Bläddra i källkod

合并develop更改内容

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

# Conflicts:
#	src/views/financialManagement/warehousingAudit/list.vue
#	src/views/purchasingManagement/purchaseOrder/detail.vue
#	vue.config.js
chenrui 3 år sedan
förälder
incheckning
bcc03c7eab
100 ändrade filer med 3170 tillägg och 1492 borttagningar
  1. 7 34
      public/index.html
  2. 3 0
      public/version.json
  3. 8 0
      src/api/checkWarehouse.js
  4. 11 0
      src/api/dealerProduct.js
  5. 150 0
      src/api/reportData.js
  6. 5 5
      src/api/sales.js
  7. BIN
      src/assets/upBrowser/t1.png
  8. BIN
      src/assets/upBrowser/t2.png
  9. BIN
      src/assets/upBrowser/t3.png
  10. BIN
      src/assets/upBrowser/t4.png
  11. BIN
      src/assets/upBrowser/temp1.png
  12. 5 5
      src/components/MultiTab/MultiTab.vue
  13. 2 1
      src/components/newThem.less
  14. 111 1
      src/config/router.config.js
  15. 7 2
      src/layouts/PageView.vue
  16. 20 5
      src/libs/JGPrint.js
  17. 22 2
      src/libs/getDate.js
  18. 13 1
      src/libs/tools.js
  19. 28 0
      src/libs/versionUpdate.js
  20. 4 2
      src/permission.js
  21. 1 1
      src/utils/util.js
  22. 21 19
      src/views/allocationManagement/chainTransferIn/detail.vue
  23. 29 27
      src/views/allocationManagement/chainTransferIn/edit.vue
  24. 21 18
      src/views/allocationManagement/chainTransferIn/list.vue
  25. 12 9
      src/views/allocationManagement/chainTransferOut/detail.vue
  26. 15 12
      src/views/allocationManagement/chainTransferOut/list.vue
  27. 12 7
      src/views/allocationManagement/storeTransferOut/detail.vue
  28. 5 2
      src/views/allocationManagement/storeTransferOut/edit.vue
  29. 8 5
      src/views/allocationManagement/storeTransferOut/list.vue
  30. 76 68
      src/views/allocationManagement/warehouseAllocation/detail.vue
  31. 8 5
      src/views/allocationManagement/warehouseAllocation/list.vue
  32. 8 5
      src/views/basicData/bulkPartsTypeManagement/list.vue
  33. 8 5
      src/views/basicData/customerTypeManagement/list.vue
  34. 8 6
      src/views/basicData/expenseType/list.vue
  35. 7 4
      src/views/basicData/storeTransferOutTypeManagement/list.vue
  36. 9 17
      src/views/bulkManagement/bulkImport/list.vue
  37. 12 7
      src/views/bulkManagement/bulkReturnGoods/detailModal.vue
  38. 10 5
      src/views/bulkManagement/bulkReturnGoods/list.vue
  39. 13 8
      src/views/bulkManagement/bulkWarehousingOrder/detail.vue
  40. 12 21
      src/views/bulkManagement/bulkWarehousingOrder/list.vue
  41. 10 7
      src/views/customerManagement/customerInfo/list.vue
  42. 74 0
      src/views/exception/updateBrowser.vue
  43. 65 57
      src/views/financialManagement/companyCollectionPayment/detail.vue
  44. 93 87
      src/views/financialManagement/companyCollectionPayment/list.vue
  45. 69 61
      src/views/financialManagement/companyReceivablePayable/chooseBillModal.vue
  46. 82 86
      src/views/financialManagement/companyReceivablePayable/detail.vue
  47. 82 76
      src/views/financialManagement/companyReceivablePayable/list.vue
  48. 15 12
      src/views/financialManagement/expenseManagement/list.vue
  49. 26 8
      src/views/financialManagement/financialCollection/list.vue
  50. 25 8
      src/views/financialManagement/financialPayment/list.vue
  51. 35 15
      src/views/financialManagement/inventoryCheckAudit/list.vue
  52. 10 7
      src/views/financialManagement/ledgerRecord/list.vue
  53. 11 6
      src/views/financialManagement/warehousingAudit/detail.vue
  54. 15 12
      src/views/financialManagement/warehousingAudit/list.vue
  55. 59 51
      src/views/financialManagement/withdrawalManagement/list.vue
  56. 91 70
      src/views/inventoryManagement/inventoryChecking/detailModal.vue
  57. 41 11
      src/views/inventoryManagement/inventoryChecking/list.vue
  58. 13 22
      src/views/inventoryManagement/inventoryChecking/makeInventory.vue
  59. 9 6
      src/views/inventoryManagement/inventoryChecking/overall.vue
  60. 12 20
      src/views/inventoryManagement/inventoryImport/list.vue
  61. 36 28
      src/views/inventoryManagement/inventoryQuery/detailModal.vue
  62. 20 29
      src/views/inventoryManagement/inventoryQuery/list.vue
  63. 102 94
      src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue
  64. 16 26
      src/views/inventoryManagement/inventoryWarning/list.vue
  65. 9 4
      src/views/inventoryManagement/satelliteWarehouseInventory/addModal.vue
  66. 8 5
      src/views/inventoryManagement/satelliteWarehouseInventory/list.vue
  67. 8 5
      src/views/inventoryManagement/warehouse/list.vue
  68. 8 5
      src/views/inventoryManagement/warehouse/storingLocation/list.vue
  69. 9 6
      src/views/outboundOrderManagement/outboundOrder/list.vue
  70. 10 6
      src/views/power/role/roleList.vue
  71. 10 6
      src/views/power/user/userList.vue
  72. 2 5
      src/views/productManagement/newProduct/detail.vue
  73. 8 5
      src/views/productManagement/newProduct/list.vue
  74. 7 4
      src/views/productManagement/newProduct/modal.vue
  75. 11 19
      src/views/productManagement/priceChangeRecord/list.vue
  76. 8 5
      src/views/productManagement/productBrand/list.vue
  77. 11 7
      src/views/productManagement/productCategory/list.vue
  78. 14 23
      src/views/productManagement/productInfo/list.vue
  79. 10 19
      src/views/productManagement/productInfoJg/list.vue
  80. 14 10
      src/views/productManagement/productOnlineInfo/list.vue
  81. 11 21
      src/views/purchasingManagement/purchaseOrder/detail.vue
  82. 3 12
      src/views/purchasingManagement/purchaseOrder/importGuideModal.vue
  83. 8 5
      src/views/purchasingManagement/purchaseOrder/list.vue
  84. 7 2
      src/views/purchasingManagement/purchaseOrder/outStockModal.vue
  85. 15 10
      src/views/purchasingManagement/purchaseOrder/receivingAddress/chooseAddressModal.vue
  86. 23 20
      src/views/purchasingManagement/purchaseOrder/warehousing.vue
  87. 64 58
      src/views/purchasingManagement/purchaseReturn/detail.vue
  88. 8 5
      src/views/purchasingManagement/purchaseReturn/list.vue
  89. 13 10
      src/views/reportData/chainCustomerReport/list.vue
  90. 69 0
      src/views/reportData/chainPurchaseReceiptReport/list.vue
  91. 295 0
      src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptDetail.vue
  92. 244 0
      src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptOrder.vue
  93. 56 29
      src/views/reportData/chainReceivedSendStorageReport/list.vue
  94. 13 10
      src/views/reportData/chainSalesDetailReport/list.vue
  95. 12 9
      src/views/reportData/chainSalesReport/list.vue
  96. 35 32
      src/views/reportData/chainStockReport/detailModal.vue
  97. 14 19
      src/views/reportData/chainStockReport/list.vue
  98. 11 8
      src/views/reportData/customerReport/list.vue
  99. 234 0
      src/views/reportData/inventoryReport/inventoryDetail.vue
  100. 186 0
      src/views/reportData/inventoryReport/inventoryOrder.vue

+ 7 - 34
public/index.html

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

+ 3 - 0
public/version.json

@@ -0,0 +1,3 @@
+{
+    "version": "1.0.4"
+}

+ 8 - 0
src/api/checkWarehouse.js

@@ -136,6 +136,14 @@ export const checkWarehouseInventory = (params) => {
     method: 'post'
   })
 }
+//  库存盘点  重盘
+export const checkWarehouseReInventory = (params) => {
+  return axios({
+    url: '/checkWarehouse/reInventory',
+    data: params,
+    method: 'post'
+  })
+}
 //  库存盘点  财务审核
 export const checkWarehouseFinanceAudit = (params) => {
   return axios({

+ 11 - 0
src/api/dealerProduct.js

@@ -71,3 +71,14 @@ export const giftsDetailList = (params) => {
     method: 'post'
   })
 }
+//  产品定价 列表  分页
+export const dealerProductPriceList = (params) => {
+  const url = `/dealerProduct/queryPageForSalesOffer/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 150 - 0
src/api/reportData.js

@@ -18,6 +18,15 @@ export const linkageReportPageTotal = (params) => {
     method: 'post'
   })
 }
+// 连锁收发存报表  导出
+export const reportChainStockPutOutExport = params => {
+  return axios.request({
+    url: `/report/reportStockPutOut/exportLinkageReport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 // 收发存报表-分页列表
 export const reportPageList = (params) => {
   const url = `report/reportStockPutOut/reportPage/${params.pageNo}/${params.pageSize}`
@@ -45,6 +54,15 @@ export const reportStockPutOutCount = (params) => {
     method: 'post'
   })
 }
+// 收发存报表  导出
+export const reportStockPutOutExport = params => {
+  return axios.request({
+    url: `/report/reportStockPutOut/exportReport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 // 大客户报表-分页列表
 export const reportBigCustomerList = (params) => {
   const url = `report/reportBigCustomer/reportPage/${params.pageNo}/${params.pageSize}`
@@ -185,3 +203,135 @@ export const reportSalesBillDetailExport = params => {
     responseType: 'blob'
   })
 }
+// 盘点报表  盘点单报表 列表 分页
+export const reportCheckWarehouseList = (params) => {
+  const url = `/report/reportCheckWarehouse/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 盘点报表  盘点单报表 合计
+export const reportCheckWarehouseCount = (params) => {
+  return axios({
+    url: '/report/reportCheckWarehouse/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 盘点报表  盘点明细报表 列表 分页
+export const reportCheckWarehouseDetailList = (params) => {
+  const url = `/report/reportCheckWarehouse/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 盘点报表  盘点明细报表 合计
+export const reportCheckWarehouseDetailCount = (params) => {
+  return axios({
+    url: '/report/reportCheckWarehouse/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库单报表 列表 分页
+export const reportReceivingBillList = (params) => {
+  const url = `/report/reportReceivingBill/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库单报表 合计
+export const reportReceivingBillCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库单报表  导出
+export const reportReceivingBillExport = params => {
+  return axios.request({
+    url: `/report/reportReceivingBill/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 采购入库报表  采购入库明细报表 列表 分页
+export const reportReceivingBillDetailList = (params) => {
+  const url = `/report/reportReceivingBill/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库明细报表 合计
+export const reportReceivingBillDetailCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库明细报表  导出
+export const reportReceivingBillDetailExport = params => {
+  return axios.request({
+    url: `/report/reportReceivingBill/detailExport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 连锁采购入库报表  连锁采购入库单报表 列表 分页
+export const reportChainReceivingBillList = (params) => {
+  const url = `/report/reportReceivingBill/linkageReportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁采购入库报表  连锁采购入库单报表 合计
+export const reportChainReceivingBillCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/linkageReportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁采购入库报表  连锁采购入库明细报表 列表 分页
+export const reportChainReceivingBillDetailList = (params) => {
+  const url = `/report/reportReceivingBill/linkageReportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁采购入库报表  连锁采购入库明细报表 合计
+export const reportChainReceivingBillDetailCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/linkageReportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}

+ 5 - 5
src/api/sales.js

@@ -127,7 +127,7 @@ export const salesCount = (params) => {
 // 车架号
 export const supperCodeByVin = (params) => {
   return axios({
-    url: `/supper/queryPartCodeByVin/${params.vin}`,
+    url: `/vinIdentify/queryPartCodeByVin/${params.vin}`,
     method: 'get'
   })
 }
@@ -138,9 +138,9 @@ export const salesDetailPrint = params => {
     method: 'get'
   }
   // 喷墨打印
-  if (params.type == 'INK') {
-    data.responseType = 'blob'
-  }
+  // if (params.type == 'INK') {
+  //   data.responseType = 'blob'
+  // }
   return axios.request(data)
 }
 // 销售 详情  导出
@@ -163,7 +163,7 @@ export const salesExport = params => {
 // 车架号  识别图片内容
 export const vinCodeParse = params => {
   return axios.request({
-    url: `/vinCode/parse`,
+    url: `/vinIdentify/ocr`,
     method: 'post',
     data: params,
     responseType: 'blob'

BIN
src/assets/upBrowser/t1.png


BIN
src/assets/upBrowser/t2.png


BIN
src/assets/upBrowser/t3.png


BIN
src/assets/upBrowser/t4.png


BIN
src/assets/upBrowser/temp1.png


+ 5 - 5
src/components/MultiTab/MultiTab.vue

@@ -36,7 +36,6 @@ export default {
       } catch (e) {
       }
     })
-    console.log('rename')
     if (this.pages.length <= this.maxTabNums) {
       this.pages.push(this.$route)
       this.tabsList.push(this.$route.name)
@@ -178,16 +177,18 @@ export default {
         const na = newVal.meta.title.indexOf('详情') >= 0
         const nb = newVal.meta.title.indexOf('新增') >= 0
         const nc = newVal.meta.title.indexOf('编辑') >= 0
+        const nxt = newVal.meta.replaceTab
         const oa = oldMenu.meta.title.indexOf('详情') >= 0
         const ob = oldMenu.meta.title.indexOf('新增') >= 0
         const oc = oldMenu.meta.title.indexOf('编辑') >= 0
-        if ((na || nb || nc || oa || ob || oc) && hasChildren) {
+        const oxt = oldMenu.meta.replaceTab
+        if ((na || nb || nc || nxt || oa || ob || oc || oxt) && hasChildren) {
           // 替换当前页签
           this.replaceTab(newVal, oldMenu)
           // 从列表打开新增,编辑
-          this.$store.state.app.isNewTab = na || nb || nc
+          this.$store.state.app.isNewTab = na || nb || nc || nxt
           // 从编辑,新增返回列表,刷新列表
-          this.$store.state.app.updateList = ob || oc
+          this.$store.state.app.updateList = ob || oc || oxt
           this.activeKey = newVal.name
         } else {
           // 新打开的页签
@@ -221,7 +222,6 @@ export default {
       }
     },
     activeKey: function (newPathKey) {
-      console.log('-----' + newPathKey)
       const pages = this.pages.find(item => item.name == newPathKey)
       this.$router.push({ name: newPathKey, params: pages.params, query: pages.query })
     }

+ 2 - 1
src/components/newThem.less

@@ -8,4 +8,5 @@
 @table-padding-vertical: 5px;
 @table-padding-horizontal: 5px;
 @border-color-base: #dedede;
-@border-color-split: #dedede;
+@border-color-split: #dedede;
+@input-disabled-bg: #dedede;

+ 111 - 1
src/config/router.config.js

@@ -66,7 +66,8 @@ export const asyncRouterMap = [
         component: () => import(/* webpackChunkName: "home" */ '@/views/productManagement/newProduct/detail'),
         meta: {
           title: '产品详情',
-          icon: 'home'
+          icon: 'home',
+          replaceTab: true
         },
         hidden: true
       },
@@ -233,6 +234,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/salesManagement/productPricing',
+            redirect: '/salesManagement/productPricing/list',
+            name: 'productPricing',
+            component: BlankLayout,
+            meta: {
+              title: '产品报价',
+              icon: 'file-search',
+              permission: 'M_productPricingList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'productPricingList',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/productPricing/list.vue'),
+                meta: {
+                  title: '产品报价列表',
+                  icon: 'file-search',
+                  hidden: true,
+                  permission: 'M_productPricingList'
+                }
+              }
+            ]
+          },
           {
             path: '/salesManagement/giftRecord',
             redirect: '/salesManagement/giftRecord/list',
@@ -360,6 +386,7 @@ export const asyncRouterMap = [
                   title: '采购入库',
                   icon: 'money-collect',
                   hidden: true,
+                  replaceTab: true,
                   permission: 'B_purchaseReceiving'
                 }
               }
@@ -1091,6 +1118,7 @@ export const asyncRouterMap = [
                   title: '出入库明细',
                   icon: 'monitor',
                   hidden: true,
+                  replaceTab: true,
                   permission: 'B_inventoryInventoryQueryStock'
                 }
               }
@@ -1169,6 +1197,7 @@ export const asyncRouterMap = [
                   title: '盘点',
                   icon: 'reconciliation',
                   hidden: true,
+                  replaceTab: true,
                   permission: 'B_inventoryCheckingInventory'
                 }
               }
@@ -1230,6 +1259,7 @@ export const asyncRouterMap = [
                   title: '仓位列表',
                   icon: 'deployment-unit',
                   hidden: true,
+                  replaceTab: true,
                   permission: 'M_inventoryWarehouseStoringLocationList'
                 }
               }
@@ -1691,6 +1721,56 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/purchaseReceiptReport',
+            redirect: '/reportData/purchaseReceiptReport/list',
+            name: 'purchaseReceiptReport',
+            component: BlankLayout,
+            meta: {
+              title: '采购入库报表',
+              icon: 'profile',
+              permission: 'M_purchaseReceiptReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'purchaseReceiptReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/purchaseReceiptReport/list.vue'),
+                meta: {
+                  title: '采购入库报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_purchaseReceiptReportList'
+                }
+              }
+            ]
+          },
+          {
+            path: '/reportData/chainPurchaseReceiptReport',
+            redirect: '/reportData/chainPurchaseReceiptReport/list',
+            name: 'chainPurchaseReceiptReport',
+            component: BlankLayout,
+            meta: {
+              title: '连锁采购入库报表',
+              icon: 'profile',
+              permission: 'M_chainPurchaseReceiptReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'chainPurchaseReceiptReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainPurchaseReceiptReport/list.vue'),
+                meta: {
+                  title: '连锁采购入库报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_chainPurchaseReceiptReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/receivedSendStorageReport',
             redirect: '/reportData/receivedSendStorageReport/list',
@@ -1715,6 +1795,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/reportData/inventoryReport',
+            redirect: '/reportData/inventoryReport/list',
+            name: 'inventoryReport',
+            component: BlankLayout,
+            meta: {
+              title: '盘点报表',
+              icon: 'profile',
+              permission: 'M_inventoryReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'inventoryReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/inventoryReport/list.vue'),
+                meta: {
+                  title: '盘点报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_inventoryReportList'
+                }
+              }
+            ]
           }
         ]
       },
@@ -2333,6 +2438,11 @@ export const constantRouterMap = [
       }
     ]
   },
+  {
+    path: '/updateBrowser',
+    name: 'updateBrowser',
+    component: () => import(/* webpackChunkName: "user" */ '@/views/exception/updateBrowser')
+  },
   {
     path: '/404',
     component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')

+ 7 - 2
src/layouts/PageView.vue

@@ -105,17 +105,22 @@ export default {
     const _this = this
     window.onresize = () => {
       return (() => {
-        _this.$store.dispatch('SetWinHeight', window.innerHeight)
         _this.setpageH()
       })()
     }
   },
+  activated () {
+    this.setpageH()
+  },
   updated () {
     this.getPageMeta()
   },
   methods: {
     setpageH () {
-      this.pageHeight = window.innerHeight - 85
+      this.$nextTick(() => {
+        this.$store.dispatch('SetWinHeight', window.innerHeight)
+        this.pageHeight = window.innerHeight - 85
+      })
     },
     getPageMeta () {
       // eslint-disable-next-line

+ 20 - 5
src/libs/JGPrint.js

@@ -38,13 +38,28 @@ export const JGPrint = function (data, type, printerType) {
     }
   } else {
     // 喷墨打印
-    const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
-    document.getElementById('print').innerHTML = '<iframe id="printfsqd" name="printfsqd" src="' + url + '" hidden></iframe>'
+    const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
+    const dlen = data.data.length
+    LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",1);//隐藏打印按钮
+    // LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW",1);//隐藏设置按钮
+    LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
+    LODOP.SET_PRINT_STYLEA(0,"PDFScalMode",1);
+    // const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+    // document.getElementById('print').innerHTML = '<iframe id="printfsqd" name="printfsqd" src="' + url + '" hidden></iframe>'
     if (type == 'preview') { //  预览
-      window.open(url)
+      // window.open(url)
+      console.log(data.data)
+      LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[0])
+      LODOP.SET_PRINT_PAGESIZE(3,2090,0,"");
+      LODOP.PREVIEW()
     } else if (type == 'print') { //  打印
-      window.frames['printfsqd'].focus()
-      window.frames['printfsqd'].print()
+      // window.frames['printfsqd'].focus()
+      // window.frames['printfsqd'].print()
+      for(let i=0;i<dlen;i++){
+        LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[i])
+        LODOP.SET_PRINT_PAGESIZE(3, 2090, 0, '')
+        LODOP.PRINT()
+      }
     }
   }
 }

+ 22 - 2
src/libs/getDate.js

@@ -86,8 +86,18 @@ export default {
     obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format('YYYY-MM-DD')
     return obj
   },
-  // 获取当前月的开始到当天结束时间
+  // 获取上一月的今天到当月的今天
   getCurrMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 1).valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始到当天结束时间
+  getCurrLastMonthDays () {
     const obj = {
       starttime: '',
       endtime: ''
@@ -106,8 +116,18 @@ export default {
     obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD')
     return obj
   },
-  // 获取近三个月的开始结束时间
+  // 获取三月前的今天到当月的今天
   getThreeMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 3).valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 3).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取近三个月的开始结束时间
+  getThreeMonthCurrDays () {
     const obj = {
       starttime: '',
       endtime: ''

+ 13 - 1
src/libs/tools.js

@@ -213,7 +213,19 @@ export const numberToFixed = function (val, num) {
   else _value = _value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
 
   return _value
-}// 只能输入数字
+}
+// 保留两位小数(不四舍五入)
+export const formatDecimal = function (num, decimal) {
+  num = num.toString()
+  const index = num.indexOf('.')
+  if (index !== -1) {
+    num = num.substring(0, decimal + index + 1)
+  } else {
+    num = num.substring(0)
+  }
+  return parseFloat(num).toFixed(decimal)
+}
+// 只能输入数字
 export const justNumber = function (val) {
   let _value = val + ''
   _value = _value.replace(/\D/g, '')

+ 28 - 0
src/libs/versionUpdate.js

@@ -0,0 +1,28 @@
+import axios from 'axios'
+import modal from 'ant-design-vue/es/modal'
+const isNewVersion = () => {
+  let url = `//${window.location.host}/version.json?t=${new Date().getTime()}`;
+  axios.get(url).then(res => {
+    if (res.status === 200) {
+      let vueVersion = res.data.version;
+      let localVueVersion = localStorage.getItem('vueVersion');
+      if (localVueVersion && localVueVersion != vueVersion) {
+        localStorage.setItem('vueVersion', vueVersion);
+        modal.info({
+          title: '提示',
+          content: '发现有新版本发布,将会强制刷新页面!',
+          onOk () {
+            window.location.reload()
+          }
+        })
+        return;
+      } else {
+        localStorage.setItem('vueVersion', vueVersion);
+      }
+    }
+  });
+}
+ 
+export default {
+  isNewVersion
+}

+ 4 - 2
src/permission.js

@@ -7,13 +7,15 @@ import '@/components/NProgress/nprogress.less' // progress bar custom style
 import notification from 'ant-design-vue/es/notification'
 import { setDocumentTitle, domTitle } from '@/utils/domUtil'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
-
+import versionTood from '@/libs/versionUpdate'
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist
+const whiteList = ['login', 'register', 'registerResult','updateBrowser'] // no redirect whitelist
 const defaultRoutePath = '/home'
 
 router.beforeEach((to, from, next) => {
+  //判断当前代码版本是否与服务器中代码版本一致,如不一致则刷新页面获取最新
+  // versionTood.isNewVersion()
 	store.commit('TOGGLE_NOW_ROUTER',to.fullPath)
   NProgress.start() // start progress bar
   to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`))

+ 1 - 1
src/utils/util.js

@@ -3,7 +3,7 @@ export function timeFix () {
   const hour = time.getHours()
   return hour < 9 ? '早上好' : hour <= 11 ? '上午好' : hour <= 13 ? '中午好' : hour < 20 ? '下午好' : '晚上好'
 }
-
+ 
 export function welcome () {
   const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
   const index = Math.floor(Math.random() * arr.length)

+ 21 - 19
src/views/allocationManagement/chainTransferIn/detail.vue

@@ -48,7 +48,6 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
-          :scroll="{ x: 1335 }"
           :defaultLoadData="false"
           bordered>
         </s-table>
@@ -70,31 +69,34 @@ export default {
       spinning: false,
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调入数量', dataIndex: 'putQty', width: 100, 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: 'costSubtotal', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价(¥)', dataIndex: 'putCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调入数量', dataIndex: 'putQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const params = Object.assign(parameter, { allocationLinkagePutSn: this.$route.params.sn })
         this.spinning = true
         return allocLinkagePutDetailList(params).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+            }
+            this.localDataSource = data.list
           }
-          this.getDetailCount(params)
-          this.localDataSource = data.list
           this.spinning = false
           return data
         })

+ 29 - 27
src/views/allocationManagement/chainTransferIn/edit.vue

@@ -77,7 +77,6 @@
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
-          :scroll="{ x: 1110 }"
           bordered>
           <!-- 仓库仓位 -->
           <template slot="warehouse" slot-scope="text, record, index">
@@ -135,15 +134,15 @@ export default {
       warehouseCascadeData: [], //  仓库仓位
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'putCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调入数量', dataIndex: 'putQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本小计', dataIndex: 'costSubtotal', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调入数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本小计', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '16%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -151,25 +150,28 @@ export default {
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam, { allocationLinkagePutSn: this.$route.params.sn })
         return allocLinkagePutDetailList(params).then(res => {
-          this.getDetailCount(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
-            const warehouseSn = data.list[i].warehouseSn || undefined
-            const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
-            data.list[i].warehouseSnBackups = warehouseSn
-            data.list[i].warehouseLocationSnBackups = warehouseLocationSn
-            if (warehouseSn || warehouseLocationSn) {
-              data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
-            } else {
-              data.list[i].warehouseCascade = undefined
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              const warehouseSn = data.list[i].warehouseSn || undefined
+              const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
+              data.list[i].warehouseSnBackups = warehouseSn
+              data.list[i].warehouseLocationSnBackups = warehouseLocationSn
+              if (warehouseSn || warehouseLocationSn) {
+                data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
+              } else {
+                data.list[i].warehouseCascade = undefined
+              }
+              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
             }
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+            this.localDataSource = data.list || []
+            this.disabled = false
           }
-          this.localDataSource = data.list || []
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 21 - 18
src/views/allocationManagement/chainTransferIn/list.vue

@@ -79,7 +79,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1310, y: tableHeight }"
+        :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
         <!-- 连锁调入单号 -->
@@ -139,30 +139,33 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '连锁调入单号', scopedSlots: { customRender: 'allocationLinkagePutNo' }, width: 180, align: 'center' },
-        { title: '调出对象', dataIndex: 'outTenantName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总款数', dataIndex: 'productTotalCategory', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'productTotalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'productTotalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库时间', dataIndex: 'putWarehouseTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨产品类型', dataIndex: 'allocationTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务状态', dataIndex: 'settleStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '连锁调入单号', scopedSlots: { customRender: 'allocationLinkagePutNo' }, width: '16%', align: 'center' },
+        { title: '调出对象', dataIndex: 'outTenantName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库时间', dataIndex: 'putWarehouseTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨产品类型', dataIndex: 'allocationTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return allocLinkagePutList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 12 - 9
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -95,16 +95,19 @@ export default {
         this.disabled = true
         const params = Object.assign(parameter, { allocationLinkageOutSn: this.outBizSn || this.$route.params.sn })
         return allocLinkageOutDetailList(params).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
+            }
+            this.disabled = false
+            this.localDataSource = data.list
           }
-          this.disabled = false
-          this.getDetailCount(params)
-          this.localDataSource = data.list
           return data
         })
       },

+ 15 - 12
src/views/allocationManagement/chainTransferOut/list.vue

@@ -158,29 +158,32 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '连锁调出单号', scopedSlots: { customRender: 'allocationLinkageOutNo' }, width: '12%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '连锁调出单号', scopedSlots: { customRender: 'allocationLinkageOutNo' }, width: '16%', align: 'center' },
         { title: '调往对象', dataIndex: 'putTenantName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总款数', dataIndex: 'productTotalCategory', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'productTotalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨类型', dataIndex: 'allocationTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return allocLinkageOutList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 12 - 7
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -90,14 +90,17 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return storeCallOutDetailList(Object.assign(parameter, { storeCallOutSn: this.outBizSn || this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
+            }
+            this.localDataSource = data.list
           }
-          this.localDataSource = data.list
           this.spinning = false
           return data
         })
@@ -156,6 +159,7 @@ export default {
   },
   mounted () {
     if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新 或 为弹框时调用
+      this.printCostChecked = true
       this.$refs.table.refresh(true)
       this.getDetail()
       this.getDetailCount()
@@ -164,6 +168,7 @@ export default {
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.printCostChecked = true
       this.$refs.table.refresh(true)
       this.getDetail()
       this.getDetailCount()

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

@@ -9,6 +9,7 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra" v-if="$hasPermissions('B_storeCallOutPrint')">
+          <a-checkbox key="4" v-model="printCostChecked">打印成本</a-checkbox>
           <Print :disabled="chooseLoadDataSource.length==0" :showExport="false" @handlePrint="handlePrint"></Print>
         </template>
       </a-page-header>
@@ -285,7 +286,8 @@ export default {
       },
       chooseLoadDataSource: [],
       basicInfoData: null, //  基本信息
-      productTotal: null //  合计
+      productTotal: null, //  合计
+      printCostChecked: true //  打印成本
     }
   },
   methods: {
@@ -306,7 +308,7 @@ export default {
       const _this = this
       _this.spinning = true
       const url = storeCallOutDetailPrint
-      const params = { sn: this.$route.params.sn, type: printerType, costFlag: '0' }
+      const params = { sn: this.$route.params.sn, type: printerType, costFlag: this.printCostChecked ? '1' : '0' }
       // 打印或导出
       hdPrint(printerType, type, url, params, '', function () {
         _this.spinning = false
@@ -476,6 +478,7 @@ export default {
       )
     },
     pageInit () {
+      this.printCostChecked = true
       this.getDetail()
       this.getWarehouseList()
       this.getProductBrand()

+ 8 - 5
src/views/allocationManagement/storeTransferOut/list.vue

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

+ 76 - 68
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -1,68 +1,70 @@
 <template>
   <div class="warehouseAllocationDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationDetail-back" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle" v-if="!outBizSn">
-        <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <a-button
-          v-if="warehouse&&warehouse.stateDictValue!='已完结'&&$hasPermissions('B_warehouseAllocationEdit')"
-          type="primary"
-          size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="warehouseAllocationEdit-btn"
-          @click.stop="handleEdit">
-          编辑
-        </a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="warehouseAllocationDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="调出仓库">{{ (warehouse&&warehouse.outWarehouseName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="调入仓库">{{ (warehouse&&warehouse.putWarehouseName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="调拨单号">{{ (warehouse&&warehouse.allocationWarehouseNo) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="关联单号">{{ (warehouse&&warehouse.relevanceNo) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="单据状态">{{ (warehouse&&warehouse.stateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ (warehouse&&warehouse.remark) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="warehouseAllocationDetail-cont">
-      <!-- 总计 -->
-      <a-alert type="info" style="margin-bottom:10px">
-        <div slot="message">
-          总款数: <strong>{{ productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0) ? productTotal.productTotalCategory : '--' }}</strong> ,
-          总数量: <strong>{{ productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0) ? productTotal.productTotalQty : '--' }}</strong> ,
-          总成本: <strong>{{ productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        bordered>
-        <!-- 产品类别 -->
-        <template slot="productType" slot-scope="text, record">
-          <a-tooltip placement="top">
-            <template slot="title">
-              <span>{{ record.productTypeName }}</span>
-            </template>
-            {{ record.productTypeName3 }}
-          </a-tooltip>
-        </template>
-        <!-- 成本小计 -->
-        <template slot="totalCost" slot-scope="text, record">
-          <span>{{ (record.allocationCost * record.allocationQty) || 0 }}</span>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationDetail-back" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle" v-if="!outBizSn">
+          <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a-button
+            v-if="warehouse&&warehouse.stateDictValue!='已完结'&&$hasPermissions('B_warehouseAllocationEdit')"
+            type="primary"
+            size="small"
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="warehouseAllocationEdit-btn"
+            @click.stop="handleEdit">
+            编辑
+          </a-button>
         </template>
-      </s-table>
-    </a-card>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="warehouseAllocationDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="调出仓库">{{ (warehouse&&warehouse.outWarehouseName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="调入仓库">{{ (warehouse&&warehouse.putWarehouseName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="调拨单号">{{ (warehouse&&warehouse.allocationWarehouseNo) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="关联单号">{{ (warehouse&&warehouse.relevanceNo) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="单据状态">{{ (warehouse&&warehouse.stateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ (warehouse&&warehouse.remark) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="warehouseAllocationDetail-cont">
+        <!-- 总计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            总款数: <strong>{{ productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0) ? productTotal.productTotalCategory : '--' }}</strong> ,
+            总数量: <strong>{{ productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0) ? productTotal.productTotalQty : '--' }}</strong> ,
+            总成本: <strong>{{ productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          bordered>
+          <!-- 产品类别 -->
+          <template slot="productType" slot-scope="text, record">
+            <a-tooltip placement="top">
+              <template slot="title">
+                <span>{{ record.productTypeName }}</span>
+              </template>
+              {{ record.productTypeName3 }}
+            </a-tooltip>
+          </template>
+          <!-- 成本小计 -->
+          <template slot="totalCost" slot-scope="text, record">
+            <span>{{ (record.allocationCost * record.allocationQty) || 0 }}</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -79,6 +81,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       exportLoading: false, // 导出loading
       warehouse: null, // 基础信息
       productTotal: null,
@@ -98,14 +101,19 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return allocWarehouseDetailList(Object.assign(parameter, { allocationWarehouseSn: this.outBizSn || this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getProduceTotal()
+            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.getProduceTotal()
-          this.disabled = false
+          this.spinning = false
           return data
         })
       }

+ 8 - 5
src/views/allocationManagement/warehouseAllocation/list.vue

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

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

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

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

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

+ 8 - 6
src/views/basicData/expenseType/list.vue

@@ -78,12 +78,14 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return costTypeAllQuery({}).then(res => {
-          //  递归去除空children
-          this.recursionFun(res.data)
-          if (res.data.length > 0) {
-            this.defaultExpandedRowKeys[0] = res.data[0].id
-          } else {
-            this.defaultExpandedRowKeys = []
+          if (res.status == 200) {
+            //  递归去除空children
+            this.recursionFun(res.data)
+            if (res.data.length > 0) {
+              this.defaultExpandedRowKeys[0] = res.data[0].id
+            } else {
+              this.defaultExpandedRowKeys = []
+            }
           }
           this.spinning = false
           return res.data

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

@@ -71,10 +71,13 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return storeCallOutTypeList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
           }
           this.spinning = false
           return data

+ 9 - 17
src/views/bulkManagement/bulkImport/list.vue

@@ -71,7 +71,7 @@
 <script>
 import { STable, Upload } from '@/components'
 import { stockImportList, stockImportFinish, stockImportCancel, stockImportExportError } from '@/api/stockImport'
-import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, Upload },
   data () {
@@ -102,10 +102,13 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return stockImportList(Object.assign(parameter, { stockImportSn: this.uploadData && this.uploadData.stockImportSn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
           }
           this.spinning = false
           return data
@@ -197,21 +200,10 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+          downloadExcel(res, '散件导入错误项')
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const fname = '散件导入错误项' + moment('YYYY_MMDD')
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 12 - 7
src/views/bulkManagement/bulkReturnGoods/detailModal.vue

@@ -80,16 +80,21 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         const params = Object.assign(parameter, { sparePartsReturnSn: this.itemSn })
         return sparePartsRetDetailList(params).then(res => {
-          this.getDetailCount(params)
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.dataSource = data.list
+            this.disabled = false
           }
-          this.dataSource = data.list
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },

+ 10 - 5
src/views/bulkManagement/bulkReturnGoods/list.vue

@@ -168,13 +168,18 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return sparePartsRetList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },

+ 13 - 8
src/views/bulkManagement/bulkWarehousingOrder/detail.vue

@@ -121,16 +121,21 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return sparePartsPurDetailList(Object.assign(parameter, { sparePartsPurchaseSn: this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            // 采购金额  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].purchaseAmount = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 采购金额  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].purchaseAmount = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+            }
+            this.localDataSource = data.list
+            this.disabled = false
           }
-          this.localDataSource = data.list
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },

+ 12 - 21
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -139,13 +139,13 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import getDate from '@/libs/getDate.js'
 import basicInfoModal from './basicInfoModal.vue'
 import { sparePartsPurList, sparePartsPurCount, sparePartsPurDel, sparePartsPurPut, sparePartsPurExport } from '@/api/sparePartsPur'
 import { supplierAllList } from '@/api/supplier'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
@@ -188,15 +188,18 @@ export default {
         this.disabled = true
         this.spinning = true
         return sparePartsPurList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(Object.assign(parameter, this.queryParam))
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.dataTotalCount = data.count || 0
           }
-          this.disabled = false
           this.spinning = false
-          this.dataTotalCount = data.count || 0
-          this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
       },
@@ -314,22 +317,10 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+          downloadExcel(res, '散件入库单')
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '散件入库单' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     // 供应商下拉数据
     getSupplierList () {
       supplierAllList().then(res => {

+ 10 - 7
src/views/customerManagement/customerInfo/list.vue

@@ -147,7 +147,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '客户名称', dataIndex: 'customerName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'customerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '联系人', dataIndex: 'contactName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '联系电话', dataIndex: 'contactTel', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '联系手机', dataIndex: 'contactMobile', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -162,13 +162,16 @@ export default {
         this.disabled = true
         this.spinning = true
         return custList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            data.list[i].enabledFlag = data.list[i].enabledFlag + '' === '1'
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].enabledFlag = data.list[i].enabledFlag + '' === '1'
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 74 - 0
src/views/exception/updateBrowser.vue

@@ -0,0 +1,74 @@
+<template>
+  <div class="upbrowser-box">
+    <div>
+      <h1>非常抱歉,当前浏览器由于版本太低,不支持访问系统!</h1>
+      <h3>请仔细阅读以下说明,如有疑问请联系客服,进行技术支持,感谢您的使用!</h3>
+    </div>
+    <div>
+      <h2>一、请使用或安装以下浏览器;</h2>
+      <div>
+        <p><a href="http://browser.360.cn/" target="_blank">360 浏览器</a>,<a href="https://browser.qq.com/" target="_blank">QQ 浏览器</a>或其它国产浏览器 (只支持极速模式),<a href="https://www.google.cn/intl/zh-CN/chrome/" target="_blank">谷歌浏览器</a>,<a href="http://www.firefox.com.cn/" target="_blank">火狐浏览器</a>,Microsoft Edge 等高级浏览器。</p>
+        <p>注意:不支持ie11及其以下版本访问iSCM系统(ie 浏览器微软已经放弃持续更新)。</p>
+      </div>
+      <h2>二、如果使用的是360,QQ或其它国产浏览器,仍然无法访问;</h2>
+      <div>
+        <p>请检查当前浏览器模式是否是极速模式,如下图所示。</p>
+        <p><img src="@/assets/upBrowser/temp1.png"></p>
+      </div>
+      <!-- <h2>三、建议安装使用"iSCM系统"桌面端软件,以便体验更好,更流畅的使用体验;</h2>
+      <div>
+        <h3>桌面端软件安装指南:</h3>
+        <p>1、下载软件</p>
+        <p><a href="https://iscm.360arrow.com/iSCM智慧供应链系统_v0.1.0.exe" target="_blank">点击下载:iSCM智慧供应链系统 Setup 0.1.0</a></p>
+        <p>2、安装软件 </p>
+        <p style="color:red;">注意:(如果被电脑杀毒软件误杀/误报/误拦截的情况,请安装之前先关闭退出杀毒软件,比如360安全卫士,360杀毒软件或其它杀毒软件)</p>
+        <p><img src="@/assets/upBrowser/t1.png"></p>
+        <p><img src="@/assets/upBrowser/t2.png"></p>
+        <p><img src="@/assets/upBrowser/t3.png"></p>
+        <p>3、点击完成打开软件 </p>
+        <p><img width="499px" src="@/assets/upBrowser/t4.png"></p>
+      </div> -->
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'UpdateBrowser',
+  components: {
+  },
+  data () {
+    return {
+    }
+  },
+  created () {
+    document.body.style.background = '#FFFFFF'
+  },
+  methods: {
+    toDownloadDesktop () {
+      this.$router.push({ name: 'login' })
+    }
+  }
+}
+</script>
+
+<style scoped lang="less">
+  .upbrowser-box{
+    width: 800px;
+    margin: 50px auto;
+    font-size: 14px;
+    h2,h1{
+      font-weight: bold;
+    }
+    h2{
+      color: #333;
+    }
+    a{
+      text-decoration: underline;
+      color: #096DD9;
+      &:hover{
+        color: #108EE9;
+      }
+    }
+  }
+</style>

+ 65 - 57
src/views/financialManagement/companyCollectionPayment/detail.vue

@@ -1,56 +1,58 @@
 <template>
   <div class="companyCollectionPaymentDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="companyCollectionPaymentDetail-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="companyCollectionPaymentDetail-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;">单号:{{ (basicInfoData&&basicInfoData.unitSettleNo) || '--' }}</p>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="单位名称">{{ (basicInfoData&&basicInfoData.settleClientName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="单位类型">{{ (basicInfoData&&basicInfoData.settleClientTypeDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="结算类型">{{ (basicInfoData&&basicInfoData.settleTypeDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="应结算金额">{{ (basicInfoData&&(basicInfoData.settleAmount || basicInfoData.settleAmount==0)) ? basicInfoData.settleAmount : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="折让金额">{{ (discountAmount || discountAmount==0) ? discountAmount : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="实结算金额">{{ (basicInfoData&&(basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0)) ? basicInfoData.realSettleAmount : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="结算时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="操作人">{{ (basicInfoData&&basicInfoData.operateName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="结算方式">{{ (basicInfoData&&basicInfoData.settleStyleName) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 收款明细 -->
-    <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="收款明细">
-          <!-- alert -->
-          <a-alert type="info" style="margin-bottom:10px">
-            <div slot="message">
-              共 <strong>{{ total }}</strong> 条明细,
-              金额合计 <strong>{{ (basicInfoData&&(basicInfoData.totalSettleAmount || basicInfoData.totalSettleAmount==0)) ? '¥'+basicInfoData.totalSettleAmount : '--' }}</strong> ,
-              结算金额合计 <strong>{{ (basicInfoData&&(basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0)) ? '¥'+basicInfoData.realSettleAmount : '--' }}</strong>
-            </div>
-          </a-alert>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :defaultLoadData="false"
-            bordered>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="companyCollectionPaymentDetail-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="companyCollectionPaymentDetail-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;">单号:{{ (basicInfoData&&basicInfoData.unitSettleNo) || '--' }}</p>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="单位名称">{{ (basicInfoData&&basicInfoData.settleClientName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="单位类型">{{ (basicInfoData&&basicInfoData.settleClientTypeDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="结算类型">{{ (basicInfoData&&basicInfoData.settleTypeDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="应结算金额">{{ (basicInfoData&&(basicInfoData.settleAmount || basicInfoData.settleAmount==0)) ? basicInfoData.settleAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="折让金额">{{ (discountAmount || discountAmount==0) ? discountAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="实结算金额">{{ (basicInfoData&&(basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0)) ? basicInfoData.realSettleAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="结算时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="操作人">{{ (basicInfoData&&basicInfoData.operateName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="结算方式">{{ (basicInfoData&&basicInfoData.settleStyleName) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 收款明细 -->
+      <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="收款明细">
+            <!-- alert -->
+            <a-alert type="info" style="margin-bottom:10px">
+              <div slot="message">
+                共 <strong>{{ total }}</strong> 条明细,
+                金额合计 <strong>{{ (basicInfoData&&(basicInfoData.totalSettleAmount || basicInfoData.totalSettleAmount==0)) ? '¥'+basicInfoData.totalSettleAmount : '--' }}</strong> ,
+                结算金额合计 <strong>{{ (basicInfoData&&(basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0)) ? '¥'+basicInfoData.realSettleAmount : '--' }}</strong>
+              </div>
+            </a-alert>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :defaultLoadData="false"
+              bordered>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -61,6 +63,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', align: 'center', width: '10%' },
@@ -72,14 +75,19 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return settleUnitDetailList(Object.assign(parameter, { unitSettleSn: this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.total = data.count || 0
           }
-          this.disabled = false
-          this.total = data.count || 0
+          this.spinning = false
           return data
         })
       },

+ 93 - 87
src/views/financialManagement/companyCollectionPayment/list.vue

@@ -1,95 +1,97 @@
 <template>
   <a-card size="small" :bordered="false" class="companyCollectionPaymentList-wrap">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" 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="companyCollectionPaymentList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入单位名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="单位类型">
-              <v-select
-                v-model="queryParam.settleClientType"
-                ref="settleClientType"
-                id="companyCollectionPaymentList-settleClientType"
-                code="SETTLE_CLIENT_TYPE"
-                placeholder="请选择单位类型"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="结算类型">
-              <v-select
-                v-model="queryParam.settleType"
-                ref="settleType"
-                id="companyCollectionPaymentList-settleType"
-                code="SETTLE_TYPE"
-                placeholder="请选择结算类型"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" 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="companyCollectionPaymentList-unitSettleNo" v-model.trim="queryParam.unitSettleNo" allowClear placeholder="请输入结算单号"/>
+              <a-form-item label="单位名称">
+                <a-input id="companyCollectionPaymentList-settleClientName" v-model.trim="queryParam.settleClientName" 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="单位类型">
+                <v-select
+                  v-model="queryParam.settleClientType"
+                  ref="settleClientType"
+                  id="companyCollectionPaymentList-settleClientType"
+                  code="SETTLE_CLIENT_TYPE"
+                  placeholder="请选择单位类型"
+                  allowClear></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="结算方式">
-                <a-select id="companyCollectionPaymentList-settleStyleSn" v-model="queryParam.settleStyleSn" placeholder="请选择结算方式" allowClear>
-                  <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
-                </a-select>
+              <a-form-item label="结算类型">
+                <v-select
+                  v-model="queryParam.settleType"
+                  ref="settleType"
+                  id="companyCollectionPaymentList-settleType"
+                  code="SETTLE_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="companyCollectionPaymentList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="companyCollectionPaymentList-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" style="margin-bottom:10px">
-      <div slot="message">
-        共 <strong>{{ total }}</strong> 条记录,
-        其中收款单 <strong>{{ (productTotal&&(productTotal.receiptCount || productTotal.receiptCount==0)) ? productTotal.receiptCount : '--' }}</strong> 条,
-        收款金额合计 <strong>{{ (productTotal&&(productTotal.receiptAmount || productTotal.receiptAmount==0)) ? '¥'+productTotal.receiptAmount : '--' }}</strong> ,
-        付款单 <strong>{{ (productTotal&&(productTotal.payCount || productTotal.payCount==0)) ? productTotal.payCount : '--' }}</strong> 条,
-        付款金额合计 <strong>{{ (productTotal&&(productTotal.payAmount || productTotal.payAmount==0)) ? '¥'+productTotal.payAmount : '--' }}</strong>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="结算单号">
+                  <a-input id="companyCollectionPaymentList-unitSettleNo" v-model.trim="queryParam.unitSettleNo" 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-select id="companyCollectionPaymentList-settleStyleSn" v-model="queryParam.settleStyleSn" placeholder="请选择结算方式" allowClear>
+                    <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
+                  </a-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="companyCollectionPaymentList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="companyCollectionPaymentList-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>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable fixPagination"
-      ref="table"
-      :style="{ height: tableHeight+84.5+'px' }"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ y: tableHeight }"
-      :defaultLoadData="false"
-      bordered>
-      <!-- 结算单号 -->
-      <template slot="unitSettleNo" slot-scope="text, record">
-        <span :class="$hasPermissions('M_companyCollectionPayment_detail')?'active':'common'" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
-      </template>
-    </s-table>
+      <!-- alert -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div slot="message">
+          共 <strong>{{ total }}</strong> 条记录,
+          其中收款单 <strong>{{ (productTotal&&(productTotal.receiptCount || productTotal.receiptCount==0)) ? productTotal.receiptCount : '--' }}</strong> 条,
+          收款金额合计 <strong>{{ (productTotal&&(productTotal.receiptAmount || productTotal.receiptAmount==0)) ? '¥'+productTotal.receiptAmount : '--' }}</strong> ,
+          付款单 <strong>{{ (productTotal&&(productTotal.payCount || productTotal.payCount==0)) ? productTotal.payCount : '--' }}</strong> 条,
+          付款金额合计 <strong>{{ (productTotal&&(productTotal.payAmount || productTotal.payAmount==0)) ? '¥'+productTotal.payAmount : '--' }}</strong>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 结算单号 -->
+        <template slot="unitSettleNo" slot-scope="text, record">
+          <span :class="$hasPermissions('M_companyCollectionPayment_detail')?'active':'common'" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
+        </template>
+      </s-table>
+    </a-spin>
   </a-card>
 </template>
 
@@ -102,6 +104,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
@@ -132,15 +135,18 @@ export default {
         this.disabled = true
         this.spinning = true
         return settleUnitList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(Object.assign(parameter, this.queryParam))
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.total = data.count || 0
           }
-          this.disabled = false
           this.spinning = false
-          this.total = data.count || 0
-          this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
       },

+ 69 - 61
src/views/financialManagement/companyReceivablePayable/chooseBillModal.vue

@@ -8,56 +8,58 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="960">
-    <!-- 搜索条件 -->
-    <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="chooseBillModal-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单据号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="单据类型">
-              <v-select
-                v-model="queryParam.bizType"
-                ref="bizType"
-                id="chooseBillModal-bizType"
-                code="SETTLE_BIZ_TYPE"
-                placeholder="请选择单据类型"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="7" :sm="24">
-            <a-form-item label="审核时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="5" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseBillModal-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="chooseBillModal-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :showPagination="false"
-      :scroll="{ x: '100%', y: 400 }"
-      :defaultLoadData="false"
-      bordered>
-    </s-table>
-    <div class="btn-cont">
-      <a-button type="primary" id="chooseBillModal-modal-save" @click="handleSave">确定</a-button>
-      <a-button id="chooseBillModal-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
+    <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="chooseBillModal-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单据号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单据类型">
+                <v-select
+                  v-model="queryParam.bizType"
+                  ref="bizType"
+                  id="chooseBillModal-bizType"
+                  code="SETTLE_BIZ_TYPE"
+                  placeholder="请选择单据类型"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="7" :sm="24">
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseBillModal-refresh">查询</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="chooseBillModal-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        :scroll="{ x: '100%', y: 400 }"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+      <div class="btn-cont">
+        <a-button type="primary" id="chooseBillModal-modal-save" @click="handleSave">确定</a-button>
+        <a-button id="chooseBillModal-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -86,6 +88,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
       queryParam: {
@@ -106,20 +109,25 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return settleInfoAllList(Object.assign(this.queryParam, { settleClientSn: this.settleClientSn, notEqZero: 1 })).then(res => {
-          const data = res.data
-          this.selectedRowKeys = []
-          this.selectedRows = []
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = i + 1
-            data[i].settleAmount = data[i].unsettleAmount
-            const ind = this.nowChoose.findIndex(item => item.id == data[i].id)
-            if (ind != -1) {
-              this.selectedRowKeys.push(data[i].id)
-              this.selectedRows.push(data[i])
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.selectedRowKeys = []
+            this.selectedRows = []
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+              data[i].settleAmount = data[i].unsettleAmount
+              const ind = this.nowChoose.findIndex(item => item.id == data[i].id)
+              if (ind != -1) {
+                this.selectedRowKeys.push(data[i].id)
+                this.selectedRows.push(data[i])
+              }
             }
+            this.disabled = false
           }
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },

+ 82 - 86
src/views/financialManagement/companyReceivablePayable/detail.vue

@@ -1,76 +1,78 @@
 <template>
   <div class="companyCollectionPaymentDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="companyCollectionPaymentDetail-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="companyCollectionPaymentDetail-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>
-      <!-- 搜索条件 -->
-      <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="companyReceivablePayableDetail-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>
-            </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="companyReceivablePayableDetail-refresh">查询</a-button>
-                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="companyReceivablePayableDetail-reset">重置</a-button>
-                <!-- <a-button
-                  type="danger"
-                  style="margin-left: 8px"
-                  @click="handleExport"
-                  :disabled="disabled"
-                  :loading="exportLoading"
-                  id="companyReceivablePayableDetail-export-btn">导出</a-button> -->
-              </span>
-            </a-col>
-          </a-row>
-        </a-form>
-      </div>
-      <!-- alert -->
-      <a-alert type="info" style="margin-bottom:10px">
-        <div slot="message">
-          共 <strong>{{ total }}</strong> 条明细,
-          金额合计 <strong>{{ (productTotal&&(productTotal.totalAmount || productTotal.totalAmount==0)) ? '¥'+productTotal.totalAmount : '--' }}</strong> ,
-          余额合计 <strong>{{ (productTotal&&(productTotal.unsettleAmount || productTotal.unsettleAmount==0)) ? '¥'+productTotal.unsettleAmount : '--' }}</strong>
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 采购数量 -->
-        <template slot="purchaseNum" slot-scope="text, record">
-          <span>{{ record.purchaseNum }}</span>
-        </template>
-        <!-- 缺货数量 -->
-        <template slot="outOfStockNum" slot-scope="text, record">
-          <span>{{ record.outOfStockNum }}</span>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="companyCollectionPaymentDetail-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="companyCollectionPaymentDetail-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>
-      </s-table>
-    </a-card>
+      </a-page-header>
+      <a-card>
+        <!-- 搜索条件 -->
+        <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="companyReceivablePayableDetail-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>
+              </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="companyReceivablePayableDetail-refresh">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="companyReceivablePayableDetail-reset">重置</a-button>
+                  <!-- <a-button
+                    type="danger"
+                    style="margin-left: 8px"
+                    @click="handleExport"
+                    :disabled="disabled"
+                    :loading="exportLoading"
+                    id="companyReceivablePayableDetail-export-btn">导出</a-button> -->
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- alert -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            共 <strong>{{ total }}</strong> 条明细,
+            金额合计 <strong>{{ (productTotal&&(productTotal.totalAmount || productTotal.totalAmount==0)) ? '¥'+productTotal.totalAmount : '--' }}</strong> ,
+            余额合计 <strong>{{ (productTotal&&(productTotal.unsettleAmount || productTotal.unsettleAmount==0)) ? '¥'+productTotal.unsettleAmount : '--' }}</strong>
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 采购数量 -->
+          <template slot="purchaseNum" slot-scope="text, record">
+            <span>{{ record.purchaseNum }}</span>
+          </template>
+          <!-- 缺货数量 -->
+          <template slot="outOfStockNum" slot-scope="text, record">
+            <span>{{ record.outOfStockNum }}</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
 <script>
-import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { settleInfoList, settleInfoQueryReceiptOrPaySum } from '@/api/settle'
@@ -78,6 +80,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
       queryParam: {
@@ -98,16 +101,21 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         const params = Object.assign(parameter, this.queryParam, { settleClientSn: this.$route.params.sn })
         return settleInfoList(params).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.total = data.count || 0
           }
-          this.disabled = false
-          this.total = data.count || 0
-          this.getTotal(params)
+          this.spinning = false
           return data
         })
       },
@@ -150,20 +158,8 @@ export default {
       this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+	  // downloadExcel(res, '单位应收应付')
       // })
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '单位应收应付' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   mounted () {

+ 82 - 76
src/views/financialManagement/companyReceivablePayable/list.vue

@@ -1,73 +1,75 @@
 <template>
   <a-card size="small" :bordered="false" class="companyReceivablePayableList-wrap">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" 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="companyReceivablePayableList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入单位名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="单位类型">
-              <v-select
-                v-model="queryParam.settleClientType"
-                ref="settleClientType"
-                id="companyReceivablePayableList-settleClientType"
-                code="SETTLE_CLIENT_TYPE"
-                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="companyReceivablePayableList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="companyReceivablePayableList-reset">重置</a-button>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" style="margin-bottom:10px">
-      <div slot="message">
-        共 <strong>{{ total }}</strong> 条记录,
-        应收金额合计 <strong>{{ (productTotal&&(productTotal.receipt || productTotal.receipt==0)) ? '¥'+productTotal.receipt : '--' }}</strong> ,
-        应付金额合计 <strong>¥{{ (productTotal&&productTotal.pay) ? Math.abs(productTotal.pay) : 0 }}</strong>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" 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="companyReceivablePayableList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入单位名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单位类型">
+                <v-select
+                  v-model="queryParam.settleClientType"
+                  ref="settleClientType"
+                  id="companyReceivablePayableList-settleClientType"
+                  code="SETTLE_CLIENT_TYPE"
+                  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="companyReceivablePayableList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="companyReceivablePayableList-reset">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable fixPagination"
-      ref="table"
-      :style="{ height: tableHeight+84.5+'px' }"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ y: tableHeight }"
-      :defaultLoadData="false"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <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>
+      <!-- alert -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div slot="message">
+          共 <strong>{{ total }}</strong> 条记录,
+          应收金额合计 <strong>{{ (productTotal&&(productTotal.receipt || productTotal.receipt==0)) ? '¥'+productTotal.receipt : '--' }}</strong> ,
+          应付金额合计 <strong>¥{{ (productTotal&&productTotal.pay) ? Math.abs(productTotal.pay) : 0 }}</strong>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <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-spin>
   </a-card>
 </template>
 
@@ -78,6 +80,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
       // 查询参数
@@ -99,17 +102,20 @@ export default {
         this.disabled = true
         this.spinning = true
         return settleUnitClientList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            // 应付金额  值为负,应显示为正
-            data.list[i].unSettleAmountPay = Math.abs(data.list[i].unSettleAmountPay) || 0
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(Object.assign(parameter, this.queryParam))
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 应付金额  值为负,应显示为正
+              data.list[i].unSettleAmountPay = Math.abs(data.list[i].unSettleAmountPay) || 0
+            }
+            this.disabled = false
+            this.total = data.count || 0
           }
-          this.disabled = false
           this.spinning = false
-          this.total = data.count || 0
-          this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
       },

+ 15 - 12
src/views/financialManagement/expenseManagement/list.vue

@@ -165,20 +165,23 @@ export default {
         this.disabled = true
         this.spinning = true
         return settleExpenseQuery(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            // 费用类型
+            if (this.costTypeList.length == 0) {
+              this.getCostTypeList()
+            }
+            // 汇总
+            this.totalData.count = data.count
+            this.settleExpenseQuerySum(Object.assign(parameter, this.queryParam))
           }
-          this.disabled = false
           this.spinning = false
-          // 费用类型
-          if (this.costTypeList.length == 0) {
-            this.getCostTypeList()
-          }
-          // 汇总
-          this.totalData.count = data.count
-          this.settleExpenseQuerySum(Object.assign(parameter, this.queryParam))
           return data
         })
       },

+ 26 - 8
src/views/financialManagement/financialCollection/list.vue

@@ -170,16 +170,19 @@ export default {
         this.disabled = true
         this.spinning = true
         return settleReceiptQuery(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.totalData.count = data.count || 0
+            // 查询总计
+            this.settleReceiptQuerySum(Object.assign(parameter, this.queryParam))
           }
-          this.disabled = false
           this.spinning = false
-          this.totalData.count = data.count || 0
-          // 查询总计
-          this.settleReceiptQuerySum(Object.assign(parameter, this.queryParam))
           return data
         })
       },
@@ -367,3 +370,18 @@ export default {
   }
 }
 </script>
+
+<style lang="less">
+	.financialCollectionList-wrap{
+		.financialCollectionList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
+      height: 30px!important;
+		}
+    .financialCollectionList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
+      height: 30px!important;
+    }
+    .financialCollectionList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
+      line-height: 26px!important;
+      height: 30px!important;
+    }
+	}
+</style>

+ 25 - 8
src/views/financialManagement/financialPayment/list.vue

@@ -169,16 +169,19 @@ export default {
         this.disabled = true
         this.spinning = true
         return settlePayQuery(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.totalData.count = data.count || 0
+            // 查询总计
+            this.settlePayQuerySum(Object.assign(parameter, this.queryParam))
           }
-          this.disabled = false
           this.spinning = false
-          this.totalData.count = data.count || 0
-          // 查询总计
-          this.settlePayQuerySum(Object.assign(parameter, this.queryParam))
           return data
         })
       },
@@ -366,3 +369,17 @@ export default {
   }
 }
 </script>
+<style lang="less">
+	.finacialPay-wrap{
+		.finacialPay-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
+      height: 30px!important;
+		}
+    .finacialPay-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
+      height: 30px!important;
+    }
+    .finacialPay-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
+      line-height: 26px!important;
+      height: 30px!important;
+    }
+	}
+</style>

+ 35 - 15
src/views/financialManagement/inventoryCheckAudit/list.vue

@@ -56,12 +56,12 @@
             id="warehousingAudit-adopt-btn">通过</a-button>
           <a-button
             size="small"
-            v-if="record.state=='WAIT_FINANCE_AUDIT' && $hasPermissions('B_inventoryCheckAuditAudit')"
             type="link"
+            v-if="record.state == 'WAIT_FINANCE_AUDIT' && $hasPermissions('B_inventoryCheckingAgain')"
             class="button-warning"
-            @click="handleExamine(record, false)"
-            id="warehousingAudit-unadopt-btn">不通过</a-button>
-          <span v-if="!(record.state=='WAIT_FINANCE_AUDIT' && $hasPermissions('B_inventoryCheckAuditAudit'))">--</span>
+            @click="handleAgain(record)"
+          >重盘</a-button>
+          <span v-if="!(record.state=='WAIT_FINANCE_AUDIT' && ($hasPermissions('B_inventoryCheckAuditAudit') || $hasPermissions('B_inventoryCheckingAgain')))">--</span>
         </template>
       </s-table>
     </a-spin>
@@ -74,7 +74,7 @@
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import inventoryCheckingDetailModal from '@/views/inventoryManagement/inventoryChecking/detailModal.vue'
-import { checkWarehouseAuditList, checkWarehouseFinanceAudit } from '@/api/checkWarehouse'
+import { checkWarehouseAuditList, checkWarehouseFinanceAudit, checkWarehouseReInventory } from '@/api/checkWarehouse'
 export default {
   components: { STable, VSelect, rangeDate, inventoryCheckingDetailModal },
   data () {
@@ -91,29 +91,32 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '17%', align: 'center' },
+        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '15%', align: 'center' },
         { title: '总款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'totalStockCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本', dataIndex: 'totalStockCost', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '盘盈数量', dataIndex: 'totalProfitQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '盘亏数量', scopedSlots: { customRender: 'totalLossQty' }, width: '7%', align: 'center' },
         { title: '盘点完成时间', dataIndex: 'checkTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务审核时间', dataIndex: 'financeAuditTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务审核状态', dataIndex: 'stateDictValue', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
+        { title: '财务审核状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return checkWarehouseAuditList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            data.list[i].financeFinishTime = data.list[i].financeAuditTime
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].financeFinishTime = data.list[i].financeAuditTime
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -159,6 +162,23 @@ export default {
         }
       })
     },
+    // 重盘
+    handleAgain (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '重新盘点后,盘点单状态回退到待提交。确认重新盘点吗?',
+        centered: true,
+        onOk () {
+          checkWarehouseReInventory({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate()

+ 10 - 7
src/views/financialManagement/ledgerRecord/list.vue

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

+ 11 - 6
src/views/financialManagement/warehousingAudit/detail.vue

@@ -81,14 +81,19 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return receivingDetailList(Object.assign(parameter, { receivingBillSn: this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.localDataSource = data.list
+            this.disabled = false
           }
-          this.localDataSource = data.list
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },

+ 15 - 12
src/views/financialManagement/warehousingAudit/list.vue

@@ -138,21 +138,24 @@ export default {
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         return receivingAuditList(params).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            if (data.list[i].auditState == 'WAIT_PUT_WAREHOUSE_AUDIT') {
-              data.list[i].auditStateDictValue = '待审核'
-            } else if (data.list[i].auditState == 'FINISH') {
-              data.list[i].auditStateDictValue = '已审核'
-            } else if (data.list[i].auditState == 'PUT_WAREHOUSE_AUDIT_REJECT') {
-              data.list[i].auditStateDictValue = '审核不通过'
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getTotal(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              if (data.list[i].auditState == 'WAIT_PUT_WAREHOUSE_AUDIT') {
+                data.list[i].auditStateDictValue = '待审核'
+              } else if (data.list[i].auditState == 'FINISH') {
+                data.list[i].auditStateDictValue = '已审核'
+              } else if (data.list[i].auditState == 'PUT_WAREHOUSE_AUDIT_REJECT') {
+                data.list[i].auditStateDictValue = '审核不通过'
+              }
             }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
-          this.getTotal(params)
           return data
         })
       },

+ 59 - 51
src/views/financialManagement/withdrawalManagement/list.vue

@@ -1,51 +1,53 @@
 <template>
   <a-card size="small" :bordered="false" class="withdrawalManagementList-wrap">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" 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="提现时间">
-              <rangeDateTime ref="rangeDate" @change="dateChange" />
-            </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="withdrawalManagementList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="withdrawalManagementList-reset">重置</a-button>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-      <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>
-    <!-- 列表 -->
-    <s-table
-      class="sTable fixPagination"
-      ref="table"
-      :style="{ height: tableHeight+84.5+'px' }"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1320 }"
-      :defaultLoadData="false"
-      bordered>
-    </s-table>
-    <!-- 提现说明 -->
-    <div class="descriptions">
-      <p class="descriptions-tit">提现说明:</p>
-      <ul class="descriptions-list">
-        <li><em>1、</em>提现手续费为元/笔,从可提现余额中扣除。</li>
-        <li><em>2、</em>提现到账时间正常为T+1工作日(例如当天提现,则第二天到账。如果遇到周末或法定节假日,则依次顺延)。</li>
-        <li><em>3、</em>页面上的【可提现余额】包含当天收款但支付公司未清算金额,该部分金额只能在第二天清算后才可提现,如果提示【提现失败】和【账户余额不足】,则表明【可提现金额】中会存在该部分金额,遇到这种情况时,请减少当日提现金额或在次日进行提现。</li>
-        <li><em>4、</em>提现账户为申请开通支付结算账户时所提供的账户信息。</li>
-      </ul>
-    </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" 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="提现时间">
+                <rangeDateTime ref="rangeDate" @change="dateChange" />
+              </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="withdrawalManagementList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="withdrawalManagementList-reset">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <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>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1320 }"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+      <!-- 提现说明 -->
+      <div class="descriptions">
+        <p class="descriptions-tit">提现说明:</p>
+        <ul class="descriptions-list">
+          <li><em>1、</em>提现手续费为元/笔,从可提现余额中扣除。</li>
+          <li><em>2、</em>提现到账时间正常为T+1工作日(例如当天提现,则第二天到账。如果遇到周末或法定节假日,则依次顺延)。</li>
+          <li><em>3、</em>页面上的【可提现余额】包含当天收款但支付公司未清算金额,该部分金额只能在第二天清算后才可提现,如果提示【提现失败】和【账户余额不足】,则表明【可提现金额】中会存在该部分金额,遇到这种情况时,请减少当日提现金额或在次日进行提现。</li>
+          <li><em>4、</em>提现账户为申请开通支付结算账户时所提供的账户信息。</li>
+        </ul>
+      </div>
+    </a-spin>
     <!-- 申请提现 -->
     <cashOutModal :openModal="openModal" :nowData="accountInfo" @ok="handleOk" @close="closeModal" />
   </a-card>
@@ -60,6 +62,7 @@ export default {
   components: { STable, VSelect, rangeDateTime, cashOutModal },
   data () {
     return {
+      spinning: false,
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
@@ -82,13 +85,18 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return satelliteWHWithdrawalList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },

+ 91 - 70
src/views/inventoryManagement/inventoryChecking/detailModal.vue

@@ -34,8 +34,8 @@
             :disabled="localDataSource.length==0"
             @click="handlePrint('export')">导出Excel</a-button>
         </div>
-        <a-descriptions size="small" :column="3">
-          <a-descriptions-item label="盘点单号" :span="3">
+        <a-descriptions size="small" :column="2">
+          <a-descriptions-item label="盘点单号" :span="2">
             {{ (basicInfoData&&basicInfoData.checkWarehouseNo) || '--' }}
             <div style="display: inline-block;margin-left: 10px;">
               <a-tag color="red" v-if="basicInfoData&&basicInfoData.stateDictValue">{{ basicInfoData.stateDictValue }}</a-tag>
@@ -43,7 +43,7 @@
           </a-descriptions-item>
           <a-descriptions-item label="盘点类型">{{ (basicInfoData&&basicInfoData.checkTypeDictValue) || '--' }}</a-descriptions-item>
           <a-descriptions-item label="是否区分仓库" v-if="basicInfoData&&basicInfoData.checkType=='SELECT'">{{ (basicInfoData&&basicInfoData.warehouseFlagDictValue) || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="盘点仓库" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'" :span="3">{{ (basicInfoData&&basicInfoData.warehouseNameList) || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="盘点仓库" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'" :span="2">{{ (basicInfoData&&basicInfoData.warehouseNameList) || '--' }}</a-descriptions-item>
           <a-descriptions-item label="创建人">{{ (basicInfoData&&basicInfoData.creatorName) || '--' }}</a-descriptions-item>
           <a-descriptions-item label="创建时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
           <a-descriptions-item label="审核时间">{{ (basicInfoData&&basicInfoData.checkSuperviseTime) || '--' }}</a-descriptions-item>
@@ -55,11 +55,19 @@
           <div slot="message">
             <div style="display: flex;justify-content: space-between;align-items: center;">
               <div>
-                总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
-                总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
-                总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
-                盘盈数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong> ,
-                盘亏数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>
+                <div>
+                  总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
+                  总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
+                  总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
+                </div>
+                <div>
+                  盘盈总数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong>,
+                  <span v-if="basicInfoData&&basicInfoData.state=='FINISH'">盘盈总成本: <strong>{{ productTotal&&(productTotal.checkProfitCost || productTotal.checkProfitCost==0) ? productTotal.checkProfitCost : '--' }}</strong>,</span>
+                  盘亏总数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>,
+                  <span v-if="basicInfoData&&basicInfoData.state=='FINISH'">盘亏总成本: <strong>{{ productTotal&&(productTotal.checkLossCost || productTotal.checkLossCost==0) ? productTotal.checkLossCost : '--' }}</strong>,</span>
+                  盈亏总数量: <strong>{{ productTotal&&(productTotal.totalCheckProfitLossQty || productTotal.totalCheckProfitLossQty==0) ? productTotal.totalCheckProfitLossQty : '--' }}</strong>,
+                  <span v-if="basicInfoData&&basicInfoData.state=='FINISH'">盈亏总成本: <strong>{{ productTotal&&(productTotal.totalCheckProfitLossCost || productTotal.totalCheckProfitLossCost==0) ? productTotal.totalCheckProfitLossCost : '--' }}</strong>,</span>
+                </div>
               </div>
               <div>
                 <span style="color: red;display: inline-block;margin-right: 8px;">红色代表盘盈</span>
@@ -70,42 +78,45 @@
         </a-alert>
         <!-- 筛选条件 -->
         <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="产品编码" prop="productCode">
-                  <a-input id="inventoryCheckMakeInventoryList-productCode" v-model="queryParam.productCode" placeholder="请输入" allowClear />
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品名称" prop="productName">
-                  <a-input id="inventoryCheckMakeInventoryList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品分类">
-                  <ProductType id="inventoryCheckMakeInventoryList-productType" @change="changeProductType" v-model="productType"></ProductType>
-                </a-form-item>
-              </a-col>
-              <template v-if="advanced && (basicInfoData&&basicInfoData.warehouseFlag=='1')">
-                <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
-                  <a-form-item label="仓库">
-                    <a-select id="inventoryCheckMakeInventoryList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                      <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                    </a-select>
+          <div style="display: flex;justify-content: space-between;">
+            <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="产品编码" prop="productCode">
+                    <a-input id="inventoryCheckMakeInventoryList-productCode" v-model="queryParam.productCode" placeholder="请输入" allowClear />
                   </a-form-item>
                 </a-col>
-              </template>
-              <a-col :md="5" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 5px" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
-                  {{ advanced ? '收起' : '展开' }}
-                  <a-icon :type="advanced ? 'up' : 'down'"/>
-                </a>
-              </a-col>
-            </a-row>
-          </a-form>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品名称" prop="productName">
+                    <a-input id="inventoryCheckMakeInventoryList-productName" v-model="queryParam.productName" placeholder="请输入" allowClear />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品分类">
+                    <ProductType id="inventoryCheckMakeInventoryList-productType" @change="changeProductType" v-model="productType"></ProductType>
+                  </a-form-item>
+                </a-col>
+                <template v-if="advanced && (basicInfoData&&basicInfoData.warehouseFlag=='1')">
+                  <a-col :md="6" :sm="24" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                    <a-form-item label="仓库">
+                      <a-select id="inventoryCheckMakeInventoryList-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                        <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                </template>
+                <a-col :md="5" :sm="24" style="margin-bottom: 10px;">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+                  <a @click="advanced=!advanced" style="margin-left: 5px" v-if="basicInfoData&&basicInfoData.warehouseFlag=='1'">
+                    {{ advanced ? '收起' : '展开' }}
+                    <a-icon :type="advanced ? 'up' : 'down'"/>
+                  </a>
+                </a-col>
+              </a-row>
+            </a-form>
+            <div style="flex-shrink: 0;margin-left: 5px;"><a-checkbox v-model="isPrice"><span style="display: inline-block;margin-top: 1px;">仅显示盈亏</span></a-checkbox></div>
+          </div>
         </div>
         <!-- 列表 -->
         <s-table
@@ -128,6 +139,10 @@
           <template slot="checkProfitLossQty" slot-scope="text, record">
             <span :style="{ color: record.checkProfitLossQty>0?'red':record.checkProfitLossQty<0?'green':'', fontWeight: record.checkProfitLossQty!=0?'bold':'' }">{{ (record.checkProfitLossQty || record.checkProfitLossQty==0) ? Math.abs(record.checkProfitLossQty) : '--' }}</span>
           </template>
+          <!-- 盈亏成本 -->
+          <template slot="checkProfitLossCost" slot-scope="text, record">
+            <span :style="{ color: record.checkProfitLossCost>0?'red':record.checkProfitLossCost<0?'green':'', fontWeight: record.checkProfitLossCost!=0?'bold':'' }">{{ (record.checkProfitLossCost || record.checkProfitLossCost==0) ? '¥'+formatDecimal(Math.abs(record.checkProfitLossCost), 2) : '--' }}</span>
+          </template>
         </s-table>
       </a-card>
     </a-spin>
@@ -139,10 +154,11 @@
 </template>
 
 <script>
-import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import { STable } from '@/components'
 import printModal from './printModal.vue'
 import ProductType from '@/views/common/productType.js'
+import { formatDecimal } from '@/libs/tools'
 import { checkWarehouseDetailList, checkWarehouseDetail, checkWarehouseDetailCount, checkWarehouseDetailExport, checkWarehouseDetailPrint, checkWarehouseWarehouse } from '@/api/checkWarehouse'
 export default {
   name: 'InventoryCheckingDetailModal',
@@ -174,15 +190,24 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return checkWarehouseDetailList(Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })).then(res => {
-          this.getDetailCount()
-          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.spinning = true
+        const params = Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })
+        if (this.isPrice) {
+          params.profitLossFlag = 1
+        }
+        return checkWarehouseDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.localDataSource = data.list || []
+            this.disabled = false
           }
-          this.localDataSource = data.list || []
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -191,6 +216,7 @@ export default {
       productType: [],
       warehouseList: [], //  仓库  下拉数据
       localDataSource: [],
+      isPrice: false, //  仅显示盈亏
       openPrintModal: false,
       nowType: null,
       printerType: 'NEEDLE' //  打印机类型
@@ -200,13 +226,14 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '19%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, align: 'center', width: '12%' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, align: 'center', width: '11%' },
         { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '库存数量', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '盘点数量', dataIndex: 'checkQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盈亏数量', scopedSlots: { customRender: 'checkProfitLossQty' }, width: '6%', align: 'center' }
+        { title: '盈亏数量', scopedSlots: { customRender: 'checkProfitLossQty' }, width: '6%', align: 'center' },
+        { title: '盈亏成本', scopedSlots: { customRender: 'checkProfitLossCost' }, width: '6%', align: 'right' }
       ]
       if (this.basicInfoData && this.basicInfoData.warehouseFlag == '1') {
         arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
@@ -216,6 +243,8 @@ export default {
     }
   },
   methods: {
+    // 保留两位小数(不四舍五入)
+    formatDecimal,
     // 详情
     getDetail () {
       checkWarehouseDetail({ sn: this.itemSn }).then(res => {
@@ -227,8 +256,8 @@ export default {
       })
     },
     // 合计
-    getDetailCount () {
-      checkWarehouseDetailCount(Object.assign(this.queryParam, { checkWarehouseSn: this.itemSn })).then(res => {
+    getDetailCount (params) {
+      checkWarehouseDetailCount(params).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
           if (res.data && res.data.checkLossQty) {
@@ -303,7 +332,7 @@ export default {
           reader.readAsText(res)
         } else {
           if (this.nowType == 'export' || this.nowType == 'typeExport') {
-            this.download(res)
+            downloadExcel(res, '库存盘点')
           } else {
             this.print(res, objs.type)
           }
@@ -322,18 +351,6 @@ export default {
         window.frames['printficd'].focus()
         window.frames['printficd'].print()
       }
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存盘点' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   watch: {
@@ -357,9 +374,13 @@ export default {
     },
     itemSn (newValue, oldValue) {
       if (this.isShow && newValue) {
+        this.isPrice = false
         this.getDetail()
         this.getWarehouseList()
       }
+    },
+    isPrice (newValue, oldValue) {
+      this.$refs.table.refresh(true)
     }
   }
 }

+ 41 - 11
src/views/inventoryManagement/inventoryChecking/list.vue

@@ -86,6 +86,13 @@
           class="button-warning"
           @click="handleWarehouse(record)"
         >盘点</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state == 'WAIT_CHECK_WAREHOUSE' && $hasPermissions('B_inventoryCheckingAgain')"
+          class="button-warning"
+          @click="handleAgain(record)"
+        >重盘</a-button>
         <a-button
           size="small"
           type="link"
@@ -93,7 +100,10 @@
           class="button-error"
           @click="handleDel(record)"
         >删除</a-button>
-        <span v-if="!((record.state == 'WAIT_SUBMIT') || (record.state == 'AUDIT_REJECT') && ($hasPermissions('B_inventoryCheckingEdit') || $hasPermissions('B_inventoryCheckingDel'))) && !(record.state == 'WAIT_AUDIT' && $hasPermissions('B_inventoryCheckingAudit')) && !(record.state == 'WAIT_CHECK_WAREHOUSE' && $hasPermissions('B_inventoryCheckingInventory'))">--</span>
+        <span
+          v-if="!((record.state == 'WAIT_SUBMIT') || (record.state == 'AUDIT_REJECT') && ($hasPermissions('B_inventoryCheckingEdit') || $hasPermissions('B_inventoryCheckingDel')))
+            && !(record.state == 'WAIT_AUDIT' && $hasPermissions('B_inventoryCheckingAudit'))
+            && !(record.state == 'WAIT_CHECK_WAREHOUSE' && ($hasPermissions('B_inventoryCheckingInventory') || $hasPermissions('B_inventoryCheckingAgain')))">--</span>
       </template>
     </s-table>
     <!-- 基础信息 -->
@@ -111,7 +121,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import inventoryCheckingDetailModal from './detailModal.vue'
-import { checkWarehouseList, checkWarehouseDel, checkWarehouseAudit, checkWarehouseValidate } from '@/api/checkWarehouse'
+import { checkWarehouseList, checkWarehouseDel, checkWarehouseAudit, checkWarehouseValidate, checkWarehouseReInventory } from '@/api/checkWarehouse'
 export default {
   components: { STable, VSelect, rangeDate, auditModal, basicInfoModal, inventoryCheckingDetailModal },
   data () {
@@ -129,12 +139,12 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '16%', align: 'center' },
+        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '15%', align: 'center' },
         { title: '总款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'totalStockCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点类型', dataIndex: 'checkTypeDictValue', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否区分仓库', dataIndex: 'warehouseFlagDictValue', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总成本', dataIndex: 'totalStockCost', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点类型', dataIndex: 'checkTypeDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否区分仓库', dataIndex: 'warehouseFlagDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'checkSuperviseTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -145,12 +155,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return checkWarehouseList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -219,6 +232,23 @@ export default {
     handleWarehouse (row) {
       this.$router.push({ path: `/inventoryManagement/inventoryChecking/makeInventory/${row.id}/${row.checkWarehouseSn}` })
     },
+    // 重盘
+    handleAgain (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '重新盘点后,盘点单状态回退到待提交。确认重新盘点吗?',
+        centered: true,
+        onOk () {
+          checkWarehouseReInventory({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
     //  基本信息  保存
     handleOk (data) {
       this.handleEdit(data)

+ 13 - 22
src/views/inventoryManagement/inventoryChecking/makeInventory.vue

@@ -168,10 +168,10 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import ProductType from '@/views/common/productType.js'
 import printModal from './printModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import { checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseInventory, checkWarehouseDetail, checkWarehouseDetailSave, checkWarehouseCheckZero, checkWarehouseWarehouse, checkWarehouseDetailExport, checkWarehouseDetailPrint } from '@/api/checkWarehouse'
 export default {
   components: { STable, VSelect, ProductType, printModal },
@@ -196,15 +196,18 @@ export default {
         this.disabled = true
         this.spinning = true
         return checkWarehouseDetailList(Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            data.list[i].checkQtyBackups = data.list[i].checkQty
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].checkQtyBackups = data.list[i].checkQty
+            }
+            this.localDataSource = data.list || []
+            this.getProduceTotal()
+            this.disabled = false
           }
-          this.localDataSource = data.list || []
-          this.getProduceTotal()
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -404,7 +407,7 @@ export default {
           reader.readAsText(res)
         } else {
           if (this.nowType == 'export' || this.nowType == 'typeExport') {
-            this.download(res)
+            downloadExcel(res, '库存盘点')
           } else {
             this.print(res, objs.type)
           }
@@ -423,18 +426,6 @@ export default {
         window.frames['printficm'].focus()
         window.frames['printficm'].print()
       }
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存盘点' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   mounted () {

+ 9 - 6
src/views/inventoryManagement/inventoryChecking/overall.vue

@@ -108,13 +108,16 @@ export default {
         this.disabled = true
         this.spinning = true
         return checkWarehouseDetailList(Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.getProduceTotal()
+            this.disabled = false
           }
-          this.getProduceTotal()
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 12 - 20
src/views/inventoryManagement/inventoryImport/list.vue

@@ -13,7 +13,7 @@
           upText="选择导入文件"
           @remove="resetSearchForm"
           @change="changeImport"></Upload>
-        <a :href="filePath" target="_blank" style="margin: 5px 0 0 15px;display: block;float: left;">
+        <a :href="filePath" style="margin: 5px 0 0 15px;display: block;float: left;">
           <a-icon type="download" style="padding-right: 5px;" />下载导入模板
         </a>
       </div>
@@ -72,7 +72,7 @@
 <script>
 import { STable, Upload } from '@/components'
 import { stockImportList, stockImportFinish, stockImportCancel, stockImportKCExportError } from '@/api/stockImport'
-import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, Upload },
   data () {
@@ -96,13 +96,16 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return stockImportList(Object.assign(parameter, { stockImportSn: this.uploadData && this.uploadData.stockImportSn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            const ret = data.list.filter(item => item.isError == 1)
+            this.isAllError = ret.length == data.count
           }
-          const ret = data.list.filter(item => item.isError == 1)
-          this.isAllError = ret.length == data.count
           this.spinning = false
           return data
         })
@@ -191,21 +194,10 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+          downloadExcel(res, '库存导入错误项')
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const fname = '库存导入错误项' + moment('YYYY_MMDD')
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 36 - 28
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -8,28 +8,30 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="960">
-    <!-- 合计 -->
-    <a-alert type="info" style="margin-bottom:10px">
-      <div class="ftext" slot="message">
-        可用库存总数量(个):<strong>{{ currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0) ? currentStock.currentStockQty : '--' }}</strong>;
-        可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? currentStock.currentStockCost : '--' }}</strong>。
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 合计 -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div class="ftext" slot="message">
+          可用库存总数量(个):<strong>{{ currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0) ? currentStock.currentStockQty : '--' }}</strong>;
+          可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? currentStock.currentStockCost : '--' }}</strong>。
+        </div>
+      </a-alert>
+      <!-- 库存详情 -->
+      <s-table
+        v-if="openModal"
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        bordered>
+      </s-table>
+      <div class="btn-cont">
+        <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
       </div>
-    </a-alert>
-    <!-- 库存详情 -->
-    <s-table
-      v-if="openModal"
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ y: 500 }"
-      bordered>
-    </s-table>
-    <div class="btn-cont">
-      <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -58,6 +60,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       // 表头
       columns: [
@@ -75,15 +78,20 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return stockDetailList(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', isSellOut: '0' })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            // 总计
+            this.getTotal(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', isSellOut: '0' }))
           }
-          this.disabled = false
-          // 总计
-          this.getTotal(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', isSellOut: '0' }))
+          this.spinning = false
           return data
         })
       },

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

@@ -123,12 +123,12 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { stockList, stockCount, stockExport } from '@/api/stock'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect, inventoryQueryDetailModal },
   data () {
@@ -186,23 +186,26 @@ export default {
           params.zeroQtyFlag = ''
         }
         return stockList(params).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            // 总计
+            this.getTotal(params)
+            // 产品分类
+            if (this.typeData.length == 0) {
+              this.getProductType()
+            }
+            // 产品品牌
+            if (this.brandData.length == 0) {
+              this.getProductBrand()
+            }
           }
-          this.disabled = false
           this.spinning = false
-          // 总计
-          this.getTotal(params)
-          // 产品分类
-          if (this.typeData.length == 0) {
-            this.getProductType()
-          }
-          // 产品品牌
-          if (this.brandData.length == 0) {
-            this.getProductBrand()
-          }
           return data
         })
       },
@@ -276,22 +279,10 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+		  downloadExcel(res, '库存查询')
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存查询' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     getProductType () {
       dealerProductTypeList({}).then(res => {
         this.recursionFun(res.data)

+ 102 - 94
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -1,96 +1,98 @@
 <template>
   <div class="inventoryQueryWarehouseDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="inventoryQueryWarehouseDetail-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="inventoryQueryWarehouseDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="inventoryQueryWarehouseDetail-cont">
-      <!-- 搜索条件 -->
-      <div ref="tableSearch" 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.flowType"
-                  ref="flowType"
-                  id="warehousingAuditList-flowType"
-                  code="STOCK_FLOW_TYPE"
-                  placeholder="请选择变动类型"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="单据类型">
-                <v-select
-                  v-model="queryParam.bizType"
-                  ref="bizType"
-                  id="inventoryQueryWarehouseDetail-bizType"
-                  code="STOCK_FLOW_BIZ_TYPE"
-                  placeholder="请选择单据类型"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="仓库">
-                <a-select id="inventoryQueryWarehouseDetail-warehouseSn" placeholder="请选择仓库" allowClear v-model="queryParam.warehouseSn" >
-                  <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :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...">
+      <a-page-header :ghost="false" :backIcon="false" class="inventoryQueryWarehouseDetail-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="inventoryQueryWarehouseDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="inventoryQueryWarehouseDetail-cont">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" 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.flowType"
+                    ref="flowType"
+                    id="warehousingAuditList-flowType"
+                    code="STOCK_FLOW_TYPE"
+                    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 label="单据类型">
+                  <v-select
+                    v-model="queryParam.bizType"
+                    ref="bizType"
+                    id="inventoryQueryWarehouseDetail-bizType"
+                    code="STOCK_FLOW_BIZ_TYPE"
+                    placeholder="请选择单据类型"
+                    allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="单位名称">
-                  <a-input id="inventoryQueryWarehouseDetail-unitName" v-model.trim="queryParam.unitName" allowClear placeholder="请输入单位名称"/>
+                <a-form-item label="仓库">
+                  <a-select id="inventoryQueryWarehouseDetail-warehouseSn" placeholder="请选择仓库" allowClear v-model="queryParam.warehouseSn" >
+                    <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                  </a-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="inventoryQueryWarehouseDetail-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryWarehouseDetail-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
-            </a-col>
-          </a-row>
-        </a-form>
-      </div>
-      <!-- 合计 -->
-      <a-alert type="info" style="margin-bottom:10px">
-        <div class="ftext" slot="message">
-          当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.currentStockQty || productTotal.currentStockQty==0)) ? productTotal.currentStockQty : '--' }}</strong>;
-          当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? productTotal.currentStockCost : '--' }}</strong>。
+              <template v-if="advanced">
+                <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="inventoryQueryWarehouseDetail-unitName" v-model.trim="queryParam.unitName" allowClear placeholder="请输入单位名称"/>
+                  </a-form-item>
+                </a-col>
+              </template>
+              <a-col :md="6" :sm="24">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryWarehouseDetail-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryWarehouseDetail-reset">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </a-col>
+            </a-row>
+          </a-form>
         </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+84.5+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 数量 -->
-        <template slot="qty" slot-scope="text, record">
-          <p :class="record.flowType=='PUT' ? 'green':'red'" style="margin: 0;">
-            <span v-if="record.qty!=0">{{ record.flowType=='PUT' ? '+':'-' }}</span>
-            {{ record.qty }}
-          </p>
-        </template>
-      </s-table>
-    </a-card>
+        <!-- 合计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div class="ftext" slot="message">
+            当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.currentStockQty || productTotal.currentStockQty==0)) ? productTotal.currentStockQty : '--' }}</strong>;
+            当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? productTotal.currentStockCost : '--' }}</strong>。
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 数量 -->
+          <template slot="qty" slot-scope="text, record">
+            <p :class="record.flowType=='PUT' ? 'green':'red'" style="margin: 0;">
+              <span v-if="record.qty!=0">{{ record.flowType=='PUT' ? '+':'-' }}</span>
+              {{ record.qty }}
+            </p>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -104,6 +106,7 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -133,20 +136,25 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         const params = Object.assign(parameter, this.queryParam, { productSn: this.$route.params.sn })
         return stockFlowList(params).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            if (data.list[i].flowType == 'PUT') {
-              data.list[i].qty = data.list[i].putQty
-            } else if (data.list[i].flowType == 'OUT') {
-              data.list[i].qty = data.list[i].outQty
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              if (data.list[i].flowType == 'PUT') {
+                data.list[i].qty = data.list[i].putQty
+              } else if (data.list[i].flowType == 'OUT') {
+                data.list[i].qty = data.list[i].outQty
+              }
             }
+            this.disabled = false
+            this.getTotal(params)
           }
-          this.disabled = false
-          this.getTotal(params)
+          this.spinning = false
           return data
         })
       },

+ 16 - 26
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -177,11 +177,11 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { stockWarnList, stockWarnSaveBatch } from '@/api/stockWarn'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect },
   data () {
@@ -225,20 +225,23 @@ export default {
         this.disabled = true
         this.spinning = true
         return stockWarnList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            if (this.selectedRowKeys) { //  处理切换页码后 上页已选已输数据保留
-              const ind = this.selectedRowKeys.indexOf(data.list[i].id)
-              if (ind >= 0) {
-                data.list[i].inTransit = this.selectedRows[ind].inTransit
-                data.list[i].upperLimit = this.selectedRows[ind].upperLimit
-                data.list[i].lowerLimit = this.selectedRows[ind].lowerLimit
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              if (this.selectedRowKeys) { //  处理切换页码后 上页已选已输数据保留
+                const ind = this.selectedRowKeys.indexOf(data.list[i].id)
+                if (ind >= 0) {
+                  data.list[i].inTransit = this.selectedRows[ind].inTransit
+                  data.list[i].upperLimit = this.selectedRows[ind].upperLimit
+                  data.list[i].lowerLimit = this.selectedRows[ind].lowerLimit
+                }
               }
             }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -408,22 +411,9 @@ export default {
       this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+	  // downloadExcel(res, '库存预警')
       // })
     },
-    //  下载
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存预警' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 9 - 4
src/views/inventoryManagement/satelliteWarehouseInventory/addModal.vue

@@ -94,12 +94,17 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        this.spinning = true
         return satelliteWHSupplyList(Object.assign(parameter, { customerSn: this.nowData.customerSn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
           }
+          this.spinning = false
           return data
         })
       },

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

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

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

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

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

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

+ 9 - 6
src/views/outboundOrderManagement/outboundOrder/list.vue

@@ -166,12 +166,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return stockOutList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -373,7 +376,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 205
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
   },
   watch: {

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

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

+ 10 - 6
src/views/power/user/userList.vue

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

+ 2 - 5
src/views/productManagement/newProduct/detail.vue

@@ -100,11 +100,8 @@ export default {
     }
   },
   activated () {
-    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面  (当前产品详情页的上级页分别有 上下线产品列表、箭冠产品列表和采购新增编辑页。因此处判断是否为子页是通过上级页路由路径是否有'/list',故需单独处理)
-    if ((this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) || (this.prevPageInfo && (this.prevPageInfo.name == 'purchaseOrderEdit' || this.prevPageInfo.name == 'purchaseOrderAdd'))) {
-      this.itemId = this.$route.params.sn
-      this.getDetail()
-    }
+    this.itemId = this.$route.params.sn
+    this.getDetail()
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {

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

@@ -150,12 +150,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return queryNewProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: this.$route.params.onlineFalg })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

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

@@ -41,10 +41,13 @@ export default {
       loadData: parameter => {
         this.spinning = true
         return queryNewProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: this.onlineFalg })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
           }
           this.spinning = false
           return data

+ 11 - 19
src/views/productManagement/priceChangeRecord/list.vue

@@ -121,6 +121,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import { productPriceChangeList, getCurrentDealer } from '@/api/product'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -149,13 +150,16 @@ export default {
         this.disabled = true
         this.spinning = true
         return productPriceChangeList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.total = data.count || 0
+            this.disabled = false
           }
-          this.total = data.count || 0
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -282,21 +286,9 @@ export default {
       this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+      // downloadExcel(res, '价格变更记录')
       // })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '价格变更记录' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     //  产品品牌  列表
     getProductBrand () {
       productBrandQuery({}).then(res => {

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

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

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

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

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

@@ -132,12 +132,12 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
 import productInfoDetailModal from './detailModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ProductList',
   components: { STable, VSelect, productInfoDetailModal },
@@ -179,16 +179,19 @@ export default {
         this.disabled = true
         this.spinning = true
         return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
-            const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
-            const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
-            data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
+              const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
+              const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
+              data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -285,22 +288,10 @@ export default {
       this.spinning = true
       dealerProductExport(this.queryParam).then(res => {
         this.exportLoading = false
-        this.download(res)
         this.spinning = false
+        downloadExcel(res, '自建产品列表')
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '自建产品列表' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     //  产品品牌  列表
     getProductBrand () {
       dealerProductBrandQuery({}).then(res => {

+ 10 - 19
src/views/productManagement/productInfoJg/list.vue

@@ -110,11 +110,11 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { productTypeQuery } from '@/api/productType'
 import { productList, getCurrentDealer } from '@/api/product'
 import { STable, VSelect } from '@/components'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ProductJgList',
   components: { STable, VSelect },
@@ -143,12 +143,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -241,21 +244,9 @@ export default {
       this.exportLoading = true
       // dealerProductExport(this.queryParam).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+	  // downloadExcel(res, '箭冠产品列表')
       // })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '箭冠产品列表' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     //  产品品牌  列表
     getProductBrand () {
       dealerProductBrandQuery({ 'sysFlag': '1' }).then(res => {

+ 14 - 10
src/views/productManagement/productOnlineInfo/list.vue

@@ -110,7 +110,7 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { productTypeQuery } from '@/api/productType'
-import { hdPrint } from '@/libs/JGPrint'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import { productList, productExport } from '@/api/product'
 export default {
   name: 'ProductJgList',
@@ -153,12 +153,15 @@ export default {
         this.disabled = true
         this.spinning = true
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })
@@ -205,12 +208,13 @@ export default {
     // 导出
     handleExport () {
       const _this = this
-      _this.spinning = true
+      const params = _this.queryParam
       _this.exportLoading = true
-      // 打印或导出
-      hdPrint('', 'export', productExport, this.queryParam, '产品上线信息', function () {
-        _this.spinning = false
+      _this.spinning = true
+      productExport(params).then(res => {
+        downloadExcel(res, '产品上线信息')
         _this.exportLoading = false
+        _this.spinning = false
       })
     },
     //  产品分类  change

+ 11 - 21
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -139,12 +139,11 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { purchaseDetailBySn, purchaseDetailPrint, purchaseDetailExport, purchaseExportDetail } from '@/api/purchase'
 import { purchaseDetailList } from '@/api/purchaseDetail'
 import Print from '@/views/common/print.vue'
-import { hdPrint } from '@/libs/JGPrint'
+import { hdPrint, downloadExcel } from '@/libs/JGPrint'
 export default {
   components: { STable, VSelect, Print },
   data () {
@@ -168,13 +167,16 @@ export default {
       loadData: parameter => {
         this.disabled = true
         return purchaseDetailList(Object.assign(parameter, { purchaseBillSn: this.$route.params.sn, orderBy: 'product_type.FIRST_CHAR,dealer_product.CODE' })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.localDataSource = data.list
+            this.disabled = false
           }
-          this.localDataSource = data.list
-          this.disabled = false
           return data
         })
       },
@@ -234,21 +236,9 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+          downloadExcel(res, '采购产品')
         }
       })
-    },
-    download (data, type) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '采购产品' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   },
   mounted () {

+ 3 - 12
src/views/purchasingManagement/purchaseOrder/importGuideModal.vue

@@ -66,6 +66,7 @@
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
 import { purchaseDetailDownload } from '@/api/purchase'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ImportGuideModal',
   components: { ChooseImportModal, Upload },
@@ -134,21 +135,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+		  const fileName = '采购单产品导入模板'
+		  downloadExcel(res, fileName)
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const fname = '采购单产品导入模板'
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 8 - 5
src/views/purchasingManagement/purchaseOrder/list.vue

@@ -206,12 +206,15 @@ export default {
         // 获取统计数据
         this.getTotalData(Object.assign(parameter, this.queryParam))
         return purchaseList(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 7 - 2
src/views/purchasingManagement/purchaseOrder/outStockModal.vue

@@ -88,9 +88,14 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return purchaseDetailCancelList(parameter).then(res => {
-          const data = res.data
-          this.disabled = false
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.disabled = false
+          }
+          this.spinning = false
           return data
         })
       },

+ 15 - 10
src/views/purchasingManagement/purchaseOrder/receivingAddress/chooseAddressModal.vue

@@ -110,18 +110,23 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return shippingAddressQuery(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = 0
-          for (var i = 0; i < data.length; i++) {
-            data[i].no = no + i + 1
-            const provinceName = data[i].provinceName ? (data[i].provinceName + '-') : ''
-            const cityName = data[i].cityName ? (data[i].cityName + '-') : ''
-            const countyName = data[i].countyName ? (data[i].countyName + '-') : ''
-            const addr = data[i].addr || ''
-            data[i].address = provinceName + cityName + countyName + addr
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+              const provinceName = data[i].provinceName ? (data[i].provinceName + '-') : ''
+              const cityName = data[i].cityName ? (data[i].cityName + '-') : ''
+              const countyName = data[i].countyName ? (data[i].countyName + '-') : ''
+              const addr = data[i].addr || ''
+              data[i].address = provinceName + cityName + countyName + addr
+            }
+            this.disabled = false
           }
-          this.disabled = false
+          this.spinning = false
           return data
         })
       },

+ 23 - 20
src/views/purchasingManagement/purchaseOrder/warehousing.vue

@@ -107,30 +107,33 @@ export default {
         this.disabled = true
         this.queryParam.receivingBillSn = parameter.tableId
         return receivingDetail(Object.assign(parameter, this.queryParam)).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            data.list[i].shippedQty = data.list[i].putQty
-            const warehouseSn = data.list[i].warehouseSn || undefined
-            const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
-            if (warehouseSn || warehouseLocationSn) {
-              data.list[i].warehouseSnBackups = warehouseSn
-              data.list[i].warehouseLocationSnBackups = warehouseLocationSn
-              data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
-            } else {
-              //  设置默认仓库
-              if (this.defaultWarehouseCascade.length > 0) {
-                data.list[i].warehouseCascade = this.defaultWarehouseCascade
-                data.list[i].warehouseSn = this.defaultWarehouseCascade[0]
-                data.list[i].warehouseLocationSn = this.defaultWarehouseCascade[1]
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].shippedQty = data.list[i].putQty
+              const warehouseSn = data.list[i].warehouseSn || undefined
+              const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
+              if (warehouseSn || warehouseLocationSn) {
+                data.list[i].warehouseSnBackups = warehouseSn
+                data.list[i].warehouseLocationSnBackups = warehouseLocationSn
+                data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
               } else {
-                data.list[i].warehouseCascade = undefined
+                //  设置默认仓库
+                if (this.defaultWarehouseCascade.length > 0) {
+                  data.list[i].warehouseCascade = this.defaultWarehouseCascade
+                  data.list[i].warehouseSn = this.defaultWarehouseCascade[0]
+                  data.list[i].warehouseLocationSn = this.defaultWarehouseCascade[1]
+                } else {
+                  data.list[i].warehouseCascade = undefined
+                }
               }
             }
+            this.disabled = false
+            this.chooseLoadData[parameter.index] = data.list
           }
-          this.disabled = false
-          this.chooseLoadData[parameter.index] = data.list
           return data
         })
       }

+ 64 - 58
src/views/purchasingManagement/purchaseReturn/detail.vue

@@ -1,56 +1,58 @@
 <template>
   <div class="purchaseReturnDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle" v-if="!outBizSn">
-        <a id="purchaseReturnDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <a-button
-          v-if="isEdit"
-          type="primary"
-          size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="purchaseReturnDetail-edit-btn"
-          @click.stop="handleEdit">编辑</a-button>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
-        <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="purchaseReturnDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="客户名称">{{ basicInfoData&&basicInfoData.returnTargetName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="采退单号">{{ basicInfoData&&basicInfoData.purchaseReturnNo || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="创建时间">{{ basicInfoData&&basicInfoData.createDate || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="退货数量">{{ basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0) ? basicInfoData.totalQty : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="坏件数量">{{ basicInfoData&&(basicInfoData.totalBadQty || basicInfoData.totalBadQty == 0) ? basicInfoData.totalBadQty : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="返库数量">{{ basicInfoData&&(basicInfoData.totalBackStockQty || basicInfoData.totalBackStockQty == 0) ? basicInfoData.totalBackStockQty : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="退货金额">{{ basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount == 0) ? basicInfoData.totalAmount : '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 产品详情 -->
-    <a-card size="small" :bordered="false" class="purchaseReturnDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="产品详情">
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle" v-if="!outBizSn">
+          <a id="purchaseReturnDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a-button
+            v-if="isEdit"
+            type="primary"
             size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :defaultLoadData="false"
-            bordered>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="purchaseReturnDetail-edit-btn"
+            @click.stop="handleEdit">编辑</a-button>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
+          <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="客户名称">{{ basicInfoData&&basicInfoData.returnTargetName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="采退单号">{{ basicInfoData&&basicInfoData.purchaseReturnNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建时间">{{ basicInfoData&&basicInfoData.createDate || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货数量">{{ basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0) ? basicInfoData.totalQty : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="坏件数量">{{ basicInfoData&&(basicInfoData.totalBadQty || basicInfoData.totalBadQty == 0) ? basicInfoData.totalBadQty : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="返库数量">{{ basicInfoData&&(basicInfoData.totalBackStockQty || basicInfoData.totalBackStockQty == 0) ? basicInfoData.totalBackStockQty : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货金额">{{ basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount == 0) ? basicInfoData.totalAmount : '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 产品详情 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="产品详情">
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :defaultLoadData="false"
+              bordered>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -70,6 +72,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -89,15 +92,18 @@ export default {
       loadData: parameter => {
         this.disabled = true
         return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.outBizSn || this.$route.params.sn })).then(res => {
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            // 采购金额  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].purchaseReturnAmount = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 采购金额  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].purchaseReturnAmount = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
+            }
+            this.disabled = false
+            this.dataSource = data.list
           }
-          this.disabled = false
-          this.dataSource = data.list
           return data
         })
       },

+ 8 - 5
src/views/purchasingManagement/purchaseReturn/list.vue

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

+ 13 - 10
src/views/reportData/chainCustomerReport/list.vue

@@ -50,7 +50,7 @@
             <template v-if="advanced">
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0!important;">
                         <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
@@ -79,7 +79,7 @@
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <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">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -158,15 +158,18 @@ export default {
         delete params.time
         if (params.beginDate) {
           return reportBigCustomerLinkageList(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
-              data.list[i].percentageUnit = data.list[i].percentage ? data.list[i].percentage + '%' : undefined
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+                data.list[i].percentageUnit = data.list[i].percentage ? data.list[i].percentage + '%' : undefined
+              }
+              this.disabled = false
             }
-            this.disabled = false
             this.spinning = false
             return data
           })

+ 69 - 0
src/views/reportData/chainPurchaseReceiptReport/list.vue

@@ -0,0 +1,69 @@
+<template>
+  <a-card size="small" :bordered="false" class="chainPurchaseReceiptReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 标签页 -->
+      <a-tabs type="card" :default-active-key="nowKey" @change="handleTabChange" class="chainPurchaseReceiptReportList-tabs ">
+        <a-tab-pane v-for="item in tabPaneData" :key="item.val">
+          <span slot="tab">{{ item.name }}</span>
+        </a-tab-pane>
+      </a-tabs>
+      <purchaseReceiptOrder v-show="nowKey=='1'" @spinning="spinningFun" />
+      <purchaseReceiptDetail v-show="nowKey=='2'" @spinning="spinningFun" />
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import purchaseReceiptOrder from './purchaseReceiptOrder.vue'
+import purchaseReceiptDetail from './purchaseReceiptDetail.vue'
+export default {
+  components: { purchaseReceiptOrder, purchaseReceiptDetail },
+  data () {
+    return {
+      spinning: false,
+      tabPaneData: [
+        { name: '采购入库单报表', val: '1' },
+        { name: '采购入库明细报表', val: '2' }
+      ],
+      nowKey: '1'
+    }
+  },
+  methods: {
+    spinningFun (val) {
+      this.spinning = val
+    },
+    // tab切换
+    handleTabChange (key) {
+      this.nowKey = key
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.nowKey = '1'
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.nowKey = '1'
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+	.chainPurchaseReceiptReportList-wrap{
+		.chainPurchaseReceiptReportList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
+      height: 30px!important;
+		}
+    .chainPurchaseReceiptReportList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
+      height: 30px!important;
+    }
+    .chainPurchaseReceiptReportList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
+      line-height: 26px!important;
+      height: 30px!important;
+    }
+	}
+</style>

+ 295 - 0
src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptDetail.vue

@@ -0,0 +1,295 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="chainPurchaseReceiptDetailList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="连锁店" prop="tenantId">
+              <a-select
+                placeholder="请选择连锁店"
+                id="chainPurchaseReceiptDetailList-tenantId"
+                allowClear
+                v-model="queryParam.tenantId"
+                :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="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-item label="产品品牌">
+              <ProductBrand id="chainPurchaseReceiptDetailList-productBrandSn" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品分类">
+                <ProductType id="chainPurchaseReceiptDetailList-productType" @change="changeProductType" v-model="productType"></ProductType>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="salesDetailReportList-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="salesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainPurchaseReceiptDetailList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainPurchaseReceiptDetailList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_chainPurchaseReceiptReportExport')"
+              id="chainPurchaseReceiptDetailList-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-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        采购总数量:<strong>{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</strong>;
+        采购总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        入库总数量:<strong>{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }}</strong>;
+        入库总成本:<strong>{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? '¥'+totalData.putAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { reportChainReceivingBillDetailList, reportChainReceivingBillDetailCount, reportReceivingBillDetailExport, linkageGroupList } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        tenantId: undefined,
+        time: [],
+        beginDate: '',
+        endDate: '',
+        productEntity: {
+          productBrandSn: undefined,
+          productTypeSn1: undefined,
+          productTypeSn2: undefined,
+          productTypeSn3: undefined,
+          code: '',
+          name: ''
+        }
+      },
+      productType: [],
+      rules: {
+        'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, // 高级搜索 展开/关闭
+      exportLoading: false,
+      columns: [
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'putQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'putAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportChainReceivingBillDetailList(params).then(res => {
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
+            }
+            this.$emit('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.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null, //  合计
+      linkageGroupData: []
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportChainReceivingBillDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.tenantId = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      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.productType = []
+      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.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportReceivingBillDetailExport(params).then(res => {
+            downloadExcel(res, '连锁采购入库明细报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          this.linkageGroupData = res.data || []
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

+ 244 - 0
src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptOrder.vue

@@ -0,0 +1,244 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="chainPurchaseReceiptOrderList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="连锁店" prop="tenantId">
+              <a-select
+                placeholder="请选择连锁店"
+                id="chainPurchaseReceiptOrderList-tenantId"
+                allowClear
+                v-model="queryParam.tenantId"
+                :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="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" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainPurchaseReceiptOrderList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainPurchaseReceiptOrderList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_chainPurchaseReceiptReportExport')"
+              id="chainPurchaseReceiptOrderList-export">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        总单数:<strong>{{ (totalData && (totalData.totalPutCategory || totalData.totalPutCategory==0)) ? totalData.totalPutCategory : '--' }}</strong>;
+        采购总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        采购总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        入库总数量:<strong>{{ (totalData && (totalData.totalPutQty || totalData.totalPutQty==0)) ? totalData.totalPutQty : '--' }}</strong>;
+        入库总成本:<strong>{{ (totalData && (totalData.totalPutAmount || totalData.totalPutAmount==0)) ? '¥'+totalData.totalPutAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { reportChainReceivingBillList, reportChainReceivingBillCount, reportReceivingBillExport, linkageGroupList } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        tenantId: undefined,
+        time: [],
+        beginDate: '',
+        endDate: ''
+      },
+      productType: [],
+      rules: {
+        'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库款数', dataIndex: 'totalPutCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'totalPutQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'totalPutAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '16%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportChainReceivingBillList(params).then(res => {
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
+            }
+            this.$emit('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.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null, //  合计
+      linkageGroupData: []
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportChainReceivingBillCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.tenantId = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      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
+      )
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportReceivingBillExport(params).then(res => {
+            downloadExcel(res, '连锁采购入库单报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          this.linkageGroupData = res.data || []
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

+ 56 - 29
src/views/reportData/chainReceivedSendStorageReport/list.vue

@@ -29,8 +29,8 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+              <a-form-model-item label="日期" prop="auditDate">
+                <a-month-picker v-model="queryParam.auditDate" :allowClear="false" @change="onChange" :defaultValue="moment()" style="width: 100%;" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -76,7 +76,16 @@
             <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">
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                v-if="$hasPermissions('B_chainReceivedSendStorageReportExport')"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="sendStorageReportList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -103,8 +112,8 @@
             收入金额:{{ (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 : '--' }}
+            结数量:{{ (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>
@@ -113,22 +122,22 @@
 </template>
 
 <script>
+import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
-import rangeDate from '@/views/common/rangeDate.vue'
-import { linkageReportPageList, linkageReportPageTotal, linkageGroupList } from '@/api/reportData'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { linkageReportPageList, linkageReportPageTotal, linkageGroupList, reportChainStockPutOutExport } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect },
   data () {
     return {
+      moment,
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+        auditDate: moment().format('YYYY-MM'),
         tenantId: undefined,
         productEntity: {
           code: '', //  产品编码
@@ -143,7 +152,7 @@ export default {
       wrapperCol: { span: 16 },
       rules: {
         'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
-        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+        'auditDate': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
@@ -172,16 +181,20 @@ export default {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
-        if (this.queryParam.beginDate && this.queryParam.tenantId) {
+        if (this.queryParam.auditDate && this.queryParam.tenantId) {
+          params.auditDate = this.queryParam.auditDate + '-01'
           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
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
             }
-            this.disabled = false
             this.spinning = false
             return data
           })
@@ -209,11 +222,9 @@ export default {
     }
   },
   methods: {
-    //  时间  change
-    dateChange (date) {
-      this.queryParam.time = date
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+    // 月份  change
+    onChange (date, dateString) {
+      this.queryParam.auditDate = dateString || null
     },
     //  查询
     handleSearch () {
@@ -239,10 +250,7 @@ export default {
     //  重置
     resetSearchForm () {
       this.queryParam.tenantId = undefined
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.time = []
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.auditDate = moment().format('YYYY-MM')
       this.queryParam.productEntity.code = ''
       this.queryParam.productEntity.name = ''
       this.queryParam.productEntity.productBrandSn = undefined
@@ -254,6 +262,25 @@ export default {
       this.totalData = null
       this.$refs.table.clearTable()
     },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          params.auditDate = params.auditDate + '-01'
+          _this.exportLoading = true
+          _this.spinning = true
+          reportChainStockPutOutExport(params).then(res => {
+            downloadExcel(res, '连锁收发存报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''

+ 13 - 10
src/views/reportData/chainSalesDetailReport/list.vue

@@ -118,7 +118,7 @@
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
                         <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省" allowClear>
@@ -144,10 +144,10 @@
                 </a-row>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <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">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -251,14 +251,17 @@ export default {
         delete params.time
         delete params.warehouseCascade
         return reportChainSalesBillDetailList(params).then(res => {
-          // 总计
-          this.getCount(params)
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 12 - 9
src/views/reportData/chainSalesReport/list.vue

@@ -66,7 +66,7 @@
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="8">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
                         <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
@@ -92,7 +92,7 @@
                 </a-row>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <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">
@@ -184,14 +184,17 @@ export default {
         this.spinning = true
         delete params.time
         return reportChainSalesBillList(params).then(res => {
-          // 总计
-          this.getCount(params)
-          const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
           }
-          this.disabled = false
           this.spinning = false
           return data
         })

+ 35 - 32
src/views/reportData/chainStockReport/detailModal.vue

@@ -8,32 +8,29 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="960">
-    <!-- 合计 -->
-    <a-alert type="info" style="margin-bottom:10px">
-      <div class="ftext" slot="message">
-        现有库存总数量(个):<strong> {{ (currentStock && currentStock.totalQty) || 0 }} </strong>;
-        现有库存总成本(¥):<strong> {{ (currentStock && currentStock.totalCost) || 0 }} </strong>。
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 合计 -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div class="ftext" slot="message">
+          可用库存总数量(个):<strong> {{ (currentStock && currentStock.totalQty) || 0 }} </strong>;
+          可用库存总成本(¥):<strong> {{ (currentStock && currentStock.totalCost) || 0 }} </strong>。
+        </div>
+      </a-alert>
+      <!-- 详情 -->
+      <s-table
+        v-if="openModal"
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        bordered>
+      </s-table>
+      <div class="btn-cont">
+        <a-button id="chainStockReportDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
       </div>
-    </a-alert>
-    <!-- 详情 -->
-    <s-table
-      v-if="openModal"
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-      <!-- 库存数量 -->
-      <template slot="currentQty" slot-scope="text, record">
-        {{ (Number(record.currentQty) + Number(record.freezeQty)) || 0 }}
-        <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
-      </template>
-    </s-table>
-    <div class="btn-cont">
-      <a-button id="chainStockReportDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -64,6 +61,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       // 表头
       columns: [
@@ -74,20 +72,25 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: '8%', align: 'center' },
+        { title: '库存数量', dataIndex: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '成本单价', dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        this.spinning = true
         const params = Object.assign(parameter, { productSn: this.productSn, stockSn: this.stockSn })
         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 = no + i + 1
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            // 总计
+            this.getCount(params)
           }
-          // 总计
-          this.getCount(params)
+          this.spinning = false
           return data
         })
       },

+ 14 - 19
src/views/reportData/chainStockReport/list.vue

@@ -87,8 +87,8 @@
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
         <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.currentStockQty || totalData.currentStockQty==0)) ? totalData.currentStockQty : '--' }} </strong>;
+          可用库存总成本(¥):<strong> {{ (totalData && (totalData.currentStockCost || totalData.currentStockCost==0)) ? totalData.currentStockCost : '--' }} </strong>。
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -101,14 +101,6 @@
         :data="loadData"
         :defaultLoadData="false"
         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>
@@ -156,8 +148,8 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: '14%', align: 'center', sorter: true },
-        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: '14%', align: 'center', sorter: true },
+        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '14%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '14%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -167,14 +159,17 @@ export default {
         this.spinning = true
         if (params.tenantId) {
           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
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
             }
-            this.disabled = false
             this.spinning = false
             return data
           })

+ 11 - 8
src/views/reportData/customerReport/list.vue

@@ -141,15 +141,18 @@ export default {
         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
-              data.list[i].percentageUnit = data.list[i].percentage ? data.list[i].percentage + '%' : undefined
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+                data.list[i].percentageUnit = data.list[i].percentage ? data.list[i].percentage + '%' : undefined
+              }
+              this.disabled = false
             }
-            this.disabled = false
             this.spinning = false
             return data
           })

+ 234 - 0
src/views/reportData/inventoryReport/inventoryDetail.vue

@@ -0,0 +1,234 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="inventoryReportList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="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-item label="产品编码">
+              <a-input id="productPricingList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="productPricingList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <ProductBrand id="productPricingList-productBrandSn" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <ProductType id="productPricingList-productType" @change="changeProductType" v-model="productType"></ProductType>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="inventoryReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryReportList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        库存总数量:<strong>{{ (totalData && (totalData.stockQty || totalData.stockQty==0)) ? totalData.stockQty : '--' }}</strong>;
+        盘盈总数量:<strong>{{ (totalData && (totalData.checkProfitQty || totalData.checkProfitQty==0)) ? totalData.checkProfitQty : '--' }}</strong>;
+        盘亏总数量:<strong>{{ (totalData && (totalData.checkLossQty || totalData.checkLossQty==0)) ? totalData.checkLossQty : '--' }}</strong>;
+        盈亏总数量:<strong>{{ (totalData && (totalData.checkProfitLossQty || totalData.checkProfitLossQty==0)) ? totalData.checkProfitLossQty : '--' }}</strong>;
+        盈亏总成本:<strong>{{ (totalData && (totalData.checkProfitLossCost || totalData.checkProfitLossCost==0)) ? '¥'+totalData.checkProfitLossCost : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.checkWarehouseSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { reportCheckWarehouseDetailList, reportCheckWarehouseDetailCount } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      tableHeight: 0,
+      advanced: true, // 高级搜索 展开/关闭
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        productEntity: {
+          name: '',
+          code: '',
+          productBrandSn: undefined,
+          productTypeSn1: '',
+          productTypeSn2: '',
+          productTypeSn3: ''
+        }
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '19%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '库存数量', dataIndex: 'stockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点数量', dataIndex: 'checkQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏数量', dataIndex: 'checkProfitLossQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏总成本', dataIndex: 'checkProfitLossCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportCheckWarehouseDetailList(params).then(res => {
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
+            }
+            this.$emit('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.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null //  合计
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportCheckWarehouseDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

+ 186 - 0
src/views/reportData/inventoryReport/inventoryOrder.vue

@@ -0,0 +1,186 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="inventoryReportList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="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" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="inventoryReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryReportList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        库存总数量:<strong>{{ (totalData && (totalData.totalStockQty || totalData.totalStockQty==0)) ? totalData.totalStockQty : '--' }}</strong>;
+        库存总成本:<strong>{{ (totalData && (totalData.totalStockCost || totalData.totalStockCost==0)) ? '¥'+totalData.totalStockCost : '--' }}</strong>;
+        盘盈总数量:<strong>{{ (totalData && (totalData.totalProfitQty || totalData.totalProfitQty==0)) ? totalData.totalProfitQty : '--' }}</strong>;
+        盘盈总成本:<strong>{{ (totalData && (totalData.totalProfitCost || totalData.totalProfitCost==0)) ? '¥'+totalData.totalProfitCost : '--' }}</strong>;
+        盘亏总数量:<strong>{{ (totalData && (totalData.totalLossQty || totalData.totalLossQty==0)) ? totalData.totalLossQty : '--' }}</strong>;
+        盘亏总成本:<strong>{{ (totalData && (totalData.totalLossCost || totalData.totalLossCost==0)) ? '¥'+totalData.totalLossCost : '--' }}</strong>;
+        盈亏总数量:<strong>{{ (totalData && (totalData.totalProfitLossQty || totalData.totalProfitLossQty==0)) ? totalData.totalProfitLossQty : '--' }}</strong>;
+        盈亏总成本:<strong>{{ (totalData && (totalData.totalProfitLossCost || totalData.totalProfitLossCost==0)) ? '¥'+totalData.totalProfitLossCost : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { reportCheckWarehouseList, reportCheckWarehouseCount } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: ''
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存总数量', dataIndex: 'totalStockQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存总成本', dataIndex: 'totalStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘盈总数量', dataIndex: 'totalProfitQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘盈总成本', dataIndex: 'totalProfitCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘亏总数量', dataIndex: 'totalLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘亏总成本', dataIndex: 'totalLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏总数量', dataIndex: 'totalProfitLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏总成本', dataIndex: 'totalProfitLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportCheckWarehouseList(params).then(res => {
+            let data
+            if (res.status == 200) {
+              data = res.data
+              // 总计
+              this.getCount(params)
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
+            }
+            this.$emit('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.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null //  合计
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportCheckWarehouseCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

Vissa filer visades inte eftersom för många filer har ändrats