Przeglądaj źródła

易码通商城

chenrui 9 miesięcy temu
rodzic
commit
277638f685

BIN
public/templ/商城产品导入模板.xlsx


+ 74 - 36
src/config/router.config.js

@@ -3468,42 +3468,6 @@ export const asyncRouterMap = [
           permission: 'M_promotionRulesManagement'
         },
         children: [
-          {
-            path: '/promotionRulesManagement/shoppingManagement',
-            redirect: '/promotionRulesManagement/shoppingManagement/list',
-            name: 'shoppingManagement',
-            component: BlankLayout,
-            meta: {
-              title: '易码通商城',
-              icon: 'file-ppt'
-              // permission: 'M_shoppingManagementList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'shoppingManagementList',
-                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/shoppingManagement/list.vue'),
-                meta: {
-                  title: '易码通商城',
-                  icon: 'file-ppt',
-                  hidden: true
-                  // permission: 'M_shoppingManagementList'
-                }
-              },
-              {
-                path: 'chooseProduct',
-                name: 'chooseProductList',
-                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/shoppingManagement/chooseProduct.vue'),
-                meta: {
-                  title: '管辖产品设置',
-                  icon: 'file-ppt',
-                  hidden: true
-                  // permission: 'M_shoppingManagementList'
-                }
-              }
-            ]
-          },
           {
             path: '/promotionRulesManagement/promotionManagement',
             redirect: '/promotionRulesManagement/promotionManagement/list',
@@ -3599,6 +3563,80 @@ export const asyncRouterMap = [
           }
         ]
       },
+      // 易码通
+      {
+        path: '/easyPassManagement',
+        redirect: '/easyPassManagement/shoppingManagement',
+        component: PageView,
+        meta: {
+          title: '易码通',
+          icon: 'shop',
+          permission: 'M_bigScreenStatistics'
+        },
+        children: [
+          {
+            path: '/easyPassManagement/shoppingManagement',
+            redirect: '/easyPassManagement/shoppingManagement/list',
+            name: 'shoppingManagement',
+            component: BlankLayout,
+            meta: {
+              title: '易码通商城',
+              icon: 'file-ppt'
+              // permission: 'M_shoppingManagementList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'shoppingManagementList',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/shoppingManagement/list.vue'),
+                meta: {
+                  title: '易码通商城',
+                  icon: 'file-ppt',
+                  hidden: true
+                  // permission: 'M_shoppingManagementList'
+                }
+              },
+              {
+                path: 'chooseProduct',
+                name: 'chooseProductList',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/shoppingManagement/chooseProduct.vue'),
+                meta: {
+                  title: '管辖产品设置',
+                  icon: 'file-ppt',
+                  hidden: true
+                  // permission: 'M_shoppingManagementList'
+                }
+              }
+            ]
+          },
+          {
+            path: '/easyPassManagement/shoppingProducts',
+            redirect: '/easyPassManagement/shoppingProducts/list',
+            name: 'shoppingProducts',
+            component: BlankLayout,
+            meta: {
+              title: '商城产品',
+              icon: 'file-ppt'
+              // permission: 'M_shoppingProductsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'shoppingProductsList',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/shoppingProducts/list.vue'),
+                meta: {
+                  title: '商城产品列表',
+                  icon: 'file-ppt',
+                  hidden: true
+                  // permission: 'M_shoppingProductsList'
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 大屏数据
       {
         path: '/bigStatistics',

+ 0 - 0
src/views/promotionRulesManagement/shoppingManagement/addCategoryModal.vue → src/views/easyPassManagement/shoppingManagement/addCategoryModal.vue


+ 134 - 112
src/views/promotionRulesManagement/shoppingManagement/chooseProduct.vue → src/views/easyPassManagement/shoppingManagement/chooseProduct.vue

@@ -11,51 +11,72 @@
           <span style="margin: 0 15px;color: #666;font-weight: bold;">类目名称:{{ detailsData&&detailsData.sparePartsNo }}</span>
         </template>
       </a-page-header>
-      <a-card size="small" :bordered="false" class="chooseProductEdit-cont">
-        <div class="table-page-search-wrapper" style="display:flex;align-items: center;justify-content: space-between;">
-          <div style="flex-grow:1;">
-            <a-form layout="inline" id="chooseProductEdit-form-btn" @keyup.enter.native="$refs.table.refresh(true)">
-              <a-row :gutter="15">
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品编码"><a-input id="chooseProductEdit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="请输入产品编码" /></a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品名称"><a-input id="chooseProductEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="请输入产品名称" /></a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                  <a-button type="primary" id="chooseProductEdit-refresh" @click="$refs.table.refresh(true)">查询</a-button>
-                  <a-button style="margin-left: 5px" id="chooseProductEdit-reset" @click="resetSearchForm">重置</a-button>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
+      <a-card size="small" :bordered="false" class="chooseProductEdit-cont table-page-search-wrapper">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品名称">
+                  <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品编码/原厂编码">
+                  <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="品牌">
+                  <ProductBrand id="productPricingList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <ProductType id="productPricingList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品商城状态">
+                  <v-select code="ENABLE_FLAG" id="promotionRulesList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择产品商城状态"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
         </div>
-        <div class="showBtn">
-          <a-button id="chooseProductEdit-add" v-if="$hasPermissions('B_chooseProductEdit_add')" type="primary" class="button-warning" @click="handleAddEdit">新增产品</a-button>
-          <a-button id="chooseProductEdit-ex" v-if="$hasPermissions('B_chooseProductEdit_import')" class="button-warning" @click="handleImport">导入产品</a-button>
-          <a-button
-            id="chooseProductEdit-queryQty"
-            type="primary"
-            class="button-warning"
-            :loading="loading"
-            v-if="$hasPermissions('B_chooseProductEdit_thirdQty')"
-            @click="handleThirdQty">第三方库存</a-button>
-          <a-alert type="info">
-            <div slot="message" class="total-bar">
-              <span>采购数量:{{ statisticsObj && (statisticsObj.productTotalQty || statisticsObj.productTotalQty == 0) ? statisticsObj.productTotalQty : '--' }};</span>
-              <span v-if="$hasPermissions('M_chooseProductEdit_costPrice')">采购金额:{{ (statisticsObj && (statisticsObj.productTotalCost || statisticsObj.productTotalCost == 0) )? statisticsObj.productTotalCost : '--' }};</span>
-            </div>
-          </a-alert>
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button type="primary" @click="handleAddProduct">选择产品</a-button>
+          <span>
+            <a-button type="primary" class="button-info" @click="handleAdd">批量上架</a-button>
+            <a-button @click="handleAdd">批量下架</a-button>
+            <a-button type="primary" class="button-error" ghost @click="handleAdd">批量删除</a-button>
+            <span>已选1项</span>
+          </span>
         </div>
         <s-table
-          class="sTable"
+          class="sTable fixPagination"
           ref="table"
           size="small"
+          :style="{ height: tableHeight+65+'px' }"
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
+          :pageSize="30"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
+          :scroll="{ y: tableHeight-170 }"
           :defaultLoadData="false"
           bordered>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <span style="padding-right: 15px;">{{ record.productCode }}</span>
+            <a-badge count="热" :number-style="{ zoom:'80%' }"></a-badge>
+          </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <a-button
@@ -77,35 +98,21 @@
         </s-table>
       </a-card>
     </a-spin>
-    <div class="affix-cont">
-      <a-button
-        size="large"
-        style="padding: 0 60px;"
-        :disabled="spinning"
-        type="primary"
-        class="button-primary"
-        v-if="$hasPermissions('B_chooseProductEdit_submit')"
-        @click="handleSubmit"
-        id="chooseProductEdit-submit">提交</a-button>
-    </div>
-    <!-- 新增弹窗-->
-    <add-modal
+    <!-- 编辑弹窗-->
+    <editProductModal
       v-drag
       :itemSn="itemSn"
-      :openModal="openAddModal"
-      :nowData="detailsData"
+      :openModal="opeEditModal"
       @ok="resetTable"
-      @close="openAddModal=false" />
-    <!-- 导入弹窗 -->
-    <importGuideModal :openModal="openGuideModal" :params="{sparePartsSn: $route.query.sn}" @close="openGuideModal=false" @ok="hanldleImportOk" />
-    <!-- 编辑基础信息弹窗 -->
-    <basic-info-modal
-      v-drag
-      :openModal="openBasicInfoModal"
-      :itemData="itemObj"
-      :itemSn="sparePartsSn"
-      @ok="resetSearchForm"
-      @close="openBasicInfoModal = false" />
+      @close="opeEditModal=false" />
+    <!-- 添加产品 -->
+    <chooseProduct
+      ref="chooseProduct"
+      :chooseType="chooseTypeList"
+      :itemSn="$route.params.sn"
+      :openModal="showProModal"
+      @ok="addProductSuccess"
+      @close="closeProductModal"></chooseProduct>
   </div>
 </template>
 
@@ -115,14 +122,16 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 // import addModal from './addModal.vue'
 // import basicInfoModal from './basicInfoModal.vue'
-// import importGuideModal from './importGuideModal.vue'
+import chooseProduct from './chooseProductsModal.vue'
+import ProductType from '@/views/common/productType.js'
+import ProductBrand from '@/views/common/productBrand.js'
 // 接口
-import { purchaseDetailPageList, queryDetailCount, purchaseDetailDel, purchaseSubmit, purchaseImportBatchInsert, purchaseDetailPageCount } from '@/api/purchase'
+import { financeBookDetailQueryPage, queryDetailCount, purchaseDetailDel, purchaseSubmit, purchaseImportBatchInsert, purchaseDetailPageCount } from '@/api/financeBook'
 import { getThirdStockQty } from '@/api/salesNew'
 export default {
   name: 'ChooseProductEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect },
+  components: { STable, VSelect, ProductType, ProductBrand, chooseProduct },
   data () {
     return {
       spinning: false,
@@ -134,6 +143,8 @@ export default {
       detailsData: null, // 基础信息数据
       addMoreLoading: false, // 防止多次添加  加载状态
       loading: false, // 第三方库存按钮加载状态
+      opeEditModal: false, // 编辑弹窗
+      showProModal: false, // 选择产品弹窗
       // 查询参数
       productForm: {
         productCode: '', // 产品编码
@@ -143,12 +154,22 @@ export default {
       sparePartsSn: undefined, // 采购入库sn
       itemSn: undefined, // 列表行 sn
       itemObj: null, // 基础信息弹窗回显数据
+      queryParam: {
+        name: '',
+        queryWord: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      rowSelectionInfo: null,
+      tableHeight: 0, // 表格高度
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.productForm.sparePartsSn = this.sparePartsSn
         const parames = Object.assign(parameter, this.productForm)
         // 获取列表数据  有分页
-        return purchaseDetailPageList(parames).then(res => {
+        return financeBookDetailQueryPage(parames).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -173,27 +194,44 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
-        { title: '采购数量', dataIndex: 'productQty', align: 'center', width: '13%', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        { title: '第三方库存', dataIndex: 'thirdStockQty', align: 'center', width: '10%', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        // { title: '采购单价', dataIndex: 'productCost', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' }, },
-        // { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', scopedSlots: { customRender: 'productCode' } },
+        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'unit', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'unit', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', dataIndex: 'unit', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'productCost', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
+        { title: '售价类型', dataIndex: 'unit', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '终端价', dataIndex: 'productCost', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
+        { title: '车主价', dataIndex: 'productCost', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
+        { title: '优先级', dataIndex: 'unit', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '添加时间', dataIndex: 'unit', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '产品商城状态', dataIndex: 'unit', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('M_chooseProductEdit_costPrice')) {
-        arr.splice(6, 0, { title: '采购单价', dataIndex: 'productCost', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
-        if (this.detailsData && this.detailsData.supplierName) {
-          arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
-        } else {
-          arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || '--' } })
-        }
-      }
+      // if (this.$hasPermissions('M_chooseProductEdit_costPrice')) {
+      //   arr.splice(6, 0, { title: '采购单价', dataIndex: 'productCost', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+      //   if (this.detailsData && this.detailsData.supplierName) {
+      //     arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+      //   } else {
+      //     arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || '--' } })
+      //   }
+      // }
       return arr
+    },
+    // 计算选中数据条数
+    selectCount () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     }
   },
   methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 添加产品
+    handleAddProduct () {
+      this.showProModal = true
+    },
     // 新增产品成功 刷新基础信息时间,防止重复提交
     handleAddOk () {
       this.pageInit()
@@ -231,12 +269,12 @@ export default {
     },
     // 新增/编辑产品
     handleAddEdit (row) {
-      if (this.detailsData && !this.detailsData.supplierName) {
-        this.$message.warning('供应商不能为空,请先编辑基础信息!')
-        return
-      }
-      this.itemSn = (row && row.sparePartsDetailSn) ? row.sparePartsDetailSn : null
-      this.openAddModal = true
+      // if (this.detailsData && !this.detailsData.supplierName) {
+      //   this.$message.warning('供应商不能为空,请先编辑基础信息!')
+      //   return
+      // }
+      // this.itemSn = (row && row.sparePartsDetailSn) ? row.sparePartsDetailSn : null
+      this.openEditModal = true
     },
     // 导入产品
     handleImport () {
@@ -247,7 +285,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认删除吗?',
+        content: '确认删除产品吗?',
         centered: true,
         closable: true,
         onOk () {
@@ -271,7 +309,7 @@ export default {
     },
     // 刷新列表  更新操作时间
     resetTable () {
-      this.itemSn = undefined
+      this.opeEditModal = false
       this.$refs.table.refresh(true)
     },
     //  重置
@@ -296,8 +334,14 @@ export default {
       this.sparePartsSn = this.$route.query.sn
       this.$nextTick(() => {
         this.resetSearchForm()
+        this.setTableH()
       })
     },
+    // 计算表格高度
+    setTableH () {
+      const headHeight = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - headHeight - 280
+    },
     // 获取页面统计数据
     getStatisticsData (ajaxData) {
       purchaseDetailPageCount(ajaxData).then(res => {
@@ -343,36 +387,14 @@ export default {
 .chooseProductEdit-wrap {
   position: relative;
   height: 100%;
-  padding-bottom: 51px;
   box-sizing: border-box;
   > .ant-spin-nested-loading {
-    overflow-y: scroll;
     height: 100%;
   }
-  .showBtn{
-    display:flex;
-    align-items:center;
-    margin-bottom:10px;
-  }
   .chooseProductEdit-cont {
     margin-top: 6px;
-    .ant-divider-horizontal {
-      margin: 10px 0 24px;
-    }
-    .total-bar {
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-      > div {
-        &:last-child {
-          display: flex;
-          align-items: center;
-          justify-content: space-between;
-          > div {
-            padding: 0 10px;
-          }
-        }
-      }
+    .table-operator{
+      margin-bottom:6px;
     }
   }
 }

+ 304 - 0
src/views/easyPassManagement/shoppingManagement/chooseProductsModal.vue

@@ -0,0 +1,304 @@
+<template>
+  <a-drawer
+    :zIndex="zIndex"
+    title="选择产品"
+    placement="right"
+    :visible="isShow"
+    width="80%"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    :headerStyle="{ padding: '10px' }"
+    @close="onClose"
+    wrapClassName="chooseProducts-modal">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="products-con">
+        <!-- 搜索条件 -->
+        <div class="table-page-search-wrapper">
+          <a-form-model
+            ref="ruleForm"
+            class="form-model-con"
+            layout="inline"
+            :model="queryParam"
+            id="chooseProducts-form"
+            :label-col="formItemLayout.labelCol"
+            :wrapper-col="formItemLayout.wrapperCol">
+            <a-row :gutter="15">
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input id="chooseProducts-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="原厂编码">
+                  <a-input id="chooseProducts-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="chooseProducts-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType" id="chooseProducts-productType"></productTypeAll>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="chooseProducts-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetData" :disabled="disabled" id="chooseProducts-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form-model>
+        </div>
+        <div style="margin-bottom: 10px">
+          <a-button type="primary" ghost id="chooseProducts-add-btn" :loading="loading" @click="handleSave">批量添加</a-button>
+          <span style="margin-left: 5px">
+            <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
+          </span>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.productSn"
+          rowKeyName="productSn"
+          :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.terminalPrice } })}"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :pagination="{pageSizeOptions: ['20','50','100','200','500']}"
+          :data="loadData"
+          :defaultLoadData="false"
+          style="max-height:700px;"
+          :scroll="{ y: 550 }"
+          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="productQty" slot-scope="text, record">
+            <span v-if="record.packQty">
+              {{ record.packQty }}{{ record.unit }}/{{ record.packQtyUnit?record.packQtyUnit:'--' }}
+            </span>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-drawer>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable } from '@/components'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
+// 接口
+import { queryWaitingProductPage } from '@/api/promoActive'
+export default {
+  name: 'ChooseProductsModal',
+  components: { STable, ProductBrand, productTypeAll },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    chooseData: {// 隐藏选择的产品
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    chooseType: {// 选中的分类
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    chooseProduct: {// 当前行选中的数据
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    itemSn: {// 活动sn
+      type: String,
+      default: ''
+    },
+    zIndex: { // 层级
+      type: [String, Number],
+      default: 1000
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // form 表单中label布局
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 20 }
+      },
+      //  查询条件
+      queryParam: {
+        productName: '', // 产品名称
+        productCode: '', //  产品编码
+        origCode: '', // 原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productType: [], // 产品分类
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        hideProductSnList: [], // 已选中产品数据
+        productTypeSnList: []// 已选中分类数据
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
+      columns: [// 表头
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '产品编码', dataIndex: 'code', align: 'center', width: '12%' },
+        { title: '产品名称', dataIndex: 'name', align: 'left', width: '18%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '特约价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '品牌', dataIndex: 'productBrandName', align: 'center', width: '8%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '包装数', scopedSlots: { customRender: 'productQty' }, width: '6%', align: 'center' },
+        { title: '单位', dataIndex: 'unit', align: 'center', width: '6%', ellipsis: true, customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        params.hideProductSnList = this.chooseData
+        params.productTypeSnList = this.chooseType
+        params.promoActiveSn = this.itemSn
+        return queryWaitingProductPage(params).then(res => {
+          let data
+          if (res.status == 200) {
+            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
+            const _this = this
+            // 选中回显
+            if (_this.chooseProduct && _this.chooseProduct.length > 0) {
+              const selectedRows = []
+              let selectedRowKeys = []
+              data.list.forEach(item => {
+                const flag = _this.chooseProduct.includes(item.productSn)
+                if (flag) {
+                  selectedRows.push(item)
+                }
+              })
+              selectedRowKeys = _this.chooseProduct
+              _this.$nextTick(() => { // 页面渲染完成后的回调
+                _this.$refs.table.setTableSelected(selectedRowKeys, selectedRows) // 设置表格选中项
+              })
+            }
+          }
+          _this.spinning = false
+          return data
+        })
+      },
+      rowSelectionInfo: null// 选中数据
+    }
+  },
+  computed: {
+    // 计算选中产品条数
+    selectCount () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 重置数据
+    resetData () {
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.origCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.productType = []
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    },
+    //  清空选项
+    resetSearchForm () {
+      this.$refs.table.clearSelected()
+    },
+    // 批量添加
+    handleSave () {
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        this.$message.warning('请在列表勾选后再进行操作!')
+        return
+      }
+      const resultList = JSON.parse(JSON.stringify(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows))
+      this.$emit('ok', resultList)
+      this.isShow = false
+    },
+    // 关闭弹框
+    onClose () {
+      this.isShow = false
+      this.$emit('close')
+    },
+    //  产品分类  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] : ''
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.resetSearchForm()
+        this.rowSelectionInfo = null
+        this.$emit('close')
+      } else {
+        const _this = this
+        _this.resetData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseProducts-modal{
+    .products-con{
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 169 - 0
src/views/easyPassManagement/shoppingManagement/editProductModal.vue

@@ -0,0 +1,169 @@
+<template>
+  <a-modal
+    centered
+    class="promotionRules-rule-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="编辑"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="700">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="promotionRules-rule-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="售价类型" prop="logo">
+          <v-select
+            v-model="queryParam.printStatus"
+            code="PRINT_STATUS"
+            placeholder="请选择售价类型"
+            allowClear
+          ></v-select>
+        </a-form-model-item>
+        <a-form-model-item label="售价" prop="name">
+          <a-input-number :min="0" :max="999999999" :precision="2" :step="0.1" placeholder="请输入产品售价" />
+        </a-form-model-item>
+        <a-form-model-item label="热销产品" prop="tip">
+          <v-select
+            v-model="queryParam.printStatus"
+            code="FlAG"
+            placeholder="请选择是否是热销产品"
+            allowClear
+          ></v-select>
+        </a-form-model-item>
+        <a-form-model-item label="热销产品优先级" prop="tip">
+          <a-input-number :min="0" :max="999999999" :precision="0" :step="1" placeholder="请输入正整数,数字越大优先级越低" />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="promotionRules-rule-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+        <a-button type="primary" id="promotionRules-rule-modal-save" @click="handleSave">保存</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import { promoRuleSave } from '@/api/promoRule'
+export default {
+  name: 'AddCategoryModal',
+  mixins: [commonMixin],
+  components: { VSelect },
+  props: {
+    openModal: {//  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: String || Number,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 3 },
+        wrapperCol: { span: 20 }
+      },
+      spinning: false,
+      form: {
+        name: '', //  促销类型
+        tip: '', //  正价品数量
+        logo: undefined //  促销品数量
+      },
+      rules: {
+        name: [{ required: true, message: '请选择促销类型', trigger: 'change' }],
+        tip: [{ required: true, message: '请输入正价品数量', trigger: 'blur' }],
+        logo: [{ required: true, message: '请输入促销品数量', trigger: 'blur' }]
+      }
+    }
+  },
+  methods: {
+    //  图片上传
+    changeImage (file) {
+      this.form.imageSet = file
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      //  处理表单校验
+      _this.form.normalGoodsList = this.normalGoodsList.length > 0 ? 'a' : ''
+      _this.form.promoGoodsList = this.promoGoodsList.length > 0 ? 'a' : ''
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.normalGoodsList = this.normalGoodsList
+          form.promoGoodsList = this.promoGoodsList
+          form.promoActiveSn = this.$route.params.sn
+          if (form.promoRuleType == 'BUY_PROD_GIVE_MONEY' && form.promoType == 'promo_amount_per') { //  买产品送采购额  百分比
+            form.promoAmountPer = Number(form.promoAmountPer) / 100
+            form.orderAmounts = ''
+            form.promoAmount = ''
+          } else if (form.promoRuleType == 'BUY_PROD_GIVE_MONEY' && form.promoType == 'promo_amount') { //  买产品送采购额  金额
+            form.orderAmount = form.orderAmounts
+            form.promoAmountPer = ''
+          }
+          if (!_this.itemSn) { delete form.id }
+          _this.spinning = true
+          promoRuleSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.$emit('ok')
+                _this.isShow = false
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        // this.$refs.ruleForm.resetFields()
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.promotionRules-rule-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+  .ant-radio + span{
+    line-height: 40px;
+  }
+}
+</style>

+ 2 - 2
src/views/promotionRulesManagement/shoppingManagement/list.vue → src/views/easyPassManagement/shoppingManagement/list.vue

@@ -53,7 +53,7 @@
             type="link"
             class="button-success"
             v-else
-            @click="handleView(record)"
+            @click="handleAddProduct(record)"
             :id="'marketingDivisionSetNew-edit-btn'+record.id">添加产品</a-button>
           <a-button
             size="small"
@@ -209,7 +209,7 @@ export default {
     },
     // 查看经销商
     handleAddProduct (row) {
-      this.$router.push({ name: 'expenseReimbursementListDetail' })
+      this.$router.push({ name: 'chooseProductList' })
     },
     // 初始化
     pageInit () {

+ 191 - 0
src/views/easyPassManagement/shoppingProducts/chooseImportModal.vue

@@ -0,0 +1,191 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { hdExportExcel } from '@/libs/exportExcel'
+import { sparePartsDetailParseProducts, sparePartsDetailFailExcel } from '@/api/spareParts'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品类目', dataIndex: 'code', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
+        { title: '产品编码', dataIndex: 'name', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品类目', dataIndex: 'code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '备注', dataIndex: 'errorMsg', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      const params = {
+        sparePartsSn: this.paramsData.sparePartsSn,
+        path: this.paramsData.path
+      }
+      sparePartsDetailParseProducts(params).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          if (res.data.okList && res.data.okList.length > 0) {
+            res.data.okList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.okList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.$emit('ok', this.loadData)
+        this.isShow = false
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      const params = {
+        list: _this.unLoadData
+      }
+      hdExportExcel(sparePartsDetailFailExcel, params, '产品导入错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 192 - 0
src/views/easyPassManagement/shoppingProducts/importGuideModal.vue

@@ -0,0 +1,192 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) “产品编码”必须是系统中已上线的产品</li>
+            <li>2) 产品类目必须是系统中已存在的最小类目</li>
+            <li>3) 售价非必填,若填写,产品售价为导入的售价,售价类型为自定义,若不填写,产品售价为终端价</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      },
+      exportLoading: false,
+      filePath: location.protocol + '//' + location.host + '/templ/商城产品导入模板.xlsx'
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          sparePartsSn: this.params.sparePartsSn || '',
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 209 - 0
src/views/easyPassManagement/shoppingProducts/list.vue

@@ -0,0 +1,209 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="rebateSettingsList-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码/原厂编码">
+                <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="品牌">
+                <ProductBrand id="productPricingList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <ProductType id="productPricingList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品商城状态">
+                <v-select code="ENABLE_FLAG" id="promotionRulesList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择产品商城状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button type="primary" @click="handleAddProduct">产品导入</a-button>
+        <span>
+          <a-button type="primary" class="button-info" @click="handleAdd">批量上架</a-button>
+          <a-button @click="handleAdd">批量下架</a-button>
+          <a-button type="primary" class="button-error" ghost @click="handleAdd">批量删除</a-button>
+          <span>已选1项</span>
+        </span>
+      </div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :data="loadData"
+          :pageSize="20"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <span style="padding-right: 15px;">{{ record.productCode }}</span>
+            <a-badge count="热" :number-style="{ zoom:'80%' }"></a-badge>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="$hasPermissions('B_chooseProductEdit_edit')"
+              @click="handleAddEdit(record)"
+              class="button-info"
+              :id="'chooseProductEdit-edit-btn'+record.id">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              :loading="delLoading"
+              class="button-error"
+              v-if="$hasPermissions('B_chooseProductEdit_del')"
+              @click="handleDel(record)"
+              :id="'chooseProductEdit-del-btn'+record.id">删除</a-button>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeOk" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import importGuideModal from './importGuideModal.vue'
+import productType from '@/views/common/productType.js'
+import productBrand from '@/views/common/productBrand.js'
+import { queryRebatePage } from '@/api/dealerRelation'
+export default {
+  name: 'RebateSettingsList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, importGuideModal, productType, productBrand },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      queryParam: {
+        dealerName: '',
+        supDealerName: '',
+        rebateDealerName: ''
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '经销商名称', width: '15%', scopedSlots: { customRender: 'jxs' }, align: 'left', ellipsis: true },
+        { title: '经销商级别', scopedSlots: { customRender: 'dealerLevel' }, align: 'left', width: '15%' },
+        { title: '指定差价归属经销商', scopedSlots: { customRender: 'cjgs' }, align: 'left', width: '15%' },
+        { title: '指定归属经销商级别', scopedSlots: { customRender: 'gsjxsjb' }, align: 'left', width: '15%' },
+        { title: '上级经销商', scopedSlots: { customRender: 'sjcjgs' }, align: 'left', width: '15%' },
+        { title: '上级经销商级别', scopedSlots: { customRender: 'sjgsjxsjb' }, align: 'left', width: '15%' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return queryRebatePage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      defaultExpandedRowKeys: [], //  树形数据默认展开项
+      openModal: false, //  新增编辑  弹框
+      nowData: null //  当前记录数据
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.dealerName = ''
+      this.queryParam.supDealerName = ''
+      this.queryParam.rebateDealerName = ''
+      this.$refs.table.refresh(true)
+    },
+    // 编辑
+    handleEdit (row) {
+      this.nowData = row
+      this.openModal = true
+    },
+    //  关闭弹框
+    closeModal () {
+      this.nowData = null
+      this.openModal = false
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 200
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  }
+}
+</script>