Bladeren bron

对接产品定价、产品变更记录

chenrui 4 jaren geleden
bovenliggende
commit
07c1fdb965

+ 12 - 0
src/api/product.js

@@ -167,3 +167,15 @@ export const productBatchOfflineAudit = (params) => {
     method: 'post'
   })
 }
+
+//  产品  价格变更记录  列表  分页
+export const productPriceChangeList = (params) => {
+  const url = `/product/queryPriceChangePage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 85 - 61
src/libs/getDate.js

@@ -1,65 +1,89 @@
 // 引入 moment 时间插件
-import moment from "moment";
-//获取今日/昨日/本周/上周/本月/上月 时间
+import moment from 'moment'
+moment.updateLocale('en', { week: {
+  dow: 1, // 星期的第一天是星期一
+  doy: 7 // 年份的第一周必须包含1月1日 (7 + 1 - 1)
+} })
+// 获取今日/昨日/本周/上周/本月/上月 时间
 export default {
-    // 获取今日的开始结束时间
-    getToday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().startOf("day").valueOf()).format("YYYY-MM-DD HH:mm:ss");
-        obj.endtime = moment(moment().valueOf()).format("YYYY-MM-DD HH:mm:ss");
-        return obj
-    },
-    // 获取昨日的开始结束时间
-    getYesterday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().add(-1, 'days').startOf("day").valueOf()).format("YYYY-MM-DD");
-        obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前周的开始结束时间
-    getCurrWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week()).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week()).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一周的开始结束时间
-    getLastWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前月的开始结束时间
-    getCurrMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month()).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一个月的开始结束时间
-    getLastMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
+  // 获取今日的开始结束时间
+  getToday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
     }
+    obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  //  近7天
+  getRecentday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment().subtract('days', 6).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取昨日的开始结束时间
+  getYesterday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前周的开始到当天结束时间
+  getCurrWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week()).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一周的开始结束时间
+  getLastWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始到当天结束时间
+  getCurrMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一个月的开始结束时间
+  getLastMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取近三个月的开始结束时间
+  getThreeMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 2).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 2).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  }
 }

+ 84 - 67
src/views/productManagement/priceChangeRecord/list.vue

@@ -17,12 +17,12 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="productChangeRecordList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="productChangeRecordList-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="productChangeRecordList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              <a-input id="productChangeRecordList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
@@ -30,9 +30,9 @@
               <a-form-item label="品牌">
                 <a-select
                   placeholder="请选择"
-                  id="productChangeRecordList-productBrandSn"
+                  id="productChangeRecordList-brandSn"
                   allowClear
-                  v-model="queryParam.productBrandSn"
+                  v-model="queryParam.brandSn"
                   :showSearch="true"
                   option-filter-prop="children"
                   :filter-option="filterOption">
@@ -44,12 +44,14 @@
               <a-form-item label="产品分类">
                 <a-cascader
                   @change="changeProductType"
+                  expand-trigger="hover"
                   change-on-select
                   :options="productTypeList"
                   :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
-                  id="productChangeRecordList-productType"
+                  id="productInfoList-productType"
                   placeholder="请选择产品分类"
-                  allowClear />
+                  allowClear
+                  v-model="productType" />
               </a-form-item>
             </a-col>
           </template>
@@ -81,12 +83,33 @@
       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.productEntity.productTypeName2 || record.productEntity.productTypeName3">{{ record.productEntity.productTypeName2 }} {{ record.productEntity.productTypeName3 ? '>' : '' }} {{ record.productEntity.productTypeName3 }}</span>
+        <span v-else>--</span>
+      </template>
+      <!-- 省级价变更后 -->
+      <template slot="afterProvincePrice" slot-scope="text, record">
+        <span v-if="record.afterProvincePrice || record.afterProvincePrice==0" :class="record.beforeProvincePrice != record.afterProvincePrice ? 'red' : ''">{{ record.afterProvincePrice }}</span>
+        <span v-else>--</span>
+      </template>
+      <!-- 市级价变更后 -->
+      <template slot="afterCityPrice" slot-scope="text, record">
+        <span v-if="record.afterCityPrice || record.afterCityPrice==0" :class="record.beforeCityPrice != record.afterCityPrice ? 'red' : ''">{{ record.afterCityPrice }}</span>
+        <span v-else>--</span>
+      </template>
+      <!-- 特约价变更后 -->
+      <template slot="afterSpecialPrice" slot-scope="text, record">
+        <span v-if="record.afterSpecialPrice || record.afterSpecialPrice==0" :class="record.beforeSpecialPrice != record.afterSpecialPrice ? 'red' : ''">{{ record.afterSpecialPrice }}</span>
+        <span v-else>--</span>
+      </template>
+      <!-- 终端价变更后 -->
+      <template slot="afterTerminalPrice" slot-scope="text, record">
+        <span v-if="record.afterTerminalPrice || record.afterTerminalPrice==0" :class="record.beforeTerminalPrice != record.afterTerminalPrice ? 'red' : ''">{{ record.afterTerminalPrice }}</span>
+        <span v-else>--</span>
+      </template>
+      <!-- 车主价变更后 -->
+      <template slot="afterCarOwnersPrice" slot-scope="text, record">
+        <span v-if="record.afterCarOwnersPrice || record.afterCarOwnersPrice==0" :class="record.beforeCarOwnersPrice != record.afterCarOwnersPrice ? 'red' : ''">{{ record.afterCarOwnersPrice }}</span>
+        <span v-else>--</span>
       </template>
     </s-table>
   </a-card>
@@ -94,42 +117,48 @@
 
 <script>
 import moment from 'moment'
-// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-// import { dealerProductTypeQuery } from '@/api/dealerProductType'
 import { STable, VSelect } from '@/components'
+import getDate from '@/libs/getDate.js'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { productPriceChangeList } from '@/api/product'
 export default {
   components: { STable, VSelect },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        productName: '', //  产品名称
-        productCode: '', //  产品编码
-        productBrandSn: undefined, //  品牌
+        name: '', //  产品名称
+        code: '', //  产品编码
+        brandSn: undefined, //  品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
+      productType: [],
       disabled: false, //  查询、重置按钮是否可操作
       dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ], //  变更时间
       exportLoading: false, // 导出loading
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { 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: 'productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '变更时间', dataIndex: 'updateDate', width: 160, align: 'center' },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 140, align: 'center' },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '单位', dataIndex: 'prodsuctBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         {
           title: '省级价',
           dataIndex: 'sdtermindfaldsdPrice',
           width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'shjbbb', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', dataIndex: 'shjaaa', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+            { title: '变更前', dataIndex: 'beforeProvincePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterProvincePrice' }, width: 100, align: 'center' }
           ]
         },
         {
@@ -138,8 +167,8 @@ export default {
           width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'sjbbb', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', dataIndex: 'sjaaa', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+            { title: '变更前', dataIndex: 'beforeCityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterCityPrice' }, width: 100, align: 'center' }
           ]
         },
         {
@@ -148,8 +177,8 @@ export default {
           width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'tybbb', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', dataIndex: 'tyaaa', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+            { title: '变更前', dataIndex: 'beforeSpecialPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterSpecialPrice' }, width: 100, align: 'center' }
           ]
         },
         {
@@ -158,8 +187,8 @@ export default {
           width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'zdbbb', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', dataIndex: 'zdaaa', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+            { title: '变更前', dataIndex: 'beforeTerminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterTerminalPrice' }, width: 100, align: 'center' }
           ]
         },
         {
@@ -168,51 +197,31 @@ export default {
           width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'czbbb', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', dataIndex: 'czaaa', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+            { title: '变更前', dataIndex: 'beforeCarOwnersPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterCarOwnersPrice' }, width: 100, align: 'center' }
           ]
         },
-        { title: '变更原因', dataIndex: 'sterminaldsdPriffce', width: 160, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '变更原因', dataIndex: 'changeReason', width: 160, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         // 变更时间
-        // if (this.time && this.time.length > 0) {
-        //   this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-        //   this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        // } else {
-        //   this.queryParam.beginDate = undefined
-        //   this.queryParam.endDate = undefined
-        // }
-        // return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //     const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
-        //     const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
-        //     const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
-        //     data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productPic: ['https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', 'https://qn.antdv.com/vue.png'], productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
+        if (this.time && this.time.length > 0) {
+          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        return productPriceChangeList(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
         })
       },
       productBrandList: [], //  品牌下拉数据
@@ -305,7 +314,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
+      productBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -315,7 +324,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeQuery({}).then(res => {
+      productTypeQuery({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {
@@ -332,3 +341,11 @@ export default {
   }
 }
 </script>
+
+<style lang="less" scoped>
+  .productChangeRecordList-wrap{
+    .red{
+      color: #ed1c24;
+    }
+  }
+</style>

+ 18 - 14
src/views/productManagement/productInfo/list.vue

@@ -72,21 +72,21 @@
         id="productInfoList-batchAudit"
         type="primary"
         class="button-warning"
-        :loading="loading"
+        :loading="loadingAudit"
         @click="handleBatchAudit"
         style="margin: 0 15px;">批量审核</a-button>
       <a-button
         id="productInfoList-batchLaunch"
         type="primary"
         class="button-primary"
-        :loading="loading"
+        :loading="loadingLaunch"
         @click="handleBatchLaunch"
         style="margin: 0 15px;">批量上线</a-button>
       <a-button
         id="productInfoList-batchDownline"
         type="primary"
         class="button-grey"
-        :loading="loading"
+        :loading="loadingDownline"
         @click="handleBatchDownline"
         style="margin: 0 15px;">批量下线</a-button>
       <span style="margin-left: 8px">
@@ -208,7 +208,9 @@ export default {
       ],
       selectedRowKeys: [], // Check here to configure the default column
       selectedRows: [],
-      loading: false,
+      loadingAudit: false,
+      loadingLaunch: false,
+      loadingDownline: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -217,8 +219,6 @@ 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
@@ -230,7 +230,7 @@ export default {
       openModal: false, //  查看详情  弹框
       itemSn: '', //  当前sn
       openOfflineModal: false, //  下线  弹框
-      nowData: null,  //  当前所选数据
+      nowData: null, //  当前所选数据
       productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
     }
@@ -286,10 +286,12 @@ export default {
         content: '已选有效数据' + num + '条,确认要批量审核吗?',
         centered: true,
         onOk () {
-          _this.loading = true
-          productBatchAudit({ snList: obj }).then(res => {
-            _this.loading = false
+          _this.loadingAudit = true
+          productBatchAudit(obj).then(res => {
+            _this.loadingAudit = false
             if (res.status == 200) {
+              _this.selectedRowKeys = []
+              _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
             }
@@ -321,10 +323,12 @@ export default {
         content: '已选有效数据' + num + '条,确认要批量上线吗?',
         centered: true,
         onOk () {
-          _this.loading = true
-          productBatchOnline({ snList: obj }).then(res => {
-            _this.loading = false
+          _this.loadingLaunch = true
+          productBatchOnline(obj).then(res => {
+            _this.loadingLaunch = false
             if (res.status == 200) {
+              _this.selectedRowKeys = []
+              _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
             }
@@ -393,7 +397,7 @@ export default {
     },
     // 下线
     handleDownline (row) {
-      
+
     },
     // 删除
     handleDel (row) {

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

@@ -139,7 +139,7 @@ export default {
       this.$refs.table.refresh(true)
     },
     // 单个审核
-    handleOutbound (row) {
+    handleAudit (row) {
       this.$confirm({
         title: '提示',
         content: '确认要上线审核吗?',
@@ -167,7 +167,7 @@ export default {
         centered: true,
         onOk () {
           _this.loading = true
-          productBatchOnlineAudit({ snList: _this.selectedRowKeys }).then(res => {
+          productBatchOnlineAudit(_this.selectedRowKeys).then(res => {
             _this.loading = false
             if (res.status == 200) {
               _this.$message.success(res.message)

+ 28 - 20
src/views/productManagement/productOfflineAudit/list.vue

@@ -77,7 +77,7 @@
     </div>
     <!-- 列表 -->
     <div style="margin-bottom: 15px">
-      <a-button type="primary" id="productOfflineAudit-export" :disabled="!hasSelected" :loading="loading" @click="handleOutbounds">批量审核</a-button>
+      <a-button type="primary" id="productOfflineAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
       <span style="margin-left: 8px">
         <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
       </span>
@@ -91,7 +91,7 @@
       :columns="columns"
       :data="loadData"
       :showPagination="false"
-      :scroll="{ x: 1450, y: tableHeight }"
+      :scroll="{ x: 1930, y: tableHeight }"
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
@@ -117,7 +117,7 @@
 import { STable, VSelect } from '@/components'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
-import { productOfflineList } from '@/api/product'
+import { productOfflineList, productOfflineAudit, productBatchOfflineAudit } from '@/api/product'
 export default {
   components: { STable, VSelect },
   data () {
@@ -131,16 +131,16 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'code', width: 140, align: 'center' },
+        { 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: 100, 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: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核人', dataIndex: 'totalPrice', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
@@ -197,33 +197,41 @@ export default {
       this.$refs.table.refresh(true)
     },
     // 单个审核
-    handleOutbound (row) {
+    handleAudit (row) {
       this.$confirm({
         title: '提示',
         content: '确认要下线审核通过吗?',
         centered: true,
         onOk () {
-          console.log('OK')
-        },
-        onCancel () {
-          console.log('Cancel')
+          productOfflineAudit({ 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: '确认要批量下线审核通过吗?',
         centered: true,
         onOk () {
-          this.loading = true
-          // 成功后
-          // this.loading = false
-          // this.selectedRowKeys = []
-        },
-        onCancel () {
-          console.log('Cancel')
+          _this.loading = true
+          productBatchOfflineAudit(_this.selectedRowKeys).then(res => {
+            _this.loading = false
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },

+ 5 - 6
src/views/productManagement/productPricing/auditModal.vue

@@ -32,7 +32,7 @@
           {{ 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-item label="变更原因">{{ detailsData.changeReason }}</a-descriptions-item>
       </a-descriptions>
       <div class="btn-cont">
         <a-button type="primary" id="productPricingAudit-save" @click="handleAudit">审核通过</a-button>
@@ -65,7 +65,7 @@ export default {
   methods: {
     //  获取详情
     getDetail () {
-      productPricingSnDetail({ id: this.itemSn }).then(res => {
+      productPricingSnDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           this.detailsData = res.data
         } else {
@@ -75,11 +75,10 @@ export default {
     },
     // 审核
     handleAudit () {
-      productPricingAudit({ id: this.itemSn }).then(res => {
+      productPricingAudit(this.detailsData).then(res => {
         if (res.status == 200) {
-          this.detailsData = res.data
-        } else {
-          this.detailsData = null
+          this.isShow = false
+          this.$emit('ok')
         }
       })
     }

+ 6 - 1
src/views/productManagement/productPricing/editModal.vue

@@ -127,7 +127,8 @@ export default {
         changeReason: [
           { required: true, message: '请选择变更原因', trigger: 'change' }
         ]
-      }
+      },
+      detailData: null //  数据详情
     }
   },
   methods: {
@@ -135,12 +136,14 @@ export default {
     getDetail () {
       productPricingSnDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
+          this.detailData = res.data
           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.detailData = null
           this.$refs.ruleForm.resetFields()
         }
       })
@@ -155,6 +158,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          form.id = this.detailData.id || undefined
           form.productSn = _this.itemSn
           productPricingSave(form).then(res => {
             if (res.status == 200) {
@@ -181,6 +185,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.$refs.ruleForm.resetFields()
       }
     },
     itemSn (newValue, oldValue) {

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

@@ -88,7 +88,7 @@
         <a-button
           size="small"
           type="link"
-          v-if="record.state=='WAIT_PRICING_AUDIT'"
+          v-if="record.pricingState=='WAIT_PRICING_AUDIT'"
           class="button-warning"
           @click="handleAudit(record)"
           id="productPricingList-audit-btn">审核</a-button>
@@ -98,7 +98,7 @@
     <!-- 编辑价格 -->
     <product-pricing-edit-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" @ok="$refs.table.refresh()" />
     <!-- 审核价格 -->
-    <product-pricing-audit-modal :openModal="openAuditModal" :itemSn="itemSn" @close="closeAuditModal" />
+    <product-pricing-audit-modal :openModal="openAuditModal" :itemSn="itemSn" @close="closeAuditModal" @ok="$refs.table.refresh()" />
   </a-card>
 </template>