|
@@ -36,8 +36,8 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col span="7" offset="1">
|
|
|
- <a-form-item prop="countySn" style="margin: 0;">
|
|
|
- <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
|
|
|
+ <a-form-item prop="districtSn" style="margin: 0;">
|
|
|
+ <a-select v-model="queryParam.districtSn" placeholder="请选择区/县">
|
|
|
<a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
@@ -62,6 +62,7 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
+ :defaultLoadData="false"
|
|
|
bordered>
|
|
|
</s-table>
|
|
|
<!-- 按钮 -->
|
|
@@ -139,11 +140,17 @@ export default {
|
|
|
methods: {
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
+ this.resetData()
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ resetData () {
|
|
|
+ console.log('重置艾迪康')
|
|
|
this.queryParam.dealerName = ''
|
|
|
this.queryParam.provinceSn = undefined
|
|
|
this.queryParam.citySn = undefined
|
|
|
this.queryParam.districtSn = undefined
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ this.addrCityList = []
|
|
|
+ this.addrDistrictList = []
|
|
|
},
|
|
|
// 确定
|
|
|
handleSubmit () {
|
|
@@ -173,28 +180,28 @@ export default {
|
|
|
this.getArea('district', val)
|
|
|
},
|
|
|
// 省/市/区
|
|
|
- getArea (type, sn) {
|
|
|
+ getArea (leve, sn) {
|
|
|
let params
|
|
|
- if (type == 'province') {
|
|
|
- params = { level: '1' }
|
|
|
+ if (leve == 'province') {
|
|
|
+ params = { type: '2' }
|
|
|
} else {
|
|
|
- params = { psn: sn }
|
|
|
+ params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
|
|
|
}
|
|
|
getArea(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- if (type == 'province') {
|
|
|
+ if (leve == 'province') {
|
|
|
this.addrProvinceList = res.data || []
|
|
|
- } else if (type == 'city') {
|
|
|
+ } else if (leve == 'city') {
|
|
|
this.addrCityList = res.data || []
|
|
|
- } else if (type == 'district') {
|
|
|
+ } else if (leve == 'district') {
|
|
|
this.addrDistrictList = res.data || []
|
|
|
}
|
|
|
} else {
|
|
|
- if (type == 'province') {
|
|
|
+ if (leve == 'province') {
|
|
|
this.addrProvinceList = []
|
|
|
- } else if (type == 'city') {
|
|
|
+ } else if (leve == 'city') {
|
|
|
this.addrCityList = []
|
|
|
- } else if (type == 'district') {
|
|
|
+ } else if (leve == 'district') {
|
|
|
this.addrDistrictList = []
|
|
|
}
|
|
|
}
|
|
@@ -210,11 +217,16 @@ export default {
|
|
|
isShow (newValue, oldValue) {
|
|
|
if (!newValue) {
|
|
|
this.$emit('close')
|
|
|
+ this.resetData()
|
|
|
} else {
|
|
|
this.selectedRowKeys = this.chooseCust
|
|
|
if (this.addrProvinceList.length == 0) {
|
|
|
this.getArea('province')
|
|
|
}
|
|
|
+ const _this = this
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.$refs.table.refresh(true)
|
|
|
+ }, 200)
|
|
|
}
|
|
|
}
|
|
|
}
|