|
@@ -55,7 +55,7 @@
|
|
:scroll="{ y: 230 }"
|
|
:scroll="{ y: 230 }"
|
|
:bordered="true"
|
|
:bordered="true"
|
|
:pagination="pagination"
|
|
:pagination="pagination"
|
|
- :row-key="record => record.no"
|
|
|
|
|
|
+ :row-key="record => record.dealerSn"
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data-source="dealerList"
|
|
:data-source="dealerList"
|
|
@@ -68,7 +68,7 @@
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import AreaList from '@/views/common/areaList.js'
|
|
import AreaList from '@/views/common/areaList.js'
|
|
-import { dealerQueryList } from '@/api/dealer'
|
|
|
|
|
|
+import { dealerQueryList, getDealerListInfo } from '@/api/dealer'
|
|
import subarea from '@/views/common/subarea.js'
|
|
import subarea from '@/views/common/subarea.js'
|
|
export default {
|
|
export default {
|
|
name: 'ChooseDealer',
|
|
name: 'ChooseDealer',
|
|
@@ -130,26 +130,24 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
onSelectChange (selectedRowKeys) {
|
|
onSelectChange (selectedRowKeys) {
|
|
- console.log('selectedRowKeys changed: ', selectedRowKeys)
|
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
this.selectedRowKeys = selectedRowKeys
|
|
},
|
|
},
|
|
handlePage (pagination, filters, sorter) {
|
|
handlePage (pagination, filters, sorter) {
|
|
- console.log(pagination);
|
|
|
|
- const pager = { ...this.pagination };
|
|
|
|
- pager.current = pagination.current;
|
|
|
|
- pager.pageSize = pagination.pageSize;
|
|
|
|
- this.pagination = pager;
|
|
|
|
-
|
|
|
|
|
|
+ const pager = { ...this.pagination }
|
|
|
|
+ pager.current = pagination.current
|
|
|
|
+ pager.pageSize = pagination.pageSize
|
|
|
|
+ this.pagination = pager
|
|
|
|
+
|
|
this.loadData({ pageNo: pagination.current, pageSize: pagination.pageSize })
|
|
this.loadData({ pageNo: pagination.current, pageSize: pagination.pageSize })
|
|
},
|
|
},
|
|
loadData (pager) {
|
|
loadData (pager) {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- const params = {pageSize: 20,pageNo:1,...pager}
|
|
|
|
|
|
+ const params = { pageSize: 20, pageNo: 1, ...pager }
|
|
dealerQueryList(Object.assign(params, this.queryParam)).then(res => {
|
|
dealerQueryList(Object.assign(params, this.queryParam)).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
- const pagination = { ...this.pagination };
|
|
|
|
|
|
+ const pagination = { ...this.pagination }
|
|
pagination.total = data.count
|
|
pagination.total = data.count
|
|
const no = 0
|
|
const no = 0
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
@@ -157,6 +155,10 @@ export default {
|
|
}
|
|
}
|
|
this.dealerList = data.list
|
|
this.dealerList = data.list
|
|
this.pagination = pagination
|
|
this.pagination = pagination
|
|
|
|
+ if (this.chooseInfo && !this.pageFlag) {
|
|
|
|
+ this.pageFlag = true
|
|
|
|
+ this.selectedRowKeys = this.chooseInfo
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|
|
@@ -170,8 +172,8 @@ export default {
|
|
this.queryParam.citySn = val[1] ? val[1] : ''
|
|
this.queryParam.citySn = val[1] ? val[1] : ''
|
|
this.queryParam.districtSn = val[2] ? val[2] : ''
|
|
this.queryParam.districtSn = val[2] ? val[2] : ''
|
|
},
|
|
},
|
|
- searchForm (flag) {
|
|
|
|
- this.$refs.table.refresh(flag)
|
|
|
|
|
|
+ searchForm () {
|
|
|
|
+ this.loadData()
|
|
this.spinning = false
|
|
this.spinning = false
|
|
},
|
|
},
|
|
subareaChange (val) {
|
|
subareaChange (val) {
|
|
@@ -198,8 +200,13 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.$refs.areaList.clearData()
|
|
this.$refs.areaList.clearData()
|
|
}
|
|
}
|
|
- this.$refs.table.clearSelected()
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ this.pagination = {
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ showSizeChanger: true,
|
|
|
|
+ current: 1
|
|
|
|
+ }
|
|
|
|
+ this.selectedRowKeys = []
|
|
|
|
+ this.loadData()
|
|
this.pageFlag = false
|
|
this.pageFlag = false
|
|
},
|
|
},
|
|
clearTable () {
|
|
clearTable () {
|
|
@@ -207,22 +214,15 @@ export default {
|
|
this.$refs.table.clearTable()
|
|
this.$refs.table.clearTable()
|
|
},
|
|
},
|
|
// 批量添加
|
|
// 批量添加
|
|
- handleBatchAudit () {
|
|
|
|
|
|
+ async handleBatchAudit () {
|
|
const _this = this
|
|
const _this = this
|
|
- if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
|
|
|
|
+ if (_this.selectedRowKeys && _this.selectedRowKeys.length < 1) {
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- const dealerSnList = _this.rowSelectionInfo.selectedRows
|
|
|
|
- // const newDealerSnList = dealerSnList.map(con => {
|
|
|
|
- // const obj = {
|
|
|
|
- // buyerName: con.dealerName,
|
|
|
|
- // buyerSn: con.dealerSn
|
|
|
|
- // }
|
|
|
|
- // return obj
|
|
|
|
- // })
|
|
|
|
|
|
+ const dealerInfoList = await getDealerListInfo({ dealerSnList: _this.selectedRowKeys })
|
|
this.spinning = false
|
|
this.spinning = false
|
|
- this.$emit('plAdd', dealerSnList)
|
|
|
|
|
|
+ this.$emit('plAdd', dealerInfoList.data)
|
|
},
|
|
},
|
|
handleAdd (row) {
|
|
handleAdd (row) {
|
|
if (row.subareaArea) {
|
|
if (row.subareaArea) {
|
|
@@ -247,7 +247,7 @@ export default {
|
|
_this.setTableH()
|
|
_this.setTableH()
|
|
})
|
|
})
|
|
this.chooseInfo = data || []
|
|
this.chooseInfo = data || []
|
|
- this.loadData()
|
|
|
|
|
|
+ this.resetSearchForm()
|
|
},
|
|
},
|
|
setTableH () {
|
|
setTableH () {
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|