Bladeren bron

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

lilei 2 jaren geleden
bovenliggende
commit
c6c8f4d8ae

+ 17 - 6
src/views/common/chooseDealer.vue

@@ -88,6 +88,7 @@ import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
 import { queryDealerPageList } from '@/api/dealer'
 import subarea from '@/views/common/subarea.js'
+import Array from 'core-js/library/fn/array'
 export default {
   name: 'ChooseDealer',
   mixins: [commonMixin],
@@ -115,11 +116,12 @@ export default {
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
-        },
+        }
       },
+      chooseInfo: [],
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, // 批量添加loading
@@ -128,11 +130,19 @@ export default {
         this.spinning = true
         return queryDealerPageList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
+          const _this = this
           if (res.status == 200) {
             data = res.data
             const no = 0
-            for (var i = 0; i < data.length; i++) {
-              data[i].no = no + i + 1
+            if (!_this.pageType && _this.chooseInfo && _this.chooseInfo.length > 0) {
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+                _this.chooseInfo.forEach(con => {
+                  if (data.list[i].dealerSn == con) {
+                    data.list[i].subareaAreaSn = con
+                  }
+                })
+              }
             }
           }
           this.spinning = false
@@ -194,7 +204,7 @@ export default {
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         }
@@ -235,11 +245,12 @@ export default {
         this.$emit('add', row)
       }
     },
-    pageInit () {
+    pageInit (data) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
+      this.chooseInfo = data
       this.resetSearchForm()
     },
     setTableH () {

+ 9 - 3
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" @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,8 +113,14 @@ export default {
       this.queryParam.userSn = val.key
     },
     handleSetCategory (row) {
-      const name = encodeURI(row.userName)
-      this.$router.push({ name: 'categorySet', query: { sn: row.userSn, name: name } })
+      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 } })
     },
     // 新增
     handleAdd () {

+ 91 - 83
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;">用户姓名:{{ decodeURI($route.query.name) }}</span>
+            <span class="subTitle-word text-overflow" style="max-width:300px;">用户姓名:{{ infoObj.name?infoObj.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>
@@ -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="设置管辖区域">
+            <a-tab-pane key="1" tab="设置管辖区域" v-if="infoObj.p_flag&&infoObj.p_flag!=1">
               <div class="areaSet-wrap">
                 <div class="table-page-search-wrapper newTableSearchName" >
                   <div class="areaSet-btnGroup" style="margin-bottom:20px;">
@@ -68,7 +68,7 @@
                 </a-spin>
               </div>
             </a-tab-pane>
-            <a-tab-pane key="2" tab="设置管辖品类" force-render>
+            <a-tab-pane key="2" tab="设置管辖品类" force-render v-if="infoObj.p_flag&&infoObj.p_flag!=1">
               <categorySet ref="setCategory"></categorySet>
             </a-tab-pane>
           </a-tabs>
@@ -79,37 +79,37 @@
         ref="partQuery"
         :showModal="openChooseArea"
         :chooseData="newChooseData"
-        @ok="handleArea"
-        @close="openChooseArea=false">
-      </chooseAreaModal>
-      <!-- 选择经销商 -->
-      <a-drawer
-        title="选择经销商"
-        width="80%"
-        :zIndex="100"
-        :visible="openChooseDealer"
-        :get-container="false"
-        :wrap-style="{ position: 'absolute' }"
-        @close="openChooseDealer = false">
-        <div class="dealerModalCon">
-          <chooseDealer @plAdd="handleAddDealer"></chooseDealer>
-        </div>
-      </a-drawer>
-    </a-spin>
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { STable } from '@/components'
-import categorySet from './categorySet'
-import chooseAreaModal from './chooseAreaModal'
+        @ok="handleArea"
+        @close="openChooseArea=false">
+      </chooseAreaModal>
+      <!-- 选择经销商 -->
+      <a-drawer
+        title="选择经销商"
+        width="80%"
+        :zIndex="100"
+        :visible="openChooseDealer"
+        :get-container="false"
+        :wrap-style="{ position: 'absolute' }"
+        @close="openChooseDealer = false">
+        <div class="dealerModalCon">
+          <chooseDealer ref="dealerChoose" @plAdd="handleAddDealer"></chooseDealer>
+        </div>
+      </a-drawer>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+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 subarea from '@/views/common/subarea.js'
-export default {
-  name: 'SettingsIndex',
-  mixins: [commonMixin],
+import subarea from '@/views/common/subarea.js'
+export default {
+  name: 'SettingsIndex',
+  mixins: [commonMixin],
   components: { STable, categorySet, chooseAreaModal, chooseDealer, subarea },
   data () {
     return {
@@ -119,33 +119,27 @@ export default {
       tableHeight: 0,
       queryParam: {
         hasDetail: 0,
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
         dealerName: ''
       },
-      newChooseData: {
+      infoObj: {},
+      newChooseData: {// 区域分区回显
         checked: [],
         halfChecked: []
-      },
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { 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: [],
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { 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' }
+      ],
       disabled: false, //  查询、重置按钮是否可操作
-      dataSource: [],
-      openModal: false, //  新增编辑产品品牌  弹框
-      itemSn: '', //  当前sn
-      nowData: null, //  当前记录数据
-      showClassifyModal: false,
-      showBrandModal: false,
-      ChooseClassifyPos: null,
+      chooseInfo: [], // 回显选中经销商信息
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
@@ -159,8 +153,8 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
-            this.disabled = false
           }
+          this.disabled = false
           this.spinning = false
           return data
         })
@@ -210,15 +204,16 @@ export default {
     },
     resetSearchForm () {
       this.queryParam = {
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
         dealerName: ''
       }
-      this.$refs.subarea.clearData()
-      this.$refs.table.refresh(true)
+      this.$refs.subarea.clearData()
+      this.$refs.table.refresh(true)
     },
+    // 选择区域
     async openAreaModal (params = {}) {
       this.$refs.partQuery.pageInit()
       const _this = this
@@ -228,36 +223,43 @@ export default {
         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
+      if (dataList.data.list && dataList.data.list.length > 0) {
+        dataList.data.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
-    },
-    //  返回
-    handleBack () {
-      this.$router.push({ name: 'businessOwnerSettings' })
+      })
     },
-    handleAddDealer (list) {
-      const newData = []
-      list.forEach(con => {
-        const obj = {}
-        obj.userSn = this.$route.query.sn
-        obj.bizType = 'dealer'
-        obj.bizSn = con
-        newData.push(obj)
+    // 打开经销商弹窗
+    async openDealerModal (params = {}) {
+      const _this = this
+      const arr = []
+      const dataList = await bizuserScopeQueryPage({
+        pageNo: 1,
+        pageSize: 1000,
+        ...params
       })
-      this.saveChooseData(newData)
-    },
+      if (dataList.data.list && dataList.data.list.length > 0) {
+        dataList.data.list.forEach(con => {
+          arr.push(con.bizSn)
+        })
+        _this.chooseInfo = [...new Set(arr)]
+      }
+      _this.openChooseDealer = true
+      if (_this.openChooseDealer) {
+        _this.$refs.dealerChoose.pageInit(_this.chooseInfo)
+      }
+    },
+    // 经销商
+    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)
    },
     //  删除
     handleDel (row) {
       const _this = this
@@ -272,14 +274,20 @@ export default {
             }
           })
         }
-      })
+      })
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'businessOwnerSettings' })
     },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.resetSearchForm()
+      const obj = decodeURI(_this.$route.query.con)
+      _this.infoObj = JSON.parse(obj)
+      _this.resetSearchForm()
     },
     setTableH () {
       const headHeight = this.$refs.headerBar.offsetHeight

+ 2 - 2
src/views/reportData/receivedSendStorageReport/index.vue

@@ -254,12 +254,12 @@ export default {
       _this.spinning = true
       _this.showExport = true
       if (this.tabVal == 1) {
-        hdExportExcel(exportDetailReport, params, '进销存明细报表', function () {
+        hdExportExcel(exportDetailReport, params, '收发存报表', function () {
           _this.exportLoading = false
           _this.spinning = false
         })
       } else {
-        hdExportExcel(exportGroupByProductTypeReport, params, '进销存明细报表', function () {
+        hdExportExcel(exportGroupByProductTypeReport, params, '收发存报表', function () {
           _this.exportLoading = false
           _this.spinning = false
         })