|
@@ -18,17 +18,8 @@
|
|
|
>
|
|
|
<div class="dialog">
|
|
|
<div>
|
|
|
- <el-form :model="form" ref="form" size="small" :rules="rules" :inline="true" label-width="100px">
|
|
|
- <!-- <el-form-item label="门店POIID" prop="poiId">
|
|
|
- <el-input
|
|
|
- v-model="form.poiId"
|
|
|
- placeholder="请输入门店POIID"
|
|
|
- clearable
|
|
|
- style="width: 240px"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="商品类目ID" prop="categoryId">
|
|
|
+ <el-form :model="form" ref="form" size="small" :rules="rules" :inline="true" label-width="68px">
|
|
|
+ <el-form-item label="商品类目ID" prop="categoryId" label-width="110px">
|
|
|
<el-select
|
|
|
v-model="form.categoryId"
|
|
|
placeholder="商品类目ID"
|
|
@@ -36,13 +27,27 @@
|
|
|
style="width: 240px"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.tiktok_category"
|
|
|
+ v-for="dict in dict.type.maoyan_category"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- </el-form-item> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="城市" prop="cityId">
|
|
|
+ <el-cascader
|
|
|
+ v-model="form.cityId"
|
|
|
+ :options="cityList"
|
|
|
+ style="width: 400px;"
|
|
|
+ :props="{
|
|
|
+ children: 'child',
|
|
|
+ label: 'name',
|
|
|
+ value: 'value',
|
|
|
+ checkStrictly: true,
|
|
|
+ emitPath: false,
|
|
|
+ }"
|
|
|
+ clearable></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<el-table
|
|
@@ -173,12 +178,13 @@ import {
|
|
|
getCalendarPriceApi,
|
|
|
setCalendarPriceApi,
|
|
|
getPushListApi,
|
|
|
- deleteCalendarPriceApi
|
|
|
+ deleteCalendarPriceApi,
|
|
|
+ getCityListApi
|
|
|
} from "@/api/otaMr/maoyan";
|
|
|
import moment from "moment"
|
|
|
export default {
|
|
|
name: "dataEdit",
|
|
|
- dicts: ['tiktok_category','tiktok_scheduling_status'],
|
|
|
+ dicts: ['maoyan_category','tiktok_scheduling_status'],
|
|
|
data() {
|
|
|
return {
|
|
|
title: "编辑",
|
|
@@ -190,6 +196,7 @@ export default {
|
|
|
rules: {
|
|
|
poiId: [{ required: true, message: "请输入门店POIID", trigger: ["change","blur"] }],
|
|
|
categoryId: [{ required: true, message: "请选择商品类目ID", trigger: ["change","blur"] }],
|
|
|
+ cityId: [{ required: true, message: "请选择城市", trigger: ["change","blur"] }],
|
|
|
},
|
|
|
multipleSelection: [],
|
|
|
|
|
@@ -213,8 +220,13 @@ export default {
|
|
|
},
|
|
|
seatTypeId: null,
|
|
|
calendarId: null,
|
|
|
+
|
|
|
+ cityList: []
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getCityListFun()
|
|
|
+ },
|
|
|
methods: {
|
|
|
/**
|
|
|
* 打开弹框
|
|
@@ -239,6 +251,34 @@ export default {
|
|
|
})
|
|
|
this.$refs["form"].clearValidate()
|
|
|
})
|
|
|
+ },
|
|
|
+ /** 获取城市 */
|
|
|
+ async getCityListFun() {
|
|
|
+ try {
|
|
|
+ let res = await getCityListApi()
|
|
|
+ if(res.code == 200) {
|
|
|
+ let list = []
|
|
|
+ list = this.setTreeData(res.data)
|
|
|
+ console.log("list===",list)
|
|
|
+ this.cityList = list
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setTreeData(list) {
|
|
|
+ let listCopy = []
|
|
|
+ list.forEach((item,index)=>{
|
|
|
+ listCopy.push({
|
|
|
+ ...item
|
|
|
+ })
|
|
|
+ if(item.child && item.child.length>0){
|
|
|
+ listCopy[index]['child'] = this.setTreeData(item.child)
|
|
|
+ }else {
|
|
|
+ listCopy[index]['child'] = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return listCopy
|
|
|
},
|
|
|
/** 获取设置的日历价格 */
|
|
|
async getPushListFun(obj,type) {
|