浏览代码

Merge branch 'deploy' of jianguan-web/jg-ocs-html into master

陈瑞 3 年之前
父节点
当前提交
2ece9608da
共有 100 个文件被更改,包括 8072 次插入6854 次删除
  1. 2 2
      .env
  2. 2 2
      .env.development
  3. 2 2
      .env.preview
  4. 0 47
      public/adapter.js
  5. 34 50
      public/index.html
  6. 49 0
      src/api/allocateReport.js
  7. 8 0
      src/api/power-user.js
  8. 8 0
      src/api/product.js
  9. 3 3
      src/api/productUniversalCode.js
  10. 106 0
      src/api/reportData.js
  11. 55 0
      src/api/salesBillReport.js
  12. 10 7
      src/components/Table/index.js
  13. 1 1
      src/components/tools/UserMenu.vue
  14. 846 865
      src/config/router.config.js
  15. 10 10
      src/store/modules/permission.js
  16. 1 1
      src/views/allocationManagement/transferOut/detail.vue
  17. 1 1
      src/views/allocationManagement/transferOut/edit.vue
  18. 135 107
      src/views/allocationManagement/transferOut/list.vue
  19. 42 31
      src/views/basicData/transferTypeManagement/list.vue
  20. 63 54
      src/views/basicData/warehouse/list.vue
  21. 64 57
      src/views/basicData/warehouse/storingLocation/list.vue
  22. 5 2
      src/views/bnSetting/menu/adminMenus.vue
  23. 3 1
      src/views/bnSetting/menu/childModal.vue
  24. 4 0
      src/views/common/rangeDate.vue
  25. 31 31
      src/views/dealerManagement/dealerAccountManagement/editModal.vue
  26. 87 62
      src/views/dealerManagement/dealerAccountManagement/list.vue
  27. 8 0
      src/views/dealerManagement/dealerRelationshipBinding/list.vue
  28. 1 1
      src/views/dealerManagement/marketingDivisionSet/editModal.vue
  29. 51 31
      src/views/dealerManagement/marketingDivisionSet/list.vue
  30. 82 76
      src/views/dealerManagement/merchantInfoManagement/detailModal.vue
  31. 6 6
      src/views/dealerManagement/merchantInfoManagement/edit.vue
  32. 92 84
      src/views/dealerManagement/merchantInfoManagement/list.vue
  33. 73 62
      src/views/dealerManagement/merchantInfoManagement/permissionSetting.vue
  34. 0 1
      src/views/dealerManagement/merchantInfoManagement/updateDealerLevel.vue
  35. 8 1
      src/views/dealerManagement/rebateSettings/list.vue
  36. 1 1
      src/views/dealerManagement/rebateSettings/queryChild.vue
  37. 147 127
      src/views/financialManagement/financialCollection/list.vue
  38. 89 74
      src/views/financialManagement/returnConfirmation/list.vue
  39. 173 113
      src/views/financialManagement/warehousingConfirmation/list.vue
  40. 14 6
      src/views/inventoryManagement/intelligentReplenishment/edit.vue
  41. 51 46
      src/views/inventoryManagement/intelligentReplenishment/import.vue
  42. 61 51
      src/views/inventoryManagement/intelligentReplenishment/list.vue
  43. 39 32
      src/views/inventoryManagement/intelligentReplenishment/productRange.vue
  44. 61 57
      src/views/inventoryManagement/intelligentReplenishment/set.vue
  45. 114 95
      src/views/inventoryManagement/inventoryQuery/list.vue
  46. 160 146
      src/views/inventoryManagement/inventoryWarning/list.vue
  47. 4 4
      src/views/power/menu/menu.vue
  48. 67 56
      src/views/power/role/menuModal.vue
  49. 80 89
      src/views/power/role/roleList.vue
  50. 83 91
      src/views/power/role/roleModal.vue
  51. 106 92
      src/views/power/user/userList.vue
  52. 3 1
      src/views/power/user/userModal.vue
  53. 112 106
      src/views/productManagement/priceChangeRecord/list.vue
  54. 79 58
      src/views/productManagement/productBrand/list.vue
  55. 52 45
      src/views/productManagement/productCategory/list.vue
  56. 7 22
      src/views/productManagement/productInfo/detailModal.vue
  57. 26 7
      src/views/productManagement/productInfo/edit.vue
  58. 198 153
      src/views/productManagement/productInfo/list.vue
  59. 79 68
      src/views/productManagement/productLaunchAudit/list.vue
  60. 2 2
      src/views/productManagement/productLevel/editModal.vue
  61. 8 1
      src/views/productManagement/productLevel/list.vue
  62. 113 102
      src/views/productManagement/productOfflineAudit/list.vue
  63. 3 2
      src/views/productManagement/productPricing/list.vue
  64. 81 61
      src/views/productManagement/productUniversal/list.vue
  65. 17 7
      src/views/promotionRulesManagement/orderStatistics/list.vue
  66. 14 6
      src/views/promotionRulesManagement/productStatistics/list.vue
  67. 6 6
      src/views/promotionRulesManagement/promotionRules/editRuleModal.vue
  68. 95 86
      src/views/promotionRulesManagement/promotionRules/list.vue
  69. 45 38
      src/views/promotionRulesManagement/promotionRules/rule.vue
  70. 78 71
      src/views/purchasingManagement/bulkWarehousingOrder/edit.vue
  71. 102 85
      src/views/purchasingManagement/bulkWarehousingOrder/list.vue
  72. 249 340
      src/views/reportData/actualSalesReport/list.vue
  73. 417 227
      src/views/reportData/allocationDetails/list.vue
  74. 190 133
      src/views/reportData/allocationOrderTotal/list.vue
  75. 244 360
      src/views/reportData/billingReturnReport/list.vue
  76. 25 12
      src/views/reportData/districtTypeSalesDetails/list.vue
  77. 360 144
      src/views/reportData/nationalCustomerCostStatistics/list.vue
  78. 49 32
      src/views/reportData/priceDifferenceDetailReport/list.vue
  79. 34 16
      src/views/reportData/provinceTypeSalesDetails/list.vue
  80. 27 14
      src/views/reportData/regionalPromotionCostStatistics/list.vue
  81. 250 382
      src/views/reportData/returnSlipReport/list.vue
  82. 241 214
      src/views/reportData/salesAmountReport/list.vue
  83. 68 50
      src/views/reportData/salesDetails/list.vue
  84. 421 205
      src/views/reportData/salesReturnDetailReport/list.vue
  85. 242 333
      src/views/reportData/salesReturnReport/list.vue
  86. 267 165
      src/views/reportData/salesReturnsReport/list.vue
  87. 249 222
      src/views/reportData/salesSlipReport/list.vue
  88. 1 1
      src/views/salesManagement/backorder/detailModal.vue
  89. 4 3
      src/views/salesManagement/backorder/list.vue
  90. 100 93
      src/views/salesManagement/examineVerify/list.vue
  91. 112 86
      src/views/salesManagement/outboundOrder/list.vue
  92. 2 5
      src/views/salesManagement/pushOrderManagement/chooseTypeModal.vue
  93. 14 9
      src/views/salesManagement/pushOrderManagement/detail.vue
  94. 6 4
      src/views/salesManagement/pushOrderManagement/list.vue
  95. 3 3
      src/views/salesManagement/salesQuery/chooseActive.vue
  96. 24 9
      src/views/salesManagement/salesQuery/detail.vue
  97. 7 3
      src/views/salesManagement/salesQuery/edit.vue
  98. 196 177
      src/views/salesManagement/salesQuery/list.vue
  99. 3 3
      src/views/salesManagement/salesQuery/queryPart.vue
  100. 4 4
      src/views/salesManagement/salesQuery/queryPromotable.vue

+ 2 - 2
.env

@@ -6,5 +6,5 @@ VUE_APP_VERSION=V1.0.1
 VUE_APP_PRO_NAME=箭冠运营中心系统
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
-VUE_APP_COM_NAME=广州市箭冠网络科技有限公司
-VUE_APP_ICP=粤ICP备10216726
+VUE_APP_COM_NAME=陕西山海高科信息技术有限公司
+VUE_APP_ICP=陕ICP备20006268

+ 2 - 2
.env.development

@@ -6,5 +6,5 @@ VUE_APP_VERSION=V1.0.1
 VUE_APP_PRO_NAME=箭冠运营中心系统-dev
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
-VUE_APP_COM_NAME=广州市箭冠网络科技有限公司
-VUE_APP_ICP=粤ICP备10216726
+VUE_APP_COM_NAME=陕西山海高科信息技术有限公司
+VUE_APP_ICP=陕ICP备20006268

+ 2 - 2
.env.preview

@@ -6,5 +6,5 @@ VUE_APP_VERSION=V1.0.1
 VUE_APP_PRO_NAME=箭冠运营中心系统-pre
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
-VUE_APP_COM_NAME=广州市箭冠网络科技有限公司
-VUE_APP_ICP=粤ICP备10216726
+VUE_APP_COM_NAME=陕西山海高科信息技术有限公司
+VUE_APP_ICP=陕ICP备20006268

+ 0 - 47
public/adapter.js

@@ -1,47 +0,0 @@
-//  非谷歌浏览器或非IE11时,则提示下载谷歌浏览器进行访问
-function BrowserType () {
-  var userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
-  var isOpera = userAgent.indexOf('Opera') > -1 // 判断是否Opera浏览器
-  // var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
-  var isIE = window.ActiveXObject || 'ActiveXObject' in window
-  // var isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //判断是否IE的Edge浏览器
-  var isEdge = userAgent.indexOf('Edge') > -1 // 判断是否IE的Edge浏览器
-  var isFF = userAgent.indexOf('Firefox') > -1 // 判断是否Firefox浏览器
-  var isSafari = userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') == -1 // 判断是否Safari浏览器
-  var isChrome = userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Safari') > -1 && !isEdge // 判断Chrome浏览器
-
-  if (isIE) {
-    var reIE = new RegExp('MSIE (\\d+\\.\\d+);')
-    reIE.test(userAgent)
-    var fIEVersion = parseFloat(RegExp['$1'])
-    if (userAgent.indexOf('MSIE 6.0') != -1) {
-      return 'IE6'
-    } else if (fIEVersion == 7) {
-      return 'IE7'
-    } else if (fIEVersion == 8) {
-      return 'IE8'
-    } else if (fIEVersion == 9) {
-      return 'IE9'
-    } else if (fIEVersion == 10) {
-      return 'IE10'
-    } else if (userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)) {
-      return 'IE11'
-    } else { // IE版本过低
-      return '0'
-    }
-  } // isIE end
-
-  if (isFF) { return 'FF' }
-  if (isOpera) { return 'Opera' }
-  if (isSafari) { return 'Safari' }
-  if (isChrome) { return 'Chrome' }
-  if (isEdge) { return 'Edge' }
-} // myBrowser() end
-
-if (BrowserType() != 'Chrome' && BrowserType() != 'IE11') {
-  var con = alert('当前浏览器版本过低,为保证更好体验请下载谷歌浏览器进行操作, 点击【确定】升级,如不升级您将不能正常浏览网页!' + '\n' + '下载地址:“https://www.google.cn/chrome”') // 在页面上弹出对话框
-  if (con == true) {} else {
-    window.location = 'https://www.google.cn/chrome'
-  }
-}
-//  升级ie  https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads

+ 34 - 50
public/index.html

@@ -11,56 +11,40 @@
     <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
     <link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
     <% } %>
-    <!-- <script src="./adapter.js" type="text/javascript"></script> -->
-    <script>
-      //  非谷歌浏览器或非IE11时,则提示下载谷歌浏览器进行访问
-      function BrowserType () {
-        var userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
-        var isOpera = userAgent.indexOf('Opera') > -1 // 判断是否Opera浏览器
-        // var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
-        var isIE = window.ActiveXObject || 'ActiveXObject' in window
-        // var isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //判断是否IE的Edge浏览器
-        var isEdge = userAgent.indexOf('Edge') > -1 // 判断是否IE的Edge浏览器
-        var isFF = userAgent.indexOf('Firefox') > -1 // 判断是否Firefox浏览器
-        var isSafari = userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') == -1 // 判断是否Safari浏览器
-        var isChrome = userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Safari') > -1 && !isEdge // 判断Chrome浏览器
-      
-        if (isIE) {
-          var reIE = new RegExp('MSIE (\\d+\\.\\d+);')
-          reIE.test(userAgent)
-          var fIEVersion = parseFloat(RegExp['$1'])
-          if (userAgent.indexOf('MSIE 6.0') != -1) {
-            return 'IE6'
-          } else if (fIEVersion == 7) {
-            return 'IE7'
-          } else if (fIEVersion == 8) {
-            return 'IE8'
-          } else if (fIEVersion == 9) {
-            return 'IE9'
-          } else if (fIEVersion == 10) {
-            return 'IE10'
-          } else if (userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)) {
-            return 'IE11'
-          } else { // IE版本过低
-            return '0'
-          }
-        } // isIE end
-      
-        if (isFF) { return 'FF' }
-        if (isOpera) { return 'Opera' }
-        if (isSafari) { return 'Safari' }
-        if (isChrome) { return 'Chrome' }
-        if (isEdge) { return 'Edge' }
-      } // myBrowser() end
-      
-      if (BrowserType() != 'Chrome' && BrowserType() != 'IE11') {
-        var con = alert('当前浏览器版本过低,为保证更好体验请下载谷歌浏览器进行操作, 点击【确定】升级,如不升级您将不能正常浏览网页!' + '\n' + '下载地址:“https://www.google.cn/chrome”') // 在页面上弹出对话框
-        if (con == true) {} else {
-          window.location = 'https://www.google.cn/chrome'
-        }
-      }
-      //  升级ie  https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads
-    </script>
+	<script>
+		//  非谷歌浏览器或非IE11时,则提示下载谷歌浏览器进行访问
+		function BrowserType () {
+		  var userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
+		  var isOpera = userAgent.indexOf('Opera') > -1 // 判断是否Opera浏览器
+		  // var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
+		  var isIE = window.ActiveXObject || 'ActiveXObject' in window
+		  // var isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //判断是否IE的Edge浏览器
+		  var isEdge = userAgent.indexOf('Edge') > -1 // 判断是否IE的Edge浏览器
+		  var isFF = userAgent.indexOf('Firefox') > -1 // 判断是否Firefox浏览器
+		  var isSafari = userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') == -1 // 判断是否Safari浏览器
+		  var isChrome = userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Safari') > -1 && !isEdge // 判断Chrome浏览器
+		
+		  if (isIE) {
+		    var reIE = new RegExp('MSIE (\\d+\\.\\d+);')
+		    reIE.test(userAgent)
+		    var fIEVersion = parseFloat(RegExp['$1'])
+			console.log(fIEVersion)
+		    if (userAgent.indexOf('MSIE 6.0') != -1 || fIEVersion<11) {
+		      var con = alert('当前浏览器版本过低,为保证更好体验请下载谷歌浏览器进行操作, 点击【确定】升级,如不升级您将不能正常浏览网页!' + '\n' + '下载地址:“https://www.google.cn/chrome”') // 在页面上弹出对话框
+		      if (con == true) {} else {
+		        window.location = 'https://www.google.cn/chrome'
+		      }
+		    }
+		  } // isIE end
+		
+		  if (isFF) { return 'FF' }
+		  if (isOpera) { return 'Opera' }
+		  if (isSafari) { return 'Safari' }
+		  if (isChrome) { return 'Chrome' }
+		  if (isEdge) { return 'Edge' }
+		} 
+		BrowserType()
+	</script>
   </head>
   <body>
     <noscript>

+ 49 - 0
src/api/allocateReport.js

@@ -0,0 +1,49 @@
+import { axios } from '@/utils/request'
+
+//  调拨开单统计  列表  有分页
+export const allocateReportList = (params) => {
+  const url = `/report/allocateReport/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  调拨开单统计  列表  合计
+export const allocateReportCount = (params) => {
+  return axios({
+    url: '/report/allocateReport/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  调拨明细  列表  有分页
+export const allocateReportDetailList = (params) => {
+  const url = `/report/allocateReport/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  调拨明细  列表  合计
+export const allocateReportDetailCount = (params) => {
+  return axios({
+    url: '/report/allocateReport/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  调拨明细报表 导出
+export const allocateReportDetailExport = (params) => {
+  return axios({
+    url: '/report/allocateReport/detail/exportExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 8 - 0
src/api/power-user.js

@@ -64,3 +64,11 @@ export const userSubareaSave = params => {
     method: 'post'
   })
 }
+// 所有用户
+export const userQueryList = params => {
+  return axios({
+    url: '/yyuser/queryAllLike',
+    data: params,
+    method: 'POST'
+  })
+}

+ 8 - 0
src/api/product.js

@@ -212,3 +212,11 @@ export const productLevelList = (params) => {
     method: 'post'
   })
 }
+//  产品  级别 保存
+export const productLevelSave = (params) => {
+  return axios({
+    url: '/product/saveProductLevel',
+    data: params,
+    method: 'post'
+  })
+}

+ 3 - 3
src/api/productUniversalCode.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 //  通用产品 列表  有分页
 export const productUniversalCodeList = (params) => {
-  const url = `/productUniversalCode/query/${params.pageNo}/${params.pageSize}`
+  const url = `/productUniversalCode/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -29,7 +29,7 @@ export const productUniversalCodeSave = (params) => {
 }
 //  通用产品 详情
 export const productUniversalCodeDetail = (params) => {
-  const url = `/productUniversalCode/${params.id}`
+  const url = `/productUniversalCode/findById/${params.id}`
   return axios({
     url: url,
     method: 'get'
@@ -37,7 +37,7 @@ export const productUniversalCodeDetail = (params) => {
 }
 //  产品编码模糊搜索  有分页  产品编码
 export const productCodeQueryList = (params) => {
-  const url = `/productUniversalCode/productList/${params.pageNo}/${params.pageSize}`
+  const url = `/productUniversalCode/productListPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 106 - 0
src/api/reportData.js

@@ -0,0 +1,106 @@
+import { axios } from '@/utils/request'
+
+//  开单退货单报表
+export const salesReportReturnBillList = (params) => {
+  const url = `/report/salesReturnBillReport/returnBillQueryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  开单退货单报表  合计
+export const salesReportReturnBillCount = (params) => {
+  return axios({
+    url: '/report/salesReturnBillReport/returnBillQuerySum',
+    data: params,
+    method: 'post'
+  })
+}
+//  开单退货报表
+export const salesReportReturnList = (params) => {
+  const url = `/report/salesReturnBillReport/returnQueryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  开单退货报表  合计
+export const salesReportReturnCount = (params) => {
+  return axios({
+    url: '/report/salesReturnBillReport/returnQuerySum',
+    data: params,
+    method: 'post'
+  })
+}
+//  实售退货报表
+export const salesReportReturnRebateList = (params) => {
+  const url = `/report/salesReturnBillReport/returnRebateQueryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  实售退货报表  合计
+export const salesReportReturnRebateCount = (params) => {
+  return axios({
+    url: '/report/salesReturnBillReport/returnRebateQuerySum',
+    data: params,
+    method: 'post'
+  })
+}
+//  销售退货单报表
+export const reportSalesReturnList = (params) => {
+  const url = `/report/reportSalesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  销售退货单报表  合计
+export const reportSalesReturnCount = (params) => {
+  return axios({
+    url: '/report/reportSalesReturn/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  销售退货明细报表
+export const reportSalesReturnDetailList = (params) => {
+  const url = `/report/reportSalesReturn/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  销售退货明细报表  合计
+export const reportSalesReturnDetailCount = (params) => {
+  return axios({
+    url: '/report/reportSalesReturn/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  销售退货明细报表 导出
+export const reportSalesReturnDetailExport = (params) => {
+  return axios({
+    url: '/report/reportSalesReturn/detail/exportExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 55 - 0
src/api/salesBillReport.js

@@ -0,0 +1,55 @@
+import { axios } from '@/utils/request'
+
+//  开单销售单报表   列表  有分页
+export const salesBillReportList = (params) => {
+  const url = `/report/salesBillReport/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//  开单销售报表   列表  有分页
+export const salesBillReportGroupByBuyerList = (params) => {
+  const url = `/report/salesBillReport/queryPageGroupByBuyer/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//  开单销售单报表/开单销售报表   合计
+export const salesBillReportCount = (params) => {
+  return axios({
+    url: '/report/salesBillReport/totalSaleAmount',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 实售销售报表
+export const salesBillRealAmountQueryPageList = (params) => {
+  const url = `/report/salesBillReport/realAmountQueryPageGroupByBuyer/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//  实售销售报表   合计
+export const salesBillRealReportCount = (params) => {
+  return axios({
+    url: '/report/salesBillReport/totalRealAmount',
+    data: params,
+    method: 'post'
+  })
+}

+ 10 - 7
src/components/Table/index.js

@@ -145,6 +145,13 @@ export default {
       }))
       this.loadData()
     },
+    // 重置表格为空
+    clearTable(){
+      this.localDataSource = []
+      this.localPagination = Object.assign({}, {
+        current: 1, pageSize: this.pageSize, total: 0
+      })
+    },
     /**
      * 加载数据方法
      * @param {Object} pagination 分页选项器
@@ -157,7 +164,9 @@ export default {
         pageNo: (pagination && pagination.current) ||
           this.showPagination && this.localPagination.current || this.pageNum,
         pageSize: (pagination && pagination.pageSize) ||
-          this.showPagination && this.localPagination.pageSize || this.pageSize
+          this.showPagination && this.localPagination.pageSize || this.pageSize,
+        tableId: this.tableId,
+        index: this.index
       },
       (sorter && sorter.field && {
         sortField: sorter.field
@@ -168,12 +177,6 @@ export default {
         ...filters
       }
       )
-      if (this.tableId != '') {
-        parameter.tableId = this.tableId
-      }
-      if (this.index != '') {
-        parameter.index = this.index
-      }
       // console.log('parameter', parameter)
       const result = this.data(parameter)
       // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.count, r.data

+ 1 - 1
src/components/tools/UserMenu.vue

@@ -67,7 +67,7 @@ export default {
     handleLogout () {
       this.$confirm({
         title: '提示',
-        content: '真的要退出登录吗 ?',
+        content: '确定要退出登录吗 ?',
         centered: true,
         onOk: () => {
           return this.Logout({}).then(() => {

文件差异内容过多而无法显示
+ 846 - 865
src/config/router.config.js


+ 10 - 10
src/store/modules/permission.js

@@ -9,16 +9,16 @@ import { asyncRouterMap, constantRouterMap } from '@/config/router.config'
  */
 function hasPermission (permission, route) {
   if (route.meta && route.meta.permission) {
-    // let flag = permission.find(item => {
-    //   return item&&item == route.meta.permission
-    // })
-    let flag = false
-    for (let i = 0, len = permission.length; i < len; i++) {
-      flag = route.meta.permission.includes(permission[i])
-      if (flag) {
-        return true
-      }
-    }
+    let flag = permission.find(item => {
+      return item&&item == route.meta.permission
+    })
+    // let flag = false
+    // for (let i = 0, len = permission.length; i < len; i++) {
+    //   flag = route.meta.permission.includes(permission[i])
+    //   if (flag) {
+    //     return true
+    //   }
+    // }
     return flag
   }
   return true

+ 1 - 1
src/views/allocationManagement/transferOut/detail.vue

@@ -14,7 +14,7 @@
             @click.stop="handleEdit">编辑</a-button>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template v-if="$hasPermissions('B_transferOut_print')" slot="extra">
           <a-button key="2" id="allocateBillDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
           <a-button key="1" type="primary" id="allocateBillDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
         </template>

+ 1 - 1
src/views/allocationManagement/transferOut/edit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">调往对象:{{ $route.params.name || '--' }}</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template v-if="$hasPermissions('B_transferOut_print')" slot="extra">
           <a-button key="2" id="allocateBillEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
           <a-button key="1" type="primary" id="allocateBillEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
         </template>

+ 135 - 107
src/views/allocationManagement/transferOut/list.vue

@@ -1,112 +1,114 @@
 <template>
   <a-card size="small" :bordered="false" class="allocateBillList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调往对象">
-              <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调拨类型">
-              <a-select id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型" allowClear >
-                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
-                <v-select
-                  v-model="queryParam.state"
-                  ref="state"
-                  id="allocateBillList-state"
-                  code="ALLOCATE_STATUS"
-                  placeholder="请选择业务状态"
-                  allowClear
-                ></v-select>
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨单号">
-                <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+              <a-form-item label="调往对象">
+                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
-            <!-- <a-button
-              style="margin: 0 0 18px 5px"
-              type="primary"
-              class="button-warning"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              id="allocateBillList-export">导出</a-button> -->
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="allocateBillList-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1940, y: tableHeight }"
-      bordered>
-      <!-- 单号 -->
-      <template slot="allocateNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocateNo }}</span>
-      </template>
-      <!-- 财务状态 -->
-      <template slot="settleState" slot-scope="text, record">
-        <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.settleStateDictValue" />
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          class="button-warning"
-          @click="handleExamine(record)"
-          id="allocateBillList-examine-btn">审核</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="allocateBillList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')"
-          class="button-error"
-          @click="handleDel(record)"
-          id="allocateBillList-del-btn">删除</a-button>
-        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT') && (record.state != 'AUDIT_REJECT')">--</span>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调拨类型">
+                <a-select id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型" allowClear >
+                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.state"
+                    ref="state"
+                    id="allocateBillList-state"
+                    code="ALLOCATE_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="调拨单号">
+                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
+              <!-- <a-button
+                style="margin: 0 0 18px 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="allocateBillList-export">导出</a-button> -->
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button v-if="$hasPermissions('B_transferOut_add')" id="allocateBillList-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1940, y: tableHeight }"
+        bordered>
+        <!-- 单号 -->
+        <template slot="allocateNo" slot-scope="text, record">
+          <span :class="$hasPermissions('M_transferOut_detail')?'active':'common'" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+        </template>
+        <!-- 财务状态 -->
+        <template slot="settleState" slot-scope="text, record">
+          <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.settleStateDictValue" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_transferOut_audit')"
+            class="button-warning"
+            @click="handleExamine(record)"
+            id="allocateBillList-examine-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('M_transferOut_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="allocateBillList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('B_transferOut_del')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="allocateBillList-del-btn">删除</a-button>
+          <span v-if="((record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT') && (record.state != 'AUDIT_REJECT'))||(!$hasPermissions('B_transferOut_audit') && !$hasPermissions('M_transferOut_edit') && !$hasPermissions('B_transferOut_del'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
     <!-- 审核 -->
@@ -116,6 +118,7 @@
 
 <script>
 import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -126,11 +129,16 @@ export default {
   components: { STable, VSelect, basicInfoModal, rangeDate, auditModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
         allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
@@ -184,9 +192,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
@@ -205,10 +213,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocateBillDel({ sn: row.allocateSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -222,19 +234,24 @@ export default {
     // 审核
     auditOrder (state) {
       const _this = this
+      _this.spinning = true
       allocateBillAudit({ sn: this.auditInfo.allocateSn, state: state }).then(res => {
         if (res.status == 200) {
           _this.visibleAudit = false
           _this.$message.success(res.message)
           _this.$refs.table.refresh()
+          _this.spinning = false
         } else {
           _this.visibleAudit = false
+          _this.spinning = false
         }
       })
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.allocateSn}` })
+      if (this.$hasPermissions('M_transferOut_detail')) {
+        this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.allocateSn}` })
+      }
     },
     //  编辑
     handleEdit (row) {
@@ -244,9 +261,11 @@ export default {
     handleExport () {
       const params = this.queryParam
       this.exportLoading = true
+      this.spinning = true
       allocateBillExport(params).then(res => {
         this.exportLoading = false
         this.download(res)
+        this.spinning = false
       })
     },
     download (data) {
@@ -280,3 +299,12 @@ export default {
   }
 }
 </script>
+<style lang="less">
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
+</style>

+ 42 - 31
src/views/basicData/transferTypeManagement/list.vue

@@ -1,38 +1,44 @@
 <template>
   <a-card size="small" :bordered="false" class="transferTypeManagementList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator-nobor">
-      <a-button
-        id="transferTypeManagementList-add"
-        type="primary"
-        class="button-error"
-        @click="handleEdit()">新增</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator-nobor">
         <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="transferTypeManagementList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
+          id="transferTypeManagementList-add"
+          type="primary"
           class="button-error"
-          @click="handleDel(record)"
-          id="transferTypeManagementList-del-btn">删除</a-button>
-      </template>
-    </s-table>
+          v-if="$hasPermissions('B_transferTypeManagement_add')"
+          @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            v-if="$hasPermissions('B_transferTypeManagement_edit')"
+            id="transferTypeManagementList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            v-if="$hasPermissions('B_transferTypeManagement_del')"
+            id="transferTypeManagementList-del-btn">删除</a-button>
+          <span v-if="!$hasPermissions('B_transferTypeManagement_del') &&!$hasPermissions('B_transferTypeManagement_edit')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑 -->
     <transfer-type-management-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @close="closeModal" />
   </a-card>
@@ -46,6 +52,7 @@ export default {
   components: { STable, VSelect, transferTypeManagementEditModal },
   data () {
     return {
+      spinning: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
@@ -84,10 +91,14 @@ export default {
         content: '删除后原数据不可恢复,是否删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocateTypeDel({ sn: row.allocateTypeSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 63 - 54
src/views/basicData/warehouse/list.vue

@@ -1,59 +1,63 @@
 <template>
   <a-card size="small" :bordered="false" class="warehouseList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="仓库名称">
-              <a-input id="warehouseList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入仓库名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehouseList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="warehouseList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-warning"
-          @click="goStoringLocation(record)"
-          id="warehouseList-storingLocation-btn">仓位管理</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.defaultFlag!='1'"
-          @click="handleEdit(record)"
-          id="warehouseList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="record.defaultFlag!='1'"
-          @click="handleDel(record)"
-          id="warehouseList-del-btn">删除</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="仓库名称">
+                <a-input id="warehouseList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入仓库名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehouseList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button v-if="$hasPermissions('B_warehouse_add')" id="warehouseList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            @click="goStoringLocation(record)"
+            v-if="$hasPermissions('B_warehouse_ckSet')"
+            id="warehouseList-storingLocation-btn">仓位管理</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.defaultFlag!='1' &&$hasPermissions('B_warehouse_edit') "
+            @click="handleEdit(record)"
+            id="warehouseList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="record.defaultFlag!='1' &&$hasPermissions('B_warehouse_del')"
+            @click="handleDel(record)"
+            id="warehouseList-del-btn">删除</a-button>
+          <span v-if="record.defaultFlag=='0' && !$hasPermissions('B_warehouse_edit') && !$hasPermissions('B_warehouse_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑仓库 -->
     <warehouse-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -67,6 +71,7 @@ export default {
   components: { STable, warehouseEditModal },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         name: '' //  仓库名称
       },
@@ -127,12 +132,16 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           warehouseDel({
             sn: row.warehouseSn
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 64 - 57
src/views/basicData/warehouse/storingLocation/list.vue

@@ -1,63 +1,65 @@
 <template>
   <div class="storingLocationList-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="storingLocationList-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="storingLocationList-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <strong style="color: rgba(0, 0, 0, 0.65);margin-left: 50px;">所属仓库:{{ $route.query.name }}</strong>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="storingLocationList-cont">
-      <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-          <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="仓位名称">
-                <a-input id="storingLocationList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入仓位名称"/>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storingLocationList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storingLocationList-reset">重置</a-button>
-            </a-col>
-          </a-row>
-        </a-form>
-      </div>
-      <!-- 操作按钮 -->
-      <div class="table-operator" style="border: 0;padding: 0 0 15px;">
-        <a-button id="storingLocationList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-      </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="default"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-info"
-            v-if="record.defaultFlag!='1'"
-            @click="handleEdit(record)"
-            id="storingLocationList-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-error"
-            v-if="record.defaultFlag!='1'"
-            @click="handleDel(record)"
-            id="storingLocationList-del-btn">删除</a-button>
-          <span v-if="record.defaultFlag=='1'">--</span>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="storingLocationList-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="storingLocationList-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <strong style="color: rgba(0, 0, 0, 0.65);margin-left: 50px;">所属仓库:{{ $route.query.name }}</strong>
         </template>
-      </s-table>
-    </a-card>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="storingLocationList-cont">
+        <!-- 搜索条件 -->
+        <div class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="仓位名称">
+                  <a-input id="storingLocationList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入仓位名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storingLocationList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storingLocationList-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 操作按钮 -->
+        <div class="table-operator" style="border: 0;padding: 0 0 15px;">
+          <a-button id="storingLocationList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="default"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="record.defaultFlag!='1'"
+              @click="handleEdit(record)"
+              id="storingLocationList-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              v-if="record.defaultFlag!='1'"
+              @click="handleDel(record)"
+              id="storingLocationList-del-btn">删除</a-button>
+            <span v-if="record.defaultFlag=='1'">--</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
     <!-- 新增/编辑仓位 -->
     <storing-location-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
   </div>
@@ -71,6 +73,7 @@ export default {
   components: { STable, storingLocationEditModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
         warehouseSn: this.$route.params.sn, //  仓库sn
@@ -139,12 +142,16 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           warehouseLocDel({
             sn: row.warehouseLocationSn
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 5 - 2
src/views/bnSetting/menu/adminMenus.vue

@@ -102,8 +102,9 @@
           </a-form-item>
           <!-- 后台权限编码 -->
           <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
+            <a-textarea
               placeholder="请输入后台权限编码"
+              :auto-size="{ minRows: 2, maxRows: 6 }"
               v-decorator="[
                 'formData.permission',
                 {
@@ -239,7 +240,6 @@ export default {
       this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
-
     onSelect (selectedKeys, info) {
       console.log('onSelect', info)
       this.selectedKeys = selectedKeys
@@ -396,6 +396,9 @@ export default {
       this.form.validateFields((err, values) => {
         if (!err) {
           console.log(values.formData, ' formData.type222222222')
+          if (values.formData.permission) {
+            values.formData.permission = values.formData.permission.replace(/\//g, '_')
+          }
           saveYyMenu(Object.assign({ id: this.formData.id }, values.formData)).then(res => {
             console.log(res, 'res--save')
             if (res.status + '' === '200') {

+ 3 - 1
src/views/bnSetting/menu/childModal.vue

@@ -79,8 +79,9 @@
         </a-form-item>
         <!-- 后台权限编码 -->
         <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-input
+          <a-textarea
             placeholder="请输入后台权限编码"
+            :auto-size="{ minRows: 2, maxRows: 6 }"
             v-decorator="[
               'formData.permission',
               {initialValue: formData.permission},
@@ -257,6 +258,7 @@ export default {
       this.form.validateFields((err, values) => {
         if (!err) {
           console.log(values.formData, ' formData.type222222222')
+          values.formData.permission = values.formData.permission.replace(/\//g, '_')
           const saveRequest = this.parentType == 'store' ? saveMdMenu : saveYyMenu
           saveRequest(Object.assign(this.formData, values.formData)).then(res => {
             console.log(res, 'res--save')

+ 4 - 0
src/views/common/rangeDate.vue

@@ -48,6 +48,9 @@ export default {
     dateChange (date, dateStrings) {
       this.selectPriceDate = ''
       this.date = date
+      if (dateStrings[0] == '' && dateStrings[1] == '') {
+        dateStrings = []
+      }
       this.$emit('change', dateStrings)
     },
     dateCalendarChange (date, dateStrings) {
@@ -55,6 +58,7 @@ export default {
     },
     resetDate (val) {
       this.date = val || []
+      this.$emit('change', this.date)
     }
   }
 }

+ 31 - 31
src/views/dealerManagement/dealerAccountManagement/editModal.vue

@@ -18,60 +18,60 @@
           :rules="rules"
           :label-col="formItemLayout.labelCol"
           :wrapper-col="formItemLayout.wrapperCol"
-          >
+        >
           <a-form-model-item label="经销商名称" prop="tenantSn">
             <custList ref="custList" v-if="itemId==''" id="dealerAccountEdit-tenantSn" @change="custChange"></custList>
             <span v-else>{{ detailData ? (detailData.org ? detailData.org.name : '--') : '--' }}</span>
           </a-form-model-item>
           <a-form-model-item label="管理员姓名" prop="name">
             <a-input
-            id="dealerAccountEdit-name"
-            :maxLength="30"
-            v-model.trim="form.name"
-            placeholder="请输入管理员姓名(最多30个字符)"
-            allowClear />
+              id="dealerAccountEdit-name"
+              :maxLength="30"
+              v-model.trim="form.name"
+              placeholder="请输入管理员姓名(最多30个字符)"
+              allowClear />
           </a-form-model-item>
           <a-form-model-item label="管理员手机" prop="phone">
             <a-input
-            id="dealerAccountEdit-phone"
-            :maxLength="11"
-            v-model.trim="form.phone"
-            placeholder="请输入管理员手机(最多11个字符)"
-            allowClear />
+              id="dealerAccountEdit-phone"
+              :maxLength="11"
+              v-model.trim="form.phone"
+              placeholder="请输入管理员手机(最多11个字符)"
+              allowClear />
           </a-form-model-item>
           <a-form-model-item label="管理员账号" prop="loginName">
             <a-input
-            id="dealerAccountEdit-loginName"
-            :maxLength="50"
-            v-model.trim="form.loginName"
-            placeholder="请输入管理员账号,字母/数字(最多50个字符)"
-            allowClear />
+              id="dealerAccountEdit-loginName"
+              :maxLength="50"
+              v-model.trim="form.loginName"
+              placeholder="请输入管理员账号,字母/数字(最多50个字符)"
+              allowClear />
           </a-form-model-item>
           <a-form-model-item label="管理员密码" :prop="itemId=='' ? 'password' : ''" :extra="itemId ? '说明:已录入的密码不会显示,录入新密码将会覆盖原有密码' : ''" >
             <a-input
-            id="dealerAccountEdit-password"
-            :maxLength="50"
-            type="password"
-            v-model.trim="form.password"
-            placeholder="请输入管理员密码,字母/数字(最多50个字符)"
-            allowClear />
+              id="dealerAccountEdit-password"
+              :maxLength="50"
+              type="password"
+              v-model.trim="form.password"
+              placeholder="请输入管理员密码,字母/数字(最多50个字符)"
+              allowClear />
           </a-form-model-item>
           <a-form-model-item label="最大可开通用户数" prop="org.childUserMaxNum" extra="(含管理员账号)">
             <a-input-number
-            id="dealerAccountEdit-childUserMaxNum"
-            v-model="form.org.childUserMaxNum"
-            :precision="0"
-            :min="1"
-            :max="999999"
-            placeholder="请输入数量"
-            style="width: 100%;" />
+              id="dealerAccountEdit-childUserMaxNum"
+              v-model="form.org.childUserMaxNum"
+              :precision="0"
+              :min="1"
+              :max="999999"
+              placeholder="请输入数量"
+              style="width: 100%;" />
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
           <a-button type="primary" id="dealerAccountEdit-save" @click="handleSave">保存</a-button>
           <a-button id="dealerAccountEdit-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
         </div>
-		  </a-spin>
+      </a-spin>
     </div>
   </a-modal>
 </template>
@@ -142,7 +142,7 @@ export default {
               _this.$emit('ok')
               _this.isShow = false
               _this.spinning = false
-            }else{
+            } else {
               _this.spinning = false
             }
           })

+ 87 - 62
src/views/dealerManagement/dealerAccountManagement/list.vue

@@ -1,67 +1,84 @@
 <template>
   <a-card size="small" :bordered="false" class="dealerAccountList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="经销商名称">
-              <a-input id="dealerAccountList-name" v-model.trim="queryParam.org.name" allowClear placeholder="请输入经销商名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="管理员账号">
-              <a-input id="dealerAccountList-loginName" v-model.trim="queryParam.loginName" allowClear placeholder="请输入管理员账号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="账号状态">
-              <v-select code="ENABLE_FLAG" id="dealerAccountList-loginFlag" v-model="queryParam.loginFlag" allowClear placeholder="请选择账号状态"></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerAccountList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="dealerAccountList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1310, y: tableHeight }"
-      bordered>
-      <!-- 账号状态 -->
-      <template slot="loginFlag" slot-scope="text, record">
-        <a-switch
-          id="dealerAccountList-enable"
-          checkedChildren="启用"
-          unCheckedChildren="禁用"
-          @change="changeStatus(record)"
-          :checked="record.loginFlag == 1 ? true : false" />
-        <!-- <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span> -->
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="dealerAccountList-edit-btn">编辑</a-button>
-        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="dealerAccountList-detail-btn">详情</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-warning"
-          @click="handleReset(record)"
-          id="dealerAccountList-reset-btn">重置密码</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="经销商名称">
+                <a-input id="dealerAccountList-name" v-model.trim="queryParam.org.name" allowClear placeholder="请输入经销商名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="管理员账号">
+                <a-input id="dealerAccountList-loginName" v-model.trim="queryParam.loginName" allowClear placeholder="请输入管理员账号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="账号状态">
+                <v-select code="ENABLE_FLAG" id="dealerAccountList-loginFlag" v-model="queryParam.loginFlag" allowClear placeholder="请选择账号状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerAccountList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="dealerAccountList-add" type="primary" v-if="$hasPermissions('B_dealerAccount_add')" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1310, y: tableHeight }"
+        bordered>
+        <!-- 账号状态 -->
+        <template slot="loginFlag" slot-scope="text, record">
+          <a-switch
+            id="dealerAccountList-enable"
+            v-if="$hasPermissions('B_dealerAccount_enable')"
+            checkedChildren="启用"
+            unCheckedChildren="禁用"
+            @change="changeStatus(record)"
+            :checked="record.loginFlag == 1 ? true : false" />
+          <span v-else :style="{color:(record.loginFlag==1?'#00aa00':'#999')}"> {{ record.loginFlag==1? '已启用': '已禁用' }} </span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_dealerAccount_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="dealerAccountList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_dealerAccount_detail')"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="dealerAccountList-detail-btn">详情</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_dealerAccount_reset')"
+            class="button-warning"
+            @click="handleReset(record)"
+            id="dealerAccountList-reset-btn">重置密码</a-button>
+          <span v-if="!$hasPermissions('B_dealerAccount_edit') && !$hasPermissions('B_dealerAccount_detail') && !$hasPermissions('B_dealerAccount_reset')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑 -->
     <dealer-account-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
     <!-- 查看 -->
@@ -78,6 +95,7 @@ export default {
   components: { STable, VSelect, dealerAccountEditModal, dealerAccountDetailModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
         org: {
@@ -159,10 +177,14 @@ export default {
         content: '重置密码后,新的密码会以短信形式发送到【管理员手机】,确定要重置吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           dealerUserResetP({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -174,12 +196,15 @@ export default {
         id: record.id,
         flag: record.loginFlag == 1 ? '0' : '1'
       }
+      this.spinning = true
       dealerUserEnable(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.table.refresh()
+          this.spinning = false
         } else {
           this.$refs.table.refresh()
+          this.spinning = false
         }
       })
     }

+ 8 - 0
src/views/dealerManagement/dealerRelationshipBinding/list.vue

@@ -44,22 +44,26 @@
           <template slot="action" slot-scope="text, record">
             <a-button
               type="link"
+              v-if="$hasPermissions('B_dealerRelationshipBinding_unrelation')"
               class="button-error"
               size="small"
               icon="close"
               :id="'relationshipBindingList-delSubItem'+record.id"
               @click.stop="handleDisassociate(record)">取消关联</a-button>
+            <span v-else>--</span>
           </template>
         </a-table>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
             type="link"
+            v-if="$hasPermissions('B_dealerRelationshipBinding_relation')"
             class="button-info"
             size="small"
             icon="plus"
             :id="'relationshipBindingList-addSubItem'+record.id"
             @click.stop="handleAssociate(record)">关联下级</a-button>
+          <span v-else>--</span>
         </template>
       </a-table>
     </a-spin>
@@ -215,10 +219,14 @@ export default {
         content: '确认要解除上下级的关系吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           unbindRelation({ subDealerSn: row.dealerSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.addItemOk()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 1 - 1
src/views/dealerManagement/marketingDivisionSet/editModal.vue

@@ -309,7 +309,7 @@ export default {
 <style lang="less">
   .marketingDivisionSetEdit-modal{
     .ant-modal-body {
-    	padding: 40px 40px 24px;
+      padding: 40px 40px 24px;
     }
     .btn-cont {
       text-align: center;

+ 51 - 31
src/views/dealerManagement/marketingDivisionSet/list.vue

@@ -1,36 +1,51 @@
 <template>
   <a-card size="small" :bordered="false" class="marketingDivisionSetList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="marketingDivisionSetList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :showPagination="false"
-      :data="loadData"
-      bordered>
-      <!-- 市区 -->
-      <template slot="cityArea" slot-scope="text, record">
-        <div style="display: inline-block;margin-right: 15px;" v-for="item in record.subareaAreaList" :key="item.id">
-          {{ item.areaName }}
-          <span v-if="item.citySubareaAreaList">(</span>
-          <span style="color: #999;margin:0 3px;" v-for="area in item.citySubareaAreaList" :key="area.id">
-            {{ area.areaName }}
-          </span>
-          <span v-if="item.citySubareaAreaList">)</span>
-        </div>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="marketingDivisionSetList-edit-btn">编辑</a-button>
-        <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="marketingDivisionSetList-del-btn">删除</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="marketingDivisionSetList-add" type="primary" v-if="$hasPermissions('B_marketingDivisionSet_add')" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :showPagination="false"
+        :data="loadData"
+        bordered>
+        <!-- 市区 -->
+        <template slot="cityArea" slot-scope="text, record">
+          <div style="display: inline-block;margin-right: 15px;" v-for="item in record.subareaAreaList" :key="item.id">
+            {{ item.areaName }}
+            <span v-if="item.citySubareaAreaList">(</span>
+            <span style="color: #999;margin:0 3px;" v-for="area in item.citySubareaAreaList" :key="area.id">
+              {{ area.areaName }}
+            </span>
+            <span v-if="item.citySubareaAreaList">)</span>
+          </div>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_marketingDivisionSet_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="marketingDivisionSetList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_marketingDivisionSet_del')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="marketingDivisionSetList-del-btn">删除</a-button>
+          <span v-if="!$hasPermissions('B_marketingDivisionSet_edit') && !$hasPermissions('B_marketingDivisionSet_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 编辑分区 -->
     <marketing-division-set-edit-modal :nowData="nowData" :openModal="openModal" :itemId="itemId" @ok="$refs.table.refresh()" @close="closeModal" />
   </a-card>
@@ -44,6 +59,7 @@ export default {
   components: { STable, VSelect, marketingDivisionSetEditModal },
   data () {
     return {
+      spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -82,10 +98,14 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           subareaDeleteBySn({ sn: row.subareaSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 82 - 76
src/views/dealerManagement/merchantInfoManagement/detailModal.vue

@@ -8,83 +8,85 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="960">
-    <div v-if="form">
-      <a-collapse :activeKey="['1','2','3']" class="merchantInfoManagement-cont-m">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="2" bordered size="small">
-            <a-descriptions-item label="经销商名称">{{ form.dealerName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="经销商别名">{{ form.dealerAlias || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="商户类型">{{ form.dealerTypeDictValue || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系人1">{{ form.contact || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系手机1">{{ form.contactMobile || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系角色1">{{ form.contactRole || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系电话">{{ form.dealerTelephone || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="地址">
-              <span v-if="form.provinceName || form.cityName || form.districtName || form.address">{{ form.provinceName }}{{ form.cityName }}{{ form.districtName }}{{ form.address }}</span>
-              <span v-else>--</span>
-            </a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-      <a-collapse class="merchantInfoManagement-cont-m">
-        <a-collapse-panel key="2" header="公司信息">
-          <a-descriptions :column="2" bordered size="small">
-            <a-descriptions-item label="经营方式">{{ form.busniessMode || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="经营项目">{{ form.busniessItmes || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="公司规模">{{ form.busniessScope || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="成立时间">{{ form.buildDate || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="一般纳税人">
-              <span v-if="form.isTaxpayer">{{ form.isTaxpayer == 1 ? '是':'否' }}</span>
-              <span v-else>--</span>
-            </a-descriptions-item>
-            <a-descriptions-item label="身份证号码">{{ form.indentityCard || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="生日">{{ form.brithday || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="籍贯">{{ form.nativePlace || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="邮箱">{{ form.mail || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系人2">{{ form.contact2 || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系角色2">{{ form.contractRole2 || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系手机2">{{ form.contactMobile2 || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="邮政编码">{{ form.zipCode || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货人">{{ form.receiveContact || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货人电话">{{ form.receiveMobile || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货地址">
-              <span v-if="form.receiveProvinceName || form.receiveCityName || form.receiveDistrictName || form.receiveAddress">{{ form.receiveProvinceName }}{{ form.receiveCityName }}{{ form.receiveDistrictName }}{{ form.receiveAddress }}</span>
-              <span v-else>--</span>
-            </a-descriptions-item>
-            <a-descriptions-item label="银行账户">{{ form.tradeAccountName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="开户行">{{ form.tradeBankName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="银行账号">{{ form.tradeBankAccount || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-      <a-collapse class="merchantInfoManagement-cont-m">
-        <a-collapse-panel key="3" header="总部信息">
-          <a-descriptions :column="2" bordered size="small">
-            <a-descriptions-item label="箭冠汽配代码">{{ form.jgAutoPartsCode || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="门头更换日期">{{ form.jgDoorHeaderChangeTime || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="特约价是否可见">
-              <span v-if="form.isShowSpecialPrice">{{ form.isShowSpecialPrice == 1 ? '是':'否' }}</span>
-              <span v-else>--</span>
-            </a-descriptions-item>
-            <a-descriptions-item label="备注">{{ form.remark || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-      <div class="btn-cont">
-        <a-button
-          id="merchantInfoManagement-audit"
-          size="large"
-          v-if="isAudit"
-          type="primary"
-          class="button-primary"
-          style="margin-right: 50px;"
-          @click="visibleAudit=true">审核</a-button>
-        <a-button id="merchantInfoManagement-back" size="large" @click="isShow = false" style="font-size: 12px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div v-if="form">
+        <a-collapse :activeKey="['1','2','3']" class="merchantInfoManagement-cont-m">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="2" bordered size="small">
+              <a-descriptions-item label="经销商名称">{{ form.dealerName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="经销商别名">{{ form.dealerAlias || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="商户类型">{{ form.dealerTypeDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系人1">{{ form.contact || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系手机1">{{ form.contactMobile || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系角色1">{{ form.contactRole || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系电话">{{ form.dealerTelephone || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="地址">
+                <span v-if="form.provinceName || form.cityName || form.districtName || form.address">{{ form.provinceName }}{{ form.cityName }}{{ form.districtName }}{{ form.address }}</span>
+                <span v-else>--</span>
+              </a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+        <a-collapse class="merchantInfoManagement-cont-m">
+          <a-collapse-panel key="2" header="公司信息">
+            <a-descriptions :column="2" bordered size="small">
+              <a-descriptions-item label="经营方式">{{ form.busniessMode || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="经营项目">{{ form.busniessItmes || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="公司规模">{{ form.busniessScope || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="成立时间">{{ form.buildDate || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="一般纳税人">
+                <span v-if="form.isTaxpayer">{{ form.isTaxpayer == 1 ? '是':'否' }}</span>
+                <span v-else>--</span>
+              </a-descriptions-item>
+              <a-descriptions-item label="身份证号码">{{ form.indentityCard || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="生日">{{ form.brithday || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="籍贯">{{ form.nativePlace || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="邮箱">{{ form.mail || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系人2">{{ form.contact2 || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系角色2">{{ form.contractRole2 || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系手机2">{{ form.contactMobile2 || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="邮政编码">{{ form.zipCode || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货人">{{ form.receiveContact || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货人电话">{{ form.receiveMobile || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货地址">
+                <span v-if="form.receiveProvinceName || form.receiveCityName || form.receiveDistrictName || form.receiveAddress">{{ form.receiveProvinceName }}{{ form.receiveCityName }}{{ form.receiveDistrictName }}{{ form.receiveAddress }}</span>
+                <span v-else>--</span>
+              </a-descriptions-item>
+              <a-descriptions-item label="银行账户">{{ form.tradeAccountName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="开户行">{{ form.tradeBankName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="银行账号">{{ form.tradeBankAccount || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+        <a-collapse class="merchantInfoManagement-cont-m">
+          <a-collapse-panel key="3" header="总部信息">
+            <a-descriptions :column="2" bordered size="small">
+              <a-descriptions-item label="箭冠汽配代码">{{ form.jgAutoPartsCode || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="门头更换日期">{{ form.jgDoorHeaderChangeTime || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="特约价是否可见">
+                <span v-if="form.isShowSpecialPrice">{{ form.isShowSpecialPrice == 1 ? '是':'否' }}</span>
+                <span v-else>--</span>
+              </a-descriptions-item>
+              <a-descriptions-item label="备注">{{ form.remark || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+        <div class="btn-cont">
+          <a-button
+            id="merchantInfoManagement-audit"
+            size="large"
+            v-if="isAudit"
+            type="primary"
+            class="button-primary"
+            style="margin-right: 50px;"
+            @click="visibleAudit=true">审核</a-button>
+          <a-button id="merchantInfoManagement-back" size="large" @click="isShow = false" style="font-size: 12px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
-    <div style="padding: 50px;text-align: center;" v-else>
-      <a-spin />
-    </div>
+      <div style="padding: 50px;text-align: center;" v-else>
+        <a-spin />
+      </div>
+    </a-spin>
     <!-- 审核 -->
     <auditModal :openModal="visibleAudit" @close="visibleAudit=false" @ok="auditOrder('PASS')" @fail="auditOrder('REJECT')" />
   </a-modal>
@@ -109,6 +111,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       form: null,
       title: '',
@@ -118,6 +121,7 @@ export default {
   methods: {
     // 审核
     auditOrder (auditState) {
+      this.spinning = true
       dealerAudit({
         dealerAuditSn: this.form.dealerAuditSn,
         auditState: auditState
@@ -126,8 +130,10 @@ export default {
           this.visibleAudit = false
           this.$message.success(res.message)
           this.$emit('ok')
+          this.spinning = false
         } else {
           this.visibleAudit = false
+          this.spinning = false
         }
       })
     },

+ 6 - 6
src/views/dealerManagement/merchantInfoManagement/edit.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="merchantInfoManagementEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="merchantInfoManagementEdit-cont">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="merchantInfoManagement-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
     <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="merchantInfoManagementEdit-cont">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="merchantInfoManagement-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
       <a-form-model
         id="merchantInfoManagementEdit-form"
         ref="ruleForm"

+ 92 - 84
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -1,93 +1,98 @@
 <template>
   <a-card size="small" :bordered="false" class="merchantInfoManagementList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="区域">
-              <subarea id="merchantInfoManagementList-subarea" v-model="queryParam.subareaSn"></subarea>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="商户名称/别名">
-              <a-input id="merchantInfoManagementList-nameLike" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入商户名称/别名"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="商户类型">
-              <v-select code="DEALER_TYPE" id="merchantInfoManagementList-dealerType" v-model="queryParam.dealerType" allowClear placeholder="请选择商户类型"></v-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="审核状态">
-                <v-select code="AUDIT_STATE" id="merchantInfoManagementList-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
+              <a-form-item label="区域">
+                <subarea id="merchantInfoManagementList-subarea" v-model="queryParam.subareaSn"></subarea>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="合作状态">
-                <v-select code="DEALER_COOPERATE_FLAG" id="merchantInfoManagementList-cooperateFlag" v-model="queryParam.cooperateFlag" allowClear placeholder="请选择合作状态"></v-select>
+              <a-form-item label="商户名称/别名">
+                <a-input id="merchantInfoManagementList-nameLike" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入商户名称/别名"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="merchantInfoManagementList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 5px" @click="resetSearchForm" :disabled="disabled" id="merchantInfoManagementList-reset">重置</a-button>
-            <a-button
-              style="margin-left: 5px"
-              type="primary"
-              class="button-warning"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              id="merchantInfoManagementList-export">导出</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="merchantInfoManagementList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
-    </div>
-    <!-- 总计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计:<strong>{{ total }}</strong>条</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2240, y: tableHeight }"
-      bordered>
-      <!-- 经销商 -->
-      <template slot="dealerName" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.dealerName }}</span>
-      </template>
-      <!-- 区域 -->
-      <template slot="area" slot-scope="text, record">
-        <div v-if="record.subareaNameSet&&record.subareaNameSet.length!=0">
-          <span v-for="(item, index) in record.subareaNameSet" :key="index">{{ item }}{{ index+1 == record.subareaNameSet.length ? '' : ',' }}</span>
-        </div>
-        <span v-else>--</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-warning" v-if="record.auditState == 'WAIT'" @click="handleAudit(record)" >审核</a-button>
-        <a-button size="small" type="link" class="button-success" @click="handleCooperation(record)" >合作设置</a-button>
-        <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'WAIT'" @click="handleDistribution(record)">经销权</a-button>
-        <a-button size="small" type="link" class="button-primary" @click="handleLevel(record)">级别设置</a-button>
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)">编辑</a-button>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="商户类型">
+                <v-select code="DEALER_TYPE" id="merchantInfoManagementList-dealerType" v-model="queryParam.dealerType" allowClear placeholder="请选择商户类型"></v-select>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="审核状态">
+                  <v-select code="AUDIT_STATE" id="merchantInfoManagementList-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="合作状态">
+                  <v-select code="DEALER_COOPERATE_FLAG" id="merchantInfoManagementList-cooperateFlag" v-model="queryParam.cooperateFlag" allowClear placeholder="请选择合作状态"></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="merchantInfoManagementList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 5px" @click="resetSearchForm" :disabled="disabled" id="merchantInfoManagementList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                v-if="$hasPermissions('B_merchantInfo_export')"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="merchantInfoManagementList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="merchantInfoManagementList-add" type="primary" v-if="$hasPermissions('B_merchantInfo_add')" class="button-error" @click="handleAdd">新增</a-button>
+      </div>
+      <!-- 总计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">合计:<strong>{{ total }}</strong>条</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2240, y: tableHeight }"
+        bordered>
+        <!-- 经销商 -->
+        <template slot="dealerName" slot-scope="text, record">
+          <span v-if="$hasPermissions('B_merchantInfo_detail')" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.dealerName }}</span>
+          <span v-else>{{ record.dealerName }}</span>
+        </template>
+        <!-- 区域 -->
+        <template slot="area" slot-scope="text, record">
+          <div v-if="record.subareaNameSet&&record.subareaNameSet.length!=0">
+            <span v-for="(item, index) in record.subareaNameSet" :key="index">{{ item }}{{ index+1 == record.subareaNameSet.length ? '' : ',' }}</span>
+          </div>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-warning" v-if="record.auditState == 'WAIT' && $hasPermissions('B_merchantInfo_audit')" @click="handleAudit(record)" >审核</a-button>
+          <a-button size="small" type="link" class="button-success" v-if="$hasPermissions('B_merchantInfo_cooperation')" @click="handleCooperation(record)" >合作设置</a-button>
+          <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'WAIT' && $hasPermissions('B_merchantInfo_distribution')" @click="handleDistribution(record)">经销权</a-button>
+          <a-button size="small" type="link" class="button-primary" v-if="$hasPermissions('B_merchantInfo_level')" @click="handleLevel(record)">级别设置</a-button>
+          <a-button size="small" type="link" class="button-info" v-if="$hasPermissions('B_merchantInfo_edit')" @click="handleEdit(record)">编辑</a-button>
+          <span v-if="!(record.auditState == 'WAIT' && $hasPermissions('B_merchantInfo_audit')) && !$hasPermissions('B_merchantInfo_cooperation') && !(record.auditState != 'WAIT' && $hasPermissions('B_merchantInfo_distribution')) && !$hasPermissions('B_merchantInfo_level') && !$hasPermissions('B_merchantInfo_edit')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 产品详情 -->
     <merchant-info-management-detail-modal :openModal="openModal" :isAudit="isAudit" :itemId="itemId" @ok="resetForm" @close="closeModal" />
     <!-- 合作设置 -->
@@ -109,6 +114,7 @@ export default {
   components: { STable, VSelect, merchantInfoManagementDetailModal, subarea, UpdateCooperate, UpdateDealerLeve },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -193,13 +199,13 @@ export default {
     },
     // 合作设置
     handleCooperation (row) {
-      this.openUcModal = true
       this.$refs.updateCooperate.setData(row)
+      this.openUcModal = true
     },
     // 价格级别
     handleLevel (row) {
-      this.openUdModal = true
       this.$refs.updateDealerLevel.setData(row)
+      this.openUdModal = true
     },
     // 经销权
     handleDistribution (row) {
@@ -227,8 +233,10 @@ export default {
       const _this = this
       const params = this.queryParam
       this.exportLoading = true
+      _this.spinning = true
       dealerExport(params).then(res => {
         this.exportLoading = false
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 73 - 62
src/views/dealerManagement/merchantInfoManagement/permissionSetting.vue

@@ -1,68 +1,70 @@
 <template>
   <div class="permissionSetting-wrap">
-    <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="permissionSetting-cont">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="permissionSetting-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="permissionSetting-main">
-      <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
-        <a-form-model
-          id="permissionSetting-form"
-          ref="ruleForm"
-          :model="queryParam"
-          :rules="rules"
-          layout="inline"
-          @keyup.enter.native="handleSearch">
-          <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="类型" prop="goodsType">
-                <v-select code="DEALER_GOODS_TYPE" id="permissionSetting-goodsType" v-model="queryParam.goodsType" allowClear placeholder="请选择类型"></v-select>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="类型名称" prop="goodsName">
-                <a-input id="permissionSetting-goodsName" v-model.trim="queryParam.goodsName" allowClear placeholder="请输入类型名称"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品编码" prop="goodsCode">
-                <a-input id="permissionSetting-goodsCode" v-model.trim="queryParam.goodsCode" allowClear placeholder="请输入产品编码"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="handleSearch" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
-            </a-col>
-          </a-row>
-        </a-form-model>
-      </div>
-      <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-button id="permissionSetting-brand" type="primary" class="button-error" @click="choosePModal('BRAND')">选择产品品牌</a-button>
-        <a-button id="permissionSetting-type" type="primary" class="button-info" @click="choosePModal('CATEGORY')">选择产品分类</a-button>
-        <a-button id="permissionSetting-product" type="primary" class="button-success" @click="choosePModal('PRODUCT')">选择产品</a-button>
-      </div>
-      <!-- 列表 -->
-      <a-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data-source="loadData"
-        :pagination="paginationProps"
-        :loading="loading"
-        :scroll="{ x: 1200, y: tableHeight }"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="permissionSetting-cont">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="permissionSetting-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
-      </a-table>
-    </a-card>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="permissionSetting-main">
+        <!-- 搜索条件 -->
+        <div class="table-page-search-wrapper">
+          <a-form-model
+            id="permissionSetting-form"
+            ref="ruleForm"
+            :model="queryParam"
+            :rules="rules"
+            layout="inline"
+            @keyup.enter.native="handleSearch">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="类型" prop="goodsType">
+                  <v-select code="DEALER_GOODS_TYPE" id="permissionSetting-goodsType" v-model="queryParam.goodsType" allowClear placeholder="请选择类型"></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="类型名称" prop="goodsName">
+                  <a-input id="permissionSetting-goodsName" v-model.trim="queryParam.goodsName" allowClear placeholder="请输入类型名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品编码" prop="goodsCode">
+                  <a-input id="permissionSetting-goodsCode" v-model.trim="queryParam.goodsCode" allowClear placeholder="请输入产品编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-button style="margin-bottom: 18px;" type="primary" @click="handleSearch" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
+                <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form-model>
+        </div>
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button id="permissionSetting-brand" type="primary" class="button-error" @click="choosePModal('BRAND')">选择产品品牌</a-button>
+          <a-button id="permissionSetting-type" type="primary" class="button-info" @click="choosePModal('CATEGORY')">选择产品分类</a-button>
+          <a-button id="permissionSetting-product" type="primary" class="button-success" @click="choosePModal('PRODUCT')">选择产品</a-button>
+        </div>
+        <!-- 列表 -->
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data-source="loadData"
+          :pagination="paginationProps"
+          :loading="loading"
+          :scroll="{ x: 1200, y: tableHeight }"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
+          </template>
+        </a-table>
+      </a-card>
+    </a-spin>
     <!-- 选择产品品牌 -->
     <chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
     <!-- 选择产品分类 -->
@@ -88,6 +90,7 @@ export default {
   components: { STable, VSelect, ChooseProductsModal, ChooseBrandModal, ChooseTypeModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -266,10 +269,14 @@ export default {
         goodsType: type,
         goodsSnList: snList
       }
+      _this.spinning = true
       dealerScopeSave(params).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.getProductList(1)
+          _this.spinning = false
+        } else {
+          _this.spinning = false
         }
       })
     },
@@ -281,10 +288,14 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           dealerScopeDel({ sn: row.dealerScopeSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.getProductList()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 0 - 1
src/views/dealerManagement/merchantInfoManagement/updateDealerLevel.vue

@@ -71,7 +71,6 @@ export default {
       this.form.dealerName = row.dealerName
       this.form.dealerLevel = row.dealerLevel
       this.dealerLevelBak = row.dealerLevel
-      console.log(row, this.dealerLevelBak)
     },
     onSubmit () {
       const _this = this

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

@@ -28,7 +28,14 @@
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="rebateSettingsList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="$hasPermissions('B_rebateSettings_edit')"
+          class="button-info"
+          @click="handleEdit(record)"
+          id="rebateSettingsList-edit-btn">编辑</a-button>
+        <span v-else>--</span>
       </template>
       <!-- 经销商名称 -->
       <template slot="jxs" slot-scope="text, record">

+ 1 - 1
src/views/dealerManagement/rebateSettings/queryChild.vue

@@ -45,7 +45,7 @@ export default {
       const fetchId = this.lastFetchId
       this.data = []
       this.fetching = true
-      dealerRelationList({ 'dealerName': dealerName, 'dealerLevelList': this.dealerLevelList, pageNo: 1, pageSize: 1000 }).then(res => {
+      dealerRelationList({ 'dealerName': dealerName, 'dealerLevelList': this.dealerLevelList, pageNo: 1, pageSize: 20 }).then(res => {
         if (fetchId !== this.lastFetchId) {
           return
         }

+ 147 - 127
src/views/financialManagement/financialCollection/list.vue

@@ -1,143 +1,149 @@
 <template>
   <a-card size="small" :bordered="false" class="financialCollectionList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="审核时间">
-              <rangeDate ref="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="经销商名称">
-              <a-input id="financialCollectionList-buyerName" v-model.trim="queryParam.buyerName" allowClear placeholder="请输入经销商名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="商户级别">
-              <v-select
-                v-model="queryParam.dealerLevel"
-                ref="dealerLevel"
-                id="financialCollectionList-dealerLevel"
-                code="DEALER_LEVEL"
-                placeholder="请选择商户级别"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="收款方式">
-                <v-select
-                  v-model="queryParam.settleStyleSn"
-                  ref="settleStyleSn"
-                  id="financialCollectionList-settleStyleSn"
-                  code="SETTLE_STYLE"
-                  placeholder="请选择收款方式"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="区域">
-                <subarea id="financialCollectionList-subarea" v-model="queryParam.subareaSn"></subarea>
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
-                <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="financialCollectionList-billStatus"
-                  code="SALES_RECEIVE_LIST_STATUS"
-                  placeholder="请选择业务状态"
-                  allowClear></v-select>
+              <a-form-item label="经销商名称">
+                <a-input id="financialCollectionList-buyerName" v-model.trim="queryParam.buyerName" allowClear placeholder="请输入经销商名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="财务状态">
+              <a-form-item label="商户级别">
                 <v-select
-                  v-model="queryParam.financialStatus"
-                  ref="financialStatus"
-                  id="financialCollectionList-financialStatus"
-                  code="FINANCIAL_RECEIVE_STATUS"
-                  placeholder="请选择财务状态"
+                  v-model="queryParam.dealerLevel"
+                  ref="dealerLevel"
+                  id="financialCollectionList-dealerLevel"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择商户级别"
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="收款时间">
-                <rangeDate ref="rangeSettleDate" @change="dateSettleChange" />
-              </a-form-item>
-            </a-col>
-            <a-col :md="12" :sm="24">
-              <a-row>
-                <a-form-item label="经销商地区">
-                  <a-col span="7">
-                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerProvinceSn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCitySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCitySn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCountySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCountySn" 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-item>
-                  </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="收款方式">
+                  <v-select
+                    v-model="queryParam.settleStyleSn"
+                    ref="settleStyleSn"
+                    id="financialCollectionList-settleStyleSn"
+                    code="SETTLE_STYLE"
+                    placeholder="请选择收款方式"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="区域">
+                  <subarea id="financialCollectionList-subarea" v-model="queryParam.subareaSn"></subarea>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="financialCollectionList-billStatus"
+                    code="SALES_RECEIVE_LIST_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
                 </a-form-item>
-              </a-row>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.financialStatus"
+                    ref="financialStatus"
+                    id="financialCollectionList-financialStatus"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="收款时间">
+                  <rangeDate ref="rangeSettleDate" @change="dateSettleChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-item label="经销商地区">
+                    <a-col span="7">
+                      <a-form-item prop="dealerProvinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerProvinceSn" @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-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-item prop="dealerCitySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCitySn" @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-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-item prop="dealerCountySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCountySn" 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-item>
+                    </a-col>
+                  </a-form-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 总计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计:<strong>{{ total }}</strong>条</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1820, y: tableHeight }"
-      bordered>
-      <!-- 单号 -->
-      <template slot="salesBillNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.financialStatus=='WAIT'"
-          class="button-warning"
-          @click="handleAudit(record)"
-          id="financialCollectionList-audit-btn">收款</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 总计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">合计:<strong>{{ total }}</strong>条</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1820, y: tableHeight }"
+        bordered>
+        <!-- 单号 -->
+        <template slot="salesBillNo" slot-scope="text, record">
+          <span :class="$hasPermissions('B_salesDetail')?'active':'common'" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+        </template>
+        <!-- 财务状态 -->
+        <template slot="financialStatus" slot-scope="text, record">
+          <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.financialStatusDictValue" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.financialStatus=='WAIT' && $hasPermissions('B_financialCollection_receipt')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="financialCollectionList-audit-btn">收款</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -153,6 +159,7 @@ export default {
   components: { STable, VSelect, subarea, rangeDate },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         beginAuditDate: getDate.getThreeMonthDays().starttime,
         endAuditDate: getDate.getCurrMonthDays().endtime,
@@ -187,7 +194,7 @@ export default {
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remarks', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'financialStatus', scopedSlots: { customRender: 'financialStatus' }, width: 120, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -247,7 +254,9 @@ export default {
     },
     // 详情
     handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
+      if (this.$hasPermissions('B_salesDetail')) {
+        this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
+      }
     },
     // 收款
     handleAudit (row) {
@@ -257,10 +266,14 @@ export default {
         content: '确认要收款吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           salesReceipt({ sn: row.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -322,5 +335,12 @@ export default {
     .sTable{
       margin-top: 20px;
     }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
   }
 </style>

+ 89 - 74
src/views/financialManagement/returnConfirmation/list.vue

@@ -1,85 +1,87 @@
 <template>
   <a-card size="small" :bordered="false" class="returnConfirmationList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <custList ref="custList" id="returnConfirmationList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销退单号">
-              <a-input id="returnConfirmationList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入销退单号"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="是否抓单">
-                <v-select
-                  v-model="queryParam.grabFlag"
-                  ref="grabFlag"
-                  id="returnConfirmationList-grabFlag"
-                  code="FLAG"
-                  placeholder="请选择"
-                  allowClear></v-select>
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="状态">
-                <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="returnConfirmationList-billStatus"
-                  code="SALES_RETURN_CONFIRM_STATUS"
-                  placeholder="请选择状态"
-                  allowClear></v-select>
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <custList ref="custList" id="returnConfirmationList-buyerSn" @change="custChange"></custList>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="returnConfirmationList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="returnConfirmationList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1460, y: tableHeight }"
-      bordered>
-      <!-- 销退单号 -->
-      <template slot="salesReturnBillNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesReturnBillNo }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.billStatus=='WAIT_FINANCIAL_AUDIT'"
-          class="button-warning"
-          @click="handleAudit(record)"
-          id="returnConfirmationList-audit-btn">退货确认</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="销退单号">
+                <a-input id="returnConfirmationList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入销退单号"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="是否抓单">
+                  <v-select
+                    v-model="queryParam.grabFlag"
+                    ref="grabFlag"
+                    id="returnConfirmationList-grabFlag"
+                    code="FLAG"
+                    placeholder="请选择"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="returnConfirmationList-billStatus"
+                    code="SALES_RETURN_CONFIRM_STATUS"
+                    placeholder="请选择状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="returnConfirmationList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="returnConfirmationList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1460, y: tableHeight }"
+        bordered>
+        <!-- 销退单号 -->
+        <template slot="salesReturnBillNo" slot-scope="text, record">
+          <span :class="$hasPermissions('B_returnConfirmation_detail')?'active':'common'" @click="handleDetail(record)">{{ record.salesReturnBillNo }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.billStatus=='WAIT_FINANCIAL_AUDIT' && $hasPermissions('B_returnConfirmation_return')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="returnConfirmationList-audit-btn">退货确认</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 查看 -->
     <confirmation-detail-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" />
   </a-card>
@@ -95,6 +97,7 @@ export default {
   components: { STable, VSelect, confirmationDetailModal, custList, rangeDate },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
@@ -162,6 +165,7 @@ export default {
     },
     // 详情
     handleDetail (row) {
+      if (!this.$hasPermissions('B_returnConfirmation_detail')) { return }
       this.itemSn = row.salesReturnBillSn
       this.openModal = true
     },
@@ -192,10 +196,14 @@ export default {
     },
     auditOrder (sn, flag) {
       const _this = this
+      _this.spinning = true
       salesReturnFinancial({ salesReturnBillSn: sn, billStatus: flag }).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.$refs.table.refresh()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
         }
       })
     }
@@ -208,5 +216,12 @@ export default {
     .sTable{
       margin-top: 20px;
     }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
   }
 </style>

+ 173 - 113
src/views/financialManagement/warehousingConfirmation/list.vue

@@ -1,67 +1,90 @@
 <template>
   <a-card size="small" :bordered="false" class="warehousingConfirmationList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="入库单号">
-              <a-input id="warehousingConfirmationList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="单据状态">
-              <v-select
-                v-model="queryParam.auditState"
-                ref="auditState"
-                id="warehousingConfirmationList-auditState"
-                code="PUT_CONFIRM_STATE"
-                placeholder="请选择单据状态"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingConfirmationList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <div style="margin-bottom: 15px">
-      <a-button type="primary" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
-      </span>
-    </div>
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="rowSelection"
-      :rowKey="(record) => record.stockPutSn"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1530, y: tableHeight }"
-      bordered>
-      <!-- 入库单号 -->
-      <template slot="stockPutNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.stockPutNo }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.auditState=='WAIT'"
-          class="button-warning"
-          @click="handleAudit(record)"
-          id="warehousingConfirmationList-audit-btn">入库确认</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="入库单号">
+                <a-input id="warehousingConfirmationList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单据状态">
+                <v-select
+                  v-model="queryParam.auditState"
+                  ref="auditState"
+                  id="warehousingConfirmationList-auditState"
+                  code="PUT_CONFIRM_STATE"
+                  placeholder="请选择单据状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingConfirmationList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <div v-if="$hasPermissions('B_warehousingConfirmationpl')" style="margin-bottom: 15px">
+        <a-button type="primary" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
+        <span style="margin-left: 8px">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="rowSelection"
+        :rowKey="(record) => record.stockPutSn"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1530, y: tableHeight }"
+        bordered>
+        <!-- 入库单号 -->
+        <template slot="stockPutNo" slot-scope="text, record">
+          <span :class="$hasPermissions('B_warehousingConfirmationDetail')?'active':'common'" @click="handleDetail(record)">{{ record.stockPutNo }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.auditState=='WAIT' && $hasPermissions('B_warehousingConfirmationAlone')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="warehousingConfirmationList-audit-btn">入库确认</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 查看 -->
     <confirmation-detail-modal :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
+    <!-- 入库确认 -->
+    <a-modal
+      centered
+      class="confirmation-modal"
+      :footer="null"
+      :maskClosable="false"
+      v-model="confirmationModal"
+      @cancle="confirmationModal=false"
+      :width="416">
+      <div class="confirmation-main">
+        <a-icon type="question-circle" style="color: #faad14;font-size: 22px;margin-right: 16px;" />
+        <div class="confirmation-cont">
+          <p class="confirmation-tit">提示</p>
+          <p class="confirmation-txt">请点击下方按钮确认操作?</p>
+        </div>
+      </div>
+      <div class="btn-box">
+        <a-button type="primary" class="button-error" @click="handleConfirmationFail">不通过</a-button>
+        <a-button type="primary" class="button-info" @click="handleConfirmationOk">通过</a-button>
+      </div>
+    </a-modal>
   </a-card>
 </template>
 
@@ -73,6 +96,7 @@ export default {
   components: { STable, VSelect, confirmationDetailModal },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         stockPutNo: '', //  入库单号
         auditState: undefined //  状态
@@ -107,7 +131,10 @@ export default {
       },
       openModal: false,
       itemSn: '',
-      nowData: null
+      nowData: null,
+      confirmationModal: false,
+      confirmationInfo: null,
+      isBatch: false
     }
   },
   computed: {
@@ -115,17 +142,21 @@ export default {
       return this.selectedRowKeys.length > 0
     },
     rowSelection () {
-      return {
-        selectedRowKeys: this.selectedRowKeys,
-        onChange: (selectedRowKeys, selectedRows) => {
-          console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
-          this.onSelectChange(selectedRowKeys)
-        },
-        getCheckboxProps: record => ({
-          props: {
-            disabled: record.auditState != 'WAIT'
-          }
-        })
+      if (this.$hasPermissions('B_warehousingConfirmationpl')) {
+        return {
+			  selectedRowKeys: this.selectedRowKeys,
+			  onChange: (selectedRowKeys, selectedRows) => {
+			    console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+			    this.onSelectChange(selectedRowKeys)
+			  },
+			  getCheckboxProps: record => ({
+			    props: {
+			      disabled: record.auditState != 'WAIT'
+			    }
+			  })
+        }
+      } else {
+        return null
       }
     }
   },
@@ -138,52 +169,61 @@ export default {
     },
     // 详情
     handleDetail (row) {
-      console.log(row)
-      this.itemSn = row.stockPutSn
-      this.nowData = row
-      this.openModal = true
+      if (this.$hasPermissions('B_warehousingConfirmationDetail')) {
+        this.itemSn = row.stockPutSn
+        this.nowData = row
+        this.openModal = true
+      }
     },
     closeModal () {
       this.itemSn = ''
       this.nowData = null
       this.openModal = false
     },
+    // 通过
+    handleConfirmationOk () {
+      if (this.isBatch) { //  批量
+        this.auditOrder(this.selectedRowKeys, true)
+      } else {
+        this.auditOrder([this.confirmationInfo.stockPutSn], true)
+      }
+    },
+    // 不通过
+    handleConfirmationFail () {
+      if (this.isBatch) { //  批量
+        this.auditOrder(this.selectedRowKeys, false)
+      } else {
+        this.auditOrder([this.confirmationInfo.stockPutSn], false)
+      }
+    },
     // 单个审核
     handleAudit (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '请点击下方按钮确认操作',
-        centered: true,
-        okText: '通过',
-        cancelText: '不通过',
-        onOk () {
-          _this.auditOrder([row.stockPutSn], true)
-        },
-        onCancel (e) {
-          if (!e.triggerCancel) {
-            _this.auditOrder([row.stockPutSn], false)
-          }
-          _this.$destroyAll()
-        }
-      })
+      this.confirmationInfo = row
+      this.isBatch = false
+      this.confirmationModal = true
     },
-    auditOrder (snList, flag, isBatch) {
+    auditOrder (snList, flag) {
       const _this = this
-      if (isBatch) {
+      if (this.isBatch) {
         _this.loading = true
       }
+      _this.spinning = true
       stockPutConfirm({ stockPutSnList: snList, confirm: flag }).then(res => {
-        if (isBatch) {
+        if (this.isBatch) {
           _this.loading = false
         }
         if (res.status == 200) {
-          if (isBatch) {
+          if (this.isBatch) {
             _this.selectedRowKeys = []
             _this.selectedRows = []
           }
           _this.$message.success(res.message)
           _this.$refs.table.refresh()
+          _this.confirmationModal = false
+          _this.spinning = false
+        } else {
+          _this.confirmationModal = false
+          _this.spinning = false
         }
       })
     },
@@ -194,22 +234,8 @@ export default {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
-      this.$confirm({
-        title: '提示',
-        content: '请点击下方按钮批量确认操作',
-        centered: true,
-        okText: '通过',
-        cancelText: '不通过',
-        onOk () {
-          _this.auditOrder(_this.selectedRowKeys, true, 'isBatch')
-        },
-        onCancel (e) {
-          if (!e.triggerCancel) {
-            _this.auditOrder(_this.selectedRowKeys, false, 'isBatch')
-          }
-          _this.$destroyAll()
-        }
-      })
+      this.isBatch = true
+      this.confirmationModal = true
     },
     onSelectChange (selectedRowKeys) {
       console.log('selectedRowKeys changed: ', selectedRowKeys)
@@ -224,5 +250,39 @@ export default {
     .sTable{
       margin-top: 20px;
     }
+  }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
+  .confirmation-modal{
+    .ant-modal-body{
+      padding: 32px 32px 24px;
+    }
+    .confirmation-main{
+      display: flex;
+      .confirmation-cont{
+        .confirmation-tit{
+          color: rgba(0, 0, 0, 0.85);
+          font-weight: 500;
+          font-size: 16px;
+          line-height: 1.4;
+          margin: 0;
+        }
+        .confirmation-txt{
+          margin: 8px 0 0;
+          color: rgba(0, 0, 0, 0.65);
+          font-size: 14px;
+          line-height: 1.5;
+        }
+      }
+    }
+    .btn-box{
+      text-align: right;
+      margin-top: 24px;
+    }
   }
 </style>

+ 14 - 6
src/views/inventoryManagement/intelligentReplenishment/edit.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="intelligentReplenishmentEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="intelligentReplenishmentEdit-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="intelligentReplenishmentEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
     <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="intelligentReplenishmentEdit-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="intelligentReplenishmentEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
       <a-card size="small" :bordered="false" class="intelligentReplenishmentEdit-cont">
         <div class="steps-cont">
           <a-steps :current="current" size="small">
@@ -167,17 +167,25 @@ export default {
     },
     // 保存
     handleSave (params) {
+      this.spinning = true
       predictSave(params).then(res => {
         if (res.status == 200) {
           this.current++
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
     // 计算
     handleRun (params) {
+      this.spinning = true
       predictRun(params).then(res => {
         if (res.status == 200) {
           this.current++
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },

+ 51 - 46
src/views/inventoryManagement/intelligentReplenishment/import.vue

@@ -1,52 +1,54 @@
 <template>
   <div class="intelligentReplenishmentImport-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="intelligentReplenishmentImport-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="intelligentReplenishmentImport-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card :bordered="false" class="intelligentReplenishmentImport-cont">
-      <div>
-        <p class="total">共 <span>{{ listData.length }}</span> 条数据,红色字体表示数据不符合规范,请返回上一步修改文件后重新上传</p>
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :data="loadData"
-          :scroll="{ x: 1440 }"
-          :rowClassName="(record, index) => record.cost ? 'redBg-row':''"
-          :showPagination="false"
-          bordered>
-        </s-table>
-        <div class="btn-cont">
-          <a-button
-            type="primary"
-            v-if="errorFlag.indexOf('1')==-1"
-            id="intelligentReplenishmentLevel-submit"
-            size="large"
-            class="button-primary"
-            @click="handleSubmit"
-            style="padding: 0 60px;">确认导入</a-button>
-          <a-button
-            type="primary"
-            v-if="errorFlag.indexOf('1')!=-1"
-            id="intelligentReplenishmentLevel-set"
-            size="large"
-            class="button-primary"
-            @click="handleBackSet"
-            style="padding: 0 60px;">上一步</a-button>
-          <a-button
-            id="intelligentReplenishmentLevel-back"
-            size="large"
-            class="button-cancel"
-            @click="handleBack"
-            style="padding: 0 60px;">取消</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="intelligentReplenishmentImport-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="intelligentReplenishmentImport-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
+      <a-card :bordered="false" class="intelligentReplenishmentImport-cont">
+        <div>
+          <p class="total">共 <span>{{ listData.length }}</span> 条数据,红色字体表示数据不符合规范,请返回上一步修改文件后重新上传</p>
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :scroll="{ x: 1440 }"
+            :rowClassName="(record, index) => record.cost ? 'redBg-row':''"
+            :showPagination="false"
+            bordered>
+          </s-table>
+          <div class="btn-cont">
+            <a-button
+              type="primary"
+              v-if="errorFlag.indexOf('1')==-1"
+              id="intelligentReplenishmentLevel-submit"
+              size="large"
+              class="button-primary"
+              @click="handleSubmit"
+              style="padding: 0 60px;">确认导入</a-button>
+            <a-button
+              type="primary"
+              v-if="errorFlag.indexOf('1')!=-1"
+              id="intelligentReplenishmentLevel-set"
+              size="large"
+              class="button-primary"
+              @click="handleBackSet"
+              style="padding: 0 60px;">上一步</a-button>
+            <a-button
+              id="intelligentReplenishmentLevel-back"
+              size="large"
+              class="button-cancel"
+              @click="handleBack"
+              style="padding: 0 60px;">取消</a-button>
+          </div>
         </div>
-      </div>
-    </a-card>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -57,6 +59,7 @@ export default {
   components: { STable },
   data () {
     return {
+      spinning: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
@@ -96,7 +99,9 @@ export default {
     // 确认导入
     handleSubmit () {
       const _this = this
+      _this.spinning = true
       predictProductInfoInsert(this.listData).then(res => {
+        _this.spinning = false
         if (res.status == 200) {
           _this.$success({
             content: '数据导入成功!',

+ 61 - 51
src/views/inventoryManagement/intelligentReplenishment/list.vue

@@ -1,56 +1,59 @@
 <template>
   <a-card size="small" :bordered="false" class="intelligentReplenishmentList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="intelligentReplenishmentList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-      <a-button id="intelligentReplenishmentList-set" type="primary" class="button-warning" @click="handleSet">基础信息设置</a-button>
-    </div>
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">为保证系统性能,仅保留最近10次的预测结果</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :showPagination="false"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.state == 'WAIT'"
-          @click="handleEdit(record)"
-          id="intelligentReplenishmentList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="record.state == 'WAIT'"
-          @click="handleDel(record)"
-          id="intelligentReplenishmentList-del-btn">删除</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-success"
-          v-if="record.state != 'WAIT'"
-          @click="handleDetail(record)"
-          id="customerManagementList-detail-btn">详情</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-warning"
-          :loading="downloadLoading"
-          v-if="record.state == 'FINISH'"
-          @click="handleDownload(record)"
-          id="chainTransferInList-download-btn">结果下载</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button v-if="$hasPermissions('B_intelligentReplenishment_add')" id="intelligentReplenishmentList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+        <a-button v-if="$hasPermissions('B_intelligentReplenishment_set')" id="intelligentReplenishmentList-set" type="primary" class="button-warning" @click="handleSet">基础信息设置</a-button>
+      </div>
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">为保证系统性能,仅保留最近10次的预测结果</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.state == 'WAIT' && $hasPermissions('B_intelligentReplenishment_edit')"
+            @click="handleEdit(record)"
+            id="intelligentReplenishmentList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="record.state == 'WAIT' && $hasPermissions('B_intelligentReplenishment_del')"
+            @click="handleDel(record)"
+            id="intelligentReplenishmentList-del-btn">删除</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-success"
+            v-if="record.state != 'WAIT' && $hasPermissions('B_intelligentReplenishment_detail')"
+            @click="handleDetail(record)"
+            id="customerManagementList-detail-btn">详情</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            :loading="downloadLoading"
+            v-if="record.state == 'FINISH' && $hasPermissions('B_intelligentReplenishment_down')"
+            @click="handleDownload(record)"
+            id="chainTransferInList-download-btn">结果下载</a-button>
+			<span v-if="!(record.state == 'WAIT' && $hasPermissions('B_intelligentReplenishment_edit'))&&!(record.state == 'WAIT' && $hasPermissions('B_intelligentReplenishment_del'))&&!(record.state != 'WAIT' && $hasPermissions('B_intelligentReplenishment_detail'))&&!(record.state == 'FINISH' && $hasPermissions('B_intelligentReplenishment_down'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 详情 -->
     <intelligent-replenishment-detail-modal :openModal="openDetailModal" :itemSn="itemSn" @close="closeModal" />
   </a-card>
@@ -65,6 +68,7 @@ export default {
   components: { STable, VSelect, intelligentReplenishmentDetailModal },
   data () {
     return {
+      spinning: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
@@ -93,7 +97,9 @@ export default {
       if (row) { //  编辑
         this.$router.push({ path: `/inventoryManagement/intelligentReplenishment/edit/${row.stockPredictSn}` })
       } else { //  新增
+        this.spinning = true
         predictSave({}).then(res => {
+          this.spinning = false
           if (res.status == 200) {
             this.$router.push({ path: `/inventoryManagement/intelligentReplenishment/add/${res.data.stockPredictSn}` })
           }
@@ -117,10 +123,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           predictDel({ sn: row.stockPredictSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 39 - 32
src/views/inventoryManagement/intelligentReplenishment/productRange.vue

@@ -1,37 +1,39 @@
 <template>
   <div class="productRange-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="productRange-brand" type="primary" class="button-error" @click="choosePModal('PRODUCT_BRAND')">选择产品品牌</a-button>
-      <a-button id="productRange-type" type="primary" class="button-info" @click="choosePModal('PRODUCT_TYPE')">选择产品分类</a-button>
-      <a-button id="productRange-product" type="primary" class="button-success" @click="choosePModal('SUPPLIER')">选择供应商</a-button>
-    </div>
-    <!-- 选择产品品牌 -->
-    <chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
-    <!-- 选择产品分类 -->
-    <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
-    <!-- 选择供应商 -->
-    <chooseSupplierModal :openModal="openSupplierModal" :chooseData="chooseSupplier" @close="openSupplierModal=false" @ok="handleSupplierOk" />
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :showPagination="false"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="productRange-del-btn">删除</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="productRange-brand" type="primary" class="button-error" @click="choosePModal('PRODUCT_BRAND')">选择产品品牌</a-button>
+        <a-button id="productRange-type" type="primary" class="button-info" @click="choosePModal('PRODUCT_TYPE')">选择产品分类</a-button>
+        <a-button id="productRange-product" type="primary" class="button-success" @click="choosePModal('SUPPLIER')">选择供应商</a-button>
+      </div>
+      <!-- 选择产品品牌 -->
+      <chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
+      <!-- 选择产品分类 -->
+      <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
+      <!-- 选择供应商 -->
+      <chooseSupplierModal :openModal="openSupplierModal" :chooseData="chooseSupplier" @close="openSupplierModal=false" @ok="handleSupplierOk" />
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="productRange-del-btn">删除</a-button>
+        </template>
+      </s-table>
+    </a-spin>
   </div>
 </template>
 
@@ -51,6 +53,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       openBrandModal: false, //  选择产品品牌
       openTypeModal: false, //  选择产品分类
       openSupplierModal: false, //  选择供应商
@@ -163,10 +166,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           predictRangeDel({ stockPredictSn: row.stockPredictSn, rangeDataSn: row.rangeDataSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 61 - 57
src/views/inventoryManagement/intelligentReplenishment/set.vue

@@ -1,65 +1,67 @@
 <template>
   <div class="intelligentReplenishmentSet-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="intelligentReplenishmentSet-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="intelligentReplenishmentSet-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="intelligentReplenishmentSet-cont">
-      <div class="importGuide-con">
-        <div class="explain-con">
-          <div class="explain-item">
-            <div class="explain-tit">
-              <span>1</span>准备导入
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="intelligentReplenishmentSet-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="intelligentReplenishmentSet-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="intelligentReplenishmentSet-cont">
+        <div class="importGuide-con">
+          <div class="explain-con">
+            <div class="explain-item">
+              <div class="explain-tit">
+                <span>1</span>准备导入
+              </div>
+              <p>所有允许导入的数据字段请参考模板,数据字段不符合规则,整条不予以导入。</p>
+              <ul>
+                <li>1) 下载导入模板得到的excel中,是目前系统中全部的产品信息,请修改变化的字段(该行的其他字段保持不变),并删除没有变化的行</li>
+                <li>2) “产品编码”字段为必填项</li>
+                <li>3) “订货周期”字段只能输入正整数,如果没有订货周期,保持为空即可</li>
+                <li>4) “是否淘汰”字段,如果确定淘汰,则输入“是”,如果不淘汰,则不需要输入,保持为空即可</li>
+                <li>5) “淘汰描述”字段,只有当是否淘汰为“是”时,才能录入淘汰描述,否则,淘汰描述只能保持为空</li>
+              </ul>
+              <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
             </div>
-            <p>所有允许导入的数据字段请参考模板,数据字段不符合规则,整条不予以导入。</p>
-            <ul>
-              <li>1) 下载导入模板得到的excel中,是目前系统中全部的产品信息,请修改变化的字段(该行的其他字段保持不变),并删除没有变化的行</li>
-              <li>2) “产品编码”字段为必填项</li>
-              <li>3) “订货周期”字段只能输入正整数,如果没有订货周期,保持为空即可</li>
-              <li>4) “是否淘汰”字段,如果确定淘汰,则输入“是”,如果不淘汰,则不需要输入,保持为空即可</li>
-              <li>5) “淘汰描述”字段,只有当是否淘汰为“是”时,才能录入淘汰描述,否则,淘汰描述只能保持为空</li>
-            </ul>
-            <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
-          </div>
-          <div class="explain-item">
-            <div class="explain-tit">
-              <span>2</span>上传数据文件
+            <div class="explain-item">
+              <div class="explain-tit">
+                <span>2</span>上传数据文件
+              </div>
+              <p>目前支持的文件类型*.xls,*.xlsx.</p>
+              <p>
+                <Upload
+                  id="importGuide-attachList"
+                  ref="importUpload"
+                  :maxNums="1"
+                  fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+                  uploadType="import"
+                  :action="attachAction"
+                  :uploadParams="uploadParams"
+                  upText="添加文件"
+                  @change="changeImport"></Upload>
+              </p>
             </div>
-            <p>目前支持的文件类型*.xls,*.xlsx.</p>
-            <p>
-              <Upload
-                id="importGuide-attachList"
-                ref="importUpload"
-                :maxNums="1"
-                fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
-                uploadType="import"
-                :action="attachAction"
-                :uploadParams="uploadParams"
-                upText="添加文件"
-                @change="changeImport"></Upload>
-            </p>
+          </div>
+          <!-- 按钮 -->
+          <div class="btn-con">
+            <a-button
+              type="primary"
+              id="importGuide-nextStep"
+              size="large"
+              class="button-primary"
+              @click="handlerNextStep"
+              style="padding: 0 60px;">下一步</a-button>
+            <a-button
+              id="importGuide-cancel"
+              size="large"
+              class="button-cancel"
+              @click="handleBack"
+              style="padding: 0 60px;margin-left: 15px;">取消</a-button>
           </div>
         </div>
-        <!-- 按钮 -->
-        <div class="btn-con">
-          <a-button
-            type="primary"
-            id="importGuide-nextStep"
-            size="large"
-            class="button-primary"
-            @click="handlerNextStep"
-            style="padding: 0 60px;">下一步</a-button>
-          <a-button
-            id="importGuide-cancel"
-            size="large"
-            class="button-cancel"
-            @click="handleBack"
-            style="padding: 0 60px;margin-left: 15px;">取消</a-button>
-        </div>
-      </div>
-    </a-card>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -72,7 +74,7 @@ export default {
   components: { Upload },
   data () {
     return {
-      // filePath: 'http://jg-ocs.oss-cn-beijing.aliyuncs.com/templ/promo/normal_product_templ.xlsx',
+      spinning: false,
       filePath: 'javascript:;',
       attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
       paramsData: null,
@@ -102,7 +104,9 @@ export default {
     //  导出
     handleExport () {
       const _this = this
+      _this.spinning = true
       predictProductInfoExport({}).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 114 - 95
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -1,108 +1,124 @@
 <template>
   <a-card size="small" :bordered="false" class="inventoryQueryList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="inventoryQueryList-productCode" v-model="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="原厂编码">
-              <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="5" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
-                <a-select
-                  placeholder="请选择产品品牌"
-                  id="inventoryQueryList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
+              <a-form-item label="产品编码">
+                <a-input id="inventoryQueryList-productCode" v-model="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  expand-trigger="hover"
-                  change-on-select
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="inventoryQueryList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productType" />
+              <a-form-item label="原厂编码">
+                <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="库存情况">
-                <a-select placeholder="请选择库存情况" id="inventoryQueryList-zeroQtyFlag" allowClear v-model="queryParam.zeroQtyFlag">
-                  <a-select-option v-for="item in zeroQtyData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-                </a-select>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="7" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
-            <a-button
-              type="primary"
-              style="margin-left: 5px"
-              class="button-warning"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              id="inventoryQueryList-export">导出</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 5px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 合计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1450, y: tableHeight }"
-      bordered>
-      <!-- 现有库存数量 -->
-      <template slot="currentStockQty" slot-scope="text, record">
-        {{ (record.currentStockQty + record.freezeQty) || 0 }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-      </template>
-      <template slot="currentStockCost" slot-scope="text, record">
-        {{ ((Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000).toFixed(2) || 0 }}
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="inventoryQueryList-detail-btn">库存详情</a-button>
-        <a-button size="small" type="link" class="button-warning" @click="goWarehouseDetail(record)" id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
-      </template>
-    </s-table>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="inventoryQueryList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productBrandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="inventoryQueryList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="库存情况">
+                  <a-select placeholder="请选择库存情况" id="inventoryQueryList-zeroQtyFlag" allowClear v-model="queryParam.zeroQtyFlag">
+                    <a-select-option v-for="item in zeroQtyData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="7" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
+              <a-button
+                v-if="$hasPermissions('B_inventoryQuery_export')"
+                type="primary"
+                style="margin-left: 5px"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="inventoryQueryList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 合计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1450, y: tableHeight }"
+        bordered>
+        <!-- 现有库存数量 -->
+        <template slot="currentStockQty" slot-scope="text, record">
+          {{ (record.currentStockQty + record.freezeQty) || 0 }}
+          <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+        </template>
+        <template slot="currentStockCost" slot-scope="text, record">
+          {{ ((Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000).toFixed(2) || 0 }}
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            v-if="$hasPermissions('B_inventoryQuery_detail')"
+            size="small"
+            type="link"
+            class="button-success"
+            @click="goDetail(record)"
+            id="inventoryQueryList-detail-btn">库存详情</a-button>
+          <a-button
+            v-if="$hasPermissions('B_inventoryQuery_rkDetail')"
+            size="small"
+            type="link"
+            class="button-warning"
+            @click="goWarehouseDetail(record)"
+            id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
+			<span v-if="!$hasPermissions('B_inventoryQuery_detail')&&!$hasPermissions('B_inventoryQuery_rkDetail')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 库存详情 -->
     <inventory-query-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
   </a-card>
@@ -119,6 +135,7 @@ export default {
   components: { STable, VSelect, inventoryQueryDetailModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -246,8 +263,10 @@ export default {
       const _this = this
       const params = this.queryParam
       this.exportLoading = true
+      _this.spinning = true
       stockExport(params).then(res => {
         this.exportLoading = false
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 160 - 146
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -1,160 +1,169 @@
 <template>
   <a-card size="small" :bordered="false" class="inventoryWarningList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="pageInit(1)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="inventoryWarningList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="原厂编码">
-              <a-input id="inventoryWarningList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="inventoryWarningList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="pageInit(1)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
-                <a-select
-                  placeholder="请选择产品品牌"
-                  id="inventoryWarningList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
+              <a-form-item label="产品编码">
+                <a-input id="inventoryWarningList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-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="inventoryWarningList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
+              <a-form-item label="原厂编码">
+                <a-input id="inventoryWarningList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="预警提示">
-                <v-select
-                  v-model="queryParam.stockState"
-                  ref="stockState"
-                  id="inventoryWarningList-stockState"
-                  code="STOCK_WARN_TIP"
-                  placeholder="请选择预警提示"
-                  allowClear
-                ></v-select>
+              <a-form-item label="产品名称">
+                <a-input id="inventoryWarningList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="pageInit(1)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
-            <!-- <a-button
-              style="margin-left: 8px"
-              type="danger"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              id="inventoryWarningList-export">导出</a-button> -->
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button type="primary" id="inventoryWarningList-update" :loading="loading" @click="handleupdate">批量更新</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
-      </span>
-    </div>
-    <!-- 列表 -->
-    <a-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :dataSource="loadData"
-      :scroll="{ x: 2220, y: tableHeight }"
-      :pagination="paginationProps"
-      :loading="tableLoading"
-      bordered>
-      <!-- 产品分类 -->
-      <template slot="productType" slot-scope="text, record">
-        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 实时库存数 -->
-      <template slot="stockQty" slot-scope="text, record">
-        {{ record.currentStockQty + record.freezeQty }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-      </template>
-      <!-- 预警提示 -->
-      <template slot="stockState" slot-scope="text, record">
-        <span v-if="record.stockStateDictValue" :class="[record.stockState=='OVERFLOW'?'yellow':record.stockState=='NOT_ENOUGH'?'red':record.stockState=='LACK'?'blue':record.stockState=='NORMAL'?'green':'']">{{ record.stockStateDictValue }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 在途数 -->
-      <template slot="inTransit" slot-scope="text, record" >
-        <div>
-          <a-input-number
-            id="inventoryWarningList-inTransit"
-            v-model="record.inTransit"
-            :precision="0"
-            :min="0"
-            :max="999999"
-            placeholder="请输入在途数" />
-        </div>
-      </template>
-      <!-- 最大库存数 -->
-      <template slot="upperLimit" slot-scope="text, record" >
-        <div>
-          <a-input-number
-            id="inventoryWarningList-upperLimit"
-            v-model="record.upperLimit"
-            :precision="0"
-            :min="0"
-            :max="999999"
-            placeholder="请输入最大库存数" />
-        </div>
-      </template>
-      <!-- 最小库存数 -->
-      <template slot="lowerLimit" slot-scope="text, record" >
-        <div>
-          <a-input-number
-            id="inventoryWarningList-lowerLimit"
-            v-model="record.lowerLimit"
-            :precision="0"
-            :min="0"
-            :max="record.upperLimit"
-            placeholder="请输入最小库存数" />
-        </div>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button type="primary" size="small" class="button-info" @click="handleSave(record)" id="inventoryWarningList-add-btn">保存</a-button>
-      </template>
-    </a-table>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="inventoryWarningList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productBrandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    change-on-select
+                    v-model="productType"
+                    expand-trigger="hover"
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="inventoryWarningList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="预警提示">
+                  <v-select
+                    v-model="queryParam.stockState"
+                    ref="stockState"
+                    id="inventoryWarningList-stockState"
+                    code="STOCK_WARN_TIP"
+                    placeholder="请选择预警提示"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="pageInit(1)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
+              <!-- <a-button
+                style="margin-left: 8px"
+                type="danger"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="inventoryWarningList-export">导出</a-button> -->
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div v-if="$hasPermissions('B_inventoryWarning_refresh')" class="table-operator">
+        <a-button type="primary" id="inventoryWarningList-update" :loading="loading" @click="handleupdate">批量更新</a-button>
+        <span style="margin-left: 8px">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <!-- 列表 -->
+      <a-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="$hasPermissions('B_inventoryWarning_refresh')?{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }:null"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :dataSource="loadData"
+        :scroll="{ x: 2220, y: tableHeight }"
+        :pagination="paginationProps"
+        :loading="tableLoading"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 实时库存数 -->
+        <template slot="stockQty" slot-scope="text, record">
+          {{ record.currentStockQty + record.freezeQty }}
+          <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+        </template>
+        <!-- 预警提示 -->
+        <template slot="stockState" slot-scope="text, record">
+          <span v-if="record.stockStateDictValue" :class="[record.stockState=='OVERFLOW'?'yellow':record.stockState=='NOT_ENOUGH'?'red':record.stockState=='LACK'?'blue':record.stockState=='NORMAL'?'green':'']">{{ record.stockStateDictValue }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 在途数 -->
+        <template slot="inTransit" slot-scope="text, record" >
+          <div>
+            <a-input-number
+              id="inventoryWarningList-inTransit"
+              v-model="record.inTransit"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              placeholder="请输入在途数" />
+          </div>
+        </template>
+        <!-- 最大库存数 -->
+        <template slot="upperLimit" slot-scope="text, record" >
+          <div>
+            <a-input-number
+              id="inventoryWarningList-upperLimit"
+              v-model="record.upperLimit"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              placeholder="请输入最大库存数" />
+          </div>
+        </template>
+        <!-- 最小库存数 -->
+        <template slot="lowerLimit" slot-scope="text, record" >
+          <div>
+            <a-input-number
+              id="inventoryWarningList-lowerLimit"
+              v-model="record.lowerLimit"
+              :precision="0"
+              :min="0"
+              :max="record.upperLimit"
+              placeholder="请输入最小库存数" />
+          </div>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            v-if="$hasPermissions('B_inventoryWarning_save')"
+            type="primary"
+            size="small"
+            class="button-info"
+            @click="handleSave(record)"
+            id="inventoryWarningList-add-btn">保存</a-button>
+          <span v-else>--</span>
+        </template>
+      </a-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -168,6 +177,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -307,12 +317,16 @@ export default {
           lowerLimit: row.lowerLimit
         })
       }
+      this.spinning = true
       stockWarnSaveBatch(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.pageInit()
           this.selectedRowKeys = []
           this.selectedRows = []
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },

+ 4 - 4
src/views/power/menu/menu.vue

@@ -1,9 +1,9 @@
 <template>
   <a-card :bordered="false">
     <a-row :gutter="24">
-      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
+      <a-button v-if="$hasPermissions('B_power_menu_child_add')" style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
+      <a-button v-if="$hasPermissions('B_power_menu_top_add')" style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
+      <a-button v-if="$hasPermissions('B_power_menu_del')" style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
 
     </a-row>
     <a-row :gutter="24">
@@ -172,7 +172,7 @@
           </a-form-item>
 
           <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()">
+            <a-button type="primary" @click="handleSubmit()" v-if="$hasPermissions('B_power_menu_edit')">
               保存
             </a-button>
             <a-button :style="{ marginLeft: '8px' }" @click="clear">

+ 67 - 56
src/views/power/role/menuModal.vue

@@ -2,31 +2,38 @@
   <div>
     <a-modal
       centered
-      class="modalBox"
-      :title="roleName"
+      class="roleMenuEdit-modal"
+      :footer="null"
+      :maskClosable="false"
+      :title="titleText"
       v-model="isshow"
-      @cancle="cancel"
-      :maskClosable="false">
+      @cancle="isshow=false"
+      :width="800">
       <a-spin :spinning="spinning" tip="Loading...">
-        <a-form class="form-box" style="max-height: 600px;" :form="form" @submit="handleSubmit">
-          <a-tree
-            checkable
-            @check="onCheck"
-            @expand="onExpand"
-            :expandedKeys="expandedKeys"
-            :autoExpandParent="autoExpandParent"
-            v-model="checkedKeys"
-            :treeData="treeData"
-          />
-          <a-form-item :wrapper-col="{ offset: 15 }">
-            <a-button type="primary" @click="handleSubmit()" id="menuModal-handleSubmit">
-              保存
-            </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="cancel" id="menuModal-handleCancel">
-              取消
-            </a-button>
-          </a-form-item>
-        </a-form>
+        <a-form-model
+          id="roleMenuEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <div style="height: 500px;overflow-y: scroll;">
+            <a-tree
+              checkable
+              @check="onCheck"
+              @expand="onExpand"
+              :expandedKeys="expandedKeys"
+              :autoExpandParent="autoExpandParent"
+              v-model="checkedKeys"
+              :treeData="treeData"
+            />
+          </div>
+          <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+            <a-button type="primary" id="roleMenuEdit-save" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
+            <a-button id="roleMenuEdit-cancel" :style="{ marginLeft: '8px' }" @click="isshow=false">取消</a-button>
+          </a-form-model-item>
+        </a-form-model>
       </a-spin>
     </a-modal>
   </div>
@@ -45,7 +52,7 @@ export default {
       type: Boolean,
       default: false
     },
-    data: {
+    nowData: {
       type: Object,
       default: function () {
         return {}
@@ -56,14 +63,18 @@ export default {
     return {
       spinning: false,
       treeData: [],
-      roleName: '',
+      titleText: '',
       expandedKeys: [],
       autoExpandParent: true,
       checkedKeys: [],
       checkedData: [],
       isshow: this.visible,
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'menuModal' }),
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {},
+      rules: {},
       id: '' // 角色id
     }
   },
@@ -76,43 +87,37 @@ export default {
       this.checkedData = [...checkedKeys, ...info.halfCheckedKeys]
       this.checkedKeys = checkedKeys
     },
-    cancel (e) {
-      this.clear()
-      this.$emit('close')
-    },
-
     // 保存提交
     handleSubmit () {
       const _this = this
-      this.form.validateFields((err, values) => {
-        if (!err) {
-          console.log(this.checkedData)
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
           if (this.checkedData.length == 0) {
             return this.$message.warning('请先选择菜单')
           }
           const arr = this.checkedData.join(',')
-          console.log({ id: this.id, menuIds: arr })
           _this.spinning = true
           addMenuPower({ id: this.id, menuIds: arr }).then(res => {
-            console.log(res, 'res--save')
-            if (res.status + '' === '200') {
-              this.$message.success(res.message ? res.message : '保存成功')
-              this.$emit('refresh')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('refresh')
               setTimeout(function () {
-                _this.cancel()
+                _this.isshow = false
                 _this.spinning = false
               }, 300)
             } else {
               _this.spinning = false
-              // this.$message.error(res.message)
             }
           })
+        } else {
+          console.log('error submit!!')
+          return false
         }
       })
     },
     clear () {
       this.form.resetFields()
-      this.roleName = ''
+      this.titleText = ''
       this.id = ''
       this.checkedKeys = []
       this.expandedKeys = []
@@ -135,29 +140,35 @@ export default {
       }
     }
   },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'menuModal' })
-  },
   watch: {
     visible (newValue, oldValue) {
       this.isshow = newValue
     },
     isshow (newValue, oldValue) {
-      if (newValue) {
-        if (this.data) { // 编辑
-          this.treeData = this.data.allMenuList
-          this.id = this.data.role.id
-          this.roleName = '分配权限' + '(' + this.data.role.name + ')'
-          if (this.data.role.menuIds) {
-            const arr = this.data.role.menuIds.split(',')
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.id = ''
+        this.checkedKeys = []
+        this.expandedKeys = []
+        this.titleText = '新增角色'
+      }
+    },
+    nowData: {
+      handler (newValue, oldValue) {
+        if (this.isshow && newValue) {
+          this.treeData = this.nowData.allMenuList
+          this.id = this.nowData.role.id
+          this.titleText = '分配权限' + '(' + this.nowData.role.name + ')'
+          if (this.nowData.role.menuIds) {
+            const arr = this.nowData.role.menuIds.split(',')
             this.checkedData = arr
             // 找出叶子节点
             this.findLeaf(this.treeData, arr)
           }
         }
-      } else {
-        this.cancel()
-      }
+      },
+      deep: true
     }
   }
 }

+ 80 - 89
src/views/power/role/roleList.vue

@@ -1,87 +1,74 @@
 <template>
   <a-card size="small" :bordered="false">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline">
-        <a-row :gutter="48">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="角色名称">
-              <a-input
-                allowClear
-                v-model.trim="queryParam.name"
-                placeholder="请输入角色名称"
-                :maxLength="30"
-                id="roleList-name"
-                @pressEnter="$refs.table.refresh(true)" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="状态">
-              <v-select code="ENABLE_FLAG" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" id="roleList-isEnable"></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" id="roleList-handSubmit" style="margin-right: 10px;">查询</a-button>
-            <a-button type="" @click="reset" id="roleList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <div class="table-operator">
-      <!-- <a-button v-if="$hasPermissions('B_powerMD_role_add')" type="primary" class="button-error" @click="openModal" id="roleList-openModal">新增</a-button> -->
-      <a-button type="primary" class="button-error" @click="openModal" id="roleList-openModal">新增</a-button>
-    </div>
-
-    <s-table
-      ref="table"
-      size="default"
-      rowKey="id"
-      :columns="columns"
-      :data="loadData"
-      style="word-break: break-all;"
-      bordered>
-      <!-- 启用禁用 -->
-      <span slot="status" slot-scope="text, record">
-        <!-- <a-switch
-          v-if="$hasPermissions('B_powerMD_role_enable')"
-          checkedChildren="启用"
-          unCheckedChildren="禁用"
-          id="roleList-isEnable"
-          v-model="record.isEnable"
-          @change="changeFlagHandle(text, record)" />
-        <span v-else>{{ record.isEnable==1?'已启用':'已禁用' }}</span> -->
-		<a-switch
-		  checkedChildren="启用"
-		  unCheckedChildren="禁用"
-		  id="roleList-isEnable"
-		  v-model="record.isEnable"
-		  @change="changeFlagHandle(text, record)" />
-      </span>
-      <!-- 角色描述 -->
-      <template slot="remarks" slot-scope="text, record">
-        <span class="text-overflows" :title="record.remarks">{{ record.remarks ?record.remarks : '--' }}</span>
-      </template>
-      <!-- 操作 -->
-      <span slot="action" slot-scope="text, record">
-        <!-- <a-icon v-if="$hasPermissions('M_powerMD_role_menu')" type="setting" title="菜单权限" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="openMenuModal(record)" />
-        <a-icon v-if="$hasPermissions('B_powerMD_role_edit')" type="edit" title="编辑" :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}" @click="handleEdit(record)" />
-        <a-icon
-          type="delete"
-          title="删除"
-          :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-          v-if="!record.isEnable && $hasPermissions('B_powerMD_role_del')"
-          @click="delect(record)" /> -->
-		<a-icon type="setting" title="菜单权限" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="openMenuModal(record)" />
-		<a-icon type="edit" title="编辑" :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}" @click="handleEdit(record)" />
-		<a-icon
-			type="delete"
-			title="删除"
-			:style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-			v-if="!record.isEnable"
-			@click="delect(record)" />
-		</span>
-    </s-table>
-    <roleModal :visible="showModal" :data="itemData" @refresh="refreshTable" @close="showModal = false"></roleModal>
-    <menuModal :visible="showMenuModal" :data="menuData" @close="showMenuModal = false"></menuModal>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="角色名称">
+                <a-input
+                  allowClear
+                  v-model.trim="queryParam.name"
+                  placeholder="请输入角色名称"
+                  :maxLength="30"
+                  id="roleList-name"
+                  @pressEnter="$refs.table.refresh(true)" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <v-select code="ENABLE_FLAG" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" id="roleList-isEnable"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" id="roleList-handSubmit" style="margin-right: 10px;">查询</a-button>
+              <a-button type="" @click="reset" id="roleList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="table-operator">
+        <a-button type="primary" v-if="$hasPermissions('B_power_role_add')" class="button-error" @click="openModal" id="roleList-openModal">新增</a-button>
+      </div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        style="word-break: break-all;"
+        bordered>
+        <!-- 启用禁用 -->
+        <span slot="status" slot-scope="text, record">
+          <a-switch
+            v-if="$hasPermissions('B_power_role_enable')"
+            checkedChildren="启用"
+            unCheckedChildren="禁用"
+            id="roleList-isEnable"
+            v-model="record.isEnable"
+            @change="changeFlagHandle(text, record)" />
+          <span v-else>{{ record.isEnable==1?'已启用':'已禁用' }}</span>
+        </span>
+        <!-- 角色描述 -->
+        <template slot="remarks" slot-scope="text, record">
+          <span class="text-overflows" :title="record.remarks">{{ record.remarks ?record.remarks : '--' }}</span>
+        </template>
+        <!-- 操作 -->
+        <span slot="action" slot-scope="text, record">
+          <a-icon type="setting" title="菜单权限" v-if="$hasPermissions('M_power_role_menu')" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="openMenuModal(record)" />
+          <a-icon type="edit" title="编辑" v-if="$hasPermissions('B_power_role_edit')" :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}" @click="handleEdit(record)" />
+          <a-icon
+            type="delete"
+            title="删除"
+            :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
+            v-if="!record.isEnable && $hasPermissions('B_power_role_del')"
+            @click="delect(record)" />
+          <span v-if="!$hasPermissions('M_power_role_menu') && !$hasPermissions('B_power_role_edit') && (record.isEnable && !$hasPermissions('B_power_role_del'))">--</span>
+        </span>
+      </s-table>
+    </a-spin>
+    <roleModal :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="showModal = false"></roleModal>
+    <menuModal :visible="showMenuModal" @refresh="$refs.table.refresh(true)" :nowData="menuData" @close="showMenuModal = false"></menuModal>
   </a-card>
 </template>
 
@@ -108,6 +95,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       // 查询参数
       queryParam: {
         name: '',
@@ -164,7 +152,6 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        console.log(parameter, 'parameter')
         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++) {
@@ -212,11 +199,9 @@ export default {
         if (res.status == 200) {
           _this.menuData = res.data
           this.showMenuModal = true
-          console.log(res.data, 'this.itemData')
         }
       })
     },
-
     // 删除
     delect (row) {
       const _this = this
@@ -225,20 +210,22 @@ export default {
         content: '删除后无法恢复,确认删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           delectRolePower({
             id: row.id
           }).then(res => {
-            console.log(res, 'res1111')
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
       })
     },
     handleEdit (row) {
-      console.log(row, 'row')
       this.showModal = true
       this.itemData = row
     },
@@ -248,11 +235,15 @@ export default {
         id: record.id,
         flag: record.isEnable ? '1' : '0'
       }
+      this.spinning = true
       updateEnableStatus(_data).then(res => {
-        if (res.status + '' === '200') {
+        if (res.status == 200) {
           this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinning = false
         } else {
-          record.isEnable = !record.isEnable
+          this.$refs.table.refresh()
+          this.spinning = false
         }
       })
     }

+ 83 - 91
src/views/power/role/roleModal.vue

@@ -2,64 +2,52 @@
   <div>
     <a-modal
       centered
-      class="modalBox"
+      class="roleEdit-modal"
+      :footer="null"
+      :maskClosable="false"
       :title="titleText"
       v-model="isshow"
-      @cancle="cancel"
-      :maskClosable="false"
-      width="45%">
+      @cancle="isshow=false"
+      :width="800">
       <a-spin :spinning="spinning" tip="Loading...">
-        <a-form :form="form" @submit="handleSubmit">
+        <a-form-model
+          id="roleEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
           <!-- 用户名称 -->
-          <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <a-form-model-item label="角色名称" prop="name">
             <a-input
-              placeholder="请输入角色名称(最多30个字符)"
+              id="roleEdit-name"
+              v-model.trim="form.name"
+              @change="filterEmpty"
               :maxLength="30"
-              v-decorator="['formData.name', {
-                initialValue: formData.name,
-                getValueFromEvent: $filterEmpty,
-                rules: [{ required: true, message: '请输入角色名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
-            />
-          </a-form-item>
-
+              allowClear
+              placeholder="请输入角色名称(最多30个字符)"/>
+          </a-form-model-item>
           <!-- 状态 -->
-          <a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-radio-group
-              name="radioGroup"
-              v-decorator="[
-                'formData.isEnable',
-                {
-                  initialValue: formData.isEnable,
-                  rules: [{ required: true, message: '请选择状态!' }] },
-              ]"
-            >
+          <a-form-model-item label="状态" prop="isEnable">
+            <a-radio-group name="radioGroup" v-model="form.isEnable" placeholder="请选择状态">
               <a-radio :value="1">启用</a-radio>
               <a-radio :value="0">禁用</a-radio>
             </a-radio-group>
-          </a-form-item>
-
-          <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          </a-form-model-item>
+          <a-form-model-item label="角色描述" prop="remarks">
             <a-textarea
-              v-decorator="[
-                'formData.remarks',
-                { initialValue: formData.remarks,
-                  rules: [] },
-              ]"
-              style="min-height: 60px;"
+              id="roleEdit-remarks"
+              v-model.trim="form.remarks"
               :maxLength="500"
-              placeholder="请输入描述(最多500个字符)"
-              autosize />
-          </a-form-item>
-
-          <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()">
-              保存
-            </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="cancel">
-              取消
-            </a-button>
-          </a-form-item>
-        </a-form>
+              allowClear
+              placeholder="请输入描述(最多500个字符)"/>
+          </a-form-model-item>
+          <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+            <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="isshow=false">取消</a-button>
+          </a-form-model-item>
+        </a-form-model>
       </a-spin>
     </a-modal>
   </div>
@@ -78,7 +66,7 @@ export default {
       type: Boolean,
       default: false
     },
-    data: {
+    nowData: {
       type: Object,
       default: function () {
         return {}
@@ -90,84 +78,88 @@ export default {
       titleText: '添加角色',
       isshow: this.visible,
       spinning: false,
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'roleModal' }),
-      formData: {
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
         name: '',
-        isEnable: '', // 活动状态
+        isEnable: undefined,
         remarks: ''
+      },
+      rules: {
+        name: [ { required: true, message: '请输入角色名称', trigger: 'blur' }, { pattern: '^[^<|>]{1,30}$', message: '请输入不含<或>的字符,最多30个字符' } ],
+        isEnable: [ { required: true, message: '请选择状态', trigger: 'change' } ]
       }
-
     }
   },
   methods: {
-    cancel () {
-      this.clear()
-      this.$emit('close')
+    // 过滤空格
+    filterEmpty () {
+      let str = this.form.name
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.name = str
     },
     // 保存提交
     handleSubmit () {
       const _this = this
-      this.form.validateFields((err, values) => {
-        if (!err) {
-          console.log(values.formData, ' formData.type222222222')
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(_this.form))
+          params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
           _this.spinning = true
-          saveRolePower(Object.assign(this.formData, values.formData)).then(res => {
-            console.log(res, 'res--save')
-            if (res.status + '' === '200') {
-              this.$message.success(res.message ? res.message : '保存成功')
-              this.$emit('refresh')
+          saveRolePower(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('refresh')
               setTimeout(function () {
-                _this.cancel()
+                _this.isshow = false
                 _this.spinning = false
               }, 300)
             } else {
               _this.spinning = false
-              // this.$message.error(res.message)
             }
           })
+        } else {
+          console.log('error submit!!')
+          return false
         }
       })
-    },
-    clear () {
-      this.form.resetFields()
-      delete this.formData.id
-      this.formData.name = ''
-      this.formData.isEnable = ''
-      this.formData.remarks = ''
     }
   },
-  mounted () {
-  },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'roleModal' })
-  },
   watch: {
     visible (newValue, oldValue) {
       this.isshow = newValue
     },
     isshow (newValue, oldValue) {
-      if (newValue) {
-        if (this.data.id) { // 编辑
-          this.titleText = '编辑角色'
-          this.formData = Object.assign({}, this.data)
-          delete this.formData.no
-          this.formData.isEnable = Number(this.formData.isEnable)
-          console.log(this.formData, 'this.formData')
-        } else {
-          this.titleText = '添加角色'
-        }
-      } else {
-        this.cancel()
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.form.name = ''
+        this.form.isEnable = undefined
+        this.form.remarks = ''
+        this.titleText = '新增角色'
       }
+    },
+    nowData: {
+      handler (newValue, oldValue) {
+        if (this.isshow && newValue) {
+          if (this.nowData.id) { //  编辑
+            this.titleText = '编辑角色'
+            this.form = Object.assign({}, this.nowData)
+            this.form.isEnable = Number(this.nowData.isEnable)
+          }
+        }
+      },
+      deep: true
     }
   }
 }
 </script>
 
 <style >
-  .modalBox{
-  }
   .ant-modal-footer {
     display: none;
   }

+ 106 - 92
src/views/power/user/userList.vue

@@ -1,97 +1,100 @@
 <template>
   <a-card size="small" :bordered="false">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="用户名称">
-              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入用户名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="手机号码">
-              <a-input allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="状态">
-              <v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" style="margin-right: 10px;">查询</a-button>
-            <a-button type="" @click="reset" id="roleList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <div class="table-operator">
-      <!-- <a-button v-if="$hasPermissions('B_powerMD_user_add')" type="primary" class="button-error" @click="openModal">新增</a-button> -->
-      <a-button type="primary" class="button-error" @click="openModal">新增</a-button>
-    </div>
-    <s-table
-      ref="table"
-      size="default"
-      rowKey="id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1350 }"
-      style="word-break: break-all;"
-      bordered
-    >
-      <span slot="status" slot-scope="text, record">
-        <!-- <a-switch v-if="$hasPermissions('B_powerMD_user_enable')" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
-        <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span> -->
-        <!-- 超级管理员不可删除不可编辑不可启禁用 -->
-        <a-switch v-if="record.superAdmin!=1" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
-        <span v-if="record.superAdmin==1">{{ record.loginFlag==1?'已启用':'已禁用' }}</span>
-      </span>
-      <span slot="action" slot-scope="text, record">
-        <!-- <a-icon
-          type="edit"
-          title="编辑"
-          :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}"
-          v-if="$hasPermissions('B_powerMD_user_edit')"
-          @click="handleEdit(record)"
-        />
-        <a-icon
-          type="unlock"
-          title="重置密码"
-          v-if="record.loginFlag==1 && $hasPermissions('B_powerMD_user_restPwd')"
-          :style="{fontSize: '20px',color:' #ffaa00',padding: '0 10px'}"
-          @click="resetPassword(record)" />
-        <a-icon
-          type="delete"
-          title="删除"
-          :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-          v-if="record.loginFlag==0 && $hasPermissions('B_powerMD_user_del')"
-          @click="delect(record)"/> -->
-        <a-icon
-          type="edit"
-          title="编辑"
-          v-if="record.superAdmin!=1"
-          :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}"
-          @click="handleEdit(record)"
-        />
-        <a-icon
-          type="unlock"
-          title="重置密码"
-          v-if="record.loginFlag==1 && record.superAdmin!=1"
-          :style="{fontSize: '20px',color:' #ffaa00',padding: '0 10px'}"
-          @click="resetPassword(record)" />
-        <a-icon
-          type="delete"
-          title="删除"
-          :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-          v-if="record.loginFlag==0 && record.superAdmin!=1"
-          @click="delect(record)"/>
-        <a-icon
-          type="setting"
-          title="分区设置"
-          :style="{fontSize: '20px',color:' #00aa00',padding: '0 10px'}"
-          @click="handleSetting(record)" />
-      </span>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="用户名称">
+                <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入用户名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="手机号码">
+                <a-input allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" style="margin-right: 10px;">查询</a-button>
+              <a-button type="" @click="reset" id="roleList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="table-operator">
+        <!-- <a-button v-if="$hasPermissions('B_powerMD_user_add')" type="primary" class="button-error" @click="openModal">新增</a-button> -->
+        <a-button type="primary" v-if="$hasPermissions('B_power_user_add')" class="button-error" @click="openModal">新增</a-button>
+      </div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1350 }"
+        style="word-break: break-all;"
+        bordered
+      >
+        <span slot="status" slot-scope="text, record">
+          <!-- <a-switch v-if="$hasPermissions('B_powerMD_user_enable')" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
+          <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span> -->
+          <!-- 超级管理员不可删除不可编辑不可启禁用 -->
+          <a-switch v-if="record.superAdmin!=1 && $hasPermissions('B_power_user_enable')" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
+          <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span>
+        </span>
+        <span slot="action" slot-scope="text, record">
+          <!-- <a-icon
+            type="edit"
+            title="编辑"
+            :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}"
+            v-if="$hasPermissions('B_powerMD_user_edit')"
+            @click="handleEdit(record)"
+          />
+          <a-icon
+            type="unlock"
+            title="重置密码"
+            v-if="record.loginFlag==1 && $hasPermissions('B_powerMD_user_restPwd')"
+            :style="{fontSize: '20px',color:' #ffaa00',padding: '0 10px'}"
+            @click="resetPassword(record)" />
+          <a-icon
+            type="delete"
+            title="删除"
+            :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
+            v-if="record.loginFlag==0 && $hasPermissions('B_powerMD_user_del')"
+            @click="delect(record)"/> -->
+          <a-icon
+            type="edit"
+            title="编辑"
+            v-if="record.superAdmin!=1 &&$hasPermissions('B_power_user_edit')"
+            :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}"
+            @click="handleEdit(record)"
+          />
+          <a-icon
+            type="unlock"
+            title="重置密码"
+            v-if="record.loginFlag==1 && record.superAdmin!=1 &&$hasPermissions('B_power_user_resetPsd')"
+            :style="{fontSize: '20px',color:' #ffaa00',padding: '0 10px'}"
+            @click="resetPassword(record)" />
+          <a-icon
+            type="delete"
+            title="删除"
+            :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
+            v-if="record.loginFlag==0 && record.superAdmin!=1 &&$hasPermissions('B_power_user_del')"
+            @click="delect(record)"/>
+          <a-icon
+            type="setting"
+            title="分区设置"
+            v-if="$hasPermissions('B_power_user_set')"
+            :style="{fontSize: '20px',color:' #00aa00',padding: '0 10px'}"
+            @click="handleSetting(record)" />
+        </span>
+      </s-table>
+    </a-spin>
     <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="showModal = false"></userModal>
     <!-- 分区设置 -->
     <UpdateArea ref="UpdateArea" :openUdModal="openUdModal" @ok="$refs.table.refresh(true)" @close="openUdModal=false"></UpdateArea>
@@ -110,6 +113,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       // 查询参数
       queryParam: {
         name: '',
@@ -172,12 +176,16 @@ export default {
         content: '确认重置密码吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           resetPSD({
             id: row.id
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -191,14 +199,17 @@ export default {
         content: '删除后无法恢复,确认删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           delectUserPower({
             id: row.id
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
             } else {
               _this.$message.error(res.message)
+              _this.spinning = false
             }
           })
         }
@@ -214,12 +225,15 @@ export default {
         id: record.id,
         flag: record.loginFlag ? '1' : '0'
       }
+      this.spinning = true
       updateEnableStatus(_data).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.table.refresh()
+          this.spinning = false
         } else {
           this.$refs.table.refresh()
+          this.spinning = false
         }
       })
     }

+ 3 - 1
src/views/power/user/userModal.vue

@@ -170,7 +170,9 @@ export default {
         if (valid) {
           const params = JSON.parse(JSON.stringify(_this.form))
           params.roleNames = _this.form.roleNames.join(',')
-          params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
+          if (_this.nowData && _this.nowData.id) {
+            params.id = _this.nowData.id
+          }
           _this.spinning = true
           saveUserPower(params).then(res => {
             if (res.status == 200) {

+ 112 - 106
src/views/productManagement/priceChangeRecord/list.vue

@@ -1,117 +1,120 @@
 <template>
   <a-card size="small" :bordered="false" class="productChangeRecordList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="变更时间">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productChangeRecordList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productChangeRecordList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="品牌">
-                <a-select
-                  placeholder="请选择"
-                  id="productChangeRecordList-brandSn"
-                  allowClear
-                  v-model="queryParam.brandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
+              <a-form-item label="变更时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  expand-trigger="hover"
-                  change-on-select
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productType" />
+              <a-form-item label="产品名称">
+                <a-input id="productChangeRecordList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productChangeRecordList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productChangeRecordList-reset">重置</a-button>
-            <a-button
-              style="margin: 0 0 18px 8px"
-              type="primary"
-              class="button-warning"
-              @click="handleExport"
-              :loading="exportLoading"
-              id="productChangeRecordList-export">导出</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 总计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计:<strong>{{ total }}</strong>条</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2340, y: tableHeight }"
-      bordered>
-      <!-- 产品分类 -->
-      <template slot="productType" slot-scope="text, record">
-        <span v-if="record.productEntity.productTypeName2 || record.productEntity.productTypeName3">{{ record.productEntity.productTypeName2 }} {{ record.productEntity.productTypeName3 ? '>' : '' }} {{ record.productEntity.productTypeName3 }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 省级价变更后 -->
-      <template slot="afterProvincePrice" slot-scope="text, record">
-        <span v-if="record.afterProvincePrice || record.afterProvincePrice==0" :class="record.beforeProvincePrice != record.afterProvincePrice ? 'red' : ''">{{ record.afterProvincePrice }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 市级价变更后 -->
-      <template slot="afterCityPrice" slot-scope="text, record">
-        <span v-if="record.afterCityPrice || record.afterCityPrice==0" :class="record.beforeCityPrice != record.afterCityPrice ? 'red' : ''">{{ record.afterCityPrice }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 特约价变更后 -->
-      <template slot="afterSpecialPrice" slot-scope="text, record">
-        <span v-if="record.afterSpecialPrice || record.afterSpecialPrice==0" :class="record.beforeSpecialPrice != record.afterSpecialPrice ? 'red' : ''">{{ record.afterSpecialPrice }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 终端价变更后 -->
-      <template slot="afterTerminalPrice" slot-scope="text, record">
-        <span v-if="record.afterTerminalPrice || record.afterTerminalPrice==0" :class="record.beforeTerminalPrice != record.afterTerminalPrice ? 'red' : ''">{{ record.afterTerminalPrice }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 车主价变更后 -->
-      <template slot="afterCarOwnersPrice" slot-scope="text, record">
-        <span v-if="record.afterCarOwnersPrice || record.afterCarOwnersPrice==0" :class="record.beforeCarOwnersPrice != record.afterCarOwnersPrice ? 'red' : ''">{{ record.afterCarOwnersPrice }}</span>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="productChangeRecordList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="品牌">
+                  <a-select
+                    placeholder="请选择"
+                    id="productChangeRecordList-brandSn"
+                    allowClear
+                    v-model="queryParam.brandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="productInfoList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productChangeRecordList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productChangeRecordList-reset">重置</a-button>
+              <a-button
+                style="margin: 0 0 18px 8px"
+                type="primary"
+                v-if="$hasPermissions('B_priceChangeRecord_export')"
+                class="button-warning"
+                @click="handleExport"
+                :loading="exportLoading"
+                id="productChangeRecordList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 总计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">合计:<strong>{{ total }}</strong>条</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2340, y: tableHeight }"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productEntity.productTypeName2 || record.productEntity.productTypeName3">{{ record.productEntity.productTypeName2 }} {{ record.productEntity.productTypeName3 ? '>' : '' }} {{ record.productEntity.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 省级价变更后 -->
+        <template slot="afterProvincePrice" slot-scope="text, record">
+          <span v-if="record.afterProvincePrice || record.afterProvincePrice==0" :class="record.beforeProvincePrice != record.afterProvincePrice ? 'red' : ''">{{ record.afterProvincePrice }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 市级价变更后 -->
+        <template slot="afterCityPrice" slot-scope="text, record">
+          <span v-if="record.afterCityPrice || record.afterCityPrice==0" :class="record.beforeCityPrice != record.afterCityPrice ? 'red' : ''">{{ record.afterCityPrice }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 特约价变更后 -->
+        <template slot="afterSpecialPrice" slot-scope="text, record">
+          <span v-if="record.afterSpecialPrice || record.afterSpecialPrice==0" :class="record.beforeSpecialPrice != record.afterSpecialPrice ? 'red' : ''">{{ record.afterSpecialPrice }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 终端价变更后 -->
+        <template slot="afterTerminalPrice" slot-scope="text, record">
+          <span v-if="record.afterTerminalPrice || record.afterTerminalPrice==0" :class="record.beforeTerminalPrice != record.afterTerminalPrice ? 'red' : ''">{{ record.afterTerminalPrice }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 车主价变更后 -->
+        <template slot="afterCarOwnersPrice" slot-scope="text, record">
+          <span v-if="record.afterCarOwnersPrice || record.afterCarOwnersPrice==0" :class="record.beforeCarOwnersPrice != record.afterCarOwnersPrice ? 'red' : ''">{{ record.afterCarOwnersPrice }}</span>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -127,6 +130,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -283,8 +287,10 @@ export default {
       const _this = this
       const params = this.queryParam
       this.exportLoading = true
+      _this.spinning = true
       productPriceChangeExport(params).then(res => {
         this.exportLoading = false
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

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

@@ -1,63 +1,79 @@
 <template>
   <a-card size="small" :bordered="false" class="productBrandList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="品牌名称">
-              <a-input id="productBrandList-brandName" v-model.trim="queryParam.brandName" allowClear placeholder="请输入品牌名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="品牌分类">
-              <v-select code="BRAND_TYPE" id="productBrandList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="排序字母">
-              <a-select placeholder="请选择排序字母" id="productBrandList-sortChar" allowClear v-model="queryParam.sortChar">
-                <a-select-option v-for="item in sortCharList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productBrandList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="productBrandList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="productBrandList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ y: tableHeight }"
-      bordered>
-      <!-- 产品图片 -->
-      <template slot="imageUrl" slot-scope="text, record">
-        <img :src="record.imageUrl" width="30" height="30" class="imageUrl" @click="lookPic(record.imageUrl)" />
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productBrandList-edit-btn">编辑</a-button>
-        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="productBrandList-detail-btn">详情</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="productBrandList-del-btn">删除</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="品牌名称">
+                <a-input id="productBrandList-brandName" v-model.trim="queryParam.brandName" allowClear placeholder="请输入品牌名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="品牌分类">
+                <v-select code="BRAND_TYPE" id="productBrandList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="排序字母">
+                <a-select placeholder="请选择排序字母" id="productBrandList-sortChar" allowClear v-model="queryParam.sortChar">
+                  <a-select-option v-for="item in sortCharList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productBrandList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="productBrandList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="productBrandList-add" type="primary" v-if="$hasPermissions('B_productBrand_add')" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        bordered>
+        <!-- 产品图片 -->
+        <template slot="imageUrl" slot-scope="text, record">
+          <img :src="record.imageUrl" width="30" height="30" class="imageUrl" @click="lookPic(record.imageUrl)" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productBrand_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="productBrandList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productBrand_detail')"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="productBrandList-detail-btn">详情</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productBrand_del')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="productBrandList-del-btn">删除</a-button>
+          <span v-if="!$hasPermissions('B_productBrand_edit') && !$hasPermissions('B_productBrand_detail') && !$hasPermissions('B_productBrand_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑产品品牌 -->
     <product-brand-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="$refs.table.refresh()" @close="closeModal" />
     <!-- 查看产品品牌 -->
@@ -86,6 +102,7 @@ export default {
   components: { STable, VSelect, productBrandEditModal, productBrandDetailModal },
   data () {
     return {
+      spinning: false,
       sortCharList: dataList.sortCharList,
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -170,10 +187,14 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productBrandDel({ sn: row.brandSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 52 - 45
src/views/productManagement/productCategory/list.vue

@@ -1,49 +1,52 @@
 <template>
   <a-card size="small" :bordered="false" class="productCategoryList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator-nobor">
-      <a-button id="productCategoryList-add" type="primary" class="button-error" @click="handleAdd()">新增一级分类</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :showPagination="false"
-      :defaultExpandedRowKeys="defaultExpandedRowKeys"
-      :scroll="{ y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          v-if="record.productTypeLevel<3"
-          type="link"
-          class="button-success"
-          size="small"
-          icon="plus"
-          id="productCategory-addSubItem"
-          @click="handleAdd(record)">新增子级</a-button>
-        <a-button
-          v-if="record.pid != 0"
-          type="link"
-          class="button-info"
-          size="small"
-          icon="edit"
-          id="productCategory-edit"
-          @click="handleEdit(record)">编辑</a-button>
-        <a-button
-          v-if="record.pid != 0"
-          type="link"
-          class="button-error"
-          size="small"
-          icon="delete"
-          id="productCategory-del"
-          @click="handleDel(record)">删除</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator-nobor">
+        <a-button id="productCategoryList-add" type="primary" v-if="$hasPermissions('B_productCategory_add')" class="button-error" @click="handleAdd()">新增一级分类</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        :defaultExpandedRowKeys="defaultExpandedRowKeys"
+        :scroll="{ y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            v-if="record.productTypeLevel<3 && $hasPermissions('B_productCategory_add')"
+            type="link"
+            class="button-success"
+            size="small"
+            icon="plus"
+            id="productCategory-addSubItem"
+            @click="handleAdd(record)">新增子级</a-button>
+          <a-button
+            v-if="record.pid != 0 && $hasPermissions('B_productCategory_edit')"
+            type="link"
+            class="button-info"
+            size="small"
+            icon="edit"
+            id="productCategory-edit"
+            @click="handleEdit(record)">编辑</a-button>
+          <a-button
+            v-if="record.pid != 0 && $hasPermissions('B_productCategory_del')"
+            type="link"
+            class="button-error"
+            size="small"
+            icon="delete"
+            id="productCategory-del"
+            @click="handleDel(record)">删除</a-button>
+          <span v-if="!(record.productTypeLevel<3 && $hasPermissions('B_productCategory_add')) && !(record.pid != 0 && $hasPermissions('B_productCategory_edit')) && !(record.pid != 0 && $hasPermissions('B_productCategory_del'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑产品分类 -->
     <product-category-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -57,6 +60,7 @@ export default {
   components: { STable, productCategoryEditModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       formItemLayout: {
         labelCol: { span: 6 },
@@ -122,17 +126,20 @@ export default {
     },
     //  删除
     handleDel (row) {
-      console.log(row)
       const _this = this
       _this.$confirm({
         title: '提示',
         content: '删除后原数据不可恢复,是否删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productTypeDel({ sn: row.productTypeSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 7 - 22
src/views/productManagement/productInfo/detailModal.vue

@@ -22,7 +22,7 @@
         <a-descriptions-item label="产品图片:" :span="2">
           <div style="display: flex;">
             <p class="pic-box" v-for="(item,index) in fileList" :key="index">
-              <img :src="item" title="点击查看大图" class="productPic" @click="getPreview(item)" />
+              <img :src="item.imageUrl" title="点击查看大图" class="productPic" @click="getPreview(item.imageUrl)" />
             </p>
           </div>
           <span v-if="fileList.length == 0">--</span>
@@ -76,26 +76,7 @@ export default {
       detailsData: null, //  详情数据
       previewVisible: false,
       previewImage: '',
-      fileList: [
-        {
-          uid: '-1',
-          name: 'image.png',
-          status: 'done',
-          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-        },
-        {
-          uid: '-2',
-          name: 'image.png',
-          status: 'done',
-          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-        },
-        {
-          uid: '-3',
-          name: 'image.png',
-          status: 'done',
-          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-        }
-      ]
+      fileList: []
     }
   },
   methods: {
@@ -104,7 +85,11 @@ export default {
       productSnDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           this.detailsData = res.data
-          this.fileList = res.data.productMsg ? res.data.productMsg.split(',') : []
+          if (res.data && res.data.productPicList && res.data.productPicList.length > 0) {
+            this.fileList = res.data.productPicList
+          } else {
+            this.fileList = []
+          }
         } else {
           this.detailsData = null
         }

+ 26 - 7
src/views/productManagement/productInfo/edit.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="productInfoEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="productInfoEdit-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
     <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="productInfoEdit-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
       <a-form-model
         id="productInfoEdit-form"
         ref="ruleForm"
@@ -283,7 +283,18 @@ export default {
           const data = res.data
           this.form = Object.assign(this.form, data)
           this.form.productType = [ this.form.productTypeSn1, this.form.productTypeSn2, this.form.productTypeSn3 ]
-          this.$refs.productMsg.setFileList(res.data.productMsg)
+          if (res.data.productPicList && res.data.productPicList.length > 0) {
+            let str = ''
+            res.data.productPicList.map(item => {
+              if (item.imageUrl) {
+                str += item.imageUrl + ','
+              }
+            })
+            str = str.substr(0, str.length - 1)
+            this.$refs.productMsg.setFileList(str)
+          } else {
+            this.$refs.productMsg.setFileList('')
+          }
           this.$refs.editor.setHtml(res.data.description)
           this.$refs.otherDesc.setHtml(res.data.otherDesc)
         } else {
@@ -303,6 +314,14 @@ export default {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.id = _this.$route.params.id ? _this.$route.params.id : undefined
+          form.productPicList = []
+          if (form.productMsg) {
+            const arr = form.productMsg.split(',')
+            arr.map(item => {
+              form.productPicList.push({ imageUrl: item })
+            })
+          }
+          delete form.productMsg
           delete form.productType
           delete form.updateDate
           _this.spinning = true

+ 198 - 153
src/views/productManagement/productInfo/list.vue

@@ -1,173 +1,191 @@
 <template>
   <a-card size="small" :bordered="false" class="productInfoList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码/原厂编码">
-              <a-input id="productInfoList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="品牌">
-              <a-select
-                placeholder="请选择"
-                id="productInfoList-productBrandSn"
-                allowClear
-                v-model="queryParam.productBrandSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  expand-trigger="hover"
-                  change-on-select
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productType" />
+              <a-form-item label="产品名称">
+                <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品状态">
-                <v-select code="PRODUCT_STATUS" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
+              <a-form-item label="产品编码/原厂编码">
+                <a-input id="productInfoList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="定价状态">
-                <v-select code="PRICING_STATUS" id="productInfoList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
+              <a-form-item label="品牌">
+                <a-select
+                  placeholder="请选择"
+                  id="productInfoList-productBrandSn"
+                  allowClear
+                  v-model="queryParam.productBrandSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
-            <a-button
-              style="margin-left: 5px"
-              type="primary"
-              class="button-warning"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              id="productInfoList-export">导出</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="productInfoList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-      <a-button
-        id="productInfoList-batchAudit"
-        type="primary"
-        class="button-warning"
-        :loading="loadingAudit"
-        @click="handleBatchAudit"
-        style="margin: 0 15px;">批量审核</a-button>
-      <a-button
-        id="productInfoList-batchLaunch"
-        type="primary"
-        class="button-primary"
-        :loading="loadingLaunch"
-        @click="handleBatchLaunch"
-        style="margin: 0 15px;">批量上线</a-button>
-      <a-button
-        id="productInfoList-batchDownline"
-        type="primary"
-        class="button-grey"
-        :loading="loadingDownline"
-        @click="handleBatchDownline"
-        style="margin: 0 15px;">批量下线</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
-      </span>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2150, y: tableHeight }"
-      bordered>
-      <!-- 自定义表头 -->
-      <template slot="arrowFalgTitle">
-        <a-tooltip placement="top">
-          <template slot="title">
-            <span>自有即箭冠产品,非自有即非箭冠产品</span>
-          </template>
-          自有<a-icon type="question-circle" :style="{ marginLeft: '10px' }" />
-        </a-tooltip>
-      </template>
-      <template slot="arrowFalg" slot-scope="text, record">
-        <span v-if="record.arrowFalg">{{ record.arrowFalg == 1 ? '是' : '否' }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 产品分类 -->
-      <template slot="productType" slot-scope="text, record">
-        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 定价状态 -->
-      <template slot="pricingState" slot-scope="text, record">
-        <a-badge :color="record.pricingState=='WAIT_PRICING'?'gold':record.pricingState=='WAIT_PRICING_AUDIT'?'volcano':'#87d068'" :text="record.pricingStateDictValue" />
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="productInfoList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品状态">
+                  <v-select code="PRODUCT_STATUS" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="定价状态">
+                  <v-select code="PRICING_STATUS" id="productInfoList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+              <a-button
+                v-if="$hasPermissions('B_productInfo_export')"
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="productInfoList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="productInfoList-add" type="primary" v-if="$hasPermissions('B_productInfo_add')" class="button-error" @click="handleEdit()">新增</a-button>
         <a-button
-          size="small"
-          type="link"
-          v-if="record.state=='WAIT'"
+          id="productInfoList-batchAudit"
+          type="primary"
+          v-if="$hasPermissions('B_productInfo_batchAudit')"
           class="button-warning"
-          @click="handleAudit(record)"
-          id="productInfoList-audit-btn">审核</a-button>
+          :loading="loadingAudit"
+          @click="handleBatchAudit"
+          style="margin: 0 15px;">批量审核</a-button>
         <a-button
-          size="small"
-          type="link"
-          v-if="record.state=='WAIT_ONLINE'||record.state=='OFFLINE'"
+          id="productInfoList-batchLaunch"
+          type="primary"
+          v-if="$hasPermissions('B_productInfo_batchLaunch')"
           class="button-primary"
-          @click="handleLaunch(record)"
-          id="productInfoList-launch-btn">上线</a-button>
+          :loading="loadingLaunch"
+          @click="handleBatchLaunch"
+          style="margin: 0 15px;">批量上线</a-button>
         <a-button
-          size="small"
-          type="link"
-          v-if="record.state=='ONLINE'"
+          id="productInfoList-batchDownline"
+          type="primary"
+          v-if="$hasPermissions('B_productInfo_batchDownline')"
           class="button-grey"
-          @click="handleDownline(record)"
-          id="productInfoList-downline-btn">下线</a-button>
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productInfoList-edit-btn">编辑</a-button>
-        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="productInfoList-detail-btn">详情</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state=='WAIT'"
-          class="button-error"
-          @click="handleDel(record)"
-          id="productInfoList-del-btn">删除</a-button>
-      </template>
-    </s-table>
+          :loading="loadingDownline"
+          @click="handleBatchDownline"
+          style="margin: 0 15px;">批量下线</a-button>
+        <span style="margin-left: 8px" v-if="$hasPermissions('B_productInfo_batchAudit') || $hasPermissions('B_productInfo_batchLaunch') || $hasPermissions('B_productInfo_batchDownline')">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection=" showSelect ?{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }:null"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2150, y: tableHeight }"
+        bordered>
+        <!-- 自定义表头 -->
+        <template slot="arrowFalgTitle">
+          <a-tooltip placement="top">
+            <template slot="title">
+              <span>自有即箭冠产品,非自有即非箭冠产品</span>
+            </template>
+            自有<a-icon type="question-circle" :style="{ marginLeft: '10px' }" />
+          </a-tooltip>
+        </template>
+        <template slot="arrowFalg" slot-scope="text, record">
+          <span v-if="record.arrowFalg">{{ record.arrowFalg == 1 ? '是' : '否' }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 定价状态 -->
+        <template slot="pricingState" slot-scope="text, record">
+          <a-badge :color="record.pricingState=='WAIT_PRICING'?'gold':record.pricingState=='WAIT_PRICING_AUDIT'?'volcano':'#87d068'" :text="record.pricingStateDictValue" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='WAIT' && $hasPermissions('B_productInfo_audit')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="productInfoList-audit-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="(record.state=='WAIT_ONLINE'||record.state=='OFFLINE') && $hasPermissions('B_productInfo_launch')"
+            class="button-primary"
+            @click="handleLaunch(record)"
+            id="productInfoList-launch-btn">上线</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='ONLINE' && $hasPermissions('B_productInfo_downline')"
+            class="button-grey"
+            @click="handleDownline(record)"
+            id="productInfoList-downline-btn">下线</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productInfo_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="productInfoList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productInfo_detail')"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="productInfoList-detail-btn">详情</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='WAIT' && $hasPermissions('B_productInfo_del')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="productInfoList-del-btn">删除</a-button>
+          <span v-if="!(record.state=='WAIT' && $hasPermissions('B_productInfo_audit')) && !((record.state=='WAIT_ONLINE'||record.state=='OFFLINE') && $hasPermissions('B_productInfo_launch')) && !(record.state=='ONLINE' && $hasPermissions('B_productInfo_downline')) && !$hasPermissions('B_productInfo_edit') && !$hasPermissions('B_productInfo_detail') && !(record.state=='WAIT' && $hasPermissions('B_productInfo_del'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 产品详情 -->
     <product-info-detail-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" />
     <!-- 产品下线 -->
@@ -187,6 +205,7 @@ export default {
   components: { STable, VSelect, productInfoDetailModal, productInfoOfflineModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -248,6 +267,10 @@ export default {
   computed: {
     hasSelected () {
       return this.selectedRowKeys.length > 0
+    },
+    // 是否显示table选择框
+    showSelect () {
+      return this.$hasPermissions('B_productInfo_batchAudit') || this.$hasPermissions('B_productInfo_batchLaunch') || this.$hasPermissions('B_productInfo_batchDownline')
     }
   },
   methods: {
@@ -289,10 +312,14 @@ export default {
         content: '确认要审核吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productAudit({ sn: row.productSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -323,6 +350,7 @@ export default {
         centered: true,
         onOk () {
           _this.loadingAudit = true
+          _this.spinning = true
           productBatchAudit(obj).then(res => {
             _this.loadingAudit = false
             if (res.status == 200) {
@@ -330,6 +358,9 @@ export default {
               _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -360,6 +391,7 @@ export default {
         centered: true,
         onOk () {
           _this.loadingLaunch = true
+          _this.spinning = true
           productBatchOnline(obj).then(res => {
             _this.loadingLaunch = false
             if (res.status == 200) {
@@ -367,6 +399,9 @@ export default {
               _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -422,10 +457,14 @@ export default {
         content: '确认要上线吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productOnline({ sn: row.productSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -444,10 +483,14 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productDel({ sn: row.productSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -480,8 +523,10 @@ export default {
       const _this = this
       const params = this.queryParam
       this.exportLoading = true
+      _this.spinning = true
       productExport(params).then(res => {
         this.exportLoading = false
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 79 - 68
src/views/productManagement/productLaunchAudit/list.vue

@@ -1,71 +1,73 @@
 <template>
   <a-card size="small" :bordered="false" class="productLaunchAuditList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productLaunchAuditList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productLaunchAuditList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="审核状态">
-              <v-select
-                v-model="queryParam.state"
-                ref="state"
-                id="productLaunchAuditList-state"
-                code="PRODUCT_ONOFFLINE_STATUS"
-                placeholder="请选择审核状态"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productLaunchAuditList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productLaunchAuditList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <div style="margin-bottom: 15px">
-      <a-button type="primary" id="productLaunchAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
-      </span>
-    </div>
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="rowSelection"
-      :rowKey="(record) => record.productSn"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1510, y: tableHeight }"
-      bordered>
-      <!-- 产品分类 -->
-      <template slot="productType" slot-scope="text, record">
-        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state=='WAIT_ONLINE_AUDIT'"
-          class="button-warning"
-          @click="handleAudit(record)"
-          id="productLaunchAuditList-audit-btn">审核</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="productLaunchAuditList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="productLaunchAuditList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="审核状态">
+                <v-select
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="productLaunchAuditList-state"
+                  code="PRODUCT_ONOFFLINE_STATUS"
+                  placeholder="请选择审核状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productLaunchAuditList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productLaunchAuditList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <div style="margin-bottom: 15px">
+        <a-button type="primary" v-if="$hasPermissions('B_productLaunchAudit_batchAudit')" id="productLaunchAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
+        <span style="margin-left: 8px" v-if="$hasPermissions('B_productLaunchAudit_batchAudit')">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="rowSelection"
+        :rowKey="(record) => record.productSn"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1510, y: tableHeight }"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='WAIT_ONLINE_AUDIT' && $hasPermissions('B_productLaunchAudit_audit')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="productLaunchAuditList-audit-btn">审核</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -76,6 +78,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         name: '', //  名称
         code: '', //  编码
@@ -115,7 +118,7 @@ export default {
       return this.selectedRowKeys.length > 0
     },
     rowSelection () {
-      return {
+      return this.$hasPermissions('B_productLaunchAudit_batchAudit') ? {
         selectedRowKeys: this.selectedRowKeys,
         onChange: (selectedRowKeys, selectedRows) => {
           console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
@@ -126,7 +129,7 @@ export default {
             disabled: record.state != 'WAIT_ONLINE_AUDIT'
           }
         })
-      }
+      } : null
     }
   },
   methods: {
@@ -145,10 +148,14 @@ export default {
         content: '确认要上线审核吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productOnlineAudit({ sn: row.productSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -167,6 +174,7 @@ export default {
         centered: true,
         onOk () {
           _this.loading = true
+          _this.spinning = true
           productBatchOnlineAudit(_this.selectedRowKeys).then(res => {
             _this.loading = false
             if (res.status == 200) {
@@ -174,6 +182,9 @@ export default {
               _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         },

+ 2 - 2
src/views/productManagement/productLevel/editModal.vue

@@ -40,7 +40,7 @@
 
 <script>
 import { VSelect } from '@/components'
-import { productSave } from '@/api/product'
+import { productLevelSave } from '@/api/product'
 export default {
   name: 'ProductLevelEditModal',
   components: { VSelect },
@@ -87,7 +87,7 @@ export default {
           const params = _this.nowData
           params.level = _this.form.level
           _this.spinning = true
-          productSave(params).then(res => {
+          productLevelSave(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {

+ 8 - 1
src/views/productManagement/productLevel/list.vue

@@ -82,7 +82,14 @@
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productLevelList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="$hasPermissions('B_productLevel_edit')"
+          class="button-info"
+          @click="handleEdit(record)"
+          id="productLevelList-edit-btn">编辑</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
     <!-- 编辑价格 -->

+ 113 - 102
src/views/productManagement/productOfflineAudit/list.vue

@@ -1,116 +1,118 @@
 <template>
   <a-card size="small" :bordered="false" class="productOfflineAuditList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productOfflineAuditList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码/通用编码">
-              <a-input id="productOfflineAuditList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码/通用编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="下线选项">
-              <v-select
-                v-model="queryParam.offlineReasonType"
-                ref="offlineReasonType"
-                id="productOfflineAuditList-offlineReasonType"
-                code="OFFLINE_REASON_TYPE"
-                placeholder="请选择下线选项"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="品牌">
-                <a-select
-                  placeholder="请选择"
-                  id="productOfflineAuditList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
+              <a-form-item label="产品名称">
+                <a-input id="productOfflineAuditList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  expand-trigger="hover"
-                  change-on-select
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productOfflineAuditList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productType" />
+              <a-form-item label="产品编码/通用编码">
+                <a-input id="productOfflineAuditList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码/通用编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="审核状态">
+              <a-form-item label="下线选项">
                 <v-select
-                  v-model="queryParam.state"
-                  ref="state"
-                  id="productOfflineAuditList-state"
-                  code="PRODUCT_ONOFFLINE_STATUS"
-                  placeholder="请选择审核状态"
+                  v-model="queryParam.offlineReasonType"
+                  ref="offlineReasonType"
+                  id="productOfflineAuditList-offlineReasonType"
+                  code="OFFLINE_REASON_TYPE"
+                  placeholder="请选择下线选项"
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productOfflineAuditList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productOfflineAuditList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <div style="margin-bottom: 15px">
-      <a-button type="primary" id="productOfflineAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
-      </span>
-    </div>
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="rowSelection"
-      :rowKey="(record) => record.productSn"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2070, y: tableHeight }"
-      bordered>
-      <!-- 产品分类 -->
-      <template slot="productType" slot-scope="text, record">
-        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state=='WAIT_OFFLINE_AUDIT'"
-          class="button-warning"
-          @click="handleAudit(record)"
-          id="productOfflineAuditList-audit-btn">审核</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="品牌">
+                  <a-select
+                    placeholder="请选择"
+                    id="productOfflineAuditList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productBrandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="productOfflineAuditList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="审核状态">
+                  <v-select
+                    v-model="queryParam.state"
+                    ref="state"
+                    id="productOfflineAuditList-state"
+                    code="PRODUCT_ONOFFLINE_STATUS"
+                    placeholder="请选择审核状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productOfflineAuditList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productOfflineAuditList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <div style="margin-bottom: 15px">
+        <a-button type="primary" v-if="$hasPermissions('B_productOfflineAudit_batchAudit')" id="productOfflineAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
+        <span style="margin-left: 8px" v-if="$hasPermissions('B_productOfflineAudit_batchAudit')">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="rowSelection"
+        :rowKey="(record) => record.productSn"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2070, y: tableHeight }"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='WAIT_OFFLINE_AUDIT' && $hasPermissions('B_productOfflineAudit_audit')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="productOfflineAuditList-audit-btn">审核</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -123,6 +125,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
         name: '', //  产品名称
@@ -174,7 +177,7 @@ export default {
       return this.selectedRowKeys.length > 0
     },
     rowSelection () {
-      return {
+      return this.$hasPermissions('B_productOfflineAudit_batchAudit') ? {
         selectedRowKeys: this.selectedRowKeys,
         onChange: (selectedRowKeys, selectedRows) => {
           console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
@@ -185,7 +188,7 @@ export default {
             disabled: record.state != 'WAIT_OFFLINE_AUDIT'
           }
         })
-      }
+      } : null
     }
   },
   methods: {
@@ -215,10 +218,14 @@ export default {
         content: '确认要下线审核通过吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productOfflineAudit({ sn: row.productSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -237,6 +244,7 @@ export default {
         centered: true,
         onOk () {
           _this.loading = true
+          _this.spinning = true
           productBatchOfflineAudit(_this.selectedRowKeys).then(res => {
             _this.loading = false
             if (res.status == 200) {
@@ -244,6 +252,9 @@ export default {
               _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

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

@@ -98,11 +98,12 @@
         <a-button
           size="small"
           type="link"
-          v-if="record.pricingState=='WAIT_PRICING_AUDIT'"
+          v-if="record.pricingState=='WAIT_PRICING_AUDIT' && $hasPermissions('B_productPricing_audit')"
           class="button-warning"
           @click="handleAudit(record)"
           id="productPricingList-audit-btn">审核</a-button>
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productPricingList-edit-btn">编辑</a-button>
+        <a-button size="small" type="link" v-if="$hasPermissions('B_productPricing_edit')" class="button-info" @click="handleEdit(record)" id="productPricingList-edit-btn">编辑</a-button>
+        <span v-if="!(record.pricingState=='WAIT_PRICING_AUDIT' && $hasPermissions('B_productPricing_audit')) && !$hasPermissions('B_productPricing_edit')">--</span>
       </template>
     </s-table>
     <!-- 编辑价格 -->

+ 81 - 61
src/views/productManagement/productUniversal/list.vue

@@ -1,72 +1,87 @@
 <template>
   <a-card size="small" :bordered="false" class="productUniversalList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productUniversalList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productUniversalList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品状态">
-              <v-select code="PRODUCT_STATUS" id="productUniversalList-productState" v-model="queryParam.productState" allowClear placeholder="请选择产品状态"></v-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="通用产品编码">
-                <a-input id="productUniversalList-productCommonCode" v-model.trim="queryParam.productCommonCode" allowClear placeholder="请输入通用产品编码"/>
+              <a-form-item label="产品编码">
+                <a-input id="productUniversalList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="通用产品名称">
-                <a-input id="productUniversalList-productCommonName" v-model.trim="queryParam.productCommonName" allowClear placeholder="请输入通用产品名称"/>
+              <a-form-item label="产品名称">
+                <a-input id="productUniversalList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productUniversalList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productUniversalList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="productUniversalList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1580 }"
-      bordered>
-      <!-- 产品分类 -->
-      <template slot="productType" slot-scope="text, record">
-        <span v-if="record.productCommont.productTypeName2 || record.productCommont.productTypeName3">{{ record.productCommont.productTypeName2 }} {{ record.productCommont.productTypeName3 ? '>' : '' }} {{ record.productCommont.productTypeName3 }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productUniversalList-edit-btn">编辑</a-button>
-        <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="productUniversalList-del-btn">删除</a-button>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品状态">
+                <v-select code="PRODUCT_STATUS" id="productUniversalList-productState" v-model="queryParam.productState" allowClear placeholder="请选择产品状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="通用产品编码">
+                  <a-input id="productUniversalList-productCommonCode" v-model.trim="queryParam.productCommonCode" allowClear placeholder="请输入通用产品编码"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="通用产品名称">
+                  <a-input id="productUniversalList-productCommonName" v-model.trim="queryParam.productCommonName" allowClear placeholder="请输入通用产品名称"/>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productUniversalList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productUniversalList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="productUniversalList-add" type="primary" v-if="$hasPermissions('B_productUniversal_add')" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1580 }"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productCommont.productTypeName2 || record.productCommont.productTypeName3">{{ record.productCommont.productTypeName2 }} {{ record.productCommont.productTypeName3 ? '>' : '' }} {{ record.productCommont.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productUniversal_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="productUniversalList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productUniversal_del')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="productUniversalList-del-btn">删除</a-button>
+          <span v-if="!$hasPermissions('B_productUniversal_edit') && !$hasPermissions('B_productUniversal_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑 -->
     <product-universal-edit-modal :openModal="openModal" :itemId="itemId" @close="closeModal" @ok="$refs.table.refresh()" />
   </a-card>
@@ -81,6 +96,7 @@ export default {
   components: { STable, VSelect, productUniversalEditModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -156,10 +172,14 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           productUniversalCodeDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 17 - 7
src/views/promotionRulesManagement/orderStatistics/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
+              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -77,9 +77,11 @@
         <a-button
           size="small"
           type="link"
+          v-if="$hasPermissions('B_orderStatistics_detail')"
           @click="handleDetail(record)"
           class="button-success"
           id="orderStatisticsList-edit-btn">详情</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
     <!-- 详情 -->
@@ -88,6 +90,8 @@
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
@@ -103,13 +107,17 @@ export default {
       tableHeight: 0,
       // 查询参数
       queryParam: {
-        beginDate: '',
-        endDate: '',
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         buyerSn: undefined,
         promoActiveSn: undefined,
         salesBillNo: '',
         billStatus: undefined
       },
+      time: [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ],
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -184,15 +192,17 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.buyerSn = undefined
       this.queryParam.promoActiveSn = undefined
       this.queryParam.salesBillNo = ''
       this.queryParam.billStatus = undefined
       this.$refs.custList.resetForm()
-      this.$refs.promoList.resetForm()
+      if (this.advanced) {
+        this.$refs.promoList.resetForm()
+      }
       this.$refs.table.refresh(true)
     },
     // 关闭弹框

+ 14 - 6
src/views/promotionRulesManagement/productStatistics/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="统计时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
+              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -82,9 +82,11 @@
         <a-button
           size="small"
           type="link"
+          v-if="$hasPermissions('B_productStatistics_detail')"
           class="button-success"
           @click="handleDetail(record)"
           id="productStatisticsList-detail-btn">详情</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
     <!-- 详情 -->
@@ -93,6 +95,8 @@
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import productStatisticsDetailModal from './detailModal.vue'
@@ -107,8 +111,8 @@ export default {
       tableHeight: 0,
       productType: [],
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productBrandSn: undefined, //  产品品牌
@@ -116,6 +120,10 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
+      time: [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ],
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -160,9 +168,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.productBrandSn = undefined

+ 6 - 6
src/views/promotionRulesManagement/promotionRules/editRuleModal.vue

@@ -8,7 +8,7 @@
     v-model="isShow"
     @cancle="isShow = false"
     :width="960">
-    <a-spin tip="Loading..." :spinning="spinLoading">
+    <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
         id="promotionRules-rule-form"
         ref="ruleForm"
@@ -222,7 +222,7 @@ export default {
       promoGoodsList: [], //  当前已选促销品
       nowChooseGoodsType: '', //  当前选择产品的类型(正价产品/促销品)
       nowData: [], //  选择产品
-      spinLoading: false
+      spinning: false
     }
   },
   computed: {
@@ -328,17 +328,17 @@ export default {
             form.promoAmountPer = ''
           }
           if (!_this.itemSn) { delete form.id }
-          _this.spinLoading = true
+          _this.spinning = true
           promoRuleSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
                 _this.$emit('ok')
-                _this.spinLoading = false
                 _this.isShow = false
+                _this.spinning = false
               }, 1000)
-            }else{
-              _this.spinLoading = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 95 - 86
src/views/promotionRulesManagement/promotionRules/list.vue

@@ -1,91 +1,96 @@
 <template>
   <a-card size="small" :bordered="false" class="promotionRulesList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="促销名称">
-              <a-input id="promotionRulesList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入促销名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="状态">
-              <v-select code="ENABLE_FLAG" id="promotionRulesList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="promotionRulesList-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
-    </div>
-    <!-- 总计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计: <strong>{{ total }}</strong>条</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1440, y: tableHeight }"
-      bordered>
-      <!-- 促销时间 -->
-      <template slot="activeDate" slot-scope="text, record">
-        <div v-if="record.activeDateEnable != '0'">
-          <span v-if="record.activeDateStart || record.activeDateEnd">{{ record.activeDateStart }} 至 {{ record.activeDateEnd }}</span>
-          <span v-else>--</span>
-        </div>
-        <span v-else>不限</span>
-      </template>
-      <!-- 状态 -->
-      <template slot="enabledFlag" slot-scope="text, record">
-        <a-switch
-          id="promotionRulesList-enable"
-          checkedChildren="启用"
-          unCheckedChildren="禁用"
-          @change="changeStatus(record)"
-          :checked="record.enabledFlag == 1 ? true : false" />
-        <!-- <span v-else :style="{color:(record.enabledFlag==1?'#00aa00':'#999')}"> {{ record.enabledFlag==1? '已启用': '已禁用' }} </span> -->
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.enabledFlag != 1"
-          class="button-primary"
-          @click="handleRule(record)"
-          id="promotionRulesList-rule-btn">规则设置</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.enabledFlag != 1"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="promotionRulesList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-success"
-          @click="handleDetail(record)"
-          id="promotionRulesList-detail-btn">详情</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="促销名称">
+                <a-input id="promotionRulesList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入促销名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <v-select code="ENABLE_FLAG" id="promotionRulesList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="promotionRulesList-add" type="primary" v-if="$hasPermissions('B_promotionRules_add')" class="button-error" @click="openModal=true">新增</a-button>
+      </div>
+      <!-- 总计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">合计: <strong>{{ total }}</strong>条</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1440, y: tableHeight }"
+        bordered>
+        <!-- 促销时间 -->
+        <template slot="activeDate" slot-scope="text, record">
+          <div v-if="record.activeDateEnable != '0'">
+            <span v-if="record.activeDateStart || record.activeDateEnd">{{ record.activeDateStart }} 至 {{ record.activeDateEnd }}</span>
+            <span v-else>--</span>
+          </div>
+          <span v-else>不限</span>
+        </template>
+        <!-- 状态 -->
+        <template slot="enabledFlag" slot-scope="text, record">
+          <a-switch
+            v-if="$hasPermissions('B_promotionRules_enable')"
+            id="promotionRulesList-enable"
+            checkedChildren="启用"
+            unCheckedChildren="禁用"
+            @change="changeStatus(record)"
+            :checked="record.enabledFlag == 1 ? true : false" />
+          <span v-else :style="{color:(record.enabledFlag==1?'#00aa00':'#999')}"> {{ record.enabledFlag==1? '已启用': '已禁用' }} </span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.enabledFlag != 1 && $hasPermissions('B_promotionRules_ruleSet')"
+            class="button-primary"
+            @click="handleRule(record)"
+            id="promotionRulesList-rule-btn">规则设置</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.enabledFlag != 1 && $hasPermissions('B_promotionRules_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="promotionRulesList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_promotionRules_detail')"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="promotionRulesList-detail-btn">详情</a-button>
+          <span v-if="!(record.enabledFlag != 1 && $hasPermissions('B_promotionRules_ruleSet')) && !(record.enabledFlag != 1 && $hasPermissions('B_promotionRules_edit')) && !$hasPermissions('B_promotionRules_detail')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增 -->
     <basic-info-modal :openModal="openModal" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -101,6 +106,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
         beginDate: '',
@@ -191,12 +197,15 @@ export default {
         sn: record.promoActiveSn,
         flag: record.enabledFlag == 1 ? '0' : '1'
       }
+      this.spinning = true
       promoActiveEnable(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.table.refresh()
+          this.spinning = false
         } else {
           this.$refs.table.refresh()
+          this.spinning = false
         }
       })
     }

+ 45 - 38
src/views/promotionRulesManagement/promotionRules/rule.vue

@@ -1,44 +1,46 @@
 <template>
   <div class="promotionRulesList-rule-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="promotionRulesList-rule-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="promotionRulesList-rule-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="promotionRulesList-rule-wrap">
-      <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-button id="promotionRulesList-rule-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
-      </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="default"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :showPagination="false"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="promotionRulesList-rule-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-error"
-            @click="handleDel(record)"
-            id="promotionRulesList-rule-del-btn">删除</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="promotionRulesList-rule-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="promotionRulesList-rule-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
-      </s-table>
-      <!-- 新增/编辑 -->
-      <edit-rule-modal :openModal="openModal" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="promotionRulesList-rule-wrap">
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button id="promotionRulesList-rule-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="default"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :showPagination="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              @click="handleEdit(record)"
+              id="promotionRulesList-rule-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+              id="promotionRulesList-rule-del-btn">删除</a-button>
+          </template>
+        </s-table>
+      </a-card></a-spin>
+    <!-- 新增/编辑 -->
+    <edit-rule-modal :openModal="openModal" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
     </a-card>
   </div>
 </template>
@@ -51,6 +53,7 @@ export default {
   components: { STable, VSelect, editRuleModal },
   data () {
     return {
+      spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -108,10 +111,14 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           promoRuleDel({ sn: row.promoRuleSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 78 - 71
src/views/purchasingManagement/bulkWarehousingOrder/edit.vue

@@ -1,78 +1,80 @@
 <template>
   <div class="bulkWarehousingOrderEdit-wrap">
-    <!-- 内容 -->
-    <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderEdit-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <!-- <template slot="extra">
-        <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn">快速打印</a-button>
-      </template> -->
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            基础信息
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 内容 -->
+      <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderEdit-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <!-- <template slot="extra">
+          <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn">打印预览</a-button>
+          <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn">快速打印</a-button>
+        </template> -->
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              基础信息
+            </template>
+            <a-descriptions :column="3">
+              <a-descriptions-item label="供应商">{{ (productTotal&&productTotal.supplierName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="入库类型">{{ (productTotal&&productTotal.sparePartsTypeDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="入库单号">{{ (productTotal&&productTotal.sparePartsNo) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button id="bulkWarehousingOrderEdit-add" type="primary" class="button-error" @click="handleEdit()">新增产品</a-button>
+        </div>
+        <!-- 总计 -->
+        <a-alert type="info" showIcon style="margin-bottom:15px">
+          <div slot="message">入库数量 <strong>{{ (productTotal&&productTotal.totalQty) || 0 }}</strong> ,入库金额 <strong>{{ (productTotal&&productTotal.totalPrice) || 0 }}</strong></div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              @click="handleEdit(record)"
+              class="button-info"
+              id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              @click="handleDel(record)"
+              class="button-error"
+              id="bulkWarehousingOrderList-del-btn">删除</a-button>
           </template>
-          <a-descriptions :column="3">
-            <a-descriptions-item label="供应商">{{ (productTotal&&productTotal.supplierName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="入库类型">{{ (productTotal&&productTotal.sparePartsTypeDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="入库单号">{{ (productTotal&&productTotal.sparePartsNo) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
-      <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-button id="bulkWarehousingOrderEdit-add" type="primary" class="button-error" @click="handleEdit()">新增产品</a-button>
-      </div>
-      <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">入库数量 <strong>{{ (productTotal&&productTotal.totalQty) || 0 }}</strong> ,入库金额 <strong>{{ (productTotal&&productTotal.totalPrice) || 0 }}</strong></div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            @click="handleEdit(record)"
-            class="button-info"
-            id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
+        </s-table>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
           <a-button
-            size="small"
-            type="link"
-            @click="handleDel(record)"
-            class="button-error"
-            id="bulkWarehousingOrderList-del-btn">删除</a-button>
-        </template>
-      </s-table>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="bulkWarehousingOrderEdit-submit"
-          size="large"
-          class="button-primary"
-          @click="handleBack"
-          style="padding: 0 60px;">保存并返回</a-button>
-      </div>
-    </a-affix>
+            type="primary"
+            id="bulkWarehousingOrderEdit-submit"
+            size="large"
+            class="button-primary"
+            @click="handleBack"
+            style="padding: 0 60px;">保存并返回</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <spare-parts-product-modal :openModal="openModal" :itemSn="itemSn" :nowData="productTotal" @ok="$refs.table.refresh(true)" @close="closeModal" />
   </div>
 </template>
@@ -86,6 +88,7 @@ export default {
   components: { STable, VSelect, sparePartsProductModal },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -136,10 +139,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           sparePartsDeleteDetail({ sn: row.sparePartsDetailSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 102 - 85
src/views/purchasingManagement/bulkWarehousingOrder/list.vue

@@ -1,80 +1,83 @@
 <template>
   <a-card size="small" :bordered="false" class="bulkWarehousingOrderList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="关联单号">
-              <a-input id="bulkWarehousingOrderList-relationNo" v-model.trim="queryParam.relationNo" allowClear placeholder="请输入关联单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons" style="margin-top: 3px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkWarehousingOrderList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="bulkWarehousingOrderList-reset">重置</a-button>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
-      <a-button
-        id="bulkWarehousingOrderList-batchAudit"
-        type="primary"
-        class="button-warning"
-        :loading="loading"
-        @click="handleBatchAudit"
-        style="margin: 0 15px;">批量审核</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
-      </span>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="rowSelection"
-      :rowKey="(record) => record.sparePartsSn"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1960, y: tableHeight }"
-      bordered>
-      <!-- 入库单号 -->
-      <template slot="sparePartsNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.sparePartsNo }}</span>
-      </template>
-      <!-- 财务状态 -->
-      <template slot="settleState" slot-scope="text, record">
-        <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.settleStateDictValue" />
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关联单号">
+                <a-input id="bulkWarehousingOrderList-relationNo" v-model.trim="queryParam.relationNo" allowClear placeholder="请输入关联单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons" style="margin-top: 3px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkWarehousingOrderList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="bulkWarehousingOrderList-reset">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button v-if="$hasPermissions('B_sparePartsNew')" id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
         <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          @click="handleEdit(record)"
-          class="button-info"
-          id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          @click="handleDel(record)"
-          class="button-error"
-          id="bulkWarehousingOrderList-del-btn">删除</a-button>
-        <span v-if="record.state != 'WAIT_AUDIT'">--</span>
-      </template>
-    </s-table>
+          v-if="$hasPermissions('B_sparePartsAudit')"
+          id="bulkWarehousingOrderList-batchAudit"
+          type="primary"
+          class="button-warning"
+          :loading="loading"
+          @click="handleBatchAudit"
+          style="margin: 0 15px;">批量审核</a-button>
+        <span style="margin-left: 8px">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="rowSelection"
+        :rowKey="(record) => record.sparePartsSn"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1960, y: tableHeight }"
+        bordered>
+        <!-- 入库单号 -->
+        <template slot="sparePartsNo" slot-scope="text, record">
+          <span :class="$hasPermissions('B_sparePartsDetail')?'active':'common'" @click="handleDetail(record)">{{ record.sparePartsNo }}</span>
+        </template>
+        <!-- 财务状态 -->
+        <template slot="settleState" slot-scope="text, record">
+          <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.settleStateDictValue" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_sparePartsEdit')"
+            @click="handleEdit(record)"
+            class="button-info"
+            id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_sparePartsDel')"
+            @click="handleDel(record)"
+            class="button-error"
+            id="bulkWarehousingOrderList-del-btn">删除</a-button>
+          <span v-if="record.state != 'WAIT_AUDIT'||(!$hasPermissions('B_sparePartsEdit') && !$hasPermissions('B_sparePartsDel'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 选择基本信息弹框 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
     <sparePartsDetailModal :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
@@ -90,6 +93,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, sparePartsDetailModal },
   data () {
     return {
+      spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 基本信息弹框是否显示
       tableHeight: 0,
@@ -140,17 +144,21 @@ export default {
       return this.selectedRowKeys.length > 0
     },
     rowSelection () {
-      return {
-        selectedRowKeys: this.selectedRowKeys,
-        onChange: (selectedRowKeys, selectedRows) => {
-          console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
-          this.onSelectChange(selectedRowKeys)
-        },
-        getCheckboxProps: record => ({
-          props: {
-            disabled: record.state != 'WAIT_AUDIT'
-          }
-        })
+      if (this.$hasPermissions('B_sparePartsAudit')) {
+        return {
+			  selectedRowKeys: this.selectedRowKeys,
+			  onChange: (selectedRowKeys, selectedRows) => {
+			    console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+			    this.onSelectChange(selectedRowKeys)
+			  },
+			  getCheckboxProps: record => ({
+			    props: {
+			      disabled: record.state != 'WAIT_AUDIT'
+			    }
+			  })
+        }
+      } else {
+        return null
       }
     }
   },
@@ -173,6 +181,7 @@ export default {
     },
     //  详情
     handleDetail (row) {
+      if (!this.$hasPermissions('B_sparePartsDetail')) { return }
       this.itemSn = row.sparePartsSn
       this.openDetailModal = true
     },
@@ -189,10 +198,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           sparePartsDelete({ sn: row.sparePartsSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -216,12 +229,16 @@ export default {
         content: '确认要批量审核吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           sparePartsAudit(_this.selectedRowKeys).then(res => {
             if (res.status == 200) {
               _this.selectedRowKeys = []
               _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 249 - 340
src/views/reportData/actualSalesReport/list.vue

@@ -1,176 +1,169 @@
 <template>
-  <a-card size="small" :bordered="false" class="shortageStatisticsCList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售日期">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户类型">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="actualSalesReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="actualSalesReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              <a-form-model-item label="销售日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <custList id="actualSalesReportList-allocateTypeSn" ref="custList" @change="custChange"></custList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户类型">
+                <v-select
+                  v-model="queryParam.dealer.dealerLevel"
+                  ref="dealerLevel"
+                  id="actualSalesReportList-allocateTypeSn"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择客户类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="actualSalesReportList-allocateTypeSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <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-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-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-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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="actualSalesReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="actualSalesReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :defaultLoadData="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 3120 }"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
               <a-row>
-                <a-form-item label="地区">
-                  <a-col span="7">
-                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerProvinceSn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCitySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCitySn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCountySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCountySn" 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-item>
-                  </a-col>
-                </a-form-item>
+                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? totalData.jpLqqAmount : '--' }}</a-col>
+                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</a-col>
+                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">稳升:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <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-row>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2880, y: tableHeight }"
-      bordered>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
+import { salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
 export default {
-  components: { STable, VSelect, custList, subarea, rangeDate },
+  components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        buyerSn: undefined,
-        subareaSn: undefined, //  区域
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        dealer: {
+          'dealerSn': undefined,
+          'provinceSn': undefined,
+          'citySn': undefined,
+          'districtSn': undefined,
+          'subareaSn': undefined,
+          'dealerLevel': undefined
+        }
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      time: [], //  创建时间
+      exportLoading: false,
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '区域',
-          dataIndex: 'area',
-          width: 150,
-          align: 'center',
-          customRender: (text, row, index) => {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 4
-                }
-              }
-            }
-            return text
-          }
-        },
-        { title: '省份',
-          dataIndex: 'provinceName',
-          width: 150,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户名称',
-          dataIndex: 'custName',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户类型',
-          dataIndex: 'custType',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌',
           align: 'center',
           children: [
@@ -180,38 +173,38 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp1',
+                  dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp2',
+                  dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
-                  dataIndex: 'pp3',
+                  dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'pp4',
-                  align: 'center',
+                  align: 'jpScpAmount',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
-                  dataIndex: 'pp5',
+                  dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -221,54 +214,54 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp6',
+                  dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp7',
+                  dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp8',
+                  dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
             {
               title: '汇箭',
-              dataIndex: 'pp9',
+              dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
-              dataIndex: 'pp10',
+              dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
-              dataIndex: 'pp11',
+              dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
-              dataIndex: 'pp12',
+              dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -276,185 +269,149 @@ export default {
           children: [
             {
               title: 'NGK',
-              dataIndex: 'pp13',
+              dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
-              dataIndex: 'pp14',
+              dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
-              dataIndex: 'pp15',
+              dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
-              dataIndex: 'pp16',
+              dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
-              dataIndex: 'pp17',
+              dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
-              dataIndex: 'pp18',
+              dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
-              dataIndex: 'pp19',
+              dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '实销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } }
+        { title: '实销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // this.disabled = true
-        // if (this.tableHeight == 0) {
-        //   this.tableHeight = window.innerHeight - 380
-        // }
-        // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        // const params = Object.assign(parameter, this.queryParam) //  无分页
-        // return oosBuyerList(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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [{
-              area: 'A区',
-              provinceName: '广东省',
-              custName: '支持省级',
-              custType: '省级服务中心',
-              pp1: '125.02',
-              pp2: '73.00',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '0',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '198.02'
-            },
-            {
-              area: '合计',
-              provinceName: '合计',
-              custName: '合计',
-              custType: '合计',
-              pp1: '125.02',
-              pp2: '73.00',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '0',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '198.02'
-            }],
-            count: 1
-          }
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
-      productType: [],
-      productTotal: null,
-      currentTotal: null
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesBillRealReportCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    custChange (obj) {
-      this.queryParam.buyerSn = obj.key
+    custChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      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.totalData = null
+      this.$refs.rangeDate.resetDate()
+      this.$refs.custList.resetForm()
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.provinceName = this.addrProvinceList[index].name
-      }
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.cityName = this.addrCityList[index].name
-      }
       this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCountySn = undefined
       this.getArea('district', val)
     },
-    // 区县变更
-    areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.districtName = this.addrDistrictList[index].name
-      }
-      this.queryParam.address = ''
-    },
     //  省/市/区
     getArea (leve, sn) {
       let params
@@ -482,54 +439,6 @@ export default {
           }
         }
       })
-    },
-    //  重置
-    resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerSn = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.productName = ''
-      this.queryParam.productCode = ''
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.queryParam.salesBillNo = ''
-      this.productType = []
-      this.$refs.table.refresh(true)
-    },
-    // 详情
-    handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
-    },
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      this.exportLoading = true
-      oosDetailExport(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      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 = '缺货统计(按客户)' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 417 - 227
src/views/reportData/allocationDetails/list.vue

@@ -1,278 +1,468 @@
 <template>
-  <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调拨开单日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调拨单号">
-              <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="allocationDetailsList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="allocationDetailsList-form"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+              <a-form-model-item label="调拨开单日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="省份">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="allocationDetailsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="排序">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择排序" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="品牌分类">
+                <v-select code="BRAND_TYPE" id="allocationDetailsList-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="操作员">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择操作员" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <template v-if="advanced">
+              <a-col :md="7" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择"
+                    id="allocationDetailsList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productBrandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input id="allocationDetailsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="调拨类型名称">
+                  <a-select id="allocationDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型名称" allowClear >
+                    <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="操作员">
+                  <a-select id="allocationDetailsList-creatorId" v-model="queryParam.creatorId" placeholder="请选择操作员" allowClear >
+                    <a-select-option v-for="item in operatorList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="调拨单号">
+                  <a-input id="allocationDetailsList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="allocationDetailsList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <a-input id="allocationDetailsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户级别">
+                  <v-select code="DEALER_LEVEL" id="allocationDetailsList-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择客户级别"></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="allocationDetailsList-subarea" v-model="queryParam.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                  <a-form-model-item prop="dealerProvinceSn">
+                    <a-select id="allocationDetailsList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省">
+                      <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="8" :sm="24" style="margin-top: 3px;">
+              <a-button
+                style="margin-bottom: 18px;"
+                type="primary"
+                class="button-warning"
+                size="small"
+                @click="handleStock"
+                id="allocationDetailsList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin: 0 0 18px 8px" type="primary" @click="handleSearch" :disabled="disabled" id="allocationDetailsList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="allocationDetailsList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="allocationDetailsList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品名称">
-                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-              </a-form-item>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        :scroll="{ x: 3430 }"
+        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="6" :sm="24">
-              <a-form-item label="客户名称">
-                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
-                <a-select
-                  placeholder="请选择"
-                  id="productPricingList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="客户级别">
-                <a-select
-                  placeholder="请选择"
-                  id="productPricingList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="品牌类别">
-                <v-select code="BRAND_TYPE" id="productBrandList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              总售价:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="二级分类">
-                <a-select
-                  placeholder="请选择"
-                  id="productPricingList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="三级分类">
-                <a-select
-                  placeholder="请选择"
-                  id="productPricingList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="盘点区间日期">
-                <a-checkbox @change="onChange"></a-checkbox>
-              </a-form-item>
-            </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2960 }"
-      bordered>
-      <template slot="footer" slot-scope="currentPageData">
-        <a-row :gutter="15">
-          <a-col :md="4" :sm="24">
-            总数量:263320
-          </a-col>
-          <a-col :md="4" :sm="24">
-            总进价:1,827,311.38
-          </a-col>
-          <a-col :md="4" :sm="24">
-            总毛利:1187.11
-          </a-col>
-          <a-col :md="4" :sm="24">
-            总售价:2,233,739.75
-          </a-col>
-        </a-row>
-      </template>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import subarea from '@/views/common/subarea.js'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { getArea } from '@/api/data'
+import { allocateTypeAllList } from '@/api/allocateType'
+import { userQueryList } from '@/api/power-user'
+import { allocateReportDetailList, allocateReportDetailCount, allocateReportDetailExport } from '@/api/allocateReport'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, subarea },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
+      exportLoading: false,
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        productName: '',
+        productBrandTypeSn: undefined,
+        productBrandSn: undefined, //  产品品牌
+        productCode: '',
         allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        creatorId: undefined,
+        allocateNo: '',
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        dealerName: '',
+        dealerLevel: undefined,
+        subareaSn: undefined,
+        dealerProvinceSn: undefined
+      },
+      productType: [],
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkVal: '',
-      reportData: reportData.reportDataList,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '区域', dataIndex: 'data1', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨单号', dataIndex: 'data2', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '调拨开单日期', dataIndex: 'data3', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'data4', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户名称', dataIndex: 'data5', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, ellipsis: true },
-        { title: '客户类型', dataIndex: 'data6', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '品牌', dataIndex: 'data7', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, ellipsis: true },
-        { title: '二级类别', dataIndex: 'data8', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '产品名称', dataIndex: 'data9', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'data10', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调拨数量', dataIndex: 'data11', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'data12', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '进价', dataIndex: 'data13', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'data14', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总进价', dataIndex: 'data15', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'data16', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库', dataIndex: 'data17', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓位', dataIndex: 'data18', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'data19', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调拨类型', dataIndex: 'data20', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '区域', dataIndex: 'subareaNames', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨单号', dataIndex: 'allocateNo', width: 220, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '调拨开单日期', dataIndex: 'allocateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerProvinceName', width: 200, 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: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '调拨数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本价', dataIndex: 'totalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '毛利', dataIndex: 'grossProfit', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '操作员', dataIndex: 'creatorName', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = 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
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: reportData.allocationDetailsList,
-            count: 10
-          }
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
-          }
-          _this.disabled = false
-          resolve(data)
-        })
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        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
+            }
+            this.disabled = false
+            this.spinning = false
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            _this.spinning = false
+            _this.$message.info('请选择调拨开单日期')
+            resolve(data)
+          })
+        }
       },
       allocateTypeList: [], //  调拨类型
-      openModal: false //  新增编辑  弹框
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [], //  分类下拉数据
+      operatorList: [], //  操作员下拉数据
+      addrProvinceList: [], //  省下拉
+      totalData: null //  合计
     }
   },
   methods: {
-    handleFooterShow (currentPageData) {
-      console.log(currentPageData, '[=currentPageData]')
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    // 选择盘点日期
-    onChange (e) {
-      console.log(e)
-      // this.checkVal
+    // 合计
+    getCount (params) {
+      allocateReportDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     },
-
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.productName = ''
+      this.queryParam.productBrandTypeSn = undefined
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productCode = ''
       this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
+      this.queryParam.creatorId = undefined
       this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      _this.spinning = true
+      allocateReportDetailExport(params).then(res => {
+        this.exportLoading = false
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    download (data) {
+      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 = '调拨明细报表' + a
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    //  产品品牌  列表
+    getProductBrand () {
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
+    },
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    //  调拨类型
+    getAllocateTypeAllList () {
+      allocateTypeAllList().then(res => {
+        if (res.status == 200) {
+          this.allocateTypeList = res.data
+        } else {
+          this.allocateTypeList = []
+        }
+      })
+    },
+    // 操作员
+    getUserList () {
+      userQueryList({}).then(res => {
+        if (res.status == 200) {
+          this.operatorList = res.data
+        } else {
+          this.operatorList = []
+        }
+      })
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      vm.getProductBrand()
+      vm.getProductType()
+      vm.getAllocateTypeAllList()
+      vm.getUserList()
+      vm.getArea('province')
+    })
   }
 }
 </script>

+ 190 - 133
src/views/reportData/allocationOrderTotal/list.vue

@@ -1,179 +1,236 @@
 <template>
-  <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调拨开单日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调拨单号">
-              <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="操作员">
-              <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
-                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="调拨类型">
-                <a-select
-                  placeholder="请选择"
-                  id="productPricingList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+  <a-card size="small" :bordered="false" class="allocationOrderTotalList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="allocationOrderTotalList-form"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="7" :sm="24">
+              <a-form-model-item label="调拨开单日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="调拨单号">
+                <a-input id="allocationOrderTotalList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="操作员">
+                <a-select id="allocationOrderTotalList-creatorId" v-model="queryParam.creatorId" placeholder="请选择操作员" allowClear >
+                  <a-select-option v-for="item in operatorList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="调拨类别">
+                  <v-select code="ALLOCATE_CATEGORY" id="allocationOrderTotalList-allocateCategory" v-model="queryParam.allocateCategory" allowClear placeholder="请选择调拨类别"></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="调拨类型名称">
+                  <a-select id="allocationOrderTotalList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型名称" allowClear >
+                    <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="7" :sm="24" style="margin-top: 3px;">
+              <a-button
+                style="margin-bottom: 18px;"
+                type="primary"
+                class="button-warning"
+                size="small"
+                @click="handleStock"
+                id="allocationOrderTotalList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin: 0 0 18px 8px" type="primary" @click="handleSearch" :disabled="disabled" id="allocationOrderTotalList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="allocationOrderTotalList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        :scroll="{ x: 1140 }"
+        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="6" :sm="24">
-              <a-form-item label="盘点区间日期">
-                <a-checkbox @change="onChange"></a-checkbox>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              总成本价:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1140 }"
-      bordered>
-      <template slot="footer" slot-scope="currentPageData">
-        <a-row :gutter="15">
-          <a-col :md="4" :sm="24">
-            总数量:752325
-          </a-col>
-          <a-col :md="4" :sm="24">
-            总进价:4,405,812.22
-          </a-col>
-          <a-col :md="4" :sm="24">
-            总毛利:-4,405,812.22
-          </a-col>
-        </a-row>
-      </template>
-    </s-table>
+            <a-col :md="4" :sm="24">
+              总毛利:{{ (totalData && (totalData.totalGrossProfit || totalData.totalGrossProfit==0)) ? totalData.totalGrossProfit : '--' }}
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { allocateTypeAllList } from '@/api/allocateType'
+import { userQueryList } from '@/api/power-user'
+import { allocateReportList, allocateReportCount } from '@/api/allocateReport'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        allocateNo: '',
+        creatorId: undefined,
+        allocateCategory: undefined,
+        allocateTypeSn: undefined
+      },
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkVal: '',
-      reportData: reportData.reportDataList,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '调拨单号', dataIndex: 'data1', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨开单日期', dataIndex: 'data2', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'data3', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调拨数量', dataIndex: 'data4', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '进价', dataIndex: 'data5', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'data6', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'data7', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '调拨单号', dataIndex: 'allocateNo', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨开单日期', dataIndex: 'allocateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'targetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨数量', dataIndex: 'totalQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'totalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '毛利', dataIndex: 'grossProfit', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'creatorName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = 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
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: reportData.allocationOrderTotalList,
-            count: 10
-          }
+        const params = Object.assign(parameter, this.queryParam)
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
       allocateTypeList: [], //  调拨类型
-      openModal: false //  新增编辑  弹框
+      operatorList: [], //  操作员下拉数据
+      totalData: null //  合计
     }
   },
   methods: {
-    handleFooterShow (currentPageData) {
-      console.log(currentPageData, '[=currentPageData]')
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    // 选择盘点日期
-    onChange (e) {
-      console.log(e)
-      // this.checkVal
+    // 合计
+    getCount (params) {
+      allocateReportCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     },
-
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.creatorId = undefined
+      this.queryParam.allocateCategory = undefined
+      this.queryParam.allocateTypeSn = undefined
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    //  调拨类型
+    getAllocateTypeAllList () {
+      allocateTypeAllList().then(res => {
+        if (res.status == 200) {
+          this.allocateTypeList = res.data
+        } else {
+          this.allocateTypeList = []
+        }
+      })
+    },
+    // 操作员
+    getUserList () {
+      userQueryList({}).then(res => {
+        if (res.status == 200) {
+          this.operatorList = res.data
+        } else {
+          this.operatorList = []
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      vm.getAllocateTypeAllList()
+      vm.getUserList()
+    })
   }
 }
 </script>

+ 244 - 360
src/views/reportData/billingReturnReport/list.vue

@@ -1,176 +1,172 @@
 <template>
-  <a-card size="small" :bordered="false" class="shortageStatisticsCList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售日期">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户类型">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="billingReturnReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="returnSlipReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              <a-form-model-item label="销售日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <custList id="billingReturnReportList-custList" ref="custList" @change="custChange"></custList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户类型">
+                <v-select
+                  v-model="queryParam.dealer.dealerLevel"
+                  ref="dealerLevel"
+                  id="billingReturnReportList-dealerLevel"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择客户类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <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>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <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-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-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-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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="billingReturnReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="billingReturnReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 3020, y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
               <a-row>
-                <a-form-item label="地区">
-                  <a-col span="7">
-                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerProvinceSn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCitySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCitySn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCountySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCountySn" 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-item>
-                  </a-col>
-                </a-form-item>
+                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? totalData.jpLqqAmount : '--' }}</a-col>
+                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</a-col>
+                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">稳升:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <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-row>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2880, y: tableHeight }"
-      bordered>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
+import { salesReportReturnList, salesReportReturnCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        buyerSn: undefined,
-        subareaSn: undefined, //  区域
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        dealer: {
+          'dealerSn': undefined,
+          'provinceSn': undefined,
+          'citySn': undefined,
+          'districtSn': undefined,
+          'subareaSn': undefined,
+          'dealerLevel': undefined
+        }
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      time: [], //  创建时间
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '区域',
-          dataIndex: 'area',
-          width: 150,
-          align: 'center',
-          customRender: (text, row, index) => {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 4
-                }
-              }
-            }
-            return text
-          }
-        },
-        { title: '省份',
-          dataIndex: 'provinceName',
-          width: 150,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户名称',
-          dataIndex: 'custName',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户类型',
-          dataIndex: 'custType',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌',
           align: 'center',
           children: [
@@ -180,38 +176,38 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp1',
+                  dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp2',
+                  dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
-                  dataIndex: 'pp3',
+                  dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp4',
+                  dataIndex: 'jpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
-                  dataIndex: 'pp5',
+                  dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -221,54 +217,54 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp6',
+                  dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp7',
+                  dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp8',
+                  dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
             {
               title: '汇箭',
-              dataIndex: 'pp9',
+              dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
-              dataIndex: 'pp10',
+              dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
-              dataIndex: 'pp11',
+              dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
-              dataIndex: 'pp12',
+              dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -276,211 +272,147 @@ export default {
           children: [
             {
               title: 'NGK',
-              dataIndex: 'pp13',
+              dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
-              dataIndex: 'pp14',
+              dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
-              dataIndex: 'pp15',
+              dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
-              dataIndex: 'pp16',
+              dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
-              dataIndex: 'pp17',
+              dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
-              dataIndex: 'pp18',
+              dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
-              dataIndex: 'pp19',
+              dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '开单退货合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } }
+        { title: '开单退货合计金额', width: 200, dataIndex: 'sumAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // this.disabled = true
-        // if (this.tableHeight == 0) {
-        //   this.tableHeight = window.innerHeight - 380
-        // }
-        // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        // const params = Object.assign(parameter, this.queryParam) //  无分页
-        // return oosBuyerList(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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [{
-              area: 'A区',
-              provinceName: '广东省',
-              custName: '剪冠汽配佛山白坭店',
-              custType: '省级服务中心',
-              pp1: '0',
-              pp2: '0',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '37.00',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '37.00'
-            },
-            {
-              area: 'A区',
-              provinceName: '广东省',
-              custName: '支持省级',
-              custType: '省级服务中心',
-              pp1: '0',
-              pp2: '36.50',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '0',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '36.50'
-            },
-            {
-              area: '合计',
-              provinceName: '合计',
-              custName: '合计',
-              custType: '合计',
-              pp1: '0',
-              pp2: '36.50',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '37.00',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '73.50'
-            }],
-            count: 1
-          }
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
       productType: [],
-      productTotal: null,
-      currentTotal: null
+      totalData: null
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesReportReturnCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    custChange (obj) {
-      this.queryParam.buyerSn = obj.key
+    custChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      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.totalData = null
+      this.$refs.custList.resetForm()
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.provinceName = this.addrProvinceList[index].name
-      }
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.cityName = this.addrCityList[index].name
-      }
       this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCountySn = undefined
       this.getArea('district', val)
     },
-    // 区县变更
-    areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.districtName = this.addrDistrictList[index].name
-      }
-      this.queryParam.address = ''
-    },
     //  省/市/区
     getArea (leve, sn) {
       let params
@@ -508,54 +440,6 @@ export default {
           }
         }
       })
-    },
-    //  重置
-    resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerSn = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.productName = ''
-      this.queryParam.productCode = ''
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.queryParam.salesBillNo = ''
-      this.productType = []
-      this.$refs.table.refresh(true)
-    },
-    // 详情
-    handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
-    },
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      this.exportLoading = true
-      oosDetailExport(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      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 = '缺货统计(按客户)' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 25 - 12
src/views/reportData/districtTypeSalesDetails/list.vue

@@ -2,19 +2,19 @@
   <a-card size="small" :bordered="false" class="districtTypeSalesDetailsList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model layout="inline" ref="ruleForm" :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="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
+            <a-form-model-item label="创建时间" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="districtTypeSalesDetailsList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="districtTypeSalesDetailsList-reset">重置</a-button>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
     <!-- 列表 -->
     <s-table
@@ -34,6 +34,7 @@
 import { STable, VSelect } from '@/components'
 import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
+import getDate from '@/libs/getDate.js'
 // import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
 // import { allocateTypeAllList } from '@/api/allocateType'
 export default {
@@ -43,8 +44,12 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
         allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
@@ -52,6 +57,9 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
+      rules: {
+        'time': [{ required: true, message: '请选择创建时间', trigger: 'change' }]
+      },
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '区域', dataIndex: 'area', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
@@ -116,14 +124,19 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined

+ 360 - 144
src/views/reportData/nationalCustomerCostStatistics/list.vue

@@ -2,173 +2,389 @@
   <a-card size="small" :bordered="false" class="nationalCustomerCostStatisticsList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model layout="inline" ref="ruleForm" :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="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
+            <a-form-model-item label="创建时间" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="区域">
-              <a-select id="nationalCustomerCostStatisticsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
-                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+            <a-form-model-item label="区域">
+              <a-select id="nationalCustomerCostStatisticsList-allocateTypeSn" v-model="queryParam.allocateTypeSn"
+                placeholder="请选择区域" allowClear>
+                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn"
+                  :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
               </a-select>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="省份">
-              <a-select id="nationalCustomerCostStatisticsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
-                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+            <a-form-model-item label="省份">
+              <a-select id="nationalCustomerCostStatisticsList-state" v-model="queryParam.state" placeholder="请选择省份"
+                allowClear>
+                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn"
+                  :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
               </a-select>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="nationalCustomerCostStatisticsList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="nationalCustomerCostStatisticsList-reset">重置</a-button>
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled"
+              id="nationalCustomerCostStatisticsList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled"
+              id="nationalCustomerCostStatisticsList-reset">重置</a-button>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
     <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :showPagination="false"
-      :data="loadData"
-      :scroll="{ x: 2920 }"
-      bordered>
+    <s-table class="sTable" ref="table" size="small" :rowKey="(record) => record.id" :columns="columns"
+      :showPagination="false" :data="loadData" :scroll="{ x: 2920 }" bordered>
     </s-table>
   </a-card>
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
-import rangeDate from '@/views/common/rangeDate.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
-export default {
-  components: { STable, VSelect, rangeDate },
-  data () {
-    return {
-      advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '区域', dataIndex: 'area', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'province', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'customerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '费用类型', dataIndex: 'targetName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '1月', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '2月', dataIndex: 'totalQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '3月', dataIndex: 'totalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '4月', dataIndex: 'totalPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '5月', dataIndex: 'auditTime', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '6月', dataIndex: 'allocateTypeName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '7月', dataIndex: 'stateDictValue', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '8月', dataIndex: 'printStateDictValue', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '9月', dataIndex: 'printCount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '10月', dataIndex: 'printCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '11月', dataIndex: 'printCsounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '12月', dataIndex: 'printdCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '1-12月费用合计', dataIndex: 'prfintCounts', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        {
-          title: '实际销售额合计',
-          dataIndex: 'printCogunts',
-          width: 140,
-          align: 'center',
-          customRender: (value, row, index) => {
-            const obj = {
-              children: value,
-              attrs: {}
-            }
-            if (index === 0) { obj.attrs.rowSpan = 5 }
-            if (index === 1) { obj.attrs.rowSpan = 0 }
-            if (index === 2) { obj.attrs.rowSpan = 0 }
-            if (index === 3) { obj.attrs.rowSpan = 0 }
-            if (index === 4) { obj.attrs.rowSpan = 0 }
-            if (index === 5) { obj.attrs.rowSpan = 5 }
-            if (index === 6) { obj.attrs.rowSpan = 0 }
-            if (index === 7) { obj.attrs.rowSpan = 0 }
-            if (index === 8) { obj.attrs.rowSpan = 0 }
-            if (index === 9) { obj.attrs.rowSpan = 0 }
-            if (index === 10) { obj.attrs.rowSpan = 5 }
-            if (index === 11) { obj.attrs.rowSpan = 0 }
-            if (index === 12) { obj.attrs.rowSpan = 0 }
-            if (index === 13) { obj.attrs.rowSpan = 0 }
-            if (index === 14) { obj.attrs.rowSpan = 0 }
-            return obj
-          }
+  import {
+    STable,
+    VSelect
+  } from '@/components'
+  import reportData from '@/libs/reportData'
+  import rangeDate from '@/views/common/rangeDate.vue'
+  import getDate from '@/libs/getDate.js'
+  // import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
+  // import { allocateTypeAllList } from '@/api/allocateType'
+  export default {
+    components: {
+      STable,
+      VSelect,
+      rangeDate
+    },
+    data() {
+      return {
+        advanced: false, // 高级搜索 展开/关闭
+        tableHeight: 0,
+        queryParam: { //  查询条件
+          time: [
+            getDate.getCurrMonthDays().starttime,
+            getDate.getCurrMonthDays().endtime
+          ],
+          beginDate: getDate.getCurrMonthDays().starttime,
+          endDate: getDate.getCurrMonthDays().endtime,
+          targetName: '', //  调往对象
+          allocateTypeSn: undefined, //  调拨类型
+          state: undefined, //  业务状态
+          allocateNo: '' //  调拨单号
         },
-        { title: '费用占比(%)', dataIndex: 'phrintCounts', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常费用', dataIndex: 'printCsountss', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特殊申请费用', dataIndex: 'prinftCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = 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
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: reportData.nationalCustomerCostStatisticsList,
-            count: 10
-          }
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+        disabled: false, //  查询、重置按钮是否可操作
+        exportLoading: false,
+        rules: {
+          'time': [{
+            required: true,
+            message: '请选择创建时间',
+            trigger: 'change'
+          }]
+        },
+        columns: [{
+            title: '序号',
+            dataIndex: 'no',
+            width: 80,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            title: '区域',
+            dataIndex: 'area',
+            width: 200,
+            align: 'center',
+            customRender: function(text) {
+              return text || '--'
+            }
+          },
+          {
+            title: '省份',
+            dataIndex: 'province',
+            align: 'center',
+            customRender: function(text) {
+              return text || '--'
+            }
+          },
+          {
+            title: '客户名称',
+            dataIndex: 'customerName',
+            align: 'center',
+            customRender: function(text) {
+              return text || '--'
+            },
+            ellipsis: true
+          },
+          {
+            title: '费用类型',
+            dataIndex: 'targetName',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '1月',
+            dataIndex: 'dealerLevelDictValue',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '2月',
+            dataIndex: 'totalQty',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '3月',
+            dataIndex: 'totalCost',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '4月',
+            dataIndex: 'totalPrice',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '5月',
+            dataIndex: 'auditTime',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '6月',
+            dataIndex: 'allocateTypeName',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '7月',
+            dataIndex: 'stateDictValue',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '8月',
+            dataIndex: 'printStateDictValue',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '9月',
+            dataIndex: 'printCount',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '10月',
+            dataIndex: 'printCounts',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '11月',
+            dataIndex: 'printCsounts',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '12月',
+            dataIndex: 'printdCounts',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '1-12月费用合计',
+            dataIndex: 'prfintCounts',
+            width: 140,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '实际销售额合计',
+            dataIndex: 'printCogunts',
+            width: 140,
+            align: 'center',
+            customRender: (value, row, index) => {
+              const obj = {
+                children: value,
+                attrs: {}
+              }
+              if (index === 0) {
+                obj.attrs.rowSpan = 5
+              }
+              if (index === 1) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 2) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 3) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 4) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 5) {
+                obj.attrs.rowSpan = 5
+              }
+              if (index === 6) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 7) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 8) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 9) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 10) {
+                obj.attrs.rowSpan = 5
+              }
+              if (index === 11) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 12) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 13) {
+                obj.attrs.rowSpan = 0
+              }
+              if (index === 14) {
+                obj.attrs.rowSpan = 0
+              }
+              return obj
+            }
+          },
+          {
+            title: '费用占比(%)',
+            dataIndex: 'phrintCounts',
+            width: 140,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '正常费用',
+            dataIndex: 'printCsountss',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          },
+          {
+            title: '特殊申请费用',
+            dataIndex: 'prinftCounts',
+            width: 120,
+            align: 'center',
+            customRender: function(text) {
+              return ((text || text == 0) ? text : '--')
+            }
           }
-          _this.disabled = false
-          resolve(data)
-        })
+        ],
+        // 加载数据方法 必须为 Promise 对象
+        loadData: parameter => {
+          this.disabled = 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
+          //   }
+          //   this.disabled = false
+          //   return data
+          // })
+          const _this = this
+          return new Promise(function(resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: reportData.nationalCustomerCostStatisticsList,
+              count: 10
+            }
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = i + 1
+            }
+            _this.disabled = false
+            resolve(data)
+          })
+        },
+        allocateTypeList: [], //  调拨类型
+        openModal: false //  新增编辑  弹框
+      }
+    },
+    methods: {
+      //  创建时间  change
+      dateChange(date) {
+        this.queryParam.time = date
+        this.queryParam.beginDate = date[0] || ''
+        this.queryParam.endDate = date[1] || ''
       },
-      allocateTypeList: [], //  调拨类型
-      openModal: false //  新增编辑  弹框
-    }
-  },
-  methods: {
-    //  创建时间  change
-    dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      //  重置
+      resetSearchForm() {
+        this.$refs.rangeDate.resetDate(this.queryParam.time)
+        this.queryParam.time = [getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ]
+        this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+        this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+        this.queryParam.targetName = ''
+        this.queryParam.allocateTypeSn = undefined
+        this.queryParam.state = undefined
+        this.queryParam.allocateNo = ''
+        this.$refs.table.refresh(true)
+      }
     },
-    //  重置
-    resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
-      this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+    beforeRouteEnter(to, from, next) {
+      next(vm => {})
     }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
   }
-}
 </script>

+ 49 - 32
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -2,68 +2,74 @@
   <a-card size="small" :bordered="false" class="shortageStatisticsCList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model
+        id="priceDifferenceDetailReport-form"
+        layout="inline"
+        ref="ruleForm"
+        :model="queryParam"
+        :rules="rules"
+        @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-item label="日期">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
+            <a-form-model-item label="日期" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="单号">
+            <a-form-model-item label="单号">
               <a-input placeholder="请输入单号" />
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
+            <a-form-model-item label="客户名称">
               <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
+            </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="客户类型">
                 <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="品牌类别">
+              <a-form-model-item label="品牌类别">
                 <a-select placeholder="选择品牌类别">
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
+              <a-form-model-item label="产品品牌">
                 <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.brandSn"></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="二级品类">
                 <ProductType id="productInfoList-productType" v-model="productType" @change="changeProductType"></ProductType>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
+              <a-form-model-item label="所在区域">
                 <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="省级区域" prop="provinceSn">
+              <a-form-model-item label="省级区域" prop="provinceSn">
                 <a-select id="supplierInfoEdit-provinceSn" @change="getCityList" v-model="queryParam.provinceSn" placeholder="请选择省">
                   <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="类型">
+              <a-form-model-item label="类型">
                 <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="">
+              <a-form-model-item label="">
                 <a-checkbox>
                   盘点区间日期
                 </a-checkbox>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
@@ -75,7 +81,7 @@
             </a>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
     <!-- 列表 -->
     <s-table
@@ -128,20 +134,26 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         buyerSn: undefined,
         subareaSn: undefined, //  区域
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined
       },
+	  rules: {
+	    'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
+	  },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      time: [], //  创建时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '区域',
@@ -353,8 +365,9 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     custChange (obj) {
       this.queryParam.buyerSn = obj.key
@@ -427,8 +440,12 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.buyerSn = undefined
       this.queryParam.subareaSn = undefined

+ 34 - 16
src/views/reportData/provinceTypeSalesDetails/list.vue

@@ -2,33 +2,38 @@
   <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model
+        layout="inline"
+        ref="ruleForm"
+        :model="queryParam"
+        :rules="rules"
+        @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
+            <a-form-model-item label="创建时间" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="区域">
+            <a-form-model-item label="区域">
               <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
                 <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
               </a-select>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="省份">
+            <a-form-model-item label="省份">
               <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
                 <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
               </a-select>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="provinceTypeSalesDetailsList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="provinceTypeSalesDetailsList-reset">重置</a-button>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
     <!-- 列表 -->
     <s-table
@@ -48,6 +53,7 @@
 import { STable, VSelect } from '@/components'
 import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
+import getDate from '@/libs/getDate.js'
 // import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
 // import { allocateTypeAllList } from '@/api/allocateType'
 export default {
@@ -57,8 +63,12 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
         allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
@@ -66,6 +76,9 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
+      rules: {
+        'time': [{ required: true, message: '请选择创建时间', trigger: 'change' }]
+      },
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '区域', dataIndex: 'area', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
@@ -131,18 +144,23 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
       this.queryParam.allocateNo = ''
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.$refs.table.refresh(true)
     }
   },

+ 27 - 14
src/views/reportData/regionalPromotionCostStatistics/list.vue

@@ -2,26 +2,26 @@
   <a-card size="small" :bordered="false" class="regionalPromotionCostStatisticsList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model layout="inline" ref="ruleForm" :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="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
+            <a-form-model-item label="创建时间" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="区域">
+            <a-form-model-item label="区域">
               <a-select id="regionalPromotionCostStatisticsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
                 <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
               </a-select>
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="regionalPromotionCostStatisticsList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="regionalPromotionCostStatisticsList-reset">重置</a-button>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
     <!-- 列表 -->
     <s-table
@@ -42,6 +42,7 @@
 import { STable, VSelect } from '@/components'
 import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
+import getDate from '@/libs/getDate.js'
 // import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
 // import { allocateTypeAllList } from '@/api/allocateType'
 export default {
@@ -51,8 +52,12 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
         allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
@@ -60,6 +65,9 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
+      rules: {
+        'time': [{ required: true, message: '请选择创建时间', trigger: 'change' }]
+      },
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '省份', dataIndex: 'province', align: 'center', customRender: function (text) { return text || '--' } },
@@ -134,14 +142,19 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined

+ 250 - 382
src/views/reportData/returnSlipReport/list.vue

@@ -1,197 +1,179 @@
 <template>
-  <a-card size="small" :bordered="false" class="shortageStatisticsCList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售日期">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户类型">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="returnSlipReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="returnSlipReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="退货单号">
-                <a-input id="salesSlipReportList-allocateTypeSn" v-model.trim="queryParam.allocateTypeSn" allowClear placeholder="请输入退货单号"/>
-              </a-form-item>
+              <a-form-model-item label="退货日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              <a-form-model-item label="客户名称">
+                <custList id="returnSlipReportList-custList" ref="custList" @change="custChange"></custList>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
-              <a-row>
-                <a-form-item label="地区">
-                  <a-col span="7">
-                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerProvinceSn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCitySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCitySn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCountySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCountySn" 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-item>
-                  </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户类型">
+                <v-select
+                  v-model="queryParam.dealer.dealerLevel"
+                  ref="dealerLevel"
+                  id="returnSlipReportList-dealerLevel"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择客户类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="退货单号">
+                  <a-input id="returnSlipReportList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
                 </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="returnSlipReportList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <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-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-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-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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnSlipReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="returnSlipReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 3240, y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
+              <a-row>
+                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? totalData.jpLqqAmount : '--' }}</a-col>
+                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</a-col>
+                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">稳升:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <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-row>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2880, y: tableHeight }"
-      bordered>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
+import { salesReportReturnBillList, salesReportReturnBillCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        buyerSn: undefined,
-        subareaSn: undefined, //  区域
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        dealer: {
+          'dealerSn': undefined,
+          'provinceSn': undefined,
+          'citySn': undefined,
+          'districtSn': undefined,
+          'subareaSn': undefined,
+          'dealerLevel': undefined
+        },
+        salesReturnBillNo: ''
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择退货日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      time: [], //  创建时间
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '区域',
-          dataIndex: 'area',
-          width: 150,
-          align: 'center',
-          customRender: (text, row, index) => {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 4
-                }
-              }
-            }
-            return text
-          }
-        },
-        { title: '退货单号',
-		  dataIndex: 'allocateTypeSn',
-		  width: 150,
-		  align: 'center',
-		  customRender: (text, row, index) => {
-		    if (text == '合计') {
-		      return {
-		        children: <span>{ text }</span>,
-		        attrs: {
-		          colSpan: 4
-		        }
-		      }
-		    }
-		    return text
-		  }
-        },
-        { title: '省份',
-          dataIndex: 'provinceName',
-          width: 150,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户名称',
-          dataIndex: 'custName',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户类型',
-          dataIndex: 'custType',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
+        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌',
           align: 'center',
           children: [
@@ -201,38 +183,38 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp1',
+                  dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp2',
+                  dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
-                  dataIndex: 'pp3',
+                  dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp4',
+                  dataIndex: 'jpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
-                  dataIndex: 'pp5',
+                  dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -242,54 +224,54 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp6',
+                  dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp7',
+                  dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp8',
+                  dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
             {
               title: '汇箭',
-              dataIndex: 'pp9',
+              dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
-              dataIndex: 'pp10',
+              dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
-              dataIndex: 'pp11',
+              dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
-              dataIndex: 'pp12',
+              dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -297,213 +279,147 @@ export default {
           children: [
             {
               title: 'NGK',
-              dataIndex: 'pp13',
+              dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
-              dataIndex: 'pp14',
+              dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
-              dataIndex: 'pp15',
+              dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
-              dataIndex: 'pp16',
+              dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
-              dataIndex: 'pp17',
+              dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
-              dataIndex: 'pp18',
+              dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
-              dataIndex: 'pp19',
+              dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '开单退货合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } }
+        { title: '开单退货单合计金额', width: 200, dataIndex: 'sumAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // this.disabled = true
-        // if (this.tableHeight == 0) {
-        //   this.tableHeight = window.innerHeight - 380
-        // }
-        // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        // const params = Object.assign(parameter, this.queryParam) //  无分页
-        // return oosBuyerList(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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [{
-              area: 'A区',
-			  allocateTypeSn: 'TH201622021245541',
-              provinceName: '广东省',
-              custName: '剪冠汽配佛山白坭店',
-              custType: '省级服务中心',
-              pp1: '0',
-              pp2: '0',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '37.00',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '37.00'
-            },
-            {
-              area: 'A区',
-			  allocateTypeSn: 'TH201722021245582',
-              provinceName: '广东省',
-              custName: '支持省级',
-              custType: '省级服务中心',
-              pp1: '0',
-              pp2: '36.50',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '0',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '36.50'
-            },
-            {
-              area: '合计',
-              provinceName: '合计',
-              custName: '合计',
-              custType: '合计',
-              pp1: '0',
-              pp2: '36.50',
-              pp3: '0',
-              pp4: '0',
-              pp5: '0',
-              pp6: '0',
-              pp7: '0',
-              pp8: '0',
-              pp9: '0',
-              pp10: '0',
-              pp11: '0',
-              pp12: '0',
-              pp13: '37.00',
-              pp14: '0',
-              pp15: '0',
-              pp16: '0',
-              pp17: '0',
-              pp18: '0',
-              pp19: '0',
-              totalAmount: '73.50'
-            }],
-            count: 1
-          }
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
-      productType: [],
-      productTotal: null,
-      currentTotal: null
+      totalData: null
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesReportReturnBillCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    custChange (obj) {
-      this.queryParam.buyerSn = obj.key
+    custChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      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.salesReturnBillNo = ''
+      this.$refs.custList.resetForm()
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.provinceName = this.addrProvinceList[index].name
-      }
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.cityName = this.addrCityList[index].name
-      }
       this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCountySn = undefined
       this.getArea('district', val)
     },
-    // 区县变更
-    areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.districtName = this.addrDistrictList[index].name
-      }
-      this.queryParam.address = ''
-    },
     //  省/市/区
     getArea (leve, sn) {
       let params
@@ -531,54 +447,6 @@ export default {
           }
         }
       })
-    },
-    //  重置
-    resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerSn = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.productName = ''
-      this.queryParam.productCode = ''
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.queryParam.salesBillNo = ''
-      this.productType = []
-      this.$refs.table.refresh(true)
-    },
-    // 详情
-    handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
-    },
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      this.exportLoading = true
-      oosDetailExport(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      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 = '缺货统计(按客户)' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 241 - 214
src/views/reportData/salesAmountReport/list.vue

@@ -1,115 +1,169 @@
 <template>
   <a-card size="small" :bordered="false" class="salesAmountReportList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <a-input id="salesAmountReportList-allocateTypeSn" v-model.trim="queryParam.allocateTypeSn" allowClear placeholder="请输入客户名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户类型">
-              <a-select id="salesAmountReportList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择客户类型" allowClear >
-                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesAmountReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <subarea id="salesAmountReportList-allocateTypeSn" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              <a-form-model-item label="销售日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <custList id="salesAmountReportList-allocateTypeSn" ref="custList" @change="custChange"></custList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户类型">
+                <v-select
+                  v-model="queryParam.dealer.dealerLevel"
+                  ref="dealerLevel"
+                  id="salesAmountReportList-allocateTypeSn"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择客户类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="salesAmountReportList-allocateTypeSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <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-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-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-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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesAmountReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesAmountReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :defaultLoadData="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 3120 }"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
               <a-row>
-                <a-form-item label="地区">
-                  <a-col span="7">
-                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerProvinceSn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCitySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCitySn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCountySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCountySn" 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-item>
-                  </a-col>
-                </a-form-item>
+                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? totalData.jpLqqAmount : '--' }}</a-col>
+                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</a-col>
+                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">稳升:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <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-row>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesAmountReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesAmountReportList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 3120 }"
-      bordered>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
+import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { salesBillReportGroupByBuyerList, salesBillReportCount } from '@/api/salesBillReport'
 export default {
-  components: { STable, VSelect, rangeDate, subarea },
+  components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        dealer: {
+          'dealerSn': undefined,
+          'provinceSn': undefined,
+          'citySn': undefined,
+          'districtSn': undefined,
+          'subareaSn': undefined,
+          'dealerLevel': undefined
+        }
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '区域', dataIndex: 'area', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户类型', dataIndex: 'custType', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌',
           align: 'center',
           children: [
@@ -119,38 +173,38 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp1',
+                  dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp2',
+                  dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
-                  dataIndex: 'pp3',
+                  dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'pp4',
-                  align: 'center',
+                  align: 'jpScpAmount',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
-                  dataIndex: 'pp5',
+                  dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -160,54 +214,54 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp6',
+                  dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp7',
+                  dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp8',
+                  dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
             {
               title: '汇箭',
-              dataIndex: 'pp9',
+              dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
-              dataIndex: 'pp10',
+              dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
-              dataIndex: 'pp11',
+              dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
-              dataIndex: 'pp12',
+              dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -215,161 +269,134 @@ export default {
           children: [
             {
               title: 'NGK',
-              dataIndex: 'pp13',
+              dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
-              dataIndex: 'pp14',
+              dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
-              dataIndex: 'pp15',
+              dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
-              dataIndex: 'pp16',
+              dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
-              dataIndex: 'pp17',
+              dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
-              dataIndex: 'pp18',
+              dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
-              dataIndex: 'pp19',
+              dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '实际销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } }
+        { title: '开单销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // this.disabled = true
-        // if (this.tableHeight == 0) {
-        //   this.tableHeight = window.innerHeight - 380
-        // }
-        // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        // const params = Object.assign(parameter, this.queryParam) //  无分页
-        // return oosBuyerList(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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [{
-              area: 'A区',
-              provinceName: '广东省',
-              custName: '箭冠汽配佛山白坭店',
-              custType: '市级经销商',
-              pp1: '0.00',
-              pp2: '0.00',
-              pp3: '0.00',
-              pp4: '0.00',
-              pp5: '0.00',
-              pp6: '0.00',
-              pp7: '0.00',
-              pp8: '0.00',
-              pp9: '0.00',
-              pp10: '0.00',
-              pp11: '0.00',
-              pp12: '0.00',
-              pp13: '92.50',
-              pp14: '0.00',
-              pp15: '0.00',
-              pp16: '0.00',
-              pp17: '0.00',
-              pp18: '0.00',
-              pp19: '0.00',
-              totalAmount: '92.50'
-            },
-            {
-              area: '合计:',
-              provinceName: '',
-              custName: '',
-              custType: '',
-              pp1: '0.00',
-              pp2: '0.00',
-              pp3: '0.00',
-              pp4: '0.00',
-              pp5: '0.00',
-              pp6: '0.00',
-              pp7: '0.00',
-              pp8: '0.00',
-              pp9: '0.00',
-              pp10: '0.00',
-              pp11: '0.00',
-              pp12: '0.00',
-              pp13: '92.50',
-              pp14: '0.00',
-              pp15: '0.00',
-              pp16: '0.00',
-              pp17: '0.00',
-              pp18: '0.00',
-              pp19: '0.00',
-              totalAmount: '92.50'
-            }],
-            count: 1
-          }
+        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 }) //  有分页
+        delete paramsPage.time
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
+      totalData: null,
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      allocateTypeList: [] //  调拨类型
+      addrDistrictList: [] //  区下拉
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesBillReportCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    custChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
-      this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      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.totalData = null
+      this.$refs.custList.resetForm()
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
     },
     // 获取城市列表
     getCityList (val) {

+ 68 - 50
src/views/reportData/salesDetails/list.vue

@@ -1,54 +1,59 @@
 <template>
-  <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
+  <a-card size="small" :bordered="false" class="salesDetailsList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model
+        layout="inline"
+        ref="ruleForm"
+        :model="queryParam"
+        :rules="rules"
+        @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-item label="销售日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
+            <a-form-model-item label="销售日期" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="销售单号">
-              <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
+            <a-form-model-item label="销售单号">
+              <a-input id="salesDetailsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入销售单号"/>
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
+            <a-form-model-item label="产品编码">
+              <a-input id="salesDetailsList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
+            </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-item label="区域">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
+              <a-form-model-item label="区域">
+                <a-select id="salesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
                   <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="省份">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
+              <a-form-model-item label="省份">
+                <a-select id="salesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
                   <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品名称">
-                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-              </a-form-item>
+              <a-form-model-item label="产品名称">
+                <a-input id="salesDetailsList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
-                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
-              </a-form-item>
+              <a-form-model-item label="客户名称">
+                <a-input id="salesDetailsList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
+              <a-form-model-item label="产品品牌">
                 <a-select
                   placeholder="请选择"
-                  id="productPricingList-productBrandSn"
+                  id="salesDetailsList-productBrandSn"
                   allowClear
                   v-model="queryParam.productBrandSn"
                   :showSearch="true"
@@ -56,13 +61,13 @@
                   :filter-option="filterOption">
                   <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户级别">
+              <a-form-model-item label="客户级别">
                 <a-select
                   placeholder="请选择"
-                  id="productPricingList-productBrandSn"
+                  id="salesDetailsList-productBrandSn"
                   allowClear
                   v-model="queryParam.productBrandSn"
                   :showSearch="true"
@@ -70,18 +75,18 @@
                   :filter-option="filterOption">
                   <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="品牌类别">
-                <v-select code="BRAND_TYPE" id="productBrandList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
-              </a-form-item>
+              <a-form-model-item label="品牌类别">
+                <v-select code="BRAND_TYPE" id="salesDetailsList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="二级分类">
+              <a-form-model-item label="二级分类">
                 <a-select
                   placeholder="请选择"
-                  id="productPricingList-productBrandSn"
+                  id="salesDetailsList-productBrandSn"
                   allowClear
                   v-model="queryParam.productBrandSn"
                   :showSearch="true"
@@ -89,13 +94,13 @@
                   :filter-option="filterOption">
                   <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="三级分类">
+              <a-form-model-item label="三级分类">
                 <a-select
                   placeholder="请选择"
-                  id="productPricingList-productBrandSn"
+                  id="salesDetailsList-productBrandSn"
                   allowClear
                   v-model="queryParam.productBrandSn"
                   :showSearch="true"
@@ -103,24 +108,24 @@
                   :filter-option="filterOption">
                   <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="盘点区间日期">
+              <a-form-model-item label="盘点区间日期">
                 <a-checkbox @change="onChange"></a-checkbox>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
+            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesDetailsList-refresh">查询</a-button>
+            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="salesDetailsList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin-left: 8px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
     <!-- 列表 -->
     <s-table
@@ -156,6 +161,7 @@
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -168,13 +174,20 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
         allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
         allocateNo: '' //  调拨单号
       },
+	  rules: {
+	    'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
+	  },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       checkVal: '',
@@ -242,8 +255,9 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     // 选择盘点日期
     onChange (e) {
@@ -253,9 +267,13 @@ export default {
 
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined

+ 421 - 205
src/views/reportData/salesReturnDetailReport/list.vue

@@ -1,259 +1,475 @@
 <template>
-  <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="退货完成日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="盘点区间日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="退货单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="salesReturnDetailList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesSlipReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品编码" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入产品编码"/>
-              </a-form-item>
+              <a-form-model-item label="退货完成日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入产品名称"/>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="退货单号">
+                <a-input id="salesReturnDetailList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <custList id="salesReturn-buyerSn" ref="custList" @change="custChange"></custList>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="salesReturnDetailList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="客户类型">
-                <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-              </a-form-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="salesReturnDetailList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <a-input id="salesReturnDetailList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户类型">
+                  <v-select
+                    v-model="queryParam.dealerLevel"
+                    ref="dealerLevel"
+                    id="salesReturnDetailList-dealerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="品牌分类">
+                  <v-select code="BRAND_TYPE" id="salesReturnDetailList-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择"
+                    id="salesReturnDetailList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productBrandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="salesReturnDetailList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="salesReturnDetailList-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="地区">
+                    <a-col span="7">
+                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerProvinceSn" 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.dealerCitySn" 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.dealerCountySn" 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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="8" :sm="24">
+              <a-button
+                style="margin-bottom: 18px;"
+                type="primary"
+                class="button-warning"
+                size="small"
+                @click="handleStock"
+                id="salesReturnDetailList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin: 0 0 18px 8px" type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnDetailList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnDetailList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="salesReturnDetailList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="品牌类别">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 4450 }"
+        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="6" :sm="24">
-              <a-form-item label="产品品牌">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              开单退货金额:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="二级类别">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="三级类别">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              返工数量:{{ (totalData && (totalData.totalBackStockQty || totalData.totalBackStockQty==0)) ? totalData.totalBackStockQty : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              坏件数量:{{ (totalData && (totalData.totalBadQty || totalData.totalBadQty==0)) ? totalData.totalBadQty : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="省份">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              正常退货数量:{{ (totalData && (totalData.totalNormalQty || totalData.totalNormalQty==0)) ? totalData.totalNormalQty : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="市">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择市" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="4" :sm="24">
+              正常退货金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? totalData.totalNormalPrice : '--' }}
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="区">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择区" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <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>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="provinceTypeSalesDetailsList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="provinceTypeSalesDetailsList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 3750 }"
-      bordered>
-      <template slot="footer" slot-scope="currentPageData">
-        <a-table
-          ref="table_footer"
-          size="small"
-          :pagination="false"
-          :bordered="false"
-          :rowKey="(record) => record.id"
-          :columns="columnsTotal"
-          :data-source="totalData"
-        >
-        </a-table>
-      </template>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
+import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { getArea } from '@/api/data'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import { reportSalesReturnDetailList, reportSalesReturnDetailCount, reportSalesReturnDetailExport } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate, custList },
+  components: { STable, VSelect, rangeDate, custList, subarea },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        salesReturnBillNo: '',
+        productCode: '',
+        productName: '',
+        dealerName: '',
+        dealerLevel: undefined,
+        productBrandTypeSn: undefined,
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        subareaSn: undefined,
+        dealerProvinceSn: undefined,
+        dealerCitySn: undefined,
+        dealerCountySn: undefined
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      reportData: reportData.salesReturnDetailReportList,
-      totalData: [
-        { printCsountss: 3, prinftCounts: 27, prisntCogunts: 22.5, prinxtCounts: '0', printCocunts: 3, printCvounts: '0', printCgounts: '0.00', printCouhnts: '0.00', printCournts: '0.00' }
-      ],
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '区域', dataIndex: 'area', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单号', dataIndex: 'returnNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'province', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'customerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '直接绑定客户名称', dataIndex: 'directCustomName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '间接绑定客户名称', dataIndex: 'IndirectCustomName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货完成日期', dataIndex: 'returnFinTime', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'type', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '二级类别', dataIndex: 'allocateTypeName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'stateDictValue', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'printStateDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productUnit', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货数量', dataIndex: 'printCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'printCsounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'printdCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货开单价', dataIndex: 'prfintCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货开单金额', dataIndex: 'printCogunts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货实售价', dataIndex: 'phrintCounts', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货实售金额', dataIndex: 'printCsountss', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价金额', dataIndex: 'prinftCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'prisntCogunts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'prinxtCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '再入库单价', dataIndex: 'printCocunts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常退货数量', dataIndex: 'printCvounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常退货金额', dataIndex: 'printCgounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常再入库金额', dataIndex: 'printCouhnts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '正常退货入库差额', dataIndex: 'printCournts', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '区域', dataIndex: 'subareaNames', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerProvinceName', width: 200, 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: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货数量', dataIndex: 'qty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货开单价', dataIndex: 'price', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货开单金额', dataIndex: 'totalPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货实售价', dataIndex: 'realPrice', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货实售金额', dataIndex: 'totalRealAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '直接差价', dataIndex: 'directRebateAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '再入库单价', dataIndex: 'cost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '正常退货数量', dataIndex: 'normalQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
-	  columnsTotal: [
-		  { title: '退货数量', dataIndex: 'printCsountss', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '开单退货金额', dataIndex: 'prinftCounts', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '实售退货金额', dataIndex: 'prisntCogunts', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '返库数量', dataIndex: 'prinxtCounts', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '坏件数量', dataIndex: 'printCocunts', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '正常退货数量', dataIndex: 'printCvounts', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '正常退货金额', dataIndex: 'printCgounts', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '正常再入库金额', dataIndex: 'printCouhnts', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-		  { title: '正常退货入库差额', dataIndex: 'printCournts', width: 120, align: 'center', customRender: function (text) { return text || '--' } }
-	  ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = 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
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: reportData.salesReturnDetailReportList,
-            count: 10
-          }
+        this.spinning = true
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
-      allocateTypeList: [], //  调拨类型
-      openModal: false //  新增编辑  弹框
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [], //  区下拉
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [] //  分类下拉数据
     }
   },
   methods: {
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportSalesReturnDetailCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
-      this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.productBrandTypeSn = undefined
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      this.productType = []
+      if (this.advanced) {
+        this.$refs.custList.resetForm()
+      }
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      _this.spinning = true
+      reportSalesReturnDetailExport(params).then(res => {
+        this.exportLoading = false
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    download (data) {
+      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 = '销售退货明细报表' + a
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    //  产品品牌  列表
+    getProductBrand () {
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
+    },
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      this.getArea('city', val)
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.queryParam.dealerCountySn = undefined
+      this.getArea('district', val)
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      vm.getProductBrand()
+      vm.getProductType()
+      vm.getArea('province')
+    })
   }
 }
 </script>

+ 242 - 333
src/views/reportData/salesReturnReport/list.vue

@@ -1,176 +1,172 @@
 <template>
-  <a-card size="small" :bordered="false" class="shortageStatisticsCList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售日期">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户类型">
-              <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="salesReturnReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesReturnReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              <a-form-model-item label="销售日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <custList id="salesReturnReportList-custList" ref="custList" @change="custChange"></custList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户类型">
+                <v-select
+                  v-model="queryParam.dealer.dealerLevel"
+                  ref="dealerLevel"
+                  id="salesReturnReportList-dealerLevel"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择客户类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <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>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <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-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-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-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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 3020, y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
               <a-row>
-                <a-form-item label="地区">
-                  <a-col span="7">
-                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerProvinceSn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCitySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCitySn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCountySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCountySn" 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-item>
-                  </a-col>
-                </a-form-item>
+                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? totalData.jpLqqAmount : '--' }}</a-col>
+                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</a-col>
+                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">稳升:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <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-row>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2880, y: tableHeight }"
-      bordered>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-// import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
+import { salesReportReturnRebateList, salesReportReturnRebateCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        buyerSn: undefined,
-        subareaSn: undefined, //  区域
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        dealer: {
+          'dealerSn': undefined,
+          'provinceSn': undefined,
+          'citySn': undefined,
+          'districtSn': undefined,
+          'subareaSn': undefined,
+          'dealerLevel': undefined
+        }
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      time: [], //  创建时间
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '区域',
-          dataIndex: 'area',
-          width: 150,
-          align: 'center',
-          customRender: (text, row, index) => {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 4
-                }
-              }
-            }
-            return text
-          }
-        },
-        { title: '省份',
-          dataIndex: 'provinceName',
-          width: 150,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户名称',
-          dataIndex: 'custName',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '客户类型',
-          dataIndex: 'custType',
-          width: 200,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{ text }</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌',
           align: 'center',
           children: [
@@ -180,38 +176,38 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp1',
+                  dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp2',
+                  dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
-                  dataIndex: 'pp3',
+                  dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp4',
+                  dataIndex: 'jpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
-                  dataIndex: 'pp5',
+                  dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -221,54 +217,54 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp6',
+                  dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp7',
+                  dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp8',
+                  dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
             {
               title: '汇箭',
-              dataIndex: 'pp9',
+              dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
-              dataIndex: 'pp10',
+              dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
-              dataIndex: 'pp11',
+              dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
-              dataIndex: 'pp12',
+              dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -276,186 +272,147 @@ export default {
           children: [
             {
               title: 'NGK',
-              dataIndex: 'pp13',
+              dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
-              dataIndex: 'pp14',
+              dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
-              dataIndex: 'pp15',
+              dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
-              dataIndex: 'pp16',
+              dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
-              dataIndex: 'pp17',
+              dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
-              dataIndex: 'pp18',
+              dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
-              dataIndex: 'pp19',
+              dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '实售退货合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } }
+        { title: '实售退货合计金额', width: 200, dataIndex: 'sumAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // this.disabled = true
-        // if (this.tableHeight == 0) {
-        //   this.tableHeight = window.innerHeight - 380
-        // }
-        // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        // const params = Object.assign(parameter, this.queryParam) //  无分页
-        // return oosBuyerList(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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              {
-                area: 'A区',
-                provinceName: '广东省',
-                custName: '支持省级',
-                custType: '省级服务中心',
-                pp1: '0',
-                pp2: '36.50',
-                pp3: '0',
-                pp4: '0',
-                pp5: '0',
-                pp6: '0',
-                pp7: '0',
-                pp8: '0',
-                pp9: '0',
-                pp10: '0',
-                pp11: '0',
-                pp12: '0',
-                pp13: '0',
-                pp14: '0',
-                pp15: '0',
-                pp16: '0',
-                pp17: '0',
-                pp18: '0',
-                pp19: '0',
-                totalAmount: '36.50'
-              },
-              {
-                area: '合计',
-                provinceName: '合计',
-                custName: '合计',
-                custType: '合计',
-                pp1: '0',
-                pp2: '36.50',
-                pp3: '0',
-                pp4: '0',
-                pp5: '0',
-                pp6: '0',
-                pp7: '0',
-                pp8: '0',
-                pp9: '0',
-                pp10: '0',
-                pp11: '0',
-                pp12: '0',
-                pp13: '37.00',
-                pp14: '0',
-                pp15: '0',
-                pp16: '0',
-                pp17: '0',
-                pp18: '0',
-                pp19: '0',
-                totalAmount: '36.50'
-              }],
-            count: 1
-          }
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
       productType: [],
-      productTotal: null,
-      currentTotal: null
+      totalData: null
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesReportReturnRebateCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
     //  创建时间  change
     dateChange (date) {
+      this.queryParam.time = date
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    custChange (obj) {
-      this.queryParam.buyerSn = obj.key
+    custChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      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.totalData = null
+      this.$refs.custList.resetForm()
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.provinceName = this.addrProvinceList[index].name
-      }
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.cityName = this.addrCityList[index].name
-      }
       this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      this.queryParam.address = ''
+      this.queryParam.dealerCountySn = undefined
       this.getArea('district', val)
     },
-    // 区县变更
-    areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
-      if (index >= 0) {
-        this.queryParam.districtName = this.addrDistrictList[index].name
-      }
-      this.queryParam.address = ''
-    },
     //  省/市/区
     getArea (leve, sn) {
       let params
@@ -483,54 +440,6 @@ export default {
           }
         }
       })
-    },
-    //  重置
-    resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerSn = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.productName = ''
-      this.queryParam.productCode = ''
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.queryParam.salesBillNo = ''
-      this.productType = []
-      this.$refs.table.refresh(true)
-    },
-    // 详情
-    handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
-    },
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      this.exportLoading = true
-      oosDetailExport(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      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 = '缺货统计(按客户)' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 267 - 165
src/views/reportData/salesReturnsReport/list.vue

@@ -1,211 +1,313 @@
 <template>
-  <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="退货完成日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="退货单号">
-              <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="区域">
-                <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+  <a-card size="small" :bordered="false" class="salesReturnsReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesReturnsReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="7" :sm="24">
+              <a-form-model-item label="退货完成日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="省份">
-                <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="退货单号">
+                <a-input id="salesReturnsReportList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
-                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
-              </a-form-item>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="所在区域">
+                <subarea id="salesReturnsReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="客户级别">
-                <a-select
-                  placeholder="请选择"
-                  id="productPricingList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn">
-                  <a-select-option v-for="item in allocateTypeList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
-              </a-form-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <custList id="salesReturnsReportList-dealerName" ref="custList" @change="custChange"></custList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户类型">
+                  <v-select
+                    v-model="queryParam.dealerLevel"
+                    ref="dealerLevel"
+                    id="salesReturnsReportList-dealerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <a-col span="7">
+                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerProvinceSn" 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.dealerCitySn" 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.dealerCountySn" 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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="7" :sm="24">
+              <a-button
+                style="margin-bottom: 18px;"
+                type="primary"
+                class="button-warning"
+                size="small"
+                @click="handleStock"
+                id="salesReturnsReportList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin: 0 0 18px 8px" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturnsReportList-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnsReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="盘点区间日期">
-                <a-checkbox @change="onChange"></a-checkbox>
-              </a-form-item>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2510 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24">
+              总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2380 }"
-      bordered>
-      <template slot="footer" slot-scope="currentPageData">
-        <a-row :gutter="15">
-          <a-col :md="4" :sm="24">
-            总数量:130
-          </a-col>
-          <a-col :md="4" :sm="24">
-            开单退货金额:1688.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            实售退货金额:1476.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            经销商金额:1688.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            服务中心金额:55.50
-          </a-col>
-          <a-col :md="4" :sm="24">
-            特约加盟店金额:1856.00
-          </a-col>
-        </a-row>
-      </template>
-    </s-table>
+            <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.totalWholesalePrice1 || totalData.totalWholesalePrice1==0)) ? totalData.totalWholesalePrice1 : '--' }}
+            </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.totalWholesalePrice3 || totalData.totalWholesalePrice3==0)) ? totalData.totalWholesalePrice3 : '--' }}
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import subarea from '@/views/common/subarea.js'
+import custList from '@/views/common/custList.vue'
+import { getArea } from '@/api/data'
+import { reportSalesReturnList, reportSalesReturnCount } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        salesReturnBillNo: '',
+        subareaSn: undefined,
+        dealerSn: '',
+        dealerLevel: undefined,
+        dealerProvinceSn: undefined,
+        dealerCitySn: undefined,
+        dealerCountySn: undefined
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkVal: '',
-      reportData: reportData.salesReturnsReportList,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '退货单号', dataIndex: 'data1', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货完成日期', dataIndex: 'data2', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'data3', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户类型', dataIndex: 'data4', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接绑定客户类型', dataIndex: 'data5', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接绑定客户类型', dataIndex: 'data6', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', dataIndex: 'data7', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '开单退货金额', dataIndex: 'data8', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '经销商价', dataIndex: 'data9', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '服务中心价', dataIndex: 'data10', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约加盟价', dataIndex: 'data11', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售退货价', dataIndex: 'data12', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '直接差价', dataIndex: 'data13', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '间接差价', dataIndex: 'data14', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'data15', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'data16', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货数量', dataIndex: 'totalQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '开单退货金额', dataIndex: 'totalAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '经销商价', dataIndex: 'totalWholesalePrice1', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '服务中心价', dataIndex: 'totalWholesalePrice2', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '特约加盟店价', dataIndex: 'totalWholesalePrice3', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实售退货金额', dataIndex: 'totalRealAmount', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '直接差价', dataIndex: 'totalDirectRebate', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '间接差价', dataIndex: 'totalIndirectRebate', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'operatorName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = 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
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: reportData.salesReturnsReportList,
-            count: 10
-          }
+        this.spinning = true
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
-      allocateTypeList: [], //  调拨类型
-      openModal: false //  新增编辑  弹框
+      totalData: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
     }
   },
   methods: {
-    handleFooterShow (currentPageData) {
-      console.log(currentPageData, '[=currentPageData]')
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportSalesReturnCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    // 选择盘点日期
-    onChange (e) {
-      console.log(e)
-      // this.checkVal
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
     },
-
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
-      this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerSn = undefined
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      if (this.advanced) {
+        this.$refs.custList.resetForm()
+      }
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      this.getArea('city', val)
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.queryParam.dealerCountySn = undefined
+      this.getArea('district', val)
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      vm.getArea('province')
+    })
   }
 }
 </script>

+ 249 - 222
src/views/reportData/salesSlipReport/list.vue

@@ -1,121 +1,176 @@
 <template>
   <a-card size="small" :bordered="false" class="salesSlipReportList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <a-input id="salesSlipReportList-allocateTypeSn" v-model.trim="queryParam.allocateTypeSn" allowClear placeholder="请输入客户名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户类型">
-              <a-select id="salesSlipReportList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择客户类型" allowClear >
-                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesSlipReportList-form"
+          layout="inline"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="销售单号">
-                <a-input id="salesSlipReportList-allocateTypeSn" v-model.trim="queryParam.allocateTypeSn" allowClear placeholder="请输入销售单号"/>
-              </a-form-item>
+              <a-form-model-item label="销售日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="所在区域">
-                <subarea id="salesSlipReportList-allocateTypeSn" v-model="queryParam.subareaSn"></subarea>
-              </a-form-item>
+              <a-form-model-item label="客户名称">
+                <custList id="salesSlipReportList-allocateTypeSn" ref="custList" @change="custChange"></custList>
+              </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户类型">
+                <v-select
+                  v-model="queryParam.dealer.dealerLevel"
+                  ref="dealerLevel"
+                  id="salesSlipReportList-allocateTypeSn"
+                  code="DEALER_LEVEL"
+                  placeholder="请选择客户类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="销售单号">
+                  <a-input id="salesSlipReportList-allocateTypeSn" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="salesSlipReportList-allocateTypeSn" v-model="queryParam.dealer.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <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-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-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-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>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesSlipReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesSlipReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :defaultLoadData="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 3220 }"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
               <a-row>
-                <a-form-item label="地区">
-                  <a-col span="7">
-                    <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerProvinceSn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCitySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCitySn" @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-item>
-                  </a-col>
-                  <a-col span="7" offset="1">
-                    <a-form-item prop="dealerCountySn" style="margin: 0;">
-                      <a-select v-model="queryParam.dealerCountySn" 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-item>
-                  </a-col>
-                </a-form-item>
+                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? totalData.jpLqqAmount : '--' }}</a-col>
+                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</a-col>
+                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">稳升:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? totalData.ngkAmount : '--' }}</a-col>
+                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? totalData.flpAmount : '--' }}</a-col>
+                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? totalData.cpAmount : '--' }}</a-col>
+                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? totalData.wetAmount : '--' }}</a-col>
+                <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-row>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesSlipReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesSlipReportList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 3220 }"
-      bordered>
-    </s-table>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import reportData from '@/libs/reportData'
 import rangeDate from '@/views/common/rangeDate.vue'
+import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
 export default {
-  components: { STable, VSelect, rangeDate, subarea },
+  components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
-        state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        salesBillNo: '', //  销售单号
+        dealer: {
+          'dealerSn': undefined,
+          'provinceSn': undefined,
+          'citySn': undefined,
+          'districtSn': undefined,
+          'subareaSn': undefined,
+          'dealerLevel': undefined
+        }
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择销售日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '区域', dataIndex: 'area', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 220, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '销售单号', dataIndex: 'salesBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户类型', dataIndex: 'custType', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealer.provinceName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户类型', dataIndex: 'dealer.dealerLevelDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌',
           align: 'center',
           children: [
@@ -125,38 +180,38 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp1',
+                  dataIndex: 'jpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp2',
+                  dataIndex: 'jpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '喇叭',
-                  dataIndex: 'pp3',
+                  dataIndex: 'jpLbAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
                   dataIndex: 'pp4',
-                  align: 'center',
+                  align: 'jpScpAmount',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '感应线',
-                  dataIndex: 'pp5',
+                  dataIndex: 'jpGyxAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
@@ -166,54 +221,54 @@ export default {
               children: [
                 {
                   title: '滤清器',
-                  dataIndex: 'pp6',
+                  dataIndex: 'gpLqqAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '雨刮片',
-                  dataIndex: 'pp7',
+                  dataIndex: 'gpYgpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 },
                 {
                   title: '刹车片',
-                  dataIndex: 'pp8',
+                  dataIndex: 'gpScpAmount',
                   align: 'center',
                   width: 100,
-                  customRender: function (text) { return text ? ('¥' + text) : '--' }
+                  customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
                 }
               ]
             },
             {
               title: '汇箭',
-              dataIndex: 'pp9',
+              dataIndex: 'hjAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德路斯',
-              dataIndex: 'pp10',
+              dataIndex: 'dlsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '稳升',
-              dataIndex: 'pp11',
+              dataIndex: 'wsAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: 'TBU',
-              dataIndex: 'pp12',
+              dataIndex: 'tbuAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
         { title: '代理品牌',
@@ -221,176 +276,148 @@ export default {
           children: [
             {
               title: 'NGK',
-              dataIndex: 'pp13',
+              dataIndex: 'ngkAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '飞利浦',
-              dataIndex: 'pp14',
+              dataIndex: 'flpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '车仆',
-              dataIndex: 'pp15',
+              dataIndex: 'cpAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '瓦尔塔',
-              dataIndex: 'pp16',
+              dataIndex: 'wetAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '雷贝斯托',
-              dataIndex: 'pp17',
+              dataIndex: 'lbstAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '德尔福',
-              dataIndex: 'pp18',
+              dataIndex: 'defAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             },
             {
               title: '巴诺德',
-              dataIndex: 'pp19',
+              dataIndex: 'bndAmount',
               align: 'center',
               width: 100,
-              customRender: function (text) { return text ? ('¥' + text) : '--' }
+              customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
             }
           ] },
-        { title: '实际销售合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return text ? ('¥' + text) : '--' } }
+        { title: '开单销售单合计金额', width: 200, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // this.disabled = true
-        // if (this.tableHeight == 0) {
-        //   this.tableHeight = window.innerHeight - 380
-        // }
-        // const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
-        // const params = Object.assign(parameter, this.queryParam) //  无分页
-        // return oosBuyerList(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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [{
-              area: 'A区',
-              salesBillNo: 'XS2106020000001',
-              provinceName: '广东省',
-              custName: '箭冠汽配佛山白坭店',
-              custType: '市级经销商',
-              pp1: '0.00',
-              pp2: '0.00',
-              pp3: '0.00',
-              pp4: '0.00',
-              pp5: '0.00',
-              pp6: '0.00',
-              pp7: '0.00',
-              pp8: '0.00',
-              pp9: '0.00',
-              pp10: '0.00',
-              pp11: '0.00',
-              pp12: '0.00',
-              pp13: '92.50',
-              pp14: '0.00',
-              pp15: '0.00',
-              pp16: '0.00',
-              pp17: '0.00',
-              pp18: '0.00',
-              pp19: '0.00',
-              totalAmount: '92.50'
-            },
-            {
-              area: '合计:',
-              salesBillNo: '',
-              provinceName: '',
-              custName: '',
-              custType: '',
-              pp1: '0.00',
-              pp2: '0.00',
-              pp3: '0.00',
-              pp4: '0.00',
-              pp5: '0.00',
-              pp6: '0.00',
-              pp7: '0.00',
-              pp8: '0.00',
-              pp9: '0.00',
-              pp10: '0.00',
-              pp11: '0.00',
-              pp12: '0.00',
-              pp13: '92.50',
-              pp14: '0.00',
-              pp15: '0.00',
-              pp16: '0.00',
-              pp17: '0.00',
-              pp18: '0.00',
-              pp19: '0.00',
-              totalAmount: '92.50'
-            }],
-            count: 1
-          }
+        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 }) //  有分页
+        delete paramsPage.time
+        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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
+      totalData: null,
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      allocateTypeList: [] //  调拨类型
+      addrDistrictList: [] //  区下拉
     }
   },
   methods: {
+    // 总计
+    getCount (params) {
+      salesBillReportCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    custChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
-      this.queryParam.state = undefined
-      this.queryParam.allocateNo = ''
-      this.$refs.table.refresh(true)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesBillNo = ''
+      this.queryParam.dealer = {
+        'dealerSn': undefined,
+        'provinceSn': undefined,
+        'citySn': undefined,
+        'districtSn': undefined,
+        'subareaSn': undefined,
+        'dealerLevel': undefined
+      }
+      this.totalData = null
+      this.$refs.custList.resetForm()
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
     },
     // 获取城市列表
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.dealer.citySn = undefined
+      this.queryParam.dealer.districtSn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.dealer.districtSn = undefined
       this.getArea('district', val)
     },
     //  省/市/区

+ 1 - 1
src/views/salesManagement/backorder/detailModal.vue

@@ -9,7 +9,7 @@
     @cancle="isShow=false"
     :width="960">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div style="padding: 0 12px;text-align: right;">
+      <div style="padding: 0 12px;text-align: right;" v-if="$hasPermissions('B_oosPrint')">
         <a-button id="backorderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')" style="margin-right: 15px;">打印预览</a-button>
         <a-button type="primary" id="backorderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
       </div>

+ 4 - 3
src/views/salesManagement/backorder/list.vue

@@ -33,7 +33,8 @@
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleDetail(record)" id="backorderList-detail-btn">详情</a-button>
+        <a-button size="small" type="link" @click="handleDetail(record)" v-if="$hasPermissions('B_oosDetail')" id="backorderList-detail-btn">详情</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
     <!-- 详情 -->
@@ -60,8 +61,8 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '缺货款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 100 - 93
src/views/salesManagement/examineVerify/list.vue

@@ -1,104 +1,107 @@
 <template>
   <a-card size="small" :bordered="false" class="examineVerifyList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <custList id="examineVerifyList-buyerName" ref="custList" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售单号">
-              <a-input id="examineVerifyList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="出库单号">
-                <a-input id="examineVerifyList-stockOutNo" v-model.trim="queryParam.stockOutNo" allowClear placeholder="请输入出库单号"/>
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="打印状态">
-                <v-select
-                  v-model="queryParam.printStatus"
-                  ref="printStatus"
-                  id="examineVerifyList-printStatus"
-                  code="PRINT_STATUS"
-                  placeholder="请选择打印状态"
-                  allowClear></v-select>
+              <a-form-item label="客户名称">
+                <custList id="examineVerifyList-buyerName" ref="custList" @change="custChange"></custList>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
-                <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="examineVerifyList-billStatus"
-                  code="DISPATCH_BILL_STATUS"
-                  placeholder="请选择单据状态"
-                  allowClear></v-select>
+              <a-form-item label="销售单号">
+                <a-input id="examineVerifyList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="备货单号">
-                <a-input id="examineVerifyList-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
-              </a-form-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="出库单号">
+                  <a-input id="examineVerifyList-stockOutNo" v-model.trim="queryParam.stockOutNo" allowClear placeholder="请输入出库单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="打印状态">
+                  <v-select
+                    v-model="queryParam.printStatus"
+                    ref="printStatus"
+                    id="examineVerifyList-printStatus"
+                    code="PRINT_STATUS"
+                    placeholder="请选择打印状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="examineVerifyList-billStatus"
+                    code="DISPATCH_BILL_STATUS"
+                    placeholder="请选择单据状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="备货单号">
+                  <a-input id="examineVerifyList-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="examineVerifyList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="examineVerifyList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="examineVerifyList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="examineVerifyList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">
-        总售价:<strong>{{ totalData.totalAmount }}</strong>元;
-        总单数:<strong>{{ totalData.totalRecord }}</strong>;
-        总款数:<strong>{{ totalData.totalCategory }}</strong>;
-        总数量:<strong>{{ totalData.totalQty }}</strong>;
+          </a-row>
+        </a-form>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2000, y:tableHeight }"
-      bordered>
-      <!-- 下推单号 -->
-      <template slot="dispatchBillNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.dispatchBillNo }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.billStatus=='WAIT_STOCK_UP_AUDIT'"
-          @click="handleExamine(record)"
-          id="examineVerifyList-examine-btn">备货审核</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">
+          总售价:<strong>{{ totalData.totalAmount }}</strong>元;
+          总单数:<strong>{{ totalData.totalRecord }}</strong>;
+          总款数:<strong>{{ totalData.totalCategory }}</strong>;
+          总数量:<strong>{{ totalData.totalQty }}</strong>;
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2000, y:tableHeight }"
+        bordered>
+        <!-- 下推单号 -->
+        <template slot="dispatchBillNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record)">{{ record.dispatchBillNo }}</span>
+          <span v-else>{{ record.dispatchBillNo }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.billStatus=='WAIT_STOCK_UP_AUDIT'&&$hasPermissions('B_dispatchAduit')"
+            @click="handleExamine(record)"
+            id="examineVerifyList-examine-btn">备货审核</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 审核 -->
     <auditModal :openModal="visibleAudit" @close="visibleAudit=false" @ok="auditOrder('OUTING_WAREHOUSE')" @fail="auditOrder('STOCK_UP_REJECT')" />
   </a-card>
@@ -116,6 +119,7 @@ export default {
   components: { STable, VSelect, custList, rangeDate, auditModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       time: [
@@ -135,17 +139,17 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '单据来源', dataIndex: 'salesBillEntity.salesBillSourceDictValue', width: 100, align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 230, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesBillEntity.salesBillSourceDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 230, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: 230, align: 'center' },
         { title: '出库单号', dataIndex: 'stockOutNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '售价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '备货时间', dataIndex: 'stockUpDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' },
-        { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: 100, align: 'center', customRender: function (text) { return text || '0' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
@@ -208,6 +212,7 @@ export default {
       this.visibleAudit = true
     },
     auditOrder (billStatus) {
+      this.spinning = true
       dispatchStockUpAduit({
         dispatchBillSn: this.auditInfo.dispatchBillSn,
         billStatus: billStatus
@@ -216,8 +221,10 @@ export default {
           this.visibleAudit = false
           this.$message.success(res.message)
           this.$refs.table.refresh()
+          this.spinning = false
         } else {
           this.visibleAudit = false
+          this.spinning = false
         }
       })
     },

+ 112 - 86
src/views/salesManagement/outboundOrder/list.vue

@@ -1,98 +1,100 @@
 <template>
   <a-card size="small" :bordered="false" class="outboundOrderList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="审核时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称">
-              <a-input id="outboundOrderList-demanderName" v-model.trim="queryParam.demanderName" allowClear placeholder="请输入客户名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="出库类型">
-              <v-select
-                v-model="queryParam.outBizType"
-                ref="outBizType"
-                id="outboundOrderList-outBizType"
-                code="OUT_STOCK_TYPE"
-                placeholder="请选择出库类型"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="出库状态">
-                <v-select
-                  v-model="queryParam.state"
-                  ref="state"
-                  id="outboundOrderList-state"
-                  code="OUT_STATE"
-                  placeholder="请选择出库状态"
-                  allowClear></v-select>
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务单号">
-                <a-input id="outboundOrderList-outBizNo" v-model.trim="queryParam.outBizNo" allowClear placeholder="请输入业务单号"/>
+              <a-form-item label="客户名称">
+                <a-input id="outboundOrderList-demanderName" v-model.trim="queryParam.demanderName" allowClear placeholder="请输入客户名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="出库单号">
-                <a-input id="outboundOrderList-stockOutNo" v-model.trim="queryParam.stockOutNo" allowClear placeholder="请输入出库单号"/>
+              <a-form-item label="出库类型">
+                <v-select
+                  v-model="queryParam.outBizType"
+                  ref="outBizType"
+                  id="outboundOrderList-outBizType"
+                  code="OUT_STOCK_TYPE"
+                  placeholder="请选择出库类型"
+                  allowClear></v-select>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="outboundOrderList-refresh" style="margin-bottom: 15px;">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="outboundOrderList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <div style="margin-bottom: 15px">
-      <a-button type="primary" id="outboundOrder-export" :loading="loading" @click="handleOutbound()">批量出库</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
-      </span>
-    </div>
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="rowSelection"
-      :rowKey="(record) => record.stockOutSn"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1760, y: tableHeight }"
-      bordered>
-      <!-- 单号 -->
-      <template slot="stockOutNo" slot-scope="text, record">
-        <span v-if="record.stockOutNo" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.stockOutNo }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state=='WAIT'"
-          class="button-primary"
-          @click="handleOutbound(record)"
-          id="outboundOrderList-out-btn">出库</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="出库状态">
+                  <v-select
+                    v-model="queryParam.state"
+                    ref="state"
+                    id="outboundOrderList-state"
+                    code="OUT_STATE"
+                    placeholder="请选择出库状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务单号">
+                  <a-input id="outboundOrderList-outBizNo" v-model.trim="queryParam.outBizNo" allowClear placeholder="请输入业务单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="出库单号">
+                  <a-input id="outboundOrderList-stockOutNo" v-model.trim="queryParam.stockOutNo" allowClear placeholder="请输入出库单号"/>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="outboundOrderList-refresh" style="margin-bottom: 15px;">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="outboundOrderList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <div style="margin-bottom: 15px" v-if="$hasPermissions('B_stockOut')">
+        <a-button type="primary" id="outboundOrder-export" :loading="loading" @click="handleOutbound()">批量出库</a-button>
+        <span style="margin-left: 8px">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="$hasPermissions('B_stockOut')?rowSelection:null"
+        :rowKey="(record) => record.stockOutSn"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1760, y: tableHeight }"
+        bordered>
+        <!-- 单号 -->
+        <template slot="stockOutNo" slot-scope="text, record">
+          <span v-if="record.stockOutNo" :class="detailPermissions(record)?'active':'common'" @click="handleDetail(record)">{{ record.stockOutNo }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='WAIT'&&$hasPermissions('B_stockOut')"
+            class="button-primary"
+            @click="handleOutbound(record)"
+            id="outboundOrderList-out-btn">出库</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -104,6 +106,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
@@ -175,6 +178,16 @@ export default {
     }
   },
   methods: {
+    detailPermissions (row) {
+      let state = false
+      //  根据出库类型和对应功能权限 判断是否有查看详情的权限
+      if (row.outBizType == 'SALES' && this.$hasPermissions('B_dispatchDetail')) { // 销售出库
+        state = true
+      } else if (row.outBizType == 'ALLOCATE' && this.$hasPermissions('M_transferOut_detail')) { //  调拨出库
+        state = true
+      }
+      return state
+    },
     //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
@@ -195,9 +208,9 @@ export default {
     //  详情
     handleDetail (row) {
       //  根据出库类型跳转对应页面
-      if (row.outBizType == 'SALES') { //  销售出库
+      if (row.outBizType == 'SALES' && this.$hasPermissions('B_dispatchDetail')) { //  销售出库
         this.$router.push({ path: `/salesManagement/pushOrderManagement/detail/${row.outBizSubSn}/stockOut` })
-      } else if (row.outBizType == 'ALLOCATE') { //  调拨出库
+      } else if (row.outBizType == 'ALLOCATE' && this.$hasPermissions('M_transferOut_detail')) { //  调拨出库
         this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.outBizSn}` })
       } else if (row.outBizType == 'CHECK_ORDER_OUT') { //  库存盘点盘亏
 
@@ -240,6 +253,7 @@ export default {
           if (!row) { //  批量出库
             _this.loading = true
           }
+          _this.spinning = true
           stockOutOut(params).then(res => {
             _this.loading = false
             if (res.status == 200) {
@@ -249,6 +263,9 @@ export default {
               }
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -287,3 +304,12 @@ export default {
   }
 }
 </script>
+<style lang="less">
+  .active{
+    color: #ed1c24;
+    cursor: pointer;
+  }
+  .common{
+    color: rgba(0, 0, 0, 0.65);
+  }
+</style>

+ 2 - 5
src/views/salesManagement/pushOrderManagement/chooseTypeModal.vue

@@ -8,7 +8,7 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="600">
-    <a-spin tip="Loading..." :spinning="spinLoading">
+    <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
         id="pushOrderManagement-print-form"
         ref="ruleForm"
@@ -53,7 +53,7 @@ export default {
         labelCol: { span: 6 },
         wrapperCol: { span: 18 }
       },
-      spinLoading: false,
+      spinning: false,
       typeList: []
     }
   },
@@ -61,13 +61,10 @@ export default {
     // 确认
     handleSave () {
       const _this = this
-
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.spinLoading = true
           _this.$emit('ok', _this.form.productTypeSn2)
           _this.isShow = false
-          _this.spinLoading = false
         } else {
           console.log('error submit!!')
           return false

+ 14 - 9
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -5,7 +5,7 @@
         <template slot="subTitle">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
         </template>
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_dispatchPrint')">
           <a-button
             key="4"
             type="primary"
@@ -40,14 +40,19 @@
       <a-card size="small" :bordered="false" class="salesDetail-cont">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
-            <a-descriptions size="small" :column="3" v-if="detailData!=null">
-              <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货地址" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity.shippingAddrProvinceName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCityName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCountyName || '--' }}{{ detailData.salesBillExtEntity.shippingAddr || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收款方式">{{ detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货人" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货电话" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货地址" v-if="detailData&&detailData.salesBillExtEntity">
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货人" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货电话" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>

+ 6 - 4
src/views/salesManagement/pushOrderManagement/list.vue

@@ -70,11 +70,13 @@
       bordered>
       <!-- 销售单号 -->
       <template slot="salesBillNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
+        <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
+        <span v-else>{{ record.salesBillNo }}</span>
       </template>
       <!-- 备货单号 -->
       <template slot="dispatchBillNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
+        <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
+        <span v-else>{{ record.dispatchBillNo }}</span>
       </template>
     </s-table>
   </a-card>
@@ -112,12 +114,12 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         // { title: '区域', dataIndex: 'shippingAddrCountyName', width: 120, align: 'center' },
         // { title: '省份', dataIndex: 'shippingAddrProvinceName', width: 120, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: 210, align: 'center' },
         { title: '关联销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 210, align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '下推数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '下推金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '下推金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '备货时间', dataIndex: 'stockUpDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库时间', dataIndex: 'stockOutDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' }

+ 3 - 3
src/views/salesManagement/salesQuery/chooseActive.vue

@@ -81,9 +81,9 @@ export default {
       columns: [
         { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', align: 'center', customRender: function (text) { return (text == undefined ? '--' : ('¥' + text)) } },
-        { title: '原售价', dataIndex: 'productPrice', align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '促销价', dataIndex: 'promoRuleGoods.goodsPrice', align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '成本价', dataIndex: 'cost', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '原售价', dataIndex: 'productPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '促销价', dataIndex: 'promoRuleGoods.goodsPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '数量', dataIndex: 'qty', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
         { title: '单位', dataIndex: 'unit', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promoRuleGoods.promoRuleTypeName', width: 200, align: 'center', customRender: function (text) { return text || '--' } }

+ 24 - 9
src/views/salesManagement/salesQuery/detail.vue

@@ -24,7 +24,9 @@
         <a-collapse-panel key="1" header="基础信息">
           <a-descriptions size="small" :column="3" v-if="detailData">
             <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货地址">{{ detailData.salesBillExtEntity.shippingAddrProvinceName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCityName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCountyName || '--' }}{{ detailData.salesBillExtEntity.shippingAddr || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址">
+              {{ shippingAddress }}
+            </a-descriptions-item>
             <a-descriptions-item label="收款方式">{{ detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
             <a-descriptions-item label="收货人">{{ detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
             <a-descriptions-item label="收货电话">{{ detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
@@ -70,7 +72,7 @@
         size="large"
         style="width: 150px;"
         id="salesDetail-edit-btn"
-        v-if="detailData&&detailData.salesBillSource != 'PURCHASE' && (detailData.billStatus == 'WAIT_SUBMIT' || detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'AUDIT_REJECT')"
+        v-if="detailData&&detailData.salesBillSource != 'PURCHASE' && (detailData.billStatus == 'WAIT_SUBMIT' || detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')"
         @click="handleEdit(record)"
       >
         编辑
@@ -81,7 +83,7 @@
         type="primary"
         class="button-info"
         id="salesDetail-edit-btn"
-        v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')"
+        v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
         @click="handleEdit(record)"
       >
         改单
@@ -116,13 +118,13 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: 220, scopedSlots: { customRender: 'productCode' }, align: 'center' },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'showCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '销售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '成本价', dataIndex: 'showCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '销售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
-        { title: '已取消数', dataIndex: 'cancelQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
-        { title: '已下推数', dataIndex: 'pushedQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
-        { title: '待下推数', dataIndex: 'unpushedQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } }
+        { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已取消数', dataIndex: 'cancelQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已下推数', dataIndex: 'pushedQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待下推数', dataIndex: 'unpushedQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -148,6 +150,19 @@ export default {
       detailData: null //  详情数据
     }
   },
+  computed: {
+    shippingAddress () {
+      const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
+      const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
+      const shippingAddrCountyName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCountyName ? this.detailData.salesBillExtEntity.shippingAddrCountyName : ''
+      const shippingAddr = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddr ? this.detailData.salesBillExtEntity.shippingAddr : ''
+      if (!shippingAddrProvinceName && !shippingAddrCityName && !shippingAddrCountyName && !shippingAddr) {
+        return '--'
+      } else {
+        return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
+      }
+    }
+  },
   methods: {
     //  返回
     handleBack () {

+ 7 - 3
src/views/salesManagement/salesQuery/edit.vue

@@ -187,12 +187,12 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', sorter: true },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, align: 'center' },
-        { title: '售价', dataIndex: 'price', width: 120, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '售价', dataIndex: 'price', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -263,6 +263,7 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesDetailDelAll({ salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm()
@@ -270,6 +271,7 @@ export default {
               _this.$message.success(res.message)
             }
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })
@@ -284,6 +286,7 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm(true)
@@ -291,6 +294,7 @@ export default {
               _this.$message.success(res.message)
             }
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })

+ 196 - 177
src/views/salesManagement/salesQuery/list.vue

@@ -1,184 +1,187 @@
 <template>
   <a-card size="small" :bordered="false" class="salesManagementList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <custList id="salesManagementList-buyerName" ref="custList" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售单号">
-              <a-input id="salesManagementList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="采购单号">
-                <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="打印状态">
-                <v-select
-                  v-model="queryParam.printStatus"
-                  ref="printStatus"
-                  id="salesManagementList-printStatus"
-                  code="PRINT_STATUS"
-                  placeholder="请选择打印状态"
-                  allowClear></v-select>
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <custList id="salesManagementList-buyerName" ref="custList" @change="custChange"></custList>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
-                <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="salesManagementList-billStatus"
-                  code="SALES_BILL_STATUS"
-                  placeholder="请选择业务状态"
-                  allowClear></v-select>
+              <a-form-item label="销售单号">
+                <a-input id="salesManagementList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-item>
             </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="采购单号">
+                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="打印状态">
+                  <v-select
+                    v-model="queryParam.printStatus"
+                    ref="printStatus"
+                    id="salesManagementList-printStatus"
+                    code="PRINT_STATUS"
+                    placeholder="请选择打印状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="salesManagementList-billStatus"
+                    code="SALES_BILL_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.financialStatus"
+                    ref="financialStatus"
+                    id="salesManagementList-financialStatus"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
             <a-col :md="6" :sm="24">
-              <a-form-item label="财务状态">
-                <v-select
-                  v-model="queryParam.financialStatus"
-                  ref="financialStatus"
-                  id="salesManagementList-financialStatus"
-                  code="FINANCIAL_RECEIVE_STATUS"
-                  placeholder="请选择财务状态"
-                  allowClear></v-select>
-              </a-form-item>
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
-              <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <!-- <div class="table-operator">
-      <a-button type="primary" class="button-error" @click="handleAdd">新增</a-button>
-    </div> -->
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">
-        <div>
-          总单数:<strong>{{ totalData.totalRecord }}</strong>;
-          总款数:<strong>{{ totalData.totalCategory }}</strong>;
-          总数量:<strong>{{ totalData.totalQty }}</strong>;
-          已下推数量:<strong>{{ totalData.totalPushedQty }}</strong>;
-          已发货数量:<strong>{{ totalData.totalDispatchQty }}</strong>;
-          已取消数量:<strong>{{ totalData.totalCancelQty }}</strong>;
-          待下推数量:<strong>{{ totalData.totalUnpushedQty }}</strong>;
-        </div>
-        <div>
-          总售价:<strong>{{ totalData.totalAmount }}</strong>元;
-          已下推金额::<strong>{{ totalData.totalPushedAmount }}</strong>元;
-          已取消金额::<strong>{{ totalData.totalCancelAmount }}</strong>元;
-          待下推金额::<strong>{{ totalData.totalUnpushedAmount }}</strong>元;
-          已发货金额::<strong>{{ totalData.totalDispatchAmount }}</strong>元;
-        </div>
+          </a-row>
+        </a-form>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2640, y:tableHeight }"
-      bordered>
-      <!-- 销售单号 -->
-      <template slot="salesBillNo" slot-scope="text, record">
-        <a-badge :count="'改'+record.changeTimes" :offset="[0,-10]" v-if="record.changeTimes>0">
-          <span style="color: #00aaff;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-        </a-badge>
-        <span v-else style="color: #00aaff;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-      </template>
-      <!-- 总数量 -->
-      <template slot="totalQty" slot-scope="text, record">
-        {{ record.totalQty }}
-      </template>
-      <!-- 财务状态 -->
-      <template slot="financialStatus" slot-scope="text, record">
-        <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.financialStatusDictValue" />
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-warning"
-          v-if="record.billStatus == 'WAIT_AUDIT'"
-          @click="handleEexamine(record)"
-        >审核</a-button>
-
-        <a-button
-          size="small"
-          type="link"
-          class="button-warning"
-          v-if="record.billStatus == 'OUTING_WAREHOUSE'&&record.totalUnpushedQty>0"
-          @click="handleDispatch(record)"
-        >下推</a-button>
-
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')"
-          @click="handleEdit(record)"
-        >
-          编辑
-        </a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')"
-          @click="handleEdit(record)"
-        >
-          改单
-        </a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')"
-          @click="handleDel(record)"
-        >
-          删除
-        </a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')"
-          @click="handleDel(record)"
-        >
-          取消
-        </a-button>
-        <span v-if="record.billStatus == 'FINISH'||record.billStatus == 'CANCEL'||(record.billStatus == 'OUTING_WAREHOUSE'&&record.totalUnpushedQty<=0)">--</span>
-      </template>
-    </s-table>
+      <!-- 操作按钮 -->
+      <!-- <div class="table-operator">
+        <a-button type="primary" class="button-error" @click="handleAdd">新增</a-button>
+      </div> -->
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">
+          <div>
+            总单数:<strong>{{ totalData.totalRecord }}</strong>;
+            总款数:<strong>{{ totalData.totalCategory }}</strong>;
+            总数量:<strong>{{ totalData.totalQty }}</strong>;
+            已下推数量:<strong>{{ totalData.totalPushedQty }}</strong>;
+            已发货数量:<strong>{{ totalData.totalDispatchQty }}</strong>;
+            已取消数量:<strong>{{ totalData.totalCancelQty }}</strong>;
+            待下推数量:<strong>{{ totalData.totalUnpushedQty }}</strong>;
+          </div>
+          <div>
+            总售价:<strong>{{ totalData.totalAmount }}</strong>元;
+            已下推金额::<strong>{{ totalData.totalPushedAmount }}</strong>元;
+            已取消金额::<strong>{{ totalData.totalCancelAmount }}</strong>元;
+            待下推金额::<strong>{{ totalData.totalUnpushedAmount }}</strong>元;
+            已发货金额::<strong>{{ totalData.totalDispatchAmount }}</strong>元;
+          </div>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2640, y:tableHeight }"
+        bordered>
+        <!-- 销售单号 -->
+        <template slot="salesBillNo" slot-scope="text, record">
+          <div v-if="$hasPermissions('B_salesDetail')">
+            <a-badge :count="'改'+record.changeTimes" :offset="[0,-10]" v-if="record.changeTimes>0">
+              <span style="color: #00aaff;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+            </a-badge>
+            <span v-else style="color: #00aaff;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+          </div>
+          <div v-else>{{ record.salesBillNo }}</div>
+        </template>
+        <!-- 总数量 -->
+        <template slot="totalQty" slot-scope="text, record">
+          {{ record.totalQty }}
+        </template>
+        <!-- 财务状态 -->
+        <template slot="financialStatus" slot-scope="text, record">
+          <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.financialStatusDictValue" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            v-if="record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
+            @click="handleEexamine(record)"
+          >审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            v-if="record.billStatus == 'OUTING_WAREHOUSE'&&record.totalUnpushedQty>0&&$hasPermissions('B_salesDispatch')"
+            @click="handleDispatch(record)"
+          >下推</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')"
+            @click="handleEdit(record)"
+          >
+            编辑
+          </a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
+            @click="handleEdit(record)"
+          >
+            改单
+          </a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesDel')"
+            @click="handleDel(record)"
+          >
+            删除
+          </a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesDel')"
+            @click="handleDel(record)"
+          >
+            取消
+          </a-button>
+          <span v-if="!(record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')) && !(record.billStatus == 'OUTING_WAREHOUSE'&&record.totalUnpushedQty>0&&$hasPermissions('B_salesDispatch')) && !(record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')) && !(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')) && !(record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesDel')) && !(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesDel'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
     <!-- 审核 -->
@@ -187,6 +190,8 @@
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import auditModal from '@/views/common/auditModal.vue'
@@ -199,14 +204,19 @@ export default {
   components: { STable, VSelect, chooseCustomModal, custList, rangeDate, auditModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
       // 查询参数
       queryParam: {
-        beginDate: '',
-        endDate: '',
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         buyerSn: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         purchaseBillNo: '',
@@ -231,13 +241,13 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: 120, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 210, align: 'center' },
         { title: '采购单号', dataIndex: 'purchaseBillNo', width: 210, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: 100, align: 'center' },
-        { title: '总售价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '总售价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '已下推数量', dataIndex: 'totalPushedQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已发货数量', dataIndex: 'totalDispatchQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已取消数量', dataIndex: 'totalCancelQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -245,8 +255,8 @@ export default {
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' },
-        { title: '财务状态', dataIndex: 'financialStatusDictValue', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'financialStatus', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
         { title: '打印次数', dataIndex: 'detailPrintTimes', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 220, align: 'center', fixed: 'right' }
       ],
@@ -296,7 +306,9 @@ export default {
     },
     // 下推
     handleDispatch (row) {
+      this.spinning = true
       findBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => {
+        this.spinning = false
         if (res.status == 200) {
           this.$router.push({ name: 'waitDispatch', params: { salesBillSn: row.salesBillSn, dispatchBillSn: res.data.dispatchBillSn } })
         }
@@ -308,6 +320,7 @@ export default {
       this.visibleAudit = true
     },
     auditOrder (billStatus) {
+      this.spinning = true
       salesWriteAudit({
         salesBillSn: this.auditInfo.salesBillSn,
         billStatus: billStatus
@@ -316,11 +329,13 @@ export default {
           this.visibleAudit = false
           this.$message.success(res.message)
           this.$refs.table.refresh()
+          this.spinning = false
           if (billStatus == 'OUTING_WAREHOUSE') {
             this.handleDispatch({ salesBillSn: this.auditInfo.salesBillSn })
           }
         } else {
           this.visibleAudit = false
+          this.spinning = false
         }
       })
     },
@@ -341,10 +356,14 @@ export default {
         centered: true,
         closable: true,
         onOk () {
+          _this.spinning = true
           salesDel({ salesBillSn: row.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -352,9 +371,9 @@ export default {
     },
     // 重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.$refs.custList.resetForm()
       this.queryParam.buyerSn = undefined
       this.queryParam.salesBillNo = ''

+ 3 - 3
src/views/salesManagement/salesQuery/queryPart.vue

@@ -126,10 +126,10 @@ export default {
         { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, align: 'center' },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'productPrice', width: 120, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '包装数', dataIndex: 'packQtyV', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
+        { title: '售价', dataIndex: 'productPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '包装数', dataIndex: 'packQtyV', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],

+ 4 - 4
src/views/salesManagement/salesQuery/queryPromotable.vue

@@ -60,11 +60,11 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', sorter: true },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, align: 'center' },
-        { title: '成本价', dataIndex: 'showCost', width: 120, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '原售价', dataIndex: 'origPrice', width: 120, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '促销价', dataIndex: 'price', width: 120, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '成本价', dataIndex: 'showCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '原售价', dataIndex: 'origPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '促销价', dataIndex: 'price', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '数量', dataIndex: 'qty', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promotionRulesName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },

部分文件因为文件数量过多而无法显示