浏览代码

修改bug

chenrui 2 年之前
父节点
当前提交
c6c3543192

+ 12 - 0
src/api/bizuser.js

@@ -150,3 +150,15 @@ export const saveDealerScope = params => {
     method: 'post'
   })
 }
+
+// 经销商列表  (选择过的优先显示)
+export const bizuserScopeQueryDealer = (params) => {
+  const url = `/bizuser/scope/queryDealer/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 11 - 13
src/api/reportData.js

@@ -846,7 +846,7 @@ export const queryDetailReportPage = (params) => {
 // 收发存报表  导出
 export const exportDetailReport = (params) => {
   return axios({
-    url: '/report/reportStockPsi/exportDetailReport',
+    url: '/report/reportStockPsi/exportReport',
     data: params,
     method: 'post',
     responseType: 'blob'
@@ -854,9 +854,7 @@ export const exportDetailReport = (params) => {
 }
 // 收发存报表  汇总列表
 export const queryGroupByprodTypeReportPage = (params) => {
-  const url = `/report/reportStockPsi/queryGroupByProdTypeReportPage/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
+  const url = `/report/reportStockPsi/queryGroupByProdTypeReport`
   return axios({
     url: url,
     data: params,
@@ -872,12 +870,12 @@ export const queryReportCount = (params) => {
     method: 'post'
   })
 }
-// 收发存报表  汇总导出
-export const exportGroupByProductTypeReport = (params) => {
-  return axios({
-    url: '/report/reportStockPsi/exportGroupByProductTypeReport',
-    data: params,
-    method: 'post',
-    responseType: 'blob'
-  })
-}
+// // 收发存报表  汇总导出
+// export const exportGroupByProductTypeReport = (params) => {
+//   return axios({
+//     url: '/report/reportStockPsi/exportGroupByProductTypeReport',
+//     data: params,
+//     method: 'post',
+//     responseType: 'blob'
+//   })
+// }

+ 35 - 35
src/views/dealerManagement/businessOwnerSettings/chooseAreaModal.vue

@@ -88,42 +88,43 @@ export default {
               })
             }
           })
-          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 : []
+          this.subregionData = res.data
+          // 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) {
-            item.disabled = area.includes(item.areaSn)
-            item.disableCheckbox = area.includes(item.areaSn)
-          }
-          if (item.subareaAreaList && item.subareaAreaList.length > 0) {
-            item.subareaAreaList.forEach(con => {
-              con.disabled = zone.includes(con.areaSn)
-              con.disableCheckbox = zone.includes(con.areaSn)
-            })
-          }
-        })
-      }
-      this.subregionData = subregionData
-    },
+    // 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) {
+    //         item.disabled = area.includes(item.areaSn)
+    //         item.disableCheckbox = area.includes(item.areaSn)
+    //       }
+    //       if (item.subareaAreaList && item.subareaAreaList.length > 0) {
+    //         item.subareaAreaList.forEach(con => {
+    //           con.disabled = zone.includes(con.areaSn)
+    //           con.disableCheckbox = zone.includes(con.areaSn)
+    //         })
+    //       }
+    //     })
+    //   }
+    //   this.subregionData = subregionData
+    // },
     save () {
       this.$emit('ok', this.checkedKeys)
     },
@@ -139,12 +140,11 @@ export default {
         this.checkedKeys.halfChecked = []
       }
     },
+    // 递归完成全选
     getAllFun (data) {
       if (data) {
         data.map((item, index) => {
-          if (!item.disabled || !item.disableCheckbox) {
-            this.checkedKeys.checked.push(item.areaSn)
-          }
+          this.checkedKeys.checked.push(item.areaSn)
           if (item.subareaAreaList && item.subareaAreaList.length > 0) {
             this.getAllFun(item.subareaAreaList)
           }

+ 277 - 0
src/views/dealerManagement/businessOwnerSettings/chooseDealer.vue

@@ -0,0 +1,277 @@
+<template>
+  <a-spin :spinning="spinning" tip="Loading...">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="经销商名称/别名">
+              <a-input id="chooseDealer-nameLike" v-model.trim="queryParam.dealer.nameLike" allowClear placeholder="请输入经销商名称/别名"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="商户类型">
+              <v-select code="DEALER_TYPE" id="chooseDealer-dealerType" v-model="queryParam.dealer.dealerType" allowClear placeholder="请选择商户类型"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-model-item label="商户级别" prop="dealerLevel">
+              <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="queryParam.dealer.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="8" :sm="24" v-if="pageType!='viewDealers'">
+            <a-form-item label="所在区域/分区">
+              <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
+            </a-form-item>
+          </a-col>
+          <div v-else>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="审核状态">
+                <v-select code="AUDIT_STATE" id="viewDealers-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-model-item label="地区">
+                <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+              </a-form-model-item>
+            </a-col>
+          </div>
+          <a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="searchForm(true)" :disabled="disabled" id="chooseDealer-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseDealer-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+      <!-- 列表 -->
+      <div style="margin-bottom: 10px">
+        <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
+        <span style="margin-left: 5px">
+          <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
+        </span>
+      </div>
+    </div>
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.dealer.dealerSn"
+      rowKeyName="dealerSn"
+      :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: pageType=='viewDealers'?!!record.subareaAreaSn: !!record.chooseId} }) }"
+      @rowSelection="rowSelectionFun"
+      :columns="columns"
+      :data="loadData"
+      :style="{ height:pageType=='viewDealers'? tableHeight+84.5+'px':tableHeight-15+'px' }"
+      :scroll="{ y: pageType=='viewDealers'?tableHeight:tableHeight+80 }"
+      :defaultLoadData="false"
+      bordered>
+      <template slot="areas" slot-scope="text, record">
+        <span v-if="record.subareaArea">{{ record.subareaArea.subareaName }}>{{ record.subareaArea.subareaAreaName }}</span>
+        <span v-else>--</span>
+      </template>
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="handleAdd(record)"
+          v-if="record.subareaAreaSn != parentData.subareaAreaSn"
+          id="marketingDivisionSetNew-del-btn">添加</a-button>
+        <span style="color:#666" v-else>已添加</span>
+      </template>
+    </s-table>
+  </a-spin>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import AreaList from '@/views/common/areaList.js'
+import { bizuserScopeQueryDealer } from '@/api/bizuser'
+import subarea from '@/views/common/subarea.js'
+export default {
+  name: 'ChooseDealer',
+  mixins: [commonMixin],
+  components: { STable, VSelect, subarea, AreaList },
+  props: {
+    pageType: {
+      type: String,
+      default: ''
+    },
+    parentData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      queryParam: { //  查询条件
+        dealer: {
+          nameLike: '',
+          dealerType: null,
+          dealerLevel: null
+        },
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        subareaSn: undefined,
+        subareaAreaSn: undefined
+      },
+      userSn: '',
+      chooseInfo: [],
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 批量添加loading
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        this.queryParam.userSn = this.userSn
+        return bizuserScopeQueryDealer(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          const _this = this
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            if (!_this.pageType && _this.chooseInfo && _this.chooseInfo.length > 0) {
+              const chooseData = []
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+                // 回显选中数据
+                const flag = _this.chooseInfo.includes(data.list[i].dealer.dealerSn)
+                if (flag) {
+                  chooseData.push(data.list[i])
+                }
+              }
+              console.log('111111:', chooseData)
+              console.log('222222:', _this.chooseInfo)
+              _this.$refs.table.setTableSelected(_this.chooseInfo, chooseData) // 设置表格选中项
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      rowSelectionInfo: null
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户别名', dataIndex: 'dealer.dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'dealer.dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealer.dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (_this.pageType == 'viewDealers') {
+        arr.splice(4, 0, { title: '审核状态', dataIndex: 'auditStateDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } })
+        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: 'subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(5, 0, { title: '所在分区', dataIndex: 'subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
+    },
+    selectCount () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    areaChange (val) {
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
+    },
+    searchForm (flag) {
+      this.$refs.table.refresh(flag)
+      this.$refs.table.clearSelected()
+      this.spinning = false
+    },
+    subareaChange (val) {
+      this.queryParam.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam = {
+        dealer: {
+          nameLike: '',
+          dealerType: null,
+          dealerLevel: null
+        },
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        subareaSn: undefined,
+        subareaAreaSn: undefined
+      }
+      if (this.pageType != 'viewDealers') {
+        this.$refs.subarea.clearData()
+      } else {
+        this.$refs.areaList.clearData()
+      }
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    },
+    clearTable () {
+      this.rowSelectionInfo = null
+      this.$refs.table.clearTable()
+    },
+    // 批量添加
+    handleBatchAudit () {
+      const _this = this
+      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      const dealerSnList = _this.rowSelectionInfo.selectedRowKeys
+      this.spinning = false
+      this.$emit('plAdd', dealerSnList)
+    },
+    handleAdd (row) {
+      if (row.subareaArea) {
+        const _this = this
+        this.$confirm({
+          title: '提示',
+          content: '当前经销商已被其他区域分区绑定,确定要更新绑定关系吗?',
+          centered: true,
+          onOk () {
+            _this.spinning = true
+            _this.$emit('add', row)
+          }
+        })
+      } else {
+        this.spinning = true
+        this.$emit('add', row)
+      }
+    },
+    pageInit (data) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.chooseInfo = data.list
+      this.userSn = data.sn
+      this.resetSearchForm()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 285
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  }
+}
+</script>

+ 6 - 2
src/views/dealerManagement/businessOwnerSettings/settingsIndex.vue

@@ -104,7 +104,7 @@ 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 chooseDealer from './chooseDealer.vue'
 import { bizuserScopeQueryPage, bizuserScopeDelete, findById, queryAreaScope, queryDealerScope, saveAreaScope, saveDealerScope } from '@/api/bizuser'
 import subarea from '@/views/common/subarea.js'
 export default {
@@ -271,9 +271,13 @@ export default {
         })
         _this.chooseInfo = [...new Set(arr)]
       }
+      const dataInfo = {
+        list: _this.chooseInfo,
+        sn: _this.$route.query.sn
+      }
       _this.openChooseDealer = true
       if (_this.openChooseDealer) {
-        _this.$refs.dealerChoose.pageInit(_this.chooseInfo)
+        _this.$refs.dealerChoose.pageInit(dataInfo)
       }
     },
     // 经销商

+ 5 - 10
src/views/dealerManagement/dealerZoneSearch/list.vue

@@ -12,7 +12,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="经销商">
-                <dealerSearchList id="dealerZoneSearch-dealerName" placeholder="请输入经销商名称搜索" ref="indirectDealer" @change="dealerChange" />
+                <custList id="dealerZoneSearch-dealerName" placeholder="请输入经销商名称搜索" ref="indirectDealer" @change="dealerChange" />
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
@@ -89,11 +89,11 @@ import { STable } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import { exportExcel } from '@/libs/JGPrint.js'
 import { queryDealerWithBizuser, exportDealerWithBizuser } from '@/api/dealerRelation'
-import dealerSearchList from '@/views/common/dealerSearchList.vue'
+import custList from '@/views/common/custList.vue'
 export default {
   name: 'DealerZoneSearch',
   mixins: [commonMixin],
-  components: { STable, subarea, dealerSearchList },
+  components: { STable, subarea, custList },
   data () {
     return {
       spinning: false,
@@ -166,13 +166,8 @@ export default {
     },
     // 选择经销商
     dealerChange (val) {
-      if (val.row) {
-        this.queryParam.dealer.dealerSn = val.row.dealerSn
-        this.queryParam.dealer.dealerName = val.row.dealerName
-      } else {
-        this.queryParam.dealer.dealerSn = undefined
-        this.queryParam.dealer.dealerName = val.key
-      }
+      this.queryParam.dealer.dealerSn = val.key
+      this.queryParam.dealer.dealerName = (val.label.replace('\n', '')).trim()
     },
     pageInit () {
       const _this = this

+ 4 - 8
src/views/reportData/receivedSendStorageReport/index.vue

@@ -103,7 +103,7 @@
         </s-table>
       </a-tab-pane>
       <a-tab-pane key="2" tab="汇总" force-render>
-        <gatherList ref="gatherBox" :tableHeight="tableHeight" :queryParam="queryParam"></gatherList>
+        <gatherList ref="gatherBox" :tableHeight="tableHeight" :totalData="totalData" :queryParam="queryParam"></gatherList>
       </a-tab-pane>
     </a-tabs>
     <!-- 导出提示框 -->
@@ -117,7 +117,7 @@ import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
 import { STable, VSelect } from '@/components'
 import reportModal from '@/views/common/reportModal.vue'
-import { queryDetailReportPage, exportDetailReport, exportGroupByProductTypeReport, queryReportCount } from '@/api/reportData'
+import { queryDetailReportPage, exportDetailReport, queryReportCount } from '@/api/reportData'
 import { hdExportExcel } from '@/libs/exportExcel'
 import gatherList from './list'
 import moment from 'moment'
@@ -190,8 +190,6 @@ export default {
               data.list[i].no = no + i + 1
             }
             this.disabled = false
-            // 总计
-            this.getCount(params)
           }
           this.spinning = false
           return data
@@ -263,10 +261,6 @@ export default {
         _this.exportLoading = false
         _this.spinning = false
       })
-      hdExportExcel(exportGroupByProductTypeReport, params, '收发存报表', function () {
-        _this.exportLoading = false
-        _this.spinning = false
-      })
     },
     // 验证表单 type值  search查询 export导出
     testForm (type) {
@@ -291,6 +285,8 @@ export default {
     // 查询
     handleSearch () {
       const _this = this
+      // 总计
+      _this.getCount(this.queryParam)
       _this.$refs.table.refresh(true)
       _this.$refs.gatherBox.resetCurForm()
     },

+ 8 - 17
src/views/reportData/receivedSendStorageReport/list.vue

@@ -8,6 +8,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
+      :showPagination="false"
       :scroll="{ y: tableHeight-120 }"
       :defaultLoadData="false"
       bordered>
@@ -38,7 +39,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { queryGroupByprodTypeReportPage, queryReportCount } from '@/api/reportData'
+import { queryGroupByprodTypeReportPage } from '@/api/reportData'
 import { STable, VSelect } from '@/components'
 export default {
   name: 'QueryPart',
@@ -55,6 +56,12 @@ export default {
     tableHeight: {
       type: Number,
       default: 0
+    },
+    totalData: {
+      type: Object,
+      default: function () {
+        return null
+      }
     }
   },
   data () {
@@ -77,7 +84,6 @@ export default {
         { title: '期末结存金额', dataIndex: 'endAmount', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
       ],
       disabled: false, //  查询、重置按钮是否可操作
-      totalData: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -86,12 +92,7 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
             this.disabled = false
-            this.getCount(params)
           }
           this.spinning = false
           return data
@@ -100,15 +101,6 @@ export default {
     }
   },
   methods: {
-    getCount (params) {
-      queryReportCount(params).then(res => {
-        if (res.status == 200) {
-          this.totalData = res.data
-        } else {
-          this.totalData = null
-        }
-      })
-    },
     pageInit (buyerSn) {
       this.resetCurForm()
     },
@@ -118,7 +110,6 @@ export default {
     },
     resetTable () {
       this.$refs.table.clearTable()
-      this.totalData = null
     }
   }
 }

+ 3 - 2
src/views/setting/erpMessageManagement/list.vue

@@ -52,8 +52,9 @@
         </template>
         <!-- 同步状态 -->
         <template slot="syncStatus" slot-scope="text, record">
-          <span v-if="record.handleResult&&record.handleResult!='fail'">同步成功</span>
-          <span v-else style="color:#ed1c24;">同步失败</span>
+          <span v-if="record.handleResult&&record.handleResult=='finish'">处理成功</span>
+          <span v-else-if="record.handleResult&&record.handleResult=='wait'">等待处理</span>
+          <span v-else style="color:#ed1c24;">处理失败</span>
         </template>
         <!-- 错误信息 -->
         <template slot="errInfo" slot-scope="text, record">