فهرست منبع

对接产品品牌、产品级别,完善产品信息、产品上下线审核

chenrui 4 سال پیش
والد
کامیت
e7b884fe8e

+ 15 - 10
src/api/product.js

@@ -58,8 +58,9 @@ export const productOnline = (params) => {
 //  产品 下线
 export const productOffline = (params) => {
   return axios({
-    url: `/product/offline/${params.sn}`,
-    method: 'get'
+    url: `/product/offline`,
+    data: params,
+    method: 'post'
   })
 }
 //  产品 批量上线
@@ -70,14 +71,6 @@ export const productBatchOnline = (params) => {
     method: 'post'
   })
 }
-//  产品 批量下线
-export const productBatchOffline = (params) => {
-  return axios({
-    url: '/product/batchOffline',
-    data: params,
-    method: 'post'
-  })
-}
 
 //  产品  定价  列表  分页
 export const productPricingList = (params) => {
@@ -179,3 +172,15 @@ export const productPriceChangeList = (params) => {
     method: 'post'
   })
 }
+
+//  产品  级别 列表  分页
+export const productLevelList = (params) => {
+  const url = `/product/level/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 33 - 0
src/api/productBrand.js

@@ -8,3 +8,36 @@ export const productBrandQuery = (params) => {
     method: 'post'
   })
 }
+//  产品品牌 列表  分页
+export const productBrandList = (params) => {
+  const url = `/productBrand/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  产品品牌 保存
+export const productBrandSave = (params) => {
+  return axios({
+    url: '/productBrand/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  产品品牌 删除
+export const productBrandDel = (params) => {
+  return axios({
+    url: `/productBrand/delete/${params.sn}`,
+    method: 'get'
+  })
+}
+//  产品品牌 详情  根据sn查询
+export const productBrandSnDetail = (params) => {
+  return axios({
+    url: `/productBrand/findBySn/${params.sn}`,
+    method: 'get'
+  })
+}

+ 31 - 0
src/libs/commonData.js

@@ -0,0 +1,31 @@
+// 品牌  排序字母  下拉数据
+export default {
+  sortCharList: [
+    { id: 'A', name: 'A' },
+    { id: 'B', name: 'B' },
+    { id: 'C', name: 'C' },
+    { id: 'D', name: 'D' },
+    { id: 'E', name: 'E' },
+    { id: 'F', name: 'F' },
+    { id: 'G', name: 'G' },
+    { id: 'H', name: 'H' },
+    { id: 'I', name: 'I' },
+    { id: 'J', name: 'J' },
+    { id: 'K', name: 'K' },
+    { id: 'L', name: 'L' },
+    { id: 'M', name: 'M' },
+    { id: 'N', name: 'N' },
+    { id: 'O', name: 'O' },
+    { id: 'P', name: 'P' },
+    { id: 'Q', name: 'Q' },
+    { id: 'R', name: 'R' },
+    { id: 'S', name: 'S' },
+    { id: 'T', name: 'T' },
+    { id: 'U', name: 'U' },
+    { id: 'V', name: 'V' },
+    { id: 'W', name: 'W' },
+    { id: 'X', name: 'X' },
+    { id: 'Y', name: 'Y' },
+    { id: 'Z', name: 'Z' }
+  ]
+}

+ 25 - 42
src/views/productManagement/productBrand/detailModal.vue

@@ -8,22 +8,18 @@
     v-model="isShow"
     @cancle="isShow=false"
     width="80%">
-    <!-- 产品详情 -->
-    <div>
-      <a-descriptions bordered size="default">
+    <div v-if="detailsData">
+      <a-descriptions bordered size="default" :column="1">
         <a-descriptions-item label="品牌图片:">
-          <img
-            v-for="(item,index) in fileList"
-            :key="index"
-            :src="item.url"
-            title="点击查看大图"
-            class="productPic"
-            @click="getPreview(item.url)" />
+          <img :src="detailsData.imageUrl" title="点击查看大图" class="productPic" @click="getPreview(item.url)" />
+        </a-descriptions-item>
+        <a-descriptions-item label="品牌名称:">{{ detailsData.brandName || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="品牌类别:">{{ detailsData.brandType || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="排序字母:">{{ detailsData.sortChar || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="品牌介绍:">
+          <div v-if="detailsData.brandIntroduce" v-html="detailsData.brandIntroduce"></div>
+          <span v-else>--</span>
         </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>
       <div class="btn-cont"><a-button id="productBrandDetail-modal-back" @click="isShow = false">返回列表</a-button></div>
     </div>
@@ -34,53 +30,37 @@
 </template>
 
 <script>
-// import { dealerProductDetail } from '@/api/dealerProduct'
+import { productBrandSnDetail } from '@/api/productBrand'
 export default {
-  name: 'productBrandDetailModal',
+  name: 'ProductBrandDetailModal',
   props: {
     openModal: { //  弹框显示状态
       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 productTypeName3 = this.detailsData.productTypeName3 ? ' > ' + this.detailsData.productTypeName3 : ''
-      return productTypeName1 + productTypeName2 + productTypeName3
-    }
-  },
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  详情数据
       previewVisible: false,
-      previewImage: '',
-      fileList: [
-        {
-          uid: '-1',
-          name: 'image.png',
-          status: 'done',
-          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-        }
-      ]
+      previewImage: ''
     }
   },
   methods: {
     //  获取详情
     getDetail () {
-      // dealerProductDetail({ id: this.itemId }).then(res => {
-      //   if (res.status == 200) {
-      //     this.detailsData = res.data
-      //   } else {
-      //     this.detailsData = null
-      //   }
-      // })
+      productBrandSnDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.detailsData = res.data
+        } else {
+          this.detailsData = null
+        }
+      })
     },
     // 查看大图
     getPreview (url) {
@@ -99,7 +79,7 @@ export default {
         this.$emit('close')
       }
     },
-    itemId (newValue, oldValue) {
+    itemSn (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.getDetail()
       }
@@ -122,5 +102,8 @@ export default {
       text-align: center;
       margin: 35px 0 10px;
     }
+    .ant-descriptions-item-label.ant-descriptions-item-colon{
+      width: 120px;
+    }
   }
 </style>

+ 53 - 33
src/views/productManagement/productBrand/editModal.vue

@@ -18,37 +18,35 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="品牌名称" prop="productBrandName">
+        <a-form-model-item label="品牌名称" prop="brandName">
           <a-input
-            id="productBrandEdit-productBrandName"
+            id="productBrandEdit-brandName"
             :maxLength="30"
-            v-model="form.productBrandName"
+            v-model="form.brandName"
             placeholder="请输入产品品牌名称(最多30个字符)"
             allowClear />
         </a-form-model-item>
-        <a-form-model-item label="品牌类别" prop="productBrandName">
-          <a-select placeholder="请选择品牌类别" id="productBrandEdit-level" allowClear v-model="form.level">
-            <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 label="品牌分类" prop="brandType">
+          <v-select code="BRAND_TYPE" id="productBrandEdit-brandType" v-model="form.brandType" allowClear placeholder="请选择品牌分类"></v-select>
         </a-form-model-item>
-        <a-form-model-item label="排序字母" prop="productBrandName">
-          <a-select placeholder="请选择排序字母" id="productBrandEdit-level" allowClear v-model="form.levels">
-            <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
+        <a-form-model-item label="排序字母" prop="sortChar">
+          <a-select placeholder="请选择排序字母" id="productBrandEdit-sortChar" allowClear v-model="form.sortChar">
+            <a-select-option v-for="item in sortCharList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
           </a-select>
         </a-form-model-item>
-        <a-form-model-item label="品牌图片" prop="productBrandName">
+        <a-form-model-item label="品牌图片" prop="imageUrl">
           <Upload
             class="upload"
-            id="productBrandEdit-image"
-            v-model="form.image"
-            ref="image"
+            id="productBrandEdit-imageUrl"
+            v-model="form.imageUrl"
+            ref="imageUrl"
             :fileSize="0.25"
             @change="changeHomeImage"
             listType="picture-card" ></Upload>
           <span class="upload-desc">说明:图片比例1:1,尺寸为120*120px,可上传1张。</span>
         </a-form-model-item>
-        <a-form-model-item label="品牌介绍" prop="desc">
-          <editor id="productBrandEdit-editor" ref="editor" class="productBrandEdit-editor" @on-change="editorChange" :cache="false"></editor>
+        <a-form-model-item label="品牌介绍" prop="brandIntroduce">
+          <editor id="productBrandEdit-brandIntroduce" ref="editor" class="productBrandEdit-brandIntroduce" @on-change="editorChange" :cache="false"></editor>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
@@ -60,18 +58,19 @@
 </template>
 
 <script>
-import { STable, Upload } from '@/components'
+import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
-// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+import dataList from '@/libs/commonData'
+import { productBrandSnDetail, productBrandSave } from '@/api/productBrand'
 export default {
   name: 'ProductBrandEditModal',
-  components: { STable, Upload, Editor },
+  components: { VSelect, Upload, Editor },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemSn: {
       type: [Number, String],
       default: ''
     },
@@ -87,33 +86,56 @@ export default {
   },
   data () {
     return {
+      sortCharList: dataList.sortCharList,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
       form: {
-        productBrandName: '', // 产品品牌名称
-        image: '',
-        desc: ''
+        brandName: '', // 品牌名称
+        brandType: undefined,
+        sortChar: undefined,
+        imageUrl: '',
+        brandIntroduce: ''
       },
       rules: {
-        productBrandName: [
-          { required: true, message: '请输入产品品牌名称', trigger: 'blur' }
+        brandName: [
+          { required: true, message: '请输入品牌名称', trigger: 'blur' }
+        ],
+        brandType: [
+          { required: true, message: '请选择品牌分类', trigger: 'change' }
+        ],
+        sortChar: [
+          { required: true, message: '请选择排序字母', trigger: 'change' }
+        ],
+        imageUrl: [
+          { required: true, message: '请上传品牌图片', trigger: 'change' }
         ]
-      },
-      productBrandList: []
+      }
     }
   },
   methods: {
+    //  详情
+    getDetail () {
+      productBrandSnDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.form = Object.assign(this.form, data)
+          this.$refs.editor.setHtml(res.data.brandIntroduce)
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+      })
+    },
     //  保存
     handleSave () {
       const _this = this
       _this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const formData = JSON.parse(JSON.stringify(_this.form))
-          formData.id = _this.itemId ? _this.itemId : undefined
-          dealerProductBrandSave(formData).then(res => {
+          formData.brandSn = _this.itemSn ? _this.itemSn : undefined
+          productBrandSave(formData).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
@@ -127,11 +149,11 @@ export default {
     },
     //  图片上传
     changeHomeImage (file) {
-      this.form.image = file
+      this.form.imageUrl = file
     },
     //  文本编辑器
     editorChange (html, text) {
-      this.form.desc = html
+      this.form.brandIntroduce = html
     }
   },
   watch: {
@@ -143,8 +165,6 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-      } else {
-        this.form.productBrandName = this.nowData && this.nowData.productBrandName ? this.nowData.productBrandName : ''
       }
     }
   }

+ 42 - 58
src/views/productManagement/productBrand/list.vue

@@ -6,20 +6,18 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="品牌名称">
-              <a-input id="productBrandList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入品牌名称"/>
+              <a-input id="productBrandList-brandName" v-model.trim="queryParam.brandName" allowClear placeholder="请输入品牌名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="品牌分类">
-              <a-select placeholder="请选择品牌分类" id="productBrandList-level" allowClear v-model="queryParam.level">
-                <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
-              </a-select>
+              <v-select code="BRAND_TYPE" id="productBrandList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="排序字母">
-              <a-select placeholder="请选择排序字母" id="productBrandList-level" allowClear v-model="queryParam.level">
-                <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
+              <a-select placeholder="请选择排序字母" id="productBrandList-sortChar" allowClear v-model="queryParam.sortChar">
+                <a-select-option v-for="item in sortCharList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -49,17 +47,20 @@
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleEdit(record)" id="productBrandList-edit-btn">编辑</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="productBrandList-detail-btn">详情</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDel(record)" id="productBrandList-del-btn">删除</a-button>
+        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productBrandList-edit-btn">编辑</a-button>
+        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="productBrandList-detail-btn">详情</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="handleDel(record)"
+          id="productBrandList-del-btn">删除</a-button>
       </template>
     </s-table>
     <!-- 新增/编辑产品品牌 -->
-    <product-brand-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
+    <product-brand-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="$refs.table.refresh()" @close="closeModal" />
     <!-- 查看产品品牌 -->
-    <product-brand-detail-modal :openModal="openDetailModal" :itemId="itemId" @close="closeDetailModal" />
+    <product-brand-detail-modal :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
     <!-- 查看图片 -->
     <a-modal
       centered
@@ -76,86 +77,69 @@
 </template>
 
 <script>
-// import { dealerProductBrandList, dealerProductBrandUpdate } from '@/api/dealerProductBrand'
 import { STable, VSelect } from '@/components'
+import dataList from '@/libs/commonData'
 import productBrandEditModal from './editModal.vue'
 import productBrandDetailModal from './detailModal.vue'
+import { productBrandList, productBrandDel } from '@/api/productBrand'
 export default {
   components: { STable, VSelect, productBrandEditModal, productBrandDetailModal },
   data () {
     return {
+      sortCharList: dataList.sortCharList,
       queryParam: { //  查询条件
-        productBrandName: '', //  品牌名称
-        enabledFlag: undefined //  状态
+        brandName: '', //  品牌名称
+        brandType: undefined,
+        sortChar: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       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: 'productBrandName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '品牌分类', dataIndex: 'productssBrandName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '排序字母', dataIndex: 'firstChar', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌名称', dataIndex: 'brandName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌分类', dataIndex: 'brandType', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '排序字母', dataIndex: 'sortChar', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return dealerProductBrandList(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
-        //   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' }
-            ]
-          }
+        return productBrandList(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, //  查看图片 弹框
       openDetailModal: false, // 详情  弹框
-      itemId: '', //  当前id
+      itemSn: '', //  当前sn
       nowData: null, //  当前记录数据
-      nowPic: '', // 品牌图片
-      productBrandList: []
+      nowPic: '' // 品牌图片
     }
   },
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.productBrandName = ''
-      this.queryParam.enabledFlag = undefined
+      this.queryParam.brandName = ''
+      this.queryParam.brandType = undefined
+      this.queryParam.sortChar = undefined
       this.$refs.table.refresh(true)
     },
     //  新增/编辑
     handleEdit (row) {
-      this.itemId = row ? row.id : null
+      this.itemSn = row ? row.brandSn : null
       this.nowData = row || null
       this.openModal = true
     },
-    //  新增/编辑  成功
-    handleOk () {
-      this.$refs.table.refresh(true)
-    },
     // 详情
     handleDetail (row) {
-      this.itemId = row ? row.id : null
+      this.itemSn = row ? row.brandSn : null
       this.openDetailModal = true
     },
     // 查看图片
@@ -164,13 +148,13 @@ export default {
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
+      this.itemSn = ''
       this.nowData = null
       this.openModal = false
     },
     // 关闭详情弹框
     closeDetailModal () {
-      this.itemId = ''
+      this.itemSn = ''
       this.openDetailModal = false
     },
     // 删除
@@ -181,12 +165,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()
-          //   }
-          // })
+          productBrandDel({ sn: row.brandSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     }

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

@@ -273,7 +273,7 @@ export default {
     }
   },
   methods: {
-    //  获取详情
+    //  详情
     getDetail () {
       productSnDetail({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {

+ 26 - 23
src/views/productManagement/productInfo/list.vue

@@ -163,7 +163,7 @@
     <!-- 产品详情 -->
     <product-info-detail-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" />
     <!-- 产品下线 -->
-    <product-info-offline-modal :openModal="openOfflineModal" :nowData="nowData" @close="closeOfflineModal" />
+    <product-info-offline-modal :openModal="openOfflineModal" :offlineProductList="offlineProductList" @close="closeOfflineModal" @ok="$refs.table.refresh()" />
   </a-card>
 </template>
 
@@ -173,7 +173,7 @@ import productInfoDetailModal from './detailModal.vue'
 import productInfoOfflineModal from './offlineModal.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
-import { productList, productAudit, productBatchAudit, productDel, productOnline, productOffline, productBatchOnline, productBatchOffline } from '@/api/product'
+import { productList, productAudit, productBatchAudit, productDel, productOnline, productBatchOnline } from '@/api/product'
 export default {
   components: { STable, VSelect, productInfoDetailModal, productInfoOfflineModal },
   data () {
@@ -230,7 +230,7 @@ export default {
       openModal: false, //  查看详情  弹框
       itemSn: '', //  当前sn
       openOfflineModal: false, //  下线  弹框
-      nowData: null, //  当前所选数据
+      offlineProductList: [], //  下线 当前所选数据
       productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
     }
@@ -338,23 +338,23 @@ export default {
     },
     // 批量下线
     handleBatchDownline () {
-      // const _this = this
-      // if (_this.selectedRowKeys.length < 1) {
-      //   _this.$message.warning('请在列表勾选后再进行批量操作!')
-      //   return
-      // }
-      // let num = 0
-      // const obj = []
-      // _this.selectedRows.map(item => {
-      //   if (item.state == 'ONLINE') {
-      //     num++
-      //     obj.push(item.productSn)
-      //   }
-      // })
-      // if (num < 1) {
-      //   _this.$message.warning('当前数据不可操作!')
-      //   return
-      // }
+      const _this = this
+      if (_this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      let num = 0
+      _this.offlineProductList = []
+      _this.selectedRows.map(item => {
+        if (item.state == 'ONLINE') {
+          num++
+          _this.offlineProductList.push({ productSn: item.productSn, code: item.code, commonCode: '' })
+        }
+      })
+      if (num < 1) {
+        _this.$message.warning('当前数据不可操作!')
+        return
+      }
       this.openOfflineModal = true
     },
     //  重置
@@ -386,7 +386,7 @@ export default {
         content: '确认要上线吗?',
         centered: true,
         onOk () {
-          productOnline({ id: row.id }).then(res => {
+          productOnline({ sn: row.productSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -397,7 +397,8 @@ export default {
     },
     // 下线
     handleDownline (row) {
-
+      this.offlineProductList.push({ productSn: row.productSn, code: row.code, commonCode: '' })
+      this.openOfflineModal = true
     },
     // 删除
     handleDel (row) {
@@ -433,7 +434,9 @@ export default {
     },
     //  关闭下线弹框
     closeOfflineModal () {
-      this.nowData = null
+      this.selectedRowKeys = []
+      this.selectedRows = []
+      this.offlineProductList = []
       this.openOfflineModal = false
     },
     //  产品分类  change

+ 52 - 28
src/views/productManagement/productInfo/offlineModal.vue

@@ -17,44 +17,44 @@
       :rules="rules"
       :label-col="formItemLayout.labelCol"
       :wrapper-col="formItemLayout.wrapperCol">
-      <a-form-model-item label="下线选项" prop="unit">
+      <a-form-model-item label="下线选项" prop="offlineReasonType">
         <v-select
           code="OFFLINE_REASON_TYPE"
-          id="productInfoOffline-unit"
-          v-model="form.unit"
+          id="productInfoOffline-offlineReasonType"
+          v-model="form.offlineReasonType"
           allowClear
           placeholder="请选择下线选项"
         ></v-select>
       </a-form-model-item>
-      <a-form-model-item label="通用编码" prop="unit">
+      <a-form-model-item label="通用编码" :required="form.offlineReasonType=='通用'">
         <!-- 列表 -->
         <a-table
           class="sTable"
           ref="table"
           size="small"
-          :rowKey="(record) => record.id"
+          :rowKey="(record) => record.productSn"
           :columns="columns"
           :dataSource="loadData"
           :pagination="false"
           bordered>
           <!-- 通用编码 -->
-          <template slot="universalCoding" slot-scope="text, record" >
+          <template slot="commonCode" slot-scope="text, record" >
             <div>
               <a-input
-                id="productInfoOffline-universalCoding"
+                id="productInfoOffline-commonCode"
                 :maxLength="60"
-                v-model="form.lowerLimit"
+                v-model="record.commonCode"
                 placeholder="请输入通用编码(最多60个字符)"
                 allowClear />
             </div>
           </template>
         </a-table>
       </a-form-model-item>
-      <a-form-model-item label="下线备注" prop="otherCode">
+      <a-form-model-item label="下线备注" prop="offlineRemark">
         <a-textarea
-          id="productInfoOffline-otherCode"
+          id="productInfoOffline-offlineRemark"
           :maxLength="60"
-          v-model="form.otherCode"
+          v-model="form.offlineRemark"
           placeholder="请输入下线备注(最多60个字符)"
           allowClear />
       </a-form-model-item>
@@ -68,7 +68,7 @@
 
 <script>
 import { VSelect } from '@/components'
-import { productSnDetail } from '@/api/product'
+import { productOffline } from '@/api/product'
 export default {
   name: 'ProductInfoDetailModal',
   components: { VSelect },
@@ -77,7 +77,7 @@ export default {
       type: Boolean,
       default: false
     },
-    nowData: {
+    offlineProductList: {
       type: Array,
       default: () => {
         return []
@@ -92,31 +92,55 @@ export default {
         wrapperCol: { span: 21 }
       },
       form: {
-        storageQuantity: undefined
+        offlineReasonType: undefined,
+        offlineRemark: ''
       },
       rules: {
-        supplierName: [
-          { required: true, message: '请输入供应商名称', trigger: 'blur' }
+        offlineReasonType: [
+          { required: true, message: '请选择下线选项', trigger: 'change' }
         ]
       },
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用编码', scopedSlots: { customRender: 'universalCoding' }, align: 'center' }
+        { title: '通用编码', scopedSlots: { customRender: 'commonCode' }, align: 'center' }
       ],
       loadData: []
     }
   },
   methods: {
-    //  确定
+    //  确定 下线
     handleSubmit () {
-      // productSnDetail({ sn: this.itemSn }).then(res => {
-      //   if (res.status == 200) {
-      //     this.detailsData = res.data
-      //   } else {
-      //     this.detailsData = null
-      //   }
-      // })
+      const _this = this
+      if (_this.form.offlineReasonType == '通用') {
+        const arr = []
+        this.loadData.map((item, index) => {
+          if (!item.commonCode) {
+            arr.push(index + 1)
+          }
+        })
+        if (arr.length > 0) {
+          this.$message.warning('请将通用编码填写完整后再提交!')
+          return
+        }
+      }
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(_this.form))
+          params.offlineProductList = _this.loadData
+          productOffline(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.$emit('ok')
+                _this.isShow = false
+              }, 1000)
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     }
   },
   watch: {
@@ -130,10 +154,10 @@ export default {
         this.$emit('close')
       }
     },
-    nowData: {
+    offlineProductList: {
       handler (newValue, oldValue) {
         if (this.isShow && newValue) {
-          // this.getDetail()
+          this.loadData = JSON.parse(JSON.stringify(newValue))
         }
       },
       deep: true

+ 10 - 8
src/views/productManagement/productLaunchAudit/list.vue

@@ -17,10 +17,10 @@
           <a-col :md="6" :sm="24">
             <a-form-item label="审核状态">
               <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="productLaunchAuditList-billStatus"
-                code="PAYMENT_TYPE"
+                v-model="queryParam.state"
+                ref="state"
+                id="productLaunchAuditList-state"
+                code="PRODUCT_ONOFFLINE_STATUS"
                 placeholder="请选择审核状态"
                 allowClear></v-select>
             </a-form-item>
@@ -60,7 +60,7 @@
         <a-button
           size="small"
           type="link"
-          v-if="record.state=='WAIT'"
+          v-if="record.state=='WAIT_ONLINE_AUDIT'"
           class="button-warning"
           @click="handleAudit(record)"
           id="productLaunchAuditList-audit-btn">审核</a-button>
@@ -90,9 +90,9 @@ export default {
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
         { title: '提交时间', dataIndex: 'updateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '提交人', dataIndex: 'updatorName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
+        { title: '审核状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'onlineAuditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核人', dataIndex: 'onlineAuditPersonSn', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核人', dataIndex: 'onlineAuditPersonName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
@@ -124,7 +124,7 @@ export default {
         },
         getCheckboxProps: record => ({
           props: {
-            disabled: record.state != 'WAIT'
+            disabled: record.state != 'WAIT_ONLINE_AUDIT'
           }
         })
       }
@@ -170,6 +170,8 @@ export default {
           productBatchOnlineAudit(_this.selectedRowKeys).then(res => {
             _this.loading = false
             if (res.status == 200) {
+              _this.selectedRowKeys = []
+              _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
             }

+ 39 - 45
src/views/productManagement/productLevel/editModal.vue

@@ -18,26 +18,14 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="产品编码" prop="supplierName">
-          JG12131
+        <a-form-model-item label="产品编码">
+          {{ nowData&&nowData.code ? nowData.code : '--' }}
         </a-form-model-item>
-        <a-form-model-item label="产品名称" prop="supplierName">
-          50.00
+        <a-form-model-item label="产品名称">
+          {{ nowData&&nowData.name ? nowData.name : '--' }}
         </a-form-model-item>
-        <a-form-model-item label="产品级别">
-          <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>
-        </a-form-model-item>
-        <a-form-model-item label="装箱数量" prop="supplierName">
-          <a-input-number
-            id="productLevelEdit-storageQuantity"
-            v-model="form.storageQuantity"
-            :precision="2"
-            :min="1"
-            :max="999999"
-            placeholder="请输入"
-            style="width: 100%;" />
+        <a-form-model-item label="产品级别" prop="level">
+          <v-select code="PRODUCT_LEVEL" id="productLevelEdit-level" v-model="form.level" allowClear placeholder="请选择产品级别"></v-select>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
@@ -49,9 +37,11 @@
 </template>
 
 <script>
-// import { dealerProductDetail } from '@/api/dealerProduct'
+import { VSelect } from '@/components'
+import { productSave } from '@/api/product'
 export default {
   name: 'ProductLevelEditModal',
+  components: { VSelect },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -60,14 +50,12 @@ export default {
     itemId: {
       type: [Number, String],
       default: ''
-    }
-  },
-  computed: {
-    productTypeName () {
-      const productTypeName1 = this.detailsData.productTypeName1 ? this.detailsData.productTypeName1 : ''
-      const productTypeName2 = this.detailsData.productTypeName2 ? ' > ' + this.detailsData.productTypeName2 : ''
-      const productTypeName3 = this.detailsData.productTypeName3 ? ' > ' + this.detailsData.productTypeName3 : ''
-      return productTypeName1 + productTypeName2 + productTypeName3
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
     }
   },
   data () {
@@ -77,32 +65,38 @@ export default {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
-      detailsData: null, //  详情数据
       form: {
-        storageQuantity: undefined
+        level: undefined
       },
       rules: {
-        supplierName: [
-          { required: true, message: '请输入供应商名称', trigger: 'blur' }
+        level: [
+          { required: true, message: '请选择产品级别', trigger: 'change' }
         ]
-      },
-      brandData: []
+      }
     }
   },
   methods: {
-    //  获取详情
-    getDetail () {
-      // dealerProductDetail({ id: this.itemId }).then(res => {
-      //   if (res.status == 200) {
-      //     this.detailsData = res.data
-      //   } else {
-      //     this.detailsData = null
-      //   }
-      // })
-    },
     // 保存
     handleSave () {
-
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.nowData
+          params.level = _this.form.level
+          productSave(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.$emit('ok')
+                _this.isShow = false
+              }, 1000)
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     }
   },
   watch: {
@@ -118,7 +112,7 @@ export default {
     },
     itemId (newValue, oldValue) {
       if (this.isShow && newValue) {
-        this.getDetail()
+        this.form.level = this.nowData.level || undefined
       }
     }
   }

+ 44 - 68
src/views/productManagement/productLevel/list.vue

@@ -6,24 +6,26 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="productLevelList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="productLevelList-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="productLevelList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              <a-input id="productLevelList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
             </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' }"
                 id="productLevelList-productType"
                 placeholder="请选择产品分类"
-                allowClear />
+                allowClear
+                v-model="productType" />
             </a-form-item>
           </a-col>
           <template v-if="advanced">
@@ -37,15 +39,13 @@
                   :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-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品级别">
-                <a-select placeholder="请选择产品级别" id="productLevelList-level" allowClear v-model="queryParam.level">
-                  <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
-                </a-select>
+                <v-select code="PRODUCT_LEVEL" id="productLevelList-level" v-model="queryParam.level" allowClear placeholder="请选择产品级别"></v-select>
               </a-form-item>
             </a-col>
           </template>
@@ -77,12 +77,8 @@
       bordered>
       <!-- 产品分类 -->
       <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="action" slot-scope="text, record">
@@ -90,100 +86,83 @@
       </template>
     </s-table>
     <!-- 编辑价格 -->
-    <product-level-edit-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+    <product-level-edit-modal :openModal="openModal" :itemId="itemId" :nowData="nowData" @close="closeModal" @ok="$refs.table.refresh()" />
   </a-card>
 </template>
 
 <script>
 import moment from 'moment'
-// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-// import { dealerProductTypeQuery } from '@/api/dealerProductType'
 import { STable, VSelect } from '@/components'
 import productLevelEditModal from './editModal.vue'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { productLevelList } from '@/api/product'
 export default {
   components: { STable, VSelect, productLevelEditModal },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
-        productName: '', //  产品名称
-        productCode: '', //  产品编码/原厂编码
-        productBrandSn: undefined, //  品牌
+        name: '', //  产品名称
+        queryWord: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        enabledFlag: undefined //  定价状态
+        level: undefined
       },
+      productType: [],
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, 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: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '装箱数', dataIndex: 'sterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'sdterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品级别', dataIndex: 'fterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+        { title: '装箱数', dataIndex: 'packQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'packQtyUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品级别', dataIndex: 'level', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 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 productLevelList(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, //  编辑  弹框
       itemId: '', //  当前产品id
       productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      productTypeList: [], //  分类下拉数据
+      nowData: null
     }
   },
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.productName = ''
+      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.level = undefined
+      this.productType = []
       this.$refs.table.refresh(true)
     },
-    // 审核
-    handleAudit (row) {
-      this.itemId = row.id
-      this.openAuditModal = true
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -191,19 +170,16 @@ export default {
     },
     //  编辑
     handleEdit (row) {
+      this.nowData = row
       this.itemId = row.id
       this.openModal = true
     },
     //  关闭弹框
     closeModal () {
       this.itemId = ''
+      this.nowData = null
       this.openModal = false
     },
-    //  关闭审核弹框
-    closeAuditModal () {
-      this.itemId = ''
-      this.openAuditModal = false
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
@@ -235,7 +211,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
+      productBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -245,7 +221,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeQuery({}).then(res => {
+      productTypeQuery({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {

+ 45 - 30
src/views/productManagement/productOfflineAudit/list.vue

@@ -6,21 +6,21 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="productOfflineAuditList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="productOfflineAuditList-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="productOfflineAuditList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码/通用编码"/>
+              <a-input id="productOfflineAuditList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码/通用编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="下线选项">
               <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="productOfflineAuditList-billStatus"
-                code="PAYMENT_TYPE"
+                v-model="queryParam.offlineReasonType"
+                ref="offlineReasonType"
+                id="productOfflineAuditList-offlineReasonType"
+                code="OFFLINE_REASON_TYPE"
                 placeholder="请选择下线选项"
                 allowClear></v-select>
             </a-form-item>
@@ -36,7 +36,7 @@
                   :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-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -44,21 +44,23 @@
               <a-form-item label="产品分类">
                 <a-cascader
                   @change="changeProductType"
+                  expand-trigger="hover"
                   change-on-select
                   :options="productTypeList"
                   :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
                   id="productOfflineAuditList-productType"
                   placeholder="请选择产品分类"
-                  allowClear />
+                  allowClear
+                  v-model="productType" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="审核状态">
                 <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="productOfflineAuditList-billStatus"
-                  code="PAYMENT_TYPE"
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="productOfflineAuditList-state"
+                  code="PRODUCT_ONOFFLINE_STATUS"
                   placeholder="请选择审核状态"
                   allowClear></v-select>
               </a-form-item>
@@ -91,7 +93,7 @@
       :columns="columns"
       :data="loadData"
       :showPagination="false"
-      :scroll="{ x: 1930, y: tableHeight }"
+      :scroll="{ x: 2010, y: tableHeight }"
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
@@ -103,7 +105,7 @@
         <a-button
           size="small"
           type="link"
-          v-if="record.state=='WAIT'"
+          v-if="record.state=='WAIT_OFFLINE_AUDIT'"
           class="button-warning"
           @click="handleAudit(record)"
           id="productOfflineAuditList-audit-btn">审核</a-button>
@@ -124,23 +126,30 @@ export default {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        bundleName: '', //  供应商名称
+        name: '', //  产品名称
+        code: '', // 产品编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        offlineReasonType: undefined, // 下线选项
         state: undefined //  状态
       },
+      productType: [],
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'code', width: 220, align: 'center' },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '提交时间', dataIndex: 'outTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '提交人', dataIndex: 'productType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '下线选项', dataIndex: 'producstType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用编码', dataIndex: 'produdctType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '下线原因', dataIndex: 'productgType', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核状态', scopedSlots: { customRender: 'state' }, width: 110, align: 'center' },
-        { title: '审核时间', dataIndex: 'authTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核人', dataIndex: 'totalPrice', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提交时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提交人', dataIndex: 'creatorName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '下线选项', dataIndex: 'offlineReasonType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用编码', dataIndex: 'commonCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下线原因', dataIndex: 'offlineRemark', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'offlineAuditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核人', dataIndex: 'offlineAuditPersonName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
@@ -174,7 +183,7 @@ export default {
         },
         getCheckboxProps: record => ({
           props: {
-            disabled: record.state != 'WAIT'
+            disabled: record.state != 'WAIT_OFFLINE_AUDIT'
           }
         })
       }
@@ -188,16 +197,20 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.name = ''
+      this.queryParam.code = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.offlineReasonType = undefined
+      this.queryParam.state = undefined
+      this.productType = []
       this.$refs.table.refresh(true)
     },
     // 单个审核
     handleAudit (row) {
+      const _this = this
       this.$confirm({
         title: '提示',
         content: '确认要下线审核通过吗?',
@@ -228,6 +241,8 @@ export default {
           productBatchOfflineAudit(_this.selectedRowKeys).then(res => {
             _this.loading = false
             if (res.status == 200) {
+              _this.selectedRowKeys = []
+              _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
             }