chenrui 4 years ago
parent
commit
7310d0f610
30 changed files with 452 additions and 647 deletions
  1. 0 71
      src/api/dealerProduct.js
  2. 0 41
      src/api/dealerProductBrand.js
  3. 0 29
      src/api/dealerProductType.js
  4. 53 0
      src/api/product.js
  5. 10 0
      src/api/productBrand.js
  6. 9 9
      src/api/productType.js
  7. 25 0
      src/components/global.less
  8. 1 1
      src/config/router.config.js
  9. 4 4
      src/views/allocationManagement/transferOut/edit.vue
  10. 2 2
      src/views/common/productBrand.js
  11. 1 1
      src/views/dealerManagement/marketingDivisionSet/editModal.vue
  12. 3 3
      src/views/dealerManagement/merchantInfoManagement/list.vue
  13. 2 2
      src/views/inventoryManagement/warehouseAllocation/edit.vue
  14. 2 2
      src/views/productManagement/priceChangeRecord/list.vue
  15. 1 1
      src/views/productManagement/productBrand/editModal.vue
  16. 1 1
      src/views/productManagement/productBrand/list.vue
  17. 11 11
      src/views/productManagement/productCategory/editModal.vue
  18. 13 13
      src/views/productManagement/productCategory/list.vue
  19. 27 28
      src/views/productManagement/productInfo/detailModal.vue
  20. 153 120
      src/views/productManagement/productInfo/edit.vue
  21. 117 173
      src/views/productManagement/productInfo/list.vue
  22. 0 118
      src/views/productManagement/productInfo/lookPicModal.vue
  23. 2 2
      src/views/productManagement/productLevel/list.vue
  24. 2 2
      src/views/productManagement/productPricing/list.vue
  25. 2 2
      src/views/productManagement/purchaseBaseLimit/list.vue
  26. 1 1
      src/views/promotionRulesManagement/promotionRules/chooseImportModal.vue
  27. 3 3
      src/views/promotionRulesManagement/promotionRules/chooseProductsModal.vue
  28. 3 3
      src/views/promotionRulesManagement/promotionRules/list.vue
  29. 2 2
      src/views/salesManagement/salesQuery/queryPart.vue
  30. 2 2
      vue.config.js

+ 0 - 71
src/api/dealerProduct.js

@@ -1,71 +0,0 @@
-import { axios } from '@/utils/request'
-
-//  产品列表  分页
-export const dealerProductList = (params) => {
-  const url = `/dealerProduct/queryPage/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
-//  产品列表  无分页
-export const dealerProductQuery = (params) => {
-  const url = `/dealerProduct/query`
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
-// 新增/编辑产品
-export const dealerProductSave = params => {
-  return axios({
-    url: '/dealerProduct/save',
-    data: params,
-    method: 'post'
-  })
-}
-
-// 产品 更改状态
-export const dealerProductUpdate = params => {
-  return axios({
-    url: '/dealerProduct/updateStatus',
-    data: params,
-    method: 'post'
-  })
-}
-
-// 产品 导出
-export const dealerProductExport = params => {
-  return axios({
-    url: '/dealerProduct/export',
-    data: params,
-    method: 'post',
-    responseType: 'blob'
-  })
-}
-
-//  产品  详情
-export const dealerProductDetail = (params) => {
-  return axios({
-    url: `/dealerProduct/findById/${params.id}`,
-    data: {},
-    method: 'get'
-  })
-}
-//  赠品 列表  分页
-export const giftsDetailList = (params) => {
-  const url = `/giftsDetail/queryPage/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}

+ 0 - 41
src/api/dealerProductBrand.js

@@ -1,41 +0,0 @@
-import { axios } from '@/utils/request'
-
-//  产品品牌列表  分页
-export const dealerProductBrandList = (params) => {
-  const url = `/dealerProductBrand/queryPage/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
-//  产品品牌列表  无分页
-export const dealerProductBrandQuery = (params) => {
-  const url = `/dealerProductBrand/queryList`
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
-// 新增/编辑产品品牌
-export const dealerProductBrandSave = params => {
-  return axios({
-    url: '/dealerProductBrand/save',
-    data: params,
-    method: 'post'
-  })
-}
-
-// 产品品牌 更改状态
-export const dealerProductBrandUpdate = params => {
-  return axios({
-    url: '/dealerProductBrand/updateStatus',
-    data: params,
-    method: 'post'
-  })
-}

+ 0 - 29
src/api/dealerProductType.js

@@ -1,29 +0,0 @@
-import { axios } from '@/utils/request'
-
-//  产品分类 列表  无分页
-export const dealerProductTypeList = (params) => {
-  const url = `/dealerProductType/query`
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
-// 新增/编辑 产品分类
-export const dealerProductTypeSave = params => {
-  return axios({
-    url: '/dealerProductType/save',
-    data: params,
-    method: 'post'
-  })
-}
-
-// 删除 产品分类
-export const dealerProductTypeDel = params => {
-  return axios({
-    url: `/dealerProductType/delete/${params.id}`,
-    data: {},
-    method: 'get'
-  })
-}

+ 53 - 0
src/api/product.js

@@ -0,0 +1,53 @@
+import { axios } from '@/utils/request'
+
+//  产品 列表  分页
+export const productList = (params) => {
+  const url = `/product/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  产品 保存
+export const productSave = (params) => {
+  return axios({
+    url: '/product/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  产品 删除
+export const productDel = (params) => {
+  return axios({
+    url: `/product/delete/${params.sn}`,
+    data: params,
+    method: 'get'
+  })
+}
+//  产品 详情  根据sn查询
+export const productSnDetail = (params) => {
+  return axios({
+    url: `/product/findBySn/${params.sn}`,
+    data: params,
+    method: 'get'
+  })
+}
+//  产品 审核
+export const productAudit = (params) => {
+  return axios({
+    url: `/product/audit/${params.sn}`,
+    data: params,
+    method: 'get'
+  })
+}
+//  产品 批量审核
+export const productBatchAudit = (params) => {
+  return axios({
+    url: '/product/batchAudit',
+    data: params,
+    method: 'get'
+  })
+}

+ 10 - 0
src/api/productBrand.js

@@ -0,0 +1,10 @@
+import { axios } from '@/utils/request'
+
+//  产品品牌 列表   无分页
+export const productBrandQuery = (params) => {
+  return axios({
+    url: '/productBrand/query',
+    data: params,
+    method: 'post'
+  })
+}

+ 9 - 9
src/api/productType.js

@@ -1,14 +1,14 @@
 import { axios } from '@/utils/request'
 
-//  箭冠 产品分类 列表   一层分类查询   无分页
-export const productTypeQueryList = (params) => {
-  return axios({
-    url: '/productType/queryList',
-    data: params,
-    method: 'post'
-  })
-}
-//  箭冠 产品分类 列表  多层分类查询   无分页
+// //  产品分类 列表   一层分类查询   无分页
+// export const productTypeQueryList = (params) => {
+//   return axios({
+//     url: '/productType/queryList',
+//     data: params,
+//     method: 'post'
+//   })
+// }
+//  产品分类 列表  多层分类查询   无分页
 export const productTypeQuery = (params) => {
   return axios({
     url: '/productType/query',

+ 25 - 0
src/components/global.less

@@ -653,6 +653,21 @@ body {
     border-color: #531dab;
   }
 }
+.ant-btn-primary.button-grey {
+  background-color: #82848a;
+  border-color: #82848a;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #909399;
+    border-color: #909399;
+  }
+ 
+  &:active, &.active {
+    background-color: #c8c9cc;
+    border-color: #c8c9cc;
+  }
+}
 
 // btn-link
 .ant-btn-link.button-primary {
@@ -730,4 +745,14 @@ body {
   &:active, &.active {
     color: #531dab;
   }
+}
+.ant-btn-link.button-grey {
+  color: #82848a;
+  &:hover, &:focus {
+    color: #909399;
+  }
+ 
+  &:active, &.active {
+    color: #c8c9cc;
+  }
 }

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

@@ -94,7 +94,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'edit/:id',
+                path: 'edit/:id/:sn',
                 name: 'productInfoEdit',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/productManagement/productInfo/edit.vue'),
                 meta: {

+ 4 - 4
src/views/allocationManagement/transferOut/edit.vue

@@ -183,8 +183,8 @@
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { storeCallOutDetailList, storeCallOutDetail, storeCallOutDetailCount, storeCallOutDetailSave, storeCallOutDetailDel, storeCallOutSubmit } from '@/api/storeCallOut'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeList } from '@/api/productType'
 import { warehouseAllList } from '@/api/warehouse'
 import { productQuery } from '@/api/allocWarehouse'
 export default {
@@ -440,7 +440,7 @@ export default {
     //  产品品牌  列表
     getProductBrand () {
       // sysFlag不传,此处应查询所有产品
-      dealerProductBrandQuery({}).then(res => {
+      productBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -450,7 +450,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({}).then(res => {
+      productTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {

+ 2 - 2
src/views/common/productBrand.js

@@ -1,4 +1,4 @@
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { productBrandQuery } from '@/api/productBrand'
 const ProductBrand = {
   template: `
       <a-select
@@ -54,7 +54,7 @@ const ProductBrand = {
     },
     //  产品品牌列表, sysFlag: 1 箭冠 0 自建
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': this.sysFlag }).then(res => {
+      productBrandQuery({ 'sysFlag': this.sysFlag }).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {

+ 1 - 1
src/views/dealerManagement/marketingDivisionSet/editModal.vue

@@ -49,7 +49,7 @@
 <script>
 import { STable, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
-import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
 export default {
   name: 'MarketingDivisionSetEditModal',
   components: { STable, Upload, Editor },

+ 3 - 3
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -108,9 +108,9 @@
 
 <script>
 import moment from 'moment'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeQuery } from '@/api/dealerProductType'
-import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeQuery } from '@/api/dealerProductType'
+// import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
 import merchantInfoManagementDetailModal from './detailModal.vue'
 export default {

+ 2 - 2
src/views/inventoryManagement/warehouseAllocation/edit.vue

@@ -228,8 +228,8 @@
 <script>
 import { STable, VSelect } from '@/components'
 import { allocWarehouseDetailList, allocWarehouseDetail, productQuery, allocWarehouseDetailCount, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeList } from '@/api/dealerProductType'
 import { warehouseLocAllList } from '@/api/warehouse'
 
 export default {

+ 2 - 2
src/views/productManagement/priceChangeRecord/list.vue

@@ -94,8 +94,8 @@
 
 <script>
 import moment from 'moment'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeQuery } from '@/api/dealerProductType'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeQuery } from '@/api/dealerProductType'
 import { STable, VSelect } from '@/components'
 export default {
   components: { STable, VSelect },

+ 1 - 1
src/views/productManagement/productBrand/editModal.vue

@@ -62,7 +62,7 @@
 <script>
 import { STable, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
-import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
 export default {
   name: 'ProductBrandEditModal',
   components: { STable, Upload, Editor },

+ 1 - 1
src/views/productManagement/productBrand/list.vue

@@ -76,7 +76,7 @@
 </template>
 
 <script>
-import { dealerProductBrandList, dealerProductBrandUpdate } from '@/api/dealerProductBrand'
+// import { dealerProductBrandList, dealerProductBrandUpdate } from '@/api/dealerProductBrand'
 import { STable, VSelect } from '@/components'
 import productBrandEditModal from './editModal.vue'
 import productBrandDetailModal from './detailModal.vue'

+ 11 - 11
src/views/productManagement/productCategory/editModal.vue

@@ -35,9 +35,9 @@
 
 <script>
 import { STable } from '@/components'
-import { dealerProductTypeSave } from '@/api/dealerProductType'
+// import { dealerProductTypeSave } from '@/api/dealerProductType'
 export default {
-  name: 'productCategoryEditModal',
+  name: 'ProductCategoryEditModal',
   components: { STable },
   props: {
     openModal: { //  弹框显示状态
@@ -66,19 +66,19 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        productTypeName: '', // 产品分类名称
+        productTypeName: '' // 产品分类名称
       },
       rules: {
         productTypeName: [
           { required: true, message: '请输入产品分类名称', trigger: 'blur' }
-        ],
+        ]
       },
-      parentType: '',  //  父级分类
+      parentType: '' //  父级分类
     }
   },
   methods: {
     //  保存
-    handleSave(){
+    handleSave () {
       const _this = this
       _this.$refs.ruleForm.validate(valid => {
         if (valid) {
@@ -96,7 +96,7 @@ export default {
           return false
         }
       })
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -107,9 +107,9 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-      }else{
+      } else {
         //  获取父级分类 名称
-        if(this.nowData && this.nowData.namePaths){
+        if (this.nowData && this.nowData.namePaths) {
           let namePathsArr = []
           namePathsArr = this.nowData.namePaths.split(',')
           this.parentType = ''
@@ -117,7 +117,7 @@ export default {
             this.parentType += item + ' > '
           })
           this.parentType = this.parentType ? this.parentType.substr(0, this.parentType.length - 3) : ''
-        }else{
+        } else {
           this.parentType = ''
         }
       }
@@ -125,7 +125,7 @@ export default {
     itemId (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.form.productTypeName = this.nowData && this.nowData.productTypeName ? this.nowData.productTypeName : ''
-      }else{
+      } else {
         this.form.productTypeName = ''
       }
     }

+ 13 - 13
src/views/productManagement/productCategory/list.vue

@@ -49,7 +49,7 @@
 </template>
 
 <script>
-import { dealerProductTypeQuery, dealerProductTypeDel } from '@/api/dealerProductType'
+// import { dealerProductTypeQuery, dealerProductTypeDel } from '@/api/dealerProductType'
 import { STable } from '@/components'
 import productCategoryEditModal from './editModal.vue'
 export default {
@@ -71,29 +71,29 @@ export default {
         return dealerProductTypeQuery({}).then(res => {
           //  递归去除空children
           this.recursionFun(res.data)
-          if(res.data.length > 0){
+          if (res.data.length > 0) {
             this.defaultExpandedRowKeys[0] = res.data[0].id
-          }else{
+          } else {
             this.defaultExpandedRowKeys = []
           }
           return res.data
         })
       },
       defaultExpandedRowKeys: [], //  树形数据默认展开项
-      openModal: false,  //  新增编辑  弹框
-      itemId: '',  //  当前id
-      nowData: null  //  当前记录数据
+      openModal: false, //  新增编辑  弹框
+      itemId: '', //  当前id
+      nowData: null //  当前记录数据
     }
   },
   methods: {
     //  新增子级
     handleAdd (row) {
       this.itemId = null
-      if(row){  //  新增子级
-        let nowData = row
+      if (row) { //  新增子级
+        const nowData = row
         nowData.psn = nowData && nowData.productTypeSn ? nowData.productTypeSn : null
         this.nowData = nowData
-      }else{  //  最高级
+      } else { //  最高级
         this.nowData = null
       }
       this.openModal = true
@@ -101,18 +101,18 @@ export default {
     //  编辑
     handleEdit (row) {
       this.itemId = row && row.id ? row.id : null
-      let nowData = row
+      const nowData = row
       nowData.psn = nowData && nowData.productTypeSn ? nowData.productTypeSn : null
       this.nowData = nowData
       this.openModal = true
     },
     //  关闭弹框
-    closeModal(){
+    closeModal () {
       this.itemId = ''
       this.openModal = false
     },
     //  新增/编辑  成功
-    handleOk(){
+    handleOk () {
       this.$refs.table.refresh(true)
     },
     //  删除
@@ -170,4 +170,4 @@ export default {
       }
     }
   }
-</style>
+</style>

+ 27 - 28
src/views/productManagement/productInfo/detailModal.vue

@@ -9,9 +9,17 @@
     @cancle="isShow=false"
     width="80%">
     <!-- 产品详情 -->
-    <div>
-      <a-descriptions bordered size="default">
-        <a-descriptions-item label="产品图片:">
+    <div v-if="detailsData">
+      <a-descriptions bordered size="small" :column="2">
+        <a-descriptions-item label="产品名称:">{{ detailsData.name || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="产品编码:">{{ detailsData.code || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="原厂编码:">{{ detailsData.origCode || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="产品品牌:">{{ detailsData.productBrandName || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="产品分类:">{{ productTypeName || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="其他编码:">{{ detailsData.otherCode || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="包装规格:">{{ detailsData.packQty || '--' }}{{ detailsData.packQtyUnit || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="箭冠产品:">{{ detailsData.arrowFalgDictValue || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="产品图片:" :span="2">
           <img
             v-for="(item,index) in fileList"
             :key="index"
@@ -20,20 +28,12 @@
             class="productPic"
             @click="getPreview(item.url)" />
         </a-descriptions-item>
-        <!-- <a-descriptions-item label="产品名称:">{{ detailsData.productName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="产品编码:">{{ detailsData.productCode || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="原厂编码:">{{ detailsData.origCode || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="其他编码:">{{ detailsData.origCode || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="包装规格:">{{ detailsData.origCode || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="箭冠产品:">{{ detailsData.origCode || '--' }}</a-descriptions-item>
         <a-descriptions-item label="单位:">{{ detailsData.unit || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="产品品牌:">{{ detailsData.productBrandName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="产品类别:">{{ productTypeName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="产品尺寸:">{{ (detailsData.wholesalePrice || detailsData.wholesalePrice==0) ? detailsData.wholesalePrice : '--' }}</a-descriptions-item>
-        <a-descriptions-item label="产品重量:">{{ (detailsData.terminalPrice || detailsData.terminalPrice==0) ? detailsData.terminalPrice : '--' }}</a-descriptions-item>
-        <a-descriptions-item label="颜色:">{{ detailsData.productBrandName || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="产品尺寸:">{{ (detailsData.size || detailsData.size==0) ? detailsData.size : '--' }}</a-descriptions-item>
+        <a-descriptions-item label="产品重量:">{{ (detailsData.weight || detailsData.weight==0) ? detailsData.weight : '--' }}</a-descriptions-item>
+        <a-descriptions-item label="颜色:">{{ detailsData.color || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品说明:">{{ detailsData.productBrandName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="其他说明:">{{ detailsData.productBrandName || '--' }}</a-descriptions-item> -->
+        <a-descriptions-item label="其他说明:">{{ detailsData.productBrandName || '--' }}</a-descriptions-item>
       </a-descriptions>
       <div class="btn-cont"><a-button id="product-management-detail-modal-back" @click="isShow = false">返回列表</a-button></div>
     </div>
@@ -44,7 +44,7 @@
 </template>
 
 <script>
-// import { dealerProductDetail } from '@/api/dealerProduct'
+import { productSnDetail } from '@/api/product'
 export default {
   name: 'ProductInfoDetailModal',
   props: {
@@ -52,17 +52,16 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemSn: {
       type: [Number, String],
       default: ''
     }
   },
   computed: {
     productTypeName () {
-      const productTypeName1 = this.detailsData.productTypeName1 ? this.detailsData.productTypeName1 : ''
-      const productTypeName2 = this.detailsData.productTypeName2 ? ' > ' + this.detailsData.productTypeName2 : ''
+      const productTypeName2 = this.detailsData.productTypeName2 ? this.detailsData.productTypeName2 : ''
       const productTypeName3 = this.detailsData.productTypeName3 ? ' > ' + this.detailsData.productTypeName3 : ''
-      return productTypeName1 + productTypeName2 + productTypeName3
+      return productTypeName2 + productTypeName3
     }
   },
   data () {
@@ -96,13 +95,13 @@ export default {
   methods: {
     //  获取详情
     getDetail () {
-      // dealerProductDetail({ id: this.itemId }).then(res => {
-      //   if (res.status == 200) {
-      //     this.detailsData = res.data
-      //   } else {
-      //     this.detailsData = null
-      //   }
-      // })
+      productSnDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.detailsData = res.data
+        } else {
+          this.detailsData = null
+        }
+      })
     },
     // 查看大图
     getPreview (url) {
@@ -121,7 +120,7 @@ export default {
         this.$emit('close')
       }
     },
-    itemId (newValue, oldValue) {
+    itemSn (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.getDetail()
       }

+ 153 - 120
src/views/productManagement/productInfo/edit.vue

@@ -16,17 +16,17 @@
       <a-card :bordered="false" class="productInfoEdit-cont">
         <a-row>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="产品名称" prop="productTypeName">
-              <a-input v-model.trim="form.productTypeName" id="productInfoEdit-name" :maxLength="100" allowClear placeholder="请输入产品名称(最多100个字符)" />
+            <a-form-model-item label="产品名称" prop="name">
+              <a-input v-model.trim="form.name" id="productInfoEdit-name" :maxLength="100" allowClear placeholder="请输入产品名称(最多100个字符)" />
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="产品编码" prop="productCode">
+            <a-form-model-item label="产品编码" prop="code">
               <a-input
-                id="productInfoEdit-productCode"
+                id="productInfoEdit-code"
                 :maxLength="100"
                 :disabled="!!$route.params.id"
-                v-model="form.productCode"
+                v-model="form.code"
                 placeholder="请输入产品编码(最多100个字符)"
                 allowClear />
             </a-form-model-item>
@@ -42,11 +42,11 @@
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="其他编码" prop="origCode">
+            <a-form-model-item label="其他编码" prop="otherCode">
               <a-input
-                id="productInfoEdit-origCode"
+                id="productInfoEdit-otherCode"
                 :maxLength="60"
-                v-model="form.origCode"
+                v-model="form.otherCode"
                 placeholder="请输入(最多60个字符,多个编码用逗号隔开)"
                 allowClear />
             </a-form-model-item>
@@ -56,7 +56,6 @@
               <a-select
                 id="productInfoEdit-productBrand"
                 placeholder="请选择产品品牌"
-                :disabled="!!$route.params.id"
                 allowClear
                 v-model="form.productBrandSn"
                 :showSearch="true"
@@ -69,6 +68,8 @@
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="产品分类" prop="productType">
               <a-cascader
+                :disabled="!!$route.params.id"
+                expand-trigger="hover"
                 @change="changeProductType"
                 :options="productTypeList"
                 :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
@@ -84,18 +85,18 @@
                 id="productInfoEdit-unit"
                 placeholder="请选择单位"
                 allowClear
-                v-model="form.productBrandSn">
+                v-model="form.unit">
                 <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
               </a-select>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="包装数" prop="origCode" :label-col="{span:8}" :wrapper-col="{span:16}">
+            <a-form-model-item label="包装数" prop="packQty" :label-col="{span:4}" :wrapper-col="{span:16}">
               <a-row>
                 <a-col :span="14">
                   <a-input-number
-                    id="productInfoEdit-name"
-                    v-model="form.storageQuantity"
+                    id="productInfoEdit-packQty"
+                    v-model="form.packQty"
                     :precision="0"
                     :min="1"
                     :max="999999"
@@ -103,19 +104,19 @@
                     style="width: 70%;" /><span>/单位</span>
                 </a-col>
                 <a-col :span="10">
-                  <a-select placeholder="请选择" id="productLevelEdit-storageQuantity" allowClear v-model="form.storageQuantity">
-                    <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                  <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>
               </a-row>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="箭冠产品">
+            <a-form-model-item label="箭冠产品" prop="arrowFalg">
               <v-select
                 code="FLAG"
-                id="productInfoEdit-dispatchType"
-                v-model="form.dispatchType"
+                id="productInfoEdit-arrowFalg"
+                v-model="form.arrowFalg"
                 allowClear
                 placeholder="请选择"
               ></v-select>
@@ -124,12 +125,12 @@
         </a-row>
         <a-row>
           <a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
-            <a-form-model-item label="产品图片" help="说明:图片比例1:1,尺寸大于300*300px,首张为主图,最多5张。" :label-col="{span:6}" :wrapper-col="{span:18}">
+            <a-form-model-item label="产品图片" help="说明:图片比例1:1,尺寸大于300*300px,首张为主图,最多5张。" :label-col="{span:3}" :wrapper-col="{span:18}">
               <Upload
                 class="upload"
-                id="productInfoEdit-homeImage"
-                v-model="form.homeImage"
-                ref="homeImage"
+                id="productInfoEdit-productMsg"
+                v-model="form.productMsg"
+                ref="productMsg"
                 :fileSize="0.25"
                 @change="changeHomeImage"
                 listType="picture-card" ></Upload>
@@ -138,50 +139,50 @@
         </a-row>
         <a-row>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="产品尺寸" prop="productTypeName">
+            <a-form-model-item label="产品尺寸" prop="size">
               <a-input
-                v-model.trim="form.productTypeName"
-                id="productInfoEdit-name"
+                v-model.trim="form.size"
+                id="productInfoEdit-size"
                 :maxLength="50"
                 allowClear
                 placeholder="请输入产品尺寸(最多50个字符)" />
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="产品重量" prop="productTypeName">
+            <a-form-model-item label="产品重量" prop="weight">
               <a-input
-                v-model.trim="form.productTypeName"
-                id="productInfoEdit-name"
+                v-model.trim="form.weight"
+                id="productInfoEdit-weight"
                 :maxLength="50"
                 allowClear
                 placeholder="请输入产品重量(最多50个字符)" />
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="颜色" prop="productTypeName">
-              <a-select placeholder="请选择" id="productLevelEdit-storageQuantity" allowClear v-model="form.storageQuantity">
-                <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+            <a-form-model-item label="颜色" prop="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>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
-            <a-form-model-item label="产品内核尺寸" prop="productTypeName">
+            <a-form-model-item label="产品内核尺寸" prop="boxSize">
               <a-input
-                v-model.trim="form.productTypeName"
-                id="productInfoEdit-name"
+                v-model.trim="form.boxSize"
+                id="productInfoEdit-boxSize"
                 :maxLength="50"
                 allowClear
                 placeholder="请输入产品内核尺寸(最多50个字符)" />
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-            <a-form-model-item label="产品说明" prop="desc" :label-col="{span:4}" :wrapper-col="{span:20}">
-              <editor id="productInfoEdit-editor" ref="editor" class="productInfoEdit-editor" @on-change="editorChange" :cache="false"></editor>
+            <a-form-model-item label="产品说明" prop="description" :label-col="{span:2}" :wrapper-col="{span:20}">
+              <editor id="productInfoEdit-description" ref="editor" class="productInfoEdit-description" @on-change="editorDescriptionChange" :cache="false"></editor>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-            <a-form-model-item label="其他说明" prop="desc" :label-col="{span:4}" :wrapper-col="{span:20}">
-              <editor id="productInfoEdit-other-editor" ref="editor" class="productInfoEdit-editor" @on-change="editorChange" :cache="false"></editor>
+            <a-form-model-item label="其他说明" prop="otherDesc" :label-col="{span:2}" :wrapper-col="{span:20}">
+              <editor id="productInfoEdit-other-otherDesc" ref="otherDesc" class="productInfoEdit-otherDesc" @on-change="editorOtherChange" :cache="false"></editor>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -202,41 +203,108 @@
 </template>
 
 <script>
-import { getArea } from '@/api/data'
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
+import { productSave, productSnDetail } from '@/api/product'
+import { productTypeQuery } from '@/api/productType'
+import { productBrandQuery } from '@/api/productBrand'
 export default {
   components: { VSelect, Upload, Editor },
   data () {
     return {
       formItemLayout: {
-        labelCol: {
-          span: 8
-        },
-        wrapperCol: {
-          span: 16
-        }
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
       },
       form: {
-        time: ''
+        name: '', // 产品名称
+        code: '', //  产品编码
+        origCode: '', //  原厂编码
+        otherCode: '', // 其他编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn3: '', //  产品三级分类
+        productType: [], //  产品分类
+        unit: '', //  单位
+        packQty: '', // 包装数
+        packQtyUnit: undefined, // 包装数单位
+        arrowFalg: undefined, // 是否箭冠产品
+        productMsg: '', //  产品图片
+        size: '', // 产品尺寸
+        weight: '', // 产品重量
+        color: '', // 颜色
+        boxSize: '', // 内核尺寸
+        description: '', // 产品说明
+        otherDesc: '' // 其他说明
+      },
+      rules: {
+        name: [
+          { required: true, message: '请输入产品名称', trigger: 'blur' }
+        ],
+        code: [
+          { required: true, message: '请输入产品编码', trigger: 'blur' }
+        ],
+        productBrandSn: [
+          { required: true, message: '请选择产品品牌', trigger: 'change' }
+        ],
+        productType: [
+          { required: true, message: '请选择产品分类', trigger: 'change' }
+        ],
+        unit: [
+          { required: true, message: '请选择单位', trigger: 'change' }
+        ],
+        packQty: [
+          { required: true, message: '请输入包装数', trigger: 'blur' }
+        ],
+        arrowFalg: [
+          { required: true, message: '请选择是否为箭冠产品', trigger: 'change' }
+        ]
       },
-      rules: {},
-      brandData: [],
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      dateFormat: 'YYYY-MM-DD',
       productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  获取详情
+    getDetail () {
+      productSnDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.form = Object.assign(this.form, data)
+          this.form.productType = [ this.form.productTypeSn1, this.form.productTypeSn2, this.form.productTypeSn3 ]
+          this.$refs.editor.setHtml(res.data.description)
+          this.$refs.otherDesc.setHtml(res.data.otherDesc)
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+      })
     },
     // 提交
-    handleSubmit () {},
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      if (!this.form.productTypeSn3) {
+        this.$message.warning('产品分类未选到第三级,请修改后再提交!')
+        return
+      }
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.id = _this.$route.params.id ? _this.$route.params.id : undefined
+          delete form.productType
+          productSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.handleBack()
+              }, 1000)
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
     // 返回
     handleBack () {
       this.$router.push({ path: '/productManagement/productInfo/list' })
@@ -245,86 +313,51 @@ export default {
     changeHomeImage (file) {
       this.form.homeImage = file
     },
-    //  文本编辑器
-    editorChange (html, text) {
-      this.form.desc = html
+    // 产品说明 文本编辑器
+    editorDescriptionChange (html, text) {
+      this.form.description = html
+    },
+    //  其他说明 文本编辑器
+    editorOtherChange (html, text) {
+      this.form.otherDesc = html
     },
     //  产品分类  change
     changeProductType (val, opt) {
       this.form.productTypeSn3 = val[2] ? val[2] : ''
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
-    // 获取城市列表
-    getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.sn == val)
-      if (index >= 0) {
-        this.form.provinceName = this.addrProvinceList[index].name
-      }
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.form.citySn = undefined
-      this.form.countySn = undefined
-      this.form.supplierAddress = ''
-      this.getArea('city', val)
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.sn == val)
-      if (index >= 0) {
-        this.form.cityName = this.addrCityList[index].name
-      }
-      this.addrDistrictList = []
-      this.form.countySn = undefined
-      this.form.supplierAddress = ''
-      this.getArea('district', val)
-    },
-    // 区县变更
-    areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.sn == val)
-      if (index >= 0) {
-        this.form.countyName = this.addrDistrictList[index].name
-      }
-      this.form.supplierAddress = ''
+    //  产品品牌  列表
+    getProductBrand () {
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
     },
-    //  省/市/区
-    getArea (type, sn) {
-      let params
-      if (type == 'province') {
-        params = { level: '1' }
-      } else {
-        params = { psn: sn }
-      }
-      getArea(params).then(res => {
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
-            this.addrCityList = res.data || []
-          } else if (type == 'district') {
-            this.addrDistrictList = res.data || []
-          }
+          this.productTypeList = res.data
         } else {
-          if (type == 'province') {
-            this.addrProvinceList = []
-          } else if (type == 'city') {
-            this.addrCityList = []
-          } else if (type == 'district') {
-            this.addrDistrictList = []
-          }
+          this.productTypeList = []
         }
       })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getArea('province')
       vm.$refs.ruleForm.resetFields()
+      vm.getProductBrand()
+      vm.getProductType()
       if (vm.$route.params.id) { //  编辑页
-        // vm.getGoodsDetail()
+        vm.getDetail()
       }
     })
   }

+ 117 - 173
src/views/productManagement/productInfo/list.vue

@@ -5,45 +5,35 @@
       <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-range-picker
-                style="width:100%"
-                id="productInfoList-time"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+            <a-form-item label="产品名称">
+              <a-input id="productInfoList-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="productInfoList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            <a-form-item label="产品编码/原厂编码">
+              <a-input id="productInfoList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码/原厂编码">
-              <a-input id="productInfoList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            <a-form-item label="品牌">
+              <a-select
+                placeholder="请选择"
+                id="productInfoList-productBrandSn"
+                allowClear
+                v-model="queryParam.productBrandSn"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption">
+                <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+              </a-select>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="品牌">
-                <a-select
-                  placeholder="请选择"
-                  id="productInfoList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品分类">
                 <a-cascader
                   @change="changeProductType"
+                  expand-trigger="hover"
                   change-on-select
                   :options="productTypeList"
                   :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
@@ -53,8 +43,13 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="单据状态">
-                <v-select code="ENABLED_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择单据状态"></v-select>
+              <a-form-item label="产品状态">
+                <v-select code="ENABLED_FLAG" 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>
               </a-form-item>
             </a-col>
           </template>
@@ -72,9 +67,27 @@
     <!-- 操作按钮 -->
     <div class="table-operator">
       <a-button id="productInfoList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-      <a-button id="productInfoList-import" :loading="loading" @click="handleBatchAudit" style="margin: 0 15px;">批量审核</a-button>
-      <a-button id="productInfoList-import" :loading="loading" @click="handleBatchLaunch" style="margin: 0 15px;">批量上线</a-button>
-      <a-button id="productInfoList-import" :loading="loading" @click="handleBatchDownline" style="margin: 0 15px;">批量下线</a-button>
+      <a-button
+        id="productInfoList-import"
+        type="primary"
+        class="button-warning"
+        :loading="loading"
+        @click="handleBatchAudit"
+        style="margin: 0 15px;">批量审核</a-button>
+      <a-button
+        id="productInfoList-import"
+        type="primary"
+        class="button-primary"
+        :loading="loading"
+        @click="handleBatchLaunch"
+        style="margin: 0 15px;">批量上线</a-button>
+      <a-button
+        id="productInfoList-import"
+        type="primary"
+        class="button-grey"
+        :loading="loading"
+        @click="handleBatchDownline"
+        style="margin: 0 15px;">批量下线</a-button>
       <span style="margin-left: 8px">
         <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
       </span>
@@ -88,10 +101,10 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1830 }"
+      :scroll="{ x: 2140, y: tableHeight }"
       bordered>
       <!-- 自定义表头 -->
-      <template slot="terminaldsdPriceTitle">
+      <template slot="arrowFalgTitle">
         <a-tooltip placement="top">
           <template slot="title">
             <span>自有即箭冠产品,非自有即非箭冠产品</span>
@@ -99,134 +112,93 @@
           自有<a-icon type="question-circle" :style="{ marginLeft: '10px' }" />
         </a-tooltip>
       </template>
-      <!-- 产品图片 -->
-      <template slot="productPic" slot-scope="text, record">
-        <img :src="record.productPic[0]" width="30" height="30" class="productPic" @click="openPicModal=true" />
+      <template slot="arrowFalg" slot-scope="text, record">
+        <span v-if="record.arrowFalg">{{ record.arrowFalg == 1 ? '是' : '否' }}</span>
+        <span v-else>--</span>
       </template>
-      <!-- 产品类 -->
+      <!-- 产品类 -->
       <template slot="productType" slot-scope="text, record">
-        <a-tooltip placement="top">
-          <template slot="title">
-            <span>{{ record.productTypeName }}</span>
-          </template>
-          {{ record.productTypeName3 }}
-        </a-tooltip>
+        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+        <span v-else>--</span>
       </template>
-      <!-- 状态 -->
-      <template slot="status" slot-scope="text, record">
-        <a-tag :color="record.status==1?'green':'red'" >{{ record.status==1? '待提交': '待单据审核' }}</a-tag>
+      <!-- 定价状态 -->
+      <template slot="pricingState" slot-scope="text, record">
+        <a-badge :color="record.pricingState=='WAIT_PRICING'?'gold':record.pricingState=='WAIT_PRICING_AUDIT'?'volcano':'#87d068'" :text="record.pricingStateDictValue" />
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleAudit(record)" id="productInfoList-audit-btn">审核</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleLaunch(record)" id="productInfoList-launch-btn">上线</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDownline(record)" id="productInfoList-downline-btn">下线</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleEdit(record)" id="productInfoList-edit-btn">编辑</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="productInfoList-detail-btn">详情</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDel(record)" id="productInfoList-del-btn">删除</a-button>
+        <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" 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>
       </template>
     </s-table>
     <!-- 产品详情 -->
-    <product-info-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
-    <!-- 查看产品图片 -->
-    <look-pic-modal :openModal="openPicModal" :itemId="itemId" @close="closePicModal" />
+    <product-info-detail-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" />
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeQuery } from '@/api/dealerProductType'
-import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
 import productInfoDetailModal from './detailModal.vue'
-import lookPicModal from './lookPicModal.vue'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { productList, productAudit, productBatchAudit, productDel } from '@/api/product'
 export default {
-  components: { STable, VSelect, productInfoDetailModal, lookPicModal },
+  components: { STable, VSelect, productInfoDetailModal },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
-        productCode: '', //  产品编码
-        productName: '', //  产品名称
-        origCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级类别
-        productTypeSn2: '', //  产品二级类别
-        productTypeSn3: '', //  产品三级类别
-        enabledFlag: undefined //  状态
+        // name: '', //  产品名称
+        // queryWord: '', // 产品编码/原厂编码
+        // productBrandSn: undefined, //  产品品牌
+        // productTypeSn1: '', //  产品一级分类
+        // productTypeSn2: '', //  产品二级分类
+        // productTypeSn3: '', //  产品三级分类
+        // state: undefined, //  产品状态
+        // pricingState: undefined //  定价状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '产品图片', scopedSlots: { customRender: 'productPic' }, width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
-        { title: '原厂编码', dataIndex: 'origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center' },
+        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { slots: { title: 'terminaldsdPriceTitle' }, dataIndex: 'terminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '最后修改时间', dataIndex: 'cssreateDate', width: 160, align: 'center' },
-        { title: '产品状态', scopedSlots: { customRender: 'status' }, width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 310, align: 'center', fixed: 'right' }
+        { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: 100, align: 'center' },
+        { 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' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
       loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 创建时间
-        // if (this.time && this.time.length > 0) {
-        //   this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-        //   this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        // } else {
-        //   this.queryParam.beginDate = undefined
-        //   this.queryParam.endDate = undefined
-        // }
-        // return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //     const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
-        //     const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
-        //     const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
-        //     data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productPic: ['https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', 'https://qn.antdv.com/vue.png'], productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        return productList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
       },
       openModal: false, //  查看详情  弹框
-      openPicModal: false, //  查看图片 弹框
-      itemId: '', //  当前产品id
+      itemSn: '', //  当前sn
       productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  类下拉数据
+      productTypeList: [] //  分类下拉数据
     }
   },
   computed: {
@@ -235,19 +207,6 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
-    // // 批量出库
-    // handleOutbounds () {
-    //   this.loading = true
-    //   // ajax request after empty completing
-    //   setTimeout(() => {
-    //     this.loading = false
-    //     this.selectedRowKeys = []
-    //   }, 1000)
-    // },
     onSelectChange (selectedRowKeys) {
       console.log('selectedRowKeys changed: ', selectedRowKeys)
       this.selectedRowKeys = selectedRowKeys
@@ -264,7 +223,7 @@ export default {
         content: '确认要批量审核吗?',
         centered: true,
         onOk () {
-          // salesDel({ id: row.id }).then(res => {
+          // productBatchAudit({ sn: row.productSn }).then(res => {
           //   if (res.status == 200) {
           //     _this.$message.success(res.message)
           //     _this.$refs.table.refresh()
@@ -298,22 +257,20 @@ export default {
     handleBatchDownline () {},
     //  重置
     resetSearchForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.productName = ''
-      this.queryParam.origCode = ''
+      this.queryParam.name = ''
+      this.queryParam.queryWord = ''
       this.queryParam.productBrandSn = undefined
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
-      this.queryParam.enabledFlag = undefined
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.state = undefined
+      this.queryParam.pricingState = undefined
       this.$refs.table.refresh(true)
     },
     //  新增/编辑
     handleEdit (row) {
       if (row) { //  编辑
-        this.$router.push({ path: `/productManagement/productInfo/edit/${row.id}` })
+        this.$router.push({ path: `/productManagement/productInfo/edit/${row.id}/${row.productSn}` })
       } else { //  新增
         this.$router.push({ path: '/productManagement/productInfo/add' })
       }
@@ -326,12 +283,12 @@ export default {
         content: '确认要审核吗?',
         centered: true,
         onOk () {
-          // salesDel({ id: row.id }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          productAudit({ sn: row.productSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
@@ -362,12 +319,12 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
-          // salesDel({ id: row.id }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          productDel({ sn: row.productSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
@@ -378,20 +335,15 @@ export default {
     },
     //  详情
     handleDetail (row) {
-      this.itemId = row.id
+      this.itemSn = row.productSn
       this.openModal = true
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
+      this.itemSn = ''
       this.openModal = false
     },
-    // 关闭查看图片弹框
-    closePicModal () {
-      this.itemId = ''
-      this.openPicModal = false
-    },
-    //  产品类别  change
+    //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
@@ -399,7 +351,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
+      productBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -407,9 +359,9 @@ export default {
         }
       })
     },
-    //  产品类  列表
+    //  产品类  列表
     getProductType () {
-      dealerProductTypeQuery({}).then(res => {
+      productTypeQuery({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {
@@ -426,11 +378,3 @@ export default {
   }
 }
 </script>
-
-<style lang="less">
-  .productInfoList-wrap{
-    .productPic{
-      cursor: pointer;
-    }
-  }
-</style>

+ 0 - 118
src/views/productManagement/productInfo/lookPicModal.vue

@@ -1,118 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="productInfoPicDetail-modal"
-    :footer="null"
-    :maskClosable="false"
-    title="产品图片"
-    v-model="isShow"
-    @cancle="isShow=false"
-    :width="800">
-    <a-carousel arrows>
-      <div slot="prevArrow" slot-scope="props" class="custom-slick-arrow" style="left: 10px;zIndex: 1">
-        <a-icon type="left-circle" />
-      </div>
-      <div slot="nextArrow" slot-scope="props" class="custom-slick-arrow" style="right: 10px">
-        <a-icon type="right-circle" />
-      </div>
-      <div><h3>1</h3></div>
-      <div><h3>2</h3></div>
-      <div><h3>3</h3></div>
-      <div><h3>4</h3></div>
-    </a-carousel>
-    <div class="btn-cont"><a-button id="product-management-detail-modal-back" @click="isShow = false">返回列表</a-button></div>
-  </a-modal>
-</template>
-
-<script>
-// import { dealerProductDetail } from '@/api/dealerProduct'
-export default {
-  name: 'ProductInfoPicDetailModal',
-  props: {
-    openModal: { //  弹框显示状态
-      type: Boolean,
-      default: false
-    },
-    itemId: {
-      type: [Number, String],
-      default: ''
-    }
-  },
-  data () {
-    return {
-      isShow: this.openModal, //  是否打开弹框
-      detailsData: null //  详情数据
-    }
-  },
-  methods: {
-    //  获取详情
-    getDetail () {
-      // dealerProductDetail({ id: this.itemId }).then(res => {
-      //   if (res.status == 200) {
-      //     this.detailsData = res.data
-      //   }else{
-      //     this.detailsData = null
-      //   }
-      // })
-    }
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-      }
-    },
-    itemId (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.getDetail()
-      }
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .productInfoPicDetail-modal{
-    .ant-modal-body {
-    	padding: 40px 40px 24px;
-    }
-    .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
-    }
-  }
-</style>
-<style scoped>
-  /* For demo */
-  .ant-carousel >>> .slick-slide {
-    text-align: center;
-    height: 160px;
-    line-height: 160px;
-    background: #364d79;
-    overflow: hidden;
-  }
-
-  .ant-carousel >>> .custom-slick-arrow {
-    width: 25px;
-    height: 25px;
-    font-size: 25px;
-    color: #fff;
-    background-color: rgba(31, 45, 61, 0.11);
-    opacity: 0.3;
-  }
-  .ant-carousel >>> .custom-slick-arrow:before {
-    display: none;
-  }
-  .ant-carousel >>> .custom-slick-arrow:hover {
-    opacity: 0.5;
-  }
-
-  .ant-carousel >>> .slick-slide h3 {
-    color: #fff;
-  }
-</style>

+ 2 - 2
src/views/productManagement/productLevel/list.vue

@@ -96,8 +96,8 @@
 
 <script>
 import moment from 'moment'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeQuery } from '@/api/dealerProductType'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeQuery } from '@/api/dealerProductType'
 import { STable, VSelect } from '@/components'
 import productLevelEditModal from './editModal.vue'
 export default {

+ 2 - 2
src/views/productManagement/productPricing/list.vue

@@ -104,8 +104,8 @@
 </template>
 
 <script>
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeQuery } from '@/api/dealerProductType'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeQuery } from '@/api/dealerProductType'
 import { STable, VSelect } from '@/components'
 import productPricingEditModal from './editModal.vue'
 import productPricingAuditModal from './auditModal.vue'

+ 2 - 2
src/views/productManagement/purchaseBaseLimit/list.vue

@@ -100,8 +100,8 @@
 </template>
 
 <script>
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeQuery } from '@/api/dealerProductType'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeQuery } from '@/api/dealerProductType'
 import { STable, VSelect } from '@/components'
 import purchaseBaseLimitEditModal from './editModal.vue'
 export default {

+ 1 - 1
src/views/promotionRulesManagement/promotionRules/chooseImportModal.vue

@@ -57,7 +57,7 @@
 
 <script>
 import { STable } from '@/components'
-import { dealerProductList } from '@/api/dealerProduct'
+// import { dealerProductList } from '@/api/dealerProduct'
 export default {
   name: 'ChooseImportModal',
   components: { STable },

+ 3 - 3
src/views/promotionRulesManagement/promotionRules/chooseProductsModal.vue

@@ -89,9 +89,9 @@
 
 <script>
 import { STable } from '@/components'
-import { dealerProductList } from '@/api/dealerProduct'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+// import { dealerProductList } from '@/api/dealerProduct'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeList } from '@/api/dealerProductType'
 export default {
   name: 'ChooseProductsModal',
   components: { STable },

+ 3 - 3
src/views/promotionRulesManagement/promotionRules/list.vue

@@ -87,9 +87,9 @@
 
 <script>
 import moment from 'moment'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
-import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeList } from '@/api/dealerProductType'
+// import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
 export default {
   components: { STable, VSelect },

+ 2 - 2
src/views/salesManagement/salesQuery/queryPart.vue

@@ -171,8 +171,8 @@
 </template>
 
 <script>
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeList } from '@/api/dealerProductType'
 import { querySumByProductLocation } from '@/api/stock'
 import { warehouseAllList } from '@/api/warehouse'
 import productSalesRecordModal from './productSalesRecordModal.vue'

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.103:8503/qpls-md',
-        target: 'http://qpls-md.360arrow.com.cn/qpls-md',
+        target: 'http://192.168.16.194:8503/ocs',
+        // target: 'http://qpls-md.360arrow.com.cn/qpls-md',
         // target: 'https://it.test.qiubcar.com/zyit',
         ws: false,
         changeOrigin: true,