瀏覽代碼

Merge branch 'master' of http://47.100.37.243:10191/quyueting/manHourHousekeeper

yusm 2 周之前
父節點
當前提交
7e7eff2a11

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

@@ -64,7 +64,7 @@
                             style="height:0.6rem;padding:0 0.16667rem;" :loading="cardRefLoading" loading-size="0.26667rem"
                             @click.stop.native="cardtimeRefresh(form.createDate, (fillingAgent.id || ''))"
                             v-if="substitute && fillingAgent.name && (user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1)"></van-button>
-                            <template v-if="(user.companyId <= 10 || user.companyId == 8555) && !report.time">
+                            <template v-if="user.companyId == 8555 && (!report.time || !report.time.workHours)">
                                 <span style="margin:0 10px;color:#DAA520;">异常填报</span>
                                 <van-switch v-model="form.abnormalTime" size="20px" :disabled="!canEdit" @change="$forceUpdate()"/>
                             </template>
@@ -94,25 +94,13 @@
                         :decimal-length="1" />
                 </template>
             </van-cell>
-
-            <!-- <van-cell title="待分配时长" :value="report.time + 'h'" size="large"></van-cell> -->
-
             <div class="form_domains" v-for="(item, index) in form.domains" :key="item.id">
                 <div style="float:right;margin-top:10px;margin-right:10px;">
-                    <!-- <van-tag v-if="canEdit&&item.projectName.length>0" color="#fff"
-                @click="copyProject(index)" style="border: 1px solid #20a0ff;padding:5px;"
-                 icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">复制项目</span></van-tag> -->
-
                 <!-- 扫码填报 -->
                 <van-tag v-if="item.canEdit && user.companyId == 7536" color="#fff"
                     @click="scanCodeToFillIn(index)" style="border: 1px solid #409eff;padding:5px;margin-left:10px;" icon="plus"
                     type="default"><span style="color:#409eff;padding: 0 5px;">扫码填报</span>
                 </van-tag>
-                <!-- <van-tag v-if="item.canEdit && user.companyId == 7536" color="#fff"
-                    @click="determineQrcode(index)" style="border: 1px solid #409eff;padding:5px;margin-left:10px;" icon="plus"
-                    type="default"><span style="color:#409eff;padding: 0 5px;">扫码填报</span>
-                </van-tag> -->
-
                 <van-tag v-if="(index > 0 || form.domains.length > 1) && item.canEdit" 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>
@@ -182,6 +170,19 @@
                         <van-picker show-toolbar :columns="item.workContentList" value-key="workContext"
                             @confirm="choseWorkContent" @cancel="item.showPickerWorkContent = false; $forceUpdate();" />
                     </van-popup>
+                    <!--柘中施工分项工程-->
+                    <van-field readonly name="extraField1" v-if="(user.companyId == 4811 || user.companyId == 10) && item.constructionStages != null && item.constructionStages.length > 0" clickable
+                        :value="item.constructionStagesStr" label="施工分项工程" placeholder="请录入今日完成数量" :disabled="!item.canEdit"
+                        @click="clickPickConstructionStage(index, item)" />
+                    <van-popup v-model="item.showPickerConstruction" position="bottom">
+                        <!-- <van-picker show-toolbar :columns="item.constructionStages" value-key="name" @confirm="choseConstruction"
+                            @cancel="item.showPickerConstruction = false; $forceUpdate();" /> -->
+                        
+                        <van-cell-group>
+                            <van-field label-width="70%" v-for="stage in item.constructionStages" type="digit" :label="stage.name+' - 今日完成'" v-model="stage.finishNumber" placeholder="完成数量" ></van-field>
+                        </van-cell-group>
+                        <van-button style="width:100%" type="primary" @click="choseConstruction">确定</van-button>
+                    </van-popup>
                     <!--任务阶段 -->
                     <van-field readonly name="stage" :disabled="!item.canEdit"
                         v-if="user.companyId != yuzhongCompId && user.company.packageProject == 1 && !user.timeType.hideStages && item.stages != null && item.stages.length > 0"
@@ -233,8 +234,8 @@
                                 <!-- 按审批流显示审核人 -->
                                 <template v-if="user.timeType.reportWorkflow">
                                     <div style="display: flex; align-items: center; flex-wrap: wrap;">
-                                        <template v-for="(nodeItem, nodeIndex) in item.auditWorkflow">
-                                            <span :key="'node-' + nodeIndex" style="display: inline-flex; align-items: center;">
+                                        <template >
+                                            <span v-for="(nodeItem, nodeIndex) in item.auditWorkflow" :key="'node-' + nodeIndex" style="display: inline-flex; align-items: center;">
                                                 <span v-if="nodeItem.isDeptAudit">
                                                     <van-tag v-if="user.userNameNeedTranslate != '1'" type="primary">{{ nodeItem.auditDeptManagerName }}</van-tag>
                                                     <van-tag v-else type="primary"><TranslationOpenDataText type='userName' :openid='nodeItem.auditDeptManagerName'></TranslationOpenDataText></van-tag>
@@ -360,15 +361,21 @@
                     </van-popup>
 
                     <!-- 自定义数值 -->
-                    <van-field v-if="user.timeType.customDataActive == 1" type="number" :disabled="!item.canEdit"
+                    <van-field v-if="user.timeType.customDataActive == 1 && user.companyId != 4811" type="number" :disabled="!item.canEdit"
                         v-model="item.customData" :label="user.timeType.customDataName" placeholder="请输入数字"
                         :rules="user.timeType.customDataStatus == 1 ? [{ required: true, message: '请输入' + user.timeType.customDataName }] : []"></van-field>
                     <!-- 自定义文本 -->
-                    <van-field v-if="user.timeType.customTextActive == 1" :disabled="!item.canEdit"
+                    <van-field v-if="user.timeType.customTextActive == 1 && user.companyId != 4811" :disabled="!item.canEdit"
                         v-model="item.customText" :label="user.timeType.customTextName" placeholder="请输入" maxlength="1000"
                         :rules="user.timeType.customTextStatus ? [{ required: true, message: '请选择' + user.timeType.customTextName }] : []"
                         rows="2" type="textarea" show-word-limit autosize></van-field>
 
+                    <van-field v-if="user.companyId == 4811" :disabled="!item.canEdit"
+                        v-model="item.customTextShow" label="人员" placeholder="请选择人员" readonly clickable @click="showEmployeeSelector(index, item)"
+                        :rules="[{ required: true, message: '请选择人员'}]" ></van-field>
+
+                    <!-- 柘中的施工人数自定义,放人员下面-->
+                    <van-cell v-if="user.companyId == 4811" :title="user.timeType.customDataName" :value="item.customData" />
                     <van-cell title="专业进度" v-if="user.company.packageEngineering == 1">
                     </van-cell>
                     <van-field :disabled="!item.canEdit" type="number" :name="'progress_' + pItem.professionId"
@@ -452,8 +459,8 @@
                             </template>
                         </van-cell>
                         <van-field class="form_input" :disabled="!item.canEdit" v-model="item.content" name="content" v-if="!user.timeType.hideContent"
-                            type="textarea" label="工作事项" placeholder="请输入"
-                            :rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
+                            type="textarea" label="工作内容" placeholder="请输入"
+                            :rules="user.timeType.workContentState == 1 && (user.companyId != 10 || item.constructionStages.length == 0)? [{ required: true, message: '请填写工作内容' }] : null"
                             rows="3" autosize />
                     </div>
 
@@ -521,7 +528,7 @@
                             <span :class="item.canEdit ? 'overListTime' : 'overListTime hoveOver'">小时</span>
                         </div>
                         <!--羲合超导的照片上传-->
-                        <template v-if="(user.companyId <= 10|| user.companyId == 8555)">
+                        <template v-if="user.companyId == 8555">
                             <van-tag style="position:absolute;right:10px;" v-if="form.abnormalTime && item.canEdit" type="primary"
                             size="large" @click="takePhoto(index)">图片上传</van-tag>
                         </template>
@@ -617,42 +624,23 @@
         <!-- 选择项目弹窗 -->
         <van-popup v-model="showPickerUserddp" position="bottom" style="height: 84%">
             <div class="popupDiv">
-                <!-- <van-search v-model="userName" placeholder="请输入项目名称/编号" @clear="sea()" @blur="sea()" @search="sea()" @input="sea()"/> -->
                 <div class="popupSearch">
                     <van-search v-model="userName" shape="round" background="#F4F4F4" placeholder="请输入项目名称/编号"
                         @clear="sea()" @blur="sea()" @search="sea()" @input="sea()" />
                 </div>
-
                 <div class="popupCon">
-                    <!-- <div class="ryuan" style="color: rgb(185 185 185);">近期选择项目</div>
-                    <div v-for="(item, index) in integrationProjectList" :key="index" class="ryuan" @click="fZr(item, index)">
-                        <p>{{item.projectName}}</p>
-                        <p style="margin-top: 5px;color: #9697B2;">{{item.projectCode}}</p> 
-                    </div>
-
-                    <div class="ryuan" style="color: rgb(185 185 185);">全部项目</div>
-                    <div v-for="(item, index) in projectss" :key="item.id" class="ryuan" @click="fZr(item, index)">
-                        <p>{{item.projectName}}</p>
-                        <p style="margin-top: 5px;color: #9697B2;">{{item.projectCode}}</p> 
-                    </div> -->
-
                     <div class="popupTitle">近期选择项目</div>
-
                     <div v-for="(item, index) in integrationProjectList" :key="index" class="popupItem paddingDiv"
-                        @click="fZr(item, index)">
+                        @click="selectProject(item, index)">
                         <div class="popupItemOne" v-if="item.projectName">{{ item.projectName }}</div>
                         <p class="popupItemTwo" v-if="item.projectCode">{{ item.projectCode }}</p>
                     </div>
-
                     <div class="popupTitle marginTop">全部项目</div>
-
                     <div v-for="(item, index) in projectss" :key="item.id" class="popupItem paddingDiv"
-                        @click="fZr(item, index)">
+                        @click="selectProject(item, index)">
                         <div class="popupItemOne" v-if="item.projectName">{{ item.projectName }}</div>
                         <p class="popupItemTwo" v-if="item.projectCode">{{ item.projectCode }}</p>
                     </div>
-
-                    <!-- <div class="popupTitle paddingDiv">全部项目</div> -->
                 </div>
             </div>
         </van-popup>
@@ -674,6 +662,44 @@
         <div class="qrcodeClass" v-if="showQrcode">
             <Qrcode @closeQrcode="closeQrcode" @determineQrcode="determineQrcode" />
         </div>
+
+        <!-- 人员选择器弹窗 -->
+        <van-popup v-model="employeeSelector.show" position="bottom" :style="{ height: '80vh' }">
+            <div class="employeeSelectorPopup">
+                <div class="employeeSelectorHeader">
+                    <span class="employeeSelectorTitle">选择人员</span>
+                </div>
+                <div class="employeeSelectorContent">
+                    <div v-for="(group, groupIndex) in employeeSelector.groupList" :key="groupIndex" class="employeeGroup">
+                        <!-- 分组标题 -->
+                        <div class="employeeGroupHeader">
+                            <van-checkbox 
+                                v-model="group.checked" 
+                                :indeterminate="group.indeterminate"
+                                @change="onGroupCheckChange(group)">
+                                <span class="groupName">{{ group.name || '未分组' }}</span>
+                                <span class="groupCount">({{ group.employeeList ? group.employeeList.length : 0 }}人)</span>
+                            </van-checkbox>
+                        </div>
+                        <!-- 人员列表 -->
+                        <div class="employeeList" v-if="group.employeeList && group.employeeList.length > 0">
+                            <div v-for="(employee, empIndex) in group.employeeList" :key="empIndex" 
+                                class="employeeItem">
+                                <van-checkbox 
+                                    v-model="employee.checked"
+                                    @change="onEmployeeCheckChange(employee, group)">
+                                    {{ employee.name }}
+                                </van-checkbox>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="employeeSelectorFooter">
+                    <van-button class="employeeSelectorBtn" @click="cancelEmployeeSelection">取消</van-button>
+                    <van-button class="employeeSelectorBtn" type="info" @click="confirmEmployeeSelection">确定</van-button>
+                </div>
+            </div>
+        </van-popup>
     </div>
 </template>
 <script>
@@ -690,7 +716,7 @@ export default {
             jobResponseList: [],
             yuzhongCompId: 3385,
             dailyIndex: 0,
-
+            allConstructionStages: [],
             showQrcode: false,
             integrationProjectList: [],
             cardRefLoading: false,
@@ -805,6 +831,14 @@ export default {
             hideWorkingHours: false,
 
             reportSettingsRow: {},
+            
+            // 人员选择器相关数据
+            employeeSelector: {
+                show: false,
+                groupList: [],
+                selectedEmployees: [],
+                currentIndex: 0
+            }
         };
     },
 
@@ -891,7 +925,7 @@ export default {
             };
             const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
             const item = { id: trueProjectId, projectName: projectName, projectCode: projectId }
-            this.fZr(item, this.scanCodeIndex, true)
+            this.selectProject(item, this.scanCodeIndex, true)
             if(reportExtraField4Name || reportExtraField5Name) {
                 this.getInfoByProjectId(item.projectCode, this.clickIndex, false)
             }
@@ -949,8 +983,6 @@ export default {
                 }).catch(err => { })
         },
         updateResponse(domainItem) {
-            console.log(111);
-            var that = this;
             var selectPid = domainItem.projectId;
             domainItem.extraField2 = null;
             domainItem.extraField3 = null;
@@ -959,7 +991,6 @@ export default {
             if (selectPid && domainItem.extraField1) {
                 //是否非项目
                 var isPublic = this.projectss.filter(p => p.id == selectPid)[0].isPublic;
-                console.log('==========', 'isPublic==' + isPublic);
                 var filteredRespList = this.jobResponseList.filter(j => j.timeType == (isPublic ? '非项目工时' : '项目工时') && j.role == (this.roleList.filter(r => r.value == domainItem.extraField1)[0].label));
                 domainItem.filteredRespList = filteredRespList;
             }
@@ -973,7 +1004,14 @@ export default {
                     }
                 }).catch(err => { })
         },
-
+        getConstructionStageList(){
+            this.$axios.post("/construction-stage/list", null)
+            .then(res => {
+                if(res.code == "ok") {
+                    this.allConstructionStages = res.data;
+                }
+            }).catch(err=> {this.$toast.clear();});
+        },
         getRecentlyProject(userId) {
             this.$axios.post('/project/nearProject', {userId: userId})
                 .then(res => {
@@ -1246,7 +1284,7 @@ export default {
                 }).catch(err => { this.$toast.clear(); });
         },
 
-        fZr(item, index, flag = false) {
+        selectProject(item, index, flag = false) {
 
             var domainItem = this.form.domains[this.clickIndex];
             domainItem.projectId = item.id;
@@ -1295,10 +1333,7 @@ export default {
                         this.getProjectAuditorList(domainItem, index);
                     }
                 }
-                
             }
-
-            console.log(item, '数据')
             if (this.user.timeType.customDegreeActive == 1 && item) {
                 var that = this
                 setTimeout(() => {
@@ -1309,11 +1344,17 @@ export default {
             if (this.user.companyId == this.yuzhongCompId) {
                 this.updateResponse(domainItem);
             }
-            // 工单号,行号
-            // const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
-            // if((reportExtraField4Name || reportExtraField5Name) && !flag) {
-            //     this.getInfoByProjectId(item.projectCode)
-            // }
+            //加载柘中施工分项工程
+            if (this.user.companyId == 4811 || this.user.companyId == 10) {
+                domainItem.constructionStagesStr = null;
+                if (curProject && curProject.plate1 && this.allConstructionStages.length > 0) {
+                    domainItem.constructionStages = JSON.parse(JSON.stringify(this.allConstructionStages.filter(
+                        stage => curProject.plate1.indexOf(stage.constructionType) != -1
+                    )));
+                } else {
+                    domainItem.constructionStages = [];
+                }
+            }
         },
         getInfoByProjectId(projectCode, index = null, flag = true) {
             const { projectId, groupId = '' } = this.form.domains[this.clickIndex];
@@ -1981,12 +2022,14 @@ export default {
                             let array = [];
                             var abnormalTime = false;
                             for (var i in list) {
-                                if (this.user.companyId <= 10 || this.user.companyId == 8555) {
+                                if (this.user.companyId == 8555) {
                                     if (list[i].extraField1) {
                                         abnormalTime = true;
                                     }
                                 }
+                                
                                 var projectName = list[i].projectName;
+                                
                                 var flg = (list[i].isOvertime == 1);
                                 for (var j in this.project) {
                                     if (this.project[j].id == list[i].projectId) {
@@ -2000,11 +2043,12 @@ export default {
                                         tname = filterList[0].taskName;
                                     }
                                 }
-                                let mmm = !t.customDegreeMultiple ? list[i].degreeId : (list[i].multiDegrIdList || [])
+                                let isCustomDegreeMultiple = t.customDegreeMultiple;
+                                let mmm = !isCustomDegreeMultiple ? list[i].degreeId : (list[i].multiDegrIdList || [])
                                 let sss = list[i].degreeList || []
                                 let radioPickDegree = ''
                                 let wuduName = ''
-                                if(!t.customDegreeMultiple) {
+                                if(!isCustomDegreeMultiple) {
                                     for (var s in sss) {
                                         if (sss[s].id == mmm) {
                                             wuduName = sss[s].name
@@ -2035,17 +2079,53 @@ export default {
                                 }
                                 var targetP = this.project.filter(p => p.id == list[i].projectId);
                                 var filteredRespList = [];
-                                if (targetP.length > 0 && list[i].extraField1) {
-                                    list[i].extraField1Name = this.roleList.find(r => r.value == list[i].extraField1).label;
-                                    var isPublic = targetP[0].isPublic;
-                                    filteredRespList = this.jobResponseList.filter(j => j.timeType == (isPublic ? '非项目工时' : '项目工时') && j.role == this.roleList.filter(r => r.value == list[i].extraField1)[0].label);
-                                    if (list[i].extraField2) {
-                                        list[i].extraField2Name = filteredRespList.find(f => f.id == list[i].extraField2).jobRespon;
+                                
+                                if (this.user.companyId == this.yuzhongCompId) {
+                                    if (targetP.length > 0 && list[i].extraField1) {
+                                        list[i].extraField1Name = this.roleList.find(r => r.value == list[i].extraField1).label;
+                                        var isPublic = targetP[0].isPublic;
+                                        filteredRespList = this.jobResponseList.filter(j => j.timeType == (isPublic ? '非项目工时' : '项目工时') && j.role == this.roleList.filter(r => r.value == list[i].extraField1)[0].label);
+                                        if (list[i].extraField2) {
+                                            list[i].extraField2Name = filteredRespList.find(f => f.id == list[i].extraField2).jobRespon;
+                                        }
+                                        if (list[i].extraField3) {
+                                            list[i].extraField3Name = list[i].workContentList.find(w => w.id == list[i].extraField3).workContext;
+                                        }
                                     }
-                                    if (list[i].extraField3) {
-                                        list[i].extraField3Name = list[i].workContentList.find(w => w.id == list[i].extraField3).workContext;
+                                } else if (this.user.companyId == 10 || this.user.companyId == 4811) {
+                                    if (targetP.length > 0 && this.allConstructionStages.length > 0) {
+                                        list[i].constructionStages = JSON.parse(JSON.stringify(this.allConstructionStages.filter(item=>targetP[0].plate1.indexOf(item.constructionType) > -1)));
+                                        //给完成数量赋值
+                                        var rpcList = list[i].projectConsStageList;
+                                        list[i].constructionStages.forEach(stage=>stage.finishNumber =
+                                            rpcList.find(rpc=>rpc.stageId == stage.id)?rpcList.find(rpc=>rpc.stageId == stage.id).finishNumber:0);
+                                        var constages = list[i].constructionStages;
+                                        var str = '';
+                                        for (var t=0;t<constages.length; t++) {
+                                            if (constages[t].finishNumber > 0) {
+                                                str += constages[t].name + '('+constages[t].finishNumber+ '), ';
+                                            }
+                                        }
+                                        if (str.length > 0) {
+                                            str = str.substring(0, str.length-2);
+                                        }
+                                        list[i].constructionStagesStr = str;
                                     }
+                                   
                                 }
+                                
+                                // 处理 customText,解析出人员姓名
+                                let customTextShow = '';
+                                if (list[i].customText && list[i].customText !== '-') {
+                                    // customText 格式: id1-name1,id2-name2
+                                    const employees = list[i].customText.split(',');
+                                    const names = employees.map(emp => {
+                                        const parts = emp.split('-');
+                                        return parts.length > 1 ? parts[1] : '';
+                                    }).filter(name => name);
+                                    customTextShow = names.join(',');
+                                }
+                                
                                 let copyData = {
                                     id: list[i].id,
                                     projectId: list[i].projectId,
@@ -2070,7 +2150,7 @@ export default {
                                     worktimeList: list[i].worktimeList,
                                     wuduList: list[i].degreeList,
                                     weiduName: wuduName,
-                                    degreeId: !t.customDegreeMultiple ? list[i].degreeId : list[i].multiDegrIdList,
+                                    degreeId: !isCustomDegreeMultiple ? list[i].degreeId : list[i].multiDegrIdList,
                                     radioPickDegree: radioPickDegree,
                                     subProjectId: list[i].subProjectId,
                                     subProjectName: subProjectName,
@@ -2084,6 +2164,7 @@ export default {
                                     auditUserList: list[i].auditUserList,
                                     overtimeHours: list[i].overtimeHours,
                                     customText: list[i].customText,
+                                    customTextShow: customTextShow,
                                     basecostId: list[i].basecostId,
                                     basecostName: basecostName,
                                     canEdit: list[i].state >= 2 ? true : false,
@@ -2093,6 +2174,8 @@ export default {
                                     ccUserid: list[i].ccUserid ? list[i].ccUserid : { name: '', id: '' },
                                     extraField1: list[i].extraField1,
                                     extraField1Name: list[i].extraField1Name,
+                                    constructionStages: list[i].constructionStages,
+                                    extraField1Unit:list[i].extraField1Unit,
                                     extraField2: list[i].extraField2,
                                     extraField2Name: list[i].extraField2Name,
                                     extraField3: list[i].extraField3,
@@ -2106,14 +2189,14 @@ export default {
                                     serviceList: list[i].serviceList,
                                     userReportDeptName: list[i].userReportDeptName,
                                     reportTargetDeptId: list[i].deptId,
-                                    auditWorkflow: list[i].auditWorkflow
+                                    auditWorkflow: list[i].auditWorkflow,
+                                    constructionStagesStr: list[i].constructionStagesStr
                                 }
                                 if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
                                     //分组负责人审核的情况下,前端不需要显示,无需设置
                                     copyData.projectAuditorId = list[i].projectAuditorId;
                                     copyData.projectAuditorName = list[i].projectAuditorName;
                                 }
-                                console.log(copyData);
                                 array.push(copyData);
                                 if (list[i].state >= 2) {
                                     this.canEdit = true;
@@ -2163,7 +2246,7 @@ export default {
                                 multiWorktime: t.multiWorktime,
                                 worktimeList: [{}],
                                 canEdit: true,
-
+                                constructionStages: [],
                                 auditorFirst: { name: '', id: '' },
                                 auditorSec: { name: '', id: '' },
                                 auditorThird: { name: '', id: '' },
@@ -2199,13 +2282,12 @@ export default {
                                 const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
                                 for(let domainsIndex in this.form.domains) {
                                     const projectItens = this.projectss.find(pro => pro.id == this.form.domains[domainsIndex].projectId) || {}
-                                    this.fZr(projectItens, domainsIndex, true)
+                                    this.selectProject(projectItens, domainsIndex, true)
                                     if(reportExtraField4Name || reportExtraField5Name) {
                                         this.getInfoByProjectId(projectItens.projectCode, domainsIndex, false)
                                     }
                                 }
                             }
-                            console.log(this.form.domains, '<===== this.form.domains')
                             if (this.isWeekend && this.user.timeType.lockWorktime != 1) {
                                 this.$set(this.form.domains[0], 'isOvertime', true)
                                 if (t.type != 2 && t.type != 0) {
@@ -2257,8 +2339,9 @@ export default {
                 auditorFirst: { name: '', id: '' },
                 auditorSec: { name: '', id: '' },
                 auditorThird: { name: '', id: '' },
-                ccUserid: { name: '', id: '' }
+                ccUserid: { name: '', id: '' },
             }]
+            this.form.abnormalTime = false;
             if (this.isWeekend && this.user.timeType.lockWorktime != 1) {
                 this.$set(this.form.domains[0], 'isOvertime', true)
                 if (t.type != 2 && t.type != 0) {
@@ -2306,6 +2389,29 @@ export default {
             item.showPickerRole = true;
             this.$forceUpdate();
         },
+        //点击选择施工分项工程
+        clickPickConstructionStage(i, item) {
+            if (!item.canEdit) return;
+            this.clickIndex = i;
+            item.showPickerConstruction = true;
+            this.$forceUpdate();
+        },
+        //施工分项工程显示
+        choseConstruction() {
+            this.form.domains[this.clickIndex].showPickerConstruction = false;
+            var list = this.form.domains[this.clickIndex].constructionStages;
+            var string = '';
+            for (var i=0;i<list.length; i++) {
+                if (list[i].finishNumber > 0) {
+                    string += list[i].name + '('+list[i].finishNumber+ '), ';
+                }
+            }
+            if (string.length > 0) {
+                string = string.substring(0, string.length-2);
+            }
+            this.form.domains[this.clickIndex].constructionStagesStr = string;
+            this.$forceUpdate();
+        },
 
         //点击选择子项目
         clickPickSubProject(i, item) {
@@ -2668,7 +2774,8 @@ export default {
                 multiWorktime: this.reportTimeType.multiWorktime,
                 worktimeList: [{}],
                 degreeId: null,
-                canEdit: true
+                canEdit: true,
+                constructionStages: [],
             }
             if (this.isWeekend && this.user.timeType.lockWorktime != 1) {
                 this.$set(item, 'isOvertime', true)
@@ -2923,7 +3030,7 @@ export default {
             }
             //非代填情况下要校验考勤
             if (!this.substitute) {
-                if ((this.user.companyId <= 10 || this.user.companyId == 8555) && this.form.abnormalTime) {
+                if ((this.user.companyId == 8555) && this.form.abnormalTime) {
                     //异常上报情况,需要上传图片
                     var findImg = false;
                     for (var t=0;t<this.form.domains.length; t++) {
@@ -3006,7 +3113,9 @@ export default {
                         if(!customDegreeMultiple) { // 单选
                             formData.append("degreeId", this.form.domains[i].degreeId);
                         } else {
-                            let newDegreeId = Array.isArray(this.form.domains[i].degreeId) ? this.form.domains[i].degreeId : this.form.domains[i].degreeId.split(',')
+                            // console.log('this.form.domains[i].degreeId', this.form.domains[i].degreeId);
+                            let newDegreeId = Array.isArray(this.form.domains[i].degreeId) ? this.form.domains[i].degreeId: this.form.domains[i].degreeId.split(',');
+                            // let newDegreeId = this.form[formIndex].domains[i].degreeId.split(',')
                             formData.append("multiDegrId", JSON.stringify(newDegreeId).replace(/,/g, '@'))
                         }
                     } else {
@@ -3178,7 +3287,10 @@ export default {
                                     //有项目审核节点,但是没有选中项目审核人,需要提示
                                     this.$toast.fail("请指定[" + this.form.domains[i].projectName + ']项目的审核人');
                                     return;
-                                } 
+                                } else {
+                                    //没有项目审核节点,也没有设置审核人,需要对齐数组,传一个null过去
+                                    formData.append("projectAuditorId", null);
+                                }
                             }
                         } else {
                             //无审批流
@@ -3211,6 +3323,10 @@ export default {
                     formData.append('extraField2', this.form.domains[i].extraField2);
                     formData.append('extraField3', this.form.domains[i].extraField3);
                 }
+                if (this.user.companyId == 10 || this.user.companyId == 4811 ) {
+                    let constructionStagesStr = JSON.stringify(this.form.domains[i].constructionStages).replace(/,/g,"@");
+                    formData.append('constructionStagesStr', constructionStagesStr);
+                }
                 if (this.user.companyId == 3092) {
                     formData.append('sapServiceId', this.form.domains[i].sapServiceId);
                 }
@@ -3234,7 +3350,7 @@ export default {
                     formData.append('extraField5', this.form.domains[i].extraField5 || '');
                 }
                 //羲合超导的异常工时上报
-                if (this.user.companyId <= 10 || this.user.companyId == 8555) {
+                if (this.user.companyId == 8555) {
                     formData.append("abnormalTime", this.form.abnormalTime);
                 }
             }
@@ -3345,6 +3461,160 @@ export default {
                     this.$toast.fail('获取失败:'+res.msg);
                 }
             }).catch(err=> {this.$toast.clear();});
+        },
+        
+        // 显示人员选择器
+        showEmployeeSelector(index, item) {
+            if (!item.canEdit) return;
+            
+            this.employeeSelector.currentIndex = index;
+            this.employeeSelector.selectedEmployees = [];
+            
+            // 如果已有选中的人员,解析并预设选中状态
+            if (item.customText) {
+                const existingIds = item.customText.split(',').map(emp => {
+                    const parts = emp.split('-');
+                    return parts[0];
+                });
+                this.employeeSelector.selectedEmployees = existingIds;
+            }
+            
+            // 调用接口获取分组人员
+            const toast = this.$toast.loading({
+                forbidClick: true,
+                duration: 0,
+                message: '加载中...'
+            });
+            
+            this.$axios.post('/employee/listByGroup', {
+                companyId: this.user.companyId
+            })
+            .then(res => {
+                this.$toast.clear();
+                if (res.code == 'ok') {
+                    // 处理返回的数据,添加选中状态
+                    this.employeeSelector.groupList = (res.data || []).map(group => {
+                        return {
+                            ...group,
+                            checked: false,
+                            indeterminate: false,
+                            employeeList: (group.employeeList || []).map(emp => {
+                                return {
+                                    ...emp,
+                                    checked: this.employeeSelector.selectedEmployees.includes(String(emp.id))
+                                };
+                            })
+                        };
+                    });
+                    
+                    // 更新分组的选中状态
+                    this.updateGroupCheckStatus();
+                    
+                    this.employeeSelector.show = true;
+                } else {
+                    this.$toast.fail('获取人员列表失败: ' + res.msg);
+                }
+            })
+            .catch(err => {
+                this.$toast.clear();
+                this.$toast.fail('获取人员列表失败');
+                console.error(err);
+            });
+        },
+        
+        // 更新分组的选中状态
+        updateGroupCheckStatus() {
+            this.employeeSelector.groupList.forEach(group => {
+                const checkedCount = group.employeeList.filter(emp => emp.checked).length;
+                const totalCount = group.employeeList.length;
+                
+                if (checkedCount === 0) {
+                    group.checked = false;
+                    group.indeterminate = false;
+                } else if (checkedCount === totalCount) {
+                    group.checked = true;
+                    group.indeterminate = false;
+                } else {
+                    group.checked = false;
+                    group.indeterminate = true;
+                }
+            });
+        },
+        
+        // 切换分组选中状态
+        toggleGroupCheck(group) {
+            const newCheckedState = !group.checked;
+            group.checked = newCheckedState;
+            group.indeterminate = false;
+            
+            // 同步更新该分组下所有人员的选中状态
+            group.employeeList.forEach(emp => {
+                emp.checked = newCheckedState;
+            });
+            
+            this.$forceUpdate();
+        },
+        
+        // 分组复选框变化事件
+        onGroupCheckChange(group) {
+            // 当分组复选框状态改变时,同步更新所有子人员
+            group.indeterminate = false;
+            group.employeeList.forEach(emp => {
+                emp.checked = group.checked;
+            });
+            this.$forceUpdate();
+        },
+        
+        // 切换人员选中状态
+        toggleEmployeeCheck(employee, group) {
+            employee.checked = !employee.checked;
+            this.updateGroupCheckStatus();
+            this.$forceUpdate();
+        },
+        
+        // 人员复选框变化事件
+        onEmployeeCheckChange(employee, group) {
+            this.updateGroupCheckStatus();
+            this.$forceUpdate();
+        },
+        
+        // 确认选择人员
+        confirmEmployeeSelection() {
+            const selectedEmployees = [];
+            
+            // 收集所有选中的人员
+            this.employeeSelector.groupList.forEach(group => {
+                group.employeeList.forEach(emp => {
+                    if (emp.checked) {
+                        selectedEmployees.push({
+                            id: emp.id,
+                            name: emp.name
+                        });
+                    }
+                });
+            });
+            
+            if (selectedEmployees.length === 0) {
+                this.$toast.fail('请至少选择一名人员');
+                return;
+            }
+            
+            // 格式化数据:id-name,多个用中文逗号隔开
+            const customText = selectedEmployees.map(emp => `${emp.id}-${emp.name}`).join(',');
+            const customTextShow = selectedEmployees.map(emp => emp.name).join(',');
+            
+            // 更新表单数据
+            this.form.domains[this.employeeSelector.currentIndex].customText = customText;
+            this.form.domains[this.employeeSelector.currentIndex].customTextShow = customTextShow;
+            this.form.domains[this.employeeSelector.currentIndex].customData = selectedEmployees.length;
+            // 关闭弹窗
+            this.employeeSelector.show = false;
+            this.$forceUpdate();
+        },
+        
+        // 取消选择人员
+        cancelEmployeeSelection() {
+            this.employeeSelector.show = false;
         }
     },
 
@@ -3425,6 +3695,9 @@ export default {
                 // this.determineQrcode(0)
             }, 1000)
         }
+        if (this.user.companyId == 10 || this.user.companyId == 4811) {
+            this.getConstructionStageList();
+        }
     },
     beforeDestroy() {
         localStorage.removeItem('formVal')
@@ -3604,6 +3877,89 @@ export default {
 .van-checkbox__label--disabled {
     color: #c8c9cc !important;
 }
+
+/* 人员选择器样式 */
+.employeeSelectorPopup {
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    background: #f7f8fa;
+}
+
+.employeeSelectorHeader {
+    padding: 16px;
+    background: #fff;
+    border-bottom: 1px solid #ebedf0;
+    text-align: center;
+}
+
+.employeeSelectorTitle {
+    font-size: 16px;
+    font-weight: 500;
+    color: #323233;
+}
+
+.employeeSelectorContent {
+    flex: 1;
+    overflow-y: auto;
+    padding: 8px 0;
+}
+
+.employeeGroup {
+    margin-bottom: 8px;
+    background: #fff;
+}
+
+.employeeGroupHeader {
+    padding: 12px 16px;
+    background: #f7f8fa;
+    border-bottom: 1px solid #ebedf0;
+}
+
+.groupName {
+    font-size: 15px;
+    font-weight: 500;
+    color: #323233;
+    margin-right: 4px;
+}
+
+.groupCount {
+    font-size: 13px;
+    color: #969799;
+}
+
+.employeeList {
+    background: #fff;
+}
+
+.employeeItem {
+    padding: 12px 16px;
+    border-bottom: 1px solid #ebedf0;
+}
+
+.employeeItem:last-child {
+    border-bottom: none;
+}
+
+.employeeSelectorFooter {
+    display: flex;
+    padding: 10px 16px;
+    background: #fff;
+    border-top: 1px solid #ebedf0;
+}
+
+.employeeSelectorBtn {
+    flex: 1;
+    margin: 0 4px;
+}
+
+.employeeSelectorBtn:first-child {
+    margin-left: 0;
+}
+
+.employeeSelectorBtn:last-child {
+    margin-right: 0;
+}
 </style>
 
 

+ 280 - 8
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -266,12 +266,18 @@
                         </van-popup>
 
                         <!-- 自定义数值 -->
-                        <van-field v-if="user.timeType.customDataActive==1" type="number" v-model="item.customData" :label="user.timeType.customDataName" 
+                        <van-field v-if="user.timeType.customDataActive==1 && !(user.companyId == 4811)" type="number" v-model="item.customData" :label="user.timeType.customDataName" 
                             placeholder="请输入数字" ></van-field> 
                         <!-- 自定义文本 -->
-                        <van-field v-if="user.timeType.customTextActive==1" v-model="item.customText" :label="user.timeType.customTextName" 
-                            placeholder="请输入" maxlength="25"></van-field> 
-
+                        <van-field v-if="user.timeType.customTextActive==1 && user.companyId != 4811" v-model="item.customText" :label="user.timeType.customTextName" 
+                            placeholder="请输入" maxlength="25"></van-field>
+
+                        <!-- 人员选择 -->
+                        <van-field v-if="user.companyId == 4811" :disabled="item.state<=1"
+                            v-model="item.customTextShow" label="人员" placeholder="请选择人员" @click="showEmployeeSelector(index, item)"
+                            :rules="[{ required: true, message: '请选择人员'}]" ></van-field>
+                        <!-- 柘中的施工人数自定义,放人员下面-->
+                        <van-cell v-if="(user.companyId == 4811)" :title="user.timeType.customDataName" :value="item.customData" />
                         <van-cell title="专业进度" v-if="user.company.packageEngineering == 1">
                         </van-cell>
                         <van-field 
@@ -495,6 +501,44 @@
             <van-button  v-if="canCancel" block type="default" @click="cancel"> 撤销 </van-button>
         </div>
 
+        <!-- 人员选择器弹窗 -->
+        <van-popup v-model="employeeSelector.show" position="bottom" :style="{ height: '80vh' }">
+            <div class="employeeSelectorPopup">
+                <div class="employeeSelectorHeader">
+                    <span class="employeeSelectorTitle">选择人员</span>
+                </div>
+                <div class="employeeSelectorContent">
+                    <div v-for="(group, groupIndex) in employeeSelector.groupList" :key="groupIndex" class="employeeGroup">
+                        <!-- 分组标题 -->
+                        <div class="employeeGroupHeader">
+                            <van-checkbox 
+                                v-model="group.checked" 
+                                :indeterminate="group.indeterminate"
+                                @change="onGroupCheckChange(group)">
+                                <span class="groupName">{{ group.name || '未分组' }}</span>
+                                <span class="groupCount">({{ group.employeeList ? group.employeeList.length : 0 }}人)</span>
+                            </van-checkbox>
+                        </div>
+                        <!-- 人员列表 -->
+                        <div class="employeeList" v-if="group.employeeList && group.employeeList.length > 0">
+                            <div v-for="(employee, empIndex) in group.employeeList" :key="empIndex" 
+                                class="employeeItem">
+                                <van-checkbox 
+                                    v-model="employee.checked"
+                                    @change="onEmployeeCheckChange(employee, group)">
+                                    {{ employee.name }}
+                                </van-checkbox>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="employeeSelectorFooter">
+                    <van-button class="employeeSelectorBtn" @click="cancelEmployeeSelection">取消</van-button>
+                    <van-button class="employeeSelectorBtn" type="info" @click="confirmEmployeeSelection">确定</van-button>
+                </div>
+            </div>
+        </van-popup>
+
         <!-- 选择项目弹窗 -->
         <van-popup v-model="showPickerUserddp" position="bottom" style="height: 80%">
             <!-- <van-search v-model="userName" placeholder="请输入项目名称/编号" @clear="sea()" @blur="sea()" @search="sea()" @input="sea()"/>
@@ -643,9 +687,151 @@
                 wuqiId: '1071',
                 doYouWantToDisplayTheWorkOrder: true,
                 doYouWantToDisplayTheWorkOrderGongdan: true,
+                
+                // 人员选择器相关数据
+                employeeSelector: {
+                    show: false,
+                    groupList: [],
+                    selectedEmployees: [],
+                    currentIndex: 0
+                }
             };
         },
         methods: {
+            // 显示人员选择器
+            showEmployeeSelector(index, item) {
+                if (item.state <= 1) return;
+                
+                this.employeeSelector.currentIndex = index;
+                this.employeeSelector.selectedEmployees = [];
+                
+                // 如果已有选中的人员,解析并预设选中状态
+                if (item.customText) {
+                    const existingIds = item.customText.split(',').map(emp => {
+                        const parts = emp.split('-');
+                        return parts[0];
+                    });
+                    this.employeeSelector.selectedEmployees = existingIds;
+                }
+                
+                // 调用接口获取分组人员
+                const toast = this.$toast.loading({
+                    forbidClick: true,
+                    duration: 0,
+                    message: '加载中...'
+                });
+                
+                this.$axios.post('/employee/listByGroup', {
+                    companyId: this.user.companyId
+                })
+                .then(res => {
+                    this.$toast.clear();
+                    if (res.code == 'ok') {
+                        // 处理返回的数据,添加选中状态
+                        this.employeeSelector.groupList = (res.data || []).map(group => {
+                            return {
+                                ...group,
+                                checked: false,
+                                indeterminate: false,
+                                employeeList: (group.employeeList || []).map(emp => {
+                                    return {
+                                        ...emp,
+                                        checked: this.employeeSelector.selectedEmployees.includes(String(emp.id))
+                                    };
+                                })
+                            };
+                        });
+                        
+                        // 更新分组的选中状态
+                        this.updateGroupCheckStatus();
+                        
+                        this.employeeSelector.show = true;
+                    } else {
+                        this.$toast.fail('获取人员列表失败: ' + res.msg);
+                    }
+                })
+                .catch(err => {
+                    this.$toast.clear();
+                    this.$toast.fail('获取人员列表失败');
+                    console.error(err);
+                });
+            },
+            
+            // 更新分组的选中状态
+            updateGroupCheckStatus() {
+                this.employeeSelector.groupList.forEach(group => {
+                    const checkedCount = group.employeeList.filter(emp => emp.checked).length;
+                    const totalCount = group.employeeList.length;
+                    
+                    if (checkedCount === 0) {
+                        group.checked = false;
+                        group.indeterminate = false;
+                    } else if (checkedCount === totalCount) {
+                        group.checked = true;
+                        group.indeterminate = false;
+                    } else {
+                        group.checked = false;
+                        group.indeterminate = true;
+                    }
+                });
+            },
+            
+            // 分组复选框变化事件
+            onGroupCheckChange(group) {
+                // 当分组复选框状态改变时,同步更新所有子人员
+                group.indeterminate = false;
+                group.employeeList.forEach(emp => {
+                    emp.checked = group.checked;
+                });
+                this.$forceUpdate();
+            },
+            
+            // 人员复选框变化事件
+            onEmployeeCheckChange(employee, group) {
+                this.updateGroupCheckStatus();
+                this.$forceUpdate();
+            },
+            
+            // 确认选择人员
+            confirmEmployeeSelection() {
+                const selectedEmployees = [];
+                
+                // 收集所有选中的人员
+                this.employeeSelector.groupList.forEach(group => {
+                    group.employeeList.forEach(emp => {
+                        if (emp.checked) {
+                            selectedEmployees.push({
+                                id: emp.id,
+                                name: emp.name
+                            });
+                        }
+                    });
+                });
+                
+                if (selectedEmployees.length === 0) {
+                    this.$toast.fail('请至少选择一名人员');
+                    return;
+                }
+                
+                // 格式化数据:id-name,多个用中文逗号隔开
+                const customText = selectedEmployees.map(emp => `${emp.id}-${emp.name}`).join(',');
+                const customTextShow = selectedEmployees.map(emp => emp.name).join(',');
+                
+                // 更新表单数据
+                this.currentForm.domains[this.employeeSelector.currentIndex].customText = customText;
+                this.currentForm.domains[this.employeeSelector.currentIndex].customTextShow = customTextShow;
+                this.currentForm.domains[this.employeeSelector.currentIndex].customData = selectedEmployees.length;
+
+                // 关闭弹窗
+                this.employeeSelector.show = false;
+                this.$forceUpdate();
+            },
+            
+            // 取消选择人员
+            cancelEmployeeSelection() {
+                this.employeeSelector.show = false;
+            },
+            
             // 时间选择
             timePickChange(item, filed) {
                 if(item.state <= 1) {
@@ -2417,8 +2603,7 @@
                                 if(!customDegreeMultiple) { // 单选
                                     formData.append("degreeId", this.form[formIndex].domains[i].degreeId);
                                 } else {
-                                    console.log(this.form[formIndex].domains[i].degreeId)
-                                    let newDegreeId = this.form[formIndex].domains[i].degreeId.split(',')
+                                    let newDegreeId = Array.isArray(this.form[formIndex].domains[i].degreeId) ? this.form[formIndex].domains[i].degreeId.degreeId: this.form[formIndex].domains[i].degreeId.split(',')
                                     formData.append("multiDegrId", JSON.stringify(newDegreeId).replace(/,/g, '@'))
                                 }
                             } else {
@@ -2951,7 +3136,7 @@
                                 projectAuditorId, projectAuditorName, projectId,
                                 projectName, state, taskId, taskName, overtimeHours,
                                 stage, taskGroups, isOvertime, workingTime, subProjectId, progress,
-                                multiDegrId, degreeId, degreeList
+                                multiDegrId, degreeId, degreeList, customText
                             } = arrayItem.reportList[j]
 
                             let newMultiDegrId = []
@@ -2965,6 +3150,16 @@
                                 newWeiduName = (degreeList || []).filter(s => newMultiDegrId.includes(+s.id)).map(s => s.name).join(',');
                             }
 
+                            // 处理customText,转换为customTextShow
+                            let customTextShow = '';
+                            if (customText && customText !== '-') {
+                                // customText格式: id-name,多个用中文逗号隔开
+                                customTextShow = customText.split(',').map(item => {
+                                    const parts = item.split('-');
+                                    return parts.length > 1 ? parts[1] : item;
+                                }).join(',');
+                            }
+
                             let newObj = {
                                 ...objectItem, id,
                                 endTime, startTime, content, groupId, groupName,
@@ -2974,7 +3169,9 @@
                                 isOvertime: isOvertime == 1 ? true : false,
                                 degreeId: !timeType.customDegreeMultiple ? degreeId : newMultiDegrId.join(','),
                                 radioPickDegree: !timeType.customDegreeMultiple ? degreeId : newMultiDegrId,
-                                wuduList: degreeList, weiduName: newWeiduName
+                                wuduList: degreeList, weiduName: newWeiduName,
+                                customText: customText || '',
+                                customTextShow: customTextShow
                             }
                             list.push(newObj)
                         }
@@ -3291,5 +3488,80 @@
         width: 50%;
         text-align: center;
     }
+    
+    /* 人员选择器样式 */
+    .employeeSelectorPopup {
+        display: flex;
+        flex-direction: column;
+        height: 100%;
+        background: #f7f8fa;
+    }
+    
+    .employeeSelectorHeader {
+        padding: 16px;
+        background: #fff;
+        border-bottom: 1px solid #ebedf0;
+        text-align: center;
+    }
+    
+    .employeeSelectorTitle {
+        font-size: 16px;
+        font-weight: 500;
+        color: #323233;
+    }
+    
+    .employeeSelectorContent {
+        flex: 1;
+        overflow-y: auto;
+        padding: 8px 0;
+    }
+    
+    .employeeGroup {
+        margin-bottom: 8px;
+        background: #fff;
+    }
+    
+    .employeeGroupHeader {
+        padding: 12px 16px;
+        background: #f7f8fa;
+        border-bottom: 1px solid #ebedf0;
+    }
+    
+    .groupName {
+        font-size: 15px;
+        font-weight: 500;
+        color: #323233;
+    }
+    
+    .groupCount {
+        font-size: 13px;
+        color: #969799;
+        margin-left: 4px;
+    }
+    
+    .employeeList {
+        padding: 0 16px;
+    }
+    
+    .employeeItem {
+        padding: 12px 0;
+        border-bottom: 1px solid #ebedf0;
+    }
+    
+    .employeeItem:last-child {
+        border-bottom: none;
+    }
+    
+    .employeeSelectorFooter {
+        display: flex;
+        padding: 8px 16px;
+        background: #fff;
+        border-top: 1px solid #ebedf0;
+        gap: 12px;
+    }
+    
+    .employeeSelectorBtn {
+        flex: 1;
+    }
 </style>
 

+ 64 - 5
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/department_list.vue

@@ -96,6 +96,10 @@
                 nowTime: this.format(new Date(new Date()),"yyyy-MM-dd"),
                 showPicker: false,
                 report: [],
+                pageIndex: 1,
+                pageSize: 20,
+                loading: false,
+                finished: false,
             };
         },
         created() {
@@ -143,20 +147,70 @@
 
             // 获取待专业审核的日报列表
             getReport() {
+                if (this.loading || this.finished) {
+                    return;
+                }
+                
+                this.loading = true;
                 const toast = this.$toast.loading({
                     forbidClick: true,
                     duration: 0
                 });
-                this.$axios.post("/report/listByStateDepartment", {state:0})
+                this.$axios.post("/report/listByStateDepartment", {
+                    state: 0,
+                    pageIndex: this.pageIndex,
+                    pageSize: this.pageSize
+                })
                 .then(res => {
                     if(res.code == "ok") {
                         this.$toast.clear();
-                        this.report = res.data;
+                        if (res.data && res.data.records.length > 0) {
+                            // 拼接数据到现有的report数组
+                            this.report = this.report.concat(res.data.records);
+                            this.loading = false;
+                            
+                            // 如果返回的数据少于pageSize,说明没有更多数据了
+                            if (res.data.records.length < this.pageSize) {
+                                this.finished = true;
+                            }
+                        } else {
+                            // 没有数据返回,标记为已完成
+                            this.finished = true;
+                            this.loading = false;
+                        }
                     } else {
                         this.$toast.clear();
                         this.$toast.fail('获取失败:'+res.msg);
+                        this.loading = false;
                     }
-                }).catch(err=> {this.$toast.clear();});
+                }).catch(err=> {
+                    this.$toast.clear();
+                    this.loading = false;
+                });
+            },
+
+            // 滚动加载更多
+            handleScroll() {
+                const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
+                const clientHeight = document.documentElement.clientHeight;
+                const scrollHeight = document.documentElement.scrollHeight;
+                
+                // 当滚动到距离底部100px时,加载下一页
+                if (scrollTop + clientHeight >= scrollHeight - 100) {
+                    if (!this.loading && !this.finished) {
+                        this.pageIndex++;
+                        this.getReport();
+                    }
+                }
+            },
+
+            // 重置分页并重新加载
+            resetAndReload() {
+                this.pageIndex = 1;
+                this.report = [];
+                this.loading = false;
+                this.finished = false;
+                this.getReport();
             },
 
             approve(id, item) {
@@ -178,7 +232,7 @@
                         this.$toast.clear();
                         this.$toast.success('审核成功');
                         
-                        that.getReport();
+                        that.resetAndReload();
                     } else {
                         this.$toast.clear();
                         this.$toast.fail(res.msg);
@@ -203,7 +257,7 @@
                     if(res.code == "ok") {
                         this.$toast.clear();
                         this.$toast.success('驳回成功');
-                        this.getReport();
+                        this.resetAndReload();
                     } else {
                         this.$toast.clear();
                         this.$toast.fail(res.msg);
@@ -214,6 +268,11 @@
 
         mounted() {
             this.getReport();
+            window.addEventListener('scroll', this.handleScroll);
+        },
+
+        beforeDestroy() {
+            window.removeEventListener('scroll', this.handleScroll);
         }
     };
 </script>

+ 23 - 17
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -25,20 +25,6 @@
                     </template>
                 </van-cell>
                 <van-popup v-model="selectUserShow" position="bottom" style="height: 90%">
-                    <!-- <van-search v-model="searchInputValue" placeholder="输入员工姓名搜索" @search="userListSearch" v-if="user.userNameNeedTranslate != '1'"></van-search>
-                    <div style="minHeight:300px;">
-                        <template v-if="user.userNameNeedTranslate == '1'">
-                            <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
-                                <TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText>
-                            </van-checkbox>
-                        </template>
-                        <template v-else>
-                            <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
-                                <span>{{item.name}}</span>
-                            </van-checkbox>
-                        </template>
-                        <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="selectUserConfirm()">确定</van-button>
-                    </div> -->
                     <div class="popupDiv">
                         <div class="popupSearch" v-if="user.userNameNeedTranslate != '1'">
                             <van-search v-model="searchInputValue" placeholder="输入员工姓名搜索" @search="userListSearch" shape="round" background="#F4F4F4"></van-search>
@@ -140,6 +126,8 @@
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.groupName != null" >任务分组:{{item1.groupName}}</div>
                         <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作职责:{{item1.extraField2?item1.extraField2Name:''}}</div>
                         <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作内容:{{item1.extraField3?item1.extraField3Name:''}}</div>
+                        <!--陕西柘中施工分项工程-->
+                        <div class="project_title" v-if="(user.companyId == 4811 || user.companyId == 10)" >施工分项工程:{{item1.constructionStageStr}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-' && user.companyId != yuzhongCompId" >投入阶段:{{item1.stage}}</div>
                         <div class="project_title" v-if="user.timeType.reportExtraField4Name" >{{ user.timeType.reportExtraField4Name }}:{{item1.extraField4}}</div>
                         <div class="project_title" v-if="user.timeType.reportExtraField5Name" >{{ user.timeType.reportExtraField5Name }}:{{item1.extraField5}}</div>
@@ -161,7 +149,7 @@
                                 <span v-if="item1.reportTimeType == 2" style="margin-right:10px;">{{item1.startTime+'-'+item1.endTime}}</span>{{item1.time.toFixed(1)}}h
                                 <div class="button" v-if="item1.isOvertime == 1">加班<span v-if="item1.overtimeHours">{{item1.overtimeHours.toFixed(1)}}h</span></div>
                             </div>
-                            <div v-if="!user.timeType.hideContent" class="project_content">事项:<span v-html="item1.content"></span></div>
+                            <div v-if="!user.timeType.hideContent" class="project_content">事项:<span v-html="formatContent(item1.content)"></span></div>
                         </div>
                         <div v-if="item1.multiWorktime == 1">
                             <div>
@@ -174,7 +162,7 @@
                                     <span style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>{{timeItem.time.toFixed(1)}}h
                                     <span style="margin-left:5px;" v-if="timeItem.detail">{{ timeItem.detail }}</span>
                                 </div>
-                                <div v-if="!user.timeType.hideContent" class="project_content">事项:<span v-html="timeItem.content"></span></div>
+                                <div v-if="!user.timeType.hideContent" class="project_content">事项:<span v-html="formatContent(timeItem.content)"></span></div>
                             </div>
                         </div>
                         <div style="padding:5px;text-align:center;" v-if="item1.pics != null && item1.pics.length > 0">
@@ -220,6 +208,7 @@
     export default {
         data() {
             return {
+                allConstructionStages:[],
                 isBatchDeny: false,
                 yuzhongCompId: 3385,
                 roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
@@ -256,6 +245,11 @@
         created() {
         },
         methods: {
+            // 格式化content内容,将换行符转换为<br>标签
+            formatContent(content) {
+                if (!content) return '';
+                return content.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>').replace(/\r/g, '<br>');
+            },
             selectDateClear(){
                 this.selectDate = []
                 this.selectDateValue = ''
@@ -465,6 +459,7 @@
                     if(res.code == "ok") {
                         this.$toast.clear();
                         this.report = res.data;
+                        console.log(this.report)
                         // this.isAllChecked = this.report.length == 0 ? false : true
                         if(this.report.length == 0){
                             this.isAllChecked = false
@@ -529,7 +524,15 @@
                     }
                 }).catch(err=> {this.$toast.clear();});
             },
-
+            getConstructionStageList(){
+                let that = this;
+                this.$axios.post("/construction-stage/list", null)
+                .then(res => {
+                    if(res.code == "ok") {
+                        this.allConstructionStages = res.data;
+                    }
+                }).catch(err=> {this.$toast.clear();});
+            },
             showDenyDialog(id,i,date, item) {
                 this.denyReasonDialog = true;
                 this.isBatchDeny = false;
@@ -614,6 +617,9 @@
                     this.flg = true
                 }
             }
+            if (this.user.companyId == 10 || this.user.companyId == 4811) {
+                this.getConstructionStageList();
+            }
         }
     };
 </script>

+ 23 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/view/index.vue

@@ -132,6 +132,8 @@
                                     工作职责:{{ item1.extraField2 ? item1.extraField2Name : '' }}</div>
                                 <div class="project_title" v-if="user.companyId == yuzhongCompId">
                                     工作内容:{{ item1.extraField3 ? item1.extraField3Name : '' }}</div>
+                                <!--陕西柘中施工分项工程-->
+                                <div class="project_title" v-if="(user.companyId == 4811 || user.companyId == 10)" >施工分项工程:{{item1.constructionStageStr}}</div>
                                 <div class="project_title" v-if="user.company.packageProject == 1 && item1.stage != '-'">
                                     投入阶段:{{ item1.stage }}</div>
                                 <!--自定义维度 -->
@@ -163,7 +165,7 @@
                                         {{ item1.progress }}%
                                     </div>
                                     
-                                    <div v-if="!user.timeType.hideContent" class="project_content">事项:<span v-html="item1.content"></span></div>
+                                    <div v-if="!user.timeType.hideContent" class="project_content">事项:<span v-html="formatContent(item1.content)"></span></div>
 
                                 </div>
                                 <div v-if="item1.multiWorktime == 1">
@@ -179,7 +181,7 @@
                                             }}</span>{{ timeItem.time.toFixed(1) }}h 
                                             <span style="margin-left:5px;" v-if="timeItem.detail">{{ timeItem.detail }}</span>
                                         </div>
-                                        <div class="project_content">事项:<span v-html="timeItem.content"></span></div>
+                                        <div class="project_content">事项:<span v-html="formatContent(timeItem.content)"></span></div>
                                     </div>
                                 </div>
                                 <div style="padding:5px;text-align:center;" v-if="item1.pics != null && item1.pics.length > 0">
@@ -324,7 +326,8 @@ export default {
             },
             reportsCompany: false,
             reportsDept: false,
-            hideWorkingHours: false
+            hideWorkingHours: false,
+            allConstructionStages: []
         };
     },
     created() {
@@ -343,7 +346,11 @@ export default {
         },
     },
     methods: {
-        
+        // 格式化content内容,将换行符转换为<br>标签
+        formatContent(content) {
+            if (!content) return '';
+            return content.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>').replace(/\r/g, '<br>');
+        },
         onDownRefresh() {
             this.pageIndex = 1
             this.upFinished = false // 不写这句会导致你上拉到底过后在下拉刷新将不能触发下拉加载事件
@@ -566,6 +573,15 @@ export default {
                     date: this.nowTime
                 }
             });
+        },
+        getConstructionStageList(){
+            let that = this;
+            this.$axios.post("/construction-stage/list", null)
+            .then(res => {
+                if(res.code == "ok") {
+                    this.allConstructionStages = res.data;
+                }
+            }).catch(err=> {this.$toast.clear();});
         }
     },
     mounted() {
@@ -588,6 +604,9 @@ export default {
         this.getReport();
         this.getUsers()
         this.getDepartmentList()
+        if (this.user.companyId == 10 || this.user.companyId == 4811) {
+            this.getConstructionStageList();
+        }
     }
 };
 </script>