From 5845addb964c38a7f7b17f4f5cd14459d6aab965 Mon Sep 17 00:00:00 2001 From: super_liu <396572590@qq.com> Date: Fri, 11 Feb 2022 17:14:27 +0800 Subject: [PATCH] feat: There is no way the, --- src/api/process.js | 8 + src/pages/home2/components/todoList/index.vue | 58 ++++++ .../pages/components/ProcessMixin.vue | 3 + .../pages/creatProcess/qbfs/step1.vue | 155 +++++++--------- .../pages/creatProcess/qbfs/step2.vue | 170 +++++------------- .../tabComponents/processCenter/index.vue | 58 ++++++ src/router/index.js | 10 ++ 7 files changed, 249 insertions(+), 213 deletions(-) diff --git a/src/api/process.js b/src/api/process.js index 8da9d45c1..3315c9fe4 100644 --- a/src/api/process.js +++ b/src/api/process.js @@ -15,6 +15,14 @@ export function startProcess (data) { }) } +export function startProcessRollBack (data) { + return axios({ + url: '/api/lawss/activiti/startProcessRollBack', + method: 'post', + params: data + }) +} + // 流程提交 export function completeTask (data) { return axios({ diff --git a/src/pages/home2/components/todoList/index.vue b/src/pages/home2/components/todoList/index.vue index 273677a0f..b89774a91 100644 --- a/src/pages/home2/components/todoList/index.vue +++ b/src/pages/home2/components/todoList/index.vue @@ -411,6 +411,64 @@ export default { }) } break; + case 'buss3': + if (row.taskInfo === '对接人选择复审人') { + this.$router.push({ + name: 'qbfsStepSub1', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '复审人选择复审结果'){ + this.$router.push({ + name: 'qbfsStepSub2', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '发起人汇总结果'){ + this.$router.push({ + name: 'bussFs2', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '重新发起人汇总结果'){ + this.$router.push({ + name: 'bussFsC2', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '标准法规部高级经理批准'){ + this.$router.push({ + name: 'bussFs3', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + } + break; case '2': if (row.taskInfo === '责任对接人选择责任人') { this.$router.push({ diff --git a/src/pages/processCenter/pages/components/ProcessMixin.vue b/src/pages/processCenter/pages/components/ProcessMixin.vue index b4308c0c2..b502de945 100644 --- a/src/pages/processCenter/pages/components/ProcessMixin.vue +++ b/src/pages/processCenter/pages/components/ProcessMixin.vue @@ -28,6 +28,9 @@ export default { { label: "企标制修订-产品标准", value: "buss2" + },{ + label: "企标复审流程", + value: "buss3" }, { label: "标准征求意见流程", diff --git a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue index ae9766055..5cc3bda88 100644 --- a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue @@ -611,7 +611,7 @@ import ProcessHeader from "../../components/ProcessHeader"; import ProcessFooter from "../../components/ProcessFooter"; import ProcessTitle from "../../components/ProcessTitle"; -import {saveTaskFirst,queryTaskFirst, inboundLiaisonDetail,taskDel } from "api/process"; +import {saveTaskFirst,queryTaskFirst, inboundLiaisonDetail,taskDel,startProcessRollBack, completeTask } from "api/process"; export default { name: "qbfsStep1", @@ -1102,75 +1102,50 @@ export default { this.saveLoading = false }) }, - async processExec(sendProcess){ - const json = Object.assign(sendProcess, this.roleForm); - this.$http.post('lawss/activiti/startProcessRollBack', { - createUser: this.$store.getters.userInfo.userId, - createUserName: this.$store.getters.userInfo.userName, - type: 'buss3', - json: JSON.stringify({ - roleForm: this.roleForm, - qbfsForm: this.qbfsForm, - commentText: this.commentText - }) - }, { - _this: this - }, res => { - if (res.ok) { - this.$http.post('lawss/activiti/completeTask', { - taskIds: res.data, - userId : this.$store.getters.userInfo.userId, - json: JSON.stringify(json) - }, { - _this: this - }, res => { - if (res.success) { - sendProcess.processStatus = '1' - this.$message.success(res.message) - if (this.bpnId !== '') { - let taskId = { - id: this.bpnId - } - taskDel(taskId).then(res=>{ - }) - } - } + startProcessRollBack() { + return new Promise((resolve, reject) => { + startProcessRollBack({ + createUser: this.$store.getters.userInfo.userId, + createUserName: this.$store.getters.userInfo.userName, + type: 'buss3', + json: JSON.stringify({ + roleForm: this.roleForm, + qbfsForm: this.qbfsForm, + commentText: this.commentText + }) + }).then(res => { + const history = res; + resolve(history) }) - } - }) + }) + }, + completeTask(res,json) { + return new Promise((resolve, reject) => { + this.$http.post('lawss/activiti/completeTask', { + taskIds: res.data, + userId : this.$store.getters.userInfo.userId, + json: JSON.stringify(json) + }, { + _this: this + }, res => { + const history = res; + resolve(history) + }) + }) }, //流程提交 - handleSubmit() { + async handleSubmit() { if(this.$route.query.prcNum === undefined){ if(this.qbfsForm.modelData === undefined || this.qbfsForm.modelData === null || this.qbfsForm.modelData.length === 0){ this.$message.warning('请选择复审企标完善列表内容') return } + let boo = false this.$refs['qbfsForm'].validate((valid) => { if (valid) { this.$refs['roleForm'].validate((valid) => { if (valid) { - this.isSubmit = true - // this.qbfsForm.fileList = this.fileList - this.qbfsForm.commentText = this.commentText - // 批量发起列表流程 - this.loading = true - this.qbfsForm.modelData.forEach(sendProcess =>{ - sendProcess.processStatus = '2' - setTimeout(() => { - this.processExec(sendProcess) - }, 3000); - this.$forceUpdate() - }) - - const time = setInterval(() => { - const list = this.qbfsForm.modelData.filter ( item => item.processStatus === '1') - if(list && this.qbfsForm.modelData && list.length === this.qbfsForm.modelData.length){ - this.isSubmit = false - clearInterval(time) - this.$router.push({path:'/processCenter?tabsName=ProcessCenter'}) - } - },1000); + boo = true }else { this.$message.warning('请检查人员信息表单是否填写完整') } @@ -1179,36 +1154,42 @@ export default { this.$message.warning('请检查基础信息表单是否填写完整') } }) - // }else{ - // this.$refs['qbfsForm'].validate((valid) => { - // if (valid) { - // this.$refs['roleForm'].validate((valid) => { - // if (valid) { - // this.isSubmit = true - // this.qbfsForm.commentText = this.commentText - // var json = Object.assign(this.qbfsForm, this.roleForm) - // this.$http.post('lawss/activiti/completeTask', { - // taskIds: res.data, - // userId : this.$store.getters.userInfo.userId, - // json: JSON.stringify(json) - // }, { - // _this: this - // }, res => { - // if (res.success) { - // this.$message.success(res.message) - // this.isSubmit = false - // this.$router.push({path:'/processCenter?tabsName=ProcessCenter'}) - // } - // }) - // }else { - // this.$message.warning('请检查人员信息表单是否填写完整') - // } - // }) - // } else { - // this.$message.warning('请检查基础信息表单是否填写完整') - // } - // }) + + if(boo){ + this.isSubmit = true + // this.qbfsForm.fileList = this.fileList + this.qbfsForm.commentText = this.commentText + // 批量发起列表流程 + this.loading = true + for (const sendProcess of this.qbfsForm.modelData) { + sendProcess.processStatus = '2' + const json = Object.assign(sendProcess, this.roleForm); + let startProcess = await this.startProcessRollBack() + if (startProcess.ok) { + let completeTask = await this.completeTask(startProcess,json) + if (completeTask.success) { + sendProcess.processStatus = '1' + this.$message.success(completeTask.message) + if (this.bpnId !== undefined && this.bpnId !== '') { + let taskId = { + id: this.bpnId + } + taskDel(taskId).then(res=>{ + }) + } + } + } } + const time = setInterval(() => { + const list = this.qbfsForm.modelData.filter ( item => item.processStatus === '1') + if(list && this.qbfsForm.modelData && list.length === this.qbfsForm.modelData.length){ + this.isSubmit = false + clearInterval(time) + this.$router.push({path:'/processCenter?tabsName=ProcessCenter'}) + } + },1000); + } + } }, // 流程阶段负责人选择 choiceZRR(type, title, id) { diff --git a/src/pages/processCenter/pages/creatProcess/qbfs/step2.vue b/src/pages/processCenter/pages/creatProcess/qbfs/step2.vue index b7211df74..1f1be597f 100644 --- a/src/pages/processCenter/pages/creatProcess/qbfs/step2.vue +++ b/src/pages/processCenter/pages/creatProcess/qbfs/step2.vue @@ -22,104 +22,10 @@ > - + - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

{{ item.oldFileName }} - - -

-
-
- 暂无数据 -
-
- - @@ -212,14 +118,9 @@ @@ -247,7 +148,7 @@ import ProcessTitle from "../../components/ProcessTitle"; import { changeAssigneeNew, inboundLiaisonDetail, saveTaskFirst } from "api/process"; export default { - name: "qbfsStep2", + name: "qbfsStepSub1", components:{ ProcessHeader, ProcessFooter, @@ -281,6 +182,8 @@ export default { reviewDate: '', jgUser: '', jgUserId: '', + bussFsSubUser2:'', + bussFsSubUser2Name:'', }, roleForm: { jgUser: "" @@ -289,6 +192,9 @@ export default { jgUser: [ {required: true, message: "请选择工作组成员", trigger: "change"} ], + bussFsSubUser2Name: [ + {required: true, message: "请选择企标复审人", trigger: "change"} + ], }, } }, @@ -338,23 +244,29 @@ export default { }, //流程提交 handleSubmit(){ - this.isSubmit = true - this.qbfsForm.commentText = this.commentText - let json = JSON.stringify(this.qbfsForm); - this.$http.post('lawss/activiti/completeTask', { - taskIds: this.$route.query.taskIds, - userId: this.$store.getters.userInfo.userId, - json: json, - }, { - _this: this - }, res => { - if (res.success) { - this.$message.success(res.message) - this.$router.push('/processCenter') - } - this.isSubmit = false - }, e => { - }); + this.$refs['qbfsForm'].validate((valid) => { + if (valid) { + this.isSubmit = true + this.qbfsForm.commentText = this.commentText + let json = JSON.stringify(this.qbfsForm); + this.$http.post('lawss/activiti/completeTask', { + taskIds: this.$route.query.taskIds, + userId: this.$store.getters.userInfo.userId, + json: json, + }, { + _this: this + }, res => { + if (res.success) { + this.$message.success(res.message) + this.$router.push('/processCenter') + } + this.isSubmit = false + }, e => { + }); + }else { + this.$message.warning('请检查基础信息表单是否填写完整') + } + }) }, //转办事件 handleTransfer(){ @@ -398,10 +310,10 @@ export default { }) }, choiceZRRS() { - this.drawerTitle = '请选择工作组成员' + this.drawerTitle = '请选择企标复审人' this.nodeList2 = []; - if (this.qbfsForm.jgUserId) { - this.nodeList2 = this.qbfsForm.jgUserId.split(","); + if (this.qbfsForm.bussFsSubUser2) { + this.nodeList2 = this.qbfsForm.bussFsSubUser2.split(","); } this.modalshowflag = true; }, @@ -421,6 +333,12 @@ export default { if(this.qbfsForm.jgUser){ this.$refs.qbfsForm.validateField('jgUser') } + + this.$set(this.qbfsForm, 'bussFsSubUser2Name', nameList) + this.$set(this.qbfsForm, 'bussFsSubUser2', idList) + if(this.qbfsForm.jgUser){ + this.$refs.qbfsForm.validateField('bussFsSubUser2') + } }, /** * @Description: 点击下载 diff --git a/src/pages/processCenter/pages/processList/tabComponents/processCenter/index.vue b/src/pages/processCenter/pages/processList/tabComponents/processCenter/index.vue index 72e99d344..5c100b103 100644 --- a/src/pages/processCenter/pages/processList/tabComponents/processCenter/index.vue +++ b/src/pages/processCenter/pages/processList/tabComponents/processCenter/index.vue @@ -657,6 +657,64 @@ export default { }) } break; + case 'buss3': + if (row.taskInfo === '对接人选择复审人') { + this.$router.push({ + name: 'qbfsStepSub1', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '复审人选择复审结果'){ + this.$router.push({ + name: 'qbfsStepSub2', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '发起人汇总结果'){ + this.$router.push({ + name: 'bussFs2', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '重新发起人汇总结果'){ + this.$router.push({ + name: 'bussFsC2', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + }else if (row.taskInfo === '标准法规部高级经理批准'){ + this.$router.push({ + name: 'bussFs3', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + prcName: row.prcName, + prcType: row.prcType + } + }) + } + break; case '2': if (row.taskInfo === '任务分发') { this.$router.push({ diff --git a/src/router/index.js b/src/router/index.js index 281dfbf52..4da6a428a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2000,6 +2000,16 @@ const routes = [ title: '加入标准化协会信息提报流程' } }, + //企标复审流程(新) + { + path: '/qbfsStepSub1', + name: 'qbfsStepSub1', + component: () => import('@/pages/processCenter/pages/creatProcess/qbfs/step2.vue'), + meta: { + requireAuth: true, + title: '企标复审流程' + } + }, //企标复审流程 { path: '/qbfsStep1',