QuYueTing 1 день назад
Родитель
Сommit
ecf0fe98fd

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

@@ -225,7 +225,7 @@
                     <template v-if="user.timeType.reportAuditType != 3">
                         <van-field readonly name="projectAuditorId" :disabled="!item.canEdit"
                             v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
-                            :value="item.projectAuditorName" :label="user.companyId == 781 ? '审核人' : '项目审核人'"
+                            :value="item.projectAuditorName" label="审核人"
                             placeholder="请选择审核人" @click="clickPickAuditor(index, item)">
                             <template #input>
                                 <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
@@ -1101,9 +1101,46 @@ export default {
                 }
             }).catch(err => { this.$toast.clear(); })
         },
+
+        //获取审批流进行显示
+        getWorkFlowList(domainItem) {
+            this.$axios.post("/project-auditor/getWorkFlowList", { projectId: domainItem.projectId})
+                .then(res => {
+                    if (res.code == "ok") {
+                        //取项目节点,进行加载
+                        domainItem.auditWorkflow = res.data;
+                        for (var i=0;i<res.data.length; i++) {
+                            var node = res.data[i];
+                            if (node.isDeptAudit == 0) {
+                                var pAuditors = node.projectAuditors;
+                                domainItem.auditUserList = pAuditors;
+                                if (pAuditors == null || pAuditors.length==0) {
+                                    this.$toast.fail('日报审核人尚未设置,请联系管理员');
+                                } else if (pAuditors.length==1) {
+                                    //默认取第一个显示
+                                    domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
+                                    domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
+                                }
+                                break;
+                            }
+                        }
+                        
+                        // domainItem.auditUserList = res.data;
+                        // if (res.data.length == 1) {
+                        //     domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
+                        //     domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
+                        // }
+                        this.$forceUpdate();
+                    } else {
+                        this.$toast.fail('获取失败:' + res.msg);
+                    }
+                }).catch(err => { this.$toast.clear(); });
+        },
+
+
         //获取项目审核人
         getProjectAuditorList(domainItem) {
-            this.$axios.post("/project-auditor/getList", { projectId: domainItem.projectId })
+            this.$axios.post("/project-auditor/getList", { projectId: domainItem.projectId , forReport: true})
                 .then(res => {
                     if (res.code == "ok") {
                         domainItem.auditUserList = res.data;
@@ -1222,8 +1259,17 @@ export default {
             //获取项目审核人
             // console.log(domainItem.projectId,this.project);
             var curProject = this.project.filter(p => p.id == domainItem.projectId)[0];
-            if (curProject && (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
-                this.getProjectAuditorList(domainItem, index);
+            if (curProject) {
+                if (this.user.timeType.reportAuditType == 4) {
+                    this.getProjectAuditorList(domainItem, index);
+                } else if (this.user.timeType.reportAuditType == 0) {
+                    if (this.user.timeType.reportWorkflow) {
+                        this.getWorkFlowList(domainItem, index);
+                    } else {
+                        this.getProjectAuditorList(domainItem, index);
+                    }
+                }
+                
             }
 
             console.log(item, '数据')

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

@@ -1010,7 +1010,7 @@
 
             //获取项目审核人
             getProjectAuditorList(domainItem) {
-                this.$axios.post("/project-auditor/getList", {projectId: domainItem.projectId})
+                this.$axios.post("/project-auditor/getList", {projectId: domainItem.projectId, forReport: true})
                 .then(res => {
                     if(res.code == "ok") {
                         domainItem.auditUserList = res.data;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/editask.vue

@@ -240,7 +240,7 @@ export default {
             currentDate2: new Date(),
             currentDate3: new Date(),
             minDate: new Date(2020,0,1),
-            maxDate: new Date(2025,11,31),
+            maxDate: new Date(2030,11,31),
             canEdit: true,
             onSearchTime: null,
             taskform:{      // 表单

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/test/list.vue

@@ -368,7 +368,7 @@
         methods: {
             //获取项目审核人
             getProjectAuditorList(domainItem) {
-                this.$axios.post("/project-auditor/getList", {projectId: domainItem.projectId})
+                this.$axios.post("/project-auditor/getList", {projectId: domainItem.projectId, forReport: true})
                 .then(res => {
                     if(res.code == "ok") {
                         domainItem.auditUserList = res.data;