|
@@ -35,10 +35,10 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="8" :sm="24">
|
|
<a-col :md="8" :sm="24">
|
|
- <a-form-model-item label="地区">
|
|
|
|
|
|
+ <a-form-model-item label="地区">
|
|
<AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
|
|
<AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-button type="primary" @click="searchForm" :disabled="disabled" id="viewDealers-refresh">查询</a-button>
|
|
<a-button type="primary" @click="searchForm" :disabled="disabled" id="viewDealers-refresh">查询</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="viewDealers-reset">重置</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="viewDealers-reset">重置</a-button>
|
|
@@ -58,7 +58,7 @@
|
|
</a-empty>
|
|
</a-empty>
|
|
</div>
|
|
</div>
|
|
<div class="tableCon" v-else>
|
|
<div class="tableCon" v-else>
|
|
- <div style="text-align:right;margin-bottom:10px;"><a-button type="primary" class="button-error" @click="openAddDealer=true"><a-icon type="plus" />绑定经销商</a-button></div>
|
|
|
|
|
|
+ <div style="margin-bottom:10px;"><a-button type="primary" class="button-error" @click="openAddDealer=true">绑定经销商</a-button></div>
|
|
<s-table
|
|
<s-table
|
|
class="sTable"
|
|
class="sTable"
|
|
ref="table"
|
|
ref="table"
|
|
@@ -70,13 +70,13 @@
|
|
:scroll="{ y: tableHeight }"
|
|
:scroll="{ y: tableHeight }"
|
|
bordered>
|
|
bordered>
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-error"
|
|
|
|
- @click="handleDel(record)"
|
|
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
|
|
+ @click="handleDel(record)"
|
|
>删除</a-button>
|
|
>删除</a-button>
|
|
- </template>
|
|
|
|
|
|
+ </template>
|
|
</s-table>
|
|
</s-table>
|
|
</div>
|
|
</div>
|
|
</a-spin>
|
|
</a-spin>
|
|
@@ -93,7 +93,13 @@
|
|
class="deraw-bindDealer"
|
|
class="deraw-bindDealer"
|
|
@close="openAddDealer = false">
|
|
@close="openAddDealer = false">
|
|
<div class="dealerModalCon">
|
|
<div class="dealerModalCon">
|
|
- <chooseDealer ref="chooseDealer" v-if="openAddDealer" :parentData="parentData" pageType="viewDealers" @add="hanldAdd" @plAdd="hanldPlAdd"></chooseDealer>
|
|
|
|
|
|
+ <chooseDealer
|
|
|
|
+ ref="chooseDealer"
|
|
|
|
+ v-if="openAddDealer"
|
|
|
|
+ :parentData="parentData"
|
|
|
|
+ pageType="viewDealers"
|
|
|
|
+ @add="hanldAdd"
|
|
|
|
+ @plAdd="hanldPlAdd"></chooseDealer>
|
|
</div>
|
|
</div>
|
|
</a-drawer>
|
|
</a-drawer>
|
|
</div>
|
|
</div>
|
|
@@ -116,7 +122,7 @@ export default {
|
|
},
|
|
},
|
|
parentData: {
|
|
parentData: {
|
|
type: Object,
|
|
type: Object,
|
|
- default: function(){
|
|
|
|
|
|
+ default: function () {
|
|
return null
|
|
return null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -129,7 +135,7 @@ export default {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
this.resetData()
|
|
this.resetData()
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.pageInit()
|
|
this.pageInit()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -145,7 +151,7 @@ export default {
|
|
openAddDealer: false,
|
|
openAddDealer: false,
|
|
flag: true,
|
|
flag: true,
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
- dealer:{
|
|
|
|
|
|
+ dealer: {
|
|
nameLike: '',
|
|
nameLike: '',
|
|
dealerType: null,
|
|
dealerType: null,
|
|
dealerLevel: null,
|
|
dealerLevel: null,
|
|
@@ -171,7 +177,7 @@ export default {
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- return queryPageAreaDealer(Object.assign(parameter, this.queryParam, {subareaSn: this.parentData.subareaSn, subareaAreaSn: this.parentData.subareaAreaSn})).then(res => {
|
|
|
|
|
|
+ return queryPageAreaDealer(Object.assign(parameter, this.queryParam, { subareaSn: this.parentData.subareaSn, subareaAreaSn: this.parentData.subareaAreaSn })).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
@@ -185,15 +191,15 @@ export default {
|
|
this.setTableH()
|
|
this.setTableH()
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 绑定
|
|
// 绑定
|
|
- hanldAdd(row){
|
|
|
|
|
|
+ hanldAdd (row) {
|
|
console.log(row)
|
|
console.log(row)
|
|
- bindDealer({subareaAreaSn: this.parentData.subareaAreaSn,dealerSn:row.dealerSn}).then(res => {
|
|
|
|
- if(res.status == 200){
|
|
|
|
|
|
+ bindDealer({ subareaAreaSn: this.parentData.subareaAreaSn, dealerSn: row.dealerSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
this.resetSearchForm()
|
|
this.resetSearchForm()
|
|
this.$refs.chooseDealer.searchForm(false)
|
|
this.$refs.chooseDealer.searchForm(false)
|
|
}
|
|
}
|
|
@@ -201,10 +207,10 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 批量绑定
|
|
// 批量绑定
|
|
- hanldPlAdd(rows){
|
|
|
|
|
|
+ hanldPlAdd (rows) {
|
|
console.log(rows)
|
|
console.log(rows)
|
|
- batchBindDealer({subareaAreaSn: this.parentData.subareaAreaSn,dealerSnSet:rows}).then(res => {
|
|
|
|
- if(res.status == 200){
|
|
|
|
|
|
+ batchBindDealer({ subareaAreaSn: this.parentData.subareaAreaSn, dealerSnSet: rows }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
this.resetSearchForm()
|
|
this.resetSearchForm()
|
|
this.$refs.chooseDealer.searchForm(false)
|
|
this.$refs.chooseDealer.searchForm(false)
|
|
}
|
|
}
|
|
@@ -212,7 +218,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 删除
|
|
// 删除
|
|
- handleDel(row){
|
|
|
|
|
|
+ handleDel (row) {
|
|
const _this = this
|
|
const _this = this
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
@@ -220,8 +226,8 @@ export default {
|
|
centered: true,
|
|
centered: true,
|
|
onOk () {
|
|
onOk () {
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- deleteBindDealer({sn: row.subareaAreaDealerSn}).then(res => {
|
|
|
|
- if(res.status == 200){
|
|
|
|
|
|
+ deleteBindDealer({ sn: row.subareaAreaDealerSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
_this.resetSearchForm()
|
|
_this.resetSearchForm()
|
|
}
|
|
}
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
@@ -229,42 +235,42 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- searchForm(){
|
|
|
|
- if(this.flag){
|
|
|
|
|
|
+ searchForm () {
|
|
|
|
+ if (this.flag) {
|
|
this.hasData()
|
|
this.hasData()
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- resetData(){
|
|
|
|
|
|
+ resetData () {
|
|
this.queryParam = {
|
|
this.queryParam = {
|
|
- dealer:{
|
|
|
|
- nameLike: '',
|
|
|
|
- dealerType: null,
|
|
|
|
- dealerLevel: null,
|
|
|
|
- auditState: undefined,
|
|
|
|
- provinceSn: undefined,
|
|
|
|
- citySn: undefined,
|
|
|
|
- districtSn: undefined
|
|
|
|
- }
|
|
|
|
|
|
+ dealer: {
|
|
|
|
+ nameLike: '',
|
|
|
|
+ dealerType: null,
|
|
|
|
+ dealerLevel: null,
|
|
|
|
+ auditState: undefined,
|
|
|
|
+ provinceSn: undefined,
|
|
|
|
+ citySn: undefined,
|
|
|
|
+ districtSn: undefined
|
|
}
|
|
}
|
|
|
|
+ }
|
|
this.$refs.areaList.clearData()
|
|
this.$refs.areaList.clearData()
|
|
},
|
|
},
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- if(this.flag){
|
|
|
|
|
|
+ if (this.flag) {
|
|
this.hasData()
|
|
this.hasData()
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.resetData()
|
|
this.resetData()
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- areaChange(val){
|
|
|
|
|
|
+ areaChange (val) {
|
|
this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
|
|
this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
|
|
this.queryParam.dealer.citySn = val[1] ? val[1] : ''
|
|
this.queryParam.dealer.citySn = val[1] ? val[1] : ''
|
|
this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
|
|
this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
|
|
},
|
|
},
|
|
- async hasData(){
|
|
|
|
- const ret = await queryPageAreaDealer({pageNo:1,pageSize:10,subareaSn: this.parentData.subareaSn, subareaAreaSn: this.parentData.subareaAreaSn}).then(res => res.data)
|
|
|
|
|
|
+ async hasData () {
|
|
|
|
+ const ret = await queryPageAreaDealer({ pageNo: 1, pageSize: 10, subareaSn: this.parentData.subareaSn, subareaAreaSn: this.parentData.subareaAreaSn }).then(res => res.data)
|
|
this.flag = ret.count == 0
|
|
this.flag = ret.count == 0
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
@@ -280,7 +286,7 @@ export default {
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
this.tableHeight = window.innerHeight - tableSearchH - 290
|
|
this.tableHeight = window.innerHeight - tableSearchH - 290
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|