lilei 1 سال پیش
والد
کامیت
c093224cba

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1709777989787
+  "version": 1709780626312
 }

+ 20 - 98
src/views/chainReportData/chainCustomerReport/list.vue

@@ -35,45 +35,14 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  change-on-select
-                  v-model="productType"
-                  expand-trigger="hover"
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="customerReportList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
+                <ProductType placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="10" :sm="24">
-                <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
-                    <a-col span="7">
-                      <a-form-model-item prop="provinceSn" style="margin: 0!important;">
-                        <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="citySn" style="margin: 0!important;">
-                        <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="countySn" style="margin: 0!important;">
-                        <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="客户所在区">
+                  <AreaList changeOnSelect ref="areaList" @change="areaChange"></AreaList>
+                </a-form-item>
               </a-col>
               <a-col :md="4" :sm="24">
                 <a-form-item label="客户类型">
@@ -107,7 +76,8 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.salesTargetSn"
+        :rowKey="(record) => record.no"
+        rowKeyName="no"
         :columns="columns"
         :data="loadData"
         :defaultLoadData="false"
@@ -122,11 +92,13 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import custType from '@/views/common/custType.js'
+import ProductType from '../../common/productType.js'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { reportBigCustomerLinkageList, reportBigCustomerLinkageCount, linkageGroupList } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate, custType },
+  components: { STable, VSelect, rangeDate, custType, AreaList, ProductType },
   mixins: [commonMixin],
   data () {
     return {
@@ -206,9 +178,9 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '连锁门店', dataIndex: 'dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
         { title: '客户类型', dataIndex: 'customerTypeName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '交易金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }, sorter: true }
       ]
@@ -220,6 +192,11 @@ export default {
     }
   },
   methods: {
+    areaChange (val) {
+      this.queryParam.provinceSn = val[0] ? val[0] : undefined
+      this.queryParam.citySn = val[1] ? val[1] : undefined
+      this.queryParam.countySn = val[2] ? val[2] : undefined
+    },
     // 合计
     getCount (params) {
       reportBigCustomerLinkageCount(params).then(res => {
@@ -262,6 +239,9 @@ export default {
       this.queryParam.countySn = undefined
       this.queryParam.customerTypeSn = undefined
       this.productType = []
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -277,62 +257,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.countySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.countySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     // 连锁店
     getLinkageGroup () {
       linkageGroupList({}).then(res => {
@@ -345,8 +269,6 @@ export default {
     },
     pageInit () {
       this.getLinkageGroup()
-      this.getArea('province')
-      this.getProductType()
     }
   },
   mounted () {

+ 18 - 93
src/views/chainReportData/chainSalesDetailReport/list.vue

@@ -40,11 +40,9 @@
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户类型">
-                <a-select id="chainSalesDetailReportList-customerType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
-                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
+              <a-form-item label="客户类型">
+                <custType v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型"></custType>
+              </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="收款方式">
@@ -101,32 +99,10 @@
                 <a-input id="chainSalesDetailReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
-              <a-row>
-                <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
-                  <a-col span="7">
-                    <a-form-model-item prop="provinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省" allowClear>
-                        <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-form-model-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-model-item prop="citySn" style="margin: 0;">
-                      <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市" allowClear>
-                        <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-form-model-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-model-item prop="countySn" style="margin: 0;">
-                      <a-select v-model="queryParam.countySn" placeholder="请选择区/县" allowClear>
-                        <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-form-model-item>
-                  </a-col>
-                </a-form-model-item>
-              </a-row>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户所在区">
+                <AreaList changeOnSelect ref="areaList" @change="areaChange"></AreaList>
+              </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -173,15 +149,15 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { getArea } from '@/api/data'
-import { custTypeFindAllList } from '@/api/custType'
+import AreaList from '@/views/common/areaList.js'
+import custType from '@/views/common/custType.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import { warehouseCascadeList } from '@/api/warehouse'
 import custList from '@/views/common/custList.vue'
 import { reportChainSalesBillDetailList, reportChainSalesBillDetailCount, linkageGroupList } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate, ProductType, ProductBrand, custList },
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand, custList, AreaList, custType },
   mixins: [commonMixin],
   data () {
     return {
@@ -296,6 +272,11 @@ export default {
         }
       })
     },
+    areaChange (val) {
+      this.queryParam.provinceSn = val[0] ? val[0] : undefined
+      this.queryParam.citySn = val[1] ? val[1] : undefined
+      this.queryParam.countySn = val[2] ? val[2] : undefined
+    },
     //  创建时间  change
     dateChange (date) {
       this.queryParam.time = date
@@ -349,6 +330,9 @@ export default {
       this.queryParam.salesManName = ''
       this.productType = []
       this.$refs.custSatelliteList.resetForm()
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -358,17 +342,6 @@ export default {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
-    //  获取客户类型列表
-    getCustTypeList () {
-      const _this = this
-      custTypeFindAllList().then(res => {
-        if (res.status == 200) {
-          _this.custTypeList = res.data || []
-        } else {
-          _this.custTypeList = []
-        }
-      })
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
@@ -418,56 +391,8 @@ export default {
         this.queryParam.warehouseLocationSn = ''
       }
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.countySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.countySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     pageInit () {
       this.getLinkageGroup()
-      this.getArea('province')
-      this.getCustTypeList()
       this.getWarehouseCascade()
     }
   },

+ 18 - 93
src/views/chainReportData/chainSalesReport/list.vue

@@ -40,11 +40,9 @@
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户类型">
-                <a-select id="chainSalesReportList-salesTargetType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
-                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
+              <a-form-item label="客户类型">
+                <custType v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型"></custType>
+              </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="收款方式">
@@ -67,32 +65,10 @@
                 <a-input id="chainSalesReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
-              <a-row>
-                <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
-                  <a-col span="8">
-                    <a-form-model-item prop="provinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-form-model-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-model-item prop="citySn" style="margin: 0;">
-                      <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-form-model-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-model-item prop="countySn" style="margin: 0;">
-                      <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-form-model-item>
-                  </a-col>
-                </a-form-model-item>
-              </a-row>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户所在区">
+                <AreaList changeOnSelect ref="areaList" @change="areaChange"></AreaList>
+              </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -139,12 +115,12 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { getArea } from '@/api/data'
-import { custTypeFindAllList } from '@/api/custType'
+import AreaList from '@/views/common/areaList.js'
+import custType from '@/views/common/custType.js'
 import custList from '@/views/common/custList.vue'
 import { reportChainSalesBillList, reportChainSalesBillCount, linkageGroupList } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate, custList },
+  components: { STable, VSelect, rangeDate, custList, AreaList, custType },
   mixins: [commonMixin],
   data () {
     return {
@@ -231,6 +207,11 @@ export default {
     }
   },
   methods: {
+    areaChange (val) {
+      this.queryParam.provinceSn = val[0] ? val[0] : undefined
+      this.queryParam.citySn = val[1] ? val[1] : undefined
+      this.queryParam.countySn = val[2] ? val[2] : undefined
+    },
     // 合计
     getCount (params) {
       reportChainSalesBillCount(params).then(res => {
@@ -284,6 +265,9 @@ export default {
       this.queryParam.salesBillNo = ''
       this.queryParam.salesManName = ''
       this.$refs.custSatelliteList.resetForm()
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -293,17 +277,6 @@ export default {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
-    //  获取客户类型列表
-    getCustTypeList () {
-      const _this = this
-      custTypeFindAllList().then(res => {
-        if (res.status == 200) {
-          _this.custTypeList = res.data || []
-        } else {
-          _this.custTypeList = []
-        }
-      })
-    },
     // 连锁店
     getLinkageGroup () {
       linkageGroupList({}).then(res => {
@@ -319,56 +292,8 @@ export default {
         }
       })
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.countySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.countySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     pageInit () {
       this.getLinkageGroup()
-      this.getArea('province')
-      this.getCustTypeList()
     }
   },
   mounted () {