Browse Source

Merge branch 'develop_xsth' of jianguan-web/jg-ocs-html into pre-release

李磊 2 years ago
parent
commit
48edc91d8f
69 changed files with 6548 additions and 1937 deletions
  1. 1 1
      public/version.json
  2. 1 1
      src/App.vue
  3. 9 0
      src/api/data.js
  4. 97 0
      src/api/pickUp.js
  5. 7 2
      src/api/sales.js
  6. 42 5
      src/api/salesReturn.js
  7. 93 1
      src/api/salesReturnDetail.js
  8. 7 1
      src/components/Select/index.js
  9. 3 0
      src/components/index.less
  10. 196 70
      src/config/router.config.js
  11. 11 7
      src/libs/JGPrint.js
  12. 2 1
      src/store/getters.js
  13. 20 0
      src/store/modules/app.js
  14. 1 1
      src/views/Home.vue
  15. 2 2
      src/views/allocationManagement/transferOut/detail.vue
  16. 3 0
      src/views/allocationManagement/transferOut/dsModal.vue
  17. 2 2
      src/views/allocationManagement/transferOut/edit.vue
  18. 5 2
      src/views/allocationManagement/transferOut/printModal.vue
  19. 26 3
      src/views/allocationManagement/transfersPrint/list.vue
  20. 14 0
      src/views/bnSetting/menu/adminMenus.vue
  21. 89 0
      src/views/common/auditDetail.vue
  22. 5 1
      src/views/common/dealerSubareaScopeList.vue
  23. 1 2
      src/views/common/dingDepartUser.js
  24. 109 0
      src/views/common/returnReason.js
  25. 19 17
      src/views/financialManagement/returnConfirmation/detailModal.vue
  26. 15 15
      src/views/financialManagement/returnConfirmation/list.vue
  27. 13 1
      src/views/power/user/userModal.vue
  28. 40 4
      src/views/purchasingManagement/bulkWarehousingOrder/list.vue
  29. 1 1
      src/views/reportData/actualSalesReport/list.vue
  30. 23 17
      src/views/reportData/salesReturnDetailReport/list.vue
  31. 26 6
      src/views/salesManagement/matchSendOutOrder/list.vue
  32. 6 3
      src/views/salesManagement/pushOrderManagement/detail.vue
  33. 16 2
      src/views/salesManagement/pushOrderManagement/list.vue
  34. 7 3
      src/views/salesManagement/pushOrderManagement/sendTypeModal.vue
  35. 46 13
      src/views/salesManagement/receiptPrint/list.vue
  36. 28 9
      src/views/salesManagement/salesCollection/list.vue
  37. 0 251
      src/views/salesManagement/salesReturn/detail.vue
  38. 0 216
      src/views/salesManagement/salesReturn/queryPart.vue
  39. 0 277
      src/views/salesManagement/salesReturn/salesReturnCheck.vue
  40. 0 375
      src/views/salesManagement/salesReturn/salesReturnEdit.vue
  41. 0 378
      src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue
  42. 27 7
      src/views/salesManagement/stockPrint/list.vue
  43. 0 8
      src/views/salesManagement/stockPrint/printStockClasList.vue
  44. 3 0
      src/views/salesManagement/waitDispatch/dsModal.vue
  45. 451 0
      src/views/salesReturnManagement/billOfLading/add.vue
  46. 342 0
      src/views/salesReturnManagement/billOfLading/detail.vue
  47. 370 0
      src/views/salesReturnManagement/billOfLading/list.vue
  48. 91 0
      src/views/salesReturnManagement/billOfLading/logisticsCompany.js
  49. 100 0
      src/views/salesReturnManagement/billOfLading/logisticsPoint.js
  50. 202 0
      src/views/salesReturnManagement/billOfLading/selectXtModal.vue
  51. 97 0
      src/views/salesReturnManagement/billOfLading/verifyModal.vue
  52. 537 0
      src/views/salesReturnManagement/custConfirm/list.vue
  53. 280 0
      src/views/salesReturnManagement/custConfirm/setPriceModal.vue
  54. 255 0
      src/views/salesReturnManagement/pickUp/list.vue
  55. 487 0
      src/views/salesReturnManagement/receiveCheck/checking.vue
  56. 112 0
      src/views/salesReturnManagement/receiveCheck/chooseProductsModal.vue
  57. 97 0
      src/views/salesReturnManagement/receiveCheck/chooseTypeModal.vue
  58. 250 0
      src/views/salesReturnManagement/receiveCheck/list.vue
  59. 410 0
      src/views/salesReturnManagement/receiveCheck/receiving.vue
  60. 20 32
      src/views/salesReturnManagement/salesReturn/chooseCustomModal.vue
  61. 194 0
      src/views/salesReturnManagement/salesReturn/chooseDepartUserModal.vue
  62. 15 46
      src/views/salesReturnManagement/salesReturn/chooseImportModal.vue
  63. 301 0
      src/views/salesReturnManagement/salesReturn/detail.vue
  64. 16 35
      src/views/salesReturnManagement/salesReturn/importGuideModal.vue
  65. 154 118
      src/views/salesReturnManagement/salesReturn/list.vue
  66. 181 0
      src/views/salesReturnManagement/salesReturn/queryPart.vue
  67. 520 0
      src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue
  68. 49 0
      src/views/salesReturnManagement/salesReturn/verifyModal.vue
  69. 1 1
      vue.config.js

+ 1 - 1
public/version.json

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

+ 1 - 1
src/App.vue

@@ -32,7 +32,7 @@ export default {
     })
     this.$message.config({
       top: `100px`,
-      duration: 3,
+      duration: 5,
       maxCount: 3
     })
   }

+ 9 - 0
src/api/data.js

@@ -155,4 +155,13 @@ export const printLogSave = (params) => {
     data: params,
     method: 'post'
   })
+}
+
+// 下载模板文件
+export const downLoadTemp = (params) => {
+  return axios({
+    url: `downLoad/temp/${params.type}`,
+    method: 'get',
+    responseType: 'blob'
+  })
 }

+ 97 - 0
src/api/pickUp.js

@@ -0,0 +1,97 @@
+import { axios } from '@/utils/request'
+
+//  提货单列表  分页
+export const pickUpQueryPage = (params) => {
+  const url = `/pickUp/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 保存提货单
+export const pickUpSave = (params) => {
+  return axios({
+    url: `/pickUp/save`,
+    data: params,
+    method: 'post'
+  })
+}
+// 提交提货单
+export const pickUpSubmit = (params) => {
+  return axios({
+    url: `/pickUp/submit`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 删除提货单
+export const pickUpDelete = (params) => {
+  return axios({
+    url: `/pickUp/deleteBySn/${params.pickUpSn}`,
+    data: params,
+    method: 'post'
+  })
+}
+// 再次编辑
+export const pickUpAgainEdit = (params) => {
+  return axios({
+    url: `/pickUp/againEdit/${params.pickUpSn}`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 提货单详情
+export const pickUpDetail = (params) => {
+  return axios({
+    url: `/pickUp/queryBySn/${params.pickUpSn}`,
+    method: 'get'
+  })
+}
+
+// 物流公司
+export const pickUpLogisticsList = (params) => {
+  return axios({
+    url: `/pickUp/queryLogisticsList`,
+    method: 'get'
+  })
+}
+// 提货-物流点
+export const pickUpPointList = (params) => {
+  return axios({
+    url: `/pickUp/queryLogisticsPointList`,
+    method: 'get'
+  })
+}
+// 销退单-列表
+export const pickUpDetailQueryList = (params) => {
+  return axios({
+    url: `/pickUp/queryPickUpSalesReturnList/${params.pickUpSn}`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 导出
+export const pickUpExport = (params) => {
+  return axios({
+    url: '/pickUp/excel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 打印
+export const pickUpDetailPrint = params => {
+  const url = `/pickUp/print`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 7 - 2
src/api/sales.js

@@ -30,11 +30,16 @@ export const salesDel = (params) => {
 export const salesDetailBySn = (params) => {
   return axios({
     url: `/sales/findBySn/${params.salesBillSn}`,
-    data: params,
     method: 'get'
   })
 }
-
+// 查询客户名称
+export const salesDetailByNo = (params) => {
+  return axios({
+    url: `/sales/findBySaleBillNo/${params.salesBillNo}`,
+    method: 'get'
+  })
+}
 //  销售 新增或编辑
 export const salesSave = (params) => {
   return axios({

+ 42 - 5
src/api/salesReturn.js

@@ -26,6 +26,14 @@ export const salesReturnDel = (params) => {
   })
 }
 
+// 再次编辑
+export const updateAgain = (params) => {
+  return axios({
+    url: `/salesReturn/updateAgain/${params.salesReturnBillSn}`,
+    method: 'get'
+  })
+}
+
 // 根据SN查询销售退货单
 export const salesReturnDetail = (params) => {
   return axios({
@@ -55,7 +63,7 @@ export const salesReturnPay = (params) => {
 //  销售退货 打印预览
 export const salesReturnPrint = (params) => {
   return axios.request({
-    url: `/salesReturn/print/${params.sn}`,
+    url: `/salesReturn/print/${params.sn}/${params.status}`,
     method: 'get',
     responseType: 'blob'
   })
@@ -64,7 +72,7 @@ export const salesReturnPrint = (params) => {
 //  销售退货 导出
 export const salesReturnExport = (params) => {
   return axios.request({
-    url: `/salesReturn/export/${params.sn}`,
+    url: `/salesReturn/export/${params.sn}/${params.status}`,
     method: 'get',
     responseType: 'blob'
   })
@@ -91,11 +99,24 @@ export const salesReturnList = (params) => {
   })
 }
 
+// 销售退货 操作记录
+export const salesReturnChangeLogList = (params) => {
+  const url = `/salesReturn/changeLog/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
 //  销售退货 提交
 export const salesReturnSubmit = (params) => {
   return axios({
-    url: `/salesReturn/submit/${params.salesReturnBillSn}`,
-    method: 'get'
+    url: `/salesReturn/submit`,
+    data: params,
+    method: 'post'
   })
 }
 
@@ -133,6 +154,22 @@ export const salesReturnFinancialDetailList = (params) => {
     method: 'post'
   })
 }
+
+//销售退货 客服确认
+export const customerServiceConfirm = (params) => {
+  return axios({
+    url: `/salesReturn/customerServiceConfirm/${params.salesReturnBillSn}`,
+    method: 'get'
+  })
+}
+// 收货提交审核
+export const salesReturnReceive = (params) => {
+  return axios({
+    url: `/salesReturn/receive/${params.salesReturnBillSn}`,
+    method: 'get'
+  })
+}
+
 // 退货确认 退货确认
 export const salesReturnFinancial = (params) => {
   return axios({
@@ -144,7 +181,7 @@ export const salesReturnFinancial = (params) => {
 // 退货确认 下载模板
 export const salesReturnDownload = params => {
   return axios.request({
-    url: `/salesReturn/detail/downloadExcel/${params.grabFlag}`,
+    url: `/salesReturn/detail/downloadExcel`,
     method: 'post',
     responseType: 'blob'
   })

+ 93 - 1
src/api/salesReturnDetail.js

@@ -47,7 +47,6 @@ export const salesReturnDetailUpdateQty = (params) => {
     method: 'post'
   })
 }
-
 // 修改销售退货明细退货原因
 export const salesReturnDetailUpdateReason = (params) => {
   return axios({
@@ -55,4 +54,97 @@ export const salesReturnDetailUpdateReason = (params) => {
     data: params,
     method: 'post'
   })
+}
+// 批量修改销售退货明细退货原因
+export const salesReturnDetailSetReason = (params) => {
+  return axios({
+    url: '/salesReturn/detail/setReturnReason',
+    data: params,
+    method: 'post'
+  })
+}
+// 修改销售退货明细实收数量
+export const salesReturnDetailUpdateReceiveQty = (params) => {
+  return axios({
+    url: '/salesReturn/detail/updateReceiveQty',
+    data: params,
+    method: 'post'
+  })
+}
+// 批量修改销售退货明细良品数量
+export const updateBatchGoodQty = (params) => {
+  return axios({
+    url: '/salesReturn/detail/updateBatchGoodQty',
+    data: params,
+    method: 'post'
+  })
+}
+// 批量修改销售退货明细返库数量
+export const updateBatchBackStockQty = (params) => {
+  return axios({
+    url: '/salesReturn/detail/updateBatchBackStockQty',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 收货 批量实收
+export const salesReturnDetailReceiveBatch = (params) => {
+  return axios({
+    url: '/salesReturn/detail/receiveBatch',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 客服确认单行保存
+export const updateByCustomerService = (params) => {
+  return axios({
+    url: '/salesReturn/detail/updateByCustomerService',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 客服设置退货单价
+export const setReturnPrice = (params) => {
+  return axios({
+    url: '/salesReturn/detail/setReturnPrice',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 客服删除销售退货明细
+export const deleteByCustomerService = (params) => {
+  return axios({
+    url: `/salesReturn/detail/deleteByCustomerService/${params.salesReturnDetailSn}`,
+    method: 'get'
+  })
+}
+
+// 收货删除销售退货明细
+export const deleteByReceiver = (params) => {
+  return axios({
+    url: `/salesReturn/detail/deleteByReceiver/${params.salesReturnDetailSn}`,
+    method: 'get'
+  })
+}
+
+// 新增销售退货明细(收货添加)
+export const insertByReceive = (params) => {
+  return axios({
+    url: '/salesReturn/detail/insertByReceive',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 新增销售退货明细(客服确认添加)
+export const insertByCustomerService = (params) => {
+  return axios({
+    url: '/salesReturn/detail/insertByCustomerService',
+    data: params,
+    method: 'post'
+  })
 }

+ 7 - 1
src/components/Select/index.js

@@ -29,6 +29,12 @@ export default {
     isEnable: { // 是否只获取已启用的数据
       type: Boolean,
       default: false
+    },
+    notIn: {
+      type: Array,
+      default: function(){
+        return []
+      }
     }
   }),
   created () {
@@ -41,7 +47,7 @@ export default {
       isEnable: _this.isEnable ? 1 : undefined
     }).then(res => {
       if (res.status == 200) {
-        _this.dataList = res.data.list
+        _this.dataList = res.data.list.filter(item => _this.notIn.indexOf(item.code)<0)
       }
     })
   },

+ 3 - 0
src/components/index.less

@@ -299,6 +299,9 @@
       > div:empty::after{
         content: '--';
       }
+      .ant-select-search__field__mirror{
+        white-space: pre-wrap;
+      }
     }
   }
   .ant-table-small > .ant-table-content .ant-table-body,.ant-table-fixed-right{

+ 196 - 70
src/config/router.config.js

@@ -400,76 +400,6 @@ export const asyncRouterMap = [
               }
             ]
           },
-          {
-            path: '/salesManagement/salesReturn',
-            redirect: '/salesManagement/salesReturn/list',
-            name: 'salesReturn',
-            component: BlankLayout,
-            meta: {
-              title: '销售退货列表',
-              icon: 'fund',
-              permission: 'M_salesReturnList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'salesReturnList',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesReturn/list.vue'),
-                meta: {
-                  title: '销售退货列表',
-                  icon: 'fund',
-                  hidden: true,
-                  permission: 'M_salesReturnList'
-                }
-              },
-              {
-                path: 'detail/:sn',
-                name: 'salesReturnDetail',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesReturn/detail.vue'),
-                meta: {
-                  title: '销售退货详情',
-                  icon: 'fund',
-                  hidden: true
-                  // permission: 'M_salesReturn'
-                }
-              },
-              {
-                path: 'salesReturnGrabEdit/:sn/:buyerSn',
-                name: 'salesReturnGrabEdit',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesReturn/salesReturnGrabEdit.vue'),
-                meta: {
-                  title: '编辑销售退货(抓单)',
-                  icon: 'fund',
-                  hidden: true
-                  // permission: 'M_salesReturnGrabEdit'
-                }
-              },
-              {
-                path: 'salesReturnEdit/:sn/:buyerSn',
-                name: 'salesReturnEdit',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesReturn/salesReturnEdit.vue'),
-                meta: {
-                  title: '编辑销售退货(不抓单)',
-                  icon: 'fund',
-                  hidden: true
-                  // permission: 'M_salesReturnEdit'
-                }
-              },
-              {
-                path: 'check/:sn',
-                name: 'salesReturnCheck',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesReturn/salesReturnCheck.vue'),
-                meta: {
-                  title: '销售退货品检',
-                  icon: 'fund',
-                  replaceTab: true,
-                  hidden: true
-                  // permission: 'M_salesReturnCheck'
-                }
-              }
-            ]
-          },
           {
             path: '/salesManagement/backorder',
             redirect: '/salesManagement/backorder/list',
@@ -572,6 +502,202 @@ export const asyncRouterMap = [
           }
         ]
       },
+      //销售退货
+      {
+        path: '/salesReturnManagement',
+        redirect: '/salesReturnManagement/salesReturn',
+        component: PageView,
+        meta: {
+          title: '销售退货',
+          icon: 'export',
+          permission: 'M_salesReturnManagement'
+        },
+        children: [
+           {
+             path: '/salesReturnManagement/salesReturn',
+             redirect: '/salesReturnManagement/salesReturn/list',
+             name: 'salesReturn',
+             component: BlankLayout,
+             meta: {
+               title: '销售退货列表',
+               icon: 'fund',
+               permission: 'M_salesReturnList'
+             },
+             hideChildrenInMenu: true,
+             children: [
+               {
+                 path: 'list',
+                 name: 'salesReturnList',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/salesReturn/list.vue'),
+                 meta: {
+                   title: '销售退货列表',
+                   icon: 'fund',
+                   hidden: true,
+                   permission: 'M_salesReturnList'
+                 }
+               },
+               {
+                 path: 'detail/:sn',
+                 name: 'salesReturnDetail',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/salesReturn/detail.vue'),
+                 meta: {
+                   title: '销售退货详情',
+                   icon: 'fund',
+                   hidden: true
+                 }
+               },
+               {
+                 path: 'salesReturnEdit/:sn/:buyerSn',
+                 name: 'salesReturnEdit',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/salesReturn/salesReturnEdit.vue'),
+                 meta: {
+                   title: '编辑销售退货',
+                   icon: 'fund',
+                   hidden: true
+                 }
+               },
+               {
+                 path: 'custConfirm/:sn/:buyerSn',
+                 name: 'custConfirm',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/custConfirm/list.vue'),
+                 meta: {
+                   title: '客服确认',
+                   icon: 'fund',
+                   replaceTab: true,
+                   hidden: true
+                 }
+               },
+             ]
+           },
+           {
+             path: '/salesReturnManagement/billOfLading',
+             redirect: '/salesReturnManagement/billOfLading/list',
+             name: 'billOfLading',
+             component: BlankLayout,
+             meta: {
+               title: '提货单列表',
+               icon: 'fund',
+               permission: 'M_billOfLadingList'
+             },
+             hideChildrenInMenu: true,
+             children: [
+               {
+                 path: 'list',
+                 name: 'billOfLadingList',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/billOfLading/list.vue'),
+                 meta: {
+                   title: '提货单列表',
+                   icon: 'fund',
+                   hidden: true,
+                   permission: 'M_billOfLadingList'
+                 }
+               },
+               {
+                 path: 'detail/:sn',
+                 name: 'billOfLadingDetail',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/billOfLading/detail.vue'),
+                 meta: {
+                   title: '提货单详情',
+                   icon: 'fund',
+                   hidden: true
+                 }
+               },
+               {
+                 path: 'add',
+                 name: 'billOfLadingAdd',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/billOfLading/add.vue'),
+                 meta: {
+                   title: '新增提货单',
+                   icon: 'fund',
+                   hidden: true
+                 }
+               },
+               {
+                 path: 'edit/:sn',
+                 name: 'billOfLadingEdit',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/billOfLading/add.vue'),
+                 meta: {
+                   title: '编辑提货单',
+                   icon: 'fund',
+                   hidden: true
+                 }
+               },
+             ]
+           },
+           {
+             path: '/salesReturnManagement/pickUp',
+             redirect: '/salesReturnManagement/pickUp/list',
+             name: 'pickUp',
+             component: BlankLayout,
+             meta: {
+               title: '仓库提货',
+               icon: 'fund',
+               permission: 'M_pickUpList'
+             },
+             hideChildrenInMenu: true,
+             children: [
+               {
+                 path: 'list',
+                 name: 'pickUpList',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/pickUp/list.vue'),
+                 meta: {
+                   title: '仓库提货列表',
+                   icon: 'fund',
+                   hidden: true,
+                   permission: 'M_pickUpList'
+                 }
+               },
+             ]
+           },
+           {
+             path: '/salesReturnManagement/receiveCheck',
+             redirect: '/salesReturnManagement/receiveCheck/list',
+             name: 'receiveCheck',
+             component: BlankLayout,
+             meta: {
+               title: '收货品检',
+               icon: 'fund',
+               permission: 'M_receiveCheckList'
+             },
+             hideChildrenInMenu: true,
+             children: [
+               {
+                 path: 'list',
+                 name: 'receiveCheckList',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/receiveCheck/list.vue'),
+                 meta: {
+                   title: '收货品检列表',
+                   icon: 'fund',
+                   hidden: true,
+                   permission: 'M_receiveCheckList'
+                 }
+               },
+               {
+                 path: 'receiving/:sn/:buyerSn',
+                 name: 'salesReturnReceiving',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/receiveCheck/receiving.vue'),
+                 meta: {
+                   title: '收货',
+                   icon: 'fund',
+                   hidden: true,
+                   replaceTab: true
+                 }
+               },
+               {
+                 path: 'checking/:sn/:buyerSn',
+                 name: 'salesReturnCheck',
+                 component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/receiveCheck/checking.vue'),
+                 meta: {
+                   title: '品检',
+                   icon: 'fund',
+                   hidden: true,
+                   replaceTab: true
+                 }
+               },
+             ]
+           }
+        ]
+      },
       // 采购管理
       {
         path: '/purchasingManagement',

+ 11 - 7
src/libs/JGPrint.js

@@ -36,7 +36,7 @@ export const JGPrintTag = function (html, width, height, data) {
   LODOP.PRINT()
 }
 // 导出文件
-export const exportExcel = function(url,params,fileName,callback){
+export const exportExcel = function(url,params,fileName,callback,noShowTime){
   url(params).then(res => {
     if (res.type == 'application/json') {
       var reader = new FileReader()
@@ -49,16 +49,16 @@ export const exportExcel = function(url,params,fileName,callback){
       })
       reader.readAsText(res)
     } else {
-       downloadExcel(res,fileName)
+       downloadExcel(res,fileName,noShowTime)
     }
     callback()
   })
 }
 // 下载excel
-export const downloadExcel = function (data, fileName) {
+export const downloadExcel = function (data, fileName, noShowTime) {
   if (!data) { return }
   const a = moment().format('YYYYMMDDHHmmss')
-  const fname = fileName + a
+  const fname = noShowTime ? fileName : (fileName + a)
   const blob = new Blob([data], { type: 'application/vnd.ms-excel' })
   if (window.navigator && window.navigator.msSaveOrOpenBlob) {
     navigator.msSaveBlob(blob, fname + '.xlsx')
@@ -137,7 +137,7 @@ export const jGPrint = function (data, type, callback, printLogParams,printPageS
 }
 
 // 打印
-export const printFun = function(url,params,type,taskName,callback,printLogParams){
+export const printFun = function(url,params,type,taskName,callback,printLogParams,hidePrint){
   url(params).then(res => {
     if (res.type == 'application/json') {
       var reader = new FileReader()
@@ -151,7 +151,7 @@ export const printFun = function(url,params,type,taskName,callback,printLogParam
       reader.readAsText(res)
     } else {
        console.log(res,'printFun')
-       jGPrintPdf(res,type,taskName,printLogParams,callback)
+       jGPrintPdf(res,type,taskName,printLogParams,callback,hidePrint)
     }
   })
 }
@@ -172,7 +172,7 @@ export const printLog = function(data,callback){
   })
 }
 // 打印pdf
-export const jGPrintPdf = function (data, type, taskName, printLogParams,callback) {
+export const jGPrintPdf = function (data, type, taskName, printLogParams,callback,hidePrint) {
     if (!data) {
       return
     }
@@ -201,6 +201,10 @@ export const jGPrintPdf = function (data, type, taskName, printLogParams,callbac
       LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
       //执行该语句之后,PRINT指令不再返回那个所谓“打印成功”,才能获取到打印状态
       LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
+      // 隐藏打印按钮
+      if(hidePrint){
+        LODOP.SET_SHOW_MODE("HIDE_PBUTTIN_PREVIEW",true);
+      }
       //TaskID:任务id,Value:job代码
       LODOP.On_Return=function(TaskID,Value){
          console.log(TaskID,Value)

+ 2 - 1
src/store/getters.js

@@ -16,7 +16,8 @@ const getters = {
   isNewSubTab: state => state.app.isNewSubTab,
   closeTabPages: state => state.app.closeTabPages,
   loadingStatus: state => state.app.loadingStatus,
-  employeeList: state => state.app.employeeList
+  employeeList: state => state.app.employeeList,
+  tempBillOfData: state => state.app.tempBillOfData
 }
 
 export default getters

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

@@ -1,5 +1,6 @@
 import Vue from 'vue'
 import { employeeQueryList } from '@/api/expenseManagement'
+import { getLookUpData, listLookUp } from '@/api/data'
 import {
   SIDEBAR_TYPE,
   DEFAULT_THEME,
@@ -33,6 +34,8 @@ const app = {
     loadingStatus: false,
     closeTabPages: [], // 已关闭的页面
     employeeList: [], // 申请人列表
+    returnReason: [], // 申请退货列表
+    tempBillOfData: null, // 临时存储收货单数据
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {
@@ -92,6 +95,9 @@ const app = {
     SET_employeeList:(state, val) => {
       state.employeeList = val
     },
+    SET_returnReason:(state, val) => {
+      state.returnReason = val
+    },
   },
   actions: {
     setSidebar ({ commit }, type) {
@@ -145,6 +151,20 @@ const app = {
         }
       })
     },
+    getLookUpData({ commit }, code, isEnable) {
+      getLookUpData({
+        pageNo: 1,
+        pageSize: 1000,
+        lookupCode: code,
+        isEnable: isEnable ? 1 : undefined
+      }).then(res => {
+        if (res.status == 200) {
+          commit('SET_returnReason', res.data.list)
+        }else{
+          commit('SET_returnReason', [])
+        }
+      })
+    },
   }
 }
 

+ 1 - 1
src/views/Home.vue

@@ -55,7 +55,7 @@ export default {
   created () {
   },
   methods: {
-    ...mapActions(['GetEmployeeList']),
+    ...mapActions(['GetEmployeeList', 'getLookUpData']),
     hasNewProduct () {
       this.GetEmployeeList()
       queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {

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

@@ -14,7 +14,7 @@
             @click.stop="handleEdit">编辑</a-button>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra" v-if="basicInfoData&&basicInfoData.printState!='UNABLE_PRINT'">
+        <template slot="extra">
           <a-button
             key="3"
             type="primary"
@@ -223,7 +223,7 @@ export default {
           billSn: objs.allocateSn,
           billNo: objs.allocateNo,
           printType: taskName + '打印'
-        })
+        }, !this.basicInfoData.printState || this.basicInfoData.printState == 'UNABLE_PRINT' || this.basicInfoData.printState == 'CANCEL_PRINT')
     },
     pageInit () {
       this.$refs.table.refresh(true)

+ 3 - 0
src/views/allocationManagement/transferOut/dsModal.vue

@@ -49,6 +49,9 @@
               <a-radio value="UNABLE_PRINT">
                 暂不打印
               </a-radio>
+              <a-radio value="CANCEL_PRINT">
+                取消打印
+              </a-radio>
             </a-radio-group>
           </a-form-model-item>
         </a-form-model>

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

@@ -8,7 +8,7 @@
           <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra" v-if="basicInfoData&&basicInfoData.printState!='UNABLE_PRINT'">
+        <template slot="extra">
           <a-button
             key="3"
             type="primary"
@@ -621,7 +621,7 @@ export default {
           billSn: objs.allocateSn,
           billNo: objs.allocateNo,
           printType: taskName + '打印'
-        })
+        }, !this.basicInfoData.printState || this.basicInfoData.printState == 'UNABLE_PRINT' || this.basicInfoData.printState == 'CANCEL_PRINT')
     },
     // 刷新当前页面
     refashPage () {

+ 5 - 2
src/views/allocationManagement/transferOut/printModal.vue

@@ -39,8 +39,8 @@
       </a-form-model>
       <div class="btn-cont">
         <a-button id="allocateBill-print-close" @click="handleClose('preview')">取消</a-button>
-        <a-button id="allocateBill-print-save" @click="handleSave('preview')" style="margin-left: 15px;">打印预览</a-button>
-        <a-button type="primary" id="allocateBill-print-back" @click="handleSave('print')" style="margin-left: 15px;">确定打印</a-button>
+        <a-button id="allocateBill-print-save" type="primary" class="button-info" @click="handleSave('preview')" style="margin-left: 15px;">打印预览</a-button>
+        <a-button v-if="hidePrint" type="primary" id="allocateBill-print-back" @click="handleSave('print')" style="margin-left: 15px;">确定打印</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -93,6 +93,9 @@ export default {
         title = '调拨分类打印'
       }
       return title
+    },
+    hidePrint () {
+      return this.itemData && this.itemData.printState && this.itemData.printState != 'UNABLE_PRINT' && this.itemData.printState != 'CANCEL_PRINT'
     }
   },
   methods: {

+ 26 - 3
src/views/allocationManagement/transfersPrint/list.vue

@@ -64,6 +64,22 @@
                     ></v-select>
                   </a-form-item>
                 </a-col>
+                <a-col :md="3" :sm="24">
+                  <a-form-item label="所在区域">
+                    <subarea id="allocateBillList-subarea" v-model="queryParam.subareaSn"></subarea>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="3" :sm="24">
+                  <a-row>
+                    <a-form-item label="地区">
+                      <a-col span="24">
+                        <a-form-item style="margin: 0;">
+                          <Area id="allocateBillList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                        </a-form-item>
+                      </a-col>
+                    </a-form-item>
+                  </a-row>
+                </a-col>
               </template>
               <a-col :md="6" :sm="24">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
@@ -134,6 +150,8 @@ import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
+import subarea from '@/views/common/subarea.js'
+import Area from '@/views/common/area.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import printModal from '@/views/allocationManagement/transferOut/printModal.vue'
@@ -144,7 +162,7 @@ import { printFun } from '@/libs/JGPrint.js'
 export default {
   name: 'TransfersPrintList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList, printModal, recordModal },
+  components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList, printModal, recordModal, subarea, Area },
   data () {
     return {
       spinning: false,
@@ -165,7 +183,9 @@ export default {
         allocateNo: '', //  调拨单号
         receiverSn: undefined,
         checkStatus: undefined,
-        printState: 'NO_PRINT'
+        printState: 'NO_PRINT',
+        subareaSn: undefined,
+        shippingAddrProvinceSn: undefined
       },
       currentTab: 2,
       disabled: false, //  查询、重置按钮是否可操作
@@ -211,12 +231,13 @@ export default {
         { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '允许打印时间', dataIndex: 'allowPrintTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印次数', dataIndex: 'printCount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
         arr.splice(7, 0, { slots: { title: 'costTitle' }, dataIndex: 'receiveTotalAmount', width: '90px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(8, 0, { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(9, 0, { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(10, 0, { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
@@ -247,6 +268,8 @@ export default {
       this.queryParam.allocateNo = ''
       this.queryParam.receiverName = ''
       this.queryParam.receiverSn = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.shippingAddrProvinceSn = undefined
       this.$refs.receiverSn.resetForm()
       this.queryParam.printState = this.currentTab == 2 ? 'NO_PRINT' : undefined
       this.$refs.table.refresh(true)

+ 14 - 0
src/views/bnSetting/menu/adminMenus.vue

@@ -50,6 +50,19 @@
               <a-icon type="pushpin" style="margin-right: 10px;" /><span >操作按钮</span>
             </div>
           </a-form-item>
+          <a-form-item label="ID" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            {{ formData.id }}
+          </a-form-item>
+          <a-form-item label="父节点ID" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-input
+              placeholder="请输入父节点ID(最多50个字符)"
+              :maxLength="50"
+              v-decorator="['formData.parentId', {
+                initialValue: formData.parentId,
+                getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入父节点ID!' }] }]"
+            />
+          </a-form-item>
           <!-- 名称 -->
           <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
@@ -250,6 +263,7 @@ export default {
         // this.formData = Object.assign({}, this.formData, info.selectedNodes[0].data.props)
         this.formData = {
           id: data.id,
+          parentId: data.parentId,
           name: data.name,
           routePath: data.routePath,
           icon: data.icon,

+ 89 - 0
src/views/common/auditDetail.vue

@@ -0,0 +1,89 @@
+<template>
+  <div>
+    <p>说明:以下信息来自钉钉</p>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        bordered>
+      </s-table>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { getProcessInstance } from '@/api/expenseManagement'
+export default {
+  name: 'AuditDetail',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    },
+    businessType: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text != '0' ? '请在钉钉中查看附件内容' : '--' } },
+        { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return getProcessInstance({ businessType: this.businessType, businessSn: this.itemSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.spinning = false
+            return data
+          } else {
+            this.spinning = false
+            this.$emit('loadError')
+            return {
+              list: [],
+              count: 0
+            }
+          }
+        })
+      }
+    }
+  },
+  methods: {
+    clearTable () {
+      this.$refs.table.clearTable()
+    },
+    refresh () {
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 5 - 1
src/views/common/dealerSubareaScopeList.vue

@@ -4,7 +4,7 @@
     label-in-value
     :size="size"
     :value="dealerName"
-    placeholder="请输入名称搜索"
+    :placeholder="placeholder"
     style="width: 100%"
     :filter-option="false"
     :not-found-content="fetching ? undefined : null"
@@ -27,6 +27,10 @@ export default {
     size: {
       type: String,
       default: 'default'
+    },
+    placeholder: {
+      type: String,
+      default: '请输入名称搜索'
     }
   },
   data () {

+ 1 - 2
src/views/common/dingDepartUser.js

@@ -56,7 +56,6 @@ const DingDepartUser = {
       )
     },
     handleChange(value) {
-      console.log(value);
       this.defaultVal = value;
       this.$emit('change', value, this.id);
       this.$emit('input', value);
@@ -90,7 +89,7 @@ const DingDepartUser = {
         }else{
           ret.push({
             title: item.name,
-            id: item.deptOrder,
+            id: item.userid,
             value: item.userid,
             pId: item.parentId,
             avatar: item.avatar,

+ 109 - 0
src/views/common/returnReason.js

@@ -0,0 +1,109 @@
+const ReturnReason = {
+  template: `
+        <a-select
+            allowClear
+            :size="size"
+            mode="combobox"
+            :value="defaultVal"
+            show-search
+            :placeholder="placeholder"
+            option-filter-prop="children"
+            style="width: 100%"
+            :filter-option="filterOption"
+            :dropdownMatchSelectWidth="false"
+            @change="onChange"
+            @blur="onBlur"
+            @focus="open=true"
+            @select="open=false"
+            :open="open"
+          >
+            <a-select-option v-for="item in list" :key="item" :value="item">
+              {{item}}
+            </a-select-option>
+          </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder: {
+      type: String,
+      default: '请输入退货原因(最多50字符)'
+    },
+    size: {
+      type: String,
+      default: 'small'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      open: false,
+      list: [
+        '漏油或者不上油',
+        '外观不良:脏污、破损、脱胶、变形等',
+        '尺寸问题',
+        '泄压',
+        '无法安装',
+        '无法或不便安装',
+        '抖动或跳动',
+        '噪音',
+        '刮雨不干净',
+        '胶条断裂、脱落',
+        '喇叭无声',
+        '声音嘶哑或者变音',
+        '浸水',
+        '伤盘',
+        '摩擦块掉渣,脱落或有残渣',
+        '制动不足,刹车不灵敏',
+        '不耐磨',
+        '冒烟',
+        '缺少感应线',
+        '尺寸不标准',
+        '不点火,间歇式失火',
+        '漏电',
+        '击穿',
+        '烧蚀',
+        '包装型号不符',
+        '整体不亮/部分能亮',
+        '灯珠脱落',
+        '漏电短路',
+        '包装型号不符/包装破损',
+        '召回'
+        ]
+    };
+  },
+  mounted() {
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    },
+  },
+  methods: {
+    filterOption(input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      );
+    },
+    onChange(value) {
+      console.log(value,'----')
+      this.open = true;
+      const ret = value?value.substr(0,50):''
+      this.defaultVal = ret;
+      this.$emit('change', ret);
+      this.$emit('input', ret);
+    },
+    onBlur(value){
+      this.open = false;
+      this.$emit('blur', value);
+    }
+  },
+};
+
+export default ReturnReason

+ 19 - 17
src/views/financialManagement/returnConfirmation/detailModal.vue

@@ -7,7 +7,7 @@
     title="详情"
     v-model="isShow"
     @cancel="isShow=false"
-    :width="960">
+    width="80%">
     <div>
       <!-- <div style="padding: 0 12px;text-align: right;">
         <a-button id="outboundOrderDetail-preview-btn" style="margin-right: 15px;">打印预览</a-button>
@@ -21,10 +21,12 @@
               <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="销退单号">{{ detailData&&detailData.salesReturnBillNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货数量">{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="申请退货数量">{{ detailData&&(detailData.totalInitialQty || detailData.totalInitialQty==0) ? detailData.totalInitialQty : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="仓库实收数量">{{ detailData&&(detailData.totalReceiveQty || detailData.totalReceiveQty==0) ? detailData.totalReceiveQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="坏件数量">{{ detailData&&(detailData.totalBadQty || detailData.totalBadQty==0) ? detailData.totalBadQty : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="良品数量">{{ detailData&&(detailData.totalGoodQty || detailData.totalGoodQty==0) ? detailData.totalGoodQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="返库数量">{{ detailData&&(detailData.totalBackStockQty || detailData.totalBackStockQty==0) ? detailData.totalBackStockQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货金额" v-if="$hasPermissions('B_isShowPrice')">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="实际退货金额" v-if="$hasPermissions('B_isShowPrice')">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -35,6 +37,7 @@
           ref="table"
           size="small"
           :rowKey="(record) => record.id"
+          :scroll="{ y: 400 }"
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
@@ -88,21 +91,20 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', 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: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '退货金额小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      // 售价权限
-      if (this.$hasPermissions('B_isShowPrice')) {
-        arr.splice(4, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(9, 0, { title: '退货金额小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(10, 0, { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(11, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }

+ 15 - 15
src/views/financialManagement/returnConfirmation/list.vue

@@ -22,13 +22,13 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="是否抓单">
+                <a-form-item label="单据来源">
                   <v-select
-                    v-model="queryParam.grabFlag"
-                    ref="grabFlag"
-                    id="returnConfirmationList-grabFlag"
-                    code="FLAG"
-                    placeholder="请选择"
+                    v-model="queryParam.salesReturnBillSource"
+                    ref="salesReturnBillSource"
+                    id="returnConfirmationList-salesReturnBillSource"
+                    code="SALES_SOURCE"
+                    placeholder="请选择单据来源"
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
@@ -110,7 +110,7 @@ export default {
         endDate: '',
         salesReturnBillNo: '', //  单号
         buyerSn: undefined,
-        grabFlag: undefined,
+        salesReturnBillSource: undefined,
         billStatus: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
@@ -142,19 +142,19 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '16%', align: 'center' },
-        { title: '退货客户', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '15%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'totalReceiveQty', 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: 'grabFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '确认时间', dataIndex: 'confirmTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '确认时间', dataIndex: 'confirmTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(6, 0, { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }
@@ -175,7 +175,7 @@ export default {
       this.queryParam.endDate = ''
       this.queryParam.salesReturnBillNo = ''
       this.queryParam.buyerSn = undefined
-      this.queryParam.grabFlag = undefined
+      this.queryParam.salesReturnBillSource = undefined
       this.queryParam.billStatus = undefined
       this.$refs.dealerSubareaScopeList.resetForm()
       this.$refs.table.refresh(true)

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

@@ -80,7 +80,14 @@
           <a-row :gutter="24">
             <a-col :span="24">
               <a-form-model-item label="角色" prop="roleNames" :label-col="{span: 3}" :wrapper-col="{span: 20}">
-                <a-select placeholder="请选择角色" id="userSyncEdit-roleNames" allowClear v-model="form.roleNames" mode="multiple">
+                <a-select
+                  show-search
+                  :filter-option="filterOption"
+                  placeholder="请选择角色"
+                  id="userSyncEdit-roleNames"
+                  allowClear
+                  v-model="form.roleNames"
+                  mode="multiple">
                   <a-select-option v-for="item in roleList" :key="item.id" :value="item.id" :disabled="item.isEnable == '0' ? true : false">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
@@ -205,6 +212,11 @@ export default {
           this.$message.warning(res.message)
         }
       })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     }
   },
   watch: {

+ 40 - 4
src/views/purchasingManagement/bulkWarehousingOrder/list.vue

@@ -16,6 +16,32 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
+              <a-form-item label="入库单号">
+                <a-input id="bulkWarehousingOrderList-sparePartsNo" v-model.trim="queryParam.sparePartsNo" allowClear placeholder="请输入入库单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="商户名称">
+                <a-input id="bulkWarehousingOrderList-supplierName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入商户名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="金蝶单号">
+                <a-input id="bulkWarehousingOrderList-kingdeeNo" v-model.trim="queryParam.kingdeeNo" allowClear placeholder="请输入金蝶单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="入库类型">
+                <v-select
+                  v-model="queryParam.sparePartsType"
+                  ref="sparePartsType"
+                  id="bulkWarehousingOrderList-sparePartsType"
+                  code="SPARE_PARTS_TYPE"
+                  placeholder="请选择入库类型"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
               <a-form-item label="状态">
                 <v-select
                   v-model="queryParam.state"
@@ -124,7 +150,11 @@ export default {
       queryParam: {
         productCode: '',
         relationNo: '',
-        state: undefined
+        state: undefined,
+        sparePartsType: undefined,
+        sparePartsNo: '',
+        supplierName: '',
+        kingdeeNo: ''
       },
       loading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -222,9 +252,15 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.relationNo = ''
-      this.queryParam.state = undefined
+      this.queryParam = {
+        productCode: '',
+        relationNo: '',
+        state: undefined,
+        sparePartsType: undefined,
+        sparePartsNo: '',
+        supplierName: '',
+        kingdeeNo: ''
+      }
       this.$refs.table.refresh(true)
     },
     //  单条审核

+ 1 - 1
src/views/reportData/actualSalesReport/list.vue

@@ -215,7 +215,7 @@ export default {
       const arr = [
         { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 90, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
         { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealer.dealerName',width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealer.dealerName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌',
           align: 'center',

+ 23 - 17
src/views/reportData/salesReturnDetailReport/list.vue

@@ -145,11 +145,12 @@
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
-            <a-col :md="4" :sm="24">退货数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">开单退货金额:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
-            <a-col :md="4" :sm="24">返工数量:{{ (totalData && (totalData.totalBackStockQty || totalData.totalBackStockQty==0)) ? totalData.totalBackStockQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24">仓库实收数量:{{ (totalData && (totalData.receiveQty || totalData.receiveQty==0)) ? totalData.receiveQty : '--' }}</a-col>
             <a-col :md="4" :sm="24">坏件数量:{{ (totalData && (totalData.totalBadQty || totalData.totalBadQty==0)) ? totalData.totalBadQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24">良品数量:{{ (totalData && (totalData.goodQty || totalData.goodQty==0)) ? totalData.goodQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24">返库数量:{{ (totalData && (totalData.totalBackStockQty || totalData.totalBackStockQty==0)) ? totalData.totalBackStockQty : '--' }}</a-col>
             <a-col :md="4" :sm="24">正常退货数量:{{ (totalData && (totalData.totalNormalQty || totalData.totalNormalQty==0)) ? totalData.totalNormalQty : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">正常退货金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? totalData.totalNormalPrice : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">正常再入库金额:{{ (totalData && (totalData.totalNormalCost || totalData.totalNormalCost==0)) ? totalData.totalNormalCost : '--' }}</a-col>
@@ -250,19 +251,23 @@ export default {
         { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerName', width: 120,align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'badQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'goodQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -276,23 +281,24 @@ export default {
         // { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
+
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 29 : 28
+        arr.splice(20, 0, { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(21, 0, { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(22, 0, { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(23, 0, { title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(24, 0, { title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(25, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(26, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind, 0, { title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
-        const ind = this.$hasPermissions('B_isShowPrice') ? 23 : 16
+        const ind = this.$hasPermissions('B_isShowPrice') ? 27 : 20
         arr.splice(ind, 0, { title: '再入库单价', dataIndex: 'cost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(ind + 3, 0, { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(ind + 4, 0, { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        const ind = this.$hasPermissions('B_isShowCost') ? 25 : 24
-        arr.splice(16, 0, { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(17, 0, { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(18, 0, { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(19, 0, { title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(20, 0, { title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(21, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(22, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(ind, 0, { title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return arr
     }
   },

+ 26 - 6
src/views/salesManagement/matchSendOutOrder/list.vue

@@ -133,6 +133,17 @@
         </s-table>
       </a-spin>
     </a-card>
+    <!-- 查看销售单或备货单详情 -->
+    <commonModal
+      :modalTit="detailType?'备货单详情':'销售单详情'"
+      bodyPadding="10px"
+      width="70%"
+      :showFooter="false"
+      :openModal="showDetailModal"
+      @cancel="cancelDetail">
+      <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+      <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+    </commonModal>
   </div>
 </template>
 
@@ -144,15 +155,21 @@ import subarea from '@/views/common/subarea.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import Area from '@/views/common/area.js'
 import { dispatchlList, dispatchCheck } from '@/api/dispatch'
+import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
+import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 export default {
   name: 'MatchSendOutOrderList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, Area },
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, Area, commonModal, salesDetail, dispatchDetail },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      showDetailModal: false,
+      detailType: 2,
+      bizSn: null,
       tableHeight: 0,
       time: [],
       checktime: [],
@@ -236,11 +253,14 @@ export default {
     },
     // 详情
     handleDetail (row, type) {
-      if (type == 0) {
-        this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn, type: 'pushOrder' } })
-      } else {
-        this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
-      }
+      this.detailType = type
+      this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
+      this.showDetailModal = true
+    },
+    cancelDetail () {
+      this.showDetailModal = false
+      this.detailType = 2
+      this.bizSn = null
     },
     // 对单
     handleAudit (row) {

+ 6 - 3
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -5,7 +5,7 @@
         <template slot="subTitle" v-if="!outBizSubSn&&!bizSn">
           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
         </template>
-        <template slot="extra" v-if="$hasPermissions('B_dispatchPrint')&&detailData&&detailData.printStatus!='UNABLE_PRINT'">
+        <template slot="extra" v-if="$hasPermissions('B_dispatchPrint')">
           <a-button
             key="3"
             type="primary"
@@ -91,7 +91,7 @@
       </a-card>
     </a-spin>
     <!-- 发货分类打印 -->
-    <sendTypeModal ref="typePrint" :openModal="openModal" @ok="handlePrintOk" @close="openModal=false" />
+    <sendTypeModal ref="typePrint" :hasNoPrint="hasNoPrint" :openModal="openModal" @ok="handlePrintOk" @close="openModal=false" />
     <!-- 导出Excel -->
     <export-excel-modal :openModal="openExcelModal" :itemData="detailData" @ok="handleExcelOk" @close="openExcelModal=false" />
     <!-- 打印 -->
@@ -166,6 +166,9 @@ export default {
     }
   },
   computed: {
+    hasNoPrint () {
+      return this.detailData && (this.detailData.printStatus == 'UNABLE_PRINT' || this.detailData.printStatus == 'CANCEL_PRINT')
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -250,7 +253,7 @@ export default {
           billSn: obj.dispatchBillSn,
           billNo: obj.dispatchBillNo,
           printType: taskName + '打印'
-        })
+        }, this.hasNoPrint)
     }
   },
   mounted () {

+ 16 - 2
src/views/salesManagement/pushOrderManagement/list.vue

@@ -144,6 +144,16 @@
           </div>
         </div>
       </commonModal>
+      <!-- 查看销售单或备货单详情 -->
+      <commonModal
+        modalTit="销售单详情"
+        bodyPadding="10px"
+        width="70%"
+        :showFooter="false"
+        :openModal="showDetailModal"
+        @cancel="showDetailModal = false">
+        <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+      </commonModal>
     </a-spin>
   </a-card>
 </template>
@@ -158,16 +168,19 @@ import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
 import { dispatchlList, dispatchQueryCount, dispatchPrintStatus } from '@/api/dispatch'
 export default {
   name: 'PushOrderManagementList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, Area },
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, Area, salesDetail },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      showDetailModal: false,
+      bizSn: null,
       tableHeight: 0,
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
@@ -262,7 +275,8 @@ export default {
     // 详情
     handleDetail (row, type) {
       if (type == 0) {
-        this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn, type: 'pushOrder' } })
+        this.bizSn = row.salesBillSn
+        this.showDetailModal = true
       } else {
         this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
       }

+ 7 - 3
src/views/salesManagement/pushOrderManagement/sendTypeModal.vue

@@ -42,9 +42,9 @@
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="pushOrderManagement-print-back" @click="handleCancel" style="margin-left: 15px;">取消</a-button>
-        <a-button id="pushOrderManagement-print-save" @click="handleSave('preview')" style="margin-left: 15px;">打印预览</a-button>
-        <a-button type="primary" id="pushOrderManagement-print-save" @click="handleSave('print')" style="margin-left: 15px;">确定</a-button>
+        <a-button id="pushOrderManagement-print-back" @click="handleCancel">取消</a-button>
+        <a-button type="primary" class="button-info" id="pushOrderManagement-print-save" @click="handleSave('preview')" style="margin-left: 15px;">打印预览</a-button>
+        <a-button type="primary" id="pushOrderManagement-print-save" v-if="!hasNoPrint" @click="handleSave('print')" style="margin-left: 10px;">确定打印</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -61,6 +61,10 @@ export default {
     outBizSubSn: {
       type: [Number, String],
       default: ''
+    },
+    hasNoPrint: {
+      type: Boolean,
+      default: false
     }
   },
   data () {

+ 46 - 13
src/views/salesManagement/receiptPrint/list.vue

@@ -40,7 +40,7 @@
                     <dealerSubareaScopeList ref="receiverName" id="salesCollectionList-receiverName" @change="receiverChange" />
                   </a-form-item>
                 </a-col>
-                <a-col :md="4" :sm="24">
+                <a-col :md="6" :sm="24">
                   <a-form-item label="业务状态">
                     <v-select
                       v-model="queryParam.billStatus"
@@ -51,7 +51,7 @@
                       allowClear></v-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="4" :sm="24" v-if="currentTab == 1">
+                <a-col :md="6" :sm="24" v-if="currentTab == 1">
                   <a-form-item label="单据状态">
                     <v-select
                       v-model="queryParam.voidFlag"
@@ -62,7 +62,7 @@
                       allowClear></v-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="4" :sm="24" v-if="currentTab == 1">
+                <a-col :md="6" :sm="24" v-if="currentTab == 1">
                   <a-form-item label="收款打印状态">
                     <v-select
                       v-model="queryParam.printState"
@@ -74,6 +74,11 @@
                     ></v-select>
                   </a-form-item>
                 </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="收款时间">
+                    <rangeDate ref="rangeSettleDate" :value="settleDate" @change="dateSettleChange" />
+                  </a-form-item>
+                </a-col>
                 <a-col :md="4" :sm="24">
                   <a-form-item label="所在区域">
                     <subarea id="salesCollectionList-subarea" v-model="queryParam.subareaSn"></subarea>
@@ -118,12 +123,12 @@
           bordered>
           <!-- 单号 -->
           <template slot="bizNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.bizNo }}</span>
+            <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record,0)">{{ record.bizNo }}</span>
             <span v-else>{{ record.bizNo }}</span>
           </template>
           <!-- 下推单号 -->
           <template slot="dispatchBillNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_dispatchDetail')" class="link-bule" @click="handleBhDetail(record)">{{ record.dispatchBillNo }}</span>
+            <span v-if="$hasPermissions('B_dispatchDetail')" class="link-bule" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
             <span v-else>{{ record.dispatchBillNo || '--' }}</span>
           </template>
           <!-- 操作 -->
@@ -156,9 +161,19 @@
           @cancel="showTipModal=false">
           <printModel ref="printModel" @cancel="showTipModal=false" @printOk="printOk"></printModel>
         </commonModal>
-
         <!-- 打印记录 -->
         <recordModal ref="recordModal" modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
+        <!-- 查看销售单或备货单详情 -->
+        <commonModal
+          :modalTit="detailType?'备货单详情':'销售单详情'"
+          bodyPadding="10px"
+          width="70%"
+          :showFooter="false"
+          :openModal="showDetailModal"
+          @cancel="cancelDetail">
+          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+        </commonModal>
       </a-spin>
     </a-card>
   </div>
@@ -172,25 +187,33 @@ import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
+import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import recordModal from './recordModal.vue'
 import printModel from './printModel.vue'
 import { settleReceiptList } from '@/api/settleReceipt'
 export default {
   name: 'ReceiptPrintList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, recordModal, Area, printModel },
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, recordModal, Area, printModel, salesDetail, dispatchDetail },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      showDetailModal: false,
+      detailType: 2,
+      bizSn: null,
       tableHeight: 0,
       time: [],
+      settleDate: [],
       currentTab: 2,
       // 查询参数
       queryParam: {
         beginDate: '',
         endDate: '',
+        beginDateSettle: '',
+        endDateSettle: '',
         bizNo: '',
         dispatchBillNo: '',
         settleClientName: '',
@@ -243,6 +266,7 @@ export default {
         // { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center' },
         { title: '打印次数', dataIndex: 'printCount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
@@ -265,19 +289,26 @@ export default {
       this.queryParam.beginDate = date[0] ? date[0] + ' 00:00:00' : ''
       this.queryParam.endDate = date[1] ? date[1] + ' 23:59:59' : ''
     },
+    //  收款时间  change
+    dateSettleChange (date) {
+      this.queryParam.beginDateSettle = date[0] ? date[0] + ' 00:00:00' : ''
+      this.queryParam.endDateSettle = date[1] ? date[1] + ' 23:59:59' : ''
+    },
     custChange (val) {
       this.queryParam.settleClientName = val.name
     },
     receiverChange (val) {
       this.queryParam.receiverName = val.name
     },
-    // 销售单详情
-    handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.bizSn, type: 'salesCollection' } })
+    handleDetail (row, type) {
+      this.detailType = type
+      this.bizSn = type == 0 ? row.bizSn : row.dispatchBillSn
+      this.showDetailModal = true
     },
-    // 备货单号
-    handleBhDetail (row) {
-      this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'salesCollection' } })
+    cancelDetail () {
+      this.showDetailModal = false
+      this.detailType = 2
+      this.bizSn = null
     },
     // 收款打印
     handlePrint (row) {
@@ -303,6 +334,8 @@ export default {
       if (this.advanced) {
         this.$refs.rangeDate.resetDate(this.time)
         this.$refs.receiverName.resetForm()
+        this.settleDate = []
+        this.$refs.rangeSettleDate.resetDate()
       }
       this.$refs.settleClientName.resetForm()
       this.queryParam = {

+ 28 - 9
src/views/salesManagement/salesCollection/list.vue

@@ -142,12 +142,12 @@
         bordered>
         <!-- 单号 -->
         <template slot="bizNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.bizNo }}</span>
+          <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record,0)">{{ record.bizNo }}</span>
           <span v-else>{{ record.bizNo }}</span>
         </template>
         <!-- 下推单号 -->
         <template slot="dispatchBillNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_dispatchDetail')" class="link-bule" @click="handleBhDetail(record)">{{ record.dispatchBillNo }}</span>
+          <span v-if="$hasPermissions('B_dispatchDetail')" class="link-bule" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
           <span v-else>{{ record.dispatchBillNo || '--' }}</span>
         </template>
         <!-- 操作 -->
@@ -197,6 +197,18 @@
           </div>
         </div>
       </commonModal>
+
+      <!-- 查看销售单或备货单详情 -->
+      <commonModal
+        :modalTit="detailType?'备货单详情':'销售单详情'"
+        bodyPadding="10px"
+        width="70%"
+        :showFooter="false"
+        :openModal="showDetailModal"
+        @cancel="cancelDetail">
+        <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+        <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+      </commonModal>
     </a-spin>
   </a-card>
 </template>
@@ -208,6 +220,8 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
 import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
+import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import detailModal from './detailModal.vue'
 import voucherModal from './voucherModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
@@ -216,13 +230,16 @@ import { settleReceiptList, settleReceiptBatch } from '@/api/settleReceipt'
 export default {
   name: 'SalesCollectionList',
   mixins: [commonMixin],
-  components: { STable, VSelect, subarea, rangeDate, commonModal, detailModal, Area, voucherModal, dealerSubareaScopeList },
+  components: { STable, VSelect, subarea, rangeDate, commonModal, detailModal, Area, voucherModal, dealerSubareaScopeList, salesDetail, dispatchDetail },
   data () {
     return {
       spinning: false,
       showDetail: false,
       showSkModal: false,
       showVoucher: false,
+      showDetailModal: false,
+      detailType: 2,
+      bizSn: null,
       tableHeight: 0,
       queryParam: { //  查询条件
         beginDate: '',
@@ -368,13 +385,15 @@ export default {
       this.$refs.table.refresh(true)
       this.$refs.table.clearSelected()
     },
-    // 销售单详情
-    handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.bizSn, type: 'salesCollection' } })
+    handleDetail (row, type) {
+      this.detailType = type
+      this.bizSn = type == 0 ? row.bizSn : row.dispatchBillSn
+      this.showDetailModal = true
     },
-    // 备货单号
-    handleBhDetail (row) {
-      this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'salesCollection' } })
+    cancelDetail () {
+      this.showDetailModal = false
+      this.detailType = 2
+      this.bizSn = null
     },
     // 点击批量收款
     handlePlColle () {

+ 0 - 251
src/views/salesManagement/salesReturn/detail.vue

@@ -1,251 +0,0 @@
-<template>
-  <div class="salesReturnDetail-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesReturnDetail-cont">
-        <template slot="subTitle">
-          <a href="javascript:;" @click="handleBack">
-            <a-icon type="left"></a-icon>
-            返回列表
-          </a>
-        </template>
-        <!-- 操作区,位于 title 行的行尾 -->
-        <template slot="extra">
-          <a-button
-            key="3"
-            type="default"
-            class="button-info"
-            id="salesReturnEdit-preview-btn"
-            v-if="$hasPermissions('B_salesReturnPrint')"
-            :disabled="chooseLoadData.length==0"
-            @click="handlePrint('preview')">打印预览</a-button>
-          <a-button
-            key="2"
-            type="primary"
-            class="button-info"
-            id="salesReturnEdit-print-btn"
-            v-if="$hasPermissions('B_salesReturnPrint')"
-            :disabled="chooseLoadData.length==0"
-            @click="handlePrint('print')">快捷打印</a-button>
-          <a-divider type="vertical" />
-          <a-button
-            key="1"
-            type="primary"
-            class="button-warning"
-            id="salesReturnEdit-export-btn"
-            v-if="$hasPermissions('B_salesReturnExport')"
-            :disabled="chooseLoadData.length==0"
-            @click="handlePrint('export')">导出Excel</a-button>
-        </template>
-      </a-page-header>
-      <!-- 基础信息 -->
-      <a-card size="small" :bordered="false" class="salesReturnDetail-cont">
-        <a-collapse :activeKey="['1']">
-          <a-collapse-panel key="1" header="基础信息">
-            <a-descriptions size="small" :column="3">
-              <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="销退单号">{{ detailData&&detailData.salesReturnBillNo || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货数量">{{ detailData&&(detailData.totalQty || detailData.totalQty == 0) ? detailData.totalQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="坏件数量">{{ detailData&&(detailData.totalBadQty || detailData.totalBadQty == 0) ? detailData.totalBadQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="返库数量">{{ detailData&&(detailData.totalBackStockQty || detailData.totalBackStockQty == 0) ? detailData.totalBackStockQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货金额" v-if="$hasPermissions('B_isShowPrice')">{{ detailData&&(detailData.totalAmount || detailData.totalAmount == 0) ? detailData.totalAmount : '--' }}元</a-descriptions-item>
-            </a-descriptions>
-          </a-collapse-panel>
-        </a-collapse>
-      </a-card>
-      <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- 列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="record => record.id"
-          :columns="columns"
-          :data="loadData"
-          :defaultLoadData="false"
-          bordered></s-table>
-      </a-card>
-      <a-card size="small" :bordered="false" class="footer-cont">
-        <a-button
-          type="primary"
-          class="button-warning"
-          style="width: 150px;"
-          size="large"
-          v-if="detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesReturnAudit')"
-          @click="visibleAudit=true"
-          id="salesReturn-eexamine-btn">审核</a-button>
-        <a-button
-          type="primary"
-          class="button-info"
-          size="large"
-          style="width: 150px;"
-          id="salesDetail-edit-btn"
-          v-if="detailData&&detailData.salesReturnBillSource == 'SALES' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'WAIT_SUBMIT')&&$hasPermissions('B_salesReturnEdit')"
-          @click="handleEdit()"
-        >
-          编辑
-        </a-button>
-        <!-- <a-button
-          size="large"
-          style="width: 150px;"
-          v-if="detailData&&detailData.salesReturnBillSource != 'SALES' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesReturnEdit')"
-          type="primary"
-          class="button-info"
-          @click="handleEdit()"
-          id="salesReturn-edit-btn">改单</a-button> -->
-      </a-card>
-    </a-spin>
-    <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_CHECK')" @fail="auditOrder('AUDIT_REJECT')" />
-    <!-- 打印 -->
-    <div id="print"></div>
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { getOperationalPrecision } from '@/libs/tools.js'
-import { STable, VSelect } from '@/components'
-import { printFun, exportExcel } from '@/libs/JGPrint.js'
-import auditModal from '@/views/common/auditModal.vue'
-import { salesReturnDetail, salesReturnAudit, salesReturnPrint, salesReturnExport } from '@/api/salesReturn'
-import { salesReturnDetailList } from '@/api/salesReturnDetail'
-export default {
-  name: 'SalesReturnDetail',
-  mixins: [commonMixin],
-  components: { STable, VSelect, auditModal },
-  data () {
-    return {
-      spinning: false,
-      disabled: false,
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        const params = Object.assign(parameter, { salesReturnBillSn: this.$route.params.sn })
-        return salesReturnDetailList(params).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].saleReturnSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
-            }
-            this.chooseLoadData = data.list
-            this.disabled = false
-          }
-          return data
-        })
-      },
-      chooseLoadData: [],
-      detailData: null, //  详情数据
-      visibleAudit: false,
-      spinningAudit: false
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '17%', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', width: '17%', 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: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '4%', customRender: function (text) { return text || '--' } },
-        // { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ]
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(4, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(9, 0, { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      return arr
-    }
-  },
-  methods: {
-    //  返回
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/salesReturn/list', query: { closeLastOldTab: true } })
-    },
-    auditOrder (billStatus) {
-      this.spinningAudit = true
-      salesReturnAudit({
-        salesReturnBillSn: this.detailData.salesReturnBillSn,
-        billStatus: billStatus
-      }).then(res => {
-        if (res.status == 200) {
-          this.visibleAudit = false
-          this.$message.success(res.message)
-          this.handleBack()
-          this.spinningAudit = false
-        } else {
-          this.visibleAudit = false
-          this.spinningAudit = false
-        }
-      })
-    },
-    // 编辑
-    handleEdit () {
-      const row = this.detailData
-      this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
-    },
-    //  详情
-    getDetail () {
-      salesReturnDetail({ sn: this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.detailData = res.data
-        } else {
-          this.detailData = null
-        }
-      })
-    },
-    // 打印预览/快捷打印
-    handlePrint (type) {
-      const _this = this
-      const params = { sn: this.$route.params.sn }
-      _this.spinning = true
-      // 导出
-      if (type == 'export') {
-        exportExcel(salesReturnExport, params, '销售退货', function () {
-          _this.spinning = false
-        })
-      } else {
-        // 打印或预览
-        printFun(salesReturnPrint, params, type, '销售退货', () => { _this.spinning = false })
-      }
-    }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      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">
-.salesReturnDetail-wrap {
-  .salesReturnDetail-cont {
-    margin-bottom: 10px;
-  }
-  .footer-cont{
-    margin-top: 5px;
-    text-align: center;
-  }
-}
-</style>

+ 0 - 216
src/views/salesManagement/salesReturn/queryPart.vue

@@ -1,216 +0,0 @@
-<template>
-  <div class="salesReturnList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24" v-if="grabFlag == 1">
-            <a-form-item label="销售单号">
-              <a-input id="salesReturnList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="salesReturnList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="salesReturnList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-            </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="salesReturnList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnList-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"
-      :customRow="handleClickRow"
-      :rowClassName="(record, index) => (grabFlag == '1'&&record.refundableQty==0) ? 'redBg-row':''"
-      :defaultLoadData="false"
-      :scroll="{ y: 300 }"
-      bordered>
-      <!-- 本次退货数量 -->
-      <template slot="qty" slot-scope="text, record">
-        <div @dblclick.stop>
-          <a-input-number
-            size="small"
-            v-model="record.qty"
-            :precision="0"
-            :min="0"
-            :max="999999"
-            style="width: 100%;"
-            placeholder="请输入" />
-        </div>
-      </template>
-      <span slot="customTitle">
-        操作
-        <a-popover>
-          <template slot="content">
-            双击列表配件可快速选中添加
-          </template>
-          <a-icon type="question-circle" theme="twoTone" />
-        </a-popover>
-      </span>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          :loading="newLoading"
-          :disabled="grabFlag == '1'&&record.refundableQty==0"
-          @click="handleAdd(record)"
-        >添加</a-button>
-      </template>
-    </s-table>
-  </div>
-</template>
-
-<script>
-import { salesQueryByReturn } from '@/api/salesReturn'
-import { queryStockProductPage } from '@/api/stock'
-import { STable, VSelect } from '@/components'
-export default {
-  name: 'QueryPart',
-  components: { STable, VSelect },
-  props: {
-    newLoading: Boolean
-  },
-  data () {
-    return {
-      buyerSn: '',
-      grabFlag: '',
-      priceType: '',
-      queryParam: { //  查询条件
-        salesBillNo: '', //  销售单号
-        productName: '', // 产品名称
-        productCode: '' //  产品编码
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      columns: [],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // 抓单时
-        if (this.grabFlag == 1) {
-          this.queryParam.buyerSn = this.buyerSn
-        }
-        // 不抓单
-        if (this.grabFlag == 0) {
-          this.queryParam.dealerSn = this.buyerSn
-        }
-        const fun = [queryStockProductPage, salesQueryByReturn]
-        return fun[this.grabFlag](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
-              data.list[i].qty = 1
-            }
-            this.disabled = false
-          }
-          return data
-        })
-      }
-    }
-  },
-  methods: {
-    // 双击列表选择配件
-    handleClickRow (record) {
-      const _this = this
-      return {
-        on: {
-          dblclick: (event) => {
-            if (_this.grabFlag == '1' && record.refundableQty == 0) {
-              _this.$message.info('该产品暂时不能添加')
-            } else {
-              event.stopPropagation()
-              _this.$emit('add', record)
-            }
-          }
-        }
-      }
-    },
-    //  重置
-    resetSearchForm () {
-      this.queryParam.salesBillNo = ''
-      this.queryParam.productName = ''
-      this.queryParam.productCode = ''
-      this.$refs.table.refresh(true)
-    },
-    pageInit (buyerSn, grabFlag) {
-      this.buyerSn = buyerSn
-      this.grabFlag = grabFlag
-      // 抓单
-      if (this.grabFlag == 1) {
-        const arr = [
-          { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-          { title: '销售单号', dataIndex: 'salesBillNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品编码', dataIndex: 'productEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-          // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '剩余可退数量', dataIndex: 'refundableQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '本次退货数量', dataIndex: 'qty', width: '8%', align: 'center', scopedSlots: { customRender: 'qty' } },
-          // { title: '采购价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-        ]
-        if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-          arr.splice(4, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        }
-        if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
-          const ind = this.$hasPermissions('B_isShowPrice') ? 7 : 6
-          arr.splice(ind, 0, { title: '采购价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        }
-        this.columns = arr
-      } else {
-        const arr = [
-          { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
-          { title: '产品编码', dataIndex: 'productCode', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productName', width: '27%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-          // { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '退货数量', dataIndex: 'qty', width: '9%', align: 'center', scopedSlots: { customRender: 'qty' } },
-          // { title: '采购价', dataIndex: 'lastStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-        ]
-        if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-          arr.splice(3, 0, { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        }
-        if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
-          const ind = this.$hasPermissions('B_isShowPrice') ? 5 : 4
-          arr.splice(ind, 0, { title: '采购价', dataIndex: 'lastStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        }
-        this.columns = arr
-      }
-      this.resetSearchForm()
-    },
-    // 选择配件
-    handleAdd (row) {
-      this.$emit('add', row)
-    },
-    refreshData () {
-      this.$refs.table.refresh()
-    }
-  }
-}
-</script>
-<style lang="less">
-  .salesReturnList-wrap{
-    .redBg-row{
-      background-color: #f5cdc8;
-    }
-  }
-</style>

+ 0 - 277
src/views/salesManagement/salesReturn/salesReturnCheck.vue

@@ -1,277 +0,0 @@
-<template>
-  <div class="salesReturnCheck-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesReturnCheck-back" >
-        <!-- 自定义的二级文字标题 -->
-        <template slot="subTitle">
-          <a id="salesReturnCheck-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
-        </template>
-      </a-page-header>
-      <a-card size="small" :bordered="false" class="salesReturnCheck-cont">
-        <div>
-          <a-button type="primary" :loading="loading" class="button-error" @click="backStock">批量返库</a-button>
-        </div>
-        <!-- 已选配件列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          :style="{ height: tableHeight+84.5+'px' }"
-          size="small"
-          :rowKey="(record) => record.id"
-          :row-selection="{ columnWidth: 40 }"
-          @rowSelection="rowSelectionFun"
-          :columns="columns"
-          :data="loadData"
-          :scroll="{ y: tableHeight }"
-          :defaultLoadData="false"
-          bordered>
-          <!-- 返库数量 -->
-          <template slot="backStockQty" slot-scope="text, record">
-            <a-input-number
-              id="salesReturn-backStockQty"
-              size="small"
-              v-model="record.backStockQty"
-              :precision="0"
-              :min="0"
-              :max="record.qty"
-              placeholder="请输入"
-              @blur="e => onCellBlur(e.target.value, record)"
-              style="width: 100%;" />
-          </template>
-        </s-table>
-      </a-card>
-    </a-spin>
-    <div class="affix-cont">
-      <a-button
-        size="large"
-        style="padding: 0 60px;"
-        :disabled="spinning"
-        type="primary"
-        class="button-primary"
-        @click="handleSubmit()"
-        id="salesReturn-handleSubmit">提交</a-button>
-    </div>
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
-import { salesReturnDetail, salesReturnCheck } from '@/api/salesReturn'
-import {
-  salesReturnDetailList,
-  updateBackStockQty
-} from '@/api/salesReturnDetail'
-export default {
-  name: 'SalesReturnCheck',
-  mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect
-  },
-  data () {
-    return {
-      spinning: false,
-      tableHeight: 0, // 表格高度
-      orderId: null,
-      orderSn: null,
-      buyerSn: null,
-      disabled: false,
-      isInster: false, // 是否正在添加产品
-      ordeDetail: { discountAmount: 0 },
-      loading: false,
-      // 已选产品
-      dataSource: [],
-      productForm: {
-        salesReturnBillSn: ''
-      },
-      chooseLoadData: [],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // 查询总计
-        this.productForm.salesReturnBillSn = this.$route.params.sn
-        return salesReturnDetailList(Object.assign(parameter, this.productForm)).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
-              data.list[i].backStockQtyBackups = data.list[i].backStockQty
-            }
-            this.disabled = false
-            this.chooseLoadData = data.list
-          }
-          return data
-        })
-      },
-      rowSelectionInfo: null
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '23%', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'qty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: '10%', align: 'center', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
-        // { title: '售价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ]
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(7, 0, { title: '售价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      return arr
-    }
-  },
-  methods: {
-    // 表格选中项
-    rowSelectionFun (obj) {
-      this.rowSelectionInfo = obj || null
-    },
-    //  返回
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/salesReturn/list', query: { closeLastOldTab: true } })
-    },
-    // 批量返库
-    backStock () {
-      const _this = this
-      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
-        _this.$message.warning('请先选择产品!')
-        return
-      }
-      this.$confirm({
-        title: '提示',
-        content: '确认要批量返库吗?',
-        centered: true,
-        onOk () {
-          const obj = []
-          _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-            obj.push({
-              salesReturnDetailSn: item.salesReturnDetailSn,
-              backStockQty: item.qty
-            })
-          })
-          console.log(obj)
-          _this.submitCheck(obj)
-        }
-      })
-    },
-    // 已选产品  blur
-    onCellBlur (val, record) {
-      //  光标移出,值发生改变再调用编辑接口
-      if (val && val != record.backStockQtyBackups) {
-        this.submitCheck([{
-          salesReturnDetailSn: record.salesReturnDetailSn,
-          backStockQty: record.backStockQty
-        }])
-      } else {
-        record.backStockQty = record.backStockQtyBackups
-      }
-    },
-    // 品检
-    submitCheck (data) {
-      this.loading = true
-      this.spinning = true
-      updateBackStockQty(data).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm(true)
-          this.$message.success(res.message)
-        }
-        this.loading = false
-        this.spinning = false
-      })
-    },
-    // 获取单据详细
-    getOrderDetail () {
-      this.rowSelectionInfo = null
-      salesReturnDetail({ sn: this.orderSn }).then(res => {
-        this.ordeDetail = res.data || null
-      })
-    },
-    //  重置
-    resetSearchForm (flag) {
-      this.$refs.table.refresh(!!flag)
-      this.getOrderDetail()
-    },
-    // 提交销售单
-    handleSubmit () {
-      this.spinning = true
-      salesReturnCheck({ salesReturnBillSn: this.orderSn }).then(res => {
-        if (res.status == 200) {
-          this.handleBack()
-          this.$message.success(res.message)
-          this.spinning = false
-        } else {
-          this.spinning = false
-        }
-      })
-    },
-    pageInit () {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-      this.orderSn = this.$route.params.sn
-      this.buyerSn = this.$route.params.buyerSn
-      this.rowSelectionInfo = null
-      this.$refs.table.clearTable()
-      this.getOrderDetail()
-    },
-    setTableH () {
-      this.tableHeight = window.innerHeight - 340
-    }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.$refs.table.refresh(true)
-      this.pageInit()
-    }
-  },
-  activated () {
-    this.$refs.table.refresh(true)
-    this.pageInit()
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
-  }
-}
-</script>
-
-<style lang="less">
-  .salesReturnCheck-wrap{
-    position: relative;
-    height: 100%;
-    padding-bottom: 51px;
-    box-sizing: border-box;
-    >.ant-spin-nested-loading{
-      overflow-y: scroll;
-      height: 100%;
-    }
-    .salesReturnCheck-cont{
-      margin-top: 10px;
-      .sTable{
-        margin-top: 10px;
-      }
-      .total-bar{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        > div{
-          &:last-child{
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            > div{
-              padding: 0 10px;
-            }
-          }
-        }
-      }
-    }
-  }
-</style>

+ 0 - 375
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -1,375 +0,0 @@
-<template>
-  <div class="salesReturnEdit-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back" >
-        <!-- 自定义的二级文字标题 -->
-        <template slot="subTitle">
-          <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
-        </template>
-      </a-page-header>
-      <a-card size="small" :bordered="false" class="salesReturnEdit-cont" v-show="ordeDetail&&ordeDetail.salesReturnBillSource=='SALES'">
-        <!-- 查询配件列表 -->
-        <queryPart ref="partQuery" :newLoading="isInster" @add="saveProduct"></queryPart>
-      </a-card>
-      <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
-        <div style="position: relative;width: 100%;">
-          <!-- alert -->
-          <a-alert style="margin-bottom: 10px;width: 80%;" type="info">
-            <div slot="message" class="total-bar">
-              <div>
-                <span v-if="$hasPermissions('B_isShowPrice')">退货总金额:{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? ordeDetail.totalAmount : '--' }}元;</span>
-                <span>退货总数量:{{ ordeDetail&&(ordeDetail.totalQty || ordeDetail.totalQty==0) ? ordeDetail.totalQty : '--' }};</span>
-              </div>
-            </div>
-          </a-alert>
-          <div style="position: absolute;right: 0;top: 3px;">
-            <a-button size="small" type="primary" class="button-info" id="salesReturnEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
-          </div>
-        </div>
-        <!-- 已选配件列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :data="loadData"
-          :defaultLoadData="false"
-          :scroll="{ y: 300 }"
-          bordered>
-          <!-- 本次退货数量 -->
-          <template slot="qty" slot-scope="text, record">
-            <a-input-number
-              id="salesReturn-qty"
-              size="small"
-              v-model="record.qty"
-              :precision="0"
-              :min="0"
-              :max="999999"
-              placeholder="请输入"
-              @blur="e => onCellBlur(e.target.value, record, 'qty')"
-              style="width: 100%;" />
-          </template>
-          <!-- 退货单价 -->
-          <template slot="price" slot-scope="text, record">
-            <a-input-number
-              id="salesReturn-price"
-              size="small"
-              v-model="record.price"
-              :precision="2"
-              :min="0"
-              :max="999999"
-              placeholder="请输入"
-              @blur="e => onCellBlur(e.target.value, record, 'price')"
-              style="width: 100%;" />
-          </template>
-          <!-- 退货原因 -->
-          <template slot="remark" slot-scope="text, record">
-            <a-input size="small" placeholder="30个字符内" :maxLength="30" v-model.trim="record.remark" @blur="updateRemark(record)"></a-input>
-          </template>
-          <!-- 操作 -->
-          <template slot="action" slot-scope="text, record">
-            <a-button
-              size="small"
-              type="link"
-              :loading="delLoading"
-              class="button-error"
-              @click="handleDel(record)"
-              id="salesReturn-Del">删除</a-button>
-          </template>
-        </s-table>
-      </a-card>
-    </a-spin>
-    <div class="affix-cont">
-      <a-button
-        size="large"
-        style="padding: 0 60px;"
-        :disabled="spinning"
-        type="primary"
-        class="button-primary"
-        @click="handleSubmit()"
-        id="salesReturn-handleSubmit">提交</a-button>
-    </div>
-    <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn, grabFlag: ordeDetail.grabFlag}" @close="closeGuideModel" @ok="hanldeOk" />
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
-import ImportGuideModal from './importGuideModal.vue'
-import queryPart from './queryPart.vue'
-import EditableCell from '@/views/common/editInput.js'
-import { salesReturnDetail, salesReturnSubmit, salesReturnBatchInsert } from '@/api/salesReturn'
-import {
-  salesReturnDetailList,
-  salesReturnDetailDel,
-  salesReturnDetailInsert,
-  salesReturnDetailUpdateQty,
-  salesReturnDetailUpdateReason
-} from '@/api/salesReturnDetail'
-export default {
-  name: 'SalesReturnEdit',
-  mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect,
-    queryPart,
-    EditableCell,
-    ImportGuideModal
-  },
-  data () {
-    return {
-      spinning: false,
-      orderId: null,
-      orderSn: null,
-      buyerSn: null,
-      disabled: false,
-      isInster: false, // 是否正在添加产品
-      ordeDetail: { discountAmount: 0 },
-      delLoading: false,
-      // 已选产品
-      dataSource: [],
-      productForm: {
-        salesReturnBillSn: ''
-      },
-      chooseLoadData: [],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // 查询总计
-        this.productForm.salesReturnBillSn = this.$route.params.sn
-        return salesReturnDetailList(Object.assign(parameter, this.productForm)).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
-              data.list[i].qtyBackups = data.list[i].qty
-              data.list[i].priceBackups = data.list[i].price
-            }
-            this.disabled = false
-            this.chooseLoadData = data.list
-          }
-          return data
-        })
-      },
-      openGuideModal: false //  导入产品引导
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
-        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'qty', align: 'center', width: '8%', scopedSlots: { customRender: 'qty' } },
-        // { title: '退货单价', dataIndex: 'price', align: 'center', width: '8%', scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
-        // { title: '退货小计', align: 'center', dataIndex: 'totalAmount', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', align: 'center', width: '13%', scopedSlots: { customRender: 'remark' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ]
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(4, 0, { title: '退货单价', dataIndex: 'price', align: 'center', width: '8%', scopedSlots: { customRender: 'price' } })
-        arr.splice(6, 0, { title: '退货小计', align: 'center', dataIndex: 'totalAmount', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      return arr
-    }
-  },
-  methods: {
-    //  返回
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/salesReturn/list', query: { closeLastOldTab: true } })
-    },
-    // 已选产品  blur
-    onCellBlur (val, record, type) {
-      let valBackups
-      if (type) {
-        if (type == 'qty') {
-          valBackups = record.qtyBackups
-        } else if (type == 'price') {
-          valBackups = record.priceBackups
-        }
-      }
-      //  光标移出,值发生改变再调用编辑接口
-      if (val && val != valBackups) {
-        this.spinning = true
-        salesReturnDetailUpdateQty({
-          salesReturnDetailSn: record.salesReturnDetailSn,
-          qty: record.qty,
-          price: record.price
-        }).then(res => {
-          if (res.status == 200) {
-            this.resetSearchForm(true)
-            this.$message.success(res.message)
-            this.spinning = false
-          } else {
-            this.spinning = false
-          }
-        })
-      } else {
-        if (type == 'qty') {
-          record.qty = valBackups
-        } else if (type == 'price') {
-          record.price = valBackups
-        }
-      }
-    },
-    // 修改退货原因
-    updateRemark (row) {
-      this.spinning = true
-      salesReturnDetailUpdateReason({
-        salesReturnDetailSn: row.salesReturnDetailSn,
-        remark: row.remark
-      }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm(true)
-          this.$message.success(res.message)
-        }
-        this.spinning = false
-      })
-    },
-    // 重置列表
-    resetForm () {
-      this.$refs.table.refresh(true)
-    },
-    // 获取单据详细
-    getOrderDetail () {
-      salesReturnDetail({ sn: this.orderSn }).then(res => {
-        this.ordeDetail = res.data || null
-      })
-    },
-    // 删除产品
-    handleDel (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要删除吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.delLoading = true
-          _this.spinning = true
-          salesReturnDetailDel({ salesReturnDetailSn: row.salesReturnDetailSn }).then(res => {
-            if (res.status == 200) {
-              _this.resetSearchForm(true)
-            }
-            _this.$message.info(res.message)
-            _this.delLoading = false
-            _this.spinning = false
-          })
-        }
-      })
-    },
-    //  重置
-    resetSearchForm (flag) {
-      this.$refs.table.refresh(!!flag)
-      this.getOrderDetail()
-    },
-    // 添加或修改产品
-    saveProduct (row) {
-      console.log(row)
-      // 防止多次添加产品
-      if (this.isInster) {
-        return
-      }
-      this.isInster = true
-      const params = {
-        'salesReturnBillSn': this.orderSn,
-        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
-        'price': row.productPrice,
-        'cost': row.lastStockCost,
-        'productSn': row.productSn,
-        'qty': row.qty
-      }
-      this.spinning = true
-      salesReturnDetailInsert(params).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm(true)
-          this.$message.success(res.message)
-        }
-        this.isInster = false
-        this.spinning = false
-      })
-    },
-    // 提交销售单
-    handleSubmit () {
-      this.spinning = true
-      salesReturnSubmit({ salesReturnBillSn: this.orderSn }).then(res => {
-        if (res.status == 200) {
-          this.handleBack()
-          this.$message.success(res.message)
-        }
-        this.spinning = false
-      })
-    },
-    closeGuideModel () {
-      this.openGuideModal = false
-    },
-    // 导入产品
-    hanldeOk (obj) {
-      salesReturnBatchInsert(obj).then(res => {
-        if (res.status == 200) {
-          this.$refs.table.refresh(true)
-          this.getOrderDetail()
-        }
-      })
-    },
-    pageInit () {
-      this.orderSn = this.$route.params.sn
-      this.buyerSn = this.$route.params.buyerSn
-      this.resetSearchForm(true)
-      this.$refs.partQuery.pageInit(this.buyerSn, 0)
-    }
-  },
-  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">
-  .salesReturnEdit-wrap{
-    position: relative;
-    height: 100%;
-    padding-bottom: 51px;
-    box-sizing: border-box;
-    >.ant-spin-nested-loading{
-      overflow-y: scroll;
-      height: 100%;
-    }
-    .salesReturnEdit-cont{
-      margin-top: 10px;
-      .total-bar{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        > div{
-          &:last-child{
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            > div{
-              padding: 0 10px;
-            }
-          }
-        }
-      }
-    }
-  }
-</style>

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

@@ -1,378 +0,0 @@
-<template>
-  <div class="salesReturnEdit-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back" >
-        <!-- 自定义的二级文字标题 -->
-        <template slot="subTitle">
-          <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
-        </template>
-      </a-page-header>
-      <a-card size="small" :bordered="false" class="salesReturnEdit-cont" v-show="ordeDetail&&ordeDetail.salesReturnBillSource=='SALES'">
-        <!-- 查询配件列表 -->
-        <queryPart ref="queryPart" :newLoading="isInster" @add="saveProduct"></queryPart>
-      </a-card>
-      <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
-        <div style="position: relative;width: 100%;">
-          <!-- alert -->
-          <a-alert style="margin-bottom: 10px;width:80%;" type="info">
-            <div slot="message" class="total-bar">
-              <div>
-                <span v-if="$hasPermissions('B_isShowPrice')">退货总金额:<strong>{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? ordeDetail.totalAmount : '--' }}</strong>元;</span>
-                <span>退货总数量:<strong>{{ ordeDetail&&(ordeDetail.totalQty || ordeDetail.totalQty==0) ? ordeDetail.totalQty : '--' }}</strong>;</span>
-              </div>
-            </div>
-          </a-alert>
-          <div style="position: absolute;right: 0;top: 3px;">
-            <a-button size="small" type="primary" class="button-info" id="salesReturnEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
-          </div>
-        </div>
-        <!-- 已选配件列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :data="loadData"
-          :defaultLoadData="false"
-          :scroll="{ y: 300 }"
-          bordered>
-          <!-- 本次退货数量 -->
-          <template slot="qty" slot-scope="text, record">
-            <a-input-number
-              id="salesReturn-qty"
-              size="small"
-              v-model="record.qty"
-              :precision="0"
-              :min="0"
-              :max="999999"
-              placeholder="请输入"
-              @blur="e => onCellBlur(e.target.value, record, 'qty')"
-              style="width: 100%;" />
-          </template>
-          <!-- 退货单价 -->
-          <template slot="price" slot-scope="text, record">
-            <a-input-number
-              id="salesReturn-price"
-              size="small"
-              v-model="record.price"
-              :precision="2"
-              :min="0"
-              :max="999999"
-              placeholder="请输入"
-              @blur="e => onCellBlur(e.target.value, record, 'price')"
-              style="width: 100%;" />
-          </template>
-          <!-- 退货原因 -->
-          <template slot="remark" slot-scope="text, record">
-            <a-input
-              size="small"
-              placeholder="30个字符内"
-              :maxLength="30"
-              v-model.trim="record.remark"
-              @blur="updateRemark(record)"
-              style="width: 100%;"></a-input>
-          </template>
-          <!-- 操作 -->
-          <template slot="action" slot-scope="text, record">
-            <a-button
-              size="small"
-              type="link"
-              :loading="delLoading"
-              class="button-error"
-              @click="handleDel(record)"
-              id="salesReturn-Del">删除</a-button>
-          </template>
-        </s-table>
-      </a-card>
-    </a-spin>
-    <div class="affix-cont">
-      <a-button
-        size="large"
-        style="padding: 0 60px;"
-        :disabled="spinning"
-        type="primary"
-        class="button-primary"
-        @click="handleSubmit()"
-        id="salesReturn-handleSubmit">提交</a-button>
-    </div>
-    <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn, grabFlag: ordeDetail&&ordeDetail.grabFlag || ''}" @close="openGuideModal=false" @ok="hanldeOk" />
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
-import ImportGuideModal from './importGuideModal.vue'
-import queryPart from './queryPart.vue'
-import EditableCell from '@/views/common/editInput.js'
-import { salesReturnDetail, salesReturnSubmit, salesReturnBatchInsert } from '@/api/salesReturn'
-import { salesReturnDetailList, salesReturnDetailDel, salesReturnDetailInsert, salesReturnDetailUpdateQty, salesReturnDetailUpdateReason } from '@/api/salesReturnDetail'
-export default {
-  name: 'SalesReturnGrabEdit',
-  mixins: [commonMixin],
-  components: { STable, VSelect, queryPart, EditableCell, ImportGuideModal },
-  data () {
-    return {
-      spinning: false,
-      orderId: null,
-      orderSn: null,
-      buyerSn: null,
-      disabled: false,
-      isInster: false, // 是否正在添加产品
-      ordeDetail: null,
-      delLoading: false,
-      // 已选产品
-      dataSource: [],
-      productForm: {
-        salesReturnBillSn: ''
-      },
-      chooseLoadData: [],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // 查询总计
-        this.productForm.salesReturnBillSn = this.$route.params.sn
-        return salesReturnDetailList(Object.assign(parameter, this.productForm)).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
-              data.list[i].qtyBackups = data.list[i].qty
-              data.list[i].priceBackups = data.list[i].price
-            }
-            this.disabled = false
-            this.chooseLoadData = data.list
-          }
-          return data
-        })
-      },
-      openGuideModal: false //  导入产品引导
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
-        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '14%', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '剩余可退数量', dataIndex: 'refundableQty', align: 'center', width: '9%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次退货数量', dataIndex: 'qty', align: 'center', width: '9%', scopedSlots: { customRender: 'qty' } },
-        // { title: '退货单价', dataIndex: 'price', align: 'center', width: '8%', scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
-        // { title: '退货小计', align: 'center', width: '8%', dataIndex: 'totalAmount', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', align: 'center', width: '10%', scopedSlots: { customRender: 'remark' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ]
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(6, 0, { title: '退货单价', dataIndex: 'price', align: 'center', width: '8%', scopedSlots: { customRender: 'price' } })
-        arr.splice(8, 0, { title: '退货小计', align: 'center', width: '8%', dataIndex: 'totalAmount', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      return arr
-    }
-  },
-  methods: {
-    //  返回
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/salesReturn/list', query: { closeLastOldTab: true } })
-    },
-    // 已选产品  blur
-    onCellBlur (val, record, type) {
-      let valBackups
-      if (type) {
-        if (type == 'qty') {
-          valBackups = record.qtyBackups
-        } else if (type == 'price') {
-          valBackups = record.priceBackups
-        }
-      }
-      //  光标移出,值发生改变再调用编辑接口
-      if (val && val != valBackups) {
-        if (Number(record.qty) > Number(record.refundableQty)) {
-          this.$message.info('本次退货数量不可大于剩余可退数量')
-          record.qty = record.qtyBackups
-          record.price = record.priceBackups
-        } else {
-          this.spinning = true
-          const params = {
-            salesReturnDetailSn: record.salesReturnDetailSn,
-            qty: record.qty,
-            price: record.price
-          }
-          this.setFun(params)
-        }
-      } else {
-        if (type == 'qty') {
-          record.qty = valBackups
-        } else if (type == 'price') {
-          record.price = valBackups
-        }
-      }
-    },
-    setFun (params) {
-      salesReturnDetailUpdateQty(params).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm(true)
-          this.$message.success(res.message)
-        }
-        this.spinning = false
-      })
-    },
-    // 修改退货原因
-    updateRemark (row) {
-      this.spinning = true
-      salesReturnDetailUpdateReason({
-        salesReturnDetailSn: row.salesReturnDetailSn,
-        remark: row.remark
-      }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm(true)
-          this.$message.success(res.message)
-        }
-        this.spinning = false
-      })
-    },
-    // 获取单据详细
-    getOrderDetail () {
-      salesReturnDetail({ sn: this.$route.params.sn }).then(res => {
-        this.ordeDetail = res.data || null
-      })
-    },
-    // 删除产品
-    handleDel (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要删除吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.delLoading = true
-          _this.spinning = true
-          salesReturnDetailDel({ salesReturnDetailSn: row.salesReturnDetailSn }).then(res => {
-            if (res.status == 200) {
-              _this.resetSearchForm(true)
-            }
-            _this.$message.info(res.message)
-            _this.delLoading = false
-            _this.spinning = false
-          })
-        }
-      })
-    },
-    //  重置
-    resetSearchForm (flag) {
-      this.$refs.table.refresh(!!flag)
-      this.getOrderDetail()
-    },
-    // 添加或修改产品
-    saveProduct (row) {
-      // 防止多次添加产品
-      if (this.isInster) {
-        return
-      }
-      this.isInster = true
-      const params = {
-        'salesReturnBillSn': this.orderSn,
-        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
-        'salesBillSn': row.salesBillSn,
-        'salesBillNo': row.salesBillNo,
-        'refundableQty': row.refundableQty,
-        'salesBillDetailSn': row.salesBillDetailSn,
-        'price': row.price,
-        'cost': row.showCost,
-        'productSn': row.productSn,
-        'productCode': row.productEntity.code,
-        'qty': row.qty
-      }
-      this.spinning = true
-      salesReturnDetailInsert(params).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm(true)
-          this.$message.success(res.message)
-          this.$refs.queryPart.refreshData()
-        }
-        this.isInster = false
-        this.spinning = false
-      })
-    },
-    // 提交销售单
-    handleSubmit () {
-      this.spinning = true
-      salesReturnSubmit({ salesReturnBillSn: this.orderSn }).then(res => {
-        if (res.status == 200) {
-          this.handleBack()
-          this.$message.success(res.message)
-        }
-        this.spinning = false
-      })
-    },
-    // 导入产品
-    hanldeOk (obj) {
-      salesReturnBatchInsert(obj).then(res => {
-        if (res.status == 200) {
-          this.$refs.table.refresh(true)
-          this.getOrderDetail()
-        }
-      })
-    },
-    pageInit () {
-      this.orderSn = this.$route.params.sn
-      this.buyerSn = this.$route.params.buyerSn
-      this.getOrderDetail()
-      this.$refs.table.refresh(true)
-      this.$refs.queryPart.pageInit(this.buyerSn, 1)
-    }
-  },
-  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">
-  .salesReturnEdit-wrap{
-    position: relative;
-    height: 100%;
-    padding-bottom: 51px;
-    box-sizing: border-box;
-    >.ant-spin-nested-loading{
-      overflow-y: scroll;
-      height: 100%;
-    }
-    .salesReturnEdit-cont{
-      margin-top: 10px;
-      .total-bar{
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        > div{
-          &:last-child{
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            > div{
-              padding: 0 10px;
-            }
-          }
-        }
-      }
-    }
-  }
-</style>

+ 27 - 7
src/views/salesManagement/stockPrint/list.vue

@@ -152,6 +152,17 @@
         <sendTypeModal ref="typePrint" :openModal="showTipModal" @ok="handlePrintOk" @close="showTipModal=false" />
         <!-- 打印记录 -->
         <recordModal ref="recordModal" modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
+        <!-- 查看销售单或备货单详情 -->
+        <commonModal
+          :modalTit="detailType?'备货单详情':'销售单详情'"
+          bodyPadding="10px"
+          width="70%"
+          :showFooter="false"
+          :openModal="showDetailModal"
+          @cancel="cancelDetail">
+          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+        </commonModal>
       </a-spin>
     </a-card>
   </div>
@@ -166,17 +177,23 @@ import Area from '@/views/common/area.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import sendTypeModal from '@/views/salesManagement/pushOrderManagement/sendTypeModal.vue'
 import recordModal from './recordModal.vue'
+import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
+import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import { dispatchlList, dispatchDetailPrint } from '@/api/dispatch'
 import { printFun } from '@/libs/JGPrint.js'
 export default {
   name: 'StockPrintList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, sendTypeModal, recordModal, Area },
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, sendTypeModal, recordModal, Area, commonModal, salesDetail, dispatchDetail },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      showDetailModal: false,
+      detailType: 2,
+      bizSn: null,
       tableHeight: 0,
       time: [],
       currentTab: 2,
@@ -235,6 +252,7 @@ export default {
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '允许打印时间', dataIndex: 'allowPrintTime', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center', fixed: 'right' }
       ]
@@ -263,13 +281,15 @@ export default {
     shcustChange (val) {
       this.queryParam.receiverSn = val.key
     },
-    // 详情
     handleDetail (row, type) {
-      if (type == 0) {
-        this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn, type: 'pushOrder' } })
-      } else {
-        this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
-      }
+      this.detailType = type
+      this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
+      this.showDetailModal = true
+    },
+    cancelDetail () {
+      this.showDetailModal = false
+      this.detailType = 2
+      this.bizSn = null
     },
     // 发货分类打印
     handlePrint (row) {

+ 0 - 8
src/views/salesManagement/stockPrint/printStockClasList.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 3 - 0
src/views/salesManagement/waitDispatch/dsModal.vue

@@ -50,6 +50,9 @@
               <a-radio value="UNABLE_PRINT">
                 暂不打印
               </a-radio>
+              <a-radio value="CANCEL_PRINT">
+                取消打印
+              </a-radio>
             </a-radio-group>
           </a-form-model-item>
         </a-form-model>

+ 451 - 0
src/views/salesReturnManagement/billOfLading/add.vue

@@ -0,0 +1,451 @@
+<template>
+  <div class="billOfLadingEdit-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="billOfLadingEdit-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="billOfLadingEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
+      <a-form-model
+        id="billOfLadingEdit-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-card :bordered="false" class="billOfLadingEdit-cont">
+          <a-row>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="申请人" prop="applyPersonSn">
+                <employee style="width: 100%;" id="billOfLading-Employee" @change="employeeChange" v-model="form.applyPersonSn"></employee>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="主题" prop="theme">
+                <a-input
+                  id="billOfLadingEdit-theme"
+                  :maxLength="30"
+                  v-model.trim="form.theme"
+                  placeholder="请输入主题(最多30个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="物流公司">
+                <logisticsCompany
+                  id="billOfLadingEdit-logisticsCompany"
+                  ref="logisticsCompany"
+                  v-model.trim="form.logisticsCompany"
+                />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="物流点">
+                <logisticsPoint
+                  ref="logisticsPoint"
+                  id="billOfLadingEdit-logisticsPoint"
+                  v-model.trim="form.logisticsPoint"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="发货方">
+                <dealerSubareaScopeList placeholder="请输入经销商名称搜索" ref="dealerSubareaScopeList" id="billOfLadingEdit-senderName" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="收货人">
+                <a-input
+                  id="billOfLadingEdit-receiverName"
+                  :maxLength="30"
+                  v-model.trim="form.receiverName"
+                  placeholder="请输入收货人(最多30个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="电话">
+                <a-input
+                  id="billOfLadingEdit-receiverPhone"
+                  :maxLength="30"
+                  v-model.trim="form.receiverPhone"
+                  placeholder="请输入电话(最多30个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="件数">
+                <a-input-number
+                  id="billOfLadingEdit-goodsNum"
+                  style="width:100%"
+                  v-model="form.goodsNum"
+                  :precision="0"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入件数"
+                />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item label="运费" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <a-input
+                  id="billOfLadingEdit-freight"
+                  :maxLength="100"
+                  v-model.trim="form.freight"
+                  placeholder="请输入运费(最多100个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row>
+            <a-col :spna="24">
+              <a-form-model-item style="margin-bottom:0" label="备注" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <a-textarea
+                  v-model.trim="form.remarks"
+                  id="billOfLadingEdit-remarks"
+                  :maxLength="500"
+                  allowClear
+                  placeholder="请输入备注(最多500个字符)" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :spna="24">
+              <a-form-model-item label="附件" help="说明:支持图片、word、excel、PDF等格式,最多10个附件。" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <Upload
+                  style="height: 100%;"
+                  id="billOfLadingEdit-attachList"
+                  v-model="form.attachmentList"
+                  ref="attachList"
+                  :fileSize="10"
+                  :maxNums="10"
+                  fileType="*"
+                  uploadType="attach"
+                  :action="attachAction"
+                  @change="changeAttach"
+                  upText="上传附件"></Upload>
+              </a-form-model-item>
+            </a-col>
+            <a-col :spna="24">
+              <a-form-model-item label="关联销退单" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <a-button type="primary" class="button-primary" @click="openSelModal">选择销退单</a-button>
+                <div style="margin-top:10px;">
+                  <a-table :columns="columns" :scroll="{ y: 400 }" :pagination="false" :data-source="chooseData" bordered>
+                    <!-- 编号 -->
+                    <template slot="no" slot-scope="text, record,index">
+                      <span>{{ index+1 }}</span>
+                    </template>
+                    <!-- 单号 -->
+                    <template slot="salesReturnNo" slot-scope="text, record">
+                      <span>{{ record.salesReturnBillNo }}</span>
+                    </template>
+                    <!-- 操作 -->
+                    <template slot="action" slot-scope="text, record">
+                      <a-button
+                        size="small"
+                        type="link"
+                        class="button-error"
+                        @click="handleDel(record)"
+                      >
+                        删除
+                      </a-button>
+                    </template>
+                  </a-table>
+                </div>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </a-card>
+      </a-form-model>
+    </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        class="button-primary"
+        :disabled="spinning"
+        id="billOfLadingEdit-save-btn"
+        size="large"
+        @click="handleSave('save')"
+        style="padding: 0 60px;">保存</a-button>
+      <a-button
+        type="primary"
+        class="button-error"
+        :disabled="spinning"
+        id="billOfLadingEdit-submit-btn"
+        size="large"
+        @click="handleSave('submit')"
+        style="padding: 0 60px;">提交</a-button>
+    </div>
+    <!-- 关联销退单 -->
+    <selectXtModal
+      ref="selXtModal"
+      modalTit="选择销退单"
+      :chooseData="chooseData"
+      :openModal="showXtModal"
+      @cancel="showXtModal=false"></selectXtModal>
+    <!-- 选择审核人员 -->
+    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect, Upload } from '@/components'
+import { pickUpSave, pickUpSubmit, pickUpDetail, pickUpDetailQueryList } from '@/api/pickUp'
+import selectXtModal from './selectXtModal.vue'
+import employee from '../../expenseManagement/expenseReimbursement/employee.js'
+import logisticsCompany from './logisticsCompany.js'
+import logisticsPoint from './logisticsPoint'
+import chooseDepartUserModal from '../../expenseManagement/expenseReimbursement/chooseDepartUserModal.vue'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+export default {
+  name: 'ProductInfoEdit',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, STable, employee, dealerSubareaScopeList, chooseDepartUserModal, selectXtModal, logisticsCompany, logisticsPoint },
+  data () {
+    return {
+      spinning: false,
+      showXtModal: false,
+      openDepartUserModal: false,
+      pickUpSn: '',
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
+      form: {
+        applyPersonSn: undefined, // 申请人
+        applyPersonName: undefined,
+        theme: '关于提货事宜', //  主题
+        logisticsCompany: undefined, //  物流公司
+        logisticsPoint: undefined, //  物流点
+        senderName: '', //  发货方
+        senderSn: '',
+        receiverName: '', //  收货人
+        receiverPhone: '', // 电话
+        goodsNum: '', // 件数
+        freight: '', // 运费
+        remarks: '',
+        attachmentList: '' // 附件
+      },
+      attachList: [],
+      rules: {
+        applyPersonSn: [
+          { required: true, message: '请选择申请人', trigger: 'blur' }
+        ],
+        theme: [
+          { required: true, message: '请输入主题', trigger: 'blur' }
+        ]
+      },
+      chooseData: [],
+      columns: [
+        { title: '序号', scopedSlots: { customRender: 'no' }, width: '8%', align: 'center' },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnNo' }, width: '15%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ]
+    }
+  },
+  methods: {
+    custChange (val) {
+      this.form.senderSn = val.key
+      this.form.senderName = val.name
+    },
+    // 申请人员
+    employeeChange (v, r) {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.validateField(['applyPersonSn'])
+      })
+    },
+    openSelModal () {
+      this.showXtModal = true
+    },
+    // 关联销售退货单
+    getReturnOrderList () {
+      pickUpDetailQueryList({ pickUpSn: this.$route.params.sn }).then(res => {
+        this.chooseData = []
+        res.data.map(item => {
+          this.chooseData.push(item.salesReturnBillEntity)
+        })
+      })
+    },
+    //  详情
+    getDetail () {
+      this.spinning = true
+      this.disabled = true
+      pickUpDetail({ pickUpSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.form = Object.assign(this.form, data)
+          // 获取附件列表
+          this.form.attachmentList = ''
+          this.attachList = res.data.attachmentList
+          this.$refs.attachList.setFileList(this.attachList)
+          // 发货方
+          if (this.form.senderSn) {
+            this.$refs.dealerSubareaScopeList.getDetail(this.form.senderSn)
+          }
+          // 物流点
+          // if (this.form.logisticsPoint) {
+          //   const point = this.$refs.logisticsCompany.getPoint(this.form.logisticsCompany)
+          //   this.$refs.logisticsPoint.getList(point)
+          // }
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+        this.spinning = false
+        this.disabled = false
+      })
+    },
+    // 删除关联单
+    handleDel (row) {
+      const i = this.chooseData.findIndex(item => row.salesReturnBillNo == item.salesReturnBillNo)
+      this.chooseData.splice(i, 1)
+    },
+    // 获取关联单sn列表
+    getRtSnList () {
+      const ret = []
+      this.chooseData.map(item => {
+        ret.push({ salesReturnSn: item.salesReturnBillSn, salesReturnNo: item.salesReturnBillNo })
+      })
+      return ret
+    },
+    // 提交
+    handleSave (type) {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.attachmentList = _this.attachList
+          form.pickUpSalesReturnList = this.getRtSnList()
+          _this.spinning = true
+          pickUpSave(form).then(res => {
+            if (res.status == 200) {
+              // 保存
+              if (type == 'save') {
+                _this.$message.success(res.message)
+                _this.$router.push({ name: 'billOfLadingList' })
+                _this.spinning = false
+              }
+              // 提交
+              if (type == 'submit') {
+                _this.openDepartUserModal = true
+                _this.pickUpSn = res.data.pickUpSn
+              }
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 提交信息
+    handleSubmit (data) {
+      this.spinning = true
+      pickUpSubmit({ pickUpSn: this.$route.params.sn || this.pickUpSn, ...data }).then(res => {
+        if (res.status == '200') {
+          this.$message.success(res.message)
+          this.$router.push({ name: 'billOfLadingList' })
+        }
+        this.spinning = false
+      })
+    },
+    // 返回
+    handleBack () {
+      if (this.$route.query.path == 'salerReturn') {
+        this.$router.push({ name: 'salesReturnList' })
+      } else {
+        this.$router.push({ name: 'billOfLadingList' })
+      }
+    },
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
+    resetForm () {
+      this.form = {
+        applyPersonSn: undefined, // 申请人
+        applyPersonName: undefined,
+        theme: '关于提货事宜', //  主题
+        logisticsCompany: undefined, //  物流公司
+        logisticsPoint: undefined, //  物流点
+        senderName: '', //  发货方
+        senderSn: '',
+        receiverName: '', //  收货人
+        receiverPhone: '', // 电话
+        goodsNum: '', // 件数
+        freight: '', // 运费
+        remarks: '',
+        attachmentList: '' // 附件
+      }
+      this.attachList = []
+      this.$refs.attachList.setFileList('')
+      this.$refs.ruleForm.resetFields()
+    },
+    pageInit () {
+      this.resetForm()
+      console.log('----')
+      //  编辑页
+      if (this.$route.params.sn) {
+        this.form.theme = ''
+        this.getDetail()
+        this.getReturnOrderList()
+      } else {
+        this.chooseData = []
+        // 从销售退货列表过来的数据
+        const cd = this.$store.state.app.tempBillOfData
+        if (cd && this.$route.query.path == 'salerReturn') {
+          this.chooseData.push(cd)
+        }
+      }
+    }
+  },
+  watch: {
+    '$store.state.app.tempBillOfData' (newValue, oldValue) {
+      this.pageInit()
+    }
+  },
+  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">
+  .billOfLadingEdit-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
+    .billOfLadingEdit-cont{
+      margin-bottom: 10px;
+    }
+    .affix{
+      .ant-affix{
+        z-index: 101;
+      }
+    }
+  }
+</style>

+ 342 - 0
src/views/salesReturnManagement/billOfLading/detail.vue

@@ -0,0 +1,342 @@
+<template>
+  <div class="billOfLadingDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="billOfLadingDetail-header" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="billOfLadingDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="default"
+            class="button-info"
+            v-if="$hasPermissions('B_printPickUp')"
+            id="billOfLadingDetail-preview-btn"
+            @click="handlePrint('preview')">打印预览</a-button>
+          <a-button
+            key="2"
+            type="primary"
+            class="button-info"
+            v-if="$hasPermissions('B_printPickUp')"
+            id="billOfLadingDetail-print-btn"
+            @click="handlePrint('print')">快捷打印</a-button>
+          <a-divider type="vertical" />
+          <a-button
+            key="1"
+            type="primary"
+            class="button-warning"
+            v-if="$hasPermissions('B_exportPickUp')"
+            id="billOfLadingDetail-export-btn"
+            @click="handlePrint('export')">导出Excel</a-button>
+        </template>
+      </a-page-header>
+      <a-form-model
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-card :bordered="false" class="billOfLadingDetail-cont" v-if="form">
+          <a-row>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="提货单号">
+                {{ form.pickUpNo||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="创建时间">
+                {{ form.createDate||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="审核时间">
+                {{ form.auditDate||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="状态">
+                {{ form.stateDictValue||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="申请人">
+                {{ form.applyPersonName||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="主题">
+                {{ form.theme||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="物流公司">
+                {{ form.logisticsCompany||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="物流点">
+                {{ form.logisticsPoint }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="发货方">
+                {{ form.dealerEntity&&form.dealerEntity.dealerName||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="收货人">
+                {{ form.receiverName||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="电话">
+                {{ form.receiverPhone||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item style="margin-bottom:0" label="件数">
+                {{ form.goodsNum||'--' }} 件
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item style="margin-bottom:0" label="运费" :label-col="{span:2}" :wrapper-col="{span:20}">
+                {{ form.freight||'--' }}
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row>
+            <a-col :spna="24">
+              <a-form-model-item style="margin-bottom:0" label="备注" prop="size" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <div style="word-break: break-all;line-height:normal;padding-top:10px;">{{ form.remarks||'--' }}</div>
+              </a-form-model-item>
+            </a-col>
+            <a-col :spna="24">
+              <a-form-model-item style="margin-bottom:10px" label="附件" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <div style="line-height:26px;">
+                  <div v-for="item in form.attachmentList" :key="item.id">
+                    <a :href="item.filePath">{{ item.fileName }}</a>
+                  </div>
+                </div>
+              </a-form-model-item>
+            </a-col>
+            <a-col :spna="24">
+              <a-form-model-item label="关联销退单" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <a-table :columns="columns" :scroll="{ y: 400 }" :pagination="false" :data-source="chooseData" bordered>
+                  <!-- 编号 -->
+                  <template slot="no" slot-scope="text, record,index">
+                    <span>{{ index+1 }}</span>
+                  </template>
+                  <!-- 单号 -->
+                  <template slot="salesReturnBillNo" slot-scope="text, record">
+                    <span>{{ record.salesReturnBillNo }}</span>
+                  </template>
+                </a-table>
+              </a-form-model-item>
+            </a-col>
+            <a-col :spna="24" v-if="$hasPermissions('B_auditPickUp')&&form.state != 'WAIT_SUBMIT'">
+              <a-form-model-item label="审核进度" :label-col="{span:2}" :wrapper-col="{span:20}">
+                <div>以下信息来自钉钉</div>
+                <s-table
+                  class="sTable fixPagination"
+                  ref="table"
+                  size="small"
+                  :rowKey="(record) => record.id"
+                  :columns="auditColumns"
+                  :data="loadData"
+                  :scroll="{ y: 400 }"
+                  :showPagination="false"
+                  :defaultLoadData="false"
+                  bordered>
+                </s-table>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </a-card>
+      </a-form-model>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect, Upload } from '@/components'
+import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import { pickUpDetail, pickUpDetailQueryList, pickUpExport, pickUpDetailPrint } from '@/api/pickUp'
+import { getProcessInstance } from '@/api/expenseManagement'
+export default {
+  name: 'ProductInfoEdit',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, STable },
+  data () {
+    return {
+      spinning: false,
+      showXtModal: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        applyPersonSn: undefined, // 申请人
+        applyPersonName: undefined,
+        theme: '', //  主题
+        logisticsCompany: undefined, //  物流公司
+        logisticsPoint: undefined, //  物流点
+        senderName: '', //  发货方
+        senderSn: '',
+        receiverName: '', //  收货人
+        receiverPhone: '', // 电话
+        goodsNum: '', // 件数
+        freight: '', // 运费
+        remarks: '',
+        attachmentList: [] // 附件
+      },
+      rules: {},
+      chooseData: [],
+      columns: [
+        { title: '序号', scopedSlots: { customRender: 'no' }, width: '8%', align: 'center' },
+        { title: '总部销退单号', dataIndex: 'salesReturnBillNo', width: '15%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      auditData: [],
+      auditColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text != '0' ? '请在钉钉中查看附件内容' : '--' } },
+        { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return getProcessInstance({ businessType: 'PICK_UP', businessSn: this.$route.params.sn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
+          } else {
+            this.isShow = false
+            return []
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      const params = { pickUpSn: this.$route.params.sn }
+      _this.spinning = true
+      // 导出
+      if (type == 'export') {
+        exportExcel(pickUpExport, params, '提货单', function () {
+          _this.spinning = false
+        })
+      } else {
+        // 打印或预览
+        printFun(pickUpDetailPrint, params, type, '提货单', () => { _this.spinning = false })
+      }
+    },
+    // 关联销售退货单
+    getReturnOrderList () {
+      pickUpDetailQueryList({ pickUpSn: this.$route.params.sn }).then(res => {
+        this.chooseData = []
+        res.data.map(item => {
+          this.chooseData.push(item.salesReturnBillEntity)
+        })
+      })
+    },
+    //  详情
+    getDetail () {
+      this.spinning = true
+      this.disabled = true
+      pickUpDetail({ pickUpSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.form = Object.assign(this.form, data)
+          if (this.form.state != 'WAIT_SUBMIT') {
+            this.$refs.table.refresh()
+          }
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+        this.spinning = false
+        this.disabled = false
+      })
+    },
+    // 返回
+    handleBack () {
+      // this.$router.push({ name: 'billOfLadingList' })
+      this.$router.go(-1)
+    },
+    pageInit () {
+      this.form = {
+        applyPersonSn: undefined, // 申请人
+        applyPersonName: undefined,
+        theme: '', //  主题
+        logisticsCompany: undefined, //  物流公司
+        logisticsPoint: undefined, //  物流点
+        senderName: '', //  发货方
+        senderSn: '',
+        receiverName: '', //  收货人
+        receiverPhone: '', // 电话
+        goodsNum: '', // 件数
+        freight: '', // 运费
+        remarks: '',
+        attachmentList: [] // 附件
+      }
+      this.$refs.ruleForm.resetFields()
+      if (this.$route.params.sn) { //  编辑页
+        this.getDetail()
+        this.getReturnOrderList()
+      }
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .billOfLadingDetail-wrap{
+    position: relative;
+    height: 100%;
+    background-color:#fff;
+    .billOfLadingDetail-cont{
+      height:100%;
+      overflow: auto;
+    }
+    .billOfLadingDetail-header{
+      border-bottom: 8px solid #eee;
+    }
+    .affix{
+      .ant-affix{
+        z-index: 101;
+      }
+    }
+  }
+</style>

+ 370 - 0
src/views/salesReturnManagement/billOfLading/list.vue

@@ -0,0 +1,370 @@
+<template>
+  <a-card size="small" :bordered="false" class="billOfLading-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="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="提货单号">
+                <a-input id="billOfLading-pickUpNo" v-model.trim="queryParam.pickUpNo" allowClear placeholder="请输入提货单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关联销退单号">
+                <a-input id="billOfLading-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="申请人">
+                <employee style="width: 100%;" id="billOfLading-Employee" v-model="queryParam.applyPersonSn"></employee>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="物流点">
+                  <a-input id="billOfLading-logisticsPoint" v-model.trim="queryParam.logisticsPoint" allowClear placeholder="请输入物流点"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="发货方">
+                  <dealerSubareaScopeList placeholder="请输入客户名称搜索" ref="dealerSubareaScopeList" id="billOfLading-senderSn" @change="custChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="审核时间">
+                  <rangeDate ref="rangeExamineDate" @change="dateExamineChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="状态">
+                  <v-select
+                    v-model="queryParam.state"
+                    ref="state"
+                    id="billOfLading-state"
+                    code="PICK_UP_STATE"
+                    placeholder="请选择状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :offset="18" :sm="24">
+              <span class="table-page-search-submitButtons" style="float:right;">
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_newPickUp')" @click="handleAdd">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+64.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 单号 -->
+        <template slot="pickUpNo" slot-scope="text, record">
+          <div v-if="$hasPermissions('M_detailPickUp')">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.pickUpNo }}</span>
+          </div>
+          <div v-else>{{ record.pickUpNo }}</div>
+        </template>
+        <!-- 关联单数 -->
+        <template slot="salesReturnNum" slot-scope="text, record">
+          <div v-if="record.salesReturnNum">{{ record.salesReturnNum }} 单</div>
+          <div v-else></div>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_auditPickUp')"
+            @click="handleEexamine(record)"
+            id="billOfLading-eexamine-btn">审核进度</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            v-if="record.state == 'AUDIT_REJECT'&&$hasPermissions('B_asginEditPickUp')"
+            @click="handleAgainEdit(record)"
+            id="billOfLading-eexamine-btn">再次编辑</a-button>
+          <a-button
+            size="small"
+            v-if="record.state == 'WAIT_SUBMIT'&&$hasPermissions('B_editPickUp')"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="billOfLading-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            v-if="record.state == 'WAIT_SUBMIT'&&$hasPermissions('B_delPickUp')"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="billOfLading-del-btn">删除</a-button>
+          <span v-if="record.state == 'AUDIT_PASS'">
+            --
+          </span>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 审核进度 -->
+    <verifyModal :openModal="visibleAudit" :itemSn="auditInfo&&auditInfo.pickUpSn" @close="visibleAudit=false"></verifyModal>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import employee from '../../expenseManagement/expenseReimbursement/employee.js'
+import verifyModal from './verifyModal.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { pickUpQueryPage, pickUpDelete, pickUpAgainEdit } from '@/api/pickUp'
+export default {
+  name: 'BillOfLadingList',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    dealerSubareaScopeList,
+    employee,
+    rangeDate,
+    verifyModal
+  },
+  data () {
+    return {
+      spinning: false,
+      // 高级搜索 展开/关闭
+      advanced: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      createDate: [], //  创建时间
+      // 查询参数
+      queryParam: {
+        beginDate: '',
+        endDate: '',
+        auditBeginDate: '',
+        auditEndDate: '',
+        pickUpNo: '', // 提货单号
+        applyPersonSn: undefined, // 申请人
+        salesReturnBillNo: undefined, //  总部销退单号
+        logisticsPoint: undefined, // 物流点
+        senderSn: undefined, //  发货人
+        state: undefined // 业务状态
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return pickUpQueryPage(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
+        })
+      },
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提货单号', scopedSlots: { customRender: 'pickUpNo' }, width: '10%', align: 'center' },
+        { title: '关联销退单', dataIndex: 'salesReturnNum', scopedSlots: { customRender: 'salesReturnNum' }, width: '6%', align: 'center' },
+        { title: '申请人', dataIndex: 'applyPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '主题', dataIndex: 'theme', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '物流公司', dataIndex: 'logisticsCompany', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '物流点', dataIndex: 'logisticsPoint', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货方', dataIndex: 'dealerEntity.dealerName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货人', dataIndex: 'receiverName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '运费', dataIndex: 'freight', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateCreateChange (date) {
+      this.queryParam.beginDate = date[0] ? (date[0] + ' 00:00:00') : ''
+      this.queryParam.endDate = date[1] ? (date[1] + ' 23:59:59') : ''
+    },
+    //  审核时间  change
+    dateExamineChange (date) {
+      this.queryParam.auditBeginDate = date[0] ? (date[0] + ' 00:00:00') : ''
+      this.queryParam.auditEndDate = date[1] ? (date[1] + ' 23:59:59') : ''
+    },
+    custChange (val) {
+      this.queryParam.senderSn = val.key
+    },
+    // 新增
+    handleAdd () {
+      this.$store.state.app.tempBillOfData = null
+      this.$router.push({ name: 'billOfLadingAdd' })
+    },
+    // 编辑
+    handleEdit (row) {
+      this.$router.push({ name: 'billOfLadingEdit', params: { sn: row.pickUpSn } })
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'billOfLadingDetail', params: { sn: row.pickUpSn } })
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          pickUpDelete({ pickUpSn: row.pickUpSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  审核进度
+    handleEexamine (row) {
+      this.auditInfo = row
+      this.visibleAudit = true
+    },
+    // 再次编辑
+    handleAgainEdit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '系统将自动生成一个新的提货单,与原单据内容相同。确认再次编辑吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          pickUpAgainEdit({ pickUpSn: row.pickUpSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    resetSearchForm () {
+      this.$refs.rangeCreateDate.resetDate()
+      if (this.advanced) {
+        this.$refs.rangeExamineDate.resetDate()
+        this.$refs.dealerSubareaScopeList.resetForm()
+      }
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
+      this.queryParam.pickUpNo = ''
+      this.queryParam.senderSn = undefined
+      this.queryParam.applyPersonSn = undefined
+      this.queryParam.logisticsPoint = undefined
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.state = undefined
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 215
+    }
+  },
+  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">
+  .billOfLading-wrap{
+    .sTable{
+      .badge-con-t{
+        .ant-badge-count{
+          transform: scale(0.8);
+          font-size: 13px;
+        }
+      }
+    }
+  }
+</style>

+ 91 - 0
src/views/salesReturnManagement/billOfLading/logisticsCompany.js

@@ -0,0 +1,91 @@
+import { pickUpLogisticsList } from '@/api/pickUp'
+const LogisticsCompany = {
+  template: `
+      <a-select
+          allowClear
+          :size="size"
+          mode="combobox"
+          :value="defaultVal"
+          show-search
+          :placeholder="placeholder"
+          option-filter-prop="children"
+          style="width: 100%"
+          :filter-option="filterOption"
+          :dropdownMatchSelectWidth="false"
+          @change="onChange"
+          @blur="onBlur"
+          @focus="open=true"
+          @select="open=false"
+          :open="open"
+        >
+          <a-select-option v-for="item in list" :key="item.id" :value="item.logisticsCompany">
+            {{ item.logisticsCompany }}
+          </a-select-option>
+        </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder: {
+      type: String,
+      default: '请输入物流公司(最多50字符)'
+    },
+    size: {
+      type: String,
+      default: 'default'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: [],
+      open: false,
+    };
+  },
+  mounted() {
+    this.getList()
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    },
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    onChange(value) {
+      const ret = value?value.substr(0,50):''
+      this.defaultVal = ret;
+      this.$emit('change', ret);
+      this.$emit('input', ret);
+    },
+    onBlur(value){
+      this.open = false;
+      this.$emit('blur', value);
+    },
+    getList () {
+      pickUpLogisticsList({}).then(res => {
+        if (res.status == 200) {
+          this.list = res.data
+        } else {
+          this.list = []
+        }
+      })
+    },
+    getPoint(v){
+      const row = this.list.find(item => item.logisticsCompany == v)
+      return row ? row.logisticsPointList : []
+    }
+  },
+};
+
+export default LogisticsCompany

+ 100 - 0
src/views/salesReturnManagement/billOfLading/logisticsPoint.js

@@ -0,0 +1,100 @@
+import { pickUpPointList } from '@/api/pickUp'
+const LogisticsPoint = {
+  template: `
+      <a-select
+          allowClear
+          :size="size"
+          mode="combobox"
+          :value="defaultVal"
+          show-search
+          :placeholder="placeholder"
+          option-filter-prop="children"
+          style="width: 100%"
+          :filter-option="filterOption"
+          :dropdownMatchSelectWidth="false"
+          @change="onChange"
+          @blur="onBlur"
+          @focus="open=true"
+          @select="open=false"
+          :open="open"
+        >
+          <a-select-option v-for="item in list" :key="item" :value="item">
+            {{ item }}
+          </a-select-option>
+        </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder: {
+      type: String,
+      default: '请输入物流点(最多50字符)'
+    },
+    defLoad:{
+      type: Boolean,
+      default: true
+    },
+    size: {
+      type: String,
+      default: 'default'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: [],
+      open: false,
+    };
+  },
+  mounted() {
+    if(this.defLoad){
+      this.getList()
+    }
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    },
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    onChange(value) {
+      const ret = value?value.substr(0,50):''
+      this.defaultVal = ret;
+      this.$emit('change', ret);
+      this.$emit('input', ret);
+    },
+    onBlur(value){
+      this.open = false;
+      this.$emit('blur', value);
+    },
+    getList (data) {
+      if(!data){
+        pickUpPointList({}).then(res => {
+          if (res.status == 200) {
+            this.list = res.data
+          } else {
+            this.list = []
+          }
+        })
+      }else{
+        this.list = data
+      }
+    },
+    clearData(){
+      this.list = []
+    }
+  },
+};
+
+export default LogisticsPoint

+ 202 - 0
src/views/salesReturnManagement/billOfLading/selectXtModal.vue

@@ -0,0 +1,202 @@
+<template>
+  <a-modal
+    centered
+    class="collection-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
+    @cancel="isShow=false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="销退单号">
+                  <a-input v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入销退单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="客户名称">
+                  <dealerSubareaScopeList ref="dealerSubareaScopeList" id="billOfLadingEdit-buyerSn" @change="custChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 表格数据 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 400 }"
+          :pageSize="10"
+          bordered>
+          <!-- 收款单号 -->
+          <template slot="salesReturnBillNo" slot-scope="text, record">
+            {{ record.salesReturnBillNo }}
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div v-if="record.billStatus == 'WAIT_RECEIVE'">
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="!record.checked"
+                @click="handleChoose(record)"
+              >选择</a-button>
+              <span style="color:green;" v-else>已选</span>
+            </div>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { salesReturnList } from '@/api/salesReturn'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+export default {
+  name: 'GlDetailModal',
+  components: { STable, VSelect, dealerSubareaScopeList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    chooseData: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      handlePlData: [],
+      queryParam: {
+        salesReturnBillNo: '',
+        buyerSn: undefined
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '15%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ],
+      orginData: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return salesReturnList(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
+              const index = this.chooseData.findIndex(item => data.list[i].salesReturnBillNo == item.salesReturnBillNo)
+              data.list[i].checked = index >= 0
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          this.orginData = data.list
+          return data
+        })
+      },
+      snList: []
+    }
+  },
+  computed: {
+    totalAmount () {
+      let ret = 0
+      this.handlePlData.map(item => {
+        ret = ret + item.totalAmount
+      })
+      return ret.toFixed(2)
+    }
+  },
+  methods: {
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    // 删除
+    handleDel (row) {
+      const i = this.chooseData.findIndex(item => row.salesReturnBillNo == item.salesReturnBillNo)
+      this.chooseData.splice(i, 1)
+      const oi = this.orginData.findIndex(item => row.salesReturnBillNo == item.salesReturnBillNo)
+      if (oi >= 0) {
+        this.orginData[oi].checked = false
+      }
+    },
+    // 选择
+    handleChoose (row) {
+      row.checked = true
+      this.chooseData.push(row)
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam = {
+        salesReturnBillNo: '',
+        buyerSn: undefined
+      }
+      this.orginData = []
+      this.$refs.dealerSubareaScopeList.resetForm()
+      if (this.$refs.table) {
+        this.$refs.table.refresh(true)
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.handleCommonCancel()
+      } else {
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+
+</style>

+ 97 - 0
src/views/salesReturnManagement/billOfLading/verifyModal.vue

@@ -0,0 +1,97 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="提货单审核进度"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <p>说明:以下信息来自钉钉</p>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        :defaultLoadData="true"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { getProcessInstance } from '@/api/expenseManagement'
+export default {
+  name: 'VerifyModal',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text != '0' ? '请在钉钉中查看附件内容' : '--' } },
+        { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return getProcessInstance({ businessType: 'PICK_UP', businessSn: this.itemSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
+          } else {
+            this.isShow = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 537 - 0
src/views/salesReturnManagement/custConfirm/list.vue

@@ -0,0 +1,537 @@
+<template>
+  <div class="custConfirm-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="custConfirm-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="custConfirm-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="custConfirm-cont">
+        <a-form layout="inline" style="margin-bottom:10px;" @keyup.enter.native="searchForm">
+          <a-form-item label="产品编码">
+            <a-input id="custConfirm-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+          </a-form-item>
+          <a-form-item label="产品名称">
+            <a-input id="custConfirm-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+          </a-form-item>
+          <a-form-item>
+            <a-button type="primary" class="button-info" @click="searchForm" :disabled="disabled" id="custConfirm-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="custConfirm-reset">重置</a-button>
+          </a-form-item>
+        </a-form>
+        <div style="border-top:1px solid #eee;padding-top:10px;">
+          <a-button type="primary" :loading="loading" class="button-info" @click="openProductModal=true">新增产品</a-button>
+          <a-button type="primary" :loading="loading" class="button-error" @click="handlePlss">批量设置退货单价</a-button>
+          <a-button style="margin-left:5px;" :loading="loading" @click="openPlSetReason">批量设置退货原因</a-button>
+          <span style="margin-left:10px;" v-if="selNums">已选{{ selNums }}项</span>
+          <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+        </div>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          :rowClassName="(record, index) => record.addFlag == '1' ? (record.addType == 'WAREHOUSE_RECEIVE'?'redBg-row':'orgBg-row'):''"
+          size="small"
+          :rowKey="(record) => record.id"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 退货数量 -->
+          <template slot="qty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.isEdit"
+              size="small"
+              v-model="record.initialQty"
+              :precision="0"
+              :min="0"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>
+              {{ record.initialQty }}
+            </span>
+          </template>
+          <!-- 仓库实收数量 -->
+          <template slot="receiveQty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.isEdit"
+              size="small"
+              v-model="record.receiveQty"
+              :precision="0"
+              :min="0"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>
+              {{ record.receiveQty }}
+            </span>
+          </template>
+          <!-- 坏件数量 -->
+          <template slot="badQty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.isEdit"
+              size="small"
+              v-model="record.badQty"
+              :precision="0"
+              :min="0"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>
+              {{ record.badQty }}
+            </span>
+          </template>
+          <!-- 良品数量 -->
+          <template slot="goodQty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.isEdit"
+              size="small"
+              v-model="record.goodQty"
+              :precision="0"
+              :min="0"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>
+              {{ record.goodQty }}
+            </span>
+          </template>
+          <!-- 返库数量 -->
+          <template slot="backStockQty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.isEdit"
+              size="small"
+              v-model="record.backStockQty"
+              :precision="0"
+              :min="0"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>
+              {{ record.backStockQty }}
+            </span>
+          </template>
+          <!-- 退货原因 -->
+          <template slot="returnReason" slot-scope="text, record">
+            <returnReason v-if="record.isEdit" v-model="record.returnReason" @blur="blurReason(record)"></returnReason>
+            <span v-else>{{ record.returnReason||'--' }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div v-if="record.isEdit">
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                :loading="loading"
+                @click="handleSave(record)"
+              >保存</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                @click="handleCancel(record)"
+              >取消</a-button>
+            </div>
+            <div v-else>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                @click="handleSetPrice(record)"
+              >设置退货单价</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                @click="handleEdit(record)"
+              >编辑</a-button>
+              <a-button
+                :loading="loading"
+                size="small"
+                type="link"
+                class="button-error"
+                @click="handleDel(record)"
+              >删除</a-button>
+            </div>
+          </template>
+        </s-table>
+        <div class="footer-btn">
+          <a-button
+            size="large"
+            style="padding: 0 60px;"
+            :disabled="spinning"
+            type="primary"
+            class="button-primary"
+            @click="handleSubmit()"
+            id="salesReturn-handleSubmit">审核通过</a-button>
+        </div>
+      </a-card>
+    </a-spin>
+    <!-- 设置退货单价 -->
+    <setPriceModal
+      ref="setPriceModal"
+      modalTit="设置退货单价"
+      :chooseData="chooseData"
+      :openModal="showSetPriceModal"
+      @setOk="setPriceOk"
+      @cancel="showSetPriceModal=false"></setPriceModal>
+    <!-- 添加产品 -->
+    <chooseProductsModal
+      ref="chooseProduct"
+      :openModal="openProductModal"
+      :buyerSn="$route.params.buyerSn"
+      @close="openProductModal=false"
+      @addProduct="addProduct"></chooseProductsModal>
+    <!-- 批量设置退货原因 -->
+    <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
+      <div style="text-align: center;">
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+        <div style="line-height: 24px;">
+          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
+        </div>
+      </div>
+    </commonModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import setPriceModal from './setPriceModal.vue'
+import commonModal from '@/views/common/commonModal.vue'
+import returnReason from '@/views/common/returnReason'
+import chooseProductsModal from '../receiveCheck/chooseProductsModal.vue'
+import { salesReturnDetail, customerServiceConfirm } from '@/api/salesReturn'
+import { salesReturnDetailList, updateByCustomerService, deleteByCustomerService, insertByCustomerService, salesReturnDetailSetReason } from '@/api/salesReturnDetail'
+export default {
+  name: 'CustConfirm',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    setPriceModal,
+    chooseProductsModal,
+    returnReason,
+    commonModal
+  },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0, // 表格高度
+      orderSn: null,
+      disabled: false,
+      ordeDetail: null,
+      loading: false,
+      queryParam: {
+        salesReturnBillSn: '',
+        productName: '',
+        productCode: ''
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // 查询总计
+        this.queryParam.salesReturnBillSn = this.$route.params.sn
+        return salesReturnDetailList(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
+              data.list[i].isEdit = false
+              data.list[i].returnReasonBackups = data.list[i].returnReason
+            }
+            this.disabled = false
+          }
+          return data
+        })
+      },
+      rowSelectionInfo: null,
+      showSetPriceModal: false,
+      chooseData: [],
+      openProductModal: false,
+      plReturnReason: '',
+      showPlModal: false
+    }
+  },
+  watch: {
+    showPlModal (newValue, oldValue) {
+      if (!newValue) {
+        this.plReturnReason = ''
+      }
+    }
+  },
+  computed: {
+    selNums () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '13%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '10%', scopedSlots: { customRender: 'qty' } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', scopedSlots: { customRender: 'receiveQty' } },
+        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', scopedSlots: { customRender: 'badQty' } },
+        { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '10%', scopedSlots: { customRender: 'goodQty' } },
+        { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '10%', scopedSlots: { customRender: 'backStockQty' } },
+        // { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货单价说明', dataIndex: 'priceRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(9, 0, { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'salesReturnList', query: { closeLastOldTab: true } })
+    },
+    // 添加产品
+    addProduct (data) {
+      const params = {
+        'salesReturnBillSn': this.orderSn,
+        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
+        ...data
+      }
+      insertByCustomerService(params).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm(true)
+          this.$message.info(res.message)
+        }
+        this.$refs.chooseProduct.resetLoading()
+      })
+    },
+    // 设置价格
+    handleSetPrice (record) {
+      this.chooseData = [record]
+      this.showSetPriceModal = true
+    },
+    // 批量设置退货单价
+    handlePlss () {
+      if (!this.selNums) {
+        this.$message.warning('请先选择产品!')
+        return
+      }
+      this.chooseData = this.rowSelectionInfo.selectedRows
+      this.showSetPriceModal = true
+    },
+    // 设置价格成功
+    setPriceOk () {
+      this.showSetPriceModal = false
+      this.$refs.table.clearSelected()
+      this.resetSearchForm(false)
+    },
+    blurReason (row) {
+      if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
+        row.returnReason = row.returnReasonBackups
+      }
+    },
+    // 批量设置退货原因
+    openPlSetReason () {
+      if (this.selNums) {
+        this.showPlModal = true
+      } else {
+        this.$message.warning('请先选择产品!')
+      }
+    },
+    setPlReturnReason () {
+      if (this.plReturnReason == '') {
+        this.$message.warning('请输入退货原因!')
+      } else {
+        this.spinning = true
+        const snList = []
+        const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        arr.map(item => {
+          snList.push(item.salesReturnDetailSn)
+        })
+        salesReturnDetailSetReason({
+          salesReturnBillDetailSnList: snList,
+          returnReason: this.plReturnReason
+        }).then(res => {
+          if (res.status == 200) {
+            this.showPlModal = false
+            this.$refs.table.clearSelected()
+            this.resetSearchForm(false)
+          }
+          this.spinning = false
+        })
+      }
+    },
+    // 保存
+    handleSave (record) {
+      if (!record.returnReason) {
+        this.$message.warning('请先选择退货原因!')
+        return
+      }
+      if (record.receiveQty != record.badQty + record.goodQty) {
+        this.$message.warning('仓库实收数量必需等于良品数量和坏件数量之和!')
+        return
+      }
+      this.spinning = true
+      updateByCustomerService(record).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.handleCancel(record)
+        }
+        this.spinning = false
+      })
+    },
+    // 删除产品
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.loading = true
+          _this.spinning = true
+          deleteByCustomerService({ salesReturnDetailSn: row.salesReturnDetailSn }).then(res => {
+            if (res.status == 200) {
+              _this.resetSearchForm(false)
+            }
+            _this.$message.info(res.message)
+            _this.loading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 编辑
+    handleEdit (record) {
+      record.isEdit = true
+    },
+    // 取消
+    handleCancel (record) {
+      record.isEdit = false
+      this.$refs.table.refresh()
+    },
+    // 获取单据详细
+    getOrderDetail () {
+      salesReturnDetail({ sn: this.orderSn }).then(res => {
+        this.ordeDetail = res.data || null
+      })
+    },
+    // 审核销售单
+    handleSubmit () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认审核通过吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          customerServiceConfirm({ salesReturnBillSn: _this.orderSn }).then(res => {
+            if (res.status == 200) {
+              _this.handleBack()
+              _this.$message.success(res.message)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  重置
+    resetSearchForm (flag) {
+      if (flag) {
+        this.queryParam.productName = ''
+        this.queryParam.productCode = ''
+        this.rowSelectionInfo = null
+        this.$refs.table.clearSelected()
+      }
+      this.$refs.table.refresh(flag)
+    },
+    searchForm () {
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.orderSn = this.$route.params.sn
+      this.getOrderDetail()
+    },
+    setTableH () {
+      this.tableHeight = window.innerHeight - 390
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.$refs.table.refresh()
+      this.pageInit()
+    }
+  },
+  activated () {
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.$refs.table.refresh()
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .custConfirm-wrap{
+    position: relative;
+    height: 100%;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      height: 100%;
+    }
+    .footer-btn{
+      text-align: center;
+    }
+    .custConfirm-cont{
+      margin-top: 10px;
+      .sTable{
+        margin-top: 10px;
+      }
+      .total-bar{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        > div{
+          &:last-child{
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            > div{
+              padding: 0 10px;
+            }
+          }
+        }
+      }
+    }
+    .redBg-row{
+      background-color: #f5beb4;
+    }
+    .orgBg-row{
+      background-color: #fffca2;
+    }
+  }
+</style>

+ 280 - 0
src/views/salesReturnManagement/custConfirm/setPriceModal.vue

@@ -0,0 +1,280 @@
+<template>
+  <a-modal
+    centered
+    class="setPrice-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
+    @cancel="isShow=false"
+    width="80%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <div class="form-row">
+          <div>
+            退货单价:
+            <a-radio-group v-model="form.grabFlag" @change="grabChange">
+              <a-radio :value="0">
+                不抓单
+              </a-radio>
+              <a-radio :value="1">
+                抓单
+              </a-radio>
+            </a-radio-group>
+          </div>
+          <div v-if="form.grabFlag==0">
+            是否打折:
+            <a-radio-group v-model="form.discountFlag">
+              <a-radio :value="0">
+                不打折
+              </a-radio>
+              <a-radio :value="1">
+                打折
+              </a-radio>
+            </a-radio-group>
+            <div v-if="form.discountFlag==1">
+              <a-input-number placeholder="请输入折扣" v-model="form.discount" :min="0" :max="10" :precision="2" />
+              <span class="mleft">示例:7折表示使用当前售价×0.7作为退货单价(保留两位小数)</span>
+              <a-button type="primary" :disabled="disabled" @click="handleSave" class="button-error">设置完成</a-button>
+            </div>
+            <div v-else>
+              <a-button type="primary" :disabled="disabled" @click="handleSave" class="button-error">设置完成</a-button>
+            </div>
+          </div>
+          <div v-else>
+            销售单号:
+            <a-input placeholder="请输入销售单号" v-model.trim="form.salesBillNo" :maxlength="50" @change="fetchUser"/>
+            <span class="mleft">{{ buyerName }}</span>
+            <a-button type="primary" :disabled="disabled" @click="handleSave" class="button-error">设置完成</a-button>
+          </div>
+        </div>
+        <a-divider>请给以下产品设置新的退货单价</a-divider>
+        <!-- 搜索条件 -->
+        <div style="overflow: hidden;">
+          <a-form layout="inline" style="margin-bottom:10px;float:left;" @keyup.enter.native="searchProduct">
+            <a-form-item label="产品编码">
+              <a-input id="setPrice-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+            </a-form-item>
+            <a-form-item label="产品名称">
+              <a-input id="setPrice-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+            </a-form-item>
+            <a-form-item>
+              <a-button type="primary" class="button-info" @click="searchProduct" :disabled="disabled" id="setPrice-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="setPrice-reset">重置</a-button>
+            </a-form-item>
+          </a-form>
+          <div style="float:right;color:#999;margin-top:10px;">说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+        </div>
+        <!-- 表格数据 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :rowClassName="(record, index) => record.addFlag == '1' ? (record.addType == 'WAREHOUSE_RECEIVE'?'redBg-row':'orgBg-row'):''"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 400 }"
+          :showPagination="false"
+          bordered>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import debounce from 'lodash/debounce'
+import { STable, VSelect } from '@/components'
+import { salesDetailByNo } from '@/api/sales'
+import { setReturnPrice } from '@/api/salesReturnDetail'
+export default {
+  name: 'SetPriceModal',
+  components: { STable, VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    chooseData: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data () {
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      queryParam: {
+        productName: '',
+        productCode: ''
+      },
+      form: {
+        grabFlag: 0, // 是否抓单
+        discountFlag: 0, // 是否打折
+        discount: '', // 折扣
+        salesBillNo: '' // 销售单号
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '13%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货单价说明', dataIndex: 'priceRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return new Promise((res, rej) => {
+          const ret = this.chooseData.filter(item => {
+            return item.productEntity.code.indexOf(this.queryParam.productCode) >= 0 &&
+            item.productEntity.name.indexOf(this.queryParam.productName) >= 0
+          })
+          res({
+            list: ret,
+            count: ret.length
+          })
+        })
+      },
+      buyerName: ''
+    }
+  },
+  methods: {
+    fetchUser () {
+      this.form.salesBillNo = this.form.salesBillNo.replace(/\s+/g, '')
+      if (!this.form.salesBillNo) {
+        this.form.salesBillNo = ''
+        this.buyerName = ''
+        return
+      }
+      this.spinning = true
+      salesDetailByNo({ salesBillNo: this.form.salesBillNo }).then(res => {
+        this.spinning = false
+        this.buyerName = res.data ? res.data.buyerName : ''
+      })
+    },
+    // 设置价格
+    handleSave () {
+      // 不抓单且打折
+      if (this.form.grabFlag == 0 && this.form.discountFlag == 1) {
+        if (!this.form.discount) {
+          this.$message.info('请输入折扣')
+          return
+        }
+      }
+      // 抓单
+      if (this.form.grabFlag == 1) {
+        if (!this.form.salesBillNo) {
+          this.$message.info('请输入销售单号')
+          return
+        }
+        this.form.discountFlag = undefined
+        this.form.discount = undefined
+      }
+      const snList = []
+      this.chooseData.map(item => {
+        snList.push(item.salesReturnDetailSn)
+      })
+      const params = Object.assign(this.form, { salesReturnBillDetailSnList: snList })
+      console.log(params)
+      this.disabled = true
+      this.spinning = true
+      setReturnPrice(params).then(res => {
+        if (res.status == 200) {
+          this.$emit('setOk')
+          this.$message.info(res.message)
+        }
+        this.disabled = false
+        this.spinning = false
+      })
+    },
+    grabChange (e) {
+      this.buyerName = ''
+      if (e.target.value == 1) {
+        this.form.salesBillNo = ''
+      } else {
+        this.form.discountFlag = 0
+        this.form.discount = ''
+      }
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    },
+    // 查询
+    searchProduct () {
+      this.$refs.table.refresh(true)
+    },
+    // 重置
+    resetSearchForm () {
+      this.form = {
+        grabFlag: 0, // 是否抓单
+        discountFlag: 0, // 是否打折
+        discount: '', // 折扣
+        salesBillNo: '' // 销售单号
+      }
+      this.queryParam = {
+        productName: '',
+        productCode: ''
+      }
+      this.buyerName = ''
+      if (this.$refs.table) {
+        this.$refs.table.refresh(true)
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.handleCommonCancel()
+      } else {
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .setPrice-detail-modal{
+    .form-row{
+      > div{
+        display: flex;
+        align-items:center;
+        padding: 10px 0;
+        input[type='text']{
+          width:250px;
+        }
+        .mleft{
+          margin-left:10px;
+        }
+      }
+    }
+    .redBg-row{
+      background-color: #f5beb4;
+    }
+    .orgBg-row{
+      background-color: #fffca2;
+    }
+  }
+</style>

+ 255 - 0
src/views/salesReturnManagement/pickUp/list.vue

@@ -0,0 +1,255 @@
+<template>
+  <a-card size="small" :bordered="false" class="pickUp-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="rangeExamineDate" @change="dateExamineChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="提货单号">
+                <a-input id="pickUp-pickUpNo" v-model.trim="queryParam.pickUpNo" allowClear placeholder="请输入提货单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关联销退单号">
+                <a-input id="pickUp-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="申请人">
+                  <employee style="width: 100%;" id="pickUp-Employee" v-model="queryParam.applyPersonSn"></employee>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="物流点">
+                  <logisticsPoint style="width: 100%;" id="pickUp-logisticsPoint" v-model="queryParam.logisticsPoint"></logisticsPoint>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="发货方">
+                  <dealerSubareaScopeList placeholder="请输入客户名称搜索" ref="dealerSubareaScopeList" id="pickUp-senderSn" @change="custChange" />
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+64.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 单号 -->
+        <template slot="pickUpNo" slot-scope="text, record">
+          <div v-if="$hasPermissions('M_detailPickUp')">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.pickUpNo }}</span>
+          </div>
+          <div v-else>{{ record.pickUpNo }}</div>
+        </template>
+        <!-- 关联单数 -->
+        <template slot="salesReturnNum" slot-scope="text, record">
+          <div v-if="record.salesReturnNum">{{ record.salesReturnNum }} 单</div>
+          <div v-else></div>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            v-if="record.state == 'AUDIT_PASS'&&$hasPermissions('M_detailPickUp')"
+            @click="handleDetail(record)"
+            id="pickUp-detail-btn">详情</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import employee from '../../expenseManagement/expenseReimbursement/employee.js'
+import logisticsPoint from '../billOfLading/logisticsPoint'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { pickUpQueryPage } from '@/api/pickUp'
+export default {
+  name: 'PickUpList',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    dealerSubareaScopeList,
+    employee,
+    rangeDate,
+    logisticsPoint
+  },
+  data () {
+    return {
+      spinning: false,
+      // 高级搜索 展开/关闭
+      advanced: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      // 查询参数
+      queryParam: {
+        auditBeginDate: '',
+        auditEndDate: '',
+        pickUpNo: '', // 提货单号
+        applyPersonSn: undefined, // 申请人
+        salesReturnBillNo: undefined, //  总部销退单号
+        logisticsPoint: undefined, // 物流点
+        senderSn: undefined, //  发货人
+        state: 'AUDIT_PASS' // 业务状态
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return pickUpQueryPage(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
+        })
+      },
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提货单号', scopedSlots: { customRender: 'pickUpNo' }, width: '10%', align: 'center' },
+        { title: '关联销退单', dataIndex: 'salesReturnNum', scopedSlots: { customRender: 'salesReturnNum' }, width: '6%', align: 'center' },
+        { title: '申请人', dataIndex: 'applyPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '主题', dataIndex: 'theme', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '物流公司', dataIndex: 'logisticsCompany', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '物流点', dataIndex: 'logisticsPoint', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '发货方', dataIndex: 'dealerEntity.dealerName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货人', dataIndex: 'receiverName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  审核时间  change
+    dateExamineChange (date) {
+      this.queryParam.auditBeginDate = date[0] ? date[0] + ' 00:00:00' : ''
+      this.queryParam.auditEndDate = date[1] ? date[1] + ' 23:59:59' : ''
+    },
+    custChange (val) {
+      this.queryParam.senderSn = val.key
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'billOfLadingDetail', params: { sn: row.pickUpSn } })
+    },
+    resetSearchForm () {
+      if (this.advanced) {
+        this.$refs.rangeExamineDate.resetDate()
+        this.$refs.dealerSubareaScopeList.resetForm()
+      }
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
+      this.queryParam.pickUpNo = ''
+      this.queryParam.senderSn = undefined
+      this.queryParam.applyPersonSn = undefined
+      this.queryParam.logisticsPoint = undefined
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.state = 'AUDIT_PASS'
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 175
+    }
+  },
+  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">
+  .pickUp-wrap{
+    .sTable{
+      .badge-con-t{
+        .ant-badge-count{
+          transform: scale(0.8);
+          font-size: 13px;
+        }
+      }
+    }
+  }
+</style>

+ 487 - 0
src/views/salesReturnManagement/receiveCheck/checking.vue

@@ -0,0 +1,487 @@
+<template>
+  <div class="salesReturnCheck-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesReturnCheck-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="salesReturnCheck-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="salesReturnCheck-cont">
+        <a-form layout="inline" style="margin-bottom:10px;" @keyup.enter.native="searchForm">
+          <a-form-item label="产品编码" prop="productCode">
+            <a-input id="salesReturnCheck-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+          </a-form-item>
+          <a-form-item label="产品名称" prop="productName">
+            <a-input id="salesReturnCheck-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+          </a-form-item>
+          <a-form-item>
+            <a-button type="primary" class="button-info" @click="searchForm" :disabled="disabled" id="salesReturnCheck-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnCheck-reset">重置</a-button>
+          </a-form-item>
+        </a-form>
+        <div style="border-top:1px solid #eee;padding-top:10px;">
+          <a-button type="primary" :loading="loading" class="button-info" @click="plSetQty(1)">批量设置良品数量</a-button>
+          <a-button type="primary" :loading="loading" class="button-error" @click="plSetQty(2)">批量设置返库数量</a-button>
+          <a-button style="margin-left:5px;" :loading="loading" @click="openPlSetReason">批量设置退货原因</a-button>
+          <span style="margin-left:10px;" v-if="selNums">已选{{ selNums }}项</span>
+          <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品</div>
+        </div>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          :rowClassName="(record, index) => record.addFlag == '1' ? (record.addType == 'WAREHOUSE_RECEIVE'?'redBg-row':'orgBg-row'):''"
+          size="small"
+          :rowKey="(record) => record.id"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 良品数量 -->
+          <template slot="goodQty" slot-scope="text, record">
+            <a-input-number
+              id="salesReturn-goodQty"
+              size="small"
+              v-model="record.goodQty"
+              :precision="0"
+              :min="0"
+              :max="record.receiveQty"
+              placeholder="请输入"
+              @blur="e => updateGoodQty(e.target.value, record)"
+              style="width: 100%;" />
+          </template>
+          <!-- 返库数量 -->
+          <template slot="backStockQty" slot-scope="text, record">
+            <a-input-number
+              id="salesReturn-backStockQty"
+              size="small"
+              v-model="record.backStockQty"
+              :precision="0"
+              :min="0"
+              placeholder="请输入"
+              @blur="e => updateBackStockQty(e.target.value, record)"
+              style="width: 100%;" />
+          </template>
+          <!-- 退货原因 -->
+          <template slot="returnReason" slot-scope="text, record">
+            <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
+          </template>
+        </s-table>
+        <div class="footer-btn">
+          <a-button
+            size="large"
+            style="padding: 0 60px;"
+            :disabled="spinning"
+            type="primary"
+            class="button-primary"
+            @click="handleSubmit()"
+            id="salesReturn-handleSubmit">提交</a-button>
+        </div>
+      </a-card>
+    </a-spin>
+    <!-- 选中批量操作 -->
+    <chooseTypeModal :openModal="openTypeModal" :type="actionType" @close="openTypeModal=false" @confirm="plconfirm"></chooseTypeModal>
+    <!-- 批量设置退货原因 -->
+    <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
+      <div style="text-align: center;">
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+        <div style="line-height: 24px;">
+          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
+        </div>
+      </div>
+    </commonModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import commonModal from '@/views/common/commonModal.vue'
+import returnReason from '@/views/common/returnReason'
+import { salesReturnDetail, salesReturnCheck } from '@/api/salesReturn'
+import { salesReturnDetailList, updateBatchBackStockQty, updateBatchGoodQty, salesReturnDetailSetReason, salesReturnDetailUpdateReason } from '@/api/salesReturnDetail'
+import chooseTypeModal from './chooseTypeModal.vue'
+export default {
+  name: 'SalesReturnCheck',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    chooseTypeModal,
+    returnReason,
+    commonModal
+  },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0, // 表格高度
+      orderSn: null,
+      openTypeModal: false,
+      actionType: '',
+      disabled: false,
+      isInster: false, // 是否正在添加产品
+      ordeDetail: { discountAmount: 0 },
+      loading: false,
+      // 已选产品
+      dataSource: [],
+      productForm: {
+        salesReturnBillSn: ''
+      },
+      queryParam: {
+        productCode: '',
+        productName: ''
+      },
+      chooseLoadData: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // 查询总计
+        this.productForm.salesReturnBillSn = this.$route.params.sn
+        return salesReturnDetailList(Object.assign(parameter, this.productForm, 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
+              data.list[i].goodQty = data.list[i].goodQty || 0
+              data.list[i].backStockQty = data.list[i].backStockQty || 0
+              data.list[i].goodQtyBackups = data.list[i].goodQty
+              data.list[i].backStockQtyBackups = data.list[i].backStockQty
+              data.list[i].returnReasonBackups = data.list[i].returnReason
+            }
+            this.disabled = false
+            this.chooseLoadData = data.list
+          }
+          return data
+        })
+      },
+      rowSelectionInfo: null,
+      plReturnReason: '',
+      showPlModal: false
+    }
+  },
+  watch: {
+    showPlModal (newValue, oldValue) {
+      if (!newValue) {
+        this.plReturnReason = ''
+      }
+    }
+  },
+  computed: {
+    selNums () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '20%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '28%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'goodQty', width: '10%', align: 'center', scopedSlots: { customRender: 'goodQty' } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: '10%', align: 'center', scopedSlots: { customRender: 'backStockQty' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'receiveCheckList' })
+    },
+    // 批量设置
+    plSetQty (type) {
+      const _this = this
+      if (!this.selNums) {
+        _this.$message.warning('请先选择产品!')
+        return
+      }
+      this.actionType = type
+      this.openTypeModal = true
+    },
+    // 批量修改数量
+    plconfirm (val) {
+      const _this = this
+      const obj = []
+      const hasError = _this.rowSelectionInfo.selectedRows.filter(item => item.backStockQty > 0)
+      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+        // 批量设置良品
+        if (this.actionType == 1) {
+          const pa = {
+            salesReturnDetailSn: item.salesReturnDetailSn,
+            goodQty: val == 1 ? item.receiveQty : 0
+          }
+          // 如果批量修改良品数量为0,且返库数量又不是0的情况
+          if (hasError.length && val == 0) {
+            pa.backStockQty = 0
+          }
+          obj.push(pa)
+        } else {
+          // 批量设置返库
+          obj.push({
+            salesReturnDetailSn: item.salesReturnDetailSn,
+            backStockQty: val == 1 ? item.goodQty : 0
+          })
+        }
+      })
+      console.log(obj)
+      // 如果批量修改良品数量为0
+      if (val == 0 && this.actionType == 1 && hasError.length) {
+        this.$confirm({
+          title: '提示',
+          content: '是否将返库数量同样设置为0?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.plSave(obj)
+          }
+        })
+      } else {
+        _this.plSave(obj)
+      }
+    },
+    plSave (obj) {
+      const fun = this.actionType == 1 ? updateBatchGoodQty : updateBatchBackStockQty
+      this.spinning = true
+      fun(obj).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.clearSelected()
+          this.$refs.table.refresh()
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+        this.openTypeModal = false
+      })
+    },
+    // 批量设置退货原因
+    openPlSetReason () {
+      if (this.selNums) {
+        this.showPlModal = true
+      } else {
+        this.$message.warning('请先选择产品!')
+      }
+    },
+    setPlReturnReason () {
+      if (this.plReturnReason == '') {
+        this.$message.warning('请输入退货原因!')
+      } else {
+        this.spinning = true
+        const snList = []
+        const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        arr.map(item => {
+          snList.push(item.salesReturnDetailSn)
+        })
+        salesReturnDetailSetReason({
+          salesReturnBillDetailSnList: snList,
+          returnReason: this.plReturnReason
+        }).then(res => {
+          if (res.status == 200) {
+            this.showPlModal = false
+            this.$refs.table.clearSelected()
+            this.$refs.table.refresh()
+          }
+          this.spinning = false
+        })
+      }
+    },
+    // 修改退货原因
+    updateReason (row) {
+      // 空或没有改变时不保存数据
+      if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
+        row.returnReason = row.returnReasonBackups
+        return
+      }
+      this.spinning = true
+      salesReturnDetailUpdateReason({
+        salesReturnDetailSn: row.salesReturnDetailSn,
+        returnReason: row.returnReason
+      }).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh()
+          this.$message.success(res.message)
+        } else {
+          row.returnReason = row.returnReasonBackups
+        }
+        this.spinning = false
+      })
+    },
+    // 修改良品数量
+    updateGoodQty (val, record) {
+      if (record.backStockQty > record.goodQty) {
+        this.$message.info('返库数量不能大于良品数量')
+        record.goodQty = record.goodQtyBackups
+        return
+      }
+      //  光标移出,值发生改变再调用编辑接口
+      if (val && val != record.goodQtyBackups) {
+        this.spinning = true
+        updateBatchGoodQty([{
+          salesReturnDetailSn: record.salesReturnDetailSn,
+          goodQty: record.goodQty
+        }]).then(res => {
+          if (res.status == 200) {
+            this.resetSearchForm(false)
+            this.$message.success(res.message)
+            record.goodQtyBackups = record.goodQty
+          } else {
+            record.goodQty = record.goodQtyBackups
+          }
+          this.spinning = false
+        })
+      } else {
+        record.goodQty = record.goodQtyBackups
+      }
+    },
+    // 修改返库数量
+    updateBackStockQty (val, record) {
+      if (record.backStockQty > record.goodQty) {
+        this.$message.info('返库数量不能大于良品数量')
+        record.backStockQty = record.backStockQtyBackups
+        return
+      }
+      //  光标移出,值发生改变再调用编辑接口
+      if (val && val != record.backStockQtyBackups) {
+        this.spinning = true
+        updateBatchBackStockQty([{
+          salesReturnDetailSn: record.salesReturnDetailSn,
+          backStockQty: record.backStockQty
+        }]).then(res => {
+          if (res.status == 200) {
+            this.resetSearchForm(false)
+            this.$message.success(res.message)
+          } else {
+            record.backStockQty = record.backStockQtyBackups
+          }
+          this.spinning = false
+        })
+      } else {
+        record.backStockQty = record.backStockQtyBackups
+      }
+    },
+    // 获取单据详细
+    getOrderDetail () {
+      salesReturnDetail({ sn: this.orderSn }).then(res => {
+        this.ordeDetail = res.data || null
+      })
+    },
+    //  重置
+    resetSearchForm (flag) {
+      if (flag) {
+        this.rowSelectionInfo = null
+        this.$refs.table.clearSelected()
+        this.queryParam = {
+          productCode: '',
+          productName: ''
+        }
+      }
+      this.$refs.table.refresh(!!flag)
+    },
+    searchForm () {
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    },
+    // 提交品检
+    handleSubmit () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '提交后将无法修改,确认提交吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          salesReturnCheck({ salesReturnBillSn: _this.orderSn }).then(res => {
+            if (res.status == 200) {
+              _this.handleBack()
+              _this.$message.success(res.message)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.orderSn = this.$route.params.sn
+      this.getOrderDetail()
+    },
+    setTableH () {
+      this.tableHeight = window.innerHeight - 390
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.$refs.table.refresh(true)
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.$refs.table.refresh()
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .salesReturnCheck-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      height: 100%;
+    }
+    .footer-btn{
+      text-align: center;
+    }
+    .salesReturnCheck-cont{
+      margin-top: 10px;
+      .sTable{
+        margin-top: 10px;
+      }
+      .total-bar{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        > div{
+          &:last-child{
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            > div{
+              padding: 0 10px;
+            }
+          }
+        }
+      }
+    }
+    .redBg-row{
+      background-color: #f5beb4;
+    }
+    .orgBg-row{
+      background-color: #fffca2;
+    }
+  }
+</style>

+ 112 - 0
src/views/salesReturnManagement/receiveCheck/chooseProductsModal.vue

@@ -0,0 +1,112 @@
+<template>
+  <a-modal
+    centered
+    class="chooseProducts-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="选择产品"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="70%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="products-con">
+        <div>
+          <!-- 查询配件列表 -->
+          <queryPart ref="partQuery" :isShowPrice="isShowPrice" :returnReasonList="returnReasonList" :newLoading="isInster" @add="saveProduct"></queryPart>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import queryPart from '@/views/salesReturnManagement/salesReturn/queryPart.vue'
+export default {
+  name: 'ChooseProductsModal',
+  components: { queryPart },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    chooseData: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    buyerSn: {
+      type: String,
+      default: ''
+    },
+    isShowPrice: { //  弹框显示状态
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      returnReasonList: [],
+      isInster: false //  表格加载中
+    }
+  },
+  methods: {
+    // 添加或修改产品
+    saveProduct (row) {
+      // 防止多次添加产品
+      if (this.isInster) {
+        return
+      }
+      if (!row.returnReason) {
+        this.$message.info('请选择退货原因')
+        return
+      }
+      const params = {
+        'price': row.productPrice,
+        'cost': row.lastStockCost,
+        'returnReason': row.returnReason,
+        'productSn': row.productSn,
+        'initialQty': row.qty
+      }
+      this.isInster = true
+      this.$emit('addProduct', params)
+    },
+    resetLoading () {
+      this.isInster = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.returnReasonList = this.$store.state.app.returnReason
+        this.$nextTick(() => {
+          this.$refs.partQuery.pageInit(this.buyerSn, 0)
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseProducts-modal{
+    .products-con{
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 97 - 0
src/views/salesReturnManagement/receiveCheck/chooseTypeModal.vue

@@ -0,0 +1,97 @@
+<template>
+  <a-modal
+    centered
+    class="chooseProducts-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="type==1?'批量设置良品数量':'批量设置返库数量'"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="450px">
+    <div class="products-con">
+      <div v-if="type == 1">
+        <div>良品数量:</div>
+        <a-radio-group v-model="value"><a-radio :style="radioStyle" :value="1">等于仓库实收数量</a-radio><a-radio :style="radioStyle" :value="0">等于0</a-radio></a-radio-group>
+      </div>
+      <div v-if="type == 2">
+        <div>返库数量:</div>
+        <a-radio-group v-model="value"><a-radio :style="radioStyle" :value="1">等于良品数量</a-radio><a-radio :style="radioStyle" :value="0">等于0</a-radio></a-radio-group>
+      </div>
+    </div>
+    <div class="btn-con">
+      <a-button size="large" @click="isShow=false" style="padding: 0 40px;margin:0 15px;" type="default">取消</a-button>
+      <a-button
+        size="large"
+        style="padding: 0 40px;margin:0 15px;"
+        type="primary"
+        class="button-primary"
+        @click="handleSubmit()"
+      >确定</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  name: 'ChooseTypeModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: [Number, String],
+      default: '1'
+    }
+  },
+  data () {
+    return {
+      value: 1,
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      radioStyle: {
+        display: 'block',
+        height: '40px',
+        lineHeight: '40px'
+      }
+    }
+  },
+  methods: {
+    handleSubmit () {
+      this.$emit('confirm', this.value)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.value = 1
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseProducts-modal{
+    .products-con{
+      padding-top:20px;
+      > div{
+        padding: 0 30px;
+        display: flex;
+        > div:first-child{
+          padding-top: 10px;
+        }
+      }
+    }
+    .btn-con{
+      text-align: center;
+      margin: 30px 0 20px;
+    }
+  }
+</style>

+ 250 - 0
src/views/salesReturnManagement/receiveCheck/list.vue

@@ -0,0 +1,250 @@
+<template>
+  <a-card size="small" :bordered="false" class="receiveCheck-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="rangeExamineDate" @change="dateExamineChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="总部销退单号">
+                <a-input id="receiveCheck-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="客户名称">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="receiveCheck-buyerSn" @change="custChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="业务状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="receiveCheck-billStatus"
+                  code="SALES_RETURN_BILL_STATUS"
+                  :notIn="['WAIT_SUBMIT', 'WAIT_AUDIT', 'AUDIT_REJECT', 'CANCEL']"
+                  placeholder="请选择业务状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+64.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 单号 -->
+        <template slot="salesReturnBillNo" slot-scope="text, record">
+          <div v-if="$hasPermissions('B_salesReturnDetail')">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.salesReturnBillNo }}</span>
+          </div>
+          <div v-else>{{ record.salesReturnBillNo }}</div>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="record.billStatus == 'WAIT_RECEIVE'&&$hasPermissions('B_salesReturnReceiving')"
+              @click="handleReceiving(record)"
+              id="receiveCheck-detail-btn">收货</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              v-if="record.billStatus == 'WAIT_CHECK'&&$hasPermissions('B_salesReturnCheck')"
+              @click="handleCheck(record)"
+              id="salesReturn-eexamine-btn">品检</a-button>
+          </div>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import employee from '../../expenseManagement/expenseReimbursement/employee.js'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { salesReturnList } from '@/api/salesReturn'
+export default {
+  name: 'ReceiveCheckList',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    dealerSubareaScopeList,
+    employee,
+    rangeDate
+  },
+  data () {
+    return {
+      spinning: false,
+      // 高级搜索 展开/关闭
+      advanced: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      createDate: [], //  创建时间
+      // 查询参数
+      queryParam: {
+        beginAuditDate: '',
+        endAuditDate: '',
+        buyerSn: undefined, //  客户名称
+        salesReturnBillNo: undefined, //  总部销退单号
+        billStatus: undefined // 业务状态
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return salesReturnList(Object.assign(parameter, this.queryParam, {
+          'excludeBillStatusList': ['WAIT_SUBMIT', 'WAIT_AUDIT', 'AUDIT_REJECT', 'CANCEL']
+        })).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
+        })
+      },
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'totalGoodQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  审核时间  change
+    dateExamineChange (date) {
+      this.queryParam.beginAuditDate = date[0]
+      this.queryParam.endAuditDate = date[1]
+    },
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillSn }, query: { path: 'receiveCheck' } })
+    },
+    // 收货
+    handleReceiving (row) {
+      this.$router.push({ name: 'salesReturnReceiving', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+    },
+    // 品检
+    handleCheck (row) {
+      this.$router.push({ name: 'salesReturnCheck', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+    },
+    resetSearchForm () {
+      this.$refs.rangeExamineDate.resetDate()
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.queryParam.beginAuditDate = ''
+      this.queryParam.endAuditDate = ''
+      this.queryParam.buyerSn = undefined
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.billStatus = undefined
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 175
+    }
+  },
+  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">
+  .receiveCheck-wrap{
+    .sTable{
+      .badge-con-t{
+        .ant-badge-count{
+          transform: scale(0.8);
+          font-size: 13px;
+        }
+      }
+    }
+  }
+</style>

+ 410 - 0
src/views/salesReturnManagement/receiveCheck/receiving.vue

@@ -0,0 +1,410 @@
+<template>
+  <div class="salesReturnReceive-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesReturnReceive-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="salesReturnReceive-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="salesReturnReceive-cont">
+        <a-form layout="inline" style="margin-bottom:10px;" @keyup.enter.native="searchForm">
+          <a-form-item label="产品编码" prop="productCode">
+            <a-input id="salesReturnReceive-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+          </a-form-item>
+          <a-form-item label="产品名称" prop="productName">
+            <a-input id="salesReturnReceive-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+          </a-form-item>
+          <a-form-item>
+            <a-button type="primary" class="button-info" @click="searchForm" :disabled="disabled" id="salesReturnReceive-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnReceive-reset">重置</a-button>
+          </a-form-item>
+        </a-form>
+        <div style="border-top:1px solid #eee;padding-top:10px;">
+          <a-button type="primary" :loading="loading" class="button-info" @click="openModal = true">新增产品</a-button>
+          <a-button type="primary" :loading="loading" class="button-error" @click="handlePlss">批量实收</a-button>
+          <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys&&rowSelectionInfo.selectedRowKeys.length">已选{{ rowSelectionInfo.selectedRowKeys.length }}项</span>
+          <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品</div>
+        </div>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          :rowClassName="(record, index) => record.addFlag == '1' ? (record.addType == 'WAREHOUSE_RECEIVE'?'redBg-row':'orgBg-row'):''"
+          size="small"
+          :rowKey="(record) => record.id"
+          :row-selection="{ columnWidth: 40, getCheckboxProps:record =>({props: { disabled: record.addFlag == '1' }}) }"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 仓库实收数量 -->
+          <template slot="receiveQty" slot-scope="text, record">
+            <a-input-number
+              size="small"
+              v-model="record.receiveQty"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              @blur="e => onCellBlurReceiveQty(e.target.value, record)"
+              placeholder="请输入"
+              style="width: 100%;" />
+          </template>
+          <!-- 退货原因 -->
+          <template slot="returnReason" slot-scope="text, record">
+            <returnReason
+              v-model="record.returnReason"
+              v-if="record.addFlag == '1'&&record.addType == 'WAREHOUSE_RECEIVE'"
+              @blur="e => onCellBlurReturnReason(e, record)"></returnReason>
+            <span v-else>{{ record.returnReason }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div>
+              <a-button
+                v-if="record.addFlag == '1'&&record.addType == 'WAREHOUSE_RECEIVE'"
+                size="small"
+                type="link"
+                class="button-warning"
+                @click="handleDel(record)"
+              >删除</a-button>
+            </div>
+          </template>
+        </s-table>
+        <div class="footer-btn">
+          <a-button
+            size="large"
+            style="padding: 0 60px;"
+            :disabled="spinning"
+            type="primary"
+            class="button-primary"
+            @click="handleSubmit()"
+            id="salesReturn-handleSubmit">提交</a-button>
+        </div>
+      </a-card>
+    </a-spin>
+    <!-- 添加产品 -->
+    <chooseProductsModal
+      ref="chooseProduct"
+      :isShowPrice="false"
+      :openModal="openModal"
+      :buyerSn="$route.params.buyerSn"
+      @close="openModal=false"
+      @addProduct="addProduct"></chooseProductsModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import chooseProductsModal from './chooseProductsModal.vue'
+import returnReason from '@/views/common/returnReason'
+import { salesReturnDetail, salesReturnReceive } from '@/api/salesReturn'
+import {
+  salesReturnDetailList, salesReturnDetailReceiveBatch, salesReturnDetailUpdateReceiveQty, salesReturnDetailUpdateReason, insertByReceive, deleteByReceiver
+} from '@/api/salesReturnDetail'
+export default {
+  name: 'Receiving',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    chooseProductsModal,
+    returnReason
+  },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0, // 表格高度
+      orderSn: null,
+      disabled: false,
+      openModal: false, // 添加产品
+      ordeDetail: null,
+      loading: false,
+      // 已选产品
+      dataSource: [],
+      productForm: {
+        salesReturnBillSn: ''
+      },
+      chooseLoadData: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // 查询总计
+        this.productForm.salesReturnBillSn = this.$route.params.sn
+        return salesReturnDetailList(Object.assign(parameter, this.productForm, 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
+              data.list[i].receiveQtyBackups = data.list[i].receiveQty
+              data.list[i].returnReasonBackups = data.list[i].returnReason
+            }
+            this.disabled = false
+            this.chooseLoadData = data.list
+          }
+          return data
+        })
+      },
+      rowSelectionInfo: null,
+      queryParam: {
+        productCode: '',
+        productName: ''
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', scopedSlots: { customRender: 'receiveQty' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'receiveCheckList' })
+    },
+    // 添加产品
+    addProduct (data) {
+      const params = {
+        'salesReturnBillSn': this.orderSn,
+        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
+        ...data
+      }
+      insertByReceive(params).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm(true)
+          this.$message.info(res.message)
+        }
+        this.$refs.chooseProduct.resetLoading()
+      })
+    },
+    // 删除产品
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.loading = true
+          _this.spinning = true
+          deleteByReceiver({ salesReturnDetailSn: row.salesReturnDetailSn }).then(res => {
+            if (res.status == 200) {
+              _this.resetSearchForm(false)
+            }
+            _this.$message.info(res.message)
+            _this.loading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 批量实收
+    handlePlss () {
+      const _this = this
+      const snList = []
+      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+        snList.push(item.salesReturnDetailSn)
+      })
+      if (snList.length == 0) {
+        _this.$message.warning('请先选择产品!')
+        return
+      }
+      _this.$confirm({
+        title: '提示',
+        content: '确认要批量实收吗?',
+        centered: true,
+        onOk () {
+          _this.loading = true
+          _this.spinning = true
+          salesReturnDetailReceiveBatch(snList).then(res => {
+            if (res.status == 200) {
+              _this.$refs.table.clearSelected()
+              _this.resetSearchForm(false)
+              _this.$message.success(res.message)
+            }
+            _this.loading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 仓库实收数量修改
+    onCellBlurReceiveQty (val, record) {
+      //  光标移出,值发生改变再调用编辑接口
+      if (val && val != record.receiveQtyBackups) {
+        this.loading = true
+        this.spinning = true
+        salesReturnDetailUpdateReceiveQty({
+          salesReturnDetailSn: record.salesReturnDetailSn,
+          receiveQty: val
+        }).then(res => {
+          if (res.status == 200) {
+            this.resetSearchForm(false)
+            this.$message.success(res.message)
+          } else {
+            record.receiveQty = record.receiveQtyBackups
+          }
+          this.loading = false
+          this.spinning = false
+        })
+      } else {
+        record.receiveQty = record.receiveQtyBackups
+      }
+    },
+    // 修改退货原因
+    onCellBlurReturnReason (e, record) {
+      // 空或没有改变时不保存数据
+      if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
+        record.returnReason = record.returnReasonBackups
+        return
+      }
+      this.loading = true
+      this.spinning = true
+      salesReturnDetailUpdateReason({
+        salesReturnDetailSn: record.salesReturnDetailSn,
+        returnReason: record.returnReason
+      }).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm(false)
+          this.$message.success(res.message)
+        } else {
+          record.returnReason = record.returnReasonBackups
+        }
+        this.loading = false
+        this.spinning = false
+      })
+    },
+    // 获取单据详细
+    getOrderDetail () {
+      salesReturnDetail({ sn: this.orderSn }).then(res => {
+        this.ordeDetail = res.data || null
+      })
+    },
+    // 审核销售单
+    handleSubmit () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '提交后将进入品检环节,确认提交吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          salesReturnReceive({ salesReturnBillSn: _this.orderSn }).then(res => {
+            if (res.status == 200) {
+              _this.handleBack()
+              _this.$message.success(res.message)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  重置
+    resetSearchForm (flag) {
+      if (flag) {
+        this.queryParam.productName = ''
+        this.queryParam.productCode = ''
+        this.rowSelectionInfo = null
+        this.$refs.table.clearSelected()
+      }
+      this.$refs.table.refresh(flag)
+    },
+    searchForm () {
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.orderSn = this.$route.params.sn
+      this.getOrderDetail()
+    },
+    setTableH () {
+      this.tableHeight = window.innerHeight - 390
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.$refs.table.refresh(true)
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.$refs.table.refresh()
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .salesReturnReceive-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      height: 100%;
+    }
+    .footer-btn{
+      text-align: center;
+    }
+    .salesReturnReceive-cont{
+      margin-top: 10px;
+      .sTable{
+        margin-top: 10px;
+      }
+      .total-bar{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        > div{
+          &:last-child{
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            > div{
+              padding: 0 10px;
+            }
+          }
+        }
+      }
+    }
+    .redBg-row{
+      background-color: #f5beb4;
+    }
+    .orgBg-row{
+      background-color: #fffca2;
+    }
+  }
+</style>

+ 20 - 32
src/views/salesManagement/salesReturn/chooseCustomModal.vue → src/views/salesReturnManagement/salesReturn/chooseCustomModal.vue

@@ -5,7 +5,7 @@
     centered
     :maskClosable="false"
     :confirmLoading="confirmLoading"
-    :width="960"
+    :width="560"
     :footer="null"
     @cancel="cancel"
   >
@@ -19,8 +19,8 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-row :gutter="15">
-          <a-col :span="16">
-            <a-form-model-item label="客户名称" prop="buyerSn" :labelCol="{ span: 3 }" :wrapperCol="{ span: 20 }">
+          <a-col :span="20">
+            <a-form-model-item label="客户名称" prop="buyerSn">
               <a-select
                 show-search
                 id="chooseCustom-buyerSn"
@@ -38,31 +38,17 @@
           </a-col>
         </a-row>
         <a-row :gutter="15">
-          <a-col :span="8">
-            <a-form-model-item label="联系人">
-              {{ form.contactName || '--' }}
+          <a-col :span="20">
+            <a-form-model-item label="是否同步" prop="syncFlag">
+              <v-select
+                code="FLAG"
+                showType="radio"
+                id="chooseCustom-syncFlag"
+                v-model="form.syncFlag"
+                allowClear
+                placeholder="请选择"></v-select>
             </a-form-model-item>
           </a-col>
-          <a-col :span="6">
-            <a-form-model-item label="联系手机">
-              {{ form.contactTel || '--' }}
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="10">
-            <a-form-model-item label="客户地址">
-              {{ form.provinceName }}{{ form.cityName }}{{ form.countyName }}{{ form.customerAddr }}
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="15">
-          <a-col :span="8">
-            <a-form-model-item label="是否抓单" prop="grabFlag">
-              <v-select code="FLAG" id="chooseCustom-grabFlag" v-model="form.grabFlag" allowClear placeholder="请选择"></v-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
-          </a-col>
         </a-row>
         <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>
@@ -89,7 +75,7 @@ export default {
     return {
       opened: this.show,
       spinning: false,
-      title: '选择客户',
+      title: '新增销售退货单——选择客户',
       confirmLoading: false,
       formItemLayout: {
         labelCol: { span: 6 },
@@ -108,10 +94,11 @@ export default {
         countySn: '', // 区
         countyName: '',
         customerAddr: '', //  详细地址
-        grabFlag: '1' // 是否抓单
+        syncFlag: undefined // 是否同步
       },
       rules: {
-        buyerSn: [{ required: true, message: '请选择客户', trigger: ['change', 'blur'] }]
+        buyerSn: [{ required: true, message: '请选择客户', trigger: ['change', 'blur'] }],
+        syncFlag: [{ required: true, message: '请选择是否同步', trigger: ['change', 'blur'] }]
       },
       fetching: false,
       dealerData: []
@@ -122,7 +109,7 @@ export default {
     fetchUser (value) {
       console.log('fetching user', value)
       this.fetching = true
-      dealerSubareaScopeList({ nameLike: value, pageNo: 1, pageSize: 20 }).then(res => {
+      dealerSubareaScopeList({ nameLike: value.replace(/\s+/g, ''), pageNo: 1, pageSize: 20 }).then(res => {
         if (res.status == 200) {
           this.dealerData = res.data && res.data.list ? res.data.list : []
           this.fetching = false
@@ -170,7 +157,7 @@ export default {
         }
       })
     },
-    // 新建或编辑销售单
+    // 新建销售退货
     salesSaveFun () {
       const _this = this
       const form = this.form
@@ -202,8 +189,9 @@ export default {
         countySn: '', // 区
         countyName: '',
         customerAddr: '', //  详细地址
-        grabFlag: '1' // 是否抓单
+        syncFlag: undefined // 是否同步
       }
+      this.$refs.ruleForm.resetFields()
       this.dealerData = []
       this.$emit('cancel')
     }

+ 194 - 0
src/views/salesReturnManagement/salesReturn/chooseDepartUserModal.vue

@@ -0,0 +1,194 @@
+<template>
+  <a-modal
+    centered
+    class="departUser-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="title+'选择审批人员'"
+    v-model="isShow"
+    @cancel="cancel"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div>
+        <div class="departUser-con">
+          <a-form-model
+            id="departUser-form"
+            ref="ruleForm"
+            :model="form"
+            :rules="rules"
+            :label-col="formItemLayout.labelCol"
+            :wrapper-col="formItemLayout.wrapperCol">
+            <a-form-model-item label="退货类型" prop="salesReturnType">
+              <v-select
+                v-model="form.salesReturnType"
+                id="departUser-salesReturnType"
+                code="SALES_RETURN_TYPE"
+                placeholder="请选择退货类型"
+                allowClear></v-select>
+            </a-form-model-item>
+            <a-form-model-item label="申请人员" prop="applyPersonSn">
+              <employee style="width: 100%;" @change="employeeChange" id="departUser-Employee" v-model="form.applyPersonSn"></employee>
+            </a-form-model-item>
+            <a-form-model-item label="审批人员" prop="approvers">
+              <dingDepartUser
+                ref="departUserApp"
+                @loaded="uploading=false"
+                id="departUser-approvers"
+                :disabled="uploading"
+                v-model="form.approvers"
+                @change="changeApprovers"
+                allowClear
+                placeholder="请选择审批人员"
+              ></dingDepartUser>
+            </a-form-model-item>
+            <a-form-model-item label="抄送人" prop="ccList">
+              <dingDepartUser
+                ref="departUserCc"
+                @loaded="uploading=false"
+                :disabled="uploading"
+                id="departUser-ccList"
+                v-model="form.ccList"
+                allowClear
+                placeholder="请选择抄送人"
+              ></dingDepartUser>
+            </a-form-model-item>
+          </a-form-model>
+        </div>
+        <div class="btn-cont">
+          <a-button type="primary" id="departUser-save" @click="handleSave">确定</a-button>
+          <a-button :loading="uploading" style="margin-left: 15px;" @click="updateUser">刷新人员</a-button>
+          <a-button id="departUser-back" @click="cancel" style="margin-left: 15px;">取消</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import dingDepartUser from '@/views/common/dingDepartUser.js'
+import employee from '@/views/expenseManagement/expenseReimbursement/employee.js'
+export default {
+  name: 'ChooseDepartUserModal',
+  components: { dingDepartUser, employee, VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      uploading: false,
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      title: '',
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        salesReturnType: undefined,
+        applyPersonSn: undefined,
+        approvers: [], // 审批人
+        ccList: [] // 抄送人
+      },
+      rules: {
+        salesReturnType: [
+          { required: true, message: '请选择退货类型', trigger: 'change' }
+        ],
+        applyPersonSn: [
+          { required: true, message: '请选择申请人员', trigger: 'change' }
+        ],
+        approvers: [
+          { required: true, type: 'array', message: '请选择审批人', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    // 申请人员
+    employeeChange (v, r) {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.validateField(['applyPersonSn'])
+      })
+    },
+    updateUser () {
+      this.uploading = true
+      this.$refs.departUserApp.updateDeptUser()
+      // this.$refs.departUserCc.updateDeptUser()
+    },
+    changeApprovers (value) {
+      this.form.approvers = value
+      this.$refs.ruleForm.clearValidate()
+    },
+    getTreeVal (data) {
+      const ret = []
+      data.map(item => {
+        ret.push(item.value)
+      })
+      return ret.join(',')
+    },
+    // 确定
+    handleSave (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          if (form.approvers) {
+            form.approvers = this.getTreeVal(form.approvers)
+          }
+          if (form.ccList) {
+            form.ccList = this.getTreeVal(form.ccList)
+          }
+          console.log(form)
+          this.$emit('submit', form)
+          this.$emit('close')
+        } else {
+          return false
+        }
+      })
+    },
+    resetForm () {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.resetFields()
+      })
+      this.form = {
+        salesReturnType: undefined,
+        applyPersonSn: undefined,
+        ccList: undefined,
+        approvers: undefined
+      }
+    },
+    cancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .departUser-modal{
+    .ant-modal-body {
+      padding: 30px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 15 - 46
src/views/salesManagement/salesReturn/chooseImportModal.vue → src/views/salesReturnManagement/salesReturn/chooseImportModal.vue

@@ -27,7 +27,7 @@
       <!-- 不可导入数据 -->
       <p class="red">不可导入数据{{ unLoadData.length }}条</p>
       <a-table
-        class="unTable"
+        class="sTable"
         ref="unTable"
         size="small"
         :rowKey="(record) => record.errorDesc"
@@ -94,53 +94,23 @@ export default {
   },
   computed: {
     nowColumns () {
-      let arr = []
-      if (this.paramsData && this.paramsData.grabFlag == '0') {
-        arr = [
-          { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-          { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '价格', dataIndex: 'priceText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '退货原因', dataIndex: 'remark', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
-        ]
-      } else if (this.paramsData && this.paramsData.grabFlag == '1') {
-        arr = [
-          { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-          { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '价格', dataIndex: 'priceText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '退货原因', dataIndex: 'remark', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
-        ]
-      }
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'returnReason', width: 150, align: 'center', customRender: function (text) { return text || '--' } }
+      ]
       return arr
     },
     nowUnColumns () {
-      let arr = []
-      if (this.paramsData && this.paramsData.grabFlag == '0') {
-        arr = [
-          { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-          { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '价格', dataIndex: 'priceText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '退货原因', dataIndex: 'remark', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '备注', dataIndex: 'errorDesc', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
-        ]
-      } else if (this.paramsData && this.paramsData.grabFlag == '1') {
-        arr = [
-          { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-          { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '价格', dataIndex: 'priceText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '退货原因', dataIndex: 'remark', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '备注', dataIndex: 'errorDesc', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
-        ]
-      }
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'returnReason', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'errorDesc', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+      ]
       return arr
     }
   },
@@ -188,7 +158,6 @@ export default {
       }
       _this.spinning = true
       const params = {
-        grabFlag: _this.paramsData.grabFlag,
         list: _this.unLoadData
       }
       hdExportExcel(salesReturnFailExcel, params, '产品导入错误项', function () {

+ 301 - 0
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -0,0 +1,301 @@
+<template>
+  <div class="salesReturnDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesReturnDetail-cont">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack">
+            <a-icon type="left"></a-icon>
+            返回列表
+          </a>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="default"
+            class="button-info"
+            id="salesReturnEdit-preview-btn"
+            v-if="$hasPermissions('B_salesReturnPrint')"
+            :disabled="chooseLoadData.length==0"
+            @click="handlePrint('preview')">打印预览</a-button>
+          <a-button
+            key="2"
+            type="primary"
+            class="button-info"
+            id="salesReturnEdit-print-btn"
+            v-if="$hasPermissions('B_salesReturnPrint')"
+            :disabled="chooseLoadData.length==0"
+            @click="handlePrint('print')">快捷打印</a-button>
+          <a-divider type="vertical" />
+          <a-button
+            key="1"
+            type="primary"
+            class="button-warning"
+            id="salesReturnEdit-export-btn"
+            v-if="$hasPermissions('B_salesReturnExport')"
+            :disabled="chooseLoadData.length==0"
+            @click="handlePrint('export')">导出Excel</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="salesReturnDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="单据来源">{{ detailData&&detailData.salesReturnBillSourceDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="销售退货单号">{{ detailData&&detailData.salesReturnBillNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="客户采退申请单号">{{ detailData&&detailData.purchaseReturnApplyNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="是否同步给客户">{{ detailData&&detailData.syncFlag ? ['否', '是'][detailData.syncFlag] : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditTime || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货类型">{{ detailData&&detailData.salesReturnTypeDictValue || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <a-tabs v-model="curTab" @change="changeTab">
+          <a-tab-pane :key="1" tab="产品明细" force-render>
+            <a-alert style="margin-bottom: 10px;" type="info">
+              <div slot="message" class="total-bar">
+                <div>
+                  <span>申请退货数量:{{ detailData&&(detailData.totalInitialQty || detailData.totalInitialQty==0) ? detailData.totalInitialQty : '--' }};</span>
+                  <span>仓库实收数量:{{ detailData&&(detailData.totalReceiveQty || detailData.totalReceiveQty==0) ? detailData.totalReceiveQty : '--' }};</span>
+                  <span>坏件数量:{{ detailData&&(detailData.totalBadQty || detailData.totalBadQty==0) ? detailData.totalBadQty : '--' }};</span>
+                  <span>良品数量:{{ detailData&&(detailData.totalGoodQty || detailData.totalGoodQty==0) ? detailData.totalGoodQty : '--' }};</span>
+                  <span>返库数量:{{ detailData&&(detailData.totalBackStockQty || detailData.totalBackStockQty==0) ? detailData.totalBackStockQty : '--' }};</span>
+                  <span v-if="$hasPermissions('B_isShowPrice')">
+                    参考退货金额:{{ detailData&&(detailData.initialAmount || detailData.initialAmount==0) ? detailData.initialAmount : '--' }}元;
+                    实际退货金额:{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}元;
+                  </span>
+                </div>
+              </div>
+            </a-alert>
+            <div style="display:flex;align-items:center;justify-content: space-between;margin-bottom: 10px;">
+              <div>说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+            </div>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              :rowClassName="(record, index) => record.addFlag == '1' ? (record.addType == 'WAREHOUSE_RECEIVE'?'redBg-row':'orgBg-row'):''"
+              ref="table"
+              size="small"
+              :pageSize="10"
+              :rowKey="record => record.id"
+              :columns="columns"
+              :data="loadData"
+              bordered></s-table>
+          </a-tab-pane>
+          <a-tab-pane :key="2" tab="审核进度" >
+            <auditDetail v-if="$hasPermissions('B_salesReturnAudit')" ref="auditDetail" businessType="SALES_RETURN" :itemSn="$route.params.sn"></auditDetail>
+            <span v-else>您没有权限查看审核进度</span>
+          </a-tab-pane>
+          <a-tab-pane :key="3" tab="操作记录">
+            <s-table
+              class="sTable"
+              ref="operateTable"
+              size="small"
+              :rowKey="record => record.id"
+              :columns="operateColumns"
+              :data="operateLoadData"
+              bordered></s-table>
+          </a-tab-pane>
+        </a-tabs>
+      </a-card>
+    </a-spin>
+    <!-- 打印 -->
+    <div id="print"></div>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import auditDetail from '@/views/common/auditDetail.vue'
+import { salesReturnDetail, salesReturnChangeLogList, salesReturnPrint, salesReturnExport } from '@/api/salesReturn'
+import { salesReturnDetailList } from '@/api/salesReturnDetail'
+export default {
+  name: 'SalesReturnDetail',
+  mixins: [commonMixin],
+  components: { STable, VSelect, auditDetail },
+  data () {
+    return {
+      spinning: false,
+      disabled: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, { salesReturnBillSn: this.$route.params.sn })
+        return salesReturnDetailList(params).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.chooseLoadData = data.list
+            this.disabled = false
+          }
+          return data
+        })
+      },
+      chooseLoadData: [],
+      detailData: null, //  详情数据
+      visibleAudit: false,
+      spinningAudit: false,
+      curTab: 1,
+      queryStrList: [
+        { code: 0, text: '不显示退货单价/金额' },
+        { code: 1, text: '显示——按照申请退货数量计算' },
+        { code: 2, text: '显示——按照仓库实收数量计算' }
+      ],
+      showFlag: undefined,
+      // 操作记录
+      operateColumns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '操作时间', dataIndex: 'createDate', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '操作人员', dataIndex: 'changeUserName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作类型', dataIndex: 'logTypeName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作内容', dataIndex: 'logContent', width: '70%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      operateLoadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, { salesReturnBillSn: this.$route.params.sn })
+        return salesReturnChangeLogList(params).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
+          }
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '参考退货单价', dataIndex: 'initialPrice', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '参考退货金额', dataIndex: 'initialAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('B_isShowPrice') && this.showFlag != 0) { //  售价权限
+        arr.splice(10, 0, { title: '参考退货单价', dataIndex: 'initialPrice', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(11, 0, { title: '参考退货金额', dataIndex: 'initialAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(12, 0, { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(13, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    //  返回
+    handleBack () {
+      if (this.$route.query.path == 'receiveCheck') {
+        this.$router.push({ name: 'receiveCheckList' })
+      } else {
+        this.$router.push({ name: 'salesReturnList' })
+      }
+    },
+    //  详情
+    getDetail () {
+      this.curTab = 1
+      salesReturnDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      const a = ['WAIT_CUSTOMER_SERVICE_CONFIRM', 'WAIT_FINANCIAL_AUDIT', 'FINANCIAL_REJECT', 'FINISH'].find(item => item == this.detailData.billStatus)
+      const status = a ? 'SALES_RETURN_AMOUNT' : 'SALES_RETURN_REASON'
+      const params = { sn: this.$route.params.sn, status: status }
+      _this.spinning = true
+      // 导出
+      if (type == 'export') {
+        exportExcel(salesReturnExport, params, '销售退货', function () {
+          _this.spinning = false
+        })
+      } else {
+        // 打印或预览
+        printFun(salesReturnPrint, params, type, '销售退货', () => {
+          _this.spinning = false
+        })
+      }
+    },
+    changeTab (v) {
+      this.$nextTick(() => {
+        if (v == 1) {
+          this.$refs.table.refresh(true)
+        }
+        if (v == 2) {
+          this.$refs.auditDetail.refresh()
+        }
+        if (v == 3) {
+          this.$refs.operateTable.refresh(true)
+        }
+      })
+    },
+    pageInit () {
+      this.getDetail()
+      if (!this.disabled) {
+        this.$refs.table.refresh(true)
+      }
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+.salesReturnDetail-wrap {
+  .salesReturnDetail-cont {
+    margin-bottom: 10px;
+  }
+  .footer-cont{
+    margin-top: 5px;
+    text-align: center;
+  }
+  .redBg-row{
+    background-color: #f5beb4;
+  }
+  .orgBg-row{
+    background-color: #fffca2;
+  }
+}
+</style>

+ 16 - 35
src/views/salesManagement/salesReturn/importGuideModal.vue → src/views/salesReturnManagement/salesReturn/importGuideModal.vue

@@ -15,8 +15,8 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为<span>{{ params.grabFlag=='0'?'':'“销售单号”、' }}</span>“产品编码”、“数量”、“价格”、“退货原因”的列,且名称必须相同</li>
-            <li>2) 除了<span>{{ params.grabFlag=='0'?'':'“销售单号”、' }}</span>“产品编码”、“数量”、“价格”、“退货原因”<span>{{ params.grabFlag=='0'?'':'五' }}</span>列,其他列可自定义,不影响数据导入</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“价格”、“退货原因”的列,且名称必须相同</li>
+            <li>2) 除了“产品编码”、“数量”、“价格”、“退货原因”四列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
           <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
@@ -64,9 +64,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { exportExcel } from '@/libs/JGPrint'
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
-import { salesReturnDownload } from '@/api/salesReturn'
+import { downLoadTemp } from '@/api/data'
 export default {
   name: 'SalesReturnImportGuideModal',
   mixins: [commonMixin],
@@ -106,7 +107,6 @@ export default {
       if (file) {
         this.paramsData = {
           salesReturnBillSn: this.params.salesReturnBillSn || '',
-          grabFlag: this.params.grabFlag || '',
           path: file
         }
       }
@@ -123,43 +123,24 @@ export default {
       this.openImportModal = false
       this.isShow = false
     },
-    //  导出
+    // 下载模板
     handleExport () {
-      const _this = this
-      _this.spinning = true
-      salesReturnDownload({ grabFlag: this.params.grabFlag }).then(res => {
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
-          })
-          reader.readAsText(res)
-        } else {
-          this.download(res)
-        }
-      })
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
       const link = document.createElement('a')
       link.style.display = 'none'
-      link.href = url
-      let fname
-      if (this.params.grabFlag == '0') {
-        fname = '销售退货单产品导入模板-不抓单'
-      } else if (this.params.grabFlag == '1') {
-        fname = '销售退货单产品导入模板-抓单'
-      }
-      link.setAttribute('download', fname + '.xlsx')
+      link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/XiaoShouTuiHuoMingXiDaoRu.xlsx'
+      link.setAttribute('download', '销售退货单产品导入模板' + '.xlsx')
       document.body.appendChild(link)
       link.click()
+      document.body.removeChild(link)
     }
+    //  下载模板
+    // handleExport () {
+    //   const _this = this
+    //   _this.spinning = true
+    //   exportExcel(downLoadTemp, { type: 'XSTHMX' }, '销售退货单产品导入模板', function () {
+    //     _this.spinning = false
+    //   }, true)
+    // }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 154 - 118
src/views/salesManagement/salesReturn/list.vue → src/views/salesReturnManagement/salesReturn/list.vue

@@ -22,13 +22,35 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="销退单号">
-                  <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入销退单号"/>
+                <a-form-item label="总部销退单号">
+                  <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="客户采退单号">
-                  <a-input id="salesReturn-purchaseReturnBillNo" v-model.trim="queryParam.purchaseReturnBillNo" allowClear placeholder="请输入客户采退单号"/>
+                <a-form-item label="客户采退申请单号">
+                  <a-input id="salesReturn-purchaseReturnApplyNo" v-model.trim="queryParam.purchaseReturnApplyNo" allowClear placeholder="请输入客户采退申请单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据来源">
+                  <v-select
+                    v-model="queryParam.salesReturnBillSource"
+                    ref="salesReturnBillSource"
+                    id="salesReturn-salesReturnBillSource"
+                    code="SALES_SOURCE"
+                    placeholder="请选择单据来源"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="是否同步给客户">
+                  <v-select
+                    v-model="queryParam.syncFlag"
+                    ref="syncFlag"
+                    id="salesReturn-syncFlag"
+                    code="FLAG"
+                    placeholder="请选择是否同步给客户"
+                    allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -74,19 +96,11 @@
       <div class="table-operator">
         <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
       </div>
-      <!-- alert -->
-      <a-alert type="info" style="margin-bottom: 10px;">
-        <div slot="message">
-          <span v-if="$hasPermissions('B_isShowPrice')">退货总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? countData.totalAmount : '--' }}</strong>元;</span>
-          总单数:<strong>{{ countData&&(countData.totalRecord || countData.totalRecord==0) ? countData.totalRecord : '--' }}</strong>;
-          总数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : '--' }}</strong>;
-        </div>
-      </a-alert>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
         ref="table"
-        :style="{ height: tableHeight+84.5+'px' }"
+        :style="{ height: tableHeight+64.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -97,7 +111,7 @@
         <!-- 单号 -->
         <template slot="salesReturnBillNo" slot-scope="text, record">
           <div v-if="$hasPermissions('B_salesReturnDetail')">
-            <a-badge :count="'改'+record.changeTimes" :offset="[16,-13]" v-if="record.changeTimes>0" class="badge-con-t">
+            <a-badge :count="'改'" :offset="[16,-13]" v-if="record.changeFlag==1" class="badge-con-t">
               <span class="link-bule" @click="handleDetail(record)">{{ record.salesReturnBillNo }}</span>
             </a-badge>
             <span v-else class="link-bule" @click="handleDetail(record)">{{ record.salesReturnBillNo }}</span>
@@ -106,60 +120,66 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-warning"
-            v-if="(record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'FINANCIAL_REJECT')&&$hasPermissions('B_salesReturnAudit')"
-            @click="handleEexamine(record)"
-            id="salesReturn-eexamine-btn">审核</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-warning"
-            v-if="record.billStatus == 'WAIT_CHECK'&&$hasPermissions('B_salesReturnCheck')"
-            @click="handleCheck(record)"
-            id="salesReturn-eexamine-btn">品检</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource == 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesReturnEdit')"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="salesReturn-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource != 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'HQ_CHANGE'||record.billStatus == 'FINANCIAL_REJECT')&&$hasPermissions('B_salesReturnEdit')"
-            type="link"
-            class="button-info"
-            @click="handleEdit(record)"
-            id="salesReturn-edit-btn">改单</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource == 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesReturnDel')"
-            type="link"
-            class="button-error"
-            @click="handleDel(record)"
-            id="salesReturn-del-btn">删除</a-button>
-          <a-button
-            size="small"
-            v-if="record.salesReturnBillSource != 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'HQ_CHANGE'||record.billStatus == 'FINANCIAL_REJECT')&&$hasPermissions('B_salesReturnDel')"
-            type="link"
-            class="button-error"
-            @click="handleDel(record)"
-            id="salesReturn-del-btn">取消</a-button>
-          <span
-            v-if="!((record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'FINANCIAL_REJECT')&&$hasPermissions('B_salesReturnAudit')) &&
-              !(record.billStatus == 'WAIT_CHECK'&&$hasPermissions('B_salesReturnCheck')) &&
-              !(record.salesReturnBillSource == 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'AUDIT_REJECT')&&($hasPermissions('B_salesReturnEdit') || $hasPermissions('B_salesReturnDel'))) &&
-              !(record.salesReturnBillSource != 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'HQ_CHANGE'||record.billStatus == 'FINANCIAL_REJECT')&&($hasPermissions('B_salesReturnEdit') || $hasPermissions('B_salesReturnDel')))">--</span>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              v-if="record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesReturnAudit')"
+              @click="handleEexamine(record)"
+              id="salesReturn-eexamine-btn">审核进度</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              v-if="record.salesReturnBillSource != 'SALES'&&record.billStatus == 'WAIT_SUBMIT'&&$hasPermissions('B_salseReturnSubmit')"
+              @click="beforeSubmit(record)"
+              id="salesReturn-eexamine-btn">提交</a-button>
+            <a-button
+              size="small"
+              v-if="record.billStatus == 'WAIT_SUBMIT' && $hasPermissions('B_salesReturnEdit')"
+              type="link"
+              class="button-info"
+              @click="handleEdit(record)"
+              id="salesReturn-edit-btn">{{ record.salesReturnBillSource == 'SALES' ? '编辑' : '改单' }}</a-button>
+            <a-button
+              size="small"
+              v-if="record.billStatus == 'WAIT_SUBMIT' && $hasPermissions('B_salesReturnDel')"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+              id="salesReturn-del-btn">{{ record.salesReturnBillSource == 'SALES' ? '删除' : '取消' }}</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="record.salesReturnBillSource == 'SALES'&&record.billStatus == 'AUDIT_REJECT'&& $hasPermissions('B_salesReturnAgainEdit')"
+              @click="handleAgainEdit(record)"
+              id="salesReturn-edit-btn">再次编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="record.billStatus == 'WAIT_RECEIVE'&& $hasPermissions('B_newPickUp')"
+              @click="handlePickUp(record)"
+              id="salesReturn-edit-btn">申请提货</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              v-if="(record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'WAIT_CUSTOMER_SERVICE_CONFIRM')&& $hasPermissions('B_salesReturnConfirm')"
+              @click="handleConfirm(record)"
+              id="salesReturn-edit-btn">客服确认</a-button>
+          </div>
         </template>
       </s-table>
     </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="handleEdit" @cancel="openModal=false"></choose-custom-modal>
-    <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_CHECK')" @fail="auditOrder('AUDIT_REJECT')" />
+    <!-- 审核进度 -->
+    <verifyModal :openModal="visibleAudit" :itemSn="auditInfo&&auditInfo.salesReturnBillSn" @close="visibleAudit=false"></verifyModal>
+    <!-- 选择审核人员 -->
+    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
   </a-card>
 </template>
 
@@ -170,9 +190,10 @@ import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
 import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
-import auditModal from '@/views/common/auditModal.vue'
+import verifyModal from './verifyModal.vue'
+import chooseDepartUserModal from './chooseDepartUserModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { salesReturnList, salesReturnQueryCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
+import { salesReturnList, updateAgain, salesReturnDel, salesReturnSubmit } from '@/api/salesReturn'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 export default {
@@ -184,7 +205,8 @@ export default {
     chooseCustomModal,
     dealerSubareaScopeList,
     rangeDate,
-    auditModal,
+    verifyModal,
+    chooseDepartUserModal,
     subarea
   },
   data () {
@@ -199,6 +221,7 @@ export default {
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  创建时间
       openModal: false, // 选择客户弹框是否显示
+      openDepartUserModal: false,
       // 查询参数
       queryParam: {
         beginDate: getDate.getThreeMonthDays().starttime,
@@ -207,19 +230,17 @@ export default {
         endAuditDate: '',
         buyerSn: undefined, //  客户名称
         salesReturnBillNo: undefined, //  总部销退单号
-        purchaseReturnBillNo: '',
+        purchaseReturnApplyNo: '',
+        syncFlag: undefined, // 是否同步给客户
         billStatus: undefined, // 业务状态
-        // financialStatus: undefined, // 财务状态
         subareaSn: undefined,
-        shippingAddrProvinceSn: undefined
+        shippingAddrProvinceSn: undefined,
+        salesReturnBillSource: undefined
       },
-      countData: null, // 统计数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        // 查询总计
-        this.getQueryCount(Object.assign(parameter, this.queryParam))
         return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -243,24 +264,22 @@ export default {
   computed: {
     columns () {
       const arr = [
-        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户采退单号', dataIndex: 'purchaseReturnBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否同步给客户', dataIndex: 'syncFlag', width: '7%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
+        { title: '客户采退申请单号', dataIndex: 'purchaseReturnApplyNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
-        { title: '退货客户', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'totalBadQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '退款金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '是否抓单', dataIndex: 'grabFlag', width: '6%', align: 'center', customRender: function (text) { return ['否', '是'][text] } },
-        { title: '审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'totalGoodQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '财务状态', dataIndex: 'financialStatusDictValue', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(9, 0, { title: '退款金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return arr
     }
   },
@@ -278,15 +297,39 @@ export default {
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
-    // 列表统计
-    getQueryCount (params) {
-      salesReturnQueryCount(params).then(res => {
-        this.countData = res.data || null
-      })
+    // 客服确认
+    handleConfirm (row) {
+      this.$router.push({ name: 'custConfirm', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+    },
+    // 申请提货
+    handlePickUp (row) {
+      this.$store.state.app.tempBillOfData = row
+      this.$router.push({ name: 'billOfLadingAdd', query: { path: 'salerReturn' } })
     },
     // 编辑
     handleEdit (row) {
-      this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+      this.$router.push({ name: 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+    },
+    // 再次编辑
+    handleAgainEdit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '系统将自动生成一个新的销售退货单,与原单据内容相同。确认再次编辑吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          updateAgain({ salesReturnBillSn: row.salesReturnBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
     },
     // 详情
     handleDetail (row) {
@@ -313,53 +356,46 @@ export default {
         }
       })
     },
-    //  审核
+    //  审核进度
     handleEexamine (row) {
       this.auditInfo = row
       this.visibleAudit = true
     },
-    auditOrder (billStatus) {
-      this.spinningAudit = true
-      salesReturnAudit({
-        salesReturnBillSn: this.auditInfo.salesReturnBillSn,
-        billStatus: billStatus
-      }).then(res => {
+    beforeSubmit (row) {
+      this.auditInfo = row
+      this.openDepartUserModal = true
+    },
+    // 提交
+    handleSubmit (data) {
+      this.spinning = true
+      salesReturnSubmit({ salesReturnBillSn: this.auditInfo.salesReturnBillSn, ...data }).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
+          this.$message.success(res.message)
         }
+        this.spinning = false
       })
     },
-    // 品检
-    handleCheck (row) {
-      this.$router.push({ name: 'salesReturnCheck', params: { sn: row.salesReturnBillSn } })
-    },
     resetSearchForm () {
-      this.$refs.rangeCreateDate.resetDate()
-      this.$refs.rangeExamineDate.resetDate()
+      this.$refs.rangeCreateDate.resetDate(this.createDate)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+
+      this.$refs.rangeExamineDate.resetDate()
       this.queryParam.beginAuditDate = ''
       this.queryParam.endAuditDate = ''
+
       this.queryParam.buyerSn = undefined
       this.$refs.dealerSubareaScopeList.resetForm()
       this.queryParam.salesReturnBillNo = ''
-      this.queryParam.purchaseReturnBillNo = ''
+      this.queryParam.purchaseReturnApplyNo = ''
       this.queryParam.billStatus = undefined
       this.queryParam.subareaSn = undefined
+      this.queryParam.syncFlag = undefined
+      this.queryParam.salesReturnBillSource = undefined
       this.queryParam.shippingAddrProvinceSn = undefined
       this.$refs.table.refresh(true)
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  省/市/区
     getArea (leve, sn) {
       let params
@@ -397,7 +433,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 270
+      this.tableHeight = window.innerHeight - tableSearchH - 215
     }
   },
   watch: {

+ 181 - 0
src/views/salesReturnManagement/salesReturn/queryPart.vue

@@ -0,0 +1,181 @@
+<template>
+  <div class="salesReturnList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <div style="width:80%">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="salesReturnList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="salesReturnList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </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="salesReturnList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :customRow="handleClickRow"
+      :defaultLoadData="false"
+      :scroll="{ y: 300 }"
+      bordered>
+      <!-- 申请退货数量 -->
+      <template slot="qty" slot-scope="text, record">
+        <div @dblclick.stop>
+          <a-input-number
+            size="small"
+            v-model="record.qty"
+            :precision="0"
+            :min="1"
+            :max="999999"
+            style="width: 100%;"
+            placeholder="请输入" />
+        </div>
+      </template>
+      <!-- 退货原因 -->
+      <template slot="returnReason" slot-scope="text, record">
+        <div @dblclick.stop>
+          <returnReason v-model="record.returnReason"></returnReason>
+        </div>
+      </template>
+      <span slot="customTitle">
+        操作
+        <a-popover>
+          <template slot="content">
+            双击列表配件可快速选中添加
+          </template>
+          <a-icon type="question-circle" theme="twoTone" />
+        </a-popover>
+      </span>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-info"
+          :disabled="newLoading"
+          v-if="record.productPrice"
+          @click="handleAdd(record)"
+        >添加</a-button>
+        <span v-else>--</span>
+      </template>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { queryStockProductPage } from '@/api/stock'
+import returnReason from '@/views/common/returnReason'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'QueryPart',
+  components: { STable, VSelect, returnReason },
+  props: {
+    newLoading: Boolean,
+    isShowPrice: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      buyerSn: '',
+      priceType: '',
+      queryParam: { //  查询条件
+        productName: '', // 产品名称
+        productCode: '' //  产品编码
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.queryParam.dealerSn = this.buyerSn
+        return queryStockProductPage(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
+              data.list[i].qty = 1
+            }
+            this.disabled = false
+          }
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 双击列表选择配件
+    handleClickRow (record) {
+      const _this = this
+      return {
+        on: {
+          dblclick: (event) => {
+            event.stopPropagation()
+            if (record.productPrice) {
+              _this.$emit('add', record)
+            }
+          }
+        }
+      }
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.$refs.table.refresh(true)
+    },
+    pageInit (buyerSn) {
+      this.buyerSn = buyerSn
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '27%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '申请退货数量', dataIndex: 'qty', width: '9%', align: 'center', scopedSlots: { customRender: 'qty' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '10%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice') && this.isShowPrice) { //  售价权限
+        arr.splice(4, 0, { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      this.columns = arr
+      this.resetSearchForm()
+    },
+    // 选择配件
+    handleAdd (row) {
+      this.$emit('add', row)
+    },
+    refreshData () {
+      this.$refs.table.refresh()
+    }
+  }
+}
+</script>
+<style lang="less">
+  .salesReturnList-wrap{
+    .redBg-row{
+      background-color: #f5cdc8;
+    }
+  }
+</style>

+ 520 - 0
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -0,0 +1,520 @@
+<template>
+  <div class="salesReturnEdit-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="default"
+            class="button-info"
+            id="salesReturnEdit-preview-btn"
+            v-if="$hasPermissions('B_salesReturnPrint')"
+            :disabled="chooseLoadData.length==0"
+            @click="handlePrint('preview')">打印预览</a-button>
+          <a-button
+            key="2"
+            type="primary"
+            class="button-info"
+            id="salesReturnEdit-print-btn"
+            v-if="$hasPermissions('B_salesReturnPrint')"
+            :disabled="chooseLoadData.length==0"
+            @click="handlePrint('print')">快捷打印</a-button>
+          <a-divider type="vertical" />
+          <a-button
+            key="1"
+            type="primary"
+            class="button-warning"
+            id="salesReturnEdit-export-btn"
+            v-if="$hasPermissions('B_salesReturnExport')"
+            :disabled="chooseLoadData.length==0"
+            @click="handlePrint('export')">导出Excel</a-button>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
+        <!-- 查询配件列表 -->
+        <queryPart ref="partQuery" :newLoading="isInster" @add="saveProduct"></queryPart>
+      </a-card>
+      <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
+        <a-alert style="margin-bottom: 10px;" type="info">
+          <div slot="message" class="total-bar">
+            <div>
+              <span>申请退货数量:{{ ordeDetail&&(ordeDetail.totalInitialQty || ordeDetail.totalInitialQty==0) ? ordeDetail.totalInitialQty : '--' }};</span>
+              <span v-if="$hasPermissions('B_isShowPrice')">参考退货金额:{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? ordeDetail.totalAmount : '--' }}元;</span>
+            </div>
+          </div>
+        </a-alert>
+        <div class="table-page-search-wrapper" style="display:flex;align-items: center;justify-content: space-between;">
+          <div style="flex-grow:1;">
+            <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-row :gutter="15">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品编码">
+                    <a-input v-model.trim="productForm.productCode" allowClear placeholder="请输入产品编码"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品名称">
+                    <a-input v-model.trim="productForm.productName" allowClear placeholder="请输入产品名称"/>
+                  </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">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form>
+          </div>
+          <div>
+            <span style="margin-right: 10px;" v-if="selNums">已选{{ selNums }}项</span>
+            <a-button type="default" class="button-info" @click="openPlSetReason">批量设置退货原因</a-button>
+            <a-button type="primary" class="button-info" id="salesReturnEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
+          </div>
+        </div>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          :scroll="{ y: 300 }"
+          bordered>
+          <!-- 本次退货数量 -->
+          <template slot="qty" slot-scope="text, record">
+            <a-input-number
+              id="salesReturn-qty"
+              size="small"
+              v-model="record.initialQty"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              placeholder="请输入"
+              @blur="e => onCellBlur(e.target.value, record, 'qty')"
+              style="width: 100%;" />
+          </template>
+          <!-- 退货原因 -->
+          <template slot="returnReason" slot-scope="text, record">
+            <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              :loading="delLoading"
+              class="button-error"
+              @click="handleDel(record)"
+              id="salesReturn-Del">删除</a-button>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+    <div class="affix-cont">
+      <a-button
+        size="large"
+        style="padding: 0 60px;"
+        :disabled="spinning"
+        type="primary"
+        class="button-primary"
+        @click="beforeSubmit()"
+        id="salesReturn-handleSubmit">提交</a-button>
+    </div>
+    <!-- 选择审核人员 -->
+    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
+    <!-- 批量设置退货原因 -->
+    <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
+      <div style="text-align: center;">
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+        <div style="line-height: 24px;">
+          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
+        </div>
+      </div>
+    </commonModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import ImportGuideModal from './importGuideModal.vue'
+import queryPart from './queryPart.vue'
+import commonModal from '@/views/common/commonModal.vue'
+import EditableCell from '@/views/common/editInput.js'
+import chooseDepartUserModal from './chooseDepartUserModal.vue'
+import returnReason from '@/views/common/returnReason'
+import {
+  salesReturnDetail,
+  salesReturnSubmit,
+  salesReturnBatchInsert,
+  salesReturnPrint,
+  salesReturnExport
+} from '@/api/salesReturn'
+import {
+  salesReturnDetailList,
+  salesReturnDetailDel,
+  salesReturnDetailInsert,
+  salesReturnDetailUpdateQty,
+  salesReturnDetailUpdateReason,
+  salesReturnDetailSetReason
+} from '@/api/salesReturnDetail'
+export default {
+  name: 'SalesReturnEdit',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    queryPart,
+    EditableCell,
+    ImportGuideModal,
+    chooseDepartUserModal,
+    returnReason,
+    commonModal
+  },
+  data () {
+    return {
+      spinning: false,
+      orderId: null,
+      orderSn: null,
+      buyerSn: null,
+      disabled: false,
+      isInster: false, // 是否正在添加产品
+      openDepartUserModal: false,
+      ordeDetail: { discountAmount: 0 },
+      delLoading: false,
+      // 已选产品
+      dataSource: [],
+      productForm: {
+        salesReturnBillSn: '',
+        productName: '',
+        productCode: ''
+      },
+      chooseLoadData: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // 查询总计
+        this.productForm.salesReturnBillSn = this.$route.params.sn
+        return salesReturnDetailList(Object.assign(parameter, this.productForm)).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
+              data.list[i].qtyBackups = data.list[i].initialQty
+              data.list[i].returnReasonBackups = data.list[i].returnReason
+            }
+            this.disabled = false
+            this.chooseLoadData = data.list
+            this.total = res.data.count
+          }
+          return data
+        })
+      },
+      openGuideModal: false, //  导入产品引导
+      total: 0,
+      rowSelectionInfo: null,
+      plReturnReason: '',
+      showPlModal: false
+    }
+  },
+  watch: {
+    showPlModal (newValue, oldValue) {
+      if (!newValue) {
+        this.plReturnReason = ''
+      }
+    }
+  },
+  computed: {
+    selNums () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '8%', scopedSlots: { customRender: 'qty' } },
+        { title: '退货原因', dataIndex: 'returnReason', align: 'center', width: '13%', scopedSlots: { customRender: 'returnReason' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(4, 0, { title: '参考退货单价', dataIndex: 'price', align: 'center', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '参考退货金额', align: 'center', dataIndex: 'totalAmount', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'salesReturnList', query: { closeLastOldTab: true } })
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 已选产品  blur
+    onCellBlur (val, record, type) {
+      const valBackups = record.qtyBackups
+      //  光标移出,值发生改变再调用编辑接口
+      if (val && val != valBackups) {
+        this.spinning = true
+        salesReturnDetailUpdateQty({
+          salesReturnDetailSn: record.salesReturnDetailSn,
+          initialQty: record.initialQty,
+          price: record.price
+        }).then(res => {
+          if (res.status == 200) {
+            this.resetTable(false)
+            this.$message.success(res.message)
+            this.spinning = false
+            record.qtyBackups = record.initialQty
+          } else {
+            this.spinning = false
+            record.initialQty = valBackups
+          }
+        })
+      } else {
+        record.initialQty = valBackups
+      }
+    },
+    // 修改退货原因
+    updateReason (row) {
+      console.log(row.returnReason)
+      // 空或没有改变时不保存数据
+      if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
+        row.returnReason = row.returnReasonBackups
+        return
+      }
+      this.spinning = true
+      salesReturnDetailUpdateReason({
+        salesReturnDetailSn: row.salesReturnDetailSn,
+        returnReason: row.returnReason
+      }).then(res => {
+        if (res.status == 200) {
+          this.resetTable(false)
+          this.$message.success(res.message)
+        } else {
+          row.returnReason = row.returnReasonBackups
+        }
+        this.spinning = false
+      })
+    },
+    // 批量设置退货原因
+    openPlSetReason () {
+      if (this.selNums) {
+        this.showPlModal = true
+      } else {
+        this.$message.warning('请先选择产品!')
+      }
+    },
+    setPlReturnReason () {
+      if (this.plReturnReason == '') {
+        this.$message.warning('请输入退货原因!')
+      } else {
+        this.spinning = true
+        const snList = []
+        const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        arr.map(item => {
+          snList.push(item.salesReturnDetailSn)
+        })
+        salesReturnDetailSetReason({
+          salesReturnBillDetailSnList: snList,
+          returnReason: this.plReturnReason
+        }).then(res => {
+          if (res.status == 200) {
+            this.showPlModal = false
+            this.$refs.table.clearSelected()
+            this.resetTable(false)
+          }
+          this.spinning = false
+        })
+      }
+    },
+    // 获取单据详细
+    getOrderDetail () {
+      salesReturnDetail({ sn: this.orderSn }).then(res => {
+        this.ordeDetail = res.data || null
+      })
+    },
+    // 删除产品
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.delLoading = true
+          _this.spinning = true
+          salesReturnDetailDel({ salesReturnDetailSn: row.salesReturnDetailSn }).then(res => {
+            if (res.status == 200) {
+              _this.resetTable(false)
+            }
+            _this.$message.info(res.message)
+            _this.delLoading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    resetTable (flag) {
+      this.$refs.table.refresh(flag)
+      this.getOrderDetail()
+    },
+    //  重置
+    resetSearchForm (flag) {
+      this.productForm.productName = ''
+      this.productForm.productCode = ''
+      this.$refs.table.refresh(!!flag)
+      this.getOrderDetail()
+    },
+    // 添加或修改产品
+    saveProduct (row) {
+      // 防止多次添加产品
+      if (this.isInster) {
+        return
+      }
+      this.isInster = true
+      const params = {
+        'salesReturnBillSn': this.orderSn,
+        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
+        'price': row.productPrice,
+        'cost': row.lastStockCost,
+        'returnReason': row.returnReason,
+        'productSn': row.productSn,
+        'initialQty': row.qty
+      }
+      this.spinning = true
+      salesReturnDetailInsert(params).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm(true)
+          this.$message.success(res.message)
+        }
+        this.isInster = false
+        this.spinning = false
+      })
+    },
+    beforeSubmit () {
+      if (this.total) {
+        const hasKong = this.chooseLoadData.find(item => !item.returnReason)
+        if (hasKong) {
+          this.$message.warning('请输入退货原因!')
+        } else {
+          this.openDepartUserModal = true
+        }
+      } else {
+        this.$message.warning('请添加产品!')
+      }
+    },
+    // 提交销售退货
+    handleSubmit (data) {
+      this.spinning = true
+      salesReturnSubmit({ salesReturnBillSn: this.orderSn, ...data }).then(res => {
+        if (res.status == 200) {
+          this.handleBack()
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+      })
+    },
+    closeGuideModel () {
+      this.openGuideModal = false
+    },
+    // 导入产品
+    hanldeOk (obj) {
+      salesReturnBatchInsert(obj).then(res => {
+        if (res.status == 200) {
+          this.resetTable(true)
+        }
+      })
+    },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      const a = ['WAIT_CUSTOMER_SERVICE_CONFIRM', 'WAIT_FINANCIAL_AUDIT', 'FINANCIAL_REJECT', 'FINISH'].find(item => item == this.ordeDetail.billStatus)
+      const status = a ? 'SALES_RETURN_AMOUNT' : 'SALES_RETURN_REASON'
+      const params = { sn: this.$route.params.sn, status: status }
+      _this.spinning = true
+      // 导出
+      if (type == 'export') {
+        exportExcel(salesReturnExport, params, '销售退货', function () {
+          _this.spinning = false
+        })
+      } else {
+        // 打印或预览
+        printFun(salesReturnPrint, params, type, '销售退货', () => {
+          _this.spinning = false
+        })
+      }
+    },
+    pageInit () {
+      this.orderSn = this.$route.params.sn
+      this.buyerSn = this.$route.params.buyerSn
+      this.resetSearchForm(true)
+      this.$refs.partQuery.pageInit(this.buyerSn, 0)
+    }
+  },
+  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">
+  .salesReturnEdit-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
+    .salesReturnEdit-cont{
+      margin-top: 10px;
+      .total-bar{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        > div{
+          &:last-child{
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            > div{
+              padding: 0 10px;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 49 - 0
src/views/salesReturnManagement/salesReturn/verifyModal.vue

@@ -0,0 +1,49 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="销售退货单审核进度"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <auditDetail v-if="isShow" ref="auditDetail" businessType="SALES_RETURN" @loadError="isShow = false" :itemSn="itemSn"></auditDetail>
+  </a-modal>
+</template>
+
+<script>
+import auditDetail from '@/views/common/auditDetail.vue'
+export default {
+  name: 'VerifyModal',
+  components: { auditDetail },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.auditDetail.clearTable()
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 1 - 1
vue.config.js

@@ -107,7 +107,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.0.102/ocs-admin',
+        // target: 'http://192.168.0.102:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
         target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,