Bläddra i källkod

Merge branch 'develop_yh05' of jianguan-web/qpls-md-html into pre-release

李磊 3 år sedan
förälder
incheckning
3ae781aaec
100 ändrade filer med 2651 tillägg och 1407 borttagningar
  1. 16 10
      package-lock.json
  2. 3 2
      package.json
  3. 3 2
      public/version.json
  4. 1 1
      src/api/allocLinkageOut.js
  5. 1 1
      src/api/allocLinkagePut.js
  6. 8 0
      src/api/product.js
  7. 2 2
      src/api/purchaseReturn.js
  8. 233 0
      src/api/reportData.js
  9. 8 0
      src/api/stockOut.js
  10. 8 0
      src/components/index.less
  11. 32 5
      src/components/tools/UserMenu.vue
  12. 273 84
      src/config/router.config.js
  13. 38 7
      src/layouts/BasicLayout.vue
  14. 141 28
      src/libs/JGPrint.js
  15. 3 1
      src/libs/versionUpdate.js
  16. 6 1
      src/store/getters.js
  17. 63 0
      src/store/modules/app.js
  18. 1 1
      src/store/modules/permission.js
  19. 6 0
      src/store/modules/user.js
  20. 3 3
      src/utils/request.js
  21. 25 17
      src/views/allocationManagement/chainTransferIn/detail.vue
  22. 26 16
      src/views/allocationManagement/chainTransferIn/edit.vue
  23. 26 18
      src/views/allocationManagement/chainTransferIn/list.vue
  24. 1 1
      src/views/allocationManagement/chainTransferOut/basicInfoModal.vue
  25. 23 15
      src/views/allocationManagement/chainTransferOut/detail.vue
  26. 58 86
      src/views/allocationManagement/chainTransferOut/edit.vue
  27. 72 33
      src/views/allocationManagement/chainTransferOut/list.vue
  28. 1 1
      src/views/allocationManagement/storeTransferOut/basicInfoModal.vue
  29. 51 17
      src/views/allocationManagement/storeTransferOut/detail.vue
  30. 100 88
      src/views/allocationManagement/storeTransferOut/edit.vue
  31. 70 30
      src/views/allocationManagement/storeTransferOut/list.vue
  32. 1 1
      src/views/allocationManagement/warehouseAllocation/basicInfoModal.vue
  33. 24 15
      src/views/allocationManagement/warehouseAllocation/detail.vue
  34. 11 59
      src/views/allocationManagement/warehouseAllocation/edit.vue
  35. 23 15
      src/views/allocationManagement/warehouseAllocation/list.vue
  36. 1 1
      src/views/basicData/bulkPartsTypeManagement/editModal.vue
  37. 1 1
      src/views/basicData/customerTypeManagement/editModal.vue
  38. 1 1
      src/views/basicData/expenseType/editModal.vue
  39. 1 1
      src/views/basicData/storeTransferOutTypeManagement/editModal.vue
  40. 1 1
      src/views/bulkManagement/bulkReturnGoods/basicInfoModal.vue
  41. 1 1
      src/views/bulkManagement/bulkReturnGoods/detailModal.vue
  42. 47 35
      src/views/bulkManagement/bulkReturnGoods/list.vue
  43. 1 1
      src/views/bulkManagement/bulkWarehousingOrder/basicInfoModal.vue
  44. 1 1
      src/views/bulkManagement/bulkWarehousingOrder/detail.vue
  45. 3 3
      src/views/bulkManagement/bulkWarehousingOrder/edit.vue
  46. 29 31
      src/views/bulkManagement/bulkWarehousingOrder/list.vue
  47. 19 9
      src/views/chainReportData/chainCustomerReport/list.vue
  48. 0 0
      src/views/chainReportData/chainPurchaseReceiptReport/list.vue
  49. 0 0
      src/views/chainReportData/chainPurchaseReceiptReport/purchaseReceiptDetail.vue
  50. 0 0
      src/views/chainReportData/chainPurchaseReceiptReport/purchaseReceiptOrder.vue
  51. 5 47
      src/views/chainReportData/chainReceivedSendStorageReport/list.vue
  52. 177 200
      src/views/chainReportData/chainSalesDetailReport/list.vue
  53. 0 0
      src/views/chainReportData/chainSalesDetailsCountReport/list.vue
  54. 46 0
      src/views/chainReportData/chainSalesReport/index.vue
  55. 140 123
      src/views/chainReportData/chainSalesReport/list.vue
  56. 0 0
      src/views/chainReportData/chainStockExpenditureReport/list.vue
  57. 0 0
      src/views/chainReportData/chainStockIncomeReport/list.vue
  58. 1 1
      src/views/chainReportData/chainStockReport/detailModal.vue
  59. 7 49
      src/views/chainReportData/chainStockReport/list.vue
  60. 1 1
      src/views/common/auditModal.vue
  61. 1 1
      src/views/common/commonModal.vue
  62. 165 0
      src/views/common/outInDetialModal.vue
  63. 50 14
      src/views/common/pdfViewModal.vue
  64. 10 1
      src/views/common/print.vue
  65. 16 2
      src/views/common/productBrand.js
  66. 18 4
      src/views/common/productType.js
  67. 147 0
      src/views/common/selectPrint.vue
  68. 4 9
      src/views/common/settleAccount.js
  69. 3 2
      src/views/common/settleStyle.js
  70. 78 0
      src/views/common/supplier.js
  71. 2 2
      src/views/customerManagement/customerInfo/detailModal.vue
  72. 17 3
      src/views/customerManagement/customerInfo/edit.vue
  73. 8 21
      src/views/financialManagement/companyCollectionPayment/list.vue
  74. 1 1
      src/views/financialManagement/companyReceivablePayable/chooseBillModal.vue
  75. 3 3
      src/views/financialManagement/companyReceivablePayable/collectionPayment.vue
  76. 1 1
      src/views/financialManagement/expenseManagement/detailModal.vue
  77. 3 7
      src/views/financialManagement/expenseManagement/edit.vue
  78. 1 1
      src/views/financialManagement/expenseManagement/list.vue
  79. 1 1
      src/views/financialManagement/financialCollection/detailModal.vue
  80. 11 5
      src/views/financialManagement/financialCollection/list.vue
  81. 1 1
      src/views/financialManagement/financialPayment/detailModal.vue
  82. 8 2
      src/views/financialManagement/financialPayment/list.vue
  83. 1 3
      src/views/financialManagement/fundAccountManagement/addModal.vue
  84. 23 16
      src/views/financialManagement/inventoryCheckAudit/list.vue
  85. 4 4
      src/views/financialManagement/settleModal/settleModal.vue
  86. 26 18
      src/views/financialManagement/warehousingAudit/detail.vue
  87. 23 16
      src/views/financialManagement/warehousingAudit/list.vue
  88. 1 1
      src/views/financialManagement/withdrawalManagement/cashOutModal.vue
  89. 1 1
      src/views/inventoryManagement/inventoryChecking/basicInfoModal.vue
  90. 4 2
      src/views/inventoryManagement/inventoryChecking/detailModal.vue
  91. 24 16
      src/views/inventoryManagement/inventoryChecking/list.vue
  92. 4 2
      src/views/inventoryManagement/inventoryChecking/makeInventory.vue
  93. 4 2
      src/views/inventoryManagement/inventoryChecking/overall.vue
  94. 4 2
      src/views/inventoryManagement/inventoryChecking/printModal.vue
  95. 11 3
      src/views/inventoryManagement/inventoryChecking/selfDisk.vue
  96. 17 10
      src/views/inventoryManagement/inventoryImport/list.vue
  97. 25 16
      src/views/inventoryManagement/inventoryQuery/detailModal.vue
  98. 46 73
      src/views/inventoryManagement/inventoryQuery/list.vue
  99. 31 19
      src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue
  100. 9 55
      src/views/inventoryManagement/inventoryWarning/list.vue

+ 16 - 10
package-lock.json

@@ -12524,10 +12524,10 @@
         "sha.js": "^2.4.8"
       }
     },
-    "pdfjs-dist": {
-      "version": "2.6.347",
-      "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.6.347.tgz",
-      "integrity": "sha512-QC+h7hG2su9v/nU1wEI3SnpPIrqJODL7GTDFvR74ANKGq1AFJW16PH8VWnhpiTi9YcLSFV9xLeWSgq+ckHLdVQ=="
+    "pdfjs-dist-sign": {
+      "version": "2.5.208",
+      "resolved": "https://registry.npmjs.org/pdfjs-dist-sign/-/pdfjs-dist-sign-2.5.208.tgz",
+      "integrity": "sha512-/bOZqdVkq1vQzCJY0qH/d6vO739VJ6X9mF7UWEWJ2WoZJij1+NOl+qTQxNgpXACp07/fhxC3GE/1+IgeDq40kQ=="
     },
     "performance-now": {
       "version": "2.1.0",
@@ -16677,15 +16677,15 @@
       "resolved": "https://registry.npm.taobao.org/vue-ls/download/vue-ls-3.2.1.tgz",
       "integrity": "sha1-JdHHWzpRwXAYEp3mB7RLsSCjOFo="
     },
-    "vue-pdf": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/vue-pdf/-/vue-pdf-4.3.0.tgz",
-      "integrity": "sha512-zd3lJj6CbtrawgaaDDciTDjkJMUKiLWtbEmBg5CvFn9Noe9oAO/GNy/fc5c59qGuFCJ14ibIV1baw4S07e5bSQ==",
+    "vue-pdf-signature": {
+      "version": "4.2.6",
+      "resolved": "https://registry.npmjs.org/vue-pdf-signature/-/vue-pdf-signature-4.2.6.tgz",
+      "integrity": "sha512-+KgBtyXd3phu6qCkGyPfrHtH7gq3xz9+a6KT965fZCexGE53FK3NtwaOXJpBs/wlh0L2pYjD7jqTPYYUWzvVfA==",
       "requires": {
         "babel-plugin-syntax-dynamic-import": "^6.18.0",
         "loader-utils": "^1.4.0",
-        "pdfjs-dist": "2.6.347",
-        "raw-loader": "^4.0.2",
+        "pdfjs-dist-sign": "^2.5.208",
+        "raw-loader": "^4.0.1",
         "vue-resize-sensor": "^2.0.0",
         "worker-loader": "^2.0.0"
       },
@@ -17373,6 +17373,12 @@
       "integrity": "sha512-nCxEZUXfI+DYrdI05wGrKAuO24weIzpn2Emwssm8Yzlw0Q1i1C8xTdFaf8dz60OVgpxy8oPMlfo4pR7UvxLPCQ==",
       "dev": true
     },
+    "webpack-version-plugin": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/webpack-version-plugin/-/webpack-version-plugin-2.0.3.tgz",
+      "integrity": "sha512-sjM2spMYLSK7tTZ0v0sW6UlazJGWeoS4vOYTFMY+GFJiJ9Dv573Ueg94IYffsTLq0g3zgC29v0NHJgkkSemofA==",
+      "dev": true
+    },
     "websocket-driver": {
       "version": "0.7.3",
       "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz",

+ 3 - 2
package.json

@@ -34,7 +34,7 @@
     "vue-cookies": "^1.6.1",
     "vue-cropper": "0.4.9",
     "vue-ls": "^3.2.1",
-    "vue-pdf": "^4.3.0",
+    "vue-pdf-signature": "^4.2.6",
     "vue-qr": "^3.2.2",
     "vue-quill-editor": "^3.0.6",
     "vue-router": "^3.1.2",
@@ -71,7 +71,8 @@
     "vue-svg-icon-loader": "^2.1.1",
     "vue-template-compiler": "^2.6.10",
     "webpack-bundle-analyzer": "^4.5.0",
-    "webpack-theme-color-replacer": "^1.2.17"
+    "webpack-theme-color-replacer": "^1.2.17",
+    "webpack-version-plugin": "^2.0.3"
   },
   "eslintConfig": {
     "root": true,

+ 3 - 2
public/version.json

@@ -1,4 +1,5 @@
 {
-  "version": "1.2.0",
-  "message": "发现有新版本发布,确定更新系统?"
+  "message": "发现有新版本发布,确定更新系统?",
+  "vendorJsVersion": "",
+  "version": 1654054754862
 }

+ 1 - 1
src/api/allocLinkageOut.js

@@ -105,7 +105,7 @@ export const getTenantList = (params) => {
 // 连锁调拨调出 详情  打印
 export const allocLinkageOutDetailPrint = params => {
   const data = {
-    url: `allocLinkageOut/print/${params.sn}/${params.type}`,
+    url: `allocLinkageOut/print/${params.sn}/${params.type}/${params.showFlag}`,
     method: 'get'
   }
   // 喷墨打印

+ 1 - 1
src/api/allocLinkagePut.js

@@ -63,7 +63,7 @@ export const allocLinkagePutDetailUpdate = (params) => {
 // 连锁调拨调入 详情  打印
 export const allocLinkagePutDetailPrint = params => {
   const data = {
-    url: `allocLinkagePut/print/${params.sn}/${params.type}`,
+    url: `allocLinkagePut/print/${params.sn}/${params.type}/${params.showFlag}`,
     method: 'get'
   }
   // 喷墨打印

+ 8 - 0
src/api/product.js

@@ -11,6 +11,14 @@ export const productListPurchase = (params) => {
     method: 'post'
   })
 }
+// 经销商产品 更改状态
+export const productUpdate = params => {
+  return axios({
+    url: '/product/updateEnable',
+    data: params,
+    method: 'post'
+  })
+}
 //  箭冠 产品 列表  分页
 export const productList = (params) => {
   const url = `/product/queryPage/${params.pageNo}/${params.pageSize}`

+ 2 - 2
src/api/purchaseReturn.js

@@ -105,7 +105,7 @@ export const purchaseReturnOutStockBill = (params) => {
 // 采购退货详情  打印
 export const purchaseReturnDetailPrint = params => {
   const data = {
-    url: `/purchaseReturn/print/${params.sn}/${params.type}`,
+    url: `/purchaseReturn/print/${params.sn}/${params.type}/${params.showFlag}`,
     method: 'get'
   }
   // 喷墨打印
@@ -117,7 +117,7 @@ export const purchaseReturnDetailPrint = params => {
 // 采购退货 详情  导出
 export const purchaseReturnDetailExport = params => {
   return axios.request({
-    url: `/purchaseReturn/excel/${params.sn}`,
+    url: `/purchaseReturn/excel/${params.sn}/${params.showFlag}`,
     method: 'get',
     responseType: 'blob'
   })

+ 233 - 0
src/api/reportData.js

@@ -1,4 +1,237 @@
 import { axios } from '@/utils/request'
+// 散件退货-分页列表
+export const reportSparePartsReturnPageList = (params) => {
+  const url = `report/reportSparePartsReturn/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货-列表合计
+export const reportSparePartsReturnTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsReturn/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货-报表导出
+export const reportSparePartsReturnExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsReturn/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+ 
+// 散件退货明细--分页
+export const reportSparePartsReturnDetailPageList = (params) => {
+  const url = `report/reportSparePartsReturnDetail/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货明细-列表合计
+export const reportSparePartsReturnDetailTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsReturnDetail/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货明细-报表导出
+export const reportSparePartsReturnDetailExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsReturnDetail/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 散件入库-分页列表
+export const reportBlukPageList = (params) => {
+  const url = `report/reportSparePartsPurchase/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库-列表合计
+export const reportBlukTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsPurchase/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库-报表导出
+export const reportBlukExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsPurchase/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 散件入库详细-分页列表
+export const reportBlukDetailPageList = (params) => {
+  const url = `report/reportSparePartsPurchaseDetail/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库详细-列表合计
+export const reportBlukDetailTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsPurchaseDetail/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库详细-报表导出
+export const reportBlukDetailExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsPurchaseDetail/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 销售退货-分页列表
+export const reportSalesReturnPageList = (params) => {
+  const url = `report/reportSalesReturnBill/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货-列表合计
+export const reportSalesReturnBillTotal = (params) => {
+  return axios({
+    url: 'report/reportSalesReturnBill/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货-报表导出
+export const reportSalesReturnExport = params => {
+  return axios.request({
+    url: `/report/reportSalesReturnBill/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 销售退货明细-分页列表
+export const reportSalesReturnDetailPageList = (params) => {
+  const url = `report/reportSalesReturnBill/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货明细-列表合计
+export const reportSalesReturnDetailTotal = (params) => {
+  return axios({
+    url: 'report/reportSalesReturnBill/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货明细-报表导出
+export const reportSalesReturnDetailExport = params => {
+  return axios.request({
+    url: `/report/reportSalesReturnBill/detailExport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+
+// 店内调出-分页列表
+export const reportStoreCallOutPageList = (params) => {
+  const url = `report/reportStoreCallOut/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 店内调出-列表合计
+export const reportStoreCallOutListTotal = (params) => {
+  return axios({
+    url: 'report/reportStoreCallOut/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 店内调出-报表导出
+export const reportStoreCallOutExport = params => {
+  return axios.request({
+    url: `/report/reportStoreCallOut/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 店内调出明细-分页列表
+export const reportStoreCallOutDetailList = (params) => {
+  const url = `report/reportStoreCallOut/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 店内调出明细-列表合计
+export const reportStoreCallOutDetailTotal = (params) => {
+  return axios({
+    url: 'report/reportStoreCallOut/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 店内调出明细-报表导出
+export const reportStoreCallOutDetailExport = params => {
+  return axios.request({
+    url: `/report/reportStoreCallOut/detailExport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
 // 连锁收发存报表-分页列表
 export const linkageReportPageList = (params) => {
   const url = `report/reportStockPutOut/linkageReportPage/${params.pageNo}/${params.pageSize}`

+ 8 - 0
src/api/stockOut.js

@@ -27,3 +27,11 @@ export const stockOutBatchOut = (params) => {
     method: 'post'
   })
 }
+// 出入库明细
+export const stockOutDetailList = (params) => {
+  return axios({
+    url: `/stockOut/detail/queryList`,
+    data: params,
+    method: 'post'
+  })
+}

+ 8 - 0
src/components/index.less

@@ -381,6 +381,14 @@
     color: #fff!important;
     -webkit-text-fill-color: #fff!important;
   }
+  .table-td-link{
+    color: #2A86F4;
+    cursor: pointer;
+    &:hover{
+      text-decoration: underline;
+      color: #d62a00;
+    }
+  }
 }
 .sTable.fixPagination{
   >.ant-table-wrapper{

+ 32 - 5
src/components/tools/UserMenu.vue

@@ -8,9 +8,9 @@
       <!-- 通知 -->
       <notice-icon class="action"/>
       <!-- 皮肤设置 -->
-      <!-- <a-popover trigger="click">
-        <div slot="content" :style="{width: fontSize=='small'?'200px':'250px'}">
-          <a-form-model :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+      <a-popover trigger="click">
+        <div slot="content" :style="{width: fontSize == 'large' ? '340px' : '300px'}">
+          <a-form-model :label-col="{ span: 9 }" :wrapper-col="{ span: 15 }">
             <a-form-model-item label="主题">
               <a-radio-group :value="theme" @change="changeTheme">
                 <a-radio-button value="dark">
@@ -34,13 +34,29 @@
                 </a-radio-button>
               </a-radio-group>
             </a-form-model-item>
+            <a-form-model-item label="默认针式打印机">
+              <div style="line-height: normal;padding-top: 10px;">
+                <span style="color: #999;">{{ printName ||'还未设置默认打印机' }}</span>
+                <div style="padding-top: 10px;">
+                  <a-button type="danger" ghost @click="changePrintType('NEEDLE')" size="small">{{ printName ? '点击修改' : '选择打印机' }}</a-button>
+                </div>
+              </div>
+              <!-- <a-radio-group @change="changePrintType">
+                <a-radio-button value="NEEDLE">
+                  选择针式打印机
+                </a-radio-button>
+                <a-radio-button value="INK">
+                  选择喷墨打印机
+                </a-radio-button>
+              </a-radio-group> -->
+            </a-form-model-item>
           </a-form-model>
         </div>
         <span class="skin">
-          <a-icon style="font-size: 15px; padding: 0 3px 0 0" type="skin" />
+          <a-icon style="font-size: 15px; padding: 0 3px 0 0" type="setting" />
           设置
         </span>
-      </a-popover> -->
+      </a-popover>
       <a-dropdown>
         <span class="action ant-dropdown-link user-dropdown-menu">
           <!-- <a-avatar class="avatar" size="small" :src="avatar==''?defaultAvatar:avatar"/> -->
@@ -106,6 +122,10 @@ export default {
       const isPurchaseOrder = this.nowRoute.indexOf('purchaseOrder') > -1 // 当前展示是否为采购单管理模块
       const isPurchaseReturn = this.nowRoute.indexOf('purchaseReturn') > -1 // 当前展示是否为采购退货模块
       return isSaleOrder || isSalesReturn || isPurchaseOrder || isPurchaseReturn
+    },
+    printName () {
+      const defName = this.$store.state.app.printDefNeedle
+      return defName && defName != 'undefined' ? defName : null
     }
   },
   data () {
@@ -180,6 +200,13 @@ export default {
     // 切换字体大小
     changeFontSize (e) {
       this.$store.dispatch('ToggleFontSize', e.target.value)
+    },
+    // 设置打印机
+    changePrintType (type) {
+      this.$store.dispatch('TogglePrintUseing', 0)
+      this.$store.dispatch('TogglePrintSettingType', type)
+      // 选择打印机
+      this.$store.commit('SET_showSelectPrint', true)
     }
   }
 }

+ 273 - 84
src/config/router.config.js

@@ -501,24 +501,24 @@ export const asyncRouterMap = [
           {
             path: '/numsGoodsShelves/withdrawalManagement',
             redirect: '/numsGoodsShelves/withdrawalManagement/list',
-            name: 'withdrawalManagement',
+            name: 'ngsWithdrawalManagement',
             component: BlankLayout,
             meta: {
               title: '提现管理',
               icon: 'monitor',
-              permission: 'M_withdrawalManagement'
+              permission: 'M_NGS_withdrawalManagement'
             },
             hideChildrenInMenu: true,
             children: [
               {
                 path: 'list',
-                name: 'withdrawalManagementList',
+                name: 'ngsWithdrawalManagementList',
                 component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/withdrawalManagement/list.vue'),
                 meta: {
                   title: '提现管理列表',
                   icon: 'monitor',
                   hidden: true
-                  // permission: 'M_salesQueryList'
+                  // permission: 'M_ngsWithdrawalManagementList'
                 }
               }
             ]
@@ -622,7 +622,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'add/:sn',
+                path: 'add/:sn/:dealerSn',
                 name: 'purchaseOrderAdd',
                 component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
                 meta: {
@@ -633,7 +633,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'edit/:sn',
+                path: 'edit/:sn/:dealerSn',
                 name: 'purchaseOrderEdit',
                 component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
                 meta: {
@@ -1828,16 +1828,27 @@ export const asyncRouterMap = [
         children: [
           {
             path: '/reportData/salesReport',
-            redirect: '/reportData/salesReport/list',
+            redirect: '/reportData/salesReport/index',
             name: 'salesReport',
             component: BlankLayout,
             meta: {
               title: '销售报表',
               icon: 'profile',
-              permission: 'M_salesReportList'
+              permission: 'M_salesReportList,M_salesDetailReportList'
             },
             hideChildrenInMenu: true,
             children: [
+              {
+                path: 'index',
+                name: 'salesReportIndex',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReport/index.vue'),
+                meta: {
+                  title: '销售报表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_salesReportList,M_salesDetailReportList'
+                }
+              },
               {
                 path: 'list',
                 name: 'salesReportList',
@@ -1848,21 +1859,7 @@ export const asyncRouterMap = [
                   hidden: true,
                   permission: 'M_salesReportList'
                 }
-              }
-            ]
-          },
-          {
-            path: '/reportData/salesDetailReport',
-            redirect: '/reportData/salesDetailReport/list',
-            name: 'salesDetailReport',
-            component: BlankLayout,
-            meta: {
-              title: '销售明细报表',
-              icon: 'profile',
-              permission: 'M_salesDetailReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
+              },
               {
                 path: 'list',
                 name: 'salesDetailReportList',
@@ -1926,6 +1923,53 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/salesReturnReport',
+            redirect: '/reportData/salesReturnReport/index',
+            name: 'salesReturnReport',
+            component: BlankLayout,
+            meta: {
+              title: '销售退货报表',
+              icon: 'profile',
+              // permission: 'M_salesReturnReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'salesReturnReportIndex',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReturnReport/index.vue'),
+                meta: {
+                  title: '销售退货报表',
+                  icon: 'profile',
+                  hidden: true,
+                  // permission: 'M_salesReturnReportList'
+                }
+              },
+              {
+                path: 'list',
+                name: 'salesReturnReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReturnReport/list.vue'),
+                meta: {
+                  title: '销售退货报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_salesReturnReportList'
+                }
+              },
+              {
+                path: 'list',
+                name: 'salesReturnDetailReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReturnReport/detailList.vue'),
+                meta: {
+                  title: '销售退货明细报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_salesReturnDetailReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/stockIncomeReport',
             redirect: '/reportData/stockIncomeReport/list',
@@ -1976,31 +2020,6 @@ 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/receivedSendStorageReport',
             redirect: '/reportData/receivedSendStorageReport/list',
@@ -2077,46 +2096,216 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainSalesReport',
-            redirect: '/reportData/chainSalesReport/list',
-            name: 'chainSalesReport',
+            path: '/reportData/purchaseReceiptReport',
+            redirect: '/reportData/purchaseReceiptReport/list',
+            name: 'purchaseReceiptReport',
             component: BlankLayout,
             meta: {
-              title: '连锁销售报表',
+              title: '采购入库报表',
               icon: 'profile',
-              permission: 'M_chainSalesReportList'
+              permission: 'M_purchaseReceiptReportList'
             },
             hideChildrenInMenu: true,
             children: [
               {
                 path: 'list',
-                name: 'chainSalesReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainSalesReport/list.vue'),
+                name: 'purchaseReceiptReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/purchaseReceiptReport/list.vue'),
                 meta: {
-                  title: '连锁销售报表列表',
+                  title: '采购入库报表列表',
                   icon: 'profile',
                   hidden: true,
-                  permission: 'M_chainSalesReportList'
+                  permission: 'M_purchaseReceiptReportList'
                 }
               }
             ]
           },
           {
-            path: '/reportData/chainSalesDetailReport',
-            redirect: '/reportData/chainSalesDetailReport/list',
-            name: 'chainSalesDetailReport',
+            path: '/reportData/bulkWarehousingReport',
+            redirect: '/reportData/bulkWarehousingReport/index',
+            name: 'bulkWarehousingReport',
             component: BlankLayout,
             meta: {
-              title: '连锁销售明细报表',
+              title: '散件入库报表',
               icon: 'profile',
-              permission: 'M_chainSalesDetailReportList'
+              // permission: 'M_bulkWarehousingReportList'
             },
             hideChildrenInMenu: true,
             children: [
+              {
+                path: 'index',
+                name: 'bulkWarehousingReportIndex',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/bulkWarehousingReport/index.vue'),
+                meta: {
+                  title: '散件入库报表',
+                  icon: 'profile',
+                  hidden: true,
+                  // permission: 'M_bulkWarehousingReportList'
+                }
+              },
               {
                 path: 'list',
+                name: 'bulkWarehousingReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/bulkWarehousingReport/list.vue'),
+                meta: {
+                  title: '散件入库报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                }
+              },
+              {
+                path: 'list',
+                name: 'bulkWarehousingDetailReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/bulkWarehousingReport/detailList.vue'),
+                meta: {
+                  title: '散件入库明细报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                }
+              }
+            ]
+          },
+          {
+            path: '/reportData/bulkReturnReport',
+            redirect: '/reportData/bulkReturnReport/index',
+            name: 'bulkReturnReport',
+            component: BlankLayout,
+            meta: {
+              title: '散件退货报表',
+              icon: 'profile',
+              // permission: 'M_bulkReturnReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'bulkReturnReportIndex',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/bulkReturnReport/index.vue'),
+                meta: {
+                  title: '散件退货报表',
+                  icon: 'profile',
+                  hidden: true,
+                  // permission: 'M_bulkReturnReportList'
+                }
+              },
+              {
+                path: 'list',
+                name: 'bulkReturnReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/bulkReturnReport/list.vue'),
+                meta: {
+                  title: '散件退货报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                }
+              },
+              {
+                path: 'list',
+                name: 'bulkReturnDetailReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/bulkReturnReport/detailList.vue'),
+                meta: {
+                  title: '散件退货明细报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                }
+              }
+            ]
+          },
+          {
+            path: '/reportData/storeTransferOutReport',
+            redirect: '/reportData/storeTransferOutReport/index',
+            name: 'storeTransferOutReport',
+            component: BlankLayout,
+            meta: {
+              title: '店内调出报表',
+              icon: 'profile',
+              // permission: 'M_storeTransferOutReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'storeTransferOutReportIndex',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/storeTransferOutReport/index.vue'),
+                meta: {
+                  title: '店内调出报表',
+                  icon: 'profile',
+                  hidden: true,
+                  // permission: 'M_storeTransferOutReportList'
+                }
+              },
+              {
+                path: 'list',
+                name: 'storeTransferOutReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/storeTransferOutReport/list.vue'),
+                meta: {
+                  title: '店内调出报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                }
+              },
+              {
+                path: 'list',
+                name: 'storeTransferOutDetailReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/storeTransferOutReport/detailList.vue'),
+                meta: {
+                  title: '店内调出明细报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                }
+              }
+            ]
+          },
+        ]
+      },
+      // 连锁报表
+      {
+        path: '/chainReportData',
+        redirect: '/chainReportData/chainStockReport',
+        component: PageView,
+        meta: {
+          title: '连锁报表',
+          icon: 'fund',
+          permission: 'M_reportData'
+        },
+        children: [
+          {
+            path: '/chainReportData/chainSalesReport',
+            redirect: '/chainReportData/chainSalesReport/index',
+            name: 'chainSalesReport',
+            component: BlankLayout,
+            meta: {
+              title: '连锁销售报表',
+              icon: 'profile',
+              permission: 'M_chainSalesReportList,M_chainSalesDetailReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'chainSalesReportIndex',
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainSalesReport/index.vue'),
+                meta: {
+                  title: '连锁销售报表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_chainSalesReportList,M_chainSalesDetailReportList'
+                }
+              },
+              {
+                path: 'list',
+                name: 'chainSalesReportList',
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainSalesReport/list.vue'),
+                meta: {
+                  title: '连锁销售报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_chainSalesReportList'
+                }
+              },
+              {
+                path: 'detailList',
                 name: 'chainSalesDetailReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainSalesDetailReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainSalesDetailReport/list.vue'),
                 meta: {
                   title: '连锁销售明细报表列表',
                   icon: 'profile',
@@ -2127,8 +2316,8 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainSalesDetailsCountReport',
-            redirect: '/reportData/chainSalesDetailsCountReport/list',
+            path: '/chainReportData/chainSalesDetailsCountReport',
+            redirect: '/chainReportData/chainSalesDetailsCountReport/list',
             name: 'chainSalesDetailsCountReport',
             component: BlankLayout,
             meta: {
@@ -2141,7 +2330,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainSalesDetailsCountReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainSalesDetailsCountReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainSalesDetailsCountReport/list.vue'),
                 meta: {
                   title: '连锁销售明细合计列表',
                   icon: 'profile',
@@ -2152,8 +2341,8 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainCustomerReport',
-            redirect: '/reportData/chainCustomerReport/list',
+            path: '/chainReportData/chainCustomerReport',
+            redirect: '/chainReportData/chainCustomerReport/list',
             name: 'chainCustomerReport',
             component: BlankLayout,
             meta: {
@@ -2166,7 +2355,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainCustomerReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainCustomerReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainCustomerReport/list.vue'),
                 meta: {
                   title: '连锁大客户报表列表',
                   icon: 'profile',
@@ -2177,8 +2366,8 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainStockIncomeReport',
-            redirect: '/reportData/chainStockIncomeReport/list',
+            path: '/chainReportData/chainStockIncomeReport',
+            redirect: '/chainReportData/chainStockIncomeReport/list',
             name: 'chainStockIncomeReport',
             component: BlankLayout,
             meta: {
@@ -2191,7 +2380,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainStockIncomeReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainStockIncomeReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainStockIncomeReport/list.vue'),
                 meta: {
                   title: '连锁库存总入报表列表',
                   icon: 'profile',
@@ -2202,8 +2391,8 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainStockExpenditureReport',
-            redirect: '/reportData/chainStockExpenditureReport/list',
+            path: '/chainReportData/chainStockExpenditureReport',
+            redirect: '/chainReportData/chainStockExpenditureReport/list',
             name: 'chainStockExpenditureReport',
             component: BlankLayout,
             meta: {
@@ -2216,7 +2405,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainStockExpenditureReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainStockExpenditureReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainStockExpenditureReport/list.vue'),
                 meta: {
                   title: '连锁库存总出报表列表',
                   icon: 'profile',
@@ -2227,8 +2416,8 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainStockReport',
-            redirect: '/reportData/chainStockReport/list',
+            path: '/chainReportData/chainStockReport',
+            redirect: '/chainReportData/chainStockReport/list',
             name: 'chainStockReport',
             component: BlankLayout,
             meta: {
@@ -2241,7 +2430,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainStockReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainStockReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainStockReport/list.vue'),
                 meta: {
                   title: '连锁库存总表列表',
                   icon: 'profile',
@@ -2252,8 +2441,8 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainPurchaseReceiptReport',
-            redirect: '/reportData/chainPurchaseReceiptReport/list',
+            path: '/chainReportData/chainPurchaseReceiptReport',
+            redirect: '/chainReportData/chainPurchaseReceiptReport/list',
             name: 'chainPurchaseReceiptReport',
             component: BlankLayout,
             meta: {
@@ -2266,7 +2455,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainPurchaseReceiptReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainPurchaseReceiptReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainPurchaseReceiptReport/list.vue'),
                 meta: {
                   title: '连锁采购入库报表列表',
                   icon: 'profile',
@@ -2277,8 +2466,8 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/reportData/chainReceivedSendStorageReport',
-            redirect: '/reportData/chainReceivedSendStorageReport/list',
+            path: '/chainReportData/chainReceivedSendStorageReport',
+            redirect: '/chainReportData/chainReceivedSendStorageReport/list',
             name: 'chainReceivedSendStorageReport',
             component: BlankLayout,
             meta: {
@@ -2291,7 +2480,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainReceivedSendStorageReportList',
-                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainReceivedSendStorageReport/list.vue'),
+                component: () => import(/* webpackChunkName: "chainReportData" */ '@/views/chainReportData/chainReceivedSendStorageReport/list.vue'),
                 meta: {
                   title: '连锁收发存报表列表',
                   icon: 'profile',

+ 38 - 7
src/layouts/BasicLayout.vue

@@ -45,6 +45,7 @@
           <router-view ></router-view>
         </transition>
       </a-layout-content>
+
       <!-- 视频播放弹窗 -->
       <div v-if="isShowVideoVal">
         <a-modal
@@ -64,6 +65,10 @@
           ></video-player>
         </a-modal>
       </div>
+      <!-- pdf 预览 -->
+      <pdfViewModal ref="pdfview" :openModal="showPdfView" @cancel="showPdfView=false"></pdfViewModal>
+      <!-- 选择打印机 -->
+      <selectPrint ref="selectPrint" :openModal="showSelectPrint" @cancel="showSelectPrint=false"></selectPrint>
       <!-- layout footer -->
       <a-layout-footer>
         <!-- <global-footer /> -->
@@ -82,7 +87,8 @@ import { triggerWindowResizeEvent } from '@/utils/util'
 import { mapState, mapActions, mapGetters } from 'vuex'
 import { mixin, mixinDevice, commonMixin } from '@/utils/mixin'
 import config from '@/config/defaultSettings'
-
+import pdfViewModal from '@/views/common/pdfViewModal.vue'
+import selectPrint from '@/views/common/selectPrint.vue'
 import RouteView from './RouteView'
 import SideMenu from '@/components/Menu/SideMenu'
 import GlobalHeader from '@/components/GlobalHeader'
@@ -104,14 +110,18 @@ export default {
     SideMenu,
     GlobalHeader,
     GlobalFooter,
-    SettingDrawer
+    SettingDrawer,
+    pdfViewModal,
+    selectPrint
   },
   data () {
     return {
       production: config.production,
       collapsed: false,
       menus: [],
-      isRouterAlive: true
+      isRouterAlive: true,
+      showPdfView: false,
+      showSelectPrint: false
     }
   },
   computed: {
@@ -185,6 +195,21 @@ export default {
   watch: {
     sidebarOpened (val) {
       this.collapsed = !val
+    },
+    '$store.state.app.showPdfPrintView' (newValue, oldValue) {
+      console.log(newValue)
+      if (newValue) {
+        this.showPdfView = newValue
+        this.$nextTick(() => {
+          this.$refs.pdfview.setData(this.$store.state.app.pdfPrintList)
+        })
+      }
+    },
+    '$store.state.app.showSelectPrint' (newValue, oldValue) {
+      console.log(newValue)
+      if (newValue) {
+        this.showSelectPrint = newValue
+      }
     }
   },
   created () {
@@ -198,10 +223,9 @@ export default {
     // 重置主题,字体,布局
     this.collapsed = !this.sidebarOpened
     this.$store.dispatch('ToggleMultiTab', true)
-	  this.$store.dispatch('ToggleColor', '#2A86F4')
-    console.log(localStorage.getItem('DEFAULT_THEME'), localStorage.getItem('DEFAULT_FONT_SIZE'))
-    this.$store.dispatch('ToggleTheme', localStorage.getItem('DEFAULT_THEME'))
-    this.$store.dispatch('ToggleFontSize', localStorage.getItem('DEFAULT_FONT_SIZE'))
+    this.$store.dispatch('ToggleColor', '#2A86F4')
+    this.$store.dispatch('ToggleTheme', localStorage.getItem('DEFAULT_THEME') || 'dark')
+    this.$store.dispatch('ToggleFontSize', localStorage.getItem('DEFAULT_FONT_SIZE') || 'small')
     // 判断是否是当月25日后
     this.$store.state.app.isLastDayForMonth = moment().date() >= 25
     if (this.$store.state.app.isLastDayForMonth && this.$hasPermissions('M_mothEndTips')) {
@@ -210,6 +234,13 @@ export default {
         description: `临到月底了,请尽快处理系统中没有完结的单据!`
       })
     }
+    // 打印设置
+    this.$store.commit('SET_pdfPrintList', [])
+    this.$store.commit('SET_showPdfPrint', false)
+    this.$store.commit('SET_showSelectPrint', false)
+    this.$store.commit('SET_printLoading', false)
+    this.$store.commit('SET_printDefNeedle', localStorage.getItem('DEFAULT_PRINT_NEEDLE') || undefined)
+    this.$store.commit('SET_printDefInk', localStorage.getItem('DEFAULT_PRINT_INK') || undefined)
   },
   mounted () {
     const userAgent = navigator.userAgent

+ 141 - 28
src/libs/JGPrint.js

@@ -1,5 +1,7 @@
 import confirm from 'ant-design-vue/es/modal/confirm'
+import { Modal } from 'ant-design-vue'
 import notification from 'ant-design-vue/es/notification'
+import store from '@/store'
 import { getLodop } from '@/libs/LodopFuncs'
 import moment from 'moment'
 // 打印页签,支持批量打印
@@ -12,6 +14,7 @@ export const JGPrintTag = function (html, width, height, data) {
       okText: '立即下载',
       okType: 'danger',
       cancelText: '暂不打印',
+      zIndex: 100000,
       onOk () {
         var agent = navigator.userAgent.toLowerCase();
         if (agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0) {
@@ -83,12 +86,6 @@ export const hdPrint = function (printerType, type, url, params, fileName, callb
   if (type !== 'export') {
     params.type = printerType
   }
-  // 针式预览和喷墨预览一样
-  if (type == 'preview') {
-    // params.type = 'INK'
-    // params.printType = 'INK'
-    // printerType = 'INK'
-  }
   url(params).then(res => {
     console.log(res, type, printerType)
     if (res.type == 'application/json') {
@@ -105,7 +102,8 @@ export const hdPrint = function (printerType, type, url, params, fileName, callb
       if (type == 'export') { //  导出
         downloadExcel(res, fileName)
       } else { // 打印
-        jGPrint(res, type, printerType)
+        const taskName = fileName+'-'+(params.sn||params.checkWarehouseSn||params.settleClientSn)+'-'
+        jGPrint(res, type, printerType, taskName)
       }
     }
     callback()
@@ -120,9 +118,122 @@ export const blobToBaseByPdf = function(data,callback){
     callback(reader.result)
   })
 }
-
+// lodop 打印预览
+export const lodopPrintView = function(data){
+  const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
+  LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
+  // LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true) // 可使输出以纸张边缘为基点
+  // 预览
+  const dlen = data.length
+  LODOP.PRINT_INIT('')
+  if(dlen > 1){
+    LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",1);//隐藏打印按钮
+  }
+  LODOP.SET_PRINTER_INDEX(store.state.app.printDefNeedle)
+  LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data[0])
+  LODOP.SET_PRINT_PAGESIZE(3,2090,dlen>1?0:50,"");
+  LODOP.PREVIEW()
+}
+// 获取打印机列表
+export const getPrintList = function(){
+  const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
+  const printCount = LODOP.GET_PRINTER_COUNT()
+  const printList = []
+  for(let i=0;i<printCount;i++){
+    const pname = LODOP.GET_PRINTER_NAME(i)
+    if(pname.indexOf('Microsoft')<0&&pname.indexOf('OneNote')<0&&pname.indexOf('Fax')<0&&pname.indexOf('导出')<0){
+      printList.push({name:pname,value:i})
+    }
+  }
+  return printList
+}
+// 获取打印机状态
+export const getStatusValue = function (ValueType,ValueIndex,callback){
+		const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
+		if (LODOP.CVERSION) {
+      LODOP.On_Return=function(TaskID,Value){
+        callback(Value)
+      };
+    }
+		var strResult=LODOP.GET_VALUE(ValueType,ValueIndex);
+		if (!LODOP.CVERSION) return callback(strResult); else return callback('');
+	}
+// pdf 直接打印
+export const pdfPrint = function (data,index){
+  const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
+  LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
+  // LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true) // 可使输出以纸张边缘为基点
+  // 开始打印
+  const dlen = data.length
+  // 打印进入队列开始
+  store.commit('SET_printLoading',true)
+  LODOP.PRINT_INIT(store.state.app.printTaskName + (dlen>1 ? ('第'+(index+1)+'页') : ''))
+  //这个语句设置网络共享打印机连接不通时是否提示一下
+  LODOP.SET_PRINT_MODE("TRYLINKPRINTER_NOALERT",true);
+  //执行该语句之后,PRINT指令不再返回那个所谓“打印成功”,才能获取到打印状态
+  LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
+  //TaskID:任务id,Value:job代码
+  LODOP.On_Return=function(TaskID,Value){
+     console.log(TaskID,Value)
+     store.commit('SET_printTaskID',Value)
+     if(index+1 < dlen){
+       pdfPrint(data,index+1)
+     }else{
+       // 打印进入队列结束
+       store.commit('SET_printLoading',false)
+     }
+  };
+  console.log(store.state.app.printDefNeedle)
+  // 指定打印机
+  LODOP.SET_PRINTER_INDEX(store.state.app.printDefNeedle)
+  LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data[index])
+  LODOP.SET_PRINT_PAGESIZE(3, 2090, (index==dlen-1)?50:0, '')
+  LODOP.PRINT()
+}
+// 判断当前单据是否已存在打印任务列表中
+ export const hasExitTaskByName = function(noCallback){
+   const printTaskID = store.state.app.printTaskID
+   const printLoading = store.state.app.printLoading
+   if(printLoading){
+     Modal.info({
+       title: '提示',
+       content: '打印机正在打印中...',
+       okText: '知道了',
+       okType: 'danger',
+       centered: true,
+       zIndex: 100000
+     })
+   }else{
+     if(printTaskID){
+       getStatusValue('PRINT_STATUS_BUSY',printTaskID,function(isExist){
+         console.log(isExist)
+         if(isExist.length){
+           if(isExist != '0'){
+             confirm({
+               title: '提示',
+               content: h => <div style='font-size:14px;'><div>打印机正在打印中或有未完成的打印任务</div><div>是否继续添加打印任务?</div></div>,
+               okText: '继续打印',
+               okType: 'danger',
+               cancelText: '取消',
+               centered: true,
+               zIndex: 100000,
+               onOk () {
+                 noCallback()
+               }
+             })
+           }else{
+             noCallback()
+           }
+         }
+       })
+     }else{
+       noCallback()
+     }
+   }
+ }
 // 打印控件
-export const jGPrint = function (data, type, printerType) {
+export const jGPrint = function (data, type, printerType, taskName) {
+  console.log(data,taskName)
   if (!data) {
     return
   }
@@ -147,27 +258,29 @@ export const jGPrint = function (data, type, printerType) {
       })
       return
     }
-    
-    LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
-    // LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true) // 可使输出以纸张边缘为基点
-    if (type == 'preview') { //  预览
-      const dlen = data.data.length
-      if(dlen > 1){
-        LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",1);//隐藏打印按钮
-      }
-      LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[0])
-      LODOP.SET_PRINT_PAGESIZE(3,2090,dlen>1?0:50,"");
-      LODOP.PREVIEW()
-    } else if (type == 'print') { //  打印
-      const dlen = data.data.length
-      for(let i=0;i<dlen;i++){
-        LODOP.PRINT_INIT("")
-        LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data.data[i])
-        LODOP.SET_PRINT_PAGESIZE(3, 2090, (i==dlen-1)?50:0, '')
-        LODOP.PRINT()
+    // pdf 打印预览
+    if (type == 'preview') { 
+      store.commit('SET_pdfPrintList', data.data)
+      store.commit('SET_showPdfPrint', data.data)
+      store.commit('SET_printTaskName', taskName)
+    } else if (type == 'print') { //  pdf 打印
+      // 选择打印机
+      const printDefNeedle = store.state.app.printDefNeedle
+      const hasPrint = getPrintList().find(item => item.name == printDefNeedle)
+      console.log(printDefNeedle,hasPrint)
+      // 已经设置默认打印机
+      if(hasPrint){
+        hasExitTaskByName(function () {
+          pdfPrint(data.data, 0)
+        })
+      }else{
+        // 没有设置默认打印机时,请选择打印机
+        store.commit('SET_pdfPrintList', data.data)
+        store.commit('SET_printTaskName', taskName)
+        store.commit('SET_printUseing', 1)
+        store.commit('SET_showSelectPrint', true)
       }
     }
-    
   } else {
     // 喷墨打印
     const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))

+ 3 - 1
src/libs/versionUpdate.js

@@ -7,7 +7,9 @@ const isNewVersion = () => {
       const vueVersion = res.data.version
       const message = res.data.message
       const localVueVersion = localStorage.getItem('vueVersion-iscm')
-      if (localVueVersion && localVueVersion != vueVersion) {
+      // 生产环境不比对版本号
+      const production = process.env.NODE_ENV === 'production'
+      if (localVueVersion && localVueVersion != vueVersion && production) {
         localStorage.setItem('vueVersion-iscm', vueVersion)
         modal.info({
           title: '提示',

+ 6 - 1
src/store/getters.js

@@ -13,6 +13,7 @@ const getters = {
   authOrgs: state => state.user.authOrgs,
   changeOrg: state => state.user.changeOrg,
   settleAccountFlag:state => state.user.settleAccountFlag,
+  isShowSpecialPrice: state => state.user.isShowSpecialPrice,
   addRouters: state => state.permission.addRouters,
   multiTab: state => state.app.multiTab,
   lang: state => state.i18n.lang,
@@ -21,7 +22,11 @@ const getters = {
   isNewTab: state => state.app.isNewTab,
   isNewSubTab: state => state.app.isNewSubTab,
   closeTabPages: state => state.app.closeTabPages,
-  loadingStatus: state => state.app.loadingStatus
+  loadingStatus: state => state.app.loadingStatus,
+  printDefNeedle:state => state.app.printDefNeedle,
+  printDefInk:state => state.app.printDefInk,
+  printUseing:state => state.app.printUseing,
+  printSettingType:state => state.app.printSettingType,
 }
 
 export default getters

+ 63 - 0
src/store/modules/app.js

@@ -36,6 +36,16 @@ const app = {
     loadingStatus: false,
     winHeight: 0 ,//  窗口高度
     isLastDayForMonth: false, // 是否是当月最后一天
+    showPdfPrintView: false, // pdf 打印预览
+    pdfPrintList: [] ,// 打印的pdf 文件
+    showSelectPrint: false, // 选择打印机
+    printTaskName: '', // 打印任务名称
+    printTaskID: '', // 打印任务id列表
+    printLoading: false, // 正在打印中
+    printUseing: '0', // 选择打印机的用途 0 设置打印机,1打印时
+    printSettingType: '', // 设置打印机类型,0 针式,1 喷墨
+    printDefNeedle: undefined,// 默认针式打印机
+    printDefInk: undefined, // 默认喷墨打印机
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {
@@ -105,6 +115,39 @@ const app = {
     SET_loadingStatus: (state, val) => {
       state.loadingStatus = val
     },
+    // 打印
+    SET_pdfPrintList: (state, val) => {
+      state.pdfPrintList = val
+    },
+    SET_showPdfPrint: (state, val) => {
+      state.showPdfPrintView = val && val.length > 0
+    },
+    SET_showSelectPrint: (state, val) => {
+      state.showSelectPrint = val
+    },
+    SET_printTaskName: (state, val) => {
+      state.printTaskName = val
+    },
+    SET_printTaskID: (state, val) => {
+      state.printTaskID = val
+    },
+    SET_printLoading: (state, val) => {
+      state.printLoading = val
+    },
+    SET_printDefNeedle: (state, val) => {
+      state.printDefNeedle = val
+      localStorage.setItem('DEFAULT_PRINT_NEEDLE',val)
+    },
+    SET_printDefInk: (state, val) => {
+      state.printDefInk = val
+      localStorage.setItem('DEFAULT_PRINT_INK',val)
+    },
+    SET_printUseing: (state, val) => {
+      state.printUseing = val
+    },
+    SET_printSettingType: (state, val) => {
+      state.printSettingType = val
+    },
   },
   actions: {
     setSidebar ({
@@ -132,6 +175,26 @@ const app = {
     }, size) {
       commit('TOGGLE_FONTSIZE', size)
     },
+    TogglePrintDefNeedle({
+      commit
+    }, str) {
+      commit('SET_printDefNeedle', str)
+    },
+    TogglePrintDefInk({
+      commit
+    }, str) {
+      commit('SET_printDefInk', str)
+    },
+    TogglePrintUseing({
+      commit
+    }, str) {
+      commit('SET_printUseing', str)
+    },
+    TogglePrintSettingType({
+      commit
+    }, str) {
+      commit('SET_printSettingType', str)
+    },
     ToggleLayoutMode ({
       commit
     }, mode) {

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

@@ -10,7 +10,7 @@ import { asyncRouterMap, constantRouterMap } from '@/config/router.config'
 function hasPermission (permission, route) {
   if (route.meta && route.meta.permission) {
     let flag = permission.find(item => {
-      return item&&item == route.meta.permission
+      return item&&route.meta.permission.split(',').find(a => a == item)
     })
     // let flag = false
     // for (let i = 0, len = permission.length; i < len; i++) {

+ 6 - 0
src/store/modules/user.js

@@ -16,6 +16,7 @@ const user = {
     authOrgs: [],
     changeOrg: '',
     settleAccountFlag: 0, // 结算账户管理是否开启
+    isShowSpecialPrice: 0, // 是否显示特约价
   },
 
   mutations: {
@@ -49,6 +50,9 @@ const user = {
     SET_SETTLEACCOUNT:(state, status) => {
       state.settleAccountFlag = status
     },
+    SET_isShowSpecialPrice:(state, status) => {
+      state.isShowSpecialPrice = status
+    },
   },
 
   actions: {
@@ -68,6 +72,7 @@ const user = {
               commit('SET_AUTHORGS', res.auth_orgs || [])
               commit('SET_NAME', { name: users.userNameCN, welcome: welcome() })
               commit('SET_MUSTCHANGEPWD', users.mustChangePwd)
+              commit('SET_isShowSpecialPrice',users.extInfo.isShowSpecialPrice)
               Vue.ls.set('rolesAccess-qpls-md', { permissionList: users.permCodes }, 7 * 24 * 60 * 60 * 1000)
               commit('SET_AVATAR', res.avatar ? res.avatar : '')
               // 记住密码
@@ -152,6 +157,7 @@ const user = {
           commit('SET_MUSTCHANGEPWD', '')
           commit('SET_AVATAR', '')
           commit('SET_TOKEN', '')
+          commit('SET_isShowSpecialPrice','0')
           commit('SET_ROLES', { permissionList: [] })
           Vue.ls.remove(ACCESS_TOKEN)
           Vue.ls.remove('userName')

+ 3 - 3
src/utils/request.js

@@ -23,11 +23,11 @@ const err = (error) => {
     store.commit('SET_loadingStatus', false)
     return Promise.reject(err)
   }
-
+ console.log(error.response,error.response.status)
   // 业务错误提示
   if (error.response) {
-    const status = error.response.status
-    if ((status == 503 || status == 500)) {
+    const status = error.response.status.toString()
+    if (status.indexOf('5')>=0||status.indexOf('4')>=0) {
       notification.destroy()
       notification.error({
         message: '提示',

+ 25 - 17
src/views/allocationManagement/chainTransferIn/detail.vue

@@ -36,8 +36,10 @@
         <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>
+            总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -70,19 +72,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { 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 })
@@ -112,6 +101,25 @@ export default {
   computed: {
     isEdit () {
       return (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT' && this.$hasPermissions('B_allocLinkagePutEdit'))
+    },
+    columns () {
+      const arr = [
+        { 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 || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'putCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {
@@ -148,9 +156,9 @@ export default {
       const _this = this
       _this.spinning = true
       const url = allocLinkagePutDetailPrint
-      const params = { sn: this.$route.params.sn, type: printerType }
+      const params = { sn: this.$route.params.sn, type: printerType, showFlag: this.$hasPermissions('M_ShowAllCost') ? 1 : 0 }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '连锁调入单', function () {
         _this.spinning = false
       })
     }

+ 26 - 16
src/views/allocationManagement/chainTransferIn/edit.vue

@@ -29,8 +29,10 @@
         <a-alert type="info" style="margin-bottom: 10px">
           <div slot="message">
             总款数 <strong>{{ (basicInfoData&&(basicInfoData.productTotalCategory || basicInfoData.productTotalCategory==0)) ? basicInfoData.productTotalCategory : '--' }}</strong> ,
-            总数量 <strong>{{ (basicInfoData&&(basicInfoData.productTotalQty || basicInfoData.productTotalQty==0)) ? basicInfoData.productTotalQty : '--' }}</strong> ,
-            总成本 <strong>{{ (basicInfoData&&(basicInfoData.productTotalCost || basicInfoData.productTotalCost==0)) ? '¥'+basicInfoData.productTotalCost : '--' }}</strong>
+            总数量 <strong>{{ (basicInfoData&&(basicInfoData.productTotalQty || basicInfoData.productTotalQty==0)) ? basicInfoData.productTotalQty : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              ,总成本 <strong>{{ (basicInfoData&&(basicInfoData.productTotalCost || basicInfoData.productTotalCost==0)) ? '¥'+basicInfoData.productTotalCost : '--' }}</strong>
+            </div>
           </div>
         </a-alert>
         <!-- 筛选条件 -->
@@ -135,18 +137,6 @@ export default {
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseCascadeData: [], //  仓库仓位
-      // 表头
-      columns: [
-        { 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 => {
         this.disabled = true
@@ -185,6 +175,26 @@ export default {
       printerType: 'NEEDLE' //  打印机类型
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { 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' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {
@@ -317,9 +327,9 @@ export default {
       const _this = this
       _this.spinning = true
       const url = allocLinkagePutDetailPrint
-      const params = { sn: this.$route.params.sn, type: printerType }
+      const params = { sn: this.$route.params.sn, type: printerType, showFlag: this.$hasPermissions('M_ShowAllCost') ? 1 : 0 }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '连锁调入单', function () {
         _this.spinning = false
       })
     },

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

@@ -84,7 +84,7 @@
         bordered>
         <!-- 连锁调入单号 -->
         <template slot="allocationLinkagePutNo" slot-scope="text, record">
-          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_allocLinkagePutDetail')" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_allocLinkagePutDetail')" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</span>
           <span v-else>{{ record.allocationLinkagePutNo }}</span>
         </template>
         <!-- 审核 -->
@@ -155,23 +155,6 @@ export default {
         settleState: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { 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: '14%', 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: 'waitOut' }, width: '3%', align: 'center' },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
-        { title: '付款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -196,6 +179,31 @@ export default {
       outTenantSnData: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { 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: '14%', 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: 'waitOut' }, width: '3%', align: 'center' },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '付款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 1 - 1
src/views/allocationManagement/chainTransferOut/basicInfoModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="新增连锁调出单"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancel="isShow = false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model

+ 23 - 15
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -40,8 +40,10 @@
             <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>
+                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                </div>
               </div>
             </a-alert>
             <!-- 列表 -->
@@ -82,17 +84,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'outCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出仓库', dataIndex: 'warehouseName', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', dataIndex: 'outQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -122,6 +113,23 @@ export default {
   computed: {
     isEdit () {
       return ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')) && this.$hasPermissions('B_allocLinkageOutEdit')
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价', dataIndex: 'outCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出仓库', dataIndex: 'warehouseName', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', dataIndex: 'outQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'outCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {
@@ -158,9 +166,9 @@ export default {
       const _this = this
       _this.spinning = true
       const url = allocLinkageOutDetailPrint
-      const params = { sn: this.outBizSn || this.$route.params.sn, type: printerType }
+      const params = { sn: this.outBizSn || this.$route.params.sn, type: printerType, showFlag: this.$hasPermissions('M_ShowAllCost') ? 1 : 0 }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '连锁调出单', function () {
         _this.spinning = false
       })
     }

+ 58 - 86
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -37,32 +37,14 @@
                   </a-col>
                   <template v-if="advanced">
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品品牌">
-                        <a-select
-                          placeholder="请选择"
-                          id="chainTransferOutEdit-brandSn"
-                          allowClear
-                          v-model="queryParam.brandSn"
-                          :showSearch="true"
-                          option-filter-prop="children"
-                          :filter-option="filterOption">
-                          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
+                      <a-form-model-item label="产品品牌">
+                        <ProductBrand id="chainTransferOutEdit-brandSn" placeholder="请选择产品品牌" v-model="queryParam.brandSn"></ProductBrand>
+                      </a-form-model-item>
                     </a-col>
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品分类">
-                        <a-cascader
-                          @change="changeProductType"
-                          change-on-select
-                          v-model="productType"
-                          expand-trigger="hover"
-                          :options="productTypeList"
-                          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                          id="chainTransferOutEdit-productType"
-                          placeholder="请选择产品分类"
-                          allowClear />
-                      </a-form-item>
+                      <a-form-model-item label="产品分类">
+                        <ProductType id="chainTransferOutEdit-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                      </a-form-model-item>
                     </a-col>
                     <a-col :md="6" :sm="24">
                       <a-form-item label="仓库">
@@ -125,8 +107,10 @@
             <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>
+                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                </div>
               </div>
             </a-alert>
             <!-- 筛选条件 -->
@@ -197,14 +181,14 @@ import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailSave, allocLinkageOutDetailDel, allocLinkageOutDetailCount, allocLinkageOutSubmit, allocLinkageOutDetailDelAll, allocLinkageOutDetailPrint } from '@/api/allocLinkageOut'
 import { productQuery } from '@/api/allocWarehouse'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 import { warehouseAllList } from '@/api/warehouse'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'AllocLinkageOutEdit',
-  components: { STable, VSelect, Print },
+  components: { STable, VSelect, Print, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
     return {
@@ -219,28 +203,11 @@ export default {
         productTypeSn2: undefined,
         productTypeSn3: undefined
       },
-      productBrandList: [], //  产品品牌  下拉数据
-      productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseList: [], //  仓库  下拉数据
       disabled: false, //  查询、重置按钮是否可操作
       chooseDisabled: false,
       advanced: false, // 高级搜索 展开/关闭
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -261,21 +228,6 @@ export default {
         productCode: '',
         productName: ''
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', dataIndex: 'outQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
@@ -299,6 +251,49 @@ export default {
       localDataSource: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', dataIndex: 'outQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(8, 0, { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {
@@ -339,8 +334,6 @@ export default {
         if (res.status == 200) {
           this.basicInfoData = res.data
           this.$refs.table.refresh(true)
-          this.getProductBrand()
-          this.getProductType()
         } else {
           this.basicInfoData = null
         }
@@ -455,27 +448,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      // sysFlag为1查询箭冠产品,为0查询非箭冠产品
-      dealerProductBrandQuery({ sysFlag: this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0' }).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({ sysFlag: this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0' }).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     // 仓库下拉数据
     getWarehouseList (type) {
       warehouseAllList({}).then(res => {
@@ -491,9 +463,9 @@ export default {
       const _this = this
       _this.spinning = true
       const url = allocLinkageOutDetailPrint
-      const params = { sn: this.$route.params.sn, type: printerType }
+      const params = { sn: this.$route.params.sn, type: printerType, showFlag: this.$hasPermissions('M_ShowAllCost') ? 1 : 0 }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '连锁调出单', function () {
         _this.spinning = false
       })
     },

+ 72 - 33
src/views/allocationManagement/chainTransferOut/list.vue

@@ -5,12 +5,22 @@
       <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-col :md="4" :sm="24">
               <a-form-item label="创建时间">
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="4" :sm="24">
+              <a-form-item label="审核时间">
+                <rangeDate ref="auditRangeDate" :value="auditTime" @change="auditDateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="出库时间">
+                <rangeDate ref="outWareRangeDate" :value="outWareTime" @change="outWareDateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
               <a-form-item label="调往对象">
                 <a-select
                   placeholder="请选择调往对象"
@@ -24,19 +34,19 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="调出产品类型">
-                <v-select
-                  v-model="queryParam.allocationType"
-                  ref="allocationType"
-                  id="chainTransferOutList-allocationType"
-                  code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
-                  placeholder="请选择调出产品类型"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
+                <a-form-item label="调出产品类型">
+                  <v-select
+                    v-model="queryParam.allocationType"
+                    ref="allocationType"
+                    id="chainTransferOutList-allocationType"
+                    code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
+                    placeholder="请选择调出产品类型"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
@@ -47,7 +57,7 @@
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="财务状态">
                   <v-select
                     v-model="queryParam.settleState"
@@ -88,7 +98,7 @@
         bordered>
         <!-- 连锁调出单号 -->
         <template slot="allocationLinkageOutNo" slot-scope="text, record">
-          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_allocLinkageOutDetail')" @click="handleDetail(record)">{{ record.allocationLinkageOutNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_allocLinkageOutDetail')" @click="handleDetail(record)">{{ record.allocationLinkageOutNo }}</span>
           <span v-else>{{ record.allocationLinkageOutNo }}</span>
         </template>
         <!-- 审核 -->
@@ -163,32 +173,21 @@ export default {
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
+      auditTime: [],
+      outWareTime: [],
       queryParam: { //  查询条件
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
+        auditBeginDate: '',
+        auditEndDate: '',
+        outWarehouseBeginDate: '',
+        outWarehouseEndDate: '',
         putTenantSn: undefined, //  调往对象
         allocationType: undefined, //  调出产品类型
         state: undefined, //  业务状态
         settleState: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', 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: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { 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: 'audit' }, width: '3%', align: 'center' },
-        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
-        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -212,12 +211,45 @@ export default {
       itemId: '' //  当前品牌id
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', 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: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'audit' }, width: '3%', align: 'center' },
+        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
+        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    auditDateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
+    outWareDateChange (date) {
+      this.queryParam.outWarehouseBeginDate = date[0]
+      this.queryParam.outWarehouseEndDate = date[1]
+    },
     //  重置
     resetSearchForm () {
       this.resetData()
@@ -228,6 +260,13 @@ export default {
       this.$refs.rangeDate.resetDate(flag ? '' : this.time)
       this.queryParam.beginDate = flag ? '' : getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = flag ? '' : getDate.getCurrMonthDays().endtime
+      this.$refs.auditRangeDate.resetDate('')
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
+      this.$refs.outWareRangeDate.resetDate('')
+      this.queryParam.outWarehouseBeginDate = ''
+      this.queryParam.outWarehouseEndDate = ''
+
       this.queryParam.putTenantSn = undefined
       this.queryParam.allocationType = undefined
       this.queryParam.state = undefined

+ 1 - 1
src/views/allocationManagement/storeTransferOut/basicInfoModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="新增店内调出单"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancel="isShow = false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model

+ 51 - 17
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -15,7 +15,7 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra" v-if="outBizSn ? $hasPermissions('B_outboundOrderDetail') : $hasPermissions('B_storeCallOutPrint')">
-          <a-checkbox key="4" v-model="printCostChecked">打印成本</a-checkbox>
+          <a-checkbox key="4" v-if="$hasPermissions('M_ShowAllCost')" v-model="printCostChecked">打印成本</a-checkbox>
           <Print :disabled="localDataSource.length==0" :showExport="false" @handlePrint="handlePrint"></Print>
         </template>
       </a-page-header>
@@ -38,8 +38,10 @@
         <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>
+            总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -52,7 +54,21 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
+          <div slot="costTitle">
+            <a-tooltip placement="top">
+              <template slot="title">
+                系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+              </template>
+              <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+            </a-tooltip>
+          </div>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
+          </template>
         </s-table>
+        <!-- 出入库明细 -->
+        <outInDetialModal ref="outInDetialModal" outBizType="SHOP_CALL_OUT" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
   </div>
@@ -64,10 +80,11 @@ import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn, storeCallOutDetailPrint } from '@/api/storeCallOut'
 import Print from '@/views/common/print.vue'
+import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'StoreCallOutDetail',
-  components: { STable, VSelect, Print },
+  components: { STable, VSelect, Print, outInDetialModal },
   mixins: [commonMixin],
   props: {
     outBizSn: { //  有值则为弹框,无值则为页面
@@ -78,17 +95,7 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'outCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出仓库', dataIndex: 'warehouseName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
+      showOutInModal: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
@@ -117,6 +124,24 @@ export default {
   computed: {
     isEdit () {
       return ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')) && this.$hasPermissions('B_storeCallOutEdit')
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价(¥)', dataIndex: 'outCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出仓位', dataIndex: 'warehouseLocationName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { slots: { title: 'costTitle' }, dataIndex: 'totalOutCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalOutCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {
@@ -129,12 +154,21 @@ export default {
       const _this = this
       _this.spinning = true
       const url = storeCallOutDetailPrint
-      const params = { sn: this.outBizSn || this.$route.params.sn, type: printerType, costFlag: this.printCostChecked ? '1' : '0' }
+      const params = {
+        sn: this.outBizSn || this.$route.params.sn,
+        type: printerType,
+        costFlag: this.printCostChecked && this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
+      }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '店内调出单', function () {
         _this.spinning = false
       })
     },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
     // 基本信息
     getDetail () {
       storeCallOutDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {

+ 100 - 88
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -9,7 +9,7 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra" v-if="$hasPermissions('B_storeCallOutPrint')">
-          <a-checkbox key="4" v-model="printCostChecked">打印成本</a-checkbox>
+          <a-checkbox key="4" v-if="$hasPermissions('M_ShowAllCost')" v-model="printCostChecked">打印成本</a-checkbox>
           <Print :disabled="chooseLoadDataSource.length==0" :showExport="false" @handlePrint="handlePrint"></Print>
         </template>
       </a-page-header>
@@ -40,32 +40,14 @@
                   </a-col>
                   <template v-if="advanced">
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品分类">
-                        <a-cascader
-                          @change="changeProductType"
-                          change-on-select
-                          v-model="productType"
-                          expand-trigger="hover"
-                          :options="productTypeList"
-                          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                          id="storeTransferOutEdit-productType"
-                          placeholder="请选择产品分类"
-                          allowClear />
-                      </a-form-item>
+                      <a-form-model-item label="产品品牌">
+                        <ProductBrand id="storeTransferOutEdit-brandSn" placeholder="请选择产品品牌" v-model="queryParam.brandSn"></ProductBrand>
+                      </a-form-model-item>
                     </a-col>
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品品牌">
-                        <a-select
-                          placeholder="请选择产品品牌"
-                          id="storeTransferOutEdit-brandSn"
-                          allowClear
-                          v-model="queryParam.brandSn"
-                          :showSearch="true"
-                          option-filter-prop="children"
-                          :filter-option="filterOption">
-                          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
+                      <a-form-model-item label="产品分类">
+                        <ProductType id="storeTransferOutEdit-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                      </a-form-model-item>
                     </a-col>
                   </template>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -91,6 +73,29 @@
               :scroll="{ y: 300 }"
               :defaultLoadData="false"
               bordered>
+              <div slot="costTitle">
+                <a-tooltip placement="top">
+                  <template slot="title">
+                    产品所在仓库仓位的最近一次入库成本,不包含盘盈入库和仓库调拨入库。
+                  </template>
+                  <span style="margin-right: 5px;">参考成本价</span> <a-icon type="question-circle" />
+                </a-tooltip>
+              </div>
+              <!-- 调出数量 -->
+              <template slot="outQty" slot-scope="text, record">
+                <div @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-if="record.currentQty"
+                    v-model="record.outQty"
+                    :precision="0"
+                    :min="1"
+                    :max="record.currentQty"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                  <span v-else>--</span>
+                </div>
+              </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
                 <a-button
@@ -114,8 +119,10 @@
             <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>
+                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                </div>
               </div>
             </a-alert>
             <!-- 筛选条件 -->
@@ -157,6 +164,14 @@
               :defaultLoadData="false"
               :scroll="{ y: 300 }"
               bordered>
+              <div slot="costTitle">
+                <a-tooltip placement="top">
+                  <template slot="title">
+                    系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+                  </template>
+                  <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+                </a-tooltip>
+              </div>
               <!-- 调出数量 -->
               <template slot="outQty" slot-scope="text, record">
                 <a-input-number
@@ -172,11 +187,14 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
+                <a-button size="small" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
         </a-collapse>
+        <!-- 出入库明细 -->
+        <outInDetialModal ref="outInDetialModal" outBizType="SHOP_CALL_OUT" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
     <div class="affix-cont">
@@ -197,19 +215,21 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { storeCallOutDetailList, storeCallOutDetail, storeCallOutDetailCount, storeCallOutDetailSave, storeCallOutDetailDel, storeCallOutSubmit, storeCallOutDetailPrint } from '@/api/storeCallOut'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 import { warehouseAllList } from '@/api/warehouse'
 import { productQuery } from '@/api/allocWarehouse'
 import Print from '@/views/common/print.vue'
+import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'StoreCallOutEdit',
-  components: { STable, VSelect, Print },
+  components: { STable, VSelect, Print, ProductType, ProductBrand, outInDetialModal },
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
+      showOutInModal: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -231,18 +251,6 @@ export default {
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseList: [], //  仓库  下拉数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { 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 : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -251,24 +259,12 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            data.list[i].outQty = 1
           }
           this.disabled = false
           return data
         })
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'outCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
@@ -294,6 +290,44 @@ export default {
       printCostChecked: true //  打印成本
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '库存数量', dataIndex: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      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: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价(¥)', dataIndex: 'outCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
+        // { slots: { title: 'costTitle' }, dataIndex: 'totalOutCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalOutCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {
@@ -312,9 +346,9 @@ export default {
       const _this = this
       _this.spinning = true
       const url = storeCallOutDetailPrint
-      const params = { sn: this.$route.params.sn, type: printerType, costFlag: this.printCostChecked ? '1' : '0' }
+      const params = { sn: this.$route.params.sn, type: printerType, costFlag: this.printCostChecked && this.$hasPermissions('M_ShowAllCost') ? '1' : '0' }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '店内调出单', function () {
         _this.spinning = false
       })
     },
@@ -323,6 +357,7 @@ export default {
       return {
         on: {
           dblclick: (event) => {
+            event.stopPropagation()
             this.handleAdd(record)
           }
         }
@@ -350,7 +385,7 @@ export default {
         id: isEdit ? row.id : undefined,
         storeCallOutSn: this.$route.params.sn,
         outCost: isEdit ? row.outCost : row.putCost,
-        outQty: isEdit ? row.outQty : 1, //  添加时调出数量默认为1
+        outQty: row.outQty, //  添加时调出数量默认为1
         productSn: row.productSn,
         productCode: row.productCode,
         productOrigCode: row.productOrigCode || undefined,
@@ -372,7 +407,7 @@ export default {
       storeCallOutDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
-          this.$refs.table.refresh()
+          // this.$refs.table.refresh()
           this.$refs.chooseTable.refresh()
           this.spinning = false
         } else {
@@ -380,6 +415,11 @@ export default {
         }
       })
     },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
     //  删除
     handleDel (row) {
       const _this = this
@@ -445,27 +485,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      // sysFlag不传,此处应查询所有产品
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     // 仓库下拉数据
     getWarehouseList (type) {
       warehouseAllList({}).then(res => {
@@ -476,17 +495,10 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     pageInit () {
       this.printCostChecked = true
       this.getDetail()
       this.getWarehouseList()
-      this.getProductBrand()
-      this.getProductType()
       this.resetSearchForm()
       this.chooseResetSearchForm()
     }

+ 70 - 30
src/views/allocationManagement/storeTransferOut/list.vue

@@ -5,25 +5,35 @@
       <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-col :md="4" :sm="24">
               <a-form-item label="创建时间">
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="调往对象名称">
-                <a-input id="storeTransferOutList-putPersonName" v-model.trim="queryParam.putPersonName" allowClear placeholder="请输入调往对象名称"/>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="审核时间">
+                <rangeDate ref="auditRangeDate" :value="auditTime" @change="auditDateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="出库时间">
+                <rangeDate ref="outWareRangeDate" :value="outWareTime" @change="outWareDateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="调拨类型">
-                <a-select id="storeTransferOutList-callOutType" v-model="queryParam.callOutType" placeholder="请选择调拨类型" allowClear >
-                  <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
-                </a-select>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="调往对象名称">
+                <a-input id="storeTransferOutList-putPersonName" v-model.trim="queryParam.putPersonName" allowClear placeholder="请输入调往对象名称"/>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
+                <a-form-item label="调拨类型">
+                  <a-select id="storeTransferOutList-callOutType" v-model="queryParam.callOutType" placeholder="请选择调拨类型" allowClear >
+                    <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
@@ -35,7 +45,7 @@
                   ></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="财务状态">
                   <v-select
                     v-model="queryParam.settleState"
@@ -77,7 +87,7 @@
         bordered>
         <!-- 店内调出单号 -->
         <template slot="storeCallOutNo" slot-scope="text, record">
-          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_storeCallOutDetail')" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_storeCallOutDetail')" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
           <span v-else>{{ record.storeCallOutNo }}</span>
         </template>
         <!-- 审核 -->
@@ -153,32 +163,21 @@ export default {
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
+      auditTime: [],
+      outWareTime: [],
       queryParam: { //  查询条件
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
+        auditBeginDate: '',
+        auditEndDate: '',
+        outWarehouseBeginDate: '',
+        outWarehouseEndDate: '',
         putPersonName: undefined, //  调往对象
         callOutType: undefined, //  调拨类型
         state: undefined, //  业务状态
         settleState: undefined //  财务状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: '14%', align: 'center' },
-        { title: '调往对象名称', dataIndex: 'putPersonName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨类型', dataIndex: 'callOutTypeName', width: '7%', 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: '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: 'audit' }, width: '3%', align: 'center' },
-        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
-        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -202,14 +201,48 @@ export default {
       itemId: '' //  当前品牌id
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: '14%', align: 'center' },
+        { title: '调往对象名称', dataIndex: 'putPersonName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨类型', dataIndex: 'callOutTypeName', width: '7%', 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: '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: 'audit' }, width: '3%', align: 'center' },
+        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
+        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    auditDateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
+    outWareDateChange (date) {
+      this.queryParam.outWarehouseBeginDate = date[0]
+      this.queryParam.outWarehouseEndDate = date[1]
+    },
     //  重置
     resetSearchForm () {
+      console.log('resetSearchForm')
       this.resetData()
       this.$refs.table.refresh(true)
     },
@@ -218,6 +251,13 @@ export default {
       this.$refs.rangeDate.resetDate(flag ? '' : this.time)
       this.queryParam.beginDate = flag ? '' : getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = flag ? '' : getDate.getCurrMonthDays().endtime
+      this.$refs.auditRangeDate.resetDate('')
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
+      this.$refs.outWareRangeDate.resetDate('')
+      this.queryParam.outWarehouseBeginDate = ''
+      this.queryParam.outWarehouseEndDate = ''
+
       this.queryParam.putPersonName = undefined
       this.queryParam.callOutType = undefined
       this.queryParam.state = undefined
@@ -324,7 +364,7 @@ export default {
       const b = this.$store.state.app.updateList
       // 是否从首页点击进入
       const isHomeNav = this.getIsHomeNav()[this.$route.name]
-      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name)
+      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name, '店内调出')
 
       // 从首页进入,判断式新建还式待办查询
       if (isHomeNav) {

+ 1 - 1
src/views/allocationManagement/warehouseAllocation/basicInfoModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="新增"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancel="isShow = false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model

+ 24 - 15
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -36,8 +36,10 @@
         <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>
+            总数量: <strong>{{ productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0) ? productTotal.productTotalQty : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              ,总成本: <strong>{{ productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -88,19 +90,6 @@ export default {
       exportLoading: false, // 导出loading
       warehouse: null, // 基础信息
       productTotal: null,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '类别', scopedSlots: { customRender: 'productType' }, width: '14%', align: 'center' },
-        { title: '数量', dataIndex: 'allocationQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本小计(¥)', dataIndex: 'totalAllocationCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', dataIndex: 'putWarehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -122,6 +111,26 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类别', scopedSlots: { customRender: 'productType' }, width: '14%', align: 'center' },
+        { title: '数量', dataIndex: 'allocationQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本小计(¥)', dataIndex: 'totalAllocationCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调入仓位', dataIndex: 'putWarehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '成本小计(¥)', dataIndex: 'totalAllocationCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回列表
     handleBack () {

+ 11 - 59
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -34,32 +34,14 @@
                   </a-col>
                   <template v-if="advanced">
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品品牌">
-                        <a-select
-                          placeholder="请选择产品品牌"
-                          id="warehouseAllocationEdit-brandSn"
-                          allowClear
-                          v-model="queryParam.brandSn"
-                          :showSearch="true"
-                          option-filter-prop="children"
-                          :filter-option="filterOption">
-                          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
+                      <a-form-model-item label="产品品牌">
+                        <ProductBrand id="warehouseAllocationEdit-brandSn" placeholder="请选择产品品牌" v-model="queryParam.brandSn"></ProductBrand>
+                      </a-form-model-item>
                     </a-col>
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品分类">
-                        <a-cascader
-                          @change="changeProductType"
-                          change-on-select
-                          v-model="productType"
-                          expand-trigger="hover"
-                          :options="productTypeList"
-                          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                          id="warehouseAllocationEdit-productType"
-                          placeholder="请选择产品分类"
-                          allowClear />
-                      </a-form-item>
+                      <a-form-model-item label="产品分类">
+                        <ProductType id="warehouseAllocationEdit-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                      </a-form-model-item>
                     </a-col>
                     <a-col :md="6" :sm="24">
                       <a-form-item label="调出仓位" prop="warehouseLocationSn">
@@ -135,8 +117,8 @@
             <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>
+                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong></div>
               </div>
             </a-alert>
             <!-- 筛选条件 -->
@@ -237,12 +219,12 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { allocWarehouseDetailList, allocWarehouseDetail, updatePutWhLocation, productQuery, allocWarehouseDetailCount, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 import { warehouseLocAllList } from '@/api/warehouse'
 export default {
   name: 'AllocWarehouseEdit',
-  components: { STable, VSelect },
+  components: { STable, VSelect, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
     return {
@@ -265,8 +247,6 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      productBrandList: [], //  产品品牌  下拉数据
-      productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehousePutLocData: [], //  调入仓位  下拉数据
       warehouseOutLocData: [], //  调出仓位  下拉数据
@@ -527,27 +507,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      // sysFlag不传,此处应查询所有产品
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     // 获取仓库仓位
     getWarehouseLoc (sn, type) {
       warehouseLocAllList({ warehouseSn: sn }).then(res => {
@@ -558,15 +517,8 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     pageInit () {
       this.chooseResetSearchForm()
-      this.getProductBrand()
-      this.getProductType()
       this.getDetail()
     }
   },

+ 23 - 15
src/views/allocationManagement/warehouseAllocation/list.vue

@@ -65,7 +65,7 @@
         bordered>
         <!-- 单号 -->
         <template slot="allocationWarehouseNo" slot-scope="text, record">
-          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_warehouseAllocationDetail')" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_warehouseAllocationDetail')" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
           <span v-else>{{ record.allocationWarehouseNo }}</span>
         </template>
         <!-- 审核 -->
@@ -141,20 +141,6 @@ export default {
         state: undefined //  审核状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单号', scopedSlots: { customRender: 'allocationWarehouseNo' }, width: '15%', align: 'center' },
-        { title: '调出仓库', dataIndex: 'outWarehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调入仓库', dataIndex: 'putWarehouseName', 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: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -176,6 +162,28 @@ export default {
       openModal: false //  新增编辑  弹框
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单号', scopedSlots: { customRender: 'allocationWarehouseNo' }, width: '15%', align: 'center' },
+        { title: '调出仓库', dataIndex: 'outWarehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调入仓库', dataIndex: 'putWarehouseName', 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: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 1 - 1
src/views/basicData/bulkPartsTypeManagement/editModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 表单 -->

+ 1 - 1
src/views/basicData/customerTypeManagement/editModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 表单 -->

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

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 表单 -->

+ 1 - 1
src/views/basicData/storeTransferOutTypeManagement/editModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 表单 -->

+ 1 - 1
src/views/bulkManagement/bulkReturnGoods/basicInfoModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="新增散件退货单"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancel="isShow = false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model

+ 1 - 1
src/views/bulkManagement/bulkReturnGoods/detailModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="散件退货详情"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancel="isShow = false"
     :width="960">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-card size="small" v-if="$hasPermissions('B_sparePartsRetPrint')" :bordered="false" class="bulkReturnGoodsDetail-cont">

+ 47 - 35
src/views/bulkManagement/bulkReturnGoods/list.vue

@@ -5,42 +5,47 @@
       <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-col :md="4" :sm="24">
               <a-form-item label="创建时间">
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="散件退货单号">
-                <a-input id="bulkReturnGoodsList-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入散件退货单号"/>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="审核时间">
+                <rangeDate ref="auditRangeDate" :value="auditTime" @change="auditDateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <a-select
-                  id="bulkReturnGoodsList-supplierSn"
-                  placeholder="请选择供应商"
-                  allowClear
-                  v-model="queryParam.supplierSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in supplierList" :key="item.supplierSn" :pyCode="item.pyCode" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
-                </a-select>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="出库时间">
+                <rangeDate ref="outWareRangeDate" :value="outWareTime" @change="outWareDateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="散件退货单号">
+                <a-input id="bulkReturnGoodsList-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入散件退货单号"/>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
+                <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                  <supplier
+                    id="bulkReturnGoodsList-supplierSn"
+                    placeholder="请选择供应商"
+                    v-model="queryParam.supplierSn"
+                  ></supplier>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
                 <a-form-item label="是否抓单">
                   <v-select code="FLAG" id="bulkReturnGoodsList-isGrab" v-model="queryParam.isGrab" allowClear placeholder="请选择"></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select code="SPARE_PARTS_RETURN" id="bulkReturnGoodsList-state" v-model="queryParam.state" allowClear placeholder="请选择"></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="财务状态">
                   <v-select code="FINANCIAL_RECEIVE_STATUS" id="bulkReturnGoodsList-settleState" v-model="queryParam.settleState" allowClear placeholder="请选择"></v-select>
                 </a-form-item>
@@ -75,7 +80,7 @@
         bordered>
         <!-- 散件退货单号 -->
         <template slot="sparePartsReturnNo" slot-scope="text, record">
-          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_bulkReturnGoodsDetail')" @click="handleDetail(record)">{{ record.sparePartsReturnNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_bulkReturnGoodsDetail')" @click="handleDetail(record)">{{ record.sparePartsReturnNo }}</span>
           <span v-else>{{ record.sparePartsReturnNo }}</span>
         </template>
         <!-- 审核 -->
@@ -143,11 +148,11 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import getDate from '@/libs/getDate.js'
 import auditModal from '@/views/common/auditModal.vue'
 import stateIcon from '@/views/common/stateIcon'
-import { supplierAllList } from '@/api/supplier'
+import supplier from '@/views/common/supplier'
 import { sparePartsRetList, sparePartsRetDel, sparePartsRetOutStock, sparePartsRetAudit } from '@/api/sparePartsRet'
 export default {
   name: 'BulkReturnGoodsList',
-  components: { STable, VSelect, basicInfoModal, rangeDate, bulkReturnGoodsDetailModal, auditModal, stateIcon },
+  components: { STable, VSelect, basicInfoModal, rangeDate, bulkReturnGoodsDetailModal, auditModal, stateIcon, supplier },
   mixins: [commonMixin],
   data () {
     return {
@@ -158,9 +163,15 @@ export default {
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
+      auditTime: [],
+      outWareTime: [],
       queryParam: { //  查询条件
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
+        auditBeginDate: '',
+        auditEndDate: '',
+        outWarehouseBeginDate: '',
+        outWarehouseEndDate: '',
         sparePartsReturnNo: '', //  散件退货单号
         supplierSn: undefined, //  供应商
         isGrab: undefined,
@@ -203,7 +214,6 @@ export default {
           return data
         })
       },
-      supplierList: [], //  供应商列表数据
       openModal: false, // 基本信息弹框是否显示
       openDetailModal: false,
       itemSn: null,
@@ -219,6 +229,14 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    auditDateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
+    outWareDateChange (date) {
+      this.queryParam.outWarehouseBeginDate = date[0]
+      this.queryParam.outWarehouseEndDate = date[1]
+    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
@@ -235,6 +253,12 @@ export default {
       this.$refs.rangeDate.resetDate(flag ? '' : this.time)
       this.queryParam.beginDate = flag ? '' : getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = flag ? '' : getDate.getCurrMonthDays().endtime
+      this.$refs.auditRangeDate.resetDate('')
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
+      this.$refs.outWareRangeDate.resetDate('')
+      this.queryParam.outWarehouseBeginDate = ''
+      this.queryParam.outWarehouseEndDate = ''
       this.queryParam.sparePartsReturnNo = ''
       this.queryParam.supplierSn = undefined
       this.queryParam.isGrab = undefined
@@ -332,23 +356,12 @@ export default {
       this.isGrab = null
       this.openDetailModal = false
     },
-    // 供应商下拉数据
-    getSupplierList () {
-      supplierAllList().then(res => {
-        if (res.status == 200) {
-          this.supplierList = res.data
-        } else {
-          this.supplierList = []
-        }
-      })
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
       this.openModal = false
-      this.getSupplierList()
 
       // 是否打开的页签
       const a = this.$store.state.app.isNewTab
@@ -356,7 +369,6 @@ export default {
       const b = this.$store.state.app.updateList
       // 是否从首页点击进入
       const isHomeNav = this.getIsHomeNav()[this.$route.name]
-      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name)
 
       // 从首页进入,判断式新建还式待办查询
       if (isHomeNav) {

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

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="新增散件入库单"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model

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

@@ -164,7 +164,7 @@ export default {
       const url = sparePartsPurDetailPrint
       const params = { sn: this.$route.params.sn, type: printerType }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '散件入库单', function () {
         _this.spinning = false
       })
     },

+ 3 - 3
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -243,7 +243,7 @@
       :maskClosable="false"
       title="新增产品"
       v-model="showNewProduct"
-      @cancle="showNewProduct=false"
+      @cancel="showNewProduct=false"
       :width="800">
       <newProduct
         ref="newProduct"
@@ -316,7 +316,7 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
-            data.list[i].putCost = data.list[i].purchasePrice || ''
+            data.list[i].putCost = data.list[i].purchasePrice
             data.list[i].putQty = data.list[i].putQty || 1
             if (this.defaultWarehouseCascade.length > 0) {
               data.list[i].warehouseCascade = this.defaultWarehouseCascade
@@ -456,7 +456,7 @@ export default {
       const url = sparePartsPurDetailPrint
       const params = { sn: this.$route.params.sn, type: printerType }
       // 打印或导出
-      hdPrint(printerType, type, url, params, '', function () {
+      hdPrint(printerType, type, url, params, '散件入库', function () {
         _this.spinning = false
       })
     },

+ 29 - 31
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -5,32 +5,32 @@
       <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-col :md="5" :sm="24">
               <a-form-item label="创建时间">
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="5" :sm="24">
+              <a-form-item label="入库时间">
+                <rangeDate ref="auditRangeDate" :value="auditTime" @change="auditDateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
               <a-form-item label="散件单号">
                 <a-input id="bulkWarehousingOrderList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入散件单号"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="4" :sm="24">
               <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <a-select
+                <supplier
                   id="bulkWarehousingOrderList-supplierSn"
                   placeholder="请选择供应商"
-                  allowClear
                   v-model="queryParam.supplierSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in supplierList" :pyCode="item.pyCode" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
-                </a-select>
+                ></supplier>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
@@ -42,7 +42,7 @@
                   ></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="财务状态">
                   <v-select
                     v-model="queryParam.settleState"
@@ -103,7 +103,7 @@
         bordered>
         <!-- 散件单号 -->
         <template slot="sparePartsPurchaseNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_bulkWarehousingOrder_detail')" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.sparePartsPurchaseNo }}</span>
+          <span v-if="$hasPermissions('B_bulkWarehousingOrder_detail')" class="table-td-link" @click="handleDetail(record)">{{ record.sparePartsPurchaseNo }}</span>
           <span v-else>{{ record.sparePartsPurchaseNo }}</span>
         </template>
         <!-- 提交 -->
@@ -157,12 +157,12 @@ 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 supplier from '@/views/common/supplier'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import stateIcon from '@/views/common/stateIcon'
 export default {
   name: 'BulkWarehousingList',
-  components: { STable, VSelect, basicInfoModal, rangeDate, stateIcon },
+  components: { STable, VSelect, basicInfoModal, rangeDate, stateIcon, supplier },
   mixins: [commonMixin],
   data () {
     return {
@@ -171,16 +171,18 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       openModal: false, // 基本信息弹框是否显示
-      supplierList: [], //  供应商列表数据
       tableHeight: 0,
       time: [
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
+      auditTime: [],
       // 查询参数
       queryParam: {
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
+        auditBeginDate: '',
+        auditEndDate: '',
         sparePartsPurchaseNo: '', //  散件单号
         supplierSn: undefined, //  供应商
         state: undefined, //  单据状态
@@ -229,8 +231,12 @@ export default {
   methods: {
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
+    auditDateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
     },
     // 合计
     getTotal (param) {
@@ -310,8 +316,11 @@ export default {
     // 重置数据
     resetData (flag) {
       this.$refs.rangeDate.resetDate(flag ? '' : this.time)
-      this.queryParam.beginDate = flag ? '' : getDate.getCurrMonthDays().starttime
-      this.queryParam.endDate = flag ? '' : getDate.getCurrMonthDays().endtime
+      this.queryParam.auditBeginDate = flag ? '' : getDate.getCurrMonthDays().starttime
+      this.queryParam.auditEndDate = flag ? '' : getDate.getCurrMonthDays().endtime
+      this.$refs.auditRangeDate.resetDate('')
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
       this.queryParam.sparePartsPurchaseNo = ''
       this.queryParam.supplierSn = undefined
       this.queryParam.state = undefined
@@ -347,23 +356,12 @@ export default {
         }
       })
     },
-    // 供应商下拉数据
-    getSupplierList () {
-      supplierAllList().then(res => {
-        if (res.status == 200) {
-          this.supplierList = res.data
-        } else {
-          this.supplierList = []
-        }
-      })
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
       this.openModal = false
-      this.getSupplierList()
 
       // 是否打开的页签
       const a = this.$store.state.app.isNewTab

+ 19 - 9
src/views/reportData/chainCustomerReport/list.vue → src/views/chainReportData/chainCustomerReport/list.vue

@@ -96,7 +96,9 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
           总交易金额:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</strong>;
-          总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>
+          </div>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -152,14 +154,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '连锁门店', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
-        { title: '客户类型', dataIndex: 'customerTypeName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '交易金额', dataIndex: 'totalAmount', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
-        { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -207,6 +201,22 @@ export default {
       linkageGroupData: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '连锁门店', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
+        { title: '客户类型', dataIndex: 'customerTypeName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '交易金额', dataIndex: 'totalAmount', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true }
+        // { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {

+ 0 - 0
src/views/reportData/chainPurchaseReceiptReport/list.vue → src/views/chainReportData/chainPurchaseReceiptReport/list.vue


+ 0 - 0
src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptDetail.vue → src/views/chainReportData/chainPurchaseReceiptReport/purchaseReceiptDetail.vue


+ 0 - 0
src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptOrder.vue → src/views/chainReportData/chainPurchaseReceiptReport/purchaseReceiptOrder.vue


+ 5 - 47
src/views/reportData/chainReceivedSendStorageReport/list.vue → src/views/chainReportData/chainReceivedSendStorageReport/list.vue

@@ -46,30 +46,12 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品品牌">
-                  <a-select
-                    placeholder="请选择产品品牌"
-                    id="sendStorageReportList-productBrandSn"
-                    allowClear
-                    v-model="queryParam.productEntity.productBrandSn"
-                    :showSearch="true"
-                    option-filter-prop="children"
-                    :filter-option="filterOption">
-                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                  </a-select>
+                  <ProductBrand id="sendStorageReportList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品分类">
-                  <a-cascader
-                    @change="changeProductType"
-                    change-on-select
-                    v-model="productType"
-                    expand-trigger="hover"
-                    :options="productTypeList"
-                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                    id="sendStorageReportList-productType"
-                    placeholder="请选择产品分类"
-                    allowClear />
+                  <ProductType id="sendStorageReportList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -125,12 +107,12 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import { linkageReportPageList, linkageReportPageTotal, linkageGroupList, reportChainStockPutOutExport } from '@/api/reportData'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
     return {
@@ -218,8 +200,6 @@ export default {
       },
       productType: [],
       linkageGroupData: [],
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [], //  分类下拉数据
       totalData: null // 合计
     }
   },
@@ -289,26 +269,6 @@ export default {
       this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -331,8 +291,6 @@ export default {
     },
     pageInit () {
       this.getLinkageGroup()
-      this.getProductBrand()
-      this.getProductType()
     }
   },
   mounted () {

+ 177 - 200
src/views/reportData/chainSalesDetailReport/list.vue → src/views/chainReportData/chainSalesDetailReport/list.vue

@@ -1,180 +1,170 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainSalesDetailReportList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
-      <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
-        <a-form-model
-          id="chainSalesDetailReportList-form"
-          ref="ruleForm"
-          class="form-model-con"
-          layout="inline"
-          :model="queryParam"
-          :rules="rules"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          @keyup.enter.native="handleSearch" >
-          <a-row :gutter="15">
+  <a-spin :spinning="spinning" tip="Loading...">
+    <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="chainSalesDetailReportList-form"
+        ref="ruleForm"
+        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="chainSalesDetailReportList-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-model-item label="客户名称">
+              <a-input id="chainSalesDetailReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+            </a-form-model-item>
+          </a-col>
+          <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="连锁店" prop="tenantId">
-                <a-select
-                  placeholder="请选择连锁店"
-                  id="chainSalesDetailReportList-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-form-model-item label="客户类型">
+                <a-select id="chainSalesDetailReportList-customerType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
+                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="审核时间" prop="time">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+              <a-form-model-item label="收款方式">
+                <v-select
+                  code="SETTLE_STYLE"
+                  id="chainSalesDetailReportList-settleStyleSn"
+                  v-model="queryParam.settleStyleSn"
+                  allowClear
+                  placeholder="请选择收款方式"
+                ></v-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户名称">
-                <a-input id="chainSalesDetailReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+              <a-form-model-item label="产品品牌">
+                <ProductBrand id="chainSalesDetailReportList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
               </a-form-model-item>
             </a-col>
-            <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="客户类型">
-                  <a-select id="chainSalesDetailReportList-customerType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
-                    <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="收款方式">
-                  <v-select code="SETTLE_STYLE" id="chainSalesDetailReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式" ></v-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="产品品牌">
-                  <a-select
-                    placeholder="请选择产品品牌"
-                    id="chainSalesDetailReportList-productBrandSn"
-                    allowClear
-                    v-model="queryParam.productEntity.productBrandSn"
-                    :showSearch="true"
-                    option-filter-prop="children"
-                    :filter-option="filterOption">
-                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                  </a-select>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品分类">
-                  <a-cascader
-                    @change="changeProductType"
-                    change-on-select
-                    v-model="productType"
-                    expand-trigger="hover"
-                    :options="productTypeList"
-                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                    id="chainSalesDetailReportList-productType"
-                    placeholder="请选择产品分类"
-                    allowClear />
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品编码">
-                  <a-input id="chainSalesDetailReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品名称">
-                  <a-input id="chainSalesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="仓库仓位">
-                  <a-cascader
-                    v-model="queryParam.warehouseCascade"
-                    expand-trigger="hover"
-                    :options="warehouseCascadeData"
-                    :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-                    id="chainSalesDetailReportList-warehouseCascade"
-                    placeholder="请选择仓库仓位"
-                    @change="warehouseCascadeChange"
-                    allowClear
-                    style="width: 100%;" />
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="单号">
-                  <a-input id="chainSalesDetailReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="业务员">
-                  <a-input id="chainSalesDetailReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品分类">
+                <ProductType id="chainSalesDetailReportList-productType" placeholder="请选择产品分类" :isDealer="true" @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="chainSalesDetailReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="chainSalesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="仓库仓位">
+                <a-cascader
+                  v-model="queryParam.warehouseCascade"
+                  expand-trigger="hover"
+                  :options="warehouseCascadeData"
+                  :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+                  id="chainSalesDetailReportList-warehouseCascade"
+                  placeholder="请选择仓库仓位"
+                  @change="warehouseCascadeChange"
+                  allowClear
+                  style="width: 100%;" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="单号">
+                <a-input id="chainSalesDetailReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="业务员">
+                <a-input id="chainSalesDetailReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="12" :sm="24">
+              <a-row>
+                <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>
+                        <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="7" offset="1">
+                    <a-form-model-item prop="citySn" style="margin: 0;">
+                      <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市" allowClear>
+                        <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="7" offset="1">
+                    <a-form-model-item prop="countySn" style="margin: 0;">
+                      <a-select v-model="queryParam.countySn" placeholder="请选择区/县" allowClear>
+                        <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
                 </a-form-model-item>
-              </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" 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>
-                          <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="citySn" style="margin: 0;">
-                        <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市" allowClear>
-                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="countySn" style="margin: 0;">
-                        <a-select v-model="queryParam.countySn" placeholder="请选择区/县" allowClear>
-                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
-              </a-col>
-            </template>
-            <a-col :md="6" :sm="24" style="margin-bottom: 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: 5px">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
+              </a-row>
             </a-col>
-          </a-row>
-        </a-form-model>
-      </div>
-      <!-- 合计 -->
-      <a-alert type="info" style="margin-bottom:10px">
-        <div class="ftext" slot="message">
-          产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+          </template>
+          <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: 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.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
-          总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
+        </div>
+        总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
         </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :defaultLoadData="false"
-        bordered>
-      </s-table>
-    </a-spin>
-  </a-card>
+      </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-spin>
 </template>
 
 <script>
@@ -183,12 +173,12 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { getArea } from '@/api/data'
 import { custTypeFindAllList } from '@/api/custType'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 import { warehouseCascadeList } from '@/api/warehouse'
 import { reportChainSalesBillDetailList, reportChainSalesBillDetailCount, linkageGroupList } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
     return {
@@ -228,20 +218,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -278,6 +254,29 @@ export default {
       warehouseCascadeData: [] //  仓库仓位
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(8, 0, { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {
@@ -351,32 +350,12 @@ export default {
         }
       })
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
     //  产品分类  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] : ''
     },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     // 连锁店
     getLinkageGroup () {
       linkageGroupList({}).then(res => {
@@ -470,8 +449,6 @@ export default {
       this.getLinkageGroup()
       this.getArea('province')
       this.getCustTypeList()
-      this.getProductBrand()
-      this.getProductType()
       this.getWarehouseCascade()
     }
   },

+ 0 - 0
src/views/reportData/chainSalesDetailsCountReport/list.vue → src/views/chainReportData/chainSalesDetailsCountReport/list.vue


+ 46 - 0
src/views/chainReportData/chainSalesReport/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="tabsReportList-wrap">
+    <div style="background-color: #fff;margin-bottom: 5px;">
+      <a-tabs default-active-key="1" v-model="curTab">
+        <a-tab-pane key="1" tab="连锁销售报表" v-if="$hasPermissions('M_chainSalesReportList')"></a-tab-pane>
+        <a-tab-pane key="2" tab="连锁销售明细报表" v-if="$hasPermissions('M_chainSalesDetailReportList')" force-render></a-tab-pane>
+      </a-tabs>
+    </div>
+    <a-card size="small" :bordered="false">
+      <salesReport v-show="curTab==1&&$hasPermissions('M_chainSalesReportList')"></salesReport>
+      <salesDetailReport v-show="curTab==2&&$hasPermissions('M_chainSalesDetailReportList')"></salesDetailReport>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import salesReport from './list.vue'
+import salesDetailReport from '@/views/chainReportData/chainSalesDetailReport/list.vue'
+export default {
+  name: 'ChainSalesReportIndex',
+  components: {
+    salesReport,
+    salesDetailReport
+  },
+  data () {
+    return {
+      curTab: '1'
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .tabsReportList-wrap{
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    .ant-tabs-bar{
+      margin: 0;
+    }
+    .ant-card{
+      flex-grow: 1;
+      overflow: auto;
+    }
+  }
+</style>

+ 140 - 123
src/views/reportData/chainSalesReport/list.vue → src/views/chainReportData/chainSalesReport/list.vue

@@ -1,129 +1,137 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainSalesReportList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
-      <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
-        <a-form-model
-          id="chainSalesReportList-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-spin :spinning="spinning" tip="Loading...">
+    <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="chainSalesReportList-form"
+        ref="ruleForm"
+        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="chainSalesReportList-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-model-item label="客户名称">
+              <a-input id="chainSalesReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+            </a-form-model-item>
+          </a-col>
+          <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="连锁店" prop="tenantId">
-                <a-select
-                  placeholder="请选择连锁店"
-                  id="chainSalesReportList-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-form-model-item label="客户类型">
+                <a-select id="chainSalesReportList-salesTargetType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
+                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="审核时间" prop="time">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+              <a-form-model-item label="收款方式">
+                <v-select
+                  code="SETTLE_STYLE"
+                  id="chainSalesReportList-settleStyleSn"
+                  v-model="queryParam.settleStyleSn"
+                  allowClear
+                  placeholder="请选择收款方式"
+                ></v-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户名称">
-                <a-input id="chainSalesReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+              <a-form-model-item label="单号">
+                <a-input id="chainSalesReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
               </a-form-model-item>
             </a-col>
-            <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="客户类型">
-                  <a-select id="chainSalesReportList-salesTargetType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
-                    <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="收款方式">
-                  <v-select code="SETTLE_STYLE" id="chainSalesReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式" ></v-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="单号">
-                  <a-input id="chainSalesReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="业务员">
-                  <a-input id="chainSalesReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="业务员">
+                <a-input id="chainSalesReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="12" :sm="24">
+              <a-row>
+                <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="请选择省">
+                        <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="7" offset="1">
+                    <a-form-model-item prop="citySn" style="margin: 0;">
+                      <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
+                        <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="7" offset="1">
+                    <a-form-model-item prop="countySn" style="margin: 0;">
+                      <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
+                        <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
                 </a-form-model-item>
-              </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" 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="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="citySn" style="margin: 0;">
-                        <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="countySn" style="margin: 0;">
-                        <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
-              </a-col>
-            </template>
-            <a-col :md="6" :sm="24" style="margin-bottom: 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">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
+              </a-row>
             </a-col>
-          </a-row>
-        </a-form-model>
-      </div>
-      <!-- 合计 -->
-      <a-alert type="info" style="margin-bottom:10px">
-        <div class="ftext" slot="message">
-          总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
-          产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+          </template>
+          <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">
+              {{ 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.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
-          总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
+        </div>
+        总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
         </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :defaultLoadData="false"
-        bordered>
-      </s-table>
-    </a-spin>
-  </a-card>
+      </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-spin>
 </template>
 
 <script>
@@ -163,19 +171,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -207,6 +202,28 @@ export default {
       custTypeList: [] //  客户类型 下拉数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {

+ 0 - 0
src/views/reportData/chainStockExpenditureReport/list.vue → src/views/chainReportData/chainStockExpenditureReport/list.vue


+ 0 - 0
src/views/reportData/chainStockIncomeReport/list.vue → src/views/chainReportData/chainStockIncomeReport/list.vue


+ 1 - 1
src/views/reportData/chainStockReport/detailModal.vue → src/views/chainReportData/chainStockReport/detailModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="960">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 合计 -->

+ 7 - 49
src/views/reportData/chainStockReport/list.vue → src/views/chainReportData/chainStockReport/list.vue

@@ -46,30 +46,12 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品品牌">
-                  <a-select
-                    placeholder="请选择产品品牌"
-                    id="chainStockReportList-productBrandSn"
-                    allowClear
-                    v-model="queryParam.productBrandSn"
-                    :showSearch="true"
-                    option-filter-prop="children"
-                    :filter-option="filterOption">
-                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                  </a-select>
+                  <ProductBrand id="chainStockReportList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品分类">
-                  <a-cascader
-                    @change="changeProductType"
-                    change-on-select
-                    v-model="productType"
-                    expand-trigger="hover"
-                    :options="productTypeList"
-                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                    id="chainStockReportList-productType"
-                    placeholder="请选择产品分类"
-                    allowClear />
+                  <ProductType id="chainStockReportList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -158,14 +140,14 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import chainStockReportDetailModal from './detailModal.vue'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
 import { linkageGroupList } from '@/api/reportData'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 import { reportStockList, reportStockCount } from '@/api/reportStock'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import { stockExport } from '@/api/stock'
 export default {
-  components: { STable, VSelect, chainStockReportDetailModal },
+  components: { STable, VSelect, chainStockReportDetailModal, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
     return {
@@ -208,7 +190,6 @@ export default {
         this.spinning = true
         if (params.tenantId) {
           if (this.checkValueRange()) {
-            console.log('====通过')
             return reportStockList(params).then(res => {
               let data
               if (res.status == 200) {
@@ -312,7 +293,6 @@ export default {
         days = '--'
       }
       return days
-      console.log(days, '天数')
     },
     // 合计
     getCount (params) {
@@ -346,8 +326,8 @@ export default {
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
-      this.queryParam.minUnsalableDays = undefined, // 滞销天数最小值
-      this.queryParam.maxUnsalableDays = undefined, // 滞销天数最大值
+      this.queryParam.minUnsalableDays = undefined // 滞销天数最小值
+      this.queryParam.maxUnsalableDays = undefined // 滞销天数最大值
       this.productType = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null
@@ -402,26 +382,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -444,8 +404,6 @@ export default {
     },
     pageInit () {
       this.getLinkageGroup()
-      this.getProductBrand()
-      this.getProductType()
     }
   },
   mounted () {

+ 1 - 1
src/views/common/auditModal.vue

@@ -5,7 +5,7 @@
     :footer="null"
     :maskClosable="false"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="416">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="audit-main">

+ 1 - 1
src/views/common/commonModal.vue

@@ -7,7 +7,7 @@
     v-model="isShow"
     :title="modalTit"
     :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="416">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main" v-html="modalHtml"></div>

+ 165 - 0
src/views/common/outInDetialModal.vue

@@ -0,0 +1,165 @@
+<template>
+  <a-modal
+    centered
+    class="outIndetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="出库明细"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="1024">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="baseInfo" v-if="baseData">
+        <div>
+          <span>产品编码:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.code : baseData.productCode }}</span>
+        </div>
+        <div>
+          <span>产品名称:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.name : baseData.productName }}</span>
+        </div>
+      </div>
+      <div class="outIndetail-modal-table">
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 450 }"
+          :defaultLoadData="false"
+          :showPagination="false"
+          bordered>
+        </s-table>
+      </div>
+      <div class="btn-cont">
+        <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { stockOutDetailList } from '@/api/stockOut'
+export default {
+  name: 'OutinDetailModal',
+  components: { STable },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    outBizType: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      baseData: null,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        // outBizType = SHOP_CALL_OUT(店内调出)   /  SALES (销售)
+        const params = this.baseData
+        console.log(params)
+        const queryParams = { outBizType: this.outBizType, productSn: params.productSn }
+        if (this.outBizType == 'SALES') {
+          queryParams.outBizSn = params.salesBillSn
+          queryParams.outBizNo = params.salesBillNo
+        }
+        if (this.outBizType == 'SHOP_CALL_OUT') {
+          queryParams.outBizSn = params.storeCallOutSn
+          queryParams.outBizNo = params.storeCallOutNo
+        }
+        // 仓库仓位
+        queryParams.warehouseSn = params.warehouseSn
+        queryParams.warehouseLocationSn = params.warehouseLocationSn
+        return stockOutDetailList(queryParams).then(res => {
+          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
+              data[i].totalCost = Number(data[i].putCost * data[i].outQty).toFixed(2)
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '库存批次', dataIndex: 'stockBatchNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次出库数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    cansel () {
+      this.isShow = false
+      this.baseData = null
+    },
+    getData (row) {
+      this.baseData = row
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.outIndetail-modal {
+	.ant-modal-body {
+		padding: 20px;
+    .outIndetail-modal-table{
+      padding: 20px 0 0;
+    }
+    .baseInfo{
+      line-height: 24px;
+      font-size: 14px;
+    }
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 50 - 14
src/views/common/pdfViewModal.vue

@@ -1,18 +1,20 @@
 <template>
   <a-modal
     centered
-    class="common-modal"
+    class="common-pdfView-modal"
     :footer="null"
     :maskClosable="false"
     v-model="isShow"
     :title="modalTit"
-    :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
-    @cancle="handleCommonCancel"
-    width="60%">
+    :zIndex="1001"
+    destroyOnClose
+    :bodyStyle="{padding: modalTit?'15px 15px 20px':'50px 32px 15px',background: '#f2f2f2'}"
+    @cancel="handleCommonCancel"
+    width="1024px">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main">
-        <div style="width: 100%;height: 500px;overflow: auto;border: 1px solid #eee;">
-          {{ page }} <span @click="page=page+1">下一页</span>
+        <vue-scroll :ops="ops" style="width: 100%;height: 70vh;">
+          <!-- {{ page }} <span @click="page=page+1">下一页</span> -->
           <div v-if="loadedRatio > 0 && loadedRatio < 1" style="background-color: green; color: white; text-align: center" :style="{ width: loadedRatio * 100 + '%' }">{{ Math.floor(loadedRatio * 100) }}%</div>
           <pdf
             ref="pdf"
@@ -26,19 +28,22 @@
             @error="error"
             @num-pages="numPages = $event"
             @link-clicked="page = $event"></pdf>
-        </div>
+        </vue-scroll>
       </div>
       <div class="btn-box">
-        <a-button type="default" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
-        <a-button type="primary" class="button-error" @click="handleCommonOk">{{ okText }}</a-button>
+        <a-button size="large" style="margin-right: 25px;" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button size="large" type="primary" :loading="$store.state.app.printLoading" @click="handleCommonOk">
+          {{ $store.state.app.printLoading?'打印中...':okText }}
+        </a-button>
       </div>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
-import pdf from 'vue-pdf'
-import CMapReaderFactory from 'vue-pdf/src/CMapReaderFactory.js'
+import pdf from 'vue-pdf-signature'
+import CMapReaderFactory from 'vue-pdf-signature/src/CMapReaderFactory.js'
+import { pdfPrint, getPrintList, hasExitTaskByName } from '@/libs/JGPrint'
 export default {
   components: {
     pdf
@@ -81,7 +86,22 @@ export default {
       numPages: 0,
       rotate: 0,
       curpage: 1,
-      total: 3
+      total: 3,
+      ops: {
+        vuescroll: {},
+        scrollPanel: {},
+        rail: {
+          keepShow: true
+        },
+        bar: {
+          hoverStyle: true,
+          onlyShowBarOnScroll: false, // 是否只有滚动的时候才显示滚动条
+          background: '#9d9d9d', // 滚动条颜色
+          opacity: 0.5, // 滚动条透明度
+          size: '10px',
+          'overflow-x': 'hidden'
+        }
+      }
     }
   },
   methods: {
@@ -89,6 +109,7 @@ export default {
       return pdf.createLoadingTask({ url: item, CMapReaderFactory })
     },
     setData (data) {
+      // console.log(data)
       this.pdfList = data
       this.src = data[0]
       this.curpage = 1
@@ -99,12 +120,27 @@ export default {
     },
     // 确定
     handleCommonOk () {
-      this.$emit('ok')
+      const _this = this
+      const printDefNeedle = _this.$store.state.app.printDefNeedle
+      const hasPrint = getPrintList().find(item => item.name == printDefNeedle)
+      // 已选择打印机
+      if (hasPrint) {
+        hasExitTaskByName(function () {
+          pdfPrint(_this.$store.state.app.pdfPrintList, 0)
+        })
+      } else {
+        // 选择打印机
+        _this.$store.commit('SET_showSelectPrint', true)
+      }
+      _this.$emit('ok')
     },
     // 取消
     handleCommonCancel () {
       this.isShow = false
       this.pdfList = []
+      this.$store.commit('SET_pdfPrintList', [])
+      this.$store.commit('SET_showPdfPrint', false)
+      this.$emit('cancel')
     },
     // 下载
     handleDownload () {
@@ -127,7 +163,7 @@ export default {
 </script>
 
 <style lang="less">
-  .common-modal{
+  .common-pdfView-modal{
     .common-main{
     }
     .btn-box{

+ 10 - 1
src/views/common/print.vue

@@ -5,7 +5,15 @@
       <a-radio value="INK">喷墨</a-radio>
     </a-radio-group>
     <a-button key="3" id="print-preview-btn" :disabled="disabled" @click="handlePrint('preview')">打印预览</a-button>
-    <a-button key="2" type="primary" id="print-print-btn" :disabled="disabled" @click="handlePrint('print')">快捷打印</a-button>
+    <a-button
+      key="2"
+      type="primary"
+      id="print-print-btn"
+      :disabled="disabled"
+      :loading="$store.state.app.printLoading"
+      @click="handlePrint('print')">
+      {{ $store.state.app.printLoading?'打印中...':'快捷打印' }}
+    </a-button>
     <a-button
       key="1"
       type="primary"
@@ -39,6 +47,7 @@ export default {
   },
   methods: {
     handlePrint (type) {
+      this.$store.dispatch('TogglePrintSettingType', this.printerType)
       this.$emit('handlePrint', type, this.printerType)
     }
   }

+ 16 - 2
src/views/common/productBrand.js

@@ -25,7 +25,11 @@ const ProductBrand = {
     },
     sysFlag: {
       type: [String,Number],
-      default: '1'
+      default: ''
+    },
+    tenantId: {
+      type: String,
+      default: ''
     }
   },
   data() {
@@ -40,6 +44,9 @@ const ProductBrand = {
   watch: {
     value(newValue, oldValue) {
       this.defaultVal = newValue
+    },
+    tenantId(newValue, oldValue){
+      console.log(newValue)
     }
   },
   methods: {
@@ -57,7 +64,14 @@ const ProductBrand = {
     },
     //  产品品牌列表, sysFlag: 1 箭冠 0 自建
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': this.sysFlag }).then(res => {
+      const params = {'sysFlag': this.sysFlag}
+      if(this.tenantId!="NONE"){
+        params.tenantId = this.tenantId
+      }
+      if(this.tenantId=="NONE"){
+        params.sysFlag = '1'
+      }
+      dealerProductBrandQuery(params).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {

+ 18 - 4
src/views/common/productType.js

@@ -26,7 +26,11 @@ const ProductType = {
     },
     isDealer: {
       type: Boolean,
-      default: false
+      default: true
+    },
+    tenantId: {
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -38,6 +42,9 @@ const ProductType = {
   watch: {
     value (newValue, oldValue) {
       this.defaultVal = newValue
+    },
+    tenantId(newValue, oldValue){
+      console.log(newValue)
     }
   },
   mounted () {
@@ -48,10 +55,17 @@ const ProductType = {
       this.defaultVal = value
       this.$emit('change', this.defaultVal)
     },
-    //  产品分类列表
+    //  产品分类列表 sysFlag: 1 箭冠 0 自建
     getProductType () {
+      const params = {}
+      if(this.tenantId!="NONE"){
+        params.tenantId = this.tenantId
+      }
+      if(this.tenantId=="NONE"){
+        params.sysFlag = '1'
+      }
       if(this.isDealer){
-        dealerProductTypeList({}).then(res => {
+        dealerProductTypeList(params).then(res => {
           if (res.status == 200) {
             this.productTypeList = res.data
           } else {
@@ -59,7 +73,7 @@ const ProductType = {
           }
         })
       }else{
-        productTypeQuery({}).then(res => {
+        productTypeQuery(params).then(res => {
           if (res.status == 200) {
             this.productTypeList = res.data
           } else {

+ 147 - 0
src/views/common/selectPrint.vue

@@ -0,0 +1,147 @@
+<template>
+  <a-modal
+    centered
+    class="common-selectPrint-modal"
+    :footer="null"
+    :maskClosable="false"
+    :zIndex="1002"
+    v-model="isShow"
+    :title="title"
+    :bodyStyle="{padding: title?'25px 32px 20px':'50px 32px 15px'}"
+    @cancel="handleCommonCancel"
+    :width="416">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main" v-if="printList&&printList.length">
+        <p style="color: #666;">选择打印机后,针式打印以后就会按这里设置的打印机去打印。<br>所以请正确选择打印机,如果选择错误,可以在顶部栏“设置”里面修改打印机。</p>
+        <a-select v-model="printIndex" @change="changePrint" style="width: 100%" placeholder="选择打印机">
+          <a-select-option v-for="item in printList" :key="'print-'+item.value" :value="item.name">
+            {{ item.name }}
+          </a-select-option>
+        </a-select>
+      </div>
+      <div v-else class="common-main">
+        <p>暂未发现打印机,请检查您的打印机是否连接正常</p>
+      </div>
+      <div class="btn-box">
+        <a-button type="default" style="margin-right:20px;" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button type="primary" v-if="printList&&printList.length" class="button-error" @click="handleCommonOk">{{ okText }}</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { getPrintList, pdfPrint, hasExitTaskByName } from '@/libs/JGPrint'
+export default {
+  name: 'CommonModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalHtml: {
+      type: String,
+      default: ''
+    },
+    okText: { // 确定 按钮文字
+      type: String,
+      default: '确定'
+    },
+    cancelText: { // 取消 按钮文字
+      type: String,
+      default: '取消'
+    },
+    isCancel: { // 是否显示  取消 按钮
+      type: Boolean,
+      default: true
+    },
+    spinning: { // 加载中
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      printIndex: undefined,
+      printList: [],
+      isSetting: 0,
+      printType: '',
+      title: ''
+    }
+  },
+  methods: {
+    // 确定
+    handleCommonOk () {
+      if (this.printIndex) {
+        // 保存默认设置
+        if (this.printType == 'NEEDLE') {
+          this.$store.commit('SET_printDefNeedle', this.printIndex)
+        }
+        // 继续打印
+        if (!this.isSetting) {
+          const pdfList = this.$store.state.app.pdfPrintList
+          hasExitTaskByName(function () {
+            pdfPrint(pdfList, 0)
+          })
+        }
+        // 关闭弹框
+        this.$store.commit('SET_showSelectPrint', false)
+        this.$emit('cancel')
+      } else {
+        this.$message.info('请选择打印机')
+      }
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+      this.$store.commit('SET_pdfPrintList', [])
+      this.$store.commit('SET_showSelectPrint', false)
+    },
+    getPrintList () {
+      this.isSetting = this.$store.state.app.printUseing == 0
+      this.printType = this.$store.state.app.printSettingType
+      this.printList = getPrintList()
+      this.printIndex = this.printIndex > 0 ? this.printIndex : undefined
+      console.log(this.printType)
+      this.title = this.printType == 'NEEDLE' ? '选择针式默认打印机' : '选择打印机'
+    },
+    changePrint (v) {
+      this.$store.state.app.printTaskID = undefined
+      this.printIndex = v
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.printIndex = undefined
+      } else {
+        // 获取打印机列表
+        this.getPrintList()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .common-selectPrint-modal{
+    .common-main{
+      display: flex;
+      flex-direction: column;
+      line-height: 24px;
+      .common-cont{
+      }
+    }
+    .btn-box{
+      text-align: center;
+      margin-top: 20px;
+    }
+  }
+</style>

+ 4 - 9
src/views/common/settleAccount.js

@@ -47,10 +47,11 @@ const SettleAccount = {
       this.defaultVal = newValue||undefined
     },
     settleStyleSn(a,b){
+      console.log(a,b)
       if(a){
         this.getList()
       }else{
-        this.clearVal()
+        this.handleChange(undefined)
       }
     }
   },
@@ -67,9 +68,9 @@ const SettleAccount = {
     },
     handleChange(value) {
       this.defaultVal = value;
-      const accountName = this.list.find(item => item[this.defValKey] == value).accountName
+      const row = this.list.find(item => item[this.defValKey] == value)
       this.$emit('input', value);
-      this.$emit('change', value, accountName);
+      this.$emit('change', this.defaultVal, row?row.accountName:'');
     },
     // 列表数据
     getList () {
@@ -82,12 +83,6 @@ const SettleAccount = {
         }
       })
     },
-    clearVal(){
-      this.list = []
-      this.defaultVal = undefined
-      this.$emit('input', undefined);
-      this.$emit('change', undefined, undefined);
-    }
   },
 };
 

+ 3 - 2
src/views/common/settleStyle.js

@@ -53,10 +53,11 @@ const SettleStyle = {
       )
     },
     handleChange(value) {
+      console.log(value)
       this.defaultVal = value;
-      const settleStyleName = this.list.find(item => item[this.defValKey] == value)
+      const row = this.list.find(item => item[this.defValKey] == value)
       this.$emit('input', value);
-      this.$emit('change', this.value, settleStyleName?settleStyleName.name:'');
+      this.$emit('change', this.defaultVal, row?row.name:'');
     },
     // 列表数据
     getList () {

+ 78 - 0
src/views/common/supplier.js

@@ -0,0 +1,78 @@
+import { supplierAllList } from '@/api/supplier.js'
+const Employee = {
+  template: `
+      <a-select
+        :placeholder="placeholder"
+        :id="id"
+        allowClear
+        :value="defaultVal"
+        :showSearch="true"
+        @change="handleChange"
+        option-filter-prop="children"
+        :filter-option="filterOption">
+        <a-select-option v-for="item in list" :key="item.supplierSn" :value="item.supplierSn">
+        {{ item.supplierName }}
+        </a-select-option>
+      </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder: {
+      type: String,
+      default: '请选择供应商'
+    },
+    enableFlag: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: []
+    };
+  },
+  mounted() {
+    this.getList()
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    },
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange(value) {
+      this.defaultVal = value;
+      const item = this.list.find(item => item.supplierSn == value)
+      this.$emit('change', value, item);
+      this.$emit('input', value);
+    },
+    getList () {
+      supplierAllList().then(res => {
+        if (res.status == 200) {
+          if(this.enableFlag!=''){
+            this.list = res.data.filter(item => item.enableFlag == this.enableFlag)
+          }else{
+            this.list = res.data
+          }
+        } else {
+          this.list = []
+        }
+      })
+    },
+  },
+};
+
+export default Employee

+ 2 - 2
src/views/customerManagement/customerInfo/detailModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="客户详情"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="960">
     <!-- 客户详情 -->
     <div>
@@ -21,7 +21,7 @@
           <a-descriptions-item label="配送方式:">{{ detailData&&detailData.dispatchTypeDictValue || '--' }}</a-descriptions-item>
           <a-descriptions-item label="是否卫星仓客户:">{{ detailData&&detailData.satelliteFlagDictValue || '--' }}</a-descriptions-item>
           <a-descriptions-item label="价格类型:">{{ detailData&&detailData.priceTypeDictValue || '--' }}</a-descriptions-item>
-          <a-descriptions-item label="收款方式:">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="收款方式:">{{ detailData&&detailData.settleStyleName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="客户类型:">{{ detailData&&detailData.customerTypeName || '--' }}</a-descriptions-item>
         </a-descriptions>
       </a-spin>

+ 17 - 3
src/views/customerManagement/customerInfo/edit.vue

@@ -110,7 +110,9 @@
             </a-col>
             <a-col :span="8">
               <a-form-model-item label="收款方式" prop="settleStyleSn">
-                <v-select code="SETTLE_STYLE" id="customerManagementEdit-settleStyleSn" v-model="form.settleStyleSn" allowClear placeholder="请选择收款方式" ></v-select>
+                <a-select id="customerManagementEdit-settleStyleSn" v-model="form.settleStyleSn" allowClear placeholder="请选择收款方式">
+                  <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
+                </a-select>
               </a-form-model-item>
             </a-col>
             <a-col :span="8">
@@ -133,7 +135,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { getArea } from '@/api/data'
 import custType from '@/views/common/custType.js'
-import { custSave, custFindById } from '@/api/customer'
+import { custSave, custFindById, settleStyleFindAllList } from '@/api/customer'
 export default {
   name: 'CustomerManagementEdit',
   components: { STable, VSelect, custType },
@@ -182,7 +184,8 @@ export default {
       },
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      addrDistrictList: [], //  区下拉
+      settleStyleList: [] //  收款方式  下拉数据
     }
   },
   methods: {
@@ -205,6 +208,16 @@ export default {
         }
       })
     },
+    // 收款方式
+    getSettleStyleList () {
+      settleStyleFindAllList().then(res => {
+        if (res.status == 200) {
+          this.settleStyleList = res.data
+        } else {
+          this.settleStyleList = []
+        }
+      })
+    },
     //  保存
     handleSubmit (e) {
       e.preventDefault()
@@ -302,6 +315,7 @@ export default {
     // 获取基础数据
     getBaseData () {
       this.getArea('province') //  省市区
+      this.getSettleStyleList() // 收款方式
       this.$refs.ruleForm.resetFields()
     },
     initPage () {

+ 8 - 21
src/views/financialManagement/companyCollectionPayment/list.vue

@@ -45,13 +45,13 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="结算方式">
-					  <v-select
-					  code="SETTLE_STYLE" 
-					  id="companyCollectionPaymentList-settleStyleSn" 
-					  v-model="queryParam.settleStyleSn" 
-					  allowClear 
-					  placeholder="请选择结算方式" 
-					  ></v-select>
+                  <v-select
+                    code="SETTLE_STYLE"
+                    id="companyCollectionPaymentList-settleStyleSn"
+                    v-model="queryParam.settleStyleSn"
+                    allowClear
+                    placeholder="请选择结算方式"
+                  ></v-select>
                 </a-form-item>
               </a-col>
             </template>
@@ -92,7 +92,7 @@
         bordered>
         <!-- 结算单号 -->
         <template slot="unitSettleNo" slot-scope="text, record">
-          <span :class="$hasPermissions('M_companyCollectionPayment_detail')?'active':'common'" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
+          <span :class="$hasPermissions('M_companyCollectionPayment_detail')?'table-td-link':'common'" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
         </template>
       </s-table>
     </a-spin>
@@ -103,7 +103,6 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { settleStyleQueryAll } from '@/api/settleStyle'
 import { settleUnitList, settleUnitQuerySum } from '@/api/settle'
 export default {
   name: 'CompanyCollectionPaymentList',
@@ -157,7 +156,6 @@ export default {
           return data
         })
       },
-      settleStyleList: [],
       total: 0, //  总条数
       productTotal: null
     }
@@ -198,22 +196,11 @@ export default {
       this.queryParam.settleStyleSn = undefined
       this.$refs.table.refresh(true)
     },
-    //  结算方式
-    getSettleStyle () {
-      settleStyleQueryAll({}).then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        } else {
-          this.settleStyleList = []
-        }
-      })
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.getSettleStyle()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

+ 1 - 1
src/views/financialManagement/companyReceivablePayable/chooseBillModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="全部单据"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="960">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->

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

@@ -285,9 +285,9 @@ export default {
     },
     // 选择结算方式
     settleStyleChange (v, name) {
-      console.log(name)
-      if (name) {
-        this.form.settleStyleName = name.dispName
+      this.form.settleStyleName = name.dispName
+      if (this.form.settleAccountSn) {
+        this.form.settleAccountSn = undefined
       }
     },
     settleAccountChange (v, name) {

+ 1 - 1
src/views/financialManagement/expenseManagement/detailModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="详情"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="600">
     <!-- 详情 -->
     <div>

+ 3 - 7
src/views/financialManagement/expenseManagement/edit.vue

@@ -121,9 +121,9 @@ export default {
     ...mapActions(['GetSettleAccountState']),
     // 选择结算方式
     settleStyleChange (v, name) {
-      console.log(name)
-      if (name) {
-        this.form.settleStyleName = name.dispName
+      this.form.settleStyleName = name.dispName
+      if (this.form.settleAccountSn) {
+        this.form.settleAccountSn = undefined
       }
     },
     //  递归函数
@@ -157,7 +157,6 @@ export default {
     },
     //  详情
     getDetail () {
-      this.spinning = true
       findExpenseDetail({ id: this.$route.params.id }).then(res => {
         if (res.status == 200) {
           this.form = Object.assign({}, this.form, res.data)
@@ -165,9 +164,6 @@ export default {
         } else {
           this.$refs.ruleForm.resetFields()
         }
-        setTimeout(() => {
-          this.spinning = false
-        }, 1000)
       })
     },
     //  保存

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

@@ -84,7 +84,7 @@
         </template>
         <!-- 费用单号 -->
         <template slot="accountExpensesNo" slot-scope="text, record">
-          <span :class="$hasPermissions('B_expenseDetail')?'active':'common'" @click="handleDetail(record)">{{ text }}</span>
+          <span :class="$hasPermissions('B_expenseDetail')?'table-td-link':'common'" @click="handleDetail(record)">{{ text }}</span>
         </template>
         <!-- 审核 -->
         <template slot="audit" slot-scope="text, record">

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

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="凭证"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="600">
     <!-- 详情 -->
     <div>

+ 11 - 5
src/views/financialManagement/financialCollection/list.vue

@@ -9,7 +9,7 @@
       </a-tabs>
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" @keyup.enter.native="searchForm">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="收款单号"><a-input id="financialCollectionList-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入收款单号" /></a-form-item>
@@ -48,7 +48,7 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
+                <a-button type="primary" @click="searchForm()" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
                 <a @click="advanced = !advanced" style="margin-left: 5px">
                   {{ advanced ? '收起' : '展开' }}
@@ -96,7 +96,7 @@
       >
         <!-- 关联单号 -->
         <template slot="bizNo" slot-scope="text, record">
-          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.bizNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.bizNo }}</span>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -132,7 +132,7 @@
       :title="curBizTitle"
       v-model="openDetailModal"
       v-if="openDetailModal&&fcBizType!='SPARE_PARTS_RETURN'"
-      @cancle="handleDetailClose"
+      @cancel="handleDetailClose"
       width="80%">
       <div style="max-height: 700px;overflow-y: auto;">
         <!-- 销售单 -->
@@ -396,12 +396,18 @@ export default {
       this.resetData()
       this.$refs.table.refresh(true)
     },
-    // 重置数据
+    // 查询
+    searchForm () {
+      this.$refs.table.clearSelected() // 清空表格选中项
+      this.$refs.table.refresh(true)
+    },
+    // 重置查询条件数据
     resetData () {
       if (this.advanced) {
         this.$refs.rangeDate.resetDate()
         // this.$refs.createDate.resetDate()
       }
+      this.$refs.table.clearSelected() // 清空表格选中项
       this.queryParam = {
         bizType: this.curBizType,
         settleNo: '',

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

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="凭证"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="600">
     <!-- 详情 -->
     <div v-if="detailsData">

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

@@ -9,7 +9,7 @@
       </a-tabs>
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" @keyup.enter.native="searchForm">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="付款单号"><a-input id="finacialPay-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入付款单号" /></a-form-item>
@@ -47,7 +47,7 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="finacialPay-refresh">查询</a-button>
+                <a-button type="primary" @click="searchForm()" :disabled="disabled" id="finacialPay-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="finacialPay-reset">重置</a-button>
                 <a @click="advanced = !advanced" style="margin-left: 5px">
                   {{ advanced ? '收起' : '展开' }}
@@ -331,6 +331,11 @@ export default {
         }
       })
     },
+    // 查询
+    searchForm () {
+      this.$refs.table.clearSelected() // 清空表格选中项
+      this.$refs.table.refresh(true)
+    },
     //  重置
     resetSearchForm () {
       this.resetData()
@@ -342,6 +347,7 @@ export default {
         this.$refs.rangeDate.resetDate()
         // this.$refs.createDate.resetDate()
       }
+      this.$refs.table.clearSelected() // 清空表格选中项
       this.queryParam = {
         bizType: this.curBizType,
         settleNo: '',

+ 1 - 3
src/views/financialManagement/fundAccountManagement/addModal.vue

@@ -106,9 +106,7 @@ export default {
       this.isEdit = false
     },
     settleStyleChange (v, name) {
-		 if (name) {
-        this.form.settleStyleName = name.dispName
-      }
+      this.form.settleStyleName = name.dispName
     },
     //  保存
     handleSubmit (e) {

+ 23 - 16
src/views/financialManagement/inventoryCheckAudit/list.vue

@@ -38,7 +38,7 @@
         bordered>
         <!-- 单号 -->
         <template slot="checkWarehouseNo" slot-scope="text, record">
-          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_inventoryCheckingDetail')" @click="handleDetail(record)">{{ record.checkWarehouseNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_inventoryCheckingDetail')" @click="handleDetail(record)">{{ record.checkWarehouseNo }}</span>
           <span v-else>{{ record.checkWarehouseNo }}</span>
         </template>
         <!-- 盈亏数量 -->
@@ -99,21 +99,6 @@ export default {
         endDate: undefined,
         checkWarehouseNo: ''
       },
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', 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: '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: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -139,6 +124,28 @@ export default {
       itemSn: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', 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: '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: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '总成本', dataIndex: 'totalStockCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 4 - 4
src/views/financialManagement/settleModal/settleModal.vue

@@ -31,7 +31,6 @@
             code="SETTLE_STYLE"
             id="expenseManagementEdit-settleStyleSn"
             v-model="form.settleStyleSn"
-            @change="settleStyleChange"
             allowClear
             placeholder="请选择结算方式"
           ></v-select>
@@ -55,9 +54,9 @@
 </template>
 
 <script>
+import { VSelect } from '@/components'
 import { commonMixin } from '@/utils/mixin'
 import settleAccount from '@/views/common/settleAccount'
-import { VSelect } from '@/components'
 export default {
   name: 'SettleModal',
   components: { settleAccount, VSelect },
@@ -102,8 +101,9 @@ export default {
       }
     },
     settleStyleChange (v, name) {
-      if (name) {
-        this.form.settleStyleName = name.dispName
+      this.form.settleStyleName = name.dispName
+      if (this.form.settleAccountSn) {
+        this.form.settleAccountSn = undefined
       }
     },
     //  保存

+ 26 - 18
src/views/financialManagement/warehousingAudit/detail.vue

@@ -16,18 +16,18 @@
       <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
-            <a-descriptions :column="3">
+            <a-descriptions :column="4">
               <a-descriptions-item label="供应商">{{ basicInfoData&&basicInfoData.purchaseTargetName ? basicInfoData.purchaseTargetName : '--' }}</a-descriptions-item>
               <a-descriptions-item label="入库时间">{{ basicInfoData&&basicInfoData.stockPutTime ? basicInfoData.stockPutTime : '--' }}</a-descriptions-item>
               <a-descriptions-item label="采购单号">{{ basicInfoData&&basicInfoData.purchaseBillNo ? basicInfoData.purchaseBillNo : '--' }}</a-descriptions-item>
             </a-descriptions>
-            <a-descriptions :column="3" bordered size="small">
+            <a-descriptions :column="4" size="small">
               <a-descriptions-item label="采购总款数">{{ basicInfoData&&(basicInfoData.totalCategory || basicInfoData.totalCategory==0) ? basicInfoData.totalCategory : '--' }}</a-descriptions-item>
               <a-descriptions-item label="采购总数量">{{ basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0) ? basicInfoData.totalQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="采购总成本">{{ basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount==0) ? '¥'+basicInfoData.totalAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="采购总成本" v-if="$hasPermissions('M_ShowAllCost')">{{ basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount==0) ? '¥'+basicInfoData.totalAmount : '--' }}</a-descriptions-item>
               <a-descriptions-item label="入库总款数">{{ basicInfoData&&(basicInfoData.totalPutCategory || basicInfoData.totalPutCategory==0) ? basicInfoData.totalPutCategory : '--' }}</a-descriptions-item>
               <a-descriptions-item label="入库总数量">{{ basicInfoData&&(basicInfoData.totalPutQty || basicInfoData.totalPutQty==0) ? basicInfoData.totalPutQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="入库总成本">{{ basicInfoData&&(basicInfoData.totalPutAmount || basicInfoData.totalPutAmount==0) ? '¥'+basicInfoData.totalPutAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="入库总成本" v-if="$hasPermissions('M_ShowAllCost')">{{ basicInfoData&&(basicInfoData.totalPutAmount || basicInfoData.totalPutAmount==0) ? '¥'+basicInfoData.totalPutAmount : '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -67,20 +67,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '15%', 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: 'discountedPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库小计', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库', dataIndex: 'warehouseEntity.name', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -105,6 +91,28 @@ export default {
       printerType: 'NEEDLE' //  打印机类型
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '15%', 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: 'discountedPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '入库小计', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseEntity.name', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '成本价', dataIndex: 'discountedPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '入库小计', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回列表
     handleBack () {

+ 23 - 16
src/views/financialManagement/warehousingAudit/list.vue

@@ -67,7 +67,7 @@
         bordered>
         <!-- 发货单号 -->
         <template slot="receivingBillNo" slot-scope="text, record">
-          <span v-if="record.receivingBillNo" :class="$hasPermissions('M_warehousingAudit_detail')?'active':'common'" @click="handleDetail(record)">{{ record.receivingBillNo }}</span>
+          <span v-if="record.receivingBillNo" :class="$hasPermissions('M_warehousingAudit_detail')?'table-td-link':'common'" @click="handleDetail(record)">{{ record.receivingBillNo }}</span>
           <span v-else>--</span>
         </template>
         <!-- 审核 -->
@@ -128,20 +128,6 @@ export default {
         receivingBillNo: '',
         auditState: 'WAIT_PUT_WAREHOUSE_AUDIT'
       },
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '发货单号', scopedSlots: { customRender: 'receivingBillNo' }, width: '15%', align: 'center' },
-        { title: '总款数', dataIndex: 'totalPutCategory', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库总数量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库总成本', dataIndex: 'totalPutAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '签收入库时间', dataIndex: 'stockPutTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务入库审核时间', dataIndex: 'auditTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
-        // { title: '财务审核状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -172,6 +158,27 @@ export default {
       productTotal: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货单号', scopedSlots: { customRender: 'receivingBillNo' }, width: '15%', align: 'center' },
+        { title: '总款数', dataIndex: 'totalPutCategory', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库总数量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '入库总成本', dataIndex: 'totalPutAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '签收入库时间', dataIndex: 'stockPutTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务入库审核时间', dataIndex: 'auditTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        // { title: '财务审核状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '入库总成本', dataIndex: 'totalPutAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {
@@ -261,6 +268,7 @@ export default {
     // 是否从首页点击进入
     const isHomeNav = this.getIsHomeNav()[this.$route.name]
     console.log(this.getIsHomeNav(), isHomeNav, this.$route.name)
+    this.pageInit()
     // 待办查询
     if (isHomeNav && isHomeNav.type == 'todo') {
       this.resetData(true)
@@ -269,7 +277,6 @@ export default {
     } else {
       // 如果是新页签打开
       if (this.$store.state.app.isNewTab) {
-        this.pageInit()
         this.resetSearchForm()
       }
     }

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

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="申请提现"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 表单 -->

+ 1 - 1
src/views/inventoryManagement/inventoryChecking/basicInfoModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="新增盘点单"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancel="isShow = false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model

+ 4 - 2
src/views/inventoryManagement/inventoryChecking/detailModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     title="详情"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancel="isShow = false"
     width="80%">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-card size="small" :bordered="false" class="inventoryCheckingDetail-cont">
@@ -58,7 +58,9 @@
                 <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 style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                    总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>
+                  </div>
                 </div>
                 <div>
                   盘盈总数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong>,

+ 24 - 16
src/views/inventoryManagement/inventoryChecking/list.vue

@@ -60,7 +60,7 @@
       bordered>
       <!-- 单号 -->
       <template slot="checkWarehouseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_inventoryCheckingDetail')" @click="handleDetail(record)">{{ record.checkWarehouseNo }}</span>
+        <span class="table-td-link" v-if="$hasPermissions('B_inventoryCheckingDetail')" @click="handleDetail(record)">{{ record.checkWarehouseNo }}</span>
         <span v-else>{{ record.checkWarehouseNo }}</span>
       </template>
       <!-- 监盘人审核 -->
@@ -150,21 +150,6 @@ export default {
       tableHeight: 0,
       advanced: true,
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '12%', 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: '10%', 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: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'checkSuperviseTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '监盘人审核', scopedSlots: { customRender: 'dpaudit' }, width: '3%', align: 'center' },
-        { title: '财务人审核', scopedSlots: { customRender: 'cwaudit' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -193,6 +178,29 @@ export default {
       itemSn: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '12%', 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: '10%', 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: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'checkSuperviseTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '监盘人审核', scopedSlots: { customRender: 'dpaudit' }, width: '3%', align: 'center' },
+        { title: '财务人审核', scopedSlots: { customRender: 'cwaudit' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '总成本', dataIndex: 'totalStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 4 - 2
src/views/inventoryManagement/inventoryChecking/makeInventory.vue

@@ -56,7 +56,9 @@
               <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 style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
+                </div>
                 盘盈数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong> ,
                 盘亏数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>
               </div>
@@ -171,7 +173,7 @@
       :maskClosable="false"
       centered
       title="导出excel"
-      @cancle="exportShow=false"
+      @cancel="exportShow=false"
     >
       <div style="line-height: 48px;padding: 0 30px;">
         <div>盘点单号:{{ basicInfoData&&basicInfoData.checkWarehouseNo }}</div>

+ 4 - 2
src/views/inventoryManagement/inventoryChecking/overall.vue

@@ -27,8 +27,10 @@
         <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">
             总款数: <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.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              ,总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>。
+            </div>
           </div>
         </a-alert>
         <!-- 筛选条件 -->

+ 4 - 2
src/views/inventoryManagement/inventoryChecking/printModal.vue

@@ -6,7 +6,7 @@
     class="inventoryChecking-print-type-modal"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="600">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
@@ -42,7 +42,9 @@
       </a-form-model>
       <div class="btn-cont">
         <a-button type="primary" id="inventoryChecking-print-save" @click="handleSave()">打印预览</a-button>
-        <a-button id="inventoryChecking-print-back" @click="handleCancel" style="margin-left: 15px;">快捷打印</a-button>
+        <a-button id="inventoryChecking-print-back" @click="handleCancel" :loading="$store.state.app.printLoading" style="margin-left: 15px;">
+          {{ $store.state.app.printLoading?'打印中...':'快捷打印' }}
+        </a-button>
       </div>
     </a-spin>
   </a-modal>

+ 11 - 3
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -32,7 +32,7 @@
               <a-button size="small" type="primary" class="button-info" @click.stop="handleBatchAdd('batch')" id="chainTransferOutEdit-del-all-btn">批量添加</a-button>
             </a-col>
             <a-col :md="20" :sm="24">
-              <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-form layout="inline" @keyup.enter.native="searchForm">
                 <a-row :gutter="15">
                   <a-col :md="6" :sm="24">
                     <a-form-item label="产品编码" prop="productCode">
@@ -64,7 +64,7 @@
                     </a-col>
                   </template>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckSelfDiskList-refresh">查询</a-button>
+                    <a-button type="primary" @click="searchForm" :disabled="disabled" id="inventoryCheckSelfDiskList-refresh">查询</a-button>
                     <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckSelfDiskList-reset">重置</a-button>
                     <a @click="advanced=!advanced" style="margin-left: 5px">
                       {{ advanced ? '收起' : '展开' }}
@@ -174,7 +174,9 @@
               <div slot="message">
                 总款数: <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 style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>。
+                </div>
               </div>
             </a-alert>
           </a-col>
@@ -346,8 +348,14 @@ export default {
     rowChooseSelectionFun (obj) {
       this.rowChooseSelectionInfo = obj || null
     },
+    // 查询
+    searchForm () {
+      this.$refs.table.clearSelected() // 清空表格选中项
+      this.$refs.table.refresh(true)
+    },
     //  重置
     resetSearchForm () {
+      this.$refs.table.clearSelected() // 清空表格选中项
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.warehouseSn = undefined

+ 17 - 10
src/views/inventoryManagement/inventoryImport/list.vue

@@ -96,16 +96,6 @@ export default {
       tableHeight: 0,
       queryParam: {}, // 查询参数
       isAllError: false, // 是否全部错误
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '错误原因', dataIndex: 'errorMsg', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       listData: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -138,6 +128,23 @@ export default {
       filePath: 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/StockImports.xlsx'
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '错误原因', dataIndex: 'errorMsg', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 上传文件  change
     changeImport (file) {

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

@@ -6,16 +6,20 @@
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow=false"
+    @cancel="isShow=false"
     :width="960">
     <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 style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? currentStock.currentStockCost : '--' }}</strong>;
+          </div>
           冻结库存总数量(个):<strong>{{ currentStock&&(currentStock.freezeQty || currentStock.freezeQty==0) ? currentStock.freezeQty : '--' }}</strong>;
-          冻结库存总成本(¥):<strong>{{ currentStock&&(currentStock.freezeCost || currentStock.freezeCost==0) ? currentStock.freezeCost : '--' }}</strong>。
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            冻结库存总成本(¥):<strong>{{ currentStock&&(currentStock.freezeCost || currentStock.freezeCost==0) ? currentStock.freezeCost : '--' }}</strong>。
+          </div>
         </div>
       </a-alert>
       <!-- 库存详情 -->
@@ -60,14 +64,9 @@ export default {
   computed: {
     modalTit () {
       return '库存详情'
-    }
-  },
-  data () {
-    return {
-      spinning: false,
-      isShow: this.openModal, //  是否打开弹框
-      // 表头
-      columns: [
+    },
+    columns () {
+      const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
@@ -77,14 +76,24 @@ export default {
         { 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: '可用库存数量', dataIndex: 'currentQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '冻结库存数量', dataIndex: 'freezeQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
+        { title: '冻结库存数量', dataIndex: 'freezeQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(10, 0, { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return stockDetailList(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', isSellOut: '0' })).then(res => {
+        return stockDetailList(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', existStockFlag: '1' })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -94,7 +103,7 @@ export default {
             }
             this.disabled = false
             // 总计
-            this.getTotal(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', isSellOut: '0' }))
+            this.getTotal(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', existStockFlag: '1' }))
           }
           this.spinning = false
           return data

+ 46 - 73
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -22,31 +22,14 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品品牌">
-                  <a-select
-                    placeholder="请选择产品品牌"
-                    id="inventoryQueryList-productBrandSn"
-                    allowClear
-                    v-model="queryParam.productBrandSn"
-                    :showSearch="true"
-                    option-filter-prop="children"
-                    :filter-option="filterOption">
-                    <a-select-option v-for="item in brandData" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                  </a-select>
-                </a-form-item>
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="inventoryQueryList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品分类">
-                  <a-cascader
-                    :options="typeData"
-                    expand-trigger="hover"
-                    change-on-select
-                    :field-names="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                    placeholder="请选择产品分类"
-                    allowClear
-                    v-model="productTypeSn"
-                    @change="changeType" />
-                </a-form-item>
+                <a-form-model-item label="产品分类">
+                  <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeType" v-model="productTypeSn"></ProductType>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="滞销天数">
@@ -80,7 +63,7 @@
             </template>
             <a-col :md="12" :sm="24">
               <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
-              <a-checkbox v-model="queryParam.productEnabledFlag" :checked="queryParam.productEnabledFlag" id="inventoryQueryList-productEnabledFlag">包括禁用产品</a-checkbox>
+              <a-checkbox v-model="queryParam.enableFlag" :checked="queryParam.enableFlag" id="inventoryQueryList-enableFlag">包括禁用产品</a-checkbox>
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
               <a-button
@@ -103,7 +86,9 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
           可用库存总数量(个):<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}</strong>;
-          可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
+          </div>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -157,14 +142,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { stockList, stockCount, stockExport } from '@/api/stock'
-import { dealerProductTypeList } from '@/api/dealerProductType'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'InventoryQueryList',
-  components: { STable, VSelect, inventoryQueryDetailModal },
+  components: { STable, VSelect, inventoryQueryDetailModal, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
     return {
@@ -180,33 +165,20 @@ export default {
         productTypeSn2: '', //  产品分类2
         productTypeSn3: '', //  产品分类3
         zeroQtyFlag: false, //  库存情况
-        productEnabledFlag: true, // 显示禁用产品
+        enableFlag: true, // 显示禁用产品
         minUnsalableDays: undefined, // 滞销天数最小值
         maxUnsalableDays: undefined // 滞销天数最大值
       },
       productTypeSn: [],
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌下拉数据
-      typeData: [], //  产品分类下拉数据
       zeroQtyData: [ //  库存情况
         { name: '库存数量为0', id: '1' },
         { name: '库存数量不为0', id: '0' }
       ],
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '16%', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'brandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: '13%', align: 'center' },
-        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: <div><a-tooltip placement='top' title='1:产品距离最近一次销售的时间,30天算一个月 2:采购退货,调拨等不算销售,不用来计算滞销天数'><a-icon type="question-circle" /></a-tooltip>&nbsp;滞销天数</div>, width: '10%', align: 'center', scopedSlots: { customRender: 'unsalableDays' }, sorter: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        console.log(parameter)
         // 查询条件有直销天数先校验滞销天数
         if (this.checkValueRange()) {
           this.disabled = true
@@ -220,9 +192,13 @@ export default {
             parameter.sortField = 'currentStockCost'
             parameter.sortAlias = 'stock'
           }
+          if (parameter.sortField == 'unsalableDays') {
+            parameter.sortField = 'unsalableDays'
+            parameter.sortAlias = ''
+          }
           const params = Object.assign(parameter, this.queryParam)
           params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
-          params.productEnabledFlag = params.productEnabledFlag ? '' : '1'
+          params.enableFlag = params.enableFlag ? '' : '1'
           return stockList(params).then(res => {
             let data
             if (res.status == 200) {
@@ -234,14 +210,6 @@ export default {
               this.disabled = false
               // 总计
               this.getTotal(params)
-              // 产品分类
-              if (this.typeData.length == 0) {
-                this.getProductType()
-              }
-              // 产品品牌
-              if (this.brandData.length == 0) {
-                this.getProductBrand()
-              }
             }
             this.spinning = false
             return data
@@ -251,7 +219,7 @@ export default {
           this.disabled = true
           this.spinning = true
           return new Promise(function (resolve, reject) {
-            const data = []
+            const data = { list: [], count: 0, pageNo: 1, pageSize: 10 }
             _this.disabled = false
             _this.spinning = false
             resolve(data)
@@ -263,6 +231,26 @@ export default {
       currentStock: null
     }
   },
+  computed: {
+    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: '16%', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: '13%', align: 'center' },
+        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div><a-tooltip placement='top' title='1:产品距离最近一次销售的时间,30天算一个月 2:采购退货,调拨等不算销售,不用来计算滞销天数'><a-icon type="question-circle" /></a-tooltip>&nbsp;滞销天数</div>, width: '10%', align: 'center', dataIndex: 'unsalableDays', scopedSlots: { customRender: 'unsalableDays' }, sorter: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 校验滞销天数数值范围
     checkValueRange () {
@@ -357,7 +345,8 @@ export default {
       const _this = this
       const params = JSON.parse(JSON.stringify(this.queryParam))
       params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
-      params.productEnabledFlag = params.productEnabledFlag ? '' : '1'
+      params.enableFlag = params.enableFlag ? '' : '1'
+      params.showCost = this.$hasPermissions('M_ShowAllCost') ? 1 : 0
       this.exportLoading = true
       _this.spinning = true
       stockExport(params).then(res => {
@@ -374,16 +363,10 @@ export default {
           })
           reader.readAsText(res)
         } else {
-		  downloadExcel(res, '库存查询')
+          downloadExcel(res, '库存查询')
         }
       })
     },
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        this.recursionFun(res.data)
-        this.typeData = res.data
-      })
-    },
     //  递归函数
     recursionFun (data) {
       if (data) {
@@ -407,16 +390,6 @@ export default {
         this.queryParam.productTypeSn3 = ''
       }
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.brandData = res.data
-        } else {
-          this.brandData = []
-        }
-      })
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -428,7 +401,7 @@ export default {
         _this.setTableH()
       })
       // 是否默认包括禁用产品
-      this.queryParam.productEnabledFlag = localStorage.getItem('productEnabledFlag-' + this.$store.state.user.info.orgId) != 'false'
+      this.queryParam.enableFlag = localStorage.getItem('productEnabledFlag-' + this.$store.state.user.info.orgId) != 'false'
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
@@ -442,7 +415,7 @@ export default {
         _this.setTableH()
       })
     },
-    'queryParam.productEnabledFlag' (newValue, oldValue) {
+    'queryParam.enableFlag' (newValue, oldValue) {
       localStorage.setItem('productEnabledFlag-' + this.$store.state.user.info.orgId, newValue)
     },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度

+ 31 - 19
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -84,9 +84,13 @@
         <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 style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? productTotal.currentStockCost : '--' }}</strong>;
+            </div>
             冻结库存总数量(个):<strong>{{ productTotal&&(productTotal.freezeQty || productTotal.freezeQty==0) ? productTotal.freezeQty : '--' }}</strong>;
-            冻结库存总成本(¥):<strong>{{ productTotal&&(productTotal.freezeCost || productTotal.freezeCost==0) ? productTotal.freezeCost : '--' }}</strong>。
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              冻结库存总成本(¥):<strong>{{ productTotal&&(productTotal.freezeCost || productTotal.freezeCost==0) ? productTotal.freezeCost : '--' }}</strong>。
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -141,23 +145,6 @@ export default {
         state: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'product.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '12%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '批次号', dataIndex: 'stockBatchNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联单据号', dataIndex: 'bizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'unitName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '数量', scopedSlots: { customRender: 'qty' }, width: '5%', align: 'center' },
-        { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '出入库状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -187,6 +174,31 @@ export default {
       productTotal: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'product.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '12%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单据号', dataIndex: 'bizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'unitName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '数量', scopedSlots: { customRender: 'qty' }, width: '5%', align: 'center' },
+        // { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '出入库状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(12, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 9 - 55
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -22,32 +22,14 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品品牌">
-                  <a-select
-                    placeholder="请选择产品品牌"
-                    id="inventoryWarningList-productBrandSn"
-                    allowClear
-                    v-model="queryParam.productBrandSn"
-                    :showSearch="true"
-                    option-filter-prop="children"
-                    :filter-option="filterOption">
-                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                  </a-select>
-                </a-form-item>
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="inventoryWarningList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品分类">
-                  <a-cascader
-                    @change="changeProductType"
-                    change-on-select
-                    v-model="productType"
-                    expand-trigger="hover"
-                    :options="productTypeList"
-                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                    id="inventoryWarningList-productType"
-                    placeholder="请选择产品分类"
-                    allowClear />
-                </a-form-item>
+                <a-form-model-item label="产品分类">
+                  <ProductType id="inventoryWarningList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="预警提示">
@@ -174,11 +156,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { stockWarnList, stockWarnSaveBatch } from '@/api/stockWarn'
-import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-import { dealerProductTypeList } from '@/api/dealerProductType'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 export default {
   name: 'InventoryWarning',
-  components: { STable, VSelect },
+  components: { STable, VSelect, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
     return {
@@ -352,39 +334,11 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      // sysFlag不传,此处应查询所有产品
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.getProductType()
-      this.getProductBrand()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

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