yuansh před 2 roky
rodič
revize
62fa2f978c
1 změnil soubory, kde provedl 31 přidání a 18 odebrání
  1. 31 18
      src/views/activiti/form/demoForm2.vue

+ 31 - 18
src/views/activiti/form/demoForm2.vue

@@ -651,17 +651,24 @@ export default {
         //默认时间/默认当前账号
         defualtData(item){ 
                            if(item[1].label =='today'){
-                            if(item[2].label){
-                               item[0].value =moment(new Date().toLocaleDateString()).format('YYYY-MM-DD')
-                            }else{
-                                item[0].value =moment(new Date().toLocaleDateString()).format('YYYY-MM-DD HH:mm')
-                            }
+                               if(item[2].label){
+                                 item[0].value =moment(new Date().toLocaleDateString()).format('YYYY-MM-DD')
+                               }else{
+                                  item[0].value =moment(new Date().toLocaleDateString()).format('YYYY-MM-DD HH:mm')
+                               }
                                var that = this
                                setTimeout(function(){
-                               that.$refs.KFB.setData({[item[0].label]:item[0].value})   
-                                  },0)
+                                  that.$refs.KFB.setData({[item[0].label]:item[0].value})   
+                               },0)
+                                  
+                           }else if(item[1].label =='deptName'){
+                               var that = this 
+                               setTimeout(function(){
+                                  that.$refs.KFB.setData({[item[0].label]:that.$store.getters.userInfo.deptName})  
+                               },200)
+                              
                            }else if(item[1].label =='user'){
-                              this.$store.getters.userInfo
+                               // this.$store.getters.userInfo
                                var that = this
                                setTimeout(function(){
                                that.$refs.KFB.setData({[item[0].label]:that.$store.getters.userInfo.realname})  
@@ -737,17 +744,23 @@ export default {
                                   }
                                 })
                            }else if(item[1].label =='automatic'){
-                             var that = this
+                               var that = this
                                setTimeout(function(){
-                               if(that.processData.businessTable == 'incident_ticket'){ // 森语-质量事故单-自动生成事故单号
-                                if( that.processData.tableId==''|| !that.processData.tableId){
-                                   that.getAction('/sys/user/getNextNo',{name:'accidentCode'}).then(res => {
-                                        that.$refs.KFB.setData({accident_number:res})
-                                  }) 
-                                }
-                                 
-                                }
-                             },200)
+                                  if(that.processData.businessTable == 'incident_ticket'){ // 森语-质量事故单-自动生成事故单号
+                                    if( that.processData.tableId==''|| !that.processData.tableId){
+                                       that.getAction('/sys/user/getNextNo',{name:'accidentCode'}).then(res => {
+                                            that.$refs.KFB.setData({accident_number:res})
+                                      }) 
+                                    }
+                                  }else if(that.processData.businessTable == 'expense_account'){//报销单-自动生成单号
+                                    if( that.processData.tableId==''|| !that.processData.tableId){
+                                       that.getAction('/sys/user/getNextNo',{name:'BXDCode'}).then(res => {
+                                            that.$refs.KFB.setData({reimbursement_no:res})
+                                      }) 
+                                    }
+                                  }
+                              },200)
+                              
                            }
         },
         // 获取申请人信息