chenrui пре 2 година
родитељ
комит
7c0f759ce4

+ 20 - 3
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],
@@ -103,6 +104,12 @@ export default {
         return null
       }
     }
+    // chooseInfo: {
+    //   type: Array,
+    //   defatut: () => {
+    //     return []
+    //   }
+    // }
   },
   data () {
     return {
@@ -118,6 +125,7 @@ export default {
         subareaSn: undefined,
         subareaAreaSn: undefined
       },
+      chooseInfo: [],
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, // 批量添加loading
@@ -126,11 +134,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
@@ -231,11 +247,12 @@ export default {
         this.$emit('add', row)
       }
     },
-    pageInit () {
+    pageInit (data) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
+      this.chooseInfo = data
       this.resetSearchForm()
     },
     setTableH () {

+ 47 - 34
src/views/dealerManagement/businessOwnerSettings/settingsIndex.vue

@@ -92,7 +92,7 @@
         :wrap-style="{ position: 'absolute' }"
         @close="openChooseDealer = false">
         <div class="dealerModalCon">
-          <chooseDealer @plAdd="handleAddDealer"></chooseDealer>
+          <chooseDealer ref="dealerChoose" :chooseInfo="chooseInfo" @plAdd="handleAddDealer"></chooseDealer>
         </div>
       </a-drawer>
     </a-spin>
@@ -113,17 +113,16 @@ export default {
   components: { STable, categorySet, chooseAreaModal, chooseDealer, subarea },
   data () {
     return {
-      openChooseArea: false,
-      openChooseDealer: false,
+      openChooseArea: false, // 选择区域弹窗
+      openChooseDealer: false, // 选择经销商弹窗
       spinning: false,
       tableHeight: 0,
-      queryParam: {
-        hasDetail: 0,
+      queryParam: {
         subareaSn: undefined,
         subareaAreaSn: undefined,
         dealerName: ''
       },
-      newChooseData: {
+      newChooseData: {// 区域分区回显
         checked: [],
         halfChecked: []
       },
@@ -134,16 +133,9 @@ export default {
         { 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: [],
-      disabled: false, //  查询、重置按钮是否可操作
-      dataSource: [],
-      openModal: false, //  新增编辑产品品牌  弹框
-      itemSn: '', //  当前sn
-      nowData: null, //  当前记录数据
-      showClassifyModal: false,
-      showBrandModal: false,
-      ChooseClassifyPos: null,
+      ],
+      disabled: false, //  查询、重置按钮是否可操作
+      chooseInfo: [], // 回显选中经销商信息
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
@@ -157,8 +149,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
         })
@@ -215,7 +207,8 @@ export default {
       }
       this.$refs.subarea.clearData()
       this.$refs.table.refresh(true)
-    },
+    },
+    // 选择区域
     async openAreaModal (params = {}) {
       this.$refs.partQuery.pageInit()
       const _this = this
@@ -225,25 +218,41 @@ 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' })
     },
+    // 打开经销商弹窗
+    async openDealerModal (params = {}) {
+      const _this = this
+      const arr = []
+      const dataList = await bizuserScopeQueryPage({
+        pageNo: 1,
+        pageSize: 1000,
+        ...params
+      })
+      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)
    },
     //  删除
@@ -261,6 +270,10 @@ export default {
           })
         }
       })
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'businessOwnerSettings' })
     },
     pageInit () {
       const _this = this

+ 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
         })