瀏覽代碼

对接库存预警

chenrui 4 年之前
父節點
當前提交
49af8b4f0a
共有 2 個文件被更改,包括 226 次插入264 次删除
  1. 21 0
      src/api/stockWarn.js
  2. 205 264
      src/views/inventoryManagement/inventoryWarning/list.vue

+ 21 - 0
src/api/stockWarn.js

@@ -0,0 +1,21 @@
+import { axios } from '@/utils/request'
+
+//  库存预警 列表  分页
+export const stockWarnList = (params) => {
+  const url = `/stockWarn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存预警 保存
+export const stockWarnSaveBatch = (params) => {
+  return axios({
+    url: '/stockWarn/saveBatch',
+    data: params,
+    method: 'post'
+  })
+}

+ 205 - 264
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -2,46 +2,67 @@
   <a-card size="small" :bordered="false" class="inventoryWarningList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" @keyup.enter.native="pageInit(1)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品编码">
-              <a-input id="inventoryWarningList-orderBundleNo" v-model.trim="queryParam.orderBundleNo" allowClear placeholder="请输入产品编码"/>
+              <a-input id="inventoryWarningList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="原厂编码">
-              <a-input id="inventoryWarningList-custMobile" v-model.trim="queryParam.orderBundle.custMobile" allowClear placeholder="请输入原厂编码"/>
+              <a-input id="inventoryWarningList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="inventoryWarningList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="inventoryWarningList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
-                <a-select id="inventoryWarningList-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
+                <a-select
+                  placeholder="请选择产品品牌"
+                  id="inventoryWarningList-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>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品类别">
-                <a-cascader :options="typeData" expand-trigger="hover" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
+              <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="inventoryWarningList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="预警提示">
-                <a-select id="inventoryWarningList-bundleNames" placeholder="请选择预警提示" allowClear v-model="queryParam.brand">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
-                </a-select>
+                <v-select
+                  v-model="queryParam.warnTip"
+                  ref="warnTip"
+                  id="inventoryWarningList-warnTip"
+                  code="STOCK_WARN_TIP"
+                  placeholder="请选择预警提示"
+                  allowClear
+                ></v-select>
               </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
+            <a-button type="primary" @click="pageInit(1)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
             <a-button
               style="margin-left: 8px"
@@ -67,83 +88,60 @@
       class="sTable"
       ref="table"
       size="default"
-      :rowKey="record => record.id"
+      :rowKey="(record) => record.id"
       :columns="columns"
       :dataSource="loadData"
+      :scroll="{ x: 2070, y: tableHeight }"
       :pagination="paginationProps"
-      :loading="loadingPage"
-      :scroll="{ x: 1940 }"
       bordered>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+        <span v-else>--</span>
+      </template>
       <!-- 预警提示 -->
-      <template slot="warningTips" slot-scope="text, record">
-        <!-- 库存溢满:总库存数>最大库存数 -->
-        <span v-if="record.inventoryTotal > record.maxInventory" class="yellow">库存溢满</span>
-        <!-- 库存不足:总库存数<最小库存数 -->
-        <span v-if="record.inventoryTotal < record.minInventory" class="red">库存不足</span>
-        <!-- 库存缺货:当前库存数为0 -->
-        <span v-if="record.inventoryRealTime < 1" class="blue">库存缺货</span>
-        <!-- 库存正常:最小库存数≤总库存数≤最大库存数 -->
-        <span v-if="record.minInventory <= record.inventoryTotal <= record.maxInventory" class="green">库存正常</span>
+      <template slot="warnTip" slot-scope="text, record">
+        <span :class="[record.warnTip=='OVERFLOW'?'yellow':record.warnTip=='NOT_ENOUGH'?'red':record.warnTip=='LACK'?'blue':record.warnTip=='NORMAL'?'green':'']">{{ record.warnTipDictValue }}</span>
       </template>
-      <!-- 需要编辑的字段 -->
       <!-- 在途数 -->
-      <template slot="onWayNum" slot-scope="text, record" >
+      <template slot="inTransit" slot-scope="text, record" >
         <div>
           <a-input-number
-            v-if="record.editable"
-            id="inventoryWarningList-onWayNum"
-            :value="record.onWayNum"
+            id="inventoryWarningList-inTransit"
+            v-model="record.inTransit"
             :precision="0"
             :min="0"
-            :max="record.inventoryTotal-record.inventoryRealTime"
-            placeholder="请输入在途数"
-            @change="e => handleChange(e, record.id, 'onWayNum')" />
-          <template v-else> {{ record.onWayNum }} </template>
+            :max="999999"
+            placeholder="请输入在途数" />
         </div>
       </template>
       <!-- 最大库存数 -->
-      <template slot="maxInventory" slot-scope="text, record" >
+      <template slot="upperLimit" slot-scope="text, record" >
         <div>
           <a-input-number
-            v-if="record.editable"
-            id="inventoryWarningList-maxInventory"
-            :value="record.maxInventory"
+            id="inventoryWarningList-upperLimit"
+            v-model="record.upperLimit"
             :precision="0"
             :min="0"
             :max="999999"
-            placeholder="请输入最大库存数"
-            @change="e => handleChange(e, record.id, 'maxInventory')" />
-          <template v-else> {{ record.maxInventory }} </template>
+            placeholder="请输入最大库存数" />
         </div>
       </template>
       <!-- 最小库存数 -->
-      <template slot="minInventory" slot-scope="text, record" >
+      <template slot="lowerLimit" slot-scope="text, record" >
         <div>
           <a-input-number
-            v-if="record.editable"
-            id="inventoryWarningList-minInventory"
-            :value="record.minInventory"
+            id="inventoryWarningList-lowerLimit"
+            v-model="record.lowerLimit"
             :precision="0"
             :min="0"
             :max="999999"
-            placeholder="请输入最小库存数"
-            @change="e => handleChange(e, record.id, 'minInventory')" />
-          <template v-else> {{ record.minInventory }} </template>
+            placeholder="请输入最小库存数" />
         </div>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <div class="editable-row-operations">
-          <span v-if="record.editable">
-            <a-button size="small" type="primary" @click="() => save(record.id, record.onWayNum, record.maxInventory, record.minInventory)" style="margin-right: 10px;">保存</a-button>
-            <a-popconfirm title="确定要取消吗" @confirm="() => cancel(record.id)">
-              <a-button size="small">取消</a-button>
-            </a-popconfirm>
-          </span>
-          <span v-else>
-            <a-button size="small" type="link" :disabled="editingId !== ''" @click="() => edit(record.id)">编辑</a-button type="primary">
-          </span>
-        </div>
+        <a-button type="primary" class="button-primary" @click="handleSave(record)" id="inventoryWarningList-add-btn">保存</a-button>
       </template>
     </a-table>
   </a-card>
@@ -151,121 +149,48 @@
 
 <script>
 import moment from 'moment'
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
-import { STable } from '@/components'
+import { STable, VSelect } from '@/components'
+import { stockWarnList, stockWarnSaveBatch } from '@/api/stockWarn'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { dealerProductTypeList } from '@/api/dealerProductType'
 export default {
-  components: { STable },
+  components: { STable, VSelect },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
-        orderBundleNo: '', //  订单编号
-        orderBundle: {
-          custMobile: '' //  客户手机
-        },
-        bundleName: '', //  套餐名称
-        itemName: '', //  服务名称
-        brand: undefined, //  产品品牌
-        inventoryNum: false //  库存数量是否为0
+        productCode: '',
+        productName: '',
+        productOrigCode: '', // 原厂编码
+        productBrandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined,
+        warnTip: undefined
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌下拉数据
-      typeData: [], //  产品类别下拉数据
+      productBrandList: [], //  产品品牌下拉数据
+      productTypeList: [], //  产品类别下拉数据
+      productType: [],
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '级别', dataIndex: 'productNasme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOldNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrand', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', dataIndex: 'productType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '实时库存数(个)', dataIndex: 'inventoryRealTime', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '在途数(个)', scopedSlots: { customRender: 'onWayNum' }, width: 130, align: 'center' },
-        { title: '总库存数(个)', dataIndex: 'inventoryTotal', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '最大库存数(个)', scopedSlots: { customRender: 'maxInventory' }, width: 130, align: 'center' },
-        { title: '最小库存数(个)', scopedSlots: { customRender: 'minInventory' }, width: 130, align: 'center' },
-        { title: '差异数量', dataIndex: 'variabilityMeasures', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '预警提示', scopedSlots: { customRender: 'warningTips' }, width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
+        { title: '实时库存数(个)', dataIndex: 'currentStockQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 130, align: 'center' },
+        { title: '总库存数(个)', dataIndex: 'totalStockQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 130, align: 'center' },
+        { title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 130, align: 'center' },
+        { title: '差异数量', dataIndex: 'differenceNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '预警提示', scopedSlots: { customRender: 'warnTip' }, width: 100, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      // loadData: parameter => {
-      //   this.disabled = true
-      //   // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-      //   //   const data = res.data
-      //   //   const no = (data.pageNo - 1) * data.pageSize
-      //   //   for (var i = 0; i < data.list.length; i++) {
-      //   //     data.list[i].no = no + i + 1
-      //   //   }
-      //   //   this.disabled = false
-      //   //   return data
-      //   // })
-      //   const _this = this
-      //   return new Promise(function(resolve, reject){
-      //     const data = {
-      //       pageNo: 1,
-      //       pageSize: 10,
-      //       list: [
-      //         {
-      //           key: '1',
-      //           id: '1',
-      //           productNum: 'jgqp11111111111',
-      //           productName: '产品1',
-      //           productOldNum: 'jgqp111123545',
-      //           productBrand: '箭冠品牌',
-      //           productType: '产品分类1',
-      //           inventoryRealTime: 0,
-      //           inventoryMoney: '122',
-      //           onWayNum: 2,
-      //           inventoryTotal: 5,
-      //           maxInventory: 7,
-      //           minInventory: 1,
-      //           variabilityMeasures: 2
-      //         }
-      //       ]
-      //     }
-      //     const no = (data.pageNo - 1) * data.pageSize
-      //     for (var i = 0; i < data.list.length; i++) {
-      //       data.list[i].no = no + i + 1
-      //     }
-      //     _this.disabled = false
-      //     resolve(data)
-      //   })
-      // },
-      loadData: [
-        {
-          id: 1,
-          productNum: 'jgqp11111111111',
-          productName: '产品1',
-          productOldNum: 'jgqp111123545',
-          productBrand: '箭冠品牌',
-          productType: '产品分类1',
-          inventoryRealTime: 2,
-          inventoryMoney: '122',
-          onWayNum: 2,
-          inventoryTotal: 5,
-          maxInventory: 7,
-          minInventory: 1,
-          variabilityMeasures: 2
-        },
-        {
-          id: 2,
-          productNum: 'jgqp11111111111',
-          productName: '产品1',
-          productOldNum: 'jgqp111123545',
-          productBrand: '箭冠品牌',
-          productType: '产品分类1',
-          inventoryRealTime: 2,
-          inventoryMoney: '122',
-          onWayNum: 2,
-          inventoryTotal: 5,
-          maxInventory: 7,
-          minInventory: 1,
-          variabilityMeasures: 2
-        }
-      ], //  列表数据
-      loadingPage: false, //  加载中
+      loadData: [],
       pageNo: 1, //  分页页码
       pageSize: 10, //  分页 每页多少条
       paginationProps: {
@@ -274,64 +199,104 @@ export default {
         current: 1,
         onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
         onChange: (current) => this.changePage(current)
-      },
-      openModal: false, //  查看库存详情  弹框
-      itemId: '', //  当前库存记录id
-      editingId: ''
+      }
     }
   },
   methods: {
     //  分页  一页多少条change
     changePageSize (current, pageSize) {
-      this.editingId = ''
       this.pageNo = current
       this.pageSize = pageSize
       this.pageInit()
     },
     //  分页 页码change
     changePage (current) {
-      this.editingId = ''
       this.pageNo = current
       this.pageInit()
     },
     //  列表数据
-    pageInit (pageNo, pageSize) {
+    pageInit (pageNo) {
+      if (this.tableHeight == 0) {
+        this.tableHeight = window.innerHeight - 380
+      }
+      this.disabled = true
       this.pageNo = pageNo || this.pageNo
-      this.pageSize = pageSize || this.pageSize
-      this.editingId = ''
-      // const params = {
-      //   storeId: this.searchForm.storeId,
-      //   itemId: this.searchForm.itemId,
-      //   itemType: this.searchForm.itemType,
-      //   pageNo: this.pageNo,
-      //   pageSize: this.pageSize
-      // }
-      this.loadingPage = true
-      // storeItemPriceList(params).then(res => {
-      //   if (res.status == 200) {
-      //     const data = res.data
-      //     this.paginationProps.total = res.data.count || 0
-      //     this.paginationProps.current = this.pageNo
-      //     const no = (data.pageNo - 1) * data.pageSize
-      //     for (var i = 0; i < data.list.length; i++) {
-      //       data.list[i].no = no + i + 1
-      //       data.list[i].editable = false
-      //     }
-      //     this.loadData = data.list
-      //   } else {
-      //     this.loadData = []
-      //   }
-      //   this.loadingPage = false
-      // })
+      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      stockWarnList(params).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = this.pageNo
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.loadData = data.list
+          this.disabled = false
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.loadData = []
+        }
+      })
+    },
+    //  保存
+    handleSave (row, isBatch) {
+      const params = []
+      if (isBatch) { //  批量更新
+        let dataInd = -1
+        this.loadData.map((item, index) => {
+          if ((!item.inTransit && item.inTransit != 0) || (!item.upperLimit && item.upperLimit != 0) || (!item.lowerLimit && item.lowerLimit != 0)) {
+            dataInd = item.no
+          }
+          params.push({
+            id: item.id,
+            inTransit: item.inTransit,
+            upperLimit: item.upperLimit,
+            lowerLimit: item.lowerLimit
+          })
+        })
+        if (dataInd != -1) {
+          this.$message.warning('请完善第' + dataInd + '行数据后再提交')
+          return
+        }
+      } else { //  单个保存
+        if (!row.inTransit && row.inTransit != 0) {
+          this.$message.warning('请输入在途数')
+          return
+        }
+        if (!row.upperLimit && row.upperLimit != 0) {
+          this.$message.warning('请输入最大库存数')
+          return
+        }
+        if (!row.lowerLimit && row.lowerLimit != 0) {
+          this.$message.warning('请输入最小库存数')
+          return
+        }
+        params.push({
+          id: row.id,
+          inTransit: row.inTransit,
+          upperLimit: row.upperLimit,
+          lowerLimit: row.lowerLimit
+        })
+      }
+      stockWarnSaveBatch(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.pageInit()
+        }
+      })
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.queryParam.warnTip = undefined
       this.pageInit(1)
     },
     //  批量更新
@@ -342,81 +307,50 @@ export default {
         content: '确定提交批量更新的内容吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          _this.handleSave('', 'batch')
         }
       })
     },
-    //  change
-    handleChange (value, id, column) {
-      const newData = [...this.loadData]
-      const target = newData.filter(item => id === item.id)[0]
-      if (target) {
-        target[column] = value
-        this.loadData = newData
-      }
+    //  产品分类  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] : ''
     },
-    //  编辑
-    edit (id) {
-      const newData = [...this.loadData]
-      const target = newData.filter(item => id === item.id)[0]
-      this.editingId = id
-      if (target) {
-        target.editable = true
-        this.loadData = newData
-      }
+    //  产品品牌  列表
+    getProductBrand () {
+      // sysFlag不传,此处应查询所有产品
+      dealerProductBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
     },
-    //  保存
-    save (id, onWayNum, maxInventory, minInventory) {
-      //  更改后的值是否为空
-      if (!onWayNum) {
-        this.$message.warning('在途数不能为空')
-        return
-      }
-      if (!maxInventory) {
-        this.$message.warning('最大库存数不能为空')
-        return
-      }
-      if (!minInventory) {
-        this.$message.warning('最小库存数不能为空')
-        return
-      }
-      // saveStoreItemPrice({
-      //   id: id,
-      //   accountPrice: accountPrice
-      // }).then(res => {
-      //   if (res.status == 200) {
-      this.editingId = ''
-      this.pageInit()
-      //   } else {
-      //     this.$message.warning(res.message)
-      //   }
-      // })
+    //  产品分类  列表
+    getProductType () {
+      dealerProductTypeList({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
     },
-    //  取消
-    cancel (id) {
-      const newData = [...this.loadData]
-      const target = newData.filter(item => id === item.id)[0]
-      this.editingId = ''
-      if (target) {
-        this.pageInit()
-      }
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     },
     //  导出
     handleExport () {
       const params = this.queryParam
       this.exportLoading = true
-      customerBundleExportDelay(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
+      // customerBundleExportDelay(params).then(res => {
+      //   this.exportLoading = false
+      //   this.download(res)
+      // })
     },
     //  下载
     download (data) {
@@ -431,6 +365,13 @@ export default {
       document.body.appendChild(link)
       link.click()
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.pageInit(1)
+      vm.getProductType()
+      vm.getProductBrand()
+    })
   }
 }
 </script>