[update] 修改UAT问题:企标制修订流程征求意见对象填写意见节点增加有无意见字段,有意见才显示征求意见表格及操作按钮

This commit is contained in:
lideqin
2024-09-03 14:26:44 +08:00
parent 200057d90b
commit 87c108b2f8
2 changed files with 104 additions and 47 deletions
+4 -1
View File
@@ -164,7 +164,10 @@ module.exports = {
confirmIsInsertSignature: '确认是否已插入签章', confirmIsInsertSignature: '确认是否已插入签章',
confirmIsInsertSignatureCont: '本节点需要前往在线编辑页面插入签章,请前往在线编辑页面确认是否已经插入签章,检查签章页无误后再行提交。', confirmIsInsertSignatureCont: '本节点需要前往在线编辑页面插入签章,请前往在线编辑页面确认是否已经插入签章,检查签章页无误后再行提交。',
confirmIsInsertSignatureOkText: '前往在线编辑页面', confirmIsInsertSignatureOkText: '前往在线编辑页面',
confirmIsInsertSignatureCancelText: '确认签章页无误并提交' confirmIsInsertSignatureCancelText: '确认签章页无误并提交',
haveNoOpinion: '有无意见',
have: '有',
noHave: '无'
}, },
// 企标更改流程 // 企标更改流程
enStandardChange: { enStandardChange: {
@@ -1,6 +1,8 @@
<template> <template>
<div> <div>
<base-info-form ref="baseInfoForm" v-bind="$attrs" disabled></base-info-form> <base-info-form ref="baseInfoForm" v-bind="$attrs" disabled></base-info-form>
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<div class="form-flex-box">
<!-- 标准文本 --> <!-- 标准文本 -->
<div class="box-title-text form-flex-item"> <div class="box-title-text form-flex-item">
<div class="title-text"> <div class="title-text">
@@ -15,6 +17,28 @@
</div> </div>
</a-form-model-item> </a-form-model-item>
</div> </div>
<!-- 有无意见 -->
<div class="box-title-text form-flex-item">
<div class="title-text title-text-long">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.haveNoOpinion')">
{{ $t('workCenter.enStandardRevision.haveNoOpinion') }}
</span>
</div>
<a-form-model-item class="item-model" prop="haveNoOpinion">
<a-radio-group v-model="formInline.haveNoOpinion" :disabled="disabled" @change="reviewMeetingFlagChange">
<a-radio value="1">
{{ $t('workCenter.enStandardRevision.have') }}
</a-radio>
<a-radio value="0">
{{ $t('workCenter.enStandardRevision.noHave') }}
</a-radio>
</a-radio-group>
</a-form-model-item>
</div>
</div>
</a-form-model>
<template v-if="formInline.haveNoOpinion === '1'">
<!-- 操作区域 --> <!-- 操作区域 -->
<div v-if="!disabled" class="table-operator"> <div v-if="!disabled" class="table-operator">
<!-- 新增 --> <!-- 新增 -->
@@ -44,6 +68,7 @@
</j-table> </j-table>
</div> </div>
</template>
<comment-modal ref="commentModal" @ok="modalFormOk"></comment-modal> <comment-modal ref="commentModal" @ok="modalFormOk"></comment-modal>
</div> </div>
</template> </template>
@@ -71,6 +96,17 @@ export default {
data () { data () {
return { return {
loading: false, loading: false,
formInline: {},
rules: {
// 有无意见
haveNoOpinion: [
{
required: true,
message: this.$t('workCenter.enStandardRevision.haveNoOpinion') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
/* 分页参数 */ /* 分页参数 */
ipagination: { ipagination: {
current: 1, current: 1,
@@ -126,9 +162,18 @@ export default {
onEditFile: '' // 在线编辑的文件id onEditFile: '' // 在线编辑的文件id
} }
}, },
mounted () {
const formInline = {}
formInline.haveNoOpinion = '1'
this.formInline = Object.assign({}, formInline)
},
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.formInline = Object.assign({}, data)
if (!this.formInline.haveNoOpinion) {
this.formInline.haveNoOpinion = '1'
}
// 给表格赋值,在线编辑不知道要怎么赋值? // 给表格赋值,在线编辑不知道要怎么赋值?
this.dataSource = data.advices.map(item => { this.dataSource = data.advices.map(item => {
const uidGenerator = () => { const uidGenerator = () => {
@@ -148,7 +193,7 @@ export default {
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
// 把数据抛出,在线编辑不知道要不要抛 // 把数据抛出,在线编辑不知道要不要抛
const data = {} const data = Object.assign({}, this.formInline)
data.advices = this.dataSource data.advices = this.dataSource
data.businessJson = JSON.stringify(this.$refs.baseInfoForm.getData()) data.businessJson = JSON.stringify(this.$refs.baseInfoForm.getData())
// 在线编辑文件id // 在线编辑文件id
@@ -156,15 +201,20 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () { async getDataValidate () {
if (this.dataSource && this.dataSource.length > 0) { let data = {} // 要返回的数据
const 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 data.advices = this.dataSource
return data } else if (this.formInline.haveNoOpinion === '1' && (!this.dataSource || this.dataSource.length <= 0)) {
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData')) this.$message.warning(this.$t('addAtLeastOneRowOfData'))
return false data = false
} else {
data = Object.assign({}, this.formInline)
} }
})
return data
}, },
handleTableChange (pagination) { handleTableChange (pagination) {
this.ipagination = pagination this.ipagination = pagination
@@ -212,6 +262,10 @@ export default {
// 在线编辑的查看 // 在线编辑的查看
onlineEditView () { onlineEditView () {
this.$emit('onlineEditView', this.onEditFile) this.$emit('onlineEditView', this.onEditFile)
},
reviewMeetingFlagChange () {
console.log('------change', this.formInline)
this.$forceUpdate()
} }
} }
} }