Browse Source

Merge branch 'deploy' of jianguan-web/qpls-md-html into master

陈瑞 4 years ago
parent
commit
7fa8a7002e
100 changed files with 6337 additions and 6175 deletions
  1. 2 2
      .env
  2. 2 2
      .env.development
  3. 2 2
      .env.preview
  4. 0 47
      public/adapter.js
  5. 32 48
      public/index.html
  6. 104 0
      src/api/reportData.js
  7. 48 0
      src/api/reportStock.js
  8. 7 0
      src/components/Table/index.js
  9. 1 1
      src/components/tools/UserMenu.vue
  10. 558 500
      src/config/router.config.js
  11. 11 10
      src/store/modules/permission.js
  12. 3 1
      src/store/modules/websocketStore.js
  13. 2 2
      src/views/allocationManagement/chainTransferIn/detail.vue
  14. 1 2
      src/views/allocationManagement/chainTransferIn/edit.vue
  15. 113 105
      src/views/allocationManagement/chainTransferIn/list.vue
  16. 2 2
      src/views/allocationManagement/chainTransferOut/detail.vue
  17. 9 1
      src/views/allocationManagement/chainTransferOut/edit.vue
  18. 132 116
      src/views/allocationManagement/chainTransferOut/list.vue
  19. 2 2
      src/views/allocationManagement/storeTransferOut/detail.vue
  20. 5 1
      src/views/allocationManagement/storeTransferOut/edit.vue
  21. 124 108
      src/views/allocationManagement/storeTransferOut/list.vue
  22. 1 5
      src/views/allocationManagement/warehouseAllocation/detail.vue
  23. 4 1
      src/views/allocationManagement/warehouseAllocation/edit.vue
  24. 106 93
      src/views/allocationManagement/warehouseAllocation/list.vue
  25. 41 33
      src/views/basicData/bulkPartsTypeManagement/list.vue
  26. 58 49
      src/views/basicData/customerTypeManagement/list.vue
  27. 0 1
      src/views/basicData/expenseType/editModal.vue
  28. 52 44
      src/views/basicData/expenseType/list.vue
  29. 43 35
      src/views/basicData/storeTransferOutTypeManagement/list.vue
  30. 1 1
      src/views/bulkManagement/bulkWarehousingOrder/detail.vue
  31. 5 4
      src/views/bulkManagement/bulkWarehousingOrder/edit.vue
  32. 137 121
      src/views/bulkManagement/bulkWarehousingOrder/list.vue
  33. 4 0
      src/views/common/rangeDate.vue
  34. 119 113
      src/views/customerManagement/customerInfo/list.vue
  35. 11 2
      src/views/financialManagement/companyCollectionPayment/list.vue
  36. 7 7
      src/views/financialManagement/companyReceivablePayable/collectionPayment.vue
  37. 15 2
      src/views/financialManagement/companyReceivablePayable/list.vue
  38. 56 56
      src/views/financialManagement/expenseManagement/edit.vue
  39. 126 106
      src/views/financialManagement/expenseManagement/list.vue
  40. 8 8
      src/views/financialManagement/financialCollection/detailModal.vue
  41. 134 199
      src/views/financialManagement/financialCollection/list.vue
  42. 8 8
      src/views/financialManagement/financialPayment/detailModal.vue
  43. 132 196
      src/views/financialManagement/financialPayment/list.vue
  44. 1 1
      src/views/financialManagement/warehousingAudit/detail.vue
  45. 97 81
      src/views/financialManagement/warehousingAudit/list.vue
  46. 1 1
      src/views/financialManagement/withdrawalManagement/list.vue
  47. 0 1
      src/views/inventoryManagement/inventoryQuery/detailModal.vue
  48. 116 98
      src/views/inventoryManagement/inventoryQuery/list.vue
  49. 163 150
      src/views/inventoryManagement/inventoryWarning/list.vue
  50. 62 54
      src/views/inventoryManagement/satelliteWarehouseInventory/list.vue
  51. 64 58
      src/views/inventoryManagement/warehouse/list.vue
  52. 65 57
      src/views/inventoryManagement/warehouse/storingLocation/list.vue
  53. 177 181
      src/views/power/dataDictionary/codeItemModal.vue
  54. 78 83
      src/views/power/dataDictionary/codeModal.vue
  55. 103 106
      src/views/power/dataDictionary/dataDictionary.vue
  56. 34 31
      src/views/power/role/menuModal.vue
  57. 77 71
      src/views/power/role/roleList.vue
  58. 64 67
      src/views/power/role/roleModal.vue
  59. 77 64
      src/views/power/user/userList.vue
  60. 98 93
      src/views/power/user/userModal.vue
  61. 28 23
      src/views/power/user/userSyncModal.vue
  62. 0 20
      src/views/productManagement/priceChangeRecord/list.vue
  63. 65 59
      src/views/productManagement/productBrand/list.vue
  64. 52 45
      src/views/productManagement/productCategory/list.vue
  65. 14 22
      src/views/productManagement/productInfo/edit.vue
  66. 124 116
      src/views/productManagement/productInfo/list.vue
  67. 1 1
      src/views/purchasingManagement/purchaseOrder/detail.vue
  68. 28 11
      src/views/purchasingManagement/purchaseOrder/edit.vue
  69. 130 122
      src/views/purchasingManagement/purchaseOrder/list.vue
  70. 82 67
      src/views/purchasingManagement/purchaseOrder/receivingAddress/chooseAddressModal.vue
  71. 56 47
      src/views/purchasingManagement/purchaseOrder/receivingAddress/editAddressModal.vue
  72. 6 7
      src/views/purchasingManagement/purchaseOrder/warehousing.vue
  73. 1 1
      src/views/purchasingManagement/purchaseReturn/detail.vue
  74. 13 5
      src/views/purchasingManagement/purchaseReturn/edit.vue
  75. 100 88
      src/views/purchasingManagement/purchaseReturn/list.vue
  76. 205 345
      src/views/reportData/chainReceivedSendStorageReport/list.vue
  77. 282 218
      src/views/reportData/chainSalesDetailReport/list.vue
  78. 198 165
      src/views/reportData/chainSalesReport/list.vue
  79. 23 49
      src/views/reportData/chainStockReport/detailModal.vue
  80. 188 151
      src/views/reportData/chainStockReport/list.vue
  81. 179 106
      src/views/reportData/customerReport/list.vue
  82. 189 346
      src/views/reportData/receivedSendStorageReport/list.vue
  83. 156 138
      src/views/reportData/stockExpenditureReport/list.vue
  84. 156 132
      src/views/reportData/stockIncomeReport/list.vue
  85. 3 3
      src/views/salesManagement/giftRecord/list.vue
  86. 0 156
      src/views/salesManagement/outboundOrder/detail.vue
  87. 118 93
      src/views/salesManagement/outboundOrder/list.vue
  88. 17 13
      src/views/salesManagement/salesQuery/chooseCustomModal.vue
  89. 34 25
      src/views/salesManagement/salesQuery/detail.vue
  90. 12 6
      src/views/salesManagement/salesQuery/edit.vue
  91. 174 177
      src/views/salesManagement/salesQuery/list.vue
  92. 5 25
      src/views/salesManagement/salesQuery/productSalesRecordModal.vue
  93. 3 4
      src/views/salesManagement/salesQuery/queryPart.vue
  94. 12 10
      src/views/salesManagement/salesReturn/chooseCustomModal.vue
  95. 3 3
      src/views/salesManagement/salesReturn/detail.vue
  96. 125 113
      src/views/salesManagement/salesReturn/list.vue
  97. 8 8
      src/views/salesManagement/salesReturn/queryPart.vue
  98. 10 2
      src/views/salesManagement/salesReturn/salesReturnEdit.vue
  99. 11 5
      src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue
  100. 21 15
      src/views/salesManagement/urgentItemsOffset/detail.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

+ 32 - 48
public/index.html

@@ -11,55 +11,39 @@
     <% 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
+    	//  非谷歌浏览器或非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>

+ 104 - 0
src/api/reportData.js

@@ -0,0 +1,104 @@
+import { axios } from '@/utils/request'
+// 连锁收发存报表-分页列表
+export const linkageReportPageList = (params) => {
+  const url = `report/reportStockPutOut/linkageReportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁收发存报表-列表合计
+export const linkageReportPageTotal = (params) => {
+  return axios({
+    url: 'report/reportStockPutOut/linkageReportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 收发存报表-分页列表
+export const reportPageList = (params) => {
+  const url = `report/reportStockPutOut/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 收发存报表-列表合计
+export const linkageReportTotal = (params) => {
+  return axios({
+    url: 'report/reportStockPutOut/linkageReportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 大客户报表-分页列表
+export const reportBigCustomerList = (params) => {
+  const url = `report/reportBigCustomer/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 大客户报表-列表合计
+export const reportBigCustomerCount = (params) => {
+  return axios({
+    url: 'report/reportBigCustomer/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁销售报表-分页列表
+export const reportSalesBillList = (params) => {
+  const url = `/report/reportSalesBill/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁销售报表-列表合计
+export const reportSalesBillCount = (params) => {
+  return axios({
+    url: '/report/reportSalesBill/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁销售明细报表-分页列表
+export const reportSalesBillDetailList = (params) => {
+  const url = `/report/reportSalesBill/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁销售明细报表-列表合计
+export const reportSalesBillDetailCount = (params) => {
+  return axios({
+    url: '/report/reportSalesBill/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁店
+export const linkageGroupList = (params) => {
+  return axios({
+    url: '/report/linkageGroup/findListByDealerSn',
+    data: params,
+    method: 'post'
+  })
+}

+ 48 - 0
src/api/reportStock.js

@@ -0,0 +1,48 @@
+import { axios } from '@/utils/request'
+
+//  连锁库存总表  列表  有分页
+export const reportStockList = (params) => {
+  const url = `/report/reportStock/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  连锁库存总表  列表  合计
+export const reportStockCount = (params) => {
+  return axios({
+    url: '/report/reportStock/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  连锁库存总表  详情  列表  有分页
+export const reportStockDetailList = (params) => {
+  const url = `/report/reportStock/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存总入报表
+export const reportStockPutList = (params) => {
+  return axios({
+    url: '/report/reportStockPut/report',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存总出报表
+export const reportStockOutList = (params) => {
+  return axios({
+    url: '/report/reportStockOut/report',
+    data: params,
+    method: 'post'
+  })
+}

+ 7 - 0
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 分页选项器

+ 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(() => {

File diff suppressed because it is too large
+ 558 - 500
src/config/router.config.js


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

@@ -9,16 +9,17 @@ 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
+    //   }
+    // }
+    // console.log(flag)
     return flag
   }
   return true

+ 3 - 1
src/store/modules/websocketStore.js

@@ -53,7 +53,9 @@ export default {
         // console.log('ws发送心跳!')
         if (state.websock.readyState == 3) {
           clearInterval(state.heartInterId)
-          _this.commit('WEBSOCKET_INIT', url)
+          setTimeout(function() {
+            _this.commit('WEBSOCKET_INIT', url)
+          }, 500);
         }
         state.websock.send('ping')
       }, 10000)

+ 2 - 2
src/views/allocationManagement/chainTransferIn/detail.vue

@@ -6,7 +6,7 @@
         <template slot="subTitle">
           <a id="chainTransferInDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <a-button
-            v-if="isEdit"
+            v-if="isEdit&&$hasPermissions('B_allocLinkagePutEdit')"
             type="primary"
             size="small"
             style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
@@ -14,7 +14,7 @@
             @click.stop="handleEdit">编辑</a-button>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_allocLinkagePutPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>

+ 1 - 2
src/views/allocationManagement/chainTransferIn/edit.vue

@@ -7,7 +7,7 @@
           <a id="chainTransferInEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_allocLinkagePutPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -317,7 +317,6 @@ export default {
             }
           })
           this.warehouseCascadeData = res.data
-          console.log(this.warehouseCascadeData)
         } else {
           this.warehouseCascadeData = []
         }

+ 113 - 105
src/views/allocationManagement/chainTransferIn/list.vue

@@ -1,118 +1,121 @@
 <template>
   <a-card size="small" :bordered="false" class="chainTransferInList-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-select
-                placeholder="请选择调出对象"
-                allowClear
-                id="chainTransferInList-outTenantSn"
-                v-model="queryParam.outTenantSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in outTenantSnData" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调拨产品类型">
-              <v-select
-                v-model="queryParam.allocationType"
-                ref="allocationType"
-                id="chainTransferInList-allocationType"
-                code="ALLOCATION_LINKAGE_PRODUCT_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="chainTransferInList-state"
-                  code="ALLOCATION_LINKAGE_PUT_STATUS"
-                  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-select
+                  placeholder="请选择调出对象"
+                  allowClear
+                  id="chainTransferInList-outTenantSn"
+                  v-model="queryParam.outTenantSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in outTenantSnData" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="财务状态">
+              <a-form-item label="调拨产品类型">
                 <v-select
-                  v-model="queryParam.settleState"
-                  ref="settleState"
-                  id="chainTransferInList-settleState"
-                  code="FINANCIAL_PAY_STATUS"
-                  placeholder="请选择财务状态"
+                  v-model="queryParam.allocationType"
+                  ref="allocationType"
+                  id="chainTransferInList-allocationType"
+                  code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
+                  placeholder="请选择调拨产品类型"
                   allowClear></v-select>
               </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="chainTransferInList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferInList-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: 1650, y: tableHeight }"
-      bordered>
-      <!-- 连锁调入单号 -->
-      <template slot="allocationLinkagePutNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</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_SUBMIT'"
-          class="button-primary"
-          @click="handleEdit(record)"
-          id="chainTransferInList-warehousing-btn">入库</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          class="button-warning"
-          @click="handleExamine(record)"
-          id="chainTransferInList-examine-btn">审核</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="chainTransferInList-edit-btn">编辑</a-button>
-        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')">--</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="chainTransferInList-state"
+                    code="ALLOCATION_LINKAGE_PUT_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.settleState"
+                    ref="settleState"
+                    id="chainTransferInList-settleState"
+                    code="FINANCIAL_PAY_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </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="chainTransferInList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferInList-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: 1650, y: tableHeight }"
+        bordered>
+        <!-- 连锁调入单号 -->
+        <template slot="allocationLinkagePutNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_allocLinkagePutDetail')" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</span>
+          <span v-else>{{ record.allocationLinkagePutNo }}</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_SUBMIT'&&$hasPermissions('B_allocLinkagePutEdit')"
+            class="button-primary"
+            @click="handleEdit(record)"
+            id="chainTransferInList-warehousing-btn">入库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutAudit')"
+            class="button-warning"
+            @click="handleExamine(record)"
+            id="chainTransferInList-examine-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutEdit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="chainTransferInList-edit-btn">编辑</a-button>
+          <span v-if="((record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')) || (!(record.state == 'WAIT_SUBMIT'&&$hasPermissions('B_allocLinkagePutEdit'))&&!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutAudit'))&&!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkagePutEdit')))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -125,6 +128,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
@@ -202,10 +206,14 @@ export default {
         content: '确认要审核通过吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocLinkagePutAudit({ sn: row.allocationLinkagePutSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 2 - 2
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -6,7 +6,7 @@
         <template slot="subTitle">
           <a id="chainTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <a-button
-            v-if="isEdit"
+            v-if="isEdit&&$hasPermissions('B_allocLinkageOutEdit')"
             type="primary"
             size="small"
             style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
@@ -14,7 +14,7 @@
             @click.stop="handleEdit">编辑</a-button>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_allocLinkageOutPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>

+ 9 - 1
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">调往对象:{{ (basicInfoData&&basicInfoData.putTenantName) || '--' }}</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_allocLinkageOutPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -369,19 +369,27 @@ export default {
         centered: true,
         onOk () {
           if (isAll) { //  整单删除
+            _this.spinning = true
             allocLinkageOutDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.getProductList()
                 _this.$refs.chooseTable.refresh()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
               }
             })
           } else { //  单个删除
+            _this.spinning = true
             allocLinkageOutDetailDel({ id: row.id }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.getProductList()
                 _this.$refs.chooseTable.refresh()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
               }
             })
           }

+ 132 - 116
src/views/allocationManagement/chainTransferOut/list.vue

@@ -1,129 +1,132 @@
 <template>
   <a-card size="small" :bordered="false" class="chainTransferOutList-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="createDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调往对象">
-              <a-select
-                placeholder="请选择调往对象"
-                allowClear
-                id="chainTransferOutList-putTenantSn"
-                v-model="queryParam.putTenantSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in putTenantSnData" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调出产品类型">
-              <v-select
-                v-model="queryParam.allocationType"
-                ref="allocationType"
-                id="chainTransferOutList-allocationType"
-                code="ALLOCATION_LINKAGE_PRODUCT_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="chainTransferOutList-state"
-                  code="ALLOCATION_LINKAGE_OUT_STATUS"
-                  placeholder="请选择业务状态"
-                  allowClear></v-select>
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="createDate" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调往对象">
+                <a-select
+                  placeholder="请选择调往对象"
+                  allowClear
+                  id="chainTransferOutList-putTenantSn"
+                  v-model="queryParam.putTenantSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in putTenantSnData" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="财务状态">
+              <a-form-item label="调出产品类型">
                 <v-select
-                  v-model="queryParam.settleState"
-                  ref="settleState"
-                  id="chainTransferOutList-settleState"
-                  code="FINANCIAL_RECEIVE_STATUS"
-                  placeholder="请选择财务状态"
+                  v-model="queryParam.allocationType"
+                  ref="allocationType"
+                  id="chainTransferOutList-allocationType"
+                  code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
+                  placeholder="请选择调出产品类型"
                   allowClear></v-select>
               </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="chainTransferOutList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutList-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="chainTransferOutList-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: 1670, y: tableHeight }"
-      bordered>
-      <!-- 连锁调出单号 -->
-      <template slot="allocationLinkageOutNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocationLinkageOutNo }}</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="chainTransferOutList-examine-btn">审核</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT'"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="chainTransferOutList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_OUT_WAREHOUSE'"
-          class="button-primary"
-          @click="handleOut(record)"
-          id="chainTransferOutList-out-btn">出库</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT' || record.state == 'WAIT_OUT_WAREHOUSE'"
-          class="button-error"
-          @click="handleDel(record)"
-          id="chainTransferOutList-del-btn">删除</a-button>
-        <span v-if="record.state != 'WAIT_SUBMIT' && record.state != 'WAIT_AUDIT' && record.state != 'WAIT_OUT_WAREHOUSE'">--</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="chainTransferOutList-state"
+                    code="ALLOCATION_LINKAGE_OUT_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.settleState"
+                    ref="settleState"
+                    id="chainTransferOutList-settleState"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </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="chainTransferOutList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutList-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="chainTransferOutList-add" v-if="$hasPermissions('B_allocLinkageOutNew')" 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: 1670, y: tableHeight }"
+        bordered>
+        <!-- 连锁调出单号 -->
+        <template slot="allocationLinkageOutNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_allocLinkageOutDetail')" @click="handleDetail(record)">{{ record.allocationLinkageOutNo }}</span>
+          <span v-else>{{ record.allocationLinkageOutNo }}</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_allocLinkageOutAudit')"
+            class="button-warning"
+            @click="handleExamine(record)"
+            id="chainTransferOutList-examine-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT') &&$hasPermissions('B_allocLinkageOutEdit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="chainTransferOutList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_allocLinkageOutStock')"
+            class="button-primary"
+            @click="handleOut(record)"
+            id="chainTransferOutList-out-btn">出库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT' || record.state == 'WAIT_OUT_WAREHOUSE') &&$hasPermissions('B_allocLinkageOutDel')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="chainTransferOutList-del-btn">删除</a-button>
+          <span v-if="(record.state != 'WAIT_SUBMIT' && record.state != 'WAIT_AUDIT' && record.state != 'WAIT_OUT_WAREHOUSE')|| (!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocLinkageOutAudit')) && !((record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT') &&$hasPermissions('B_allocLinkageOutEdit')) && !(record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_allocLinkageOutStock')))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
   </a-card>
@@ -140,6 +143,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       createDate: [
@@ -219,10 +223,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocLinkageOutDel({ sn: row.allocationLinkageOutSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -236,10 +244,14 @@ export default {
         content: '确认要出库吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocLinkageOutStock({ sn: row.allocationLinkageOutSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -253,10 +265,14 @@ export default {
         content: '确认要审核通过吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocLinkageAudit({ sn: row.allocationLinkageOutSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 2 - 2
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -6,7 +6,7 @@
         <template slot="subTitle">
           <a id="storeTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <a-button
-            v-if="isEdit"
+            v-if="isEdit&&$hasPermissions('B_storeCallOutEdit')"
             type="primary"
             size="small"
             style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
@@ -14,7 +14,7 @@
             @click.stop="handleEdit">编辑</a-button>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_storeCallOutPrint')">
           <a-checkbox key="4" v-model="printCostChecked">打印成本</a-checkbox>
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>

+ 5 - 1
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">调往对象名称:{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_storeCallOutPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -394,11 +394,15 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           storeCallOutDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
               _this.getChooseProductList()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 124 - 108
src/views/allocationManagement/storeTransferOut/list.vue

@@ -1,118 +1,121 @@
 <template>
   <a-card size="small" :bordered="false" class="storeTransferOutList-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="storeTransferOutList-putPersonName" v-model.trim="queryParam.putPersonName" allowClear placeholder="请输入调往对象名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调拨类型">
-              <a-select id="storeTransferOutList-callOutType" v-model="queryParam.callOutType" placeholder="请选择调拨类型" allowClear >
-                <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ 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="storeTransferOutList-state"
-                  code="STORE_CALL_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="财务状态">
-                <v-select
-                  v-model="queryParam.settleState"
-                  ref="settleState"
-                  id="storeTransferOutList-settleState"
-                  code="FINANCIAL_RECEIVE_STATUS"
-                  placeholder="请选择财务状态"
-                  allowClear
-                ></v-select>
+              <a-form-item label="调往对象名称">
+                <a-input id="storeTransferOutList-putPersonName" v-model.trim="queryParam.putPersonName" 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="storeTransferOutList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-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="storeTransferOutList-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: 1500, y: tableHeight }"
-      bordered>
-      <!-- 店内调出单号 -->
-      <template slot="storeCallOutNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.storeCallOutNo }}</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="storeTransferOutList-examine-btn">审核</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="storeTransferOutList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_OUT_WAREHOUSE'"
-          class="button-primary"
-          @click="handleOut(record)"
-          id="storeTransferOutList-out-btn">出库</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'WAIT_OUT_WAREHOUSE')"
-          class="button-error"
-          @click="handleDel(record)"
-          id="storeTransferOutList-del-btn">删除</a-button>
-        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT') && (record.state != 'WAIT_OUT_WAREHOUSE')">--</span>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调拨类型">
+                <a-select id="storeTransferOutList-callOutType" v-model="queryParam.callOutType" placeholder="请选择调拨类型" allowClear >
+                  <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ 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="storeTransferOutList-state"
+                    code="STORE_CALL_OUT_STATE"
+                    placeholder="请选择业务状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.settleState"
+                    ref="settleState"
+                    id="storeTransferOutList-settleState"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear
+                  ></v-select>
+                </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="storeTransferOutList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-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="storeTransferOutList-add" v-if="$hasPermissions('B_storeTransferOutNews')" 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: 1500, y: tableHeight }"
+        bordered>
+        <!-- 店内调出单号 -->
+        <template slot="storeCallOutNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_storeCallOutDetail')" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
+          <span v-else>{{ record.storeCallOutNo }}</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_storeCallOutAudit')"
+            class="button-warning"
+            @click="handleExamine(record)"
+            id="storeTransferOutList-examine-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) &&$hasPermissions('B_storeCallOutEdit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="storeTransferOutList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_storeCallStockOut')"
+            class="button-primary"
+            @click="handleOut(record)"
+            id="storeTransferOutList-out-btn">出库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'WAIT_OUT_WAREHOUSE'))&&$hasPermissions('B_storeCallOutDel')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="storeTransferOutList-del-btn">删除</a-button>
+          <span v-if="!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_storeCallOutAudit')) && !(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) &&$hasPermissions('B_storeCallOutEdit')) && !(record.state == 'WAIT_OUT_WAREHOUSE'&&$hasPermissions('B_storeCallStockOut')) && !(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'WAIT_OUT_WAREHOUSE'))&&$hasPermissions('B_storeCallOutDel'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
   </a-card>
@@ -128,6 +131,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -150,7 +154,7 @@ export default {
         { title: '总成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
-        { title: '财务状态', scopedSlots: { customRender: 'settleState' }, width: 110, align: 'center' },
+        { title: '财务状态', dataIndex: 'settleState', scopedSlots: { customRender: 'settleState' }, width: 110, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -203,10 +207,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           storeCallOutDel({ 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
             }
           })
         }
@@ -220,10 +228,14 @@ export default {
         content: '确认要出库吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           storeCallOutOut({ storeCallOutSn: row.storeCallOutSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -237,10 +249,14 @@ export default {
         content: '确认要审核通过吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           storeCallOutAudit({ 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
             }
           })
         }

+ 1 - 5
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -5,7 +5,7 @@
       <template slot="subTitle">
         <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         <a-button
-          v-if="warehouse&&warehouse.stateDictValue!='已完结'"
+          v-if="warehouse&&warehouse.stateDictValue!='已完结'&&$hasPermissions('B_warehouseAllocationEdit')"
           type="primary"
           size="small"
           style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
@@ -13,7 +13,6 @@
           @click.stop="handleEdit">
           编辑
         </a-button>
-        <!-- <a id="warehouseAllocationDetail-back-edit" style="color: #1890ff;margin-left: 20px;" href="javascript:;" @click="handleBack">编辑</a> -->
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <!-- <template slot="extra">
@@ -174,10 +173,7 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      // vm.getProductBrand()
-      // vm.getProductType()
       vm.getHouse()
-      console.log(vm.id, vm.$route.params, 'vm.id')
     })
   }
 }

+ 4 - 1
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -425,11 +425,15 @@ export default {
           } else { //  单个删除
             params = { id: row.id }
           }
+          _this.spinning = true
           allocWarehouseDetailDel(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.getProductList()
               _this.getChooseProductList()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -605,7 +609,6 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getDetail()
-      // vm.getProductList(1)
       vm.getChooseProductList(1)
       vm.getProductBrand()
       vm.getProductType()

+ 106 - 93
src/views/allocationManagement/warehouseAllocation/list.vue

@@ -1,101 +1,105 @@
 <template>
   <a-card size="small" :bordered="false" class="warehouseAllocationList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" ref="searchForm" :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-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调出仓库">
-              <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
-                <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调入仓库">
-              <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
-                <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ 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" ref="searchForm" :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-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
-                <v-select
-                  v-model="queryParam.state"
-                  ref="state"
-                  id="warehouseAllocationList-state"
-                  code="ALLOCATION_WAREHOUSE_STATE"
-                  placeholder="请选择业务状态"
-                  allowClear
-                ></v-select>
+              <a-form-item label="调出仓库">
+                <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
+                  <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                </a-select>
               </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="warehouseAllocationList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-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="warehouseAllocationList-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: 1500, y: tableHeight }"
-      bordered>
-      <!-- 单号 -->
-      <template slot="allocationWarehouseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          v-if="record.state == 'WAIT_AUDIT'"
-          size="small"
-          type="link"
-          class="button-warning"
-          @click="handleExamine(record)"
-          id="warehouseAllocationList-examine-btn">
-          审核
-        </a-button>
-        <a-button
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
-          size="small"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="warehouseAllocationList-edit-btn">
-          编辑
-        </a-button>
-        <a-button
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
-          size="small"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="warehouseAllocationList-del-btn">
-          删除
-        </a-button>
-        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')">--</span>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调入仓库">
+                <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
+                  <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ 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="warehouseAllocationList-state"
+                    code="ALLOCATION_WAREHOUSE_STATE"
+                    placeholder="请选择业务状态"
+                    allowClear
+                  ></v-select>
+                </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="warehouseAllocationList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-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="warehouseAllocationList-add" v-if="$hasPermissions('B_warehouseAllocationNews')" 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: 1500, y: tableHeight }"
+        bordered>
+        <!-- 单号 -->
+        <template slot="allocationWarehouseNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_warehouseAllocationDetail')" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
+          <span v-else>{{ record.allocationWarehouseNo }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocWarehouseAudit')"
+            size="small"
+            type="link"
+            class="button-warning"
+            @click="handleExamine(record)"
+            id="warehouseAllocationList-examine-btn">
+            审核
+          </a-button>
+          <a-button
+            v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) && $hasPermissions('B_warehouseAllocationEdit')"
+            size="small"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="warehouseAllocationList-edit-btn">
+            编辑
+          </a-button>
+          <a-button
+            v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) && $hasPermissions('B_warehouseAllocationDel')"
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="warehouseAllocationList-del-btn">
+            删除
+          </a-button>
+          <span v-if="((record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')) || (!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocWarehouseAudit')) && !(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) && $hasPermissions('B_warehouseAllocationEdit')) &&!(((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) && $hasPermissions('B_warehouseAllocationDel'))) ">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑 -->
     <basic-info-modal :openModal="openModal" @ok="handleEdit" @close="openModal=false" />
   </a-card>
@@ -111,6 +115,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       warehouseList: [], // 仓库列表
@@ -188,10 +193,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocWarehouseDel({ 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
             }
           })
         }
@@ -205,10 +214,14 @@ export default {
         content: '确认要审核通过吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           allocWarehouseAudit({ allocationWarehouseSn: row.allocationWarehouseSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 41 - 33
src/views/basicData/bulkPartsTypeManagement/list.vue

@@ -1,38 +1,41 @@
 <template>
   <a-card size="small" :bordered="false" class="bulkPartsTypeList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator-nobor">
-      <a-button v-if="$hasPermissions('B_basicData_bulkPartsType_add')" id="bulkPartsTypeList-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: 300 }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          v-if="$hasPermissions('B_basicData_bulkPartsType_edit')"
-          size="small"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="bulkPartsTypeList-edit-btn">编辑</a-button>
-        <a-button
-          v-if="$hasPermissions('B_basicData_bulkPartsType_del')"
-          size="small"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="bulkPartsTypeList-del-btn"
-          style="margin: 0 0 0 8px;">删除</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator-nobor">
+        <a-button v-if="$hasPermissions('B_basicData_bulkPartsType_add')" id="bulkPartsTypeList-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: 300 }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            v-if="$hasPermissions('B_basicData_bulkPartsType_edit')"
+            size="small"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="bulkPartsTypeList-edit-btn">编辑</a-button>
+          <a-button
+            v-if="$hasPermissions('B_basicData_bulkPartsType_del')"
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="bulkPartsTypeList-del-btn"
+            style="margin: 0 0 0 8px;">删除</a-button>
+          <span v-if="!$hasPermissions('B_basicData_bulkPartsType_edit') && !$hasPermissions('B_basicData_bulkPartsType_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑散件类型 -->
     <bulkParts-type-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @close="closeModal" />
   </a-card>
@@ -46,6 +49,7 @@ export default {
   components: { STable, VSelect, bulkPartsTypeEditModal },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         name: '' //  散件类型名称
       },
@@ -94,10 +98,14 @@ export default {
         content: '删除后原数据不可恢复,是否删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           sparePartsPutTypeDel({ 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
             }
           })
         }

+ 58 - 49
src/views/basicData/customerTypeManagement/list.vue

@@ -1,53 +1,56 @@
 <template>
   <a-card size="small" :bordered="false" class="customerTypeList-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="customerTypeList-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="customerTypeList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="customerTypeList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button v-if="$hasPermissions('B_basicData_customerType_add')" id="customerTypeList-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: 300 }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          v-if="$hasPermissions('B_basicData_customerType_edit')"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="customerTypeList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          v-if="$hasPermissions('B_basicData_customerType_del')"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="customerTypeList-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="customerTypeList-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="customerTypeList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="customerTypeList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button v-if="$hasPermissions('B_basicData_customerType_add')" id="customerTypeList-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: 300 }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            v-if="$hasPermissions('B_basicData_customerType_edit')"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="customerTypeList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            v-if="$hasPermissions('B_basicData_customerType_del')"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="customerTypeList-del-btn">删除</a-button>
+          <span v-if="!$hasPermissions('B_basicData_customerType_edit') && !$hasPermissions('B_basicData_customerType_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑客户类型 -->
     <customer-type-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @close="closeModal" />
   </a-card>
@@ -61,6 +64,7 @@ export default {
   components: { STable, VSelect, customerTypeEditModal },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         name: '' //  客户类型名称
       },
@@ -106,13 +110,18 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '客户类型被使用,删除后客户资料中的原有客户类型将同步被删除,确定删除吗?',
+        // content: '客户类型被使用,删除后客户资料中的原有客户类型将同步被删除,确定删除吗?',
+        content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           custTypeDel({ 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
             }
           })
         }

+ 0 - 1
src/views/basicData/expenseType/editModal.vue

@@ -130,7 +130,6 @@ export default {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
       } else {
-        console.log(this.nowData)
         //  获取父级分类 名称
         if (this.nowData) {
           this.parentType = (this.nowData.namePaths ? (this.nowData.namePaths.replace(/,/g, '>') + '>') : '') + this.nowData.name

+ 52 - 44
src/views/basicData/expenseType/list.vue

@@ -1,49 +1,52 @@
 <template>
   <a-card size="small" :bordered="false" class="expenseTypeList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator-nobor">
-      <a-button v-if="$hasPermissions('B_basicData_expenseType_add')" id="expenseTypeList-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: 300 }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          v-if="record.typeLevel<3 && $hasPermissions('B_basicData_expenseType_add')"
-          type="link"
-          class="button-success"
-          size="small"
-          icon="plus"
-          id="expenseType-addSubItem"
-          @click="handleAdd(record)">新增子级</a-button>
-        <a-button
-          v-if="record.pid != 0 && $hasPermissions('B_basicData_expenseType_edit')"
-          type="link"
-          class="button-info"
-          size="small"
-          icon="edit"
-          id="expenseType-edit"
-          @click="handleEdit(record)">编辑</a-button>
-        <a-button
-          v-if="record.pid != 0 && $hasPermissions('B_basicData_expenseType_del')"
-          type="link"
-          class="button-error"
-          size="small"
-          icon="delete"
-          id="expenseType-del"
-          @click="handleDel(record)">删除</a-button>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator-nobor">
+        <a-button v-if="$hasPermissions('B_basicData_expenseType_add')" id="expenseTypeList-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: 300 }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            v-if="record.typeLevel<3 && $hasPermissions('B_basicData_expenseType_add')"
+            type="link"
+            class="button-success"
+            size="small"
+            icon="plus"
+            id="expenseType-addSubItem"
+            @click="handleAdd(record)">新增子级</a-button>
+          <a-button
+            v-if="record.pid != 0 && $hasPermissions('B_basicData_expenseType_edit')"
+            type="link"
+            class="button-info"
+            size="small"
+            icon="edit"
+            id="expenseType-edit"
+            @click="handleEdit(record)">编辑</a-button>
+          <a-button
+            v-if="record.pid != 0 && $hasPermissions('B_basicData_expenseType_del')"
+            type="link"
+            class="button-error"
+            size="small"
+            icon="delete"
+            id="expenseType-del"
+            @click="handleDel(record)">删除</a-button>
+          <span v-if="!$hasPermissions('B_basicData_expenseType_add') && !$hasPermissions('B_basicData_expenseType_edit') && !$hasPermissions('B_basicData_expenseType_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑费用类型 -->
     <expense-type-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -57,6 +60,7 @@ export default {
   components: { STable, expenseTypeEditModal },
   data () {
     return {
+      spinning: false,
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
@@ -125,10 +129,14 @@ export default {
         content: '删除后原数据不可恢复,是否删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           costTypeDel({ id: _this.nowId }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 43 - 35
src/views/basicData/storeTransferOutTypeManagement/list.vue

@@ -1,42 +1,45 @@
 <template>
   <a-card size="small" :bordered="false" class="storeTransferOutTypeList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator-nobor">
-      <a-button
-        v-if="$hasPermissions('B_basicData_storeTransferOutType_add')"
-        id="storeTransferOutTypeList-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: 300 }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator-nobor">
         <a-button
-          v-if="$hasPermissions('B_basicData_storeTransferOutType_edit')"
-          size="small"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="storeTransferOutTypeList-edit-btn">编辑</a-button>
-        <a-button
-          v-if="$hasPermissions('B_basicData_storeTransferOutType_del')"
-          size="small"
-          type="link"
+          v-if="$hasPermissions('B_basicData_storeTransferOutType_add')"
+          id="storeTransferOutTypeList-add"
+          type="primary"
           class="button-error"
-          @click="handleDel(record)"
-          id="storeTransferOutTypeList-del-btn">删除</a-button>
-      </template>
-    </s-table>
+          @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 300 }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            v-if="$hasPermissions('B_basicData_storeTransferOutType_edit')"
+            size="small"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="storeTransferOutTypeList-edit-btn">编辑</a-button>
+          <a-button
+            v-if="$hasPermissions('B_basicData_storeTransferOutType_del')"
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="storeTransferOutTypeList-del-btn">删除</a-button>
+          <span v-if="!$hasPermissions('B_basicData_storeTransferOutType_edit') && !$hasPermissions('B_basicData_storeTransferOutType_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑店内调出类型 -->
     <storeTransferOut-type-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @close="closeModal" />
   </a-card>
@@ -50,6 +53,7 @@ export default {
   components: { STable, VSelect, storeTransferOutTypeEditModal },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         name: '' //  店内调出类型名称
       },
@@ -98,10 +102,14 @@ export default {
         content: '删除后原数据不可恢复,是否删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           storeCallOutTypeDel({ 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
             }
           })
         }

+ 1 - 1
src/views/bulkManagement/bulkWarehousingOrder/detail.vue

@@ -19,7 +19,7 @@
           <a-tag color="orange" v-if="basicInfoData&&basicInfoData.settleStateDictValue">{{ basicInfoData.settleStateDictValue }}</a-tag>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_bulkWarehousingOrder_print')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>

+ 5 - 4
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -9,7 +9,7 @@
           <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '' }}</p>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_bulkWarehousingOrder_print')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -489,10 +489,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           sparePartsPurDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.getChooseDealerProductList()
+              _this.spinning = false
+            }else{
+              _this.spinning = false
             }
           })
         }
@@ -710,13 +714,10 @@ export default {
     },
     // 选择产品 表格  change
     onTableChange (pagination, filters, sorter) {
-      console.log('-------------------------------')
-      console.log('params', pagination, filters, sorter)
       this.getDealerProductList(this.pageNo, sorter)
     },
     // 已选产品 表格  change
     onChooseTableChange (pagination, filters, sorter) {
-      console.log('++++++++++++++++++++++++++++++++++')
       this.getChooseDealerProductList(this.choosePageNo, sorter)
     }
   },

+ 137 - 121
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -1,132 +1,137 @@
 <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="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="散件单号">
-              <a-input id="bulkWarehousingOrderList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入散件单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-select
-                id="bulkWarehousingOrderList-supplierSn"
-                placeholder="请选择供应商"
-                allowClear
-                v-model="queryParam.supplierSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</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="bulkWarehousingOrderList-state"
-                  code="SPARE_PARTS_PURCHASE"
-                  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="bulkWarehousingOrderList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入散件单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="财务状态">
-                <v-select
-                  v-model="queryParam.settleState"
-                  ref="settleState"
-                  id="bulkWarehousingOrderList-settleState"
-                  code="FINANCIAL_PAY_STATUS"
-                  placeholder="请选择财务状态"
+              <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <a-select
+                  id="bulkWarehousingOrderList-supplierSn"
+                  placeholder="请选择供应商"
                   allowClear
-                ></v-select>
+                  v-model="queryParam.supplierSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
-          </template>
-          <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>
-              <a-button
-                style="margin-left: 8px"
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                id="bulkWarehousingOrderList-export">导出</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 id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">共 <strong>{{ dataTotalCount }}</strong> 条记录,总数量合计 <strong>{{ productTotal.productTotalQty }}</strong> ,总金额合计¥<strong>{{ productTotal.productTotalCost }}</strong> </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1360, y: tableHeight }"
-      bordered>
-      <!-- 散件单号 -->
-      <template slot="sparePartsPurchaseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.sparePartsPurchaseNo }}</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 != 'FINISH'"
-          @click="handleEdit(record)"
-          class="button-info"
-          id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_PUT_WAREHOUSE'"
-          @click="handleWarehouse(record)"
-          class="button-primary"
-          id="bulkWarehousingOrderList-warehouse-btn">入库</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state != 'FINISH'"
-          @click="handleDel(record)"
-          class="button-error"
-          id="bulkWarehousingOrderList-del-btn">删除</a-button>
-        <span v-if="(record.state == 'FINISH') && (record.state != 'WAIT_PUT_WAREHOUSE')">--</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="bulkWarehousingOrderList-state"
+                    code="SPARE_PARTS_PURCHASE"
+                    placeholder="请选择业务状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.settleState"
+                    ref="settleState"
+                    id="bulkWarehousingOrderList-settleState"
+                    code="FINANCIAL_PAY_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <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>
+                <a-button
+                  style="margin-left: 8px"
+                  type="primary"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  v-if="$hasPermissions('B_bulkWarehousingOrder_export')"
+                  id="bulkWarehousingOrderList-export">导出</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 v-if="$hasPermissions('B_bulkWarehousingOrder_add')" id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
+      </div>
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">共 <strong>{{ dataTotalCount }}</strong> 条记录,总数量合计 <strong>{{ productTotal.productTotalQty }}</strong> ,总金额合计¥<strong>{{ productTotal.productTotalCost }}</strong> </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1360, y: tableHeight }"
+        bordered>
+        <!-- 散件单号 -->
+        <template slot="sparePartsPurchaseNo" slot-scope="text, record">
+          <span v-if="$hasPermissions('B_bulkWarehousingOrder_detail')" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.sparePartsPurchaseNo }}</span>
+          <span v-else>{{ record.sparePartsPurchaseNo }}</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 != 'FINISH' && $hasPermissions('B_bulkWarehousingOrder_edit')"
+            @click="handleEdit(record)"
+            class="button-info"
+            id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_PUT_WAREHOUSE' && $hasPermissions('B_bulkWarehousingOrder_put')"
+            @click="handleWarehouse(record)"
+            class="button-primary"
+            id="bulkWarehousingOrderList-warehouse-btn">入库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state != 'FINISH' && $hasPermissions('B_bulkWarehousingOrder_del')"
+            @click="handleDel(record)"
+            class="button-error"
+            id="bulkWarehousingOrderList-del-btn">删除</a-button>
+          <!-- <span v-if="record.state == 'FINISH' && record.state != 'WAIT_PUT_WAREHOUSE'">--</span> -->
+          <span v-if="(record.state == 'FINISH' || !$hasPermissions('B_bulkWarehousingOrder_edit')) &&(record.state == 'FINISH' || !$hasPermissions('B_bulkWarehousingOrder_del')) &&(record.state != 'WAIT_PUT_WAREHOUSE' || !$hasPermissions('B_bulkWarehousingOrder_put'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 选择基本信息弹框 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
   </a-card>
@@ -143,6 +148,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
@@ -168,7 +174,7 @@ export default {
         { title: '总数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总金额', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: 100, align: 'center' },
-        { title: '财务状态', scopedSlots: { customRender: 'settleState' }, width: 100, align: 'center' },
+        { title: '财务状态', dataIndex: 'settleState', scopedSlots: { customRender: 'settleState' }, width: 100, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -240,10 +246,14 @@ export default {
         content: '确定要入库吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           sparePartsPurPut({ 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
             }
           })
         }
@@ -257,10 +267,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           sparePartsPurDel({ 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
             }
           })
         }
@@ -287,8 +301,10 @@ export default {
       const _this = this
       const params = this.queryParam
       this.exportLoading = true
+      this.spinning = true
       sparePartsPurExport(params).then(res => {
         this.exportLoading = false
+        this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 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)
     }
   }
 }

+ 119 - 113
src/views/customerManagement/customerInfo/list.vue

@@ -1,125 +1,122 @@
 <template>
   <a-card size="small" :bordered="false" class="customerManagementList-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="customerManagementList-customerName" v-model.trim="queryParam.customerName" allowClear placeholder="请输入客户名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="联系人">
-              <a-input id="customerManagementList-contactName" v-model.trim="queryParam.contactName" 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="最后销售时间">
-                <rangeDate ref="rangeSaleDate" @change="dateSaleChange" />
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </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="provinceSn" style="margin: 0;">
-                      <a-select v-model="queryParam.provinceSn" @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="citySn" style="margin: 0;">
-                      <a-select v-model="queryParam.citySn" @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="countySn" style="margin: 0;">
-                      <a-select v-model="queryParam.countySn" 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>
             <a-col :md="6" :sm="24">
-              <a-form-item label="是否卫星仓客户">
-                <v-select code="FLAG" id="customerManagementList-satelliteFlag" v-model="queryParam.satelliteFlag" allowClear placeholder="请选择"></v-select>
+              <a-form-item label="客户名称">
+                <a-input id="customerManagementList-customerName" v-model.trim="queryParam.customerName" allowClear placeholder="请输入客户名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户类型">
-                <a-select v-model="queryParam.customerTypeSn" allowClear placeholder="请选择客户类型" style="max-width: 240px;">
-                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
+              <a-form-item label="联系人">
+                <a-input id="customerManagementList-contactName" v-model.trim="queryParam.contactName" allowClear placeholder="请输入联系人"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24" style="margin-bottom: 15px;">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="customerManagementList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="customerManagementList-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 v-if="$hasPermissions('B_customer_customerInfo_add')" id="customerManagementList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-      <!-- <a-button id="customerManagementList-merge" @click="handleMerge" style="margin: 0 0 0 15px;">客户合并</a-button> -->
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1240, y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          v-if="$hasPermissions('B_customer_customerInfo_edit')"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="customerManagementList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          v-if="$hasPermissions('B_customer_customerInfo_detail')"
-          type="link"
-          class="button-success"
-          @click="handleDetail(record)"
-          id="customerManagementList-detail-btn">详情</a-button>
-        <!-- <a-button
-          size="small"
-          v-if="$hasPermissions('B_customer_customerInfo_del') && record.satelliteFlag!=1"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="customerManagementList-del-btn">删除</a-button> -->
-      </template>
-      <template slot="enableAction" slot-scope="text, record">
-        <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.enabledFlag" @change="changeFlagHandle(text, record)"/>
-      </template>
-    </s-table>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="最后销售时间">
+                  <rangeDate ref="rangeSaleDate" @change="dateSaleChange" />
+                </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="provinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.provinceSn" @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="citySn" style="margin: 0;">
+                        <a-select v-model="queryParam.citySn" @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="countySn" style="margin: 0;">
+                        <a-select v-model="queryParam.countySn" 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>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="是否卫星仓客户">
+                  <v-select code="FLAG" id="customerManagementList-satelliteFlag" v-model="queryParam.satelliteFlag" allowClear placeholder="请选择"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="客户类型">
+                  <a-select v-model="queryParam.customerTypeSn" allowClear placeholder="请选择客户类型" style="max-width: 240px;">
+                    <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 15px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="customerManagementList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="customerManagementList-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 v-if="$hasPermissions('B_customer_customerInfo_add')" id="customerManagementList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+        <!-- <a-button id="customerManagementList-merge" @click="handleMerge" style="margin: 0 0 0 15px;">客户合并</a-button> -->
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1240, y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            v-if="$hasPermissions('B_customer_customerInfo_edit')"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="customerManagementList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            v-if="$hasPermissions('B_customer_customerInfo_detail')"
+            type="link"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="customerManagementList-detail-btn">详情</a-button>
+          <span v-if="!$hasPermissions('B_customer_customerInfo_edit') && !$hasPermissions('B_customer_customerInfo_detail')">--</span>
+        </template>
+        <template slot="enableAction" slot-scope="text, record">
+          <a-switch v-if="$hasPermissions('B_customer_customerInfo_enable')" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.enabledFlag" @change="changeFlagHandle(text, record)"/>
+          <span v-else :style="{color:(record.enabledFlag==1?'#00aa00':'#999')}"> {{ record.enabledFlag==1? '已启用': '已禁用' }} </span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 客户详情 -->
     <customer-management-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
   </a-card>
@@ -136,6 +133,7 @@ export default {
   components: { STable, VSelect, customerManagementDetailModal, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -236,10 +234,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           custDel({ 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
             }
           })
         }
@@ -251,11 +253,15 @@ export default {
         id: record.id,
         flag: record.enabledFlag ? '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.enabledFlag = !record.enabledFlag
+          this.$refs.table.refresh()
+          this.spinning = false
         }
       })
     },

+ 11 - 2
src/views/financialManagement/companyCollectionPayment/list.vue

@@ -79,7 +79,7 @@
       bordered>
       <!-- 结算单号 -->
       <template slot="unitSettleNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
+        <span :class="$hasPermissions('M_companyCollectionPayment_detail')?'active':'common'" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
       </template>
     </s-table>
   </a-card>
@@ -150,7 +150,9 @@ export default {
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/financialManagement/companyCollectionPayment/detail/${row.id}/${row.unitSettleSn}` })
+      if (this.$hasPermissions('M_companyCollectionPayment_detail')) {
+        this.$router.push({ path: `/financialManagement/companyCollectionPayment/detail/${row.id}/${row.unitSettleSn}` })
+      }
     },
     // 合计
     getTotal (param) {
@@ -199,5 +201,12 @@ export default {
     .sTable{
       margin-top: 15px;
     }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
   }
 </style>

+ 7 - 7
src/views/financialManagement/companyReceivablePayable/collectionPayment.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="collectionPayment-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="collectionPayment-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="collectionPayment-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
-      </template>
-    </a-page-header>
     <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="collectionPayment-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="collectionPayment-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
+        </template>
+      </a-page-header>
       <!-- 已选单据 -->
       <a-card size="small" :bordered="false" class="collectionPayment-cont">
         <a-collapse :activeKey="['1']">

+ 15 - 2
src/views/financialManagement/companyReceivablePayable/list.vue

@@ -45,8 +45,21 @@
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-info" @click="handleCollectionPayment(record)" id="companyReceivablePayableList-collectionPayment-btn">收付款</a-button>
-        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="companyReceivablePayableList-detail-btn">详情</a-button>
+        <a-button
+          v-if="$hasPermissions('M_collectionPayment')"
+          size="small"
+          type="link"
+          class="button-info"
+          @click="handleCollectionPayment(record)"
+          id="companyReceivablePayableList-collectionPayment-btn">收付款</a-button>
+        <a-button
+          v-if="$hasPermissions('M_companyReceivablePayable_detail')"
+          size="small"
+          type="link"
+          class="button-success"
+          @click="handleDetail(record)"
+          id="companyReceivablePayableList-detail-btn">详情</a-button>
+        <span v-if="!$hasPermissions('M_collectionPayment') && !$hasPermissions('M_companyReceivablePayable_detail')">--</span>
       </template>
     </s-table>
   </a-card>

+ 56 - 56
src/views/financialManagement/expenseManagement/edit.vue

@@ -1,64 +1,64 @@
 <template>
   <div class="expenseManagementEdit-wrap">
-    <a-page-header :ghost="false" :back-icon="false" class="expenseManagementEdit-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="expenseManagementEdit-back-btn" href="javascript:;" @click="handleBack">
-          <a-icon type="left"></a-icon>
-          返回列表
-        </a>
-      </template>
-    </a-page-header>
     <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :back-icon="false" class="expenseManagementEdit-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="expenseManagementEdit-back-btn" href="javascript:;" @click="handleBack">
+            <a-icon type="left"></a-icon>
+            返回列表
+          </a>
+        </template>
+      </a-page-header>
       <a-card size="small" :bordered="false" class="expenseManagementEdit-table-page-wrapper">
         <a-form-model
-        id="expenseManagementEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol">
-        <a-form-model-item label="费用类型" prop="costType">
-          <a-cascader
-          @change="changeCostType"
-          v-model="form.costType"
-          expand-trigger="hover"
-          :options="costTypeList"
-          :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
-          id="productInfoList-costType"
-          placeholder="请选择费用类型"
-          allowClear
-          />
-        </a-form-model-item>
-        <a-form-model-item label="费用金额" prop="settleAmount">
-          <a-input-number
-          id="expenseManagementEdit-name"
-          v-model="form.settleAmount"
-          :precision="2"
-          :min="0"
-          :max="999999"
-          placeholder="请输入费用金额(0~999999)"
-          allowClear
-          style="width: 90%;"
-          />
-          元
-        </a-form-model-item>
-        <a-form-model-item label="结算方式" prop="settleStyleSn">
-          <a-select placeholder="请选择结算方式" v-model="form.settleStyleSn" @change="settleStyleChange">
-          <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-            {{ item.name }}
-          </a-select-option>
-          </a-select>
-        </a-form-model-item>
-        <a-form-model-item label="关联单号" prop="bizNo">
-          <a-input id="expenseManagementEdit-bizNo" :maxLength="30" v-model="form.bizNo" placeholder="请输入关联单号(最多30个字符)" allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="备注" prop="remark">
-          <a-textarea id="expenseManagementEdit-remarks" :maxLength="500" v-model="form.remark" placeholder="请输入备注(最多500个字符)" allowClear />
-        </a-form-model-item>
-        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-          <a-button type="primary" size="large" @click="handleSubmit" id="expenseManagementEdit-btn-save" style="margin: 0 30px;">保存</a-button>
-        </a-form-model-item>
+          id="expenseManagementEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol">
+          <a-form-model-item label="费用类型" prop="costType">
+            <a-cascader
+            @change="changeCostType"
+            v-model="form.costType"
+            expand-trigger="hover"
+            :options="costTypeList"
+            :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
+            id="productInfoList-costType"
+            placeholder="请选择费用类型"
+            allowClear
+            />
+          </a-form-model-item>
+          <a-form-model-item label="费用金额" prop="settleAmount">
+            <a-input-number
+            id="expenseManagementEdit-name"
+            v-model="form.settleAmount"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入费用金额(0~999999)"
+            allowClear
+            style="width: 90%;"
+            />
+            
+          </a-form-model-item>
+          <a-form-model-item label="结算方式" prop="settleStyleSn">
+            <a-select placeholder="请选择结算方式" v-model="form.settleStyleSn" @change="settleStyleChange">
+            <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
+              {{ item.name }}
+            </a-select-option>
+            </a-select>
+          </a-form-model-item>
+          <a-form-model-item label="关联单号" prop="bizNo">
+            <a-input id="expenseManagementEdit-bizNo" :maxLength="30" v-model="form.bizNo" placeholder="请输入关联单号(最多30个字符)" allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="备注" prop="remark">
+            <a-textarea id="expenseManagementEdit-remarks" :maxLength="500" v-model="form.remark" placeholder="请输入备注(最多500个字符)" allowClear />
+          </a-form-model-item>
+          <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+            <a-button type="primary" size="large" @click="handleSubmit" id="expenseManagementEdit-btn-save" style="margin: 0 30px;">保存</a-button>
+          </a-form-model-item>
         </a-form-model>
       </a-card>
 		</a-spin>

+ 126 - 106
src/views/financialManagement/expenseManagement/list.vue

@@ -1,111 +1,113 @@
 <template>
   <a-card size="small" :bordered="false" class="expenseManagementList-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="expenseManagementList-accountExpensesNo" v-model.trim="queryParam.accountExpensesNo" allowClear placeholder="请输入费用单号"/>
-            </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="费用类型">
-              <a-cascader
-                @change="changeCostType"
-                change-on-select
-                v-model="costType"
-                expand-trigger="hover"
-                :options="costTypeList"
-                :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
-                id="productInfoList-costType"
-                placeholder="请选择费用类型"
-                allowClear />
-            </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="expenseManagementList-state"
-                  code="EXPENSE_AUDIT_TYPE"
-                  placeholder="请选择单据状态"
-                  allowClear></v-select>
+              <a-form-item label="费用单号">
+                <a-input id="expenseManagementList-accountExpensesNo" v-model.trim="queryParam.accountExpensesNo" allowClear placeholder="请输入费用单号"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="expenseManagementList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="expenseManagementList-reset">重置</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 id="expenseManagementList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">共 <strong>{{ totalData.count }}</strong> 条记录,金额共计 <strong>¥{{ totalData.totalAmount }}</strong></div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1120, y: tableHeight }"
-      bordered>
-      <!-- 费用类别 -->
-      <template slot="expensesType" slot-scope="text, record">
-        {{ record.expensesTypeName1 }} <span v-if="record.expensesTypeName2">>{{ record.expensesTypeName2 }}</span> <span v-if="record.expensesTypeName3">>{{ record.expensesTypeName3 }}</span>
-      </template>
-      <!-- 状态 -->
-      <template slot="accountExpensesNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ text }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          class="button-warring"
-          @click="handleAudit(record)"
-          id="expenseManagement-edit-btn">审核</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="expenseManagement-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_AUDIT'"
-          class="button-error"
-          @click="handleDel(record)"
-          id="expenseManagement-del-btn">删除</a-button>
-        <span v-if="record.state != 'WAIT_AUDIT'">--</span>
-      </template>
-    </s-table>
+            <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-cascader
+                  @change="changeCostType"
+                  change-on-select
+                  v-model="costType"
+                  expand-trigger="hover"
+                  :options="costTypeList"
+                  :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
+                  id="productInfoList-costType"
+                  placeholder="请选择费用类型"
+                  allowClear />
+              </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="expenseManagementList-state"
+                    code="EXPENSE_AUDIT_TYPE"
+                    placeholder="请选择单据状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="expenseManagementList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="expenseManagementList-reset">重置</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 v-if="$hasPermissions('B_expenseNew')" id="expenseManagementList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">共 <strong>{{ totalData.count }}</strong> 条记录,金额共计 <strong>¥{{ totalData.totalAmount }}</strong></div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1120, y: tableHeight }"
+        bordered>
+        <!-- 费用类别 -->
+        <template slot="expensesType" slot-scope="text, record">
+          {{ record.expensesTypeName1 }} <span v-if="record.expensesTypeName2">>{{ record.expensesTypeName2 }}</span> <span v-if="record.expensesTypeName3">>{{ record.expensesTypeName3 }}</span>
+        </template>
+        <!-- 状态 -->
+        <template slot="accountExpensesNo" slot-scope="text, record">
+          <span :class="$hasPermissions('B_expenseDetail')?'active':'common'" @click="handleDetail(record)">{{ text }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseAudit')"
+            class="button-warring"
+            @click="handleAudit(record)"
+            id="expenseManagement-audit-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseEdit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="expenseManagement-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseDel')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="expenseManagement-del-btn">删除</a-button>
+          <span v-if="record.state != 'WAIT_AUDIT'||( !$hasPermissions('B_expenseAudit')&& !$hasPermissions('B_expenseEdit') && !$hasPermissions('B_expenseDel'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 详情 -->
     <expense-management-detail-modal :openModal="openModal" :itemId="itemId" @close="closeDetail" />
   </a-card>
@@ -121,6 +123,7 @@ export default {
   components: { STable, VSelect, expenseManagementDetailModal, rangeDate },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, //  高级搜索 展开/关闭
@@ -225,8 +228,10 @@ export default {
     },
     //  详情
     handleDetail (row) {
-      this.itemId = row.id
-      this.openModal = true
+      if (this.$hasPermissions('B_expenseDetail')) {
+        this.itemId = row.id
+        this.openModal = true
+      }
     },
     //  审核
     handleAudit (row) {
@@ -236,12 +241,16 @@ export default {
         content: '确定要审核吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           auditExpense({
             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
             }
           })
         }
@@ -256,10 +265,14 @@ export default {
         content: '删除后原数据不可恢复,是否删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           delExpense({ id: _this.itemId }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -268,7 +281,7 @@ export default {
     // 汇总
     settleExpenseQuerySum (params) {
       settleExpenseQuerySum(params).then(res => {
-        this.totalData.totalAmount = res.data.settleAmount || 0
+        this.totalData.totalAmount = res.data && res.data.settleAmount || 0
       })
     },
     //  重置
@@ -295,5 +308,12 @@ export default {
     .sTable{
       margin-top: 15px;
     }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
   }
 </style>

+ 8 - 8
src/views/financialManagement/financialCollection/detailModal.vue

@@ -56,11 +56,11 @@ export default {
     //  获取详情
     getDetail (id) {
       findReceiptDetail({ id: id }).then(res => {
-        	if (res.status == 200) {
-        		this.detailsData = res.data
-        	} else {
-        		this.detailsData = null
-        	}
+        if (res.status == 200) {
+          this.detailsData = res.data
+        } else {
+          this.detailsData = null
+        }
       })
     }
   },
@@ -83,11 +83,11 @@ export default {
 <style lang="less">
   .financialPaymentDetail-modal{
     .ant-modal-body {
-    	padding: 40px 40px 24px;
+      padding: 40px 40px 24px;
     }
     .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
+      text-align: center;
+      margin: 35px 0 10px;
     }
   }
 </style>

+ 134 - 199
src/views/financialManagement/financialCollection/list.vue

@@ -1,112 +1,114 @@
 <template>
   <a-card size="small" :bordered="false" class="financialCollectionList-wrap">
-    <!-- 标签页 -->
-    <a-tabs type="card" default-active-key="ALL" @change="handleTabChange" class="financialCollectionList-tabs ">
-      <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
-        <span slot="tab">{{ item.bizName }}({{ item.countNum }})</span>
-      </a-tab-pane>
-    </a-tabs>
-    <!-- 搜索条件 -->
-    <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="financialCollectionList-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入收款单号" /></a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="关联单号"><a-input id="financialCollectionList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号" /></a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="商户名称">
-              <a-input id="financialCollectionList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入商户名称" />
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 标签页 -->
+      <a-tabs type="card" default-active-key="ALL" @change="handleTabChange" class="financialCollectionList-tabs ">
+        <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
+          <span slot="tab">{{ item.bizName }}({{ item.countNum }})</span>
+        </a-tab-pane>
+      </a-tabs>
+      <!-- 搜索条件 -->
+      <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.billState"
-                  ref="settleState"
-                  id="financialCollectionList-settleState"
-                  code="BILL_STATUS"
-                  placeholder="请选择单据状态"
-                  allowClear
-                ></v-select>
-              </a-form-item>
+              <a-form-item label="收款单号"><a-input id="financialCollectionList-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入收款单号" /></a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关联单号"><a-input id="financialCollectionList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号" /></a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="审核时间">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+              <a-form-item label="商户名称">
+                <a-input id="financialCollectionList-settleClientName" v-model.trim="queryParam.settleClientName" 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.billState"
+                    ref="settleState"
+                    id="financialCollectionList-settleState"
+                    code="BILL_STATUS"
+                    placeholder="请选择单据状态"
+                    allowClear
+                  ></v-select>
+                </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>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
+                <a-button style="margin-left: 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>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">
+          共
+          <strong>{{ totalData.count }}</strong>
+          条记录,应收金额合计
+          <strong>¥{{ totalData.totalAmount }}</strong>
+          ,其中已收金额
+          <strong>¥{{ totalData.settledAmount }}</strong>
+          ,待收金额
+          <strong>¥{{ totalData.unsettleAmount }}</strong>
+        </div>
+      </a-alert>
+      <div v-if="$hasPermissions('B_financialCollectionPl')" style="margin-bottom: 15px">
+        <a-button type="primary" id="financialCollectionList-export" :loading="loading" @click="handleCollection">批量收款</a-button>
+        <span style="margin-left: 8px" v-if="$hasPermissions('B_financialCollectionPl')">
+          <template v-if="hasSelected">
+            {{ `已选 ${selectedRowKeys.length} 项` }}
           </template>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
-              <a-button style="margin-left: 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>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">
-        共
-        <strong>{{ totalData.count }}</strong>
-        条记录,应收金额合计
-        <strong>¥{{ totalData.totalAmount }}</strong>
-        ,其中已收金额
-        <strong>¥{{ totalData.settledAmount }}</strong>
-        ,待收金额
-        <strong>¥{{ totalData.unsettleAmount }}</strong>
+        </span>
       </div>
-    </a-alert>
-    <div style="margin-bottom: 15px">
-      <a-button type="primary" id="financialCollectionList-export" :loading="loading" @click="handleCollection">批量收款</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">
-          {{ `已选 ${selectedRowKeys.length} 项` }}
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="$hasPermissions('B_financialCollectionPl') ? rowSelection : null"
+        :rowKey="record => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1660, y: tableHeight }"
+        bordered
+      >
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.settleState == 'SETTLED' && $hasPermissions('B_financialCollectionDetail')"
+            @click="handleVoucher(record)"
+            id="financialCollectionList-voucher-btn">凭证</a-button>
+          <a-button
+            size="small"
+            type="link"
+            :loading="loading"
+            class="button-warning"
+            v-if="record.settleState == 'UNSETTLE'&&record.satelliteFlag!=1 && $hasPermissions('B_financialCollectionSing')"
+            @click="handleCollectionSing(record)"
+            id="financialCollectionList-pay-btn">收款</a-button>
+          <span v-if="(!(record.settleState == 'SETTLED') && !(record.settleState == 'UNSETTLE'&&record.satelliteFlag!=1))||(!$hasPermissions('B_financialCollectionSing') && !$hasPermissions('B_financialCollectionDetail'))||(record.settleState == 'SETTLED' && !$hasPermissions('B_financialCollectionDetail'))||(record.settleState == 'UNSETTLE'&&record.satelliteFlag!=1 && !$hasPermissions('B_financialCollectionSing'))">--</span>
+          <!-- satelliteFlag为1,是卫星仓 -->
         </template>
-      </span>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="rowSelection"
-      :rowKey="record => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1660, y: tableHeight }"
-      bordered
-    >
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.settleState == 'SETTLED'"
-          @click="handleVoucher(record)"
-          id="financialCollectionList-voucher-btn">凭证</a-button>
-        <a-button
-          size="small"
-          type="link"
-          :loading="loading"
-          class="button-warning"
-          v-if="record.settleState == 'UNSETTLE'&&record.satelliteFlag!=1"
-          @click="handleCollectionSing(record)"
-          id="financialCollectionList-pay-btn">收款</a-button>
-        <span v-if="!(record.settleState == 'SETTLED') && !(record.settleState == 'UNSETTLE'&&record.satelliteFlag!=1)">--</span>
-        <!-- satelliteFlag为1,是卫星仓 -->
-      </template>
-    </s-table>
+      </s-table>
+    </a-spin>
     <!-- 详情 -->
     <detail-modal :openModal="openModal" ref="detailModal" @close="openModal = false" />
   </a-card>
@@ -121,6 +123,7 @@ export default {
   components: { STable, VSelect, detailModal, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
@@ -145,95 +148,16 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        {
-          title: '收款单号',
-          dataIndex: 'settleNo',
-          width: 220,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '关联单号',
-          dataIndex: 'bizNo',
-          width: 220,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '商户名称',
-          dataIndex: 'settleClientName',
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '应收金额',
-          width: 100,
-          align: 'center',
-          customRender: function (text, record) {
-            const val = record.totalAmount
-            return val || val == 0 ? '¥' + val : '--'
-          }
-        },
-        {
-          title: '已收金额',
-          width: 100,
-          align: 'center',
-          customRender: function (text, record) {
-            const val = record.settledAmount
-            return val || val == 0 ? '¥' + val : '--'
-          }
-        },
-        {
-          title: '待收金额',
-          width: 100,
-          align: 'center',
-          customRender: function (text, record) {
-            const val = record.unsettleAmount
-            return val || val == 0 ? '¥' + val : '--'
-          }
-        },
-        {
-          title: '收款类型',
-          dataIndex: 'bizName',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '收款方式',
-          dataIndex: 'settleStyleName',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '审核时间',
-          dataIndex: 'auditTime',
-          width: 160,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '收款时间',
-          dataIndex: 'settleTime',
-          width: 160,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
+        { title: '收款单号', dataIndex: 'settleNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单号', dataIndex: 'bizNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户名称', dataIndex: 'settleClientName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '应收金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '已收金额', dataIndex: 'settledAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '待收金额', dataIndex: 'unsettleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '收款类型', dataIndex: 'bizName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款方式', dataIndex: 'settleStyleName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款时间', dataIndex: 'settleTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
@@ -265,16 +189,20 @@ export default {
       return this.selectedRowKeys.length > 0
     },
     rowSelection () {
-      return {
-        selectedRowKeys: this.selectedRowKeys,
-        onChange: (selectedRowKeys, selectedRows) => {
-          this.selectedRowKeys = selectedRowKeys
-        },
-        getCheckboxProps: record => ({
-          props: {
-            disabled: record.settleState == 'SETTLED'
-          }
-        })
+      if (this.$hasPermissions('B_financialCollectionPl')) {
+        return {
+			  selectedRowKeys: this.selectedRowKeys,
+			  onChange: (selectedRowKeys, selectedRows) => {
+			    this.selectedRowKeys = selectedRowKeys
+			  },
+			  getCheckboxProps: record => ({
+			    props: {
+			      disabled: record.settleState == 'SETTLED'
+			    }
+			  })
+        }
+      } else {
+        return null
       }
     }
   },
@@ -292,7 +220,6 @@ export default {
     // 总计
     settleReceiptQuerySum (params) {
       settleReceiptQuerySum(params).then(res => {
-        console.log(res)
         if (res.status == 200) {
           this.totalData = Object.assign(this.totalData, res.data)
         }
@@ -315,12 +242,16 @@ export default {
     // 收款
     handleCollectionSing (row) {
       this.loading = true
+      this.spinning = true
       settleReceiptMoney([row.id]).then(res => {
         this.loading = false
         if (res.status == 200) {
           this.$message.success(res.message)
           this.selectedRowKeys = []
           this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -337,12 +268,16 @@ export default {
         return
       }
       this.loading = true
+      this.spinning = true
       settleReceiptMoney(this.selectedRowKeys).then(res => {
         this.loading = false
         if (res.status == 200) {
           this.$message.success(res.message)
           this.selectedRowKeys = []
           this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },

+ 8 - 8
src/views/financialManagement/financialPayment/detailModal.vue

@@ -56,11 +56,11 @@ export default {
     //  获取详情
     getDetail (id) {
       findPayDetail({ id: id }).then(res => {
-        	if (res.status == 200) {
-        		this.detailsData = res.data
-        	} else {
-        		this.detailsData = null
-        	}
+        if (res.status == 200) {
+          this.detailsData = res.data
+        } else {
+          this.detailsData = null
+        }
       })
     }
   },
@@ -83,11 +83,11 @@ export default {
 <style lang="less">
   .financialPaymentDetail-modal{
     .ant-modal-body {
-    	padding: 40px 40px 24px;
+      padding: 40px 40px 24px;
     }
     .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
+      text-align: center;
+      margin: 35px 0 10px;
     }
   }
 </style>

+ 132 - 196
src/views/financialManagement/financialPayment/list.vue

@@ -1,109 +1,112 @@
 <template>
   <a-card size="small" :bordered="false" class="finacialPay-wrap">
-    <!-- 标签页 -->
-    <a-tabs type="card" default-active-key="0" @change="handleTabChange" class="finacialPay-tabs">
-      <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
-        <span slot="tab">{{ item.bizName }}({{ item.countNum }})</span>
-      </a-tab-pane>
-    </a-tabs>
-    <!-- 搜索条件 -->
-    <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="finacialPay-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入付款单号" /></a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="关联单号"><a-input id="finacialPay-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号" /></a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="商户名称">
-              <a-input id="finacialPay-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入商户名称" />
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 标签页 -->
+      <a-tabs type="card" default-active-key="0" @change="handleTabChange" class="finacialPay-tabs">
+        <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
+          <span slot="tab">{{ item.bizName }}({{ item.countNum }})</span>
+        </a-tab-pane>
+      </a-tabs>
+      <!-- 搜索条件 -->
+      <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.billState"
-                  ref="settleState"
-                  id="finacialPay-settleState"
-                  code="BILL_STATUS"
-                  placeholder="请选择单据状态"
-                  allowClear></v-select>
-              </a-form-item>
+              <a-form-item label="付款单号"><a-input id="finacialPay-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入付款单号" /></a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关联单号"><a-input id="finacialPay-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号" /></a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="审核时间">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+              <a-form-item label="商户名称">
+                <a-input id="finacialPay-settleClientName" v-model.trim="queryParam.settleClientName" 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.billState"
+                    ref="settleState"
+                    id="finacialPay-settleState"
+                    code="BILL_STATUS"
+                    placeholder="请选择单据状态"
+                    allowClear></v-select>
+                </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>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="finacialPay-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="finacialPay-reset">重置</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>
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">
+          共
+          <strong>{{ totalData.count }}</strong>
+          条记录,应付金额合计
+          <strong>¥{{ totalData.totalAmount }}</strong>
+          ,其中已付金额
+          <strong>¥{{ totalData.settledAmount }}</strong>
+          ,待付金额
+          <strong>¥{{ totalData.unsettleAmount }}</strong>
+        </div>
+      </a-alert>
+      <div v-if="$hasPermissions('B_financialPaymentPl')" style="margin-bottom: 15px">
+        <a-button type="primary" id="finacialPay-export" :loading="loading" @click="handlePayment">批量付款</a-button>
+        <span style="margin-left: 8px" v-if="$hasPermissions('B_financialPaymentPl')">
+          <template v-if="hasSelected">
+            {{ `已选 ${selectedRowKeys.length} 项` }}
           </template>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="finacialPay-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="finacialPay-reset">重置</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>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">
-        共
-        <strong>{{ totalData.count }}</strong>
-        条记录,应付金额合计
-        <strong>¥{{ totalData.totalAmount }}</strong>
-        ,其中已付金额
-        <strong>¥{{ totalData.settledAmount }}</strong>
-        ,待付金额
-        <strong>¥{{ totalData.unsettleAmount }}</strong>
+        </span>
       </div>
-    </a-alert>
-    <div style="margin-bottom: 15px">
-      <a-button type="primary" id="finacialPay-export" :loading="loading" @click="handlePayment">批量付款</a-button>
-      <span style="margin-left: 8px">
-        <template v-if="hasSelected">
-          {{ `已选 ${selectedRowKeys.length} 项` }}
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="$hasPermissions('B_financialPaymentPl') ? rowSelection : null"
+        :rowKey="record => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1660, y: tableHeight }"
+        bordered
+      >
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.settleState == 'SETTLED' && $hasPermissions('B_financialPaymentDetail')"
+            @click="handleVoucher(record)"
+            id="finacialPay-voucher-btn">凭证</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            :loading="loading"
+            v-else-if="record.settleState != 'SETTLED' && $hasPermissions('B_financialPaymentSing')"
+            @click="handlePay(record)"
+            id="finacialPay-pay-btn">付款</a-button>
+          <span v-else>--</span>
         </template>
-      </span>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :row-selection="rowSelection"
-      :rowKey="record => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1660, y: tableHeight }"
-      bordered
-    >
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.settleState == 'SETTLED'"
-          @click="handleVoucher(record)"
-          id="finacialPay-voucher-btn">凭证</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-warning"
-          :loading="loading"
-          v-else
-          @click="handlePay(record)"
-          id="finacialPay-pay-btn">付款</a-button>
-      </template>
-    </s-table>
+      </s-table>
+    </a-spin>
     <!-- 详情 -->
     <detail-modal :openModal="openModal" ref="detailModal" @close="openModal = false" />
   </a-card>
@@ -118,6 +121,7 @@ export default {
   components: { STable, VSelect, detailModal, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
@@ -143,95 +147,16 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        {
-          title: '付款单号',
-          dataIndex: 'settleNo',
-          width: 220,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '关联单号',
-          dataIndex: 'bizNo',
-          width: 220,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '商户名称',
-          dataIndex: 'settleClientName',
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '应付金额',
-          width: 100,
-          align: 'center',
-          customRender: function (text, record) {
-            const val = record.totalAmount
-            return val || val == 0 ? '¥' + val : '--'
-          }
-        },
-        {
-          title: '已付金额',
-          width: 100,
-          align: 'center',
-          customRender: function (text, record) {
-            const val = record.settledAmount
-            return val || val == 0 ? '¥' + val : '--'
-          }
-        },
-        {
-          title: '待付金额',
-          width: 100,
-          align: 'center',
-          customRender: function (text, record) {
-            const val = record.unsettleAmount
-            return val || val == 0 ? '¥' + val : '--'
-          }
-        },
-        {
-          title: '付款类型',
-          dataIndex: 'bizName',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '付款方式',
-          dataIndex: 'settleStyleName',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '审核时间',
-          dataIndex: 'auditTime',
-          width: 160,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '付款时间',
-          dataIndex: 'settleTime',
-          width: 160,
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
+        { title: '付款单号', dataIndex: 'settleNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单号', dataIndex: 'bizNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户名称', dataIndex: 'settleClientName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '应付金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '已付金额', dataIndex: 'settledAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '待付金额', dataIndex: 'unsettleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '付款类型', dataIndex: 'bizName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '付款方式', dataIndex: 'settleStyleName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '付款时间', dataIndex: 'settleTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
@@ -263,16 +188,20 @@ export default {
       return this.selectedRowKeys.length > 0
     },
     rowSelection () {
-      return {
-        selectedRowKeys: this.selectedRowKeys,
-        onChange: (selectedRowKeys, selectedRows) => {
-          this.selectedRowKeys = selectedRowKeys
-        },
-        getCheckboxProps: record => ({
-          props: {
-            disabled: record.settleState == 'SETTLED'
-          }
-        })
+      if (this.$hasPermissions('B_financialPaymentPl')) {
+        return {
+			  selectedRowKeys: this.selectedRowKeys,
+			  onChange: (selectedRowKeys, selectedRows) => {
+			    this.selectedRowKeys = selectedRowKeys
+			  },
+			  getCheckboxProps: record => ({
+			    props: {
+			      disabled: record.settleState == 'SETTLED'
+			    }
+			  })
+        }
+      } else {
+        return null
       }
     }
   },
@@ -290,7 +219,6 @@ export default {
     // 总计
     settlePayQuerySum (params) {
       settlePayQuerySum(params).then(res => {
-        console.log(res)
         if (res.status == 200) {
           this.totalData = Object.assign(this.totalData, res.data)
         }
@@ -313,12 +241,16 @@ export default {
     // 付款
     handlePay (row) {
       this.loading = true
+      this.spinning = true
       settlePayMoney([row.id]).then(res => {
         this.loading = false
         if (res.status == 200) {
           this.$message.success(res.message)
           this.selectedRowKeys = []
           this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -335,12 +267,16 @@ export default {
         return
       }
       this.loading = true
+      this.spinning = true
       settlePayMoney(this.selectedRowKeys).then(res => {
         this.loading = false
         if (res.status == 200) {
           this.$message.success(res.message)
           this.selectedRowKeys = []
           this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },

+ 1 - 1
src/views/financialManagement/warehousingAudit/detail.vue

@@ -8,7 +8,7 @@
           <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.receivingBillNo) || '--' }}</p>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template v-if="$hasPermissions('B_warehousingDetail_print')" slot="extra">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>

+ 97 - 81
src/views/financialManagement/warehousingAudit/list.vue

@@ -1,88 +1,90 @@
 <template>
   <a-card size="small" :bordered="false" class="warehousingAuditList-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="warehousingAuditList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="采购入库单号">
-              <a-input id="warehousingAuditList-receivingBillNo" v-model.trim="queryParam.receivingBillNo" allowClear placeholder="请输入采购入库单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="入库时间">
-              <rangeDate ref="rangeDate" :value="auditTime" @change="dateChange" />
-            </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.auditState"
-                  ref="auditState"
-                  id="warehousingAuditList-auditState"
-                  code="RECEIVING_BILL_STATUS"
-                  placeholder="请选择入库审核状态"
-                  allowClear></v-select>
+              <a-form-item label="采购单号">
+                <a-input id="warehousingAuditList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingAuditList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="warehousingAuditList-reset">重置</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>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">共 <strong>{{ (productTotal&&productTotal.totalRecord) || 0 }}</strong> 条记录,其中待审核 <strong>{{ (productTotal&&productTotal.waitAuditRecord) || 0 }}</strong> 条 </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1420, y: tableHeight }"
-      bordered>
-      <!-- 采购入库单号 -->
-      <template slot="receivingBillNo" slot-scope="text, record">
-        <span v-if="record.receivingBillNo" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.receivingBillNo }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          v-if="record.auditState=='WAIT_PUT_WAREHOUSE_AUDIT'"
-          type="link"
-          class="button-info"
-          @click="handleExamine(record, 1)"
-          id="warehousingAudit-adopt-btn">通过</a-button>
-        <a-button
-          size="small"
-          v-if="record.auditState=='WAIT_PUT_WAREHOUSE_AUDIT'"
-          type="link"
-          class="button-warning"
-          @click="handleExamine(record, 2)"
-          id="warehousingAudit-unadopt-btn">不通过</a-button>
-        <span v-if="record.auditState!='WAIT_PUT_WAREHOUSE_AUDIT'">--</span>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="采购入库单号">
+                <a-input id="warehousingAuditList-receivingBillNo" v-model.trim="queryParam.receivingBillNo" allowClear placeholder="请输入采购入库单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="入库时间">
+                <rangeDate ref="rangeDate" :value="auditTime" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="入库审核状态">
+                  <v-select
+                    v-model="queryParam.auditState"
+                    ref="auditState"
+                    id="warehousingAuditList-auditState"
+                    code="RECEIVING_BILL_STATUS"
+                    placeholder="请选择入库审核状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingAuditList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="warehousingAuditList-reset">重置</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>
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">共 <strong>{{ (productTotal&&productTotal.totalRecord) || 0 }}</strong> 条记录,其中待审核 <strong>{{ (productTotal&&productTotal.waitAuditRecord) || 0 }}</strong> 条 </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1420, y: tableHeight }"
+        bordered>
+        <!-- 采购入库单号 -->
+        <template slot="receivingBillNo" slot-scope="text, record">
+          <span v-if="record.receivingBillNo" :class="$hasPermissions('M_warehousingAudit_detail')?'active':'common'" @click="handleDetail(record)">{{ record.receivingBillNo }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            v-if="record.auditState=='WAIT_PUT_WAREHOUSE_AUDIT' && $hasPermissions('B_receivingAudit')"
+            type="link"
+            class="button-info"
+            @click="handleExamine(record, 1)"
+            id="warehousingAudit-adopt-btn">通过</a-button>
+          <a-button
+            size="small"
+            v-if="record.auditState=='WAIT_PUT_WAREHOUSE_AUDIT'&& $hasPermissions('B_receivingAudit')"
+            type="link"
+            class="button-warning"
+            @click="handleExamine(record, 2)"
+            id="warehousingAudit-unadopt-btn">不通过</a-button>
+          <span v-if="record.auditState!='WAIT_PUT_WAREHOUSE_AUDIT'|| !$hasPermissions('B_receivingAudit')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -96,6 +98,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       auditTime: [
@@ -163,7 +166,9 @@ export default {
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/financialManagement/warehousingAudit/detail/${row.receivingBillSn}` })
+      if (this.$hasPermissions('M_warehousingAudit_detail')) {
+        this.$router.push({ path: `/financialManagement/warehousingAudit/detail/${row.receivingBillSn}` })
+      }
     },
     //  审核
     handleExamine (row, type) {
@@ -173,10 +178,14 @@ export default {
         content: '确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           receivingStockInAudit({ id: row.id, auditState: type == 1 ? 'FINISH' : 'PUT_WAREHOUSE_AUDIT_REJECT' }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -200,5 +209,12 @@ export default {
     .sTable{
       margin-top: 15px;
     }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0, 0.65);
+	}
   }
 </style>

+ 1 - 1
src/views/financialManagement/withdrawalManagement/list.vue

@@ -20,7 +20,7 @@
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button id="withdrawalManagementList-tx" type="primary" class="button-warning" @click="handleCashOut">申请提现</a-button>
+      <a-button v-if="$hasPermissions('B_withdrawalManagement_cashOut')" id="withdrawalManagementList-tx" type="primary" class="button-warning" @click="handleCashOut">申请提现</a-button>
       <div style="display: inline-block;margin-left: 80px;">可提现余额: <strong>¥{{ accountInfo&&(accountInfo.balance || accountInfo.balance==0) ? accountInfo.balance : '--' }}</strong> 元</div>
     </div>
     <!-- 列表 -->

+ 0 - 1
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -84,7 +84,6 @@ export default {
           this.disabled = false
           // 总计
           this.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
-          console.log(data)
           return data
         })
       },

+ 116 - 98
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -1,110 +1,126 @@
 <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 brandData" :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
-                  :options="typeData"
-                  expand-trigger="hover"
-                  :field-names="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productTypeSn"
-                  @change="changeType" />
+              <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"
-              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>{{ currentStock.currentStockQty || 0 }}</strong>;现有库存总成本(¥):<strong>{{ currentStock.currentStockCost || 0 }}</strong>。</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1630, y: tableHeight }"
-      bordered>
-      <!-- 产品分类 -->
-      <template slot="productTypeName" slot-scope="text, record">
-        <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
-        <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
-      </template>
-      <!-- 现有库存数量 -->
-      <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)*100 + Number(record.freezeCost)*100)/100 || 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 brandData" :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
+                    :options="typeData"
+                    expand-trigger="hover"
+                    :field-names="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productTypeSn"
+                    @change="changeType" />
+                </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
+                type="primary"
+                v-if="$hasPermissions('B_inventoryInventoryQueryExport')"
+                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>{{ currentStock.currentStockQty || 0 }}</strong>;现有库存总成本(¥):<strong>{{ currentStock.currentStockCost || 0 }}</strong>。</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1630, y: tableHeight }"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productTypeName" slot-scope="text, record">
+          <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
+          <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
+        </template>
+        <!-- 现有库存数量 -->
+        <template slot="currentStockQty" slot-scope="text, record">
+          {{ (record.currentStockQty + record.freezeQty) || 0 }}
+          <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
+        </template>
+        <template slot="currentStockCost" slot-scope="text, record">
+          {{ (Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000 || 0 }}
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_inventoryInventoryQueryDetail')"
+            class="button-success"
+            @click="goDetail(record)"
+            id="inventoryQueryList-detail-btn">库存详情</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_inventoryInventoryQueryStock')"
+            class="button-warning"
+            @click="goWarehouseDetail(record)"
+            id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
+          <span v-if="!$hasPermissions('B_inventoryInventoryQueryDetail') && !$hasPermissions('B_inventoryInventoryQueryStock')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 库存详情 -->
     <inventory-query-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
   </a-card>
@@ -121,6 +137,7 @@ export default {
   components: { STable, VSelect, inventoryQueryDetailModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -244,8 +261,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 () {
@@ -293,7 +312,6 @@ export default {
     },
     // 分类  changeType
     changeType (val, selectedOptions) {
-      console.log(val, selectedOptions)
       for (let i = 0; i < val.length; i++) {
         this.queryParam['productTypeSn' + (i + 1)] = val[i]
       }

+ 163 - 150
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.warnTip"
-                  ref="warnTip"
-                  id="inventoryWarningList-warnTip"
-                  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="primary"
-              class="button-warning"
-              @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: onSelectChange }"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :dataSource="loadData"
-      :scroll="{ x: 2120, y: tableHeight }"
-      :pagination="paginationProps"
-      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="warnTip" slot-scope="text, record">
-        <span v-if="record.warnTipDictValue" :class="[record.warnTip=='OVERFLOW'?'yellow':record.warnTip=='NOT_ENOUGH'?'red':record.warnTip=='LACK'?'blue':record.warnTip=='NORMAL'?'green':'']">{{ record.warnTipDictValue }}</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="primary"
+                class="button-warning"
+                @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" v-if="$hasPermissions('B_inventoryWarningBatchSave')" id="inventoryWarningList-update" :loading="loading" @click="handleupdate">批量更新</a-button>
+        <span style="margin-left: 8px" v-if="$hasPermissions('B_inventoryWarningBatchSave')">
+          <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+        </span>
+      </div>
+      <!-- 列表 -->
+      <a-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :row-selection="$hasPermissions('B_inventoryWarningBatchSave') ? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange } : null"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :dataSource="loadData"
+        :scroll="{ x: 2200, y: tableHeight }"
+        :pagination="paginationProps"
+        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"
+            v-if="$hasPermissions('B_inventoryWarningSave')"
+            size="small"
+            class="button-info"
+            @click="handleSave(record)"
+            id="inventoryWarningList-add-btn">保存</a-button>
+          <span v-if="!$hasPermissions('B_inventoryWarningSave')">--</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: { //  查询条件
@@ -178,7 +188,7 @@ export default {
         productTypeSn1: undefined,
         productTypeSn2: undefined,
         productTypeSn3: undefined,
-        warnTip: undefined
+        stockState: undefined
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
@@ -198,7 +208,7 @@ export default {
         { title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 130, align: 'center' },
         { title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 130, align: 'center' },
         { title: '差异数量', dataIndex: 'differenceNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '预警提示', scopedSlots: { customRender: 'warnTip' }, width: 100, align: 'center' },
+        { title: '预警提示', scopedSlots: { customRender: 'stockState' }, width: 100, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       loadData: [],
@@ -304,17 +314,20 @@ 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
         }
       })
     },
     onSelectChange (selectedRowKeys, selectedRows) {
-      console.log('selectedRowKeys changed: ', selectedRowKeys, selectedRows)
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
     },
@@ -327,7 +340,7 @@ export default {
       this.queryParam.productTypeSn1 = undefined
       this.queryParam.productTypeSn2 = undefined
       this.queryParam.productTypeSn3 = undefined
-      this.queryParam.warnTip = undefined
+      this.queryParam.stockState = undefined
       this.pageNo = 1
       this.pageSize = 10
       this.paginationProps.total = 0

+ 62 - 54
src/views/inventoryManagement/satelliteWarehouseInventory/list.vue

@@ -1,59 +1,62 @@
 <template>
   <a-card size="small" :bordered="false" class="satelliteWarehouseInventoryList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="satelliteWarehouseInventoryList-form"
-        ref="ruleForm"
-        :model="queryParam"
-        :rules="rules"
-        :labelCol="labelCol"
-        :wrapperCol="wrapperCol"
-        @keyup.enter.native="getStockList(1)" >
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="客户名称" prop="customer.customerSn">
-              <custSatelliteList ref="custSatelliteList" @change="custSatelliteChange"></custSatelliteList>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="配件名称">
-              <a-input id="satelliteWarehouseInventoryList-name" v-model.trim="queryParam.dealerProduct.name" allowClear placeholder="请输入配件名称" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="配件编码">
-              <a-input id="satelliteWarehouseInventoryList-queryWord" v-model.trim="queryParam.dealerProduct.queryWord" allowClear placeholder="请输入产品编码或产品原厂编码" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="satelliteWarehouseInventoryList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="satelliteWarehouseInventoryList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="satelliteWarehouseInventoryList-replenishment" type="primary" @click="handleReplenishment">补货清单</a-button>
-    </div>
-    <!-- 列表 -->
-    <a-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data-source="loadData"
-      :pagination="paginationProps"
-      :loading="loading"
-      :scroll="{ x: 1210, y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleAdd(record)" id="satelliteWarehouseInventoryList-add-btn">加入补货单</a-button>
-      </template>
-    </a-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="satelliteWarehouseInventoryList-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-model-item label="客户名称" prop="customer.customerSn">
+                <custSatelliteList ref="custSatelliteList" @change="custSatelliteChange"></custSatelliteList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="配件名称">
+                <a-input id="satelliteWarehouseInventoryList-name" v-model.trim="queryParam.dealerProduct.name" allowClear placeholder="请输入配件名称" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="配件编码">
+                <a-input id="satelliteWarehouseInventoryList-queryWord" v-model.trim="queryParam.dealerProduct.queryWord" allowClear placeholder="请输入产品编码或产品原厂编码" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="satelliteWarehouseInventoryList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="satelliteWarehouseInventoryList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button v-if="$hasPermissions('B_satelliteWarehouseInventoryDetail')" id="satelliteWarehouseInventoryList-replenishment" type="primary" @click="handleReplenishment">补货清单</a-button>
+      </div>
+      <!-- 列表 -->
+      <a-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data-source="loadData"
+        :pagination="paginationProps"
+        :loading="loading"
+        :scroll="{ x: 1210, y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" v-if="$hasPermissions('B_satelliteWarehouseInventoryAdd')" type="link" @click="handleAdd(record)" id="satelliteWarehouseInventoryList-add-btn">加入补货单</a-button>
+          <span v-if="!$hasPermissions('B_satelliteWarehouseInventoryAdd')">--</span>
+        </template>
+      </a-table>
+    </a-spin>
     <!-- 补货单 -->
     <satellite-warehouse-inventory-add-modal :openModal="openModal" :nowData="nowData" @close="closeModal" />
   </a-card>
@@ -68,6 +71,7 @@ export default {
   components: { STable, VSelect, satelliteWarehouseInventoryAddModal, custSatelliteList },
   data () {
     return {
+      spinning: false,
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       tableHeight: 0,
@@ -204,9 +208,13 @@ export default {
           productQty: 1
         }
       }
+      this.spinning = true
       satelliteWHSupplyInsert(params).then(res => {
         if (res.status == 200) {
           this.$message.success('添加成功')
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },

+ 64 - 58
src/views/inventoryManagement/warehouse/list.vue

@@ -1,61 +1,64 @@
 <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 v-if="$hasPermissions('B_inventory_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">
-        <!-- record.sysFlag表示该仓库是否默认,为默认仓库时则不可删除不可编辑 -->
-        <a-button
-          size="small"
-          v-if="$hasPermissions('M_inventoryWarehouseStoringLocationList')"
-          type="link"
-          class="button-warning"
-          @click="goStoringLocation(record)"
-          id="warehouseList-storingLocation-btn">仓位管理</a-button>
-        <a-button
-          size="small"
-          v-if="$hasPermissions('B_inventory_warehouse_edit') && record.sysFlag==0"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="warehouseList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          v-if="$hasPermissions('B_inventory_warehouse_del') && record.sysFlag==0"
-          type="link"
-          class="button-error"
-          @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_inventory_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">
+          <!-- record.sysFlag表示该仓库是否默认,为默认仓库时则不可删除不可编辑 -->
+          <a-button
+            size="small"
+            v-if="$hasPermissions('M_inventoryWarehouseStoringLocationList')"
+            type="link"
+            class="button-warning"
+            @click="goStoringLocation(record)"
+            id="warehouseList-storingLocation-btn">仓位管理</a-button>
+          <a-button
+            size="small"
+            v-if="$hasPermissions('B_inventory_warehouse_edit') && record.sysFlag==0"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="warehouseList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            v-if="$hasPermissions('B_inventory_warehouse_del') && record.sysFlag==0"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="warehouseList-del-btn">删除</a-button>
+          <span v-if="!$hasPermissions('M_inventoryWarehouseStoringLocationList') && !$hasPermissions('B_inventory_warehouse_edit') && !$hasPermissions('B_inventory_warehouse_del')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑仓库 -->
     <warehouse-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -69,6 +72,7 @@ export default {
   components: { STable, warehouseEditModal },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         name: '' //  仓库名称
       },
@@ -130,12 +134,16 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           warehouseDel({
             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
             }
           })
         }
@@ -148,5 +156,3 @@ export default {
   }
 }
 </script>
-
-<style lang="less"></style>

+ 65 - 57
src/views/inventoryManagement/warehouse/storingLocation/list.vue

@@ -1,63 +1,66 @@
 <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 v-if="$hasPermissions('B_inventory_warehouse_storingLocation_add')" 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">
-          <!-- record.sysFlag表示该仓库是否默认,为默认仓库时则不可删除不可编辑 -->
-          <a-button
-            size="small"
-            v-if="$hasPermissions('B_inventory_warehouse_storingLocation_edit') && record.sysFlag==0"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="storingLocationList-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            v-if="$hasPermissions('B_inventory_warehouse_storingLocation_del') && record.sysFlag==0"
-            type="link"
-            class="button-error"
-            @click="handleDel(record)"
-            id="storingLocationList-del-btn">删除</a-button>
+    <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 v-if="$hasPermissions('B_inventory_warehouse_storingLocation_add')" 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">
+            <!-- record.sysFlag表示该仓库是否默认,为默认仓库时则不可删除不可编辑 -->
+            <a-button
+              size="small"
+              v-if="$hasPermissions('B_inventory_warehouse_storingLocation_edit') && record.sysFlag==0"
+              type="link"
+              class="button-info"
+              @click="handleEdit(record)"
+              id="storingLocationList-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              v-if="$hasPermissions('B_inventory_warehouse_storingLocation_del') && record.sysFlag==0"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+              id="storingLocationList-del-btn">删除</a-button>
+            <span v-if="!$hasPermissions('B_inventory_warehouse_storingLocation_edit') && !$hasPermissions('B_inventory_warehouse_storingLocation_del')">--</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
     <!-- 新增/编辑仓位 -->
     <storing-location-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
   </div>
@@ -71,6 +74,7 @@ export default {
   components: { STable, storingLocationEditModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
         warehouseSn: this.$route.params.sn, //  仓库sn
@@ -140,6 +144,7 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           warehouseLocDel({
             id: row.id,
             warehouseSn: _this.$route.params.sn
@@ -147,6 +152,9 @@ export default {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 177 - 181
src/views/power/dataDictionary/codeItemModal.vue

@@ -1,178 +1,179 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
-      <a-form :form="form" @submit="handleSubmit">
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <!-- code -->
-            <a-form-item label="字典码" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
-              <a-input
-                disabled
-                placeholder=""
-                v-decorator="['formData.lookupCode', {
-                  initialValue: formData.lookupCode,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+        <a-form :form="form" @submit="handleSubmit">
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <!-- code -->
+              <a-form-item label="字典码" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+                <a-input
+                  disabled
+                  placeholder=""
+                  v-decorator="['formData.lookupCode', {
+                    initialValue: formData.lookupCode,
+                    rules: [] }]"
+                />
+              </a-form-item>
+            </a-col>
+          </a-row>
 
-        <a-row :gutter="24">
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 名称 -->
-            <a-form-item label="名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder="请输入名称(最多30个字符)"
-                :maxLength="30"
-                v-decorator="['formData.dispName', {
-                  initialValue: formData.dispName,
-                  rules: [{ required: true, message: '请输入名称!' }] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 项编码 -->
-            <a-form-item label="项编码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder="请输入项编码"
-                v-decorator="['formData.code', {
-                  initialValue: formData.code,
-                  rules: [{ required: true, message: '请输入项编码!' }] }]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12" style="padding-right: 0px;">
-            <a-form-item label="启用" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-radio-group
-                name="radioGroup"
-                v-decorator="[
-                  'formData.isEnable',
-                  {
-                    initialValue: formData.isEnable,
-                    rules: [] },
-                ]"
-              >
-                <a-radio :value="1">是</a-radio>
-                <a-radio :value="0">否</a-radio>
-              </a-radio-group>
-            </a-form-item>
-          </a-col>
-          <!-- 排序值 -->
-          <a-col :span="12">
-            <a-form-item label="排序值" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input-number
-                style="width: 100%;"
-                placeholder="请输入排序值(0~999999)"
-                v-decorator="['formData.sort', {
-                  initialValue: formData.sort,
-                  rules: [{ required: true, message: '请输入排序值!' }] }]"
-                :max="999999"
-                :min="0"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <!-- 扩展参数 -->
-        <a-row :gutter="24">
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 扩展一 -->
-            <a-form-item label="扩展一" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr1', {
-                  initialValue: formData.attr1,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 扩展二 -->
-            <a-form-item label="扩展二" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr2', {
-                  initialValue: formData.attr2,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 扩展三 -->
-            <a-form-item label="扩展三" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr3', {
-                  initialValue: formData.attr3,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 扩展四 -->
-            <a-form-item label="扩展四" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr4', {
-                  initialValue: formData.attr4,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12" style="padding-right: 0px;">
-            <!-- 扩展五 -->
-            <a-form-item label="扩展五" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr5', {
-                  initialValue: formData.attr5,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <!-- 扩展六 -->
-            <a-form-item label="扩展六" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-input
-                placeholder=""
-                v-decorator="['formData.attr6', {
-                  initialValue: formData.attr6,
-                  rules: [] }]"
-              />
-            </a-form-item>
-          </a-col>
-        </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12" style="padding-right: 0px;">
+              <!-- 名称 -->
+              <a-form-item label="名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder="请输入名称(最多30个字符)"
+                  :maxLength="30"
+                  v-decorator="['formData.dispName', {
+                    initialValue: formData.dispName,
+                    rules: [{ required: true, message: '请输入名称!' }] }]"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <!-- 项编码 -->
+              <a-form-item label="项编码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder="请输入项编码"
+                  v-decorator="['formData.code', {
+                    initialValue: formData.code,
+                    rules: [{ required: true, message: '请输入项编码!' }] }]"
+                />
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12" style="padding-right: 0px;">
+              <a-form-item label="启用" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-radio-group
+                  name="radioGroup"
+                  v-decorator="[
+                    'formData.isEnable',
+                    {
+                      initialValue: formData.isEnable,
+                      rules: [] },
+                  ]"
+                >
+                  <a-radio :value="1">是</a-radio>
+                  <a-radio :value="0">否</a-radio>
+                </a-radio-group>
+              </a-form-item>
+            </a-col>
+            <!-- 排序值 -->
+            <a-col :span="12">
+              <a-form-item label="排序值" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input-number
+                  style="width: 100%;"
+                  placeholder="请输入排序值(0~999999)"
+                  v-decorator="['formData.sort', {
+                    initialValue: formData.sort,
+                    rules: [{ required: true, message: '请输入排序值!' }] }]"
+                  :max="999999"
+                  :min="0"
+                />
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <!-- 扩展参数 -->
+          <a-row :gutter="24">
+            <a-col :span="12" style="padding-right: 0px;">
+              <!-- 扩展一 -->
+              <a-form-item label="扩展一" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder=""
+                  v-decorator="['formData.attr1', {
+                    initialValue: formData.attr1,
+                    rules: [] }]"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <!-- 扩展二 -->
+              <a-form-item label="扩展二" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder=""
+                  v-decorator="['formData.attr2', {
+                    initialValue: formData.attr2,
+                    rules: [] }]"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12" style="padding-right: 0px;">
+              <!-- 扩展三 -->
+              <a-form-item label="扩展三" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder=""
+                  v-decorator="['formData.attr3', {
+                    initialValue: formData.attr3,
+                    rules: [] }]"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <!-- 扩展四 -->
+              <a-form-item label="扩展四" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder=""
+                  v-decorator="['formData.attr4', {
+                    initialValue: formData.attr4,
+                    rules: [] }]"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12" style="padding-right: 0px;">
+              <!-- 扩展五 -->
+              <a-form-item label="扩展五" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder=""
+                  v-decorator="['formData.attr5', {
+                    initialValue: formData.attr5,
+                    rules: [] }]"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <!-- 扩展六 -->
+              <a-form-item label="扩展六" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+                <a-input
+                  placeholder=""
+                  v-decorator="['formData.attr6', {
+                    initialValue: formData.attr6,
+                    rules: [] }]"
+                />
+              </a-form-item>
+            </a-col>
+          </a-row>
 
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
-              <a-textarea
-                v-decorator="[
-                  'formData.remarks',
-                  {
-                    initialValue: formData.remarks,
-                    rules: [] },
-                ]"
-                :maxLength="500"
-                style="min-height: 60px;"
-                placeholder="最多500字符"
-                autosize />
-            </a-form-item>
-          </a-col>
-        </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+                <a-textarea
+                  v-decorator="[
+                    'formData.remarks',
+                    {
+                      initialValue: formData.remarks,
+                      rules: [] },
+                  ]"
+                  :maxLength="500"
+                  style="min-height: 60px;"
+                  placeholder="最多500字符"
+                  autosize />
+              </a-form-item>
+            </a-col>
+          </a-row>
 
-        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
-            保存
-          </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
-            取消
-          </a-button>
-        </a-form-item>
-      </a-form>
-
-    </a-modal>
+          <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+            <a-button type="primary" @click="handleSubmit()">
+              保存
+            </a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+              取消
+            </a-button>
+          </a-form-item>
+        </a-form>
+      </a-modal>
+    </a-spin>
   </div>
 </template>
 
@@ -198,6 +199,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       titleText: '添加字典项',
       isshow: this.visible,
       formLayout: 'horizontal',
@@ -225,23 +227,22 @@ export default {
       this.clear()
       this.$emit('close')
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
       this.form.validateFields((err, values) => {
-        console.log(values, 'values222')
         if (!err) {
-          console.log(values.formData, ' formData.type222222222')
+          _this.spinning = true
           saveLookUpItem(Object.assign(this.formData, values.formData)).then(res => {
-            console.log(res, 'res--save')
-            if (res.status + '' === '200') {
+            if (res.status == 200) {
               this.$message.success(res.message)
               this.$emit('refresh')
               setTimeout(function () {
                 _this.cancel()
+                _this.spinning = false
               }, 300)
             } else {
+              _this.spinning = false
               // this.$message.error(res.message)
             }
           })
@@ -254,7 +255,7 @@ export default {
       this.$confirm({
         title: '提示',
         content: '确定取消吗?',
-		centered: true,
+        centered: true,
         onOk () {
           _this.clear()
           _this.cancel()
@@ -277,9 +278,6 @@ export default {
       this.formData.attr6 = ''
       this.formData.remarks = ''
     }
-
-  },
-  mounted () {
   },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'miniForm' })
@@ -293,10 +291,8 @@ export default {
         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.formData.lookupCode = this.data.lookupCode
           this.titleText = '添加字典项'

+ 78 - 83
src/views/power/dataDictionary/codeModal.vue

@@ -1,81 +1,82 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
-      <a-form :form="form" @submit="handleSubmit">
-        <!-- 类别编码 -->
-        <a-form-item label="类别编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-input
-            placeholder="请输入类别编码"
-            :disabled="true"
-            v-decorator="['formData.code', {
-              initialValue: formData.code,
-              rules: [{ required: true, message: '请输入类别编码!' }] }]"
-          />
-        </a-form-item>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+        <a-form :form="form" @submit="handleSubmit">
+          <!-- 类别编码 -->
+          <a-form-item label="类别编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入类别编码"
+              :disabled="true"
+              v-decorator="['formData.code', {
+                initialValue: formData.code,
+                rules: [{ required: true, message: '请输入类别编码!' }] }]"
+            />
+          </a-form-item>
 
-        <!-- 名称 -->
-        <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-input
-            placeholder="请输入名称(最多30个字符)"
-            :maxLength="30"
-            v-decorator="['formData.name', {
-              initialValue: formData.name,
-              rules: [{ required: true, message: '请输入名称!' }] }]"
-          />
-        </a-form-item>
+          <!-- 名称 -->
+          <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入名称(最多30个字符)"
+              :maxLength="30"
+              v-decorator="['formData.name', {
+                initialValue: formData.name,
+                rules: [{ required: true, message: '请输入名称!' }] }]"
+            />
+          </a-form-item>
 
-        <!-- 排序值 -->
-        <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-input-number
-            style="width: 100%;"
-            placeholder="请输入排序值(0~999999)"
-            v-decorator="['formData.sort', {
-              initialValue: formData.sort,
-              rules: [{ required: true, message: '请输入排序值!' }] }]"
-            :max="999999"
-            :min="0"
-          />
-        </a-form-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-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-input-number
+              style="width: 100%;"
+              placeholder="请输入排序值(0~999999)"
+              v-decorator="['formData.sort', {
+                initialValue: formData.sort,
+                rules: [{ required: true, message: '请输入排序值!' }] }]"
+              :max="999999"
+              :min="0"
+            />
+          </a-form-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-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-textarea
-            v-decorator="[
-              'formData.remarks',
-              { initialValue: formData.remarks,
-                rules: [] },
-            ]"
-            :maxLength="500"
-            style="min-height: 60px;"
-            placeholder="最多500字符"
-            autosize />
-        </a-form-item>
+          <a-form-item label="备注" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-textarea
+              v-decorator="[
+                'formData.remarks',
+                { initialValue: formData.remarks,
+                  rules: [] },
+              ]"
+              :maxLength="500"
+              style="min-height: 60px;"
+              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="handleCancel()">
-            取消
-          </a-button>
-        </a-form-item>
-      </a-form>
-
-    </a-modal>
+          <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+            <a-button type="primary" @click="handleSubmit()">
+              保存
+            </a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+              取消
+            </a-button>
+          </a-form-item>
+        </a-form>
+      </a-modal>
+    </a-spin>
   </div>
 </template>
 
@@ -101,6 +102,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       titleText: '添加字典',
       isshow: this.visible,
       formLayout: 'horizontal',
@@ -120,22 +122,22 @@ export default {
       this.clear()
       this.$emit('close')
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          console.log(values.formData, ' formData.type222222222')
+          _this.spinning = true
           saveLookUp(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')
               setTimeout(function () {
                 _this.cancel()
+                _this.spinning = false
               }, 300)
             } else {
+              _this.spinning = false
               // this.$message.warning(res.message)
             }
           })
@@ -148,7 +150,7 @@ export default {
       this.$confirm({
         title: '提示',
         content: '确定取消吗?',
-		centered: true,
+        centered: true,
         onOk () {
           _this.clear()
           _this.cancel()
@@ -164,9 +166,6 @@ export default {
       this.formData.isEnable = ''
       this.formData.remarks = ''
     }
-
-  },
-  mounted () {
   },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'miniForm' })
@@ -180,10 +179,8 @@ export default {
         if (this.data.id) { // 编辑
           this.formData.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.formData.titleText = '添加字典'
         }
@@ -196,8 +193,6 @@ export default {
 </script>
 
 <style >
-  .modalBox{
-  }
   .ant-modal-footer {
     display: none;
   }

+ 103 - 106
src/views/power/dataDictionary/dataDictionary.vue

@@ -1,97 +1,98 @@
 <template>
   <a-card size="small" :bordered="false">
-    <a-row :gutter="24">
-      <!-- 左侧字典列表 -->
-      <a-col :span="6">
-        <a-row :gutter="24">
-          <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">添加字典</a-button> -->
-          <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
-          <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
-               <a-select-option @click="editCode" value="编辑字典">编辑字典</a-select-option>
-               <a-select-option @click="delectCode" value="删除字典">删除字典</a-select-option>
-             </a-select> -->
-        </a-row>
-        <a-row :gutter="24" class="textCount">
-          <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
-          <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
-        </a-row>
-        <a-row :gutter="24" >
-          <a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
-        </a-row>
-        <a-row :gutter="24" >
-          <a-menu class="menu-box" style="border-right: 0;max-height: 650px;overflow: auto;" v-model="selectedKey" >
-            <a-menu-item style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{ item.name }}</a-menu-item>
-          </a-menu>
-          <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
-        </a-row>
-      </a-col>
-      <!-- 右侧数据列表 -->
-      <a-col :span="18" >
-        <div style="padding-left: 20px;">
-          <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="queryParam.dispName" placeholder="请输入数据名称"/>
-                  </a-form-item>
-                </a-col>
-
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="状态">
-                    <a-select
-                      allowClear
-                      v-model="queryParam.isEnable"
-                      placeholder="请选择"
-                    >
-                      <a-select-option :value="1">
-                        是
-                      </a-select-option>
-                      <a-select-option :value="0">
-                        否
-                      </a-select-option>
-                    </a-select>
-                    <!-- <v-select code="FLAG" v-model="queryParam.enableFlag" allowClear placeholder="是否启用"></v-select> -->
-                  </a-form-item>
-                </a-col>
-                <a-col :md="2" :sm="24">
-                  <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-                </a-col>
-                <!-- <a-col :md="2" :sm="24">
-                  <a-button type="primary" @click="queryParam=''">重置</a-button>
-                </a-col> -->
-              </a-row>
-            </a-form>
-          </div>
-          <!-- <a-divider/> -->
-          <div class="table-operator">
-            <a-button type="primary" icon="plus" @click="openCodeItemModal">添加数据</a-button>
-            <!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
-            <a-button type="" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
-          </div>
-          <!-- <div  class="textCount">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-row :gutter="24">
+        <!-- 左侧字典列表 -->
+        <a-col :span="6">
+          <a-row :gutter="24">
+            <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">添加字典</a-button> -->
+            <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
+            <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
+                 <a-select-option @click="editCode" value="编辑字典">编辑字典</a-select-option>
+                 <a-select-option @click="delectCode" value="删除字典">删除字典</a-select-option>
+               </a-select> -->
+          </a-row>
+          <a-row :gutter="24" class="textCount">
             <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
-            <span>已选择<span style="color: #40a9ff;font-weight: 600;margin-left: 10px;">{{selectedNum}}项</span><span class="imgSize">清空</span></span>
-          </div> -->
-          <s-table
-            ref="table"
-            size="default"
-            rowKey="id"
-            :columns="columns"
-            :data="loadData"
-            bordered
-          >
-            <span slot="action" slot-scope="text, record">
-              <template>
-                <a class="action-button" @click="handleEdit(record)">修改</a>
-                <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
-              </template>
-            </span>
-          </s-table>
-        </div>
+            <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
+          </a-row>
+          <a-row :gutter="24" >
+            <a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
+          </a-row>
+          <a-row :gutter="24" >
+            <a-menu class="menu-box" style="border-right: 0;max-height: 650px;overflow: auto;" v-model="selectedKey" >
+              <a-menu-item style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{ item.name }}</a-menu-item>
+            </a-menu>
+            <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
+          </a-row>
+        </a-col>
+        <!-- 右侧数据列表 -->
+        <a-col :span="18" >
+          <div style="padding-left: 20px;">
+            <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="queryParam.dispName" placeholder="请输入数据名称"/>
+                    </a-form-item>
+                  </a-col>
 
-      </a-col>
-    </a-row>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="状态">
+                      <a-select
+                        allowClear
+                        v-model="queryParam.isEnable"
+                        placeholder="请选择"
+                      >
+                        <a-select-option :value="1">
+                          是
+                        </a-select-option>
+                        <a-select-option :value="0">
+                          否
+                        </a-select-option>
+                      </a-select>
+                      <!-- <v-select code="FLAG" v-model="queryParam.enableFlag" allowClear placeholder="是否启用"></v-select> -->
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="2" :sm="24">
+                    <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                  </a-col>
+                  <!-- <a-col :md="2" :sm="24">
+                    <a-button type="primary" @click="queryParam=''">重置</a-button>
+                  </a-col> -->
+                </a-row>
+              </a-form>
+            </div>
+            <!-- <a-divider/> -->
+            <div class="table-operator">
+              <a-button type="primary" icon="plus" @click="openCodeItemModal">添加数据</a-button>
+              <!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
+              <a-button type="" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
+            </div>
+            <!-- <div  class="textCount">
+              <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
+              <span>已选择<span style="color: #40a9ff;font-weight: 600;margin-left: 10px;">{{selectedNum}}项</span><span class="imgSize">清空</span></span>
+            </div> -->
+            <s-table
+              ref="table"
+              size="default"
+              rowKey="id"
+              :columns="columns"
+              :data="loadData"
+              bordered
+            >
+              <span slot="action" slot-scope="text, record">
+                <template>
+                  <a class="action-button" @click="handleEdit(record)">修改</a>
+                  <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
+                </template>
+              </span>
+            </s-table>
+          </div>
+        </a-col>
+      </a-row>
+    </a-spin>
     <codeModal :visible="showCodeModal" :data="codeData" @refresh="getCodeList" @close="showCodeModal = false"></codeModal>
     <codeItemModal :visible="showItemCodeModal" :data="itemCodeData" @refresh="$refs.table.refresh(true)" @close="showItemCodeModal = false"></codeItemModal>
   </a-card>
@@ -124,6 +125,7 @@ export default {
     //    }
     //  }
     return {
+      spinning: false,
       // 查询参数
       queryParam: {
         dispName: '',
@@ -202,8 +204,6 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        console.log(parameter, 'parameter')
-
         return getLookUpItem(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++) {
@@ -218,12 +218,9 @@ export default {
     }
   },
   methods: {
-
     // 获取字典列表
     getCodeList () {
-      console.log({ code: this.code })
       listLookUp({ code: this.code }).then(res => {
-        console.log(res, 'res1111111')
         if (res.status == 200) {
           this.codeList = res.data
           this.noData = false
@@ -256,14 +253,18 @@ export default {
       this.$confirm({
         title: '警告',
         content: `确定要删除 ${this.codeList[this.selectedKey].name} 吗?`,
-		centered: true,
+        centered: true,
         onOk () {
+          _this.spinning = true
           delLookUp({
             id: id
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success('删除成功')
               _this.getCodeList()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           }).catch(() => {
             _this.$message.success('删除失败, 请稍后重试')
@@ -276,7 +277,6 @@ export default {
       this.selectedKey = []
       this.selectedMenu = ''
     },
-
     // 新增数据
     openCodeItemModal () {
       if (!this.selectedKey.length) {
@@ -285,7 +285,6 @@ export default {
       this.showItemCodeModal = true
       this.itemCodeData = { lookupCode: this.codeList[this.selectedKey].code }
     },
-
     // 批量删除数据
     delectAll () {
       if (!this.selectedNum) {
@@ -295,7 +294,7 @@ export default {
       this.$confirm({
         title: '警告',
         content: `确定要删除您选择的这${this.selectedNum}条数据吗?`,
-		centered: true,
+        centered: true,
         onOk () {
           // delectUserPower({
           //   id: row.id
@@ -316,15 +315,18 @@ export default {
       this.$confirm({
         title: '警告',
         content: '确定要删除吗?',
-		centered: true,
+        centered: true,
         onOk () {
+          _this.spinning = true
           delLookUpItem({
             id: row.id
           }).then(res => {
-            console.log(res, 'res1111')
             if (res.status == 200) {
               _this.$message.success('删除成功')
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           }).catch(() => {
             _this.$message.success('删除失败, 请稍后重试')
@@ -333,13 +335,9 @@ export default {
       })
     },
     handleEdit (row) {
-      console.log(row, 'row')
       this.showItemCodeModal = true
       this.itemCodeData = row
     }
-
-  },
-  mounted () {
   },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'miniForm' })
@@ -351,7 +349,6 @@ export default {
   },
   watch: {
     selectedKey (newValue, oldValue) {
-      console.log(newValue, 'newValue')
       if (newValue.length) {
         this.selectedMenu = this.codeList[this.selectedKey].name + ' ' + '(' + this.codeList[this.selectedKey].code + ')'
         this.queryParam.lookupCode = this.codeList[this.selectedKey].code

+ 34 - 31
src/views/power/role/menuModal.vue

@@ -1,32 +1,34 @@
 <template>
   <div>
-    <a-modal
-      centered
-      class="modalBox"
-      :title="roleName"
-      v-model="isshow"
-      @cancle="cancel"
-      :maskClosable="false">
-      <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>
-      <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-modal>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal
+        centered
+        class="modalBox"
+        :title="roleName"
+        v-model="isshow"
+        @cancle="cancel"
+        :maskClosable="false">
+        <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>
+        <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-modal>
+    </a-spin>
   </div>
 </template>
 
@@ -52,6 +54,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       treeData: [],
       roleName: '',
       expandedKeys: [],
@@ -83,21 +86,21 @@ export default {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          console.log(this.checkedData)
           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') {
+            if (res.status == 200) {
               this.$message.success(res.message ? res.message : '保存成功')
               this.$emit('refresh')
               setTimeout(function () {
                 _this.cancel()
+                _this.spinning = false
               }, 300)
             } else {
+              _this.spinning = false
               // this.$message.error(res.message)
             }
           })

+ 77 - 71
src/views/power/role/roleList.vue

@@ -1,70 +1,71 @@
 <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>
-    </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>
-      </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)" />
-      </span>
-    </s-table>
+    <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 v-if="$hasPermissions('B_powerMD_role_add')" 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>
+        </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)" />
+        </span>
+      </s-table>
+    </a-spin>
     <roleModal :visible="showModal" :data="itemData" @refresh="refreshTable" @close="showModal = false"></roleModal>
     <menuModal :visible="showMenuModal" :data="menuData" @close="showMenuModal = false"></menuModal>
   </a-card>
@@ -93,6 +94,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       // 查询参数
       queryParam: {
         name: '',
@@ -149,7 +151,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++) {
@@ -197,7 +198,6 @@ export default {
         if (res.status == 200) {
           _this.menuData = res.data
           this.showMenuModal = true
-          console.log(res.data, 'this.itemData')
         }
       })
     },
@@ -210,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
     },
@@ -233,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
         }
       })
     }

+ 64 - 67
src/views/power/role/roleModal.vue

@@ -1,66 +1,67 @@
 <template>
   <div>
-    <a-modal
-      centered
-      class="modalBox"
-      :title="titleText"
-      v-model="isshow"
-      @cancle="cancel"
-      :maskClosable="false"
-      width="45%">
-      <a-form :form="form" @submit="handleSubmit">
-        <!-- 用户名称 -->
-        <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-input
-            placeholder="请输入角色名称(最多30个字符)"
-            :maxLength="30"
-            v-decorator="['formData.name', {
-              initialValue: formData.name,
-              getValueFromEvent: $filterEmpty,
-              rules: [{ required: true, message: '请输入角色名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
-          />
-        </a-form-item>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal
+        centered
+        class="modalBox"
+        :title="titleText"
+        v-model="isshow"
+        @cancle="cancel"
+        :maskClosable="false"
+        width="45%">
+        <a-form :form="form" @submit="handleSubmit">
+          <!-- 用户名称 -->
+          <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入角色名称(最多30个字符)"
+              :maxLength="30"
+              v-decorator="['formData.name', {
+                initialValue: formData.name,
+                getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入角色名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
+            />
+          </a-form-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-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-radio-group
+              name="radioGroup"
+              v-decorator="[
+                'formData.isEnable',
+                {
+                  initialValue: formData.isEnable,
+                  rules: [{ required: true, message: '请选择状态!' }] },
+              ]"
+            >
+              <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-textarea
-            v-decorator="[
-              'formData.remarks',
-              { initialValue: formData.remarks,
-                rules: [] },
-            ]"
-            style="min-height: 60px;"
-            :maxLength="500"
-            placeholder="请输入描述(最多500个字符)"
-            autosize />
-        </a-form-item>
+          <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-textarea
+              v-decorator="[
+                'formData.remarks',
+                { initialValue: formData.remarks,
+                  rules: [] },
+              ]"
+              style="min-height: 60px;"
+              :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>
-
-    </a-modal>
+          <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>
+      </a-modal>
+    </a-spin>
   </div>
 </template>
 
@@ -86,6 +87,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       titleText: '添加角色',
       isshow: this.visible,
       formLayout: 'horizontal',
@@ -95,7 +97,6 @@ export default {
         isEnable: '', // 活动状态
         remarks: ''
       }
-
     }
   },
   methods: {
@@ -108,16 +109,17 @@ export default {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          console.log(values.formData, ' formData.type222222222')
+          _this.spinning = true
           saveRolePower(Object.assign(this.formData, values.formData)).then(res => {
-            console.log(res, 'res--save')
-            if (res.status + '' === '200') {
+            if (res.status == 200) {
               this.$message.success(res.message ? res.message : '保存成功')
               this.$emit('refresh')
               setTimeout(function () {
                 _this.cancel()
+                _this.spinning = false
               }, 300)
             } else {
+              _this.spinning = false
               // this.$message.error(res.message)
             }
           })
@@ -132,8 +134,6 @@ export default {
       this.formData.remarks = ''
     }
   },
-  mounted () {
-  },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'roleModal' })
   },
@@ -148,7 +148,6 @@ export default {
           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 = '添加角色'
         }
@@ -161,8 +160,6 @@ export default {
 </script>
 
 <style >
-  .modalBox{
-  }
   .ant-modal-footer {
     display: none;
   }

+ 77 - 64
src/views/power/user/userList.vue

@@ -1,69 +1,71 @@
 <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 id="userList-name" allowClear v-model.trim="queryParam.name" placeholder="请输入用户名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="手机号码">
-              <a-input id="userList-phone" allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="状态">
-              <v-select id="userList-loginFlag" 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)" id="userList-search">查询</a-button>
-            <a-button type="" @click="reset" id="userList-reset" style="margin-left: 10px;">重置</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>
-    </div>
-    <s-table
-      ref="table"
-      size="default"
-      rowKey="id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1360 }"
-      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>
-      </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 && record.ownerOrgFlag==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 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del')"
-          @click="delect(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 id="userList-name" allowClear v-model.trim="queryParam.name" placeholder="请输入用户名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="手机号码">
+                <a-input id="userList-phone" allowClear v-model.trim="queryParam.phone" placeholder="请输入手机号码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <v-select id="userList-loginFlag" 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)" id="userList-search">查询</a-button>
+              <a-button type="" @click="reset" id="userList-reset" style="margin-left: 10px;">重置</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>
+      </div>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1360 }"
+        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>
+        </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 && record.ownerOrgFlag==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 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del')"
+            @click="delect(record)"/>
+        </span>
+      </s-table>
+    </a-spin>
     <!-- 自建账号  新增/编辑 -->
     <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="handleUserCancel"></userModal>
     <userSyncModal :openModal="showSyncModal" @ok="$refs.table.refresh(true)" :nowData="itemData" @close="handleCancel" />
@@ -82,6 +84,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       // 查询参数
       queryParam: {
         name: '',
@@ -144,12 +147,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
             }
           })
         }
@@ -163,14 +170,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
             }
           })
         }
@@ -195,12 +205,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
         }
       })
     }

+ 98 - 93
src/views/power/user/userModal.vue

@@ -1,97 +1,99 @@
 <template>
   <div>
-    <a-modal
-      centered
-      class="userEdit-modal"
-      :footer="null"
-      :maskClosable="false"
-      :title="titleText"
-      v-model="isshow"
-      @cancle="isshow=false"
-      :width="800">
-      <a-form-model
-        id="userEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-model-item label="用户名称" prop="name">
-              <a-input
-                id="userEdit-name"
-                v-model.trim="form.name"
-                @change="filterEmpty"
-                :maxLength="30"
-                allowClear
-                placeholder="请输入用户名称(最多30个字符)"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-model-item label="手机号码" prop="phone">
-              <a-input id="userEdit-phone" v-model.trim="form.phone":maxLength="11" allowClear placeholder="请输入手机号码"/>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="20">
-          <a-col :span="24">
-            <a-form-model-item label="用户账号" prop="loginName" :label-col="{span: 3}" :wrapper-col="{span: 20}">
-              <a-input id="userEdit-loginName" v-model.trim="form.loginName":maxLength="50" allowClear placeholder="请输入用户账号(最多50个字符)"/>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <!-- 性别 -->
-          <a-col :span="12">
-            <a-form-model-item label="性别" prop="sex">
-              <v-select
-                ref="sex"
-                id="userEdit-sex"
-                code="SEX"
-                v-model="form.sex"
-                placeholder="请选择性别"
-                allowClear ></v-select>
-            </a-form-model-item>
-          </a-col>
-          <!-- 状态 -->
-          <a-col :span="12">
-            <a-form-model-item label="状态" prop="loginFlag">
-              <a-radio-group name="radioGroup" v-model="form.loginFlag" placeholder="请选择状态">
-                <a-radio :value="1">是</a-radio>
-                <a-radio :value="0">否</a-radio>
-              </a-radio-group>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-model-item label="角色" prop="roleNames" :label-col="{span: 3}" :wrapper-col="{span: 20}">
-              <a-select
-                placeholder="请选择角色"
-                id="userSyncEdit-roleNames"
-                allowClear
-                v-model="form.roleNames"
-                mode="multiple">
-                <a-select-option v-for="item in roleList" :key="item.id" :value="item.id" :disabled="item.isEnable == '0' ? true : false">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-model-item label="备注" prop="remarks" :label-col="{span: 3}" :wrapper-col="{span: 20}">
-              <a-textarea id="userEdit-remarks" v-model.trim="form.remarks":maxLength="500" allowClear placeholder="请输入备注(最多500个字符)"/>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <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-modal>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-modal
+        centered
+        class="userEdit-modal"
+        :footer="null"
+        :maskClosable="false"
+        :title="titleText"
+        v-model="isshow"
+        @cancle="isshow=false"
+        :width="800">
+        <a-form-model
+          id="userEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-model-item label="用户名称" prop="name">
+                <a-input
+                  id="userEdit-name"
+                  v-model.trim="form.name"
+                  @change="filterEmpty"
+                  :maxLength="30"
+                  allowClear
+                  placeholder="请输入用户名称(最多30个字符)"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="手机号码" prop="phone">
+                <a-input id="userEdit-phone" v-model.trim="form.phone":maxLength="11" allowClear placeholder="请输入手机号码"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="20">
+            <a-col :span="24">
+              <a-form-model-item label="用户账号" prop="loginName" :label-col="{span: 3}" :wrapper-col="{span: 20}">
+                <a-input id="userEdit-loginName" v-model.trim="form.loginName":maxLength="50" allowClear placeholder="请输入用户账号(最多50个字符)"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <!-- 性别 -->
+            <a-col :span="12">
+              <a-form-model-item label="性别" prop="sex">
+                <v-select
+                  ref="sex"
+                  id="userEdit-sex"
+                  code="SEX"
+                  v-model="form.sex"
+                  placeholder="请选择性别"
+                  allowClear ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <!-- 状态 -->
+            <a-col :span="12">
+              <a-form-model-item label="状态" prop="loginFlag">
+                <a-radio-group name="radioGroup" v-model="form.loginFlag" placeholder="请选择状态">
+                  <a-radio :value="1">是</a-radio>
+                  <a-radio :value="0">否</a-radio>
+                </a-radio-group>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-model-item label="角色" prop="roleNames" :label-col="{span: 3}" :wrapper-col="{span: 20}">
+                <a-select
+                  placeholder="请选择角色"
+                  id="userSyncEdit-roleNames"
+                  allowClear
+                  v-model="form.roleNames"
+                  mode="multiple">
+                  <a-select-option v-for="item in roleList" :key="item.id" :value="item.id" :disabled="item.isEnable == '0' ? true : false">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-model-item label="备注" prop="remarks" :label-col="{span: 3}" :wrapper-col="{span: 20}">
+                <a-textarea id="userEdit-remarks" v-model.trim="form.remarks":maxLength="500" allowClear placeholder="请输入备注(最多500个字符)"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <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-modal>
+    </a-spin>
   </div>
 </template>
 
@@ -117,6 +119,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       titleText: '新增用户',
       isshow: this.visible,
       roleList: [],
@@ -160,15 +163,17 @@ export default {
           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
+          _this.spinning = true
           saveUserPower(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('refresh')
               setTimeout(function () {
                 _this.isshow = false
+                _this.spinning = false
               }, 300)
             } else {
-
+              _this.spinning = false
             }
           })
         } else {

+ 28 - 23
src/views/power/user/userSyncModal.vue

@@ -8,29 +8,31 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="userSyncEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="用户名称">{{ detailData && detailData.name ? detailData.name : '--' }}</a-form-model-item>
-        <a-form-model-item label="用户账号">{{ detailData && detailData.loginName ? detailData.loginName : '--' }}</a-form-model-item>
-        <a-form-model-item label="用户角色" prop="roleNames">
-          <a-select placeholder="请选择角色" id="userSyncEdit-roleNames" allowClear v-model="form.roleNames" mode="multiple">
-            <a-select-option v-for="item in roleList" :key="item.id" :value="item.id" :disabled="item.isEnable == '0' ? true : false">{{ item.name }}</a-select-option>
-          </a-select>
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="userSyncEdit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="userSyncEdit-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="userSyncEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="用户名称">{{ detailData && detailData.name ? detailData.name : '--' }}</a-form-model-item>
+          <a-form-model-item label="用户账号">{{ detailData && detailData.loginName ? detailData.loginName : '--' }}</a-form-model-item>
+          <a-form-model-item label="用户角色" prop="roleNames">
+            <a-select placeholder="请选择角色" id="userSyncEdit-roleNames" allowClear v-model="form.roleNames" mode="multiple">
+              <a-select-option v-for="item in roleList" :key="item.id" :value="item.id" :disabled="item.isEnable == '0' ? true : false">{{ item.name }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="userSyncEdit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="userSyncEdit-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -52,6 +54,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -75,15 +78,17 @@ export default {
         if (valid) {
           const params = JSON.parse(JSON.stringify(_this.detailData))
           params.roleNames = _this.form.roleNames.join(',')
+          _this.spinning = true
           saveUserPower(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               setTimeout(function () {
                 _this.isShow = false
+                _this.spinning = false
               }, 300)
             } else {
-
+              _this.spinning = false
             }
           })
         } else {

+ 0 - 20
src/views/productManagement/priceChangeRecord/list.vue

@@ -273,31 +273,11 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.$refs.table.refresh(true)
     },
-    // 审核
-    handleAudit (row) {
-      this.itemId = row.id
-      this.openAuditModal = true
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
-    //  编辑
-    handleEdit (row) {
-      this.itemId = row.id
-      this.openModal = true
-    },
-    //  关闭弹框
-    closeModal () {
-      this.itemId = ''
-      this.openModal = false
-    },
-    //  关闭审核弹框
-    closeAuditModal () {
-      this.itemId = ''
-      this.openAuditModal = false
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''

+ 65 - 59
src/views/productManagement/productBrand/list.vue

@@ -1,64 +1,66 @@
 <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="ENABLE_FLAG" id="productBrandList-enabledFlag" v-model="queryParam.enabledFlag" 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="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 v-if="$hasPermissions('B_product_dealerProductBrand_add')" id="productBrandList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-      <!-- <a-button id="productBrandList-import" @click="handleImport">导入品牌</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="enabledFlag" slot-scope="text, record">
-        <a-switch
-          id="productBrandList-enable"
-          checkedChildren="启用"
-          unCheckedChildren="禁用"
-          v-if="$hasPermissions('B_product_dealerProductBrand_enable')&&record.sysFlag == 0"
-          @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"
-          v-if="$hasPermissions('B_product_dealerProductBrand_edit')&&record.sysFlag == 0"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="productBrandList-edit-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="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="ENABLE_FLAG" id="productBrandList-enabledFlag" v-model="queryParam.enabledFlag" 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="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 v-if="$hasPermissions('B_product_dealerProductBrand_add')" id="productBrandList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+        <!-- <a-button id="productBrandList-import" @click="handleImport">导入品牌</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="enabledFlag" slot-scope="text, record">
+          <a-switch
+            id="productBrandList-enable"
+            checkedChildren="启用"
+            unCheckedChildren="禁用"
+            v-if="$hasPermissions('B_product_dealerProductBrand_enable')&&record.sysFlag == 0"
+            @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"
+            v-if="$hasPermissions('B_product_dealerProductBrand_edit')&&record.sysFlag == 0"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="productBrandList-edit-btn">编辑</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑产品品牌 -->
     <product-brand-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -72,6 +74,7 @@ export default {
   components: { STable, VSelect, productBrandEditModal },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
         brandName: '', //  品牌名称
         enabledFlag: undefined //  状态
@@ -137,12 +140,15 @@ export default {
         id: record.id,
         enabledFlag: record.enabledFlag == 1 ? '0' : '1'
       }
+      _this.spinning = true
       dealerProductBrandUpdate(_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
         }
       })
     },

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

@@ -1,50 +1,52 @@
 <template>
   <a-card size="small" :bordered="false" class="productCategoryList-wrap">
-    <!-- 操作按钮 -->
-    <div class="table-operator-nobor">
-      <a-button v-if="$hasPermissions('B_product_dealerProductType_add')" 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 && $hasPermissions('B_product_dealerProductType_add')&&record.sysFlag == 0"
-          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_product_dealerProductType_edit')&&record.sysFlag == 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 && $hasPermissions('B_product_dealerProductType_del')&&record.sysFlag == 0"
-          type="link"
-          class="button-error"
-          size="small"
-          icon="delete"
-          id="productCategory-del"
-          @click="handleDel(record)">删除</a-button>
-        <span v-if="record.sysFlag != 0">--</span>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator-nobor">
+        <a-button v-if="$hasPermissions('B_product_dealerProductType_add')" 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 && $hasPermissions('B_product_dealerProductType_add')&&record.sysFlag == 0"
+            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_product_dealerProductType_edit')&&record.sysFlag == 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 && $hasPermissions('B_product_dealerProductType_del')&&record.sysFlag == 0"
+            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_product_dealerProductType_add')&&record.sysFlag == 0) && !(record.pid != 0 && $hasPermissions('B_product_dealerProductType_edit')&&record.sysFlag == 0) && !(record.pid != 0 && $hasPermissions('B_product_dealerProductType_del')&&record.sysFlag == 0)">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑产品分类 -->
     <product-category-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -58,6 +60,7 @@ export default {
   components: { STable, productCategoryEditModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       formItemLayout: {
         labelCol: { span: 6 },
@@ -130,10 +133,14 @@ export default {
         content: '删除后原数据不可恢复,是否删除?',
         centered: true,
         onOk () {
+          _this.spinning = true
           dealerProductTypeDel({ id: _this.nowId }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 14 - 22
src/views/productManagement/productInfo/edit.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="productInfoEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="productInfoEdit-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="productInfoEdit-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-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="productInfoEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
       <a-card size="small" :bordered="false" class="productInfoEdit-table-page-wrapper">
         <a-form-model
           id="productInfoEdit-form"
@@ -50,18 +50,6 @@
             </a-input-group>
           </a-form-model-item>
           <a-form-model-item label="产品品牌" prop="productBrandSn">
-            <!-- <a-select
-          id="productInfoEdit-productBrand"
-          placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
-          :disabled="!!$route.params.id"
-          allowClear
-          v-model="form.productBrandSn"
-          :showSearch="true"
-          option-filter-prop="children"
-          :filter-option="filterOption"
-          style="width: 90%;">
-          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
-          </a-select> -->
             <a-select
               show-search
               id="productInfoEdit-productBrand"
@@ -78,6 +66,7 @@
               <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
             </a-select>
             <a-button
+              v-if="$hasPermissions('B_product_dealerProductBrand_add')"
               @click="openModal=true"
               :disabled="!!$route.params.id"
               icon="plus"
@@ -190,11 +179,11 @@ export default {
     }
   },
   methods: {
-    // 搜索经销商
+    // 搜索品牌
     fetchUser (value) {
       console.log('fetching user', value)
       this.fetching = true
-      dealerProductBrandQuery({ 'sysFlag': '0', 'queryWord': value }).then(res => {
+      dealerProductBrandQuery({ 'queryWord': value }).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data || []
           this.fetching = false
@@ -229,6 +218,9 @@ export default {
           const productTypeSn2 = res.data.productTypeSn2 ? res.data.productTypeSn2 : ''
           const productTypeSn3 = res.data.productTypeSn3 ? res.data.productTypeSn3 : ''
           this.form.productType = [productTypeSn1, productTypeSn2, productTypeSn3]
+          if (res.data.productBrandName) {
+            this.fetchUser(res.data.productBrandName)
+          }
         } else {
           this.$refs.ruleForm.resetFields()
         }
@@ -285,7 +277,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand (val) {
-      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      dealerProductBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
           if (val) { //  需将新增加的品牌回填到产品品牌的地方,即不需要用户再选一下
@@ -297,7 +289,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {

+ 124 - 116
src/views/productManagement/productInfo/list.vue

@@ -1,126 +1,129 @@
 <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-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="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-origCode" v-model.trim="queryParam.origCode" 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="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 label="产品编码">
+                <a-input id="productInfoList-code" v-model.trim="queryParam.code" 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="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
+              <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="ENABLE_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
+              <a-form-item label="原厂编码">
+                <a-input id="productInfoList-origCode" v-model.trim="queryParam.origCode" 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="productInfoList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
-            <!-- <a-button
-              style="margin: 0 0 18px 8px"
-              type="danger"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              id="inventoryQueryList-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_product_dealerProduct_add')" id="productInfoList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
-      <!-- <a-button id="productInfoList-import" @click="handleImport" style="margin: 0 15px;">批量导入产品</a-button> -->
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1820, 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="enabledFlag" slot-scope="text, record">
-        <a-switch
-          id="productInfoList-enable"
-          checkedChildren="启用"
-          unCheckedChildren="禁用"
-          v-if="$hasPermissions('B_product_dealerProduct_enable')"
-          @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"
-          v-if="$hasPermissions('B_product_dealerProduct_edit')"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="productInfoList-edit-btn">编辑</a-button>
-        <a-button
-          v-if="$hasPermissions('B_product_dealerProduct_detail')"
-          size="small"
-          type="link"
-          class="button-success"
-          @click="handleDetail(record)"
-          id="productInfoList-detail-btn">详情</a-button>
-      </template>
-    </s-table>
+            <template v-if="advanced">
+              <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>
+              <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="productInfoList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="状态">
+                  <v-select code="ENABLE_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" 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 8px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+              <!-- <a-button
+                style="margin: 0 0 18px 8px"
+                type="danger"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="inventoryQueryList-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_product_dealerProduct_add')" id="productInfoList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+        <!-- <a-button id="productInfoList-import" @click="handleImport" style="margin: 0 15px;">批量导入产品</a-button> -->
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1880, 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="enabledFlag" slot-scope="text, record">
+          <a-switch
+            id="productInfoList-enable"
+            checkedChildren="启用"
+            unCheckedChildren="禁用"
+            v-if="$hasPermissions('B_product_dealerProduct_enable')"
+            @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"
+            v-if="$hasPermissions('B_product_dealerProduct_edit')"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="productInfoList-edit-btn">编辑</a-button>
+          <a-button
+            v-if="$hasPermissions('B_product_dealerProduct_detail')"
+            size="small"
+            type="link"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="productInfoList-detail-btn">详情</a-button>
+          <span v-if="!$hasPermissions('B_product_dealerProduct_edit') && !$hasPermissions('B_product_dealerProduct_detail')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 产品详情 -->
     <product-info-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
   </a-card>
@@ -137,6 +140,7 @@ export default {
   components: { STable, VSelect, productInfoDetailModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       productType: [],
@@ -158,7 +162,7 @@ export default {
         { title: '产品编码', dataIndex: 'code', width: 220, align: 'center' },
         { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center', ellipsis: true },
         { title: '经销批发价', dataIndex: 'specialPrice', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '终端价', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -220,7 +224,6 @@ export default {
 
     },
     filterOption (input, option) {
-      console.log(option.componentOptions.children[0].text, 'option')
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
@@ -262,21 +265,26 @@ export default {
         id: record.id,
         enabledFlag: record.enabledFlag == 1 ? '0' : '1'
       }
+      this.spinning = true
       dealerProductUpdate(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
         }
       })
     },
     //  导出
     handleExport () {
       this.exportLoading = true
+      this.spinning = true
       dealerProductExport(this.queryParam).then(res => {
         this.exportLoading = false
         this.download(res)
+        this.spinning = false
       })
     },
     download (data) {
@@ -293,7 +301,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      dealerProductBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -303,7 +311,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {

+ 1 - 1
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -10,7 +10,7 @@
           <a-tag color="orange">{{ detail&&detail.financialStatusDictValue }}</a-tag>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_purchasePrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>

+ 28 - 11
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -8,7 +8,7 @@
           <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_purchasePrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -23,14 +23,14 @@
           <a-collapse-panel key="1">
             <template slot="header">
               基础信息
-              <a-button
+              <!-- <a-button
                 type="primary"
                 shape="circle"
                 size="small"
                 icon="edit"
                 class="edit-circle-btn"
                 id="purchaseOrderEdit-edit-circle-btn"
-                @click.stop="handleEditInfo" />
+                @click.stop="handleEditInfo" /> -->
             </template>
             <a-descriptions :column="2">
               <a-descriptions-item label="供应商">{{ detail&&detail.purchaseTargetName }}</a-descriptions-item>
@@ -239,11 +239,11 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '箱/单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购单价', dataIndex: 'purchasePrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) }, fixed: 'right' },
+        { title: '采购单价', dataIndex: 'purchasePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, fixed: 'right' },
         { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center', fixed: 'right' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
@@ -268,7 +268,7 @@ export default {
       chooseColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '采购单价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center' },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
@@ -286,6 +286,7 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            data.list[i].qtyBackups = data.list[i].qty
           }
           this.localDataSource = data.list
           this.disabled = false
@@ -332,12 +333,17 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           purchaseDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.resetPurchaseDetail(true)
               _this.$message.success(res.message)
+              _this.delLoading = false
+              _this.spinning = false
+            } else {
+              _this.delLoading = false
+              _this.spinning = false
             }
-            _this.delLoading = false
           })
         }
       })
@@ -349,8 +355,10 @@ export default {
     },
     // 修改数量后
     qtyBlur (val, record) {
-      console.log(val, record)
-      this.handleAdd(record, 1)
+      //  光标移出,值发生改变再调用编辑接口
+      if (val != record.qtyBackups) {
+        this.handleAdd(record, 1)
+      }
     },
     //  导入明细
     handleImport () {
@@ -383,6 +391,10 @@ export default {
     //  添加或修改
     handleAdd (row, type) {
       let params = {}
+      if (type == 0 && !row.qty) {
+        this.$message.warning('请输入数量后再添加!')
+        return
+      }
       // 添加
       if (type == 0) {
         params.productSn = row.productSn
@@ -390,7 +402,12 @@ export default {
         params.purchaseBillNo = this.detail.purchaseBillNo
         params.price = row.purchasePrice
         params.qty = row.qty
-      } else {
+      } else { //  编辑
+        // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
+        if (!row.qty) {
+          row.qty = row.qtyBackups
+          return
+        }
         params = row
       }
       this.addLoading = true

+ 130 - 122
src/views/purchasingManagement/purchaseOrder/list.vue

@@ -1,125 +1,128 @@
 <template>
   <a-card size="small" :bordered="false" class="purchaseOrderList-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="purchaseOrderList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-select
-                id="purchaseOrderList-purchaseTargetSn"
-                placeholder="请选择供应商"
-                allowClear
-                v-model="queryParam.purchaseTargetSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption"
-                @change="tragetTypeChange">
-                <a-select-option v-for="item in supplierList" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">{{ item.purchaseTargetName }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24" v-show="advanced">
-            <a-form-item label="业务状态">
-              <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="purchaseOrderList-billStatus"
-                code="PURCHASE_BILL_STATUS"
-                placeholder="请选择业务状态"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24" v-show="advanced">
-            <a-form-item label="财务状态">
-              <v-select
-                v-model="queryParam.financialStatus"
-                ref="financialStatus"
-                id="purchaseOrderList-financialStatus"
-                code="FINANCIAL_PAY_STATUS"
-                placeholder="请选择财务状态"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="purchaseOrderList-reset">重置</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 id="purchaseOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">共 <strong>{{ totalData.totalRecord }}</strong> 条记录,采购数量合计 <strong>{{ totalData.totalQty }}</strong> ,采购金额合计¥<strong>{{ totalData.totalAmount }}</strong> </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1495, y: tableHeight }"
-      bordered>
-      <!-- 采购单号 -->
-      <template slot="purchaseBillNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.purchaseBillNo }}</span>
-      </template>
-      <!-- 财务状态 -->
-      <template slot="financialStatus" slot-scope="text, record">
-        <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="$refs.financialStatus.getNameByCode(text)" />
-      </template>
-      <!-- 业务状态 -->
-      <template slot="billStatus" slot-scope="text, record">
-        {{ $refs.billStatus.getNameByCode(text) }}
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT'"
-          @click="handleEdit(record)"
-        >编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-warning"
-          v-if="record.billStatus == 'WAIT_PUT_WAREHOUSE'"
-          @click="handleWarehouse(record)"
-        >签收入库</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT'"
-          @click="handleDel(record)"
-        >删除</a-button>
-        <span v-if="record.billStatus != 'WAIT_SUBMIT'&&record.billStatus != 'AUDIT_REJECT'&&record.billStatus != 'WAIT_PUT_WAREHOUSE'">--</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="创建时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="采购单号">
+                <a-input id="purchaseOrderList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <a-select
+                  id="purchaseOrderList-purchaseTargetSn"
+                  placeholder="请选择供应商"
+                  allowClear
+                  v-model="queryParam.purchaseTargetSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption"
+                  @change="tragetTypeChange">
+                  <a-select-option v-for="item in supplierList" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">{{ item.purchaseTargetName }}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="advanced">
+              <a-form-item label="业务状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="purchaseOrderList-billStatus"
+                  code="PURCHASE_BILL_STATUS"
+                  placeholder="请选择业务状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="advanced">
+              <a-form-item label="财务状态">
+                <v-select
+                  v-model="queryParam.financialStatus"
+                  ref="financialStatus"
+                  id="purchaseOrderList-financialStatus"
+                  code="FINANCIAL_PAY_STATUS"
+                  placeholder="请选择财务状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="purchaseOrderList-reset">重置</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 id="purchaseOrderList-add" type="primary" v-if="$hasPermissions('B_purchaseNew')" class="button-error" @click="handleAdd">新增</a-button>
+      </div>
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">共 <strong>{{ totalData.totalRecord }}</strong> 条记录,采购数量合计 <strong>{{ totalData.totalQty }}</strong> ,采购金额合计¥<strong>{{ totalData.totalAmount }}</strong> </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1495, y: tableHeight }"
+        bordered>
+        <!-- 采购单号 -->
+        <template slot="purchaseBillNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_purchaseDetail')" @click="handleDetail(record)">{{ record.purchaseBillNo }}</span>
+          <span v-else>{{ record.purchaseBillNo }}</span>
+        </template>
+        <!-- 财务状态 -->
+        <template slot="financialStatus" slot-scope="text, record">
+          <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="$refs.financialStatus.getNameByCode(text)" />
+        </template>
+        <!-- 业务状态 -->
+        <template slot="billStatus" slot-scope="text, record">
+          {{ $refs.billStatus.getNameByCode(text) }}
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="(record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT') && $hasPermissions('B_purchaseEdit')"
+            @click="handleEdit(record)"
+          >编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            v-if="record.billStatus == 'WAIT_PUT_WAREHOUSE'&&$hasPermissions('B_purchaseReceiving')"
+            @click="handleWarehouse(record)"
+          >签收入库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="(record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT') &&$hasPermissions('B_purchaseDel')"
+            @click="handleDel(record)"
+          >删除</a-button>
+          <span v-if="record.billStatus != 'WAIT_SUBMIT'&&record.billStatus != 'AUDIT_REJECT'&&record.billStatus != 'WAIT_PUT_WAREHOUSE'">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 选择基本信息弹框 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @cancel="openModal=false" />
   </a-card>
@@ -134,6 +137,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 基本信息弹框是否显示
@@ -160,10 +164,10 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: 220, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'purchaseTargetName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'purchaseTargetName', 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 : '--') } },
-        { title: '采购金额(¥)', dataIndex: 'discountedAmount', width: 115, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '采购金额(¥)', dataIndex: 'discountedAmount', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '业务状态', dataIndex: 'billStatus', scopedSlots: { customRender: 'billStatus' }, width: 110, align: 'center' },
         { title: '财务状态', dataIndex: 'financialStatus', scopedSlots: { customRender: 'financialStatus' }, width: 100, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
@@ -234,12 +238,16 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           purchaseDel({
             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
             }
           })
         }

+ 82 - 67
src/views/purchasingManagement/purchaseOrder/receivingAddress/chooseAddressModal.vue

@@ -7,68 +7,70 @@
     title="收货地址"
     v-model="isShow"
     @cancel="isShow=false"
-    :width="900">
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <a-button id="chooseAddressList-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: 1050 }"
-      :showPagination="false"
-      bordered>
-      <!-- 收货人 -->
-      <template slot="consignee" slot-scope="text, record">
-        <div class="item-box">
-          <a-tooltip placement="top">
-            <template slot="title">
-              <span>{{ record.consigneeName }}</span>
-            </template>
-            <p class="ellipsis-txt">{{ record.consigneeName }}</p>
-          </a-tooltip>
-          <span v-if="record.defaultFlag==1" class="badge-txt">默认</span>
-        </div>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="primary"
-          class="button-success"
-          v-if="record.defaultFlag==0"
-          @click="handleDefault(record)"
-          id="chooseAddressList-default-btn">设为默认</a-button>
-        <a-button
-          size="small"
-          type="primary"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="chooseAddressList-edit-btn"
-        >编辑</a-button>
-        <a-button
-          size="small"
-          type="primary"
-          class="button-error"
-          @click="handleDel(record)"
-          id="chooseAddressList-del-btn"
-        >删除</a-button>
-      </template>
-      <!-- 选择 -->
-      <template slot="choose" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="primary"
-          class="button-primary"
-          @click="handleChoose(record)"
-          id="chooseAddressList-choose-btn">选择</a-button>
-      </template>
-    </s-table>
+    :width="960">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="chooseAddressList-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: 1250 }"
+        :showPagination="false"
+        bordered>
+        <!-- 收货人 -->
+        <template slot="consignee" slot-scope="text, record">
+          <div class="item-box">
+            <a-tooltip placement="top">
+              <template slot="title">
+                <span>{{ record.consigneeName }}</span>
+              </template>
+              <p class="ellipsis-txt">{{ record.consigneeName }}</p>
+            </a-tooltip>
+            <span v-if="record.defaultFlag==1" class="badge-txt">默认</span>
+          </div>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="primary"
+            class="button-success"
+            v-if="record.defaultFlag==0"
+            @click="handleDefault(record)"
+            id="chooseAddressList-default-btn">设为默认</a-button>
+          <a-button
+            size="small"
+            type="primary"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="chooseAddressList-edit-btn"
+          >编辑</a-button>
+          <a-button
+            size="small"
+            type="primary"
+            class="button-error"
+            @click="handleDel(record)"
+            id="chooseAddressList-del-btn"
+          >删除</a-button>
+        </template>
+        <!-- 选择 -->
+        <template slot="choose" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="primary"
+            class="button-primary"
+            @click="handleChoose(record)"
+            id="chooseAddressList-choose-btn">选择</a-button>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 新增/编辑地址 -->
     <edit-address-modal ref="addrModal" :openModal="openAddrModal" @ok="handleOk" @close="openAddrModal=false" />
   </a-modal>
@@ -89,14 +91,15 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       queryParam: {},
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '收货人', scopedSlots: { customRender: 'consignee' }, align: 'center', ellipsis: true },
-        { title: '手机号码', dataIndex: 'consigneeTel', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收货地址', dataIndex: 'address', width: 400, align: 'center', ellipsis: true },
+        { title: '手机号码', dataIndex: 'consigneeTel', width: 230, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货地址', dataIndex: 'address', width: 400, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 220, align: 'center', fixed: 'right' },
         { title: '选择', scopedSlots: { customRender: 'choose' }, width: 100, align: 'center', fixed: 'right' }
       ],
@@ -108,7 +111,11 @@ export default {
           const no = 0
           for (var i = 0; i < data.length; i++) {
             data[i].no = no + i + 1
-            data[i].address = data[i].provinceName + '-' + data[i].cityName + '-' + data[i].countyName + '-' + data[i].addr
+            const provinceName = data[i].provinceName ? (data[i].provinceName + '-') : ''
+            const cityName = data[i].cityName ? (data[i].cityName + '-') : ''
+            const countyName = data[i].countyName ? (data[i].countyName + '-') : ''
+            const addr = data[i].addr || ''
+            data[i].address = provinceName + cityName + countyName + addr
           }
           this.disabled = false
           return data
@@ -120,11 +127,15 @@ export default {
   methods: {
     //  设为默认
     handleDefault (row) {
+      this.spinning = true
       shippingAddressSet({ id: row.id }).then(res => {
         if (res.status == 200) {
+          this.$message.success(res.message)
           this.$refs.table.refresh(true)
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
-        this.$message.info(res.message)
       })
     },
     //  新增/编辑收货地址
@@ -155,14 +166,18 @@ export default {
       this.$confirm({
         title: '提示',
         content: '删除后不可恢复,确定要进行删除吗?',
-		    centered: true,
+        centered: true,
         onOk () {
+          _this.spinning = true
           shippingAddressDel({
             id: row.id
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh(true)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 56 - 47
src/views/purchasingManagement/purchaseOrder/receivingAddress/editAddressModal.vue

@@ -18,58 +18,58 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="收货人" prop="consigneeName">
-        <a-input
-          id="editAddress-name"
-          :maxLength="30"
-          v-model="form.consigneeName"
-          placeholder="请输入收货人(最多30个字符)"
-          allowClear />
+          <a-input
+            id="editAddress-name"
+            :maxLength="30"
+            v-model="form.consigneeName"
+            placeholder="请输入收货人(最多30个字符)"
+            allowClear />
         </a-form-model-item>
         <a-form-model-item label="手机号码" prop="consigneeTel">
-        <a-input
-          id="editAddress-phone"
-          :maxLength="11"
-          v-model="form.consigneeTel"
-          placeholder="请输入手机号码(最多11个字符)"
-          allowClear />
+          <a-input
+            id="editAddress-phone"
+            :maxLength="11"
+            v-model="form.consigneeTel"
+            placeholder="请输入手机号码(最多11个字符)"
+            allowClear />
         </a-form-model-item>
         <a-form-model-item label="所在地区" required style="margin: 0;">
-        <a-row :gutter="20">
-          <!-- 所在地区 -->
-          <a-col span="8">
-          <a-form-model-item prop="provinceSn">
-            <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" 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="8">
-          <a-form-model-item prop="citySn">
-            <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" 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="8">
-          <a-form-model-item prop="countySn">
-            <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" 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-row>
+          <a-row :gutter="20">
+            <!-- 所在地区 -->
+            <a-col span="8">
+              <a-form-model-item prop="provinceSn">
+                <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" 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="8">
+              <a-form-model-item prop="citySn">
+                <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" 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="8">
+              <a-form-model-item prop="countySn">
+                <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" 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-row>
         </a-form-model-item>
         <a-form-model-item label="详细地址" prop="addr">
-        <a-input
-          id="editAddress-address"
-          :maxLength="60"
-          v-model="form.addr"
-          placeholder="请输入详细地址(最多60个字符)"
-          allowClear />
+          <a-input
+            id="editAddress-address"
+            :maxLength="60"
+            v-model="form.addr"
+            placeholder="请输入详细地址(最多60个字符)"
+            allowClear />
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-        <a-button type="primary" @click="handleSubmit" id="editAddress-btn-submit">保存</a-button>
-        <a-button @click="isShow=false" style="margin-left: 15px" id="editAddress-btn-back">返回</a-button>
+          <a-button type="primary" @click="handleSubmit" id="editAddress-btn-submit">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="editAddress-btn-back">返回</a-button>
         </a-form-model-item>
       </a-form-model>
     </a-spin>
@@ -209,11 +209,20 @@ export default {
       Promise.all([getArea({ type: '2' }), getArea({ parentId: data.provinceSn, type: '3' }), getArea({ parentId: data.citySn, type: '4' })]).then(res => {
         console.log(res)
         this.addrProvinceList = res[0].data
-        this.form.provinceName = this.addrProvinceList.find(item => item.id == data.provinceSn).name
+        const provinceName = this.addrProvinceList.find(item => item.id == data.provinceSn)
+        if (provinceName && provinceName.name) {
+          this.form.provinceName = provinceName.name
+        }
         this.addrCityList = res[1].data
-        this.form.cityName = this.addrCityList.find(item => item.id == data.citySn).name
+        const cityName = this.addrCityList.find(item => item.id == data.citySn)
+        if (cityName && cityName.name) {
+          this.form.cityName = cityName.name
+        }
         this.addrDistrictList = res[2].data
-        this.form.countyName = this.addrDistrictList.find(item => item.id == data.countySn).name
+        const countyName = this.addrDistrictList.find(item => item.id == data.countySn)
+        if (countyName && countyName.name) {
+          this.form.countyName = countyName.name
+        }
         this.form = Object.assign({}, this.form, data)
       })
     }

+ 6 - 7
src/views/purchasingManagement/purchaseOrder/warehousing.vue

@@ -5,7 +5,7 @@
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
           <a id="purchaseOrderWarehousing-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-          <span class="billno">单号:{{ detail&&detail[0].purchaseBillNo }}</span>
+          <span class="billno">单号:{{ (detail&&detail[0]&&detail[0].purchaseBillNo) ? detail[0].purchaseBillNo : '--' }}</span>
         </template>
       </a-page-header>
       <!-- 内容 -->
@@ -94,10 +94,10 @@ export default {
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购单价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购数量', dataIndex: 'qty', width: 100, align: 'center', scopedSlots: { customRender: 'origqty' } },
-        { title: '本次发货数量', dataIndex: 'shippedQty', width: 120, align: 'center', customRender: function (text) { return text || 0 } },
+        { title: '本次发货数量', dataIndex: 'shippedQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '本次发货金额', dataIndex: 'totalAmount', width: 120, align: 'center', customRender: function (text) { return '¥' + (text || 0) }, fixed: 'right' },
-        { title: '本次入库数量', dataIndex: 'putQty', width: 120, align: 'center', fixed: 'right' },
+        { title: '本次发货金额', dataIndex: 'totalAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, fixed: 'right' },
+        { title: '本次入库数量', dataIndex: 'putQty', width: 120, align: 'center', customRender: function (text) { return text || '--' }, fixed: 'right' },
         { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: 250, align: 'center', fixed: 'right' }
       ],
       chooseLoadData: [],
@@ -209,7 +209,6 @@ export default {
     },
     // 修改仓库仓位
     changeWarehouseCascade (val, opt, ind, bindex) {
-      console.log(val, opt, ind)
       let loadData = this.chooseLoadData[bindex][ind]
       if (val.length == 1) {
         this.$message.warning('当前仓库无仓位,请选择其他仓库')
@@ -260,8 +259,8 @@ export default {
 <style lang="less">
   .purchaseOrderWarehousing-wrap{
     .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
+      text-align: center;
+      margin: 35px 0 10px;
     }
     .billno{
       font-size: 14px;

+ 1 - 1
src/views/purchasingManagement/purchaseReturn/detail.vue

@@ -66,7 +66,7 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 200, align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '售价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 13 - 5
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -157,9 +157,9 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 220, align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center' },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '采购总数', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '可退数量', dataIndex: 'refundableQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: 100, align: 'center' },
@@ -180,9 +180,9 @@ export default {
       // 表头
       chooseColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 220, align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '采购总数', dataIndex: 'purchaseBillQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
         { title: '采购价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -275,19 +275,27 @@ export default {
         centered: true,
         onOk () {
           if (isAll) { //  整单删除
+            _this.spinning = true
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.getPurchaseBillDetailList()
                 _this.getChooseProductList()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
               }
             })
           } else { //  单个删除
+            _this.spinning = true
             purchaseReturnDetailDel({ id: row.id }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.getPurchaseBillDetailList()
                 _this.getChooseProductList()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
               }
             })
           }

+ 100 - 88
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -1,96 +1,99 @@
 <template>
   <a-card size="small" :bordered="false" class="purchaseReturnList-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="purchaseReturnList-purchaseReturnNo" v-model.trim="queryParam.purchaseReturnNo" 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="purchaseReturnList-state"
-                code="PURCHASE_RETURN_STATUS"
-                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-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="purchaseReturnList-purchaseReturnNo" v-model.trim="queryParam.purchaseReturnNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务状态">
                 <v-select
-                  v-model="queryParam.settleState"
-                  ref="settleState"
-                  id="chainTransferOutList-settleState"
-                  code="FINANCIAL_RECEIVE_STATUS"
-                  placeholder="请选择财务状态"
-                  allowClear></v-select>
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="purchaseReturnList-state"
+                  code="PURCHASE_RETURN_STATUS"
+                  placeholder="请选择业务状态"
+                  allowClear
+                ></v-select>
               </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="purchaseReturnList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-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="purchaseReturnList-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: 1250, y: tableHeight }"
-      bordered>
-      <!-- 采退单号 -->
-      <template slot="purchaseReturnNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.purchaseReturnNo }}</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"
-          class="button-info"
-          v-if="record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT'"
-          @click="handleEdit(record)"
-          id="purchaseReturnList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT'"
-          @click="handleDel(record)"
-          id="purchaseReturnList-del-btn">删除</a-button>
-        <span v-if="!(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT')">--</span>
-      </template>
-    </s-table>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.settleState"
+                    ref="settleState"
+                    id="chainTransferOutList-settleState"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </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="purchaseReturnList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-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="purchaseReturnList-add" type="primary" v-if="$hasPermissions('B_purchaseReturnNew')" 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: 1250, y: tableHeight }"
+        bordered>
+        <!-- 采退单号 -->
+        <template slot="purchaseReturnNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_purchaseReturnDetail')" @click="handleDetail(record)">{{ record.purchaseReturnNo }}</span>
+          <span v-else>{{ record.purchaseReturnNo }}</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"
+            class="button-info"
+            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturnEdit')"
+            @click="handleEdit(record)"
+            id="purchaseReturnList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturnDel')"
+            @click="handleDel(record)"
+            id="purchaseReturnList-del-btn">删除</a-button>
+          <span v-if="!(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -103,6 +106,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
         beginDate: '',
@@ -114,7 +118,7 @@ export default {
       tableHeight: 0,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采退单号', scopedSlots: { customRender: 'purchaseReturnNo' }, align: 'center' },
         { 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 : '--') } },
@@ -165,10 +169,14 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           purchaseReturnDel({ 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
             }
           })
         }
@@ -200,10 +208,14 @@ export default {
               returnTargetName: _this.purchaseTragetType[0].purchaseTargetName,
               returnTargetType: _this.purchaseTragetType[0].purchaseTargetType
             }
+            _this.spinning = true
             purchaseReturnSave(params).then(res => {
               if (res.status == 200) {
                 const data = res.data
+                _this.spinning = false
                 _this.$router.push({ path: `/purchasingManagement/purchaseReturn/add/${data.id}/${data.purchaseReturnSn}/${data.returnTargetName}` })
+              } else {
+                _this.spinning = false
               }
             })
           }

+ 205 - 345
src/views/reportData/chainReceivedSendStorageReport/list.vue

@@ -1,97 +1,112 @@
 <template>
   <a-card size="small" :bordered="false" class="sendStorageReportList-wrap">
     <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="sendStorageReportList-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-model-item label="连锁店" prop="targetName">
-              <a-select
-                placeholder="请选择连锁店"
-                id="sendStorageReportList-targetName"
-                allowClear
-                v-model="queryParam.targetName"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in allocateTypeList" :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="日期">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品编码">
-              <a-input id="sendStorageReportList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="sendStorageReportList-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-model-item label="产品名称">
-                <a-input id="sendStorageReportList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品品牌">
+              <a-form-model-item label="连锁店" prop="dealerSn">
                 <a-select
-                  placeholder="请选择产品品牌"
-                  id="sendStorageReportList-productBrandSn"
+                  placeholder="请选择连锁店"
+                  id="sendStorageReportList-dealerSn"
                   allowClear
-                  v-model="queryParam.productBrandSn"
+                  v-model="queryParam.dealerSn"
                   :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-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</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"
-                  change-on-select
-                  v-model="productType"
-                  expand-trigger="hover"
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="sendStorageReportList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
+              <a-form-model-item label="日期" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-model-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="sendStorageReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="sendStorageReportList-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: 2390 }"
-      bordered>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="sendStorageReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="sendStorageReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="sendStorageReportList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productEntity.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"
+                    change-on-select
+                    v-model="productType"
+                    expand-trigger="hover"
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="sendStorageReportList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear />
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="sendStorageReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="sendStorageReportList-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: 2530 }"
+        bordered>
+        <template slot="footer" slot-scope="currentPageData">
+          <span>
+            合计: 期初数量:{{ (totalData && (totalData.beginQty || totalData.beginQty==0)) ? totalData.beginQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            期初金额:{{ (totalData && (totalData.beginAmount || totalData.beginAmount==0)) ? totalData.beginAmount : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            收入数量:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            收入金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? totalData.putAmount : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            发出数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ? totalData.outQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            发出金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? totalData.outAmount : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            结算数量:{{ (totalData && (totalData.endQty || totalData.endQty==0)) ? totalData.endQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            结算金额:{{ (totalData && (totalData.endAmount || totalData.endAmount==0)) ? totalData.endAmount : '--' }}
+          </span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -100,290 +115,107 @@ import { STable, VSelect } from '@/components'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { linkageReportPageList, linkageReportPageTotal, linkageGroupList } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        time: [],
         beginDate: '',
         endDate: '',
-        targetName: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        dealerSn: undefined,
+        productEntity: {
+          code: '', //  产品编码
+          name: '', //  产品名称
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '' //  产品三级分类
+        }
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       rules: {
-        'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
+        'dealerSn': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
-        { title: '序号',
-          dataIndex: 'no',
-          width: 80,
-          align: 'center',
-          customRender: function (value, row, index) {
-            const obj = { children: value, attrs: {} }
-            if (value == '合计') {
-              console.log(111)
-              obj.attrs.colSpan = 7
-            }
-            return obj
-          }
-          // fixed: 'left'
-        },
-        { title: '产品编码',
-          dataIndex: 'code',
-          width: 220,
-          align: 'center',
-          customRender: function (value, row, index) {
-            value = value || '--'
-            const obj = { children: value, attrs: {} }
-            if (value == '合计') { obj.attrs.colSpan = 0 }
-            return obj
-          }
-        },
-        { title: '产品名称',
-          dataIndex: 'name',
-          align: 'center',
-          customRender: function (value, row, index) {
-            value = value || '--'
-            const obj = { children: value, attrs: {} }
-            if (value == '合计') { obj.attrs.colSpan = 0 }
-            return obj
-          },
-          ellipsis: true
-        },
-        { title: '品牌',
-          dataIndex: 'brand',
-          align: 'center',
-          width: 200,
-          customRender: function (value, row, index) {
-            value = value || '--'
-            const obj = { children: value, attrs: {} }
-            if (value == '合计') { obj.attrs.colSpan = 0 }
-            return obj
-          }
-        },
-        { title: '三级分类',
-          dataIndex: 'productLeve',
-          width: 150,
-          align: 'center',
-          customRender: function (value, row, index) {
-            value = value || '--'
-            const obj = { children: value, attrs: {} }
-            if (value == '合计') { obj.attrs.colSpan = 0 }
-            return obj
-          }
-        },
-        { title: '原厂编码',
-          dataIndex: 'origCode',
-          width: 220,
-          align: 'center',
-          customRender: function (value, row, index) {
-            value = value || '--'
-            const obj = { children: value, attrs: {} }
-            if (value == '合计') { obj.attrs.colSpan = 0 }
-            return obj
-          }
-        },
-        { title: '单位',
-          dataIndex: 'unit',
-          width: 100,
-          align: 'center',
-          customRender: function (value, row, index) {
-            value = value || '--'
-            const obj = { children: value, attrs: {} }
-            if (value == '合计') { obj.attrs.colSpan = 0 }
-            return obj
-          }
-        },
-        { title: '期初数量', dataIndex: 'sqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '期初单价(¥)', dataIndex: 'sprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '期初金额(¥)', dataIndex: 'samount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收入数量', dataIndex: 'srqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收入单价(¥)', dataIndex: 'srprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收入金额(¥)', dataIndex: 'sramount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '发出数量', dataIndex: 'fcqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '发出单价(¥)', dataIndex: 'fcprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '发出金额(¥)', dataIndex: 'fcamount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '结存数量', dataIndex: 'dcqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '结存单价(¥)', dataIndex: 'dcprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '结存金额(¥)', dataIndex: 'dcamount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '三级分类', dataIndex: 'productEntity.productTypeName3', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '期初数量', dataIndex: 'beginQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初单价(¥)', dataIndex: 'beginPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初金额(¥)', dataIndex: 'beginAmount', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入数量', dataIndex: 'putQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入单价(¥)', dataIndex: 'putPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入金额(¥)', dataIndex: 'putAmount', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出数量', dataIndex: 'outQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出单价(¥)', dataIndex: 'outPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出金额(¥)', dataIndex: 'outAmount', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存数量', dataIndex: 'endQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存单价(¥)', dataIndex: 'endPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存金额(¥)', dataIndex: 'endAmount', width: 120, align: 'center', sorter: true, 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: [
-              { id: '1',
-                code: '0000 1110 V003 / 000 1110 V004',
-                name: '广州非品牌 空调滤清器',
-                brand: '非品牌',
-                productLeve: '空调滤清器',
-                origCode: '',
-                unit: '个',
-                sqty: '18',
-                sprice: '4.72',
-                samount: '85.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '0',
-                fcprice: '0',
-                fcamount: '0',
-                dcqty: '18',
-                dcprice: '4.72',
-                dcamount: '85.00'
-              },
-              { id: '2',
-                code: '0000015',
-                name: '辅助单位测试',
-                brand: '雪企',
-                productLeve: '雪种油',
-                origCode: '',
-                unit: '升',
-                sqty: '24',
-                sprice: '32.71',
-                samount: '785.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '0',
-                fcprice: '0',
-                fcamount: '0',
-                dcqty: 24,
-                dcprice: '32.71',
-                dcamount: '785.00'
-              },
-              { id: '3',
-                code: '0000015',
-                name: '辅助单位',
-                brand: '阿尔派',
-                productLeve: '电喇叭',
-                origCode: '',
-                unit: '个',
-                sqty: '16',
-                sprice: '120.00',
-                samount: '1920.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '0',
-                fcprice: '0',
-                fcamount: '0',
-                dcqty: 16,
-                dcprice: '120.00',
-                dcamount: '1920.00'
-              },
-              { id: '4',
-                code: '0000015',
-                name: '辅助单位',
-                brand: '阿尔派',
-                productLeve: '电喇叭',
-                origCode: '',
-                unit: '个',
-                sqty: '11',
-                sprice: '120.00',
-                samount: '1320.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '0',
-                fcprice: '0',
-                fcamount: '0',
-                dcqty: 11,
-                dcprice: '120.00',
-                dcamount: '1320.00'
-              },
-              { id: '5',
-                code: '00089',
-                name: 'SOFT99车蜡 氟素镀膜 白色车身用 防水保护效果持久',
-                brand: 'SOFT99',
-                productLeve: '车蜡',
-                origCode: '',
-                unit: '瓶',
-                sqty: '32',
-                sprice: '34.38',
-                samount: '1100.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '0',
-                fcprice: '0',
-                fcamount: '0',
-                dcqty: 32,
-                dcprice: '34.38',
-                dcamount: '1100.00'
-              },
-              { id: '6',
-                code: '合计',
-                name: '合计',
-                brand: '合计',
-                productLeve: '合计',
-                origCode: '合计',
-                unit: '合计',
-                sqty: '2208',
-                sprice: '',
-                samount: '48254.44',
-                srqty: 18,
-                srprice: '',
-                sramount: '135.00',
-                fcqty: '0',
-                fcprice: '0.00',
-                fcamount: '0.00',
-                dcqty: 2226,
-                dcprice: '',
-                dcamount: '48389.00'
-              }
-            ],
-            count: 10
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        if (this.queryParam.beginDate && this.queryParam.dealerSn) {
+          if (params.dealerSn == 'all') {
+            params.dealerSn = ''
           }
-          for (var i = 0; i < data.list.length; i++) {
-            if (i < data.list.length - 1) {
-              data.list[i].no = i + 1
-            } else {
-              data.list[i].no = '合计'
+          return linkageReportPageList(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
-          resolve(data)
-        })
+            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)
+          })
+        }
       },
       productType: [],
+      linkageGroupData: [],
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
-      allocateTypeList: [] //  调拨类型
+      totalData: null // 合计
     }
   },
   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] || ''
     },
     //  查询
     handleSearch () {
@@ -396,28 +228,43 @@ export default {
         }
       })
     },
+    // 查询总计
+    getCount (params) {
+      linkageReportPageTotal(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     //  重置
     resetSearchForm () {
-      this.queryParam.targetName = undefined
-      this.queryParam.code = ''
-      this.queryParam.name = ''
-      this.queryParam.origCode = ''
-      this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
+      this.queryParam.dealerSn = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
       this.productType = []
-      this.$refs.table.refresh(true)
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
     },
     //  产品分类  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] : ''
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      dealerProductBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -427,7 +274,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {
@@ -439,10 +286,23 @@ export default {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        const all = [{ dealerName: '全部', dealerSn: 'all' }]
+        if (res.status == 200) {
+          const data = res.data || []
+          this.linkageGroupData = [...all, ...data]
+        } else {
+          this.linkageGroupData = all
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      vm.getLinkageGroup()
       vm.getProductBrand()
       vm.getProductType()
     })

+ 282 - 218
src/views/reportData/chainSalesDetailReport/list.vue

@@ -1,176 +1,179 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
-    <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="chainStockReportList-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-model-item label="连锁店" prop="targetName">
-              <a-select
-                placeholder="请选择连锁店"
-                id="chainStockReportList-targetName"
-                allowClear
-                v-model="queryParam.targetName"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in allocateTypeList" :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="审核时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="客户名称">
-              <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入客户名称"/>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+  <a-card size="small" :bordered="false" class="chainSalesDetailReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainSalesDetailReportList-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-model-item label="客户类型">
-                <a-select id="chainStockReportList-customerType" v-model="queryParam.customerTypeSn" allowClear placeholder="请选择客户类型">
-                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="12" :sm="24">
-              <a-row>
-                <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
-                  <a-col span="7">
-                    <a-form-model-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-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" @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" 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>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="收款方式">
-                <a-select id="chainStockReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式">
-                  <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
+              <a-form-model-item label="连锁店" prop="dealerSn">
                 <a-select
-                  placeholder="请选择产品品牌"
-                  id="chainStockReportList-productBrandSn"
+                  placeholder="请选择连锁店"
+                  id="chainSalesDetailReportList-dealerSn"
                   allowClear
-                  v-model="queryParam.productBrandSn"
+                  v-model="queryParam.dealerSn"
                   :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-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
                 </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  change-on-select
-                  v-model="productType"
-                  expand-trigger="hover"
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品编码">
-                <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品名称">
-                <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入业务员"/>
+              <a-form-model-item label="审核时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="仓库仓位">
-                <a-cascader
-                  v-model="queryParam.warehouseCascade"
-                  expand-trigger="hover"
-                  :allowClear="false"
-                  :options="warehouseCascadeData"
-                  :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-                  id="chainStockReportList-warehouseCascade"
-                  placeholder="请选择仓库仓位"
-                  style="width: 100%;" />
+              <a-form-model-item label="客户名称">
+                <a-input id="chainSalesDetailReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="单号">
-                <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入单号"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="业务员">
-                <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入业务员"/>
-              </a-form-model-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户类型">
+                  <a-select id="chainSalesDetailReportList-customerType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
+                    <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                    <a-col span="7">
+                      <a-form-model-item prop="provinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省" allowClear>
+                          <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="citySn" style="margin: 0;">
+                        <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市" allowClear>
+                          <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="countySn" style="margin: 0;">
+                        <a-select v-model="queryParam.countySn" placeholder="请选择区/县" allowClear>
+                          <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>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="收款方式">
+                  <a-select id="chainSalesDetailReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式">
+                    <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="chainSalesDetailReportList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productEntity.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-model-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    change-on-select
+                    v-model="productType"
+                    expand-trigger="hover"
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="chainSalesDetailReportList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input id="chainSalesDetailReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="chainSalesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="仓库仓位">
+                  <a-cascader
+                    v-model="queryParam.warehouseCascade"
+                    expand-trigger="hover"
+                    :options="warehouseCascadeData"
+                    :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+                    id="chainSalesDetailReportList-warehouseCascade"
+                    placeholder="请选择仓库仓位"
+                    @change="warehouseCascadeChange"
+                    style="width: 100%;" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="单号">
+                  <a-input id="chainSalesDetailReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="业务员">
+                  <a-input id="chainSalesDetailReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesDetailReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesDetailReportList-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-top: 3px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-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>
-    <!-- 合计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">
-        产品总数量:<strong>45</strong>;
-        总成本:<strong>¥33.00</strong>;
-        总售价:<strong>¥48.00</strong>;
-        总毛利:<strong>¥15.00</strong>。
+          </a-row>
+        </a-form-model>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1720 }"
-      bordered>
-    </s-table>
+      <!-- 合计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div class="ftext" slot="message">
+          产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+          总成本:<strong>¥{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</strong>;
+          总售价:<strong>¥{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}</strong>;
+          总毛利:<strong>¥{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? totalData.totalProfit : '--' }}</strong>。
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1770 }"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -183,77 +186,89 @@ import { settleStyleFindAllList } from '@/api/customer'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { warehouseCascadeList } from '@/api/warehouse'
+import { reportSalesBillDetailList, reportSalesBillDetailCount, linkageGroupList } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        dealerSn: undefined,
+        time: [],
         beginDate: '',
         endDate: '',
-        targetName: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        salesTargetName: '',
+        salesTargetType: undefined,
+        provinceSn: undefined, //  省
+        citySn: undefined, //  市
+        countySn: undefined, //  区
+        settleStyleSn: undefined,
+        productEntity: {
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '', //  产品三级分类
+          code: '', //  产品编码
+          name: '' //  产品名称
+        },
+        warehouseCascade: [],
+        warehouseSn: undefined,
+        warehouseLocationSn: undefined,
+        salesBillNo: '',
+        salesManName: ''
       },
       rules: {
-        'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
+        'dealerSn': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '销售单号', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'currentStockCost', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'proCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'proName', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'totalCost', 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: 'totalMl', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '审核时间', dataIndex: 'auditDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'productQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本', dataIndex: 'productCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '售价', dataIndex: 'productPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '毛利', dataIndex: 'productProfit', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: 160, 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: [
-              { id: '1', code: '159177', name: '支持市级', orderType: '线下', payType: '货到付款', currentStockCost: '现金', proCode: '00004', proName: 'xl测试00004', unit: '个', totalCategory: '3', totalQty: '3', totalCost: '33.00', totalAmount: '48.00', totalMl: '15.00', billName: '', auditDate: '2021-03-19 18:27:48' }
-            ],
-            count: 10
-          }
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        delete params.warehouseCascade
+        if (params.dealerSn == 'all') {
+          params.dealerSn = ''
+        }
+        return reportSalesBillDetailList(params).then(res => {
+          // 总计
+          this.getCount(params)
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = 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: [], //  区下拉
+      linkageGroupData: [],
       allocateTypeList: [], //  调拨类型
       custTypeList: [], //  客户类型 下拉数据
       settleStyleList: [], //  收款方式  下拉数据
@@ -264,10 +279,21 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    // 合计
+    getCount (params) {
+      reportSalesBillDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  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] || ''
     },
     //  查询
     handleSearch () {
@@ -282,16 +308,32 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.targetName = undefined
-      this.queryParam.code = ''
-      this.queryParam.name = ''
-      this.queryParam.origCode = ''
-      this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
+      this.queryParam.dealerSn = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.salesTargetName = ''
+      this.queryParam.salesTargetType = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
+      this.queryParam.settleStyleSn = undefined
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.warehouseLocationSn = undefined
+      this.queryParam.warehouseCascade = []
+      this.queryParam.salesBillNo = ''
+      this.queryParam.salesManName = ''
       this.productType = []
-      this.$refs.table.refresh(true)
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
     },
     filterOption (input, option) {
       return (
@@ -321,7 +363,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      dealerProductBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -331,13 +373,13 @@ export default {
     },
     //  产品分类  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] : ''
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {
@@ -345,9 +387,20 @@ export default {
         }
       })
     },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        const all = [{ dealerName: '全部', dealerSn: 'all' }]
+        if (res.status == 200) {
+          const data = res.data || []
+          this.linkageGroupData = [...all, ...data]
+        } else {
+          this.linkageGroupData = all
+        }
+      })
+    },
     //  仓库仓位  级联  列表
     getWarehouseCascade () {
-      const _this = this
       warehouseCascadeList({}).then(res => {
         if (res.status == 200) {
           res.data.map(item => {
@@ -364,18 +417,28 @@ export default {
         }
       })
     },
+    // 仓库仓位change
+    warehouseCascadeChange (val) {
+      if (val && val.length > 0) {
+        this.queryParam.warehouseSn = val[0] || ''
+        this.queryParam.warehouseLocationSn = val[1] || ''
+      } else {
+        this.queryParam.warehouseSn = ''
+        this.queryParam.warehouseLocationSn = ''
+      }
+    },
     // 获取城市列表
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.countySn = undefined
       this.getArea('district', val)
     },
     //  省/市/区
@@ -409,6 +472,7 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      vm.getLinkageGroup()
       vm.getArea('province')
       vm.getCustTypeList()
       vm.getSettleStyleList()

+ 198 - 165
src/views/reportData/chainSalesReport/list.vue

@@ -1,126 +1,129 @@
 <template>
   <a-card size="small" :bordered="false" class="chainSalesReportList-wrap">
-    <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="chainSalesReportList-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-model-item label="连锁店" prop="targetName">
-              <a-select
-                placeholder="请选择连锁店"
-                id="chainSalesReportList-targetName"
-                allowClear
-                v-model="queryParam.targetName"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in allocateTypeList" :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="审核时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="客户名称">
-              <a-input id="chainSalesReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入客户名称"/>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainSalesReportList-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-model-item label="客户类型">
-                <a-select id="chainSalesReportList-customerType" v-model="queryParam.customerTypeSn" allowClear placeholder="请选择客户类型">
-                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
+              <a-form-model-item label="连锁店" prop="dealerSn">
+                <a-select
+                  placeholder="请选择连锁店"
+                  id="chainSalesReportList-dealerSn"
+                  allowClear
+                  v-model="queryParam.dealerSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
-            <a-col :md="12" :sm="24">
-              <a-row>
-                <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
-                  <a-col span="7">
-                    <a-form-model-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-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" @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" 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>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="收款方式">
-                <a-select id="chainSalesReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式">
-                  <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
-                </a-select>
+              <a-form-model-item label="审核时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="单号">
-                <a-input id="chainSalesReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入单号"/>
+              <a-form-model-item label="客户名称">
+                <a-input id="chainSalesReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="业务员">
-                <a-input id="chainSalesReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入业务员"/>
-              </a-form-model-item>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户类型">
+                  <a-select id="chainSalesReportList-salesTargetType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
+                    <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                    <a-col span="7">
+                      <a-form-model-item prop="provinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.provinceSn" @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="citySn" style="margin: 0;">
+                        <a-select v-model="queryParam.citySn" @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="countySn" style="margin: 0;">
+                        <a-select v-model="queryParam.countySn" 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>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="收款方式">
+                  <a-select id="chainSalesReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式">
+                    <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ 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="chainSalesReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="业务员">
+                  <a-input id="chainSalesReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesReportList-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-top: 3px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesReportList-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>
-    <!-- 合计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">
-        总单数:<strong>1</strong>;
-        产品总数量:<strong>3</strong>;
-        总成本:<strong>¥33.00</strong>;
-        总售价:<strong>¥48.00</strong>;
-        总毛利:<strong>¥15.00</strong>。
+          </a-row>
+        </a-form-model>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1170 }"
-      bordered>
-    </s-table>
+      <!-- 合计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div class="ftext" slot="message">
+          总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
+          产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+          总成本:<strong>¥{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</strong>;
+          总售价:<strong>¥{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}</strong>;
+          总毛利:<strong>¥{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? totalData.totalProfit : '--' }}</strong>。
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1480 }"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -130,73 +133,73 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { getArea } from '@/api/data'
 import { custTypeFindAllList } from '@/api/custType'
 import { settleStyleFindAllList } from '@/api/customer'
+import { reportSalesBillList, reportSalesBillCount, linkageGroupList } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        dealerSn: undefined,
+        time: [],
         beginDate: '',
         endDate: '',
-        targetName: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        salesTargetName: '',
+        salesTargetType: undefined,
+        provinceSn: undefined, //  省
+        citySn: undefined, //  市
+        countySn: undefined, //  区
+        settleStyleSn: undefined,
+        salesBillNo: '',
+        salesManName: ''
       },
       rules: {
-        'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
+        'dealerSn': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '销售单号', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'currentStockCost', width: 165, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '款数', dataIndex: 'totalCategory', width: 165, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量', dataIndex: 'totalQty', width: 165, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'totalCost', width: 165, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '售价', dataIndex: 'totalAmount', width: 165, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '毛利', dataIndex: 'totalMl', width: 165, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '业务员', dataIndex: 'billName', width: 165, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'auditDate', width: 165, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { 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 : '--') } },
+        { title: '成本', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '售价', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '毛利', dataIndex: 'totalProfit', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '业务员', dataIndex: 'salesManName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: 160, 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: [
-              { id: '1', code: '159177', name: '支持市级', currentStockCost: '现金', totalCategory: '3', totalQty: '3', totalCost: '33.00', totalAmount: '48.00', totalMl: '15.00', billName: '', auditDate: '2021-03-19 18:27:48' }
-            ],
-            count: 10
-          }
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        if (params.dealerSn == 'all') {
+          params.dealerSn = ''
+        }
+        return reportSalesBillList(params).then(res => {
+          // 总计
+          this.getCount(params)
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.spinning = false
+          return data
         })
       },
+      totalData: null, //  合计
+      linkageGroupData: [],
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
@@ -206,10 +209,21 @@ export default {
     }
   },
   methods: {
+    // 合计
+    getCount (params) {
+      reportSalesBillCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     //  创建时间  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] || ''
     },
     //  查询
     handleSearch () {
@@ -224,16 +238,22 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.targetName = undefined
-      this.queryParam.code = ''
-      this.queryParam.name = ''
-      this.queryParam.origCode = ''
-      this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.productType = []
-      this.$refs.table.refresh(true)
+      this.queryParam.dealerSn = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.salesTargetName = ''
+      this.queryParam.salesTargetType = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
+      this.queryParam.settleStyleSn = undefined
+      this.queryParam.salesBillNo = ''
+      this.queryParam.salesManName = ''
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
     },
     filterOption (input, option) {
       return (
@@ -261,18 +281,30 @@ export default {
         }
       })
     },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        const all = [{ dealerName: '全部', dealerSn: 'all' }]
+        if (res.status == 200) {
+          const data = res.data || []
+          this.linkageGroupData = [...all, ...data]
+        } else {
+          this.linkageGroupData = all
+        }
+      })
+    },
     // 获取城市列表
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.countySn = undefined
       this.getArea('district', val)
     },
     //  省/市/区
@@ -306,6 +338,7 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      vm.getLinkageGroup()
       vm.getArea('province')
       vm.getCustTypeList()
       vm.getSettleStyleList()

+ 23 - 49
src/views/reportData/chainStockReport/detailModal.vue

@@ -10,13 +10,10 @@
     :width="960">
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):
-        <strong>
-          <!-- {{ currentStock.currentQty || 0 }} -->207
-        </strong>;现有库存总成本(¥):
-        <strong>
-          <!-- {{ currentStock.putCost || 0 }} -->1550.5
-        </strong>。</div>
+      <div class="ftext" slot="message">
+        现有库存总数量(个):<strong> {{ (currentStock && currentStock.totalQty) || 0 }} </strong>;
+        现有库存总成本(¥):<strong> {{ (currentStock && currentStock.totalCost) || 0 }} </strong>。
+      </div>
     </a-alert>
     <!-- 详情 -->
     <s-table
@@ -31,8 +28,8 @@
       bordered>
       <!-- 库存数量 -->
       <template slot="currentQty" slot-scope="text, record">
-        {{ (record.currentQty + record.freezeQty) || 0 }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+        {{ (Number(record.currentQty) + Number(record.freezeQty)) || 0 }}
+        <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
       </template>
     </s-table>
     <div class="btn-cont">
@@ -43,7 +40,7 @@
 
 <script>
 import { STable } from '@/components'
-import { stockDetailList, stockDetailCount } from '@/api/stock'
+import { reportStockDetailList, reportStockCount } from '@/api/reportStock'
 export default {
   name: 'InventoryQueryDetailModal',
   components: { STable },
@@ -52,7 +49,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    productSn: {
       type: [Number, String],
       default: ''
     }
@@ -68,9 +65,9 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
@@ -80,52 +77,29 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.disabled = true
-        // return stockDetailList(Object.assign(parameter, { stockSn: this.itemId })).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   // 总计
-        //   this.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productCode: 'GA-11078N', productName: '冠牌空气滤清器 丰田新款佳美2.4 12款逸致1.8', productOrigCode: '17807-20040', putTime: '2021-01-28 14:56:11', warehouseName: '默认仓库', warehouseLocationName: '默认仓位', putBizTypeDictValue: '散件入库', currentQty: '207', freezeQty: '', putCost: '1550.50' }
-            ],
-            count: 10
-          }
+        const params = Object.assign(parameter, { productSn: this.productSn })
+        return reportStockDetailList(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 = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          // 总计
+          this.getCount(params)
+          return data
         })
       },
-      currentStock: { // 合计信息
-        currentQty: '',
-        putCost: ''
-      }
+      currentStock: null
     }
   },
   methods: {
     // 合计
-    getTotal (param) {
-      stockDetailCount(param).then(res => {
+    getCount (param) {
+      reportStockCount(param).then(res => {
         if (res.status == 200 && res.data) {
           this.currentStock = res.data
         } else {
-          this.currentStock = { // 合计信息
-            currentQty: '',
-            putCost: ''
-          }
+          this.currentStock = null
         }
       })
     }

+ 188 - 151
src/views/reportData/chainStockReport/list.vue

@@ -1,121 +1,121 @@
 <template>
   <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="chainStockReportList-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-model-item label="连锁店" prop="targetName">
-              <a-select
-                placeholder="请选择连锁店"
-                id="chainStockReportList-targetName"
-                allowClear
-                v-model="queryParam.targetName"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in allocateTypeList" :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="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品名称">
-              <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainStockReportList-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-model-item label="原厂编码">
-                <a-input id="productInfoList-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品品牌">
+              <a-form-model-item label="连锁店" prop="dealerSn">
                 <a-select
-                  placeholder="请选择产品品牌"
-                  id="productInfoList-productBrandSn"
+                  placeholder="请选择连锁店"
+                  id="chainStockReportList-dealerSn"
                   allowClear
-                  v-model="queryParam.productBrandSn"
+                  v-model="queryParam.dealerSn"
                   :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-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</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"
-                  change-on-select
-                  v-model="productType"
-                  expand-trigger="hover"
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
+              <a-form-model-item label="产品编码">
+                <a-input id="chainStockReportList-code" 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-input id="chainStockReportList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
               </a-form-model-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24" style="margin-top: 3px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-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>
-    <!-- 合计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):
-        <strong>
-          <!-- {{ currentStock.currentQty || 0 }} -->207
-        </strong>;现有库存总成本(¥):
-        <strong>
-          <!-- {{ currentStock.putCost || 0 }} -->1550.5
-        </strong>。</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1170 }"
-      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)*100 + Number(record.freezeCost)*100)/100 || 0 }}
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="chainStockReportList-detail-btn">详情</a-button>
-      </template>
-    </s-table>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="原厂编码">
+                  <a-input id="chainStockReportList-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="chainStockReportList-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"
+                    change-on-select
+                    v-model="productType"
+                    expand-trigger="hover"
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="chainStockReportList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear />
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-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>
+      <!-- 合计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div class="ftext" slot="message">
+          现有库存总数量(个):<strong> {{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }} </strong>;
+          现有库存总成本(¥):<strong> {{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }} </strong>。
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.productSn + record.stockSn"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        :scroll="{ x: 1170 }"
+        bordered>
+        <!-- 现有库存数量 -->
+        <template slot="currentStockQty" slot-scope="text, record">
+          {{ (Number(record.currentStockQty) + Number(record.freezeQty)) || 0 }}
+          <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
+        </template>
+        <template slot="currentStockCost" slot-scope="text, record">
+          {{ (Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000 || 0 }}
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="chainStockReportList-detail-btn">详情</a-button>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 详情 -->
-    <chain-stock-report-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+    <chain-stock-report-detail-modal :openModal="openModal" :productSn="productSn" @close="closeModal" />
   </a-card>
 </template>
 
@@ -124,36 +124,37 @@ import { STable, VSelect } from '@/components'
 import chainStockReportDetailModal from './detailModal.vue'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { linkageGroupList } from '@/api/reportData'
+import { reportStockList, reportStockCount } from '@/api/reportStock'
 export default {
   components: { STable, VSelect, chainStockReportDetailModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        targetName: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
+        dealerSn: undefined,
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        productOrigCode: '', //  原厂编码
         productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn1: '', //  产品分类1
+        productTypeSn2: '', //  产品分类2
+        productTypeSn3: '' //  产品分类3
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       rules: {
-        'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
+        'dealerSn': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { 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: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
         { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 165, align: 'center', sorter: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
@@ -161,46 +162,67 @@ export default {
       // 加载数据方法 必须为 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: [
-              { id: '1', code: 'GA-11078N', name: '冠牌空气滤清器 丰田新款佳美2.4 12款逸致1.8', origCode: '17807-20040', currentStockQty: '207', freezeQty: '', currentStockCost: '1550.50', freezeCost: '' }
-            ],
-            count: 10
-          }
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        if (params.dealerSn) {
+          if (params.dealerSn == 'all') {
+            params.dealerSn = ''
           }
-          _this.disabled = false
-          resolve(data)
-        })
+          return reportStockList(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)
+          })
+        }
       },
       productType: [],
+      linkageGroupData: [],
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
       allocateTypeList: [], //  调拨类型
-      itemId: '', //  当前id
+      totalData: null, //  合计
+      productSn: '',
       openModal: false //  弹框
     }
   },
   methods: {
+    // 合计
+    getCount (params) {
+      reportStockCount(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)
+          _this.$refs.table.refresh(true)
         } else {
           console.log('error submit!!')
           return false
@@ -209,25 +231,27 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.targetName = undefined
-      this.queryParam.code = ''
-      this.queryParam.name = ''
-      this.queryParam.origCode = ''
+      this.queryParam.dealerSn = undefined
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
       this.queryParam.productBrandSn = undefined
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.productType = []
-      this.$refs.table.refresh(true)
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
     },
     //  详情
     goDetail (row) {
-      this.itemId = row.stockSn
+      this.productSn = row.productSn
       this.openModal = true
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
+      this.productSn = ''
       this.openModal = false
     },
     //  产品分类  change
@@ -238,7 +262,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      dealerProductBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -248,7 +272,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {
@@ -260,10 +284,23 @@ export default {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        const all = [{ dealerName: '全部', dealerSn: 'all' }]
+        if (res.status == 200) {
+          const data = res.data || []
+          this.linkageGroupData = [...all, ...data]
+        } else {
+          this.linkageGroupData = all
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      vm.getLinkageGroup()
       vm.getProductBrand()
       vm.getProductType()
     })

+ 179 - 106
src/views/reportData/customerReport/list.vue

@@ -1,59 +1,95 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="chainStockReportList-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="添加时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品分类">
-              <a-select id="chainStockReportList-targetName" 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>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="区域">
-              <a-select id="chainStockReportList-targetName" 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>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-    <!-- 合计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">
-        总交易金额:<strong>3638.55</strong>;
-        总毛利率:<strong>54.97%</strong>
+  <a-card size="small" :bordered="false" class="customerReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="customerReportList-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-model-item label="添加时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品分类">
+                <a-cascader
+                  @change="changeProductType"
+                  change-on-select
+                  v-model="productType"
+                  expand-trigger="hover"
+                  :options="productTypeList"
+                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                  id="customerReportList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                    <a-col span="7">
+                      <a-form-model-item prop="provinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.provinceSn" @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="citySn" style="margin: 0;">
+                        <a-select v-model="queryParam.citySn" @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="countySn" style="margin: 0;">
+                        <a-select v-model="queryParam.countySn" 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" style="margin-bottom: 15px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="customerReportList-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>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-    </s-table>
+      <!-- 合计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div class="ftext" slot="message">
+          总交易金额:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</strong>;
+          总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage : '--' }}</strong>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.salesTargetSn"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -61,82 +97,98 @@
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { getArea } from '@/api/data'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { dealerProductTypeList } from '@/api/dealerProductType'
+import { reportBigCustomerList, reportBigCustomerCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        time: [],
         beginDate: '',
         endDate: '',
-        targetName: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        provinceSn: undefined, //  省
+        citySn: undefined, //  市
+        countySn: undefined //  区
       },
+      productType: [],
       rules: {
-        'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
+        'time': [{ required: true, message: '请选择添加时间', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '客户名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '交易金额', dataIndex: 'currentStockCost', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '毛利率', dataIndex: 'totalCategory', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '客户名称', dataIndex: 'salesTargetName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
+        { title: '交易金额', dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, sorter: true },
+        { title: '毛利率', dataIndex: 'percentage', align: 'center', customRender: function (text) { return text || '--' }, sorter: 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: [
-              { id: '1', code: '159177', name: '测试修理厂', currentStockCost: '¥1729.55', totalCategory: '44.58%' },
-              { id: '2', code: '159177', name: '常青二路总店', currentStockCost: '¥395.00', totalCategory: '45.32%' },
-              { id: '3', code: '159177', name: '支持市级', currentStockCost: '¥1136.00', totalCategory: '90.05%' },
-              { id: '4', code: '159177', name: '支持特约测试', currentStockCost: '¥378.00', totalCategory: '7.04%' }
-            ],
-            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)
+        this.spinning = true
+        delete params.time
+        if (params.beginDate) {
+          return reportBigCustomerList(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)
+          })
+        }
       },
+      totalData: null, //  合计
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      allocateTypeList: [] //  调拨类型
+      productTypeList: [] //  分类下拉数据
     }
   },
   methods: {
+    // 合计
+    getCount (params) {
+      reportBigCustomerCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     //  创建时间  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] || ''
     },
     //  查询
     handleSearch () {
@@ -151,34 +203,54 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.targetName = undefined
-      this.queryParam.code = ''
-      this.queryParam.name = ''
-      this.queryParam.origCode = ''
-      this.queryParam.productBrandSn = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
       this.productType = []
-      this.$refs.table.refresh(true)
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
     },
     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] : ''
+    },
+    //  产品分类  列表
+    getProductType () {
+      dealerProductTypeList({}).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.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.countySn = undefined
       this.getArea('district', val)
     },
     //  省/市/区
@@ -213,6 +285,7 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getArea('province')
+      vm.getProductType()
     })
   }
 }

+ 189 - 346
src/views/reportData/receivedSendStorageReport/list.vue

@@ -1,83 +1,98 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
+  <a-card size="small" :bordered="false" class="receivedSendStorageReportList-wrap">
     <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="chainStockReportList-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="日期">
-              <rangeDate ref="rangeDate" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productInfoList-name" v-model.trim="queryParam.name" 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-model
+          id="receivedSendStorageReportList-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
-                  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-form-model-item label="日期" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  change-on-select
-                  v-model="productType"
-                  expand-trigger="hover"
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
-              </a-form-item>
+              <a-form-model-item label="产品编码">
+                <a-input id="receivedSendStorageReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-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: 1170 }"
-      bordered>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="receivedSendStorageReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="receivedSendStorageReportList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productEntity.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"
+                    change-on-select
+                    v-model="productType"
+                    expand-trigger="hover"
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="receivedSendStorageReportList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear />
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="receivedSendStorageReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="receivedSendStorageReportList-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: 2530 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <span>
+            合计: 期初数量:{{ (totalData && (totalData.beginQty || totalData.beginQty==0)) ? totalData.beginQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            期初金额:{{ (totalData && (totalData.beginAmount || totalData.beginAmount==0)) ? totalData.beginAmount : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            收入数量:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            收入金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? totalData.putAmount : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            发出数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ? totalData.outQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            发出金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? totalData.outAmount : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            结算数量:{{ (totalData && (totalData.endQty || totalData.endQty==0)) ? totalData.endQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            结算金额:{{ (totalData && (totalData.endAmount || totalData.endAmount==0)) ? totalData.endAmount : '--' }}
+          </span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -86,288 +101,102 @@ import { STable, VSelect } from '@/components'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { reportPageList, linkageReportTotal } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
-        targetName: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        time: [],
+        beginDate: '',
+        endDate: '',
+        productEntity: {
+          code: '', //  产品编码
+          name: '', //  产品名称
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '' //  产品三级分类
+        }
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
-      rules: {},
+      rules: {
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+      },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码',
-          dataIndex: 'code',
-          width: 250,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 6
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '产品名称',
-          dataIndex: 'name',
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          },
-          ellipsis: true },
-        { title: '品牌',
-          dataIndex: 'brand',
-          align: 'center',
-          width: 200,
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '三级类别',
-          dataIndex: 'productLeve',
-          width: 150,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '原厂编码',
-          dataIndex: 'origCode',
-          width: 150,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '单位',
-          dataIndex: 'unit',
-          width: 150,
-          align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '期初数量', dataIndex: 'sqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '期初单价(¥)', dataIndex: 'sprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '期初金额(¥)', dataIndex: 'samount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '收入数量', dataIndex: 'srqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '收入单价(¥)', dataIndex: 'srprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '收入金额(¥)', dataIndex: 'sramount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '发出数量', dataIndex: 'fcqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '发出单价(¥)', dataIndex: 'fcprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '发出金额(¥)', dataIndex: 'fcamount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '结存数量', dataIndex: 'dcqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '结存单价(¥)', dataIndex: 'dcprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '结存金额(¥)', dataIndex: 'dcamount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } }
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '三级分类', dataIndex: 'productEntity.productTypeName3', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '期初数量', dataIndex: 'beginQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初单价(¥)', dataIndex: 'beginPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初金额(¥)', dataIndex: 'beginAmount', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入数量', dataIndex: 'putQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入单价(¥)', dataIndex: 'putPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入金额(¥)', dataIndex: 'putAmount', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出数量', dataIndex: 'outQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出单价(¥)', dataIndex: 'outPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出金额(¥)', dataIndex: 'outAmount', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存数量', dataIndex: 'endQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存单价(¥)', dataIndex: 'endPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存金额(¥)', dataIndex: 'endAmount', width: 120, align: 'center', sorter: true, 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: [
-              { id: '1',
-                code: '0000 1110 V003 / 000 1110 V004',
-                name: '广州非品牌 空调滤清器',
-                brand: '非品牌',
-                productLeve: '空调滤清器',
-                origCode: '',
-                unit: '个',
-                sqty: '8',
-                sprice: '9.00',
-                samount: '72.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '1',
-                fcprice: '9.00',
-                fcamount: '9.00',
-                dcqty: '7',
-                dcprice: '9.00',
-                dcamount: '63.00'
-              },
-              { id: '2',
-                code: '0000015',
-                name: '辅助单位测试',
-                brand: '雪企',
-                productLeve: '雪种油',
-                origCode: '',
-                unit: '升',
-                sqty: '24',
-                sprice: '32.71',
-                samount: '785.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '0',
-                fcprice: '0',
-                fcamount: '0',
-                dcqty: 24,
-                dcprice: '32.71',
-                dcamount: '785.00'
-              },
-              { id: '3',
-                code: 'GA-11073N',
-                name: '冠牌空气滤清器 丰田威驰 吉利金刚 夏利2000',
-                brand: '冠牌',
-                productLeve: '空气滤清器',
-                origCode: '17801-14010',
-                unit: '个',
-                sqty: '106',
-                sprice: '6.48',
-                samount: '687.00',
-                srqty: '21',
-                srprice: '6.62',
-                sramount: '139.00',
-                fcqty: '74',
-                fcprice: '6.52',
-                fcamount: '482.50',
-                dcqty: 53,
-                dcprice: '6.48',
-                dcamount: '343.50'
-              },
-              { id: '4',
-                code: 'GA-11078N',
-                name: '冠牌空气滤清器 丰田新款佳美2.4',
-                brand: '冠牌',
-                productLeve: '空气滤清器',
-                origCode: '17801-20040',
-                unit: '个',
-                sqty: '200',
-                sprice: '7.50',
-                samount: '1500.00',
-                srqty: '7',
-                srprice: '7.21',
-                sramount: '50.50',
-                fcqty: '0',
-                fcprice: '0.00',
-                fcamount: '0.00',
-                dcqty: 207,
-                dcprice: '7.49',
-                dcamount: '1550.50'
-              },
-              { id: '5',
-                code: '00089',
-                name: 'SOFT99车蜡 氟素镀膜 白色车身用 防水保护效果持久',
-                brand: 'SOFT99',
-                productLeve: '车蜡',
-                origCode: '',
-                unit: '瓶',
-                sqty: '32',
-                sprice: '34.38',
-                samount: '1100.00',
-                srqty: '0',
-                srprice: '0',
-                sramount: '0',
-                fcqty: '0',
-                fcprice: '0',
-                fcamount: '0',
-                dcqty: 32,
-                dcprice: '34.38',
-                dcamount: '1100.00'
-              },
-              { id: '6',
-                code: '合计',
-                name: '合计',
-                brand: '合计',
-                productLeve: '合计',
-                origCode: '合计',
-                unit: '合计',
-                sqty: '1870',
-                sprice: '',
-                samount: '18767.94',
-                srqty: 28,
-                srprice: '',
-                sramount: '189.50',
-                fcqty: '77',
-                fcprice: '0.00',
-                fcamount: '515.50',
-                dcqty: 1821,
-                dcprice: '',
-                dcamount: '18441.94'
-              }
-            ],
-            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)
+        this.spinning = true
+        if (this.queryParam.beginDate) {
+          return reportPageList(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)
+          })
+        }
       },
       productType: [],
       productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      productTypeList: [], //  分类下拉数据
+      totalData: {} // 合计
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
     //  查询
     handleSearch () {
       this.$refs.ruleForm.validate(valid => {
@@ -379,28 +208,42 @@ export default {
         }
       })
     },
+    // 查询总计
+    getCount (params) {
+      linkageReportTotal(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
     //  重置
     resetSearchForm () {
-      this.queryParam.targetName = undefined
-      this.queryParam.code = ''
-      this.queryParam.name = ''
-      this.queryParam.origCode = ''
-      this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
       this.productType = []
-      this.$refs.table.refresh(true)
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
     },
     //  产品分类  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] : ''
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      dealerProductBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -410,7 +253,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {

+ 156 - 138
src/views/reportData/stockExpenditureReport/list.vue

@@ -1,70 +1,92 @@
 <template>
-  <a-card size="small" :bordered="false" class="noticeList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="handelSearch(1)">
-        <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-button type="primary" @click="handelSearch(1)" id="noticeList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" id="noticeList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <a-row :gutter="15">
-      <a-col :md="12" :sm="24">
-        <div class="chart-box">
-          <div class="chart-hj">库存总出数量:372,总成本:¥4315.50</div>
-          <div id="con1" class="chart"></div>
-        </div>
-      </a-col>
-      <a-col :md="12" :sm="24">
-        <a-table
-          class="sTable"
-          ref="table"
-          size="default"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :dataSource="loadData"
-          :loading="listLoading"
-          :pagination="false"
-          bordered>
-        </a-table>
-      </a-col>
-    </a-row>
+  <a-card size="small" :bordered="false" class="stockExpenditureReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="stockExpenditureReportList-form"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handelSearch" >
+          <a-row :gutter="15">
+            <a-col :md="8" :sm="24">
+              <a-form-model-item label="出库完成时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handelSearch" id="stockExpenditureReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" id="stockExpenditureReportList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <a-row :gutter="15" style="margin-top: 50px;">
+        <a-col :md="12" :sm="24">
+          <div class="chart-box">
+            <div class="chart-hj">
+              库存总出数量:{{ (totalData&&totalData.totalQty) ? totalData.totalQty : '--' }},
+              总成本:¥{{ (totalData&&totalData.totalCost) ? totalData.totalCost : '--' }}
+            </div>
+            <div id="con1" class="chart"></div>
+          </div>
+        </a-col>
+        <a-col :md="12" :sm="24" style="margin-top: 30px;">
+          <a-table
+            class="sTable"
+            ref="table"
+            size="default"
+            :rowKey="(record) => record.dataBizTypeDictValue"
+            :columns="columns"
+            :dataSource="tableData"
+            :loading="listLoading"
+            :pagination="false"
+            bordered>
+          </a-table>
+        </a-col>
+      </a-row>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
 import rangeDate from '@/views/common/rangeDate.vue'
 import echarts from 'echarts'
+import { reportStockOutList } from '@/api/reportStock'
 export default {
   components: { rangeDate },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
+        time: [],
         beginDate: '',
         endDate: ''
       },
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'time': [{ required: true, message: '请选择出库完成时间', trigger: 'change' }]
+      },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '明细项', dataIndex: 'itemName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量(件)', dataIndex: 'qty', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本(元)', dataIndex: 'cost', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价(元)', dataIndex: 'price', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '明细项', dataIndex: 'dataBizTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量(件)', dataIndex: 'productQty', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本(元)', dataIndex: 'productCost', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价(元)', dataIndex: 'productPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 统计图
       pieData: [],
       pieColor: ['#00aaff', '#ffaa00', '#00aa00', '#ff55ff', '#1dc5d4', '#8465c7', '#00ffff'],
-      loadData: [],
+      tableData: [], //  含总计数据
+      loadData: [], //  不含总计数据
       listLoading: false,
-      chart1: null
+      chart1: null,
+      totalData: null
     }
   },
 
@@ -74,8 +96,8 @@ export default {
       const legend = []
       if (bit) {
         data.map(item => {
-    			 const p = `${item.name}: ${item.value}${bit}`
-    			 legend.push(p)
+          const p = `${item.name}: ${item.value}${bit}`
+          legend.push(p)
         })
       }
       const option = {
@@ -94,25 +116,25 @@ export default {
           formatter: `{b} : {d}%`
         },
         legend: {
-    		  orient: 'horizontal',
-    		  left: 'center',
-    		  bottom: '5',
-    		  padding: 5,
-    		  textStyle: {
-    		    color: '#abd7ff',
+          orient: 'horizontal',
+          left: 'center',
+          bottom: '5',
+          padding: 5,
+          textStyle: {
+            color: '#abd7ff',
             fontSize: 10
-    		  },
-    		  show: !!bit,
-    		  formatter: function (name) {
-    			  if (bit) {
+          },
+          show: !!bit,
+          formatter: function (name) {
+            if (bit) {
               const p = data.find(item => item.name == name)
               return name + (p ? (':' + p.value + bit) : '')
-    			  }
-    		  }
+            }
+          }
         },
         series: [{
           type: 'pie',
-          radius: ['30%', '50%'],
+          radius: ['50%', '70%'],
           startAngle: 75,
           top: 50,
           avoidLabelOverlap: true, // 在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠
@@ -120,8 +142,7 @@ export default {
             normal: {
               formatter: params => {
                 return (
-                  '{name|' + params.name + '}{value|' +
-    										params.percent + '%' + '}'
+                  '{name|' + params.name + '}{value|' + params.percent + '%' + '}'
                 )
               },
               padding: [0, -70, 25, -70],
@@ -157,82 +178,70 @@ export default {
     },
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0] ? date[0] + ' 00:00:00' : ''
-      this.queryParam.endDate = date[1] ? date[1] + ' 23:59:59' : ''
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
-    // 查询列表
     handelSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.getList()
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 查询列表
+    getList () {
       const params = {
         beginDate: this.queryParam.beginDate,
         endDate: this.queryParam.endDate
       }
       // 开始查询
       this.listLoading = true
-      setTimeout(() => {
+      this.spinning = true
+      reportStockOutList(params).then(res => {
         this.listLoading = false
-        this.loadData = [
-          {
-            itemName: '采购退货',
-            qty: '14',
-            cost: '84.50',
-            price: ''
-          },
-          {
-            itemName: '散件退货',
-            qty: '3',
-            cost: '28.00',
-            price: ''
-          },
-          {
-            itemName: '销售(含急件)',
-            qty: '77',
-            cost: '837.50',
-            price: '2672.55'
-          },
-          {
-            itemName: '急件冲减',
-            qty: '9',
-            cost: '109.50',
-            price: ''
-          },
-          {
-            itemName: '店内调出',
-            qty: '6',
-            cost: '55.00',
-            price: ''
-          },
-          {
-            itemName: '盘亏出库',
-            qty: '190',
-            cost: '2725.00',
-            price: ''
-          },
-          {
-            itemName: '连锁调出',
-            qty: '73',
-            cost: '476.00',
-            price: ''
-          },
-          {
-            itemName: '总出',
-            qty: '372',
-            cost: '4315.50',
-            price: '2672.55'
+        if (res.status == 200) {
+          const reportStockOutVOList = (res.data && res.data.reportStockOutVOList) ? res.data.reportStockOutVOList : []
+          const totalQty = (res.data && (res.data.totalQty || res.data.totalQty == 0)) ? res.data.totalQty : '--'
+          const totalPrice = (res.data && (res.data.totalPrice || res.data.totalPrice == 0)) ? res.data.totalPrice : '--'
+          const totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? res.data.totalCost : '--'
+          this.totalData = {
+            totalQty: totalQty,
+            totalPrice: totalPrice,
+            totalCost: totalCost
           }
-        ]
-        this.chartInit()
-      }, 600)
-    },
-    chartInit () {
-      this.loadData.map((item, index) => {
-        if (index != this.loadData.length - 1) {
-          this.pieData.push({
-            name: item.itemName + '总成本',
-            value: item.cost
-          })
+          if (reportStockOutVOList) {
+            this.loadData = res.data.reportStockOutVOList
+            this.tableData = res.data.reportStockOutVOList
+            const total = [{ dataBizTypeDictValue: '总出', productQty: totalQty, productCost: totalCost, productPrice: totalPrice }]
+            this.tableData = [...this.tableData, ...total]
+          } else {
+            this.loadData = []
+            this.tableData = []
+          }
+          this.chartInit()
         }
+        this.spinning = false
       })
-      const con5 = document.getElementById('con1')
+    },
+    chartInit () {
+      this.pieData = []
+      if (this.loadData.length < 1) {
+        this.pieData = [{ name: '总成本', value: 0 }]
+      } else {
+        this.loadData.map((item, index) => {
+          if (index != this.loadData.length) {
+            this.pieData.push({
+              name: item.dataBizTypeDictValue + '总成本',
+              value: item.productCost
+            })
+          }
+        })
+      }
+      const con1 = document.getElementById('con1')
       const chart1 = echarts.init(con1)
       const option = this.initPie(chart1, '', this.pieData)
       chart1.setOption(option)
@@ -242,7 +251,13 @@ export default {
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate()
-      this.handelSearch()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.loadData = []
+      this.tableData = []
+      this.totalData = null
+      this.chartInit()
     }
   },
   mounted () {
@@ -254,22 +269,25 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.handelSearch()
+      vm.chartInit()
     })
   }
 }
 </script>
 <style lang="less">
-  .chart-box{
-    height: 400px;
-    .chart-hj{
-      font-size: 22px;
-      text-align: center;
-    }
-    .chart{
-      width: 100%;
-      height: 450px;
-      overflow: auto;
+  .stockExpenditureReportList-wrap{
+    min-height: 700px;
+    .chart-box{
+      height: 400px;
+      .chart-hj{
+        font-size: 22px;
+        text-align: center;
+      }
+      .chart{
+        width: 100%;
+        height: 450px;
+        overflow: auto;
+      }
     }
   }
 </style>

+ 156 - 132
src/views/reportData/stockIncomeReport/list.vue

@@ -1,70 +1,92 @@
 <template>
-  <a-card size="small" :bordered="false" class="noticeList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="handelSearch(1)">
-        <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-button type="primary" @click="handelSearch(1)" id="noticeList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" id="noticeList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <a-row :gutter="15">
-      <a-col :md="12" :sm="24">
-        <div class="chart-box">
-          <div class="chart-hj">库存总入数量:28,总成本:¥189.50</div>
-          <div id="con1" class="chart"></div>
-        </div>
-      </a-col>
-      <a-col :md="12" :sm="24">
-        <a-table
-          class="sTable"
-          ref="table"
-          size="default"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :dataSource="loadData"
-          :loading="listLoading"
-          :pagination="false"
-          bordered>
-        </a-table>
-      </a-col>
-    </a-row>
+  <a-card size="small" :bordered="false" class="stockIncomeReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="stockIncomeReportList-form"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handelSearch" >
+          <a-row :gutter="15">
+            <a-col :md="8" :sm="24">
+              <a-form-model-item label="入库完成时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handelSearch" id="stockIncomeReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" id="stockIncomeReportList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <a-row :gutter="15" style="margin-top: 50px;">
+        <a-col :md="12" :sm="24">
+          <div class="chart-box">
+            <div class="chart-hj">
+              库存总入数量:{{ (totalData&&totalData.totalQty) ? totalData.totalQty : '--' }},
+              总成本:¥{{ (totalData&&totalData.totalCost) ? totalData.totalCost : '--' }}
+            </div>
+            <div id="con1" class="chart"></div>
+          </div>
+        </a-col>
+        <a-col :md="12" :sm="24" style="margin-top: 30px;">
+          <a-table
+            class="sTable"
+            ref="table"
+            size="default"
+            :rowKey="(record) => record.dataBizTypeDictValue"
+            :columns="columns"
+            :dataSource="tableData"
+            :loading="listLoading"
+            :pagination="false"
+            bordered>
+          </a-table>
+        </a-col>
+      </a-row>
+    </a-spin>
   </a-card>
 </template>
 
 <script>
 import rangeDate from '@/views/common/rangeDate.vue'
 import echarts from 'echarts'
+import { reportStockPutList } from '@/api/reportStock'
 export default {
   components: { rangeDate },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
+        time: [],
         beginDate: '',
         endDate: ''
       },
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'time': [{ required: true, message: '请选择入库完成时间', trigger: 'change' }]
+      },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '明细项', dataIndex: 'itemName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量(件)', dataIndex: 'qty', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本(元)', dataIndex: 'cost', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价(元)', dataIndex: 'price', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '明细项', dataIndex: 'dataBizTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量(件)', dataIndex: 'productQty', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本(元)', dataIndex: 'productCost', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价(元)', dataIndex: 'productPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 统计图
       pieData: [],
       pieColor: ['#00aaff', '#ffaa00', '#00aa00', '#ff55ff', '#1dc5d4', '#8465c7', '#00ffff'],
-      loadData: [],
+      tableData: [], //  含总计数据
+      loadData: [], //  不含总计数据
       listLoading: false,
-      chart1: null
+      chart1: null,
+      totalData: null
     }
   },
 
@@ -74,8 +96,8 @@ export default {
       const legend = []
       if (bit) {
         data.map(item => {
-    			 const p = `${item.name}: ${item.value}${bit}`
-    			 legend.push(p)
+          const p = `${item.name}: ${item.value}${bit}`
+          legend.push(p)
         })
       }
       const option = {
@@ -94,25 +116,25 @@ export default {
           formatter: `{b} : {d}%`
         },
         legend: {
-    		  orient: 'horizontal',
-    		  left: 'center',
-    		  bottom: '5',
-    		  padding: 5,
-    		  textStyle: {
-    		    color: '#abd7ff',
+          orient: 'horizontal',
+          left: 'center',
+          bottom: '5',
+          padding: 5,
+          textStyle: {
+            color: '#abd7ff',
             fontSize: 10
-    		  },
-    		  show: !!bit,
-    		  formatter: function (name) {
-    			  if (bit) {
+          },
+          show: !!bit,
+          formatter: function (name) {
+            if (bit) {
               const p = data.find(item => item.name == name)
               return name + (p ? (':' + p.value + bit) : '')
-    			  }
-    		  }
+            }
+          }
         },
         series: [{
           type: 'pie',
-          radius: ['30%', '50%'],
+          radius: ['50%', '70%'],
           startAngle: 75,
           top: 50,
           avoidLabelOverlap: true, // 在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠
@@ -120,8 +142,7 @@ export default {
             normal: {
               formatter: params => {
                 return (
-                  '{name|' + params.name + '}{value|' +
-    										params.percent + '%' + '}'
+                  '{name|' + params.name + '}{value|' + params.percent + '%' + '}'
                 )
               },
               padding: [0, -70, 25, -70],
@@ -157,76 +178,70 @@ export default {
     },
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0] ? date[0] + ' 00:00:00' : ''
-      this.queryParam.endDate = date[1] ? date[1] + ' 23:59:59' : ''
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
-    // 查询列表
     handelSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.getList()
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 查询列表
+    getList () {
       const params = {
         beginDate: this.queryParam.beginDate,
         endDate: this.queryParam.endDate
       }
       // 开始查询
       this.listLoading = true
-      setTimeout(() => {
+      this.spinning = true
+      reportStockPutList(params).then(res => {
         this.listLoading = false
-        this.loadData = [
-          {
-            itemName: '采购入库',
-            qty: '8',
-            cost: '52.00',
-            price: ''
-          },
-          {
-            itemName: '散件入库',
-            qty: '17',
-            cost: '115.00',
-            price: ''
-          },
-          {
-            itemName: '销售退货',
-            qty: '3',
-            cost: '22.50',
-            price: '30.00'
-          },
-          {
-            itemName: '盘盈入库',
-            qty: '0',
-            cost: '00.00',
-            price: ''
-          },
-          {
-            itemName: '连锁调入',
-            qty: '0',
-            cost: '00.00',
-            price: ''
-          },
-          {
-            itemName: '库存导入',
-            qty: '0',
-            cost: '00.00',
-            price: ''
-          },
-          {
-            itemName: '总入',
-            qty: '28',
-            cost: '189.50',
-            price: '30.00'
+        if (res.status == 200) {
+          const reportStockPutVOList = (res.data && res.data.reportStockPutVOList) ? res.data.reportStockPutVOList : []
+          const totalQty = (res.data && (res.data.totalQty || res.data.totalQty == 0)) ? res.data.totalQty : '--'
+          const totalPrice = (res.data && (res.data.totalPrice || res.data.totalPrice == 0)) ? res.data.totalPrice : '--'
+          const totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? res.data.totalCost : '--'
+          this.totalData = {
+            totalQty: totalQty,
+            totalPrice: totalPrice,
+            totalCost: totalCost
           }
-        ]
-        this.chartInit()
-      }, 600)
-    },
-    chartInit () {
-      this.loadData.map((item, index) => {
-        if (index != this.loadData.length - 1) {
-          this.pieData.push({
-            name: item.itemName + '总成本',
-            value: item.cost
-          })
+          if (reportStockPutVOList) {
+            this.loadData = res.data.reportStockPutVOList
+            this.tableData = res.data.reportStockPutVOList
+            const total = [{ dataBizTypeDictValue: '总入', productQty: totalQty, productCost: totalCost, productPrice: totalPrice }]
+            this.tableData = [...this.tableData, ...total]
+          } else {
+            this.loadData = []
+            this.tableData = []
+          }
+          this.chartInit()
         }
+        this.spinning = false
       })
-      const con5 = document.getElementById('con1')
+    },
+    chartInit () {
+      this.pieData = []
+      if (this.loadData.length < 1) {
+        this.pieData = [{ name: '总成本', value: 0 }]
+      } else {
+        this.loadData.map((item, index) => {
+          if (index != this.loadData.length) {
+            this.pieData.push({
+              name: item.dataBizTypeDictValue + '总成本',
+              value: item.productCost
+            })
+          }
+        })
+      }
+      const con1 = document.getElementById('con1')
       const chart1 = echarts.init(con1)
       const option = this.initPie(chart1, '', this.pieData)
       chart1.setOption(option)
@@ -236,7 +251,13 @@ export default {
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate()
-      this.handelSearch()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.loadData = []
+      this.tableData = []
+      this.totalData = null
+      this.chartInit()
     }
   },
   mounted () {
@@ -248,22 +269,25 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.handelSearch()
+      vm.chartInit()
     })
   }
 }
 </script>
 <style lang="less">
-  .chart-box{
-    height: 400px;
-    .chart-hj{
-      font-size: 22px;
-      text-align: center;
-    }
-    .chart{
-      width: 100%;
-      height: 450px;
-      overflow: auto;
+  .stockIncomeReportList-wrap{
+    min-height: 700px;
+    .chart-box{
+      height: 400px;
+      .chart-hj{
+        font-size: 22px;
+        text-align: center;
+      }
+      .chart{
+        width: 100%;
+        height: 450px;
+        overflow: auto;
+      }
     }
   }
 </style>

+ 3 - 3
src/views/salesManagement/giftRecord/list.vue

@@ -87,15 +87,15 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '赠品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '赠送数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '关联销售单号', dataIndex: 'salesBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '赠送客户', dataIndex: 'customerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '成本价(¥)', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'totalCost', width: 120, align: 'center' }
+        { title: '成本小计(¥)', dataIndex: 'totalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 0 - 156
src/views/salesManagement/outboundOrder/detail.vue

@@ -1,156 +0,0 @@
-<template>
-  <div class="outboundOrderDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="outboundOrderDetail-cont">
-      <template slot="subTitle">
-        <a href="javascript:;" @click="handleBack">返回列表</a>
-        <a-button size="small" id="outboundOrderDetail-ts-btn" style="margin-left:30px" key="0">订单推送</a-button>
-        <!-- <a-button size="small" id="outboundOrderDetail-export-btn" type="danger" style="margin-left:20px" key="1">销售导出</a-button> -->
-      </template>
-      <!-- <template slot="extra">
-        <span>打印字段:</span>
-        <a-select key="2" style="width:150px" id="sales-pritKey" placeholder="请选择打印字段" allowClear>
-          <a-select-option v-for="item in pritKey" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-        </a-select>
-        <span><i style="color: red;">*</i>打印模板:</span>
-        <a-select key="3" style="width:150px" id="sales-pritKey" placeholder="请选择打印模板" allowClear>
-          <a-select-option v-for="item in pritModal" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-        </a-select>
-        <a-button key="4" id="outboundOrderDetail-preview-btn">打印预览</a-button>
-        <a-button key="5" type="primary" id="outboundOrderDetail-print-btn">快速打印</a-button>
-      </template> -->
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions size="small" :column="3">
-            <a-descriptions-item label="客户名称">张三的</a-descriptions-item>
-            <a-descriptions-item label="客户地址">山西省太原市阿斯加德法律静安寺水电费</a-descriptions-item>
-            <a-descriptions-item label="支付方式">货到付款</a-descriptions-item>
-            <a-descriptions-item label="收款方式">现金</a-descriptions-item>
-            <a-descriptions-item label="联系手机">13709146191</a-descriptions-item>
-            <a-descriptions-item label="联系电话">13709146191</a-descriptions-item>
-            <a-descriptions-item label="备注">备注备注备注备注备注</a-descriptions-item>
-            <a-descriptions-item label="销售单号">34242sdf234234</a-descriptions-item>
-            <a-descriptions-item label="制单人">王明</a-descriptions-item>
-            <a-descriptions-item label="业务员">李四</a-descriptions-item>
-            <a-descriptions-item label="审核状态">未审核</a-descriptions-item>
-            <a-descriptions-item label="完结状态">未完结</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
-      <!-- alert -->
-      <a-alert type="info" style="margin-bottom: 15px;">
-        <div slot="message">
-          总款数:<strong>12</strong>;总数量:<strong>12</strong>;总赠品数量:<strong>12</strong>;急件总款数:<strong>12</strong>;急件总数量:<strong>12</strong>;<br/>
-          总售价:<strong>12</strong>;总成本:<strong>12</strong>;总毛利:<strong>12</strong>;折后总售价:<strong>12</strong>;折扣:<strong>12%</strong>;折扣金额:<strong>12</strong>;
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="default"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1660 }"
-        bordered>
-        <!-- 状态 -->
-        <template slot="state" slot-scope="text, record">
-          <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '已出库': '未出库' }}</a-tag>
-        </template>
-      </s-table>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-export default {
-  name: 'SalesDetail',
-  components: {
-    STable,
-    VSelect
-  },
-  data () {
-    return {
-      disabled: false,
-      pritKey: [
-        { id: 0, name: '打印促销' },
-        { id: 1, name: '打印支付方式' },
-        { id: 2, name: '打印收款方式' }
-      ],
-      pritModal: [
-        { id: 0, name: '普通模板一' },
-        { id: 1, name: '普通模板二' },
-        { id: 2, name: '仓库模板一' }
-      ],
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'salerNo', width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'storeNo', align: 'center' },
-        { title: '原厂编码', dataIndex: 'custName', width: 140, align: 'center' },
-        { title: '成本价', dataIndex: 'totalP', width: 100, align: 'center' },
-        { title: '售价', dataIndex: 'totalNums', width: 100, align: 'center' },
-        { title: '折后售价', dataIndex: 'totalPrice', width: 100, align: 'center' },
-        { title: '销售数量', dataIndex: 'payType', width: 100, align: 'center' },
-        { title: '单位', dataIndex: 'mementPay', width: 100, align: 'center' },
-        { title: '辅助数量', dataIndex: 'shDate', width: 100, align: 'center' },
-        { title: '售价小计', dataIndex: 'isJj', width: 100, align: 'center' },
-        { title: '折后小计', dataIndex: 'status', width: 100, align: 'center' },
-        { title: '仓库', dataIndex: 'status', width: 100, align: 'center' },
-        { title: '仓位', dataIndex: 'status', width: 100, align: 'center' },
-        { title: '销售类型', dataIndex: 'status', width: 100, align: 'center' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ],
-            count: 10
-          }
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-          }
-          _this.disabled = false
-          resolve(data)
-        })
-      }
-    }
-  },
-  methods: {
-    //  返回
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/outboundOrder/list' })
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .outboundOrderDetail-wrap{
-    .outboundOrderDetail-cont{
-      margin-bottom: 15px;
-    }
-  }
-</style>

+ 118 - 93
src/views/salesManagement/outboundOrder/list.vue

@@ -1,99 +1,103 @@
 <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="queryParam.demanderName" placeholder="请输入单位名称" allowClear />
-            </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="单据状态">
+              <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="queryParam.demanderName" placeholder="请输入单位名称" allowClear />
+              </a-form-item>
+            </a-col>
+            <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="请选择单据状态"
+                  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" :disabled="!hasSelected" :loading="loading" @click="handleOutbounds">批量出库</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.id"
-      :columns="columns"
-      :data="loadData"
-      :showPagination="false"
-      :scroll="{ x: 1710 }"
-      bordered> -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1720, y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <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>
-        <a-button
-          size="small"
-          type="link"
-          class="button-success"
-          @click="handleDetail(record)"
-          id="outboundOrderList-detail-btn">详情</a-button>
-      </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>
+            </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" :disabled="!hasSelected" :loading="loading" @click="handleOutbounds">批量出库</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.id"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        :scroll="{ x: 1710 }"
+        bordered> -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1720, y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state=='WAIT'&&$hasPermissions('B_outboundOut')"
+            class="button-primary"
+            @click="handleOutbound(record)"
+            id="outboundOrderList-out-btn">出库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="detailPermissions(record)"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="outboundOrderList-detail-btn">详情</a-button>
+          <span v-if="!(record.state=='WAIT'&&$hasPermissions('B_outboundOut')) && !(detailPermissions(record))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -105,6 +109,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
@@ -117,7 +122,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '关联单号', dataIndex: 'outBizNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库类型', dataIndex: 'outBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位名称', dataIndex: 'demanderName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
@@ -168,6 +173,24 @@ export default {
     }
   },
   methods: {
+    detailPermissions (row) {
+      let state = false
+      //  根据出库类型和对应功能权限 判断是否有查看详情的权限
+      if ((row.outBizType == 'PURCHASE_RETURN') && this.$hasPermissions('B_purchaseReturnDetail')) { // 采购退货
+        state = true
+      } else if ((row.outBizType == 'SALES') && this.$hasPermissions('B_salesDetail')) { // 销售
+        state = true
+      } else if ((row.outBizType == 'DISPATCH_DEDUCT') && this.$hasPermissions('M_urgentDetail')) { // 急件冲减
+        state = true
+      } else if ((row.outBizType == 'SHOP_CALL_OUT') && this.$hasPermissions('B_storeCallOutDetail')) { // 店内调出
+        state = true
+      } else if ((row.outBizType == 'LINKAGE_CALL_OUT') && this.$hasPermissions('B_allocLinkageOutDetail')) { // 连锁调出
+        state = true
+      } else if ((row.outBizType == 'WAREHOUSE_CALL_OUT') && this.$hasPermissions('B_warehouseAllocationDetail')) { // 仓库调出
+        state = true
+      }
+      return state
+    },
     //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
@@ -196,7 +219,7 @@ export default {
       } else if (row.outBizType == 'SPARE_PARTS_RETURN') { // 散件退货
         this.$message.warning('该出库类型对应页面未开发')
         // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
-      } else if (row.outBizType == 'SALES') { // 出库
+      } else if (row.outBizType == 'SALES') { // 销售
         this.$router.push({ path: `/salesManagement/salesQuery/detail/${row.outBizSn}` })
       } else if (row.outBizType == 'DISPATCH_DEDUCT') { // 急件冲减
         this.$router.push({ path: `/salesManagement/urgentItemsOffset/detail/${row.outBizSn}` })
@@ -207,7 +230,6 @@ export default {
         // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
       } else if (row.outBizType == 'LINKAGE_CALL_OUT') { // 连锁调出
         this.$router.push({ path: `/allocationManagement/chainTransferOut/detail/${row.outBizSn}` })
-        // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
       } else if (row.outBizType == 'WAREHOUSE_CALL_OUT') { // 仓库调出
         this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.outBizSn}` })
       } else {
@@ -222,10 +244,14 @@ export default {
         content: '确认要出库吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           stockOutOut(Object.assign(row, { outStockEnum: row.outBizType })).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -245,7 +271,6 @@ export default {
       }, 1000)
     },
     onSelectChange (selectedRowKeys) {
-      console.log('selectedRowKeys changed: ', selectedRowKeys)
       this.selectedRowKeys = selectedRowKeys
     }
   },

+ 17 - 13
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -32,7 +32,7 @@
               </a-select>
             </a-form-model-item>
           </a-col>
-          <a-col :span="16">
+          <a-col :span="16" v-if="$hasPermissions('B_customer_customerInfo_add')">
             <a-form-model-item>
               <a-button type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
               (点击新增按钮新增客户)
@@ -399,9 +399,15 @@ export default {
         priceType: this.form.priceType, //  价格类型
         settleStyleSn: this.form.settleStyleSn //  收款方式
       }
+      this.spinning = true
       updateByCustomerSn(params).then(res => {
-        if (res.status != 200) {
-          this.$message.error(res.message)
+        this.spinning = false
+        if (res.status == 200) {
+          // 保存销售单
+          this.salesSaveFun()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -411,7 +417,6 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          console.log(_this.priceTypeBak, _this.form.priceType)
           // 如果价格类型改变,提示
           if (_this.priceTypeBak != _this.form.priceType && this.isEdit) {
             this.$confirm({
@@ -421,19 +426,19 @@ export default {
               onOk () {
                 // 保存客户信息
                 _this.handleSaveCust()
-                // 保存销售单
-                if (_this.form.buyerSn) {
-                  _this.salesSaveFun()
-                }
+                // // 保存销售单
+                // if (_this.form.buyerSn) {
+                //   _this.salesSaveFun()
+                // }
               }
             })
           } else {
             // 保存客户信息
             _this.handleSaveCust()
-            // 保存销售单
-            if (_this.form.buyerSn) {
-              _this.salesSaveFun()
-            }
+            // // 保存销售单
+            // if (_this.form.buyerSn) {
+            //   _this.salesSaveFun()
+            // }
           }
         } else {
           console.log('error submit!!')
@@ -445,7 +450,6 @@ export default {
     salesSaveFun () {
       const _this = this
       const form = this.form
-      console.log(form, 'save data')
       _this.spinning = true
       salesSave(form).then(res => {
         if (res.status == 200) {

+ 34 - 25
src/views/salesManagement/salesQuery/detail.vue

@@ -5,14 +5,14 @@
         <template slot="subTitle">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
           <a-button
-            v-if="detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE'"
+            v-if="(detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE')&&$hasPermissions('B_salesEdit')"
             type="primary"
             size="small"
             style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
             id="salesDetail-edit-btn"
             @click.stop="handleEdit">编辑</a-button>
         </template>
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_salesPrint')">
           <!-- <span>打印字段:</span>
           <a-select key="1" style="width:150px" id="salesDetail-pritKey" placeholder="请选择打印字段" allowClear>
             <a-select-option v-for="item in pritKey" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
@@ -34,27 +34,36 @@
       <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">
-              <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="客户地址">{{ detailData.shippingAddressProvinceName || '--' }}{{ detailData.shippingAddressCityName || '--' }}{{ detailData.shippingAddressCountyName || '--' }}{{ detailData.shippingAddress || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收款方式">{{ detailData.settleStyleEntity.name || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="联系电话">{{ detailData.consigneeTel || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="制单人">{{ detailData.operatorName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="业务员">{{ detailData.salesManName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="财务状态">{{ detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName? detailData.buyerName : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="客户地址">{{ detailData&&detailData.shippingAddressProvinceName ? detailData.shippingAddressProvinceName : '--' }}{{ detailData.shippingAddressCityName || '--' }}{{ detailData.shippingAddressCountyName || '--' }}{{ detailData.shippingAddress || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleEntity&&detailData.settleStyleEntity.name?detailData.settleStyleEntity.name: '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系电话">{{ detailData&&detailData.consigneeTel ? detailData.consigneeTel : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ detailData&&detailData.remarks ? detailData.remarks : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo ? detailData.salesBillNo : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="制单人">{{ detailData&&detailData.operatorName ? detailData.operatorName : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务员">{{ detailData&&detailData.salesManName ? detailData.salesManName : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue ? detailData.billStatusDictValue : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue ? detailData.financialStatusDictValue : '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- alert -->
-        <a-alert type="info" style="margin-bottom: 15px;" v-if="detailData">
+        <a-alert type="info" style="margin-bottom: 15px;">
           <div slot="message">
-            总款数:<strong>{{ detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData.totalQty || 0 }}</strong>;总赠品数量:<strong>{{ detailData.giftQty || 0 }}</strong>;急件总款数:<strong>{{ detailData.oosCategory || 0 }}</strong>;急件总数量:<strong>{{ detailData.oosQty || 0 }}</strong>;<br/>
-            总售价:<strong>{{ detailData.totalAmount || 0 }}</strong>;总成本:<strong>{{ detailData.totalCost || 0 }}</strong>;总毛利:<strong>{{ detailData.grossProfit || 0 }}</strong>;折后总售价:<strong>{{ detailData.discountedAmount || 0 }}</strong>;折扣:<strong>{{ detailData.discountRate || 0 }}%</strong>;折扣金额:<strong>{{ detailData.discountAmount || 0 }}</strong>;
+            总款数:<strong>{{ detailData&&detailData.totalCategory ? detailData.totalCategory : 0 }}</strong>;
+            总数量:<strong>{{ detailData&&detailData.totalQty ? detailData.totalQty : 0 }}</strong>;
+            总赠品数量:<strong>{{ detailData&&detailData.giftQty ? detailData.giftQty : 0 }}</strong>;
+            急件总款数:<strong>{{ detailData&&detailData.oosCategory ? detailData.oosCategory : 0 }}</strong>;
+            急件总数量:<strong>{{ detailData&&detailData.oosQty ? detailData.oosQty : 0 }}</strong>;<br/>
+            总售价:<strong>{{ detailData&&detailData.totalAmount ? detailData.totalAmount : 0 }}</strong>;
+            总成本:<strong>{{ detailData&&detailData.totalCost ? detailData.totalCost : 0 }}</strong>;
+            总毛利:<strong>{{ detailData&&detailData.grossProfit ? detailData.grossProfit : 0 }}</strong>;
+            折后总售价:<strong>{{ detailData&&detailData.discountedAmount ? detailData.discountedAmount : 0 }}</strong>;
+            折扣:<strong>{{ detailData&&detailData.discountRate ? detailData.discountRate : 0 }}%</strong>;
+            折扣金额:<strong>{{ detailData&&detailData.discountAmount ? detailData.discountAmount : 0 }}</strong>;
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -100,19 +109,19 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', 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: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { 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: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '销售数量', dataIndex: 'qty', 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: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '折后小计', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center' },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
+        { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '折后小计', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '是否急件', dataIndex: 'oosFlagDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 12 - 6
src/views/salesManagement/salesQuery/edit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_salesPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -19,7 +19,7 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesEdit-cont">
         <!-- 查询配件列表 -->
-        <queryPart ref="partQuery" :buyerSn="detailData&&detailData.buyerSn" :priceType="$route.params.priceType" :newLoading="isInster" @add="insterProduct"></queryPart>
+        <queryPart ref="partQuery" :buyerSn="(detailData&&detailData.buyerSn&&detailData.salesBillSource&&detailData.salesBillSource=='PURCHASE')?'':detailData.buyerSn" :priceType="$route.params.priceType" :newLoading="isInster" @add="insterProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="salesEdit-cont">
         <!-- 总计 -->
@@ -183,8 +183,8 @@ export default {
         { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
         { title: '单位', dataIndex: 'dealerProductEntity.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: 'discountedAmount', 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: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -207,7 +207,6 @@ export default {
   },
   methods: {
     onCellChange (id, key, value) {
-      console.log(id, key, value)
       const dataSource = [...this.dataSource]
       const row = dataSource.find(item => item.id === id)
       if (row) {
@@ -216,6 +215,7 @@ export default {
       }
       // 修改价格
       if (key == 'price') {
+        this.spinning = true
         salesDetailUpdatePrice({
           salesBillSn: row.salesBillSn,
           productSn: row.productSn,
@@ -223,9 +223,11 @@ export default {
         }).then(res => {
           this.resetSearchForm(true)
           this.$message.info(res.message)
+          this.spinning = false
         })
       }
       if (key == 'qty') {
+        this.spinning = true
         salesDetailUpdateQty({
           id: row.id,
           qty: row.qty
@@ -235,6 +237,7 @@ export default {
             this.$refs.partQuery.resetCurForm()
           }
           this.$message.info(res.message)
+          this.spinning = false
         })
       }
     },
@@ -310,7 +313,6 @@ export default {
       if (this.detailData.discountAmount < 0) {
         return
       }
-      console.log(this.detailData)
       this.spinning = true
       salesWriteDiscount({
         discountAmount: this.detailData.discountAmount,
@@ -335,12 +337,14 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm()
             }
             _this.$message.info(res.message)
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })
@@ -355,12 +359,14 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm(true)
             }
             _this.$message.info(res.message)
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })

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

@@ -1,174 +1,177 @@
 <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}">
-              <a-select
-                id="salesManagementList-buyerName"
-                placeholder="请选择客户"
-                allowClear
-                v-model="queryParam.buyerName"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerName">{{ item.customerName }}</a-select-option>
-              </a-select>
-            </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" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="收款方式">
-                <a-select placeholder="请选择收款方式" v-model="queryParam.settleStyleSn">
-                  <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-                    {{ item.name }}
-                  </a-select-option>
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <a-select
+                  id="salesManagementList-buyerName"
+                  placeholder="请选择客户"
+                  allowClear
+                  v-model="queryParam.buyerName"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerName">{{ item.customerName }}</a-select-option>
                 </a-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 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="收款方式">
+                  <a-select placeholder="请选择收款方式" v-model="queryParam.settleStyleSn">
+                    <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
+                      {{ item.name }}
+                    </a-select-option>
+                  </a-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">
-        总售价:<strong>{{ totalData.totalAmount }}</strong>元;
-        总单数:<strong>{{ totalData.totalRecord }}</strong>;
-        总款数:<strong>{{ totalData.totalCategory }}</strong>;
-        总数量:<strong>{{ totalData.totalQty }}</strong>;
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd">新增(零售)</a-button>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2050, 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="oosFlag" slot-scope="text, record">
-        <a-tag :color="record.oosFlag==1?'red':'#ccc'" >{{ record.oosFlagDictValue }}</a-tag>
-      </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"
-          v-if="record.billStatus == 'WAIT_OUT_WAREHOUSE'"
-          class="button-primary"
-          @click="handleSend(record)"
-        >出库</a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="(record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')"
-          @click="handleEdit(record)"
-        >
-          编辑
-        </a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="(record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && record.billStatus != 'FINISH'"
-          @click="handleDel(record)"
-        >
-          删除
-        </a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')"
-          @click="handleEdit(record)"
-        >
-          改单
-        </a-button>
-        <a-button
-          size="small"
-          type="link"
-          class="button-error"
-          v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')"
-          @click="handleDel(record, 'cancel')"
-        >
-          取消
-        </a-button>
-        <span v-if="record.billStatus == 'FINISH'">--</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: 2050, y:tableHeight }"
+        bordered>
+        <!-- 销售单号 -->
+        <template slot="salesBillNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+          <span v-else>{{ record.salesBillNo }}</span>
+        </template>
+        <!-- 急件 -->
+        <template slot="oosFlag" slot-scope="text, record">
+          <a-tag :color="record.oosFlag==1?'red':'#ccc'" >{{ record.oosFlagDictValue }}</a-tag>
+        </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"
+            v-if="record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')"
+            class="button-primary"
+            @click="handleSend(record)"
+          >出库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
+            @click="handleEdit(record)"
+          >
+            编辑
+          </a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
+            @click="handleDel(record)"
+          >
+            删除
+          </a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_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_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel')"
+            @click="handleDel(record, 'cancel')"
+          >
+            取消
+          </a-button>
+          <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')) && !((record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')) && !((record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
     <!-- 审核 -->
@@ -189,6 +192,7 @@ export default {
   components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
@@ -216,14 +220,14 @@ 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: '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 : '--') } },
-        { 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: 'settleStyleEntity.name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '急件', dataIndex: 'oosFlag', scopedSlots: { customRender: 'oosFlag' }, width: 100, align: 'center' },
@@ -271,28 +275,11 @@ export default {
     },
     //  审核
     handleEexamine (row) {
-      // const _this = this
-      // this.$confirm({
-      //   title: '提示',
-      //   content: '请点击下方按钮确认操作?',
-      //   centered: true,
-      //   closable: true,
-      //   okText: '审核通过',
-      //   cancelText: '审核不通过',
-      //   onOk () {
-      //     _this.auditOrder(row.id, 'WAIT_OUT_WAREHOUSE')
-      //   },
-      //   onCancel (e) {
-      //     if (!e.triggerCancel) {
-      //       _this.auditOrder(row.id, 'AUDIT_REJECT')
-      //     }
-      //     _this.$destroyAll()
-      //   }
-      // })
       this.auditInfo = row
       this.visibleAudit = true
     },
     auditOrder (billStatus) {
+      this.spinning = true
       salesWriteAudit({
         id: this.auditInfo.id,
         billStatus: billStatus
@@ -301,8 +288,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
         }
       })
     },
@@ -315,12 +304,16 @@ export default {
         centered: true,
         closable: true,
         onOk () {
+          _this.spinning = true
           salesWriteStockOut({
             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
             }
           })
         }
@@ -347,10 +340,14 @@ export default {
         centered: true,
         closable: true,
         onOk () {
+          _this.spinning = true
           salesDel({ 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
             }
           })
         }

+ 5 - 25
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -61,29 +61,10 @@ export default {
       },
       // 表头
       columns: [
-        {
-          title: '销售时间',
-          dataIndex: 'salesBillEntity.createDate',
-          align: 'center',
-          width: 250
-        },
-        {
-          title: '销售价(¥)',
-          dataIndex: 'price',
-          align: 'center',
-          width: 150
-        },
-        {
-          title: '销售数量',
-          dataIndex: 'qty',
-          align: 'center',
-          width: 150
-        },
-        {
-          title: '客户名称',
-          dataIndex: 'salesBillEntity.buyerName',
-          align: 'center'
-        }
+        { title: '销售时间', dataIndex: 'salesBillEntity.createDate', width: 250, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售价(¥)', dataIndex: 'price', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'salesBillEntity.buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       list: [],
       pagination: {},
@@ -143,7 +124,6 @@ export default {
     },
     //  分页 页码change
     changePage (current) {
-      console.log(current)
       this.pageNo = current
       this.handelSearch()
     },
@@ -176,7 +156,7 @@ export default {
 <style lang="less">
   .salesRecord-modal{
     .ant-modal-body {
-    	padding: 10px;
+      padding: 10px;
     }
   }
 </style>

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

@@ -135,7 +135,6 @@
           size="small"
           type="primary"
           class="button-info"
-          :loading="newLoading"
           @click="handleAdd(record)"
           id="productInfoList-edit-btn">添加</a-button>
         <a-button
@@ -238,10 +237,10 @@ export default {
         { title: '品牌', dataIndex: 'brandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
+        { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '成本价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: 150, align: 'center' },
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }

+ 12 - 10
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -306,9 +306,15 @@ export default {
         countyName: this.form.countyName,
         customerAddr: this.form.customerAddr //  详细地址
       }
+      this.spinning = true
       updateByCustomerSn(params).then(res => {
-        if (res.status != 200) {
-          this.$message.error(res.message)
+        this.spinning = false
+        if (res.status == 200) {
+          // 保存销售单
+          this.salesSaveFun()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -320,10 +326,10 @@ export default {
         if (valid) {
           // 保存客户信息
           _this.handleSaveCust()
-          // 保存销售单
-          if (_this.form.buyerSn) {
-            _this.salesSaveFun()
-          }
+          // // 保存销售单
+          // if (_this.form.buyerSn) {
+          //   _this.salesSaveFun()
+          // }
         } else {
           console.log('error submit!!')
           return false
@@ -334,7 +340,6 @@ export default {
     salesSaveFun () {
       const _this = this
       const form = this.form
-      console.log(form, 'save data')
       _this.spinning = true
       salesReturnSave(form).then(res => {
         if (res.status == 200) {
@@ -434,6 +439,3 @@ export default {
   }
 }
 </script>
-
-<style>
-</style>

+ 3 - 3
src/views/salesManagement/salesReturn/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_salesReturnPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -70,7 +70,7 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -78,7 +78,7 @@ export default {
         { title: '退货数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '废品数量', dataIndex: 'celQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库数量', dataIndex: 'rkqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: 120, align: 'center' },
+        { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '折后退货金额小计', dataIndex: 'discountedAmount', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],

+ 125 - 113
src/views/salesManagement/salesReturn/list.vue

@@ -1,121 +1,124 @@
 <template>
   <a-card size="small" :bordered="false" class="salesReturn-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="审核时间">
-              <rangeDate ref="rangeExamineDate" @change="dateExamineChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-select
-                id="salesReturn-buyerSn"
-                placeholder="请选择客户"
-                allowClear
-                v-model="queryParam.buyerSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</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">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="退货单号">
-                <a-input id="salesReturn-salesReturnNo" v-model.trim="queryParam.salesReturnNo" allowClear placeholder="请输入退货单号"/>
+              <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.state"
-                  ref="state"
-                  id="salesManagementList-state"
-                  code="SALES_RETURN_BILL_STATUS"
-                  placeholder="请选择业务状态"
-                  allowClear></v-select>
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeExamineDate" @change="dateExamineChange" />
               </a-form-item>
             </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="openModal = true">新增</a-button>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" style="margin-bottom: 15px;">
-      <div slot="message">
-        退货总金额:<strong>{{ countData&&countData.totalAmount }}</strong>元;
-        总单数:<strong>{{ countData&&countData.totalBillNumber }}</strong>;
-        总款数:<strong>{{ countData&&countData.totalCategory }}</strong>;
-        总数量:<strong>{{ countData&&countData.totalQty }}</strong>;
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <a-select
+                  id="salesReturn-buyerSn"
+                  placeholder="请选择客户"
+                  allowClear
+                  v-model="queryParam.buyerSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</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-input id="salesReturn-salesReturnNo" v-model.trim="queryParam.salesReturnNo" 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="salesManagementList-state"
+                    code="SALES_RETURN_BILL_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </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" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1810, y: tableHeight }"
-      bordered>
-      <!-- 单号 -->
-      <template slot="salesReturnNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesReturnNo }}</span>
-      </template>
-      <!-- 财务状态 -->
-      <template slot="financialStatus" 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"
-          class="button-warning"
-          v-if="record.state == 'WAIT_AUDIT'"
-          @click="handleEexamine(record)"
-          id="salesReturn-eexamine-btn">审核</a-button>
-        <a-button
-          size="small"
-          v-if="record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT'"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="salesReturn-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          v-if="record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT'"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="salesReturn-del-btn">删除</a-button>
-        <span v-if="record.state == 'FINISH'">--</span>
-      </template>
-    </s-table>
+      <!-- alert -->
+      <a-alert type="info" style="margin-bottom: 15px;">
+        <div slot="message">
+          退货总金额:<strong>{{ countData&&countData.totalAmount }}</strong>元;
+          总单数:<strong>{{ countData&&countData.totalBillNumber }}</strong>;
+          总款数:<strong>{{ countData&&countData.totalCategory }}</strong>;
+          总数量:<strong>{{ countData&&countData.totalQty }}</strong>;
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1810, y: tableHeight }"
+        bordered>
+        <!-- 单号 -->
+        <template slot="salesReturnNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_salesReturnDetail')" @click="handleDetail(record)">{{ record.salesReturnNo }}</span>
+          <span v-else>{{ record.salesReturnNo }}</span>
+        </template>
+        <!-- 财务状态 -->
+        <template slot="financialStatus" 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"
+            class="button-warning"
+            v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_salesReturnAudit')"
+            @click="handleEexamine(record)"
+            id="salesReturn-eexamine-btn">审核</a-button>
+          <a-button
+            size="small"
+            v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnEdit')"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="salesReturn-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnDel')"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="salesReturn-del-btn">删除</a-button>
+          <span v-if="record.state == 'FINISH' || (!(record.state == 'WAIT_AUDIT'&&$hasPermissions('B_salesReturnAudit')) && !((record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnEdit')) && !((record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnDel')))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="handleEdit" @cancel="openModal=false"></choose-custom-modal>
   </a-card>
@@ -137,6 +140,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       // 高级搜索 展开/关闭
       advanced: false,
@@ -157,15 +161,15 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售退货单号', scopedSlots: { customRender: 'salesReturnNo' }, width: 260, align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '退款总金额', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总款数', dataIndex: 'totalCategory', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总数量', dataIndex: 'totalQty', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'totalCategory', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '是否抓单', dataIndex: 'grabFlag', width: 100, align: 'center', customRender: function (text) { return ['否', '是'][text] } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'settleStateDictValue', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 220, align: 'center', fixed: 'right' }
       ],
@@ -222,10 +226,14 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           salesReturnDel({ sn: row.salesReturnSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }
@@ -239,12 +247,16 @@ export default {
         content: '确认要审核吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           salesReturnAudit({
             sn: row.salesReturnSn
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

+ 8 - 8
src/views/salesManagement/salesReturn/queryPart.vue

@@ -136,21 +136,21 @@ export default {
     if (this.grabFlag == 1) {
       this.columns = [
         { title: '序号', dataIndex: 'no', align: 'center', width: 80 },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', align: 'center', sorter: true, width: 220 },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', align: 'center', customRender: function (text) { return text || '--' }, sorter: true, width: 220 },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', align: 'center', customRender: function (text) { return text || '--' }, width: 220 },
-        { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', width: 220 },
+        { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', width: 220, customRender: function (text) { return text || '--' } },
         { title: '销售审核时间', dataIndex: 'auditDate', align: 'center', customRender: function (text) { return text || '--' }, width: 160 },
         { title: '售价', dataIndex: 'price', align: 'center', width: 100, scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', align: 'center', width: 100 },
-        { title: '销售数量', dataIndex: 'qty', align: 'center', width: 100 },
-        { title: '已退数量', dataIndex: 'hasReturnQty', align: 'center', width: 100 },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', align: 'center', width: 100, customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', align: 'center', width: 100, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已退数量', dataIndex: 'hasReturnQty', align: 'center', width: 100, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }]
     } else {
       this.columns = [
         { title: '序号', dataIndex: 'no', align: 'center', width: 80 },
-        { title: '产品编码', dataIndex: 'productCode', align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价', dataIndex: 'salePrice', align: 'center', width: 100, scopedSlots: { customRender: 'price' } },
         { title: '单位', dataIndex: 'unit', align: 'center', customRender: function (text) { return text || '--' }, width: 100 },

+ 10 - 2
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">客户名称:{{ (ordeDetail&&ordeDetail.buyerName) || '--' }}</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_salesReturnPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -334,6 +334,7 @@ export default {
       if (this.ordeDetail.discountAmount < 0) {
         return
       }
+      this.spinning = true
       salesReturnDiscount({
         discountAmount: this.ordeDetail.discountAmount,
         salesReturnSn: this.ordeDetail.salesReturnSn,
@@ -341,6 +342,9 @@ export default {
       }).then(res => {
         if (res.status == 200) {
           this.resetSearchForm()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -354,12 +358,14 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesReturnDelAll({ sn: _this.ordeDetail.salesReturnSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm()
             }
             _this.$message.info(res.message)
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })
@@ -374,12 +380,14 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesReturnDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm(true)
             }
             _this.$message.info(res.message)
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })
@@ -399,7 +407,7 @@ export default {
       this.isInster = true
       const params = {
         'salesReturnBillSn': this.orderSn,
-        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
+        'salesReturnBillNo': this.ordeDetail.salesReturnNo,
         'salesBillSn': row.salesBillSn,
         'salesBillNo': row.salesBillNo,
         'salesBillDetailSn': row.salesBillDetailSn,

+ 11 - 5
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">客户名称:{{ (ordeDetail&&ordeDetail.buyerName) || '--' }}</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
+        <template slot="extra" v-if="$hasPermissions('B_salesReturnPrint')">
           <a-radio-group key="3" v-model="printerType">
             <a-radio value="NEEDLE">针式</a-radio>
             <a-radio value="INK">喷墨</a-radio>
@@ -328,6 +328,7 @@ export default {
       if (this.ordeDetail.discountAmount < 0) {
         return
       }
+      this.spinning = true
       salesReturnDiscount({
         discountAmount: this.ordeDetail.discountAmount,
         salesReturnSn: this.ordeDetail.salesReturnSn,
@@ -335,6 +336,9 @@ export default {
       }).then(res => {
         if (res.status == 200) {
           this.resetSearchForm()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -348,12 +352,14 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesReturnDelAll({ sn: _this.ordeDetail.salesReturnSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm()
             }
             _this.$message.info(res.message)
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })
@@ -368,12 +374,14 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
+          _this.spinning = true
           salesReturnDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm(true)
             }
             _this.$message.info(res.message)
             _this.delLoading = false
+            _this.spinning = false
           })
         }
       })
@@ -393,7 +401,7 @@ export default {
       this.isInster = true
       const params = {
         'salesReturnBillSn': this.orderSn,
-        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
+        'salesReturnBillNo': this.ordeDetail.salesReturnNo,
         'salesBillSn': row.salesBillSn,
         'salesBillNo': row.salesBillNo,
         'salesBillDetailSn': row.salesBillDetailSn,
@@ -476,9 +484,7 @@ export default {
     this.getWarehouseCascade()
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {
-      console.log('beforeRouteEnter')
-    })
+    next(vm => {})
   }
 }
 </script>

+ 21 - 15
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -9,7 +9,7 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra">
-          <a-button key="3" type="danger" v-if="!isWriteDown" @click="handleSubmit" id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
+          <a-button key="3" type="danger" v-if="!isWriteDown&&$hasPermissions('B_urgentWriteDown')" @click="handleSubmit" id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
           <!-- <a-button key="2" @click="handlePreview" id="urgentItemsOffsetDetail-btn-preview">打印预览</a-button>
           <a-button key="1" type="primary" @click="handlePrint" id="urgentItemsOffsetDetail-btn-print">快速打印</a-button> -->
         </template>
@@ -18,14 +18,13 @@
       <a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-info-wrapper">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
-            <a-descriptions :column="3" v-if="detailData">
-              <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="客户地址">{{ detailData.shippingAddressProvinceName || '--' }}{{ detailData.shippingAddressCityName || '--' }}{{ detailData.shippingAddressCountyName || '--' }}{{ detailData.shippingAddress || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="支付方式">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="联系电话">{{ detailData.consigneeTel || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收款方式">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="急件单号">{{ detailData.urgentBillNo || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="状态">{{ detailData.statusDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions :column="3">
+              <a-descriptions-item label="客户名称">{{ (detailData&&detailData.buyerName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="客户地址">{{ (detailData&&detailData.shippingAddressProvinceName) || '' }}{{ (detailData&&detailData.shippingAddressCityName) || '' }}{{ (detailData&&detailData.shippingAddressCountyName) || '' }}{{ (detailData&&detailData.shippingAddress) || '' }}</a-descriptions-item>
+              <a-descriptions-item label="联系电话">{{ detailData&&detailData.consigneeTel || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收款方式">{{ (detailData&&detailData.settleStyleEntity&&detailData.settleStyleEntity.name) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="急件单号">{{ (detailData&&detailData.urgentBillNo) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="状态">{{ (detailData&&detailData.statusDictValue) || '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -34,7 +33,10 @@
       <a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-table-wrapper">
         <!-- 合计 -->
         <a-alert type="info" showIcon style="margin-bottom:15px" v-if="detailData">
-          <div class="ftext" slot="message">总款数:<strong>{{ detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData.totalQty || 0 }}</strong>。</div>
+          <div class="ftext" slot="message">
+            总款数:<strong>{{ (detailData&&(detailData.totalCategory || detailData.totalCategory == 0)) ? detailData.totalCategory : '--' }}</strong>;
+            总数量:<strong>{{ (detailData&&(detailData.totalQty || detailData.totalQty == 0)) ? detailData.totalQty : '--' }}</strong>。
+          </div>
         </a-alert>
         <s-table
           class="sTable"
@@ -67,17 +69,17 @@ export default {
       spinning: false,
       unColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center' },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, customRender: function (text) { return text || '--' }, align: 'center' },
         { title: '库存数量', scopedSlots: { customRender: 'inventoryQuantity' }, width: 100, align: 'center' },
         { title: '未冲减数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center' },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库时间', dataIndex: 'stockInDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -133,11 +135,15 @@ export default {
         content: '确定要进行冲减吗?',
         centered: true,
         onOk () {
+          _this.spinning = true
           urgentWriteDown({ urgentBillSn: _this.$route.params.sn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.getDetail()
               _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         }

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