tianyi 1 month ago
parent
commit
70d3c89e47
  1. 70
      src/views/app/business/lineManage/addEdit.vue
  2. 26
      src/views/app/business/lineManage/lineManage.vue

70
src/views/app/business/lineManage/addEdit.vue

@ -19,7 +19,7 @@
<Row :gutter="32"> <Row :gutter="32">
<Col span="12"> <Col span="12">
<FormItem label="商家名" prop="value"> <FormItem label="商家名" prop="value">
<Select v-model="form.merchantId" filterable @on-change="checkShop" @on-query-change="sreachShop"> <Select v-model="form.merchantId" filterable @on-change="checkShop" :remote-method="sreachShop" :loading="loading1">
<Option v-for="item in shopList" v-model="item.value" :key="item.value">{{ item.label }}</Option> <Option v-for="item in shopList" v-model="item.value" :key="item.value">{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
@ -118,6 +118,7 @@
}, },
data() { data() {
return { return {
loading1:false,
aaVisiable:false, aaVisiable:false,
shopList:[], shopList:[],
roleList: [], roleList: [],
@ -198,9 +199,31 @@
updateAD(this.form).then((res) => { updateAD(this.form).then((res) => {
this.submitLoading = false; this.submitLoading = false;
if (res.success) { if (res.success) {
this.form = {}
this.$Message.success("操作成功"); this.$Message.success("操作成功");
this.$emit("on-submit", true); this.$emit("on-submit", true);
this.form = {
position: '',
sortOrder:"",
title:'',
adImage:'',
status:1,
regionId:JSON.parse(this.getStore("user")).departmentId,
merchantName:'',
merchantId:'',
merchantImage:'',
linkUrl:'/package1/group/groupBuySingle?type=shop&item=',
linkParams:'',
productList1:{
adId: "",
productImage: "",
productName: "",
originalPrice: "",
groupPrice: "",
groupMembers: ""
},
productList:[]
}
this.visible = false; this.visible = false;
} }
}); });
@ -210,9 +233,31 @@
addAD(this.form).then((res) => { addAD(this.form).then((res) => {
this.submitLoading = false; this.submitLoading = false;
if (res.success) { if (res.success) {
this.form = {}
this.$Message.success("操作成功"); this.$Message.success("操作成功");
this.$emit("on-submit", true); this.$emit("on-submit", true);
this.form = {
position: '',
sortOrder:"",
title:'',
adImage:'',
status:1,
regionId:JSON.parse(this.getStore("user")).departmentId,
merchantName:'',
merchantId:'',
merchantImage:'',
linkUrl:'/package1/group/groupBuySingle?type=shop&item=',
linkParams:'',
productList1:{
adId: "",
productImage: "",
productName: "",
originalPrice: "",
groupPrice: "",
groupMembers: ""
},
productList:[]
}
this.visible = false; this.visible = false;
} }
}); });
@ -276,6 +321,14 @@
this.form.merchantImage = this.shopList[i].shopIcon this.form.merchantImage = this.shopList[i].shopIcon
} }
} }
this.form.productList1 = {
adId: this.form.productList1.adId,
productImage: "",
productName: "",
originalPrice: "",
groupPrice: "",
groupMembers: ""
}
}, },
checkStatusLine(v){ checkStatusLine(v){
this.form.position = v this.form.position = v
@ -308,6 +361,17 @@
console.log('回显数据',data) console.log('回显数据',data)
// //
this.form = data; this.form = data;
getShopData(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.shopList = res.result.content;
for(let i=0;i<this.shopList.length;i++){
this.shopList[i].label = this.shopList[i].shopName
this.shopList[i].value = this.shopList[i].id
}
}
});
if(data.productList.length>0){ if(data.productList.length>0){
this.form.productList1 = { this.form.productList1 = {
adId: data.id, adId: data.id,

26
src/views/app/business/lineManage/lineManage.vue

@ -127,7 +127,7 @@
{ {
title: "商家主图", title: "商家主图",
key: "merchantImage", key: "merchantImage",
minWidth: 250, width: 150,
render: (h, params) => { render: (h, params) => {
return h("img", { return h("img", {
@ -202,19 +202,19 @@
} }
}, },
{ {
title: "广告关联商品列表", title: "广告关联商品",
key: "productList", key: "productList",
width: 100, width: 150,
// render: (h, params) => { render: (h, params) => {
// let re = "" let re = ""
// if(params.row.productList != ''){ if(params.row.productList != ''){
// re = params.row.productList[0].productName re = params.row.productList[0].productName
// } }
// return h( return h(
// "div", "div",
// re re
// ); );
// } }
}, },
{ {
title: "操作", title: "操作",

Loading…
Cancel
Save