Sfoglia il codice sorgente

合并develop分支更新内容

Merge branch 'develop' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_lcgz

# Conflicts:
#	src/views/financialManagement/financialCollection/list.vue
#	src/views/salesManagement/examineVerify/list.vue
#	src/views/salesManagement/pushOrderManagement/detail.vue
#	src/views/salesManagement/salesQuery/detail.vue
#	src/views/salesManagement/salesQuery/list.vue
chenrui 3 anni fa
parent
commit
1891c66b26
100 ha cambiato i file con 2898 aggiunte e 1703 eliminazioni
  1. 18 0
      src/api/checkWarehouse.js
  2. 16 0
      src/api/sales.js
  3. BIN
      src/assets/def_img@2x.png
  4. 2 1
      src/components/newThem.less
  5. 38 0
      src/config/router.config.js
  6. 14 7
      src/libs/exportExcel.js
  7. 22 2
      src/libs/getDate.js
  8. 20 10
      src/views/allocationManagement/transferOut/detail.vue
  9. 15 5
      src/views/allocationManagement/transferOut/edit.vue
  10. 15 7
      src/views/allocationManagement/transferOut/list.vue
  11. 7 4
      src/views/basicData/transferTypeManagement/list.vue
  12. 8 5
      src/views/basicData/warehouse/list.vue
  13. 8 5
      src/views/basicData/warehouse/storingLocation/list.vue
  14. 8 5
      src/views/common/chooseCustomerModal.vue
  15. 136 0
      src/views/dataExport/exportCheck/list.vue
  16. 9 6
      src/views/dealerManagement/dealerAccountManagement/list.vue
  17. 12 1
      src/views/dealerManagement/dealerRelationshipBinding/list.vue
  18. 8 5
      src/views/dealerManagement/marketingDivisionSet/list.vue
  19. 9 6
      src/views/dealerManagement/merchantInfoManagement/list.vue
  20. 10 7
      src/views/dealerManagement/merchantInfoManagement/permissionSetting.vue
  21. 8 5
      src/views/dealerManagement/rebateSettings/list.vue
  22. 34 22
      src/views/financialManagement/financialCollection/list.vue
  23. 45 27
      src/views/financialManagement/inventoryConfirmation/detail.vue
  24. 20 6
      src/views/financialManagement/inventoryConfirmation/list.vue
  25. 32 19
      src/views/financialManagement/returnConfirmation/detailModal.vue
  26. 30 18
      src/views/financialManagement/returnConfirmation/list.vue
  27. 24 12
      src/views/financialManagement/warehousingConfirmation/detailModal.vue
  28. 24 14
      src/views/financialManagement/warehousingConfirmation/list.vue
  29. 8 5
      src/views/inventoryManagement/intelligentReplenishment/import.vue
  30. 6 3
      src/views/inventoryManagement/intelligentReplenishment/list.vue
  31. 7 4
      src/views/inventoryManagement/intelligentReplenishment/productRange.vue
  32. 5 2
      src/views/inventoryManagement/intelligentReplenishment/serviceLevelModal.vue
  33. 29 12
      src/views/inventoryManagement/inventoryCheck/list.vue
  34. 16 13
      src/views/inventoryManagement/inventoryQuery/detailModal.vue
  35. 20 17
      src/views/inventoryManagement/inventoryQuery/list.vue
  36. 20 13
      src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue
  37. 14 11
      src/views/inventoryManagement/inventoryWarning/list.vue
  38. 8 5
      src/views/inventoryManagement/makeInventory/list.vue
  39. 8 5
      src/views/inventoryManagement/supervisionDisk/list.vue
  40. 8 5
      src/views/power/OperateJournal/OperateJournal.vue
  41. 10 6
      src/views/power/role/roleList.vue
  42. 15 7
      src/views/power/user/userList.vue
  43. 2 0
      src/views/power/user/userModal.vue
  44. 8 5
      src/views/productManagement/newProduct/list.vue
  45. 7 4
      src/views/productManagement/newProduct/modal.vue
  46. 59 49
      src/views/productManagement/priceChangeRecord/list.vue
  47. 8 5
      src/views/productManagement/productBrand/list.vue
  48. 11 7
      src/views/productManagement/productCategory/list.vue
  49. 21 8
      src/views/productManagement/productInfo/list.vue
  50. 5 2
      src/views/productManagement/productLaunchAudit/list.vue
  51. 12 9
      src/views/productManagement/productLevel/list.vue
  52. 5 2
      src/views/productManagement/productOfflineAudit/list.vue
  53. 58 41
      src/views/productManagement/productPricing/list.vue
  54. 18 24
      src/views/productManagement/productUniversal/list.vue
  55. 36 22
      src/views/promotionRulesManagement/orderStatistics/detailModal.vue
  56. 42 30
      src/views/promotionRulesManagement/orderStatistics/list.vue
  57. 35 21
      src/views/promotionRulesManagement/productStatistics/detailModal.vue
  58. 28 17
      src/views/promotionRulesManagement/productStatistics/list.vue
  59. 16 13
      src/views/promotionRulesManagement/promotionRules/list.vue
  60. 16 13
      src/views/promotionRulesManagement/promotionRules/rule.vue
  61. 28 18
      src/views/purchasingManagement/bulkWarehousingOrder/detailModal.vue
  62. 29 19
      src/views/purchasingManagement/bulkWarehousingOrder/edit.vue
  63. 27 19
      src/views/purchasingManagement/bulkWarehousingOrder/list.vue
  64. 42 29
      src/views/reportData/actualSalesReport/list.vue
  65. 50 41
      src/views/reportData/allocationDetails/list.vue
  66. 31 25
      src/views/reportData/allocationOrderTotal/list.vue
  67. 37 26
      src/views/reportData/allocationPresentation/list.vue
  68. 65 56
      src/views/reportData/billingReturnReport/list.vue
  69. 48 43
      src/views/reportData/hPriceDifferenceDetailReport/list.vue
  70. 34 27
      src/views/reportData/priceDifferenceDetailReport/list.vue
  71. 37 26
      src/views/reportData/returnGoodsPresentation/list.vue
  72. 64 55
      src/views/reportData/returnSlipReport/list.vue
  73. 42 29
      src/views/reportData/salesAmountReport/list.vue
  74. 60 51
      src/views/reportData/salesDetails/list.vue
  75. 64 54
      src/views/reportData/salesOrderTotal/list.vue
  76. 40 27
      src/views/reportData/salesPresentation/list.vue
  77. 70 63
      src/views/reportData/salesReturnDetailReport/list.vue
  78. 63 56
      src/views/reportData/salesReturnReport/list.vue
  79. 47 42
      src/views/reportData/salesReturnsReport/list.vue
  80. 40 29
      src/views/reportData/salesSlipReport/list.vue
  81. 28 17
      src/views/reportData/warehousingOrder/list.vue
  82. 34 22
      src/views/reportData/warehousingOrderDetail/list.vue
  83. 27 17
      src/views/salesManagement/backorder/detailModal.vue
  84. 26 15
      src/views/salesManagement/backorder/list.vue
  85. 32 21
      src/views/salesManagement/examineVerify/list.vue
  86. 27 18
      src/views/salesManagement/outboundOrder/list.vue
  87. 119 0
      src/views/salesManagement/priceInquiry/carInfoModal.vue
  88. 184 49
      src/views/salesManagement/priceInquiry/list.vue
  89. 40 28
      src/views/salesManagement/pushOrderManagement/detail.vue
  90. 29 21
      src/views/salesManagement/pushOrderManagement/list.vue
  91. 17 9
      src/views/salesManagement/salesQuery/chooseActive.vue
  92. 48 36
      src/views/salesManagement/salesQuery/detail.vue
  93. 32 21
      src/views/salesManagement/salesQuery/edit.vue
  94. 20 12
      src/views/salesManagement/salesQuery/list.vue
  95. 34 23
      src/views/salesManagement/salesQuery/queryPart.vue
  96. 16 8
      src/views/salesManagement/salesQuery/queryPromotable.vue
  97. 13 10
      src/views/salesManagement/salesQuery/receivingAddress/chooseAddressModal.vue
  98. 34 23
      src/views/salesManagement/salesReturn/detail.vue
  99. 34 25
      src/views/salesManagement/salesReturn/list.vue
  100. 33 14
      src/views/salesManagement/salesReturn/queryPart.vue

+ 18 - 0
src/api/checkWarehouse.js

@@ -134,3 +134,21 @@ export const checkWarehouseDetailFinanceList = (params) => {
     method: 'post'
   })
 }
+// 数据导出  导出盘点   盘点列表
+export const checkWarehouseExcelList = (params) => {
+  return axios({
+    url: `/checkWarehouse/excelList`,
+    method: 'get'
+  })
+}
+// 数据导出  导出盘点   盘点列表  导出
+export const checkWarehouseExport = params => {
+  const url = `/checkWarehouse/excel/${params.checkWarehouseSn}`
+  delete params.checkWarehouseSn
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 16 - 0
src/api/sales.js

@@ -177,3 +177,19 @@ export const salesDetailTypeExcel = params => {
     responseType: 'blob'
   })
 }
+// 车架号
+export const supperCodeByVin = (params) => {
+  return axios({
+    url: `/vinIdentify/queryPartCodeByVin/${params.vin}`,
+    method: 'get'
+  })
+}
+// 车架号  识别图片内容
+export const vinCodeParse = params => {
+  return axios.request({
+    url: `/vinIdentify/ocr`,
+    method: 'post',
+    data: params,
+    responseType: 'blob'
+  })
+}

BIN
src/assets/def_img@2x.png


+ 2 - 1
src/components/newThem.less

@@ -6,4 +6,5 @@
 @menu-item-height: 30px;
 @collapse-header-padding: 6px 8px;
 @table-padding-vertical: 5px;
-@table-padding-horizontal: 5px;
+@table-padding-horizontal: 5px;
+@input-disabled-bg: #dedede;

+ 38 - 0
src/config/router.config.js

@@ -1502,6 +1502,44 @@ export const asyncRouterMap = [
           }
         ]
       },
+      // 数据导出
+      {
+        path: '/dataExport',
+        redirect: '/dataExport/exportCheck',
+        component: PageView,
+        meta: {
+          title: '数据导出',
+          icon: 'money-collect',
+          permission: 'M_dataExport'
+        },
+        children: [
+          {
+            path: '/dataExport/exportCheck',
+            redirect: '/dataExport/exportCheck/list',
+            name: 'exportCheck',
+            component: BlankLayout,
+            meta: {
+              title: '导出盘点',
+              icon: 'gold',
+              permission: 'M_exportCheck'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'exportCheckList',
+                component: () => import(/* webpackChunkName: "dataExport" */ '@/views/dataExport/exportCheck/list.vue'),
+                meta: {
+                  title: '导出盘点',
+                  icon: 'gold',
+                  hidden: true,
+                  permission: 'M_exportCheck'
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 产品管理
       {
         path: '/productManagement',

+ 14 - 7
src/libs/exportExcel.js

@@ -29,13 +29,20 @@ export const hdExportExcel = function (url, params, fileName, callback) {
 // 导出下载excel
 export const downloadExcel = function (data, fileName) {
   if (!data) { return }
-  const url = window.URL.createObjectURL(new Blob([data]))
-  const link = document.createElement('a')
-  link.style.display = 'none'
-  link.href = url
   const a = moment().format('YYYYMMDDHHmmss')
   const fname = fileName + a
-  link.setAttribute('download', fname + '.xlsx')
-  document.body.appendChild(link)
-  link.click()
+  const blob = new Blob([data], { type: 'application/vnd.ms-excel' })
+  if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+    navigator.msSaveBlob(blob, fname + '.xlsx')
+  } else {
+    const link = document.createElement('a')
+    link.style.display = 'none'
+    var href = URL.createObjectURL(blob)
+    link.href = href
+    link.setAttribute('download', fname + '.xlsx')
+    document.body.appendChild(link)
+    link.click()
+    document.body.removeChild(link)
+    window.URL.revokeObjectURL(href) // 释放掉blob对象
+  }
 }

+ 22 - 2
src/libs/getDate.js

@@ -86,8 +86,18 @@ export default {
     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() - 1).valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始到当天结束时间
+  getCurrLastMonthDays () {
     const obj = {
       starttime: '',
       endtime: ''
@@ -106,8 +116,18 @@ export default {
     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() - 3).valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 3).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取近三个月的开始结束时间
+  getThreeMonthCurrDays () {
     const obj = {
       starttime: '',
       endtime: ''

+ 20 - 10
src/views/allocationManagement/transferOut/detail.vue

@@ -64,7 +64,7 @@
           <div slot="message">
             总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
             <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
-            总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
+            <span v-if="$hasPermissions('B_isShowPrice')">总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong></span>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -107,12 +107,15 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return allocateBillDetailList(Object.assign(parameter, { allocateSn: this.outBizSn || this.$route.params.sn })).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
+          let data
+          if (res.status == 200) {
+            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.localDataSource = data.list
           }
-          this.localDataSource = data.list
           this.spinning = false
           return data
         })
@@ -135,14 +138,21 @@ export default {
         { title: '产品名称', dataIndex: 'productEntity.name', width: '27%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', dataIndex: 'qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价小计(¥)', dataIndex: 'totalPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本价', dataIndex: 'cost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', dataIndex: 'qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本小计(¥)', dataIndex: 'totalCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价小计(¥)', dataIndex: 'totalPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(8, 0, { title: '成本小计(¥)', dataIndex: 'totalCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 6 : 5
+        arr.splice(ind, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 3, 0, { title: '售价小计(¥)', dataIndex: 'totalPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     }
   },

+ 15 - 5
src/views/allocationManagement/transferOut/edit.vue

@@ -115,7 +115,7 @@
               <div slot="message">
                 总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
                 <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
-                总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
+                <span v-if="$hasPermissions('B_isShowPrice')">总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong></span>
               </div>
             </a-alert>
             <!-- 筛选条件 -->
@@ -304,14 +304,19 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productUnit', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action1' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
         arr.splice(4, 0, { title: '成本价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 5 : 4
+        arr.splice(ind, 0, { title: '售价', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     },
     chooseColumns () {
@@ -320,15 +325,20 @@ export default {
         { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
+        // { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
         arr.splice(4, 0, { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 5 : 4
+        arr.splice(ind, 0, { title: '售价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' })
+      }
       return arr
     }
   },

+ 15 - 7
src/views/allocationManagement/transferOut/list.vue

@@ -154,12 +154,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return allocateBillList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -179,8 +182,9 @@ export default {
         { title: '起止时间', scopedSlots: { customRender: 'promoDate' }, align: 'center', width: '8%' },
         { title: '调往对象', dataIndex: 'targetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -188,9 +192,13 @@ export default {
         { title: '打印次数', dataIndex: 'printCount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
         arr.splice(6, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 8 : 7
+        arr.splice(ind, 0, { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     }
   },

+ 7 - 4
src/views/basicData/transferTypeManagement/list.vue

@@ -68,10 +68,13 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return allocateTypeList(Object.assign(parameter, {})).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
+          let data
+          if (res.status == 200) {
+            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.spinning = false
           return data

+ 8 - 5
src/views/basicData/warehouse/list.vue

@@ -89,12 +89,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return warehouseList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 8 - 5
src/views/basicData/warehouse/storingLocation/list.vue

@@ -92,12 +92,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return warehouseLocList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 8 - 5
src/views/common/chooseCustomerModal.vue

@@ -122,12 +122,15 @@ export default {
       loadData: parameter => {
         this.disabled = true
         return dealerQueryList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           return data
         })
       },

+ 136 - 0
src/views/dataExport/exportCheck/list.vue

@@ -0,0 +1,136 @@
+<template>
+  <a-card size="small" :bordered="false" class="exportCheckList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          id="exportCheckList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="10" :sm="24">
+              <a-form-model-item label="选择盘点单" prop="checkWarehouseSn">
+                <a-select id="exportCheckList-print" v-model="queryParam.checkWarehouseSn" placeholder="请选择盘点单" allowClear>
+                  <a-select-option v-for="item in checkList" :value="item.checkWarehouseSn" :key="item.checkWarehouseSn">
+                    <span>{{ item.financeAuditTime }} - {{ item.checkWarehouseNo }}</span>
+                  </a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="exportCheckList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { checkWarehouseExcelList, checkWarehouseExport } from '@/api/checkWarehouse'
+import { hdExportExcel } from '@/libs/exportExcel'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        checkWarehouseSn: undefined
+      },
+      rules: {
+        'checkWarehouseSn': [{ required: true, message: '请选择盘点单', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      checkList: []
+    }
+  },
+  methods: {
+    getList () {
+      checkWarehouseExcelList().then(res => {
+        if (res.status == 200) {
+          this.checkList = res.data || []
+        } else {
+          this.checkList = []
+        }
+      })
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(checkWarehouseExport, params, '导出盘点', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.queryParam.checkWarehouseSn = undefined
+      this.$refs.ruleForm.resetFields()
+      this.getList()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 238
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .exportCheckList-wrap{
+    height: 99%;
+  }
+</style>

+ 9 - 6
src/views/dealerManagement/dealerAccountManagement/list.vue

@@ -122,13 +122,16 @@ export default {
         this.disabled = true
         this.spinning = true
         return dealerUserList(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
-            data.list[i].loginFlag = Number(data.list[i].loginFlag)
+          let data
+          if (res.status == 200) {
+            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
+              data.list[i].loginFlag = Number(data.list[i].loginFlag)
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 12 - 1
src/views/dealerManagement/dealerRelationshipBinding/list.vue

@@ -18,7 +18,7 @@
         </a-form>
       </div>
       <!-- 列表 -->
-      <a-tabs type="card" @change="tabChange" v-model="tabInd">
+      <a-tabs type="card" @change="tabChange" v-model="tabInd" class="relationshipBindingList-tabs">
         <a-tab-pane key="1" tab="省市级关系绑定"></a-tab-pane>
         <a-tab-pane key="2" tab="特约店关系绑定"></a-tab-pane>
       </a-tabs>
@@ -272,5 +272,16 @@ export default {
       overflow-y: scroll;
       height: 100%;
     }
+    // tab样式
+    .relationshipBindingList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
+      height: 30px!important;
+    }
+    .relationshipBindingList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
+      height: 30px!important;
+    }
+    .relationshipBindingList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
+      line-height: 26px!important;
+      height: 30px!important;
+    }
   }
 </style>

+ 8 - 5
src/views/dealerManagement/marketingDivisionSet/list.vue

@@ -76,12 +76,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return subareaQueryIncludeAreaAll(parameter).then(res => {
-          const data = res.data
-          const no = 0
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 9 - 6
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -148,13 +148,16 @@ export default {
         this.disabled = true
         this.spinning = true
         return dealerQueryList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          this.total = data.count || 0
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            this.total = data.count || 0
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 10 - 7
src/views/dealerManagement/merchantInfoManagement/permissionSetting.vue

@@ -117,14 +117,17 @@ export default {
         this.disabled = true
         this.spinning = true
         return dealerScopeList(Object.assign(parameter, this.queryParam, { dealerSn: this.$route.params.sn })).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 goodsType = data.list[i].goodsType
-            data.list[i].type = goodsType == 'PRODUCT' ? '产品' : goodsType == 'BRAND' ? '品牌' : goodsType == 'CATEGORY' ? '分类' : '--'
+          let data
+          if (res.status == 200) {
+            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 goodsType = data.list[i].goodsType
+              data.list[i].type = goodsType == 'PRODUCT' ? '产品' : goodsType == 'BRAND' ? '品牌' : goodsType == 'CATEGORY' ? '分类' : '--'
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 8 - 5
src/views/dealerManagement/rebateSettings/list.vue

@@ -97,12 +97,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return queryRebatePage(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 34 - 22
src/views/financialManagement/financialCollection/list.vue

@@ -185,34 +185,21 @@ export default {
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  审核时间
       advanced: false,
-      columns: [
-        { title: '审核时间', dataIndex: 'createDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'bizNo' }, width: '10%', align: 'center' },
-        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '10%', align: 'center' },
-        { title: '经销商名称', dataIndex: 'settleClientName', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收款时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收款方式', dataIndex: 'settleStyleDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'remark', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据状态', dataIndex: 'voidFlag', scopedSlots: { customRender: 'voidFlag' }, width: '6%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '4%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return settleReceiptList(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
+          let data
+          if (res.status == 200) {
+            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.total = data.count || 0
+            this.disabled = false
           }
-          this.total = data.count || 0
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -223,6 +210,31 @@ export default {
       addrDistrictList: [] //  区下拉
     }
   },
+  // 根据权限显示列表字段
+  computed: {
+    columns () {
+      const arr = [
+        { title: '审核时间', dataIndex: 'createDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'bizNo' }, width: '10%', align: 'center' },
+        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '10%', align: 'center' },
+        { title: '经销商名称', dataIndex: 'settleClientName', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '销售金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收款时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款方式', dataIndex: 'settleStyleDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remark', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据状态', dataIndex: 'voidFlag', scopedSlots: { customRender: 'voidFlag' }, width: '6%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '4%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(6, 0, { title: '销售金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  审核时间  change
     dateAuditChange (date) {

+ 45 - 27
src/views/financialManagement/inventoryConfirmation/detail.vue

@@ -31,13 +31,19 @@
       <a-card size="small" :bordered="false" class="inventoryConfirmationDetail-cont">
         <!-- 总计 -->
         <a-alert type="info" style="margin-bottom:10px">
-          <div slot="message">
+          <div slot="message" style="display: flex;">
             盘盈数量:<strong :style="{ color: productTotal && productTotal.profitQty>0?'red':productTotal && productTotal.profitQty<0?'green':'' }">{{ productTotal && (productTotal.profitQty || productTotal.profitQty==0) ? productTotal.profitQty : '--' }}</strong>,
-            盘盈金额:<strong :style="{ color: productTotal && productTotal.profitCost>0?'red':productTotal && productTotal.profitCost<0?'green':'' }">{{ productTotal && (productTotal.profitCost || productTotal.profitCost==0) ? productTotal.profitCost : '--' }}</strong>,
+            <div v-if="$hasPermissions('B_isShowCost')">
+              盘盈金额:<strong :style="{ color: productTotal && productTotal.profitCost>0?'red':productTotal && productTotal.profitCost<0?'green':'' }">{{ productTotal && (productTotal.profitCost || productTotal.profitCost==0) ? productTotal.profitCost : '--' }}</strong>,
+            </div>
             盘亏数量:<strong :style="{ color: productTotal && productTotal.lossQty>0?'red':productTotal && productTotal.lossQty<0?'green':'' }">{{ productTotal && (productTotal.lossQty || productTotal.lossQty==0) ? productTotal.lossQty : '--' }}</strong>,
-            盘亏金额:<strong :style="{ color: productTotal && productTotal.lossCost>0?'red':productTotal && productTotal.lossCost<0?'green':'' }">{{ productTotal && (productTotal.lossCost || productTotal.lossCost==0) ? productTotal.lossCost : '--' }}</strong>,
+            <div v-if="$hasPermissions('B_isShowCost')">
+              盘亏金额:<strong :style="{ color: productTotal && productTotal.lossCost>0?'red':productTotal && productTotal.lossCost<0?'green':'' }">{{ productTotal && (productTotal.lossCost || productTotal.lossCost==0) ? productTotal.lossCost : '--' }}</strong>,
+            </div>
             盈亏总数量:<strong :style="{ color: productTotal && productTotal.profitLossQty>0?'red':productTotal && productTotal.profitLossQty<0?'green':'' }">{{ productTotal && (productTotal.profitLossQty	|| productTotal.profitLossQty ==0) ? productTotal.profitLossQty : '--' }}</strong>,
-            盈亏总金额:<strong :style="{ color: productTotal && productTotal.profitLossCost>0?'red':productTotal && productTotal.profitLossCost<0?'green':'' }">{{ productTotal && (productTotal.profitLossCost || productTotal.profitLossCost==0) ? productTotal.profitLossCost : '--' }}</strong>
+            <div v-if="$hasPermissions('B_isShowCost')">
+              盈亏总金额:<strong :style="{ color: productTotal && productTotal.profitLossCost>0?'red':productTotal && productTotal.profitLossCost<0?'green':'' }">{{ productTotal && (productTotal.profitLossCost || productTotal.profitLossCost==0) ? productTotal.profitLossCost : '--' }}</strong>
+            </div>
           </div>
         </a-alert>
         <!-- 搜索条件 -->
@@ -108,36 +114,23 @@ export default {
         profitLossFlag: undefined,
         productCode: ''
       },
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '入库时间', dataIndex: 'lastStockTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '批次', dataIndex: 'stockBatchNo', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点数量', dataIndex: 'checkQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '监盘数量', dataIndex: 'checkSuperviseQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单价', dataIndex: 'checkCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盈亏数量', dataIndex: 'profitLossQty', scopedSlots: { customRender: 'profitLossQty' }, width: '6%', align: 'center' },
-        { title: '盈亏金额', dataIndex: 'profitLossCost', scopedSlots: { customRender: 'profitLossCost' }, width: '6%', align: 'center' }
-      ],
+
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.$route.params.sn })
         return checkWarehouseDetailFinanceList(params).then(res => {
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -147,6 +140,31 @@ export default {
       productTotal: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '入库时间', dataIndex: 'lastStockTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次', dataIndex: 'stockBatchNo', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点数量', dataIndex: 'checkQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '监盘数量', dataIndex: 'checkSuperviseQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '单价', dataIndex: 'checkCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏数量', dataIndex: 'profitLossQty', scopedSlots: { customRender: 'profitLossQty' }, width: '6%', align: 'center' }
+      // { title: '盈亏金额', dataIndex: 'profitLossCost', scopedSlots: { customRender: 'profitLossCost' }, width: '6%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
+        arr.splice(11, 0, { title: '单价', dataIndex: 'checkCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(13, 0, { title: '盈亏金额', dataIndex: 'profitLossCost', scopedSlots: { customRender: 'profitLossCost' }, width: '6%', align: 'center' })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回列表
     handleBack () {

+ 20 - 6
src/views/financialManagement/inventoryConfirmation/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="inventoryConfirmationList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 标签页 -->
-      <a-tabs type="card" :default-active-key="queryParam.state" @change="handleTabChange" class="inventoryConfirmationList-tabs ">
+      <a-tabs type="card" :default-active-key="queryParam.state" @change="handleTabChange" class="inventoryConfirmationList-tabs">
         <a-tab-pane v-for="item in tabPaneData" :key="item.type">
           <span slot="tab">{{ item.name }}</span>
         </a-tab-pane>
@@ -86,12 +86,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return checkWarehouseList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -237,5 +240,16 @@ export default {
     .common{
       color: rgba(0, 0, 0, 0.65);
     }
+    // tab样式
+    .inventoryConfirmationList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
+      height: 30px!important;
+    }
+    .inventoryConfirmationList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
+      height: 30px!important;
+    }
+    .inventoryConfirmationList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
+      line-height: 26px!important;
+      height: 30px!important;
+    }
   }
 </style>

+ 32 - 19
src/views/financialManagement/returnConfirmation/detailModal.vue

@@ -24,7 +24,7 @@
               <a-descriptions-item label="退货数量">{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="坏件数量">{{ detailData&&(detailData.totalBadQty || detailData.totalBadQty==0) ? detailData.totalBadQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="返库数量">{{ detailData&&(detailData.totalBackStockQty || detailData.totalBackStockQty==0) ? detailData.totalBackStockQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货金额">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货金额" v-if="$hasPermissions('B_isShowPrice')">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -66,34 +66,47 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  详情数据
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo',width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%',align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '售价', dataIndex: 'price',width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货金额小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return salesReturnFinancialDetailList(Object.assign(parameter, { salesReturnBillSn: this.itemSn })).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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           return data
         })
       },
       detailData: null //  详情数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '售价', dataIndex: 'price',width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '退货金额小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'remark', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      // 售价权限
+      if (this.$hasPermissions('B_isShowPrice')) {
+        arr.splice(4, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '退货金额小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     getDetail () {
       salesReturnDetail({ sn: this.itemSn }).then(res => {

+ 30 - 18
src/views/financialManagement/returnConfirmation/list.vue

@@ -111,30 +111,20 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       advanced: true,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '16%', align: 'center' },
-        { title: '退货客户', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '是否抓单', dataIndex: 'grabFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '确认时间', dataIndex: 'confirmTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return salesReturnFinancialList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -143,6 +133,28 @@ export default {
       itemSn: ''
     }
   },
+  // 根据权限显示列表字段
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '16%', align: 'center' },
+        { title: '退货客户', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '是否抓单', dataIndex: 'grabFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '确认时间', dataIndex: 'confirmTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(6, 0, { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  创建时间  change
     dateChange (date) {

+ 24 - 12
src/views/financialManagement/warehousingConfirmation/detailModal.vue

@@ -55,27 +55,39 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  详情数据
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '7%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName',width: '45%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '入库数量(个)', dataIndex: 'putQty',width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库成本(¥)', dataIndex: 'putCost',width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return stockPutDetailList(Object.assign(parameter, { sn: this.itemSn })).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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           return data
         })
       }
     }
   },
+  computed: {
+    // 列表表头
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '7%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '45%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '入库数量(个)', dataIndex: 'putQty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '入库成本(¥)', dataIndex: 'putCost',width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(4, 0, { title: '入库成本(¥)', dataIndex: 'putCost', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {},
   watch: {
     //  父页面传过来的弹框状态

+ 24 - 14
src/views/financialManagement/warehousingConfirmation/list.vue

@@ -105,18 +105,6 @@ export default {
       },
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '入库时间', dataIndex: 'putTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库单号', scopedSlots: { customRender: 'stockPutNo' }, width: '16%', align: 'center' },
-        { title: '商户名称', dataIndex: 'providerName', align: 'center', width: '22%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '入库数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据状态', dataIndex: 'auditStateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'remark', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
-      ],
       selectedRowKeys: [], // Check here to configure the default column
       loading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -124,8 +112,11 @@ export default {
         this.disabled = true
         this.spinning = true
         return stockPutList(Object.assign(parameter, this.queryParam, { confirm: true })).then(res => {
-          const data = res.data
-          this.disabled = false
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.disabled = false
+          }
           this.spinning = false
           return data
         })
@@ -139,6 +130,25 @@ export default {
     }
   },
   computed: {
+    // 列表表头
+    columns () {
+      const arr = [
+        { title: '入库时间', dataIndex: 'putTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库单号', scopedSlots: { customRender: 'stockPutNo' }, width: '16%', align: 'center' },
+        { title: '商户名称', dataIndex: 'providerName', align: 'center', width: '22%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '入库数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据状态', dataIndex: 'auditStateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remark', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
+        arr.splice(4, 0, { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
     hasSelected () {
       return this.selectedRowKeys.length > 0
     },

+ 8 - 5
src/views/inventoryManagement/intelligentReplenishment/import.vue

@@ -75,12 +75,15 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return predictProductInfoGoods({ path: JSON.parse(this.$cookies.get('REPLENISHMENT_PATH')) }).then(res => {
-          const data = res.data
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
-            this.errorFlag.push(data.list[i].errorFlag)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = i + 1
+              this.errorFlag.push(data.list[i].errorFlag)
+            }
+            this.listData = data.list
           }
-          this.listData = data.list
           return data
         })
       },

+ 6 - 3
src/views/inventoryManagement/intelligentReplenishment/list.vue

@@ -83,9 +83,12 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return predictList({}).then(res => {
-          const data = res.data
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+            }
           }
           this.spinning = false
           return data

+ 7 - 4
src/views/inventoryManagement/intelligentReplenishment/productRange.vue

@@ -74,11 +74,14 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return predictRangeList({ 'sn': this.itemSn }).then(res => {
-          const data = res.data
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+            }
+            this.listData = data
           }
-          this.listData = data
           return data
         })
       },

+ 5 - 2
src/views/inventoryManagement/intelligentReplenishment/serviceLevelModal.vue

@@ -56,8 +56,11 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return predictTrendList({}).then(res => {
-          const data = res.data
-          this.listData = data
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.listData = data
+          }
           return data
         })
       },

+ 29 - 12
src/views/inventoryManagement/inventoryCheck/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="inventoryCheckList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 标签页 -->
-      <a-tabs type="card" :default-active-key="queryParam.deleteFlag" @change="handleTabChange" class="inventoryCheckList-tabs ">
+      <a-tabs type="card" :default-active-key="queryParam.deleteFlag" @change="handleTabChange" class="inventoryCheckList-tabs">
         <a-tab-pane v-for="item in tabPaneData" :key="item.type">
           <span slot="tab">{{ item.name }}</span>
         </a-tab-pane>
@@ -116,12 +116,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return checkWarehouseList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -176,13 +179,16 @@ export default {
         this.spinning = false
         if (res.status == 200) {
           if (res.data && res.data.length > 0) {
+            // this.modalHtml = `<div style="width: 100%">
+            //   <h3 style="font-size: 15px;font-weight: bold;margin: 20px 0 5px;text-align: center;">存在以下状态的销售单,无法盘点。</h3>
+            //   <h3 style="font-size: 15px;font-weight: bold;margin-bottom: 25px;text-align: center;">请先检查并处理完以下单据再试。</h3>
+            //   ${res.data.indexOf('WAIT_AUDIT') != -1 ? '<p>销售单-待审核(总部自建)</p>' : ''}
+            //   ${res.data.indexOf('AUDIT_REJECT') != -1 ? '<p>销售单-审核不通过(总部自建)</p>' : ''}
+            //   ${res.data.indexOf('HQ_CHANGE') != -1 ? '<p>销售单-总公司改单</p>' : ''}
+            //   ${res.data.indexOf('WAIT_PUSH') != -1 ? '<p>销售单-待下推</p>' : ''}
+            // </div>`
             this.modalHtml = `<div style="width: 100%">
-              <h3 style="font-size: 15px;font-weight: bold;margin: 20px 0 5px;text-align: center;">存在以下状态的销售单,无法盘点。</h3>
-              <h3 style="font-size: 15px;font-weight: bold;margin-bottom: 25px;text-align: center;">请先检查并处理完以下单据再试。</h3>
-              ${res.data.indexOf('WAIT_AUDIT') != -1 ? '<p>销售单-待审核(总部自建)</p>' : ''}
-              ${res.data.indexOf('AUDIT_REJECT') != -1 ? '<p>销售单-审核不通过(总部自建)</p>' : ''}
-              ${res.data.indexOf('HQ_CHANGE') != -1 ? '<p>销售单-总公司改单</p>' : ''}
-              ${res.data.indexOf('WAIT_PUSH') != -1 ? '<p>销售单-待下推</p>' : ''}
+              ${res.data.indexOf('WAIT_PUSH') != -1 ? '<p>存在“待下推”状态的销售单,无法盘点。</p>' : ''}
             </div>`
             this.openCommonModal = true
           } else {
@@ -271,5 +277,16 @@ export default {
     .common{
       color: rgba(0, 0, 0, 0.65);
     }
+    // tab样式
+    .inventoryCheckList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
+      height: 30px!important;
+    }
+    .inventoryCheckList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
+      height: 30px!important;
+    }
+    .inventoryCheckList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
+      line-height: 26px!important;
+      height: 30px!important;
+    }
   }
 </style>

+ 16 - 13
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -56,14 +56,17 @@ export default {
       loadData: parameter => {
         this.disabled = true
         return stockDetailList(Object.assign(parameter, { stockSn: this.itemId })).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
+          let data
+          if (res.status == 200) {
+            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
+            // 总计
+            this.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
           }
-          this.disabled = false
-          // 总计
-          this.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
           return data
         })
       },
@@ -87,16 +90,16 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '10%',align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center',width: '31%', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode',width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', width: '31%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库时间', dataIndex: 'putTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName',width: '6%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue',width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '6%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(9, 0, { title: '成本单价', dataIndex: 'putCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr

+ 20 - 17
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -169,22 +169,25 @@ export default {
           params.zeroQtyFlag = ''
         }
         return stockList(params).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
-          this.spinning = false
-          // 总计
-          this.getTotal(params)
-          // 产品分类
-          if (this.productTypeList.length == 0) {
-            this.getProductType()
-          }
-          // 产品品牌
-          if (this.productBrandList.length == 0) {
-            this.getProductBrand()
+          let data
+          if (res.status == 200) {
+            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
+            this.spinning = false
+            // 总计
+            this.getTotal(params)
+            // 产品分类
+            if (this.productTypeList.length == 0) {
+              this.getProductType()
+            }
+            // 产品品牌
+            if (this.productBrandList.length == 0) {
+              this.getProductBrand()
+            }
           }
           return data
         })
@@ -207,7 +210,7 @@ export default {
         { title: '可用库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '16%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(7, 0, { title: '可用库存成本', dataIndex: 'currentStockCost', width: '10%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr

+ 20 - 13
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -145,19 +145,22 @@ export default {
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam, { productSn: this.$route.params.sn })
         return stockFlowList(params).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
-            if (data.list[i].flowType == 'PUT') {
-              data.list[i].qty = data.list[i].putQty
-            } else if (data.list[i].flowType == 'OUT') {
-              data.list[i].qty = data.list[i].outQty
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              if (data.list[i].flowType == 'PUT') {
+                data.list[i].qty = data.list[i].putQty
+              } else if (data.list[i].flowType == 'OUT') {
+                data.list[i].qty = data.list[i].outQty
+              }
             }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
-          this.getTotal(params)
           return data
         })
       },
@@ -181,12 +184,16 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: '4%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '4%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '数量', scopedSlots: { customRender: 'qty' }, width: '4%', align: 'center' },
-        { title: '出入库状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总售价', dataIndex: 'totalPrice', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '出入库状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
+        // { title: '总成本', dataIndex: 'totalCost', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总售价', dataIndex: 'totalPrice', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(13, 0, { title: '总成本', dataIndex: 'totalCost', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+        arr.splice(arr.length, 0, { title: '总售价', dataIndex: 'totalPrice', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     }
   },

+ 14 - 11
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -204,20 +204,23 @@ export default {
         this.disabled = true
         this.spinning = true
         return stockWarnList(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
-            if (this.selectedRowKeys) { //  处理切换页码后 上页已选已输数据保留
-              const ind = this.selectedRowKeys.indexOf(data.list[i].id)
-              if (ind >= 0) {
-                data.list[i].inTransit = this.selectedRows[ind].inTransit
-                data.list[i].upperLimit = this.selectedRows[ind].upperLimit
-                data.list[i].lowerLimit = this.selectedRows[ind].lowerLimit
+          let data
+          if (res.status == 200) {
+            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
+              if (this.selectedRowKeys) { //  处理切换页码后 上页已选已输数据保留
+                const ind = this.selectedRowKeys.indexOf(data.list[i].id)
+                if (ind >= 0) {
+                  data.list[i].inTransit = this.selectedRows[ind].inTransit
+                  data.list[i].upperLimit = this.selectedRows[ind].upperLimit
+                  data.list[i].lowerLimit = this.selectedRows[ind].lowerLimit
+                }
               }
             }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 8 - 5
src/views/inventoryManagement/makeInventory/list.vue

@@ -75,12 +75,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return checkWarehouseList(Object.assign(parameter, this.queryParam, { state: 'WAIT_CHECK' })).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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 8 - 5
src/views/inventoryManagement/supervisionDisk/list.vue

@@ -78,12 +78,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return checkWarehouseList(Object.assign(parameter, this.queryParam, { state: 'WAIT_SUPERVISE_CHECK' })).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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 8 - 5
src/views/power/OperateJournal/OperateJournal.vue

@@ -83,12 +83,15 @@ export default {
         this.queryParam.beginDate = this.queryParam.beginDate + ' 00:00:00'
         this.queryParam.endDate = this.queryParam.endDate + ' 23:59:59'
         return journalList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           return data
         })
       }

+ 10 - 6
src/views/power/role/roleList.vue

@@ -123,14 +123,18 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return getPowerRoleList(Object.assign(parameter, this.queryParam)).then(res => {
-          const no = (res.data.pageNo - 1) * res.data.pageSize
-          for (let i = 0; i < res.data.list.length; i++) {
-            const _item = res.data.list[i]
-            _item.no = no + i + 1
-            _item.isEnable = _item.isEnable + '' === '1'
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+              _item.isEnable = _item.isEnable + '' === '1'
+            }
           }
           this.spinning = false
-          return res.data
+          return data
         })
       },
       optionAlertShow: false

+ 15 - 7
src/views/power/user/userList.vue

@@ -76,7 +76,7 @@
         </span>
       </s-table>
     </a-spin>
-    <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="showModal = false"></userModal>
+    <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="closeModal"></userModal>
     <!-- 分区设置 -->
     <UpdateArea ref="UpdateArea" :openUdModal="openUdModal" @ok="$refs.table.refresh(true)" @close="openUdModal=false"></UpdateArea>
   </a-card>
@@ -121,14 +121,18 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
-          const no = (res.data.pageNo - 1) * res.data.pageSize
-          for (let i = 0; i < res.data.list.length; i++) {
-            const _item = res.data.list[i]
-            _item.no = no + i + 1
-            _item.loginFlag = _item.loginFlag + '' === '1'
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+              _item.loginFlag = _item.loginFlag + '' === '1'
+            }
           }
           this.spinning = false
-          return res.data
+          return data
         })
       },
       optionAlertShow: false
@@ -140,6 +144,10 @@ export default {
       this.showModal = true
       this.itemData = null
     },
+    closeModal () {
+      this.showModal = false
+      this.itemData = null
+    },
     // 重置
     reset () {
       this.queryParam.name = ''

+ 2 - 0
src/views/power/user/userModal.vue

@@ -172,6 +172,8 @@ export default {
           params.roleNames = _this.form.roleNames.join(',')
           if (_this.nowData && _this.nowData.id) {
             params.id = _this.nowData.id
+          } else {
+            delete params.id
           }
           _this.spinning = true
           saveUserPower(params).then(res => {

+ 8 - 5
src/views/productManagement/newProduct/list.vue

@@ -142,12 +142,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return queryNewProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: this.$route.params.onlineFalg })).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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 7 - 4
src/views/productManagement/newProduct/modal.vue

@@ -41,10 +41,13 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return queryNewProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: this.onlineFalg })).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
+          let data
+          if (res.status == 200) {
+            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.spinning = false
           return data

+ 59 - 49
src/views/productManagement/priceChangeRecord/list.vue

@@ -69,7 +69,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1810, y: tableHeight }"
+        :scroll="{ x: 1520, y: tableHeight }"
         :defaultLoadData="false"
         bordered>
         <!-- 产品分类 -->
@@ -140,80 +140,90 @@ export default {
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  变更时间
       exportLoading: false, // 导出loading
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center', fixed: 'left' },
-        { title: '变更时间', dataIndex: 'updateDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        {
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return productPriceChangeList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            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.total = data.count || 0
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      total: 0,
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [] //  分类下拉数据
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 50, align: 'center', fixed: 'left' },
+        { title: '变更时间', dataIndex: 'updateDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 120, align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '变更原因', dataIndex: 'changeReason', width: 70, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(7, 0, {
           title: '省级价',
           dataIndex: 'sdtermindfaldsdPrice',
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeProvincePrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterProvincePrice' }, width: 80, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeProvincePrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterProvincePrice' }, width: 70, align: 'center' }
           ]
-        },
-        {
+        })
+        arr.splice(8, 0, {
           title: '市级价',
           dataIndex: 'sdterminaldsdPrice',
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeCityPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterCityPrice' }, width: 80, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeCityPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterCityPrice' }, width: 70, align: 'center' }
           ]
-        },
-        {
+        })
+        arr.splice(9, 0, {
           title: '特约价',
           dataIndex: 'gterminaldsdPrice',
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeSpecialPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterSpecialPrice' }, width: 80, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeSpecialPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterSpecialPrice' }, width: 70, align: 'center' }
           ]
-        },
-        {
+        })
+        arr.splice(10, 0, {
           title: '终端价',
           dataIndex: 'hterminaldsdPrice',
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeTerminalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterTerminalPrice' }, width: 80, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeTerminalPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterTerminalPrice' }, width: 70, align: 'center' }
           ]
-        },
-        {
+        })
+        arr.splice(11, 0, {
           title: '车主价',
           dataIndex: 'sterminaldsdPrice',
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeCarOwnersPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterCarOwnersPrice' }, width: 80, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeCarOwnersPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterCarOwnersPrice' }, width: 70, align: 'center' }
           ]
-        },
-        { title: '变更原因', dataIndex: 'changeReason', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        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.total = data.count || 0
-          this.disabled = false
-          this.spinning = false
-          return data
         })
-      },
-      total: 0,
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      }
+      return arr
     }
   },
   methods: {

+ 8 - 5
src/views/productManagement/productBrand/list.vue

@@ -127,12 +127,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return productBrandList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 11 - 7
src/views/productManagement/productCategory/list.vue

@@ -79,14 +79,18 @@ export default {
           this.tableHeight = window.innerHeight - 190
         }
         return productTypeQuery({}).then(res => {
-          //  递归去除空children
-          this.recursionFun(res.data)
-          if (res.data.length > 0) {
-            this.defaultExpandedRowKeys[0] = res.data[0].id
-          } else {
-            this.defaultExpandedRowKeys = []
+          let data
+          if (res.status == 200) {
+            data = res.data
+            //  递归去除空children
+            this.recursionFun(data)
+            if (data.length > 0) {
+              this.defaultExpandedRowKeys[0] = data[0].id
+            } else {
+              this.defaultExpandedRowKeys = []
+            }
           }
-          return res.data
+          return data
         })
       },
       defaultExpandedRowKeys: [], //  树形数据默认展开项

+ 21 - 8
src/views/productManagement/productInfo/list.vue

@@ -235,12 +235,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -250,7 +253,8 @@ export default {
       openOfflineModal: false, //  下线  弹框
       offlineProductList: [], //  下线 当前所选数据
       productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      productTypeList: [], //  分类下拉数据
+      pageFromInfo: null
     }
   },
   computed: {
@@ -594,6 +598,7 @@ export default {
     }
   },
   activated () {
+    const _this = this
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
@@ -602,11 +607,19 @@ export default {
     // 仅刷新列表,不重置页面
     if (this.$store.state.app.updateList) {
       this.pageInit()
-      this.$refs.table.refresh()
+      setTimeout(() => { //  解决 编辑页 返回列表 请求先前页的数据。新增页 返回列表 请求第一页的数据。延迟是为了解决先执行activated 后执行beforeRouteEnter的问题
+        if (_this.pageFromInfo && _this.pageFromInfo.name == 'productInfoAdd') {
+        	_this.resetSearchForm()
+        } else {
+        	_this.$refs.table.refresh()
+        }
+      }, 100)
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      vm.pageFromInfo = from
+    })
   }
 }
 </script>

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

@@ -106,8 +106,11 @@ export default {
         this.disabled = true
         this.spinning = true
         return productOnlineList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          this.disabled = false
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.disabled = false
+          }
           this.spinning = false
           return data
         })

+ 12 - 9
src/views/productManagement/productLevel/list.vue

@@ -133,16 +133,19 @@ export default {
         this.disabled = true
         this.spinning = true
         return productLevelList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            const packQty = (data.list[i].packQty || data.list[i].packQty == 0) ? data.list[i].packQty : '--'
-            const unit = data.list[i].unit || '--'
-            const packQtyUnit = data.list[i].packQtyUnit || '--'
-            data.list[i].packQtyV = packQty + unit + '/' + packQtyUnit
+          let data
+          if (res.status == 200) {
+            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 packQty = (data.list[i].packQty || data.list[i].packQty == 0) ? data.list[i].packQty : '--'
+              const unit = data.list[i].unit || '--'
+              const packQtyUnit = data.list[i].packQtyUnit || '--'
+              data.list[i].packQtyV = packQty + unit + '/' + packQtyUnit
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 5 - 2
src/views/productManagement/productOfflineAudit/list.vue

@@ -155,8 +155,11 @@ export default {
         this.disabled = true
         this.spinning = true
         return productOfflineList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          this.disabled = false
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.disabled = false
+          }
           this.spinning = false
           return data
         })

+ 58 - 41
src/views/productManagement/productPricing/list.vue

@@ -62,7 +62,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{x: 1870, y: tableHeight }"
+        :scroll="{y: tableHeight }"
         :defaultLoadData="false"
         bordered>
         <!-- 产品分类 -->
@@ -133,52 +133,21 @@ export default {
       },
       productType: [],
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
-        { title: '产品状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '定价状态', dataIndex: 'pricingStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', scopedSlots: { customRender: 'sterminaldsdPrice' }, width: 180, align: 'center' },
-        { title: '省级价', dataIndex: 'provincePrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价', dataIndex: 'cityPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约价', dataIndex: 'specialPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '终端价', dataIndex: 'terminalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '车主价', dataIndex: 'carOwnersPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-        // { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        // { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '产品名称', dataIndex: 'name', align: 'center',width: '13%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '产品编码', dataIndex: 'code', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '原厂编码', dataIndex: 'origCode', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '品牌', dataIndex: 'productBrandName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '7%', align: 'center' },
-        // { title: '产品状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '定价状态', dataIndex: 'pricingStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '成本价', scopedSlots: { customRender: 'sterminaldsdPrice' }, width: '7%', align: 'center' },
-        // { title: '省级价', dataIndex: 'provincePrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '市级价', dataIndex: 'cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '特约价', dataIndex: 'specialPrice', width: '5%',align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '终端价', dataIndex: 'terminalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '车主价', dataIndex: 'carOwnersPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         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
+          let data
+          if (res.status == 200) {
+            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.total = data.count || 0
+            this.disabled = false
           }
-          this.total = data.count || 0
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -191,6 +160,54 @@ export default {
       productTypeList: [] //  分类下拉数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'left', width: '13%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'code', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '7%', align: 'center' },
+        { title: '产品状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '定价状态', dataIndex: 'pricingStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价', scopedSlots: { customRender: 'sterminaldsdPrice' }, width: '7%', align: 'center' },
+        // { title: '省级价', dataIndex: 'provincePrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '市级价', dataIndex: 'cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '特约价', dataIndex: 'specialPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '车主价', dataIndex: 'carOwnersPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(9, 0, { title: '成本价', scopedSlots: { customRender: 'sterminaldsdPrice' }, width: '7%', align: 'center' })
+        if (this.$hasPermissions('B_isShowProvincePrice')) {
+          arr.splice(10, 0, { title: '省级价', dataIndex: 'provincePrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          if (this.$hasPermissions('B_isShowCityPrice')) {
+            arr.splice(11, 0, { title: '市级价', dataIndex: 'cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          }
+        } else {
+          if (this.$hasPermissions('B_isShowCityPrice')) {
+            arr.splice(10, 0, { title: '市级价', dataIndex: 'cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          }
+        }
+      } else {
+        if (this.$hasPermissions('B_isShowProvincePrice')) {
+          arr.splice(9, 0, { title: '省级价', dataIndex: 'provincePrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          if (this.$hasPermissions('B_isShowCityPrice')) {
+            arr.splice(10, 0, { title: '市级价', dataIndex: 'cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          }
+        } else {
+          if (this.$hasPermissions('B_isShowCityPrice')) {
+            arr.splice(9, 0, { title: '市级价', dataIndex: 'cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          }
+        }
+      }
+
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {

+ 18 - 24
src/views/productManagement/productUniversal/list.vue

@@ -56,7 +56,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1230, y: tableHeight }"
+        :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
         <!-- 产品分类 -->
@@ -112,36 +112,30 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       columns: [
-        // { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        // { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '24%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '产品状态', dataIndex: 'product.stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '通用产品编码', dataIndex: 'productCommonCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '通用产品名称', dataIndex: 'productCommont.name', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '通用产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
-        // { title: '通用产品状态', dataIndex: 'productCommont.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品状态', dataIndex: 'product.stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用产品编码', dataIndex: 'productCommonCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用产品名称', dataIndex: 'productCommont.name', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '通用产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
-        { title: '通用产品状态', dataIndex: 'productCommont.stateDictValue', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '24%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品状态', dataIndex: 'product.stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用产品编码', dataIndex: 'productCommonCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用产品名称', dataIndex: 'productCommont.name', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '通用产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
+        { title: '通用产品状态', dataIndex: 'productCommont.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return productUniversalCodeList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 36 - 22
src/views/promotionRulesManagement/orderStatistics/detailModal.vue

@@ -53,37 +53,51 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原价', dataIndex: 'origPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原价小计', dataIndex: 'priceSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销价小计', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '节省金额小计', dataIndex: 'totalEconomizeAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销类型', dataIndex: 'promotionRulesName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return salesDetailList(Object.assign(parameter, { salesBillSn: this.itemSn, promotionFlag: 1 })).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 origPrice = data.list[i].origPrice || 0
-            const qty = data.list[i].qty || 0
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].priceSubtotal = getOperationalPrecision(origPrice, qty)
+          let data
+          if (res.status == 200) {
+            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 origPrice = data.list[i].origPrice || 0
+              const qty = data.list[i].qty || 0
+              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].priceSubtotal = getOperationalPrecision(origPrice, qty)
+            }
           }
           return data
         })
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '原价', dataIndex: 'origPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '促销价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '原价小计', dataIndex: 'priceSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '促销价小计', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '节省金额小计', dataIndex: 'totalEconomizeAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销类型', dataIndex: 'promotionRulesName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(3, 0, { title: '原价', dataIndex: 'origPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(4, 0, { title: '促销价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '原价小计', dataIndex: 'priceSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '促销价小计', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '节省金额小计', dataIndex: 'totalEconomizeAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
 
   },

+ 42 - 30
src/views/promotionRulesManagement/orderStatistics/list.vue

@@ -55,9 +55,9 @@
       <!-- alert -->
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
-          促销品原价总额:<strong>{{ productTotal && (productTotal.totalOrigAmount || productTotal.totalOrigAmount==0) ? productTotal.totalOrigAmount : '--' }}</strong>,
-          促销品促销价总额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? productTotal.totalAmount : '--' }}</strong>,
-          节省总额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,
+          <span v-if="$hasPermissions('B_isShowPrice')">促销品原价总额:<strong>{{ productTotal && (productTotal.totalOrigAmount || productTotal.totalOrigAmount==0) ? productTotal.totalOrigAmount : '--' }}</strong>,</span>
+          <span v-if="$hasPermissions('B_isShowPrice')">促销品促销价总额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? productTotal.totalAmount : '--' }}</strong>,</span>
+          <span v-if="$hasPermissions('B_isShowPrice')">节省总额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,</span>
           总单数:<strong>{{ productTotal && (productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--' }}</strong>,
           总款数:<strong>{{ productTotal && (productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong>,
           总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>
@@ -122,40 +122,27 @@ export default {
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销名称', dataIndex: 'promoName', align: 'center', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '促销品款数', dataIndex: 'totalPromoCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销品数量', dataIndex: 'totalPromoQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '原价总额', dataIndex: 'promoTotal', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销品总额', dataIndex: 'totalPromoAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '节省总额', dataIndex: 'totalEconomizeAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '4%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return salesPromoList(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 promotionActivityNameList = data.list[i].promotionActivityNameList || []
-            data.list[i].promoName = promotionActivityNameList.join(',')
-            const totalPromoAmount = data.list[i].totalPromoAmount || 0
-            const totalEconomizeAmount = data.list[i].totalEconomizeAmount || 0
-            data.list[i].promoTotal = Number(totalPromoAmount) + Number(totalEconomizeAmount)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(Object.assign(parameter, this.queryParam))
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              const promotionActivityNameList = data.list[i].promotionActivityNameList || []
+              data.list[i].promoName = promotionActivityNameList.join(',')
+              const totalPromoAmount = data.list[i].totalPromoAmount || 0
+              const totalEconomizeAmount = data.list[i].totalEconomizeAmount || 0
+              data.list[i].promoTotal = Number(totalPromoAmount) + Number(totalEconomizeAmount)
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
-          this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
       },
@@ -165,6 +152,31 @@ export default {
       productTotal: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '促销名称', dataIndex: 'promoName', align: 'center', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '促销品款数', dataIndex: 'totalPromoCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销品数量', dataIndex: 'totalPromoQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '原价总额', dataIndex: 'promoTotal', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '促销品总额', dataIndex: 'totalPromoAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '节省总额', dataIndex: 'totalEconomizeAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '4%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(8, 0, { title: '原价总额', dataIndex: 'promoTotal', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '促销品总额', dataIndex: 'totalPromoAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '节省总额', dataIndex: 'totalEconomizeAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  创建时间  change
     dateChange (date) {

+ 35 - 21
src/views/promotionRulesManagement/productStatistics/detailModal.vue

@@ -55,36 +55,50 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '26%', customRender: function (text) { return text || '--' } },
-        { title: '原价', dataIndex: 'origPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原价小计', dataIndex: 'priceSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销价小计', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '节省金额小计', dataIndex: 'totalEconomizeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销类型', dataIndex: 'promotionRulesName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return salesDetailPromoProductList(Object.assign(parameter, { productSn: this.itemSn, promotionFlag: 1 })).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 origPrice = data.list[i].origPrice || 0
-            const qty = data.list[i].qty || 0
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].priceSubtotal = getOperationalPrecision(origPrice, qty)
+          let data
+          if (res.status == 200) {
+            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 origPrice = data.list[i].origPrice || 0
+              const qty = data.list[i].qty || 0
+              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].priceSubtotal = getOperationalPrecision(origPrice, qty)
+            }
           }
           return data
         })
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '26%', customRender: function (text) { return text || '--' } },
+        // { title: '原价', dataIndex: 'origPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '促销价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '原价小计', dataIndex: 'priceSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '促销价小计', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '节省金额小计', dataIndex: 'totalEconomizeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销类型', dataIndex: 'promotionRulesName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(2, 0, { title: '原价', dataIndex: 'origPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(3, 0, { title: '促销价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '原价小计', dataIndex: 'priceSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '促销价小计', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '节省金额小计', dataIndex: 'totalEconomizeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
 
   },

+ 28 - 17
src/views/promotionRulesManagement/productStatistics/list.vue

@@ -55,7 +55,7 @@
       <!-- alert -->
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
-          节省总金额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,
+          <span v-if="$hasPermissions('B_isShowPrice')">节省总金额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,</span>
           总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>
         </div>
       </a-alert>
@@ -121,29 +121,22 @@ export default {
         getDate.getCurrMonthDays().endtime
       ],
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', width: '28%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '节省金额', dataIndex: 'totalEconomizeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? '¥' + text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return salesDetailPromoList(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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(Object.assign(parameter, this.queryParam))
+            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
           }
-          this.disabled = false
           this.spinning = false
-          this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
       },
@@ -155,6 +148,24 @@ export default {
       productTotal: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', width: '28%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '节省金额', dataIndex: 'totalEconomizeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? '¥' + text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(6, 0, { title: '节省金额', dataIndex: 'totalEconomizeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 16 - 13
src/views/promotionRulesManagement/promotionRules/list.vue

@@ -127,20 +127,23 @@ export default {
         this.disabled = true
         this.spinning = true
         return promoActiveList(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
-            let str = ''
-            const promoBuyerList = data.list[i].promoBuyerList ? data.list[i].promoBuyerList : []
-            promoBuyerList.map(item => {
-              str += item.buyerName + ','
-            })
-            str = str.substr(0, str.length - 1)
-            data.list[i].promoBuyerName = str || '全部客户'
+          let data
+          if (res.status == 200) {
+            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
+              let str = ''
+              const promoBuyerList = data.list[i].promoBuyerList ? data.list[i].promoBuyerList : []
+              promoBuyerList.map(item => {
+                str += item.buyerName + ','
+              })
+              str = str.substr(0, str.length - 1)
+              data.list[i].promoBuyerName = str || '全部客户'
+            }
+            this.total = data.count || 0
+            this.disabled = false
           }
-          this.total = data.count || 0
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 16 - 13
src/views/promotionRulesManagement/promotionRules/rule.vue

@@ -70,22 +70,25 @@ export default {
         this.disabled = true
         this.spinning = true
         return promoRuleQueryList({ promoActiveSn: this.$route.params.sn }).then(res => {
-          const data = res.data
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = i + 1
-            if (data[i].promoRuleType == 'BUY_PROD_GIVE_PROD') { //  买产品送产品
-              data[i].promoRule = '购买满' + data[i].orderGoodsQty + '个正价产品,送' + data[i].promoQty + '个促销品'
-            } else if (data[i].promoRuleType == 'BUY_PROD_GIVE_MONEY') { //  买产品送采购额
-              if (data[i].promoType == 'promo_amount') {
-                data[i].promoRule = '购买满' + data[i].orderAmount + '元正价产品,送' + data[i].promoAmount + '元采购额可用于购买促销品'
-              } else if (data[i].promoType == 'promo_amount_per') {
-                data[i].promoRule = '购买满' + data[i].orderAmount + '元正价产品可以返正价产品采购额的' + data[i].promoAmountPer * 100 + '%用于购买促销品'
+          let data
+          if (res.status == 200) {
+            data = res.data
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+              if (data[i].promoRuleType == 'BUY_PROD_GIVE_PROD') { //  买产品送产品
+                data[i].promoRule = '购买满' + data[i].orderGoodsQty + '个正价产品,送' + data[i].promoQty + '个促销品'
+              } else if (data[i].promoRuleType == 'BUY_PROD_GIVE_MONEY') { //  买产品送采购额
+                if (data[i].promoType == 'promo_amount') {
+                  data[i].promoRule = '购买满' + data[i].orderAmount + '元正价产品,送' + data[i].promoAmount + '元采购额可用于购买促销品'
+                } else if (data[i].promoType == 'promo_amount_per') {
+                  data[i].promoRule = '购买满' + data[i].orderAmount + '元正价产品可以返正价产品采购额的' + data[i].promoAmountPer * 100 + '%用于购买促销品'
+                }
+              } else if (data[i].promoRuleType == 'ADD_PRICE_PURCH') { //  加价换购
+                data[i].promoRule = '购买满' + data[i].orderGoodsQty + '个正价产品,可以以换购价购买任意1个换购产品'
               }
-            } else if (data[i].promoRuleType == 'ADD_PRICE_PURCH') { //  加价换购
-              data[i].promoRule = '购买满' + data[i].orderGoodsQty + '个正价产品,可以以换购价购买任意1个换购产品'
             }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 28 - 18
src/views/purchasingManagement/bulkWarehousingOrder/detailModal.vue

@@ -32,7 +32,7 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
           入库数量 <strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
-          入库金额 <strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
+          <span v-if="$hasPermissions('B_isShowCost')">入库金额 <strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong></span>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -72,33 +72,43 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName',width: '40%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'unit',width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库单价', dataIndex: 'productCost',width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '小计', dataIndex: 'subtotal',width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return sparePartsDetailList(Object.assign(parameter, { sparePartsSn: this.itemSn })).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
-            // 小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].subtotal = getOperationalPrecision(data.list[i].productCost || 0, data.list[i].productQty)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(Object.assign(parameter, { sparePartsSn: this.itemSn }))
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].subtotal = getOperationalPrecision(data.list[i].productCost || 0, data.list[i].productQty)
+            }
           }
-          this.getDetailCount(Object.assign(parameter, { sparePartsSn: this.itemSn }))
           return data
         })
       },
       productTotal: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '40%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '入库单价', dataIndex: 'productCost',width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '小计', dataIndex: 'subtotal', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(5, 0, { title: '入库单价', dataIndex: 'productCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回列表
     handleBack () {

+ 29 - 19
src/views/purchasingManagement/bulkWarehousingOrder/edit.vue

@@ -33,7 +33,7 @@
         <a-alert type="info" v-if="productTotal" style="margin-bottom:10px">
           <div slot="message">
             入库数量 <strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
-            入库金额 <strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
+            <span v-if="$hasPermissions('B_isShowCost')">入库金额 <strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong></span>
           </div>
         </a-alert>
         <!-- 筛选条件 -->
@@ -116,28 +116,20 @@ export default {
         productCode: '',
         productName: ''
       },
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库单价', dataIndex: 'productCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '小计', dataIndex: 'subtotal', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return sparePartsDetailList(Object.assign(parameter, this.queryParam, { sparePartsSn: this.$route.params.sn })).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
-            // 小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].subtotal = getOperationalPrecision(data.list[i].productCost || 0, data.list[i].productQty)
+          let data
+          if (res.status == 200) {
+            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
+              // 小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].subtotal = getOperationalPrecision(data.list[i].productCost || 0, data.list[i].productQty)
+            }
+            this.getDetailCount(Object.assign(parameter, { sparePartsSn: this.$route.params.sn }))
           }
-          this.getDetailCount(Object.assign(parameter, { sparePartsSn: this.$route.params.sn }))
           return data
         })
       },
@@ -148,6 +140,24 @@ export default {
       openGuideModal: false //  导入产品引导
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '入库单价', dataIndex: 'productCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '小计', dataIndex: 'subtotal', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(5, 0, { title: '入库单价', dataIndex: 'productCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  添加/编辑
     handleEdit (row) {

+ 27 - 19
src/views/purchasingManagement/bulkWarehousingOrder/list.vue

@@ -120,20 +120,6 @@ export default {
         relationNo: '',
         state: undefined
       },
-      // 表头
-      columns: [
-        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库单号', scopedSlots: { customRender: 'sparePartsNo' }, width: '15%', align: 'center' },
-        { title: '商户名称', dataIndex: 'supplierName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '入库数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库类型', dataIndex: 'sparePartsTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联单号', dataIndex: 'relationNo', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '金蝶单号', dataIndex: 'kingdeeNo', width: '12.5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'remark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '9%', align: 'center' }
-      ],
       selectedRowKeys: [], // Check here to configure the default column
       selectedRows: [],
       loading: false,
@@ -142,12 +128,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return sparePartsList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -157,6 +146,25 @@ export default {
     }
   },
   computed: {
+	  columns () {
+	    const arr = [
+	      { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+	      { title: '入库单号', scopedSlots: { customRender: 'sparePartsNo' }, width: '15%', align: 'center' },
+	      { title: '商户名称', dataIndex: 'supplierName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
+	      { title: '入库数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+	      // { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+	      { title: '入库类型', dataIndex: 'sparePartsTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+	      { title: '关联单号', dataIndex: 'relationNo', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+	      { title: '金蝶单号', dataIndex: 'kingdeeNo', width: '12.5%', align: 'center', customRender: function (text) { return text || '--' } },
+	      { title: '状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+	      { title: '备注', dataIndex: 'remark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+	      { title: '操作', scopedSlots: { customRender: 'action' }, width: '9%', align: 'center' }
+	    ]
+	    if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+	      arr.splice(4, 0, { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+	    }
+	    return arr
+	  },
     hasSelected () {
       return this.selectedRowKeys.length > 0
     },

+ 42 - 29
src/views/reportData/actualSalesReport/list.vue

@@ -124,7 +124,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">实售销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">实售销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -172,7 +172,38 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        return salesBillRealAmountQueryPageList(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(paramsPage)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -290,7 +321,8 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
+          ]
+        },
         { title: '代理品牌',
           align: 'center',
           children: [
@@ -343,33 +375,14 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
-        { title: '实售销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
+          ]
         }
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        return salesBillRealAmountQueryPageList(paramsPage).then(res => {
-          this.getCount(paramsPage)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+        // { title: '实售销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '实售销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {

+ 50 - 41
src/views/reportData/allocationDetails/list.vue

@@ -138,18 +138,10 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="4" :sm="24">
-              总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              总售价:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}
-            </a-col>
+            <a-col :md="4" :sm="24">总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">总售价:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -207,28 +199,6 @@ export default {
         'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨单号', dataIndex: 'allocateNo', width: 160, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '调拨开单日期', dataIndex: 'allocateDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'targetName', align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'left', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '调拨数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'price', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 90, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 90, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '操作员', dataIndex: 'creatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 80, align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -237,14 +207,17 @@ export default {
         this.spinning = true
         if (params.beginDate) {
           return allocateReportDetailList(params).then(res => {
-            // 总计
-            this.getCount(params)
-            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
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              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
             }
-            this.disabled = false
             this.spinning = false
             return data
           })
@@ -272,6 +245,42 @@ export default {
       totalData: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨单号', dataIndex: 'allocateNo', width: 160, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '调拨开单日期', dataIndex: 'allocateDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'targetName', align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'left', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '调拨数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价', dataIndex: 'cost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价', dataIndex: 'price', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 90, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 90, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '操作员', dataIndex: 'creatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 80, align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(12, 0, { title: '成本价', dataIndex: 'cost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(14, 0, { title: '总成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(15, 0, { title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 13 : 12
+        arr.splice(ind, 0, { title: '售价', dataIndex: 'price', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 31 - 25
src/views/reportData/allocationOrderTotal/list.vue

@@ -81,15 +81,9 @@
         bordered>
         <template slot="footer" slot-scope="currentPageData">
           <a-row :gutter="15">
-            <a-col :md="4" :sm="24">
-              总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}
-            </a-col>
+            <a-col :md="4" :sm="24">总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -128,15 +122,6 @@ export default {
         'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '调拨单号', dataIndex: 'allocateNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨开单日期', dataIndex: 'allocateDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'targetName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨数量', dataIndex: 'totalQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价', dataIndex: 'totalCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'totalGrossProfit', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'creatorName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -144,14 +129,17 @@ export default {
         delete params.time
         this.spinning = true
         return allocateReportList(params).then(res => {
-          // 总计
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -161,6 +149,24 @@ export default {
       totalData: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '调拨单号', dataIndex: 'allocateNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨开单日期', dataIndex: 'allocateDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'targetName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨数量', dataIndex: 'totalQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'totalCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'totalGrossProfit', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'creatorName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'totalCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(5, 0, { title: '毛利', dataIndex: 'totalGrossProfit', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 37 - 26
src/views/reportData/allocationPresentation/list.vue

@@ -122,7 +122,7 @@
                 <a-col span="4">特殊申请促销调拨:{{ (totalData && (totalData.tssqcxdb || totalData.tssqcxdb==0)) ? totalData.tssqcxdb : '--' }}</a-col>
                 <a-col span="4">卡扣配送品调拨:{{ (totalData && (totalData.kkpspdb || totalData.kkpspdb==0)) ? totalData.kkpspdb : '--' }}</a-col>
                 <a-col span="4">客诉样品调拨:{{ (totalData && (totalData.ksypdb || totalData.ksypdb==0)) ? totalData.ksypdb : '--' }}</a-col>
-                <a-col span="6">调拨单合计金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">调拨单合计金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -164,7 +164,35 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        return reportAllocateDbjdReportList(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(paramsPage)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealerEntity.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '调拨单号', dataIndex: 'allocateNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealerEntity.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
@@ -272,30 +300,13 @@ export default {
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ]
-        },
-        { title: '调拨单合计金额', width: 90, dataIndex: 'totalCost', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        return reportAllocateDbjdReportList(paramsPage).then(res => {
-          this.getCount(paramsPage)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+        }
+        // { title: '调拨单合计金额', width: 90, dataIndex: 'totalCost', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '调拨单合计金额', width: 90, dataIndex: 'totalCost', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {

+ 65 - 56
src/views/reportData/billingReturnReport/list.vue

@@ -25,7 +25,7 @@
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户级别">
                 <v-select
-                  v-model="queryParam.dealer.dealerLevel"
+                  v-model="queryParam.dealerLevel"
                   ref="dealerLevel"
                   id="billingReturnReportList-dealerLevel"
                   code="DEALER_LEVEL"
@@ -36,29 +36,29 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="billingReturnReportList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                  <subarea id="billingReturnReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
                   <a-form-model-item label="地区" style="margin-bottom: 0!important;">
                     <a-col span="7">
-                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
+                      <a-form-model-item prop="provinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
                           <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
+                      <a-form-model-item prop="citySn" style="margin: 0;">
+                        <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
                           <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
+                      <a-form-model-item prop="districtSn" style="margin: 0;">
+                        <a-select v-model="queryParam.districtSn" allowClear placeholder="请选择区/县">
                           <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
@@ -124,7 +124,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">开单退货合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">开单退货合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -157,14 +157,12 @@ export default {
         ],
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
-        dealer: {
-          'dealerSn': undefined,
-          'provinceSn': undefined,
-          'citySn': undefined,
-          'districtSn': undefined,
-          'subareaSn': undefined,
-          'dealerLevel': undefined
-        }
+        dealerSn: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        subareaSn: undefined,
+        dealerLevel: undefined
       },
       rules: {
         'time': [{ required: true, message: '请选择退货日期', trigger: 'change' }]
@@ -174,7 +172,37 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        const params = Object.assign(parameter, this.queryParam) //  无分页
+        delete params.time
+        return salesReportReturnList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      productType: [],
+      totalData: null
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -292,7 +320,8 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
+          ]
+        },
         { title: '代理品牌',
           align: 'center',
           children: [
@@ -345,32 +374,14 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
-        { title: '开单退货合计金额', width: 90, dataIndex: 'sumAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
+          ]
         }
-        const params = Object.assign(parameter, this.queryParam) //  无分页
-        delete params.time
-        return salesReportReturnList(params).then(res => {
-          this.getCount(params)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      productType: [],
-      totalData: null
+        // { title: '开单退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '开单退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {
@@ -422,7 +433,7 @@ export default {
       this.queryParam.endDate = date[1] || ''
     },
     custChange (val) {
-      this.queryParam.dealer.dealerSn = val.key
+      this.queryParam.dealerSn = val.key
     },
     //  重置
     resetSearchForm () {
@@ -433,14 +444,12 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.dealer = {
-        'dealerSn': undefined,
-        'provinceSn': undefined,
-        'citySn': undefined,
-        'districtSn': undefined,
-        'subareaSn': undefined,
-        'dealerLevel': undefined
-      }
+      this.queryParam.dealerSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerLevel = undefined
       this.totalData = null
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
@@ -450,8 +459,8 @@ export default {
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
       if (val) {
         this.getArea('city', val)
       }
@@ -459,7 +468,7 @@ export default {
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.districtSn = undefined
       if (val) {
         this.getArea('district', val)
       }

+ 48 - 43
src/views/reportData/hPriceDifferenceDetailReport/list.vue

@@ -104,21 +104,11 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
-              分公司金额:{{ (totalData && (totalData.wholesalePrice1 || totalData.wholesalePrice1==0)) ? totalData.wholesalePrice1 : '--' }}
-            </a-col>
-            <a-col :md="6" :sm="24">
-              加盟商金额:{{ (totalData && (totalData.wholesalePrice2 || totalData.wholesalePrice2==0)) ? totalData.wholesalePrice2 : '--' }}
-            </a-col>
-            <a-col :md="6" :sm="24">
-              特约加盟店金额:{{ (totalData && (totalData.wholesalePrice3 || totalData.wholesalePrice3==0)) ? totalData.wholesalePrice3 : '--' }}
-            </a-col>
-            <a-col :md="6" :sm="24">
-              直接差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? totalData.directRebateAmount : '--' }}
-            </a-col>
-            <a-col :md="6" :sm="24">
-              间接差价金额:{{ (totalData && (totalData.indirectRebateAmount || totalData.indirectRebateAmount==0)) ? totalData.indirectRebateAmount : '--' }}
-            </a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">分公司金额:{{ (totalData && (totalData.wholesalePrice1 || totalData.wholesalePrice1==0)) ? totalData.wholesalePrice1 : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">加盟商金额:{{ (totalData && (totalData.wholesalePrice2 || totalData.wholesalePrice2==0)) ? totalData.wholesalePrice2 : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">特约加盟店金额:{{ (totalData && (totalData.wholesalePrice3 || totalData.wholesalePrice3==0)) ? totalData.wholesalePrice3 : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">直接差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? totalData.directRebateAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">间接差价金额:{{ (totalData && (totalData.indirectRebateAmount || totalData.indirectRebateAmount==0)) ? totalData.indirectRebateAmount : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -170,25 +160,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       addrProvinceList: [], //  省下拉
-      columns: [
-        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
-        { title: '订单号', dataIndex: 'bizNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '日期', dataIndex: 'bizCreateDate', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '分公司金额', dataIndex: 'wholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '加盟商金额', dataIndex: 'wholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约加盟店金额', dataIndex: 'wholesalePrice3', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '类型', dataIndex: 'bizTypeValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -199,17 +170,20 @@ export default {
         delete params.time
         this.spinning = true
         return headRebateDetailReportList(params).then(res => {
-          // 总计
-          this.getCount(params)
-          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
-            if (data.list[i].bizType) {
-              data.list[i].bizTypeValue = data.list[i].bizType == 'SALES' ? '采购差价' : data.list[i].bizType == 'SALES_RETURN' ? '退货差价' : ''
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              if (data.list[i].bizType) {
+                data.list[i].bizTypeValue = data.list[i].bizType == 'SALES' ? '采购差价' : data.list[i].bizType == 'SALES_RETURN' ? '退货差价' : ''
+              }
             }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -222,6 +196,37 @@ export default {
       totalData: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
+        { title: '订单号', dataIndex: 'bizNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '日期', dataIndex: 'bizCreateDate', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '分公司金额', dataIndex: 'wholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '加盟商金额', dataIndex: 'wholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '特约加盟店金额', dataIndex: 'wholesalePrice3', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '类型', dataIndex: 'bizTypeValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(11, 0, { title: '分公司金额', dataIndex: 'wholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(12, 0, { title: '加盟商金额', dataIndex: 'wholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(13, 0, { title: '特约加盟店金额', dataIndex: 'wholesalePrice3', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(14, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(15, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 34 - 27
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -68,15 +68,9 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
-              实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}
-            </a-col>
-            <a-col :md="6" :sm="24">
-              开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}
-            </a-col>
-            <a-col :md="6" :sm="24">
-              直接差额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}
-            </a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">直接差额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -111,17 +105,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       addrProvinceList: [], //  省下拉
-      columns: [
-        { title: '月份', dataIndex: 'month', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'provinceName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '记账门店', dataIndex: 'rebateDealerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差额', dataIndex: 'rebateAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '类型', dataIndex: 'bizType', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -129,14 +112,17 @@ export default {
         delete params.time
         this.spinning = true
         return reportRebateReportList(params).then(res => {
-          // 总计
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -144,6 +130,27 @@ export default {
       totalData: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '月份', dataIndex: 'month', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'provinceName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '记账门店', dataIndex: 'rebateDealerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '直接差额', dataIndex: 'rebateAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '类型', dataIndex: 'bizType', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(5, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '直接差额', dataIndex: 'rebateAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 月份  change
     onChange (date, dateString) {

+ 37 - 26
src/views/reportData/returnGoodsPresentation/list.vue

@@ -129,7 +129,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -171,7 +171,35 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        return reportSalesReturnThjdReportList(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(paramsPage)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
@@ -345,30 +373,13 @@ export default {
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ]
-        },
-        { title: '开单退货单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        return reportSalesReturnThjdReportList(paramsPage).then(res => {
-          this.getCount(paramsPage)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+        }
+        // { title: '开单退货单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '开单退货单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {

+ 64 - 55
src/views/reportData/returnSlipReport/list.vue

@@ -25,7 +25,7 @@
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户级别">
                 <v-select
-                  v-model="queryParam.dealer.dealerLevel"
+                  v-model="queryParam.dealerLevel"
                   ref="dealerLevel"
                   id="returnSlipReportList-dealerLevel"
                   code="DEALER_LEVEL"
@@ -41,29 +41,29 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="returnSlipReportList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                  <subarea id="returnSlipReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
                   <a-form-model-item label="地区" style="margin-bottom: 0!important;">
                     <a-col span="7">
-                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
+                      <a-form-model-item prop="provinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
                           <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
+                      <a-form-model-item prop="citySn" style="margin: 0;">
+                        <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
                           <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
+                      <a-form-model-item prop="districtSn" style="margin: 0;">
+                        <a-select v-model="queryParam.districtSn" allowClear placeholder="请选择区/县">
                           <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
@@ -129,7 +129,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">开单退货单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">开单退货单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -162,14 +162,12 @@ export default {
         ],
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
-        dealer: {
-          'dealerSn': undefined,
-          'provinceSn': undefined,
-          'citySn': undefined,
-          'districtSn': undefined,
-          'subareaSn': undefined,
-          'dealerLevel': undefined
-        },
+        dealerSn: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        subareaSn: undefined,
+        dealerLevel: undefined,
         salesReturnBillNo: ''
       },
       rules: {
@@ -180,7 +178,36 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        const params = Object.assign(parameter, this.queryParam) //  无分页
+        delete params.time
+        return salesReportReturnBillList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -299,7 +326,8 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
+          ]
+        },
         { title: '代理品牌',
           align: 'center',
           children: [
@@ -352,31 +380,14 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
-        { title: '开单退货单合计金额', width: 90, dataIndex: 'sumAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
+          ]
         }
-        const params = Object.assign(parameter, this.queryParam) //  无分页
-        delete params.time
-        return salesReportReturnBillList(params).then(res => {
-          this.getCount(params)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      totalData: null
+        // { title: '开单退货单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '开单退货单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {
@@ -428,7 +439,7 @@ export default {
       this.queryParam.endDate = date[1] || ''
     },
     custChange (val) {
-      this.queryParam.dealer.dealerSn = val.key
+      this.queryParam.dealerSn = val.key
     },
     //  重置
     resetSearchForm () {
@@ -439,14 +450,12 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.dealer = {
-        'dealerSn': undefined,
-        'provinceSn': undefined,
-        'citySn': undefined,
-        'districtSn': undefined,
-        'subareaSn': undefined,
-        'dealerLevel': undefined
-      }
+      this.queryParam.dealerSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerLevel = undefined
       this.queryParam.salesReturnBillNo = ''
       this.$refs.custList.resetForm()
       this.totalData = null
@@ -457,8 +466,8 @@ export default {
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
       if (val) {
         this.getArea('city', val)
       }
@@ -466,7 +475,7 @@ export default {
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.districtSn = undefined
       if (val) {
         this.getArea('district', val)
       }

+ 42 - 29
src/views/reportData/salesAmountReport/list.vue

@@ -124,7 +124,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">开单销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">开单销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -172,7 +172,38 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        return salesBillReportGroupByBuyerList(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(paramsPage)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -290,7 +321,8 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
+          ]
+        },
         { title: '代理品牌',
           align: 'center',
           children: [
@@ -343,33 +375,14 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
-        { title: '开单销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
+          ]
         }
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        return salesBillReportGroupByBuyerList(paramsPage).then(res => {
-          this.getCount(paramsPage)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+        // { title: '开单销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '开单销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {

+ 60 - 51
src/views/reportData/salesDetails/list.vue

@@ -19,7 +19,7 @@
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="销售单号">
-                <a-input id="salesDetailsList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入退货单号"/>
+                <a-input id="salesDetailsList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -145,24 +145,12 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="4" :sm="24">
-              数量:{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              实售价:{{ (totalData && (totalData.totalRealSaleAmount || totalData.totalRealSaleAmount==0)) ? totalData.totalRealSaleAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              开单价:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              成本:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? totalData.totalRealCost : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? totalData.discountedAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? totalData.discountAmount : '--' }}
-            </a-col>
+            <a-col :md="4" :sm="24">数量:{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">实售价:{{ (totalData && (totalData.totalRealSaleAmount || totalData.totalRealSaleAmount==0)) ? totalData.totalRealSaleAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">开单价:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">成本:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? totalData.totalRealCost : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? totalData.discountedAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? totalData.discountAmount : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -217,45 +205,22 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '开单日期', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售日期', dataIndex: 'salesTime', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价', dataIndex: 'totalRealCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'operatorName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         return reportSalesBillDetailList(params).then(res => {
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -268,6 +233,50 @@ export default {
       productTypeList: [] //  分类下拉数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '开单日期', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售日期', dataIndex: 'salesTime', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'totalRealCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'operatorName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(15, 0, { title: '成本价', dataIndex: 'totalRealCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 16 : 15
+        arr.splice(ind, 0, { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 1, 0, { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 2, 0, { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 3, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 4, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 5, 0, { title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 6, 0, { title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 64 - 54
src/views/reportData/salesOrderTotal/list.vue

@@ -19,7 +19,7 @@
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="销售单号">
-                <a-input id="salesOrderTotalList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入退货单号"/>
+                <a-input id="salesOrderTotalList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -107,30 +107,14 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="4" :sm="24">
-              数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              实售价:{{ (totalData && (totalData.totalRealSaleAmount || totalData.totalRealSaleAmount==0)) ? totalData.totalRealSaleAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              开单价:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              成本:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              毛利:{{ (totalData && (totalData.grossProfit || totalData.grossProfit==0)) ? totalData.grossProfit : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              返利:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              折扣金额:{{ (totalData && (totalData.totalDiscountAmount || totalData.totalDiscountAmount==0)) ? totalData.totalDiscountAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              折后金额:{{ (totalData && (totalData.totalDiscountedAmount || totalData.totalDiscountedAmount==0)) ? totalData.totalDiscountedAmount : '--' }}
-            </a-col>
+            <a-col :md="4" :sm="24">数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">实售价:{{ (totalData && (totalData.totalRealSaleAmount || totalData.totalRealSaleAmount==0)) ? totalData.totalRealSaleAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">开单价:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">成本:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">毛利:{{ (totalData && (totalData.grossProfit || totalData.grossProfit==0)) ? totalData.grossProfit : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">返利:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">折扣金额:{{ (totalData && (totalData.totalDiscountAmount || totalData.totalDiscountAmount==0)) ? totalData.totalDiscountAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">折后金额:{{ (totalData && (totalData.totalDiscountedAmount || totalData.totalDiscountedAmount==0)) ? totalData.totalDiscountedAmount : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -174,42 +158,22 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '开单日期', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售日期', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总数量', dataIndex: 'totalQty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '省级价', dataIndex: 'totalProvinceAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约加盟店价', dataIndex: 'totalSpecialAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'operatorName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         return reportSalesBillList(params).then(res => {
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -219,6 +183,52 @@ export default {
       addrProvinceList: [] //  省下拉
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '开单日期', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售日期', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总数量', dataIndex: 'totalQty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '省级价', dataIndex: 'totalProvinceAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '特约加盟店价', dataIndex: 'totalSpecialAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'operatorName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        const ind = this.$hasPermissions('B_isShowPrice') ? 10 : 8
+        arr.splice(ind, 0, { title: '成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 1, 0, { title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 12 : 10
+        arr.splice(8, 0, { title: '实售价', dataIndex: 'totalRealSaleAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind, 0, { title: '省级价', dataIndex: 'totalProvinceAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 1, 0, { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 2, 0, { title: '特约加盟店价', dataIndex: 'totalSpecialAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 3, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 4, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 5, 0, { title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 6, 0, { title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 7, 0, { title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 40 - 27
src/views/reportData/salesPresentation/list.vue

@@ -129,7 +129,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -172,7 +172,35 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        return reportDispatchReportList(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(paramsPage)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '销售单号', dataIndex: 'salesBillNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
@@ -291,7 +319,8 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
+          ]
+        },
         { title: '代理品牌',
           align: 'center',
           children: [
@@ -344,30 +373,14 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
-        { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        return reportDispatchReportList(paramsPage).then(res => {
-          this.getCount(paramsPage)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+          ]
+        }
+        // { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {

+ 70 - 63
src/views/reportData/salesReturnDetailReport/list.vue

@@ -145,33 +145,15 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="4" :sm="24">
-              退货数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              开单退货金额:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              返工数量:{{ (totalData && (totalData.totalBackStockQty || totalData.totalBackStockQty==0)) ? totalData.totalBackStockQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              坏件数量:{{ (totalData && (totalData.totalBadQty || totalData.totalBadQty==0)) ? totalData.totalBadQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              正常退货数量:{{ (totalData && (totalData.totalNormalQty || totalData.totalNormalQty==0)) ? totalData.totalNormalQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              正常退货金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? totalData.totalNormalPrice : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              正常再入库金额:{{ (totalData && (totalData.totalNormalCost || totalData.totalNormalCost==0)) ? totalData.totalNormalCost : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              正常退货入库差额:{{ (totalData && (totalData.totalNormalBalance || totalData.totalNormalBalance==0)) ? totalData.totalNormalBalance : '--' }}
-            </a-col>
+            <a-col :md="4" :sm="24">退货数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">开单退货金额:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24">返工数量:{{ (totalData && (totalData.totalBackStockQty || totalData.totalBackStockQty==0)) ? totalData.totalBackStockQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24">坏件数量:{{ (totalData && (totalData.totalBadQty || totalData.totalBadQty==0)) ? totalData.totalBadQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24">正常退货数量:{{ (totalData && (totalData.totalNormalQty || totalData.totalNormalQty==0)) ? totalData.totalNormalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">正常退货金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? totalData.totalNormalPrice : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">正常再入库金额:{{ (totalData && (totalData.totalNormalCost || totalData.totalNormalCost==0)) ? totalData.totalNormalCost : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">正常退货入库差额:{{ (totalData && (totalData.totalNormalBalance || totalData.totalNormalBalance==0)) ? totalData.totalNormalBalance : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -226,36 +208,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'badQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '再入库单价', dataIndex: 'cost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常退货数量', dataIndex: 'normalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -263,13 +215,16 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
         return reportSalesReturnDetailList(params).then(res => {
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -282,6 +237,58 @@ export default {
       productTypeList: [] //  分类下拉数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '再入库单价', dataIndex: 'cost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '正常退货数量', dataIndex: 'normalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        const ind = this.$hasPermissions('B_isShowPrice') ? 23 : 16
+        arr.splice(ind, 0, { title: '再入库单价', dataIndex: 'cost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 3, 0, { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 4, 0, { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 25 : 24
+        arr.splice(16, 0, { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(17, 0, { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(18, 0, { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(19, 0, { title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(20, 0, { title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(21, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(22, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind, 0, { title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 63 - 56
src/views/reportData/salesReturnReport/list.vue

@@ -25,7 +25,7 @@
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户级别">
                 <v-select
-                  v-model="queryParam.dealer.dealerLevel"
+                  v-model="queryParam.dealerLevel"
                   ref="dealerLevel"
                   id="salesReturnReportList-dealerLevel"
                   code="DEALER_LEVEL"
@@ -36,29 +36,29 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="salesReturnReportList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                  <subarea id="salesReturnReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
                   <a-form-model-item label="地区" style="margin-bottom: 0!important;">
                     <a-col span="7">
-                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
+                      <a-form-model-item prop="provinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
                           <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
+                      <a-form-model-item prop="citySn" style="margin: 0;">
+                        <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
                           <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
+                      <a-form-model-item prop="districtSn" style="margin: 0;">
+                        <a-select v-model="queryParam.districtSn" allowClear placeholder="请选择区/县">
                           <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
@@ -124,7 +124,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">实售退货合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">实售退货合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -158,14 +158,12 @@ export default {
         ],
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
-        dealer: {
-          'dealerSn': undefined,
-          'provinceSn': undefined,
-          'citySn': undefined,
-          'districtSn': undefined,
-          'subareaSn': undefined,
-          'dealerLevel': undefined
-        }
+        dealerSn: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        subareaSn: undefined,
+        dealerLevel: undefined
       },
       rules: {
         'time': [{ required: true, message: '请选择退货日期', trigger: 'change' }]
@@ -175,7 +173,37 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        const params = Object.assign(parameter, this.queryParam) //  无分页
+        delete params.time
+        return salesReportReturnRebateList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      productType: [],
+      totalData: null
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -346,32 +374,13 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
-        { title: '实售退货合计金额', width: 90, dataIndex: 'sumAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
-        const params = Object.assign(parameter, this.queryParam) //  无分页
-        delete params.time
-        return salesReportReturnRebateList(params).then(res => {
-          this.getCount(params)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      productType: [],
-      totalData: null
+          ] }
+        // { title: '实售退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(arr.length, 0, { title: '实售退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {
@@ -423,7 +432,7 @@ export default {
       this.queryParam.endDate = date[1]
     },
     custChange (val) {
-      this.queryParam.dealer.dealerSn = val.key
+      this.queryParam.dealerSn = val.key
     },
     //  重置
     resetSearchForm () {
@@ -434,14 +443,12 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.dealer = {
-        'dealerSn': undefined,
-        'provinceSn': undefined,
-        'citySn': undefined,
-        'districtSn': undefined,
-        'subareaSn': undefined,
-        'dealerLevel': undefined
-      }
+      this.queryParam.dealerSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerLevel = undefined
       this.totalData = null
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
@@ -451,8 +458,8 @@ export default {
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
       if (val) {
         this.getArea('city', val)
       }
@@ -460,7 +467,7 @@ export default {
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.districtSn = undefined
       if (val) {
         this.getArea('district', val)
       }

+ 47 - 42
src/views/reportData/salesReturnsReport/list.vue

@@ -111,24 +111,12 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="4" :sm="24">
-              总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              开单退货金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              经销商金额:{{ (totalData && (totalData.totalWholesalePrice2 || totalData.totalWholesalePrice2==0)) ? totalData.totalWholesalePrice2 : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              服务中心金额:{{ (totalData && (totalData.totalWholesalePrice1 || totalData.totalWholesalePrice1==0)) ? totalData.totalWholesalePrice1 : '--' }}
-            </a-col>
-            <a-col :md="4" :sm="24">
-              特约加盟店金额:{{ (totalData && (totalData.totalWholesalePrice3 || totalData.totalWholesalePrice3==0)) ? totalData.totalWholesalePrice3 : '--' }}
-            </a-col>
+            <a-col :md="4" :sm="24">总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">开单退货金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">经销商金额:{{ (totalData && (totalData.totalWholesalePrice2 || totalData.totalWholesalePrice2==0)) ? totalData.totalWholesalePrice2 : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">服务中心金额:{{ (totalData && (totalData.totalWholesalePrice1 || totalData.totalWholesalePrice1==0)) ? totalData.totalWholesalePrice1 : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">特约加盟店金额:{{ (totalData && (totalData.totalWholesalePrice3 || totalData.totalWholesalePrice3==0)) ? totalData.totalWholesalePrice3 : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -172,24 +160,6 @@ export default {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单退货金额', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '经销商价', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '服务中心价', dataIndex: 'totalWholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约加盟店价', dataIndex: 'totalWholesalePrice3', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售退货金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'totalDirectRebate', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'totalIndirectRebate', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'totalBadQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'operatorName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -197,13 +167,16 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
         return reportSalesReturnList(params).then(res => {
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -214,6 +187,38 @@ export default {
       addrDistrictList: [] //  区下拉
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货数量', dataIndex: 'totalQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '开单退货金额', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '经销商价', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '服务中心价', dataIndex: 'totalWholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '特约加盟店价', dataIndex: 'totalWholesalePrice3', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '实售退货金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '直接差价', dataIndex: 'totalDirectRebate', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '间接差价', dataIndex: 'totalIndirectRebate', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'operatorName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(7, 0, { title: '开单退货金额', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '经销商价', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '服务中心价', dataIndex: 'totalWholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '特约加盟店价', dataIndex: 'totalWholesalePrice3', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(11, 0, { title: '实售退货金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(12, 0, { title: '直接差价', dataIndex: 'totalDirectRebate', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(13, 0, { title: '间接差价', dataIndex: 'totalIndirectRebate', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  导出
     handleExport () {

+ 40 - 29
src/views/reportData/salesSlipReport/list.vue

@@ -129,7 +129,7 @@
                 <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? totalData.lbstAmount : '--' }}</a-col>
                 <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? totalData.defAmount : '--' }}</a-col>
                 <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? totalData.bndAmount : '--' }}</a-col>
-                <a-col span="6">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+                <a-col span="6" v-if="$hasPermissions('B_isShowPrice')">开单销售单合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -178,7 +178,38 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        return salesBillReportList(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(paramsPage)
+            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
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -350,33 +381,13 @@ export default {
               width: 80,
               customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
-          ] },
-        { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        return salesBillReportList(paramsPage).then(res => {
-          this.getCount(paramsPage)
-          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
-          this.spinning = false
-          return data
-        })
-      },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+          ] }
+        // { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(7, 0, { title: '开单销售单合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } })
+      }
+      return arr
     }
   },
   methods: {

+ 28 - 17
src/views/reportData/warehousingOrder/list.vue

@@ -19,7 +19,7 @@
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="入库单号">
-                <a-input id="warehousingOrderList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入退货单号"/>
+                <a-input id="warehousingOrderList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -87,7 +87,7 @@
             <a-col :md="4" :sm="24">
               总数量:{{ (totalData && (totalData.productTotalQty || totalData.productTotalQty==0)) ? totalData.productTotalQty : '--' }}
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">
               总金额:{{ (totalData && (totalData.productTotalCost || totalData.productTotalCost==0)) ? totalData.productTotalCost : '--' }}
             </a-col>
           </a-row>
@@ -122,15 +122,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '入库单号', dataIndex: 'stockPutNo', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库开单日期', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'supplierName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '入库数量', dataIndex: 'productTotalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库金额', dataIndex: 'productTotalCost', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '散件入库子类型', dataIndex: 'sparePartsTypeDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -138,13 +129,16 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
         return reportStockPutList(params).then(res => {
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -152,6 +146,23 @@ export default {
       totalData: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '入库单号', dataIndex: 'stockPutNo', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库开单日期', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'supplierName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '入库数量', dataIndex: 'productTotalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '入库金额', dataIndex: 'productTotalCost', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '散件入库子类型', dataIndex: 'sparePartsTypeDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(4, 0, { title: '入库金额', dataIndex: 'productTotalCost', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 34 - 22
src/views/reportData/warehousingOrderDetail/list.vue

@@ -19,7 +19,7 @@
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="入库单号">
-                <a-input id="warehousingOrderDetailList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入退货单号"/>
+                <a-input id="warehousingOrderDetailList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -102,7 +102,7 @@
             <a-col :md="4" :sm="24">
               总数量:{{ (totalData && (totalData.totalPutQty || totalData.totalPutQty==0)) ? totalData.totalPutQty : '--' }}
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">
               总金额:{{ (totalData && (totalData.totalPutAmount || totalData.totalPutAmount==0)) ? totalData.totalPutAmount : '--' }}
             </a-col>
           </a-row>
@@ -139,20 +139,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '入库单号', dataIndex: 'stockPutNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库开单日期', dataIndex: 'openBillTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'supplierName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: '9%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'putQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '进价', dataIndex: 'putCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库金额', dataIndex: 'putAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '散件入库子类型', dataIndex: 'sparePartsTypeDictValue', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '完成日期', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -160,13 +146,16 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
         return reportStockPutDetailList(params).then(res => {
-          this.getCount(params)
-          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
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getCount(params)
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -174,6 +163,29 @@ export default {
       totalData: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '入库单号', dataIndex: 'stockPutNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库开单日期', dataIndex: 'openBillTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'supplierName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: '9%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'putQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '进价', dataIndex: 'putCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '入库金额', dataIndex: 'putAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '散件入库子类型', dataIndex: 'sparePartsTypeDictValue', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '完成日期', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(7, 0, { title: '进价', dataIndex: 'putCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '入库金额', dataIndex: 'putAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 盘点库存日期
     handleStock () {

+ 27 - 17
src/views/salesManagement/backorder/detailModal.vue

@@ -29,7 +29,7 @@
           <div slot="message">
             缺货总款数:<strong>{{ detailData && (detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</strong>,
             缺货总数量:<strong>{{ detailData && (detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>,
-            缺货总售价:<strong>{{ detailData && (detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>
+            <span v-if="$hasPermissions('B_isShowPrice')">缺货总售价:<strong>{{ detailData && (detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong></span>
           </div></a-alert>
         <!-- 列表 -->
         <s-table
@@ -71,33 +71,43 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
       detailData: null, //  详情数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '24%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '缺货数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         return oosDetailList(Object.assign(parameter, this.queryParam, { oosBillSn: this.itemSn })).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
+          let data
+          if (res.status == 200) {
+            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.localDataSource = data.list
+            this.disabled = false
           }
-          this.localDataSource = data.list
-          this.disabled = false
           return data
         })
       },
       localDataSource: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '24%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
+        // { title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(6, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  获取详情
     getDetail () {

+ 26 - 15
src/views/salesManagement/backorder/list.vue

@@ -64,27 +64,20 @@ export default {
         buyerSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '缺货款数', dataIndex: 'totalCategory', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货数量', dataIndex: 'totalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货金额', dataIndex: 'totalAmount', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return oosList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -93,6 +86,24 @@ export default {
       itemSn: ''
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '缺货款数', dataIndex: 'totalCategory', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货数量', dataIndex: 'totalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '缺货金额', dataIndex: 'totalAmount', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(6, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 32 - 21
src/views/salesManagement/examineVerify/list.vue

@@ -82,7 +82,7 @@
       <!-- alert -->
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
-          总售价:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;
+          <span v-if="$hasPermissions('B_isShowPrice')">总售价:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;</span>
           总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
           总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
           总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
@@ -159,21 +159,6 @@ export default {
         shippingAddrProvinceSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据来源', dataIndex: 'salesBillEntity.salesBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '12%', align: 'center' },
-        { title: '出库单号', dataIndex: 'stockOutNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'buyerName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '备货时间', dataIndex: 'stockUpDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       selectedRowKeys: [], // Check here to configure the default column
       loading: false,
       totalData: {
@@ -190,12 +175,15 @@ export default {
           this.totalData = Object.assign(this.totalData, res.data || {})
         })
         return dispatchlBhshList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -208,6 +196,29 @@ export default {
       spinningAuditReject: false
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesBillEntity.salesBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '12%', align: 'center' },
+        { title: '出库单号', dataIndex: 'stockOutNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '备货时间', dataIndex: 'stockUpDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(8, 0, { title: '售价', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     custChange (val) {
       this.queryParam.buyerSn = val.key

+ 27 - 18
src/views/salesManagement/outboundOrder/list.vue

@@ -157,19 +157,6 @@ export default {
         shippingAddrProvinceSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库单号', scopedSlots: { customRender: 'stockOutNo' }, width: '15%', align: 'center' },
-        { title: '业务单号', dataIndex: 'outBizNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库类型', dataIndex: 'outBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'demanderName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productTotalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '出库时间', dataIndex: 'outTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
-      ],
       selectedRowKeys: [], // Check here to configure the default column
       selectedRows: [],
       loading: false,
@@ -178,12 +165,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return stockOutList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -195,6 +185,25 @@ export default {
     }
   },
   computed: {
+    columns () {
+      const arr = [
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库单号', scopedSlots: { customRender: 'stockOutNo' }, width: '15%', align: 'center' },
+        { title: '业务单号', dataIndex: 'outBizNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库类型', dataIndex: 'outBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'demanderName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价', dataIndex: 'productTotalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '出库时间', dataIndex: 'outTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(7, 0, { title: '售价', dataIndex: 'productTotalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
     hasSelected () {
       return this.selectedRowKeys.length > 0
     },

+ 119 - 0
src/views/salesManagement/priceInquiry/carInfoModal.vue

@@ -0,0 +1,119 @@
+<template>
+  <a-modal
+    centered
+    class="carInfoDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <div>
+      <div class="head-info-con">
+        <p class="head-info-title">车型信息</p>
+        <a-divider style="margin: 12px 0;" />
+      </div>
+      <a-descriptions bordered :column="2" size="small" class="head-info-main">
+        <a-descriptions-item label="车型信息:">{{ infoData&&infoData.text || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="品牌:">{{ infoData&&infoData.brand_name || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="车型:">{{ infoData&&infoData.model_name || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="品牌LOGO:">
+          <img :src="infoData&&infoData.icon?infoData.icon:defImg" width="30" height="30" style="border-radius: 50%;" />
+        </a-descriptions-item>
+        <a-descriptions-item label="排量:">{{ infoData&&infoData.sub_name || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="年款:">{{ infoData&&infoData.year || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="车型图:">
+          <div v-if="infoData&&infoData.images.length>0">
+            <img :src="infoData.images[0] || defImg" width="30" height="30" class="imageUrl" @click="inited(infoData.images)" />
+          </div>
+          <span v-else>--</span>
+        </a-descriptions-item>
+        <a-descriptions-item label="车系:">{{ infoData&&infoData.series_name || '--' }}</a-descriptions-item>
+      </a-descriptions>
+      <div class="head-info-con" v-if="infoData&&infoData.params">
+        <p class="head-info-title">配置信息</p>
+        <a-divider style="margin: 12px 0;" />
+      </div>
+      <a-descriptions bordered :column="2" size="small" v-if="infoData&&infoData.params" class="head-info-main">
+        <a-descriptions-item v-for="item in infoData.params" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
+      </a-descriptions>
+      <div class="btn-cont"><a-button id="carInfoDetail-modal-back" @click="isShow = false">返回</a-button></div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import defImg from '@/assets/def_img@2x.png'
+export default {
+  name: 'CarInfoDetailModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    infoData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      defImg
+    }
+  },
+  methods: {
+    inited (viewer) {
+      if (viewer) {
+        const imageUrl = []
+        viewer.map(item => {
+          imageUrl.push(item)
+        })
+        this.$viewerApi({
+          images: imageUrl
+        })
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .carInfoDetail-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .ant-descriptions-item-label.ant-descriptions-item-colon{
+      width: 117px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .head-info-con{
+      .head-info-title{
+        font-size: 16px;
+        margin: 0;
+      }
+    }
+    .head-info-main{
+      margin-bottom: 20px;
+    }
+    .imageUrl{
+      cursor: pointer;
+    }
+  }
+</style>

+ 184 - 49
src/views/salesManagement/priceInquiry/list.vue

@@ -2,42 +2,56 @@
   <a-card size="small" :bordered="false" class="priceInquiryList-wrap">
     <!-- 搜索条件 -->
     <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :rules="rules"
+        :model="queryParam"
+        @keyup.enter.native="$refs.table.refresh(true)" >
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="priceInquiryList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
+            <a-form-model-item label="车架号(VIN)" prop="vinCode">
+              <a-input id="priceInquiryList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
+                <a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
+              </a-input>
+              <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="priceInquiryList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
+            <a-form-model-item label="产品编码">
+              <a-input id="priceInquiryList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="产品分类">
-              <a-cascader
-                @change="changeProductType"
-                change-on-select
-                v-model="productType"
-                expand-trigger="hover"
-                :options="productTypeList"
-                :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                id="priceInquiryList-productType"
-                placeholder="请选择产品分类"
-                allowClear />
-            </a-form-item>
+            <a-form-model-item label="产品名称">
+              <a-input id="priceInquiryList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+            </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
+              <a-form-model-item label="产品分类">
+                <a-cascader
+                  @change="changeProductType"
+                  change-on-select
+                  v-model="productType"
+                  expand-trigger="hover"
+                  :options="productTypeList"
+                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                  id="priceInquiryList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品品牌">
                 <ProductBrand id="priceInquiryList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品状态">
+              <a-form-model-item label="产品状态">
                 <v-select code="PRODUCT_ONOFFLINE_STATUS" id="priceInquiryList-state" v-model="queryParam.state" allowClear placeholder="请选择状态"></v-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -49,8 +63,24 @@
             </a>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
+    <a-alert type="error" style="margin-bottom: 10px;" v-if="vinInfoData&&!vinInfoData.vinInfo">
+      <template slot="message"><a-icon type="exclamation-circle" theme="filled" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!</template>
+    </a-alert>
+    <a-alert type="warning" style="margin-bottom: 10px;cursor: pointer;" v-if="vinInfoData&&vinInfoData.vinInfo" @click="openCarInfoModal=true">
+      <template slot="message">
+        <div style="display: flex;justify-content: space-between;align-items: center;" @click="openCarInfoModal=true">
+          <div>
+            <img :src="vinInfoData.vinInfo && vinInfoData.vinInfo.icon?(vinInfoData.vinInfo.icon+'?x-oss-process=image/resize,h_30,m_lfit'):defImg" width="30" height="30" class="imageUrl" style="border-radius: 50%;vertical-align: middle;margin-right: 3px;" />
+            <span style="vertical-align: middle;">{{ vinInfoData.vinInfo.text }}</span>
+          </div>
+          <div style="color: #f90;">
+            <span>查看更多</span> >
+          </div>
+        </div>
+      </template>
+    </a-alert>
     <!-- 列表 -->
     <s-table
       class="sTable fixPagination"
@@ -76,64 +106,132 @@
         <span v-else>--</span>
       </template>
     </s-table>
+    <!-- 查看车辆信息 -->
+    <car-info-modal ref="carInfoModal" :openModal="openCarInfoModal" :infoData="vinInfoData&&vinInfoData.vinInfo" @close="openCarInfoModal=false" />
   </a-card>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
+import carInfoModal from './carInfoModal.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import { productPriceList } from '@/api/product'
+import { supperCodeByVin, vinCodeParse } from '@/api/sales'
 import ProductBrand from '@/views/common/productBrand.js'
 export default {
-  components: { STable, VSelect, ProductBrand },
+  components: { STable, VSelect, ProductBrand, carInfoModal },
   data () {
     return {
       advanced: true, // 高级搜索 展开/关闭
+      vinLoading: false,
       tableHeight: 0,
       productType: [],
       queryParam: { //  查询条件
         code: '', //  产品编码
         name: '', //  产品名称
+        vinCode: '',
+        codeList: undefined, //  车架号
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         state: 'ONLINE' //  产品状态
       },
+      rules: {
+        vinCode: [ { len: 17, message: '请输入正确的车架号(VIN)', trigger: 'change' } ]
+      },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        const params = Object.assign(parameter, _this.queryParam)
+        if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) { //  输入vin,查出vin码信息后请求列表数据
+          _this.disabled = true
+          return supperCodeByVin({ vin: _this.queryParam.vinCode }).then(res => {
+            if (res.status == 200) {
+              _this.vinInfoData = res.data
+              params.codeList = res.data.partCodeList || []
+              return _this.getList(params)
+            } else {
+              _this.vinInfoData = null
+              _this.$refs.table.localLoading = false
+              _this.$refs.table.clearTable()
+            }
+          })
+        } else if (_this.queryParam.vinCode && _this.queryParam.vinCode.length < 17 && !this.onlyList) { // 输入vin,但vin码不符合标准,不查vin码信息,不请求列表数据
+          _this.$refs.table.localLoading = false
+          _this.$refs.table.clearTable()
+        } else if (this.onlyList) {
+          _this.disabled = true
+          if (_this.queryParam.vinCode && _this.vinInfoData) {
+            return _this.getList(Object.assign(params, { codeList: _this.vinInfoData.partCodeList }))
+          } else {
+            return _this.getList(params)
+          }
+        } else { //  未输入vin码信息,只查列表数据
+          _this.disabled = true
+          return _this.getList(params)
+        }
+      },
+      vinInfoData: null,
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [], //  分类下拉数据
+      openCarInfoModal: false,
+      onlyList: false
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'name', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'origCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省级价', dataIndex: 'provincePrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价', dataIndex: 'cityPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约价', dataIndex: 'specialPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '终端价', dataIndex: 'terminalPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '车主价', dataIndex: 'carOwnersPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '省级价', dataIndex: 'provincePrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '市级价', dataIndex: 'cityPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '特约价', dataIndex: 'specialPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '终端价', dataIndex: 'terminalPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '车主价', dataIndex: 'carOwnersPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '8%', align: 'center' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        return productPriceList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(4, 0, { title: '省级价', dataIndex: 'provincePrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(5, 0, { title: '市级价', dataIndex: 'cityPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '特约价', dataIndex: 'specialPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '终端价', dataIndex: 'terminalPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '车主价', dataIndex: 'carOwnersPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    getList (params) {
+      const _this = this
+      return productPriceList(params).then(res => {
+        let data
+        this.onlyList = false
+        if (res.status == 200) {
+          data = res.data
+          data.list = data.list.filter(item => item != null)
           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
-          this.spinning = false
-          return data
-        })
-      },
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
-    }
-  },
-  methods: {
+          if (!params.vinCode) {
+            _this.vinInfoData = null
+          }
+        } else {
+          data = {
+            list: [],
+            pageNo: 1,
+            pageSize: 10
+          }
+        }
+        _this.disabled = false
+        return data
+      })
+    },
     inited (viewer) {
       if (viewer) {
         const imageUrl = []
@@ -154,8 +252,45 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.state = 'ONLINE'
+      this.queryParam.codeList = undefined
       this.productType = []
+      this.$refs.ruleForm.resetFields()
       this.$refs.table.refresh(true)
+      this.vinInfoData = null
+    },
+    uploadFun () {
+      document.getElementById('filed').click()
+    },
+    filePreview (e) {
+      const _this = this
+      var files = e.target.files[0]
+      const formData = new FormData()
+      formData.append('savePathType', 'local')
+      formData.append('file', files)
+      this.vinLoading = true
+      vinCodeParse(formData).then(res => {
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            if (obj.status == 200) {
+              _this.queryParam.vinCode = obj.data || ''
+              // 移除表单项的校验结果
+              _this.$refs.ruleForm.clearValidate('vinCode')
+            } else {
+              _this.$notification.error({
+                message: '提示',
+                description: obj.message
+              })
+            }
+            _this.vinLoading = false
+            document.getElementById('filed').value = ''
+          })
+          reader.readAsText(res)
+        } else {
+          _this.vinLoading = false
+        }
+      })
     },
     //  产品分类  change
     changeProductType (val, opt) {
@@ -193,7 +328,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 195
+      this.tableHeight = window.innerHeight - tableSearchH - 243
     }
   },
   watch: {

+ 40 - 28
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -60,7 +60,7 @@
               总销售数量:<strong>{{ detailData&&(detailData.totalSalesQty || detailData.totalSalesQty==0) ? detailData.totalSalesQty : '--' }}</strong>;
             </span>
             本次下推数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-            本次下推金额:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
+            <span v-if="$hasPermissions('B_isShowPrice')">本次下推金额:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;</span>
             <span v-if="$route.params.type!='stockOut'">
               本次下推市级价金额:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? detailData.totalCityAmount : '--' }}</strong>;
             </span>
@@ -115,19 +115,6 @@ export default {
     return {
       disabled: false,
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '12%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productOrigUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售价格', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级销售价格', dataIndex: 'cityPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', dataIndex: 'salesQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次下推数', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       outColumns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '25%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
@@ -140,21 +127,24 @@ export default {
       loadData: parameter => {
         this.disabled = true
         return dispatchDetaillList(Object.assign(parameter, { dispatchBillSn: this.outBizSubSn || this.$route.params.sn })).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 productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
-            const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
-            const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
-            const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
-            data.list[i].productCode = productCode || '--'
-            data.list[i].productName = productName || '--'
-            data.list[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
-            data.list[i].productOrigUnit = productOrigUnit || '--'
+          let data
+          if (res.status == 200) {
+            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 productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
+              const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
+              const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
+              const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
+              data.list[i].productCode = productCode || '--'
+              data.list[i].productName = productName || '--'
+              data.list[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+              data.list[i].productOrigUnit = productOrigUnit || '--'
+            }
+            this.localDataSource = data.list
+            this.disabled = false
           }
-          this.localDataSource = data.list
-          this.disabled = false
           return data
         })
       },
@@ -165,6 +155,28 @@ export default {
       openExcelModal: false
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '19%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '19%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productOrigUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '销售价格', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '市级销售价格', dataIndex: 'cityPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'salesQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次下推数', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '市级销售价格', dataIndex: 'cityPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回
     handleBack () {

+ 29 - 21
src/views/salesManagement/pushOrderManagement/list.vue

@@ -70,7 +70,7 @@
         <div slot="message">
           下推总单数::<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
           下推总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
-          下推总金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;
+          <span v-if="$hasPermissions('B_isShowPrice')">下推总金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;</span>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -132,21 +132,6 @@ export default {
         totalQty: 0,
         totalRecord: 0
       },
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        // { title: '区域', dataIndex: 'shippingAddrCountyName', width: 120, align: 'center' },
-        // { title: '省份', dataIndex: 'shippingAddrProvinceName', width: 120, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '14%', align: 'center' },
-        { title: '关联销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '14%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '下推数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '下推金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '备货时间', dataIndex: 'stockUpDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库时间', dataIndex: 'stockOutDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -156,12 +141,15 @@ export default {
           this.totalData = Object.assign(this.totalData, res.data || {})
         })
         return dispatchlList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -169,6 +157,26 @@ export default {
       addrProvinceList: [] //  省下拉
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '14%', align: 'center' },
+        { title: '关联销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '14%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '下推数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '下推金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '备货时间', dataIndex: 'stockUpDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库时间', dataIndex: 'stockOutDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(6, 0, { title: '下推金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 17 - 9
src/views/salesManagement/salesQuery/chooseActive.vue

@@ -87,12 +87,15 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return getPromoGoodsList(Object.assign(parameter, { salesBillDetailSn: this.nowData.salesBillDetailSn || undefined, buyerSn: this.buyerSn })).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
-            data.list[i].qty = 1
-            data.list[i].promotionSourceSn = this.nowData.salesBillDetailSn
+          let data
+          if (res.status == 200) {
+            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
+              data.list[i].qty = 1
+              data.list[i].promotionSourceSn = this.nowData.salesBillDetailSn
+            }
           }
           this.spinning = false
           return data
@@ -105,15 +108,20 @@ export default {
       const arr = [
         { title: '产品编码', dataIndex: 'code', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销价', dataIndex: 'promoRuleGoods.goodsPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '原售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '促销价', dataIndex: 'promoRuleGoods.goodsPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '数量', dataIndex: 'qty', scopedSlots: { customRender: 'salesNums' }, width: 100, align: 'center' },
         { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promoRuleGoods.promoRuleTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(2, 0, { title: '成本价', dataIndex: 'cost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 3 : 2
+        arr.splice(ind, 0, { title: '原售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 1, 0, { title: '促销价', dataIndex: 'promoRuleGoods.goodsPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     }
   },

+ 48 - 36
src/views/salesManagement/salesQuery/detail.vue

@@ -74,17 +74,17 @@
                 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
                 已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
                 待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
-                总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
+                <span v-if="$hasPermissions('B_isShowPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;</span>
                 <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;</span>
-                总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
-                已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? detailData.totalCancelAmount : '--' }}</strong>;
-                已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? detailData.totalPushedAmount : '--' }}</strong>;
-                待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? detailData.totalUnpushedAmount : '--' }}</strong>;
-                已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? detailData.totalDispatchAmount : '--' }}</strong>;
-                待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? detailData.totalUndispatchAmount : '--' }}</strong>;
+                <span v-if="$hasPermissions('B_isShowCost')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_isShowPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? detailData.totalCancelAmount : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_isShowPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? detailData.totalPushedAmount : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_isShowPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? detailData.totalUnpushedAmount : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_isShowPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? detailData.totalDispatchAmount : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_isShowPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? detailData.totalUndispatchAmount : '--' }}</strong>;</span>
                 <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? detailData.totalCityAmount : '--' }}</strong>;</span>
               </div>
-              <a-checkbox v-model="isCityPrice"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              <a-checkbox v-model="isCityPrice" v-if="$hasPermissions('B_isShowPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
             </div>
           </div>
         </a-alert>
@@ -213,30 +213,33 @@ export default {
           url = salesDetailAllList
         }
         return url(params).then(res => {
-          const data = res.data
-          const no = 0
-          this.outStockStr = ''
-          let str = ''
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = no + i + 1
-            const productCode = (data[i].productEntity && data[i].productEntity.code) || (data[i].dealerProductEntity && data[i].dealerProductEntity.code)
-            const productName = (data[i].productEntity && data[i].productEntity.name) || (data[i].dealerProductEntity && data[i].dealerProductEntity.name)
-            const productOrigCode = (data[i].productEntity && data[i].productEntity.origCode) || (data[i].dealerProductEntity && data[i].dealerProductEntity.origCode)
-            const productOrigUnit = (data[i].productEntity && data[i].productEntity.unit) || (data[i].dealerProductEntity && data[i].dealerProductEntity.unit)
-            data[i].productCode = productCode || '--'
-            data[i].productName = productName || '--'
-            data[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
-            data[i].productOrigUnit = productOrigUnit || '--'
-            if (data[i].unpushedQty && (Number(data[i].stockQty) < Number(data[i].unpushedQty))) {
-              str += data[i].productCode + '、'
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            this.outStockStr = ''
+            let str = ''
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+              const productCode = (data[i].productEntity && data[i].productEntity.code) || (data[i].dealerProductEntity && data[i].dealerProductEntity.code)
+              const productName = (data[i].productEntity && data[i].productEntity.name) || (data[i].dealerProductEntity && data[i].dealerProductEntity.name)
+              const productOrigCode = (data[i].productEntity && data[i].productEntity.origCode) || (data[i].dealerProductEntity && data[i].dealerProductEntity.origCode)
+              const productOrigUnit = (data[i].productEntity && data[i].productEntity.unit) || (data[i].dealerProductEntity && data[i].dealerProductEntity.unit)
+              data[i].productCode = productCode || '--'
+              data[i].productName = productName || '--'
+              data[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+              data[i].productOrigUnit = productOrigUnit || '--'
+              if (data[i].unpushedQty && (Number(data[i].stockQty) < Number(data[i].unpushedQty))) {
+                str += data[i].productCode + '、'
+              }
             }
+            if (str.length > 0) {
+              str = str.substr(0, str.length - 1)
+              this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
+            }
+            this.localDataSource = data
+            this.disabled = false
           }
-          if (str.length > 0) {
-            str = str.substr(0, str.length - 1)
-            this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
-          }
-          this.localDataSource = data
-          this.disabled = false
           return data
         })
       },
@@ -270,20 +273,29 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'left' },
         { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
         { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
         arr.splice(4, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
-      if (this.isCityPrice) {
-        const ind = this.$hasPermissions('B_isShowCost') ? 6 : 5
-        arr.splice(ind, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 5 : 4
+        arr.splice(ind, 0, { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        if (this.isCityPrice) {
+          arr.splice(ind + 1, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          arr.splice(ind + 2, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        } else {
+          arr.splice(ind + 1, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        }
       }
       if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
         arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })

+ 32 - 21
src/views/salesManagement/salesQuery/edit.vue

@@ -37,7 +37,7 @@
           <div slot="message" class="total-bar">
             <div style="position: relative;width: 100%;">
               <div>
-                总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? '¥'+detailData.totalCommonAmount : '--' }}</strong>;
+                <span v-if="$hasPermissions('B_isShowPrice')">总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? '¥'+detailData.totalCommonAmount : '--' }}</strong>;</span>
                 总款数:<strong>{{ detailData&&(detailData.totalCommonCategory || detailData.totalCommonCategory==0) ? detailData.totalCommonCategory : '--' }}</strong>;
                 总数量:<strong>{{ detailData&&(detailData.totalCommonQty || detailData.totalCommonQty==0) ? detailData.totalCommonQty : '--' }}</strong>;
               </div>
@@ -215,32 +215,23 @@ export default {
       },
       activeName: '', // 促销活动
       nowData: null,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '20%', align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '25%', align: 'left' },
-        { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
-        { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.productForm.salesBillSn = this.$route.params.sn
         return salesDetailStockList(Object.assign(parameter, this.productForm, 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
-            data.list[i].qtyBackups = data.list[i].qty
+          let data
+          if (res.status == 200) {
+            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
+              data.list[i].qtyBackups = data.list[i].qty
+            }
+            this.disabled = false
+            this.dataSource = data.list
+            this.$refs.promotable.getData(this.salesBillSn)
           }
-          this.disabled = false
-          this.dataSource = data.list
-          this.$refs.promotable.getData(this.salesBillSn)
           return data
         })
       },
@@ -251,6 +242,26 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '20%', align: 'center', sorter: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '25%', align: 'left' },
+        // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
+        { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+        arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 已选产品  blur
     onCellBlur (val, record) {

+ 20 - 12
src/views/salesManagement/salesQuery/list.vue

@@ -116,7 +116,7 @@
                 已取消数量:<strong>{{ totalData&&(totalData.totalCancelQty || totalData.totalCancelQty==0) ? totalData.totalCancelQty : '--' }}</strong>;
                 待下推数量:<strong>{{ totalData&&(totalData.totalUnpushedQty || totalData.totalUnpushedQty==0) ? totalData.totalUnpushedQty : '--' }}</strong>;
               </div>
-              <div>
+              <div v-if="$hasPermissions('B_isShowPrice')">
                 总售价:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;
                 已下推金额::<strong>{{ totalData&&(totalData.totalPushedAmount || totalData.totalPushedAmount==0) ? totalData.totalPushedAmount : '--' }}</strong>元;
                 已取消金额::<strong>{{ totalData&&(totalData.totalCancelAmount || totalData.totalCancelAmount==0) ? totalData.totalCancelAmount : '--' }}</strong>元;
@@ -283,12 +283,15 @@ export default {
           this.totalData = Object.assign(this.totalData, res.data || {})
         })
         return salesList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -306,10 +309,10 @@ export default {
         { title: '提交时间', dataIndex: 'submitDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: '4%', align: 'center' },
-        { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已下推数量', dataIndex: 'totalPushedQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已发货数量', dataIndex: 'totalDispatchQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已下推数量', dataIndex: 'totalPushedQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已发货数量', dataIndex: 'totalDispatchQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
@@ -319,8 +322,13 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       if (this.showCancelNum) {
-        arr.splice(10, 0, { title: '已取消数量', dataIndex: 'totalCancelQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(11, 0, { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        const ind = this.$hasPermissions('B_isShowPrice') ? 10 : 8
+        arr.splice(ind, 0, { title: '已取消数量', dataIndex: 'totalCancelQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 1, 0, { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+        arr.splice(6, 0, { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }

+ 34 - 23
src/views/salesManagement/salesQuery/queryPart.vue

@@ -125,39 +125,50 @@ export default {
         productTypeSn3: '' //  产品三级分类
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.queryParam.dealerSn = this.buyerSn
+        return queryStockProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1' })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            data.list = data.list.filter(item => item != null)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].salesNums = 1
+              data.list[i].currentStockQty = data.list[i].currentStockQty || 0
+              const productPackQty = (data.list[i].productPackQty || data.list[i].productPackQty == 0) ? data.list[i].productPackQty : '--'
+              const productUnit = data.list[i].productUnit || '--'
+              const productPackQtyUnit = data.list[i].productPackQtyUnit || '--'
+              data.list[i].packQtyV = productPackQty + productUnit + '/' + productPackQtyUnit
+            }
+            this.disabled = false
+          }
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
         { title: '产品编码', dataIndex: 'productCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, width: '18%', align: 'left' },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '品牌', dataIndex: 'productBrandName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '包装数', dataIndex: 'packQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '8%', align: 'center' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.queryParam.dealerSn = this.buyerSn
-        return queryStockProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1' })).then(res => {
-          const data = res.data
-          data.list = data.list.filter(item => item != null)
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            data.list[i].salesNums = 1
-            data.list[i].currentStockQty = data.list[i].currentStockQty || 0
-            const productPackQty = (data.list[i].productPackQty || data.list[i].productPackQty == 0) ? data.list[i].productPackQty : '--'
-            const productUnit = data.list[i].productUnit || '--'
-            const productPackQtyUnit = data.list[i].productPackQtyUnit || '--'
-            data.list[i].packQtyV = productPackQty + productUnit + '/' + productPackQtyUnit
-          }
-          this.disabled = false
-          return data
-        })
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+        arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      return arr
     }
   },
   methods: {

+ 16 - 8
src/views/salesManagement/salesQuery/queryPromotable.vue

@@ -56,11 +56,14 @@ export default {
       loadData: parameter => {
         this.productForm.salesBillSn = this.salesBillSn
         return salesDetailList(Object.assign(parameter, this.productForm)).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
-            data.list[i].qtyBackups = data.list[i].qty
+          let data
+          if (res.status == 200) {
+            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
+              data.list[i].qtyBackups = data.list[i].qty
+            }
           }
           return data
         })
@@ -73,16 +76,21 @@ export default {
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原售价', dataIndex: 'origPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '原售价', dataIndex: 'origPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '促销价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '数量', dataIndex: 'qty', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promotionRulesName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowCost')) {
+      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(3, 0, { title: '成本价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 4 : 3
+        arr.splice(ind, 0, { title: '原售价', dataIndex: 'origPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 1, 0, { title: '促销价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     }
   },

+ 13 - 10
src/views/salesManagement/salesQuery/receivingAddress/chooseAddressModal.vue

@@ -111,17 +111,20 @@ export default {
       loadData: parameter => {
         this.disabled = true
         return dealerRecevieAddrQuery({ dealerSn: this.paramsData }).then(res => {
-          const data = res.data
-          const no = 0
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = no + i + 1
-            const provinceName = data[i].provinceName ? (data[i].provinceName + '-') : ''
-            const cityName = data[i].cityName ? (data[i].cityName + '-') : ''
-            const countyName = data[i].countyName ? (data[i].countyName + '-') : ''
-            const addr = data[i].addr || ''
-            data[i].address = provinceName + cityName + countyName + addr
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+              const provinceName = data[i].provinceName ? (data[i].provinceName + '-') : ''
+              const cityName = data[i].cityName ? (data[i].cityName + '-') : ''
+              const countyName = data[i].countyName ? (data[i].countyName + '-') : ''
+              const addr = data[i].addr || ''
+              data[i].address = provinceName + cityName + countyName + addr
+            }
+            this.disabled = false
           }
-          this.disabled = false
           return data
         })
       },

+ 34 - 23
src/views/salesManagement/salesReturn/detail.vue

@@ -47,7 +47,7 @@
               <a-descriptions-item label="退货数量">{{ detailData&&(detailData.totalQty || detailData.totalQty == 0) ? detailData.totalQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="坏件数量">{{ detailData&&(detailData.totalBadQty || detailData.totalBadQty == 0) ? detailData.totalBadQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="返库数量">{{ detailData&&(detailData.totalBackStockQty || detailData.totalBackStockQty == 0) ? detailData.totalBackStockQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货金额">{{ detailData&&(detailData.totalAmount || detailData.totalAmount == 0) ? detailData.totalAmount : '--' }}元</a-descriptions-item>
+              <a-descriptions-item label="退货金额" v-if="$hasPermissions('B_isShowPrice')">{{ detailData&&(detailData.totalAmount || detailData.totalAmount == 0) ? detailData.totalAmount : '--' }}元</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -115,34 +115,23 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '17%', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', width: '17%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '4%', customRender: function (text) { return text || '--' } },
-        { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         const params = Object.assign(parameter, { salesReturnBillSn: this.$route.params.sn })
         return salesReturnDetailList(params).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
-            // 折后退货金额小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].saleReturnSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
+          let data
+          if (res.status == 200) {
+            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
+              // 折后退货金额小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].saleReturnSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
+            }
+            this.chooseLoadData = data.list
+            this.disabled = false
           }
-          this.chooseLoadData = data.list
-          this.disabled = false
           return data
         })
       },
@@ -152,6 +141,28 @@ export default {
       spinningAudit: false
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '17%', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', width: '17%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
+        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '4%', customRender: function (text) { return text || '--' } },
+        // { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'remark', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(4, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回
     handleBack () {

+ 34 - 25
src/views/salesManagement/salesReturn/list.vue

@@ -77,7 +77,7 @@
       <!-- alert -->
       <a-alert type="info" style="margin-bottom: 10px;">
         <div slot="message">
-          退货总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? countData.totalAmount : '--' }}</strong>元;
+          <span v-if="$hasPermissions('B_isShowPrice')">退货总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? countData.totalAmount : '--' }}</strong>元;</span>
           总单数:<strong>{{ countData&&(countData.totalRecord || countData.totalRecord==0) ? countData.totalRecord : '--' }}</strong>;
           总数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : '--' }}</strong>;
         </div>
@@ -91,7 +91,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1600, y: tableHeight }"
+        :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
         <!-- 单号 -->
@@ -212,24 +212,6 @@ export default {
         shippingAddrProvinceSn: undefined
       },
       countData: null, // 统计数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户采退单号', dataIndex: 'purchaseReturnBillNo', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: 180, align: 'center' },
-        { title: '退货客户', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'totalBadQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'totalBackStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退款金额', dataIndex: 'totalAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '是否抓单', dataIndex: 'grabFlag', width: 80, align: 'center', customRender: function (text) { return ['否', '是'][text] } },
-        { title: '审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '财务状态', dataIndex: 'financialStatusDictValue', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -237,12 +219,15 @@ export default {
         // 查询总计
         this.getQueryCount(Object.assign(parameter, this.queryParam))
         return salesReturnList(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
+          let data
+          if (res.status == 200) {
+            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
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -253,6 +238,30 @@ export default {
       spinningAudit: false
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户采退单号', dataIndex: 'purchaseReturnBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
+        { title: '退货客户', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退款金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '是否抓单', dataIndex: 'grabFlag', width: '6%', align: 'center', customRender: function (text) { return ['否', '是'][text] } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '财务状态', dataIndex: 'financialStatusDictValue', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(9, 0, { title: '退款金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  创建时间  change
     dateCreateChange (date) {

+ 33 - 14
src/views/salesManagement/salesReturn/queryPart.vue

@@ -111,13 +111,16 @@ export default {
         }
         const fun = [queryStockProductPage, salesQueryByReturn]
         return fun[this.grabFlag](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
-            data.list[i].qty = 1
+          let data
+          if (res.status == 200) {
+            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
+              data.list[i].qty = 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           return data
         })
       }
@@ -148,33 +151,49 @@ export default {
       this.$refs.table.refresh(true)
     },
     pageInit (buyerSn, grabFlag) {
-      console.log(grabFlag, buyerSn)
       this.buyerSn = buyerSn
       this.grabFlag = grabFlag
       // 抓单
       if (this.grabFlag == 1) {
-        this.columns = [
+        const arr = [
           { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
           { title: '销售单号', dataIndex: 'salesBillNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
           { title: '产品编码', dataIndex: 'productEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
           { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-          { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
           { title: '剩余可退数量', dataIndex: 'refundableQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
           { title: '本次退货数量', dataIndex: 'qty', width: '8%', align: 'center', scopedSlots: { customRender: 'qty' } },
-          { title: '采购价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          // { title: '采购价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
           { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }]
+          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+        ]
+        if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+          arr.splice(4, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        }
+        if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+          const ind = this.$hasPermissions('B_isShowPrice') ? 7 : 6
+          arr.splice(ind, 0, { title: '采购价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        }
+        this.columns = arr
       } else {
-        this.columns = [
+        const arr = [
           { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
           { title: '产品编码', dataIndex: 'productCode', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
           { title: '产品名称', dataIndex: 'productName', width: '27%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-          { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          // { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
           { title: '退货数量', dataIndex: 'qty', width: '9%', align: 'center', scopedSlots: { customRender: 'qty' } },
-          { title: '采购价', dataIndex: 'lastStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          // { title: '采购价', dataIndex: 'lastStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
           { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
           { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
         ]
+        if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+          arr.splice(3, 0, { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        }
+        if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+          const ind = this.$hasPermissions('B_isShowPrice') ? 5 : 4
+          arr.splice(ind, 0, { title: '采购价', dataIndex: 'lastStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        }
+        this.columns = arr
       }
       this.resetSearchForm()
     },

Some files were not shown because too many files changed in this diff