|
@@ -37,7 +37,7 @@
|
|
</a-col>
|
|
</a-col>
|
|
</div>
|
|
</div>
|
|
<a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseDealer-refresh">查询</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="searchForm(true)" :disabled="disabled" id="chooseDealer-refresh">查询</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseDealer-reset">重置</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseDealer-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -46,7 +46,7 @@
|
|
<div style="margin-bottom: 10px">
|
|
<div style="margin-bottom: 10px">
|
|
<a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
|
|
<a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
|
|
<span style="margin-left: 5px">
|
|
<span style="margin-left: 5px">
|
|
- <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0"> {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }} </template>
|
|
|
|
|
|
+ <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -54,9 +54,9 @@
|
|
class="sTable"
|
|
class="sTable"
|
|
ref="table"
|
|
ref="table"
|
|
size="small"
|
|
size="small"
|
|
- :rowKey="(record) => record.stockPutSn"
|
|
|
|
- rowKeyName="stockPutSn"
|
|
|
|
- :row-selection="$hasPermissions('B_warehousingConfirmationpl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState != 'WAIT' } }) } : null"
|
|
|
|
|
|
+ :rowKey="(record) => record.dealerSn"
|
|
|
|
+ rowKeyName="dealerSn"
|
|
|
|
+ :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !!record.subareaAreaSn } }) }"
|
|
@rowSelection="rowSelectionFun"
|
|
@rowSelection="rowSelectionFun"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
@@ -64,13 +64,19 @@
|
|
:scroll="{ y: tableHeight }"
|
|
:scroll="{ y: tableHeight }"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
bordered>
|
|
bordered>
|
|
|
|
+ <template slot="areas" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.subareaNameSet">{{ record.subareaNameSet[0] }}</span>
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
+ </template>
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-error"
|
|
class="button-error"
|
|
@click="handleAdd(record)"
|
|
@click="handleAdd(record)"
|
|
|
|
+ v-if="record.subareaAreaSn != parentData.subareaAreaSn"
|
|
id="marketingDivisionSetNew-del-btn">添加</a-button>
|
|
id="marketingDivisionSetNew-del-btn">添加</a-button>
|
|
|
|
+ <span style="color:#666" v-else>已添加</span>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-spin>
|
|
</a-spin>
|
|
@@ -90,6 +96,12 @@ export default {
|
|
pageType: {
|
|
pageType: {
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
|
|
+ },
|
|
|
|
+ parentData: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: function(){
|
|
|
|
+ return null
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
@@ -97,22 +109,27 @@ export default {
|
|
spinning: false,
|
|
spinning: false,
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
nameLike: '',
|
|
nameLike: '',
|
|
- dealerType: undefined,
|
|
|
|
- dealerLevel: undefined,
|
|
|
|
- subareaSn: undefined
|
|
|
|
|
|
+ dealerType: null,
|
|
|
|
+ dealerLevel: null,
|
|
|
|
+ auditState: undefined,
|
|
|
|
+ provinceSn: undefined,
|
|
|
|
+ citySn: undefined,
|
|
|
|
+ districtSn: undefined
|
|
},
|
|
},
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
loading: false, // 批量添加loading
|
|
loading: false, // 批量添加loading
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
- this.disabled = true
|
|
|
|
this.spinning = true
|
|
this.spinning = true
|
|
return queryDealerPageList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
return queryDealerPageList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
- this.disabled = false
|
|
|
|
|
|
+ const no = 0
|
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
|
+ data[i].no = no + i + 1
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
return data
|
|
return data
|
|
@@ -125,20 +142,23 @@ export default {
|
|
columns () {
|
|
columns () {
|
|
const _this = this
|
|
const _this = this
|
|
const arr = [
|
|
const arr = [
|
|
- { title: '经销商名称', dataIndex: 'putTime', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '商户别名', dataIndex: 'providerName', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '商户类型', dataIndex: 'putBizTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '商户级别', dataIndex: 'auditStateDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
|
|
|
+ { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }},
|
|
|
|
+ { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
]
|
|
]
|
|
if (_this.pageType == 'viewDealers') {
|
|
if (_this.pageType == 'viewDealers') {
|
|
- arr.splice(4, 0, { title: '审核状态', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' } })
|
|
|
|
- arr.splice(5, 0, { title: '当前所属区域', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' } })
|
|
|
|
- arr.splice(6, 0, { title: '操作', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' })
|
|
|
|
|
|
+ arr.splice(4, 0, { title: '审核状态', dataIndex: 'auditStateDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ arr.splice(5, 0, { title: '当前所属区域', scopedSlots: { customRender: 'areas' }, width: '30%', align: 'center' })
|
|
|
|
+ arr.splice(6, 0, { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' })
|
|
} else {
|
|
} else {
|
|
- arr.splice(4, 0, { title: '所在区域', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true })
|
|
|
|
- arr.splice(5, 0, { title: '所在分区', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true })
|
|
|
|
|
|
+ arr.splice(4, 0, { title: '所在区域', dataIndex: 'subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
|
|
|
|
+ arr.splice(5, 0, { title: '所在分区', dataIndex: 'subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
|
|
}
|
|
}
|
|
return arr
|
|
return arr
|
|
|
|
+ },
|
|
|
|
+ selectCount(){
|
|
|
|
+ return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -151,10 +171,24 @@ 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)
|
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
|
+ this.spinning = false
|
|
|
|
+ },
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
|
|
+ this.queryParam = {
|
|
|
|
+ nameLike: '',
|
|
|
|
+ dealerType: null,
|
|
|
|
+ dealerLevel: null,
|
|
|
|
+ auditState: undefined,
|
|
|
|
+ provinceSn: undefined,
|
|
|
|
+ citySn: undefined,
|
|
|
|
+ districtSn: undefined
|
|
|
|
+ }
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
- this.rowSelectionInfo = null
|
|
|
|
|
|
+ this.$refs.table.clearSelected()
|
|
},
|
|
},
|
|
clearTable(){
|
|
clearTable(){
|
|
this.rowSelectionInfo = null
|
|
this.rowSelectionInfo = null
|
|
@@ -167,11 +201,26 @@ export default {
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.isBatch = true
|
|
|
|
- this.confirmationModal = true
|
|
|
|
|
|
+ const dealerSnList = _this.rowSelectionInfo.selectedRowKeys
|
|
|
|
+ this.spinning = true
|
|
|
|
+ this.$emit("plAdd",dealerSnList)
|
|
},
|
|
},
|
|
handleAdd(row){
|
|
handleAdd(row){
|
|
-
|
|
|
|
|
|
+ if(row.subareaNameSet&&row.subareaNameSet.length){
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '当前经销商已被其他区域分区绑定,确定要更新绑定关系吗?',
|
|
|
|
+ centered: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ _this.$emit("add", row)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ this.spinning = true
|
|
|
|
+ this.$emit("add", row)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -182,24 +231,16 @@ export default {
|
|
},
|
|
},
|
|
setTableH () {
|
|
setTableH () {
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 165
|
|
|
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 245
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ mounted () {
|
|
|
|
+ this.pageInit()
|
|
|
|
+ },
|
|
watch: {
|
|
watch: {
|
|
'$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
'$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
this.setTableH()
|
|
this.setTableH()
|
|
}
|
|
}
|
|
- },
|
|
|
|
- mounted () {
|
|
|
|
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
|
- this.resetSearchForm()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- activated () {
|
|
|
|
- this.pageInit()
|
|
|
|
- },
|
|
|
|
- beforeRouteEnter (to, from, next) {
|
|
|
|
- next(vm => {})
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|