|
@@ -58,6 +58,13 @@
|
|
|
@click="showExpense"
|
|
@click="showExpense"
|
|
|
>资金使用申请单</el-button
|
|
>资金使用申请单</el-button
|
|
|
>
|
|
>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ @click="expendDataup"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ :disabled="!this.expentList.length"
|
|
|
|
|
+ >批量导出</el-button
|
|
|
|
|
+ >
|
|
|
<!-- 表格 -->
|
|
<!-- 表格 -->
|
|
|
<kt-common-table
|
|
<kt-common-table
|
|
|
:operationWidth="operationWidth"
|
|
:operationWidth="operationWidth"
|
|
@@ -69,11 +76,13 @@
|
|
|
editButtonName="编辑"
|
|
editButtonName="编辑"
|
|
|
button1Name="删除"
|
|
button1Name="删除"
|
|
|
:showBatchDelete="false"
|
|
:showBatchDelete="false"
|
|
|
|
|
+ :showBatchPrint="true"
|
|
|
:showOperation="true"
|
|
:showOperation="true"
|
|
|
@findPage="findPage"
|
|
@findPage="findPage"
|
|
|
:isshowpagination="true"
|
|
:isshowpagination="true"
|
|
|
@handleEdit="expendEdit"
|
|
@handleEdit="expendEdit"
|
|
|
@handleButton1="expendDelete"
|
|
@handleButton1="expendDelete"
|
|
|
|
|
+ @selectionChange="selectionChange"
|
|
|
></kt-common-table>
|
|
></kt-common-table>
|
|
|
<!-- 申请资金弹框 -->
|
|
<!-- 申请资金弹框 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
@@ -170,7 +179,7 @@
|
|
|
<el-form-item label="资金用途" prop="fundUse">
|
|
<el-form-item label="资金用途" prop="fundUse">
|
|
|
<el-cascader
|
|
<el-cascader
|
|
|
v-model="tableForm.fundUse"
|
|
v-model="tableForm.fundUse"
|
|
|
- :show-all-levels="false"
|
|
|
|
|
|
|
+ :show-all-levels="true"
|
|
|
:clearable="true"
|
|
:clearable="true"
|
|
|
:checkStrictly="true"
|
|
:checkStrictly="true"
|
|
|
:emitPath="false"
|
|
:emitPath="false"
|
|
@@ -270,27 +279,27 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
|
|
|
|
+ <el-row style="margin-bottom: 20px">
|
|
|
|
|
+ <el-col :span="12" style="text-align: center"
|
|
|
|
|
+ ><h3>收入方资金归属(%)</h3>
|
|
|
|
|
+ <span>(请输入资金归属百分比)</span></el-col
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-col :span="12" style="text-align: center"
|
|
|
|
|
+ ><h3>支出方资金归属(%)</h3>
|
|
|
|
|
+ <span>(请输入资金归属百分比)</span></el-col
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row class="profit_box">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="收入方资金归属" prop="entProfit">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="profitObj.entProfitName"
|
|
|
|
|
- filterable
|
|
|
|
|
- @change="profitChange($event, 1)"
|
|
|
|
|
- placeholder=""
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, index) in affiliationData"
|
|
|
|
|
- :key="item.profitId + 'ent' + index"
|
|
|
|
|
- :label="item.profitName"
|
|
|
|
|
- :value="item.profitEng"
|
|
|
|
|
- >
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-for="item in affiliationData"
|
|
|
|
|
+ :key="item.profitId + 'sr'"
|
|
|
|
|
+ :label="item.profitName"
|
|
|
|
|
+ prop="entProfit"
|
|
|
|
|
+ >
|
|
|
<el-input-number
|
|
<el-input-number
|
|
|
- v-model="profitObj.entProfitValue"
|
|
|
|
|
|
|
+ v-model="item.profit"
|
|
|
:min="0"
|
|
:min="0"
|
|
|
- @blur="profitBlur($event, 1)"
|
|
|
|
|
placeholder="请输入利润(%)"
|
|
placeholder="请输入利润(%)"
|
|
|
:max="100"
|
|
:max="100"
|
|
|
label=""
|
|
label=""
|
|
@@ -298,25 +307,15 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="支出方资金归属" prop="outFlag">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="profitObj.outProfitName"
|
|
|
|
|
- filterable
|
|
|
|
|
- @change="profitChange($event, 2)"
|
|
|
|
|
- placeholder=""
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, index) in affiliationData"
|
|
|
|
|
- :key="item.profitId + 'out' + index"
|
|
|
|
|
- :label="item.profitName"
|
|
|
|
|
- :value="item.profitEng"
|
|
|
|
|
- >
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-for="item in affiliationData2"
|
|
|
|
|
+ :key="item.profitId + 'zc'"
|
|
|
|
|
+ :label="item.profitName"
|
|
|
|
|
+ prop="entProfit"
|
|
|
|
|
+ >
|
|
|
<el-input-number
|
|
<el-input-number
|
|
|
- v-model="profitObj.outProfitValue"
|
|
|
|
|
|
|
+ v-model="item.profit"
|
|
|
:min="0"
|
|
:min="0"
|
|
|
- @blur="profitBlur($event, 2)"
|
|
|
|
|
placeholder="请输入利润(%)"
|
|
placeholder="请输入利润(%)"
|
|
|
:max="100"
|
|
:max="100"
|
|
|
label=""
|
|
label=""
|
|
@@ -328,13 +327,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="resetForm" size="small">取 消</el-button>
|
|
<el-button @click="resetForm" size="small">取 消</el-button>
|
|
|
- <el-button
|
|
|
|
|
- v-if="expendDataId"
|
|
|
|
|
- @click="expendDataup"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- size="small"
|
|
|
|
|
- >导 出</el-button
|
|
|
|
|
- >
|
|
|
|
|
<el-button type="primary" @click="submitForm" size="small">{{
|
|
<el-button type="primary" @click="submitForm" size="small">{{
|
|
|
buttonValue
|
|
buttonValue
|
|
|
}}</el-button>
|
|
}}</el-button>
|
|
@@ -382,6 +374,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
|
|
|
+ expentList: [], //批量导出数据
|
|
|
expenseaaa: true,
|
|
expenseaaa: true,
|
|
|
expendTitle: "新增资金使用申请单", //弹框标题
|
|
expendTitle: "新增资金使用申请单", //弹框标题
|
|
|
operationWidth: 200, //操作单元格宽度
|
|
operationWidth: 200, //操作单元格宽度
|
|
@@ -534,6 +527,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
payment_methodsData: [], //支付方式字典数据
|
|
payment_methodsData: [], //支付方式字典数据
|
|
|
affiliationData: [], //归属字典数据
|
|
affiliationData: [], //归属字典数据
|
|
|
|
|
+ affiliationData2: [], //归属字典数据
|
|
|
collectionData: [], //收款单位信息数据
|
|
collectionData: [], //收款单位信息数据
|
|
|
innerCollectionData: [], //内部账户单位信息数据
|
|
innerCollectionData: [], //内部账户单位信息数据
|
|
|
account_qualityData: [], //账户性质字典
|
|
account_qualityData: [], //账户性质字典
|
|
@@ -629,6 +623,12 @@ export default {
|
|
|
this.tableForm.payMethod = [
|
|
this.tableForm.payMethod = [
|
|
|
this.payment_methodsData.find((item) => item.value == 2).label,
|
|
this.payment_methodsData.find((item) => item.value == 2).label,
|
|
|
];
|
|
];
|
|
|
|
|
+ this.affiliationData.forEach((item) => {
|
|
|
|
|
+ item.profit = 0;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.affiliationData2.forEach((item) => {
|
|
|
|
|
+ item.profit = 0;
|
|
|
|
|
+ });
|
|
|
this.expendDataId = "";
|
|
this.expendDataId = "";
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -643,84 +643,49 @@ export default {
|
|
|
},
|
|
},
|
|
|
mounted() {},
|
|
mounted() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
- //收入资金归属change事件
|
|
|
|
|
- profitChange(e, num) {
|
|
|
|
|
- if (num == 1) {
|
|
|
|
|
- //收入
|
|
|
|
|
- this.profitObj.entProfitName = e;
|
|
|
|
|
- this.tableForm.entProfit = {
|
|
|
|
|
- [this.profitObj.entProfitName]: this.profitObj.entProfitValue,
|
|
|
|
|
- };
|
|
|
|
|
- } else {
|
|
|
|
|
- //支出
|
|
|
|
|
- this.profitObj.outProfitName = e;
|
|
|
|
|
- this.tableForm.outProfit = {
|
|
|
|
|
- [this.profitObj.outProfitName]: this.profitObj.outProfitValue,
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- //收入资金归属利润事件
|
|
|
|
|
- profitBlur(e, num) {
|
|
|
|
|
- this.tableForm.entProfit = {
|
|
|
|
|
- [this.profitObj.entProfitName]: this.profitObj.entProfitValue,
|
|
|
|
|
- };
|
|
|
|
|
- this.tableForm.outProfit = {
|
|
|
|
|
- [this.profitObj.outProfitName]: this.profitObj.outProfitValue,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ //表格多选事件
|
|
|
|
|
+ selectionChange(e) {
|
|
|
|
|
+ this.expentList = e.selections.map((item) => item.excelAccountOperateId);
|
|
|
},
|
|
},
|
|
|
//获取归属数据
|
|
//获取归属数据
|
|
|
getAffiliationData() {
|
|
getAffiliationData() {
|
|
|
this.$api.expense.getList().then((res) => {
|
|
this.$api.expense.getList().then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
- this.affiliationData = res.data;
|
|
|
|
|
- res.data.forEach((item) => {
|
|
|
|
|
- this.columns.push({
|
|
|
|
|
- prop: item.profitEng,
|
|
|
|
|
- label: item.profitName,
|
|
|
|
|
- minWidth: 60,
|
|
|
|
|
- sortable: false,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ res.data.map((item) => {
|
|
|
|
|
+ item.profit = 0;
|
|
|
|
|
+ return item;
|
|
|
});
|
|
});
|
|
|
|
|
+ this.affiliationData = JSON.parse(JSON.stringify(res.data));
|
|
|
|
|
+ this.affiliationData2 = JSON.parse(JSON.stringify(res.data));
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
//导出
|
|
//导出
|
|
|
- expendDataup(idList) {
|
|
|
|
|
- if (this.expendDataId) {
|
|
|
|
|
- //编辑查看直接导出
|
|
|
|
|
- let url = process.env.BASE_URL + "/upload/" + this.tableForm.uplodePath; // 3.创建一个临时的url指向blob对象
|
|
|
|
|
- // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
|
|
|
|
|
- let a = document.createElement("a");
|
|
|
|
|
- a.href = url;
|
|
|
|
|
- a.download = "资金使用申请单.xlsx";
|
|
|
|
|
- a.click();
|
|
|
|
|
- // 5.释放这个临时的对象url
|
|
|
|
|
- window.URL.revokeObjectURL(url);
|
|
|
|
|
- this.resetForm();
|
|
|
|
|
- this.findPage();
|
|
|
|
|
- } else {
|
|
|
|
|
- //新增并导出
|
|
|
|
|
- this.$api.expense.excel(idList).then((response) => {
|
|
|
|
|
- if (response.code == 200) {
|
|
|
|
|
- response.data.forEach((data) => {
|
|
|
|
|
- this.resetForm();
|
|
|
|
|
- this.findPage();
|
|
|
|
|
- let url = process.env.BASE_URL + "/upload/" + data.uplodePath; // 3.创建一个临时的url指向blob对象
|
|
|
|
|
- // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
|
|
|
|
|
- let a = document.createElement("a");
|
|
|
|
|
- a.href = url;
|
|
|
|
|
- a.download = "资金使用申请单.xlsx";
|
|
|
|
|
- a.click();
|
|
|
|
|
- // 5.释放这个临时的对象url
|
|
|
|
|
- window.URL.revokeObjectURL(url);
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error(response.msg);
|
|
|
|
|
|
|
+ expendDataup(e, idList) {
|
|
|
|
|
+ idList = idList || this.expentList;
|
|
|
|
|
+ this.$api.expense.excel(idList).then((response) => {
|
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
|
+ if (response.data == null) {
|
|
|
|
|
+ this.$message.error("暂无导出数据,请重试!");
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let url = process.env.BASE_URL + "/upload/" + response.data; // 3.创建一个临时的url指向blob对象
|
|
|
|
|
+ // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
|
|
|
|
|
+ let a = document.createElement("a");
|
|
|
|
|
+ a.href = url;
|
|
|
|
|
+ a.click();
|
|
|
|
|
+ // 5.释放这个临时的对象url
|
|
|
|
|
+ window.URL.revokeObjectURL(url);
|
|
|
|
|
+ document.body.removeChild(a); //移除a标签
|
|
|
|
|
+ this.resetForm();
|
|
|
|
|
+ this.findPage();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(response.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
//点击编辑按钮
|
|
//点击编辑按钮
|
|
|
expendEdit(index) {
|
|
expendEdit(index) {
|
|
@@ -742,14 +707,22 @@ export default {
|
|
|
this.tableForm.fundUse,
|
|
this.tableForm.fundUse,
|
|
|
this.tableForm.fundFen,
|
|
this.tableForm.fundFen,
|
|
|
];
|
|
];
|
|
|
|
|
+ //转换资金归属
|
|
|
for (let key in res.data.outProfit) {
|
|
for (let key in res.data.outProfit) {
|
|
|
- this.profitObj.outProfitName = key;
|
|
|
|
|
- this.profitObj.outProfitValue = res.data.outProfit[key];
|
|
|
|
|
|
|
+ this.affiliationData2.forEach((item) => {
|
|
|
|
|
+ if (item.profitEng == key) {
|
|
|
|
|
+ item.profit = res.data.outProfit[key];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
for (let key in res.data.entProfit) {
|
|
for (let key in res.data.entProfit) {
|
|
|
- this.profitObj.entProfitName = key;
|
|
|
|
|
- this.profitObj.entProfitValue = res.data.entProfit[key];
|
|
|
|
|
|
|
+ this.affiliationData.forEach((item) => {
|
|
|
|
|
+ if (item.profitEng == key) {
|
|
|
|
|
+ item.profit = res.data.entProfit[key];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+ //转换资金归属
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
}
|
|
@@ -819,12 +792,6 @@ export default {
|
|
|
.getAccountExcel(obj)
|
|
.getAccountExcel(obj)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
res.data.records.forEach((element) => {
|
|
res.data.records.forEach((element) => {
|
|
|
- for (let key in element.outProfit) {
|
|
|
|
|
- element[key] = element.outProfit[key];
|
|
|
|
|
- }
|
|
|
|
|
- for (let key in element.entProfit) {
|
|
|
|
|
- element[key] = element.entProfit[key];
|
|
|
|
|
- }
|
|
|
|
|
element.transferFlagName =
|
|
element.transferFlagName =
|
|
|
element.transferFlag == 0 ? "已转账" : "未转账";
|
|
element.transferFlag == 0 ? "已转账" : "未转账";
|
|
|
});
|
|
});
|
|
@@ -994,7 +961,7 @@ export default {
|
|
|
//费用申请弹框
|
|
//费用申请弹框
|
|
|
showExpense() {
|
|
showExpense() {
|
|
|
this.expendTitle = "新增资金使用申请单";
|
|
this.expendTitle = "新增资金使用申请单";
|
|
|
- this.buttonValue = "导 出";
|
|
|
|
|
|
|
+ this.buttonValue = "提 交";
|
|
|
this.expenseDialog = true;
|
|
this.expenseDialog = true;
|
|
|
},
|
|
},
|
|
|
//取消隐藏弹框
|
|
//取消隐藏弹框
|
|
@@ -1004,10 +971,6 @@ export default {
|
|
|
//导出事件
|
|
//导出事件
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
let params = JSON.parse(JSON.stringify(this.tableForm));
|
|
let params = JSON.parse(JSON.stringify(this.tableForm));
|
|
|
- if( !this.profitObj.entProfitName||!this.profitObj.outProfitName){
|
|
|
|
|
- this.$message.error('请选择资金归属!');
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
this.$refs.tableForm.validate((valid) => {
|
|
this.$refs.tableForm.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
params.payMethod = this.toPayment(params.payMethod); //支付方式转换
|
|
params.payMethod = this.toPayment(params.payMethod); //支付方式转换
|
|
@@ -1027,6 +990,16 @@ export default {
|
|
|
params.fundFen =
|
|
params.fundFen =
|
|
|
this.tableForm.fundUse[this.tableForm.fundUse.length - 1]; //资金用途分项
|
|
this.tableForm.fundUse[this.tableForm.fundUse.length - 1]; //资金用途分项
|
|
|
params.fundFlow = params.company + "→" + params.collectionMessage; //资金流程
|
|
params.fundFlow = params.company + "→" + params.collectionMessage; //资金流程
|
|
|
|
|
+ //转化资金归属
|
|
|
|
|
+ params.entProfit = {};
|
|
|
|
|
+ params.outProfit = {};
|
|
|
|
|
+ this.affiliationData.forEach((item) => {
|
|
|
|
|
+ params.entProfit[item.profitEng] = item.profit;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.affiliationData2.forEach((item) => {
|
|
|
|
|
+ params.outProfit[item.profitEng] = item.profit;
|
|
|
|
|
+ });
|
|
|
|
|
+ //转化资金归属
|
|
|
if (this.expendDataId) {
|
|
if (this.expendDataId) {
|
|
|
//修改
|
|
//修改
|
|
|
params.expendDataId = this.expendDataId;
|
|
params.expendDataId = this.expendDataId;
|
|
@@ -1042,7 +1015,8 @@ export default {
|
|
|
//新增+导出
|
|
//新增+导出
|
|
|
this.$api.expense.insert(params).then((res) => {
|
|
this.$api.expense.insert(params).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
- this.expendDataup([res.data]);
|
|
|
|
|
|
|
+ this.resetForm();
|
|
|
|
|
+ this.findPage();
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
}
|
|
@@ -1177,4 +1151,8 @@ export default {
|
|
|
.table_btnbox {
|
|
.table_btnbox {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
}
|
|
}
|
|
|
|
|
+.dialog-body {
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ height: 500px;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|