Forráskód Böngészése

大客户报表 查询条件连锁店

chenrui 3 éve
szülő
commit
4258bc9732
1 módosított fájl, 37 hozzáadás és 2 törlés
  1. 37 2
      src/views/reportData/customerReport/list.vue

+ 37 - 2
src/views/reportData/customerReport/list.vue

@@ -14,6 +14,20 @@
           :wrapperCol="wrapperCol"
           @keyup.enter.native="handleSearch" >
           <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="连锁店" prop="dealerSn">
+                <a-select
+                  placeholder="请选择连锁店"
+                  id="customerReportList-dealerSn"
+                  allowClear
+                  v-model="queryParam.dealerSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="添加时间" prop="time">
                 <rangeDate ref="rangeDate" @change="dateChange" />
@@ -100,7 +114,7 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { getArea } from '@/api/data'
 import { dealerProductTypeList } from '@/api/dealerProductType'
-import { reportBigCustomerList, reportBigCustomerCount } from '@/api/reportData'
+import { reportBigCustomerList, reportBigCustomerCount, linkageGroupList } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -111,6 +125,7 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        dealerSn: undefined,
         time: [],
         beginDate: '',
         endDate: '',
@@ -123,6 +138,7 @@ export default {
       },
       productType: [],
       rules: {
+        'dealerSn': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
         'time': [{ required: true, message: '请选择添加时间', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
@@ -173,7 +189,8 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      productTypeList: [] //  分类下拉数据
+      productTypeList: [], //  分类下拉数据
+      linkageGroupData: []
     }
   },
   methods: {
@@ -206,6 +223,7 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.queryParam.dealerSn = undefined
       this.$refs.rangeDate.resetDate()
       this.queryParam.time = []
       this.queryParam.beginDate = ''
@@ -287,10 +305,27 @@ export default {
           }
         }
       })
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        const all = [{ dealerName: '全部', dealerSn: 'all' }]
+        if (res.status == 200) {
+          const data = res.data || []
+          if (data.length > 0) {
+            this.linkageGroupData = [...all, ...data]
+          } else {
+            this.linkageGroupData = []
+          }
+        } else {
+          this.linkageGroupData = []
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      vm.getLinkageGroup()
       vm.getArea('province')
       vm.getProductType()
     })