chenrui 1 vuosi sitten
vanhempi
commit
cc6ad5ca87

+ 51 - 6
src/api/dealerScope.js

@@ -9,19 +9,19 @@ export const dealerScopeList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('列表查询')
     }
   })
 }
 //  经销权 列表 无分页
 export const dealerScopeQueryList = (params) => {
-  const mid = {'PRODUCT':'选择产品','BRAND':'选择品牌','CATEGORY':'选择产品分类'}
+  const mid = { 'PRODUCT': '选择产品', 'BRAND': '选择品牌', 'CATEGORY': '选择产品分类' }
   return axios({
     url: '/dealerScope/queryList',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent(mid[params.goodsType])
     }
   })
@@ -32,7 +32,7 @@ export const dealerScopeSave = (params) => {
     url: '/dealerScope/addDealerScope',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('新增')
     }
   })
@@ -42,7 +42,7 @@ export const dealerScopeDel = (params) => {
   return axios({
     url: `/dealerScope/deleteBySn/${params.sn}`,
     method: 'get',
-    headers:{
+    headers: {
       'module': encodeURIComponent('删除')
     }
   })
@@ -53,8 +53,53 @@ export const dealerScopeValidProduct = (params) => {
     url: '/dealerScope/validProductIsIncloude',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('校验产品是否在品牌分类中')
     }
   })
 }
+
+// 获取选择品类列表数据   (所有产品的品牌+分类)
+export const queryWaitingData = (params) => {
+  return axios({
+    url: '/dealerScope/queryWaitingData',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('选择品类列表查询')
+    }
+  })
+}
+//  经销权  添加品类
+export const dealerScopeCreate = (params) => {
+  return axios({
+    url: '/dealerScope/create',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('新增品类')
+    }
+  })
+}
+//  经销权  修改价格级别
+export const dealerScopeModifyPriceLevel = (params) => {
+  return axios({
+    url: '/dealerScope/modifyPriceLevel',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('修改价格级别')
+    }
+  })
+}
+// 经销权  删除选择品类
+export const dealerScopeDelete = (params) => {
+  return axios({
+    url: '/dealerScope/delete',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('删除')
+    }
+  })
+}

+ 76 - 15
src/views/dealerManagement/merchantInfoManagement/chooseTypeList.vue

@@ -14,7 +14,7 @@
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
+            <a-button type="primary" @click="getTableData" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
           </a-col>
         </a-row>
@@ -34,7 +34,7 @@
         :virtual-scroll-option="{enable: true}"
         :columns="columns"
         :table-data="dataSource"
-        row-key-field-name="id"
+        row-key-field-name="no"
         :checkbox-option="checkboxOption"
       />
       <div v-show="dataSource.length==0" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
@@ -46,6 +46,8 @@
 import { commonMixin } from '@/utils/mixin'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
+import { Empty } from 'ant-design-vue'
+import { queryWaitingData } from '@/api/dealerScope'
 export default {
   name: 'DetailProductList',
   mixins: [commonMixin],
@@ -54,46 +56,105 @@ export default {
     maxHeight: {
       type: [String, Number],
       default: '300'
-    },
-    dataSource: {
-      type: Array,
-      default: function () { return [] }
     }
   },
   data () {
     return {
       spinning: false,
+      disabled: false,
       showEmpty: false,
       tableHeight: this.maxHeight,
       showTableHead: true, // 显示表头
+      chooseDataList: [],
+      selectedRowKeys: [],
       checkboxOption: {
         // 行选择改变事件
         selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
-          console.log(row, isSelected, selectedRowKeys)
+          const selectedRowKeysInfo = selectedRowKeys.map(item => {
+            return { productBrandSn: this.dataSource[item - 1].productBrandSn,
+              productTypeSn1: this.dataSource[item - 1].productTypeSn1,
+              productTypeSn2: this.dataSource[item - 1].productTypeSn2,
+              productTypeSn3: this.dataSource[item - 1].productTypeSn3 }
+          })
+          this.selectedRowKeys = selectedRowKeys
+          this.chooseDataList = selectedRowKeysInfo
         },
         // 全选改变事件
         selectedAllChange: ({ isSelected, selectedRowKeys }) => {
-          console.log(isSelected, selectedRowKeys)
+          const selectedRowKeysInfo = selectedRowKeys.map(item => {
+            return { productBrandSn: this.dataSource[item - 1].productBrandSn,
+              productTypeSn1: this.dataSource[item - 1].productTypeSn1,
+              productTypeSn2: this.dataSource[item - 1].productTypeSn2,
+              productTypeSn3: this.dataSource[item - 1].productTypeSn3 }
+          })
+          this.selectedRowKeys = selectedRowKeys
+          this.chooseDataList = selectedRowKeysInfo
         }
       },
       queryParam: {
-        productBrandSn: undefined
-      }
+        productBrandSn: undefined,
+        productTypeSn1: undefined, //  产品一级分类
+        productTypeSn2: undefined, //  产品二级分类
+        productTypeSn3: undefined //  产品三级分类
+      },
+      productType: [],
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      dataSource: []
     }
   },
   computed: {
     columns () {
       const arr = [
         { title: '', field: '', key: 'acheck', width: 60, type: 'checkbox', align: 'center' },
-        { title: '序号', field: 'no', key: 'a', width: 80, align: 'center', operationColumn: false },
-        { title: '品牌', field: 'productCode', key: 'b', align: 'center', width: 160, operationColumn: false },
-        { title: '一级分类', field: 'warehouseName', key: 'c', width: 160, align: 'center', operationColumn: false },
-        { title: '二级分类', field: 'surplusQty', key: 'd', width: 160, align: 'center', operationColumn: false },
-        { title: '三级分类', field: 'qty', key: 'e', width: 160, align: 'center', operationColumn: false }
+        { title: '品牌', field: 'productBrandName', key: 'a', align: 'center', width: 160, operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
+        { title: '一级分类', field: 'productTypeName1', key: 'b', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
+        { title: '二级分类', field: 'productTypeName2', key: 'c', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
+        { title: '三级分类', field: 'productTypeName3', key: 'd', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } }
       ]
       return arr
     }
+  },
+  methods: {
+    getTableData () {
+      const _this = this
+      _this.spinning = true
+      _this.disabled = true
+      const ajaxData = JSON.parse(JSON.stringify(_this.queryParam))
+      ajaxData.dealerSn = _this.$route.params.sn
+      queryWaitingData(ajaxData).then(res => {
+        if (res.status == 200 && res.data && res.data.length > 0) {
+          for (var i = 0; i < res.data.length; i++) {
+            res.data[i].no = i + 1
+          }
+          _this.dataSource = res.data
+        } else {
+          _this.dataSource = []
+        }
+        _this.spinning = false
+        _this.disabled = false
+      })
+    },
+    resetSearchForm () {
+      this.queryParam = {
+        productBrandSn: undefined,
+        productTypeSn1: undefined, //  产品一级分类
+        productTypeSn2: undefined, //  产品二级分类
+        productTypeSn3: undefined //  产品三级分类
+      }
+      this.productType = []
+      this.getTableData()
+    },
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : undefined
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : undefined
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : undefined
+    },
+    // 清空选项
+    clearSelectTable () {
+      this.selectedRowKeys = []
+    }
   }
+
 }
 </script>
 

+ 29 - 52
src/views/dealerManagement/merchantInfoManagement/chooseTypeModal.vue

@@ -18,10 +18,18 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="价格级别" prop="priceLevel">
-          <v-select code="PRICE_LEVEL" id="productPriceLevel-level" v-model="form.level" allowClear placeholder="请选择价格级别"></v-select>
+          <v-select
+            code="PRICE_LEVEL"
+            style="width: 50%;"
+            id="productPriceLevel-level"
+            v-model="form.priceLevel"
+            allowClear
+            placeholder="请选择价格级别"></v-select>
         </a-form-model-item>
-        <a-form-model-item label="添加品类" prop="productType">
-          <chooseTypeList :dataSource="dataList"></chooseTypeList>
+        <a-form-model-item label="添加品类" prop="productScopeList">
+          <div class="typeListBox">
+            <chooseTypeList ref="chooseTypeInfo" :maxHeight="500"></chooseTypeList>
+          </div>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
@@ -33,7 +41,7 @@
 </template>
 
 <script>
-import { serviceCenterAdd } from '@/api/serviceCenter'
+import { dealerScopeCreate } from '@/api/dealerScope'
 import chooseTypeList from './chooseTypeList.vue'
 import { VSelect } from '@/components'
 export default {
@@ -43,12 +51,6 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
-    },
-    dataList: {
-      type: Array,
-      default: function () {
-        return []
-      }
     }
   },
   data () {
@@ -60,33 +62,31 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
-        serviceCenterSn: undefined, // 经销商sn
-        serviceCenterName: undefined// 经销商名称
+        priceLevel: undefined, // 价格级别
+        productScopeList: []// 产品分类
       },
       rules: {
         priceLevel: [
           { required: true, message: '请选择价格等级', trigger: 'change' }
         ],
-        productType: [
-          { required: true, message: '请选择产品品类', trigger: 'change' }
+        productScopeList: [
+          { required: true, message: '请选择产品品类', trigger: 'blur' }
         ]
       }
     }
   },
   methods: {
-    // 选择经销商
-    dealerChange (val) {
-      this.form.serviceCenterSn = val.key
-      this.form.serviceCenterName = val.key ? (val.label.replace('\n', '')).trim() : ''
-    },
     //  保存
     handleSave () {
       const _this = this
+      const getTableList = _this.$refs.chooseTypeInfo.chooseDataList
+      _this.form.productScopeList = getTableList
       _this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const formData = JSON.parse(JSON.stringify(_this.form))
+          formData.dealerSn = _this.$route.params.sn
           _this.spinning = true
-          serviceCenterAdd(formData).then(res => {
+          dealerScopeCreate(formData).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
@@ -110,15 +110,23 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
+        this.$refs.ruleForm.resetFields()
         this.$emit('close')
+      } else {
+        this.$nextTick(() => {
+          this.$refs.chooseTypeInfo.getTableData()
+        })
       }
     }
   }
 }
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
   .chooseType-modal{
+    .typeListBox{
+      line-height: 23px !important;
+    }
     .ant-modal-body {
       padding: 40px 40px 24px;
     }
@@ -126,36 +134,5 @@ export default {
       text-align: center;
       margin: 35px 0 10px;
     }
-    .tree-node{
-      height: 300px;
-      overflow: auto;
-      .tree-box{
-        .tree-parent{
-          display: flex;
-          align-items: center;
-          border-bottom: 1px solid #eee;
-          padding: 0 10px;
-          > span{
-            margin:0 5px;
-            &:first-child{
-              flex-grow: 1;
-            }
-            &:last-child{
-              cursor: pointer;
-            }
-          }
-        }
-        .tree-child{
-          padding: 10px 10px 10px 35px;
-          display: flex;
-          align-items: center;
-          flex-wrap:wrap ;
-          > div{
-            margin:0 5px;
-          }
-        }
-      }
-
-    }
   }
 </style>

+ 57 - 99
src/views/dealerManagement/merchantInfoManagement/permissionSettingNew.vue

@@ -17,25 +17,25 @@
             class="form-model-con"
             layout="inline"
             :model="queryParam"
-            @keyup.enter.native="handleSearch">
+            @keyup.enter.native="$refs.table.refresh()">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="品牌" prop="goodsBrand">
+                <a-form-model-item label="品牌" prop="productBrandSn">
                   <ProductBrand id="chooseProducts-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品分类" prop="goodsType">
-                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType" id="chooseProducts-productType"></productTypeAll>
+                <a-form-model-item label="产品分类" prop="productType">
+                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="chooseProducts-productType"></productTypeAll>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="价格级别" prop="goodsCode">
-                  <v-select code="PRODUCT_LEVEL" id="productLevelEdit-level" v-model="queryParam.level" allowClear placeholder="请选择价格级别"></v-select>
+                <a-form-model-item label="价格级别" prop="priceLevel">
+                  <v-select code="PRICE_LEVEL" id="productLevelEdit-priceLevel" v-model="queryParam.priceLevel" allowClear placeholder="请选择价格级别"></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="handleSearch" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
+                <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
               </a-col>
             </a-row>
@@ -66,7 +66,9 @@
       </a-card>
     </a-spin>
     <!-- 选择产品分类 -->
-    <chooseTypeModal :openModal="openTypeModal" :dataList="detailDataList" @close="openTypeModal=false" @ok="handleTypeOk" />
+    <chooseTypeModal :openModal="openTypeModal" @close="openTypeModal=false" @ok="handleTypeOk" />
+    <!-- 修改价格等级 -->
+    <editPriceLevelModal :priceLevelVal="itemPriceLevel" :openModal="openPriceLevelModal" @close="closePriceLevelModal" @ok="handlePriceLevelOk" />
   </div>
 </template>
 
@@ -74,36 +76,35 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import ChooseTypeModal from './chooseTypeModal.vue'
+import editPriceLevelModal from './priceLevelModal.vue'
 import productTypeAll from '@/views/common/productTypeAll.js'
 import ProductBrand from '@/views/common/productBrand.js'
-import { dealerScopeList, dealerScopeSave, dealerScopeDel, dealerScopeQueryList } from '@/api/dealerScope'
+import { dealerScopeList, dealerScopeModifyPriceLevel, dealerScopeDelete } from '@/api/dealerScope'
 export default {
   name: 'MerchantInfoManagementSet',
   mixins: [commonMixin],
-  components: { STable, VSelect, ChooseTypeModal, productTypeAll, ProductBrand },
+  components: { STable, VSelect, ChooseTypeModal, productTypeAll, ProductBrand, editPriceLevelModal },
   data () {
     return {
       spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
-        goodsType: undefined,
-        goodsName: '',
-        goodsCode: '',
         productBrandSn: undefined, //  产品品牌
-        productType: [],
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        priceLevel: undefined
       },
+      productType: [],
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, //  表格加载中
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '品牌', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '一级分类', dataIndex: 'type', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '二级分类', dataIndex: 'goodsName', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '三级分类', dataIndex: 'product.name', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '价格级别', dataIndex: 'product.code', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '一级分类', dataIndex: 'productTypeName1', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '二级分类', dataIndex: 'productTypeName2', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '三级分类', dataIndex: 'productTypeName3', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -117,8 +118,6 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
-              const goodsType = data.list[i].goodsType
-              data.list[i].type = goodsType == 'PRODUCT' ? '产品' : goodsType == 'BRAND' ? '品牌' : goodsType == 'CATEGORY' ? '分类' : '--'
             }
             this.disabled = false
           }
@@ -126,92 +125,53 @@ export default {
           return data
         })
       },
-      openBrandModal: false, //  选择产品品牌
       openTypeModal: false, //  选择产品分类
-      openProductsModal: false, //  选择产品
-      chooseBrand: [], //  所选品牌
-      chooseProducts: [], //  所选产品
-      chooseType: [] //  所选分类
+      chooseType: [], //  所选分类
+      openPriceLevelModal: false,
+      itemSn: null,
+      itemPriceLevel: ''
     }
   },
   methods: {
-    // 查询
-    handleSearch () {
-      const _this = this
-      this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          _this.$refs.table.refresh(true)
-        } else {
-          return false
-        }
-      })
-    },
     // 选择品类
     chooseTModal () {
       this.openTypeModal = true
     },
-    handleEdit () {
-
-    },
-    //  产品分类  change
-    changeProductType (val, opt) {
-      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
-      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
-      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
-    },
-    // 分类
-    handleTypeOk (obj) {
-      this.chooseType = obj
-      this.changeData('CATEGORY')
-    },
-    changeData (type) {
-      const _this = this
-      if (type == 'PRODUCT') { //  选择产品
-        if (_this.chooseProducts.length > 0) {
-          const snList = []
-          _this.chooseProducts.map(item => {
-            const productSn = item.productSn ? item.productSn : item.product.productSn ? item.product.productSn : ''
-            snList.push(productSn)
-          })
-          this.setData(snList, type)
-        }
-      } else if (type == 'BRAND') { //  选择品牌
-        if (_this.chooseBrand.length > 0) {
-          const snList = []
-          _this.chooseBrand.map(item => {
-            snList.push(item.brandSn)
-          })
-          this.setData(snList, type)
-        }
-      } else if (type == 'CATEGORY') { //  选择分类
-        if (_this.chooseType.length > 0) {
-          const snList = []
-          _this.chooseType.map(item => {
-            snList.push(item.productTypeSn)
-          })
-          this.setData(snList, type)
-        }
-      }
+    // 编辑价格等级
+    handleEdit (row) {
+      this.itemSn = row.dealerScopeSn
+      this.itemPriceLevel = row.priceLevel
+      this.$nextTick(() => {
+        this.openPriceLevelModal = true
+      })
     },
-    // 添加经销权
-    setData (snList, type) {
+    handlePriceLevelOk (val) {
       const _this = this
-      const params = {
-        dealerSn: _this.$route.params.sn,
-        goodsType: type,
-        goodsSnList: snList
-      }
-      _this.spinning = true
-      dealerScopeSave(params).then(res => {
+      dealerScopeModifyPriceLevel({ dealerScopeSn: this.itemSn, priceLevel: val }).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.$refs.table.refresh(true)
+          _this.$refs.table.refresh()
           _this.spinning = false
         } else {
           _this.spinning = false
         }
       })
     },
+    closePriceLevelModal () {
+      this.itemPriceLevel = ''
+      this.itemSn = null
+      this.openPriceLevelModal = false
+    },
+    //  选择分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 选择品类完成
+    handleTypeOk (obj) {
+      this.$refs.table.refresh(true)
+    },
     // 删除
     handleDel (row) {
       const _this = this
@@ -221,7 +181,7 @@ export default {
         centered: true,
         onOk () {
           _this.spinning = true
-          dealerScopeDel({ sn: row.dealerScopeSn }).then(res => {
+          dealerScopeDelete({ dealerScopeSn: row.dealerScopeSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -235,20 +195,18 @@ export default {
     },
     // 重置表单
     resetSearchForm () {
-      this.queryParam.goodsType = undefined
-      this.queryParam.goodsName = ''
-      this.queryParam.goodsCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.priceLevel = undefined
+      this.productType.productType = []
       this.$refs.table.refresh(true)
     },
     // 返回
     handleBack () {
       this.$router.push({ path: '/dealerManagement/merchantInfoManagement/list', query: { closeLastOldTab: true } })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 122 - 0
src/views/dealerManagement/merchantInfoManagement/priceLevelModal.vue

@@ -0,0 +1,122 @@
+<template>
+  <a-modal
+    centered
+    class="chooseType-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="选择品类"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="500px">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <a-form-model
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="价格级别" prop="priceLevel">
+          <v-select
+            code="PRICE_LEVEL"
+            style="width: 50%;"
+            id="productPriceLevel-level"
+            v-model="form.priceLevel"
+            allowClear
+            placeholder="请选择价格级别"></v-select>
+
+        </a-form-model-item>
+        <div class="fontRed">注意:改价后,差价关系、返利关系也同步解除</div>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="chooseType-modal-back" @click="isShow = false" >取消</a-button>
+        <a-button type="primary" style="margin-left: 15px;" id="chooseType-modal-save" @click="handleSave">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+export default {
+  name: 'ChooseTypeModal',
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    priceLevelVal: { //  弹框显示状态
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        priceLevel: undefined // 价格级别
+      },
+      rules: {
+        priceLevel: [
+          { required: true, message: '请选择价格等级', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$emit('ok', this.form.priceLevel)
+          _this.isShow = false
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$refs.ruleForm.resetFields()
+        this.$emit('close')
+      } else {
+        this.form.priceLevel = this.priceLevelVal ? this.priceLevelVal : undefined
+        this.$nextTick(() => {
+          this.$refs.chooseTypeInfo.getTableData()
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseType-modal{
+    .fontRed{
+      margin:15px 0 0 16%;
+      color:#ed1c24;
+    }
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>