浏览代码

Merge branch 'develop_yh37' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh37

lilei 1 年之前
父节点
当前提交
03ef880dfe
共有 2 个文件被更改,包括 11 次插入77 次删除
  1. 6 47
      src/views/productManagement/priceChangeRecord/list.vue
  2. 5 30
      src/views/reportData/customerReport/list.vue

+ 6 - 47
src/views/productManagement/priceChangeRecord/list.vue

@@ -22,30 +22,12 @@
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="品牌">
-                <a-select
-                  placeholder="请选择"
-                  id="productChangeRecordList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
+                <ProductBrand id="productChangeRecordList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  expand-trigger="hover"
-                  change-on-select
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productType" />
+                <ProductType id="productChangeRecordList-productType" placeholder="请选择产品分类" :isDealer="false" @change="changeProductType" v-model="productType"></ProductType>
               </a-form-item>
             </a-col>
           </template>
@@ -119,13 +101,13 @@ import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { productBrandQuery } from '@/api/productBrand'
-import { productTypeQuery } from '@/api/productType'
+import ProductBrand from '@/views/common/productBrand.js'
+import ProductType from '@/views/common/productType.js'
 import { productPriceChangeList, getCurrentDealer } from '@/api/product'
 // import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ProductPriceChangeList',
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, ProductBrand, ProductType },
   mixins: [commonMixin],
   data () {
     return {
@@ -168,9 +150,7 @@ export default {
         })
       },
       columns: [],
-      total: 0,
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      total: 0
     }
   },
   methods: {
@@ -293,34 +273,13 @@ export default {
       // downloadExcel(res, '价格变更记录')
       // })
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      productBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
     //  产品分类  列表
-    getProductType () {
-      productTypeQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
       this.getColumns()
-      this.getProductBrand()
-      this.getProductType()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

+ 5 - 30
src/views/reportData/customerReport/list.vue

@@ -36,16 +36,7 @@
             </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 id="chainSalesReportList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
               </a-form-model-item>
             </a-col>
           </template>
@@ -96,11 +87,11 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import AreaList from '@/views/common/areaList.js'
 import custType from '@/views/common/custType.js'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import ProductType from '@/views/common/productType.js'
 import { reportBigCustomerList, reportBigCustomerCount } from '@/api/reportData'
 export default {
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, custType, custList, AreaList },
+  components: { STable, VSelect, rangeDate, custType, custList, AreaList, ProductType },
   data () {
     return {
       spinning: false,
@@ -170,8 +161,7 @@ export default {
       totalData: null, //  合计
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      productTypeList: [] //  分类下拉数据
+      addrDistrictList: [] //  区下拉
     }
   },
   computed: {
@@ -250,7 +240,7 @@ export default {
       this.productType = []
       this.$refs.ruleForm.resetFields()
       this.$refs.custSatelliteList.resetForm()
-      if(this.advanced){
+      if (this.advanced) {
         this.$refs.areaList.clearData()
       }
       this.totalData = null
@@ -266,31 +256,16 @@ export default {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       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 = []
-        }
-      })
-    },
-    pageInit () {
-      this.getProductType()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },