瀏覽代碼

修改bug

chenrui 2 年之前
父節點
當前提交
aca93631f0

+ 10 - 0
src/api/bizuser.js

@@ -114,3 +114,13 @@ export const bizuserScopeSaveList = params => {
     method: 'post'
   })
 }
+
+// 查询用户信息
+
+export const findById = params => {
+  return axios({
+    url: `/bizuser/findById/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}

+ 13 - 0
src/api/dealerRelation.js

@@ -54,4 +54,17 @@ export const updateRebate = (params) => {
     url: `/dealerRelation/updateRebate/${params.dealerSn}/${params.rebateDealerSn}`,
     method: 'get'
   })
+}
+
+
+//经销商所属分区  列表
+export const queryDealerWithBizuser = (params) => {
+  const url = `/subareaAreaDealer/queryDealerWithBizuser/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
 }

+ 2 - 2
src/config/router.config.js

@@ -2927,8 +2927,8 @@ export const asyncRouterMap = [
                 meta: {
                   title: '经销商所属分区查询',
                   icon: 'setting',
-                  hidden: true,
-                  permission: 'M_dealerZoneSearchList'
+                  hidden: true
+                  // permission: 'M_dealerZoneSearchList'
                 }
               }
             ]

+ 2 - 9
src/views/dealerManagement/businessOwnerSettings/list.vue

@@ -49,7 +49,7 @@
           bordered>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" type="link" class="button-warning" v-if="record.allDealerFlag!=1&&record.allProductFlag!=1" @click="handleSetCategory(record)">设置管辖范围</a-button>
+            <a-button size="small" type="link" class="button-warning" v-if="record.allDealerFlag!=1 || record.allProductFlag!=1" @click="handleSetCategory(record)">设置管辖范围</a-button>
             <a-button size="small" type="link" class="button-info" @click="handleEdit(record)">编辑</a-button>
             <a-button size="small" type="link" class="button-error" @click="handleDelete(record)">删除</a-button>
           </template>
@@ -113,14 +113,7 @@ export default {
       this.queryParam.userSn = val.key
     },
     handleSetCategory (row) {
-      const obj = {
-        name: row.userName,
-        d_flag: row.allDealerFlag,
-        p_flag: row.allProductFlag
-      }
-      const newString = JSON.stringify(obj)
-      const newObj = encodeURI(newString)
-      this.$router.push({ name: 'categorySet', query: { sn: row.userSn, con: newObj } })
+      this.$router.push({ name: 'categorySet', query: { sn: row.userSn, id: row.id } })
     },
     // 新增
     handleAdd () {

+ 25 - 11
src/views/dealerManagement/businessOwnerSettings/settingsIndex.vue

@@ -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;">用户姓名:{{ infoObj.name?infoObj.name:'--' }}</span>
+            <span class="subTitle-word text-overflow" style="max-width:300px;">用户姓名:{{ infoObj.userName?infoObj.userName:'--' }}</span>
             <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
           </template>
         </a-page-header>
@@ -13,7 +13,7 @@
       <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="设置管辖区域" v-if="infoObj.p_flag&&infoObj.p_flag!=1">
+            <a-tab-pane key="1" tab="设置管辖区域" v-if="infoObj.allDealerFlag && infoObj.allDealerFlag!=1">
               <div class="areaSet-wrap">
                 <div class="table-page-search-wrapper newTableSearchName" >
                   <div class="areaSet-btnGroup" style="margin-bottom:20px;">
@@ -41,7 +41,6 @@
                 </div>
                 <a-spin :spinning="spinning" tip="Loading...">
                   <!-- 列表 -->
-                  <!-- :showPagination="false" -->
                   <s-table
                     class="sTable fixPagination"
                     ref="table"
@@ -68,7 +67,7 @@
                 </a-spin>
               </div>
             </a-tab-pane>
-            <a-tab-pane key="2" tab="设置管辖品类" force-render v-if="infoObj.p_flag&&infoObj.p_flag!=1">
+            <a-tab-pane key="2" tab="设置管辖品类" force-render v-if="infoObj.allProductFlag&&infoObj.allProductFlag!=1">
               <categorySet ref="setCategory"></categorySet>
             </a-tab-pane>
           </a-tabs>
@@ -105,7 +104,7 @@ import { STable } from '@/components'
 import categorySet from './categorySet'
 import chooseAreaModal from './chooseAreaModal'
 import chooseDealer from '@/views/common/chooseDealer.vue'
-import { bizuserScopeQueryPage, bizuserScopeSaveList, bizuserScopeDelete } from '@/api/bizuser'
+import { bizuserScopeQueryPage, bizuserScopeSaveList, bizuserScopeDelete, findById } from '@/api/bizuser'
 import subarea from '@/views/common/subarea.js'
 export default {
   name: 'SettingsIndex',
@@ -162,6 +161,17 @@ export default {
     }
   },
   methods: {
+    getBaseInfo () {
+      const _this = this
+      findById({ id: _this.$route.query.id }).then(res => {
+        if (res.status == 200) {
+          _this.infoObj = res.data
+          _this.$nextTick(() => {
+            _this.$refs.table.refresh()
+          })
+        }
+      })
+    },
     // 选择区域>分区
     handleArea (con) {
       const chooseData = con.checked
@@ -169,6 +179,7 @@ export default {
       chooseData.forEach(item => {
         const obj = {}
         obj.userSn = this.$route.query.sn
+        obj.bizUserSn = this.infoObj.bizUserSn
         if (item.indexOf('_') != -1) { // 分区获取数据带_    区域不带下划线
           obj.bizType = 'subarea_area'
           obj.bizSn = item.replace('_', '')
@@ -210,8 +221,10 @@ export default {
         },
         dealerName: ''
       }
-      this.$refs.subarea.clearData()
-      this.$refs.table.refresh(true)
+      if (this.infoObj && this.infoObj.allDealerFlag != 1) {
+        this.$refs.subarea.clearData()
+        this.$refs.table.refresh(true)
+      }
     },
     // 选择区域
     async openAreaModal (params = {}) {
@@ -221,6 +234,7 @@ export default {
       const dataList = await bizuserScopeQueryPage({
         pageNo: 1,
         pageSize: 1000,
+        hasDetail: 0,
         ...params
       })
       if (dataList.data.list && dataList.data.list.length > 0) {
@@ -244,6 +258,7 @@ export default {
       const dataList = await bizuserScopeQueryPage({
         pageNo: 1,
         pageSize: 1000,
+        hasDetail: 0,
         ...params
       })
       if (dataList.data.list && dataList.data.list.length > 0) {
@@ -259,7 +274,8 @@ 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)
    },
+        obj.userSn = this.$route.query.sn
+        obj.bizUserSn = this.infoObj.bizUserSn
        obj.bizType = 'dealer'
        obj.bizSn = con
        newData.push(obj)
      })
      this.saveChooseData(newData)
    },
     //  删除
     handleDel (row) {
       const _this = this
@@ -285,9 +301,7 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      const obj = decodeURI(_this.$route.query.con)
-      _this.infoObj = JSON.parse(obj)
-      _this.resetSearchForm()
+      _this.getBaseInfo()
     },
     setTableH () {
       const headHeight = this.$refs.headerBar.offsetHeight

+ 33 - 39
src/views/dealerManagement/dealerZoneSearch/list.vue

@@ -12,25 +12,25 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="经销商">
-                <a-input id="dealerZoneSearch-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+                <a-input id="dealerZoneSearch-dealerName" v-model.trim="queryParam.dealerDTO.dealerName" allowClear placeholder="请输入经销商名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
               <a-form-item label="客服/区域负责人/销售总监">
-                <a-input id="dealerZoneSearch-dealerName" v-model.trim="queryParam.customerName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
+                <a-input id="dealerZoneSearch-dealerName" v-model.trim="queryParam.bizUserName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
               </a-form-item>
             </a-col>
             <a-col :md="24" :sm="24" style="margin-top: 10px;text-align:center;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerZoneSearch-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="dealerZoneSearch-reset">重置</a-button>
-              <a-button
+              <!-- <a-button
                 style="margin-left: 5px"
                 type="primary"
                 class="button-warning"
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
-                id="dealerZoneSearch-export">导出</a-button>
+                id="dealerZoneSearch-export">导出</a-button> -->
             </a-col>
           </a-row>
         </a-form>
@@ -44,9 +44,9 @@
           ref="table"
           :style="{ height: tableHeight+84.5+'px' }"
           size="small"
-          :rowKey="(record) => record.id"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
           :columns="columns"
-          :showPagination="false"
           :data="loadData"
           :scroll="{ y: tableHeight }"
           :defaultLoadData="false"
@@ -59,54 +59,54 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
+import { STable } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import { exportExcel } from '@/libs/JGPrint.js'
-import { subareaQueryIncludeAreaAll, dealerExport } from '@/api/subarea'
+import { queryDealerWithBizuser } from '@/api/dealerRelation'
 export default {
   name: 'DealerZoneSearch',
   mixins: [commonMixin],
-  components: { STable, VSelect, subarea },
+  components: { STable, subarea },
   data () {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
       queryParam: {
-        subareaArea:{
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+        subareaSn: undefined,
+        subareaAreaSn: undefined,
+        dealerDTO: {
+          dealerName: ''
         },
-        dealerName: '',
-        customerName: ''
+        bizUserName: ''
       },
+      exportLoading: false, // 导出loading
       columns: [
-        { title: '经销商名称', dataIndex: 'subareaName1', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '所属区域', dataIndex: 'subareaArea.subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '所属分区', dataIndex: 'subareaArea.subareaAreaName', width: "10%", align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客服', dataIndex: 'subareaName4', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域负责人', dataIndex: 'subareaName5', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售总监', dataIndex: 'subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'userNameKfs', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域负责人', dataIndex: 'userNameQyfzrs', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售总监', dataIndex: 'userNameXszjs', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return subareaQueryIncludeAreaAll(Object.assign(parameter,this.queryParam)).then(res => {
+        return queryDealerWithBizuser(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
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
             }
             this.disabled = false
           }
           this.spinning = false
           return data
         })
-      },
-      exportLoading: false// 导出loading
+      }
     }
   },
   methods: {
@@ -121,16 +121,16 @@ export default {
         _this.exportLoading = false
       })
     },
-    subareaChange(val){
-      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    subareaChange (val) {
+      this.queryParam.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.subareaArea.subareaSn = undefined
-      this.queryParam.subareaArea.subareaAreaSn = undefined
-      this.queryParam.dealerName = ''
-      this.queryParam.customerName = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.subareaAreaSn = undefined
+      this.queryParam.dealerDTO.dealerName = ''
+      this.queryParam.bizUserName = ''
       this.$refs.subarea.clearData()
       this.$refs.table.refresh(true)
     },
@@ -139,6 +139,7 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
+      this.$refs.table.refresh()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
@@ -153,19 +154,12 @@ export default {
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.resetSearchForm()
-    }
-    // 仅刷新列表,不重置页面
-    if (this.$store.state.app.updateList) {
-      this.pageInit()
-      this.$refs.table.refresh()
     }
   },
   beforeRouteEnter (to, from, next) {