Browse Source

技能博物馆-----部门预算

jbb 2 years ago
parent
commit
701a84355f
1 changed files with 22 additions and 1 deletions
  1. 22 1
      src/views/activiti/form/demoForm2.vue

+ 22 - 1
src/views/activiti/form/demoForm2.vue

@@ -171,6 +171,7 @@ export default {
         if (!this.processData.businessTable) {
             this.processData.businessTable = this.processData.tableName
         }
+        // debugger
         this.getAction('/tbTableInfo/query', {
             businessTable: this.processData.businessTable,
             taskNodeId: this.processData.key,
@@ -724,7 +725,27 @@ export default {
                   }
               })
         }
-           
+        //技能博物馆 ----部门专项预算      
+        if(key == 'department' && this.processData.businessTable == 'bwg_department_budget'){
+            //预算年份未选择
+            var year = this.$refs.KFB.form.getFieldValue('budget_year')
+            if(year == '' || !year){
+                var that =this
+                that.$message.error('请先选择报销年份');
+                setTimeout(function(){
+                     that.$refs.KFB.setData({department:' '}) 
+                },0)     
+            }else{ //已选择年份  获取预算金额
+                this.getAction('/oa/budget/getSelectionList',{year:year,budgetType:'部门预算',dept:value}).then(res => {
+                           if (res.success) {
+                               var money = res.result[0].amount
+                               this.$refs.KFB.setData({budget_sum:money}) 
+                            } else {
+                                 this.$message.error(res.message)
+                             }
+                        })
+            }
+        }
                  
             //改变的表单是主子表类型时
             if((value instanceof Array) && (key.indexOf('child&')!==-1)){