|
@@ -1,57 +1,57 @@
|
|
|
-<template>
|
|
|
- <div class="categorySet-wrap">
|
|
|
- <a-spin :spinning="spinning" tip="Loading...">
|
|
|
- <div ref="headerBar">
|
|
|
- <a-page-header :ghost="false" :backIcon="false" class="header-bar">
|
|
|
- <!-- 自定义的二级文字标题 -->
|
|
|
- <template slot="subTitle">
|
|
|
- <span class="subTitle-word text-overflow" style="max-width:300px;">用户姓名:{{ decodeURI($route.query.name) }}</span>
|
|
|
- <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
|
|
|
- </template>
|
|
|
- </a-page-header>
|
|
|
- </div>
|
|
|
- <a-card size="small" :bordered="false" class="categorySet-cont">
|
|
|
- <div :style="{ height: tableHeight+84.5+'px' }">
|
|
|
- <a-tabs default-active-key="1" @change="handleTabs">
|
|
|
- <a-tab-pane key="1" tab="设置管辖区域">
|
|
|
- <div class="areaSet-wrap">
|
|
|
- <div class="table-page-search-wrapper newTableSearchName" >
|
|
|
- <div class="areaSet-btnGroup" style="margin-bottom:20px;">
|
|
|
- <a-button type="primary" class="button-error" @click="openAreaModal" ghost>选择区域</a-button>
|
|
|
- <a-button type="primary" class="button-error" @click="openDealerModal" ghost>选择经销商</a-button>
|
|
|
- </div>
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
- <a-row :gutter="15">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="所在区域/分区">
|
|
|
- <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="经销商名称">
|
|
|
- <a-input id="areaSet-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="areaSet-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="areaSet-reset">重置</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+<template>
|
|
|
+ <div class="categorySet-wrap">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <div ref="headerBar">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="header-bar">
|
|
|
+ <!-- 自定义的二级文字标题 -->
|
|
|
+ <template slot="subTitle">
|
|
|
+ <span class="subTitle-word text-overflow" style="max-width:300px;">用户姓名:{{ decodeURI($route.query.name) }}</span>
|
|
|
+ <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
|
|
|
+ </template>
|
|
|
+ </a-page-header>
|
|
|
+ </div>
|
|
|
+ <a-card size="small" :bordered="false" class="categorySet-cont">
|
|
|
+ <div :style="{ height: tableHeight+84.5+'px' }">
|
|
|
+ <a-tabs default-active-key="1" @change="handleTabs">
|
|
|
+ <a-tab-pane key="1" tab="设置管辖区域">
|
|
|
+ <div class="areaSet-wrap">
|
|
|
+ <div class="table-page-search-wrapper newTableSearchName" >
|
|
|
+ <div class="areaSet-btnGroup" style="margin-bottom:20px;">
|
|
|
+ <a-button type="primary" class="button-error" @click="openAreaModal" ghost>选择区域</a-button>
|
|
|
+ <a-button type="primary" class="button-error" @click="openDealerModal" ghost>选择经销商</a-button>
|
|
|
+ </div>
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="所在区域/分区">
|
|
|
+ <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="经销商名称">
|
|
|
+ <a-input id="areaSet-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="areaSet-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="areaSet-reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
<!-- 列表 -->
|
|
|
- <!-- :showPagination="false" -->
|
|
|
- <s-table
|
|
|
- class="sTable fixPagination"
|
|
|
- ref="table"
|
|
|
- size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :columns="columns"
|
|
|
- :data="loadData"
|
|
|
+ <!-- :showPagination="false" -->
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
:defaultLoadData="false"
|
|
|
:style="{ height: tableHeight-100+'px' }"
|
|
|
- :scroll="{ y: tableHeight-180 }"
|
|
|
+ :scroll="{ y: tableHeight-180 }"
|
|
|
bordered>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -63,20 +63,20 @@
|
|
|
>
|
|
|
删除
|
|
|
</a-button>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
- </a-spin>
|
|
|
- </div>
|
|
|
- </a-tab-pane>
|
|
|
- <a-tab-pane key="2" tab="设置管辖品类" force-render>
|
|
|
- <categorySet ref="setCategory"></categorySet>
|
|
|
- </a-tab-pane>
|
|
|
- </a-tabs>
|
|
|
- </div>
|
|
|
- </a-card>
|
|
|
- <!-- 选择区域 -->
|
|
|
- <chooseAreaModal
|
|
|
- ref="partQuery"
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ </div>
|
|
|
+ </a-tab-pane>
|
|
|
+ <a-tab-pane key="2" tab="设置管辖品类" force-render>
|
|
|
+ <categorySet ref="setCategory"></categorySet>
|
|
|
+ </a-tab-pane>
|
|
|
+ </a-tabs>
|
|
|
+ </div>
|
|
|
+ </a-card>
|
|
|
+ <!-- 选择区域 -->
|
|
|
+ <chooseAreaModal
|
|
|
+ ref="partQuery"
|
|
|
:showModal="openChooseArea"
|
|
|
:chooseData="newChooseData"
|
|
|
@ok="handleArea"
|
|
@@ -92,7 +92,7 @@
|
|
|
:wrap-style="{ position: 'absolute' }"
|
|
|
@close="openChooseDealer = false">
|
|
|
<div class="dealerModalCon">
|
|
|
- <chooseDealer ref="dealerChoose" :chooseInfo="chooseInfo" @plAdd="handleAddDealer"></chooseDealer>
|
|
|
+ <chooseDealer ref="dealerChoose" @plAdd="handleAddDealer"></chooseDealer>
|
|
|
</div>
|
|
|
</a-drawer>
|
|
|
</a-spin>
|
|
@@ -110,17 +110,20 @@ import subarea from '@/views/common/subarea.js'
|
|
|
export default {
|
|
|
name: 'SettingsIndex',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, categorySet, chooseAreaModal, chooseDealer, subarea },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- openChooseArea: false, // 选择区域弹窗
|
|
|
- openChooseDealer: false, // 选择经销商弹窗
|
|
|
- spinning: false,
|
|
|
- tableHeight: 0,
|
|
|
- queryParam: {
|
|
|
- subareaSn: undefined,
|
|
|
- subareaAreaSn: undefined,
|
|
|
- dealerName: ''
|
|
|
+ components: { STable, categorySet, chooseAreaModal, chooseDealer, subarea },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ openChooseArea: false,
|
|
|
+ openChooseDealer: false,
|
|
|
+ spinning: false,
|
|
|
+ tableHeight: 0,
|
|
|
+ queryParam: {
|
|
|
+ hasDetail: 0,
|
|
|
+ subareaArea: {
|
|
|
+ subareaSn: undefined,
|
|
|
+ subareaAreaSn: undefined
|
|
|
+ },
|
|
|
+ dealerName: ''
|
|
|
},
|
|
|
newChooseData: {// 区域分区回显
|
|
|
checked: [],
|
|
@@ -135,14 +138,14 @@ export default {
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
],
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
- chooseInfo: [], // 回显选中经销商信息
|
|
|
- loadData: parameter => {
|
|
|
- this.disabled = true
|
|
|
+ chooseInfo: [], // 回显选中经销商信息
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
this.spinning = true
|
|
|
- this.queryParam.userSn = this.$route.query.sn
|
|
|
- return bizuserScopeQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
- let data
|
|
|
- if (res.status == 200) {
|
|
|
+ this.queryParam.userSn = this.$route.query.sn
|
|
|
+ return bizuserScopeQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
this.total = data.count || 0
|
|
@@ -150,13 +153,13 @@ export default {
|
|
|
data.list[i].no = no + i + 1
|
|
|
}
|
|
|
}
|
|
|
- this.disabled = false
|
|
|
- this.spinning = false
|
|
|
- return data
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ this.disabled = false
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 选择区域>分区
|
|
|
handleArea (con) {
|
|
@@ -193,22 +196,23 @@ export default {
|
|
|
this.$refs.setCategory.pageInit()
|
|
|
}
|
|
|
},
|
|
|
- // 所在区域分区查询
|
|
|
+ // 所在区域分区查询
|
|
|
subareaChange (val) {
|
|
|
- this.queryParam.subareaSn = val[0] ? val[0] : undefined
|
|
|
- this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
|
|
|
+ this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
+ this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
|
},
|
|
|
- // 重置
|
|
|
- resetSearchForm () {
|
|
|
- this.queryParam = {
|
|
|
- subareaSn: undefined,
|
|
|
- subareaAreaSn: undefined,
|
|
|
- dealerName: ''
|
|
|
+ resetSearchForm () {
|
|
|
+ this.queryParam = {
|
|
|
+ subareaArea: {
|
|
|
+ subareaSn: undefined,
|
|
|
+ subareaAreaSn: undefined
|
|
|
+ },
|
|
|
+ dealerName: ''
|
|
|
}
|
|
|
this.$refs.subarea.clearData()
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
- // 选择区域
|
|
|
+ // 选择区域
|
|
|
async openAreaModal (params = {}) {
|
|
|
this.$refs.partQuery.pageInit()
|
|
|
const _this = this
|
|
@@ -254,10 +258,10 @@ export default {
|
|
|
},
|
|
|
// 经销商
|
|
|
handleAddDealer (list) {
const newData = []
list.forEach(con => {
const obj = {}
|
|
|
- obj.userSn = this.$route.query.sn
obj.bizType = 'dealer'
obj.bizSn = con
newData.push(obj)
})
this.saveChooseData(newData)
},
|
|
|
- // 删除
|
|
|
- handleDel (row) {
|
|
|
- const _this = this
|
|
|
+ obj.userSn = this.$route.query.sn
obj.bizType = 'dealer'
obj.bizSn = con
newData.push(obj)
})
this.saveChooseData(newData)
},
|
|
|
+ // 删除
|
|
|
+ handleDel (row) {
|
|
|
+ const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
content: '删除后不可恢复,确定要进行删除吗?',
|
|
@@ -274,49 +278,49 @@ export default {
|
|
|
// 返回
|
|
|
handleBack () {
|
|
|
this.$router.push({ name: 'businessOwnerSettings' })
|
|
|
- },
|
|
|
- pageInit () {
|
|
|
- const _this = this
|
|
|
- this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
- _this.setTableH()
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
})
|
|
|
- this.resetSearchForm()
|
|
|
- },
|
|
|
- setTableH () {
|
|
|
- const headHeight = this.$refs.headerBar.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - headHeight - 230
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
- this.setTableH()
|
|
|
- }
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
- this.pageInit()
|
|
|
- }
|
|
|
- },
|
|
|
- activated () {
|
|
|
- // 如果是新页签打开,则重置当前页面
|
|
|
- if (this.$store.state.app.isNewTab) {
|
|
|
- this.pageInit()
|
|
|
- }
|
|
|
- // 仅刷新列表,不重置页面
|
|
|
- if (this.$store.state.app.updateList) {
|
|
|
- this.pageInit()
|
|
|
- }
|
|
|
- },
|
|
|
- beforeRouteEnter (to, from, next) {
|
|
|
- next(vm => {})
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
- .categorySet-wrap{
|
|
|
- .table-operator{
|
|
|
- text-align:right;
|
|
|
- }
|
|
|
- }
|
|
|
-</style>
|
|
|
+ this.resetSearchForm()
|
|
|
+ },
|
|
|
+ setTableH () {
|
|
|
+ const headHeight = this.$refs.headerBar.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - headHeight - 230
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
+ this.setTableH()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
+ this.pageInit()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.pageInit()
|
|
|
+ }
|
|
|
+ // 仅刷新列表,不重置页面
|
|
|
+ if (this.$store.state.app.updateList) {
|
|
|
+ this.pageInit()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {})
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+ .categorySet-wrap{
|
|
|
+ .table-operator{
|
|
|
+ text-align:right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|