From 87c108b2f8dce4d70b365bd0c10fb07eb20dcd40 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Tue, 3 Sep 2024 14:26:44 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9UAT=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9A=E4=BC=81=E6=A0=87=E5=88=B6=E4=BF=AE=E8=AE=A2?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E5=A1=AB=E5=86=99=E6=84=8F=E8=A7=81=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=89=E6=97=A0=E6=84=8F=E8=A7=81=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E6=9C=89=E6=84=8F=E8=A7=81=E6=89=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=8F=8A=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/lang/workCenter/zh.js | 5 +- .../modules/CommentObjectEnterBaseInfo.vue | 146 ++++++++++++------ 2 files changed, 104 insertions(+), 47 deletions(-) diff --git a/src/common/lang/workCenter/zh.js b/src/common/lang/workCenter/zh.js index 5e25c0b1..afa66cfa 100644 --- a/src/common/lang/workCenter/zh.js +++ b/src/common/lang/workCenter/zh.js @@ -164,7 +164,10 @@ module.exports = { confirmIsInsertSignature: '确认是否已插入签章', confirmIsInsertSignatureCont: '本节点需要前往在线编辑页面插入签章,请前往在线编辑页面确认是否已经插入签章,检查签章页无误后再行提交。', confirmIsInsertSignatureOkText: '前往在线编辑页面', - confirmIsInsertSignatureCancelText: '确认签章页无误并提交' + confirmIsInsertSignatureCancelText: '确认签章页无误并提交', + haveNoOpinion: '有无意见', + have: '有', + noHave: '无' }, // 企标更改流程 enStandardChange: { diff --git a/src/views/workCenter/enterpriseStandardRevision/modules/CommentObjectEnterBaseInfo.vue b/src/views/workCenter/enterpriseStandardRevision/modules/CommentObjectEnterBaseInfo.vue index 30f74525..94e2ee73 100644 --- a/src/views/workCenter/enterpriseStandardRevision/modules/CommentObjectEnterBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardRevision/modules/CommentObjectEnterBaseInfo.vue @@ -1,49 +1,74 @@ @@ -71,6 +96,17 @@ export default { data () { return { loading: false, + formInline: {}, + rules: { + // 有无意见 + haveNoOpinion: [ + { + required: true, + message: this.$t('workCenter.enStandardRevision.haveNoOpinion') + this.$t('cannotEmpty'), + trigger: 'change' + } + ] + }, /* 分页参数 */ ipagination: { current: 1, @@ -126,9 +162,18 @@ export default { onEditFile: '' // 在线编辑的文件id } }, + mounted () { + const formInline = {} + formInline.haveNoOpinion = '1' + this.formInline = Object.assign({}, formInline) + }, methods: { // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 initData (data) { + this.formInline = Object.assign({}, data) + if (!this.formInline.haveNoOpinion) { + this.formInline.haveNoOpinion = '1' + } // 给表格赋值,在线编辑不知道要怎么赋值? this.dataSource = data.advices.map(item => { const uidGenerator = () => { @@ -148,7 +193,7 @@ export default { // 外层要获取数据 getData () { // 把数据抛出,在线编辑不知道要不要抛 - const data = {} + const data = Object.assign({}, this.formInline) data.advices = this.dataSource data.businessJson = JSON.stringify(this.$refs.baseInfoForm.getData()) // 在线编辑文件id @@ -156,15 +201,20 @@ export default { return data }, // 外层获取数据要过校验,返回false表示没有通过校验 - getDataValidate () { - if (this.dataSource && this.dataSource.length > 0) { - const data = {} - data.advices = this.dataSource - return data - } else { - this.$message.warning(this.$t('addAtLeastOneRowOfData')) - return false - } + async getDataValidate () { + let data = {} // 要返回的数据 + await this.$refs.ruleForm.validate(valid => { + if (this.formInline.haveNoOpinion === '1' && this.dataSource && this.dataSource.length > 0) { + data = Object.assign({}, this.formInline) + data.advices = this.dataSource + } else if (this.formInline.haveNoOpinion === '1' && (!this.dataSource || this.dataSource.length <= 0)) { + this.$message.warning(this.$t('addAtLeastOneRowOfData')) + data = false + } else { + data = Object.assign({}, this.formInline) + } + }) + return data }, handleTableChange (pagination) { this.ipagination = pagination @@ -212,6 +262,10 @@ export default { // 在线编辑的查看 onlineEditView () { this.$emit('onlineEditView', this.onEditFile) + }, + reviewMeetingFlagChange () { + console.log('------change', this.formInline) + this.$forceUpdate() } } }