Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
59fd6433c0
|
@ -11,17 +11,6 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="广告类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择广告类型" @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ad_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
@ -40,15 +29,6 @@
|
|||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-has-permi="['bst:ad:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -65,17 +45,12 @@
|
|||
|
||||
<el-table v-loading="loading" :data="adList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="广告类型" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ad_type" :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="广告所属" align="center" prop="belong">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ad_belong" :value="scope.row.belong"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属运营区" align="center" prop="area_name">
|
||||
<el-table-column label="所属运营区" align="center" prop="areaName">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.areaName || '-' }}</span>
|
||||
</template>
|
||||
|
@ -122,11 +97,20 @@
|
|||
|
||||
<!-- 添加或修改广告对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-form-item label="广告类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择广告类型">
|
||||
<el-form ref="form" :model="form" label-width="80px" v-loading="detailLoading">
|
||||
<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="belong" v-if="isSysAdmin()">
|
||||
<el-select v-model="form.belong" placeholder="请选择广告所属">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ad_type"
|
||||
v-for="dict in dict.type.ad_belong"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
@ -165,6 +149,8 @@
|
|||
import { listAd, getAd, delAd, addAd, updateAd } from "@/api/bst/ad";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
||||
import {isSysAdmin} from "@/utils/permission";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
|
@ -175,8 +161,14 @@ const defaultSort = {
|
|||
export default {
|
||||
name: "Ad",
|
||||
dicts:['ad_type','ad_url_type','ad_belong'],
|
||||
props:{
|
||||
id: {
|
||||
type: [String, Number],
|
||||
default: null
|
||||
},
|
||||
},
|
||||
mixins: [$showColumns],
|
||||
components: {FormCol},
|
||||
components: {AreaRemoteSelect, FormCol},
|
||||
data() {
|
||||
return {
|
||||
span: 24,
|
||||
|
@ -227,12 +219,19 @@ export default {
|
|||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
detailLoading: false,
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
initAreaOptions() {
|
||||
return [{id: this.form.areaId, name: this.form.areaName}]
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
isSysAdmin,
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
|
@ -262,6 +261,7 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
adId: null,
|
||||
areaId: null,
|
||||
type: null,
|
||||
picture: null,
|
||||
url: null,
|
||||
|
@ -301,10 +301,13 @@ export default {
|
|||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const adId = row.adId || this.ids
|
||||
this.detailLoading = true;
|
||||
getAd(adId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改广告";
|
||||
}).finally(() => {
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
|
|
@ -117,20 +117,19 @@
|
|||
|
||||
<!-- 添加或修改协议对话框 -->
|
||||
<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">
|
||||
<el-row>
|
||||
<form-col :span="24" label="标题" prop="title">
|
||||
<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="请输入标题" />
|
||||
</form-col>
|
||||
<form-col label="运营区" prop="areaId">
|
||||
</el-form-item>
|
||||
<el-form-item label="运营区" prop="areaId" >
|
||||
<area-remote-select
|
||||
v-model="form.areaId"
|
||||
:init-options="initAreaOptions"
|
||||
v-if="!detailLoading"
|
||||
placeholder="请选择运营区"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
style="width: 100%"
|
||||
style="width: 58%"
|
||||
/>
|
||||
</form-col>
|
||||
</el-form-item>
|
||||
<el-col :span="12">
|
||||
<form-col label="协议类型" prop="agreementType">
|
||||
<el-select
|
||||
|
@ -168,8 +167,6 @@
|
|||
<form-col :span="span" label="内容详情">
|
||||
<editor v-model="form.content" :min-height="200"/>
|
||||
</form-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -185,6 +182,7 @@ import { $showColumns } from '@/utils/mixins';
|
|||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import Editor from "@/components/Editor/index.vue";
|
||||
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
|
@ -286,6 +284,7 @@ export default {
|
|||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
detailLoading: false,
|
||||
// 表单校验
|
||||
rules: {
|
||||
title: [
|
||||
|
@ -294,6 +293,11 @@ export default {
|
|||
}
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
initAreaOptions() {
|
||||
return [{id: this.form.areaId, name: this.form.areaName}]
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
@ -328,6 +332,7 @@ export default {
|
|||
this.form = {
|
||||
id: null,
|
||||
storeId: null,
|
||||
areaName:null,
|
||||
areaId: null,
|
||||
title: null,
|
||||
brief: null,
|
||||
|
@ -365,10 +370,13 @@ export default {
|
|||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
this.detailLoading = true
|
||||
getAgreement(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改协议";
|
||||
}).finally(()=>{
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
|
Loading…
Reference in New Issue
Block a user