Browse Source

森语-员工请假单-请假类型显示数字

jbb 2 năm trước cách đây
mục cha
commit
dd582e09c5
1 tập tin đã thay đổi với 11 bổ sung10 xóa
  1. 11 10
      src/views/activiti/form/demoForm2.vue

+ 11 - 10
src/views/activiti/form/demoForm2.vue

@@ -691,10 +691,10 @@ export default {
                       var time2 = that.$refs.KFB.form.getFieldValue('end_date')
                       var timeC=that.timeDifference(time1,time2,'min') //获取时间差
                       //事假,超过180分钟,年假大于0.5
-                      if(category == 1 &&timeC>=180&&that.leave>=0.5){
+                      if(category == '事假' &&timeC>=180&&that.leave>=0.5){
                           that.$refs.KFB.setData({unit:'2'})
-                          that.$refs.KFB.setData({leave_category:'2'})
-                        }else if(category == 2 && that.leave<0.5){   //类型为年假,剩余年假小于0.5
+                          that.$refs.KFB.setData({leave_category:'年假'})
+                        }else if(category == '年假' && that.leave<0.5){   //类型为年假,剩余年假小于0.5
                              that.$refs.KFB.setData({unit:'1'}) 
                              that.$refs.KFB.setData({leave_category:''})
                              that.$message.error('剩余年假不足!');
@@ -708,23 +708,23 @@ export default {
             }
              //请假类型与单位
             //事假
-            if(key == 'leave_category' && value == '1'){
+            if(key == 'leave_category' && value == '事假'){
                 setTimeout(function(){
                 var time1 = that.$refs.KFB.form.getFieldValue('start_date')
                 var time2 = that.$refs.KFB.form.getFieldValue('end_date')
                 var timeC=that.timeDifference(time1,time2,'min') //获取时间差
                 if(timeC>=180 && that.leave>=0.5){ //事假,时间差大于180,剩余年假大于0.5
                     that.$refs.KFB.setData({unit:'2'})
-                    that.$refs.KFB.setData({leave_category:'2'})
+                    that.$refs.KFB.setData({leave_category:'年假'})
                 }else{
                     that.$refs.KFB.setData({unit:'1'})   
                 }
                 },0)
-            }else if(key == 'leave_category' && value == '3'){  //病假
+            }else if(key == 'leave_category' && value == '病假'){  //病假
                 setTimeout(function(){
                  that.$refs.KFB.setData({unit:'1'})   
                 },0)
-            }else if(key == 'leave_category' && value == '2'){//年假
+            }else if(key == 'leave_category' && value == '年假'){//年假
                  setTimeout(function(){
                     if(that.leave >=0.5){  //剩余年假大于0.5
                         that.$refs.KFB.setData({unit:'2'})  
@@ -738,6 +738,7 @@ export default {
 
             }else if(key == 'leave_category'){
                 setTimeout(function(){
+                    debugger
                     that.$refs.KFB.setData({unit:'2'})   
                 },0)
             }
@@ -748,9 +749,9 @@ export default {
                     var time1 = that.$refs.KFB.form.getFieldValue('start_date')
                     var timeC=that.timeDifference(time1,time2,'min')
                     var lx=that.$refs.KFB.form.getFieldValue('leave_category')
-                    if(timeC>=180&&lx=='1'&&that.leave>=0.5){ //事假,时间差大于180,剩余年假大于0.5
+                    if(timeC>=180&&lx=='事假'&&that.leave>=0.5){ //事假,时间差大于180,剩余年假大于0.5
                         that.$refs.KFB.setData({unit:'2'})
-                          that.$refs.KFB.setData({leave_category:'2'})
+                          that.$refs.KFB.setData({leave_category:'年假'})
                      }
                 },0)
                 
@@ -958,7 +959,7 @@ export default {
                     var estimate = this.$refs.KFB.form.getFieldValue('leave_days'),
                    //   actual = that.$refs.KFB.form.getFieldValue('practical_leave'),
                     leaveCategory = this.$refs.KFB.form.getFieldValue('leave_category')
-                    if(leaveCategory=='2' && !estimate){
+                    if(leaveCategory=='年假' && !estimate){
                       this.$message.error('请填写预计请假时长!')
                       addForm = 'yes'
                      }