|
@@ -4,7 +4,7 @@
|
4
|
4
|
<el-col :span="flowDisabled ? 18 : 24" :xs="24">
|
5
|
5
|
<h2 class="text-center">借款申请</h2>
|
6
|
6
|
<el-divider></el-divider>
|
7
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="125px">
|
|
7
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
8
|
8
|
<el-row :gutter="20">
|
9
|
9
|
<el-col :span="6" :xs="24">
|
10
|
10
|
<el-form-item label="申请人" prop="user.nickName">
|
|
@@ -44,19 +44,19 @@
|
44
|
44
|
:value="item.projectId">
|
45
|
45
|
</el-option>
|
46
|
46
|
</el-select> -->
|
47
|
|
- <el-descriptions border v-if="isSelect" style="margin-top: 10px;" :column="1">
|
|
47
|
+ <el-descriptions border v-if="isSelect" style="margin-top: .125rem;" :column="1">
|
48
|
48
|
<el-descriptions-item label="项目编号" label-class-name="my-label">{{ chooseProject.projectNumber
|
49
|
|
- }}</el-descriptions-item>
|
|
49
|
+ }}</el-descriptions-item>
|
50
|
50
|
<el-descriptions-item label="项目名称" label-class-name="my-label">{{ chooseProject.projectName
|
51
|
|
- }}</el-descriptions-item>
|
|
51
|
+ }}</el-descriptions-item>
|
52
|
52
|
<el-descriptions-item label="项目负责人" label-class-name="my-label">{{ chooseProject.projectLeaderUser ?
|
53
|
|
- chooseProject.projectLeaderUser.nickName : ''
|
54
|
|
- }}</el-descriptions-item>
|
|
53
|
+ chooseProject.projectLeaderUser.nickName : ''
|
|
54
|
+ }}</el-descriptions-item>
|
55
|
55
|
<el-descriptions-item label="承担部门" label-class-name="my-label">
|
56
|
56
|
<el-tag size="small">{{ chooseProject.undertakingDeptName }}</el-tag>
|
57
|
57
|
</el-descriptions-item>
|
58
|
58
|
<el-descriptions-item label="项目类型" label-class-name="my-label">{{ chooseProject.projectType
|
59
|
|
- }}</el-descriptions-item>
|
|
59
|
+ }}</el-descriptions-item>
|
60
|
60
|
</el-descriptions>
|
61
|
61
|
</el-form-item>
|
62
|
62
|
<el-form-item label="借款明细">
|
|
@@ -111,18 +111,21 @@
|
111
|
111
|
:disabled="taskName != '借款申请'"></el-button>
|
112
|
112
|
</el-form-item>
|
113
|
113
|
<el-form-item label="预算金额" v-if="isSelect">
|
114
|
|
- <el-tag>{{ totalBudget.toFixed(2) }}</el-tag>
|
|
114
|
+ <el-tag>{{ totalBudget.toFixed(2) }}(大写:{{ formatNumberWithWan(totalBudget) }})</el-tag>
|
115
|
115
|
</el-form-item>
|
116
|
116
|
<el-form-item label="已申请借款" v-if="isSelect">
|
117
|
|
- <el-tag type="warning">{{ hasBorrow.toFixed(2) }}</el-tag>
|
|
117
|
+ <el-tag type="danger">{{ hasBorrow.toFixed(2) }}(大写:{{ formatNumberWithWan(hasBorrow) }})</el-tag>
|
118
|
118
|
</el-form-item>
|
119
|
119
|
<el-form-item label="可用借款" v-if="isSelect">
|
120
|
|
- <el-tag type="success">{{ (totalBudget - hasBorrow).toFixed(2) }}</el-tag>
|
|
120
|
+ <el-tag type="success">{{ (totalBudget - hasBorrow).toFixed(2) }}(大写:{{ formatNumberWithWan((totalBudget -
|
|
121
|
+ hasBorrow)) }})</el-tag>
|
121
|
122
|
</el-form-item>
|
122
|
123
|
<el-row :gutter="20">
|
123
|
124
|
<el-col :span="8" :xs="24">
|
124
|
125
|
<el-form-item label="申请金额" prop="applyAmount">
|
125
|
|
- <el-input v-model="form.applyAmount" placeholder="请输入申请金额" :disabled="taskName != '借款申请'" />
|
|
126
|
+ <el-input v-model="form.applyAmount" placeholder="请输入申请金额" :disabled="taskName != '借款申请'"
|
|
127
|
+ @blur="VerificationAmount" />
|
|
128
|
+ <span style="color:#E74C3C">超过预算额</span>
|
126
|
129
|
</el-form-item>
|
127
|
130
|
</el-col>
|
128
|
131
|
<el-col :span="8" :xs="24">
|
|
@@ -154,8 +157,8 @@
|
154
|
157
|
<!-- 非党工团审核 -->
|
155
|
158
|
<div v-if="form.borrowUsage == 0 || form.borrowUsage == 1">
|
156
|
159
|
<el-form-item label="部门负责人意见" prop="deptComment">
|
157
|
|
- <el-input type="textarea" v-model="form.deptComment" placeholder="请输入部门负责人意见" :disabled="taskName != '部门审核'"
|
158
|
|
- :autosize="{ minRows: 4 }" />
|
|
160
|
+ <el-input type="textarea" v-model="form.deptComment" placeholder="请输入部门负责人意见"
|
|
161
|
+ :disabled="taskName != '部门审核'" :autosize="{ minRows: 4 }" />
|
159
|
162
|
</el-form-item>
|
160
|
163
|
<el-row>
|
161
|
164
|
<el-col :span="6" :xs="24" :offset="12">
|
|
@@ -169,22 +172,6 @@
|
169
|
172
|
</el-form-item>
|
170
|
173
|
</el-col>
|
171
|
174
|
</el-row>
|
172
|
|
- <!-- <el-form-item label="项目部校核意见" prop="xmComment" v-if="form.borrowUsage == '0'">
|
173
|
|
- <el-input type="textarea" v-model="form.xmComment" placeholder="请输入项目部校核意见"
|
174
|
|
- :disabled="taskName != '项目部审核'" :autosize="{ minRows: 4 }" />
|
175
|
|
- </el-form-item>
|
176
|
|
- <el-row v-if="form.borrowUsage == '0'">
|
177
|
|
- <el-col :span="6" :xs="24" :offset="12">
|
178
|
|
- <el-form-item label="签名:" label-width="120px" v-if="showFormItem('项目部审核')">
|
179
|
|
- <span class="auditor"> {{ form.xmUser ? form.xmUser.nickName : xmUser }} </span>
|
180
|
|
- </el-form-item>
|
181
|
|
- </el-col>
|
182
|
|
- <el-col :span="6">
|
183
|
|
- <el-form-item label="日期:" label-width="120px" v-if="showFormItem('项目部审核')">
|
184
|
|
- <span> {{ form.xmTime ? form.xmTime : xmTime }} </span>
|
185
|
|
- </el-form-item>
|
186
|
|
- </el-col>
|
187
|
|
- </el-row> -->
|
188
|
175
|
<el-form-item label="分管领导审核意见" prop="managerComment">
|
189
|
176
|
<el-input type="textarea" v-model="form.managerComment" placeholder="请输入分管领导审核意见"
|
190
|
177
|
:disabled="taskName != '分管审核'" :autosize="{ minRows: 4 }" />
|
|
@@ -202,8 +189,8 @@
|
202
|
189
|
</el-col>
|
203
|
190
|
</el-row>
|
204
|
191
|
<el-form-item label="总经理审批意见" prop="zjlComment">
|
205
|
|
- <el-input type="textarea" v-model="form.zjlComment" placeholder="请输入总经理审批意见" :disabled="taskName != '总经理审核'"
|
206
|
|
- :autosize="{ minRows: 4 }" />
|
|
192
|
+ <el-input type="textarea" v-model="form.zjlComment" placeholder="请输入总经理审批意见"
|
|
193
|
+ :disabled="taskName != '总经理审核'" :autosize="{ minRows: 4 }" />
|
207
|
194
|
</el-form-item>
|
208
|
195
|
<el-row>
|
209
|
196
|
<el-col :span="6" :xs="24" :offset="12">
|
|
@@ -218,8 +205,8 @@
|
218
|
205
|
</el-col>
|
219
|
206
|
</el-row>
|
220
|
207
|
<el-form-item label="董事长批准意见" prop="dszComment">
|
221
|
|
- <el-input type="textarea" v-model="form.dszComment" placeholder="请输入董事长批准意见" :disabled="taskName != '董事长批准'"
|
222
|
|
- :autosize="{ minRows: 4 }" />
|
|
208
|
+ <el-input type="textarea" v-model="form.dszComment" placeholder="请输入董事长批准意见"
|
|
209
|
+ :disabled="taskName != '董事长批准'" :autosize="{ minRows: 4 }" />
|
223
|
210
|
</el-form-item>
|
224
|
211
|
<el-row>
|
225
|
212
|
<el-col :span="6" :xs="24" :offset="12">
|
|
@@ -281,7 +268,7 @@
|
281
|
268
|
</el-col>
|
282
|
269
|
<el-col :span="6">
|
283
|
270
|
<el-form-item label="支付日期:" prop="lendTime" v-if="showFormItem('财务处理')">
|
284
|
|
- <el-date-picker style="width:140px;" v-model="form.lendTime" value-format="yyyy-MM-dd" type="date"
|
|
271
|
+ <el-date-picker style="width:1.75rem;" v-model="form.lendTime" value-format="yyyy-MM-dd" type="date"
|
285
|
272
|
placeholder="选择日期" :disabled="taskName != '财务处理'">
|
286
|
273
|
</el-date-picker>
|
287
|
274
|
</el-form-item>
|
|
@@ -311,7 +298,7 @@
|
311
|
298
|
import { parseTime } from "@/utils/ruoyi";
|
312
|
299
|
import { getUsersDeptLeader, getUsersDeptLeaderByDept, getUsersViceDeptLeaderByDept, getUsersManageLeaderByDept } from '@/api/system/post.js'
|
313
|
300
|
import { listBorrow, getBorrow, delBorrow, addBorrow, updateBorrow } from "@/api/oa/borrow/borrow";
|
314
|
|
-import { listBorrowDetail, addBorrowDetail, updateBorrowDetail } from "@/api/oa/borrow/borrowDetail";
|
|
301
|
+import { listBorrowDetail, addBorrowDetail, updateBorrowDetail, delBorrowDetail } from "@/api/oa/borrow/borrowDetail";
|
315
|
302
|
import { listProject, getProject } from "@/api/oa/project/project";
|
316
|
303
|
import { getUserByPost } from "@/api/system/post";
|
317
|
304
|
import flow from '@/views/flowable/task/todo/detail/flow'
|
|
@@ -399,7 +386,7 @@ export default {
|
399
|
386
|
formTotal: 0,
|
400
|
387
|
flowData: {},
|
401
|
388
|
isProject: true,
|
402
|
|
- exceed: false,
|
|
389
|
+ exceed: false, //是否超预算
|
403
|
390
|
deptId: undefined,
|
404
|
391
|
dgtLabel: '工会审核意见',
|
405
|
392
|
totalBudget: 0,
|
|
@@ -415,10 +402,6 @@ export default {
|
415
|
402
|
this.managerUser = this.$store.getters.name;
|
416
|
403
|
this.managerTime = parseTime(new Date(), '{y}-{m}-{d}')
|
417
|
404
|
}
|
418
|
|
- // if (this.taskName == '项目部审核') {
|
419
|
|
- // this.xmUser = this.$store.getters.name;
|
420
|
|
- // this.xmTime = parseTime(new Date(), '{y}-{m}-{d}')
|
421
|
|
- // }
|
422
|
405
|
if (this.taskName == '总经理审核') {
|
423
|
406
|
this.zjlUser = this.$store.getters.name;
|
424
|
407
|
this.zjlTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
@@ -602,123 +585,67 @@ export default {
|
602
|
585
|
},
|
603
|
586
|
/** 提交按钮 */
|
604
|
587
|
submitForm() {
|
605
|
|
- if (this.isSelect) {
|
606
|
|
- if (this.form.applyAmount > (this.totalBudget - this.hasBorrow)) {
|
607
|
|
- this.$message.error('申请金额不允许超过可用借款!请重新填写')
|
608
|
|
- return
|
609
|
|
- }
|
610
|
|
- }
|
611
|
588
|
this.$refs["form"].validate(valid => {
|
612
|
589
|
if (valid) {
|
613
|
590
|
if (this.formTotal != 0) {
|
614
|
|
- for (let detail of this.detailList) {
|
615
|
|
- updateBorrowDetail(detail);
|
|
591
|
+ if (this.isProject) {
|
|
592
|
+ if ((this.totalBudget - this.form.applyAmount) < 0) {
|
|
593
|
+ this.exceed = true;
|
|
594
|
+ this.$set(this.taskForm.variables, "exceed", true);
|
|
595
|
+ } else {
|
|
596
|
+ this.$set(this.taskForm.variables, "exceed", false);
|
|
597
|
+ }
|
616
|
598
|
}
|
617
|
|
- updateBorrow(this.form).then(response => {
|
618
|
|
- });
|
|
599
|
+ // 更新借款明细项
|
|
600
|
+ delBorrowDetail(this.taskForm.formId).then(res => {
|
|
601
|
+ this.detailList.forEach(detail => {
|
|
602
|
+ detail.borrowId = this.taskForm.formId;
|
|
603
|
+ addBorrowDetail(detail)
|
|
604
|
+ })
|
|
605
|
+ })
|
|
606
|
+ // 更新借款审批表
|
|
607
|
+ updateBorrow(this.form);
|
619
|
608
|
const params = { taskId: this.taskForm.taskId };
|
620
|
609
|
getNextFlowNode(params).then(res => {
|
621
|
|
- if (this.taskName == '部门审核') {
|
622
|
|
- // if (this.isProject) {
|
623
|
|
- // getUsersDeptLeaderByDept({ deptId: 107 }).then(res => {
|
624
|
|
- // let userId = res.data.userId;
|
625
|
|
- // this.$set(this.taskForm.variables, "approval", userId);
|
626
|
|
- // this.$set(this.taskForm.variables, "isProject", this.isProject);
|
627
|
|
- // complete(this.taskForm).then(response => {
|
628
|
|
- // this.$modal.msgSuccess(response.msg);
|
629
|
|
- // this.$emit('goBack')
|
630
|
|
- // });
|
631
|
|
- // });
|
632
|
|
- // } else {
|
|
610
|
+ if (this.taskName == '借款申请') {
|
|
611
|
+ this.borrowAprrovalFun();
|
|
612
|
+ } else if (this.taskName == '部门审核') {
|
633
|
613
|
getUsersManageLeaderByDept({ deptId: this.form.applyDept }).then(res => {
|
634
|
|
- let userId = res.data[0].userId;
|
635
|
|
- this.$set(this.taskForm.variables, "approval", userId);
|
636
|
|
- // this.$set(this.taskForm.variables, "isProject", this.isProject);
|
637
|
|
- complete(this.taskForm).then(response => {
|
638
|
|
- this.$modal.msgSuccess(response.msg);
|
639
|
|
- this.$emit('goBack')
|
640
|
|
- });
|
|
614
|
+ let userIds = [];
|
|
615
|
+ if (res.data) {
|
|
616
|
+ res.data.forEach(item => {
|
|
617
|
+ userIds.push(item.userId)
|
|
618
|
+ })
|
|
619
|
+ }
|
|
620
|
+ this.$set(this.taskForm.variables, "approvalList", userIds);
|
|
621
|
+ this.handleComplete(this.taskForm);
|
641
|
622
|
})
|
642
|
623
|
}
|
643
|
|
-
|
644
|
|
- // }
|
645
|
|
- // else if (this.taskName == '项目部审核') {
|
646
|
|
- // getUsersManageLeaderByDept({ deptId: this.form.applyDept }).then(res => {
|
647
|
|
- // let userId = res.data[0].userId;
|
648
|
|
- // this.$set(this.taskForm.variables, "approval", userId);
|
649
|
|
- // complete(this.taskForm).then(response => {
|
650
|
|
- // this.$modal.msgSuccess(response.msg);
|
651
|
|
- // this.$emit('goBack')
|
652
|
|
- // });
|
653
|
|
- // });
|
654
|
|
- // }
|
655
|
624
|
else if (this.taskName == '分管审核') {
|
656
|
625
|
getUserByPost({ postName: '总经理' }).then(res => {
|
657
|
626
|
this.$set(this.taskForm.variables, "approval", res.data[0].userId);
|
658
|
|
- complete(this.taskForm).then(response => {
|
659
|
|
- this.$modal.msgSuccess(response.msg);
|
660
|
|
- this.$emit('goBack')
|
661
|
|
- });
|
|
627
|
+ this.handleComplete(this.taskForm);
|
662
|
628
|
})
|
663
|
629
|
}
|
664
|
630
|
else if (this.taskName == '总经理审核') {
|
665
|
|
- if (!this.exceed) {
|
666
|
|
- let approvalList = [];
|
667
|
|
- getUsersDeptLeaderByDept({ deptId: 106 }).then(res => {
|
668
|
|
- approvalList.push(res.data.userId);
|
669
|
|
- getUsersViceDeptLeaderByDept({ deptId: 106 }).then(res1 => {
|
670
|
|
- approvalList.push(res1.data.userId);
|
671
|
|
- this.$set(this.taskForm.variables, "approvalList", approvalList);
|
672
|
|
- complete(this.taskForm).then(response => {
|
673
|
|
- this.$modal.msgSuccess(response.msg);
|
674
|
|
- this.$emit('goBack')
|
675
|
|
- })
|
676
|
|
- })
|
677
|
|
- });
|
|
631
|
+ if (!this.exceed) { //没有超预算
|
|
632
|
+ this.submitFD(); //提交到财务部审核
|
678
|
633
|
}
|
679
|
634
|
else {
|
680
|
635
|
getUserByPost({ postName: '董事长' }).then(res => {
|
681
|
636
|
this.$set(this.taskForm.variables, "approval", res.data[0].userId);
|
682
|
|
- complete(this.taskForm).then(response => {
|
683
|
|
- this.$modal.msgSuccess(response.msg);
|
684
|
|
- this.$emit('goBack')
|
685
|
|
- });
|
|
637
|
+ this.handleComplete(this.taskForm);
|
686
|
638
|
})
|
687
|
639
|
}
|
688
|
640
|
}
|
689
|
641
|
else if (this.taskName == '董事长批准') {
|
690
|
|
- let approvalList = [];
|
691
|
|
- getUsersDeptLeaderByDept({ deptId: 106 }).then(res => {
|
692
|
|
- approvalList.push(res.data.userId);
|
693
|
|
- getUsersViceDeptLeaderByDept({ deptId: 106 }).then(res1 => {
|
694
|
|
- approvalList.push(res1.data.userId);
|
695
|
|
- this.$set(this.taskForm.variables, "approvalList", approvalList);
|
696
|
|
- complete(this.taskForm).then(response => {
|
697
|
|
- this.$modal.msgSuccess(response.msg);
|
698
|
|
- this.$emit('goBack')
|
699
|
|
- })
|
700
|
|
- })
|
701
|
|
- });
|
|
642
|
+ this.submitFD(); //提交到财务部审核
|
702
|
643
|
}
|
703
|
644
|
else if (this.taskName == '党工团审核') {
|
704
|
|
- let approvalList = [];
|
705
|
|
- getUsersDeptLeaderByDept({ deptId: 106 }).then(res => {
|
706
|
|
- approvalList.push(res.data.userId);
|
707
|
|
- getUsersViceDeptLeaderByDept({ deptId: 106 }).then(res1 => {
|
708
|
|
- approvalList.push(res1.data.userId);
|
709
|
|
- this.$set(this.taskForm.variables, "approvalList", approvalList);
|
710
|
|
- complete(this.taskForm).then(response => {
|
711
|
|
- this.$modal.msgSuccess(response.msg);
|
712
|
|
- this.$emit('goBack')
|
713
|
|
- })
|
714
|
|
- })
|
715
|
|
- });
|
|
645
|
+ this.submitFD(); //提交到财务部审核
|
716
|
646
|
}
|
717
|
647
|
else if (this.taskName == '财务处理') {
|
718
|
|
- complete(this.taskForm).then(response => {
|
719
|
|
- this.$modal.msgSuccess(response.msg);
|
720
|
|
- this.$emit('goBack')
|
721
|
|
- });
|
|
648
|
+ this.handleComplete(this.taskForm);
|
722
|
649
|
}
|
723
|
650
|
})
|
724
|
651
|
} else {
|
|
@@ -731,46 +658,69 @@ export default {
|
731
|
658
|
this.$modal.msgSuccess("新增成功");
|
732
|
659
|
});
|
733
|
660
|
const params = { taskId: this.taskForm.taskId };
|
|
661
|
+ // 提交到下一个流程
|
734
|
662
|
getNextFlowNode(params).then(res => {
|
735
|
|
- let userId;
|
736
|
|
- if (this.deptId == 0) {
|
737
|
|
- if (this.form.borrowUsage == 2 || this.form.borrowUsage == 3) {
|
738
|
|
- userId = this.publicData.partySecretary
|
739
|
|
- } else {
|
740
|
|
- userId = this.publicData.leagueSecretary
|
741
|
|
- }
|
742
|
|
- this.$set(this.taskForm.variables, "dept", this.deptId);
|
743
|
|
- this.$set(this.taskForm.variables, "approval", userId);
|
744
|
|
- complete(this.taskForm).then(response => {
|
745
|
|
- this.$modal.msgSuccess(response.msg);
|
746
|
|
- this.$emit('goBack')
|
747
|
|
- });
|
748
|
|
- } else {
|
749
|
|
- if (this.deptId == 105)
|
750
|
|
- getDeptLeaders({ userId: this.form.drafter }).then(res => {
|
751
|
|
- this.$set(this.taskForm.variables, "approval", res.data[1].userId);
|
752
|
|
- complete(this.taskForm).then(response => {
|
753
|
|
- this.$modal.msgSuccess(response.msg);
|
754
|
|
- this.$emit('goBack')
|
755
|
|
- });
|
756
|
|
- })
|
757
|
|
- else
|
758
|
|
- getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
|
759
|
|
- let userId = res.data.userId;
|
760
|
|
- this.$set(this.taskForm.variables, "approval", userId);
|
761
|
|
- this.$set(this.taskForm.variables, "dept", this.deptId);
|
762
|
|
- complete(this.taskForm).then(response => {
|
763
|
|
- this.$modal.msgSuccess(response.msg);
|
764
|
|
- this.$emit('goBack')
|
765
|
|
- });
|
766
|
|
- })
|
767
|
|
- }
|
|
663
|
+ this.borrowAprrovalFun();
|
768
|
664
|
|
769
|
665
|
})
|
770
|
666
|
}
|
771
|
667
|
}
|
772
|
668
|
});
|
773
|
669
|
},
|
|
670
|
+ handleComplete(taskForm) {
|
|
671
|
+ complete(taskForm).then(response => {
|
|
672
|
+ this.$modal.msgSuccess(response.msg);
|
|
673
|
+ this.$emit('goBack');
|
|
674
|
+ })
|
|
675
|
+ },
|
|
676
|
+ // 借款申请提交方法
|
|
677
|
+ borrowAprrovalFun() {
|
|
678
|
+ let userId;
|
|
679
|
+ // 如果是党工团申请 deptId == 0 为党工团申请
|
|
680
|
+ if (this.deptId == 0) {
|
|
681
|
+ // 2为工会、3为党委
|
|
682
|
+ if (this.form.borrowUsage == 2 || this.form.borrowUsage == 3) {
|
|
683
|
+ userId = this.publicData.partySecretary
|
|
684
|
+ } else {
|
|
685
|
+ userId = this.publicData.leagueSecretary
|
|
686
|
+ }
|
|
687
|
+ this.$set(this.taskForm.variables, "dept", this.deptId);
|
|
688
|
+ this.$set(this.taskForm.variables, "approval", userId);
|
|
689
|
+ this.handleComplete(this.taskForm);
|
|
690
|
+ } else if (this.deptId == 102) { //如果是经营管理层申请,走总经理审批
|
|
691
|
+ getUserByPost({ postName: '总经理' }).then(res => {
|
|
692
|
+ this.$set(this.taskForm.variables, "dept", this.deptId);
|
|
693
|
+ this.$set(this.taskForm.variables, "approval", res.data[0].userId);
|
|
694
|
+ this.handleComplete(this.taskForm);
|
|
695
|
+ })
|
|
696
|
+ } else if (this.deptId == 101) {//如果是董事会申请,走董事长批准
|
|
697
|
+ getUserByPost({ postName: '董事长' }).then(res => {
|
|
698
|
+ this.$set(this.taskForm.variables, "dept", this.deptId);
|
|
699
|
+ this.$set(this.taskForm.variables, "approval", res.data[0].userId);
|
|
700
|
+ this.handleComplete(this.taskForm);
|
|
701
|
+ })
|
|
702
|
+ }
|
|
703
|
+ else { //普通员工申请项目借款
|
|
704
|
+ getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
|
|
705
|
+ let userId = res.data.userId;
|
|
706
|
+ this.$set(this.taskForm.variables, "approval", userId);
|
|
707
|
+ this.$set(this.taskForm.variables, "dept", this.deptId);
|
|
708
|
+ this.handleComplete(this.taskForm);
|
|
709
|
+ })
|
|
710
|
+ }
|
|
711
|
+ },
|
|
712
|
+ // 提交给财务部审核
|
|
713
|
+ submitFD() {
|
|
714
|
+ let approvalList = [];
|
|
715
|
+ getUsersDeptLeaderByDept({ deptId: 106 }).then(res => {
|
|
716
|
+ approvalList.push(res.data.userId);
|
|
717
|
+ getUsersViceDeptLeaderByDept({ deptId: 106 }).then(res1 => {
|
|
718
|
+ approvalList.push(res1.data.userId);
|
|
719
|
+ this.$set(this.taskForm.variables, "approvalList", approvalList);
|
|
720
|
+ this.handleComplete(this.taskForm);
|
|
721
|
+ })
|
|
722
|
+ });
|
|
723
|
+ },
|
774
|
724
|
showFormItem(name) {
|
775
|
725
|
let isShow = false;
|
776
|
726
|
if (name == '借款申请')
|
|
@@ -820,6 +770,7 @@ export default {
|
820
|
770
|
sum = sum + Number(user[name1]);
|
821
|
771
|
}
|
822
|
772
|
this.form[name2] = sum.toFixed(2);
|
|
773
|
+ this.VerificationAmount();
|
823
|
774
|
},
|
824
|
775
|
getBorrowPath(val) {
|
825
|
776
|
let arr = val.split('/upload')
|
|
@@ -855,6 +806,24 @@ export default {
|
855
|
806
|
}
|
856
|
807
|
}
|
857
|
808
|
},
|
|
809
|
+ // 验证金额
|
|
810
|
+ VerificationAmount() {
|
|
811
|
+ if (this.isSelect) {
|
|
812
|
+ if (this.form.applyAmount > (this.totalBudget - this.hasBorrow)) {
|
|
813
|
+ this.$confirm('借款总额已经超过项目预算,将走《超预算或预算外支付(报销)》流程', '提示', {
|
|
814
|
+ confirmButtonText: '确定',
|
|
815
|
+ type: 'warning'
|
|
816
|
+ }).then(() => {
|
|
817
|
+ this.exceed = true;
|
|
818
|
+ this.$set(this.taskForm.variables, "exceed", true);
|
|
819
|
+ return
|
|
820
|
+ })
|
|
821
|
+ } else {
|
|
822
|
+ this.exceed = false;
|
|
823
|
+ this.$set(this.taskForm.variables, "exceed", false);
|
|
824
|
+ }
|
|
825
|
+ }
|
|
826
|
+ },
|
858
|
827
|
}
|
859
|
828
|
};
|
860
|
829
|
</script>
|
|
@@ -867,7 +836,7 @@ table {
|
867
|
836
|
border-collapse: collapse;
|
868
|
837
|
|
869
|
838
|
td {
|
870
|
|
- padding: 5px;
|
|
839
|
+ padding: .0625rem;
|
871
|
840
|
}
|
872
|
841
|
}
|
873
|
842
|
</style>
|