Explorar o código

对接产品定价、产品上线审核、下线审核

chenrui %!s(int64=4) %!d(string=hai) anos
pai
achega
628aac12a8

+ 119 - 0
src/api/product.js

@@ -48,3 +48,122 @@ export const productBatchAudit = (params) => {
     method: 'post'
   })
 }
+//  产品 上线
+export const productOnline = (params) => {
+  return axios({
+    url: `/product/online/${params.sn}`,
+    method: 'get'
+  })
+}
+//  产品 下线
+export const productOffline = (params) => {
+  return axios({
+    url: `/product/offline/${params.sn}`,
+    method: 'get'
+  })
+}
+//  产品 批量上线
+export const productBatchOnline = (params) => {
+  return axios({
+    url: '/product/batchOnline',
+    data: params,
+    method: 'post'
+  })
+}
+//  产品 批量下线
+export const productBatchOffline = (params) => {
+  return axios({
+    url: '/product/batchOffline',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  产品  定价  列表  分页
+export const productPricingList = (params) => {
+  const url = `/product/queryPricingPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  产品  定价 详情  根据sn查询
+export const productPricingSnDetail = (params) => {
+  return axios({
+    url: `/product/getPricingInfo/${params.sn}`,
+    method: 'get'
+  })
+}
+//  产品  定价 编辑
+export const productPricingSave = (params) => {
+  return axios({
+    url: '/product/savePricing',
+    data: params,
+    method: 'post'
+  })
+}
+//  产品  定价 审核
+export const productPricingAudit = (params) => {
+  return axios({
+    url: '/product/auditPricing',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  产品  上线审核  列表  分页
+export const productOnlineList = (params) => {
+  const url = `/product/online/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  产品 上线审核  审核
+export const productOnlineAudit = (params) => {
+  return axios({
+    url: `/product/auditOnline/${params.sn}`,
+    method: 'get'
+  })
+}
+//  产品 批量上线审核
+export const productBatchOnlineAudit = (params) => {
+  return axios({
+    url: '/product/batchAuditOnline',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  产品  下线审核  列表  分页
+export const productOfflineList = (params) => {
+  const url = `/product/offline/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  产品 下线审核  审核
+export const productOfflineAudit = (params) => {
+  return axios({
+    url: `/product/auditOffline/${params.sn}`,
+    method: 'get'
+  })
+}
+//  产品 批量下线审核
+export const productBatchOfflineAudit = (params) => {
+  return axios({
+    url: '/product/batchAuditOffline',
+    data: params,
+    method: 'post'
+  })
+}

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

@@ -25,7 +25,7 @@
               <a-input
                 id="productInfoEdit-code"
                 :maxLength="100"
-                :disabled="form.state!='WAIT'"
+                :disabled="form.state&&form.state!='WAIT'"
                 v-model="form.code"
                 placeholder="请输入产品编码(最多100个字符)"
                 allowClear />
@@ -68,7 +68,7 @@
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="产品分类" prop="productType">
               <a-cascader
-                :disabled="form.state!='WAIT'"
+                :disabled="form.state&&form.state!='WAIT'"
                 expand-trigger="hover"
                 @change="changeProductType"
                 :options="productTypeList"

+ 69 - 20
src/views/productManagement/productInfo/list.vue

@@ -162,17 +162,20 @@
     </s-table>
     <!-- 产品详情 -->
     <product-info-detail-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" />
+    <!-- 产品下线 -->
+    <product-info-offline-modal :openModal="openOfflineModal" :nowData="nowData" @close="closeOfflineModal" />
   </a-card>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 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 } from '@/api/product'
+import { productList, productAudit, productBatchAudit, productDel, productOnline, productOffline, productBatchOnline, productBatchOffline } from '@/api/product'
 export default {
-  components: { STable, VSelect, productInfoDetailModal },
+  components: { STable, VSelect, productInfoDetailModal, productInfoOfflineModal },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -214,6 +217,8 @@ export default {
         }
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
+          data.pageNo = Number(data.pageNo)
+          data.pageSize = Number(data.pageSize)
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
@@ -224,6 +229,8 @@ export default {
       },
       openModal: false, //  查看详情  弹框
       itemSn: '', //  当前sn
+      openOfflineModal: false, //  下线  弹框
+      nowData: null,  //  当前所选数据
       productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
     }
@@ -279,7 +286,9 @@ export default {
         content: '已选有效数据' + num + '条,确认要批量审核吗?',
         centered: true,
         onOk () {
+          _this.loading = true
           productBatchAudit({ snList: obj }).then(res => {
+            _this.loading = false
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -290,27 +299,60 @@ export default {
     },
     // 批量上线
     handleBatchLaunch () {
-      if (this.selectedRowKeys.length < 1) {
-        this.$message.warning('请在列表勾选后再进行批量操作!')
+      const _this = this
+      if (_this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      let num = 0
+      const obj = []
+      _this.selectedRows.map(item => {
+        if (item.state == 'WAIT_ONLINE' || item.state == 'OFFLINE') {
+          num++
+          obj.push(item.productSn)
+        }
+      })
+      if (num < 1) {
+        _this.$message.warning('当前数据不可操作!')
         return
       }
-      const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要批量上线吗?',
+        content: '已选有效数据' + num + '条,确认要批量上线吗?',
         centered: true,
         onOk () {
-          // salesDel({ id: row.id }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          _this.loading = true
+          productBatchOnline({ snList: obj }).then(res => {
+            _this.loading = false
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
     // 批量下线
-    handleBatchDownline () {},
+    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
+      // }
+      this.openOfflineModal = true
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.name = ''
@@ -340,17 +382,19 @@ 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()
-          //   }
-          // })
+          productOnline({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
     // 下线
-    handleDownline (row) {},
+    handleDownline (row) {
+      
+    },
     // 删除
     handleDel (row) {
       const _this = this
@@ -383,6 +427,11 @@ export default {
       this.itemSn = ''
       this.openModal = false
     },
+    //  关闭下线弹框
+    closeOfflineModal () {
+      this.nowData = null
+      this.openOfflineModal = false
+    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''

+ 155 - 0
src/views/productManagement/productInfo/offlineModal.vue

@@ -0,0 +1,155 @@
+<template>
+  <a-modal
+    centered
+    class="productInfoOffline-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="提示"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <p v-if="loadData.length==1" style="font-weight: bold;margin-left: 20px;">确认要下线吗?</p>
+    <p v-else style="font-weight: bold;margin-left: 20px;">已选有效数据{{ loadData.length }}条,确认要批量下线吗?</p>
+    <a-form-model
+      id="productInfoEdit-form"
+      ref="ruleForm"
+      :model="form"
+      :rules="rules"
+      :label-col="formItemLayout.labelCol"
+      :wrapper-col="formItemLayout.wrapperCol">
+      <a-form-model-item label="下线选项" prop="unit">
+        <v-select
+          code="OFFLINE_REASON_TYPE"
+          id="productInfoOffline-unit"
+          v-model="form.unit"
+          allowClear
+          placeholder="请选择下线选项"
+        ></v-select>
+      </a-form-model-item>
+      <a-form-model-item label="通用编码" prop="unit">
+        <!-- 列表 -->
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :dataSource="loadData"
+          :pagination="false"
+          bordered>
+          <!-- 通用编码 -->
+          <template slot="universalCoding" slot-scope="text, record" >
+            <div>
+              <a-input
+                id="productInfoOffline-universalCoding"
+                :maxLength="60"
+                v-model="form.lowerLimit"
+                placeholder="请输入通用编码(最多60个字符)"
+                allowClear />
+            </div>
+          </template>
+        </a-table>
+      </a-form-model-item>
+      <a-form-model-item label="下线备注" prop="otherCode">
+        <a-textarea
+          id="productInfoOffline-otherCode"
+          :maxLength="60"
+          v-model="form.otherCode"
+          placeholder="请输入下线备注(最多60个字符)"
+          allowClear />
+      </a-form-model-item>
+    </a-form-model>
+    <div class="btn-cont">
+      <a-button type="primary" id="productInfoOffline-submit" @click="handleSubmit">确定</a-button>
+      <a-button id="productInfoOffline-cancel" @click="isShow = false" style="margin-left: 100px;">取消</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { productSnDetail } from '@/api/product'
+export default {
+  name: 'ProductInfoDetailModal',
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    nowData: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 3 },
+        wrapperCol: { span: 21 }
+      },
+      form: {
+        storageQuantity: undefined
+      },
+      rules: {
+        supplierName: [
+          { required: true, message: '请输入供应商名称', trigger: 'blur' }
+        ]
+      },
+      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' }
+      ],
+      loadData: []
+    }
+  },
+  methods: {
+    //  确定
+    handleSubmit () {
+      // productSnDetail({ sn: this.itemSn }).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')
+      }
+    },
+    nowData: {
+      handler (newValue, oldValue) {
+        if (this.isShow && newValue) {
+          // this.getDetail()
+        }
+      },
+      deep: true
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .productInfoOffline-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 87 - 110
src/views/productManagement/productLaunchAudit/list.vue

@@ -5,54 +5,36 @@
       <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="productLaunchAuditList-creatTime"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
+            <a-form-item label="产品名称">
+              <a-input id="productLaunchAuditList-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="productLaunchAuditList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            <a-form-item label="产品编码">
+              <a-input id="productLaunchAuditList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productLaunchAuditList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            <a-form-item label="审核状态">
+              <v-select
+                v-model="queryParam.billStatus"
+                ref="billStatus"
+                id="productLaunchAuditList-billStatus"
+                code="PAYMENT_TYPE"
+                placeholder="请选择审核状态"
+                allowClear></v-select>
             </a-form-item>
           </a-col>
-          <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="审核状态">
-                <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="productLaunchAuditList-billStatus"
-                  code="PAYMENT_TYPE"
-                  placeholder="请选择审核状态"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
-          </template>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productLaunchAuditList-refresh">查询</a-button>
             <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productLaunchAuditList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
           </a-col>
         </a-row>
       </a-form>
     </div>
     <!-- 列表 -->
     <div style="margin-bottom: 15px">
-      <a-button type="primary" id="productLaunchAudit-export" :disabled="!hasSelected" :loading="loading" @click="handleOutbounds">批量审核</a-button>
+      <a-button type="primary" id="productLaunchAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
       <span style="margin-left: 8px">
         <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
       </span>
@@ -61,82 +43,70 @@
       class="sTable"
       ref="table"
       size="default"
-      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
-      :rowKey="(record) => record.id"
+      :row-selection="rowSelection"
+      :rowKey="(record) => record.productSn"
       :columns="columns"
       :data="loadData"
       :showPagination="false"
-      :scroll="{ x: 1390 }"
+      :scroll="{ x: 1450, y: tableHeight }"
       bordered>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '已出库': '未出库' }}</a-tag>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+        <span v-else>--</span>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleOutbound(record)" id="productLaunchAuditList-out-btn">审核</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state=='WAIT'"
+          class="button-warning"
+          @click="handleAudit(record)"
+          id="productLaunchAuditList-audit-btn">审核</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
   </a-card>
 </template>
 
 <script>
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
 import { STable, VSelect } from '@/components'
+import { productOnlineList, productBatchOnlineAudit, productOnlineAudit } from '@/api/product'
 export default {
   components: { STable, VSelect },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        bundleName: '', //  供应商名称
+        name: '', //  名称
+        code: '', //  编码
         state: undefined //  状态
       },
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
-      brandData: [], //  客户 下拉数据
       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: '产品类别', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '提交时间', dataIndex: 'outTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '提交人', dataIndex: 'productType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核状态', scopedSlots: { customRender: 'state' }, width: 110, align: 'center' },
-        { title: '审核时间', dataIndex: 'authTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核人', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
+        { 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: '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: '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: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
       loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( 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', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
-          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)
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        return productOnlineList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          this.disabled = false
+          return data
         })
       }
     }
@@ -144,53 +114,66 @@ export default {
   computed: {
     hasSelected () {
       return this.selectedRowKeys.length > 0
+    },
+    rowSelection () {
+      return {
+        selectedRowKeys: this.selectedRowKeys,
+        onChange: (selectedRowKeys, selectedRows) => {
+          console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+          this.onSelectChange(selectedRowKeys)
+        },
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.state != 'WAIT'
+          }
+        })
+      }
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  重置
     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.state = undefined
       this.$refs.table.refresh(true)
     },
     // 单个审核
     handleOutbound (row) {
       this.$confirm({
         title: '提示',
-        content: '确认要上线审核通过吗?',
+        content: '确认要上线审核吗?',
         centered: true,
         onOk () {
-          console.log('OK')
-        },
-        onCancel () {
-          console.log('Cancel')
+          productOnlineAudit({ sn: row.productSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
     // 批量审核
-    handleOutbounds () {
+    handleBatchAudit () {
+      const _this = this
+      if (_this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
       this.$confirm({
         title: '提示',
-        content: '确认要批量上线审核通过吗?',
+        content: '确认要批量上线审核吗?',
         centered: true,
         onOk () {
-          this.loading = true
-          // 成功后
-          // this.loading = false
-          // this.selectedRowKeys = []
+          _this.loading = true
+          productBatchOnlineAudit({ snList: _this.selectedRowKeys }).then(res => {
+            _this.loading = false
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         },
         onCancel () {
           console.log('Cancel')
@@ -210,11 +193,5 @@ export default {
     .sTable{
       margin-top: 20px;
     }
-    .red{
-      color: #ed1c24;
-    }
-    .green{
-      color: #19be6b;
-    }
   }
 </style>

+ 55 - 55
src/views/productManagement/productOfflineAudit/list.vue

@@ -86,28 +86,38 @@
       class="sTable"
       ref="table"
       size="default"
-      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+      :row-selection="rowSelection"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
       :showPagination="false"
-      :scroll="{ x: 1770 }"
+      :scroll="{ x: 1450, y: tableHeight }"
       bordered>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '已出库': '未出库' }}</a-tag>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+        <span v-else>--</span>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleOutbound(record)" id="productOfflineAuditList-out-btn">审核</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state=='WAIT'"
+          class="button-warning"
+          @click="handleAudit(record)"
+          id="productOfflineAuditList-audit-btn">审核</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
   </a-card>
 </template>
 
 <script>
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
 import { STable, VSelect } from '@/components'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { productOfflineList } from '@/api/product'
 export default {
   components: { STable, VSelect },
   data () {
@@ -117,14 +127,11 @@ export default {
         bundleName: '', //  供应商名称
         state: undefined //  状态
       },
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
-      brandData: [], //  客户 下拉数据
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
+        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'code', width: 140, 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: 100, align: 'center', customRender: function (text) { return text || '--' } },
@@ -141,30 +148,13 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( 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', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
-          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)
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        return productOfflineList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          this.disabled = false
+          return data
         })
       },
       productBrandList: [], //  品牌下拉数据
@@ -174,13 +164,23 @@ export default {
   computed: {
     hasSelected () {
       return this.selectedRowKeys.length > 0
+    },
+    rowSelection () {
+      return {
+        selectedRowKeys: this.selectedRowKeys,
+        onChange: (selectedRowKeys, selectedRows) => {
+          console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+          this.onSelectChange(selectedRowKeys)
+        },
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.state != 'WAIT'
+          }
+        })
+      }
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -239,23 +239,23 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      // dealerProductBrandQuery({}).then(res => {
-      //   if (res.status == 200) {
-      //     this.productBrandList = res.data
-      //   } else {
-      //     this.productBrandList = []
-      //   }
-      // })
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
     },
     //  产品分类  列表
     getProductType () {
-      // dealerProductTypeQuery({}).then(res => {
-      //   if (res.status == 200) {
-      //     this.productTypeList = res.data
-      //   } else {
-      //     this.productTypeList = []
-      //   }
-      // })
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {

+ 40 - 40
src/views/productManagement/productPricing/auditModal.vue

@@ -9,15 +9,30 @@
     @cancle="isShow=false"
     :width="800">
     <!-- 定价审核 -->
-    <div>
+    <div v-if="detailsData">
       <a-descriptions bordered :column="1">
         <a-descriptions-item label="成本价">50.00</a-descriptions-item>
-        <a-descriptions-item label="省级价">60.00(原55.00)</a-descriptions-item>
-        <a-descriptions-item label="市级价">50.00</a-descriptions-item>
-        <a-descriptions-item label="特约价">50.00</a-descriptions-item>
-        <a-descriptions-item label="终端价">50.00</a-descriptions-item>
-        <a-descriptions-item label="车主价">50.00</a-descriptions-item>
-        <a-descriptions-item label="修改原因">价格变更</a-descriptions-item>
+        <a-descriptions-item label="省级价">
+          {{ detailsData.afterProvincePrice }}
+          <span v-if="detailsData.afterProvincePrice != detailsData.beforeProvincePrice">(原{{ detailsData.beforeProvincePrice }})</span>
+        </a-descriptions-item>
+        <a-descriptions-item label="市级价">
+          {{ detailsData.afterCityPrice }}
+          <span v-if="detailsData.afterCityPrice != detailsData.beforeCityPrice">(原{{ detailsData.beforeCityPrice }})</span>
+        </a-descriptions-item>
+        <a-descriptions-item label="特约价">
+          {{ detailsData.afterSpecialPrice }}
+          <span v-if="detailsData.afterSpecialPrice != detailsData.beforeSpecialPrice">(原{{ detailsData.beforeSpecialPrice }})</span>
+        </a-descriptions-item>
+        <a-descriptions-item label="终端价">
+          {{ detailsData.afterTerminalPrice }}
+          <span v-if="detailsData.afterTerminalPrice != detailsData.beforeTerminalPrice">(原{{ detailsData.beforeTerminalPrice }})</span>
+        </a-descriptions-item>
+        <a-descriptions-item label="车主价">
+          {{ detailsData.afterCarOwnersPrice }}
+          <span v-if="detailsData.afterCarOwnersPrice != detailsData.beforeCarOwnersPrice">(原{{ detailsData.beforeCarOwnersPrice }})</span>
+        </a-descriptions-item>
+        <a-descriptions-item label="变更原因">{{ detailsData.changeReasonDictValue }}</a-descriptions-item>
       </a-descriptions>
       <div class="btn-cont">
         <a-button type="primary" id="productPricingAudit-save" @click="handleAudit">审核通过</a-button>
@@ -28,7 +43,7 @@
 </template>
 
 <script>
-// import { dealerProductDetail } from '@/api/dealerProduct'
+import { productPricingSnDetail, productPricingAudit } from '@/api/product'
 export default {
   name: 'ProductPricingAuditModal',
   props: {
@@ -36,52 +51,37 @@ 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 productTypeName3 = this.detailsData.productTypeName3 ? ' > ' + this.detailsData.productTypeName3 : ''
-      return productTypeName1 + productTypeName2 + productTypeName3
-    }
-  },
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      formItemLayout: {
-        labelCol: { span: 4 },
-        wrapperCol: { span: 16 }
-      },
-      detailsData: null, //  详情数据
-      form: {
-        storageQuantity: ''
-      },
-      rules: {
-        supplierName: [
-          { required: true, message: '请输入供应商名称', trigger: 'blur' }
-        ]
-      },
-      brandData: []
+      detailsData: null //  详情数据
     }
   },
   methods: {
     //  获取详情
     getDetail () {
-      // dealerProductDetail({ id: this.itemId }).then(res => {
-      //   if (res.status == 200) {
-      //     this.detailsData = res.data
-      //   } else {
-      //     this.detailsData = null
-      //   }
-      // })
+      productPricingSnDetail({ id: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.detailsData = res.data
+        } else {
+          this.detailsData = null
+        }
+      })
     },
     // 审核
     handleAudit () {
-
+      productPricingAudit({ id: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.detailsData = res.data
+        } else {
+          this.detailsData = null
+        }
+      })
     }
   },
   watch: {
@@ -95,7 +95,7 @@ export default {
         this.$emit('close')
       }
     },
-    itemId (newValue, oldValue) {
+    itemSn (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.getDetail()
       }

+ 79 - 49
src/views/productManagement/productPricing/editModal.vue

@@ -21,62 +21,69 @@
         <a-form-model-item label="成本价" prop="supplierName">
           50.00
         </a-form-model-item>
-        <a-form-model-item label="省级价" prop="supplierName">
+        <a-form-model-item label="省级价" prop="afterProvincePrice">
           <a-input-number
-            id="productPricingEdit-storageQuantity"
-            v-model="form.storageQuantity"
+            id="productPricingEdit-afterProvincePrice"
+            v-model="form.afterProvincePrice"
             :precision="2"
             :min="1"
             :max="999999"
-            placeholder="请输入"
+            placeholder="请输入省级价"
             style="width: 100%;" />
         </a-form-model-item>
-        <a-form-model-item label="市级价" prop="supplierName">
+        <a-form-model-item label="市级价" prop="afterCityPrice">
           <a-input-number
-            id="productPricingEdit-storageQuantity"
-            v-model="form.storageQuantity"
+            id="productPricingEdit-afterCityPrice"
+            v-model="form.afterCityPrice"
             :precision="2"
             :min="1"
             :max="999999"
-            placeholder="请输入"
+            placeholder="请输入市级价"
             style="width: 100%;" />
         </a-form-model-item>
-        <a-form-model-item label="特约价" prop="supplierName">
+        <a-form-model-item label="特约价" prop="afterSpecialPrice">
           <a-input-number
-            id="productPricingEdit-storageQuantity"
-            v-model="form.storageQuantity"
+            id="productPricingEdit-afterSpecialPrice"
+            v-model="form.afterSpecialPrice"
             :precision="2"
             :min="1"
             :max="999999"
-            placeholder="请输入"
+            placeholder="请输入特约价"
             style="width: 100%;" />
         </a-form-model-item>
-        <a-form-model-item label="终端价" prop="supplierName">
+        <a-form-model-item label="终端价" prop="afterTerminalPrice">
           <a-input-number
-            id="productPricingEdit-storageQuantity"
-            v-model="form.storageQuantity"
+            id="productPricingEdit-afterTerminalPrice"
+            v-model="form.afterTerminalPrice"
             :precision="2"
             :min="1"
             :max="999999"
-            placeholder="请输入"
+            placeholder="请输入终端价"
             style="width: 100%;" />
         </a-form-model-item>
-        <a-form-model-item label="车主价" prop="supplierName">
+        <a-form-model-item label="车主价" prop="afterCarOwnersPrice">
           <a-input-number
-            id="productPricingEdit-storageQuantity"
-            v-model="form.storageQuantity"
+            id="productPricingEdit-afterCarOwnersPrice"
+            v-model="form.afterCarOwnersPrice"
             :precision="2"
             :min="1"
             :max="999999"
-            placeholder="请输入"
+            placeholder="请输入车主价"
             style="width: 100%;" />
         </a-form-model-item>
-        <a-form-model-item label="变更原因">
-          <a-select placeholder="请选择" id="productPricingEdit-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 label="变更原因" prop="changeReason">
+          <v-select
+            code="PRODUCT_PRICE_CHANGE_REASON"
+            id="productPricingEdit-changeReason"
+            v-model="form.changeReason"
+            allowClear
+            placeholder="请选择变更原因"
+          ></v-select>
         </a-form-model-item>
       </a-form-model>
+      <div style="margin-left: 40px;">
+        <a-icon type="exclamation-circle" style="margin-right: 10px;" />说明:各个价格至少有1个填写后才能保存成功。
+      </div>
       <div class="btn-cont">
         <a-button type="primary" id="productPricingEdit-save" @click="handleSave">保存</a-button>
         <a-button id="productPricingEdit-cancel" @click="isShow = false" style="margin-left: 100px;">取消</a-button>
@@ -86,27 +93,21 @@
 </template>
 
 <script>
-// import { dealerProductDetail } from '@/api/dealerProduct'
+import { VSelect } from '@/components'
+import { productPricingSnDetail, productPricingSave } from '@/api/product'
 export default {
   name: 'ProductPricingEditModal',
+  components: { VSelect },
   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, //  是否打开弹框
@@ -114,32 +115,61 @@ export default {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
-      detailsData: null, //  详情数据
       form: {
-        storageQuantity: ''
+        afterProvincePrice: '',
+        afterCityPrice: '',
+        afterSpecialPrice: '',
+        afterTerminalPrice: '',
+        afterCarOwnersPrice: '',
+        changeReason: ''
       },
       rules: {
-        supplierName: [
-          { required: true, message: '请输入供应商名称', trigger: 'blur' }
+        changeReason: [
+          { 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
-      //   }
-      // })
+      productPricingSnDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.form.afterProvincePrice = res.data.afterProvincePrice || ''
+          this.form.afterCityPrice = res.data.afterCityPrice || ''
+          this.form.afterSpecialPrice = res.data.afterSpecialPrice || ''
+          this.form.afterTerminalPrice = res.data.afterTerminalPrice || ''
+          this.form.afterCarOwnersPrice = res.data.afterCarOwnersPrice || ''
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+      })
     },
     // 保存
     handleSave () {
-
+      const _this = this
+      if (!this.form.afterProvincePrice && !this.form.afterCityPrice && !this.form.afterSpecialPrice && !this.form.afterTerminalPrice && !this.form.afterCarOwnersPrice) {
+        this.$message.warning('需至少填写1个价格,请修改后再提交!')
+        return
+      }
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.productSn = _this.itemSn
+          productPricingSave(form).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: {
@@ -153,7 +183,7 @@ export default {
         this.$emit('close')
       }
     },
-    itemId (newValue, oldValue) {
+    itemSn (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.getDetail()
       }

+ 63 - 75
src/views/productManagement/productPricing/list.vue

@@ -6,12 +6,12 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="productPricingList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="productPricingList-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="productPricingList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -24,7 +24,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>
@@ -33,17 +33,19 @@
               <a-form-item label="产品分类">
                 <a-cascader
                   @change="changeProductType"
+                  expand-trigger="hover"
                   change-on-select
                   :options="productTypeList"
                   :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
                   id="productPricingList-productType"
                   placeholder="请选择产品分类"
-                  allowClear />
+                  allowClear
+                  v-model="productType" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="定价状态">
-                <v-select code="ENABLED_FLAG" id="productPricingList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择定价状态"></v-select>
+                <v-select code="PRICING_STATUS" id="productPricingList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
               </a-form-item>
             </a-col>
           </template>
@@ -60,7 +62,7 @@
     </div>
     <!-- 总计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计:<strong>300</strong>条</div>
+      <div slot="message">合计:<strong>{{ total }}</strong>条</div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -74,110 +76,95 @@
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
-        <a-tooltip placement="top">
-          <template slot="title">
-            <span>{{ record.productTypeName }}</span>
-          </template>
-          {{ record.productTypeName3 }}
-        </a-tooltip>
-      </template>
-      <!-- 产品状态 -->
-      <template slot="status" slot-scope="text, record">
-        <a-tag :color="record.status==1?'green':'red'" >{{ record.status==1? '待提交': '待单据审核' }}</a-tag>
+        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+        <span v-else>--</span>
       </template>
       <!-- 定价状态 -->
-      <template slot="sstatus" 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="productPricingList-audit-btn">审核</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleEdit(record)" id="productPricingList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state=='WAIT_PRICING_AUDIT'"
+          class="button-warning"
+          @click="handleAudit(record)"
+          id="productPricingList-audit-btn">审核</a-button>
+        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productPricingList-edit-btn">编辑</a-button>
       </template>
     </s-table>
     <!-- 编辑价格 -->
-    <product-pricing-edit-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+    <product-pricing-edit-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" @ok="$refs.table.refresh()" />
     <!-- 审核价格 -->
-    <product-pricing-audit-modal :openModal="openAuditModal" :itemId="itemId" @close="closeAuditModal" />
+    <product-pricing-audit-modal :openModal="openAuditModal" :itemSn="itemSn" @close="closeAuditModal" />
   </a-card>
 </template>
 
 <script>
-// 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'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { productPricingList } from '@/api/product'
 export default {
   components: { STable, VSelect, productPricingEditModal, productPricingAuditModal },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
-        productName: '', //  产品名称
-        productCode: '', //  产品编码/原厂编码
-        productBrandSn: undefined, //  品牌
+        name: '', //  产品名称
+        queryWord: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        enabledFlag: undefined //  定价状态
+        pricingState: undefined //  定价状态
       },
+      productType: [],
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, 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: 'createDate', width: 160, 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: '产品状态', scopedSlots: { customRender: 'status' }, width: 120, align: 'center' },
-        { title: '定价状态', scopedSlots: { customRender: 'sstatus' }, width: 120, align: 'center' },
+        { title: '产品状态', dataIndex: 'stateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '定价状态', scopedSlots: { customRender: 'pricingState' }, width: 140, 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 || text == 0) ? text : '--') } },
-        { title: '市级价', dataIndex: 'fterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约价', dataIndex: 'gterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '终端价', dataIndex: 'hterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '车主价', dataIndex: 'terminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '省级价', dataIndex: 'provincePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '市级价', dataIndex: 'cityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '车主价', dataIndex: 'carOwnersPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, 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 productPricingList(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.total = data.count || 0
+          this.disabled = false
+          return data
         })
       },
+      total: 0, // 合计
       openModal: false, //  编辑  弹框
       openAuditModal: false, //  审核  弹框
-      itemId: '', //  当前产品id
+      itemSn: '', //  当前产品sn
       productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
     }
@@ -185,18 +172,19 @@ export default {
   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.pricingState = undefined
+      this.productType = []
       this.$refs.table.refresh(true)
     },
     // 审核
     handleAudit (row) {
-      this.itemId = row.id
+      this.itemSn = row.productSn
       this.openAuditModal = true
     },
     filterOption (input, option) {
@@ -206,17 +194,17 @@ export default {
     },
     //  编辑
     handleEdit (row) {
-      this.itemId = row.id
+      this.itemSn = row.productSn
       this.openModal = true
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
+      this.itemSn = ''
       this.openModal = false
     },
     //  关闭审核弹框
     closeAuditModal () {
-      this.itemId = ''
+      this.itemSn = ''
       this.openAuditModal = false
     },
     //  产品分类  change
@@ -227,7 +215,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
+      productBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -237,7 +225,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeQuery({}).then(res => {
+      productTypeQuery({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {