From 5d04b64baafa042e44a5d62c54429d3a9137d5fb Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Fri, 1 Jul 2022 16:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A6=85=E9=81=93=E5=B7=B2?= =?UTF-8?q?=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/listOfRegulations.vue | 194 +++++++++++------- 1 file changed, 125 insertions(+), 69 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index b8ad627a7..a270be398 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -840,7 +840,9 @@ trigger: 'change' } ] - } + }, + detailedSuccessList: [], + detailedWarningList: [] } }, @@ -1279,28 +1281,41 @@ if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) let isTrue = true + this.detailedSuccessList = [] + this.detailedWarningList = [] for (let i = 0; i < this.dataSource.length; i++) { for (let j = 0; j < selectedRowKeys.length; j++) { if (this.dataSource[i].id == selectedRowKeys[j]) { if (this.dataSource[i].inventoryAffirmStatus == 'Not started' || this.dataSource[i].inventoryAffirmStatus == 'Rejected') { if (this.dataSource[i].homologationEngineerId && this.dataSource[i].regulationOwnerId) { - isTrue = true + this.detailedSuccessList.push(this.dataSource[i]) } else { - this.$message.warning(this.dataSource[i].serialNumber + this.$t('TheEngineerAndCertification')) - isTrue = false - return + this.detailedWarningList.push(
{this.dataSource[i].serialNumber + this.$t('TheEngineerAndCertification') }
) + // this.$message.warning(this.dataSource[i].serialNumber + this.$t('TheEngineerAndCertification')) + // isTrue = false + // return } } else { - this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseSelectinitiatedOrRejected')) - isTrue = false - return + this.detailedWarningList.push(
{this.dataSource[i].serialNumber + ',' + this.$t('pleaseSelectinitiatedOrRejected') }
) + // this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseSelectinitiatedOrRejected')) + // isTrue = false + // return } } } } - if (isTrue) { + if (this.detailedSuccessList && this.detailedSuccessList.length > 0) { this.visible = true this.formInline = {} + }else{ + let that = this + this.$warning({ + content: ( + < div > + {that.detailedWarningList} + < /div> + ) + }) } } else { this.$message.warning(this.$t('selectLeastOne')) @@ -1313,61 +1328,81 @@ if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) let isTrue = true + this.TaskSuccessList = [] + this.TaskWarningList = [] + let dataList = [] for (let i = 0; i < this.dataSource.length; i++) { for (let j = 0; j < selectedRowKeys.length; j++) { if (this.dataSource[i].id == selectedRowKeys[j]) { - if ((this.dataSource[i].taskAffirmStatus == 'Not started' || this.dataSource[i].taskAffirmStatus == 'Rejected') && - this.dataSource[i].inventoryAffirmStatus == 'Accepted') { - if (this.dataSource[i].engineeringInterfacePerson) { - if (this.dataSource[i].verifyRemark) { - if (this.dataSource[i].verifyDueDate && this.dataSource[i].verifyDutyId - && this.dataSource[i].verifyInitiatorId) { - isTrue = true - } else { - isTrue = false - this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConformityVerification')) - return - } - } - - if (this.dataSource[i].prehomoRemark) { - if (this.dataSource[i].prehomoDueDate && this.dataSource[i].prehomoDutyId - && this.dataSource[i].prehomoInitiatorId) { - isTrue = true - } else { - isTrue = false - this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConfirmedByPrehomo')) - return - } - } - - if (this.dataSource[i].designRemark) { - if (this.dataSource[i].designDueDate && this.dataSource[i].designDutyId - && this.dataSource[i].designInitiatorId) { - isTrue = true - } else { - isTrue = false - this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseDesignConformityConfirmation')) - return - } - } - - } else { - isTrue = false - this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('theProjectContactEmpty')) - return - } - } else { - isTrue = false - this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('PleaseTaskConfirmationRejected')) - return - } + dataList.push(this.dataSource[i]) } } } - if (isTrue) { + for (let i = 0; i < dataList.length; i++) { + if ((dataList[i].taskAffirmStatus == 'Not started' || dataList.taskAffirmStatus == 'Rejected') && + dataList[i].inventoryAffirmStatus == 'Accepted') { + if (dataList[i].engineeringInterfacePerson) { + if (dataList[i].verifyRemark) { + if (dataList[i].verifyDueDate && dataList[i].verifyDutyId + && dataList[i].verifyInitiatorId) { + } else { + this.TaskWarningList.push(
{dataList[i].serialNumber + this.$t('pleaseConfirmedByPrehomo') }
) + continue; + // isTrue = false + // this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConformityVerification')) + // return + } + } + + if (dataList[i].prehomoRemark) { + if (dataList[i].prehomoDueDate && dataList[i].prehomoDutyId + && dataList[i].prehomoInitiatorId) { + } else { + this.TaskWarningList.push(
{dataList[i].serialNumber + this.$t('pleaseConfirmedByPrehomo') }
) + continue; + // isTrue = false + // this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConfirmedByPrehomo')) + // return + } + } + + if (dataList[i].designRemark) { + if (dataList[i].designDueDate && dataList[i].designDutyId + && dataList[i].designInitiatorId) { + } else { + this.TaskWarningList.push(
{dataList[i].serialNumber + this.$t('pleaseDesignConformityConfirmation') }
) + continue; + // isTrue = false + // this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseDesignConformityConfirmation')) + // return + } + } + this.TaskSuccessList.push(dataList[i]) + } else { + this.TaskWarningList.push(
{dataList[i].serialNumber + this.$t('theProjectContactEmpty') }
) + // isTrue = false + // this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('theProjectContactEmpty')) + // return + } + } else { + this.TaskWarningList.push(
{dataList[i].serialNumber + this.$t('PleaseTaskConfirmationRejected') }
) + // isTrue = false + // this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('PleaseTaskConfirmationRejected')) + // return + } + } + if (this.TaskWarningList && this.TaskWarningList.length > 0) { this.visible = true this.formInline = {} + }else{ + let that = this + this.$warning({ + content: ( + < div > + {that.TaskWarningList} + < /div> + ) + }) } } else { this.$message.warning(this.$t('selectLeastOne')) @@ -1377,8 +1412,11 @@ handleOk() { this.$refs.ruleForm.validate(valid => { if (valid) { - let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) if (this.timeName == '清单') { + let selectedRowKeys = [] + this.detailedSuccessList.forEach(res => { + selectedRowKeys.push(res.id) + }) let query = { operatorType: 0, ids: selectedRowKeys.join(','), @@ -1397,26 +1435,34 @@ this.$message.warning(this.$t('operationFailed')) this.confirmLoading = false } + let that = this + if (this.detailedWarningList.length > 0){ + this.$warning({ + content: ( + < div > + {that.detailedWarningList} + < /div> + ) + }) + } + this.detailedSuccessList = [] + this.detailedWarningList = [] }) } else { let index = 0 - for (let i = 0; i < this.dataSource.length; i++) { - for (let j = 0; j < selectedRowKeys.length; j++) { - if (this.dataSource[i].id == selectedRowKeys[j]) { + for (let i = 0; i < this.TaskSuccessList.length; i++) { index++ - this.dataSource[i].taskAffirmDueDate = this.formInline.taskAffirmDueDate - Object.keys(this.dataSource[i]).forEach(res => { - if (this.dataSource[i][res] && this.dataSource[i][res] instanceof String) { - this.dataSource[i][res] = this.dataSource[i][res].replace(/\"/g, '“') - this.dataSource[i][res] = this.dataSource[i][res].replace(/\'/g, '‘') + this.TaskSuccessList[i].taskAffirmDueDate = this.formInline.taskAffirmDueDate + Object.keys(this.TaskSuccessList[i]).forEach(res => { + if (this.TaskSuccessList[i][res] && this.TaskSuccessList[i][res] instanceof String) { + this.TaskSuccessList[i][res] = this.TaskSuccessList[i][res].replace(/\"/g, '“') + this.TaskSuccessList[i][res] = this.TaskSuccessList[i][res].replace(/\'/g, '‘') } }) setTimeout(() => { this.confirmLoading = true - this.startProcess(this.dataSource[i], index) + this.startProcess(this.TaskSuccessList[i], index) }, 500) - } - } } } } @@ -1449,12 +1495,22 @@ } postAction('/workFlow/completeTask', query).then((res) => { if (res.success) { - if (index == this.selectedRowKeys.length) { + 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> + ) + }) + } } } else { this.$message.warning(this.$t('operationFailed'))