Browse Source

产品信息

chenrui 4 years ago
parent
commit
65ebeec556

+ 1 - 4
src/api/product.js

@@ -23,7 +23,6 @@ export const productSave = (params) => {
 export const productDel = (params) => {
   return axios({
     url: `/product/delete/${params.sn}`,
-    data: params,
     method: 'get'
   })
 }
@@ -31,7 +30,6 @@ export const productDel = (params) => {
 export const productSnDetail = (params) => {
   return axios({
     url: `/product/findBySn/${params.sn}`,
-    data: params,
     method: 'get'
   })
 }
@@ -39,7 +37,6 @@ export const productSnDetail = (params) => {
 export const productAudit = (params) => {
   return axios({
     url: `/product/audit/${params.sn}`,
-    data: params,
     method: 'get'
   })
 }
@@ -48,6 +45,6 @@ export const productBatchAudit = (params) => {
   return axios({
     url: '/product/batchAudit',
     data: params,
-    method: 'get'
+    method: 'post'
   })
 }

+ 0 - 38
src/config/router.config.js

@@ -1377,44 +1377,6 @@ export const asyncRouterMap = [
           }
         ]
       },
-      // 连锁IT后台
-      {
-        path: '/chainItBackstage',
-        redirect: '/chainItBackstage/chainGroupSetting',
-        component: PageView,
-        meta: {
-          title: '连锁IT后台',
-          icon: 'property-safety'
-          // permission: 'M_shop'
-        },
-        children: [
-          {
-            path: '/chainItBackstage/chainGroupSetting',
-            redirect: '/chainItBackstage/chainGroupSetting/list',
-            name: 'chainGroupSetting',
-            component: RouteView,
-            meta: {
-              title: '连锁组设置',
-              icon: 'pull-request'
-              // permission: 'M_goodsManage_list'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'chainGroupSettingList',
-                component: () => import(/* webpackChunkName: "chainItBackstage" */ '@/views/chainItBackstage/chainGroupSetting/list.vue'),
-                meta: {
-                  title: '连锁组列表',
-                  icon: 'pull-request',
-                  hidden: true
-                  // permission: 'M_goodsManage_list'
-                }
-              }
-            ]
-          }
-        ]
-      },
       // // 菜单管理
       // {
       //   path: '/menusAuth',

+ 0 - 8
src/views/chainItBackstage/chainGroupSetting/list.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 4 - 4
src/views/productManagement/productInfo/edit.vue

@@ -104,7 +104,7 @@
                     style="width: 70%;" /><span>/单位</span>
                 </a-col>
                 <a-col :span="10">
-                  <a-select placeholder="请选择" id="productLevelEdit-packQtyUnit" v-model="form.packQtyUnit">
+                  <a-select placeholder="包装数单位" id="productLevelEdit-packQtyUnit" v-model="form.packQtyUnit">
                     <a-select-option v-for="item in productBrandList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
                   </a-select>
                 </a-col>
@@ -160,7 +160,7 @@
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="颜色" prop="color">
-              <a-select placeholder="请选择" id="productLevelEdit-color" allowClear v-model="form.color">
+              <a-select placeholder="请选择颜色" id="productLevelEdit-color" allowClear v-model="form.color">
                 <a-select-option v-for="item in productBrandList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
               </a-select>
             </a-form-model-item>
@@ -224,14 +224,14 @@ export default {
         productBrandSn: undefined, //  产品品牌
         productTypeSn3: '', //  产品三级分类
         productType: [], //  产品分类
-        unit: '', //  单位
+        unit: undefined, //  单位
         packQty: '', // 包装数
         packQtyUnit: undefined, // 包装数单位
         arrowFalg: undefined, // 是否箭冠产品
         productMsg: '', //  产品图片
         size: '', // 产品尺寸
         weight: '', // 产品重量
-        color: '', // 颜色
+        color: undefined, // 颜色
         boxSize: '', // 内核尺寸
         description: '', // 产品说明
         otherDesc: '' // 其他说明

+ 74 - 37
src/views/productManagement/productInfo/list.vue

@@ -44,12 +44,12 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品状态">
-                <v-select code="ENABLED_FLAG" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
+                <v-select code="PRODUCT_STATUS" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="定价状态">
-                <v-select code="ENABLED_FLAG" id="productInfoList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
+                <v-select code="PRICING_STATUS" id="productInfoList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
               </a-form-item>
             </a-col>
           </template>
@@ -101,7 +101,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 2140, y: tableHeight }"
+      :scroll="{ x: 2090, y: tableHeight }"
       bordered>
       <!-- 自定义表头 -->
       <template slot="arrowFalgTitle">
@@ -127,12 +127,36 @@
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-warning" @click="handleAudit(record)" id="productInfoList-audit-btn">审核</a-button>
-        <a-button size="small" type="link" class="button-primary" @click="handleLaunch(record)" id="productInfoList-launch-btn">上线</a-button>
-        <a-button size="small" type="link" class="button-grey" @click="handleDownline(record)" id="productInfoList-downline-btn">下线</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state=='WAIT'"
+          class="button-warning"
+          @click="handleAudit(record)"
+          id="productInfoList-audit-btn">审核</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state=='WAIT_ONLINE'||record.state=='OFFLINE'"
+          class="button-primary"
+          @click="handleLaunch(record)"
+          id="productInfoList-launch-btn">上线</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state=='ONLINE'"
+          class="button-grey"
+          @click="handleDownline(record)"
+          id="productInfoList-downline-btn">下线</a-button>
         <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productInfoList-edit-btn">编辑</a-button>
         <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="productInfoList-detail-btn">详情</a-button>
-        <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="productInfoList-del-btn">删除</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state=='WAIT'"
+          class="button-error"
+          @click="handleDel(record)"
+          id="productInfoList-del-btn">删除</a-button>
       </template>
     </s-table>
     <!-- 产品详情 -->
@@ -175,9 +199,10 @@ export default {
         { title: '最近修改时间', dataIndex: 'updateDate', width: 160, align: 'center' },
         { title: '产品状态', dataIndex: 'stateDictValue', width: 140, align: 'center' },
         { title: '定价状态', scopedSlots: { customRender: 'pricingState' }, width: 140, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 300, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
+      selectedRows: [],
       loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -207,28 +232,57 @@ export default {
     }
   },
   methods: {
-    onSelectChange (selectedRowKeys) {
-      console.log('selectedRowKeys changed: ', selectedRowKeys)
+    onSelectChange (selectedRowKeys, selectedRows) {
       this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    // 审核
+    handleAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要审核吗?',
+        centered: true,
+        onOk () {
+          productAudit({ sn: row.productSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
     },
     // 批量审核
     handleBatchAudit () {
-      if (this.selectedRowKeys.length < 1) {
-        this.$message.warning('请在列表勾选后再进行批量操作!')
+      const _this = this
+      if (_this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      let num = 0
+      const obj = []
+      _this.selectedRows.map(item => {
+        if (item.state == 'WAIT') {
+          num++
+          obj.push(item.productSn)
+        }
+      })
+      if (num < 1) {
+        _this.$message.warning('当前数据不可操作!')
         return
       }
-      const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要批量审核吗?',
+        content: '已选有效数据' + num + '条,确认要批量审核吗?',
         centered: true,
         onOk () {
-          // productBatchAudit({ sn: row.productSn }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          productBatchAudit({ snList: obj }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
@@ -275,23 +329,6 @@ export default {
         this.$router.push({ path: '/productManagement/productInfo/add' })
       }
     },
-    // 审核
-    handleAudit (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要审核吗?',
-        centered: true,
-        onOk () {
-          productAudit({ sn: row.productSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-            }
-          })
-        }
-      })
-    },
     // 上线
     handleLaunch (row) {
       const _this = this