浏览代码

Merge branch 'develop_yh13' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh13

lilei 2 年之前
父节点
当前提交
baa35fdb45

+ 1 - 0
src/config/router.config.js

@@ -2903,6 +2903,7 @@ export const asyncRouterMap = [
                   title: '管辖品类权限设置',
                   icon: 'user',
                   hidden: true,
+                  replaceTab: true,
                   permission: 'M_settingsIndex'
                 }
               }

+ 2 - 2
src/views/common/chooseDealer.vue

@@ -165,8 +165,8 @@ export default {
         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 {
-        arr.splice(4, 0, { title: '所在区域', dataIndex: 'subareaArea.subareaName', width: '20%', align: 'center', customRender: function (text) { return text && text[0] || '--' } })
-        arr.splice(5, 0, { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text && text[1] || '--' } })
+        arr.splice(4, 0, { title: '所在区域', dataIndex: 'subareaArea.subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(5, 0, { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
     },

+ 1 - 1
src/views/common/chooseTypeModal.vue

@@ -100,7 +100,7 @@ export default {
     },
     // 保存
     handleSave () {
-      if (this.checkedKeys.length < 1) {
+      if (this.checkedKeys.checked && this.checkedKeys.checked.length < 1) {
         this.$message.warning('请在列表勾选后再进行操作!')
         return
       }

+ 5 - 4
src/views/dealerManagement/businessOwnerSettings/categorySet.vue

@@ -10,7 +10,8 @@
           ref="table"
           :style="{ height: tableHeight+84.5+'px' }"
           size="small"
-          :rowKey="(record) => record.id"
+          :rowKey="(record) => record.bizUserScopeSn"
+          rowKeyName="bizUserScopeSn"
           :columns="columns"
           :data="loadData"
           :scroll="{ y: tableHeight }"
@@ -111,9 +112,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '16%', align: 'center' }
       ],
       queryParam: {
-        userSn: this.$route.query.sn,
-        hasDetail: 1,
-        bizUserSn: this.bizUserSn
+        hasDetail: 1
       },
       dataSource: [],
       openModal: false, //  新增编辑产品品牌  弹框
@@ -128,6 +127,8 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        this.queryParam.userSn = this.$route.query.sn
+        this.queryParam.bizUserSn = this.bizUserSn
         return bizuserScopeQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           data = res.data

+ 43 - 2
src/views/dealerManagement/businessOwnerSettings/chooseAreaModal.vue

@@ -83,11 +83,52 @@ export default {
               })
             }
           })
-          this.subregionData = res.data
-          this.checkedKeys = this.chooseData ? this.chooseData : []
+          if(this.chooseData && this.chooseData.checked && this.chooseData.checked.length > 0){
+             this.handleChooseData(res.data)
+          }else{
+            this.subregionData = res.data
+          }
+          // this.checkedKeys = this.chooseData ? this.chooseData : []
         }
       })
     },
+    // 将选择过的禁用掉
+    handleChooseData (subregionData) {
+     var area = [] // 区域
+     var zone = []// 分区
+     this.chooseData.checked.forEach(con => {
+       if (con.indexOf('_') == -1) {
+         area.push(con)
+       } else {
+         zone.push(con)
+       }
+     })
+      if (subregionData && subregionData.length > 0) {
+         subregionData.forEach(item => {
+        if (area && area.length > 0) {
+            area.forEach(list => {
+              if (item.areaSn == list) {
+                item.disabled = true
+              } else {
+                item.disabled = false
+              }
+            })
+            }
+            if (item.subareaAreaList && item.subareaAreaList.length > 0 && zone && zone.length > 0 ) {
+              item.subareaAreaList.forEach(con => {
+                zone.forEach(row => {
+                  if (con.areaSn == row) {
+                    con.disableCheckbox = true
+                  } else {
+                    con.disableCheckbox = false
+                  }
+                })
+              })
+            }
+          })
+        }
+      this.subregionData = subregionData
+    },
     save () {
       this.$emit('ok', this.checkedKeys)
     },

+ 0 - 1
src/views/dealerManagement/businessOwnerSettings/list.vue

@@ -42,7 +42,6 @@
           size="small"
           :rowKey="(record) => record.id"
           :columns="columns"
-          :showPagination="false"
           :data="loadData"
           :scroll="{ y: tableHeight }"
           :defaultLoadData="false"

+ 24 - 24
src/views/dealerManagement/businessOwnerSettings/settingsIndex.vue

@@ -12,7 +12,7 @@
       </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-tabs v-model="activeKeyVal" @change="handleTabs">
             <a-tab-pane key="1" tab="设置管辖区域" v-if="infoObj.allDealerFlag && infoObj.allDealerFlag!=1">
               <div class="areaSet-wrap">
                 <div class="table-page-search-wrapper newTableSearchName" >
@@ -119,12 +119,11 @@ export default {
       tableHeight: 0,
       queryParam: {
         hasDetail: 0,
-        subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
-        },
+        bizType: undefined,
+        bizSn: undefined,
         dealerName: ''
       },
+      activeKeyVal: '1',
       infoObj: {},
       newChooseData: {// 区域分区回显
         checked: [],
@@ -162,11 +161,13 @@ export default {
     }
   },
   methods: {
+    // 获取用户基本信息
     getBaseInfo () {
       const _this = this
       findById({ id: _this.$route.query.id }).then(res => {
         if (res.status == 200) {
           _this.infoObj = res.data
+          _this.activeKeyVal = '1'
           _this.$nextTick(() => {
             _this.$refs.table.refresh()
           })
@@ -206,22 +207,30 @@ export default {
       })
     },
     handleTabs (val) {
+      this.activeKeyVal = 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
+      if (val.length == 1) {
+        this.queryParam.bizSn = val[0]
+        this.queryParam.bizType = 'subarea'
+      } else if (val.length == 2) {
+        this.queryParam.bizSn = val[1]
+        this.queryParam.bizType = 'subarea_area'
+      } else {
+        this.queryParam.bizSn = undefined
+        this.queryParam.bizType = undefined
+      }
     },
     resetSearchForm () {
       this.queryParam = {
-        subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
-        },
-        dealerName: ''
+        bizSn: undefined,
+        bizType: undefined,
+        dealerName: '',
+        hasDetail: 0
       }
       if (this.infoObj && this.infoObj.allDealerFlag != 1) {
         this.$refs.subarea.clearData()
@@ -230,7 +239,6 @@ export default {
     },
     // 选择区域
     async openAreaModal () {
-      this.$refs.partQuery.pageInit()
       const _this = this
       const checkedArr = []
       const dataList = await queryAreaScope({ userSn: this.$route.query.sn })
@@ -247,6 +255,7 @@ export default {
       } else {
         this.newChooseData.checked = []
       }
+      this.$refs.partQuery.pageInit()
       _this.$nextTick(() => {
         _this.openChooseArea = true
       })
@@ -322,19 +331,10 @@ export default {
     }
   },
   mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
-    }
+    this.pageInit()
   },
   activated () {
-    // 如果是新页签打开,则重置当前页面
-    if (this.$store.state.app.isNewTab) {
-      this.pageInit()
-    }
-    // 仅刷新列表,不重置页面
-    if (this.$store.state.app.updateList) {
-      this.pageInit()
-    }
+    this.pageInit()
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})