浏览代码

产品分类统一

lilei 2 年之前
父节点
当前提交
73fbd19d3a
共有 1 个文件被更改,包括 3 次插入37 次删除
  1. 3 37
      src/views/productManagement/newProduct/list.vue

+ 3 - 37
src/views/productManagement/newProduct/list.vue

@@ -28,16 +28,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-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="productInfoList-productType"
-                    placeholder="请选择产品分类"
-                    allowClear />
+                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="productInfoList-productType"></productTypeAll>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -98,16 +89,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { productBrandQuery } from '@/api/productBrand'
-import { productTypeQueryAll } from '@/api/productType'
 import { queryNewProductPage } from '@/api/product'
 import { STable, VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 export default {
   name: 'NewProductList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, ProductBrand },
+  components: { STable, VSelect, rangeDate, ProductBrand, productTypeAll },
   data () {
     return {
       spinning: false,
@@ -160,8 +150,6 @@ export default {
       },
       openModal: false, //  查看详情  弹框
       itemId: '', //  当前产品productSn
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
     }
   },
   methods: {
@@ -197,33 +185,11 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      productBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      productTypeQueryAll({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.getProductBrand()
-      this.getProductType()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight