From ad6a76f34b4b2461162c6a8108ba58fe5be14d66 Mon Sep 17 00:00:00 2001 From: danshihao Date: Tue, 21 Nov 2023 18:13:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=81=E6=A0=87=E7=A8=BD=E6=9F=A5?= =?UTF-8?q?=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseStandardInspectionPlanFlow.vue | 58 +++++++++++++------ .../modules/InspectionPlanTable.vue | 8 +-- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue index 65ba139d..5a4ac5da 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue @@ -145,6 +145,8 @@ export default { mixins: [WorkCenterMixin], data () { return { + // 当前流程信息 + info: {}, EsInspectionPlan, loading: false, switchValue: 'base', @@ -232,7 +234,7 @@ export default { // 否则就是创建一个新的流程 getInspectPlanProjectId().then(res => { if (res) { - this.projectId = res + this.projectId = res + '' this.currentNode = EsInspectionPlan.initiate.value this.btn = EsInspectionPlan.initiate.btn } @@ -265,6 +267,7 @@ export default { getInspectPlanDetail(params).then(res => { if (res.success) { const data = res.result || {} + this.info = data this.processInfoForm.setFieldsValue({ prcName: data.processAll.prcName, dueTime: data.processAll.dueTime, @@ -279,49 +282,68 @@ export default { // 获取页面参数 getPageParams (isValidate = true) { return new Promise((resolve, reject) => { - // 人员信息的数据, 处理成对象 - const personnelObj = this.$refs.personnelInfo.getDataObjVerify() - // List拆成数组 - for (const key in personnelObj) { - if (key.includes('List')) { - personnelObj[key] = personnelObj[key].split(',') - } - } - // 获取表格数据 const params = {} if (isValidate) { + // 发起节点才获取人员信息 + let personnelObj = {} + if (this.currentNode === EsInspectionPlan.initiate.value) { + // 人员信息的数据, 处理成对象 + personnelObj = this.$refs.personnelInfo.getDataObjVerify() + // List拆成数组 + for (const key in personnelObj) { + if (key.includes('List')) { + personnelObj[key] = personnelObj[key].split(',') + } + } + } + // 校验表单 this.validateFormList( this.processInfoForm, this.countersignForm, this.approvalInfoForm ).then(res => { - params.processAll = res[0] + params.processAll = Object.assign({}, this.info.processAll, res[0]) if (params.processAll.dueTime && !params.processAll.dueTime.includes(' 00:00:00')) { params.processAll.dueTime = params.processAll.dueTime + ' 00:00:00' } params.processAll.projectId = this.projectId params.processAll.taskId = this.$route.query.taskId - params.processApprovalRecord = res[2] + + params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, res[2]) params.processApprovalRecord.projectId = this.projectId params.map = {} Object.assign(params.map, res[1], personnelObj) - params.map.pass = params.map.pass === '1' + if (params.map.pass) { + params.map.pass = params.map.pass + '' === '1' + } resolve(params) }).catch(err => { reject(err) }) } else { - params.processAll = this.processInfoForm.getFieldsValue() + // 发起节点才获取人员信息 + let personnelObj = {} + if (this.currentNode === EsInspectionPlan.initiate.value) { + // 人员信息的数据, 处理成对象 + personnelObj = this.$refs.personnelInfo.getDataObj() + // List拆成数组 + for (const key in personnelObj) { + if (key.includes('List')) { + personnelObj[key] = personnelObj[key].split(',') + } + } + } + params.processAll = Object.assign({}, this.info.processAll, this.processInfoForm.getFieldsValue()) if (params.processAll.dueTime && params.processAll.dueTime.includes(' 00:00:00')) { params.processAll.dueTime = params.processAll.dueTime + ' 00:00:00' } params.processAll.projectId = this.projectId - params.processApprovalRecord = this.approvalInfoForm.getFieldsValue() + params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, this.approvalInfoForm.getFieldsValue()) params.processApprovalRecord.projectId = this.projectId params.map = {} Object.assign(params.map, this.countersignForm.getFieldsValue(), personnelObj) if (params.map.pass) { - params.map.pass = params.map.pass === '1' + params.map.pass = params.map.pass + '' === '1' } resolve(params) } @@ -408,7 +430,7 @@ export default { if (this.loading) return this.loading = true this.getPageParams().then(res => { - console.log(res) + res.map.pass = true return approvalInspectPlan(res) }).then(res => { if (res.success) { @@ -428,7 +450,7 @@ export default { if (this.loading) return this.loading = true this.getPageParams().then(res => { - console.log(res) + res.map.pass = false return refusalInspectPlan(res) }).then(res => { if (res.success) { diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue index 8913134f..aa5cb35b 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable.vue @@ -18,7 +18,6 @@ :can-drag="true" rowKey="id" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" - :pagination="ipagination" :scroll="{x: '100%'}" @change="tableOnChange"> @@ -98,7 +97,7 @@ export default { EsInspectionPlan, disableMixinCreated: true, url: { - list: '/process/processEsInspectPlan/page', + list: '/process/processEsInspectPlan/list', delete: '/process/processEsInspectPlan/delete', importExcelUrl: '/process/processEsInspectPlan/importExcel', deleteBatch: '/process/processEsInspectPlan/deleteBatch' @@ -229,6 +228,7 @@ export default { // 列表查询带上项目id projectId () { this.filters.projectId = this.projectId + this.loadData() } }, computed: { @@ -249,8 +249,8 @@ export default { }) } }, - mounted () { - + created () { + this.filters.taskId = this.$route.query.taskId }, methods: { getData () {