Browse Source

bug修复

chenrui 4 years ago
parent
commit
592145fe33

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

@@ -69,7 +69,7 @@
     </div>
     <!-- 总计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计:<strong>{{ total }}</strong></div>
+      <div slot="message">合计:<strong>{{ total }}</strong></div>
     </a-alert>
     <!-- 列表 -->
     <s-table

+ 48 - 12
src/views/productManagement/productInfoJg/list.vue

@@ -80,7 +80,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1340, y: tableHeight }"
+      :scroll="{ x: 1940, y: tableHeight }"
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
@@ -99,7 +99,7 @@
 import moment from 'moment'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { productTypeQuery } from '@/api/productType'
-import { productListPurchase } from '@/api/product'
+import { productList, getCurrentDealer } from '@/api/product'
 import { STable, VSelect } from '@/components'
 export default {
   components: { STable, VSelect },
@@ -123,15 +123,15 @@ export default {
       exportLoading: false, // 导出loading
       dateFormat: 'YYYY-MM-DD',
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'code', width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 240, align: 'center' },
-        { title: '终端价', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '状态', scopedSlots: { customRender: 'onlineFalgDictValue' }, width: 140, align: 'center' }
+        // { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        // { title: '产品编码', dataIndex: 'code', width: 140, align: 'center' },
+        // { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        // { title: '原厂编码', dataIndex: 'origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 240, align: 'center' },
+        // { title: '终端价', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        // { title: '状态', scopedSlots: { customRender: 'onlineFalgDictValue' }, width: 140, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -139,7 +139,7 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 210
         }
-        return productListPurchase(Object.assign(parameter, this.queryParam)).then(res => {
+        return productList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -173,6 +173,41 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
+    // 设置表头
+    getColumns () {
+      this.columns = [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center' },
+        { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { 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' }
+      ]
+      const cArr = [
+        { 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: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '状态', scopedSlots: { customRender: 'onlineFalgDictValue' }, width: 140, align: 'center' }
+      ]
+      getCurrentDealer().then(res => {
+        if (res.status == 200) {
+          if (res.data.dealerLevel && res.data.dealerLevel == 'PROVINCE') { //  省级
+            this.columns.push(
+              { 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 : '--') } }
+            )
+          } else if (res.data.dealerLevel && res.data.dealerLevel == 'CITY') { //  市级
+            this.columns.push(
+              { title: '市级价', dataIndex: 'cityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+            )
+          }
+          if (res.data.isShowSpecialPrice && res.data.isShowSpecialPrice == '0') { //  是否展示特约价
+            this.columns.push({ title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'center' })
+          }
+          this.columns = [...this.columns, ...cArr]
+        }
+      })
+    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -227,6 +262,7 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      vm.getColumns()
       vm.getProductBrand()
       vm.getProductType()
     })