From 7f242b03cd97c8ca84b5cead2f6defa47776b753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Mon, 20 Mar 2023 10:59:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=95=E8=A7=84=E6=B8=85?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/listOfRegulations.vue | 81 +++++++++---------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 745f63f1c..cc980b94b 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -1178,7 +1178,8 @@ rowKeysSuccessList: [], selectedRowKeysList: [], rowKeysWarningList: [], - rolecode: false + rolecode: false, + dataWarningList: [] } }, @@ -2081,9 +2082,9 @@ }) }, - startProcess(value) { + startProcess(value,type) { let query = { - type: 1, + type: type, projectLawsInvnetoryList: value, projectNameId: this.$route.query.projectNameId, projectName: this.$route.query.projectName, @@ -2091,10 +2092,10 @@ } postAction('/workFlow/startProcess', query).then((res) => { if (res.success) { - this.visible = false - this.selectedRowKeys = [] - this.$message.success(this.$t('OperationSuccessful')) - this.confirmLoading = false + // this.visible = false + // this.selectedRowKeys = [] + // this.$message.success(this.$t('OperationSuccessful')) + // this.confirmLoading = false this.completeTask(value, res.result) } else { this.$message.warning(this.$t('operationFailed')) @@ -2103,47 +2104,38 @@ }, completeTask(value, taskId, index) { - let handlingTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') - value.handlingTime = handlingTime - Object.keys(value).forEach(res => { - if (value[res] && typeof value[res] == 'string') { - value[res] = value[res].replace(/\"/g, '“') - value[res] = value[res].replace(/\'/g, '‘') - } - }) - let query = { - userid: this.userInfo().id, - taskId: taskId, - json: JSON.stringify(value).replace(/\"/g, '\'') - } - postAction('/workFlow/completeTask', query).then((res) => { - if (res.success) { - if (index == this.TaskSuccessList.length) { - this.visible = false - this.selectedRowKeys = [] - this.$message.success(this.$t('OperationSuccessful')) - this.confirmLoading = false - this.getList() - let that = this - if (this.TaskWarningList.length > 0) { - this.$warning({ - content: ( - < div > - { that.TaskWarningList } - < /div> - ) - }) - } + return new Promise((resolve, reject) => { + value.handlingTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') + Object.keys(value).forEach(res => { + if (value[res] && typeof value[res] == 'string') { + value[res] = value[res].replace(/\"/g, '“') + value[res] = value[res].replace(/\'/g, '‘') } - } else { - this.$message.warning(this.$t('operationFailed')) + }) + let query = { + userid: this.userInfo().id, + taskId: taskId, + json: JSON.stringify(value).replace(/\"/g, '\'') } + postAction('/workFlow/completeTask', query).then((res) => { + if (res.success) { + // this.visible = false + // this.selectedRowKeys = [] + // this.$message.success(this.$t('OperationSuccessful')) + // this.confirmLoading = false + // this.getList() + resolve(res) + } else { + this.$message.warning(this.$t('operationFailed')) + } + }) }) }, submitOrSendBackClick(num) { if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { this.detailedWarningList = [] + this.dataWarningList = [] let dataSource = [] let idList = [] this.rowKeysSuccessList = [] @@ -2162,6 +2154,8 @@ } else { this.detailedWarningList.push( < div > { dataSource[i].serialNumber + this.$t('pleaseSelectTheDataverificationVerified') } < /div>) + this.dataWarningList.push( + < div > { dataSource[i].serialNumber + this.$t('pleaseSelectTheDataverificationVerified') } < /div>) } } if (idList && idList.length > 0) { @@ -2186,7 +2180,7 @@ let designList = [] let verifyList = [] let detailedWarningList = [] - this.detailedWarningList = [] + this.detailedWarningList = this.dataWarningList || [] let _this = this _this.$destroyAll() if (num == 1) { @@ -2263,6 +2257,11 @@ } if (dataList[i].designDeliverableType && dataList[i].designDutyId && dataList[i].designDueDate) { _this.startProcess(dataList[i], 2) + Promise.all(_this.completeTask()).then((res) => { + console.log(res) + }).catch(error => { + console.log('error', error) + }) } if (dataList[i].verifyDeliverableType && dataList[i].verifyDutyId && dataList[i].verifyDueDate) { _this.startProcess(dataList[i], 2)