|
@@ -105,7 +105,7 @@ import { STable } from '@/components'
|
|
|
import categorySet from './categorySet'
|
|
|
import chooseAreaModal from './chooseAreaModal'
|
|
|
import chooseDealer from '@/views/common/chooseDealer.vue'
|
|
|
-import { bizuserScopeQueryPage, bizuserScopeSaveList, bizuserScopeDelete, findById } from '@/api/bizuser'
|
|
|
+import { bizuserScopeQueryPage, bizuserScopeDelete, findById, queryAreaScope, queryDealerScope, saveAreaScope, saveDealerScope } from '@/api/bizuser'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
export default {
|
|
|
name: 'SettingsIndex',
|
|
@@ -191,15 +191,16 @@ export default {
|
|
|
newData.push(obj)
|
|
|
}
|
|
|
})
|
|
|
- this.saveChooseData(newData)
|
|
|
+ this.saveChooseArea(newData)
|
|
|
},
|
|
|
- // 保存所选区域或经销商
|
|
|
- saveChooseData (ajaxdata) {
|
|
|
+ saveChooseArea (list) {
|
|
|
const _this = this
|
|
|
- bizuserScopeSaveList(ajaxdata).then(res => {
|
|
|
+ const newAjaxData = {}
|
|
|
+ newAjaxData.userSn = _this.$route.query.sn
|
|
|
+ newAjaxData.bizUserScopeList = list
|
|
|
+ saveAreaScope(newAjaxData).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.openChooseArea = false
|
|
|
- _this.openChooseDealer = false
|
|
|
_this.resetSearchForm()
|
|
|
}
|
|
|
})
|
|
@@ -228,18 +229,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 选择区域
|
|
|
- async openAreaModal (params = {}) {
|
|
|
+ async openAreaModal () {
|
|
|
this.$refs.partQuery.pageInit()
|
|
|
const _this = this
|
|
|
const checkedArr = []
|
|
|
- const dataList = await bizuserScopeQueryPage({
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 1000,
|
|
|
- hasDetail: 0,
|
|
|
- ...params
|
|
|
- })
|
|
|
- if (dataList.data.list && dataList.data.list.length > 0) {
|
|
|
- dataList.data.list.forEach(item => {
|
|
|
+ const dataList = await queryAreaScope({ userSn: this.$route.query.sn })
|
|
|
+ if (dataList.data && dataList.data.length > 0) {
|
|
|
+ dataList.data.forEach(item => {
|
|
|
if (item.bizType == 'subarea_area') {
|
|
|
item.bizSn = item.bizSn + '_'
|
|
|
}
|
|
@@ -257,14 +253,9 @@ export default {
|
|
|
async openDealerModal (params = {}) {
|
|
|
const _this = this
|
|
|
const arr = []
|
|
|
- const dataList = await bizuserScopeQueryPage({
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 1000,
|
|
|
- hasDetail: 0,
|
|
|
- ...params
|
|
|
- })
|
|
|
- if (dataList.data.list && dataList.data.list.length > 0) {
|
|
|
- dataList.data.list.forEach(con => {
|
|
|
+ const dataList = await queryDealerScope({ userSn: this.$route.query.sn })
|
|
|
+ if (dataList.data && dataList.data.length > 0) {
|
|
|
+ dataList.data.forEach(con => {
|
|
|
arr.push(con.bizSn)
|
|
|
})
|
|
|
_this.chooseInfo = [...new Set(arr)]
|
|
@@ -277,7 +268,20 @@ export default {
|
|
|
// 经销商
|
|
|
handleAddDealer (list) {
const newData = []
list.forEach(con => {
const obj = {}
|
|
|
obj.userSn = this.$route.query.sn
|
|
|
- obj.bizUserSn = this.infoObj.bizUserSn
obj.bizType = 'dealer'
obj.bizSn = con
newData.push(obj)
})
this.saveChooseData(newData)
},
|
|
|
+ obj.bizUserSn = this.infoObj.bizUserSn
obj.bizType = 'dealer'
obj.bizSn = con
newData.push(obj)
})
this.saveChooseDealer(newData)
},
|
|
|
+ // 保存所选区域或经销商
|
|
|
+ saveChooseDealer (list) {
|
|
|
+ const _this = this
|
|
|
+ const ajaxData = {}
|
|
|
+ ajaxData.userSn = _this.$route.query.sn
|
|
|
+ ajaxData.bizUserScopeList = list
|
|
|
+ saveDealerScope(ajaxData).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.openChooseDealer = false
|
|
|
+ _this.resetSearchForm()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 删除
|
|
|
handleDel (row) {
|
|
|
const _this = this
|