瀏覽代碼

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

Lijy 2 年之前
父節點
當前提交
262b3f253d

+ 10 - 12
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,20 +1,18 @@
 var path = require('path')
 
 //  var ip = '127.0.0.1'
-// var ip = '192.168.2.39'
 // var ip = '192.168.2.15'
-var ip = '192.168.2.39'
-// var ip = '192.168.2.12'// var ip = '47.100.37.243' 
+// var ip = '192.168.2.39'
 
-// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
-// for (var i in ifaces) {
-//     for (var j in ifaces[i]) {
-//         var val = ifaces[i][j]
-//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-//             ip = val.address
-//         }
-//     }
-// }
+var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+for (var i in ifaces) {
+    for (var j in ifaces[i]) {
+        var val = ifaces[i][j]
+        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+            ip = val.address
+        }
+    }
+}
 
 module.exports = {
   build: {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -862,7 +862,7 @@ export default {
       this.http.post('/project/getCustomerProjectInAndOut', {
                     pageIndex: this.page,
                     pageSize: this.size,
-                    projectId: this.proJuctId,
+                    projectId: this.cusProJuctId,
                     customerId: this.customerId
                     },
         res => {

+ 52 - 12
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -384,8 +384,8 @@
                         <el-input-number :id="'numberData_'+index" :disabled="!canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
                     </el-form-item>
                     <!-- 自定义文本 -->
-                    <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1">
-                        <el-input :disabled="!canEdit" v-model="domain.customText" style="width:500px;" maxlength="25" show-word-limit></el-input>
+                    <el-form-item :label="yonghuUser.customTextName + '123'" v-if="yonghuUser.customTextActive == 1">
+                        <el-input :disabled="!canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" maxlength="25" show-word-limit></el-input>
                     </el-form-item>
                     <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
                         :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
@@ -504,7 +504,7 @@
                         </el-form-item>
                         <!-- 自定义文本 -->
                         <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1">
-                            <el-input :disabled="!canEdit" v-model="domain.customText" style="width:500px;" maxlength="25" show-word-limit></el-input>
+                            <el-input :disabled="!canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" maxlength="25" show-word-limit></el-input>
                         </el-form-item>
                         <!--项目管理专业版模式下,项目下的近期执行的任务 -->
                         <el-form-item label="任务/里程碑" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
@@ -1847,22 +1847,62 @@
                 }
                 this.jsTime = quanbu
                 let worktime = this.jsTime
+
+                // 自动计算加班时长
                 if(this.isBatch != 0){
                     worktime = this.jsTime / this.jsDay
                 }
                 if(this.user.timeType.fillOvertime && domain){
-                    for(let di in spl){
+                    let isover = false
+                    let alltime = 0
+                    let allover = 0     //此处alltime同上面的worktime
+                    for(let d in spl){
+                        if(spl[d].isOvertime){
+                            isover = true
+                            allover += spl[d].overtimeHours*1
+                        }
+                        alltime += spl[d].workingTime*1
+                    }
+                    if(domain.overtimeHours){
+                        allover = allover - domain.overtimeHours
+                    }
+                    if(worktime*1 > this.user.timeType.allday){
+                        if(isover){
+                            if(alltime > (allover + this.user.timeType.allday)){
+                                    this.$set(domain,'isOvertime',true)
+                                    this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
+                            }else{
+                                this.$set(domain,'isOvertime',false)
+                                this.$set(domain,'overtimeHours',null)
+                                if(alltime < (allover + this.user.timeType.allday)){
+                                    let overtime = allover + this.user.timeType.allday - alltime
+                                    for(let pi in spl){
+                                        if(spl[pi].overtimeHours){
+                                            if((overtime - spl[pi].overtimeHours*1) > 0){
+                                                overtime = overtime - spl[pi].overtimeHours*1
+                                                this.$set(spl[pi],'isOvertime',false)
+                                                this.$set(spl[pi],'overtimeHours',null)
+                                            }else if((overtime - spl[pi].overtimeHours*1) < 0){
+                                                this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
+                                                break
+                                            }else{
+                                                this.$set(spl[pi],'isOvertime',false)
+                                                this.$set(spl[pi],'overtimeHours',null)
+                                                break
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }else{
+                            this.$set(domain,'isOvertime',true)
+                            this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
+                        }
+                    }else{
+                        for(let di in spl){
                             this.$set(spl[di],'isOvertime',false)
                             this.$set(spl[di],'overtimeHours',null)
                         }
-                    if(worktime*1 > this.user.timeType.allday){
-                        this.$set(domain,'isOvertime',true)
-                        this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
-                        // domain.overtimeHours = domain.workingTime - this.user.timeType.allday
-                        
-                    }else {
-                        this.$set(domain,'isOvertime',false)
-                        this.$set(domain,'overtimeHours',null)
                     }
                     
                 }

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

@@ -17,7 +17,7 @@
             </van-popup>
             <van-cell title="总时长(h)" v-if="reportTimeType.type == 3">
                 <template>
-                    <van-stepper :disabled="!canEdit" v-model="reportTimeType.allday" @change="changeAllTime" min="0.5" max="12" step="0.5" :decimal-length="1" />
+                    <van-stepper :disabled="!canEdit || user.timeType.lockWorktime == 1" v-model="reportTimeType.allday" @change="changeAllTime" min="0.5" max="12" step="0.5" :decimal-length="1" />
                 </template>
             </van-cell>
             
@@ -165,7 +165,7 @@
                         <template >
                             <div>
                         <span>用时占比</span>
-                        <van-slider :disabled="!canEdit" :min="10" :step="10" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
+                        <van-slider :disabled="!canEdit" :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
                         <template #button>
                             <div class="custom-button">{{ item.progress }}%</div>
                         </template>

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

@@ -26,6 +26,11 @@
                         <van-button type="default" size="small" @click="submitClear">清空</van-button>
                     </div>
             </van-grid>
+            <van-cell title="总时长(h)" v-if="reportTimeType.type == 3">
+                        <template>
+                            <van-stepper style="float:left;" :disabled="user.timeType.lockWorktime == 1" v-model="reportTimeType.allday" @change="changeAllTime" min="0.5" max="12" step="0.5" button-size="24px" :decimal-length="1" />
+                        </template>
+                    </van-cell>
 
 
             <div class="form_domains" v-for="(item,index) in currentForm.domains" :key="item.id">
@@ -150,7 +155,7 @@
                         <template >
                             <div>
                         <span>用时占比</span>
-                        <van-slider :min="10" :step="10" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
+                        <van-slider :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
                         <template #button>
                             <div class="custom-button">{{ item.progress }}%</div>
                         </template>
@@ -365,7 +370,7 @@
                 inbtn: 0,
                 weekIndex: 5,
                 weekSwitchIndex: 1,
-                kaoqinText: false
+                kaoqinText: false,
             };
         },
         methods: {
@@ -448,6 +453,7 @@
                                 projectName: "",
                                 workingTime: this.user.timeType.allday,
                                 content: "",
+                                progress: 100,
                                 state: 2,
                                 multiWorktime:0,
                                 worktimeList:{},
@@ -859,7 +865,7 @@
                         case 'h': return _this.padding(date.getHours(), $0.length);
                         case 'm': return _this.padding(date.getMinutes(), $0.length);
                         case 's': return _this.padding(date.getSeconds(), $0.length);
-                    }
+                    }getReport
                 });
             },
 

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -3,7 +3,7 @@ const pxtorem = require("postcss-pxtorem");
 const path = require('path');
 const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 
-var ip = '192.168.2.2'
+var ip = '192.168.2.39'
 // var ip = '127.0.0.1'
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {