chenrui преди 9 месеца
родител
ревизия
29b33f2766

+ 3 - 3
src/api/shopProduct.js

@@ -85,7 +85,7 @@ export const saveBatchProduct = params => {
   })
 }
 
-// 商城产品 选择产品批量保存
+// 商城产品 导入产品批量保存
 export const saveBatchProductExcel = params => {
   return axios({
     url: '/shopProduct/saveBatchProductExcel',
@@ -121,10 +121,10 @@ export const shopProductUpdateStatus = params => {
   })
 }
 
-// 获取类目添加的产品
+// 获取类目中已选择的产品  列表
 export const queryProductSnList = (params) => {
   return axios({
-    url: 'shopProduct/queryProductSnList',
+    url: '/shopProduct/queryProductSnList',
     data: params,
     method: 'post'
   })

+ 11 - 11
src/config/router.config.js

@@ -3524,7 +3524,7 @@ export const asyncRouterMap = [
         meta: {
           title: '易码通',
           icon: 'shop',
-          permission: 'M_bigScreenStatistics'
+          permission: 'M_shoppingManagement'
         },
         children: [
           {
@@ -3534,8 +3534,8 @@ export const asyncRouterMap = [
             component: BlankLayout,
             meta: {
               title: '商城类目',
-              icon: 'file-ppt'
-              // permission: 'M_shoppingManagementList'
+              icon: 'file-ppt',
+              permission: 'M_shoppingManagementList'
             },
             hideChildrenInMenu: true,
             children: [
@@ -3546,8 +3546,8 @@ export const asyncRouterMap = [
                 meta: {
                   title: '商城类目列表',
                   icon: 'file-ppt',
-                  hidden: true
-                  // permission: 'M_shoppingManagementList'
+                  hidden: true,
+                  permission: 'M_shoppingManagementList'
                 }
               },
               {
@@ -3557,8 +3557,8 @@ export const asyncRouterMap = [
                 meta: {
                   title: '商城类目产品列表',
                   icon: 'file-ppt',
-                  hidden: true
-                  // permission: 'M_shoppingManagementList'
+                  hidden: true,
+                  permission: 'B_category_chooseProduct'
                 }
               }
             ]
@@ -3570,8 +3570,8 @@ export const asyncRouterMap = [
             component: BlankLayout,
             meta: {
               title: '商城产品',
-              icon: 'file-ppt'
-              // permission: 'M_shoppingProductsList'
+              icon: 'file-ppt',
+              permission: 'M_shoppingProducts'
             },
             hideChildrenInMenu: true,
             children: [
@@ -3582,8 +3582,8 @@ export const asyncRouterMap = [
                 meta: {
                   title: '商城产品列表',
                   icon: 'file-ppt',
-                  hidden: true
-                  // permission: 'M_shoppingProductsList'
+                  hidden: true,
+                  permission: 'M_shoppingProductsList'
                 }
               }
             ]

+ 10 - 5
src/views/easyPassManagement/shoppingManagement/chooseProductsModal.vue

@@ -25,17 +25,17 @@
             <a-row :gutter="15">
               <a-col :md="8" :sm="24">
                 <a-form-model-item label="产品编码">
-                  <a-input id="chooseProducts-productCode" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
+                  <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.queryWord" allowClear placeholder="请输入原厂编码"/>
+                  <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.queryWord" allowClear placeholder="请输入产品名称"/>
+                  <a-input id="chooseProducts-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="8" :sm="24">
@@ -135,7 +135,9 @@ export default {
       },
       //  查询条件
       queryParam: {
-        queryWord: '', // 产品名称、产品编码、原厂编码
+        productCode: undefined, // 产品名称
+        origCode: undefined, // 产品编码
+        productName: undefined, // 原厂编码
         productBrandSn: undefined, //  产品品牌
         productType: [], // 产品分类
         productTypeSn1: '', //  产品一级分类
@@ -163,6 +165,7 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
+        params.queryWord = _this.productCode && this.productCode
         return productList(params).then(res => {
           let data
           if (res.status == 200) {
@@ -197,7 +200,9 @@ export default {
     },
     // 重置数据
     resetData () {
-      this.queryParam.queryWord = ''
+      this.queryParam.productCode = undefined
+      this.queryParam.origCode = undefined
+      this.queryParam.productName = undefined
       this.queryParam.productBrandSn = undefined
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''

+ 6 - 5
src/views/easyPassManagement/shoppingManagement/list.vue

@@ -3,7 +3,7 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 操作按钮 -->
       <div ref="tableSearch" class="table-operator" style="border: 0;">
-        <a-button id="shoppingManagementList-addType" type="primary" @click="addCategory('add')">新增类目</a-button>
+        <a-button id="shoppingManagementList-addType" v-if="$hasPermissions('B_addCategory')" type="primary" @click="addCategory('add')">新增类目</a-button>
       </div>
       <!-- 列表 -->
       <a-table
@@ -30,7 +30,7 @@
         <template slot="enabledFlag" slot-scope="text, record">
           <a-switch
             :id="'shoppingManagementList-enableFlag-'+record.id"
-            v-if="$hasPermissions('B_supplierInfo_enabled')"
+            v-if="$hasPermissions('B_shoppingManagement_enabled')"
             checkedChildren="启用"
             unCheckedChildren="禁用"
             v-model="record.enableFlag"
@@ -44,18 +44,19 @@
             type="link"
             class="button-info"
             @click="handleEdit(record,'edit')"
+            v-if="$hasPermissions('B_addCategory_edit')"
             :id="'shoppingManagementList-edit-btn'+record.id">编辑</a-button>
           <a-button
             size="small"
             type="link"
             class="button-info"
             @click="handleEdit(record,'addChild')"
-            v-if="(record.type && record.type=='root')&&(record.shopCategoryCount>=0&&record.shopProductCount==0)"
+            v-if="$hasPermissions('B_addChildCategory')&&(record.type && record.type=='root')&&(record.shopCategoryCount>=0&&record.shopProductCount==0)"
             :id="'shoppingManagementList-addChild-btn'+record.id">添加子类目</a-button>
           <a-button
             size="small"
             type="link"
-            v-if="(record.shopProductCount>=0&&record.shopCategoryCount==0)||record.type!='root'"
+            v-if="$hasPermissions('B_addProduct')&&(record.shopProductCount>=0&&record.shopCategoryCount==0)||record.type!='root'"
             class="button-success"
             @click="handleAddProduct(record)"
             :id="'shoppingManagementList-addProduct-btn'+record.id">添加产品</a-button>
@@ -64,7 +65,7 @@
             type="link"
             class="button-error"
             @click="handleDel(record)"
-            v-show="!record.enableFlag"
+            v-if="$hasPermissions('B_delCategory')&&!record.enableFlag"
             :id="'shoppingManagementList-del-btn'+record.id">删除</a-button>
         </template>
       </a-table>

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

@@ -146,6 +146,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           _this.spinning = true
+          console.log('1111111111111:', _this.form, _this.form.price)
           _this.form.shopProductSn = _this.itemSn
           shopProductSaveProduct(_this.form).then(res => {
             if (res.status == 200) {

+ 34 - 14
src/views/easyPassManagement/shoppingProducts/list.vue

@@ -59,12 +59,18 @@
     <a-card size="small" :bordered="false">
       <!-- 操作按钮 -->
       <div class="table-operator">
-        <a-button type="primary" id="shoppingProductsList-addProduct-btn" v-if="itemCategorySn" @click="handleChooseProduct">选择产品</a-button>
-        <a-button type="primary" v-else id="shoppingProductsList-import-btn" @click="handleAddProduct">产品导入</a-button>
+        <a-button type="primary" id="shoppingProductsList-addProduct-btn" v-if="$hasPermissions('B_category_chooseProduct')&&itemCategorySn" @click="handleChooseProduct">选择产品</a-button>
+        <a-button type="primary" v-if="$hasPermissions('B_shoppingProducts_import')&&!itemCategorySn" id="shoppingProductsList-import-btn" @click="handleAddProduct">产品导入</a-button>
         <span v-if="productNum&&productNum*1>0">
-          <a-button type="primary" id="shoppingProductsList-grounding-btn" class="button-info" @click="changeStatus('1')">批量上架</a-button>
-          <a-button @click="changeStatus('0')" id="shoppingProductsList-off-btn">批量下架</a-button>
-          <a-button type="primary" class="button-error" id="shoppingProductsList-delProduct-btn" ghost @click="handleDel()">批量删除</a-button>
+          <a-button type="primary" v-if="$hasPermissions('B_groundingProducts_btn')" id="shoppingProductsList-grounding-btn" class="button-info" @click="changeStatus('1')">批量上架</a-button>
+          <a-button v-if="$hasPermissions('B_offProducts_btn')" @click="changeStatus('0')" id="shoppingProductsList-off-btn">批量下架</a-button>
+          <a-button
+            v-if="$hasPermissions('B_delProducts_btn')"
+            type="primary"
+            class="button-error"
+            id="shoppingProductsList-delProduct-btn"
+            ghost
+            @click="handleDel()">批量删除</a-button>
           <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">已选{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}项</span>
         </span>
       </div>
@@ -82,7 +88,7 @@
           :pageSize="20"
           :row-selection="{ columnWidth: 40}"
           @rowSelection="rowSelectionFun"
-          :scroll="{ y: itemCategorySn?tableHeight-100:tableHeight }"
+          :scroll="{ y: itemCategorySn?tableHeight-100:tableHeight-20 }"
           :defaultLoadData="false"
           bordered>
           <!-- 产品编码 -->
@@ -97,7 +103,7 @@
           </template>
           <!-- 商城类目 -->
           <template slot="categoryName" slot-scope="text, record">
-            <span v-if="record.categoryName1 || record.categoryName2">{{ record.categoryName1 }} {{ record.categoryName2 ? '>' : '' }} {{ record.categoryName2 }}</span>
+            <span v-if="record.categoryName1 || record.categoryName2">{{ record.categoryName1 }} {{ (record.categoryName1&&record.categoryName2) ? '>' : '' }} {{ record.categoryName2 }}</span>
             <span v-else>--</span>
           </template>
           <!-- 售价类型 -->
@@ -111,11 +117,11 @@
             <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_editProducts_btn')"
               @click="handleEdit(record)"
               class="button-info"
               :id="'chooseProductEdit-edit-btn'+record.id">编辑</a-button>
@@ -124,19 +130,20 @@
               type="link"
               @click="changeStatus('1',record)"
               class="button-info"
-              v-if="record.status=='0'"
+              v-if="$hasPermissions('B_groundingProducts_btn')&&record.status=='0'"
               :id="'chooseProductEdit-top-btn'+record.id">上架</a-button>
             <a-button
               size="small"
               type="link"
               @click="changeStatus('0',record)"
               class="button-info"
-              v-else
+              v-if="$hasPermissions('B_offProducts_btn')&&record.status!='0'"
               :id="'chooseProductEdit-bottom-btn'+record.id">下架</a-button>
             <a-button
               size="small"
               type="link"
               class="button-error"
+              v-if="$hasPermissions('B_delProducts_btn')"
               @click="handleDel(record)"
               :id="'chooseProductEdit-del-btn'+record.id">删除</a-button>
           </template>
@@ -247,16 +254,29 @@ export default {
         { 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: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
         { title: '售价类型', dataIndex: 'priceType', scopedSlots: { customRender: 'priceType' }, align: 'center', width: '10%' },
-        { 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: '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: 'hotFlag', scopedSlots: { customRender: 'hotFlag' }, align: 'center', width: '6%' },
-        { title: '优先级', dataIndex: 'hotSort', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '优先级', dataIndex: 'hotSort', align: 'center', width: '7%', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '添加时间', dataIndex: 'createDate', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
         { title: '产品商城状态', dataIndex: 'statusDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '14%', align: 'center' }
       ]
+      // 售价
+      if (_this.$hasPermissions('M_shoppingProductsList_salesPrice')) {
+        arr.splice(6, 0, { title: '售价', dataIndex: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+      }
+      // 终端价
+      const pos = _this.$hasPermissions('M_shoppingProductsList_salesPrice') ? 8 : 7
+      if (_this.$hasPermissions('M_shoppingProductsList_salesPrice')) {
+        arr.splice(pos, 0, { title: '终端价', dataIndex: 'terminalPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+      }
+      // 车主价
+      if (_this.$hasPermissions('M_shoppingProductsList_carOwnersPrice')) {
+        arr.splice((pos * 1 + 1), 0, { title: '车主价', dataIndex: 'carOwnersPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+      }
       if (!_this.itemCategorySn) {
         arr.splice(6, 0, { title: '商城类目', scopedSlots: { customRender: 'categoryName' }, width: '15%', align: 'center' })
       }