协议增加类型
This commit is contained in:
parent
4e853edf72
commit
cbfdd158e6
|
@ -86,6 +86,10 @@
|
|||
<dict-tag :options="dict.type.agreement_type" :value="d.row.agreementType" size="mini"
|
||||
style="margin-left: 4px;"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'contentType'">
|
||||
<dict-tag :options="dict.type.agreement_content_type" :value="d.row.contentType" size="mini"
|
||||
style="margin-left: 4px;"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'userName'">
|
||||
<user-link :id="d.row.storeId" :text="d.row.userName"/>
|
||||
</template>
|
||||
|
@ -128,56 +132,52 @@
|
|||
<!-- 添加或修改协议对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-loading="detailLoading">
|
||||
<el-form-item :span="24" label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运营区" prop="areaId">
|
||||
<area-remote-select
|
||||
v-model="form.areaId"
|
||||
:init-options="initAreaOptions"
|
||||
v-if="!detailLoading"
|
||||
placeholder="请选择运营区"
|
||||
style="width: 58%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" style="width: 95%"/>
|
||||
</el-form-item>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<form-col label="内容类型" prop="contentType">
|
||||
<el-form-item label="内容类型" prop="contentType">
|
||||
<el-select
|
||||
v-model="form.contentType"
|
||||
@change="handleContentTypeChange"
|
||||
placeholder="请选择内容类型"
|
||||
style="width: 95%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.agreement_content_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<el-option v-for="dict in dict.type.agreement_content_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<form-col label="协议类型" prop="agreementType">
|
||||
<el-form-item label="协议类型" prop="agreementType">
|
||||
<el-select
|
||||
v-model="form.agreementType"
|
||||
placeholder="请选择协议类型"
|
||||
style="width: 95%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.agreement_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<el-option v-for="dict in dict.type.agreement_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row gutter="20">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<form-col label="展示时长" prop="duration">
|
||||
<div style="display: flex; align-items: center; gap: 10px">
|
||||
<el-form-item label="运营区" prop="areaId" v-if="showAreaSelect">
|
||||
<area-remote-select
|
||||
v-model="form.areaId"
|
||||
:init-options="initAreaOptions"
|
||||
v-if="!detailLoading"
|
||||
placeholder="请选择运营区"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-form-item label="展示时长" prop="duration">
|
||||
<div style="display: flex; gap: 10px">
|
||||
<el-input-number
|
||||
v-model="form.duration"
|
||||
:min="1"
|
||||
|
@ -188,21 +188,15 @@
|
|||
/>
|
||||
<span>秒</span>
|
||||
</div>
|
||||
</form-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row gutter="20">
|
||||
<el-col :span="span">
|
||||
<form-col label="简介" prop="brief">
|
||||
<el-form-item label="简介" prop="brief">
|
||||
<el-input v-model="form.brief" placeholder="请输入简介"/>
|
||||
</form-col>
|
||||
</el-col>
|
||||
<el-col :span="span">
|
||||
<form-col label="内容详情">
|
||||
</el-form-item>
|
||||
<el-form-item label="内容详情">
|
||||
<editor v-model="form.content" :min-height="150"/>
|
||||
</form-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -284,6 +278,8 @@ export default {
|
|||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选择运营区展示
|
||||
showAreaSelect: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
|
@ -342,6 +338,16 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleContentTypeChange(value) {
|
||||
// 假设当contentType为3时隐藏运营区(根据实际字典配置)
|
||||
this.showAreaSelect = !(value === '1');
|
||||
if (!this.showAreaSelect) {
|
||||
this.form.areaId = null;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate('areaId');
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user