|
@@ -5,7 +5,7 @@
|
|
|
<a-page-header :ghost="false" :backIcon="false" class="header-bar">
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
- <span class="subTitle-word text-overflow" style="max-width:300px;">用户姓名:测试测试</span>
|
|
|
+ <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>
|
|
@@ -41,21 +41,31 @@
|
|
|
</div>
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<!-- 列表 -->
|
|
|
+ <!-- :showPagination="false" -->
|
|
|
<s-table
|
|
|
class="sTable fixPagination"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
- :showPagination="false"
|
|
|
:data="loadData"
|
|
|
-
|
|
|
:defaultLoadData="false"
|
|
|
+ :style="{ height: tableHeight-100+'px' }"
|
|
|
+ :scroll="{ y: tableHeight-180 }"
|
|
|
bordered>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-error"
|
|
|
+ @click="handleDel(record)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </a-button>
|
|
|
+ </template>
|
|
|
</s-table>
|
|
|
</a-spin>
|
|
|
- <!-- :style="{ height: tableHeight+'px' }"
|
|
|
- :scroll="{ y: tableHeight }" -->
|
|
|
</div>
|
|
|
</a-tab-pane>
|
|
|
<a-tab-pane key="2" tab="设置管辖品类" force-render>
|
|
@@ -68,6 +78,8 @@
|
|
|
<chooseAreaModal
|
|
|
ref="partQuery"
|
|
|
:showModal="openChooseArea"
|
|
|
+ :chooseData="newChooseData"
|
|
|
+ @ok="handleArea"
|
|
|
@close="openChooseArea=false">
|
|
|
</chooseAreaModal>
|
|
|
<!-- 选择经销商 -->
|
|
@@ -93,7 +105,7 @@ import { STable } from '@/components'
|
|
|
import categorySet from './categorySet'
|
|
|
import chooseAreaModal from './chooseAreaModal'
|
|
|
import chooseDealer from '@/views/common/chooseDealer.vue'
|
|
|
-import { bizuserScopeQueryPage } from '@/api/bizuser'
|
|
|
+import { bizuserScopeQueryPage, bizuserScopeSaveList, bizuserScopeDelete } from '@/api/bizuser'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
export default {
|
|
|
name: 'SettingsIndex',
|
|
@@ -113,14 +125,19 @@ export default {
|
|
|
},
|
|
|
dealerName: ''
|
|
|
},
|
|
|
+ newChooseData: {
|
|
|
+ checked: [],
|
|
|
+ halfChecked: []
|
|
|
+ },
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '添加时间', dataIndex: 'subareaName1', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '区域', dataIndex: 'subareaName2', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '分区', dataIndex: 'subareaName3', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '经销商', dataIndex: 'subareaName4', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '添加时间', dataIndex: 'createDate', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '区域', dataIndex: 'subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '分区', dataIndex: 'subareaAreaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '经销商', dataIndex: 'dealerName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
],
|
|
|
+ dataList: [],
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
dataSource: [],
|
|
|
openModal: false, // 新增编辑产品品牌 弹框
|
|
@@ -132,13 +149,15 @@ export default {
|
|
|
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) {
|
|
|
data = res.data
|
|
|
- const no = 0
|
|
|
- for (var i = 0; i < data.length; i++) {
|
|
|
- data[i].no = no + i + 1
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ this.total = data.count || 0
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
+ data.list[i].no = no + i + 1
|
|
|
}
|
|
|
this.disabled = false
|
|
|
}
|
|
@@ -149,11 +168,42 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 选择区域>分区
|
|
|
+ handleArea (con) {
|
|
|
+ const chooseData = con.checked
|
|
|
+ const newData = []
|
|
|
+ chooseData.forEach(item => {
|
|
|
+ const obj = {}
|
|
|
+ obj.userSn = this.$route.query.sn
|
|
|
+ if (item.indexOf('_') != -1) { // 分区获取数据带_ 区域不带下划线
|
|
|
+ obj.bizType = 'subarea_area'
|
|
|
+ obj.bizSn = item.replace('_', '')
|
|
|
+ newData.push(obj)
|
|
|
+ } else {
|
|
|
+ obj.bizType = 'subarea'
|
|
|
+ obj.bizSn = item
|
|
|
+ newData.push(obj)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.saveChooseData(newData)
|
|
|
+ },
|
|
|
+ // 保存所选区域或经销商
|
|
|
+ saveChooseData (ajaxdata) {
|
|
|
+ const _this = this
|
|
|
+ bizuserScopeSaveList(ajaxdata).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.openChooseArea = false
|
|
|
+ _this.openChooseDealer = false
|
|
|
+ _this.resetSearchForm()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
handleTabs (val) {
|
|
|
if (val == 2) {
|
|
|
this.$refs.setCategory.pageInit()
|
|
|
}
|
|
|
},
|
|
|
+ // 所在区域分区查询
|
|
|
subareaChange (val) {
|
|
|
this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
@@ -169,8 +219,26 @@ export default {
|
|
|
this.$refs.subarea.clearData()
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
- openAreaModal () {
|
|
|
- this.openChooseArea = true
|
|
|
+ async openAreaModal (params = {}) {
|
|
|
+ this.$refs.partQuery.pageInit()
|
|
|
+ const _this = this
|
|
|
+ const checkedArr = []
|
|
|
+ const dataList = await bizuserScopeQueryPage({
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ ...params
|
|
|
+ })
|
|
|
+ dataList.list.forEach(item => {
|
|
|
+ if (item.bizType == 'subarea_area') {
|
|
|
+ item.bixSn = item.bizSn + '_'
|
|
|
+ }
|
|
|
+ checkedArr.push(item.bizSn)
|
|
|
+ })
|
|
|
+ const newCheckedArr = new Set(checkedArr)
|
|
|
+ this.newChooseData.checked = newCheckedArr
|
|
|
+ _this.$nextTick(() => {
|
|
|
+ _this.openChooseArea = true
|
|
|
+ })
|
|
|
},
|
|
|
openDealerModal () {
|
|
|
this.openChooseDealer = true
|
|
@@ -179,70 +247,30 @@ export default {
|
|
|
handleBack () {
|
|
|
this.$router.push({ name: 'businessOwnerSettings' })
|
|
|
},
|
|
|
- // 新增管辖品类
|
|
|
- addCategory () {
|
|
|
- const newData = {
|
|
|
- classifyList: [],
|
|
|
- brandList: []
|
|
|
- }
|
|
|
- this.dataSource.push(newData)
|
|
|
- },
|
|
|
handleAddDealer (list) {
|
|
|
- this.openChooseDealer = false
|
|
|
- },
|
|
|
- // 删除分类、品牌标签
|
|
|
- delLabel (pos, i, name) {
|
|
|
- this.dataSource[pos][name].splice(i, 1)
|
|
|
- },
|
|
|
- // 添加分类标签
|
|
|
- addClassifyTag (pos, row) {
|
|
|
- this.ChooseClassifyPos = pos
|
|
|
- this.showClassifyModal = true
|
|
|
- },
|
|
|
- handleClassifyModal (con) {
|
|
|
- const chooseList = con
|
|
|
- this.showClassifyModal = false
|
|
|
- this.dataSource[this.ChooseClassifyPos].classifyList = [...this.dataSource[this.ChooseClassifyPos].classifyList, ...chooseList]
|
|
|
- },
|
|
|
- // 添加品牌标签
|
|
|
- addBrandTag (pos, row) {
|
|
|
- this.ChooseBrandPos = pos
|
|
|
- this.showBrandModal = true
|
|
|
- },
|
|
|
- // 保存
|
|
|
- save () {
|
|
|
-
|
|
|
- },
|
|
|
- // 新增/编辑
|
|
|
- handleEdit (row) {
|
|
|
- if (row) {
|
|
|
- this.itemSn = row.warehouseLocationSn
|
|
|
- row.warehouseSn = this.$route.params.sn
|
|
|
- this.nowData = row
|
|
|
- } else {
|
|
|
- this.itemSn = null
|
|
|
- this.nowData = { warehouseSn: this.$route.params.sn }
|
|
|
- }
|
|
|
- this.openModal = true
|
|
|
- },
|
|
|
- // 新增/编辑 成功
|
|
|
- handleOk () {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
- },
|
|
|
- // 关闭弹框
|
|
|
- closeModal () {
|
|
|
- this.itemSn = ''
|
|
|
- this.openModal = false
|
|
|
+ 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 (pos) {
|
|
|
+ handleDel (row) {
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
content: '删除后不可恢复,确定要进行删除吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
- _this.dataSource.splice(pos, 1)
|
|
|
+ bizuserScopeDelete({ id: row.bizUserScopeSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.resetSearchForm()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -251,7 +279,7 @@ export default {
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
- this.$refs.table.refresh()
|
|
|
+ this.resetSearchForm()
|
|
|
},
|
|
|
setTableH () {
|
|
|
const headHeight = this.$refs.headerBar.offsetHeight
|