|
@@ -1,108 +1,109 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <a-card size="small" :bordered="false">
|
|
|
- <!-- 搜索条件 -->
|
|
|
- <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
- <a-row :gutter="15">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="经销商名称">
|
|
|
- <a-input id="rebateSettingsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="客服/区域负责人/销售总监">
|
|
|
- <a-input id="rebateSettingsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="24" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="rebateSettingsList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateSettingsList-reset">重置</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-form>
|
|
|
- </div></a-card>
|
|
|
- <a-card size="small" :bordered="false" class="marketingDivisionSetList-wrap">
|
|
|
- <a-spin :spinning="spinning" tip="Loading...">
|
|
|
- <!-- 操作按钮 -->
|
|
|
- <div ref="tableSearch" class="table-operator" style="border: 0;">
|
|
|
- <a-button id="marketingDivisionSetList-add" type="primary" v-if="$hasPermissions('B_marketingDivisionSet_add')" class="button-error" @click="handleEdit()">+新增区域</a-button>
|
|
|
- </div>
|
|
|
- <!-- 列表 -->
|
|
|
- <s-table
|
|
|
- class="sTable fixPagination"
|
|
|
- ref="table"
|
|
|
- :style="{ height: tableHeight+84.5+'px' }"
|
|
|
- size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :columns="columns"
|
|
|
- :showPagination="false"
|
|
|
- :data="loadData"
|
|
|
- :scroll="{ y: tableHeight }"
|
|
|
- :defaultLoadData="false"
|
|
|
- bordered>
|
|
|
- <!-- 市区 -->
|
|
|
- <template slot="cityArea" slot-scope="text, record">
|
|
|
- <div style="display: inline-block;margin-right: 15px;" v-for="item in record.subareaAreaList" :key="item.id">
|
|
|
- {{ item.areaName }}
|
|
|
- <span v-if="item.citySubareaAreaList">(</span>
|
|
|
- <span style="color: #999;margin:0 3px;" v-for="area in item.citySubareaAreaList" :key="area.id">
|
|
|
- {{ area.areaName }}
|
|
|
- </span>
|
|
|
- <span v-if="item.citySubareaAreaList">)</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
- <a-button
|
|
|
- size="small"
|
|
|
- type="link"
|
|
|
- v-if="$hasPermissions('B_marketingDivisionSet_edit')"
|
|
|
- class="button-info"
|
|
|
- @click="handleEdit(record)"
|
|
|
- id="marketingDivisionSetList-edit-btn">编辑</a-button>
|
|
|
- <a-button
|
|
|
- size="small"
|
|
|
- type="link"
|
|
|
- v-if="$hasPermissions('B_marketingDivisionSet_del')"
|
|
|
- class="button-error"
|
|
|
- @click="handleDel(record)"
|
|
|
- id="marketingDivisionSetList-del-btn">删除</a-button>
|
|
|
- <span v-if="!$hasPermissions('B_marketingDivisionSet_edit') && !$hasPermissions('B_marketingDivisionSet_del')">--</span>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
- </a-spin>
|
|
|
- <!-- 编辑分区 -->
|
|
|
- <marketing-division-set-edit-modal
|
|
|
- v-drag
|
|
|
- :nowData="nowData"
|
|
|
- :openModal="openModal"
|
|
|
- :itemId="itemId"
|
|
|
- @ok="$refs.table.refresh()"
|
|
|
- @close="closeModal" />
|
|
|
- </a-card>
|
|
|
- </div>
|
|
|
+ <a-card size="small" :bordered="false" class="marketingDivisionSetNew-wrap">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <div ref="tableSearch" class="table-operator" style="border: 0;text-align:right;">
|
|
|
+ <a-button id="marketingDivisionSetNew-add" type="primary" class="button-error" @click="addArea">+新增区域</a-button>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ :style="{ height: tableHeight+84.5+'px' }"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :showPagination="false"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ expanded-row-keys
|
|
|
+ bordered>
|
|
|
+ <!-- 市区 -->
|
|
|
+ <template slot="cityArea" slot-scope="text, record">
|
|
|
+ <div style="display: inline-block;margin-right: 15px;" v-for="item in record.subareaAreaList" :key="item.id">
|
|
|
+ {{ item.areaName }}
|
|
|
+ <span v-if="item.citySubareaAreaList">(</span>
|
|
|
+ <span style="color: #999;margin:0 3px;" v-for="area in item.citySubareaAreaList" :key="area.id">
|
|
|
+ {{ area.areaName }}
|
|
|
+ </span>
|
|
|
+ <span v-if="item.citySubareaAreaList">)</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-success"
|
|
|
+ @click="addZone(record)"
|
|
|
+ id="marketingDivisionSetNew-edit-btn">新增分区</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-success"
|
|
|
+ @click="openDealerModal=true"
|
|
|
+ id="marketingDivisionSetNew-edit-btn">查看经销商</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="$hasPermissions('B_marketingDivisionSet_edit')"
|
|
|
+ class="button-info"
|
|
|
+ @click="handleEdit(record)"
|
|
|
+ id="marketingDivisionSetNew-edit-btn">编辑</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="$hasPermissions('B_marketingDivisionSet_del')"
|
|
|
+ class="button-error"
|
|
|
+ @click="handleDel(record)"
|
|
|
+ id="marketingDivisionSetNew-del-btn">删除</a-button>
|
|
|
+ <span v-if="!$hasPermissions('B_marketingDivisionSet_edit') && !$hasPermissions('B_marketingDivisionSet_del')">--</span>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ <!-- 新增区域 -->
|
|
|
+ <addAreaModal
|
|
|
+ v-drag
|
|
|
+ :openModal="openAreaModal"
|
|
|
+ @ok="$refs.table.refresh()"
|
|
|
+ @close="openAreaModal=false"></addAreaModal>
|
|
|
+ <!-- 新增分区 -->
|
|
|
+ <addZoneModal
|
|
|
+ v-drag
|
|
|
+ :openModal="openZoneModal"
|
|
|
+ @ok="$refs.table.refresh()"
|
|
|
+ @close="openZoneModal=false"></addZoneModal>
|
|
|
+ <!-- 查看经销商 -->
|
|
|
+ <viewDealers
|
|
|
+ :showModal="openDealerModal"
|
|
|
+ @close="openDealerModal=false"></viewDealers>
|
|
|
+ </a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import marketingDivisionSetEditModal from './editModal.vue'
|
|
|
+import addAreaModal from './addAreaModal.vue'
|
|
|
+import addZoneModal from './addZoneModal.vue'
|
|
|
+import viewDealers from './viewDealers.vue'
|
|
|
import { subareaQueryIncludeAreaAll, subareaDeleteBySn } from '@/api/subarea'
|
|
|
export default {
|
|
|
- name: 'MarketingDivisionSetList',
|
|
|
+ name: 'MarketingDivisionSetNew',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, marketingDivisionSetEditModal },
|
|
|
+ components: { STable, VSelect, addAreaModal, addZoneModal, viewDealers },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
tableHeight: 0,
|
|
|
+ openAddDealer: false,
|
|
|
+ openAreaModal: false,
|
|
|
+ openZoneModal: false,
|
|
|
+ openDealerModal: false,
|
|
|
columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
- { title: '分区名', dataIndex: 'subareaName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '省份/市', scopedSlots: { customRender: 'cityArea' }, align: 'left', width: '55%' },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
+ { title: '区域分区', dataIndex: 'subareaName', width: '70%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -121,13 +122,18 @@ export default {
|
|
|
this.spinning = false
|
|
|
return data
|
|
|
})
|
|
|
- },
|
|
|
- openModal: false, // 编辑 弹框
|
|
|
- nowData: null,
|
|
|
- itemId: null // 当前产品id
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 新增区域
|
|
|
+ addArea () {
|
|
|
+ this.openAreaModal = true
|
|
|
+ },
|
|
|
+ // 新增分区
|
|
|
+ addZone (row) {
|
|
|
+ this.openZoneModal = true
|
|
|
+ },
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
this.$refs.table.refresh(true)
|
|
@@ -137,7 +143,7 @@ export default {
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: '确定要删除吗?删除后,经销商解除区域归属,人员解除管辖区域,删除后数据不可恢复。',
|
|
|
+ content: '确定要删除吗?删除后相关用户权限自动解绑。',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
@@ -159,12 +165,6 @@ export default {
|
|
|
this.nowData = row
|
|
|
this.openModal = true
|
|
|
},
|
|
|
- // 关闭弹框
|
|
|
- closeModal () {
|
|
|
- this.itemId = null
|
|
|
- this.nowData = null
|
|
|
- this.openModal = false
|
|
|
- },
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
@@ -173,7 +173,7 @@ export default {
|
|
|
},
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 195
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 230
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -205,7 +205,7 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="less">
|
|
|
- .marketingDivisionSetList-wrap{
|
|
|
+ .marketingDivisionSetNew-wrap{
|
|
|
height: 100%;
|
|
|
}
|
|
|
</style>
|