|
|
@@ -136,7 +136,7 @@
|
|
136
|
136
|
</td>
|
|
137
|
137
|
<td v-if="form.borrowUsage == 0 || form.borrowUsage == 1">
|
|
138
|
138
|
<el-input v-model="detail.managerAmount" :disabled="taskName != '分管审核' && taskName != '总经理审核'"
|
|
139
|
|
- @blur="calculateManagerAmount(detail)"></el-input>
|
|
|
139
|
+ @input="calculateManagerAmount"></el-input>
|
|
140
|
140
|
</td>
|
|
141
|
141
|
<td>
|
|
142
|
142
|
<el-button type="text" style="color: #F56C6C;" icon="el-icon-delete" size="mini"
|
|
|
@@ -654,11 +654,6 @@ export default {
|
|
654
|
654
|
}
|
|
655
|
655
|
},
|
|
656
|
656
|
initForm() {
|
|
657
|
|
- listBorrowDetail({ pageSize: 999, borrowId: this.taskForm.formId }).then(res => {
|
|
658
|
|
- if (res.rows.length != 0) {
|
|
659
|
|
- this.detailList = res.rows
|
|
660
|
|
- }
|
|
661
|
|
- });
|
|
662
|
657
|
listBorrowDetail({ pageSize: 9999 }).then(res => {
|
|
663
|
658
|
let oArray = res.rows.map(item => item.borrowItem).filter(item => item != null);
|
|
664
|
659
|
let originalArray = [...new Set(oArray)]
|
|
|
@@ -667,20 +662,27 @@ export default {
|
|
667
|
662
|
label: item, // 转大写
|
|
668
|
663
|
}));
|
|
669
|
664
|
})
|
|
670
|
|
- getBorrow(this.taskForm.formId).then(res => {
|
|
671
|
|
- if (this.isEmptyObject(res.data)) {
|
|
|
665
|
+ Promise.all([
|
|
|
666
|
+ listBorrowDetail({ pageSize: 999, borrowId: this.taskForm.formId }),
|
|
|
667
|
+ getBorrow(this.taskForm.formId)
|
|
|
668
|
+ ]).then(([detailRes, borrowRes]) => {
|
|
|
669
|
+ if (detailRes.rows.length != 0) {
|
|
|
670
|
+ this.detailList = detailRes.rows
|
|
|
671
|
+ }
|
|
|
672
|
+ if (this.isEmptyObject(borrowRes.data)) {
|
|
672
|
673
|
this.formTotal = 0;
|
|
673
|
674
|
this.form.applier = this.$store.getters.userId;
|
|
674
|
675
|
}
|
|
675
|
676
|
else {
|
|
676
|
677
|
this.formTotal = 1;
|
|
677
|
|
- this.form = res.data;
|
|
|
678
|
+ this.form = borrowRes.data;
|
|
678
|
679
|
if (this.form.applyDept == 104) //董事长分管的综合事务部,跳过分管审批
|
|
679
|
680
|
this.need = false;
|
|
680
|
681
|
this.hanldeChangeType();
|
|
681
|
|
- this.handleSelectProject(res.data.projectId)
|
|
|
682
|
+ this.handleSelectProject(borrowRes.data.projectId)
|
|
682
|
683
|
this.getBudgetSettle()
|
|
683
|
684
|
}
|
|
|
685
|
+ this.initManagerReviewAmount();
|
|
684
|
686
|
this.loading = false;
|
|
685
|
687
|
})
|
|
686
|
688
|
|
|
|
@@ -1074,9 +1076,19 @@ export default {
|
|
1074
|
1076
|
calculateXmAmount(detail) {
|
|
1075
|
1077
|
this.getTotal("xmAmount", "managerAmount", this.detailList);
|
|
1076
|
1078
|
},
|
|
1077
|
|
- calculateManagerAmount(detail) {
|
|
|
1079
|
+ calculateManagerAmount() {
|
|
1078
|
1080
|
this.getTotal("managerAmount", "managerAmount", this.detailList);
|
|
1079
|
1081
|
},
|
|
|
1082
|
+ initManagerReviewAmount() {
|
|
|
1083
|
+ if (this.taskName !== '分管审核') return;
|
|
|
1084
|
+ if (this.form.borrowUsage != '0' && this.form.borrowUsage != '1') return;
|
|
|
1085
|
+ this.detailList.forEach(detail => {
|
|
|
1086
|
+ if (detail.managerAmount === '' || detail.managerAmount === null || detail.managerAmount === undefined) {
|
|
|
1087
|
+ this.$set(detail, 'managerAmount', detail.applyAmount);
|
|
|
1088
|
+ }
|
|
|
1089
|
+ });
|
|
|
1090
|
+ this.getTotal('managerAmount', 'managerAmount', this.detailList);
|
|
|
1091
|
+ },
|
|
1080
|
1092
|
getTotal(name1, name2, list) {
|
|
1081
|
1093
|
let sum = 0;
|
|
1082
|
1094
|
for (let user of list) {
|