diff --git a/src/pages/processCenter/pages/creatProcess/policyComplianceReview/components/approvalHistory.vue b/src/pages/processCenter/pages/creatProcess/policyComplianceReview/components/approvalHistory.vue new file mode 100644 index 000000000..8986b06c5 --- /dev/null +++ b/src/pages/processCenter/pages/creatProcess/policyComplianceReview/components/approvalHistory.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/src/pages/processCenter/pages/creatProcess/policyComplianceReview/components/personnelInformation.vue b/src/pages/processCenter/pages/creatProcess/policyComplianceReview/components/personnelInformation.vue new file mode 100644 index 000000000..0f3564408 --- /dev/null +++ b/src/pages/processCenter/pages/creatProcess/policyComplianceReview/components/personnelInformation.vue @@ -0,0 +1,329 @@ + + + + + diff --git a/src/pages/processCenter/pages/creatProcess/policyComplianceReview/index.vue b/src/pages/processCenter/pages/creatProcess/policyComplianceReview/index.vue index a01e4c68d..73bc0a739 100644 --- a/src/pages/processCenter/pages/creatProcess/policyComplianceReview/index.vue +++ b/src/pages/processCenter/pages/creatProcess/policyComplianceReview/index.vue @@ -13,6 +13,202 @@ :class="active === '3' ? 'active' : ''" @click="handleTabs('3')">审批历史 +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+
+
+ {{ item.name }} + +
+
+
+
+ + 点击上传 + +
+
+
+
+ + + + + + + + + + + + + + 是 + + 否 + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + +
+
+
+
+
+ +
+
+ +
+ + + + + 正在加载数据 @@ -21,6 +217,17 @@ import ProcessTitle from "../../components/ProcessTitle"; import ProcessFooter from "../../components/ProcessFooter"; import processFile from "../../components/processFile"; + import approvalHistory from "./components/approvalHistory";//审批历史 + import personnelInformation from "./components/personnelInformation";//人员信息 + import { + queryTaskFirst, + saveTaskFirst, + taskDel, + changeAssigneeNew, + inboundLiaisonDetail, + saveTaskForPub, + } from "api/process"; + import axios from "axios"; export default { name: "index", @@ -28,11 +235,51 @@ ProcessHeader, ProcessTitle, ProcessFooter, - processFile + processFile, + approvalHistory, + personnelInformation }, data() { return { - active: '1' + active: '1', + dataForm: {}, + formRules: { + endTime: [ + {required: true, message: '请选择截止时间', trigger: 'change'}, + ], + responsibleUnitDeadline: [ + {required: true, message: '请选择责任单位截止时间', trigger: 'change'}, + ], + zrrUserNames: [ + {required: true, message: '请选择责任人', trigger: 'change'}, + ], + internalReviewFlag: [ + {required: true, message: '请选择内部评审', trigger: 'change'}, + ], + zrdwUserName: [ + {required: true, message: '请选择本单位审批人', trigger: 'change'}, + ], + hqrUserNames: [ + {required: true, message: '请选择会签人', trigger: 'change'}, + ], + csr2UserNames: [ + {required: true, message: '请选择抄送人', trigger: 'change'}, + ], + }, + dataLoading: false, + accept: '', + fileMax_M: 0, + commentText: '', + taskKey: this.$route.query.taskDefinitionKey, + bpnId: this.$route.query.bpnId, + checkBox: false, + title: '', + drawerModal: false, + nodeList: [], + saveLoading: false, + isSubmit: false, + isReject: false, + roleForm: {}, } }, computed: { @@ -42,12 +289,460 @@ showApprovalHistory() { return true }, + disabledXX() { + return false + }, + taskKeyName() { + if (!this.taskKey || this.taskKey == 'PolicySolicitOpinionProcessKey1') { + return '起草' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey2') { + return '审核' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey3') { + return '起草修改' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey4') { + return '审定' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey5') { + return '批准' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey7') { + return '责任对接人分配任务' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey8') { + return '责任人任务处理' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey9') { + return '责任对接人汇总' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey10') { + return '责任单位审批' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey11') { + return '管理员' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey12') { + return '审核' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey13') { + return '会签' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey14') { + return '审定' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey15') { + return '批准' + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey16') { + return '抄送' + } + }, + + showSave() { //是否展示保存 + if (!this.taskKey || this.taskKey == 'PolicySolicitOpinionProcessKey1' || + this.taskKey == 'PolicySolicitOpinionProcessKey3' || this.taskKey == 'PolicySolicitOpinionProcessKey7' || + this.taskKey == 'PolicySolicitOpinionProcessKey8' || this.taskKey == 'PolicySolicitOpinionProcessKey9' || + this.taskKey == 'PolicySolicitOpinionProcessKey12') { + return true + } + return false + }, + + showTransfer() {//是否展示转办 + if (!this.taskKey) { + return false + } + return true + }, + + showReject() {//是否展示驳回 + if (this.taskKey == 'PolicySolicitOpinionProcessKey2' || + this.taskKey == 'PolicySolicitOpinionProcessKey4' || + this.taskKey == 'PolicySolicitOpinionProcessKey5' || + this.taskKey == 'PolicySolicitOpinionProcessKey9' || + this.taskKey == 'PolicySolicitOpinionProcessKey10' || + this.taskKey == 'PolicySolicitOpinionProcessKey11' || + this.taskKey == 'PolicySolicitOpinionProcessKey12' || + this.taskKey == 'PolicySolicitOpinionProcessKey13' || + this.taskKey == 'PolicySolicitOpinionProcessKey14' || + this.taskKey == 'PolicySolicitOpinionProcessKey15') { + return true + } + return false + }, + + showSolicitation() { //是否展示征求意见列表 + if (this.taskKey == 'PolicySolicitOpinionProcessKey8' || + this.taskKey == 'PolicySolicitOpinionProcessKey9' || + this.taskKey == 'PolicySolicitOpinionProcessKey10' || + this.taskKey == 'PolicySolicitOpinionProcessKey11' || + this.taskKey == 'PolicySolicitOpinionProcessKey12' || + this.taskKey == 'PolicySolicitOpinionProcessKey13' || + this.taskKey == 'PolicySolicitOpinionProcessKey14' || + this.taskKey == 'PolicySolicitOpinionProcessKey15' || + this.taskKey == 'PolicySolicitOpinionProcessKey16') { + return true + } + return false + }, + }, + mounted() { + //获取草稿的数据进行展示 + if (this.bpnId) { + this.getTaskDraftData() + } + //获取流程中数据进行展示 + if (this.taskKey) { + this.getData() + } }, methods: { + handlePreview(file) { + let attId = "" + if (file && file.id) { + attId = file.id + } else { + attId = file.response.data.id + } + this.$preview(attId) + }, + //基础信息/人员信息 handleTabs(type) { this.active = type; }, + + fileUpload(fileListName, fileName, accept, fileMax_M) { + this.fileListName = fileListName + this.fileName = fileName + this.accept = accept + this.fileMax_M = fileMax_M + this.$refs.processFileRef.getFile(this.dataForm[this.fileListName]) + }, + + uploadSuccess(fileList, fileId) { + this.dataForm[this.fileListName] = fileList + this.dataForm[this.fileName] = fileId + this.dataForm = {...this.dataForm} + }, + + clickButtonToUpload(file) { + const attId = file.attId + if (attId) { + window.location.href = '/api/att/attFile/downloadFileForSarNew?fileId=' + attId + } else { + this.$message.warning('文件不存在,下载失败') + } + }, + //保存事件 + handleSave() { + + this.openButtonLoading() + if (!this.taskKey || this.taskKey == 'PolicySolicitOpinionProcessKey1') { + this.draftSaving() + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey8' || + this.taskKey == 'PolicySolicitOpinionProcessKey9' || + this.taskKey == 'PolicySolicitOpinionProcessKey12') { + let _formData = new FormData(); + this.$refs.solicitationListRef.save((row, ids) => { + _formData.append("taskIds", this.$route.query.taskIds); + _formData.append("json", JSON.stringify({ + form: this.dataForm, + commentText: this.commentText, + policySolicitOpinionEOList: row, + removeIds: ids, + currentUserId: this.$store.getters.userInfo.userId + })); + saveTaskForPub(_formData).then(res => { + this.closeButtonLoading() + this.$message.success("保存成功"); + this.$refs.solicitationListRef.getData() + }).catch(e => { + this.closeButtonLoading() + }); + }) + } + }, + //草稿保存 + draftSaving() { + let _formData = new FormData(); + let json = this.dataForm + json.commentText = this.commentText + _formData.append('id', this.bpnId || '') + _formData.append("createUser", this.$store.getters.userInfo.userId); + _formData.append("createUserName", this.$store.getters.userInfo.userName); + _formData.append("prcType", "29"); + _formData.append("json", JSON.stringify({ + form: json, + roleForm: this.$refs.personnelInformationRef.roleForm, + commentText: this.commentText + })); + saveTaskFirst(_formData).then(res => { + this.closeButtonLoading() + this.$message.success("保存成功"); + this.bpnId = res.result + }).catch(e => { + this.saveLoading = false; + }); + }, + //提交事件 + handleSubmit() { + this.$refs['zczqyjForm'].validate((valid) => { + if (valid) { + this.openButtonLoading() + if (!this.taskKey || this.taskKey == 'PolicySolicitOpinionProcessKey1') {//起草 + this.closeButtonLoading() + this.$refs.personnelInformationRef.submit((row) => { + this.openButtonLoading() + this.startProcessRollBack(row) + }) + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey2' || + this.taskKey == 'PolicySolicitOpinionProcessKey4' || + this.taskKey == 'PolicySolicitOpinionProcessKey5' || + this.taskKey == 'PolicySolicitOpinionProcessKey7') { //审核、审定、批准、责任人分配任务 + const json = Object.assign(this.dataForm); + json.commentText = this.commentText + json.approvalFlag = 0 + let query = { + form: json, + commentText: this.commentText + } + this.completeTask(this.$route.query.taskIds, query) + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey3') {//起草修改 + this.closeButtonLoading() + this.$refs.personnelInformationRef.submit((row) => { + const json = Object.assign(this.dataForm, row); + json.commentText = this.commentText + json.approvalFlag = 0 + let query = { + form: json, + commentText: this.commentText + } + this.openButtonLoading() + this.completeTask(this.$route.query.taskIds, query) + }) + } else if (this.taskKey == 'PolicySolicitOpinionProcessKey8' || + this.taskKey == 'PolicySolicitOpinionProcessKey9' || + this.taskKey == 'PolicySolicitOpinionProcessKey10' || + this.taskKey == 'PolicySolicitOpinionProcessKey11' || + this.taskKey == 'PolicySolicitOpinionProcessKey12' || + this.taskKey == 'PolicySolicitOpinionProcessKey13' || + this.taskKey == 'PolicySolicitOpinionProcessKey14' || + this.taskKey == 'PolicySolicitOpinionProcessKey15' || + this.taskKey == 'PolicySolicitOpinionProcessKey16') {//责任人任务处理 + this.closeButtonLoading() + this.$refs.solicitationListRef.submit((row, ids) => { + const json = Object.assign(this.dataForm); + json.commentText = this.commentText + json.approvalFlag = 0 + let query = { + form: json, + policySolicitOpinionEOList: row, + removeIds: ids, + commentText: this.commentText + } + this.openButtonLoading() + this.completeTask(this.$route.query.taskIds, query) + }) + } + } else { + return this.$message.warning('请完善基础信息') + } + }) + }, + openButtonLoading() { + this.isReject = true + this.isSubmit = true + this.saveLoading = true; + }, + closeButtonLoading() { + this.isReject = false + this.isSubmit = false + this.saveLoading = false; + }, + handleReject() { + // approvalFlag value:0通过 1驳回 + this.openButtonLoading() + if (this.taskKey == 'PolicySolicitOpinionProcessKey9' || + this.taskKey == 'PolicySolicitOpinionProcessKey10' || + this.taskKey == 'PolicySolicitOpinionProcessKey11' || + this.taskKey == 'PolicySolicitOpinionProcessKey12' || + this.taskKey == 'PolicySolicitOpinionProcessKey13' || + this.taskKey == 'PolicySolicitOpinionProcessKey14' || + this.taskKey == 'PolicySolicitOpinionProcessKey15') { + this.$refs.solicitationListRef.submit((row, ids) => { + const json = Object.assign(this.dataForm); + json.commentText = this.commentText + json.approvalFlag = 1 + let query = { + form: json, + policySolicitOpinionEOList: row, + removeIds: ids, + commentText: this.commentText + } + this.completeTask(this.$route.query.taskIds, query) + }) + } else { + const json = Object.assign(this.dataForm); + json.commentText = this.commentText + json.approvalFlag = 1 + let query = { + form: json, + commentText: this.commentText + } + this.completeTask(this.$route.query.taskIds, query) + } + }, + //启动流程 + startProcessRollBack(roleForm) { + const json = Object.assign(this.dataForm, roleForm); + json.commentText = this.commentText + let query = { + form: json, + commentText: this.commentText + } + this.$http.post('lawss/activiti/startProcessRollBack', { + createUser: this.$store.getters.userInfo.userId, + createUserName: this.$store.getters.userInfo.userName, + type: '29', + json: JSON.stringify(query) + }, {_this: this}, res => { + if (res.ok) { + this.completeTask(res.data, query) + } else { + this.$message.warning('流程启动失败') + this.closeButtonLoading() + } + }) + }, + //提交流程 + completeTask(taskId, query) { + this.$http.post('lawss/activiti/completeTask', { + json: JSON.stringify(query), + taskId: taskId || this.taskId, + userId: this.$store.getters.userInfo.userId + }, {_this: this}, res => { + if (res.success) { + this.$message.success(res.message); + if (this.bpnId) { + this.taskDel() + } + this.$router.push("/processCenter"); + } + this.closeButtonLoading() + }) + }, + //删除草稿 + taskDel() { + let taskId = { + id: this.bpnId + } + taskDel(taskId).then(res => { + return res + }) + }, + handleTransfer() { + this.title = '转办处理人' + this.checkBox = true + this.selectType = '转办处理人' + this.nodeList = [] + this.drawerModal = true + }, + checkedRole(data) { + let ids = [] + let names = [] + if (data && data.length > 0) { + for (let i = 0; i < data.length; i++) { + ids.push(data[i].id) + names.push(data[i].name) + } + } + if (this.selectType == '转办处理人') { + changeAssigneeNew({ + taskId: this.$route.query.taskIds, // 任务id + userId: this.$store.getters.userInfo.userId, // 委托人 + assignee: data[0].id, // 被委托人 + pId: this.$route.query.prcId, // 流程实例 + }).then(res => { + if (res.success) { + this.drawerModal = false + this.$message.success('调整成功') + this.processNum() + this.$router.push({path: '/processCenter?tabsName=ProcessCenter'}) + } else { + this.$message.warning(res.message) + } + }) + } else if (this.selectType == '责任人') { + this.dataForm.zrrUserIds = ids.join(',') + this.dataForm.zrrUserNames = names.join(',') + this.dataForm = {...this.dataForm} + } else if (this.selectType == '审批人') { + this.dataForm.zrdwUserId = ids.join(',') + this.dataForm.zrdwUserName = names.join(',') + this.dataForm = {...this.dataForm} + } else if (this.selectType == '会签人') { + this.dataForm.hqrUserIds = ids.join(',') + this.dataForm.hqrUserNames = names.join(',') + this.dataForm = {...this.dataForm} + } else if (this.selectType == '抄送人') { + this.dataForm.csr2UserIds = ids.join(',') + this.dataForm.csr2UserNames = names.join(',') + this.dataForm = {...this.dataForm} + } + }, + + // 请求转换流程图 + processNum(row) { + axios.request({ + url: '/api/lawss/activiti/getImg?_t=' + new Date().getTime(), + responseType: 'blob', + method: 'get', + params: { + prcNum: this.$route.query.prcNum + } + }).then(res => { + this.processStep = window.URL.createObjectURL(res.data) + }) + }, + //选择人员 + selectOperation(title, id, isTrue) { + this.title = title + this.checkBox = isTrue + this.selectType = title + let ids = id && id.length > 0 ? id.split(',') : [] + this.nodeList = ids + this.drawerModal = true + }, + internalReviewFlagChange() { + this.dataForm.zrdwUserId = '' + this.dataForm.zrdwUserName = '' + this.dataForm = {...this.dataForm} + }, + getData() { + this.dataLoading = true + 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.formProcessing(processForm) + } + this.dataLoading = false + }).catch(e => { + this.dataLoading = false + }); + }); + }, + formProcessing(row) { + this.dataForm = row.form + this.dataForm = {...this.dataForm} + if (this.showPersonnel) { + this.$refs.personnelInformationRef.getData(row.form) + } + }, + getTaskDraftData() { + this.dataLoading = true + queryTaskFirst({ + bpnId: this.bpnId + }).then(res => { + let mes = JSON.parse(res.mes); + this.dataForm = mes.form + this.$refs.personnelInformationRef.getData(mes.roleForm) + this.commentText = mes.commentText + this.dataLoading = false + }); + }, } } diff --git a/src/pages/processCenter/pages/creatProcess/policyConsultation/components/fileViewModel.vue b/src/pages/processCenter/pages/creatProcess/policyConsultation/components/fileViewModel.vue index 00a4857e7..3688470c7 100644 --- a/src/pages/processCenter/pages/creatProcess/policyConsultation/components/fileViewModel.vue +++ b/src/pages/processCenter/pages/creatProcess/policyConsultation/components/fileViewModel.vue @@ -5,7 +5,7 @@
- {{ item.name }} + {{ item.name || item.oldFileName }}