Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

yusm před 1 týdnem
rodič
revize
1d3a77a090

+ 17 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -44,6 +44,10 @@
                         <el-button @click="backToParentDept" size="small">返回上级</el-button>
                     </div>
 
+                    <template v-if="singleChoiceType == '工单'">
+                        <el-cascader v-model="departmentValue" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable filterable size="small" placeholder="请选择部门" @change="filterConditionSwitching"></el-cascader>
+                    </template>
+
                     <el-select v-model="projectStatus" placeholder="请选择项目状态" clearable @change="filterConditionSwitching" v-if="singleChoiceType == '项目'" size="small" style="margin-right: 10px">
                         <el-option label="进行中" value="1"></el-option>
                         <el-option label="已完成" value="2"></el-option>
@@ -152,6 +156,8 @@ export default {
             hasReportUserList: [],
             theCustomListFlgBtnLoading: false,
             projectStatus: '',
+            departmentList: [],
+            departmentValue: []
         }
     },
 
@@ -220,7 +226,7 @@ export default {
                 },
                 ['工单']: {
                     url: '/project/getTimeCostByWorkNum',
-                    extraParams: { }
+                    extraParams: { deptId: this.departmentValue[this.departmentValue.length - 1] }
                 },
                 [this.namess]: {
                     url: '/project/getDegreeCost',
@@ -1083,6 +1089,7 @@ export default {
             this.postData(url, {
                 startDate: this.chartDate[0],
                 endDate: this.chartDate[1],
+                deptId: this.departmentValue[this.departmentValue.length - 1]
             }).then((res) => {
                 const aTag = document.createElement('a');
                 aTag.download = fileName;
@@ -1092,6 +1099,11 @@ export default {
                 this.reportExportLoading = false
             })
         },
+        obtainDepartment() {
+            this.postData(`/department/list`, {}).then((res) => {
+                this.departmentList = res.data || []
+            })
+        },
         // 单独封装请求
         async postData(urls, param) {
             return new Promise((resolve, reject) => {
@@ -1130,6 +1142,10 @@ export default {
             this.getEchart()
             this.scrollFunction()
         }, 300)
+
+        if(this.user.companyId == '7536') {
+            this.obtainDepartment()
+        }
     }
 }
 </script>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/project.js

@@ -40,6 +40,6 @@ export const summaryOverviewList = [
   { label: "已逾期", filed: 'timeupCount', style: 'color: red;' },
   { label: "待认领", filed: 'unassignCount', style: 'color: orange;' },
   { label: "今日到期", filed: 'todayTimeupCount', style: 'color: pink;' },
-  { label: "期完成", filed: 'timeupFinishCount', style: 'color: gray;' },
+  { label: "期完成", filed: 'timeupFinishCount', style: 'color: gray;' },
   { label: "时间待定", filed: 'timeunsetCount', style: 'color: black;' },
 ]

+ 14 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -5110,7 +5110,7 @@
                 }
 
                 const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
-                if(reportExtraField4Name || reportExtraField5Name) {
+                if((reportExtraField4Name || reportExtraField5Name) && domain.groupId) {
                     this.getInfoByProjectId(domain, index)
                 }
             },
@@ -5118,9 +5118,10 @@
                 const { projectId } = domain
                 const projectList = this.fillProjectList || this.subFillProjectList
                 const { projectCode = '' } = projectList.find(item => item.id == projectId)
-                this.http.post('/erpOrderInfo/getInfoByProjectId',{
+                this.http.post('/erpOrderInfo/getInfoByProjectIdAndGroupId',{
                     projectId: projectCode,
-                    date: this.isBatch == 0 ? this.workForm.createDate : this.workForm.createDate[1]
+                    date: this.isBatch == 0 ? this.workForm.createDate : this.workForm.createDate[1],
+                    groupId: domain.groupId
                 },
                 res => {
                     if (res.code == "ok") {
@@ -5268,6 +5269,10 @@
                         domain.extraField4 = ''
                         domain.extraField5 = ''
                     }
+
+                    if(groupId) {
+                        this.getInfoByProjectId(domain, index, true)
+                    }
                 }
                 console.log(domain);
                 if(!domain.groupId){
@@ -6667,7 +6672,7 @@
                                     arr[i].imgListUrl = arrList
                                     arr[i].imgList = list.report[i].pics
                                 }
-                                if((reportExtraField4Name || reportExtraField5Name) && list.report[i].state >= 2) {
+                                if((reportExtraField4Name || reportExtraField5Name) && list.report[i].state >= 2 && copyData.groupId) {
                                     this.getInfoByProjectId(copyData, i, false)
                                 }
                             }
@@ -6888,7 +6893,7 @@
                             //最后一个参数表示是否保留stage的值,不要重置为空
                             this.getGroupStages(this.zhoBao, 0, true)
                         }
-                        if(reportExtraField4Name || reportExtraField5Name) {
+                        if((reportExtraField4Name || reportExtraField5Name) && sss.groupId) {
                             this.weekGetInfoByProjectId(sss)
                         }
                         this.$forceUpdate();
@@ -7060,7 +7065,7 @@
                         this.setWeekFormReportItem(sss.id, i, names, row, sss);
                     }
 
-                    if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
+                    if((this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) && sss.groupId) {
                         setTimeout(() => {
                             this.weekGetInfoByProjectId(sss)
                         }, 1000)
@@ -7072,9 +7077,10 @@
                 const { projectId } = item
                 const projectList = this.fillProjectList || this.subFillProjectList
                 const { projectCode = '' } = projectList.find(item => item.id == projectId)
-                this.http.post('/erpOrderInfo/getInfoByProjectId',{
+                this.http.post('/erpOrderInfo/getInfoByProjectIdAndGroupId',{
                     projectId: projectCode,
-                    date: this.zhoData[this.zhoBaoIdx].zhoDataTime
+                    date: this.zhoData[this.zhoBaoIdx].zhoDataTime,
+                    groupId: item.groupId
                 },
                 res => {
                     if (res.code == "ok") {

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

@@ -1225,16 +1225,17 @@ export default {
                 this.updateResponse(domainItem);
             }
             // 工单号,行号
-            const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
-            if((reportExtraField4Name || reportExtraField5Name) && !flag) {
-                this.getInfoByProjectId(item.projectCode)
-            }
+            // const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+            // if((reportExtraField4Name || reportExtraField5Name) && !flag) {
+            //     this.getInfoByProjectId(item.projectCode)
+            // }
         },
         getInfoByProjectId(projectCode, index = null, flag = true) {
-            const { projectId } = this.form.domains[this.clickIndex];
-            this.$axios.post("/erpOrderInfo/getInfoByProjectId", { 
+            const { projectId, groupId = '' } = this.form.domains[this.clickIndex];
+            this.$axios.post("/erpOrderInfo/getInfoByProjectIdAndGroupId", { 
                 projectId: projectCode,
-                date: this.form.createDate
+                date: this.form.createDate,
+                groupId: groupId
             })
                 .then(res => {
                     if (res.code == "ok") {
@@ -2394,6 +2395,14 @@ export default {
                 } else {
                     this.doYouWantToDisplayTheWorkOrderGongdan = true
                 }
+
+                const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+                if((reportExtraField4Name || reportExtraField5Name) && value.id) {
+                    console.log(this.form.domains[this.clickIndex], '<==== this.form.domains[this.clickIndex]')
+                    const { projectId } = this.form.domains[this.clickIndex]
+                    const { projectCode } = this.proads.find(item => item.id == projectId)
+                    this.getInfoByProjectId(projectCode)
+                }
             }
             
 

+ 13 - 7
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -1117,10 +1117,10 @@
                 }
 
                 // 工单号,行号
-                const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
-                if(reportExtraField4Name || reportExtraField5Name) {
-                    this.getInfoByProjectId(item.projectCode)
-                }
+                // const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+                // if(reportExtraField4Name || reportExtraField5Name) {
+                //     this.getInfoByProjectId(item.projectCode)
+                // }
             },
             // 标准日期转成 YYYY-MM-DD
             formatDateToYYYYMMDD(date) {
@@ -1129,10 +1129,11 @@
                 const day = String(date.getDate()).padStart(2, '0');
                 return `${year}-${month}-${day}`;
             },
-            getInfoByProjectId(projectCode, index = null, flag = true) {
-                this.$axios.post("/erpOrderInfo/getInfoByProjectId", { 
+            getInfoByProjectId(projectCode, groupId = null, index = null, flag = true) {
+                this.$axios.post("/erpOrderInfo/getInfoByProjectIdAndGroupId", { 
                     projectId: projectCode,
-                    date: this.formatDateToYYYYMMDD(this.dateRange[this.inbtn])
+                    date: this.formatDateToYYYYMMDD(this.dateRange[this.inbtn]),
+                    groupId: groupId
                 })
                     .then(res => {
                         if (res.code == "ok") {
@@ -1832,6 +1833,11 @@
                     } else {
                         this.doYouWantToDisplayTheWorkOrderGongdan = true
                     }
+
+                    const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
+                    if((reportExtraField4Name || reportExtraField5Name) && value.id) {
+                        this.getInfoByProjectId(this.currentForm.domains[this.clickIndex].projectCode, value.id)
+                    }
                 }
 
                 this.getGroupStages(this.currentForm.domains[this.clickIndex], index, flag);