|
@@ -6,7 +6,7 @@
|
|
<el-input v-model="form.name" placeholder="请输入门店名称" clearable />
|
|
<el-input v-model="form.name" placeholder="请输入门店名称" clearable />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="城市筛选:">
|
|
<el-form-item label="城市筛选:">
|
|
- <el-cascader v-model="form.list" :options="options" placeholder="请选择省市区" clearable
|
|
|
|
|
|
+ <el-cascader v-model="form.list" :options="mapOptions" placeholder="请选择省市区" clearable
|
|
:props="{ value: 'id', label: 'name', children: 'childList', checkStrictly: true }" />
|
|
:props="{ value: 'id', label: 'name', children: 'childList', checkStrictly: true }" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="当前状态:">
|
|
<el-form-item label="当前状态:">
|
|
@@ -59,8 +59,10 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { list, options, change, remove } from '@/api/operation/map'
|
|
|
|
|
|
+import { mapMixin } from '@/mixin/index'
|
|
|
|
+import { list, change, remove } from '@/api/operation/map'
|
|
export default {
|
|
export default {
|
|
|
|
+ mixins: [mapMixin],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
// 遮罩层
|
|
// 遮罩层
|
|
@@ -73,8 +75,6 @@ export default {
|
|
},
|
|
},
|
|
// 总数据
|
|
// 总数据
|
|
total: 0,
|
|
total: 0,
|
|
- // 省市区
|
|
|
|
- options: [],
|
|
|
|
// 列表
|
|
// 列表
|
|
tableData: [],
|
|
tableData: [],
|
|
// 当前状态
|
|
// 当前状态
|
|
@@ -94,8 +94,7 @@ export default {
|
|
this.form.area = val[2]
|
|
this.form.area = val[2]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async mounted() {
|
|
|
|
- await this.getOptions()
|
|
|
|
|
|
+ mounted() {
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -126,17 +125,6 @@ export default {
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
|
|
|
|
- // 省市区
|
|
|
|
- getOptions() {
|
|
|
|
- return new Promise((reslove, reject) => {
|
|
|
|
- options().then(res => {
|
|
|
|
- if (res.code === 0) {
|
|
|
|
- reslove(this.options = res.data)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
// 新增、 编辑、 查看
|
|
// 新增、 编辑、 查看
|
|
getDetail(id, boolean) {
|
|
getDetail(id, boolean) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
@@ -173,16 +161,6 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
// 字典翻译
|
|
// 字典翻译
|
|
- areaFormatter(row) {
|
|
|
|
- let province = this.options.find(i => i.id == row.province)
|
|
|
|
- let provinceName = province.name
|
|
|
|
- let city = province.childList.length > 0 ? province.childList.find(i => i.id == row.city) : ''
|
|
|
|
- let cityName = city ? `-${city.name}` : ''
|
|
|
|
- let area = city && city.childList.length > 0 ? city.childList.find(i => i.id == row.area) : ''
|
|
|
|
- let areaName = area ? `-${area.name}` : ''
|
|
|
|
- return `${provinceName}${cityName}${areaName}`
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
statusFormatter(row) {
|
|
statusFormatter(row) {
|
|
return this.selectDictLabel(this.statusOptions, row.status)
|
|
return this.selectDictLabel(this.statusOptions, row.status)
|
|
}
|
|
}
|