|
@@ -122,7 +122,8 @@
|
122
|
122
|
<span class="low-money">{{ siteExpenses.toFixed(2) }}</span>
|
123
|
123
|
<span class="up-money">(大写:{{ formatNumberWithWan(siteExpenses) }})</span>
|
124
|
124
|
</el-tag>
|
125
|
|
- <el-button type="primary" size="mini" @click="openBudget = true" v-hasPermi="['cmc:budget:list']">查看预算</el-button>
|
|
125
|
+ <el-button type="primary" size="mini" @click="openBudget = true"
|
|
126
|
+ v-hasPermi="['oa:budget:list']">查看预算</el-button>
|
126
|
127
|
</el-form-item>
|
127
|
128
|
<el-form-item label="已申请借款" v-if="isSelect">
|
128
|
129
|
<el-tag type="danger">
|
|
@@ -227,11 +228,11 @@
|
227
|
228
|
</el-form-item>
|
228
|
229
|
</el-col>
|
229
|
230
|
</el-row>
|
230
|
|
- <el-form-item label="董事长批准意见" prop="dszComment" label-width="150px">
|
|
231
|
+ <el-form-item label="董事长批准意见" prop="dszComment" label-width="150px" v-if="exceed && !form.cwUser">
|
231
|
232
|
<el-input type="textarea" v-model="form.dszComment" placeholder="请输入董事长批准意见"
|
232
|
233
|
:disabled="taskName != '董事长批准'" :autosize="{ minRows: 4 }" />
|
233
|
234
|
</el-form-item>
|
234
|
|
- <el-row>
|
|
235
|
+ <el-row v-if="exceed && !form.cwUser">
|
235
|
236
|
<el-col :span="6" :xs="24" :offset="12">
|
236
|
237
|
<el-form-item label="签名:" label-width="120px" v-if="showFormItem('董事长批准')">
|
237
|
238
|
<span class="auditor"> {{ form.dszUser ? form.dszUser.nickName : dszUser }} </span>
|
|
@@ -728,115 +729,123 @@ export default {
|
728
|
729
|
if (this.taskName == '借款申请') {
|
729
|
730
|
await this.VerificationAmount();
|
730
|
731
|
}
|
731
|
|
- this.$refs["form"].validate(valid => {
|
732
|
|
- if (valid) {
|
733
|
|
- if (this.form.borrowUsage == '0' && !this.form.projectId) {
|
734
|
|
- this.$message.error('请选择项目!')
|
735
|
|
- return
|
736
|
|
- }
|
737
|
|
- if (this.formTotal != 0) {
|
738
|
|
- // 更新借款明细项
|
739
|
|
- delBorrowDetail(this.taskForm.formId).then(res => {
|
740
|
|
- this.detailList.forEach(detail => {
|
741
|
|
- detail.borrowId = this.taskForm.formId;
|
742
|
|
- addBorrowDetail(detail)
|
743
|
|
- })
|
744
|
|
- })
|
745
|
|
- if (this.taskName == '部门审核') {
|
746
|
|
- this.form.deptUserId = this.$store.getters.userId;
|
747
|
|
- this.form.deptTime = parseTime(new Date(), '{y}-{m}-{d}')
|
748
|
|
- }
|
749
|
|
- if (this.taskName == '分管审核') {
|
750
|
|
- this.form.managerUserId = this.$store.getters.userId;
|
751
|
|
- this.form.managerTime = parseTime(new Date(), '{y}-{m}-{d}')
|
752
|
|
- }
|
753
|
|
- if (this.taskName == '总经理审核') {
|
754
|
|
- this.form.zjlUserId = this.$store.getters.userId;
|
755
|
|
- this.form.zjlTime = parseTime(new Date(), '{y}-{m}-{d}')
|
756
|
|
- }
|
757
|
|
- if (this.taskName == '董事长批准') {
|
758
|
|
- this.form.dszUserId = this.$store.getters.userId;
|
759
|
|
- this.form.dszTime = parseTime(new Date(), '{y}-{m}-{d}')
|
760
|
|
- }
|
761
|
|
- if (this.taskName == '党工团审核') {
|
762
|
|
- this.form.unionUserId = this.$store.getters.userId;
|
763
|
|
- this.form.unionTime = parseTime(new Date(), '{y}-{m}-{d}')
|
764
|
|
- }
|
765
|
|
- if (this.taskName == '财务处理') {
|
766
|
|
- this.form.cwUserId = this.$store.getters.userId;
|
767
|
|
- this.form.lendTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
732
|
+ let msg;
|
|
733
|
+ if(this.taskName == '财务处理'){
|
|
734
|
+ msg = '最后一个节点,提交将结束流程,是否提交?'
|
|
735
|
+ }else{
|
|
736
|
+ msg = '是否提交到下一个流程?'
|
|
737
|
+ }
|
|
738
|
+ this.$confirm(msg, '提示', {
|
|
739
|
+ confirmButtonText: '确定',
|
|
740
|
+ type: 'warning'
|
|
741
|
+ }).then(() => {
|
|
742
|
+ this.$refs["form"].validate(valid => {
|
|
743
|
+ if (valid) {
|
|
744
|
+ if (this.form.borrowUsage == '0' && !this.form.projectId) {
|
|
745
|
+ this.$message.error('请选择项目!')
|
|
746
|
+ return
|
768
|
747
|
}
|
769
|
|
- // 更新借款审批表
|
770
|
|
- updateBorrow(this.form);
|
771
|
|
- const params = { taskId: this.taskForm.taskId };
|
772
|
|
- getNextFlowNode(params).then(res => {
|
773
|
|
- if (this.taskName == '借款申请') {
|
774
|
|
- this.borrowAprrovalFun();
|
775
|
|
- } else if (this.taskName == '部门审核') {
|
776
|
|
- getUsersManageLeaderByDept({ deptId: this.form.applyDept }).then(res => {
|
777
|
|
- let userIds = [];
|
778
|
|
- if (res.data) {
|
779
|
|
- res.data.forEach(item => {
|
780
|
|
- userIds.push(item.userId)
|
781
|
|
- })
|
782
|
|
- }
|
783
|
|
- this.$set(this.taskForm.variables, "approvalList", userIds);
|
784
|
|
- this.handleComplete(this.taskForm);
|
|
748
|
+ if (this.formTotal != 0) {
|
|
749
|
+ // 更新借款明细项
|
|
750
|
+ delBorrowDetail(this.taskForm.formId).then(res => {
|
|
751
|
+ this.detailList.forEach(detail => {
|
|
752
|
+ detail.borrowId = this.taskForm.formId;
|
|
753
|
+ addBorrowDetail(detail)
|
785
|
754
|
})
|
|
755
|
+ })
|
|
756
|
+ if (this.taskName == '部门审核') {
|
|
757
|
+ this.form.deptUserId = this.$store.getters.userId;
|
|
758
|
+ this.form.deptTime = parseTime(new Date(), '{y}-{m}-{d}')
|
786
|
759
|
}
|
787
|
|
- else if (this.taskName == '分管审核') {
|
788
|
|
- getUserByPost({ postName: '总经理' }).then(res => {
|
789
|
|
- this.$set(this.taskForm.variables, "approval", res.data[0].userId);
|
790
|
|
- this.handleComplete(this.taskForm);
|
791
|
|
- })
|
|
760
|
+ if (this.taskName == '分管审核') {
|
|
761
|
+ this.form.managerUserId = this.$store.getters.userId;
|
|
762
|
+ this.form.managerTime = parseTime(new Date(), '{y}-{m}-{d}')
|
792
|
763
|
}
|
793
|
|
- else if (this.taskName == '总经理审核') {
|
794
|
|
- this.exceed = false; //待删
|
795
|
|
- this.$set(this.taskForm.variables, "exceed", this.exceed);
|
796
|
|
- if (!this.exceed) { //没有超预算
|
797
|
|
- this.submitFD(); //提交到财务部审核
|
|
764
|
+ if (this.taskName == '总经理审核') {
|
|
765
|
+ this.form.zjlUserId = this.$store.getters.userId;
|
|
766
|
+ this.form.zjlTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
767
|
+ }
|
|
768
|
+ if (this.taskName == '董事长批准') {
|
|
769
|
+ this.form.dszUserId = this.$store.getters.userId;
|
|
770
|
+ this.form.dszTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
771
|
+ }
|
|
772
|
+ if (this.taskName == '党工团审核') {
|
|
773
|
+ this.form.unionUserId = this.$store.getters.userId;
|
|
774
|
+ this.form.unionTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
775
|
+ }
|
|
776
|
+ if (this.taskName == '财务处理') {
|
|
777
|
+ this.form.cwUserId = this.$store.getters.userId;
|
|
778
|
+ this.form.lendTime = parseTime(new Date(), '{y}-{m}-{d}')
|
|
779
|
+ }
|
|
780
|
+ // 更新借款审批表
|
|
781
|
+ updateBorrow(this.form);
|
|
782
|
+ const params = { taskId: this.taskForm.taskId };
|
|
783
|
+ getNextFlowNode(params).then(res => {
|
|
784
|
+ if (this.taskName == '借款申请') {
|
|
785
|
+ this.borrowAprrovalFun();
|
|
786
|
+ } else if (this.taskName == '部门审核') {
|
|
787
|
+ getUsersManageLeaderByDept({ deptId: this.form.applyDept }).then(res => {
|
|
788
|
+ let userIds = [];
|
|
789
|
+ if (res.data) {
|
|
790
|
+ res.data.forEach(item => {
|
|
791
|
+ userIds.push(item.userId)
|
|
792
|
+ })
|
|
793
|
+ }
|
|
794
|
+ this.$set(this.taskForm.variables, "approvalList", userIds);
|
|
795
|
+ this.handleComplete(this.taskForm);
|
|
796
|
+ })
|
798
|
797
|
}
|
799
|
|
- else {
|
800
|
|
- getUserByPost({ postName: '董事长' }).then(res => {
|
|
798
|
+ else if (this.taskName == '分管审核') {
|
|
799
|
+ getUserByPost({ postName: '总经理' }).then(res => {
|
801
|
800
|
this.$set(this.taskForm.variables, "approval", res.data[0].userId);
|
802
|
801
|
this.handleComplete(this.taskForm);
|
803
|
802
|
})
|
804
|
803
|
}
|
805
|
|
- }
|
806
|
|
- else if (this.taskName == '董事长批准') {
|
807
|
|
- this.submitFD(); //提交到财务部审核
|
808
|
|
- }
|
809
|
|
- else if (this.taskName == '党工团审核') {
|
810
|
|
- this.submitFD(); //提交到财务部审核
|
811
|
|
- }
|
812
|
|
- else if (this.taskName == '财务处理') {
|
813
|
|
- this.$modal.confirm('最后一个节点,提交将结束流程,是否提交?').then(res => {
|
|
804
|
+ else if (this.taskName == '总经理审核') {
|
|
805
|
+ // this.exceed = false; //待删
|
|
806
|
+ this.$set(this.taskForm.variables, "exceed", this.exceed);
|
|
807
|
+ if (!this.exceed) { //没有超预算
|
|
808
|
+ this.submitFD(); //提交到财务部审核
|
|
809
|
+ }
|
|
810
|
+ else {
|
|
811
|
+ getUserByPost({ postName: '董事长' }).then(res => {
|
|
812
|
+ this.$set(this.taskForm.variables, "approval", res.data[0].userId);
|
|
813
|
+ this.handleComplete(this.taskForm);
|
|
814
|
+ })
|
|
815
|
+ }
|
|
816
|
+ }
|
|
817
|
+ else if (this.taskName == '董事长批准') {
|
|
818
|
+ this.submitFD(); //提交到财务部审核
|
|
819
|
+ }
|
|
820
|
+ else if (this.taskName == '党工团审核') {
|
|
821
|
+ this.submitFD(); //提交到财务部审核
|
|
822
|
+ }
|
|
823
|
+ else if (this.taskName == '财务处理') {
|
814
|
824
|
this.handleComplete(this.taskForm);
|
815
|
|
- })
|
816
|
|
- }
|
817
|
|
- })
|
|
825
|
+ }
|
|
826
|
+ })
|
|
827
|
+ } else {
|
|
828
|
+ delBorrowDetail(this.taskForm.formId).then(() => {
|
|
829
|
+ for (let detail of this.detailList) {
|
|
830
|
+ detail.borrowId = this.taskForm.formId;
|
|
831
|
+ addBorrowDetail(detail);
|
|
832
|
+ }
|
|
833
|
+ })
|
|
834
|
+ this.form.borrowId = this.taskForm.formId;
|
|
835
|
+ addBorrow(this.form).then(response => {
|
|
836
|
+ this.$modal.msgSuccess("新增成功");
|
|
837
|
+ });
|
|
838
|
+ const params = { taskId: this.taskForm.taskId };
|
|
839
|
+ // 提交到下一个流程
|
|
840
|
+ getNextFlowNode(params).then(res => {
|
|
841
|
+ this.borrowAprrovalFun();
|
|
842
|
+ })
|
|
843
|
+ }
|
818
|
844
|
} else {
|
819
|
|
- delBorrowDetail(this.taskForm.formId).then(() => {
|
820
|
|
- for (let detail of this.detailList) {
|
821
|
|
- detail.borrowId = this.taskForm.formId;
|
822
|
|
- addBorrowDetail(detail);
|
823
|
|
- }
|
824
|
|
- })
|
825
|
|
- this.form.borrowId = this.taskForm.formId;
|
826
|
|
- addBorrow(this.form).then(response => {
|
827
|
|
- this.$modal.msgSuccess("新增成功");
|
828
|
|
- });
|
829
|
|
- const params = { taskId: this.taskForm.taskId };
|
830
|
|
- // 提交到下一个流程
|
831
|
|
- getNextFlowNode(params).then(res => {
|
832
|
|
- this.borrowAprrovalFun();
|
833
|
|
- })
|
|
845
|
+ this.$message.error('请完善必填项')
|
834
|
846
|
}
|
835
|
|
- } else {
|
836
|
|
- this.$message.error('请完善必填项')
|
837
|
|
- }
|
838
|
|
- });
|
839
|
|
-
|
|
847
|
+ });
|
|
848
|
+ })
|
840
|
849
|
},
|
841
|
850
|
handleComplete(taskForm) {
|
842
|
851
|
complete(taskForm).then(response => {
|
|
@@ -985,7 +994,7 @@ export default {
|
985
|
994
|
VerificationAmount() {
|
986
|
995
|
if (this.isSelect) {
|
987
|
996
|
if (this.form.applyAmount > (this.siteExpenses - this.hasBorrow)) {
|
988
|
|
- return this.$confirm('借款总额已经超过项目预算,将走《超预算或预算外支付(报销)》流程', '提示', {
|
|
997
|
+ return this.$confirm('借款总额已经超过项目预算,将走《超预算或预算外支付(报销)》流程,即需要董事长批准,才可到财务。', '提示', {
|
989
|
998
|
confirmButtonText: '确定',
|
990
|
999
|
type: 'warning'
|
991
|
1000
|
}).then(() => {
|