chenrui 2 gadi atpakaļ
vecāks
revīzija
a60b41366d

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

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

+ 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

+ 44 - 0
src/views/dealerManagement/businessOwnerSettings/chooseAreaModal.vue

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

+ 23 - 23
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()
@@ -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 => {})