浏览代码

省市区新增删除逻辑

pull/1/head
yufei111 2 年前
父节点
当前提交
97a8bd6bd4
共有 3 个文件被更改,包括 21725 次插入183 次删除
  1. +21710
    -175
      package-lock.json
  2. +0
    -1
      src/views/data/tenant/index.vue
  3. +15
    -7
      src/views/data/tenant/tenant-edit.vue

+ 21710
- 175
package-lock.json
文件差异内容过多而无法显示
查看文件


+ 0
- 1
src/views/data/tenant/index.vue 查看文件

@@ -32,7 +32,6 @@
:datasource="url"
:columns="columns"
:where="where"
v-model:selection="selection"
:scroll="{x: 'max-content'}">
<template #toolbar>
<a-space>

+ 15
- 7
src/views/data/tenant/tenant-edit.vue 查看文件

@@ -298,26 +298,34 @@ export default {
},
/* 选择省市区 */
selectArea(value, type, name){
this.getListBycode(value, type, name)
if (type === 'province') {
this.cityList = []
this.districtList = []
this.form.cityCode = null
this.form.cityName = null
this.form.districtCode = null
this.form.districtName = null
}
if (type === 'city') {
this.districtList = []
this.form.districtCode = null
this.form.districtName = null
}
this.getListBycode(value, type, name)
},
/* 根据选择的选中的code返回子项列表 */
getListBycode(code, name, childrenName) {
this[name + 'List'].forEach((item) => {
if (item.citycode == code) {
this[childrenName + 'List'] = item.itemList
this.form[name+'Name'] = item.name
}
})
if(code) {
this[name + 'List'].forEach((item) => {
if (item.citycode == code) {
this[childrenName + 'List'] = item.itemList
this.form[name+'Name'] = item.name
}
})
} else {
this[childrenName + 'List'] = []
this.form[name+'Name'] = null
}
},
/* 保存编辑 */
save() {

正在加载...
取消
保存