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() } } }