chenrui пре 9 месеци
родитељ
комит
fb8ed626f8

+ 70 - 0
src/api/shopCategory.js

@@ -0,0 +1,70 @@
+import { axios } from '@/utils/request'
+
+//  易码通商城列表  无分页
+export const shopCategoryList = (params) => {
+  const url = '/shopCategory/queryList'
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+// 易码通商城新增类目
+export const saveShopCategory = (params) => {
+  return axios({
+    url: '/shopCategory/saveShopCategory',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('新增类目')
+    }
+  })
+}
+
+// 易码通商城目录 删除 sn=categorySn
+export const shopCategoryDel = params => {
+  return axios({
+    url: `/shopCategory/delete/${params.categorySn}`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('删除')
+    }
+  })
+}
+
+// 易码通商城目录 获取子级目录列表  无分页
+export const getChildList = params => {
+  return axios({
+    url: `/shopCategory/queryExtBySn/${params.categorySn}`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('获取子级目录列表')
+    }
+  })
+}
+
+// 易码通商城目录 详情
+export const shopCategoryDetail = params => {
+  return axios({
+    url: `/shopCategory/queryBySn/${params.categorySn}`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('详情')
+    }
+  })
+}
+
+// 易码通商城目录 修改状态
+export const shopCategoryUpdateStatus = (params) => {
+  return axios({
+    url: 'shopCategory/updateStatus',
+    data: params,
+    method: 'post'
+  })
+}

+ 110 - 0
src/api/shopProduct.js

@@ -0,0 +1,110 @@
+import { axios } from '@/utils/request'
+
+//  商城产品列表  有分页
+export const shopProductList = (params) => {
+  const url = `/shopProduct/queryProductPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 商城产品列表 删除
+export const shopProductDel = params => {
+  return axios({
+    url: '/shopProduct/delete',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('删除')
+    }
+  })
+}
+// 商城产品 导出模板
+export const shopProductDownloadExcel = params => {
+  return axios.request({
+    url: '/shopProduct/downloadExcel',
+    method: 'post',
+    data: params,
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('下载导入模板')
+    }
+  })
+}
+
+// 商城产品 导入解析
+export const shopProductParseExcel = (params) => {
+  return axios({
+    url: '/shopProduct/parseExcel',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 商城产品  导出错误项
+export const shopProductExport = params => {
+  return axios.request({
+    url: '/shopProduct/exportError',
+    method: 'post',
+    data: params,
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出错误项')
+    }
+  })
+}
+
+// 商城产品 详情
+export const shopProductDetail = params => {
+  return axios({
+    url: `/shopProduct/queryBySn/${params.shopProductSn}`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('详情')
+    }
+  })
+}
+
+// 商城产品 批量保存
+export const saveBatchProduct = params => {
+  return axios({
+    url: '/shopProduct/saveBatchProduct',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('批量保存')
+    }
+  })
+}
+
+// 商城产品  产品保存
+export const shopProductSaveProduct = params => {
+  return axios({
+    url: '/shopProduct/saveProduct',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('保存')
+    }
+  })
+}
+
+// 商城产品  更新上架、下架状态
+export const shopProductUpdateStatus = params => {
+  return axios({
+    url: '/shopProduct/updateStatus',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('更新状态')
+    }
+  })
+}

+ 60 - 50
src/views/easyPassManagement/shoppingManagement/addCategoryModal.vue

@@ -4,7 +4,7 @@
     class="add-category-modal"
     :footer="null"
     :maskClosable="false"
-    :title="itemSn ? '编辑类目':'新增类目'"
+    :title="pageType==='add'?'新增类目':pageType==='addChild'?'新增子类目':'编辑'"
     v-model="isShow"
     @cancel="isShow = false"
     :width="700">
@@ -17,37 +17,38 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="父类名称">
-          滤清器
+        <a-form-model-item label="父类名称" v-if="parentData&&parentData.categorySn">
+          {{ parentData&&parentData.categoryName ||'--' }}
         </a-form-model-item>
-        <a-form-model-item label="上传图标" prop="logo">
+        <a-form-model-item label="上传图标" prop="iconUrl">
           <Upload
             class="upload"
-            id="add-category-imageSet"
-            v-model="form.logo"
+            id="add-category-logo"
+            v-model="form.iconUrl"
             ref="imageSet"
             :fileSize="10"
             :maxNums="1"
             @change="changeImage"
             listType="picture-card"></Upload>
         </a-form-model-item>
-        <a-form-model-item label="类目名称" prop="name">
+        <a-form-model-item label="类目名称" prop="categoryName">
           <a-input
-            id="add-category-title"
-            :maxLength="30"
-            v-model.trim="form.name"
+            id="add-category-name"
+            :maxLength="5"
+            v-model.trim="form.categoryName"
             placeholder="请输入类目名称(最多5个字符)"
-            :disabled="isDisabled"
             allowClear/>
         </a-form-model-item>
-        <a-form-model-item label="优先级" prop="tip">
-          <a-input
-            id="add-category-title"
-            :maxLength="30"
-            v-model.trim="form.tip"
+        <a-form-model-item label="优先级" prop="sort">
+          <a-input-number
+            style="width:100%;"
+            id="add-category-sort"
+            v-model.trim="form.sort"
+            :min="0"
+            :precision="0"
+            :max="99999999"
             placeholder="请输入正整数,数字越大优先级越低"
-            :disabled="isDisabled"
-            allowClear/>
+            allowClear />
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
@@ -63,7 +64,7 @@ import { commonMixin } from '@/utils/mixin'
 // 组件
 import { Upload } from '@/components'
 // 接口
-import { promoRuleSave } from '@/api/promoRule'
+import { saveShopCategory, shopCategoryDetail } from '@/api/shopCategory'
 export default {
   name: 'AddCategoryModal',
   mixins: [commonMixin],
@@ -73,8 +74,14 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
-      type: String || Number,
+    parentData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    },
+    pageType: {
+      type: String,
       default: ''
     }
   },
@@ -82,51 +89,42 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
+      // 设置表单label布局
       formItemLayout: {
         labelCol: { span: 3 },
         wrapperCol: { span: 20 }
       },
+      // 添加参数
       form: {
-        name: '', //  促销类型
-        tip: '', //  正价品数量
-        logo: undefined //  促销品数量
+        parentSn: undefined,
+        categoryName: '', //  类目名称
+        sort: undefined, //  优先级
+        iconUrl: undefined //  上传图标
       },
       // 必填项验证
       rules: {
-        name: [{ required: true, message: '请选择促销类型', trigger: 'change' }],
-        tip: [{ required: true, message: '请输入正价品数量', trigger: 'blur' }],
-        logo: [{ required: true, message: '请输入促销品数量', trigger: 'blur' }]
+        categoryName: [{ required: true, message: '请输入类目名称', trigger: 'blur' }],
+        sort: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
+        iconUrl: [{ required: true, message: '请选择上传图标', trigger: 'change' }]
       }
     }
   },
   methods: {
     //  图片上传
     changeImage (file) {
-      this.form.imageSet = file
+      this.form.iconUrl = 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 (_this.parentData && _this.parentData.categorySn) {
+            _this.form.parentSn = _this.parentData.categorySn
+          }
+          saveShopCategory(_this.form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
@@ -143,6 +141,23 @@ export default {
           return false
         }
       })
+    },
+    // 重置
+    resetAddForm () {
+      this.form.categoryName = ''
+      this.form.sort = undefined
+      this.form.iconUrl = undefined
+      this.$refs.ruleForm.resetFields()
+    },
+    // 获取详情数据
+    getDetailData (ajaxData) {
+      this.spinning = true
+      shopCategoryDetail(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.form = res.data
+        }
+        this.spinning = false
+      })
     }
   },
   watch: {
@@ -154,12 +169,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        // this.$refs.ruleForm.resetFields()
-      }
-    },
-    itemSn (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.getDetail()
+        this.resetAddForm()
       }
     }
   }

+ 10 - 8
src/views/easyPassManagement/shoppingManagement/chooseProduct.vue

@@ -126,7 +126,7 @@ import chooseProduct from './chooseProductsModal.vue'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 // 接口
-import { financeBookDetailQueryPage, queryDetailCount, purchaseDetailDel, purchaseSubmit, purchaseImportBatchInsert, purchaseDetailPageCount } from '@/api/financeBook'
+import { shopProductList } from '@/api/shopProduct'
 import { getThirdStockQty } from '@/api/salesNew'
 export default {
   name: 'ChooseProductEdit',
@@ -162,6 +162,7 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
+      productType: [],
       rowSelectionInfo: null,
       tableHeight: 0, // 表格高度
       // 加载数据方法 必须为 Promise 对象
@@ -169,7 +170,7 @@ export default {
         this.productForm.sparePartsSn = this.sparePartsSn
         const parames = Object.assign(parameter, this.productForm)
         // 获取列表数据  有分页
-        return financeBookDetailQueryPage(parames).then(res => {
+        return shopProductList(parames).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -178,10 +179,6 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
-            // 获取统计数据
-            this.getStatisticsData(parames)
-            // 获取基础信息
-            this.getBasicsData()
           }
           return data
         })
@@ -314,8 +311,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.productForm.productName = ''
-      this.productForm.productCode = ''
+      this.queryParam.name = ''
+      this.queryParam.queryWord = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
       this.$refs.table.refresh(true)
     },
     // 提交采购入库

+ 89 - 78
src/views/easyPassManagement/shoppingManagement/list.vue

@@ -3,35 +3,37 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 操作按钮 -->
       <div ref="tableSearch" class="table-operator" style="border: 0;">
-        <a-button id="shoppingManagementList-addType" type="primary" @click="addCategory">新增类目</a-button>
+        <a-button id="shoppingManagementList-addType" type="primary" @click="addCategory('add')">新增类目</a-button>
       </div>
       <!-- 列表 -->
-      <s-table
+      <a-table
         class="sTable fixPagination"
         ref="table"
         :style="{ height: tableHeight+70+'px'}"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
-        :showPagination="false"
-        :data="loadData"
+        :pagination="false"
+        :dataSource="loadDataList"
         :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
+        @expand="expandChild"
         bordered>
         <!-- 图片 -->
         <template slot="imgs" slot-scope="text, record">
-          <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage109.360doc.com%2FDownloadImg%2F2023%2F11%2F1102%2F275164585_1_20231111020834648&refer=http%3A%2F%2Fimage109.360doc.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1727402624&t=e31f68c14695a678aea6137f7f0c088e" alt="图片走丢啦" width="60" />
+          <div class="addType-img">
+            <img :src="record.iconUrl" alt="图片走丢啦" width="60" height="60" :id="'shoppingManagementList-img-'+record.id"/>
+          </div>
         </template>
         <!-- 状态 -->
         <template slot="enabledFlag" slot-scope="text, record">
           <a-switch
-            :id="'supplierInfoList-enableFlag-'+record.id"
+            :id="'shoppingManagementList-enableFlag-'+record.id"
             v-if="$hasPermissions('B_supplierInfo_enabled')"
             checkedChildren="启用"
             unCheckedChildren="禁用"
             v-model="record.enableFlag"
-            @change="changeFlagHandle(text, record)"/>
-          <span v-else :style="{color:(record.enableFlag==1?'#00aa00':'#999')}"> {{ record.enableFlag==1? '已启用': '已禁用' }} </span>
+            @click="e=>changeFlagHandle(e,record)"/>
+          <span v-else :style="{color:(record.enableFlag?'#00aa00':'#999')}"> {{ record.enableFlag? '已启用': '已禁用' }} </span>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -39,22 +41,22 @@
             size="small"
             type="link"
             class="button-info"
-            @click="handleEdit(record)"
+            @click="handleEdit(record,'edit')"
             :id="'shoppingManagementList-edit-btn'+record.id">编辑</a-button>
           <a-button
             size="small"
             type="link"
             class="button-info"
             v-if="record.type && record.type == 'root'"
-            @click="addZone(record)"
-            :id="'shoppingManagementList-edit-btn'+record.id">添加子类目</a-button>
+            @click="handleEdit(record,'addChild')"
+            :id="'shoppingManagementList-addChild-btn'+record.id">添加子类目</a-button>
           <a-button
             size="small"
             type="link"
             class="button-success"
             v-else
             @click="handleAddProduct(record)"
-            :id="'shoppingManagementList-edit-btn'+record.id">添加产品</a-button>
+            :id="'shoppingManagementList-addProduct-btn'+record.id">添加产品</a-button>
           <a-button
             size="small"
             type="link"
@@ -62,12 +64,15 @@
             @click="handleDel(record)"
             :id="'shoppingManagementList-del-btn'+record.id">删除</a-button>
         </template>
-      </s-table>
+      </a-table>
     </a-spin>
     <!-- 新增类目 -->
     <addCategoryModal
       v-drag
+      ref="categoryModal"
+      :pageType="pageType"
       :openModal="openCategoryModal"
+      :parentData="parentData"
       @ok="$refs.table.refresh()"
       @close="openCategoryModal=false"></addCategoryModal>
   </a-card>
@@ -76,88 +81,92 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 // 组件
-import { STable, VSelect } from '@/components'
+import { VSelect } from '@/components'
 import addCategoryModal from './addCategoryModal.vue'
 // 接口
-import { subareaQueryAll, deleteSubareaBySn, deleteSubareaAreaBySn } from '@/api/subarea'
+import { shopCategoryList, getChildList, shopCategoryUpdateStatus, shopCategoryDel } from '@/api/shopCategory'
 export default {
   name: 'ShoppingManagementList',
   mixins: [commonMixin],
-  components: { STable, VSelect, addCategoryModal },
+  components: { VSelect, addCategoryModal },
   data () {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
       openCategoryModal: false, // 打开新增类目弹窗
-
-      openZoneModal: false, // 打开分区弹窗
-      openDealerModal: false, // 打开经销商弹窗
+      // 表头
       columns: [
-        { title: '类目名称', dataIndex: 'createDate', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '类目名称', dataIndex: 'categoryName', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '图片', scopedSlots: { customRender: 'imgs' }, width: '15%', align: 'center' },
-        { title: '优先级', dataIndex: 'remark', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '创建时间', dataIndex: 'remark', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '优先级', dataIndex: 'sort', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '15%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.spinning = true
-        return subareaQueryAll(parameter).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            // 计算列表序号
-            const no = 0
-            for (var i = 0; i < data.length; i++) {
-              data[i].no = no + i + 1
-              data[i].children = data[i].subareaAreaList || undefined
-              data[i].type = 'root'
-            }
-          }
-          this.spinning = false
-          return data
-        })
-      },
-      itemId: null, // 营销分区id
-      parentData: null// 营销分区一行数据
+      parentData: null, // 父级类目一行数据
+      loadDataList: [], // 表格数据
+      pageType: null// 按钮类型
     }
   },
   methods: {
+    // 展开子级 获取子级数据
+    expandChild (expanded, record) {
+      if (expanded) {
+        const _this = this
+        _this.spinning = true
+        getChildList({ categorySn: record.categorySn }).then(res => {
+          if (res.status == 200) {
+            const pos = this.loadDataList.findIndex(item => item.categorySn === record.categorySn)
+            _this.loadDataList[pos].children = pos != -1 ? (res.data.shopCategoryList && res.data.shopCategoryList.length > 0) ? res.data.shopCategoryList : [] : []
+          }
+          _this.spinning = false
+        })
+      }
+    },
     // 新增类目
-    addCategory () {
+    addCategory (typeVal) {
+      this.pageType = typeVal
       this.openCategoryModal = true
     },
-    // 新增分区
-    addZone (row) {
-      console.log(row)
-      this.openZoneModal = true
+    // 编辑  添加子类目
+    handleEdit (row, typeVal) {
+      this.pageType = typeVal
+      this.openCategoryModal = true
       this.parentData = row
+      if (typeVal === 'edit') {
+        this.$refs.categoryModal.getDetailData({ categorySn: row.categorySn })
+      }
     },
-    // 状态
-    changeFlagHandle () {
-      // 启用后,关联的产品不会同步上架,确认启用吗?
+    // 更新状态
+    changeFlagHandle (e, row) {
       const _this = this
+      const tipWord = row.status == 1 ? '禁用后,关联的产品会同步下架,确认禁用吗?' : '启用后,关联的产品不会同步上架,确认启用吗?'
       this.$confirm({
         title: '提示',
-        content: '禁用后,关联的产品会同步下架,确认禁用吗?',
+        content: tipWord,
         centered: true,
         onOk () {
           _this.spinning = true
-          const delFun = row.type && row.type == 'root' ? deleteSubareaBySn : deleteSubareaAreaBySn
-          const params = { sn: row.type && row.type == 'root' ? row.subareaSn : row.subareaAreaSn }
-          delFun(params).then(res => {
+          const params = { sn: row.categorySn }
+          params.status = row.status == 1 ? '0' : '1'
+          shopCategoryUpdateStatus(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.$refs.table.refresh()
               _this.spinning = false
             } else {
               _this.spinning = false
             }
           })
+        },
+        onCancel () {
+
         }
       })
     },
+    // 添加产品
+    handleAddProduct (row) {
+      this.$router.push({ name: 'chooseProductList', params: { sn: row.shopProductSn } })
+    },
     // 删除
     handleDel (row) {
       const _this = this
@@ -167,9 +176,7 @@ export default {
         centered: true,
         onOk () {
           _this.spinning = true
-          const delFun = row.type && row.type == 'root' ? deleteSubareaBySn : deleteSubareaAreaBySn
-          const params = { sn: row.type && row.type == 'root' ? row.subareaSn : row.subareaAreaSn }
-          delFun(params).then(res => {
+          shopCategoryDel({ categorySn: row.categorySn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -181,25 +188,27 @@ export default {
         }
       })
     },
-    //  编辑
-    handleEdit (row) {
-      // 大区
-      if (row.type && row.type == 'root') {
-        this.itemId = row && row.subareaSn ? row.subareaSn : null
-        this.openAreaModal = true
-      } else {
-        // 分区
-        this.parentData = row
-        this.openZoneModal = true
-      }
-    },
-    // 查看经销商
-    handleAddProduct (row) {
-      this.$router.push({ name: 'chooseProductList' })
+    // 获取表格数据
+    getTabData () {
+      this.spinning = true
+      shopCategoryList({}).then(res => {
+        let data
+        if (res.status == 200) {
+          data = res.data
+          for (var i = 0; i < data.length; i++) {
+            data[i].enableFlag = data[i].status === 1
+            data[i].children = []
+            data[i].type = 'root'
+          }
+        }
+        this.loadDataList = res.data
+        this.spinning = false
+      })
     },
     // 初始化
     pageInit () {
       const _this = this
+      _this.getTabData()
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
@@ -218,19 +227,16 @@ export default {
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.$refs.table.refresh()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.$refs.table.refresh()
     }
     // 仅刷新列表,不重置页面
     if (this.$store.state.app.updateList) {
       this.pageInit()
-      this.$refs.table.refresh()
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -241,5 +247,10 @@ export default {
 <style lang="less">
   .shoppingManagementList-wrap{
     height: 100%;
+    .addType-img{
+      img{
+        object-fit: cover;
+      }
+    }
   }
 </style>

+ 27 - 26
src/views/easyPassManagement/shoppingProducts/chooseImportModal.vue

@@ -66,16 +66,19 @@
 </template>
 
 <script>
+import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { sparePartsDetailParseProducts, sparePartsDetailFailExcel } from '@/api/spareParts'
+// 接口
+import { shopProductParseExcel, shopProductExport } from '@/api/shopProduct'
 export default {
   name: 'ChooseImportModal',
+  mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: {// 导入数据
       type: Object,
       default: () => {
         return {}
@@ -83,49 +86,50 @@ export default {
     }
   },
   data () {
+    const _this = this
     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) : '--') } }
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品类目', dataIndex: 'shopCategoryName1', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ],
-      loadData: [],
+      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 || '--' } }
+        { title: '产品编码', dataIndex: 'productCode', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品类目', dataIndex: 'shopCategoryName1', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '备注', dataIndex: 'remark', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      unLoadData: [],
-      loading: false
+      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 => {
+      shopProductParseExcel(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) => {
+          if (res.data.rightList && res.data.rightList.length > 0) {
+            res.data.rightList.map((item, index) => {
               item.no = index + 1
             })
           }
-          if (res.data.failList && res.data.failList.length > 0) {
-            res.data.failList.map((item, index) => {
+          if (res.data.errorList && res.data.errorList.length > 0) {
+            res.data.errorList.map((item, index) => {
               item.no = index + 1
             })
           }
-          _this.loadData = res.data.okList || []
-          _this.unLoadData = res.data.failList || []
+          _this.loadData = res.data.rightList || []
+          _this.unLoadData = res.data.errorList || []
         }
       })
     },
@@ -138,18 +142,15 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.unLoadData.length < 1) {
-        _this.$message.info('暂无可导出错误项~')
+        _this.$message.info('暂无可导出错误项~')
         return
       }
       _this.spinning = true
-      const params = {
-        list: _this.unLoadData
-      }
-      hdExportExcel(sparePartsDetailFailExcel, params, '产品导入错误项', function () {
+      hdExportExcel(shopProductExport, _this.unLoadData, '商城产品导出错误项', function () {
         _this.spinning = false
       })
     }

+ 194 - 0
src/views/easyPassManagement/shoppingProducts/editProductModal.vue

@@ -0,0 +1,194 @@
+<template>
+  <a-modal
+    centered
+    class="edit-product-modal"
+    id="edit-product-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="编辑"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="700">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="edit-product-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="售价类型" prop="priceType">
+          <a-select v-model="form.priceType" id="edit-product-priceType" placeholder="请选择售价类型" allowClear>
+            <a-select-option value="TERMINAL_PRICE">
+              终端价
+            </a-select-option>
+            <a-select-option value="CUSTOM_PRICE">
+              自定义价格
+            </a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="售价" prop="price">
+          <a-input-number
+            style="width:100%;"
+            id="edit-product-price"
+            :min="0"
+            :max="999999999"
+            :precision="2"
+            :step="0.1"
+            v-model="form.price"
+            :disabled="form.priceType==='TERMINAL_PRICE'"
+            placeholder="请输入产品售价"/>
+        </a-form-model-item>
+        <a-form-model-item label="热销产品" prop="hotFlag">
+          <v-select
+            v-model="form.hotFlag"
+            code="FlAG"
+            id="edit-product-hotFlag"
+            placeholder="请选择是否是热销产品"
+            allowClear
+          ></v-select>
+        </a-form-model-item>
+        <a-form-model-item label="热销产品优先级" prop="hotSort">
+          <a-input-number
+            style="width:100%;"
+            id="edit-product-money"
+            :min="0"
+            :max="999999999"
+            :precision="0"
+            :step="1"
+            v-model="form.hotSort"
+            placeholder="请输入正整数,数字越大优先级越低" />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="edit-product-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+        <a-button type="primary" id="edit-product-modal-save" @click="handleSave">保存</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { VSelect } from '@/components'
+// 接口
+import { shopProductDetail, shopProductSaveProduct } from '@/api/shopProduct'
+export default {
+  name: 'AddCategoryModal',
+  mixins: [commonMixin],
+  components: { VSelect },
+  props: {
+    openModal: {//  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: String || Number,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        priceType: 'TERMINAL_PRICE', // 售价类型
+        price: '', // 售价
+        hotFlag: undefined, // 是否是热销产品
+        hotSort: ''// 热销产品优先级
+      },
+      // 必填项校验
+      rules: {
+        priceType: [{ required: true, message: '请选择售价类型', trigger: 'change' }],
+        price: [{ required: true, message: '请输入产品售价', trigger: 'blur' }]
+      }
+    }
+  },
+  methods: {
+    // 获取编辑详情
+    getDetail () {
+      this.spinning = true
+      shopProductDetail({ shopProductSn: this.itemSn }).then(res => {
+        if (res.status == 200 && res.data) {
+          this.form = res.data
+          this.spinning = false
+        } else {
+          this.form = {}
+        }
+      })
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          _this.form.shopProductSn = _this.itemSn
+          shopProductSaveProduct(_this.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
+        }
+      })
+    },
+    // 重置
+    reSetForm () {
+      this.form.priceType = 'TERMINAL_PRICE'
+      this.form.price = ''
+      this.form.hotFlag = 'undefined'
+      this.form.hotSort = ''
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.reSetForm()
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.edit-product-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+  .ant-radio + span{
+    line-height: 40px;
+  }
+}
+</style>

+ 32 - 16
src/views/easyPassManagement/shoppingProducts/importGuideModal.vue

@@ -18,12 +18,14 @@
             <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>
+          <a-button
+            id="importGuide-download"
+            type="link"
+            icon="download"
+            style="padding: 0 0 0 23px;"
+            :loading="exportLoading"
+            @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -67,8 +69,12 @@
 </template>
 
 <script>
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
+// 接口
+import { shopProductDownloadExcel } from '@/api/shopProduct'
 export default {
   name: 'ImportGuideModal',
   components: { ChooseImportModal, Upload },
@@ -85,14 +91,13 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
-      uploadParams: {
+      exportLoading: false, // 导出按钮加载状态
+      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: {
@@ -108,15 +113,14 @@ export default {
     changeImport (file) {
       if (file) {
         this.paramsData = {
-          sparePartsSn: this.params.sparePartsSn || '',
           path: file
         }
       }
     },
     // 导入
-    hanldeOk (obj) {
-      if (obj && obj.length > 0) {
-        this.$emit('ok', obj)
+    hanldeOk (arr) {
+      if (arr && arr.length > 0) {
+        this.$emit('ok', arr)
         this.isShow = false
       }
     },
@@ -124,6 +128,18 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.spinning = true
+      _this.exportLoading = true
+      setTimeout(() => {
+        _this.exportLoading = false
+      }, 1000)
+      hdExportExcel(shopProductDownloadExcel, {}, '商城产品导入模板', function () {
+        _this.spinning = false
+      })
     }
   },
   watch: {

+ 166 - 35
src/views/easyPassManagement/shoppingProducts/list.vue

@@ -17,12 +17,12 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="品牌">
-                <ProductBrand id="shoppingProductsList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                <productBrand id="shoppingProductsList-productBrandSn" v-model="queryParam.productBrandSn"></productBrand>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品分类">
-                <ProductType id="shoppingProductsList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                <productType id="shoppingProductsList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></productType>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -43,10 +43,10 @@
       <div class="table-operator">
         <a-button type="primary" id="shoppingProductsList-name" @click="handleAddProduct">产品导入</a-button>
         <span>
-          <a-button type="primary" id="shoppingProductsList-name" class="button-info" @click="handleAdd">批量上架</a-button>
-          <a-button @click="handleAdd">批量下架</a-button>
-          <a-button type="primary" class="button-error" id="shoppingProductsList-name" ghost @click="handleAdd">批量删除</a-button>
-          <span>已选1项</span>
+          <a-button type="primary" id="shoppingProductsList-name" class="button-info" @click="changeStatus('1')">批量上架</a-button>
+          <a-button @click="changeStatus('0')">批量下架</a-button>
+          <a-button type="primary" class="button-error" id="shoppingProductsList-name" ghost @click="handleDel()">批量删除</a-button>
+          <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">已选{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}项</span>
         </span>
       </div>
       <a-spin :spinning="spinning" tip="Loading...">
@@ -56,34 +56,39 @@
           ref="table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
-          :rowKey="(record) => record.no"
-          rowKeyName="no"
+          :rowKey="(record) => record.shopProductSn"
+          rowKeyName="shopProductSn"
           :columns="columns"
           :data="loadData"
           :pageSize="20"
+          :row-selection="{ columnWidth: 40}"
+          @rowSelection="rowSelectionFun"
           :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>
+            <span style="padding-right: 6px;">{{ record.productCode }}</span>
+            <a-badge v-if="record.hotFlag==='1'" count="热" :number-style="{ zoom:'80%' }"></a-badge>
+          </template>
+          <!-- 产品分类 -->
+          <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>
           <!-- 操作 -->
+          <!-- v-if="$hasPermissions('B_chooseProductEdit_edit')" -->
           <template slot="action" slot-scope="text, record">
             <a-button
               size="small"
               type="link"
-              v-if="$hasPermissions('B_chooseProductEdit_edit')"
-              @click="handleAddEdit(record)"
+              @click="handleEdit(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>
@@ -92,6 +97,8 @@
     </a-card>
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeOk" />
+    <!-- 编辑 -->
+    <editProductModal :itemSn="itemProductSn" :openModal="openEditModal" @close="openEditModal=false" @ok="hanldeEditOk" ></editProductModal>
   </div>
 </template>
 
@@ -100,15 +107,17 @@ import { commonMixin } from '@/utils/mixin'
 // 组件
 import { STable, VSelect } from '@/components'
 import importGuideModal from './importGuideModal.vue'
+import editProductModal from './editProductModal.vue'
 import productType from '@/views/common/productType.js'
 import productBrand from '@/views/common/productBrand.js'
 // 接口
-import { queryRebatePage } from '@/api/dealerRelation'
+import { shopProductList, saveBatchProduct, shopProductDel, shopProductUpdateStatus } from '@/api/shopProduct'
 export default {
   name: 'ShoppingProductsList',
   mixins: [commonMixin],
-  components: { STable, VSelect, importGuideModal, productType, productBrand },
+  components: { STable, VSelect, importGuideModal, editProductModal, productType, productBrand },
   data () {
+    const _this = this
     return {
       spinning: false,
       tableHeight: 0,
@@ -117,26 +126,36 @@ export default {
         wrapperCol: { span: 16 }
       },
       queryParam: {
-        dealerName: '',
-        supDealerName: '',
-        rebateDealerName: ''
+        name: '', // 产品名称
+        queryWord: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
       },
       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' }
+        { title: '序号', dataIndex: 'no', align: 'center', width: '60px' },
+        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', scopedSlots: { customRender: 'productCode' } },
+        { title: '产品名称', dataIndex: 'productName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', align: 'center', width: '15%', scopedSlots: { customRender: 'productType' } },
+        { title: '售价', dataIndex: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
+        { title: '售价类型', dataIndex: 'priceTypeDictValue', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
+        { title: '车主价', dataIndex: 'carOwnersPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
+        { title: '优先级', dataIndex: 'hotSort', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '添加时间', dataIndex: 'createDate', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '产品商城状态', dataIndex: 'statusDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
+      rowSelectionInfo: null, // 已选数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return queryRebatePage(Object.assign(parameter, this.queryParam)).then(res => {
+        return shopProductList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -152,27 +171,139 @@ export default {
       },
       defaultExpandedRowKeys: [], //  树形数据默认展开项
       openModal: false, //  新增编辑  弹框
-      nowData: null //  当前记录数据
+      nowData: null, //  当前记录数据
+      openGuideModal: false, // 打开导入弹窗
+      openEditModal: false, // 打开编辑弹窗
+      itemProductSn: null
     }
   },
   methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 导入产品
+    handleAddProduct () {
+      this.openGuideModal = true
+    },
+    // 批量审核
+    handleBatchAudit () {
+      const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys
+      if (!this.rowSelectionInfo || (row.length < 1)) {
+        this.$message.warning('请在列表中进行勾选!')
+        return false
+      }
+      this.handleAudit(row)
+    },
     //  重置
     resetSearchForm () {
-      this.queryParam.dealerName = ''
-      this.queryParam.supDealerName = ''
-      this.queryParam.rebateDealerName = ''
+      this.queryParam.name = ''
+      this.queryParam.queryWord = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
       this.$refs.table.refresh(true)
     },
     // 编辑
     handleEdit (row) {
-      this.nowData = row
-      this.openModal = true
+      this.itemProductSn = row.shopProductSn
+      this.openEditModal = true
+    },
+    // 编辑成功
+    hanldeEditOk () {
+      this.itemProductSn = null
+      this.$refs.table.refresh(true)
+    },
+    //  产品分类  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] : ''
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      let shopProductSnList = []
+      if (row && Object.keys(row).length > 0) {
+        shopProductSnList.push(row.shopProductSn)
+      } else {
+        shopProductSnList = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys ? _this.rowSelectionInfo.selectedRowKeys : []
+      }
+      if (shopProductSnList && shopProductSnList.length == 0) {
+        this.$message.warning('请在列表中进行勾选!')
+        return
+      }
+      this.confirmDel(shopProductSnList)
+    },
+    // 确认删除
+    confirmDel (shopProductSnList) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认删除产品吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          shopProductDel({ shopProductSnList }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.clearSelected()
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 批量上、下架
+    changeStatus (type) {
+      const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys
+      if (!this.rowSelectionInfo || (row.length < 1)) {
+        this.$message.warning('请在列表中进行勾选!')
+        return false
+      }
+      this.handleChangeStatus(type)
+    },
+    // 确定上、下架
+    handleChangeStatus (typeVal) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认' + (typeVal === '0' ? '下架' : '上架') + '产品吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          shopProductUpdateStatus({ shopProductSnList: _this.rowSelectionInfo.selectedRowKeys, status: typeVal }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.clearSelected()
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
     },
     //  关闭弹框
     closeModal () {
       this.nowData = null
       this.openModal = false
     },
+    // 导入产品成功
+    hanldeOk (list) {
+      const _this = this
+      _this.spinning = true
+      saveBatchProduct(list).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$nextTick(() => {
+            _this.$refs.table.refresh(true)
+          })
+        }
+        _this.spinning = false
+      })
+    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -181,7 +312,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 200
+      this.tableHeight = window.innerHeight - tableSearchH - 240
     }
   },
   watch: {