diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 90e2da6ae..d37c271f2 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1435,4 +1435,5 @@ module.exports = { onlyDataListReleasedAndCertificationReturnCanSelected:'Only data with the process status of list to be released and certification return can be selected', type:'type', select:'select', + onlyDataWithProcessStatusDeleted:'Only data with process status of list to be released and approved can be deleted', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index c016bec0b..4af4fead9 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1537,4 +1537,5 @@ module.exports = { onlyDataListReleasedAndCertificationReturnCanSelected:'只能选择流程状态为清单待发布和认证退回的数据', type:'类型', select:'选择', + onlyDataWithProcessStatusDeleted:'只能删除流程状态为清单待发布和审查通过的数据', } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/certificationList/index.vue b/jero-web/src/views/projectManagement/components/certificationList/index.vue index 7cb70fb38..a2a496ece 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/index.vue @@ -316,7 +316,8 @@ v-if="record.deliveryResult && record.valueType == 'file'"> {{$t('viewFile')}} - + {{record.deliveryResult}} @@ -854,6 +855,11 @@ this.loading = true getAction(this.url.list, query).then((res) => { if (res.success) { + if (res.result.current > 1 && res.result.records.length == 0) { + this.pageNo = 1 + this.getList() + return + } this.dataSource = res.result.records || [] this.total = res.result.total this.loading = false @@ -896,42 +902,46 @@ downloadFile(this.url.exportData, this.$route.query.projectName + '.zip', query, this.Deselect) }, handleDel() { + let _this = this if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { - let _this = this - let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys)) - let isTrue = true - // 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') { - // isTrue = true - // } else { - // isTrue = false - // this.$message.warning(this.$t('onlyDeleted')) - // return - // } - // } - // } - // } - if (isTrue) { + let ids = [] + let notConditions = [] + for (let i = 0; i < this.selectedRowKeysList.length; i++) { + if (this.selectedRowKeysList[i].flowStatus == 'List to be released' || + this.selectedRowKeysList[i].flowStatus == 'Review and pass') { + ids.push(this.selectedRowKeysList[i].id) + } else { + notConditions.push(this.selectedRowKeysList[i].inspectionItem) + } + } + let data = '' + if (notConditions && notConditions.length > 0) { + data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyDataWithProcessStatusDeleted') + } + if (ids && ids.length > 0) { this.$confirm({ content: _this.$t('ConfirmBatchDeletion'), onOk() { - let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys)) deleteAction(_this.url.deleteBatch, { - ids: idList.join(','), + ids: ids.join(','), projectLibraryId: _this.$route.query.id }).then((res) => { if (res.success) { _this.$message.success(_this.$t('OperationSuccessful')) _this.selectedRowKeys = [] + _this.selectedRowKeysList = [] _this.getList() + if (notConditions && notConditions.length > 0) { + _this.failedMessage(data) + } } else { _this.$message.warning(res.message) } }) } }) + } else { + this.failedMessage(data) } } else { this.$message.warning(this.$t('selectLeastOne')) @@ -1225,19 +1235,23 @@ }, deleteLib(val) { let _this = this - this.$confirm({ - content: _this.$t('ConfirmDelete'), - onOk() { - deleteAction(_this.url.deleteOne, { id: val.id, projectLibraryId: _this.$route.query.id }).then((res) => { - if (res.success) { - _this.$message.success(_this.$t('OperationSuccessful')) - _this.getList() - } else { - _this.$message.warning(_this.$t('operationFailed')) - } - }) - } - }) + if (val.flowStatus == 'List to be released' || val.flowStatus == 'Review and pass') { + this.$confirm({ + content: _this.$t('ConfirmDelete'), + onOk() { + deleteAction(_this.url.deleteOne, { id: val.id, projectLibraryId: _this.$route.query.id }).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + } else { + _this.$message.warning(_this.$t('operationFailed')) + } + }) + } + }) + } else { + this.$message.warning(this.$t('onlyDataWithProcessStatusDeleted')) + } }, modifyHistoryClick(row) { this.$refs.modifyHistoryRef.getList(row.id)