Browse Source

Merge commit '567463b0156d8f14059046fcd6c1b037330e6490' into HEAD

gitadmin 3 years ago
parent
commit
315dab4d2c
87 changed files with 4746 additions and 22434 deletions
  1. 1 1
      .env.development
  2. 1 1
      .env.practice
  3. 3 22017
      package-lock.json
  4. 4 2
      package.json
  5. 1 1
      public/version.json
  6. 9 1
      src/api/allocWarehouse.js
  7. 52 0
      src/api/purchaseReturn.js
  8. 26 0
      src/api/salesDetail.js
  9. 26 0
      src/api/settle.js
  10. 77 0
      src/api/settleAcount.js
  11. 17 0
      src/components/Select/index.js
  12. 22 22
      src/components/index.js
  13. 110 11
      src/config/router.config.js
  14. 2 2
      src/core/lazy_use.js
  15. 2 2
      src/core/use.js
  16. 1 1
      src/layouts/BasicLayout.vue
  17. 4 4
      src/libs/JGPrint.js
  18. 50 0
      src/libs/exportExcel.js
  19. 1 0
      src/store/getters.js
  20. 41 3
      src/store/modules/user.js
  21. 9 7
      src/views/Home.vue
  22. 1 1
      src/views/allocationManagement/chainTransferIn/edit.vue
  23. 20 4
      src/views/allocationManagement/chainTransferIn/list.vue
  24. 6 4
      src/views/allocationManagement/chainTransferOut/edit.vue
  25. 20 4
      src/views/allocationManagement/chainTransferOut/list.vue
  26. 7 6
      src/views/allocationManagement/storeTransferOut/edit.vue
  27. 20 4
      src/views/allocationManagement/storeTransferOut/list.vue
  28. 3 3
      src/views/allocationManagement/warehouseAllocation/detail.vue
  29. 32 10
      src/views/allocationManagement/warehouseAllocation/edit.vue
  30. 15 9
      src/views/allocationManagement/warehouseAllocation/list.vue
  31. 3 2
      src/views/bulkManagement/bulkReturnGoods/basicInfoModal.vue
  32. 2 2
      src/views/bulkManagement/bulkReturnGoods/detailModal.vue
  33. 1 1
      src/views/bulkManagement/bulkReturnGoods/edit.vue
  34. 1 1
      src/views/bulkManagement/bulkReturnGoods/grabEdit.vue
  35. 23 5
      src/views/bulkManagement/bulkReturnGoods/list.vue
  36. 3 2
      src/views/bulkManagement/bulkWarehousingOrder/basicInfoModal.vue
  37. 1 1
      src/views/bulkManagement/bulkWarehousingOrder/edit.vue
  38. 3 2
      src/views/bulkManagement/bulkWarehousingOrder/list.vue
  39. 86 0
      src/views/common/settleAccount.js
  40. 75 0
      src/views/common/settleStyle.js
  41. 1 0
      src/views/customerManagement/customerInfo/edit.vue
  42. 1 0
      src/views/financialManagement/companyReceivablePayable/chooseBillModal.vue
  43. 172 62
      src/views/financialManagement/companyReceivablePayable/collectionPayment.vue
  44. 2 4
      src/views/financialManagement/companyReceivablePayable/detail.vue
  45. 36 21
      src/views/financialManagement/expenseManagement/edit.vue
  46. 9 3
      src/views/financialManagement/expenseManagement/list.vue
  47. 140 28
      src/views/financialManagement/financialCollection/list.vue
  48. 75 30
      src/views/financialManagement/financialPayment/list.vue
  49. 173 0
      src/views/financialManagement/fundAccountManagement/addModal.vue
  50. 251 0
      src/views/financialManagement/fundAccountManagement/detail.vue
  51. 317 0
      src/views/financialManagement/fundAccountManagement/list.vue
  52. 8 2
      src/views/financialManagement/inventoryCheckAudit/list.vue
  53. 153 0
      src/views/financialManagement/settleModal/settleModal.vue
  54. 9 2
      src/views/financialManagement/warehousingAudit/list.vue
  55. 17 5
      src/views/inventoryManagement/inventoryChecking/list.vue
  56. 1 1
      src/views/inventoryManagement/inventoryChecking/makeInventory.vue
  57. 1 1
      src/views/inventoryManagement/inventoryChecking/overall.vue
  58. 37 25
      src/views/inventoryManagement/inventoryChecking/selfDisk.vue
  59. 10 6
      src/views/inventoryManagement/inventoryQuery/list.vue
  60. 3 1
      src/views/numsGoodsShelves/replenishmentManagement/list.vue
  61. 11 4
      src/views/outboundOrderManagement/outboundOrder/list.vue
  62. 1 0
      src/views/productManagement/productInfo/edit.vue
  63. 1 1
      src/views/purchasingManagement/purchaseOrder/detail.vue
  64. 8 6
      src/views/purchasingManagement/purchaseOrder/edit.vue
  65. 31 11
      src/views/purchasingManagement/purchaseOrder/list.vue
  66. 1 1
      src/views/purchasingManagement/purchaseOrder/warehousing.vue
  67. 2 2
      src/views/purchasingManagement/purchaseReturn/detail.vue
  68. 6 4
      src/views/purchasingManagement/purchaseReturn/edit.vue
  69. 24 6
      src/views/purchasingManagement/purchaseReturn/list.vue
  70. 198 0
      src/views/purchasingManagement/purchaseReturnOutSync/basicInfoModal.vue
  71. 199 0
      src/views/purchasingManagement/purchaseReturnOutSync/detail.vue
  72. 545 0
      src/views/purchasingManagement/purchaseReturnOutSync/edit.vue
  73. 515 0
      src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue
  74. 379 0
      src/views/purchasingManagement/purchaseReturnOutSync/list.vue
  75. 1 1
      src/views/purchasingManagement/signWarehousing/edit.vue
  76. 15 3
      src/views/purchasingManagement/signWarehousing/list.vue
  77. 6 22
      src/views/salesManagement/salesQuery/chooseCustomModal.vue
  78. 199 0
      src/views/salesManagement/salesQuery/chooseImportModal.vue
  79. 76 9
      src/views/salesManagement/salesQuery/edit.vue
  80. 201 0
      src/views/salesManagement/salesQuery/importGuideModal.vue
  81. 10 20
      src/views/salesManagement/salesQuery/list.vue
  82. 14 2
      src/views/salesManagement/salesReturn/list.vue
  83. 1 6
      src/views/salesManagement/salesReturn/salesReturnEdit.vue
  84. 1 0
      src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue
  85. 1 1
      src/views/salesManagement/urgentItemsOffset/detail.vue
  86. 8 3
      src/views/salesManagement/urgentItemsOffset/list.vue
  87. 95 5
      vue.config.js

+ 1 - 1
.env.development

@@ -3,7 +3,7 @@ VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=/api
 VUE_APP_WX_BASE_URL=//192.168.16.103:8503/qpls-md/websocket/
 VUE_APP_VERSION=V1.0.1
-VUE_APP_ENVTIPS=开发环境
+VUE_APP_ENVTIPS=开发环境(仅供测试)
 VUE_APP_PRO_NAME=iSCM智慧供应链系统
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#f30f30

+ 1 - 1
.env.practice

@@ -3,7 +3,7 @@ VUE_APP_PREVIEW=false
 VUE_APP_API_BASE_URL=https://t.iscm.360arrow.com/qpls-md
 VUE_APP_WX_BASE_URL=//t.iscm.360arrow.com/qpls-md/websocket/
 VUE_APP_VERSION=V1.0.1
-VUE_APP_ENVTIPS=练习环境
+VUE_APP_ENVTIPS=练习环境(仅供测试)
 VUE_APP_PRO_NAME=iSCM智慧供应链系统
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#f30f30

File diff suppressed because it is too large
+ 3 - 22017
package-lock.json


+ 4 - 2
package.json

@@ -3,6 +3,7 @@
   "version": "2.0.0",
   "private": true,
   "scripts": {
+    "report": "set npm_config_report=true && vue-cli-service build",
     "serve": "vue-cli-service serve",
     "dev": "vue-cli-service serve",
     "build": "vue-cli-service build",
@@ -14,7 +15,6 @@
     "postinstall": "opencollective-postinstall"
   },
   "dependencies": {
-    "@antv/data-set": "^0.10.2",
     "ant-design-vue": "^1.7.1",
     "axios": "^0.19.0",
     "core-js": "2.6.9",
@@ -29,7 +29,6 @@
     "screenfull": "^5.1.0",
     "v-runtime-template": "^1.10.0",
     "v-viewer": "^1.6.4",
-    "viser-vue": "^2.4.6",
     "vue": "^2.6.10",
     "vue-clipboard2": "^0.2.1",
     "vue-cookies": "^1.6.1",
@@ -59,6 +58,7 @@
     "babel-jest": "^23.6.0",
     "babel-plugin-import": "^1.11.0",
     "babel-plugin-transform-remove-console": "^6.9.4",
+    "compression-webpack-plugin": "^2.0.0",
     "eslint": "^5.8.0",
     "eslint-plugin-html": "^5.0.0",
     "eslint-plugin-vue": "^5.2.3",
@@ -66,8 +66,10 @@
     "less-loader": "4.1.0",
     "opencollective": "^1.0.3",
     "opencollective-postinstall": "^2.0.2",
+    "terser-webpack-plugin": "^4.2.3",
     "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"
   },
   "eslintConfig": {

+ 1 - 1
public/version.json

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

+ 9 - 1
src/api/allocWarehouse.js

@@ -26,6 +26,14 @@ export const allocWarehouseDel = params => {
     method: 'get'
   })
 }
+// 修改仓位的接口
+export const updatePutWhLocation = params => {
+  return axios({
+    url: '/allocWarehouse/detail/updatePutWhLocation',
+    data: params,
+    method: 'post'
+  })
+}
 // 仓库调拨 详情  合计
 export const allocWarehouseDetailCount = params => {
   return axios({
@@ -104,4 +112,4 @@ export const allocWarehouseSubmit = params => {
     data: params,
     method: 'post'
   })
-}
+}

+ 52 - 0
src/api/purchaseReturn.js

@@ -132,3 +132,55 @@ export const purchaseReturnFinishBill = (params) => {
     method: 'post'
   })
 }
+
+// 采购退货不同步
+// 新增
+export const purchaseReturnSaveByNoSync = (params) => {
+  return axios({
+    url: '/purchaseReturn/saveByNoSync',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 分页列表
+export const purchaseReturnQueryNoSyncPage = (params) => {
+  const url = `/purchaseReturn/queryNoSyncPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 出库
+export const purchaseReturnOutStock = (params) => {
+  return axios({
+    url: '/purchaseReturn/outStock',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 审核
+export const purchaseReturnAudit = (params) => {
+  return axios({
+    url: '/purchaseReturn/audit',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  采购退货 详情 选择产品 列表  分页
+export const purchaseReturnPurchaseBillNoSyncList = (params) => {
+  const url = `/purchaseReturn/detail/queryPurchaseBillDetailPageNoSync/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 26 - 0
src/api/salesDetail.js

@@ -61,4 +61,30 @@ export const salesRecordlList = (params) => {
     data: params,
     method: 'post'
   })
+}
+
+// 导入销售产品明细
+export const salesDetailImportDetail = (params) => {
+  return axios({
+    url: '/salesDetail/importDetail',
+    data: params,
+    method: 'post',
+  })
+}
+// 确认导入明细
+export const salesDetailInsertImport = (params) => {
+  return axios({
+    url: '/salesDetail/insertImport',
+    data: params,
+    method: 'post',
+  })
+}
+// 销售明细错误导出
+export const salesDetailFailExcel = (params) => {
+  return axios({
+    url: '/salesDetail/exportImportDetailError',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
 }

+ 26 - 0
src/api/settle.js

@@ -56,6 +56,32 @@ export const settleUnitQuerySum = (params) => {
     method: 'post'
   })
 }
+
+//详情  打印
+export const settleUnitPrint = params => {
+  const data = {
+    url: `/settle/unit/print/${params.type}`,
+    data: params,
+    method: 'post'
+  }
+  // 喷墨打印
+  if (params.type == 'INK') {
+    data.responseType = 'blob'
+  }
+  return axios.request(data)
+}
+
+// 详情  导出
+export const settleUnitExport = params => {
+  return axios.request({
+    url: `/settle/unit/excel`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+
 //  单位收付款 全部单据
 export const settleInfoAllList = (params) => {
   return axios({

+ 77 - 0
src/api/settleAcount.js

@@ -0,0 +1,77 @@
+import { axios } from '@/utils/request'
+
+// 更新结算账户功能状态
+export const updateAccountMangeState = params => {
+  return axios({
+    url: `/settleAccount/updateFunctionState/${params.enableFlag}`,
+    method: 'get'
+  })
+}
+// 查询结算账户功能状态
+export const queryAccountMangeState = params => {
+  return axios({
+    url: `/settleAccount/queryFunctionState`,
+    method: 'get'
+  })
+}
+// 分页查找结算账户列表
+export const settleAccountList = (params) => {
+  const url = `/settleAccount/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 查询资金明细
+export const findSettleFlowPage = (params) => {
+  const url = `/settleAccount/findSettleFlowPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 保存结算账户信息
+export const settleAccountSave = params => {
+  return axios({
+    url: '/settleAccount/save',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 根据sn查找结算账户信息
+export const settleAccountDetail = params => {
+  return axios({
+    url: `/settleAccount/findBySn/${params.settleAccountSn}`,
+    method: 'get'
+  })
+}
+// 启禁用结算账户信息
+export const settleAccountEnable = params => {
+  return axios({
+    url: `/settleAccount/enable/${params.settleAccountSn}/${params.enableFlag}`,
+    method: 'get'
+  })
+}
+// 删除结算账户信息
+export const settleAccountDelete = params => {
+  return axios({
+    url: `/settleAccount/delete/${params.settleAccountSn}`,
+    method: 'get'
+  })
+}
+// 审核结算账户信息
+export const settleAccountAudit = params => {
+  return axios({
+    url: `/settleAccount/audit/${params.settleAccountSn}/${params.auditState}`,
+    method: 'get'
+  })
+}

+ 17 - 0
src/components/Select/index.js

@@ -84,6 +84,23 @@ export default {
         this.$emit('change', obj, _.find(this.dataList, ['code', obj]))
       }
     }
+    const radioOn = {
+      change: obj => {
+        this.$emit('input', obj.target.value)
+        this.$emit('change', obj.target.value, _.find(this.dataList, ['code', obj.target.value]))
+      }
+    }
+    if(this.showType === 'radio'){
+      return (
+        <a-radio-group vModel={props.value} {...{ props, on: radioOn }} >,
+          {
+            this.dataList.map(item => {
+              return (<a-radio value={item.code} key={item.code}>{item['dispName']}</a-radio>)
+            })
+          }
+        </a-radio-group>
+      )
+    }
     if (this.showType === 'tabs') {
       return (
         <a-tabs vModel={props.value} {...{ props, on: on }}>

+ 22 - 22
src/components/index.js

@@ -1,15 +1,15 @@
 // chart
-import Bar from '@/components/Charts/Bar'
-import ChartCard from '@/components/Charts/ChartCard'
-import Liquid from '@/components/Charts/Liquid'
-import MiniArea from '@/components/Charts/MiniArea'
-import MiniSmoothArea from '@/components/Charts/MiniSmoothArea'
-import MiniBar from '@/components/Charts/MiniBar'
-import MiniProgress from '@/components/Charts/MiniProgress'
-import Radar from '@/components/Charts/Radar'
-import RankList from '@/components/Charts/RankList'
-import TransferBar from '@/components/Charts/TransferBar'
-import TagCloud from '@/components/Charts/TagCloud'
+// import Bar from '@/components/Charts/Bar'
+// import ChartCard from '@/components/Charts/ChartCard'
+// import Liquid from '@/components/Charts/Liquid'
+// import MiniArea from '@/components/Charts/MiniArea'
+// import MiniSmoothArea from '@/components/Charts/MiniSmoothArea'
+// import MiniBar from '@/components/Charts/MiniBar'
+// import MiniProgress from '@/components/Charts/MiniProgress'
+// import Radar from '@/components/Charts/Radar'
+// import RankList from '@/components/Charts/RankList'
+// import TransferBar from '@/components/Charts/TransferBar'
+// import TagCloud from '@/components/Charts/TagCloud'
 
 // pro components
 import AvatarList from '@/components/AvatarList'
@@ -32,17 +32,17 @@ import VSelect from '@/components/Select'
 import Upload from '@/components/UploadFile'
 export {
   AvatarList,
-  Bar,
-  ChartCard,
-  Liquid,
-  MiniArea,
-  MiniSmoothArea,
-  MiniBar,
-  MiniProgress,
-  Radar,
-  TagCloud,
-  RankList,
-  TransferBar,
+  // Bar,
+  // ChartCard,
+  // Liquid,
+  // MiniArea,
+  // MiniSmoothArea,
+  // MiniBar,
+  // MiniProgress,
+  // Radar,
+  // TagCloud,
+  // RankList,
+  // TransferBar,
   Trend,
   CountDown,
   Ellipsis,

+ 110 - 11
src/config/router.config.js

@@ -774,6 +774,68 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          // 采购退货-不同步
+          {
+            path: '/purchasingManagement/purchaseReturnOutSync',
+            redirect: '/purchasingManagement/purchaseReturnOutSync/list',
+            name: 'purchaseReturnOutSync',
+            component: BlankLayout,
+            meta: {
+              title: '采购退货',
+              icon: 'money-collect',
+              permission: 'M_purchaseReturn_outSnycList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'purchaseReturnOutSyncList',
+                component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseReturnOutSync/list.vue'),
+                meta: {
+                  title: '采购退货列表',
+                  icon: 'money-collect',
+                  hidden: true,
+                  permission: 'M_purchaseReturn_outSnycList'
+                }
+              },
+              {
+                path: 'edit/:sn',
+                name: 'purchaseReturnOutSyncEdit',
+                component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseReturnOutSync/edit.vue'),
+                meta: {
+                  title: '采购退货单(不抓单)',
+                  icon: 'money-collect',
+                  hidden: true,
+                  replaceTab: true,
+                  permission: 'B_purchaseReturn_outSnycAdd'
+                }
+              },
+              {
+                path: 'grapEdit/:sn/:returnTargetType',
+                name: 'purchaseReturnOutSyncGrapEdit',
+                component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue'),
+                meta: {
+                  title: '采购退货单(抓单)',
+                  icon: 'money-collect',
+                  hidden: true,
+                  replaceTab: true,
+                  permission: 'B_purchaseReturn_outSnycEdit'
+                }
+              },
+              {
+                path: 'detail/:sn/:grabFlag',
+                name: 'purchaseReturnOutSyncDetail',
+                component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseReturnOutSync/detail.vue'),
+                meta: {
+                  title: '采购退货详情',
+                  icon: 'money-collect',
+                  hidden: true,
+                  replaceTab: true,
+                  permission: 'B_purchaseReturn_outSnycDetail'
+                }
+              }
+            ]
           }
         ]
       },
@@ -1116,7 +1178,44 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          }
+          },
+          {
+            path: '/financialManagement/fundAccountManagement',
+            redirect: '/financialManagement/fundAccountManagement/list',
+            name: 'fundAccountManagement',
+            component: BlankLayout,
+            meta: {
+              title: '资金账户管理',
+              icon: 'file-protect',
+              permission: 'M_fundAccountList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'fundAccountList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/fundAccountManagement/list.vue'),
+                meta: {
+                  title: '资金账户列表',
+                  icon: 'file-protect',
+                  hidden: true,
+                  permission: 'M_fundAccountList'
+                }
+              },
+              {
+                path: 'detail/:sn',
+                name: 'fundAccountDetail',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/fundAccountManagement/detail.vue'),
+                meta: {
+                  title: '资金明细',
+                  icon: 'file-protect',
+                  hidden: true,
+                  replaceTab: true,
+                  permission: 'M_fundAccount_detail'
+                }
+              }
+            ]
+          },
         ]
       },
       // 调拨管理
@@ -1966,7 +2065,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'inventoryReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/inventoryReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/inventoryReport/list.vue'),
                 meta: {
                   title: '盘点报表列表',
                   icon: 'profile',
@@ -1991,7 +2090,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainSalesReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainSalesReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainSalesReport/list.vue'),
                 meta: {
                   title: '连锁销售报表列表',
                   icon: 'profile',
@@ -2016,7 +2115,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainSalesDetailReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainSalesDetailReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainSalesDetailReport/list.vue'),
                 meta: {
                   title: '连锁销售明细报表列表',
                   icon: 'profile',
@@ -2041,7 +2140,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainSalesDetailsCountReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainSalesDetailsCountReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainSalesDetailsCountReport/list.vue'),
                 meta: {
                   title: '连锁销售明细合计列表',
                   icon: 'profile',
@@ -2066,7 +2165,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainCustomerReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainCustomerReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainCustomerReport/list.vue'),
                 meta: {
                   title: '连锁大客户报表列表',
                   icon: 'profile',
@@ -2091,7 +2190,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainStockIncomeReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainStockIncomeReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainStockIncomeReport/list.vue'),
                 meta: {
                   title: '连锁库存总入报表列表',
                   icon: 'profile',
@@ -2116,7 +2215,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainStockExpenditureReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainStockExpenditureReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainStockExpenditureReport/list.vue'),
                 meta: {
                   title: '连锁库存总出报表列表',
                   icon: 'profile',
@@ -2141,7 +2240,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainStockReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainStockReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainStockReport/list.vue'),
                 meta: {
                   title: '连锁库存总表列表',
                   icon: 'profile',
@@ -2166,7 +2265,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainPurchaseReceiptReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainPurchaseReceiptReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainPurchaseReceiptReport/list.vue'),
                 meta: {
                   title: '连锁采购入库报表列表',
                   icon: 'profile',
@@ -2191,7 +2290,7 @@ export const asyncRouterMap = [
               {
                 path: 'list',
                 name: 'chainReceivedSendStorageReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainReceivedSendStorageReport/list.vue'),
+                component: () => import(/* webpackChunkName: "reportData1" */ '@/views/reportData/chainReceivedSendStorageReport/list.vue'),
                 meta: {
                   title: '连锁收发存报表列表',
                   icon: 'profile',

+ 2 - 2
src/core/lazy_use.js

@@ -4,7 +4,7 @@ import config from '@/config/defaultSettings'
 
 // base library
 import '@/core/lazy_lib/components_use'
-import Viser from 'viser-vue'
+// import Viser from 'viser-vue'
 
 // ext library
 import VueClipboard from 'vue-clipboard2'
@@ -13,7 +13,7 @@ import './directives/action'
 
 VueClipboard.config.autoSetContainer = true
 
-Vue.use(Viser)
+// Vue.use(Viser)
 
 Vue.use(VueStorage, config.storageOptions)
 Vue.use(VueClipboard)

+ 2 - 2
src/core/use.js

@@ -4,7 +4,7 @@ import config from '@/config/defaultSettings'
 
 // base library
 import Antd from 'ant-design-vue'
-import Viser from 'viser-vue'
+// import Viser from 'viser-vue'
 import VueCropper from 'vue-cropper'
 import 'ant-design-vue/dist/antd.less'
 
@@ -19,7 +19,7 @@ import './directives/hasPermission'
 VueClipboard.config.autoSetContainer = true
 
 Vue.use(Antd)
-Vue.use(Viser)
+// Vue.use(Viser)
 Vue.use(MultiTab)
 Vue.use(PageLoading)
 Vue.use(VueStorage, config.storageOptions)

+ 1 - 1
src/layouts/BasicLayout.vue

@@ -197,7 +197,7 @@ export default {
     }
     this.collapsed = !this.sidebarOpened
     this.$store.dispatch('ToggleMultiTab', true)
-	  // this.$store.dispatch('ToggleColor', '#2A86F4')
+	  this.$store.dispatch('ToggleColor', '#2A86F4')
     this.$store.dispatch('ToggleTheme', 'dark')
     // 判断是否是当月25日后
     this.$store.state.app.isLastDayForMonth = moment().date() >= 25

+ 4 - 4
src/libs/JGPrint.js

@@ -15,9 +15,9 @@ export const JGPrintTag = function (html, width, height, data) {
       onOk () {
         var agent = navigator.userAgent.toLowerCase();
         if (agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0) {
-            window.open('http://www.lodop.net/demolist/CLodop_Setup_for_Win32NT.zip')
+            window.open('https://iscm.360arrow.com/electron/CLodop.exe')
         }else if (agent.indexOf("win64") >= 0 || agent.indexOf("wow64") >= 0) {
-            window.open('http://www.lodop.net/download/CLodop_Setup_for_Win64NT_4.155EN.zip')
+            window.open('https://iscm.360arrow.com/electron/CLodop.exe')
         }
       }
     })
@@ -139,9 +139,9 @@ export const jGPrint = function (data, type, printerType) {
         onOk () {
           var agent = navigator.userAgent.toLowerCase();
           if (agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0) {
-              window.open('http://www.lodop.net/demolist/CLodop_Setup_for_Win32NT.zip')
+              window.open('https://iscm.360arrow.com/electron/CLodop.exe')
           }else if (agent.indexOf("win64") >= 0 || agent.indexOf("wow64") >= 0) {
-              window.open('http://www.lodop.net/download/CLodop_Setup_for_Win64NT_4.155EN.zip')
+              window.open('https://iscm.360arrow.com/electron/CLodop.exe')
           }
         }
       })

+ 50 - 0
src/libs/exportExcel.js

@@ -0,0 +1,50 @@
+import notification from 'ant-design-vue/es/notification'
+import moment from 'moment'
+
+// 导出excel
+/*
+  *url: 数据请求接口
+  *params: 请求参数
+  *fileName: 导出文件名称
+  *callback: 回调函数
+*/
+export const hdExportExcel = function (url, params, fileName, callback) {
+  url(params).then(res => {
+    if (res.type == 'application/json') {
+      var reader = new FileReader()
+      reader.addEventListener('loadend', function () {
+        const obj = JSON.parse(reader.result)
+        if (obj.status != 200) {
+          notification.error({
+            message: '提示',
+            description: obj.message
+          })
+        }
+      })
+      reader.readAsText(res)
+    } else {
+      downloadExcel(res, fileName)
+    }
+    callback()
+  })
+}
+// 导出下载excel
+export const downloadExcel = function (data, fileName) {
+  if (!data) { return }
+  const a = moment().format('YYYYMMDDHHmmss')
+  const fname = fileName + a
+  const blob = new Blob([data], { type: 'application/vnd.ms-excel' })
+  if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+    navigator.msSaveBlob(blob, fname + '.xlsx')
+  } else {
+    const link = document.createElement('a')
+    link.style.display = 'none'
+    var href = URL.createObjectURL(blob)
+    link.href = href
+    link.setAttribute('download', fname + '.xlsx')
+    document.body.appendChild(link)
+    link.click()
+    document.body.removeChild(link)
+    window.URL.revokeObjectURL(href) // 释放掉blob对象
+  }
+}

+ 1 - 0
src/store/getters.js

@@ -11,6 +11,7 @@ const getters = {
   userInfo: state => state.user.info,
   authOrgs: state => state.user.authOrgs,
   changeOrg: state => state.user.changeOrg,
+  settleAccountFlag:state => state.user.settleAccountFlag,
   addRouters: state => state.permission.addRouters,
   multiTab: state => state.app.multiTab,
   lang: state => state.i18n.lang,

+ 41 - 3
src/store/modules/user.js

@@ -1,5 +1,6 @@
 import Vue from 'vue'
 import { login, logout } from '@/api/login'
+import { updateAccountMangeState, queryAccountMangeState } from '@/api/settleAcount'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
 import { welcome } from '@/utils/util'
 import VueCookies from 'vue-cookies'
@@ -13,7 +14,8 @@ const user = {
     roles: { permissionList: [] },
     info: {},
     authOrgs: [],
-    changeOrg: ''
+    changeOrg: '',
+    settleAccountFlag: 0, // 结算账户管理是否开启
   },
 
   mutations: {
@@ -43,7 +45,10 @@ const user = {
     },
     SET_MUSTCHANGEPWD: (state, status) => {
       state.mustChangePwd = status
-    }
+    },
+    SET_SETTLEACCOUNT:(state, status) => {
+      state.settleAccountFlag = status
+    },
   },
 
   actions: {
@@ -88,6 +93,11 @@ const user = {
     // 获取用户信息
     GetInfo ({ commit, state }) {
       const roles = Vue.ls.get('rolesAccess-qpls-md')
+      // 如果存在不同步采购退货,屏蔽同步的采购退货
+      const hasOutSyncReturn = roles.permissionList.find(item => item == 'M_purchaseReturn_outSnycList')
+      if(hasOutSyncReturn){
+        roles.permissionList = roles.permissionList.filter(item => item != 'M_purchaseReturnList')
+      }
       commit('SET_ROLES', roles)
       // commit('SET_TOKEN', sessionStorage.getItem(ACCESS_TOKEN) || state.token)
       commit('SET_NAME', { name: Vue.ls.get('userName'), welcome: '' })
@@ -95,9 +105,37 @@ const user = {
     },
     // 切换账号
     SetOrgSn ({ commit, state }, info) {
-      // console.log(info)
       commit('SET_CHANGEORG', info)
     },
+    // 更新结算账户状态
+    UpdateSettleAccount({ commit, state }, info) {
+      return new Promise((resolve, reject) => {
+        updateAccountMangeState(info).then(res => {
+          if(res.status == 200){
+            resolve(res)
+          }else{
+            reject(ret)
+          }
+        }).catch(error => {
+            reject(error)
+          })
+      })
+    },
+    // 查询结算账户状态
+    GetSettleAccountState({ commit, state }) {
+      return new Promise((resolve, reject) => {
+        queryAccountMangeState().then(res => {
+          if(res.status == 200){
+            commit('SET_SETTLEACCOUNT', res.data&&res.data.functionEnableFlag)
+            resolve(res)
+          }else{
+            reject(ret)
+          }
+        }).catch(error => {
+            reject(error)
+          })
+      })
+    },
     // 登出
     Logout ({ commit, state }) {
       console.log(state)

+ 9 - 7
src/views/Home.vue

@@ -124,7 +124,7 @@
                     class="page-nav-badge"
                     v-for="(unitItem, unitInd) in subItem"
                     :key="unitInd"
-                    @click="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission) ? goPage(unitItem) : null"
+                    @click="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission) ? goPage(unitItem,subInd) : null"
                     :style="{cursor: unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission)?'pointer': 'initial'}">
                     <div :class="['page-nav-item', unitItem.styleC]">
                       <div class="page-nav-n">
@@ -333,8 +333,8 @@ export default {
               icon: require('@/assets/home-icon/home_icon_purchase_return.png'),
               name: '采购退货',
               styleC: 'red-color',
-              url: '/purchasingManagement/purchaseReturn/list',
-              permission: 'M_purchaseReturnList',
+              url: this.$hasPermissions('M_purchaseReturn_outSnycList') ? '/purchasingManagement/purchaseReturnOutSync/list' : '/purchasingManagement/purchaseReturn/list',
+              permission: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'M_purchaseReturn_outSnycList' : 'M_purchaseReturnList',
               orderNum: ''
             }
           ],
@@ -352,9 +352,9 @@ export default {
               icon: require('@/assets/home-icon/home_icon_verify_return.png'),
               name: '退货审核',
               styleC: 'blue-color',
-              url: '/purchasingManagement/purchaseReturn/list',
+              url: this.$hasPermissions('M_purchaseReturn_outSnycList') ? '/purchasingManagement/purchaseReturnOutSync/list' : '/purchasingManagement/purchaseReturn/list',
               params: { state: 'WAIT_AUDIT' },
-              permission: 'M_purchaseReturnList',
+              permission: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'M_purchaseReturn_outSnycList' : 'M_purchaseReturnList',
               orderNum: 'purchaseReturnWaitAuditCount'
             }
           ],
@@ -681,7 +681,7 @@ export default {
       })
     },
     // 导航跳转
-    goPage (data) {
+    goPage (data, subInd) {
       if (data) {
         // 有待办数据,则跳转带有条件的;若无待办数据,则跳转全部数据
         if (data.orderNum && this.countData[data.orderNum]) {
@@ -700,7 +700,9 @@ export default {
             this.$router.push({ path: data.url, query: { pageParams: null } })
           }
         }
-        this.$store.state.app.isHomeNav = true
+        if (subInd == '1') {
+          this.$store.state.app.isHomeNav = true
+        }
       }
     },
     // 数据看板信息

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

@@ -357,7 +357,7 @@ export default {
       margin-bottom: 10px;
     }
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
   }

+ 20 - 4
src/views/allocationManagement/chainTransferIn/list.vue

@@ -87,6 +87,18 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_allocLinkagePutDetail')" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</span>
           <span v-else>{{ record.allocationLinkagePutNo }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 付款 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 入库 -->
+        <template slot="waitOut" slot-scope="text, record">
+          <stateIcon :state="record.state != 'WAIT_SUBMIT'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -124,9 +136,10 @@ import { formatDecimal } from '@/libs/tools'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { allocLinkagePutList, allocLinkagePutAudit } from '@/api/allocLinkagePut'
 import { getTenantList } from '@/api/allocLinkageOut'
+import stateIcon from '@/views/common/stateIcon'
 export default {
   name: 'AllocLinkagePutList',
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -146,15 +159,18 @@ export default {
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '连锁调入单号', scopedSlots: { customRender: 'allocationLinkagePutNo' }, width: '16%', align: 'center' },
-        { title: '调出对象', dataIndex: 'outTenantName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出对象', dataIndex: '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: 'action' }, width: '10%', align: 'center' }
+        // { 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 => {

+ 6 - 4
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -109,7 +109,7 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="chainTransferOutEdit-add-btn">添加</a-button>
+                <a-button size="small" type="link" class="button-primary" @click="handleAdd(record)" id="chainTransferOutEdit-add-btn">添加</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -169,7 +169,7 @@
               bordered>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="chainTransferOutEdit-del-btn">删除</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="chainTransferOutEdit-del-btn">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -364,7 +364,9 @@ export default {
       allocLinkageOutDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
-          this.$refs.table.refresh()
+          if(isEdit){
+            this.$refs.table.refresh()
+          }
           this.$refs.chooseTable.refresh()
           this.spinning = false
         } else {
@@ -526,7 +528,7 @@ export default {
       margin-bottom: 10px;
     }
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
   }

+ 20 - 4
src/views/allocationManagement/chainTransferOut/list.vue

@@ -91,6 +91,18 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_allocLinkageOutDetail')" @click="handleDetail(record)">{{ record.allocationLinkageOutNo }}</span>
           <span v-else>{{ record.allocationLinkageOutNo }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'||record.state == 'WAIT_OUT_WAREHOUSE'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 结算 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 出库 -->
+        <template slot="waitOut" slot-scope="text, record">
+          <stateIcon :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -135,11 +147,12 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
+import stateIcon from '@/views/common/stateIcon'
 import getDate from '@/libs/getDate.js'
 import { allocLinkageOutList, allocLinkageAudit, allocLinkageOutDel, allocLinkageOutStock, getTenantList } from '@/api/allocLinkageOut'
 export default {
   name: 'AllocLinkageOutList',
-  components: { STable, VSelect, basicInfoModal, rangeDate },
+  components: { STable, VSelect, basicInfoModal, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -163,15 +176,18 @@ export default {
         { 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: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'action' }, width: '13%', align: 'center' }
+        // { 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 => {

+ 7 - 6
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -95,11 +95,12 @@
               <template slot="action" slot-scope="text, record">
                 <a-button
                   size="small"
-                  :disabled="record.currentQty==0"
-                  type="primary"
+                  v-if="record.currentQty"
+                  type="link"
                   class="button-primary"
                   @click="handleAdd(record)"
                   id="storeTransferOutEdit-add-btn">添加</a-button>
+                <span v-else>--</span>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -171,7 +172,7 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -259,14 +260,14 @@ export default {
       chooseColumns: [
         { 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', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: '10%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
@@ -517,7 +518,7 @@ export default {
       margin-bottom: 10px;
     }
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
   }

+ 20 - 4
src/views/allocationManagement/storeTransferOut/list.vue

@@ -80,6 +80,18 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_storeCallOutDetail')" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
           <span v-else>{{ record.storeCallOutNo }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'||record.state == 'WAIT_OUT_WAREHOUSE'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 结算 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 出库 -->
+        <template slot="waitOut" slot-scope="text, record">
+          <stateIcon :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -125,11 +137,12 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import getDate from '@/libs/getDate.js'
 import basicInfoModal from './basicInfoModal.vue'
+import stateIcon from '@/views/common/stateIcon'
 import { storeCallOutList, storeCallOutAudit, storeCallOutDel, storeCallOutOut } from '@/api/storeCallOut'
 import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
 export default {
   name: 'StoreCallOutList',
-  components: { STable, VSelect, basicInfoModal, rangeDate },
+  components: { STable, VSelect, basicInfoModal, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -153,15 +166,18 @@ export default {
         { 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: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'action' }, width: '12%', align: 'center' }
+        // { 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 => {

+ 3 - 3
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -97,7 +97,7 @@ export default {
         { 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: '成本小计(¥)', scopedSlots: { customRender: 'totalCost' }, width: '8%', align: 'center' },
+        { 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 || '--' } }
       ],
@@ -155,14 +155,14 @@ export default {
   },
   mounted () {
     if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新 或 为弹框时调用
-      this.$refs.table.refresh(true)
+      // this.$refs.table.refresh(true)
       this.getHouse()
     }
   },
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      this.$refs.table.refresh(true)
+      // this.$refs.table.refresh(true)
       this.getHouse()
     }
   },

+ 32 - 10
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -117,7 +117,7 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
+                <a-button size="small" type="link" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -209,7 +209,7 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -232,7 +232,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { allocWarehouseDetailList, allocWarehouseDetail, productQuery, allocWarehouseDetailCount, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
+import { allocWarehouseDetailList, allocWarehouseDetail, updatePutWhLocation, productQuery, allocWarehouseDetailCount, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { warehouseLocAllList } from '@/api/warehouse'
@@ -270,7 +270,7 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
@@ -278,7 +278,7 @@ export default {
         { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: '8%', align: 'center' },
         { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '7%', align: 'center' },
         { title: '可用库存数', dataIndex: 'currentQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '冻结库存数', dataIndex: 'freezeQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '冻结库存数', dataIndex: 'freezeQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ],
@@ -405,7 +405,7 @@ export default {
       }
       if (isEdit) { // 编辑
         // 清空数量时,值应保持未清空前的值,因数量不可为空
-        if (!row.outQty || row.outQty == row.outQtyBackups) {
+        if (!row.outQty) {
           row.outQty = row.outQtyBackups
           return
         }
@@ -419,6 +419,7 @@ export default {
           this.spinning = false
         } else {
           this.spinning = false
+          row.outQty = row.outQtyBackups
         }
       })
     },
@@ -435,7 +436,12 @@ export default {
           if (isAll) { //  整单删除
             params = { allocationWarehouseSn: _this.$route.params.sn }
           } else { //  单个删除
-            params = { id: row.id }
+            params = {
+              allocationWarehouseSn: _this.$route.params.sn,
+              productSn: row.productSn,
+              outWarehouseLocationSn: row.outWarehouseLocationSn,
+              putWarehouseLocationSn: row.putWarehouseLocationSn
+            }
           }
           _this.spinning = true
           allocWarehouseDetailDel(params).then(res => {
@@ -489,8 +495,24 @@ export default {
       }
     },
     // 已选产品 仓位  change
-    chooseWarehouseLocChange (record) {
-      this.handleAdd(record, 'edit')
+    chooseWarehouseLocChange (row) {
+      const params = {
+        allocationWarehouseSn: this.$route.params.sn,
+        productSn: row.productSn,
+        outWarehouseLocationSn: row.outWarehouseLocationSn,
+        putWarehouseLocationSn: row.putWarehouseLocationSn
+      }
+      this.spinning = true
+      updatePutWhLocation(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.$refs.chooseTable.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
     },
     //  产品分类  change
     changeProductType (val, opt) {
@@ -568,7 +590,7 @@ export default {
       margin-bottom: 10px;
     }
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
   }

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

@@ -10,14 +10,14 @@
                 <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="调出仓库">
                 <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
                   <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="4" :sm="24">
               <a-form-item label="调入仓库">
                 <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
                   <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
@@ -25,7 +25,7 @@
               </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"
@@ -68,13 +68,17 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_warehouseAllocationDetail')" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
           <span v-else>{{ record.allocationWarehouseNo }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
             v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_allocWarehouseAudit')"
             size="small"
             type="link"
-            class="button-warning"
+            class="button-primary"
             @click="handleExamine(record)"
             id="warehouseAllocationList-examine-btn">
             审核
@@ -83,7 +87,7 @@
             v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')) && $hasPermissions('B_warehouseAllocationEdit')"
             size="small"
             type="link"
-            class="button-info"
+            class="button-primary"
             @click="handleEdit(record)"
             id="warehouseAllocationList-edit-btn">
             编辑
@@ -113,10 +117,11 @@ import { warehouseAllList } from '@/api/warehouse.js'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
+import stateIcon from '@/views/common/stateIcon'
 import getDate from '@/libs/getDate.js'
 export default {
   name: 'AllocWarehouseList',
-  components: { STable, VSelect, basicInfoModal, rangeDate },
+  components: { STable, VSelect, basicInfoModal, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -140,14 +145,15 @@ export default {
         { 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: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调入仓库', dataIndex: 'putWarehouseName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'action' }, width: '12%', align: 'center' }
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 3 - 2
src/views/bulkManagement/bulkReturnGoods/basicInfoModal.vue

@@ -25,7 +25,7 @@
             option-filter-prop="children"
             :filter-option="filterOption"
             style="width: 80%;">
-            <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn" :disabled="item.enabledFlag==0">{{ item.supplierName }}</a-select-option>
+            <a-select-option v-for="item in supplierList" :key="item.supplierSn" :pyCode="item.pyCode" :value="item.supplierSn" :disabled="item.enabledFlag==0">{{ item.supplierName }}</a-select-option>
           </a-select>
           <a-button icon="plus" size="small" @click="openSupplierModal=true" id="bulkWarehousingOrder-basicInfo-add-btn" style="margin-left: 10px;"></a-button>
         </a-form-model-item>
@@ -114,7 +114,8 @@ export default {
       })
     },
     filterOption (input, option) {
-      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+      option.data.attrs.pyCode.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
     // 新增供应商 成功
     handleOk () {

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

@@ -4,7 +4,7 @@
     class="bulkReturnGoodsDetail-modal"
     :footer="null"
     :maskClosable="false"
-    title="详情"
+    title="散件退货详情"
     v-model="isShow"
     @cancle="isShow = false"
     :width="960">
@@ -107,7 +107,7 @@ export default {
   computed: {
     columns () {
       let arr = []
-      if (this.isGrab == '1') { // 抓单
+      if (this.isGrab == '1' || this.basicInfoData && this.basicInfoData.isGrab == '1') { // 抓单
         arr = [
           { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
           { title: '散件入库单号', dataIndex: 'sparePartsPurchaseNo', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },

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

@@ -480,7 +480,7 @@ export default {
     padding-bottom: 51px;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .bulkReturnGoodsEdit-cont{

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

@@ -477,7 +477,7 @@ export default {
     padding-bottom: 51px;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .bulkReturnGoodsEdit-cont{

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

@@ -25,7 +25,7 @@
                   :showSearch="true"
                   option-filter-prop="children"
                   :filter-option="filterOption">
-                  <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
+                  <a-select-option v-for="item in supplierList" :key="item.supplierSn" :pyCode="item.pyCode" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -78,6 +78,19 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_bulkReturnGoodsDetail')" @click="handleDetail(record)">{{ record.sparePartsReturnNo }}</span>
           <span v-else>{{ record.sparePartsReturnNo }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon v-if="record.state!='AUDIT_REJECT'" :state="record.state !== 'WAIT_SUBMIT'&&record.state !== 'WAIT_AUDIT'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.stateDictValue" v-else :state="0"></stateIcon>
+        </template>
+        <!-- 出库 -->
+        <template slot="waitOut" slot-scope="text, record">
+          <stateIcon :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 收款 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -129,11 +142,12 @@ import bulkReturnGoodsDetailModal from './detailModal.vue'
 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 { sparePartsRetList, sparePartsRetDel, sparePartsRetOutStock, sparePartsRetAudit } from '@/api/sparePartsRet'
 export default {
   name: 'BulkReturnGoodsList',
-  components: { STable, VSelect, basicInfoModal, rangeDate, bulkReturnGoodsDetailModal, auditModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate, bulkReturnGoodsDetailModal, auditModal, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -156,14 +170,17 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '散件退货单号', scopedSlots: { customRender: 'sparePartsReturnNo' }, width: '16%', align: 'center' },
+        { title: '散件退货单号', scopedSlots: { customRender: 'sparePartsReturnNo' }, width: '13%', align: 'center' },
         { title: '供应商', dataIndex: 'supplierName', width: '13%', 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: 'isGrabDictValue', 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: '财务状态', 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: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库时间', dataIndex: 'outStockTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '9%', align: 'center' }
@@ -204,7 +221,8 @@ export default {
     },
     filterOption (input, option) {
       return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+        option.data.attrs.pyCode.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
     //  重置

+ 3 - 2
src/views/bulkManagement/bulkWarehousingOrder/basicInfoModal.vue

@@ -25,7 +25,7 @@
             option-filter-prop="children"
             :filter-option="filterOption"
             style="width: 80%;">
-            <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn" :disabled="item.enabledFlag==0">{{ item.supplierName }}</a-select-option>
+            <a-select-option v-for="item in supplierList" :key="item.supplierSn" :pyCode="item.pyCode" :value="item.supplierSn" :disabled="item.enabledFlag==0">{{ item.supplierName }}</a-select-option>
           </a-select>
           <a-button icon="plus" size="small" @click="openSupplierModal=true" id="bulkWarehousingOrder-basicInfo-add-btn" style="margin-left: 10px;"></a-button>
         </a-form-model-item>
@@ -129,7 +129,8 @@ export default {
     },
     filterOption (input, option) {
       return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+        option.data.attrs.pyCode.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
     // 供应商下拉数据

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

@@ -679,7 +679,7 @@ export default {
     padding-bottom: 51px;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .bulkWarehousingOrderEdit-cont{

+ 3 - 2
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -25,7 +25,7 @@
                   :showSearch="true"
                   option-filter-prop="children"
                   :filter-option="filterOption">
-                  <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
+                  <a-select-option v-for="item in supplierList" :pyCode="item.pyCode" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -317,7 +317,8 @@ export default {
     },
     filterOption (input, option) {
       return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+        option.data.attrs.pyCode.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
     //  导出

+ 86 - 0
src/views/common/settleAccount.js

@@ -0,0 +1,86 @@
+import { settleAccountList } from '@/api/settleAcount'
+// 结算账户
+const SettleAccount = {
+  template: `
+        <a-select
+          :id="id"
+          :placeholder="placeholder"
+          allowClear
+          :value="defaultVal"
+          :showSearch="true"
+          @change="handleChange"
+          :filter-option="filterOption">
+          <a-select-option v-for="item in list" :key="item[defValKey]" :value="item[defValKey]">{{ item.accountName }}-{{item.accountNo}}</a-select-option>
+        </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    defValKey: {
+      type: String,
+      default: 'settleAccountSn'
+    },
+    placeholder: {
+      type: String,
+      default: '请选择结算账户'
+    },
+    settleStyleSn:{
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value||undefined,
+      list: []
+    };
+  },
+  watch: {
+    value(newValue, oldValue) {
+      console.log(newValue)
+      this.defaultVal = newValue||undefined
+    },
+    settleStyleSn(a,b){
+      if(a){
+        this.getList()
+      }
+    }
+  },
+  mounted() {
+    if(this.settleStyleSn){
+      this.getList()
+    }
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange(value) {
+      this.defaultVal = value;
+      const accountName = this.list.find(item => item[this.defValKey] == value).accountName
+      this.$emit('input', value);
+      this.$emit('change', this.value, accountName);
+    },
+    // 列表数据
+    getList () {
+      const _this = this
+      settleAccountList({settleStyleSn: this.settleStyleSn,pageNo:1,pageSize:500,state:'ENABLE'}).then(res => {
+        if (res.status == 200) {
+          _this.list = res.data.list || []
+        } else {
+          _this.list = []
+        }
+      })
+    },
+  },
+};
+
+export default SettleAccount

+ 75 - 0
src/views/common/settleStyle.js

@@ -0,0 +1,75 @@
+import { settleStyleQueryAll } from '@/api/settleStyle'
+// 结算方式
+const SettleStyle = {
+  template: `
+        <a-select
+          :id="id"
+          :placeholder="placeholder"
+          allowClear
+          :value="defaultVal"
+          :showSearch="true"
+          @change="handleChange"
+          :filter-option="filterOption">
+          <a-select-option v-for="item in list" :key="item[defValKey]" :value="item[defValKey]">{{ item.name }}</a-select-option>
+        </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    defValKey: {
+      type: String,
+      default: 'settleStyleSn'
+    },
+    placeholder: {
+      type: String,
+      default: '请选择结算方式'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value||undefined,
+      list: []
+    };
+  },
+  watch: {
+    value(newValue, oldValue) {
+      console.log(newValue)
+      this.defaultVal = newValue||undefined
+    }
+  },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange(value) {
+      this.defaultVal = value;
+      const settleStyleName = this.list.find(item => item[this.defValKey] == value).name
+      this.$emit('input', value);
+      this.$emit('change', this.value, settleStyleName);
+    },
+    // 列表数据
+    getList () {
+      const _this = this
+      settleStyleQueryAll().then(res => {
+        if (res.status == 200) {
+          _this.list = res.data || []
+        } else {
+          _this.list = []
+        }
+      })
+    },
+  },
+};
+
+export default SettleStyle

+ 1 - 0
src/views/customerManagement/customerInfo/edit.vue

@@ -348,6 +348,7 @@ export default {
   height: 100%;
   >.ant-spin-nested-loading{
     height: calc(100% - 52px);
+	overflow-y: auto;
     .ant-spin-container{
       height: 97%;
     }

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

@@ -104,6 +104,7 @@ export default {
         bizNo: '',
         bizType: undefined
       },
+      allData: [],
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },

+ 172 - 62
src/views/financialManagement/companyReceivablePayable/collectionPayment.vue

@@ -7,6 +7,9 @@
           <a id="collectionPayment-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
         </template>
+        <template slot="extra" v-if="$hasPermissions('B_cPayment_printAndExport')">
+          <Print :disabled="chooseLoadData.length==0||totalBalance==0" @handlePrint="handlePrint"></Print>
+        </template>
       </a-page-header>
       <!-- 已选单据 -->
       <a-card size="small" :bordered="false" class="collectionPayment-cont">
@@ -48,15 +51,16 @@
                   id="collectionPayment-settleAmount"
                   v-model="record.settleAmount"
                   :precision="2"
-                  :min="record.unsettleAmount<0 ? record.unsettleAmount : 0.01"
-                  :max="record.unsettleAmount<0 ? -0.01 : record.unsettleAmount"
+                  :min="record.unsettleAmount<0 ? record.unsettleAmount : 0"
+                  :max="record.unsettleAmount<0 ? 0 : record.unsettleAmount"
+                  @change="amountSettledChange"
                   size="small"
                   placeholder="请输入"
                   style="width: 100%;" />
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="collectionPayment-del-btn">移除</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="collectionPayment-del-btn">移除</a-button>
               </template>
             </a-table>
           </a-collapse-panel>
@@ -76,14 +80,15 @@
                 <a-col span="12">
                   <a-form-model-item prop="amountSettled">
                     <template slot="label">
-                      结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
+                      本次结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
                     </template>
                     <a-input-number
                       id="collectionPayment-amountSettled"
-                      v-model="amountSettled"
-                      disabled
+                      v-model="form.amountSettled"
+                      @change="amountSettledTotalChange"
                       :precision="2"
                       placeholder=""
+                      :max="maxAmountSettled"
                       style="width: 100%;" />
                   </a-form-model-item>
                 </a-col>
@@ -94,7 +99,7 @@
                       v-model="form.discountAmount"
                       :precision="2"
                       :min="0"
-                      :max="amountSettled"
+                      :max="form.amountSettled"
                       placeholder="请输入"
                       style="width: 100%;"
                       allowClear />
@@ -103,7 +108,7 @@
                 <a-col span="12">
                   <a-form-model-item prop="actualSettlementAmount">
                     <template slot="label">
-                      实结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
+                      本次结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
                     </template>
                     <a-input-number
                       id="collectionPayment-actualSettlementAmount"
@@ -116,9 +121,23 @@
                 </a-col>
                 <a-col span="12">
                   <a-form-model-item label="结算方式" prop="settleStyleSn">
-                    <a-select id="collectionPayment-settleStyleSn" v-model="form.settleStyleSn" placeholder="请选择结算方式" allowClear>
-                      <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
-                    </a-select>
+                    <settleStyle
+                      id="collectionPayment-settleStyleSn"
+                      v-model="form.settleStyleSn"
+                      @change="settleStyleChange"
+                      placeholder="请选择结算方式">
+                    </settleStyle>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="12">
+                  <a-form-model-item v-if="enableFundAccount" label="结算账户" prop="settleAccountSn">
+                    <settleAccount
+                      id="collectionPayment-settleAccountSn"
+                      v-model="form.settleAccountSn"
+                      :settleStyleSn="form.settleStyleSn"
+                      @change="settleAccountChange"
+                      placeholder="请选择结算账户">
+                    </settleAccount>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="24">
@@ -143,6 +162,7 @@
         style="padding: 0 60px;">提交</a-button>
     </div>
     <choose-bill-modal
+      ref="chooseBillModal"
       :openModal="openModal"
       :nowChoose="chooseLoadData"
       :settleClientType="$route.params.type"
@@ -154,15 +174,22 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
+import debounce from 'lodash/debounce'
 import { STable, VSelect } from '@/components'
 import chooseBillModal from './chooseBillModal.vue'
-import { settleStyleQueryAll } from '@/api/settleStyle'
-import { settleUnitSave } from '@/api/settle'
+import { settleUnitSave, settleUnitPrint, settleUnitExport, settleInfoAllList } from '@/api/settle'
+import Print from '@/views/common/print.vue'
+import settleStyle from '@/views/common/settleStyle'
+import settleAccount from '@/views/common/settleAccount'
+import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'CollectionPaymentDetail',
-  components: { STable, VSelect, chooseBillModal },
+  components: { STable, VSelect, chooseBillModal, Print, settleStyle, settleAccount },
   mixins: [commonMixin],
   data () {
+    this.amountSettledChange = debounce(this.amountSettledChange, 800)
+    this.amountSettledTotalChange = debounce(this.amountSettledTotalChange, 800)
     return {
       spinning: false,
       loading: false, //  表格加载中
@@ -182,22 +209,30 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       chooseLoadData: [],
-      settleStyleList: [], //  结算方式
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
       form: {
+        amountSettled: 0,
         discountAmount: 0, //  折让金额
         settleStyleSn: undefined,
+        settleClientName: '',
+        settleAccountSn: undefined,
+        settleAccountName: undefined,
         remark: ''
       },
       rules: {
+        amountSettled: [{ required: true, message: '请输入本次结算金额,系统将自动分配到已选单据上', trigger: 'change' }],
         discountAmount: [{ required: true, message: '请输入折让金额', trigger: 'blur' }],
-        settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }]
+        settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }],
+        settleAccountSn: [{ required: true, message: '请选择结算账户', trigger: 'change' }]
       },
       openModal: false, //  弹框
-      isPositive: true // 是否是正值
+      isPositive: true, // 是否是正值
+      isChangeAs: false,
+      maxAmountSettled: 0,
+      enableFundAccount: false
     }
   },
   computed: {
@@ -225,27 +260,81 @@ export default {
       })
       return val / 1000
     },
-    // 应结算金额
-    amountSettled () {
-      let val = 0
-      this.chooseLoadData.map(item => {
-        val += (Number(item.settleAmount) * 1000)
-      })
-      val = val / 1000
-      if (val < 0) {
-        this.isPositive = false
-      } else {
-        this.isPositive = true
-      }
-      return Math.abs(val)
-    },
     // 实结算金额
     actualSettlementAmount () {
-      const val = (this.amountSettled * 1000 - this.form.discountAmount * 1000) / 1000
+      const val = (this.form.amountSettled * 1000 - this.form.discountAmount * 1000) / 1000
       return val
     }
   },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      const params = _this.getParams()
+      _this.spinning = true
+      let url = settleUnitPrint
+      if (type == 'export') { //  导出
+        url = settleUnitExport
+      }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '单位应收应付', function () {
+        _this.spinning = false
+      })
+    },
+    // 选择结算方式
+    settleStyleChange (v, name) {
+      this.form.settleStyleName = name
+    },
+    settleAccountChange (v, name) {
+      this.form.settleAccountName = name
+    },
+    // 应结算金额
+    amountSettledChange () {
+      console.log(this.isChangeAs)
+      if (!this.isChangeAs) {
+        let val = 0
+        this.chooseLoadData.map(item => {
+          val += (Number(item.settleAmount) * 1000)
+        })
+        val = val / 1000
+        this.isPositive = val > 0
+        this.form.amountSettled = Math.abs(val)
+        this.maxAmountSettled = Math.abs(val)
+      }
+    },
+    // 修改本次结算金额,自动分配
+    amountSettledTotalChange (v) {
+      console.log(this.isChangeAs, v, this.totalBalance, this.isPositive)
+      if (v <= Math.abs(this.totalBalance)) {
+        this.isChangeAs = true
+        const sa = v
+        const list = this.chooseLoadData
+        // 恢复初始值
+        list.map((item, index) => {
+          item.settleAmount = item.unsettleAmount
+        })
+        this.maxAmountSettled = Math.abs(this.totalBalance)
+        // 开始计算
+        let temp = 0
+        let ti = 0
+        for (let i = 0; i < list.length; i++) {
+          temp = temp + list[i].settleAmount * (this.isPositive ? 1 : -1)
+          if (temp >= sa) {
+            ti = i
+            break
+          }
+        }
+        console.log(ti, temp, sa)
+        list[ti].settleAmount = (list[ti].settleAmount - (temp - sa) * (this.isPositive ? 1 : -1)).toFixed(2)
+        // ti 之后的都改成0
+        for (let i = ti + 1; i < list.length; i++) {
+          list[i].settleAmount = 0
+        }
+        list.splice()
+        this.isChangeAs = false
+      }
+    },
     // 选择单据
     handleChoose () {
       this.openModal = true
@@ -254,6 +343,26 @@ export default {
     handleDel (record) {
       const ind = this.chooseLoadData.findIndex(item => item.id == record.id)
       this.chooseLoadData.splice(ind, 1)
+      this.amountSettledChange()
+    },
+    getParams () {
+      const _this = this
+      const form = _this.form
+      form.settleClientName = _this.$route.params.name
+      form.settleClientSn = _this.$route.params.sn || undefined
+      form.settleClientType = _this.chooseLoadData[0].settleClientType
+      form.settleType = _this.isPositive ? 'R' : 'P'
+      form.settleAmount = _this.form.amountSettled
+      form.realSettleAmount = _this.actualSettlementAmount
+      form.detailList = []
+      _this.chooseLoadData.map(item => {
+        form.detailList.push({
+          bizSn: item.bizSn,
+          settleAmount: item.settleAmount,
+          prFlag: item.prFlag
+        })
+      })
+      return form
     },
     // 提交
     handleSubmit () {
@@ -264,21 +373,8 @@ export default {
       }
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          const form = _this.form
-          form.settleClientSn = _this.$route.params.sn || undefined
-          form.settleClientType = _this.chooseLoadData[0].settleClientType
-          form.settleType = _this.isPositive ? 'R' : 'P'
-          form.settleAmount = _this.amountSettled
-          form.realSettleAmount = _this.actualSettlementAmount
-          form.detailList = []
-          _this.chooseLoadData.map(item => {
-            form.detailList.push({
-              bizSn: item.bizSn,
-              settleAmount: item.settleAmount,
-              prFlag: item.prFlag
-            })
-          })
           _this.spinning = true
+          const form = this.getParams()
           settleUnitSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -295,17 +391,12 @@ export default {
       })
     },
     handleOk (selectedRows) {
-      this.chooseLoadData = selectedRows
-    },
-    //  结算方式
-    getSettleStyle () {
-      settleStyleQueryAll({}).then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        } else {
-          this.settleStyleList = []
-        }
+      this.chooseLoadData = selectedRows.sort((a, b) => {
+        const at = new Date(a.auditTime).getTime()
+        const bt = new Date(b.auditTime).getTime()
+        return bt - at
       })
+      this.amountSettledChange()
     },
     // 返回列表
     handleBack () {
@@ -314,19 +405,39 @@ export default {
     // 关闭
     handleClose () {
       this.openModal = false
+    },
+    // 默认获取所有单据
+    getsettleInfoAllList () {
+      settleInfoAllList({ settleClientSn: this.$route.params.sn, settleClientType: this.$route.params.type, notEqZero: 1 }).then(res => {
+        res.data.map(item => {
+          item.settleAmount = item.unsettleAmount
+        })
+        this.chooseLoadData = res.data || []
+        this.amountSettledChange()
+      })
+    },
+    pageInit () {
+      this.chooseLoadData = []
+      this.getsettleInfoAllList()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.getSettleStyle()
-      this.chooseLoadData = []
+      this.pageInit()
     }
   },
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      this.getSettleStyle()
-      this.chooseLoadData = []
+      this.pageInit()
+    }
+    // 结算账户状态查询
+    if (this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')) {
+      this.GetSettleAccountState().then(res => {
+        if (res.status == 200) {
+          this.enableFundAccount = res.data.functionEnableFlag == 1
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -341,9 +452,8 @@ export default {
     height: 100%;
     padding-bottom: 51px;
     box-sizing: border-box;
-    margin-bottom: 10px;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .collectionPayment-cont{

+ 2 - 4
src/views/financialManagement/companyReceivablePayable/detail.vue

@@ -157,8 +157,8 @@ export default {
     },
     //  导出
     handleExport () {
-      const params = this.queryParam
-      this.exportLoading = true
+      // const params = this.queryParam
+      // this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false
 	  // downloadExcel(res, '单位应收应付')
@@ -167,14 +167,12 @@ export default {
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.$refs.table.refresh(true)
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      this.$refs.table.refresh(true)
       this.resetSearchForm()
     }
   },

+ 36 - 21
src/views/financialManagement/expenseManagement/edit.vue

@@ -44,11 +44,21 @@
           </a-form-model-item>
           <a-form-model-item label="结算方式" prop="settleStyleSn">
-            <a-select placeholder="请选择结算方式" allowClear v-model="form.settleStyleSn" @change="settleStyleChange">
-              <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-                {{ item.name }}
-              </a-select-option>
-            </a-select>
+            <settleStyle
+              id="expenseManagementEdit-settleStyleSn"
+              v-model="form.settleStyleSn"
+              @change="settleStyleChange"
+              placeholder="请选择结算方式">
+            </settleStyle>
+          </a-form-model-item>
+          <a-form-model-item v-if="enableFundAccount" label="结算账户" prop="settleAccountSn">
+            <settleAccount
+              id="expenseManagementEdit-settleAccountSn"
+              ref="settleAcount"
+              v-model="form.settleAccountSn"
+              :settleStyleSn="form.settleStyleSn"
+              placeholder="请选择结算账户">
+            </settleAccount>
           </a-form-model-item>
           <a-form-model-item label="关联单号" prop="bizNo">
             <a-input id="expenseManagementEdit-bizNo" :maxLength="30" v-model.trim="form.bizNo" placeholder="请输入关联单号(最多30个字符)" allowClear />
@@ -67,23 +77,25 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { STable, VSelect } from '@/components'
 import { settleExpenseSave, findExpenseDetail } from '@/api/settleExpense'
 import { costTypeAllQuery } from '@/api/costType'
-import { settleStyleQueryAll } from '@/api/settleStyle'
+import settleStyle from '@/views/common/settleStyle'
+import settleAccount from '@/views/common/settleAccount'
 export default {
   name: 'ExpenseManagementEdit',
-  components: { STable, VSelect },
+  components: { STable, VSelect, settleStyle, settleAccount },
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
+      enableFundAccount: false,
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
       costTypeList: [], // 费用类型
-      settleStyleList: [], // 结算方式
       form: {
         expensesTypeSn1: '', // 费用类型
         expensesTypeSn2: '', // 费用类型1
@@ -93,27 +105,22 @@ export default {
         settleStyleSn: undefined, //  结算方式
         settleStyleName: '', // 结算方式名称
         bizNo: '', //  关联单号
-        remark: '' //  备注
+        remark: '', //  备注
+        settleAccountSn: undefined
       },
       rules: {
         costType: [{ required: true, message: '请选择费用类型', trigger: 'change' }],
         settleAmount: [{ required: true, message: '请输入费用金额', trigger: 'blur' }],
-        settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }]
+        settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }],
+        settleAccountSn: [{ required: true, message: '请选择结算账户', trigger: 'change' }]
       }
     }
   },
   methods: {
-    // 获取结算方式
-    getSettleStyle () {
-      settleStyleQueryAll().then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        }
-      })
-    },
+    ...mapActions(['GetSettleAccountState']),
     // 选择结算方式
-    settleStyleChange (v) {
-      this.form.settleStyleName = this.settleStyleList.find(item => item.settleStyleSn == v).name
+    settleStyleChange (v, name) {
+      this.form.settleStyleName = name
     },
     //  递归函数
     recursionFun (data) {
@@ -199,7 +206,6 @@ export default {
         vm.getDetail()
       }
       vm.getCostTypeList()
-      vm.getSettleStyle()
     }
   },
   mounted () {
@@ -212,6 +218,14 @@ export default {
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
       this.pageInit()
     }
+    // 结算账户状态查询
+    if (this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')) {
+    	this.GetSettleAccountState().then(res => {
+    	  if (res.status == 200) {
+    		this.enableFundAccount = res.data.functionEnableFlag == 1
+    	  }
+    	})
+    }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})
@@ -224,6 +238,7 @@ export default {
   height: 100%;
   >.ant-spin-nested-loading{
     height: 100%;
+	overflow-y: auto;
     .ant-spin-container{
       height: 90%;
     }

+ 9 - 3
src/views/financialManagement/expenseManagement/list.vue

@@ -82,10 +82,14 @@
         <template slot="expensesType" slot-scope="text, record">
           {{ record.expensesTypeName1 }} <span v-if="record.expensesTypeName2">>{{ record.expensesTypeName2 }}</span> <span v-if="record.expensesTypeName3">>{{ record.expensesTypeName3 }}</span>
         </template>
-        <!-- 状态 -->
+        <!-- 费用单号 -->
         <template slot="accountExpensesNo" slot-scope="text, record">
           <span :class="$hasPermissions('B_expenseDetail')?'active':'common'" @click="handleDetail(record)">{{ text }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'AUDIT_PASS'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -125,9 +129,10 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { settleExpenseQuery, delExpense, settleExpenseQuerySum, auditExpense } from '@/api/settleExpense'
 import { costTypeAllQuery } from '@/api/costType'
 import expenseManagementDetailModal from './detailModal.vue'
+import stateIcon from '@/views/common/stateIcon'
 export default {
   name: 'ExpenseManagementList',
-  components: { STable, VSelect, expenseManagementDetailModal, rangeDate },
+  components: { STable, VSelect, expenseManagementDetailModal, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -160,7 +165,8 @@ export default {
         { title: '创建时间', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '费用类型', scopedSlots: { customRender: 'expensesType' }, width: '20%', align: 'center' },
         { title: '金额', dataIndex: 'settleAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '单据状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '单据状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 140 - 28
src/views/financialManagement/financialCollection/list.vue

@@ -68,9 +68,10 @@
         </div>
       </a-alert>
       <div v-if="$hasPermissions('B_financialCollectionPl')" style="margin-bottom: 10px">
-        <a-button type="primary" id="financialCollectionList-export" :loading="loading" @click="handleCollection">批量收款</a-button>
+        <a-button type="primary" id="financialCollectionList-export" :loading="loading" @click="enableFundAccount ? handleSettleAcountPay(null,1) : handleCollection()">批量收款</a-button>
         <span style="margin-left: 8px" v-if="$hasPermissions('B_financialCollectionPl')">
           <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
+          <template v-if="selectTotalAmount">,合计¥{{ selectTotalAmount }}</template>
         </span>
       </div>
       <!-- 列表 -->
@@ -88,6 +89,10 @@
         :defaultLoadData="false"
         bordered
       >
+        <!-- 关联单号 -->
+        <template slot="bizNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.bizNo }}</span>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -103,7 +108,7 @@
             :loading="loading"
             class="button-error"
             v-if="(record.settleState == 'UNSETTLE' || record.settleState == 'PART_SETTLED')&&record.satelliteFlag!=1 && $hasPermissions('B_financialCollectionSing')"
-            @click="handleCollectionSing(record)"
+            @click="enableFundAccount ? handleSettleAcountPay(record,0) : handleCollectionSing(record)"
             id="financialCollectionList-pay-btn">收款</a-button>
           <span v-if="!(record.settleState == 'SETTLED' && $hasPermissions('B_financialCollectionDetail')) && !((record.settleState == 'UNSETTLE' || record.settleState == 'PART_SETTLED')&&record.satelliteFlag!=1 && $hasPermissions('B_financialCollectionSing'))">--</span>
           <!-- satelliteFlag为1,是卫星仓 -->
@@ -112,18 +117,56 @@
     </a-spin>
     <!-- 详情 -->
     <detail-modal :openModal="openModal" ref="detailModal" @close="openModal = false" />
+    <!-- 关联单号详情 -->
+    <a-modal
+      centered
+      class="outboundOrderDetail-modal"
+      :footer="null"
+      :maskClosable="false"
+      :bodyStyle="{padding:'12px'}"
+      :title="curBizTitle"
+      v-model="openDetailModal"
+      v-if="openDetailModal&&fcBizType!='SPARE_PARTS_RETURN'"
+      @cancle="handleDetailClose"
+      width="80%">
+      <div style="max-height: 700px;overflow-y: auto;">
+        <!-- 销售单 -->
+        <salesDetailModal v-if="fcBizType=='SELL'" :outBizSn="orderSn" />
+        <!-- 采购退货 -->
+        <pushOrderDetailModal v-if="fcBizType=='PURCHASE_RETURN'&&!$hasPermissions('M_purchaseReturn_outSnycList')" :outBizSn="orderSn" />
+        <pushOrderOutSyncDetailModal v-if="fcBizType=='PURCHASE_RETURN'&&$hasPermissions('M_purchaseReturn_outSnycList')" :outBizSn="orderSn"></pushOrderOutSyncDetailModal>
+        <!-- 店内调出 -->
+        <storeTransferOutDetailModal v-if="fcBizType=='STORE_CALL_OUT'" :outBizSn="orderSn"></storeTransferOutDetailModal>
+        <!-- 连锁调出 -->
+        <chainTransferOutDetailModal v-if="fcBizType=='LINKAGE_CALL_OUT'" :outBizSn="orderSn" />
+      </div>
+    </a-modal>
+    <!-- 散件退货 -->
+    <bulkReturnGoods-detail-modal :openModal="openBulkReturnDetailModal" :itemSn="orderSn" @close="handleDetailClose" />
+    <!-- 收付款弹框 -->
+    <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
   </a-card>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { STable, VSelect } from '@/components'
 import detailModal from './detailModal.vue'
+import settleModal from '../settleModal/settleModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
+import salesDetailModal from '@/views/salesManagement/salesQuery/detail.vue'
+// 同步采购退货单详情
+import pushOrderDetailModal from '@/views/purchasingManagement/purchaseReturn/detail.vue'
+// 不同步采购退货单
+import pushOrderOutSyncDetailModal from '@/views/purchasingManagement/purchaseReturnOutSync/detail.vue'
+import chainTransferOutDetailModal from '@/views/allocationManagement/chainTransferOut/detail.vue'
+import storeTransferOutDetailModal from '@/views/allocationManagement/storeTransferOut/detail.vue'
+import bulkReturnGoodsDetailModal from '@/views/bulkManagement/bulkReturnGoods/detailModal.vue'
 import { settleReceiptQuery, queryByTypeSum, settleReceiptMoney, settleReceiptQuerySum } from '@/api/settleReceipt'
 export default {
   name: 'FinancialCollectionList',
-  components: { STable, VSelect, detailModal, rangeDate },
+  components: { STable, VSelect, detailModal, rangeDate, settleModal, pushOrderDetailModal, pushOrderOutSyncDetailModal, salesDetailModal, chainTransferOutDetailModal, bulkReturnGoodsDetailModal, storeTransferOutDetailModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -131,8 +174,15 @@ export default {
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
+      openDetailModal: false,
+      openSettleModal: false, // 打开收款弹框
+      openBulkReturnDetailModal: false,
+      enableFundAccount: false, // 是否开启资金账户管理
       tableHeight: 0,
       curBizType: 'ALL',
+      curBizTitle: '',
+      fcBizType: '',
+      orderSn: null,
       // 查询参数
       queryParam: {
         bizType: 'ALL',
@@ -154,7 +204,7 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '收款单号', dataIndex: 'settleNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联单号', dataIndex: 'bizNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单号', dataIndex: 'bizNo', scopedSlots: { customRender: 'bizNo' }, width: '16%', align: 'center' },
         { title: '商户名称', dataIndex: 'settleClientName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '应收金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '已收金额', dataIndex: 'settledAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
@@ -191,7 +241,36 @@ export default {
       rowSelectionInfo: null
     }
   },
+  computed: {
+    selectTotalAmount () {
+      let ret = 0
+      if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows) {
+        this.rowSelectionInfo.selectedRows.map(item => {
+          ret = ret + item.unsettleAmount
+        })
+      }
+      return ret
+    }
+  },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
+    handleDetailClose () {
+      this.openDetailModal = false
+      this.openBulkReturnDetailModal = false
+      this.orderSn = null
+    },
+    // 查看关联单号
+    handleDetail (row) {
+      console.log(row)
+      this.orderSn = row.bizSn
+      this.fcBizType = row.bizType
+      this.curBizTitle = row.bizTypeDictValue + '详情'
+      if (row.bizType == 'SPARE_PARTS_RETURN') {
+        this.openBulkReturnDetailModal = true
+      } else {
+        this.openDetailModal = true
+      }
+    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
@@ -228,6 +307,46 @@ export default {
       this.$refs.detailModal.getDetail(row.id)
       this.openModal = true
     },
+    // 开启结算账户功能收款, type:0 单条收款,1 批量收款
+    handleSettleAcountPay (row, type) {
+      this.openSettleModal = true
+      const data = {
+        totalAmount: type ? this.selectTotalAmount : row && row.unsettleAmount || 0,
+        settleClientName: type ? '' : row && row.settleClientName || '',
+        title: '收款',
+        type,
+        row
+      }
+      this.$nextTick(() => {
+        this.$refs.settleModal.setData(data)
+      })
+    },
+    // 去收款
+    settleAcountPay (form, data) {
+      const _this = this
+      const params =
+      {
+        'settleIds': data.type ? _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys : [data.row.id]
+      }
+      // 资金管理开启
+      if (this.enableFundAccount) {
+        params.settleStyleSn = form.settleStyleSn
+        params.settleAccountSn = form.settleAccountSn
+      }
+      _this.loading = true
+      _this.spinning = true
+      settleReceiptMoney(params).then(res => {
+        _this.loading = false
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.$refs.table.clearSelected() // 清空表格选中项
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
     // 收款
     handleCollectionSing (row) {
       const _this = this
@@ -237,19 +356,7 @@ export default {
         centered: true,
         closable: true,
         onOk () {
-          _this.loading = true
-          _this.spinning = true
-          settleReceiptMoney([row.id]).then(res => {
-            _this.loading = false
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.$refs.table.clearSelected() // 清空表格选中项
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+          _this.settleAcountPay(null, { type: 0, row: row })
         }
       })
     },
@@ -265,17 +372,14 @@ export default {
         this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
-      this.loading = true
-      this.spinning = true
-      settleReceiptMoney(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys).then(res => {
-        this.loading = false
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          this.$refs.table.refresh()
-          this.$refs.table.clearSelected() // 清空表格选中项
-          this.spinning = false
-        } else {
-          this.spinning = false
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: <div><p style="margin-top:20px;">合计金额¥{ this.selectTotalAmount } </p><p>确认批量收款吗?</p></div>,
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.settleAcountPay(null, { type: 1, row: null })
         }
       })
     },
@@ -338,6 +442,14 @@ export default {
       }
       this.pageInit()
     }
+    // 结算账户状态查询
+    if(this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')){
+    	this.GetSettleAccountState().then(res => {
+    	  if (res.status == 200) {
+    		this.enableFundAccount = res.data.functionEnableFlag == 1
+    	  }
+    	})
+    }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})

+ 75 - 30
src/views/financialManagement/financialPayment/list.vue

@@ -67,9 +67,10 @@
         </div>
       </a-alert>
       <div v-if="$hasPermissions('B_financialPaymentPl')" style="margin-bottom: 10px">
-        <a-button type="primary" id="finacialPay-export" :loading="loading" @click="handlePayment">批量付款</a-button>
+        <a-button type="primary" id="finacialPay-export" :loading="loading" @click="enableFundAccount ? handleSettleAcountPay(null,1) : handlePayment()">批量付款</a-button>
         <span style="margin-left: 8px" v-if="$hasPermissions('B_financialPaymentPl')">
           <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
+          <template v-if="selectTotalAmount">,合计¥{{ selectTotalAmount }}</template>
         </span>
       </div>
       <!-- 列表 -->
@@ -102,7 +103,7 @@
             class="button-error"
             :loading="loading"
             v-else-if="record.settleState != 'SETTLED' && $hasPermissions('B_financialPaymentSing')"
-            @click="handlePay(record)"
+            @click="enableFundAccount ? handleSettleAcountPay(record,0) : handlePay(record)"
             id="finacialPay-pay-btn">付款</a-button>
           <span v-else>--</span>
         </template>
@@ -110,18 +111,22 @@
     </a-spin>
     <!-- 详情 -->
     <detail-modal :openModal="openModal" ref="detailModal" @close="openModal = false" />
+    <!-- 收付款弹框 -->
+    <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
   </a-card>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { STable, VSelect } from '@/components'
 import detailModal from './detailModal.vue'
+import settleModal from '../settleModal/settleModal.vue'
 import { settlePayQuery, queryByTypeSum, settlePayMoney, settlePayQuerySum } from '@/api/settlePay.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 export default {
   name: 'FinancialPaymentList',
-  components: { STable, VSelect, detailModal, rangeDate },
+  components: { STable, VSelect, detailModal, rangeDate, settleModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -129,6 +134,8 @@ export default {
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
+      openSettleModal: false, // 打开付款弹框
+      enableFundAccount: false, // 是否开启资金账户管理
       tableHeight: 0,
       curBizType: 'ALL',
       // 查询参数
@@ -189,9 +196,22 @@ export default {
       rowSelectionInfo: null
     }
   },
+  computed: {
+    selectTotalAmount () {
+      let ret = 0
+      if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows) {
+        this.rowSelectionInfo.selectedRows.map(item => {
+          ret = ret + item.unsettleAmount
+        })
+      }
+      return ret.toFixed(2)
+    }
+  },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
     // 表格选中项
     rowSelectionFun (obj) {
+      console.log(obj)
       this.rowSelectionInfo = obj || null
     },
     //  时间  change
@@ -226,6 +246,47 @@ export default {
       this.$refs.detailModal.getDetail(row.id)
       this.openModal = true
     },
+    // 开启结算账户功能付款, type:0 单条付款,1 批量付款
+    handleSettleAcountPay (row, type) {
+      this.openSettleModal = true
+      const data = {
+        totalAmount: type ? this.selectTotalAmount : row && row.unsettleAmount || 0,
+        settleClientName: type ? '' : row && row.settleClientName || '',
+        title: '付款',
+        type,
+        row
+      }
+      this.$nextTick(() => {
+        this.$refs.settleModal.setData(data)
+      })
+    },
+    // 去付款
+    settleAcountPay (form, data) {
+      const _this = this
+      const params =
+      {
+        'settleIds': data.type ? _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys : [data.row.id]
+      }
+      // 资金管理开启
+      if (this.enableFundAccount) {
+        params.settleStyleSn = form.settleStyleSn
+        params.settleAccountSn = form.settleAccountSn
+      }
+
+      _this.loading = true
+      _this.spinning = true
+      settlePayMoney(params).then(res => {
+        _this.loading = false
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.$refs.table.clearSelected() // 清空表格选中项
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
     // 付款
     handlePay (row) {
       const _this = this
@@ -235,19 +296,7 @@ export default {
         centered: true,
         closable: true,
         onOk () {
-          _this.loading = true
-          _this.spinning = true
-          settlePayMoney([row.id]).then(res => {
-            _this.loading = false
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.$refs.table.clearSelected() // 清空表格选中项
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+          _this.settleAcountPay(null, { type: 0, row: row })
         }
       })
     },
@@ -266,23 +315,11 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认批量付款吗?',
+        content: <div><p style="margin-top:20px;">合计金额¥{ this.selectTotalAmount } </p><p>确认批量付款吗?</p></div>,
         centered: true,
         closable: true,
         onOk () {
-          _this.loading = true
-          _this.spinning = true
-          settlePayMoney(_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys).then(res => {
-            _this.loading = false
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.clearSelected() // 清空表格选中项
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+          _this.settleAcountPay(null, { type: 1, row: null })
         }
       })
     },
@@ -345,6 +382,14 @@ export default {
       }
       this.pageInit()
     }
+    // 结算账户状态查询
+    if(this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')){
+    	this.GetSettleAccountState().then(res => {
+    	  if (res.status == 200) {
+    		this.enableFundAccount = res.data.functionEnableFlag == 1
+    	  }
+    	})
+    }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})

+ 173 - 0
src/views/financialManagement/fundAccountManagement/addModal.vue

@@ -0,0 +1,173 @@
+<template>
+  <a-modal
+    centered
+    class="fundAount-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="(isEdit?'编辑':'新增')+'资金账户'"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="fundAount-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="账户类型" prop="settleStyleSn">
+          <settleStyle
+            id="fundAount-settleStyleSn"
+            v-model="form.settleStyleSn"
+            @change="settleStyleChange"
+            placeholder="请选择账户类型">
+          </settleStyle>
+        </a-form-model-item>
+        <a-form-model-item label="账户名称" prop="accountName">
+          <a-input
+            id="fundAount-accountName"
+            :maxLength="30"
+            v-model.trim="form.accountName"
+            placeholder="请输入账户名称(最多30个字符)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="账户号码" prop="accountNo">
+          <a-input
+            id="fundAount-accountNo"
+            :maxLength="30"
+            v-model.trim="form.accountNo"
+            placeholder="请输入账户号码(最多30个字符)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import { settleAccountSave, settleAccountDetail } from '@/api/settleAcount'
+import settleStyle from '@/views/common/settleStyle'
+export default {
+  name: 'BasicInfoModal',
+  components: { VSelect, settleStyle },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      confirmLoading: false,
+      isShow: this.openModal, //  是否打开弹框
+      isEdit: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        settleStyleSn: '',
+        settleStyleName: '',
+        accountName: '',
+        accountNo: ''
+      },
+      rules: {
+        settleStyleSn: [
+          { required: true, message: '请选择账户类型', trigger: 'change' }
+        ],
+        accountName: [
+          { required: true, message: '请输入账户名称(最多30个字符)', trigger: 'change' }
+        ],
+        accountNo: [
+          { required: true, message: '请输入账户号(最多30个字符)', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    resetForm () {
+      this.$refs.ruleForm.resetFields()
+      this.form = {
+        settleStyleSn: '',
+        settleStyleName: '',
+        accountName: '',
+        accountNo: ''
+      }
+      this.isEdit = false
+    },
+    settleStyleChange (v, name) {
+      this.form.settleStyleName = name
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          settleAccountSave(_this.form).then(res => {
+            if (res.status == 200) {
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
+              _this.$message.info(res.message)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 编辑信息
+    setData (data) {
+      if (data && data.settleAccountSn) {
+        settleAccountDetail({ settleAccountSn: data.settleAccountSn }).then(res => {
+          if (res.status == '200') {
+            this.form = Object.assign(this.form, res.data || {})
+            this.isEdit = true
+          }
+        })
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .fundAount-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .radio-s{
+      margin-bottom: 8px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 251 - 0
src/views/financialManagement/fundAccountManagement/detail.vue

@@ -0,0 +1,251 @@
+<template>
+  <div class="fundAcountDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="fundAcountDetail-back" v-if="pageType=='pages'">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="fundAcountDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="color: #333;margin-left: 30px;font-weight: bold;" v-if="detailData">{{ detailData.settleStyleName }}({{ detailData.accountName }} {{ detailData.accountNo }})</span>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据类型">
+                  <v-select
+                    v-model="queryParam.bizType"
+                    ref="bizType"
+                    :isEnable="true"
+                    id="fundAcountDetail-bizType"
+                    code="SETTLE_FLOW_BIZ_TYPE"
+                    placeholder="请选择单据类型"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="关联单据号">
+                  <a-input id="fundAcountDetail-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单据号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="操作时间">
+                  <rangeDate id="fundAcountDetail-settleTime" ref="rangeDate" @change="dateChange" />
+                </a-form-item>
+              </a-col>
+              <template v-if="advanced">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="往来单位">
+                    <a-input id="fundAcountDetail-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入往来单位名称"/>
+                  </a-form-item>
+                </a-col>
+              </template>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="fundAcountDetail-refresh">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="fundAcountDetail-reset">重置</a-button>
+                  <a @click="advanced=!advanced" style="margin-left: 8px">
+                    {{ advanced ? '收起' : '展开' }}
+                    <a-icon :type="advanced ? 'up' : 'down'"/>
+                  </a>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 结算金额 -->
+          <template slot="settleAmount" slot-scope="text, record">
+            <span :style="{color:text<0?'red':''}">{{ ((text || text == 0) ? (text) : '--') }}</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { findSettleFlowPage, settleAccountDetail } from '@/api/settleAcount'
+export default {
+  name: 'FundAccountDetail',
+  components: { STable, VSelect, rangeDate },
+  mixins: [commonMixin],
+  props: {
+    pageType: { // 页面表现形式,pages 新页签打开的页面,modal 弹框里的页面
+      type: String,
+      default: 'pages'
+    },
+    paramsData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    },
+    saveing: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, //  高级搜索 展开/关闭
+      detailData: null, // 详细基础信息
+      // 查询参数
+      queryParam: {
+        beginDate: '',
+        endDate: '',
+        bizType: '',
+        bizNo: '',
+        settleClientName: ''
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单据号', dataIndex: 'bizNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作时间', dataIndex: 'settleTime', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作人', dataIndex: 'operateName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '往来单位', dataIndex: 'settleClientName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结算金额', dataIndex: 'settleAmount', scopedSlots: { customRender: 'settleAmount' }, width: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        this.queryParam.settleAccountSn = this.$route.params.sn
+        return findSettleFlowPage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      if (date.length) {
+        this.queryParam.beginDate = date[0] + ' 00:00:00'
+        this.queryParam.endDate = date[1] + ' 00:00:00'
+      } else {
+        this.queryParam.beginDate = ''
+        this.queryParam.endDate = ''
+      }
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam = {
+        beginDate: '',
+        endDate: '',
+        bizType: '',
+        bizNo: '',
+        settleClientName: ''
+      }
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.getDetail()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 270
+    },
+    //  返回
+    handleBack () {
+      if (this.pageType == 'pages') {
+        this.$router.push({ name: 'fundAccountList' })
+      } else {
+        this.$emit('cansel')
+      }
+    },
+    getDetail () {
+      settleAccountDetail({ settleAccountSn: this.$route.params.sn }).then(res => {
+        if (res.status == '200') {
+          this.detailData = res.data
+        }
+      })
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .fundAcountDetail-wrap{
+    .fundAcountDetail-back{
+      margin-bottom: 8px;
+    }
+    .sTable{
+      margin-top: 10px;
+    }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0);
+	}
+  }
+</style>

+ 317 - 0
src/views/financialManagement/fundAccountManagement/list.vue

@@ -0,0 +1,317 @@
+<template>
+  <div class="funAccountList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" v-if="$hasPermissions('B_fundAccountEnable')" class="funAccountList-page-search-wrapper">
+        <div>
+          资金账户功能:
+          <a-radio-group
+            size="large"
+            v-model="enableFundAccount"
+            :options="[
+              { label: '启用', value: '1' },
+              { label: '禁用', value: '0' },
+            ]"
+            @change="enableFundAccountChange" />
+        </div>
+        <div>
+          开启资金账户功能后,在进行财务收款和付款时,需要从下面列表选择一个账户。
+        </div>
+      </div>
+
+      <a-card size="small" :bordered="false">
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button id="funAccountList-add" v-if="$hasPermissions('B_FA_New')" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="(record.state == 'ENABLE'||record.state == 'DISABLE')&&$hasPermissions('B_FA_QYJY')"
+              class="button-primary"
+              @click="handleEnable(record)"
+              id="foundAcount-enable-btn">
+              {{ record.state == 'ENABLE'?'禁用':'' }}
+              {{ record.state == 'DISABLE'?'启用':'' }}
+            </a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="(record.state == 'ENABLE'||record.state == 'DISABLE')&&$hasPermissions('M_fundAccount_detail')"
+              class="button-primary"
+              @click="handleDetail(record)"
+              id="foundAcount-detail-btn">资金明细</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.state == 'WAIT'&&$hasPermissions('B_FA_Audit')"
+              class="button-primary"
+              @click="handleAudit(record)"
+              id="foundAcount-audit-btn">审核</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.state == 'WAIT'&&$hasPermissions('B_FA_Edit')"
+              class="button-primary"
+              @click="handleEdit(record)"
+              id="foundAcount-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.state == 'WAIT'&&$hasPermissions('B_FA_delete')"
+              class="button-error"
+              @click="handleDel(record)"
+              id="foundAcount-del-btn">删除</a-button>
+          </template>
+        </s-table>
+      </a-card>
+
+    </a-spin>
+    <!-- 新增编辑 -->
+    <addModal ref="addModal" :openModal="openModal" @ok="addSuccess" @close="closeAddModal" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import addModal from './addModal.vue'
+import { settleAccountList, settleAccountEnable, settleAccountDelete, settleAccountAudit } from '@/api/settleAcount'
+export default {
+  name: 'FundAccountManagementList',
+  components: { STable, VSelect, addModal, rangeDate },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, //  高级搜索 展开/关闭
+      enableFundAccount: '', // 结算管理开启状态
+      // 查询参数
+      queryParam: {},
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '账户类型', dataIndex: 'settleStyleName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '账户名称', dataIndex: 'accountName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '账户号码', dataIndex: 'accountNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收入金额', dataIndex: 'totalIncomeAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text) : '--') } },
+        { title: '支出金额', dataIndex: 'totalExpendAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text) : '--') } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return settleAccountList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false, //  查看详情  弹框
+      itemId: '' //  当前id
+    }
+  },
+  methods: {
+    ...mapActions(['UpdateSettleAccount', 'GetSettleAccountState']),
+    enableFundAccountChange (v) {
+      this.UpdateSettleAccount({ enableFlag: v.target.value }).then(res => {
+        if (res.status == 200) {
+          this.GetSettleAccountState()
+        }
+        this.$message.info(res.message)
+      })
+    },
+    // 关闭弹框
+    closeAddModal () {
+      this.openModal = false
+      this.itemId = null
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      this.openModal = true
+      this.$nextTick(() => {
+        this.$refs.addModal.setData(row)
+      })
+    },
+    addSuccess () {
+      this.$refs.table.refresh()
+    },
+    //  资金明细
+    handleDetail (row) {
+      this.$router.push({ name: 'fundAccountDetail', params: { sn: row.settleAccountSn } })
+    },
+    //  审核
+    handleAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '审核通过后,账户信息不能再修改,确认审核通过吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          settleAccountAudit({
+            settleAccountSn: row.settleAccountSn,
+            auditState: 'PASS'
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 启用,禁用
+    handleEnable (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: row.state == 'ENABLE' ? '确认禁用该账户吗?' : '确认启用该账户吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          settleAccountEnable({
+            settleAccountSn: row.settleAccountSn,
+            enableFlag: row.state == 'ENABLE' ? 'DISABLE' : 'ENABLE'
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      _this.$confirm({
+        title: '提示',
+        content: '删除后原数据不可恢复,是否删除?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          settleAccountDelete({ settleAccountSn: row.settleAccountSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      // 结算账户状态查询
+      if (this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')) {
+      	this.GetSettleAccountState().then(res => {
+      	  if (res.status == 200) {
+      		this.enableFundAccount = res.data.functionEnableFlag
+      	  }
+      	})
+      }
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 270
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .funAccountList-wrap{
+    .funAccountList-page-search-wrapper{
+      font-size: 16px;
+      padding:10px 15px;
+      margin-bottom: 8px;
+      background-color: #fff;
+      > div{
+        padding: 5px 0;
+        &:last-child{
+          color: #999;
+          font-size: 14px;
+        }
+      }
+    }
+    .sTable{
+      margin-top: 10px;
+    }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0);
+	}
+  }
+</style>

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

@@ -45,6 +45,10 @@
         <template slot="totalLossQty" slot-scope="text, record">
           <span>{{ (record.totalLossQty || record.totalLossQty==0) ? Math.abs(record.totalLossQty) : '--' }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -74,11 +78,12 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import stateIcon from '@/views/common/stateIcon'
 import inventoryCheckingDetailModal from '@/views/inventoryManagement/inventoryChecking/detailModal.vue'
 import { checkWarehouseAuditList, checkWarehouseFinanceAudit, checkWarehouseReInventory } from '@/api/checkWarehouse'
 export default {
   name: 'InventoryCheckingList',
-  components: { STable, VSelect, rangeDate, inventoryCheckingDetailModal },
+  components: { STable, VSelect, rangeDate, inventoryCheckingDetailModal, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -102,7 +107,8 @@ export default {
         { 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: '财务审核状态', 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 对象

+ 153 - 0
src/views/financialManagement/settleModal/settleModal.vue

@@ -0,0 +1,153 @@
+<template>
+  <a-modal
+    centered
+    class="fundAount-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="'确认'+title"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="fundAount-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="商户名称" style="margin-bottom: 0;" v-if="baseData&&baseData.settleClientName">
+          <span class="ant-form-text">
+            {{ baseData.settleClientName }}
+          </span>
+        </a-form-model-item>
+        <a-form-model-item style="margin-bottom: 10px;" :label="title+'金额'" v-if="baseData">
+          <span class="ant-form-text">
+            ¥{{ baseData.totalAmount }}
+          </span>
+        </a-form-model-item>
+        <a-form-model-item label="结算方式" prop="settleStyleSn">
+          <settleStyle
+            id="expenseManagementEdit-settleStyleSn"
+            v-model="form.settleStyleSn"
+            @change="settleStyleChange"
+            placeholder="请选择结算方式">
+          </settleStyle>
+        </a-form-model-item>
+        <a-form-model-item label="结算账户" prop="settleAccountSn">
+          <settleAccount
+            id="expenseManagementEdit-settleAccountSn"
+            ref="settleAcount"
+            v-model="form.settleAccountSn"
+            :settleStyleSn="form.settleStyleSn"
+            placeholder="请选择结算账户">
+          </settleAccount>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import settleStyle from '@/views/common/settleStyle'
+import settleAccount from '@/views/common/settleAccount'
+export default {
+  name: 'SettleModal',
+  components: { settleStyle, settleAccount },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      confirmLoading: false,
+      isShow: this.openModal, //  是否打开弹框
+      title: '确认',
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        settleStyleSn: '',
+        settleStyleName: '',
+        settleAccountSn: ''
+      },
+      rules: {
+        settleStyleSn: [
+          { required: true, message: '请选择结算方式', trigger: 'change' }
+        ],
+        settleAccountSn: [{ required: true, message: '请选择结算账户', trigger: 'change' }]
+      },
+      baseData: null
+    }
+  },
+  methods: {
+    resetForm () {
+      this.$refs.ruleForm.resetFields()
+      this.form = {
+        settleStyleSn: '',
+        settleStyleName: '',
+        settleAccountSn: ''
+      }
+    },
+    settleStyleChange (v, name) {
+      this.form.settleStyleName = name
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.isShow = false
+          _this.$emit('ok', this.form, this.baseData)
+        } else {
+          return false
+        }
+      })
+    },
+    // 编辑信息
+    setData (data) {
+      this.title = data.title
+      this.baseData = data
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .fundAount-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .radio-s{
+      margin-bottom: 8px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 9 - 2
src/views/financialManagement/warehousingAudit/list.vue

@@ -70,6 +70,11 @@
           <span v-if="record.receivingBillNo" :class="$hasPermissions('M_warehousingAudit_detail')?'active':'common'" @click="handleDetail(record)">{{ record.receivingBillNo }}</span>
           <span v-else>--</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.auditStateDictValue" v-if="record.auditState!='PUT_WAREHOUSE_AUDIT_REJECT'" :state="record.auditState == 'FINISH'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.auditStateDictValue" v-else :state="0"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -99,10 +104,11 @@ import moment from 'moment'
 import getDate from '@/libs/getDate'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import stateIcon from '@/views/common/stateIcon'
 import { receivingAuditList, receivingStockInAudit, receivingCount } from '@/api/receiving'
 export default {
   name: 'WarehousingAuditList',
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -132,7 +138,8 @@ export default {
         { 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: '财务审核状态', dataIndex: 'auditStateDictValue', width: '8%', 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 对象

+ 17 - 5
src/views/inventoryManagement/inventoryChecking/list.vue

@@ -63,6 +63,15 @@
         <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_inventoryCheckingDetail')" @click="handleDetail(record)">{{ record.checkWarehouseNo }}</span>
         <span v-else>{{ record.checkWarehouseNo }}</span>
       </template>
+      <!-- 监盘人审核 -->
+      <template slot="dpaudit" slot-scope="text, record">
+        <stateIcon v-if="record.state!='AUDIT_REJECT'" :state="record.state !== 'WAIT_SUBMIT'&&record.state !== 'WAIT_AUDIT'?'1':'2'"></stateIcon>
+        <stateIcon :title="record.stateDictValue" v-else :state="0"></stateIcon>
+      </template>
+      <!-- 财务人审核 -->
+      <template slot="cwaudit" slot-scope="text, record">
+        <stateIcon :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
@@ -122,10 +131,11 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import inventoryCheckingDetailModal from './detailModal.vue'
+import stateIcon from '@/views/common/stateIcon'
 import { checkWarehouseList, checkWarehouseDel, checkWarehouseAudit, checkWarehouseValidate, checkWarehouseReInventory } from '@/api/checkWarehouse'
 export default {
   name: 'InventoryCheckingList',
-  components: { STable, VSelect, rangeDate, auditModal, basicInfoModal, inventoryCheckingDetailModal },
+  components: { STable, VSelect, rangeDate, auditModal, basicInfoModal, inventoryCheckingDetailModal, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -142,15 +152,17 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '15%', 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: '11%', 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: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'checkSuperviseTime', width: '12%', 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 对象

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

@@ -475,7 +475,7 @@ export default {
       margin: 0 15px;
     }
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
   }

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

@@ -209,7 +209,7 @@ export default {
       margin: 0 15px;
     }
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
   }

+ 37 - 25
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -28,6 +28,9 @@
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
           <a-row>
+            <a-col :md="2" :sm="24" style="text-align: left;">
+              <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-row :gutter="15">
@@ -71,8 +74,7 @@
                 </a-row>
               </a-form>
             </a-col>
-            <a-col :md="4" :sm="24" style="text-align: right;">
-              <a-button size="small" type="primary" class="button-info" @click.stop="handleBatchAdd('batch')" id="chainTransferOutEdit-del-all-btn">批量添加</a-button>
+            <a-col :md="2" :sm="24" style="text-align: right;">
               <a-button
                 size="small"
                 type="primary"
@@ -95,7 +97,7 @@
           :columns="columns"
           :customRow="handleClickRow"
           :data="loadData"
-          :scroll="{ y: 300 }"
+          :scroll="{ y: 150 }"
           :defaultLoadData="false"
           bordered>
           <!-- 产品分类 -->
@@ -105,23 +107,21 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="inventoryCheckSelfDiskList-add-btn">添加</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              :disabled="spinning"
+              @click="handleAdd(record)"
+              id="inventoryCheckSelfDiskList-add-btn">添加</a-button>
           </template>
         </s-table>
       </a-card>
       <a-card size="small" :bordered="false" class="inventoryCheckSelfDiskList-cont">
-        <!-- 总计 -->
-        <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>
-          </div>
-        </a-alert>
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
           <a-row>
-            <a-col :md="20" :sm="24">
+            <a-col :md="24" :sm="24">
               <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                 <a-row :gutter="15">
                   <a-col :md="6" :sm="24">
@@ -164,18 +164,30 @@
                 </a-row>
               </a-form>
             </a-col>
-            <a-col :md="4" :sm="24" style="text-align: right;">
-              <a-button size="small" type="primary" class="button-error" @click.stop="handleDel('', 'batch')" id="chainTransferOutEdit-del-all-btn">批量删除</a-button>
-              <a-button
-                size="small"
-                type="primary"
-                class="button-error"
-                style="margin-left: 5px"
-                @click.stop="handleDel('', 'all')"
-                id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
-            </a-col>
           </a-row>
         </div>
+        <a-row>
+          <a-col :md="20" :sm="16">
+            <a-button size="small" type="primary" class="button-error" @click.stop="handleDel('', 'batch')" id="chainTransferOutEdit-del-all-btn">批量删除</a-button>
+            <!-- 总计 -->
+            <a-alert type="info" style="margin-bottom:10px;display: inline-block;">
+              <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>
+            </a-alert>
+          </a-col>
+          <a-col :md="4" :sm="8" style="text-align: right;">
+            <a-button
+              size="small"
+              type="primary"
+              class="button-error"
+              style="margin-left: 5px"
+              @click.stop="handleDel('', 'all')"
+              id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+          </a-col>
+        </a-row>
         <!-- 列表 -->
         <s-table
           class="sTable"
@@ -196,7 +208,7 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="inventoryCheckSelfDiskList-del-btn">删除</a-button>
+            <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="inventoryCheckSelfDiskList-del-btn">删除</a-button>
           </template>
         </s-table>
       </a-card>
@@ -592,7 +604,7 @@ export default {
       margin: 0 15px;
     }
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
   }

+ 10 - 6
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -77,9 +77,10 @@
                   </a-input-group>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="">
                   <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-form-item>
               </a-col>
             </template>
@@ -183,6 +184,7 @@ export default {
         productTypeSn2: '', //  产品分类2
         productTypeSn3: '', //  产品分类3
         zeroQtyFlag: false, //  库存情况
+        productEnabledFlag: true, // 显示禁用产品
         minUnsalableDays: undefined, // 滞销天数最小值
         maxUnsalableDays: undefined // 滞销天数最大值
       },
@@ -223,11 +225,8 @@ export default {
             parameter.sortAlias = 'stock'
           }
           const params = Object.assign(parameter, this.queryParam)
-          if (params.zeroQtyFlag) {
-            params.zeroQtyFlag = '0'
-          } else {
-            params.zeroQtyFlag = ''
-          }
+          params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
+          params.productEnabledFlag = params.productEnabledFlag ? '' : '1'
           return stockList(params).then(res => {
             let data
             if (res.status == 200) {
@@ -436,6 +435,8 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
+      // 是否默认打印原厂编码
+      this.queryParam.productEnabledFlag = localStorage.getItem('productEnabledFlag-' + this.$store.state.user.info.orgId) != 'false'
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
@@ -449,6 +450,9 @@ export default {
         _this.setTableH()
       })
     },
+    'queryParam.productEnabledFlag' (newValue, oldValue) {
+      localStorage.setItem('productEnabledFlag-' + this.$store.state.user.info.orgId, newValue)
+    },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
     }

+ 3 - 1
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -30,7 +30,7 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <!-- <a-button type="info" style="margin-left: 5px" @click="taskIn" :disabled="disabled" >定时任务</a-button> -->
+                <a-button type="info" style="margin-left: 5px" v-if="isNotProd" @click="taskIn" :disabled="disabled" >定时任务</a-button>
                 <a-button type="primary" style="margin-left: 5px" @click="queryByTypeSum" :disabled="disabled" id="replenishmentManagementList-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="replenishmentManagementList-reset">重置</a-button>
                 <a @click="advanced = !advanced" style="margin-left: 5px">
@@ -120,6 +120,7 @@ export default {
   mixins: [commonMixin],
   data () {
     return {
+      isNotProd: false,
       spinning: false,
       advanced: true, //  高级搜索 展开/关闭
       tableHeight: 0,
@@ -406,6 +407,7 @@ export default {
     },
     pageInit () {
       const _this = this
+      this.isNotProd = !!process.env.VUE_APP_ENVTIPS
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })

+ 11 - 4
src/views/outboundOrderManagement/outboundOrder/list.vue

@@ -68,6 +68,10 @@
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
+        <!-- 状态 -->
+        <template slot="state" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -95,7 +99,7 @@
       :footer="null"
       :maskClosable="false"
       :bodyStyle="{padding:'12px'}"
-      title="详情"
+      :title="detailTitle"
       v-model="openModal"
       v-if="openModal"
       @cancle="cancleModal"
@@ -126,11 +130,12 @@ import storeTransferOutDetailModal from '@/views/allocationManagement/storeTrans
 import chainTransferOutDetailModal from '@/views/allocationManagement/chainTransferOut/detail.vue'
 import warehouseAllocationDetailModal from '@/views/allocationManagement/warehouseAllocation/detail.vue'
 import replenishmentDetailModal from '@/views/numsGoodsShelves/replenishmentManagement/replenishmentDetail.vue'
+import stateIcon from '@/views/common/stateIcon'
 import { stockOutList, stockOutOut, stockOutBatchOut } from '@/api/stockOut'
 import getDate from '@/libs/getDate.js'
 export default {
   name: 'OutboundOrderList',
-  components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal, replenishmentDetailModal },
+  components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal, replenishmentDetailModal, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -159,8 +164,9 @@ export default {
         { title: '总售价', dataIndex: 'productTotalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '出库时间', dataIndex: 'outTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '出库', scopedSlots: { customRender: 'state' }, width: '3%', align: 'center' },
+        // { title: '出库状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       loading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -241,6 +247,7 @@ export default {
     //  详情
     handleDetail (row) {
       this.outBizType = row.outBizType
+      this.detailTitle = row.outBizTypeDictValue + '详情'
       //  根据出库类型跳转对应页面
       if (row.outBizType == 'PURCHASE_RETURN') { // 采购退货
         this.orderSn = row.outBizSn

+ 1 - 0
src/views/productManagement/productInfo/edit.vue

@@ -474,6 +474,7 @@ export default {
     height: 100%;
     >.ant-spin-nested-loading{
       height: 100%;
+	  overflow-y: auto;
       .ant-spin-container{
         height: 90%;
       }

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

@@ -119,7 +119,7 @@
         </a-collapse>
       </a-card>
       <!-- 单据记录 -->
-      <a-card size="small" v-show="false" :bordered="false" class="purchaseOrderDetail-cont">
+      <a-card size="small" v-if="false" :bordered="false" class="purchaseOrderDetail-cont">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="单据记录">
             <a-timeline class="timeline-box">

+ 8 - 6
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -42,8 +42,10 @@
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1">
             <template slot="header">
-              选择产品<span class="sub-title">①输入查询条件--->②查找到需要采购的产品--->③录入采购数量--->④点击“添加”</span>
-              <p class="tag-txt">注意:仅限采购【箭冠】产品。自建产品的采购入库请使用“散件入库”功能</p>
+              <div style="display: flex;">
+                选择产品<span class="sub-title">①输入查询条件--->②查找到需要采购的产品--->③录入采购数量--->④点击“添加”</span>
+                <p class="tag-txt">注意:仅限采购【箭冠】产品。自建产品的采购入库请使用“散件入库”功能</p>
+              </div>
             </template>
             <!-- 选择产品 -->
             <div>
@@ -324,9 +326,9 @@ export default {
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '采购单价', dataIndex: 'discountedPrice', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: '10%', align: 'center' },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
@@ -590,7 +592,7 @@ export default {
     padding-bottom: 51px;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .noStock{
@@ -615,7 +617,7 @@ export default {
       .tag-txt{
         font-size: 12px;
         color: #ed1c24;
-        margin: 0;
+        margin: 0 15px;
       }
       .edit-circle-btn{
         margin-left: 15px;

+ 31 - 11
src/views/purchasingManagement/purchaseOrder/list.vue

@@ -26,7 +26,7 @@
                   option-filter-prop="children"
                   :filter-option="filterOption"
                   @change="tragetTypeChange">
-                  <a-select-option v-for="item in supplierList" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">{{ item.purchaseTargetName }}</a-select-option>
+                  <a-select-option v-for="item in supplierList" :pyCode="item.pyCode" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">{{ item.purchaseTargetName }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -110,11 +110,21 @@
         <template slot="purchaseBillNo" slot-scope="text, record">
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_purchaseDetail')" @click="handleDetail(record)">{{ record.purchaseBillNo }}</span>
           <span v-else>{{ record.purchaseBillNo }}</span>
+          <a-badge count="改" :offset="[10,0]" v-if="record.billStatus=='HQ_CHANGE'||record.billStatus=='SUPERIOR_CHANGE'"></a-badge>
+        </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.billStatusDictValue" v-if="record.billStatus!='AUDIT_REJECT'" :state="record.billStatus == 'WAIT_PUT_WAREHOUSE'||record.billStatus=='AUDIT_PASS'||record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.billStatusDictValue" v-else :state="0"></stateIcon>
+        </template>
+        <!-- 付款 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.financialStatusDictValue" :state="record.financialStatus == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 入库 -->
+        <template slot="waitOut" slot-scope="text, record">
+          <stateIcon :state="record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
         </template>
-        <!-- 财务状态 -->
-        <!-- <template slot="financialStatus" slot-scope="text, record">
-          <span>{{ record.billStatus=='FINISH'&&record.financialStatusDictValue ? record.financialStatusDictValue : '--' }}</span>
-        </template> -->
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -152,11 +162,12 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
+import stateIcon from '@/views/common/stateIcon'
 import getDate from '@/libs/getDate.js'
 import { purchaseList, purchaseDel, purchaseCount, purchaseTargetList } from '@/api/purchase'
 export default {
   name: 'PurchaseList',
-  components: { STable, VSelect, basicInfoModal, rangeDate },
+  components: { STable, VSelect, basicInfoModal, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -190,9 +201,9 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: '14%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'purchaseTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: '13%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'purchaseTargetName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品款数', dataIndex: 'totalCategory', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购金额', dataIndex: 'discountedAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -200,7 +211,10 @@ export default {
         { title: '审核金额', dataIndex: 'totalPushedAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已取消数量', dataIndex: 'totalCancelQty', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务状态', dataIndex: 'financialStatusDictValue', 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: '财务状态', dataIndex: 'financialStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '9%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -358,7 +372,13 @@ export default {
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      // 从首页点击销售开单过来的,直接打开新建弹框
+      if (from.name == 'home' && vm.$store.state.app.isHomeNav && vm.$route.query.pageParams == null) {
+        vm.openModal = true
+        vm.$store.state.app.isHomeNav = false
+      }
+    })
   }
 }
 </script>

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

@@ -309,7 +309,7 @@ export default {
     position: relative;
     height: 100%;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .btn-cont {

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

@@ -23,7 +23,7 @@
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
             <a-descriptions :column="3">
-              <a-descriptions-item label="客户名称">{{ basicInfoData&&basicInfoData.returnTargetName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="供应商">{{ basicInfoData&&basicInfoData.returnTargetName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="采退单号">{{ basicInfoData&&basicInfoData.purchaseReturnNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="创建时间">{{ basicInfoData&&basicInfoData.createDate || '--' }}</a-descriptions-item>
               <a-descriptions-item label="退货数量">{{ basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0) ? basicInfoData.totalQty : '--' }}</a-descriptions-item>
@@ -124,7 +124,7 @@ export default {
       const _this = this
       _this.spinning = true
       let url = purchaseReturnDetailPrint
-      const params = { sn: this.$route.params.sn }
+      const params = { sn: this.$route.params.sn || this.outBizSn }
       if (type == 'export') { //  导出
         url = purchaseReturnDetailExport
       }

+ 6 - 4
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -300,7 +300,9 @@ export default {
       purchaseReturnDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
-          // this.$refs.table.refresh()
+          if (isEdit) {
+            this.$refs.table.refresh()
+          }
           this.$refs.chooseTable.refresh()
           this.spinning = false
         } else {
@@ -334,7 +336,7 @@ export default {
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).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 {
@@ -346,7 +348,7 @@ export default {
             purchaseReturnDetailDel({ id: row.id }).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 {
@@ -422,7 +424,7 @@ export default {
     padding-bottom: 51px;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .purchaseReturnEdit-back, .purchaseReturnEdit-cont{

+ 24 - 6
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -11,8 +11,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="退货单号">
-                <a-input id="purchaseReturnList-purchaseReturnNo" v-model.trim="queryParam.purchaseReturnNo" allowClear placeholder="请输入退货单号"/>
+              <a-form-item label="采购退货单号">
+                <a-input id="purchaseReturnList-purchaseReturnNo" v-model.trim="queryParam.purchaseReturnNo" allowClear placeholder="请输入采购退货单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -71,6 +71,20 @@
         <template slot="purchaseReturnNo" slot-scope="text, record">
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_purchaseReturnDetail')" @click="handleDetail(record)">{{ record.purchaseReturnNo }}</span>
           <span v-else>{{ record.purchaseReturnNo }}</span>
+          <a-badge count="改" :offset="[10,0]" v-if="record.state=='HQ_CHANGE'"></a-badge>
+        </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" v-if="record.state!='AUDIT_REJECT'" :state="record.state == 'WAIT_BACK'||record.state=='CHECKED'||record.state == 'FINISH'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.stateDictValue" v-else :state="0"></stateIcon>
+        </template>
+        <!-- 出库 -->
+        <template slot="waitOut" slot-scope="text, record">
+          <stateIcon :state="record.hasStockBill == '1'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 收款 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'&&record.state!='CANCEL'?'1':'2'"></stateIcon>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -84,7 +98,7 @@
           <a-button
             size="small"
             type="link"
-            v-if="record.state == 'CHECKED' && $hasPermissions('B_purchaseReturnOutStock')"
+            v-if="(record.hasStockBill == '0' && (record.state == 'CHECKED'||record.state == 'FINISH')) && $hasPermissions('B_purchaseReturnOutStock')"
             @click="handleWarehouse(record)"
             class="button-primary"
             id="bulkReturnGoodsList-warehouse-btn">生成出库单</a-button>
@@ -102,7 +116,7 @@
             v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturnDel')"
             @click="handleDel(record)"
             id="purchaseReturnList-del-btn">删除</a-button>
-          <span v-if="!((record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && ($hasPermissions('B_purchaseReturnEdit') || $hasPermissions('B_purchaseReturnDel'))) && !(record.state == 'CHECKED' && ($hasPermissions('B_purchaseReturnOutStock') || $hasPermissions('B_purchaseReturnFinishBill')))">--</span>
+          <span v-if="!((record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && ($hasPermissions('B_purchaseReturnEdit') || $hasPermissions('B_purchaseReturnDel'))) && !(record.hasStockBill == '0' && ($hasPermissions('B_purchaseReturnOutStock') || $hasPermissions('B_purchaseReturnFinishBill')))">--</span>
         </template>
       </s-table>
     </a-spin>
@@ -115,10 +129,11 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { purchaseTargetList } from '@/api/purchase'
 import getDate from '@/libs/getDate.js'
+import stateIcon from '@/views/common/stateIcon'
 import { purchaseReturnList, purchaseReturnSave, purchaseReturnDel, purchaseReturnOutStockBill, purchaseReturnFinishBill } from '@/api/purchaseReturn'
 export default {
   name: 'PurchaseReturnList',
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -146,7 +161,10 @@ export default {
         { title: '客服审核时间', dataIndex: 'auditTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '扣减库存', dataIndex: 'hasStockBill', width: '6%', align: 'center', customRender: function (text) { return ['否', '是'][text] } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务状态', dataIndex: 'settleStateDictValue', width: '8%', 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: '财务状态', dataIndex: 'settleStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 198 - 0
src/views/purchasingManagement/purchaseReturnOutSync/basicInfoModal.vue

@@ -0,0 +1,198 @@
+<template>
+  <a-modal
+    centered
+    class="purchaseOrder-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="新增采购退货单"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="purchaseOrder-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="供应商" prop="returnTargetSn">
+          <a-radio-group
+            name="radioGroup"
+            v-model="form.returnTargetSn"
+            @change="tragetTypeChange"
+            v-if="purchaseTragetType.length"
+            id="purchaseOrder-basicInfo-returnTargetSn" >
+            <a-radio v-for="item in purchaseTragetType" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn" class="radio-s">{{ item.purchaseTargetName }}</a-radio>
+          </a-radio-group>
+          <span v-else>没有可选择的供应商</span>
+        </a-form-model-item>
+        <a-form-model-item label="是否抓单" prop="grabFlag">
+          <v-select
+            code="FLAG"
+            showType="radio"
+            id="purchaseOrder-grabFlag"
+            v-model="form.grabFlag"
+            @change="changeGrabFlag"
+            allowClear
+            placeholder="请选择"></v-select>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import { purchaseTargetList } from '@/api/purchase'
+import { purchaseReturnSaveByNoSync } from '@/api/purchaseReturn'
+export default {
+  name: 'BasicInfoModal',
+  components: { VSelect },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      confirmLoading: false,
+      isShow: this.openModal, //  是否打开弹框
+      settleStyleList: [], // 支付方式
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        returnTargetType: '', // 供应商
+        returnTargetSn: undefined,
+        returnTargetName: '',
+        grabFlag: '1'
+      },
+      rules: {
+        returnTargetSn: [
+          { required: true, message: '请选择供应商', trigger: 'change' }
+        ],
+        grabFlag: [
+          { required: true, message: '请选择抓单类型', trigger: 'change' }
+        ]
+      },
+      purchaseTragetType: []
+    }
+  },
+  mounted () {
+    this.getParentDealer()
+  },
+  methods: {
+    changeGrabFlag (e) {
+      console.log(e)
+    },
+    resetForm () {
+      this.$refs.ruleForm.resetFields()
+      this.form.returnTargetType = ''
+      this.form.returnTargetSn = undefined
+      this.form.returnTargetName = ''
+      this.form.grabFlag = '1'
+    },
+    // 供应商change
+    tragetTypeChange (e) {
+      const val = e.target.value
+      const ind = this.purchaseTragetType.findIndex(item => item.purchaseTargetSn == val)
+      if (ind != -1) {
+        this.form.returnTargetType = this.purchaseTragetType[ind].purchaseTargetType
+        this.form.returnTargetName = this.purchaseTragetType[ind].purchaseTargetName
+      }
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          purchaseReturnSaveByNoSync(_this.form).then(res => {
+            if (res.status == 200) {
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
+              _this.$message.info(res.message)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 编辑信息
+    setData (data) {
+      this.form = JSON.parse(JSON.stringify(data))
+    },
+    getParentDealer () {
+      const zb = this.$hasPermissions('B_PR_outSnycZB')
+      const sj = this.$hasPermissions('B_PR_outSnycSJ')
+      let params = {}
+      // 只能向上级退货
+      if (sj) {
+        params.purchaseTargetType = 'DEALER_UP'
+      }
+      // 只能向总部退货
+      if (zb) {
+        params.purchaseTargetType = 'SUPPLIER_SYS'
+      }
+      // 总部和上级都可以
+      if (sj && zb) {
+        params = {}
+      }
+      console.log(params)
+      purchaseTargetList(params).then(res => {
+        if (res.status == 200 && res.data[0]) {
+          this.purchaseTragetType = res.data
+          this.$emit('load', res.data)
+        } else {
+          this.purchaseTragetType = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      } else {
+        this.getParentDealer()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .purchaseOrder-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .radio-s{
+      margin-bottom: 8px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 199 - 0
src/views/purchasingManagement/purchaseReturnOutSync/detail.vue

@@ -0,0 +1,199 @@
+<template>
+  <div class="purchaseReturnDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle" v-if="!outBizSn">
+          <a id="purchaseReturnDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a-button
+            v-if="isEdit"
+            type="primary"
+            size="small"
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="purchaseReturnDetail-edit-btn"
+            @click.stop="handleEdit">编辑</a-button>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra" v-if="$hasPermissions('B_PR_outSnycPrintAndExport')">
+          <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="供应商">{{ basicInfoData&&basicInfoData.returnTargetName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="采退单号">{{ basicInfoData&&basicInfoData.purchaseReturnNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建时间">{{ basicInfoData&&basicInfoData.createDate || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="产品款数">{{ basicInfoData&&(basicInfoData.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="是否抓单">{{ basicInfoData&&(basicInfoData.grabFlag) ? ['不抓单','抓单'][basicInfoData.grabFlag] : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="出库时间">{{ basicInfoData&&(basicInfoData.outStockTime || basicInfoData.outStockTime == 0) ? basicInfoData.outStockTime : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ basicInfoData&&(basicInfoData.noSyncStateDictValue) ? basicInfoData.noSyncStateDictValue : '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 产品详情 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="产品详情">
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :defaultLoadData="false"
+              bordered>
+              <!-- 退货金额合计 amount-->
+              <template slot="amount" slot-scope="text, record">
+                {{ (record.cost * record.qty).toFixed(2) }}
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import Print from '@/views/common/print.vue'
+import { hdPrint } from '@/libs/JGPrint'
+import { getOperationalPrecision } from '@/libs/tools.js'
+import { purchaseReturnDetailSn, purchaseReturnDetailList, purchaseReturnDetailPrint, purchaseReturnDetailExport } from '@/api/purchaseReturn'
+export default {
+  name: 'PurchaseReturnDetail',
+  components: { STable, VSelect, Print },
+  mixins: [commonMixin],
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      // 表头
+      columns: [],
+      dataSource: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.outBizSn || this.$route.params.sn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 采购金额  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].purchaseReturnAmount = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
+            }
+            this.disabled = false
+            this.dataSource = data.list
+          }
+          return data
+        })
+      },
+      basicInfoData: null //  基本信息
+    }
+  },
+  computed: {
+    isEdit () {
+      return ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'AUDIT_REJECT')) && this.$hasPermissions('B_purchaseReturnEdit')
+    }
+  },
+  methods: {
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      _this.spinning = true
+      let url = purchaseReturnDetailPrint
+      const params = { sn: this.$route.params.sn || this.outBizSn }
+      if (type == 'export') { //  导出
+        url = purchaseReturnDetailExport
+      }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '采购退货单', function () {
+        _this.spinning = false
+      })
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ name: 'purchaseReturnOutSyncList' })
+    },
+    // 基本信息
+    getDetail () {
+      // 抓单
+      if (this.$route.params.grabFlag == '1') {
+        this.columns = [{ title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', 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.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '退货单价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '退货数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '退货金额', scopedSlots: { customRender: 'amount' }, width: '6%', align: 'center' }]
+      } else {
+        this.columns = [
+          { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+          { 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: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '退货单价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '退货数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '退货金额', scopedSlots: { customRender: 'amount' }, width: '6%', align: 'center' }]
+      }
+      purchaseReturnDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 编辑
+    handleEdit () {
+      const row = this.basicInfoData
+      this.$router.push({ name: row.grabFlag == 1 ? 'purchaseReturnOutSyncGrapEdit' : 'purchaseReturnOutSyncEdit', params: { sn: row.purchaseReturnSn } })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新 或 为弹框时调用
+      this.$refs.table.refresh(true)
+      this.getDetail()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.$refs.table.refresh(true)
+      this.getDetail()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .purchaseReturnDetail-cont{
+    margin-bottom: 10px;
+    .timeline-box{
+      margin-top: 30px;
+      .auxiliary-txt{
+        color: #808695;
+      }
+    }
+  }
+</style>

+ 545 - 0
src/views/purchasingManagement/purchaseReturnOutSync/edit.vue

@@ -0,0 +1,545 @@
+<template>
+  <div class="purchaseReturnEdit-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;" v-if="detailData">供应商名称:{{ detailData.returnTargetName || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra" v-if="$hasPermissions('B_PR_outSnycPrintAndExport')">
+          <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
+        </template>
+      </a-page-header>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+        <div class="purchaseReturnEdit-cont">
+          <a-collapse :activeKey="['1']">
+            <a-collapse-panel key="1" header="选择产品">
+              <!-- 筛选条件 -->
+              <div class="table-page-search-wrapper">
+                <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+                  <a-row :gutter="15">
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品编码" prop="productCode">
+                        <a-input id="bulkReturnGoodsEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品名称" prop="productName">
+                        <a-input id="bulkReturnGoodsEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-model-item label="仓库">
+                        <a-select
+                          placeholder="请选择仓库"
+                          id="bulkReturnGoodsEdit-warehouseSn"
+                          allowClear
+                          v-model="queryParam.warehouseSn"
+                          :showSearch="true"
+                          option-filter-prop="children"
+                          :filter-option="filterOption">
+                          <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                      <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
+                      <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
+                    </a-col>
+                  </a-row>
+                </a-form>
+              </div>
+              <!-- 列表 -->
+              <s-table
+                class="sTable"
+                ref="table"
+                size="small"
+                :rowKey="(record) => record.id"
+                :columns="columns"
+                :data="loadData"
+                :pageSize="10"
+                :scroll="{ y: 149 }"
+                bordered>
+                <!-- 数量 -->
+                <template slot="returnQty" slot-scope="text, record">
+                  <a-input-number
+                    size="small"
+                    id="purchaseReturnEdit-returnQty"
+                    v-model="record.returnQty"
+                    :precision="0"
+                    :min="1"
+                    :max="record.refundableQty"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                </template>
+                <!-- 单价 -->
+                <template slot="returnPrice" slot-scope="text, record">
+                  <a-input-number
+                    size="small"
+                    id="purchaseReturnEdit-returnPrice"
+                    v-model="record.returnPrice"
+                    :precision="2"
+                    :min="0"
+                    :max="999999"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                </template>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record">
+                  <span v-if="record.refundableQty==0">--</span>
+                  <a-button
+                    v-else
+                    size="small"
+                    type="link"
+                    class="button-primary"
+                    @click="handleAdd(record)"
+                    id="purchaseReturnEdit-add-btn">添加</a-button>
+                </template>
+              </s-table>
+            </a-collapse-panel>
+          </a-collapse>
+        </div>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              已选产品
+              <!-- <a-button
+                size="small"
+                type="primary"
+                class="button-error"
+                id="purchaseReturnEdit-delAll-btn"
+                @click.stop="handleDel('', 'all')"
+                style="margin-right: 10px;float: right;">整单删除</a-button> -->
+            </template>
+            <!-- 总计 -->
+            <a-alert type="info" style="margin-bottom:10px">
+              <div slot="message">
+                总款数<strong>{{ (detailData&&(detailData.totalCategory || detailData.totalCategory==0)) ? detailData.totalCategory : '--' }}</strong> ,
+                总数量<strong>{{ (detailData&&(detailData.totalQty || detailData.totalQty==0)) ? detailData.totalQty : '--' }}</strong> ,
+                总金额<strong>{{ (detailData&&(detailData.totalAmount || detailData.totalAmount==0)) ? '¥'+detailData.totalAmount : '--' }}</strong>
+              </div>
+            </a-alert>
+            <!-- 筛选条件 -->
+            <a-row :gutter="15" justify="space-between">
+              <a-col :span="17">
+                <div class="table-page-search-wrapper">
+                  <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+                    <a-row :gutter="15">
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品编码" prop="productCode">
+                          <a-input id="bulkReturnGoodsEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品名称" prop="productName">
+                          <a-input id="bulkReturnGoodsEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-form>
+                </div>
+              </a-col>
+              <a-col :span="7" style="text-align: right;"></a-col>
+            </a-row>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :data="chooseLoadData"
+              :defaultLoadData="false"
+              :pageSize="10"
+              :scroll="{ y: 149 }"
+              bordered>
+              <!-- 退货数量 -->
+              <template slot="qty" slot-scope="text, record">
+                <a-input-number
+                  size="small"
+                  id="purchaseReturnEdit-qty"
+                  v-model="record.qty"
+                  :precision="0"
+                  :min="1"
+                  :max="record.refundableQty"
+                  placeholder="请输入"
+                  @blur="e => qtyBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 退货单价 -->
+              <template slot="price" slot-scope="text, record">
+                <a-input-number
+                  size="small"
+                  id="purchaseReturnEdit-cost"
+                  v-model="record.cost"
+                  :precision="2"
+                  :min="0"
+                  :max="999999"
+                  placeholder="请输入"
+                  @blur="e => costBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 退货金额合计 amount-->
+              <template slot="amount" slot-scope="text, record">
+                {{ (record.cost * record.qty).toFixed(2) }}
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="purchaseReturnEdit-del-btn">删除</a-button>
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
+    <a-card size="small" :bordered="false" class="affix-cont">
+      <a-button
+        type="primary"
+        id="purchaseReturnEdit-submit"
+        size="large"
+        :disabled="spinning"
+        class="button-primary"
+        @click="handleSubmit"
+        style="padding: 0 60px;">提交</a-button>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import Print from '@/views/common/print.vue'
+import { hdPrint } from '@/libs/JGPrint'
+import { stockDetailProductList } from '@/api/sparePartsRet'
+import { warehouseAllList } from '@/api/warehouse'
+import {
+  purchaseReturnDetailList,
+  purchaseReturnDetailSave,
+  purchaseReturnDetailDel,
+  purchaseReturnSubmit,
+  purchaseReturnDelAll,
+  purchaseReturnDetailPrint,
+  purchaseReturnDetailExport,
+  purchaseReturnDetailSn } from '@/api/purchaseReturn'
+export default {
+  name: 'PurchaseReturnEdit',
+  components: { STable, VSelect, Print },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      detailData: null,
+      queryParam: {
+        purchaseBillNo: '',
+        productCode: '',
+        productName: ''
+      },
+      dataSource: [],
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: false, // 高级搜索 展开/关闭
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '19%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '19%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '8%', align: 'center' },
+        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '8%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return stockDetailProductList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.dataSource = data.list
+          this.disabled = false
+          return data
+        })
+      },
+      // 表头
+      chooseColumns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货单价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
+        { title: '退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
+        { title: '退货金额', scopedSlots: { customRender: 'amount' }, width: '6%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ],
+      chooseDisabled: false,
+      chooseQueryParam: {
+        productCode: '',
+        productName: ''
+      },
+      // 加载数据方法 必须为 Promise 对象
+      chooseLoadData: parameter => {
+        return purchaseReturnDetailList(Object.assign(parameter,
+          this.chooseQueryParam,
+          {
+            purchaseReturnSn: this.$route.params.sn,
+            orderBy: 'qpls_purchase_return_bill_detail.CREATE_DATE desc'
+          })).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            data.list[i].qtyBackups = data.list[i].qty
+            data.list[i].costBackups = data.list[i].cost
+            data.list[i].refundableQty = data.list[i].purchaseBillRefundableQty
+          }
+          this.dataSource = data.list
+          return data
+        })
+      },
+      warehouseList: [] // 仓库列表
+    }
+  },
+  methods: {
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      _this.spinning = true
+      let url = purchaseReturnDetailPrint
+      const params = { sn: this.$route.params.sn }
+      if (type == 'export') { //  导出
+        url = purchaseReturnDetailExport
+      }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '采购退货单', function () {
+        _this.spinning = false
+      })
+    },
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.warehouseSn = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 已选产品  重置
+    chooseResetSearchForm () {
+      this.chooseQueryParam.productCode = ''
+      this.chooseQueryParam.productName = ''
+      this.$refs.chooseTable.refresh(true)
+    },
+    //  添加/编辑
+    handleAdd (row, isEdit) {
+      // 添加时退货数量字段名为returnQty,编辑时退货数量字段名为qty
+      if (!isEdit && !row.returnPrice) {
+        this.$message.warning('请输入退货价格')
+        return
+      }
+      if (!isEdit && !row.returnQty) {
+        this.$message.warning('请输入退货数量')
+        return
+      }
+      const params = {
+        id: isEdit ? row.id : undefined,
+        purchaseReturnSn: this.$route.params.sn,
+        purchaseReturnDetailSn: row.purchaseReturnDetailSn,
+        qty: isEdit ? row.qty : row.returnQty, //  退货数量
+        productSn: row.productSn,
+        productCode: row.productCode,
+        productOrigCode: row.productOrigCode,
+        productTypeSn1: row.productTypeSn1,
+        productTypeSn2: row.productTypeSn2,
+        productTypeSn3: row.productTypeSn3,
+        brandSn: row.brandSn,
+        warehouseLocationSn: row.warehouseLocationSn,
+        warehouseSn: row.warehouseSn,
+        productExpiryDate: row.productExpiryDate,
+        cost: isEdit ? row.cost : row.returnPrice,
+        remarks: row.remarks,
+        promotionFlag: row.promotionFlag
+      }
+      if (isEdit) { // 编辑
+        // 清空退货数量时,值应保持未清空前的值,因退货数量都不可为空
+        if (!row.qty) {
+          row.qty = row.qtyBackups
+          return
+        }
+        if (!row.cost) {
+          row.cost = row.costBackups
+          return
+        }
+      }
+      this.spinning = true
+      purchaseReturnDetailSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.getDetail(true, true)
+          this.$refs.chooseTable.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
+    },
+    // 导入明细
+    handleImport () {},
+    //  删除
+    handleDel (row, isAll) {
+      const _this = this
+      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      this.$confirm({
+        title: '提示',
+        content: content,
+        centered: true,
+        onOk () {
+          if (isAll) { //  整单删除
+            _this.spinning = true
+            purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.getDetail(true, true)
+                _this.$refs.chooseTable.refresh()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
+              }
+            })
+          } else { //  单个删除
+            _this.spinning = true
+            purchaseReturnDetailDel({ id: row.id }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.getDetail(true, true)
+                _this.$refs.chooseTable.refresh()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
+              }
+            })
+          }
+        }
+      })
+    },
+    //  提交
+    handleSubmit () {
+      const _this = this
+      _this.spinning = true
+      purchaseReturnSubmit({ id: this.detailData.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+            _this.spinning = false
+          }, 1000)
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ name: 'purchaseReturnOutSyncList' })
+    },
+    // 已选产品 退货数量  blur
+    qtyBlur (val, record) {
+      //  光标移出,值发生改变再调用编辑接口
+      if (val != record.qtyBackups) {
+        this.handleAdd(record, 'edit')
+      }
+    },
+    // 已选产品 退货单价  blur
+    costBlur (val, record) {
+      if (val && (val != record.costBackups)) {
+        this.handleAdd(record, 'edit')
+      }
+    },
+    // 仓库
+    getWarehouse () {
+      warehouseAllList({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 获取详情
+    getDetail (type, refresh) {
+      purchaseReturnDetailSn({ sn: this.$route.params.sn }).then(res => {
+        this.detailData = res.data || null
+        if (!type) {
+          this.resetSearchForm()
+        } else {
+          if (!refresh) {
+            this.$refs.table.refresh(true)
+          }
+        }
+      })
+    },
+    pageInit () {
+      this.getWarehouse()
+      this.getDetail(true, true)
+      this.$refs.chooseTable.refresh(true)
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .purchaseReturnEdit-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: auto;
+      height: 100%;
+    }
+    .purchaseReturnEdit-back, .purchaseReturnEdit-cont{
+      margin-bottom: 10px;
+    }
+  }
+</style>

+ 515 - 0
src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue

@@ -0,0 +1,515 @@
+<template>
+  <div class="purchaseReturnEdit-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;" v-if="detailData">供应商名称:{{ detailData.returnTargetName || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
+          <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
+        </template>
+      </a-page-header>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+        <div class="purchaseReturnEdit-cont">
+          <a-collapse :activeKey="['1']">
+            <a-collapse-panel key="1" header="选择产品">
+              <!-- 筛选条件 -->
+              <div class="table-page-search-wrapper">
+                <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+                  <a-row :gutter="15">
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="采购单号" prop="purchaseBillNo">
+                        <a-input id="purchaseReturnEdit-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" placeholder="请输入采购单号" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品编码" prop="productCode">
+                        <a-input id="purchaseReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品名称" prop="productName">
+                        <a-input id="purchaseReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                      <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
+                      <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
+                    </a-col>
+                  </a-row>
+                </a-form>
+              </div>
+              <!-- 列表 -->
+              <s-table
+                class="sTable"
+                ref="table"
+                size="small"
+                :rowKey="(record) => record.id"
+                :columns="columns"
+                :data="loadData"
+                :pageSize="10"
+                :scroll="{ y: 149 }"
+                bordered>
+                <!-- 数量 -->
+                <template slot="returnQty" slot-scope="text, record">
+                  <a-input-number
+                    size="small"
+                    id="purchaseReturnEdit-returnQty"
+                    v-model="record.returnQty"
+                    :precision="0"
+                    :min="1"
+                    :max="record.refundableQty"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                </template>
+                <!-- 单价 -->
+                <template slot="returnPrice" slot-scope="text, record">
+                  <a-input-number
+                    size="small"
+                    id="purchaseReturnEdit-returnPrice"
+                    v-model="record.returnPrice"
+                    :precision="2"
+                    :min="0"
+                    :max="999999"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                </template>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record">
+                  <span v-if="record.refundableQty==0">--</span>
+                  <a-button
+                    v-else
+                    size="small"
+                    type="link"
+                    class="button-primary"
+                    @click="handleAdd(record)"
+                    id="purchaseReturnEdit-add-btn">添加</a-button>
+                </template>
+              </s-table>
+            </a-collapse-panel>
+          </a-collapse>
+        </div>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              已选产品
+              <!-- <a-button
+                size="small"
+                type="primary"
+                class="button-error"
+                id="purchaseReturnEdit-delAll-btn"
+                @click.stop="handleDel('', 'all')"
+                style="margin-right: 10px;float: right;">整单删除</a-button> -->
+            </template>
+            <!-- 总计 -->
+            <a-alert type="info" style="margin-bottom:10px">
+              <div slot="message">
+                总款数<strong>{{ (detailData&&(detailData.totalCategory || detailData.totalCategory==0)) ? detailData.totalCategory : '--' }}</strong> ,
+                总数量<strong>{{ (detailData&&(detailData.totalQty || detailData.totalQty==0)) ? detailData.totalQty : '--' }}</strong> ,
+                总金额<strong>{{ (detailData&&(detailData.totalAmount || detailData.totalAmount==0)) ? '¥'+detailData.totalAmount : '--' }}</strong>
+              </div>
+            </a-alert>
+            <!-- 筛选条件 -->
+            <a-row :gutter="15" justify="space-between">
+              <a-col :span="17">
+                <div class="table-page-search-wrapper">
+                  <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+                    <a-row :gutter="15">
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品编码" prop="productCode">
+                          <a-input id="bulkReturnGoodsEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品名称" prop="productName">
+                          <a-input id="bulkReturnGoodsEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-form>
+                </div>
+              </a-col>
+              <a-col :span="7" style="text-align: right;"></a-col>
+            </a-row>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :data="chooseLoadData"
+              :defaultLoadData="false"
+              :pageSize="10"
+              :scroll="{ y: 149 }"
+              bordered>
+              <!-- 退货数量 -->
+              <template slot="qty" slot-scope="text, record">
+                <a-input-number
+                  size="small"
+                  id="purchaseReturnEdit-qty"
+                  v-model="record.qty"
+                  :precision="0"
+                  :min="1"
+                  :max="record.refundableQty"
+                  placeholder="请输入"
+                  @blur="e => qtyBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 退货单价 -->
+              <template slot="price" slot-scope="text, record">
+                <a-input-number
+                  size="small"
+                  id="purchaseReturnEdit-cost"
+                  v-model="record.cost"
+                  :precision="2"
+                  :min="0"
+                  :max="999999"
+                  placeholder="请输入"
+                  @blur="e => costBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 退货金额合计 amount-->
+              <template slot="amount" slot-scope="text, record">
+                {{ (record.cost * record.qty).toFixed(2) }}
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="purchaseReturnEdit-del-btn">删除</a-button>
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
+    <a-card size="small" :bordered="false" class="affix-cont">
+      <a-button
+        type="primary"
+        id="purchaseReturnEdit-submit"
+        size="large"
+        :disabled="spinning"
+        class="button-primary"
+        @click="handleSubmit"
+        style="padding: 0 60px;">提交</a-button>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import Print from '@/views/common/print.vue'
+import { hdPrint } from '@/libs/JGPrint'
+import {
+  purchaseReturnPurchaseBillNoSyncList,
+  purchaseReturnDetailList,
+  purchaseReturnDetailSave,
+  purchaseReturnDetailDel,
+  purchaseReturnSubmit,
+  purchaseReturnDelAll,
+  purchaseReturnDetailPrint,
+  purchaseReturnDetailExport,
+  purchaseReturnDetailSn } from '@/api/purchaseReturn'
+export default {
+  name: 'PurchaseReturnEdit',
+  components: { STable, VSelect, Print },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      detailData: null,
+      queryParam: {
+        purchaseBillNo: '',
+        productCode: '',
+        productName: ''
+      },
+      dataSource: [],
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: false, // 高级搜索 展开/关闭
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '采购价格', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '已退数量', dataIndex: 'refundableQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '可退数量', dataIndex: 'refundableQty', width: '7%', align: 'center' },
+        { title: '库存数量', dataIndex: 'stock.currentStockQty', 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: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '8%', align: 'center' },
+        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '8%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.queryParam.returnTargetType = this.$route.params.returnTargetType
+        return purchaseReturnPurchaseBillNoSyncList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.disabled = false
+          return data
+        })
+      },
+      chooseDisabled: false,
+      chooseQueryParam: {
+        productCode: '',
+        productName: ''
+      },
+      // 表头
+      chooseColumns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', 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.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货单价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
+        { title: '退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
+        { title: '退货金额', scopedSlots: { customRender: 'amount' }, width: '6%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      chooseLoadData: parameter => {
+        return purchaseReturnDetailList(Object.assign(parameter,
+          this.chooseQueryParam,
+          {
+            purchaseReturnSn: this.$route.params.sn,
+            orderBy: 'qpls_purchase_return_bill_detail.CREATE_DATE desc'
+          })).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            data.list[i].qtyBackups = data.list[i].qty
+            data.list[i].costBackups = data.list[i].cost
+            data.list[i].refundableQty = data.list[i].purchaseBillRefundableQty
+          }
+          this.dataSource = data.list
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      _this.spinning = true
+      let url = purchaseReturnDetailPrint
+      const params = { sn: this.$route.params.sn }
+      if (type == 'export') { //  导出
+        url = purchaseReturnDetailExport
+      }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '采购退货单', function () {
+        _this.spinning = false
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.purchaseBillNo = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.$refs.table.refresh(true)
+    },
+    // 已选产品  重置
+    chooseResetSearchForm () {
+      this.chooseQueryParam.productCode = ''
+      this.chooseQueryParam.productName = ''
+      this.$refs.chooseTable.refresh(true)
+    },
+    //  添加/编辑
+    handleAdd (row, isEdit) {
+      // 添加时退货数量字段名为returnQty,编辑时退货数量字段名为qty
+      if (!isEdit && !row.returnPrice) {
+        this.$message.warning('请输入退货价格')
+        return
+      }
+      if (!isEdit && !row.returnQty) {
+        this.$message.warning('请输入退货数量')
+        return
+      }
+      const params = {
+        id: isEdit ? row.id : undefined,
+        purchaseReturnSn: this.$route.params.sn,
+        purchaseBillSn: row.purchaseBillSn,
+        purchaseBillNo: row.purchaseBillNo,
+        purchaseBillDetailSn: row.purchaseBillDetailSn,
+        qty: isEdit ? row.qty : row.returnQty, //  退货数量
+        productSn: row.productSn,
+        cost: isEdit ? row.cost : row.returnPrice,
+        remarks: row.remarks,
+        promotionFlag: row.promotionFlag
+      }
+      if (isEdit) { // 编辑
+        // 清空退货数量时,值应保持未清空前的值,因退货数量都不可为空
+        if (!row.qty) {
+          row.qty = row.qtyBackups
+          return
+        }
+        if (!row.cost) {
+          row.cost = row.costBackups
+          return
+        }
+      }
+      this.spinning = true
+      purchaseReturnDetailSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+
+          this.getDetail(true, true)
+          this.$refs.chooseTable.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
+    },
+    // 导入明细
+    handleImport () {},
+    //  删除
+    handleDel (row, isAll) {
+      const _this = this
+      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      this.$confirm({
+        title: '提示',
+        content: content,
+        centered: true,
+        onOk () {
+          if (isAll) { //  整单删除
+            _this.spinning = true
+            purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.getDetail(true, true)
+                _this.$refs.chooseTable.refresh()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
+              }
+            })
+          } else { //  单个删除
+            _this.spinning = true
+            purchaseReturnDetailDel({ id: row.id }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.getDetail(true, true)
+                _this.$refs.chooseTable.refresh()
+                _this.spinning = false
+              } else {
+                _this.spinning = false
+              }
+            })
+          }
+        }
+      })
+    },
+    //  提交
+    handleSubmit () {
+      const _this = this
+      _this.spinning = true
+      purchaseReturnSubmit({ id: _this.detailData.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+            _this.spinning = false
+          }, 1000)
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ name: 'purchaseReturnOutSyncList' })
+    },
+    // 已选产品 退货数量  blur
+    qtyBlur (val, record) {
+      //  光标移出,值发生改变再调用编辑接口
+      if (val != record.qtyBackups) {
+        this.handleAdd(record, 'edit')
+      }
+    },
+    // 已选产品 退货单价  blur
+    costBlur (val, record) {
+      if (val && (val != record.costBackups)) {
+        this.handleAdd(record, 'edit')
+      }
+    },
+    // 获取详情
+    getDetail (type, refresh) {
+      purchaseReturnDetailSn({ sn: this.$route.params.sn }).then(res => {
+        this.detailData = res.data || null
+        if (!type) {
+          this.resetSearchForm()
+        } else {
+          if (!refresh) {
+            this.$refs.table.refresh(true)
+          }
+        }
+      })
+    },
+    pageInit () {
+      this.getDetail(true, true)
+      this.$refs.chooseTable.refresh(true)
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .purchaseReturnEdit-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: auto;
+      height: 100%;
+    }
+    .purchaseReturnEdit-back, .purchaseReturnEdit-cont{
+      margin-bottom: 10px;
+    }
+  }
+</style>

+ 379 - 0
src/views/purchasingManagement/purchaseReturnOutSync/list.vue

@@ -0,0 +1,379 @@
+<template>
+  <a-card size="small" :bordered="false" class="purchaseReturnList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建时间">
+                <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="purchaseReturnList-purchaseReturnNo" v-model.trim="queryParam.purchaseReturnNo" allowClear placeholder="请输入采购退货单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="供应商">
+                <a-select v-model="queryParam.returnTargetSn" placeholder="请选择供应商">
+                  <a-select-option v-for="item in purchaseTragetType" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">
+                    {{ item.purchaseTargetName }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="是否抓单">
+                <v-select
+                  code="FLAG"
+                  id="purchaseReturnList-grabFlag"
+                  v-model="queryParam.grabFlag"
+                  allowClear
+                  placeholder="请选择是否抓单"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务状态">
+                <v-select
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="purchaseReturnList-state"
+                  code="PURCHASE_RETURN_NO_SYNC_STATUS"
+                  placeholder="请选择业务状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.settleState"
+                    ref="settleState"
+                    id="chainTransferOutList-settleState"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="B_purchaseReturn-add" type="primary" v-if="$hasPermissions('B_purchaseReturn_outSnycAdd')&&($hasPermissions('B_PR_outSnycSJ')||$hasPermissions('B_PR_outSnycZB'))" class="button-error" @click="openModal=true">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 采退单号 -->
+        <template slot="purchaseReturnNo" slot-scope="text, record">
+          <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_purchaseReturn_outSnycDetail')" @click="handleDetail(record)">{{ record.purchaseReturnNo }}</span>
+          <span v-else>{{ record.purchaseReturnNo }}</span>
+          <a-badge count="改" :offset="[10,0]" v-if="record.state=='HQ_CHANGE'"></a-badge>
+        </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" v-if="record.state!='AUDIT_REJECT'" :state="record.state=='WAIT_OUT_WAREHOUSE'||record.state == 'FINISH'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.stateDictValue" v-else :state="0"></stateIcon>
+        </template>
+        <!-- 出库 -->
+        <template slot="waitOut" slot-scope="text, record">
+          <stateIcon :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 收款 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-primary"
+            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturn_outSnycEdit')"
+            @click="handleEdit(record)"
+            id="purchaseReturnList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_purchaseReturn_outSnycAudit')"
+            @click="handleAudit(record)"
+            class="button-primary"
+            id="bulkReturnGoodsList-audit-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_purchaseReturn_outSnycOut')"
+            @click="handleWarehouse(record)"
+            class="button-primary"
+            id="bulkReturnGoodsList-out-btn">出库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturn_outSnycDel')"
+            @click="handleDel(record)"
+            id="purchaseReturnList-del-btn">删除</a-button>
+          <span v-if="record.state == 'FINISH'||!($hasPermissions('B_purchaseReturn_outSnycEdit') || $hasPermissions('B_purchaseReturn_outSnycDel')||$hasPermissions('B_purchaseReturn_outSnycOut')||$hasPermissions('B_purchaseReturn_outSnycAudit'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 选择基本信息弹框 -->
+    <basic-info-modal :openModal="openModal" @load="setPurchaseTragetType" @ok="handleEdit" @close="openModal=false" />
+    <!-- 审核 -->
+    <auditModal
+      :openModal="visibleAudit"
+      :spinning="spinningAudit"
+      @close="visibleAudit=false"
+      @ok="auditOrder(true)"
+      @fail="auditOrder(false)" />
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import basicInfoModal from './basicInfoModal.vue'
+import getDate from '@/libs/getDate.js'
+import auditModal from '@/views/common/auditModal.vue'
+import stateIcon from '@/views/common/stateIcon'
+import { purchaseReturnQueryNoSyncPage, purchaseReturnDel, purchaseReturnOutStock, purchaseReturnAudit } from '@/api/purchaseReturn'
+export default {
+  name: 'PurchaseReturnList',
+  components: { STable, VSelect, rangeDate, stateIcon, basicInfoModal, auditModal },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      openModal: false, // 基本信息弹框是否显示
+      visibleAudit: false,
+      spinningAudit: false,
+      auditInfo: null,
+      purchaseTragetType: [], // 供应商数据
+      time: [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ],
+      queryParam: { //  查询条件
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        purchaseReturnNo: '', //  退货单号
+        state: undefined, //  业务状态
+        settleState: undefined,
+        returnTargetSn: undefined,
+        grabFlag: undefined
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采退单号', scopedSlots: { customRender: 'purchaseReturnNo' }, width: '12%', align: 'center' },
+        { title: '供应商', dataIndex: 'returnTargetName', width: '12%', 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: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '是否抓单', dataIndex: 'grabFlag', width: '7%', align: 'center', customRender: function (text) { return text == '1' ? '抓单' : '不抓单' } },
+        { title: '出库时间', dataIndex: 'outStockTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'noSyncStateDictValue', 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: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return purchaseReturnQueryNoSyncPage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    //  重置
+    resetSearchForm () {
+      this.resetData()
+      this.$refs.table.refresh(true)
+    },
+    // 重置数据
+    resetData () {
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.purchaseReturnNo = ''
+      this.queryParam.state = undefined
+      this.queryParam.settleState = undefined
+      this.queryParam.returnTargetSn = undefined
+      this.queryParam.grabFlag = undefined
+    },
+    // 获取供应商数据
+    setPurchaseTragetType (data) {
+      this.purchaseTragetType = data
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          purchaseReturnDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 编辑
+    handleEdit (row) {
+      this.$router.push({ name: row.grabFlag == 1 ? 'purchaseReturnOutSyncGrapEdit' : 'purchaseReturnOutSyncEdit', params: { sn: row.purchaseReturnSn, returnTargetType: row.returnTargetType } })
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'purchaseReturnOutSyncDetail', params: { sn: row.purchaseReturnSn, grabFlag: row.grabFlag } })
+    },
+    //  生成出库单
+    handleWarehouse (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要出库吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          purchaseReturnOutStock({ purchaseReturnSn: row.purchaseReturnSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    auditOrder (billStatus) {
+      this.spinningAudit = true
+      purchaseReturnAudit({
+        purchaseReturnSn: this.auditInfo.purchaseReturnSn,
+        state: billStatus ? 'AUDIT_PASS' : 'AUDIT_REJECT'
+      }).then(res => {
+        if (res.status == 200) {
+          this.visibleAudit = false
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinningAudit = false
+        } else {
+          this.visibleAudit = false
+          this.spinningAudit = false
+        }
+      })
+    },
+    //  审核
+    handleAudit (row) {
+      this.auditInfo = row
+      this.visibleAudit = true
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.resetData()
+      if (this.$route.query.pageParams) {
+        this.queryParam.state = this.$route.query.pageParams.state
+      }
+      this.pageInit()
+      this.$refs.table.refresh(true)
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      // 从首页点击销售开单过来的,直接打开新建弹框
+      if (from.name == 'home' && vm.$store.state.app.isHomeNav && vm.$route.query.pageParams == null) {
+        vm.openModal = true
+        vm.$store.state.app.isHomeNav = false
+      }
+    })
+  }
+}
+</script>

+ 1 - 1
src/views/purchasingManagement/signWarehousing/edit.vue

@@ -309,7 +309,7 @@ export default {
     position: relative;
     height: 100%;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .btn-cont {

+ 15 - 3
src/views/purchasingManagement/signWarehousing/list.vue

@@ -56,16 +56,25 @@
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
-        <!-- 单号 -->
+        <!-- 采购单号 -->
         <template slot="purchaseBillNo" slot-scope="text, record">
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_purchaseDetail')" @click="handleDetail(record)">{{ record.purchaseBillNo || '--' }}</span>
           <span v-else>{{ record.purchaseBillNo || '--' }}</span>
         </template>
-        <!-- 单号 -->
+        <!-- 发货单号 -->
         <template slot="sendBillNo" slot-scope="text, record">
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_signWarehousingDetail')" @click="handleStockDetail(record)">{{ record.sendBillNo || '--' }}</span>
           <span v-else>{{ record.sendBillNo || '--' }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.auditStateDictValue" v-if="record.auditState!='PUT_WAREHOUSE_AUDIT_REJECT'" :state="record.auditState == 'FINISH'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.auditStateDictValue" v-else :state="0"></stateIcon>
+        </template>
+        <!-- 入库 -->
+        <template slot="waitIn" slot-scope="text, record">
+          <stateIcon :title="record.auditStateDictValue" :state="record.auditState == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -86,11 +95,12 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDateTime from '@/views/common/rangeDateTime.vue'
+import stateIcon from '@/views/common/stateIcon'
 import getDate from '@/libs/getDate.js'
 import { receivingStockList } from '@/api/receiving'
 export default {
   name: 'SignWarehousingList',
-  components: { STable, VSelect, rangeDateTime },
+  components: { STable, VSelect, rangeDateTime, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -117,6 +127,8 @@ export default {
         { title: '发货金额', dataIndex: 'totalPutAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库时间', dataIndex: 'stockPutTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库', scopedSlots: { customRender: 'waitIn' }, width: '3%', align: 'center' },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 6 - 22
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -126,18 +126,12 @@
                 </a-row>
               </a-form-model-item>
             </a-col>
-            <!-- <a-col :span="8">
-              <a-form-model-item label="支付方式" prop="payType">
-                <v-select code="PAY_TYPE" id="chooseCustom-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
-              </a-form-model-item>
-            </a-col> -->
             <a-col :span="8">
               <a-form-model-item label="收款方式" prop="settleStyleSn">
-                <a-select placeholder="请选择收款方式" allowClear v-model="form.settleStyleSn">
-                  <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-                    {{ item.name }}
-                  </a-select-option>
-                </a-select>
+                <settleStyle
+                  v-model="form.settleStyleSn"
+                  placeholder="请选择收款方式">
+                </settleStyle>
               </a-form-model-item>
             </a-col>
             <a-col :span="8">
@@ -203,13 +197,13 @@ import { getArea } from '@/api/data'
 import { custFindById, updateByCustomerSn } from '@/api/customer'
 import { salesSave } from '@/api/sales'
 import { employeeAllList } from '@/api/salesman'
-import { settleStyleQueryAll } from '@/api/settleStyle'
+import settleStyle from '@/views/common/settleStyle'
 import { VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
 export default {
   name: 'ChooseCustomModal',
-  components: { VSelect, CustomerManagementEdit, custList },
+  components: { VSelect, CustomerManagementEdit, custList, settleStyle },
   props: {
     show: [Boolean]
   },
@@ -280,7 +274,6 @@ export default {
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
       userList: [], // 业务员 下拉
-      settleStyleList: [], // 收款方式
       custId: undefined, // 客户id
       isEdit: false, //  是否编辑状态
       priceTypeDisabled: false, // 价格类型可编辑
@@ -554,14 +547,6 @@ export default {
           }
         }
       })
-    },
-    // 获取收款方式
-    getSettleStyle () {
-      settleStyleQueryAll().then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        }
-      })
     }
   },
   watch: {
@@ -570,7 +555,6 @@ export default {
       if (newValue) {
         this.getArea('province')
         this.getUserAllList()
-        this.getSettleStyle()
       }
     }
   }

+ 199 - 0
src/views/salesManagement/salesQuery/chooseImportModal.vue

@@ -0,0 +1,199 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+        <template slot="errorMsg" slot-scope="text,record">
+          <a-popover placement="topRight">
+            <template slot="content">
+              <p v-for="d in record.importErrorMsgSet">{{ d }}</p>
+            </template>
+            <a-button type="link">
+              查看
+            </a-button>
+          </a-popover>
+        </template>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { hdExportExcel } from '@/libs/exportExcel'
+import { salesDetailFailExcel } from '@/api/salesDetail'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'importPrice', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'importQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'importProductUnit', align: 'center', width: '15%', customRender: function (text) { return text || '--' } }
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'importPrice', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'importQty', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '10%', align: 'center' }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const paramsData = JSON.parse(JSON.stringify(this.paramsData))
+      this.loadData = paramsData.rightList || []
+      this.unLoadData = paramsData.errorList || []
+      this.loadData.map((item, index) => {
+        item.no = index + 1
+        item.salesBillNo = paramsData.salesBillNo
+        item.salesBillSn = paramsData.salesBillSn
+      })
+      this.unLoadData.map((item, index) => {
+        item.no = index + 1
+        item.salesBillNo = paramsData.salesBillNo
+        item.salesBillSn = paramsData.salesBillSn
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.paramsData.rightList.length == 0) {
+        this.$message.warning('无可导入的产品!')
+      } else {
+        const data = this.paramsData.rightList
+        data.map(item => {
+          item.salesBillNo = this.paramsData.salesBillNo
+          item.salesBillSn = this.paramsData.salesBillSn
+        })
+        this.$emit('ok', data)
+        this.isShow = false
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.paramsData.errorList.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(salesDetailFailExcel, _this.paramsData.errorList, '销售产品导出错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 76 - 9
src/views/salesManagement/salesQuery/edit.vue

@@ -91,13 +91,17 @@
                   type="primary"
                   :disabled="spinning"
                   class="button-primary"
-                  @click="handleSubmit()"
+                  @click="enableFundAccount && tbForm.length == 3 ? handleSettleAcountPay(null,0) : handleSubmit({})"
                   id="productInfoList-handleSubmit">提交</a-button>
+                <a-button
+                  type="default"
+                  @click="openGuideModal=true"
+                  :loading="delLoading"
+                  id="salesEdit-del-all">导入产品</a-button>
                 <a-button
                   type="link"
                   @click="delSalerOrder"
                   :loading="delLoading"
-                  style="margin-right: 10px"
                   id="salesEdit-del-all">整单删除</a-button>
               </div>
             </a-col>
@@ -164,22 +168,29 @@
     <!-- <div class="affix-cont"></div> -->
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
+    <!-- 导入费用明细 -->
+    <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn, salesBillNo:detailData?detailData.salesBillNo:''}" @close="openGuideModal=false" @ok="hanldeImprotOk" />
+    <!-- 收付款弹框 -->
+    <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
+import importGuideModal from './importGuideModal.vue'
+import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
 import { stockByProductSn } from '@/api/stock'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
-import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
+import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'SalesEdit',
-  components: { STable, VSelect, queryPart, chooseCustomModal, Print },
+  components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal, settleModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -190,6 +201,9 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       isInster: false, // 是否正在添加产品
       openModal: false, // 客户弹框
+      openGuideModal: false, // 导入产品弹框
+      openSettleModal: false, // 打开收款弹框
+      enableFundAccount: false, // 是否开启资金账户管理
       delLoading: false,
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
@@ -248,6 +262,7 @@ export default {
     }
   },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
@@ -325,7 +340,11 @@ export default {
     changeQty (record) {
       salesDetailUpdateQty({
         id: record.id,
-        qty: record.qty
+        salesBillSn: record.salesBillSn,
+        productSn: record.productSn,
+        salesBillDetailSn: record.salesBillDetailSn,
+        qty: record.qty,
+        price: record.price
       }).then(res => {
         this.resetSearchForm(false)
         if (res.status == 200) {
@@ -341,8 +360,11 @@ export default {
       if (val && val != record.priceBackups) {
         this.spinning = true
         salesDetailUpdatePrice({
+          id: record.id,
           salesBillSn: record.salesBillSn,
           productSn: record.productSn,
+          salesBillDetailSn: record.salesBillDetailSn,
+          qty: record.qty,
           price: record.price
         }).then(res => {
           this.resetSearchForm(false)
@@ -568,19 +590,56 @@ export default {
       })
     },
     // 提交销售单
-    handleSubmit () {
+    handleSubmit (params) {
       this.spinning = true
       const submitTypes = this.tbForm.join(',')
-      salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes }).then(res => {
+      salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes, ...params }).then(res => {
+        console.log(res)
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
-          this.spinning = false
+          // this.spinning = false
         } else {
           this.spinning = false
         }
       })
     },
+    // 开启结算账户功能收款, type:0 单条收款,1 批量收款
+    handleSettleAcountPay (row, type) {
+      this.openSettleModal = true
+      const data = {
+        totalAmount: this.detailData.discountedAmount,
+        settleClientName: '',
+        title: '收款',
+        type,
+        row
+      }
+      this.$nextTick(() => {
+        this.$refs.settleModal.setData(data)
+      })
+    },
+    // 去收款
+    settleAcountPay (form, data) {
+      const params = {}
+      // 资金管理开启
+      if (this.enableFundAccount) {
+        params.settleStyleSn = form.settleStyleSn
+        params.settleAccountSn = form.settleAccountSn
+      }
+      this.spinning = true
+      this.handleSubmit(params)
+    },
+    // 确认导入明细
+    hanldeImprotOk (obj) {
+      this.spinning = true
+      salesDetailInsertImport(obj).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+          this.getOrderDetail(false)
+        }
+        this.spinning = false
+      })
+    },
     pageInit () {
       const vm = this
       vm.$nextTick(() => {
@@ -610,6 +669,14 @@ export default {
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
       this.pageInit()
     }
+    // 结算账户状态查询
+    if (this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')) {
+    	this.GetSettleAccountState().then(res => {
+    	  if (res.status == 200) {
+    		this.enableFundAccount = res.data.functionEnableFlag == 1
+    	  }
+    	})
+    }
   },
   deactivated () {
     // this.dataSource = []
@@ -627,7 +694,7 @@ export default {
     height: 100%;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .salesEdit-cont{

+ 201 - 0
src/views/salesManagement/salesQuery/importGuideModal.vue

@@ -0,0 +1,201 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入产品"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“仓库”、“仓位”、“售价”、“数量”的列,且名称必须相同,其它列可自定义,不影响数据导入</li>
+            <li>2) 如果导入的产品已经存在,则不会导入该行</li>
+          </ul>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="attach"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="选择导入文件"
+              @remove="resetSearchForm"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/salesDetail/importDetail',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local',
+        salesBillSn: this.params.salesBillSn
+      }
+    }
+  },
+  methods: {
+    // 清空数据
+    resetSearchForm () {
+      this.$refs.importUpload.setFileList() //  清空导入文件
+      this.paramsData = null //  清空上传数据
+    },
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      // console.log(file, JSON.parse(file))
+      if (file && JSON.parse(file).length > 0) {
+        this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
+      } else {
+        this.paramsData = null
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    },
+    // 下载模板
+    handleExport () {
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/SalesDetailImport.xlsx'
+      link.setAttribute('download', '销售产品明细模板' + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+      document.body.removeChild(link)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

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

@@ -28,11 +28,11 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="收款方式">
-                  <a-select placeholder="请选择收款方式" allowClear v-model="queryParam.settleStyleSn">
-                    <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-                      {{ item.name }}
-                    </a-select-option>
-                  </a-select>
+                  <settleStyle
+                    id="salesManagementList-settleStyleSn"
+                    v-model="queryParam.settleStyleSn"
+                    placeholder="请选择收款方式">
+                  </settleStyle>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -112,8 +112,8 @@
         </template>
         <!-- 审核 -->
         <template slot="audit" slot-scope="text, record">
-          <stateIcon v-if="record.billStatus!='AUDIT_REJECT'" :state="record.billStatus == 'WAIT_OUT_WAREHOUSE'||record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
-          <stateIcon v-else :state="0"></stateIcon>
+          <stateIcon :title="record.billStatusDictValue" v-if="record.billStatus!='AUDIT_REJECT'" :state="record.billStatus == 'WAIT_OUT_WAREHOUSE'||record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.billStatusDictValue" v-else :state="0"></stateIcon>
         </template>
         <!-- 急件 -->
         <template slot="oosFlag" slot-scope="text, record">
@@ -125,7 +125,7 @@
         </template>
         <!-- 收款 -->
         <template slot="financial" slot-scope="text, record">
-          <stateIcon :state="record.financialStatus == 'FINISH'?'1':'2'"></stateIcon>
+          <stateIcon :title="record.financialStatusDictValue" :state="record.financialStatus == 'FINISH'?'1':'2'"></stateIcon>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -197,14 +197,14 @@ import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
-import { settleStyleQueryAll } from '@/api/settleStyle'
+import settleStyle from '@/views/common/settleStyle'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import stateIcon from '@/views/common/stateIcon'
 export default {
   name: 'SalesList',
-  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon },
+  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon, settleStyle },
   mixins: [commonMixin],
   data () {
     return {
@@ -214,7 +214,6 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
-      settleStyleList: [], // 收款方式
       time: [
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
@@ -427,14 +426,6 @@ export default {
         }
       })
     },
-    // 获取收款方式
-    getSettleStyle () {
-      settleStyleQueryAll().then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        }
-      })
-    },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 265
@@ -444,7 +435,6 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      _this.getSettleStyle()
     }
   },
   mounted () {

+ 14 - 2
src/views/salesManagement/salesReturn/list.vue

@@ -81,6 +81,14 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_salesReturnDetail')" @click="handleDetail(record)">{{ record.salesReturnNo }}</span>
           <span v-else>{{ record.salesReturnNo }}</span>
         </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 付款 -->
+        <template slot="financial" slot-scope="text, record">
+          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -119,6 +127,7 @@ import { STable, VSelect } from '@/components'
 import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
+import stateIcon from '@/views/common/stateIcon'
 import custList from '@/views/common/custList.vue'
 import { salesReturnList, salesReturnCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
 export default {
@@ -128,7 +137,8 @@ export default {
     VSelect,
     chooseCustomModal,
     rangeDate,
-    custList
+    custList,
+    stateIcon
   },
   mixins: [commonMixin],
   data () {
@@ -166,7 +176,9 @@ export default {
         { title: '是否抓单', dataIndex: 'grabFlag', width: '6%', align: 'center', customRender: function (text) { return ['否', '是'][text] } },
         { title: '审核时间', dataIndex: 'auditTime', width: '10%', 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: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 1 - 6
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -538,13 +538,8 @@ export default {
     height: 100%;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
+      overflow-y: auto;
       height: 100%;
-      > div{
-        height: 100%;
-        overflow-y: auto;
-        display: flex;
-        flex-direction: column;
-      }
     }
     .pages-wrap{
       margin-top: 10px;

+ 1 - 0
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -390,6 +390,7 @@ export default {
           salesReturnDelAll({ sn: _this.ordeDetail.salesReturnSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm()
+              _this.$refs.queryPart.resetSearchForm()
             }
             _this.$message.info(res.message)
             _this.delLoading = false

+ 1 - 1
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -208,7 +208,7 @@ export default {
     height: 100%;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
-      overflow-y: scroll;
+      overflow-y: auto;
       height: 100%;
     }
     .urgentItemsOffsetDetail-info-wrapper{

+ 8 - 3
src/views/salesManagement/urgentItemsOffset/list.vue

@@ -77,6 +77,10 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('M_urgentDetail')" @click="handleDetail(record)">{{ record.urgentBillNo }}</span>
           <span v-else>{{ record.urgentBillNo }}</span>
         </template>
+        <!-- 状态 -->
+        <template slot="status" slot-scope="text, record">
+          <stateIcon :title="record.statusDictValue" :state="record.status=='WAIT'?'2':'1'"></stateIcon>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -98,11 +102,12 @@ import { commonMixin } from '@/utils/mixin'
 import { urgentList, urgentWriteDown } from '@/api/urgent'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import stateIcon from '@/views/common/stateIcon'
 import custList from '@/views/common/custList.vue'
 import getDate from '@/libs/getDate.js'
 export default {
   name: 'UrgentOffsetList',
-  components: { STable, VSelect, rangeDate, custList },
+  components: { STable, VSelect, rangeDate, custList, stateIcon },
   mixins: [commonMixin],
   data () {
     return {
@@ -128,12 +133,12 @@ export default {
         { title: '急件单号', scopedSlots: { customRender: 'urgentBillNo' }, width: '15%', align: 'center' },
         { title: '急件类型', dataIndex: 'bizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '关联单号', dataIndex: 'bizBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'buyerName', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'buyerName', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'totalCategory', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '冲减时间', dataIndex: 'offSetTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'statusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', scopedSlots: { customRender: 'status' }, width: '3%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 95 - 5
vue.config.js

@@ -1,6 +1,10 @@
 const path = require('path')
 const webpack = require('webpack')
 const createThemeColorReplacerPlugin = require('./config/plugin.config')
+// gzip 压缩
+const compressionWebpackPlugin = require('compression-webpack-plugin');
+// js,css 压缩
+const TerserPlugin = require('terser-webpack-plugin');
 
 function resolve (dir) {
   return path.join(__dirname, dir)
@@ -30,7 +34,9 @@ const assetsCDN = {
     '//vuepkg.oss-cn-beijing.aliyuncs.com/vue.min.js',
     '//vuepkg.oss-cn-beijing.aliyuncs.com/vue-router.min.js',
     '//vuepkg.oss-cn-beijing.aliyuncs.com/vuex.min.js',
-    '//vuepkg.oss-cn-beijing.aliyuncs.com/axios.min.js'
+    '//vuepkg.oss-cn-beijing.aliyuncs.com/axios.min.js',
+    '//vuepkg.oss-cn-beijing.aliyuncs.com/lodash.min.js',
+    '//vuepkg.oss-cn-beijing.aliyuncs.com/echarts.min.js'
   ]
 }
 
@@ -39,7 +45,14 @@ const prodExternals = {
   vue: 'Vue',
   'vue-router': 'VueRouter',
   vuex: 'Vuex',
-  axios: 'axios'
+  axios: 'axios',
+  echarts: 'echarts',
+  lodash : { 
+    commonjs: "lodash",
+    amd: "lodash",
+    root: "_" // indicates global variable
+  },
+  'mockjs2': 'Mock'
 }
 
 // vue.config.js
@@ -47,15 +60,40 @@ const vueConfig = {
   runtimeCompiler: true, // 动态编译组件
   publicPath: BASE_URL,
   configureWebpack: {
+    optimization: isProd() ? {
+          minimize: true,
+          minimizer: [new TerserPlugin({
+              test: /\.js(\?.*)?$/i,    //匹配参与压缩的文件
+              parallel: true,    //使用多进程并发运行
+              terserOptions: {    //Terser 压缩配置
+                  output:{comments: false},
+                  compress: {//console删除
+                      pure_funcs: ["console.log"]
+                  }
+              },
+              extractComments: true,    //将注释剥离到单独的文件中
+          })],
+      }:{},
     // webpack plugins
     plugins: [
       // Ignore all locale files of moment.js
-      new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
+      new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
+      new compressionWebpackPlugin({
+          //[file] 会被替换成原始资源。[path] 会被替换成原始资源的路径, [query] 会被替换成查询字符串。默认值是 "[path].gz[query]"。
+          filename: '[path].gz[query]', // 提示compression-webpack-plugin@3.0.0的话asset改为filename
+          //可以是 function(buf, callback) 或者字符串。对于字符串来说依照 zlib 的算法(或者 zopfli 的算法)。默认值是 "gzip"。
+          algorithm: 'gzip',
+          //所有匹配该正则的资源都会被处理。默认值是全部资源。
+          test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
+          //只有大小大于该值的资源会被处理。单位是 bytes。默认值是 0。
+          threshold: 10240,
+          //只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
+          minRatio: 0.8
+        })
     ],
     // if prod is on, add externals
     externals: isProd() ? prodExternals : {}
   },
-
   chainWebpack: (config) => {
     config.resolve.alias
       .set('@$', resolve('src'))
@@ -84,9 +122,61 @@ const vueConfig = {
         return args
       })
     }
+    
+    config.optimization && config.optimization.splitChunks({
+        // 拆包配置 
+        chunks: 'all', //三选一:"initial" 初始化,"all"(默认就是all),"async"(动态加载) 
+        minSize: 30000, // 形成一个新代码块最小的体积,只有 >= minSize 的bundle会被拆分出来 30000
+        maxSize: 0, //拆分之前最大的数值,默认为0,即不做限制
+        minChunks: 1, //引入次数,如果为2 那么一个资源最少被引用两次才可以被拆分出来
+        maxAsyncRequests: 5, // 按需加载的最大并行请求数
+        maxInitialRequests: 4, // 一个入口最大并行请求数
+        automaticNameDelimiter: '~', // 文件名的连接符
+        name: true,
+        cacheGroups: {
+        // node_modules模块包
+        vendors: {
+          test: /[\\/]node_modules[\\/]/,
+          name: 'chunk-vendors',
+          // name(module) {
+          //   const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
+          //   return `chunk.${packageName.replace('@', '')}`;
+          // },
+          chunks: 'all',
+          priority: -10,
+        },
+        // UI库单独拆包
+        antDesign: {
+          name: 'chunk-antDesign',
+          priority: 19, //  the weight needs to be larger than libs and app or it will be packaged into libs or app
+          test: /[\\/]node_modules[\\/]_?@ant-design(.*)/
+        },
+        antDesignVue: {
+          name: 'chunk-antDesignVue',
+          priority: 20, //  the weight needs to be larger than libs and app or it will be packaged into libs or app
+          test: /[\\/]node_modules[\\/]_?ant-design-vue(.*)/
+        },
+        // 共享模块
+        common: {
+          name: 'chunk-common',
+          minChunks: 2,
+          maxSize: 1024, //拆分之前最大的数值,默认为0,即不做限制
+          priority: -20,
+          reuseExistingChunk: true
+        }
+        }
+    });
+    
+    // 分析打包大小
+    if (process.env.npm_config_report) {
+      config.plugin('webpack-bundle-analyzer')
+      .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
+      .end();
+    }
   },
 
   css: {
+    sourceMap: false,
     loaderOptions: {
       less: {
         modifyVars: {
@@ -108,7 +198,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.151:8503/qpls-md',
+        // target: 'http://192.168.16.105:8503/qpls-md',
         target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,

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