Explorar o código

提交请假调整代码

Lijy hai 6 meses
pai
achega
f280d6b924

+ 8 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -107,7 +107,7 @@
                           <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
                           <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
                     </el-select>
                     <template  v-if="addForm.leaveType == 6">
                     <template  v-if="addForm.leaveType == 6">
-                      <span style="margin-left:18px;color:#777;">{{ $t('restcanbeadjusted') }} {{addForm.ownerId != '' ? txselnum : '~'}} {{ $t('time.day') }}</span>
+                      <span style="margin-left:18px;color:#777;">{{ $t('restcanbeadjusted') }} {{addForm.ownerId != '' ? txselnum : '~'}} {{ addForm.timeType == 0 ? '天' : '小时' }}</span>
                       <el-tooltip effect="dark" :content="$t('overtimhourscabeusedforoffsetting')" placement="top-start">
                       <el-tooltip effect="dark" :content="$t('overtimhourscabeusedforoffsetting')" placement="top-start">
                         <i class="el-icon-question" style="color:#606266;"></i>
                         <i class="el-icon-question" style="color:#606266;"></i>
                       </el-tooltip>
                       </el-tooltip>
@@ -1936,9 +1936,15 @@ export default {
             this.addForm.timeType = '1'
             this.addForm.timeType = '1'
             this.addForm.timeHours = 1,
             this.addForm.timeHours = 1,
             this.addForm.timeDays = 1
             this.addForm.timeDays = 1
-            this.txselnum = this.txselnumTwo.toFixed(1)
+            this.txselnum = this.dayToHourConversion(this.txselnumTwo)
         }
         }
     },
     },
+    dayToHourConversion(val) {
+        let value = +val;  
+        let workHours = 8;   
+        let result = value * workHours; 
+        return result.toFixed(1);
+    },
     // 计算日期
     // 计算日期
     datas() {
     datas() {
         // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
         // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)

+ 12 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/applyLeave.vue

@@ -15,6 +15,11 @@
                 <!-- 请假类型 -->
                 <!-- 请假类型 -->
                 <van-field v-model="editForm.leaveType" label="请假类型" @click="typeShow = true" readonly clickable>
                 <van-field v-model="editForm.leaveType" label="请假类型" @click="typeShow = true" readonly clickable>
                     <template #input>{{typeList[editForm.leaveType]}}</template>
                     <template #input>{{typeList[editForm.leaveType]}}</template>
+                    <template #extra>
+                        <span v-if="editForm.leaveType == 6" style="color: #C8C9CC">
+                            {{ txselnum }} {{ editForm.timeType == 0 ? '天' : '小时' }}
+                        </span>
+                    </template>
                 </van-field>
                 </van-field>
                 <van-popup v-model="typeShow" position="bottom">
                 <van-popup v-model="typeShow" position="bottom">
                     <van-picker
                     <van-picker
@@ -328,10 +333,16 @@ export default {
                 }else{
                 }else{
                     this.formshowText.dateTitle = ''
                     this.formshowText.dateTitle = ''
                 }
                 }
-                this.txselnum = this.txselnumTwo.toFixed(1)
+                this.txselnum = this.dayToHourConversion(this.txselnumTwo)
             }
             }
             
             
         },
         },
+        dayToHourConversion(val) {
+            let value = +val;  
+            let workHours = 8;   
+            let result = value * workHours; 
+            return result.toFixed(1);
+        },
         dateShow(){
         dateShow(){
             
             
             if(this.editForm.timeType == '0'){
             if(this.editForm.timeType == '0'){