Quellcode durchsuchen

增加工时下限

seyason vor 1 Jahr
Ursprung
Commit
fc1ef2b450

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -13,7 +13,7 @@ import lombok.experimental.Accessors;
 
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author Seyason
@@ -388,6 +388,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("max_report_time")
     private Float maxReportTime;
 
+    /**
+     * 填报工作时长下限
+     */
+    @TableField("min_report_time")
+    private Float minReportTime;
+
     /**
      * 是否同步泛微考勤打卡和出差
      */

Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


+ 4 - 2
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -908,7 +908,8 @@
   "dailyworkinghours": "Normal working hours per day",
   "workingdayspermonth": "Average working days per month",
   "hoursreporteperday": "Lock the upper limit of daily reporting hours",
-  "imitillingtime": "Fill in the time limit",
+  "imitillingtime": "Max report time",
+  "minReportTime": "Min report time",
   "lockingworkinghours": "Lock working hours",
   "chargedtocost": "Overtime hours charged to cost",
   "hourscanbereported": "Reportable overtime hours",
@@ -1505,5 +1506,6 @@
   "que-ding-yao-shan-chu-ci-tiao-he-tong-lei-xing-ma": "Are you sure you want to delete this contract type ?",
   "que-ding-yao-shan-chu-gai-he-tong-ma": "Are you sure you want to delete this contract ?",
   "que-ding-yao-shan-chu-gai-wen-jian-ma": "Are you sure you want to delete this file ?",
-  "he-tong-guan-li-dao-ru-mo-ban": "Contract Management Template"
+  "he-tong-guan-li-dao-ru-mo-ban": "Contract Management Template",
+  "minMaxCheck": "report time min value should not be greater than the max value"
 }

+ 6 - 4
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -909,11 +909,12 @@
   "employeehourlywage": "员工时薪录入方式设置",
   "methodsa": "方式一: 录入月成本,自动计算时薪",
   "suitableforfulltimeemployees": "(适合企业全职员工)",
-  "workingdayspermonth": "平均每月工作天数",
-  "dailyworkinghours": "每日正常工作时长",
+  "workingdayspermonth": "平均每月工作",
+  "dailyworkinghours": "每日正常工作",
   "lockingworkinghours": "锁定工作时长",
   "hoursreporteperday": "锁定每日填报工时的上限",
-  "imitillingtime": "填报时长上限",
+  "imitillingtime": "工时上限",
+  "minReportTime": "工时下限",
   "workSettings": "加班设置",
   "hourscanbereported": "可填报加班时长",
   "chargedtocost": "加班工时记入成本",
@@ -1509,5 +1510,6 @@
   "que-ding-yao-shan-chu-ci-tiao-he-tong-lei-xing-ma": "确定要删除此条合同类型吗?",
   "que-ding-yao-shan-chu-gai-he-tong-ma": "确定要删除该合同吗?",
   "que-ding-yao-shan-chu-gai-wen-jian-ma": "确定要删除该文件吗?",
-  "he-tong-guan-li-dao-ru-mo-ban": "合同管理导入模板"
+  "he-tong-guan-li-dao-ru-mo-ban": "合同管理导入模板",
+  "minMaxCheck": "工时下限不得大于上限"
 }

+ 17 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -18,7 +18,7 @@
                     <el-radio v-model="timeType.hourCostInputType" :label="0" style="width:100%;margin-left:10px;">{{ $t('methodsa') }}<span class="tip">{{ $t('suitableforfulltimeemployees') }}</span></el-radio>
                 </div>
                 <div style="width:100%;float:left"> 
-                    <el-form ref="form0" :inline="true" :model="timeType" label-width="150px" style="margin-top:10px">
+                    <el-form ref="form0" :inline="true" :model="timeType" label-width="120px" style="margin-top:10px">
                         <el-form-item :label="$t('workingdayspermonth')" prop="monthDays">
                         <el-input v-model="timeType.monthDays"  type="number" style="width:120px;"></el-input>
                         {{ $t('time.day') }} 
@@ -40,7 +40,13 @@
                             <el-select :disabled="timeType.lockWorktime" v-model="timeType.maxReportTime" type="number" style="width:120px;">
                                 <el-option v-for="item in maxReportTimeRange" :key="item" :label="item.toFixed(1)" :value="item"></el-option>
                             </el-select><span style="margin-left:5px;color:#409eff">{{ $t('time.hour') }}</span>
-                        </el-form-item><br>
+                        </el-form-item>
+                        <el-form-item :label="$t('minReportTime')">
+                            <el-select :disabled="timeType.lockWorktime" v-model="timeType.minReportTime" type="number" style="width:120px;">
+                                <el-option v-for="item in minReportTimeRange" :key="item" :label="item.toFixed(1)" :value="item"></el-option>
+                            </el-select><span style="margin-left:5px;color:#409eff">{{ $t('time.hour') }}</span>
+                        </el-form-item>
+                        <br>
                         <el-form-item :label="$t('workSettings')" prop="allday" v-if="!timeType.lockWorktime">
                             <el-checkbox v-model="timeType.fillOvertime" :label="$t('hourscanbereported')" />
                             <el-form-item v-if="timeType.fillOvertime">
@@ -713,7 +719,7 @@
                     label: 'label'
                 },
                 maxReportTimeRange: [],
-
+                minReportTimeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.5,13.0,13.5,14.0,14.5,15.0],
                 wxFilterText: '', // 企业微信搜索
 
                 searchPersonnelFlg: false,
@@ -1308,6 +1314,14 @@
                                 return
                             }
                         }
+                        //工时上下限的校验
+                        if (param.minReportTime > param.maxReportTime) {
+                            this.$message({
+                                message:this.$t('minMaxCheck'),
+                                type:"error"
+                            })
+                            return
+                        }
                         delete param.userList
                         param.customTextStatus = param.customTextStatus && param.customTextActive ? 1 : 0
                         param.customDegreeStatus = param.customDegreeStatus && param.customDegreeActive ? 1 : 0

+ 5 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -2045,7 +2045,7 @@
                 subProjectList:[],
                 canEdit: true,
                 originCanEdit: true,
-                timeRange:[0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
+                timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
                 selectTime:null,
                 reportTimeType:{},
                 curDate:'',
@@ -2308,6 +2308,10 @@
             if(this.user.timeType.lockWorktime){
                 this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
             }
+            //设置了下限
+            if (this.user.timeType.minReportTime) {
+                this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
+            }
 
             const that = this
             if(this.user.userNameNeedTranslate == 1) {

+ 12 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -546,7 +546,7 @@ export default {
             endTime: '18:00',
             nowTime: new Date(),
             showPickerHours: false,
-            timeRange: [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.5, 13.0, 13.5, 14.0, 14.5, 15.0],
+            timeRange: [],
             selectTime: null,
             reportTimeType: {},
             user: JSON.parse(localStorage.userInfo),
@@ -2522,8 +2522,17 @@ export default {
 
         this.today = this.format(new Date(), 'yyyy-MM-dd')
         this.timeRange = []
-        for (let i = 0.5; i <= 20; i += 0.5) {
-            this.timeRange.push(i)
+        let i = 0.0; 
+        while(true) {
+            if (i < 24) {
+                //校验上下限
+                if (i >= this.user.timeType.minReportTime && i <= this.user.timeType.maxReportTime) {
+                    this.timeRange.push(i);
+                }
+                i += 0.5;
+            } else {
+                break;
+            }
         }
         // console.log('user',this.user)
         var ua = navigator.userAgent.toLowerCase();

+ 12 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -457,7 +457,7 @@
                 endTime: '18:00',
                 nowTime:new Date(),
                 showPickerHours: false,
-                timeRange:[0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.5,13.0,13.5,14.0,14.5,15.0],
+                timeRange:[],
                 selectTime:null,
                 reportTimeType:{},
                 user: JSON.parse(localStorage.userInfo),
@@ -2587,8 +2587,17 @@
             //     }
             // }
             this.timeRange = []
-            for(let i=0.5; i<=20; i+=0.5){
-                this.timeRange.push(i)
+            let i = 0.0; 
+            while(true) {
+                if (i < 24) {
+                    //校验上下限
+                    if (i >= this.user.timeType.minReportTime && i <= this.user.timeType.maxReportTime) {
+                        this.timeRange.push(i);
+                    }
+                    i += 0.5;
+                } else {
+                    break;
+                }
             }
             this.getDateRange()
             var ua = navigator.userAgent.toLowerCase();