Bläddra i källkod

提交前端代码

Lijy 1 månad sedan
förälder
incheckning
e75929cce3

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

@@ -283,6 +283,9 @@
                                                         {{$t('other.taskGroup')}}:{{item2.groupName}}
                                                         <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
                                                     </p>
+                                                    <!-- 工单号,行号 -->
+                                                    <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
+                                                    <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
                                                     <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
                                                     <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
                                                     <!-- 自定义日报文本 -->
@@ -333,7 +336,6 @@
                                                         </div>
                                                     </div>
                                                     <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
-                                                    
                                                     <!--照片的显示 -->
                                                     <p v-if="item2.pics != null && item2.pics.length > 0"> 
                                                         <el-image v-for="(pic, index) in item2.pics" :key="index"
@@ -604,6 +606,21 @@
                                 </el-select>
                             </template>
                         </el-form-item>
+
+                        <!-- 工单号,行号 -->
+                        <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
+                            <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
+                                <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
+                            <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
+                                <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+
                         <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && user.timeType.reportAuditType != 10 && domain.auditUserList">
                             <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
                                 <template slot="label">
@@ -1129,6 +1146,23 @@
                             <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
                     </el-select>
                 </div>
+                <!-- 工单号,行号 -->
+                <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
+                    <p>{{ user.timeType.reportExtraField4Name }}</p>
+                    <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange"  filterable style="width: 355px" clearable>
+                        <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
+                        </el-option>
+                    </el-select>
+                </div>
+
+                <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
+                    <p>{{ user.timeType.reportExtraField5Name }}</p>
+                    <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange"  filterable style="width: 355px" clearable>
+                        <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
+                        </el-option>
+                    </el-select>
+                </div>
+
                 <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
                     <p>{{$t('other.reviewer')}}</p>
                     <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
@@ -1715,7 +1749,7 @@
           <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
           <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
         </el-tab-pane>
-        <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1">
+        <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1">
           <div class="selectworktime_export" style="margin-top:10px">
             <div class="selectworktime_export_l">
               <el-date-picker
@@ -2629,7 +2663,7 @@
                 reportLogCheckDialog:false,
                 deptIdForHasReport:[],
                 transferWorkingHoursVisable: false,
-                multiOptionData:[],
+                multiOptionData:[]
             };
         },
         watch: {
@@ -4873,6 +4907,7 @@
                 if(this.yonghuUser.customDegreeActive == 1) {
                     this.selectDegreeId(domain, index)
                 }
+                
                 domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
                 domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
                 this.http.post('/sub-project/list',{
@@ -4886,7 +4921,7 @@
                         this.workForm.domains[index].subProjectList = res.data;
                         this.workForm.domains[index].subProjectId = null;
                         this.$forceUpdate();
-                    } 
+                    }
                 },
                 error => {
                     this.$message({
@@ -4930,8 +4965,38 @@
                 if (this.user.companyId == this.yuzhongCompId) {
                    this.updateResponse(domain);
                 }
-            },
 
+                const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+                if(reportExtraField4Name || reportExtraField5Name) {
+                    this.getInfoByProjectId(domain, index)
+                }
+            },
+            getInfoByProjectId(domain, index, flag = true) {
+                const { projectId } = domain
+                const projectList = this.fillProjectList || this.subFillProjectList
+                const { projectCode = '' } = projectList.find(item => item.id == projectId)
+                this.http.post('/erpOrderInfo/getInfoByProjectId',{
+                    projectId: projectCode
+                },
+                res => {
+                    if (res.code == "ok") {
+                        if(flag) {
+                            this.workForm.domains[index].extraField4 = ''
+                            this.workForm.domains[index].extraField5 = ''
+                        }
+                        this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
+                        this.workForm.domains[index].reportExtraField5List = res.data.lines || []
+                        this.$forceUpdate();
+                    } 
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    }
+                );
+            },
             getRecentTaskList(domain, index) {
                 //刷新任务时,清空服务
                 this.$set(domain, 'sapServiceId', null);
@@ -6356,6 +6421,7 @@
                             var arr = [];
                             this.canEdit = false;
                             let candelete = true
+                            const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
                             for(var i in list.report) {
                                 var flg = null
                                 list.report[i].isOvertime == 1 ? flg = true : flg = false
@@ -6406,6 +6472,8 @@
                                     extraField1: list.report[i].extraField1,
                                     extraField2: list.report[i].extraField2,
                                     extraField3: list.report[i].extraField3,
+                                    extraField4: list.report[i].extraField4,
+                                    extraField5: list.report[i].extraField5,
                                     workContentList: list.report[i].workContentList,
                                     filteredRespList: filteredRespList,
                                     serviceList: list.report[i].serviceList,
@@ -6440,6 +6508,9 @@
                                     arr[i].imgListUrl = arrList
                                     arr[i].imgList = list.report[i].pics
                                 }
+                                if(reportExtraField4Name || reportExtraField5Name) {
+                                    this.getInfoByProjectId(copyData, i, false)
+                                }
                             }
                             this.reportCanDelete = candelete
                             this.workForm = {
@@ -6589,6 +6660,7 @@
 
             //按周填报的弹窗口中编辑单项目相关数据
             setWeekFormReportItem(reportId, i, names, row,sss) {
+                const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
                 this.http.post('/report/getReportById', {
                     reportId: reportId
                 },
@@ -6605,6 +6677,10 @@
                         sss.degreeId = data.degreeId;
                         sss.customData = data.customData;
                         sss.wuduList = data.degreeList;
+                        if(reportExtraField4Name || reportExtraField5Name) {
+                            sss.extraField4 = data.extraField4 || ''
+                            sss.extraField5 = data.extraField5 || ''
+                        }
                         this.zhoBaoIdx = i
                         this.zhoBaoName = names
                         this.zhoBao = sss
@@ -6613,6 +6689,9 @@
                             //最后一个参数表示是否保留stage的值,不要重置为空
                             this.getGroupStages(this.zhoBao, 0, true)
                         }
+                        if(reportExtraField4Name || reportExtraField5Name) {
+                            this.weekGetInfoByProjectId(sss)
+                        }
                         this.$forceUpdate();
                     }
                 });
@@ -6710,6 +6789,7 @@
                     sss.basecostId = this.timeBasecostList[0].id;
                 }
                 var hasEdited = this.zhoData[i][names].hasEdited;
+
                 if (hasEdited) {
                     console.log('执行到了这个')
                     console.log('执行到了这个', { ...item }, obj)
@@ -6776,8 +6856,36 @@
                         //编辑填报过的;数据库已经存在的
                         this.setWeekFormReportItem(sss.id, i, names, row, sss);
                     }
+
+                    if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
+                        this.weekGetInfoByProjectId(sss)
+                    }
                 }
             },
+            weekGetInfoByProjectId(item) {
+                console.log(item, '<=== item')
+                const { projectId } = item
+                const projectList = this.fillProjectList || this.subFillProjectList
+                const { projectCode = '' } = projectList.find(item => item.id == projectId)
+                this.http.post('/erpOrderInfo/getInfoByProjectId',{
+                    projectId: projectCode
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.zhoBao.reportExtraField4List = res.data.orderIds || []
+                        this.zhoBao.reportExtraField5List = res.data.lines || []
+                        this.$forceUpdate();
+                    } 
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+                // console.log(item)
+                // console.log(this.zhoBao)
+            },
             // 按周填报里内容的填写点击确定
             setWeekProItemData() {
                 //专业版模式下,任务分组和阶段必填
@@ -7377,6 +7485,7 @@
             submitWeekReport(isDraft) {
                 var zhi = this.zhoData
                 var ll = 0
+                const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
                 if(this.reportTimeType.type == 2) {
                     for(var i in zhi) {
                         this.dateAr = []
@@ -7556,6 +7665,11 @@
                                     }else if(this.user.timeType.customTextActive){
                                         formData.append('customText','-')
                                     }
+
+                                    if(reportExtraField4Name || reportExtraField5Name) {
+                                        formData.append('extraField4', zhoD[j].extraField4 || '')
+                                        formData.append('extraField5', zhoD[j].extraField5 || '')
+                                    }
                                 }
                             }
                         }
@@ -7646,6 +7760,11 @@
                                         }else if(this.user.timeType.customTextActive){
                                             formData.append('customText','-')
                                         }
+
+                                        if(reportExtraField4Name || reportExtraField5Name) {
+                                            formData.append('extraField4', zhoD[j].extraField4 || '')
+                                            formData.append('extraField5', zhoD[j].extraField5 || '')
+                                        }
                                     }
                                 }
                             } else {
@@ -7738,6 +7857,11 @@
                                         }else if(this.user.timeType.customTextActive){
                                             formData.append('customText','-')
                                         }
+
+                                        if(reportExtraField4Name || reportExtraField5Name) {
+                                            formData.append('extraField4', zhoD[j].extraField4 || '')
+                                            formData.append('extraField5', zhoD[j].extraField5 || '')
+                                        }
                                     }
                                 }
                             }
@@ -8622,6 +8746,13 @@
                             if(this.user.timeType.userWithMultiDept == 1) {
                                 formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
                             }
+
+                            if(this.user.timeType.reportExtraField4Name) {
+                                formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
+                            }
+                            if(this.user.timeType.reportExtraField5Name) {
+                                formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
+                            }
                         }
                         this.submitingReport = true;
                         this.http.uploadFile( this.port.report.editPort, formData,

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/dailyReportReview.vue

@@ -160,6 +160,9 @@
                                       <!-- 阶段 -->
                                       <span v-if="item.stage != null && user.companyId != yuzhongCompId" style="margin-left:10px;"> {{$t('other.inputStage')}}:{{item.stage}}</span>
                                   </p>
+                                  <!-- 工单号,行号 -->
+                                  <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item.extraField4 }}</p>
+                                  <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item.extraField5 }}</p>
                                   <p v-if="user.company.companyName == '成都明夷电子科技有限公司'">
                                       <span>{{ $t('lable.percentageOfTime') }} :{{ item.progress }}%</span>
                                   </p>