diff --git a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInitiate.vue b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInitiate.vue index ec9f21d..bf0bf80 100644 --- a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInitiate.vue +++ b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInitiate.vue @@ -165,9 +165,18 @@ export default { // 校验失败就标记true obj._flag = true } - // 如果是不带入,就提示选择条款 - if (this.dataSource.length && (this.dataSource[0].decompositionSource === DecompositionSource.NO_INPUT.value)) { - this.$message.warn('workCenter.standardInterpretationProcess.pleaseSelectClause') + // 如果来源选择不带入,至少选择一条条款信息 + const isNoInput = this.dataSource.length && (this.dataSource[0].decompositionSource === DecompositionSource.NO_INPUT.value) + // 是否没有条款数据 + const isClauseNotData = this.showClauseTable && !this.$refs.interpretationClauseTable.getData().length + if (isNoInput && isClauseNotData) { + this.$message.warn(this.$t('workCenter.standardInterpretationProcess.pleaseSelectClause')) + obj._flag = true + } + // 来源选择其他,没有条款数据提示至少一条数据 + if (!isNoInput && isClauseNotData) { + this.$message.warn(this.$t('addAtLeastOneRowOfData')) + // 校验失败就标记true obj._flag = true } } @@ -214,6 +223,7 @@ export default { if (this.dataSource[0].decompositionSource === DecompositionSource.NO_INPUT.value) { this.$nextTick(() => { this.$refs.interpretationClauseTable.setData([{ + uuid: randomUUID(), itemTitle: this.dataSource[0].standardName, itemNum: this.dataSource[0].standardNumber }]) @@ -241,15 +251,18 @@ export default { handleAddStandardCallback (list) { console.log(list) this.dataSource = list || [] - // 如果有条款的表格,就清空然后隐藏 - this.$refs.interpretationClauseTable && this.$refs.interpretationClauseTable.setData([]) - this.showClauseTable = false if (this.dataSource.length) { + this.resetClauseTable() this.dataSource[0].standardId = this.dataSource[0].id - this.dataSource[0].decompositionSource = DecompositionSource.NO_INPUT.value + this.$set(this.dataSource[0], 'decompositionSource', DecompositionSource.NO_INPUT.value) this.initInterpretGetFileByStandardId(this.dataSource[0].id) } }, + // 重置条款表格 + resetClauseTable () { + this.$refs.interpretationClauseTable && this.$refs.interpretationClauseTable.setData([]) + this.showClauseTable = false + }, /** * 获取分解单来源下拉 * @param standardId - 标准id @@ -265,6 +278,7 @@ export default { // 修改分解单来源 handleChangeDecompositionSource (val) { this.decompositionSource = val + this.resetClauseTable() const find = this.decompositionSourceList.find(item => item.value === val) if (find) { this.dataSource.decompositionSource_dictText = find.text || find.title