[update] 市场清单发布流程

This commit is contained in:
lideqin
2024-07-15 15:47:02 +08:00
parent 1d44f9552a
commit d31c4cbcb1
@@ -79,28 +79,30 @@
</j-table> </j-table>
</div> </div>
<a-form-model v-if="currentNode === 1" :model="userFormInline" class="form-user" :rules="userRules" ref="userRuleForm"> <template v-if="currentNode === 1">
<div class="form-flex-box"> <a-form-model :model="userFormInline" class="form-user" :rules="rules" ref="userRuleForm">
<!-- 抄送人员 --> <div class="form-flex-box">
<div class="box-title-text form-flex-item form-flex-item-half"> <!-- 抄送人员 -->
<div class="title-text title-text-long"> <div class="box-title-text form-flex-item form-flex-item-half">
<span class="required">*</span> <div class="title-text title-text-long">
<span class="title-text-text" :title="$t('ccPerson')"> <span class="required">*</span>
<span class="title-text-text" :title="$t('ccPerson')">
{{ $t('ccPerson') }} {{ $t('ccPerson') }}
</span> </span>
</div>
<a-form-model-item class="item-model" prop="copyUser">
<user-selection v-model="userFormInline.copyUser"
:placeholder="$t('pleaseSelect')+$t('ccPerson')"
:disabled="disabled"
filedName="copyUser"
@nameChange="userSelectNameChange"
:nameStr="userFormInline.copyUser_dictText"
type="radio"/>
</a-form-model-item>
</div> </div>
<a-form-model-item class="item-model" prop="ccPerson">
<user-selection v-model="userFormInline.ccPerson"
:placeholder="$t('pleaseSelect')+$t('ccPerson')"
:disabled="disabled"
filedName="ccPerson"
@nameChange="userSelectNameChange"
:nameStr="userFormInline.ccPerson_dictText"
type="radio"/>
</a-form-model-item>
</div> </div>
</div> </a-form-model>
</a-form-model> </template>
</div> </div>
</template> </template>
@@ -149,11 +151,9 @@ export default {
message: this.$t('listNumber') + this.$t('cannotEmpty'), message: this.$t('listNumber') + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
} }
] ],
},
userRules: {
// 抄送人员 // 抄送人员
ccPerson: [ copyUser: [
{ {
required: true, required: true,
message: this.$t('ccPerson') + this.$t('cannotEmpty'), message: this.$t('ccPerson') + this.$t('cannotEmpty'),
@@ -361,8 +361,12 @@ export default {
return { value: item } return { value: item }
}) })
} }
this.userFormInline.ccPerson = data.ccPerson if (this.currentNode === 1) {
this.userFormInline.ccPerson_dictText = data.ccPerson_dictText const userFormInline = {}
userFormInline.copyUser = data.copyUser
userFormInline.copyUser_dictText = data.copyUser_dictText
this.userFormInline = Object.assign({}, userFormInline)
}
this.dataSource = JSON.parse(JSON.stringify(data.list)) this.dataSource = JSON.parse(JSON.stringify(data.list))
this.isGetDataAfter = true this.isGetDataAfter = true
}, },
@@ -371,27 +375,37 @@ export default {
// 把数据抛出,在线编辑不知道要不要抛 // 把数据抛出,在线编辑不知道要不要抛
const data = Object.assign({}, this.formInline) const data = Object.assign({}, this.formInline)
data.country = data.country.map(item => item.value).join(',') data.country = data.country.map(item => item.value).join(',')
data.ccPerson = this.userFormInline.ccPerson data.copyUser = this.userFormInline.copyUser
data.ccPerson_dictText = this.userFormInline.ccPerson_dictText data.copyUser_dictText = this.userFormInline.copyUser_dictText
data.list = JSON.parse(JSON.stringify(this.dataSource)) data.list = JSON.parse(JSON.stringify(this.dataSource))
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () { async getDataValidate () {
let data = {} let data = {}
await this.$refs.ruleForm.validate(valid => { if (this.currentNode === 1) {
this.$refs.userRuleForm.validate(userValid => { await this.$refs.ruleForm.validate(async valid => {
if (valid && userValid) { await this.$refs.userRuleForm.validate(userValid => {
if (valid && userValid) {
data = Object.assign({}, this.formInline, this.userFormInline)
data.country = data.country.map(item => item.value).join(',')
data.list = JSON.parse(JSON.stringify(this.dataSource))
} else {
data = false
}
})
})
} else {
await this.$refs.ruleForm.validate(valid => {
if (valid) {
data = Object.assign({}, this.formInline) data = Object.assign({}, this.formInline)
data.country = data.country.map(item => item.value).join(',') data.country = data.country.map(item => item.value).join(',')
data.ccPerson = this.userFormInline.ccPerson
data.ccPerson_dictText = this.userFormInline.ccPerson_dictText
data.list = JSON.parse(JSON.stringify(this.dataSource)) data.list = JSON.parse(JSON.stringify(this.dataSource))
} else { } else {
data = false data = false
} }
}) })
}) }
return data return data
}, },
// 选择用户得到用户名 // 选择用户得到用户名