瀏覽代碼

提交移动端的暂存以及威派格的完善工号定制需求

Lijy 1 年之前
父節點
當前提交
63ce89ba28

+ 69 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -248,6 +248,18 @@
                 </el-dialog>
             </section>
         </el-col>
+
+        <!-- 完善工号弹窗 -->
+        <el-dialog title="完善工号" :visible.sync="perfectJobNumber" width="500px" :show-close="false">
+            <el-form :model="perfectForm" :rules="rules" ref="perfectForm" label-width="80px" class="demo-ruleForm">
+                <el-form-item label="工号" prop="jobNumber">
+                    <el-input v-model.trim="perfectForm.jobNumber"></el-input>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="editPerfectJobNumber('perfectForm')">确 定</el-button>
+            </span>
+        </el-dialog>
     </el-row>
 </template>
 
@@ -261,10 +273,16 @@
                 companyForm:{
                     name: '',
                 },
+                perfectForm:{
+                    jobNumber: '',
+                },
                 rules: {
                     name: [
                         { required: true, message: '请输入公司名称', trigger: 'blur' },
                         { min: 1, max: 20, message: '长度为1-20个字符', trigger: 'blur' }
+                    ],
+                    jobNumber: [
+                        { required: true, message: '请输入工号', trigger: 'blur' }
                     ]
                 },
                 tourFlg: false,
@@ -377,7 +395,11 @@
                 setTimeLoad: null,
 
                 // 遮罩
-                vTourFlg: false
+                vTourFlg: false,
+
+                
+                perfectJobNumber: false, // 完善工号弹窗
+                jobNumberCheckCompanyId: [936], // 定制需求,需要完善工号的公司id
             };
         },
         created() {
@@ -785,6 +807,46 @@
                     console.log(error, '哦耶')
                 })
             },
+
+            // 完善工号
+            editPerfectJobNumber(perfectForm) {
+                this.$refs[perfectForm].validate((valid) => {
+                    if (valid) {
+                        const { id } = this.user
+                        this.http.post("/user/updateUserJobNumber", {
+                            jobNumber: this.perfectForm.jobNumber,
+                            userId: id
+                        },
+                        res => {
+                            if (res.code == "ok") {
+                                this.perfectJobNumber = false
+                                let nerUser = {
+                                    ...this.user,
+                                    jobNumber: this.perfectForm.jobNumber
+                                }
+                                sessionStorage.setItem('user', JSON.stringify(nerUser));
+                                this.$message({
+                                    message: '操作成功',
+                                    type: "success"
+                                });
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                        });
+                    } else {
+                        return false;
+                    }
+                });
+            }
         },
         mounted() {
             var ua = navigator.userAgent.toLowerCase();
@@ -839,6 +901,12 @@
                     }, 1000)
                 }, 200)
             }
+
+            // 检查是否有工号
+            const { jobNumber, companyId } = this.user
+            if(this.jobNumberCheckCompanyId.includes(companyId) && !jobNumber) {
+                this.perfectJobNumber = true
+            }
         },
     };
 </script>

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/router/index.js

@@ -210,6 +210,13 @@ const router = new Router({
         },
         component: () => import("@/views/exaLeave/awayOffice")
     },
+    {
+        path: "/editPerfect",
+        meta: {
+            title: "完善工号"
+        },
+        component: () => import("@/views/editPerfect/editPerfect")
+    },
     {
         path: "/clearStorage",
         meta: {

File diff suppressed because it is too large
+ 2651 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit-02.vue


+ 190 - 40
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -48,24 +48,29 @@
                 </template>
             </van-cell>
 
-            
             <!-- 每一周的数据循环 -->
             <div v-if="inbtn != 999">
                 <div class="form_domains" v-for="(item,index) in currentForm.domains" :key="item.id">
                     <div style="float:right;margin-top:10px;margin-right:10px;">
                     
-                    <van-tag v-if="index>0" color="#fff" 
+                    <van-tag v-if="index > 0 && item.state > 1" color="#fff" 
                     @click="delPro(index)" style="border: 1px solid #ff0000;padding:5px;margin-left:10px;"
                     icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">删除</span></van-tag>
                     </div>
 
+                    <!-- 当前的状态 -->
+                    <div class="currentState" :style="`color: ${['#E6A23C', '#5CB87A'][item.state] || '#000'}`">
+                        {{ ['待审核', '已通过'][item.state] || '' }}
+                    </div>
+
                     <van-cell-group :title="(user.companyId==781?'任务':'项目') + (index+1)">
+
                         <!-- <div>请选择投入项目</div> -->
                         <!--按周填报的项目改成非必填-->
-                        <van-field  readonly  name="projectId" clickable :value="item.projectName" :label="user.companyId==781?'工作任务':'投入项目'" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" @click="clickPicker(index, item)"
-                        />
+                        <van-field  readonly  name="projectId" clickable :value="item.projectName" :label="user.companyId==781?'工作任务':'投入项目'" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" 
+                            @click="clickPicker(index, item)" :disabled="item.state<=1" />
                         <van-field  readonly  name="subProjectId" v-if="item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1" clickable 
-                            :value="item.subProjectName" label="子项目" placeholder="请选择子项目" 
+                            :value="item.subProjectName" label="子项目" placeholder="请选择子项目"  :disabled="item.state<=1"
                         @click="clickPickSubProject(index, item)" />
 
                         <van-popup v-model="item.showPickerSubProject" position="bottom">
@@ -75,14 +80,14 @@
                         <!--任务分组 -->
                         <van-field  readonly  name="groupId" v-if="user.company.packageProject==1&&item.taskGroups != null && item.taskGroups.length > 0" clickable 
                             :value="item.groupName" :label="user.timeType.enableNewWeeklyfill == 1 ? '分组' : '任务分组'" :placeholder="user.timeType.enableNewWeeklyfill == 1 ? '请选择分组' : '请选择任务分组'" 
-                        @click="clickPickTaskGroup(index, item)" />
+                        @click="clickPickTaskGroup(index, item)" :disabled="item.state<=1" />
                         <van-popup v-model="item.showPickerTaskGroup" position="bottom">
                             <van-picker show-toolbar :columns="item.taskGroups" value-key="name" @confirm="choseTaskGroup" 
                                 @cancel="item.showPickerTaskGroup = false;$forceUpdate();" />
                         </van-popup>
                         <!--任务阶段 -->
                         <van-field  readonly  name="stage" v-if="user.company.packageProject==1&&item.stages != null && item.stages.length > 0 && user.timeType.enableNewWeeklyfill != 1" clickable 
-                            :value="item.stage" label="投入阶段" placeholder="请选择投入阶段" 
+                            :value="item.stage" label="投入阶段" placeholder="请选择投入阶段"  :disabled="item.state<=1"
                         @click="clickPickStage(index, item)" />
                         <van-popup v-model="item.showPickerStage" position="bottom">
                             <van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage" 
@@ -90,7 +95,7 @@
                         </van-popup>
                         <!-- 预算来源 -->
                         <van-field  readonly  name="basecostId" v-if="user.company.packageProject==1&&reportBasecostList &&reportBasecostList.length>0" 
-                            :value="item.basecostName" label="预算来源" placeholder="请选择预算来源" 
+                            :value="item.basecostName" label="预算来源" placeholder="请选择预算来源" :disabled="item.state<=1"
                         @click="clickPickCostId(index, item)" />
                         <van-popup v-model="item.showPickerCostId" position="bottom">
                             <van-picker show-toolbar :columns="reportBasecostList" value-key="name" @confirm="choseCostId" 
@@ -99,7 +104,7 @@
                         <!-- 审核人 -->
                     <template v-if="user.timeType.reportAuditType != 3">
                         <van-field  readonly  name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
-                            :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人" 
+                            :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人"  :disabled="item.state<=1"
                         @click="clickPickAuditor(index, item)">
                             <template #input>
                                 <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
@@ -191,7 +196,7 @@
                         <!-- 全天上下午模式 -->
                         <div v-if="reportTimeType.multiWorktime==0">
                         <van-field v-if="reportTimeType.type < 2" readonly clickable  :value="reportTimeType.type==0?item.label:(parseFloat(item.workingTime).toFixed(1)+'h')" label="工作时长" placeholder="请选择工作时长(小时)" 
-                        @click="clickTimePicker(index, item)"
+                        @click="clickTimePicker(index, item)" :disabled="item.state<=1"
                         :rules="[{ required: true, message: '请选择工作时长' }]"/>
                         <van-popup v-model="showPickerTime" position="bottom">
                             <van-picker show-toolbar :columns="timeType"  value-key="label" @confirm="choseTimePick" @cancel="showPickerTime = false" />
@@ -206,7 +211,7 @@
 
                         <!-- 时间段选择模式 -->
                         <van-field readonly v-if="reportTimeType.type == 2" clickable name="datetimePicker" :value="item.startTime" label="开始时间" placeholder="点击选择时间" 
-                            @click="showStartTime = true"
+                            @click="timePickChange(item, 'showStartTime')" :disabled="item.state<=1"
                             :rules="[{ required: true, message: '请选择开始时间' }]"
                             />
                         <van-popup v-model="showStartTime" position="bottom">
@@ -221,7 +226,7 @@
                             <!-- :filter="filter" 原本这个属性在里面 -->
                         </van-popup>
                         <van-field v-if="reportTimeType.type == 2" readonly clickable name="datetimePicker" :value="item.endTime" label="结束时间" placeholder="点击选择时间" 
-                            @click="showEndTime = true"
+                            @click="timePickChange(item, 'showEndTime')" :disabled="item.state<=1"
                             :rules="[{ required: true, message: '请选择结束时间' }]" />
                         <van-popup v-model="showEndTime" position="bottom" >
                             <van-datetime-picker
@@ -238,7 +243,7 @@
                             <template >
                                 <div>
                             <span>用时占比</span>
-                            <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)" >
+                            <van-slider :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" :disabled="item.state<=1" 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>
@@ -261,16 +266,16 @@
                                 <!-- 时间段选择模式 -->
                                 <van-field readonly v-if="reportTimeType.type == 2" :clickable="true" name="datetimePicker" 
                                 :value="timeItem.startTime" label="开始时间" placeholder="点击选择时间" 
-                                :rules="[{ required: true, message: '必填项' }]"
+                                :rules="[{ required: true, message: '必填项' }]" :disabled="item.state<=1"
                                     @click="showStartDialog(timeItem)"  />
                                 
                                 <van-field v-if="reportTimeType.type == 2" readonly :clickable="true" name="datetimePicker" 
                                 :value="timeItem.endTime" label="结束时间" placeholder="点击选择时间" 
-                                :rules="[{ required: true, message: '必填项' }]"
+                                :rules="[{ required: true, message: '必填项' }]" :disabled="item.state<=1"
                                     @click="showEndDialog(timeItem)"  />
                                 
                                 <van-field class="form_input" style="color:#333;-webkit-text-fill-color:#646566;"
-                                
+                                    :disabled="item.state<=1"
                                     v-model="timeItem.content" name="content" type="textarea" label="工作事项" placeholder="请输入工作事项" 
                                     :rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
                                     rows="1" autosize  />
@@ -308,8 +313,8 @@
                         
                         <div class="overtime" v-if="((user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)) || (isCorpWX&&canEdit)) && user.timeType.enableNewWeeklyfill != 1">
                             <div class="overTimeClas">
-                                <van-checkbox  v-model="item.isOvertime" style="width: 4.3rem;">加班</van-checkbox>
-                                <van-field v-model="item.overtimeHours" type="number" :disabled="item.isOvertime==null||item.isOvertime==0"
+                                <van-checkbox  v-model="item.isOvertime" :disabled="item.state<=1" style="width: 4.3rem;">加班</van-checkbox>
+                                <van-field v-model="item.overtimeHours" type="number" :disabled="item.isOvertime==null || item.isOvertime==0 || item.state<=1"
                                 placeholder="请输入加班时长" style="width: 5rem"></van-field>
                                 <span :class="'overListTime'">小时</span>    
                             </div>
@@ -366,8 +371,16 @@
             </div>
              
             <div class="form_btn" style="position:fixed; bottom:0px;width:100%;">
-                <div style="padding-bottom:10px;">
-                    <van-button square block type="info" @click="submitReport" native-type="submit" style="width:100%;float:left;">
+                <div style="padding-bottom:10px;" v-if="temporaryStorage">
+                    <van-button square block type="default" @click="submitReport(1)" native-type="submit" style="width:50%;float:left;">
+                        <div>暂存</div>
+                    </van-button>
+                    <van-button square block type="info" @click="submitReport(0)" native-type="submit" style="width:50%;float:right;">
+                        <div>提交</div>
+                    </van-button>
+                </div>
+                <div style="padding-bottom:10px;" v-if="!temporaryStorage">
+                    <van-button square block type="info" @click="submitReport(0)" native-type="submit" style="width:100%;float:right;">
                         <div>提交</div>
                     </van-button>
                 </div>
@@ -516,9 +529,18 @@
                 },
                 integrationProjectList: [],
                 summary: '', // 周总结
+
+                temporaryStorage: false, // 是否开启暂存
             };
         },
         methods: {
+            // 时间选择
+            timePickChange(item, filed) {
+                if(item.state <= 1) {
+                    return
+                }
+                this[filed] = true
+            },
             // 获取地址上的参数
             getUrlKey(name) {
                 return (
@@ -612,7 +634,7 @@
             },
             // 切换星期
             switchWeek(item,index){
-                console.log(this.inbtn)
+                console.log(this.inbtn, this.form)
                 if(this.inbtn == 999) {
                     this.inbtn = index
                     return
@@ -626,6 +648,8 @@
                 }
                 this.getKaoqin()
                 this.getWorkTime()
+
+                this.getEachArray(this.currentForm)
             },
             // 切换按周
             switchWeekly(index) {
@@ -948,20 +972,27 @@
                     this.projectss = this.proads
                 }
             },
-            fZr(item,index) {
+            fZr(item, index, flag = false, newProIdx) {
+                console.log(flag, '《=== 回显')
+                if(flag) { // flag 为 true 时,表示回显数据
+                    this.proIdx = newProIdx
+                }
+
                 var domainItem = this.currentForm.domains[this.proIdx];
-                domainItem.projectId = item.id;
-                domainItem.projectName = item.projectName;
-                
-                //清空子项目
-                domainItem.subProjectId = null;
-                domainItem.subProjectName = null;
-                //清空任务
-                domainItem.taskId = null;
-                domainItem.taskName = null;
-                //清空分组和阶段
-                domainItem.stage = null;
-                domainItem.groupId = null;
+
+                if(!flag) { // 选择项目时清空,回显数据不做操作
+                    domainItem.projectId = item.id;
+                    domainItem.projectName = item.projectName;
+                    //清空子项目
+                    domainItem.subProjectId = null;
+                    domainItem.subProjectName = null;
+                    //清空任务
+                    domainItem.taskId = null;
+                    domainItem.taskName = null;
+                    //清空分组和阶段
+                    domainItem.stage = null;
+                    domainItem.groupId = null;
+                }
 
                 this.showPickerUserddp = false;
                 //获取子项目
@@ -1007,6 +1038,10 @@
                     .then(res => {
                         if(res.code == "ok") {
                             domainItem.subProjectList = res.data;
+                            const { subProjectId, subProjectName } = domainItem
+                            if(subProjectId && !subProjectName) {
+                                domainItem.subProjectName = res.data.filter(item => item.id == subProjectId)[0].name
+                            }
                         } 
                         this.$forceUpdate();
                     }).catch(err=> {this.$toast.clear();});
@@ -1503,6 +1538,9 @@
                 this.$forceUpdate();
             },
             clickPickTaskGroup(i, item) {
+                if(item.state <= 1) {
+                    return
+                }
                 this.clickIndex = i;
                 item.showPickerTaskGroup = true;
                 this.$forceUpdate();
@@ -1578,16 +1616,22 @@
                 this.$forceUpdate();
             },
 
-            choseTaskGroup(value, index) {
+            choseTaskGroup(value, index, flag = false, newClickIndex) {
                 if(!value){
                     return
                 }
+
+                if(flag) {
+                    this.clickIndex = newClickIndex
+                }
+
                 this.currentForm.domains[this.clickIndex].groupId = value.id;
                 this.currentForm.domains[this.clickIndex].groupName = value.name;
                 this.currentForm.domains[this.clickIndex].showPickerTaskGroup = false;
+                
                 var domainItem = this.currentForm.domains[this.clickIndex];
 
-                this.getGroupStages(this.currentForm.domains[this.clickIndex], index);
+                this.getGroupStages(this.currentForm.domains[this.clickIndex], index, flag);
                 
                 //检查当前的项目是否需要获取分组的负责人
                 var curProject = this.project.filter(p=>p.id == this.currentForm.domains[this.clickIndex].projectId)[0];
@@ -1616,11 +1660,13 @@
 
             },
 
-            getGroupStages(domain, index) {
+            getGroupStages(domain, index, flag = false) {
                 this.$axios.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId})
                         .then(res => {
                             if(res.code == "ok") {
-                                domain.stage = '';
+                                if(!flag) {
+                                    domain.stage = '';
+                                }
                                 domain.stages = res.data;
                                 this.$forceUpdate();
                             } else {
@@ -1760,10 +1806,13 @@
             },
 
             // 提交日报
-            submitReport() {
+            submitReport(isDraft) {
                 if(this.inbtn != 999) {
                     this.form[this.inbtn] = this.currentForm
                 }
+                console.log(this.form)
+                console.log(this.currentForm)
+                // return
                 const { allday, workContentState, enableNewWeeklyfill, reportAuditType } = this.user.timeType // 系统设置的每日工作时间
                 // 针对物奇做的判断
                 if(this.user.timeType.enableNewWeeklyfill == 1){
@@ -1944,7 +1993,8 @@
                         }
                     }
 
-                    formData.append("draft", this.isDraft);
+                    // formData.append("draft", this.isDraft);
+                    formData.append("draft", isDraft);
                     //填字段
                     for(var i in this.form[formIndex].domains) {
                         //没有选择项目的,跳过
@@ -2432,9 +2482,101 @@
                 const day = newDate.getDate();
                 return `${year}/${month < 10 ? '0' + month : month}/${day < 10 ? '0' + day : day}`;
             },
+
+            // 获取按周填报的数据
+            async getWeeklyReportData() {
+                if(!this.temporaryStorage) {
+                    return
+                }
+                const { data } = await this.$axios.post("/report/getWeeklyReportData", { targetDate: this.dateText[0] })
+                const { dateList } = data
+                this.form =  this.handleWeeklyReportData(dateList)
+                this.currentForm = this.form[this.inbtn]
+                this.getEachArray(this.currentForm)
+            },
+            // 处理按周填报回显数据
+            handleWeeklyReportData(array) {
+                console.log(array, 'array')
+
+                let objectItem = {
+                    auditorFirst: {id: '', name: ''},
+                    auditorSec: {id: '', name: ''},
+                    auditorThird: {id: '', name: ''},
+                    ccUserid: {id: '', name: ''},
+                    content: '',
+                    degreeId: '',
+                    id: null,
+                    multiWorktime: 0,
+                    progress: 100,
+                    projectId: '',
+                    projectName: '',
+                    state: 2,
+                    workingTime: 8,
+                    worktimeList: []
+                }
+
+                let dataList = []
+                for(var i in array) {
+                    const arrayItem = array[i]
+                    let assignoBject = {
+                        createDate: arrayItem.date
+                    }
+                    if(arrayItem.reportList.length > 0) {
+                        let list = []
+                        for(var j in arrayItem.reportList) {
+                            const { 
+                                id,
+                                endTime, startTime, content, groupId, groupName,
+                                projectAuditorId, projectAuditorName, projectId,
+                                projectName, state, taskId, taskName, overtimeHours,
+                                stage, taskGroups, isOvertime, workingTime, subProjectId, progress
+                            } = arrayItem.reportList[j]
+
+                            let newObj = {
+                                ...objectItem, id,
+                                endTime, startTime, content, groupId, groupName,
+                                projectAuditorId, projectAuditorName, projectId,
+                                projectName, state, taskId, taskName, overtimeHours,
+                                stage, taskGroups, workingTime, subProjectId, progress,
+                                isOvertime: isOvertime == 1 ? true : false
+                            }
+                            list.push(newObj)
+                        }
+                        assignoBject.domains = JSON.parse(JSON.stringify(list))
+                    } else {
+                        assignoBject.domains = [JSON.parse(JSON.stringify(objectItem))]
+                    }
+                    dataList.push(assignoBject)
+                }
+
+                return dataList
+            },
+            // 获取回显数据的的各个数组(任务分组,阶段等)
+            getEachArray(arrItem) {
+                if(!this.temporaryStorage) {
+                    return
+                }
+                console.log(arrItem, '<=== 处理的数据')
+                let newArrItem = JSON.parse(JSON.stringify(arrItem))
+                const { domains } = newArrItem
+                for(let i in domains) {
+                    const { projectId, projectName, stage, groupId, groupName } = domains[i]
+                    if(projectId) {
+                        this.fZr({ projectId, projectName }, 0, true, i)
+                    }
+
+                    if(groupId) {
+                        this.choseTaskGroup({ id: groupId, name: groupName }, 0, true, i)
+                    }
+                }
+            }
         },
         
         mounted() {
+            const { companyId } = this.user
+            this.temporaryStorage = [4374, 10].includes(companyId)
+            console.log(this.temporaryStorage, '暂存权限', companyId)
+
             this.getUrlKey('date')
             const { enableNewWeeklyfill } = this.user.timeType // 针对物奇
             // if(enableNewWeeklyfill == 1) {
@@ -2478,6 +2620,9 @@
             //     this.form = JSON.parse(obj)
             //     localStorage.removeItem('formVal')
             // }
+
+            // 获取按周填报的数据
+            this.getWeeklyReportData()
         },
         beforeDestroy() {
             // localStorage.removeItem('formVal')
@@ -2486,6 +2631,11 @@
 </script>
 
 <style lang="less" scope>
+.currentState {
+    position: absolute;
+    top: 15px;
+    left: 112px;
+}
 .my-swipe .van-swipe-item {
   color: #fff;
   font-size: 20px;

+ 99 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/editPerfect/editPerfect.vue

@@ -0,0 +1,99 @@
+<template>
+    <div class='perfect'>
+        <div class="perfectTitle">完善工号</div>
+        <div class="perfectNumber">
+            <input type="text" v-model.trim="jobNumber" placeholder="请输入工号">
+        </div>
+        <div class="perfectBtn">
+            <van-button type="info" round :disabled="!jobNumber" @click="editPerfectJobNumber">确定</van-button>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: '',
+    components: {},
+    props: {},
+    data() {
+        return {
+            jobNumber: '',
+            user: JSON.parse(localStorage.userInfo)
+        }
+    },
+    computed: {},
+    watch: {},
+    created() { },
+    mounted() { },
+    methods: {
+        editPerfectJobNumber() {
+            const { id } = this.user
+            this.$axios.post("/user/updateUserJobNumber", {
+                id,
+                jobNumber: this.jobNumber
+            })
+            .then(res => {
+                if (res.code == "ok") {
+                    this.$toast.success('操作成功');
+                    let newUserInfo = {
+                        ...this.user,
+                        jobNumber: this.jobNumber
+                    }
+                    localStorage.setItem('userInfo', JSON.stringify(newUserInfo))
+                    this.$router.go(-1);
+                } else {
+                    this.$toast.fail(res.msg);
+                }
+            }).catch(err => {
+                this.$toast.fail(err);
+            });
+        }
+    },
+}
+</script>
+<style scoped lang='less'>
+.perfect {
+    width: 100%;
+    height: 100vh;
+    background: #fff;
+
+    .perfectTitle {
+        font-size: 30px;
+        padding-top: 20vh;
+        text-align: center;
+        color: #00a0e9;
+    }
+
+    .perfectNumber {
+        width: 100%;
+        display: flex;
+        justify-content: center;
+
+        input {
+            width: 80%;
+            height: 50px;
+            border: 1px solid #ccc;
+            border-radius: 5px;
+            margin-top: 8vh;
+            padding-left: 10px;
+            font-size: 16px;
+            border-radius: 50px;
+            text-align: center;
+        }
+    }
+
+    .perfectBtn {
+        width: 80%;
+        margin: 0 auto;
+
+        .van-button {
+            margin-top: 10vh;
+            width: 100%;
+            height: 50px;
+            border-radius: 50px;
+            background: #00a0e9;
+            color: #fff;
+        }
+    }
+}
+</style>

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -43,7 +43,8 @@
                 ],
                 routers: [],
                 key: 0,
-                isSyncData: false
+                isSyncData: false,
+                jobNumberCheckCompanyId: [936], // 定制需求,需要完善工号的公司id
             };
         },
         created() {
@@ -100,6 +101,12 @@
                     this.previewPicture()
                 }
             }
+
+            // 检查是否有工号
+            const { companyId, jobNumber } = this.user
+            if(this.jobNumberCheckCompanyId.includes(companyId) && !jobNumber) {
+                this.$router.push("/editPerfect");
+            }
         },
         components: {
             Footer