diff --git a/src/pages/home2/components/todoList/index.vue b/src/pages/home2/components/todoList/index.vue index 688bac9c7..6f2346510 100644 --- a/src/pages/home2/components/todoList/index.vue +++ b/src/pages/home2/components/todoList/index.vue @@ -970,6 +970,18 @@ export default { prcType: row.prcType } }) + }else if (row.taskInfo === '重新起草') { + this.$router.push({ + name: 'wfhxzgStep1', + query: { + taskIds: row.taskIds, + prcId: row.prcId, + prcNum: row.prcNum, + taskAssignee: row.taskAssignee, + prcName: row.prcName, + prcType: row.prcType + } + }) }else { this.$router.push({ name: 'wfhxzgStep5', diff --git a/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue b/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue index 315f128cc..04fa73d4e 100644 --- a/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/wfhxzg/step1.vue @@ -324,7 +324,15 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {startProcess, completeTask, saveTaskFirst, queryTaskFirst, taskDel, processBack} from '@/api/process.js' +import { + startProcess, + completeTask, + saveTaskFirst, + queryTaskFirst, + taskDel, + processBack, + inboundLiaisonDetail +} from "@/api/process.js"; import {standUnqualified, dicTypeData} from '@/api/unqualProcess.js' export default { @@ -332,6 +340,7 @@ export default { data() { return { loading: false, + submitFlag: '', //是否是修改节点 commentText: '', // 意见 title: '', // 新增编辑抽屉标题 ListModel: false, // 新增编辑抽屉开关 @@ -367,6 +376,7 @@ export default { dockUserName: [{required: true, message: "请选择标准法规工程师", trigger: ['blur', 'change']}] }, nodeList: [], + hisListForm:{}, drawerTitle: '', //drawer标题 modalshowflag: false, // drawer开关 treeData: [], // 人员数据 @@ -388,8 +398,39 @@ export default { if (this.bpnId !== undefined) { this.getData() } + if(this.$route.query.taskIds){ + //被驳回时调用 + this.getHistoryData() + } }, methods: { + getHistoryData() { + return new Promise((resolve, reject) => { + inboundLiaisonDetail({ + taskIds: this.$route.query.taskIds, + pId: this.$route.query.prcId, + }).then(res => { + if (res) { + const processForm = JSON.parse(res.mesg) + this.getFormFieldList(processForm) + } + }).catch(e => { + }) + }) + }, + /** + * @description: 动态表单读取 + */ + getFormFieldList (item) { + item.commentText = '' + this.$nextTick(() => { + this.hisListForm = JSON.parse(JSON.stringify(item)) + this.submitFlag = '修改节点' + this.dataList = item.dockUserList[0].standardInfoList + this.roleForm.dockUserName = this.dataList[0].engineer + this.roleForm.dockUser = this.dataList[0].engineerId + }) + }, getData() { queryTaskFirst({ bpnId: this.$route.query.bpnId @@ -557,6 +598,7 @@ export default { prcCreateUser: this.$store.getters.userInfo.userId, prcCreateUserName: this.$store.getters.userInfo.userName, engineer: this.roleForm.dockUser, + engineerName: this.roleForm.dockUserName, standardInfoList: this.dataList, commentText: this.commentText } @@ -566,43 +608,86 @@ export default { if (this.roleForm.dockUserName === '') { this.$message.warning('请完善人员信息') } else { - this.$refs['roleForm'].validate((valid) => { - if (valid) { - this.isSubmit = true - let paramsInfo = new FormData() - // paramsInfo.append('id', this.bpnId || '') - paramsInfo.append('createUser', this.$store.getters.userInfo.userId) - paramsInfo.append('createUserName', this.$store.getters.userInfo.userName) - paramsInfo.append('type', '8') - paramsInfo.append('json', JSON.stringify({ - roleForm: this.roleForm, - dataList: this.dataList, - commentText: this.commentText - })) - processBack(paramsInfo).then(res => { - this.taskID = res.data - const params = new FormData(); - params.set('json', JSON.stringify(json)) - params.set('userId', this.$store.getters.userInfo.userId) - params.set('taskIds', this.taskID) - completeTask(params).then(res => { - if (res.success === true) { - this.$message.success('提交成功') - if (this.bpnId !== '') { + if(!this.submitFlag){ + this.$refs['roleForm'].validate((valid) => { + if (valid) { + this.isSubmit = true + let paramsInfo = new FormData() + // paramsInfo.append('id', this.bpnId || '') + paramsInfo.append('createUser', this.$store.getters.userInfo.userId) + paramsInfo.append('createUserName', this.$store.getters.userInfo.userName) + paramsInfo.append('type', '8') + paramsInfo.append('json', JSON.stringify({ + roleForm: this.roleForm, + dataList: this.dataList, + commentText: this.commentText + })) + processBack(paramsInfo).then(res => { + this.taskID = res.data + const params = new FormData(); + params.set('json', JSON.stringify(json)) + params.set('userId', this.$store.getters.userInfo.userId) + params.set('taskIds', this.taskID) + completeTask(params).then(res => { + if (res.success === true) { + this.$message.success('提交成功') + if (this.bpnId !== '') { + let taskId = { + id: this.bpnId + } + taskDel(taskId).then(res => { + return res + }) + } + this.$router.push("/processCenter"); + } + this.isSubmit = false + }) + }) + } + }) + }else{ + this.$refs["roleForm"].validate((valid) => { + if (valid) { + let specialJson = { + createUser: this.$store.getters.userInfo.userId, + createUserName: this.$store.getters.userInfo.userName, + type: "8", + json: { + standardInfoList: this.dataList, + roleForm: this.roleForm, + commentText: this.commentText + } + }; + this.$http.post("lawss/activiti/completeTaskNew", { + taskIds: this.$route.query.taskIds, + userId: this.$store.getters.userInfo.userId, + json: JSON.stringify(json), + specialJson: JSON.stringify(specialJson) + }, { + _this: this + }, res => { + if (res.success) { + this.$message.success(res.message); + if (this.bpnId !== "") { let taskId = { id: this.bpnId - } + }; taskDel(taskId).then(res => { - return res - }) + return res; + }); } this.$router.push("/processCenter"); } - this.isSubmit = false - }) - }) - } - }) + this.isSubmit = false; + }); + } else { + this.isSubmit = false; + return this.$message.warning("请完善人员信息"); + } + }); + } + } } }, diff --git a/src/pages/processCenter/pages/creatProcess/wfhxzg/step2.vue b/src/pages/processCenter/pages/creatProcess/wfhxzg/step2.vue index 17b5d11e6..afef73ef0 100644 --- a/src/pages/processCenter/pages/creatProcess/wfhxzg/step2.vue +++ b/src/pages/processCenter/pages/creatProcess/wfhxzg/step2.vue @@ -150,9 +150,11 @@ show-save show-submit show-transfer + show-back :submitLoading="isSubmit" :saveLoading="saveLoading" :transferLoading="turnLoading" + @back="beforeBack" @transfer="handleTurnTo" @save="handleSave" @submit="handleSubmit" @@ -277,6 +279,7 @@ export default { }) }, getFormFieldList (item) { + console.log(item); this.$nextTick(() => { if (item.passInfo !== undefined) { this.passInfo = JSON.parse(JSON.stringify(item)).passInfo @@ -336,6 +339,50 @@ export default { this.saveLoading = false }) }, + //驳回按钮 + beforeBack(){ + if(!this.commentInfo){ + this.$message.warning('请填写审批意见') + }else{ + let zqa = new Map(); + for (let lastDataListElement of this.dataList) { + let a = zqa.get(lastDataListElement.dutyPeopleInfoId) + if( a == null){ + a = { + id: lastDataListElement.dutyPeopleInfoId, + name: lastDataListElement.dutyPeopleInfo, + standardInfoList: [] + } + } + a.standardInfoList.push(lastDataListElement); + zqa.set(a.id, a); + } + let list = []; + for(let item of zqa) { + list.push(item[1]) + } + let json = { + dockUserList: list, + passInfo: this.passInfo, + passFlag: '1', + commentText: this.commentInfo + } + const params = new FormData(); + params.set('json', JSON.stringify(json)) + params.set('userId', this.$store.getters.userInfo.userId) + params.set('taskIds', this.taskIds) + completeTask(params).then(res => { + if(res.success === true) { + this.$message.success('提交成功') + this.$router.push("/processCenter"); + } + this.isSubmit = false + }).catch(e => { + this.isSubmit = false + }) + } + + }, // 提交按钮 handleSubmit() { this.isSubmit = true @@ -359,6 +406,7 @@ export default { let json = { dockUserList: list, passInfo: this.passInfo, + passFlag: '0', commentText: this.commentInfo } let flag=false diff --git a/src/pages/processCenter/pages/creatProcess/wfhxzg/step3.vue b/src/pages/processCenter/pages/creatProcess/wfhxzg/step3.vue index 3b6e54bf1..9b7eaca53 100644 --- a/src/pages/processCenter/pages/creatProcess/wfhxzg/step3.vue +++ b/src/pages/processCenter/pages/creatProcess/wfhxzg/step3.vue @@ -152,7 +152,6 @@