瀏覽代碼

Merge branch 'feat-two'

zh 2 年之前
父節點
當前提交
fbc21317f5
共有 100 個文件被更改,包括 11199 次插入2276 次删除
  1. 88 0
      src/api/barcode.js
  2. 60 1
      src/api/basic_data/dealer.js
  3. 9 0
      src/api/basic_data/material.js
  4. 10 1
      src/api/dashboard.js
  5. 19 0
      src/api/deposit_list_v2.js
  6. 48 0
      src/api/executionRecord.js
  7. 42 0
      src/api/logisticsBill.js
  8. 56 3
      src/api/policy_list.js
  9. 107 0
      src/api/priceType.js
  10. 15 0
      src/api/sales.js
  11. 17 0
      src/api/setting.js
  12. 19 0
      src/api/stock.js
  13. 68 0
      src/api/supply/salesReturnOrder.js
  14. 73 0
      src/api/transferOrder.js
  15. 660 0
      src/components/LogisticsTabs/index.vue
  16. 97 10
      src/components/NotifyBox/index.vue
  17. 2 2
      src/components/ReturnSalesHeader/ReturnSalesHeader.vue
  18. 93 68
      src/components/SalesDialog/SalesDialog.vue
  19. 44 41
      src/components/SalesHeader/SalesHeader.vue
  20. 6 12
      src/components/SalesTable/SalesTable.vue
  21. 8 3
      src/components/template/template-page-1.vue
  22. 75 1
      src/layout/components/AppMain.vue
  23. 26 0
      src/utils/common.js
  24. 98 0
      src/views/barcode/barcodeImport.vue
  25. 98 0
      src/views/barcode/barcodeVerification.vue
  26. 80 0
      src/views/barcode/largeStockBarcode.vue
  27. 72 0
      src/views/barcode/utboundBarcode.vue
  28. 185 75
      src/views/basic_data/dealer/components/dealer_list-detail.vue
  29. 420 0
      src/views/basic_data/dealer/components/subMerchantDetail.vue
  30. 254 0
      src/views/basic_data/dealer/components/subMerchantForm.vue
  31. 45 12
      src/views/basic_data/dealer/dealer_list.vue
  32. 135 0
      src/views/basic_data/dealer/subMerchant.vue
  33. 18 3
      src/views/basic_data/material/modify_list.vue
  34. 293 0
      src/views/basic_data/priceSalesType.vue
  35. 234 0
      src/views/basic_data/priceType.vue
  36. 103 0
      src/views/delayRecord/delayRecordList.vue
  37. 204 10
      src/views/deposit_home/components/deposit-apply-surrender.vue
  38. 260 61
      src/views/deposit_home/components/deposit_list-detail.vue
  39. 196 1
      src/views/deposit_home/components/deposit_replenish.vue
  40. 152 6
      src/views/deposit_home/components/refund_list-detail.vue
  41. 151 6
      src/views/deposit_home/components/refund_reexamine.vue
  42. 151 5
      src/views/deposit_home/components/refund_replenish.vue
  43. 96 39
      src/views/deposit_home/deposit_list.vue
  44. 67 50
      src/views/deposit_home/refund_list.vue
  45. 102 0
      src/views/executionRecord/commercial.vue
  46. 384 0
      src/views/executionRecord/orderDetail.vue
  47. 103 0
      src/views/executionRecord/policy.vue
  48. 102 0
      src/views/executionRecord/retail.vue
  49. 52 66
      src/views/finance/components/rebate_list-edit.vue
  50. 83 0
      src/views/logisticsBill/components/reconciliationDetail.vue
  51. 73 0
      src/views/logisticsBill/logisticsExpenses.vue
  52. 111 0
      src/views/logisticsBill/reconciliation.vue
  53. 72 0
      src/views/logisticsBill/subExpenses.vue
  54. 103 0
      src/views/replaceRecord/replaceRecordList.vue
  55. 16 16
      src/views/sales_control/adjust_warehouse.vue
  56. 30 30
      src/views/sales_control/preposition_stock_list.vue
  57. 27 68
      src/views/sales_control/sales_management/components/customer_sales_details.vue
  58. 61 26
      src/views/sales_control/sales_management/components/customer_sales_form.vue
  59. 272 57
      src/views/sales_control/sales_management/components/return_sales_details.vue
  60. 36 47
      src/views/sales_control/sales_management/components/return_sales_form.vue
  61. 16 16
      src/views/sales_control/sales_management/customer_sales_list.vue
  62. 15 15
      src/views/sales_control/sales_management/return_sales_list.vue
  63. 122 104
      src/views/sales_policy/components/AddCondition.vue
  64. 84 30
      src/views/sales_policy/components/AddPolicy.vue
  65. 401 245
      src/views/sales_policy/components/Examine.vue
  66. 114 0
      src/views/sales_policy/components/OperationRecords.vue
  67. 567 151
      src/views/sales_policy/components/TabelTransfer.vue
  68. 164 0
      src/views/sales_policy/components/delayRecordForm.vue
  69. 650 93
      src/views/sales_policy/components/details.vue
  70. 104 37
      src/views/sales_policy/components/editPolicy.vue
  71. 420 0
      src/views/sales_policy/components/replaceRecordForm.vue
  72. 71 16
      src/views/sales_policy/policy_list.vue
  73. 438 0
      src/views/setting/jiaxianSubAccount.vue
  74. 1 1
      src/views/setting/sub_account.vue
  75. 35 12
      src/views/stock_control/preposition_stock_list.vue
  76. 17 51
      src/views/stock_control/sales_management/components/customer_sales_details.vue
  77. 17 15
      src/views/stock_control/sales_management/components/customer_sales_form.vue
  78. 19 15
      src/views/stock_control/sales_management/components/return_sales_details.vue
  79. 39 41
      src/views/stock_control/sales_management/components/return_sales_form.vue
  80. 104 105
      src/views/supply/apply/engin_list.vue
  81. 114 274
      src/views/supply/engin/components/home_detail.vue
  82. 33 4
      src/views/supply/engin/components/home_examine.vue
  83. 104 12
      src/views/supply/engin/components/home_form.vue
  84. 56 27
      src/views/supply/engin/components/home_return.vue
  85. 18 14
      src/views/supply/engin/home_list.vue
  86. 15 15
      src/views/supply/implement/components/sales_detail.vue
  87. 2 2
      src/views/supply/implement/components/sales_return_form.vue
  88. 30 13
      src/views/supply/pickup/check.vue
  89. 599 91
      src/views/supply/pickup/components/pickup_form.vue
  90. 37 29
      src/views/supply/pickup/pickup_list.vue
  91. 24 14
      src/views/supply/pickup/sum_list.vue
  92. 6 0
      src/views/supply/policy/components/retail_detail.vue
  93. 6 0
      src/views/supply/policy/components/retail_examine.vue
  94. 20 2
      src/views/supply/policy/components/retail_form.vue
  95. 6 0
      src/views/supply/policy/components/retail_return.vue
  96. 76 72
      src/views/supply/retail/components/retail_detail.vue
  97. 29 23
      src/views/supply/retail/components/retail_examine.vue
  98. 28 13
      src/views/supply/retail/components/retail_form.vue
  99. 15 2
      src/views/supply/retail/components/retail_return.vue
  100. 2 2
      src/views/supply/sales/components/sales_return_form.vue

+ 88 - 0
src/api/barcode.js

@@ -0,0 +1,88 @@
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListCodeV2(params) {
+  return request({
+    url: `/customer/code/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListCodeV2(data, name) {
+  return postBlob({
+    url: '/customer/code/user/export/v2',
+    data,
+    name
+  })
+}
+
+export function getListCustomerCodeV2(params) {
+  return request({
+    url: `/customer/code/listCustomer/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListCustomerCodeV2(data, name) {
+  return postBlob({
+    url: '/customer/code/listCustomer/export/v2',
+    data,
+    name
+  })
+}
+
+export function importListCustomerCodeV2(data) {
+  return handleImport('customer/code/import', data.formdata, data.id || '')
+}
+
+export function luBaoDownloadDownload(data, name) {
+  return getBlob({
+    url: '/customer/code/ShangJiaDownload',
+    data,
+    name
+  })
+}
+
+export function getListCustomerCheckV2(params) {
+  return request({
+    url: `/customer/code/listCustomerCheck/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListCustomerCheck(data, name) {
+  return postBlob({
+    url: '/customer/code/listCustomerCheck/export/v2',
+    data,
+    name
+  })
+}
+
+export function importListCustomerCheck(data) {
+  return handleImport('customer/code/importCheck', data.formdata, data.id || '')
+}
+
+export function listCustomerCheckDownload(data, name) {
+  return getBlob({
+    url: '/customer/code/download',
+    data,
+    name
+  })
+}
+
+export function getListDaCangV2(params) {
+  return request({
+    url: `/customer/code/listDaCang/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListDaCangV2(data, name) {
+  return postBlob({
+    url: '/customer/code/listDaCang/export/v2',
+    data,
+    name
+  })
+}

+ 60 - 1
src/api/basic_data/dealer.js

@@ -13,6 +13,13 @@ export function exportDealerListV2(data, name) {
     name
   })
 }
+export function exportJiaXianV2(data, name) {
+  return postBlob({
+    url: '/customer/user/export/jiaXianV2',
+    data,
+    name
+  })
+}
 export function getDealerStockListV2(params) {
   return request({
     url: `/customer/pt/list/v2?moduleId=${params.moduleId}`,
@@ -28,6 +35,50 @@ export function exportDealerStockListV2(data, name) {
   })
 }
 
+export function getStagecustomerListV2(params) {
+  return request({
+    url: `/StageCustomer/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportStagecustomerV2(data, name) {
+  return postBlob({
+    url: '/StageCustomer/user/export/v2',
+    data,
+    name
+  })
+}
+export function addStagecustomer(data) {
+  return request({
+    url: '/StageCustomer/add',
+    method: 'post',
+    data
+  })
+}
+export function examineStagecustomer(params) {
+  return request({
+    url: '/StageCustomer/examine',
+    method: 'post',
+    params
+  })
+}
+export function updateStagecustomer(data) {
+  return request({
+    url: '/StageCustomer/update',
+    method: 'post',
+    data
+  })
+}
+
+export function getStageCustomerDetail(params) {
+  return request({
+    url: '/StageCustomer/detail',
+    method: 'get',
+    params
+  })
+}
+
 export function importCustomerV2(data) {
   return handleImport('customer/import', data.formdata, data.id || '')
 }
@@ -230,7 +281,6 @@ export function importCustomer(data, name) {
   })
 }
 
-
 //基础上设置自提和物流
 export function updatePick(params) {
   return request({
@@ -239,3 +289,12 @@ export function updatePick(params) {
     params
   })
 }
+
+// 经销商绑定售后系统
+export function updateSystem(params) {
+  return request({
+    url: '/customer/updateSystem',
+    method: 'post',
+    params
+  })
+}

+ 9 - 0
src/api/basic_data/material.js

@@ -224,6 +224,15 @@ export function getProductRriceEdit(params) {
     data: params
   })
 }
+// 弃审产品调价单
+export function productUpdPriceReview(params) {
+  return request({
+    url: '/product-upd-price/review',
+    method: 'post',
+    params
+  })
+}
+
 
 // 产品调价单-列表
 export function v2ProductUpdPriceList(data) {

+ 10 - 1
src/api/dashboard.js

@@ -80,7 +80,7 @@ export function setMenuList(params) {
   })
 }
 
-// 常用菜单-列表
+// 物流通知列表
 export function getListInvoiceOrder(params) {
   return request({
     url: `/pick/listInvoiceOrder`,
@@ -88,3 +88,12 @@ export function getListInvoiceOrder(params) {
     params
   })
 }
+
+// 物流通知20秒拉取新消息
+export function getListInvoiceOrderTWO(params) {
+  return request({
+    url: `/pick/listInvoiceOrderTWO`,
+    method: 'get',
+    params
+  })
+}

+ 19 - 0
src/api/deposit_list_v2.js

@@ -15,3 +15,22 @@ export function depositManageHomeListExport(data, name) {
     name
   })
 }
+
+export function getCountList(data) {
+  return request({
+    url: `/v2/deposit-manage/home/count-list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function updateDepositManageenginInfo(data) {
+  return request({
+    url: `/deposit-manage/update-engin-info`,
+    method: 'post',
+    data
+  })
+}
+
+
+

+ 48 - 0
src/api/executionRecord.js

@@ -0,0 +1,48 @@
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListTradeExecV2(params) {
+  return request({
+    url: `/v2/order/trade-e/exec/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListTradeExecV2(data, name) {
+  return postBlob({
+    url: '/v2/order/trade-e/exec/list/export',
+    data,
+    name
+  })
+}
+
+export function getListRetailExecV2(params) {
+  return request({
+    url: `/v2/order/retail/exec/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListRetailExecV2(data, name) {
+  return postBlob({
+    url: '/v2/order/retail/exec/list/export',
+    data,
+    name
+  })
+}
+
+export function getListOtherExecV2(params) {
+  return request({
+    url: `/v2/order/other/exec/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListOtherExecV2(data, name) {
+  return postBlob({
+    url: '/v2/order/other/exec/list/export',
+    data,
+    name
+  })
+}

+ 42 - 0
src/api/logisticsBill.js

@@ -0,0 +1,42 @@
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListCostBillV2(params) {
+  return request({
+    url: `/customer/costBill/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function getOrderTrackList2(params) {
+  return request({
+    url: `/customer/frontOrder/orderTrackList?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+
+
+export function exportListCostBillV2(data, name) {
+  return postBlob({
+    url: '/customer/costBill/list/export',
+    data,
+    name
+  })
+}
+
+export function getListSubCostBillV2(params) {
+  return request({
+    url: `/customer/costBill/listV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListSubCostBillV2(data, name) {
+  return postBlob({
+    url: '/customer/costBill/listV2/export',
+    data,
+    name
+  })
+}
+

+ 56 - 3
src/api/policy_list.js

@@ -9,7 +9,7 @@ export function policyListV2(data) {
   })
 }
 
-//政策列表V2-导出
+// 政策列表V2-导出
 export function policyListV2Export(data, name) {
   return postBlob({
     url: '/policy/list/v2/export',
@@ -254,7 +254,7 @@ export function saleTypeRebateListV2(data) {
     data
   })
 }
-//销售类型列表V2-导出
+// 销售类型列表V2-导出
 export function saleTypeRebateListV2Export(data, name) {
   return postBlob({
     url: '/sale/type/list/v2/export',
@@ -453,7 +453,7 @@ export function walletRebateSaletypeListV2(data) {
   })
 }
 
-//返利钱包销售类型V2-导出
+// 返利钱包销售类型V2-导出
 export function walletRebateSaletypeListV2Export(data, name) {
   return postBlob({
     url: '/wallet/rebate_saletype/list/v2/export',
@@ -529,3 +529,56 @@ export function setStauts(params) {
     params
   })
 }
+
+// 政策-批量修改延期时间
+export function updateDelayPolicy(params) {
+  return request({
+    url: '/policy/batch/delay/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 政策-批量修改机型
+export function updateMaterialPolicy(params) {
+  return request({
+    url: '/policy/batch/material/update',
+    method: 'post',
+    params
+  })
+}
+// 政策对应经销商-批量设置提货数量/批量备注
+export function updateCustomerCountBatch(params) {
+  return request({
+    url: '/policy/customer_count/batch',
+    method: 'post',
+    params
+  })
+}
+
+// 经销商购买上限-批量修改起提数/提数数
+export function updateLimitBatchupdate(params) {
+  return request({
+    url: '/policy/limit/batchupdate',
+    method: 'post',
+    params
+  })
+}
+
+// 经销商配提套数购买上限-列表
+export function getPolicyLimitGroupList(params) {
+  return request({
+    url: '/policy/limit/group/list',
+    method: 'get',
+    params
+  })
+}
+
+// 经销商配提套数上限-批量修改配提套数
+export function updateLimitGrouppdate(params) {
+  return request({
+    url: '/policy/limit/group/batchupdate',
+    method: 'post',
+    params
+  })
+}

+ 107 - 0
src/api/priceType.js

@@ -0,0 +1,107 @@
+import request, { postBlob } from '@/utils/request'
+export function getProductPriceListV2(params) {
+  return request({
+    url: `/product-price/v2/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportProductPriceListV2(data, name) {
+  return postBlob({
+    url: '/product-price/v2/list/export',
+    data,
+    name
+  })
+}
+export function addProductPrice(params) {
+  return request({
+    url: `/price-type/add`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function editProductPrice(params) {
+  return request({
+    url: `/price-type/edit`,
+    method: 'post',
+    data: params
+  })
+}
+export function updateProductPriceStatus(params) {
+  return request({
+    url: `/price-type/status/update`,
+    method: 'post',
+    params
+  })
+}
+export function getProductPriceDetail(params) {
+  return request({
+    url: `/price-type/detail`,
+    method: 'get',
+    params
+  })
+}
+export function delProductPrice(params) {
+  return request({
+    url: `/price-type/del`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function getPriceSalesRelaListV2(params) {
+  return request({
+    url: `/price-sales-rela/v2/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportPriceSalesRelaListV2(data, name) {
+  return postBlob({
+    url: '/price-sales-rela/v2/list/export',
+    data,
+    name
+  })
+}
+
+export function addPriceSalesRela(params) {
+  return request({
+    url: `/price-sales-rela/add`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function editPriceSalesRela(params) {
+  return request({
+    url: `/price-sales-rela/edit`,
+    method: 'post',
+    data: params
+  })
+}
+export function updatePriceSalesRelaStatus(params) {
+  return request({
+    url: `/price-sales-rela/status/update`,
+    method: 'post',
+    params
+  })
+}
+
+export function getPriceSalesRelaDetail(params) {
+  return request({
+    url: `/price-sales-rela/detail`,
+    method: 'get',
+    params
+  })
+}
+
+export function delPriceSalesRela(params) {
+  return request({
+    url: `/price-sales-rela/del`,
+    method: 'post',
+    data: params
+  })
+}

+ 15 - 0
src/api/sales.js

@@ -140,6 +140,21 @@ export function listOrder(params) {
     data: params
   })
 }
+export function setSendRevoke(params) {
+  return request({
+    url: '/customer/frontOrder/sendRevoke',
+    method: 'post',
+    params
+  })
+}
+export function sendRefundRevoke(params) {
+  return request({
+    url: '/customer/frontOrder/sendRefundRevoke',
+    method: 'post',
+    params
+  })
+}
+
 
 
 // 下拉框查询

+ 17 - 0
src/api/setting.js

@@ -503,3 +503,20 @@ export function setUserChanging(params) {
 }
 
 
+// 嘉贤子帐号列表
+export function getJiaXianUserList(params) {
+  return request({
+    url: '/admin/user/listJiaXian',
+    method: 'get',
+    params
+  })
+}
+
+// 新建嘉贤经销商子账号
+export function addJiaXianUser(params) {
+  return request({
+    url: '/admin/user/user/child/addJiaXian',
+    method: 'post',
+    params
+  })
+}

+ 19 - 0
src/api/stock.js

@@ -311,4 +311,23 @@ export function salseExport(data, name) {
     data,
     name
   })
+}
+
+
+// 导入库存初始化
+export function kunCunImportData(data) {
+  return handleImport("/customer/front/kunCunImportData", data.formdata, data.id || "");
+}
+
+// 导入库存调整
+export function kunCunTiaoImportData(data) {
+  return handleImport("/customer/front/kunCunTiaoImportData", data.formdata, data.id || "");
+}
+
+export function downloadkunCunDownload(data, name) {
+  return getBlob({
+    url: 'customer/front/kunCunDownload',
+    data,
+    name
+  })
 }

+ 68 - 0
src/api/supply/salesReturnOrder.js

@@ -0,0 +1,68 @@
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 销售政策退订单-列表
+export function refundRetailListV2(data) {
+  return request({
+    url: `/v2/refund/retail/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//销售政策退订单-导出
+export function refundRetailListV2Export(data, name) {
+  return postBlob({
+    url: '/v2/refund/retail/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+// 零售退订单-列表
+export function refundOtherListV2(data) {
+  return request({
+    url: `/v2/refund/other/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//零售退订单-导出
+export function refundOtherListV2Export(data, name) {
+  return postBlob({
+    url: '/v2/refund/other/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+// 商用工程退订单-列表
+export function refundTradeListV2(data) {
+  return request({
+    url: `/v2/refund/trade-e/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//商用工程退订单-导出
+export function refundTradeListV2Export(data, name) {
+  return postBlob({
+    url: '/v2/refund/trade-e/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+
+// 退订单-详情
+export function getRefundDetail(data) {
+  return request({
+    url: `/v2/refund/detail`,
+    method: 'post',
+    params: data
+  })
+}

+ 73 - 0
src/api/transferOrder.js

@@ -0,0 +1,73 @@
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListTransferV2(params) {
+  return request({
+    url: `/customer/transfer/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListTransferV2(data, name) {
+  return postBlob({
+    url: '/customer/transfer/list/export',
+    data,
+    name
+  })
+}
+
+export function addCustomerTransfer(data) {
+  return request({
+    url: '/customer/transfer/add',
+    method: 'post',
+    data
+  })
+}
+
+export function updateCustomerTransfer(data) {
+  return request({
+    url: '/customer/transfer/update',
+    method: 'post',
+    data
+  })
+}
+
+export function getCustomerTransferDetail(params) {
+  return request({
+    url: '/customer/transfer/detail',
+    method: 'get',
+    params
+  })
+}
+
+export function examineCustomerTransfer(data) {
+  return request({
+    url: '/customer/transfer/examine',
+    method: 'post',
+    params: data
+  })
+}
+
+export function invoiceCustomerTransfer(data) {
+  return request({
+    url: '/customer/transfer/invoice',
+    method: 'post',
+    params: data
+  })
+}
+
+export function setNeExamine(data) {
+  return request({
+    url: '/customer/transfer/NeExamine',
+    method: 'post',
+    params: data
+  })
+}
+
+export function dletransferDelete(data) {
+  return request({
+    url: '/customer/transfer/delete',
+    method: 'post',
+    params: data
+  })
+}
+

+ 660 - 0
src/components/LogisticsTabs/index.vue

@@ -0,0 +1,660 @@
+<template>
+  <div class="logistics">
+    <div style="margin: 20px 0">
+      <el-radio-group v-model="curTarget" size="small" @change="handleChange">
+        <template v-for="(item, index) in tabsList">
+          <el-radio-button v-if="item.show " :key="index" :label="item.value">{{ item.label }}</el-radio-button>
+        </template>
+      </el-radio-group>
+    </div>
+    <el-card v-if="curTarget === 1 && tabsList[curTarget - 1].show ">
+      <div slot="header">
+        <span>物流信息</span>
+      </div>
+      <slot name="header" />
+      <div>
+        <el-timeline v-if="logisticsDetail.length" :reverse="false">
+          <el-timeline-item
+            v-for="(item, index) in logisticsDetail"
+            :key="index"
+            placement="top"
+            type="success"
+            :timestamp="item.time"
+          >
+            <el-row :gutter="20">
+              <el-col class="logistics-title"> {{ statusObj[item.status].label }} </el-col>
+              <el-col>
+                <div class="flex">
+                  <div>{{ item.comment }}</div>
+                  <!-- <div>{{ item.createTime }}</div> -->
+                </div>
+                <div class="flex">
+                  <div>{{ item.statusDetails }}</div>
+                  <!-- <div>{{ item.createTime }}</div> -->
+                </div>
+              </el-col>
+            </el-row>
+          </el-timeline-item>
+        </el-timeline>
+        <div v-else class="tip">暂无物流信息</div>
+      </div>
+    </el-card>
+    <el-card v-if="curTarget === 2 && tabsList[curTarget - 1].show ">
+      <div slot="header">
+        <span>物流费用</span>
+      </div>
+      <zj-table
+        :table-attributes="defaultTableAttributes"
+        :is-drop="true"
+        :columns="formLogistics"
+        :table-data="logisticsData"
+      />
+    </el-card>
+    <el-card v-if="curTarget === 3 && tabsList[curTarget - 1].show">
+      <div slot="header">
+        <span>出库条码</span>
+      </div>
+      <zj-table :is-drop="true" :columns="formOutbound" :table-data="outboundData" />
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { getListCostBillV2, getOrderTrackList2 } from '@/api/logisticsBill'
+import { getListCodeV2 } from '@/api/barcode'
+
+export default {
+  props: {
+    jiaxianOrderId: {
+      type: String,
+      default: null
+    },
+    detailsId: {
+      type: String,
+      default: null
+    },
+    returnShow: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data() {
+    return {
+      tabsList: [
+        {
+          label: '物流状态',
+          value: 1,
+          show: true,
+          fun: this.getOrderTrackList2
+        },
+        {
+          label: '物流费用',
+          value: 2,
+          show: false,
+          fun: this.getListCostBillV2
+        },
+        {
+          label: '出库条码',
+          value: 3,
+          show: true,
+          fun: this.getListCodeV2
+        }
+      ],
+      curTarget: 1,
+      statusObj: {
+        COLLECT: {
+          label: '揽收',
+          value: 'COLLECT'
+        },
+        OUT_OF_STOCK: {
+          label: '出库',
+          value: 'OUT_OF_STOCK'
+        },
+        ARRIVE_BRANCH: {
+          label: '到达网点',
+          value: 'ARRIVE_BRANCH'
+        },
+        DELIVERING: {
+          label: '派送中',
+          value: 'DELIVERING'
+        },
+        SIGNED: {
+          label: '已签收',
+          value: 'SIGNED'
+        },
+        RETURN: {
+          label: '退件',
+          value: 'RETURN'
+        },
+        REJECTION: {
+          label: '拒收',
+          value: 'REJECTION'
+        },
+        RESCHEDULE: {
+          label: '改约',
+          value: 'RESCHEDULE'
+        },
+        OTHER_EXCEPTION: {
+          label: '其他异常',
+          value: 'OTHER_EXCEPTION'
+        }
+      },
+      defaultTableAttributes: {
+        height: '100%',
+        border: true,
+        size: 'mini',
+        'summary-method': this.$getSummaries,
+        'show-summary': true
+      },
+      logisticsData: [],
+      outboundData: [],
+      logisticsDetail: []
+    }
+  },
+  computed: {
+    formLogistics() {
+      return [
+        {
+          columnAttributes: {
+            label: '补贴费用',
+            prop: 'allowanceCost',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '所属销售公司类型',
+            prop: 'belongCompanyType',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { belongCompanyType } = row
+            const typeObj = {
+              GE_JIANG: '格匠',
+              GUANG_ZHOU: '广州销售公司',
+              FO_SHAN: '佛山销售公司',
+              OTHER: '其他销售公司'
+            }
+            return <div>{typeObj[belongCompanyType]}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '运费结算系数',
+            prop: 'coefficient',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'comment',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '最终运费',
+            prop: 'cost',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '客户名称',
+            prop: 'customerName',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '客户电话',
+            prop: 'customerPhone',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '无法生成的原因',
+            prop: 'errorResult',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否已经对过帐',
+            prop: 'isAccountChecking',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { isAccountChecking } = row
+            return <div>{+isAccountChecking ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否已经审核',
+            prop: 'isAudit',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { isAudit } = row
+            return <div>{+isAudit ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否完结',
+            prop: 'isFinish',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { isFinish } = row
+            return <div>{+isFinish ? '已经完结' : '未完结'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '实际是否卸货',
+            prop: 'isRealUnload',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { isRealUnload } = row
+            return <div>{+isRealUnload ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '实际是否上楼',
+            prop: 'isRealUpstairs',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { isRealUpstairs } = row
+            return <div>{+isRealUpstairs ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否卸货',
+            prop: 'isUnload',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { isUnload } = row
+            return <div>{+isUnload ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '是否上楼',
+            prop: 'isUpstairs',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { isUpstairs } = row
+            return <div>{+isUpstairs ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料名称',
+            prop: 'materialCode',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '计费分类',
+            prop: 'materialCostType',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品名称',
+            prop: 'materialName',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'materialSpecification',
+            width: 350
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料类型',
+            prop: 'materialType',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商家编码',
+            prop: 'merchantCode',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商家名称',
+            prop: 'merchantName',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '订单号',
+            prop: 'orderCode',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '订单时间',
+            prop: 'orderDate',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '订单类型',
+            prop: 'orderType',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { orderType } = row
+            const typeObj = {
+              TOB: '商家机工程机类型',
+              ALL: '所有类型,广州的订单统一 开单价',
+              TOC: '佛山销售销售订单类型公司'
+            }
+            return <div>{typeObj[orderType]}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '订单类型细分',
+            prop: 'orderTypeDetail',
+            width: 200
+          },
+          render: (h, { row }) => {
+            const { orderType } = row
+            const typeObj = {
+              PICKING_UP_ORDER: '前置仓提货订单',
+              SALE_ORDER: '销售订单',
+              MERCHANT_WAREHOUSE_ORDER: '商家仓订单',
+              PROJECT_ORDER: '工程机订单',
+              SALE_RETURN_ORDER: '销售退货单'
+            }
+            return <div>{typeObj[orderType]}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '收货送货地址',
+            prop: 'receiptAddress',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '退货单号',
+            prop: 'returnOrderCode',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '补贴结算系数',
+            prop: 'subsidyCoefficient',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '嘉贤创建时间',
+            prop: 'time',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '费用汇总',
+            prop: 'totalCost',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单价计算',
+            prop: 'unitPrice',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '卸货上楼结算系数',
+            prop: 'unloadUpstairsCoefficient',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '上楼卸货费用',
+            prop: 'unloadUpstairsCost',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '发货仓库编码',
+            prop: 'warehouseCode',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '发货仓库名称',
+            prop: 'warehouseName',
+            width: 200
+          }
+        }
+      ]
+    },
+    formOutbound() {
+      return [
+        {
+          columnAttributes: {
+            label: '条码',
+            prop: 'barCode',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '出库时间',
+            prop: 'consignerTime',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '出库时间',
+            prop: 'consignerTimeV2',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '创建人',
+            prop: 'createBy',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '创建时间',
+            prop: 'createTime',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '送货时间',
+            prop: 'deliveryTime',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '送货时间',
+            prop: 'deliveryTimeV2',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料代码',
+            prop: 'materialCode',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料类型',
+            prop: 'materialType',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '销售订单号',
+            prop: 'orderNumber',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '收货人',
+            prop: 'receiptCompany',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '商家名称',
+            prop: 'salesCompany',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格',
+            prop: 'specification',
+            width: 350
+          }
+        },
+        {
+          columnAttributes: {
+            label: '更新人',
+            prop: 'updateBy',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '修改时间',
+            prop: 'updateTime',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '发货仓库名称',
+            prop: 'warehouse',
+            width: 200
+          }
+        }
+      ]
+    }
+  },
+  mounted() {
+    this.getOrderTrackList2()
+  },
+  methods: {
+    handleChange() {
+      this.tabsList[this.curTarget - 1].fun()
+    },
+    getOrderTrackList2() {
+      getOrderTrackList2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            param: 'sale_code',
+            compare: '=',
+            value: this.jiaxianOrderId
+          }
+        ]
+      }).then(res => {
+        this.logisticsDetail = res.data.records
+      })
+    },
+    getListCostBillV2() {
+      getListCostBillV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            param: 'order_code',
+            compare: '=',
+            value: this.jiaxianOrderId
+          }
+        ]
+      }).then(res => {
+        res.data.records.forEach(item => {
+          item.sums1 = ['orderHasSendQty', 'subsidyCoefficient', 'unloadUpstairsCoefficient', 'coefficient']
+          item.sums2 = ['cost', 'unitPrice', 'totalCost', 'allowanceCost']
+        })
+        this.logisticsData = res.data.records
+      })
+    },
+    getListCodeV2() {
+      getListCodeV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            param: 'order_number',
+            compare: '=',
+            value: this.jiaxianOrderId
+          }
+        ]
+      }).then(res => {
+        this.outboundData = res.data.records
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-timeline-item__tail {
+  border-left: 2px solid #67c23a;
+}
+::v-deep .el-form-item__content {
+  line-height: 33px;
+}
+.logistics-title {
+  padding: 10px;
+}
+.logistics {
+  margin: 20px 0;
+}
+
+</style>

+ 97 - 10
src/components/NotifyBox/index.vue

@@ -88,6 +88,50 @@
     </div>
     <!-- 物流通知 -->
     <div v-show="type === 3" class="table">
+      <el-form ref="invoiceOrderForm" :model="invoiceOrderForm" label-width="120px" label-position="left" size="mini">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item prop="invoiceId" label="发货单">
+              <el-input v-model="invoiceOrderForm.invoiceId" />
+            </el-form-item>
+          </el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="time" label="发货单时间">
+            <el-date-picker
+              v-model="invoiceOrderForm.time"
+              style="width: 100%"
+              type="daterange"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            /></el-form-item></el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="userName" label="收货客户">
+            <el-input v-model="invoiceOrderForm.userName" /> </el-form-item></el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="address" label="收货地址">
+            <el-input v-model="invoiceOrderForm.address" /> </el-form-item></el-col>
+          <el-col
+            :xs="24"
+            :sm="12"
+            :lg="8"
+          ><el-form-item prop="remark" label="内容"> <el-input v-model="invoiceOrderForm.remark" /> </el-form-item></el-col>
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-button size="mini" @click="handleReset($event,'invoiceOrde')">重置</el-button>
+            <el-button size="mini" type="primary" @click="getListInvoiceOrder">查询</el-button>
+          </el-col>
+        </el-row>
+      </el-form>
       <el-table
         ref="table"
         v-loading="listLoading"
@@ -134,7 +178,7 @@
                 <div style="display: flex">
                   <el-input v-model="specification" clearable style="margin-right: 10px" />
                   <el-button @click="handleReset">重置</el-button>
-                  <el-button type="primary" @click="getArrivalNotice">查询</el-button>
+                  <el-button type="primary" size="mini" @click="getArrivalNotice">查询</el-button>
                 </div>
               </el-form-item>
             </el-col>
@@ -224,10 +268,10 @@
                 :preview-src-list="[imageURL + item.url]"
               />
               <div v-else class="box2" @click="openLink(item.url)">
-                <img v-if="checkFileType(item.url) == 'word'" src="@/assets/common/word.png" />
-                <img v-if="checkFileType(item.url) == 'excel'" src="@/assets/common/excel.png" />
-                <img v-if="checkFileType(item.url) == 'ppt'" src="@/assets/common/ppt.png" />
-                <img v-if="checkFileType(item.url) == 'pdf'" src="@/assets/common/pdf.png" />
+                <img v-if="checkFileType(item.url) == 'word'" src="@/assets/common/word.png">
+                <img v-if="checkFileType(item.url) == 'excel'" src="@/assets/common/excel.png">
+                <img v-if="checkFileType(item.url) == 'ppt'" src="@/assets/common/ppt.png">
+                <img v-if="checkFileType(item.url) == 'pdf'" src="@/assets/common/pdf.png">
                 <div class="name ellipsis-3">{{ item.name }}</div>
               </div>
             </div>
@@ -289,6 +333,8 @@ import { getArrivalNotice } from '@/api/stock'
 import { getListOrderTrack } from '@/api/supply/pickup'
 import { getFileUrl } from '@/api/common'
 export default {
+  // eslint-disable-next-line vue/require-prop-types
+  props: ['mesType'],
   data() {
     return {
       imageURL: this.$imageUrl,
@@ -308,17 +354,39 @@ export default {
       logisticsDetail: [],
       arrivalNoticeList: [],
       specification: '',
+      invoiceOrderForm: {
+        time: [],
+        invoiceId: '',
+        address: '',
+        startTime: '',
+        endTime: '',
+        remark: '',
+        userName: ''
+      },
       fnArr: ['getDataList', 'getFileList', 'getRebateList', 'getListInvoiceOrder', 'getArrivalNotice']
     }
   },
   computed: {
     ...mapGetters(['showMessages', 'isCustomer'])
   },
+  watch: {
+    mesType(newValue, oldValue) {
+      if (!oldValue) {
+        this.type = newValue
+        this[this.fnArr[newValue]]()
+      }
+      this.$emit('reset')
+    }
+  },
   created() {
     this[this.fnArr[this.type]]()
   },
   methods: {
     checkFn(i) {
+      this.listTotal = 0
+      this.pageSize = 10
+      this.currentPage = 1
+      this.listLoading = false
       this[this.fnArr[i]]()
     },
     // 获取文件列表数据
@@ -357,9 +425,13 @@ export default {
     },
     // 获取物流列表
     async getListInvoiceOrder() {
+      const time = this.invoiceOrderForm.time || []
       const data = {
         pageSize: this.pageSize,
-        pageNum: this.currentPage
+        pageNum: this.currentPage,
+        ...this.invoiceOrderForm,
+        startTime: time.length ? time[0] : '',
+        endTime: time.length ? time[1] : ''
       }
       const res = await getListInvoiceOrder(data)
       this.invoiceOrderList = res.data.records
@@ -375,11 +447,16 @@ export default {
       this.arrivalNoticeList = res.data.records
       this.listTotal = res.data.total
     },
-    handleReset() {
+    handleReset(e, type) {
       this.pageSize = 10
       this.pageNum = 1
-      this.specification = ''
-      this.getArrivalNotice()
+      if (type) {
+        this.$refs.invoiceOrderForm.resetFields()
+        this.getListInvoiceOrder()
+      } else {
+        this.specification = ''
+        this.getArrivalNotice()
+      }
     },
     // 更改每页数量
     handleSizeChange(val) {
@@ -406,6 +483,7 @@ export default {
         }
       })
       this.type = 0
+      this.$emit('reset')
       this.$store.commit('user/showMessage', 'no')
     },
     // 确认查收
@@ -451,6 +529,7 @@ export default {
     // 关闭
     closeFn() {
       this.type = 0
+      this.$emit('reset')
       this.$store.commit('user/showMessage', 'no')
     },
     handLogistics(row) {
@@ -468,10 +547,18 @@ export default {
     handleJump(id) {
       this.$router.push({ path: `/supply/pickup/sum_list?id=${id}` })
       this.type = 0
+      this.$emit('reset')
       this.$store.commit('user/showMessage', 'no')
     }
   }
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+::v-deep .el-form-item--mini .el-form-item__content, ::v-deep .el-form-item--mini .el-form-item__label{
+  line-height: 27px;
+}
+::v-deep .el-range-editor--mini .el-range-separator {
+  line-height: 27px;
+}
+</style>

+ 2 - 2
src/components/ReturnSalesHeader/ReturnSalesHeader.vue

@@ -46,7 +46,7 @@
         </el-col>
         <el-col :span="details.id?8:24" class="item">
           <div class="label">发货仓库名称</div>
-          <div class="value">{{ storeObj[details.stockType] || '' }}</div>
+          <div class="value">{{storeObj[details.stockType]}}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">退货备注</div>
@@ -71,7 +71,7 @@ export default {
   data() {
     return {
       storeObj: {
-        1: '前置仓', 2: '商家仓'
+        1: '嘉贤前置仓', 2: '商家自提仓'
       }
     }
   },

+ 93 - 68
src/components/SalesDialog/SalesDialog.vue

@@ -1,40 +1,54 @@
 <template>
   <div>
-    <el-dialog
-      title="添加产品"
-      :visible.sync="dialogVisible"
-      :before-close="onClose"
-      width="75%"
-    >
+    <el-dialog title="添加产品" :visible.sync="dialogVisible" :before-close="onClose" width="75%">
       <template-page
-        style="width: 100%;
-        height: 100%;"
         ref="pageRef"
-        :getList="getList"
-        :tableAttributes="tableAttributes"
-        :tableEvents="tableEvents"
-      >
-      </template-page>
+        style="width: 100%; height: 100%"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :replace-or-not-map="false"
+      />
       <span slot="footer" class="dialog-footer">
-    <el-button @click="$parent.dialogVisible = false" size="mini">取 消</el-button>
-    <el-button type="primary" @click="confirm" size="mini">确 定</el-button>
-  </span>
+        <el-button size="mini" @click="$parent.dialogVisible = false">取 消</el-button>
+        <el-button type="primary" size="mini" @click="confirm">确 定</el-button>
+      </span>
     </el-dialog>
   </div>
 </template>
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
+import { boolean } from 'yargs'
 
 export default {
   components: { TemplatePage },
   mixins: [import_mixin],
   props: {
-    dialogVisible: false,
-    func: Function,
-    customerNumber:String,
-    returnId:String,
-    itemId:String
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    func: {
+      type: Function,
+      default: () => {}
+    },
+    customerNumber: {
+      type: String,
+      default: null
+    },
+    returnId: {
+      type: String,
+      default: null
+    },
+    itemId: {
+      type: String,
+      default: null
+    },
+    dataList: {
+      type: Array,
+      default: () => []
+    }
   },
   data() {
     return {
@@ -70,7 +84,7 @@ export default {
       tableAttributes: {
         // 启用勾选列
         selectColumn: true,
-        selectable:this.selectable
+        selectable: this.selectable
       },
       // 表格事件
       tableEvents: {
@@ -93,8 +107,6 @@ export default {
     },
     // 监听勾选变化
     selectionChange(data) {
-
-
       this.recordSelected = data
     },
     addWarehouse() {
@@ -106,77 +118,90 @@ export default {
     detailsWarehouse() {
       this.pageType = 3
     },
-    onClose(){
+    onClose() {
       this.$parent.dialogVisible = false
-
     },
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             (
-            <el-button
-              size="mini"
-              type="primary"
-              onClick={() => {
-              }}
-            >
+            <el-button size='mini' type='primary' onClick={() => {}}>
               查看
             </el-button>
-            ) }
-            (
-            <el-button
-              size="mini"
-              type="primary"
-              onClick={() => {
-              }}
-            >
+            ) } (
+            <el-button size='mini' type='primary' onClick={() => {}}>
               审批
             </el-button>
             ) }
-            {(
-              <el-popconfirm
-                title="是否确定操作?"
-                onConfirm={() => {
-                }}
-              >
-                <el-button size="mini" type="primary" slot="reference">
+            {
+              <el-popconfirm title='是否确定操作?' onConfirm={() => {}}>
+                <el-button size='mini' type='primary' slot='reference'>
                   确认返还
                 </el-button>
               </el-popconfirm>
-            )}
+            }
           </div>
         )
       }
-
     },
-    confirm(){
-      if (this.recordSelected.length){
-        this.$emit('confirm',this.recordSelected)
-      }else{
+    confirm() {
+      if (this.recordSelected.length) {
+        this.$emit('confirm', this.recordSelected)
+      } else {
         this.$errorMsg('请选择产品')
       }
       // this.$parent.dialogVisible = false
     },
-    selectable(row,index){
-      if (this.customerNumber){
-        if (row.customerNumber == this.customerNumber && row.disabled){
+    selectable(row, index) {
+      if (this.dataList.length) {
+        if (this.returnId !== null) {
+          for (let j = 0; j < this.dataList.length; j++) {
+            if (
+              row.id == this.dataList[j].id ||
+            row.disabled === false
+            ) {
+              if (
+                row.itemId == this.dataList[j].itemId ||
+              row.disabled === false
+              ) {
+                this.$set(row, 'disabled', false)
+              } else {
+                this.$set(row, 'disabled', true)
+              }
+            } else {
+              this.$set(row, 'disabled', true)
+            }
+          }
+        } else {
+          for (let j = 0; j < this.dataList.length; j++) {
+            if (
+              row.id == this.dataList[j].id ||
+            row.disabled === false
+            ) {
+              this.$set(row, 'disabled', false)
+            } else {
+              this.$set(row, 'disabled', true)
+            }
+          }
+        }
+      }
+
+      if (this.customerNumber) {
+        if (row.customerNumber == this.customerNumber && row.disabled) {
           return true
-        }else{
-          return  false
+        } else {
+          return false
         }
-      }else if(this.returnId){
-        if (row.id == this.returnId && row.disabled){
+      } else if (this.returnId) {
+        if (row.id == this.returnId && row.disabled) {
           return true
-
-        }else{
-          return  false
+        } else {
+          return false
         }
+      } else {
+        return true
       }
-      else {
-        return  true
-      }
-
     }
     // 批量删除
     // dels() {

+ 44 - 41
src/components/SalesHeader/SalesHeader.vue

@@ -3,47 +3,46 @@
     <el-form ref="form" :rules="rules" label-position="left" :disabled="screenForm.disabled" label-width="120px" :model="screenForm" size="mini">
       <el-row :gutter="20">
         <el-col :xs="24" :ms="6" :lg="6">
-          <el-form-item label="销售订单号" >
+          <el-form-item label="销售订单号">
             <el-input v-model="screenForm.id" disabled placeholder="销售订单号" size="mini" />
           </el-form-item>
         </el-col>
         <el-col :xs="24" :ms="6" :lg="6">
-          <el-form-item label="商家编号" >
+          <el-form-item label="商家编号">
             <el-input v-model="screenForm.customerNumber" disabled placeholder="商家编号" size="mini" />
           </el-form-item>
         </el-col>
         <el-col :xs="24" :ms="6" :lg="6">
-          <el-form-item label="商家名称" >
+          <el-form-item label="商家名称">
             <el-input v-model="screenForm.customerName" disabled placeholder="商家名称" size="mini" />
           </el-form-item>
         </el-col>
         <el-col :xs="24" :ms="6" :lg="6">
           <el-form-item label="配送日期" prop="pickTime">
             <el-date-picker
-              style="width: 100%"
               v-model="screenForm.pickTime"
+              style="width: 100%"
               type="date"
               size="mini"
               value-format="yyyy-MM-dd HH:mm:ss"
               placeholder="选择日期"
-            >
-            </el-date-picker>
+            />
           </el-form-item>
         </el-col>
-<!--        <el-col :xs="24" :ms="6" :lg="6">-->
-<!--          <el-form-item label="发货仓库编号" prop="code">-->
-<!--            <el-input v-model="screenForm.code" placeholder="发货仓库编号" size="mini" />-->
-<!--          </el-form-item>-->
-<!--        </el-col>-->
+        <!--        <el-col :xs="24" :ms="6" :lg="6">-->
+        <!--          <el-form-item label="发货仓库编号" prop="code">-->
+        <!--            <el-input v-model="screenForm.code" placeholder="发货仓库编号" size="mini" />-->
+        <!--          </el-form-item>-->
+        <!--        </el-col>-->
         <el-col :xs="24" :ms="6" :lg="6">
           <el-form-item label="发货仓库名称" prop="stockType">
-            <el-select disabled v-model="screenForm.stockType" placeholder="请选择" clearable>
+            <el-select v-model="screenForm.stockType" placeholder="请选择" clearable @change="handleStokType">
               <el-option
-                label="前置仓"
+                label="嘉贤前置仓"
                 :value="1"
               />
               <el-option
-                label="商家仓"
+                label="商家商家仓"
                 :value="2"
               />
             </el-select>
@@ -61,25 +60,28 @@
         </el-col>
         <el-col :xs="24" :ms="18" :lg="18" style="display: flex;" class="custom">
           <el-form-item label="省" prop="provinceId" class="item">
-            <el-select v-model="screenForm.provinceId" placeholder="请选择省" @change="changeProvince"
-                       style="width: 100%"
+            <el-select
+              v-model="screenForm.provinceId"
+              placeholder="请选择省"
+              style="width: 100%"
+              @change="changeProvince"
             >
-              <el-option v-for="item in provinceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              <el-option v-for="item in provinceList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
           <el-form-item label="市" prop="cityId" label-width="50px">
-            <el-select v-model="screenForm.cityId" placeholder="请选择市" @change="changeCity" style="width: 100%">
-              <el-option v-for="item in cityList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            <el-select v-model="screenForm.cityId" placeholder="请选择市" style="width: 100%" @change="changeCity">
+              <el-option v-for="item in cityList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
           <el-form-item label="区" prop="areaId" label-width="50px">
-            <el-select v-model="screenForm.areaId" placeholder="请选择区" @change="changeArea" style="width: 100%">
-              <el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            <el-select v-model="screenForm.areaId" placeholder="请选择区" style="width: 100%" @change="changeArea">
+              <el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
           <el-form-item label="街道" prop="streetId" label-width="50px">
-            <el-select v-model="screenForm.streetId" placeholder="请选择街道" @change="changeStreet" style="width: 100%">
-              <el-option v-for="item in streetList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            <el-select v-model="screenForm.streetId" placeholder="请选择街道" style="width: 100%" @change="changeStreet">
+              <el-option v-for="item in streetList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
 
           </el-form-item>
@@ -150,17 +152,17 @@ export default {
         pickTime: [{
           required: true, message: '请输入配送日期', trigger: 'change'
         }],
-        stockType: [{
-          required: true, message: '请输入发货仓库名称', trigger: 'change'
-        }],
+        // stockType: [{
+        //   required: true, message: '请输入发货仓库名称', trigger: 'change'
+        // }],
         userName: [{
           required: true, message: '请输入用户名称', trigger: 'change'
         }],
         phone: [{
-          required: true, message: '请输入用户电话', trigger: 'change',
+          required: true, message: '请输入用户电话', trigger: 'change'
         },
         { min: 11, max: 11, message: '请输入11位手机号', trigger: 'change' }
-      ],
+        ],
         receAddress: [{
           required: true, message: '请输入送货地址', trigger: 'change'
         }]
@@ -169,7 +171,7 @@ export default {
       cityList: [],
       areaList: [],
       streetList: [],
-      areaValue:''
+      areaValue: ''
     }
   },
   created() {
@@ -191,10 +193,8 @@ export default {
         }
       })
     },
-    handleArea(value,type){
-
-      this.screenForm[type] =  this[type+'List'].find(k=>k.id===value).name
-
+    handleArea(value, type) {
+      this.screenForm[type] = this[type + 'List'].find(k => k.id === value).name
     },
     // 切换省
     changeProvince(value) {
@@ -205,7 +205,7 @@ export default {
       this.areaList = []
       this.streetList = []
       this.getRegion(1, value)
-      this.handleArea(value,'province')
+      this.handleArea(value, 'province')
     },
 
     // 切换市
@@ -215,8 +215,7 @@ export default {
       this.areaList = []
       this.streetList = []
       this.getRegion(2, value)
-      this.handleArea(value,'city')
-
+      this.handleArea(value, 'city')
     },
 
     // 切换区
@@ -225,19 +224,18 @@ export default {
       this.screenForm.streetId = ''
       this.streetList = []
       this.getRegion(3, value)
-      this.handleArea(value,'area')
-
+      this.handleArea(value, 'area')
     },
 
     // 切换街道
     changeStreet(value) {
       this.getRegion(3, this.areaValue)
-      this.handleArea(value,'street')
+      this.handleArea(value, 'street')
     },
 
     // 初始化省市区街道
     initRegion(level, item, id = 0) {
-      let { province, city, area, street } = item
+      const { province, city, area, street } = item
       let nextId = null
       getRegion({ pid: id }).then(res => {
         if (level === 0) {
@@ -258,6 +256,9 @@ export default {
           this.initRegion(level, item, nextId)
         }
       })
+    },
+    handleStokType(e) {
+      this.$emit('setStokType', e)
     }
   }
 }
@@ -269,7 +270,9 @@ export default {
   padding: 20px;
   box-shadow: 0 0 8px 0 rgb(0 0 0 / 20%);
 }
-
+::v-deep .el-select{
+ width: 100%;
+}
 .custom {
   .item {
     ::v-deep .el-form-item__label:first-child {

+ 6 - 12
src/components/SalesTable/SalesTable.vue

@@ -3,8 +3,7 @@
     <slot name="title">
       <h5>销售订单明细</h5>
     </slot>
-    <slot name="bts">
-    </slot>
+    <slot name="bts" />
     <div class="table">
       <el-table
         :data="dataList"
@@ -19,15 +18,12 @@
           style="padding-left: 10px;"
           type="selection"
           width="55"
-
-        >
-        </el-table-column>
+        />
         <el-table-column
           v-if="isIndex"
           type="index"
           width="50"
-        >
-        </el-table-column>
+        />
         <el-table-column
           v-for="(item,index) in column"
           :key="index"
@@ -50,15 +46,13 @@
               />
             </template>
             <template v-if="item.isCustom">
-                <slot name="custom" v-bind:item="{row,$index}">
-                </slot>
+              <slot name="custom" :item="{row,$index}" />
             </template>
           </template>
         </el-table-column>
         <el-table-column v-if="isOperation" fixed="right" label="操作" min-width="100" align="center">
           <template v-slot="{row,$index}">
-            <slot name="operation" v-bind:item="{row,$index}">
-            </slot>
+            <slot name="operation" :item="{row,$index}" />
           </template>
         </el-table-column>
       </el-table>
@@ -140,7 +134,7 @@ export default {
     },
     handleSelectionAllChange(data) {
       this.$emit('handleSelection', data)
-    },
+    }
 
   }
 }

+ 8 - 3
src/components/template/template-page-1.vue

@@ -515,6 +515,12 @@ export default {
           this.$message.error('操作失败')
         })
     },
+    getParams() {
+      var querylist_ = this.$refs.zjpage.$refs.dynamicCondition.jiexi(
+        JSON.parse(JSON.stringify(this.$refs.zjpage.$refs.dynamicCondition.queryData))
+      )
+      return this.$refs.zjpage.parameterAnalysis({ querylist: querylist_ })
+    },
     // 导出
     export() {
       this.columnList = this.$refs.zjpage.columnList
@@ -530,13 +536,12 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       })
       this.evens[0][0].loading = true
-      var querylist = this.$refs.zjpage.$refs.dynamicCondition.jiexi(
-        JSON.parse(JSON.stringify(this.$refs.zjpage.$refs.dynamicCondition.queryData))
-      )
+      var { querylist, ...p } = this.getParams()
       this.exportList(
         {
           ...this.parameter,
           pageSize: -1,
+          ...p,
           params: querylist.map(item => {
             item.param = item.param.replace(/>=/g, '')
             item.param = item.param.replace(/<=/g, '')

+ 75 - 1
src/layout/components/AppMain.vue

@@ -8,7 +8,7 @@
         <router-view v-else />
       </transition>
       <!-- 通知框 -->
-      <notify-box />
+      <notify-box :mes-type="mesType" @reset="handleReset" />
       <zj-watermark color="rgba(200,200,200,.3)" position="absolute" :str="str" z-index="99" />
     </div>
   </section>
@@ -17,12 +17,23 @@
 <script>
 import { mapGetters } from 'vuex'
 import { setModuleId } from '@/utils/request'
+import { getListInvoiceOrderTWO } from '@/api/dashboard'
 import NotifyBox from '@/components/NotifyBox'
 export default {
   name: 'AppMain',
   components: {
     NotifyBox
   },
+  data() {
+    return {
+      currentPage: 1,
+      pageSize: 10,
+      listTotal: 0,
+      invoiceOrderList: [],
+      timer: null,
+      mesType: null
+    }
+  },
   computed: {
     ...mapGetters(['show']),
     cachedViews() {
@@ -42,6 +53,69 @@ export default {
   },
   beforeCreate() {
     setModuleId(this.$route.meta.moduleId)
+  },
+  mounted() {
+    this.handleInterVal()
+  },
+  beforeDestroy() {
+    this.handleClearInterVal()
+  },
+  methods: {
+    handleInterVal() {
+      this.handleClearInterVal()
+      this.timer = setInterval(() => {
+        this.getListInvoiceOrderTWO()
+      }, 20000)
+    },
+    handleClearInterVal() {
+      clearInterval(this.timer)
+      this.timer = null
+    },
+    open() {
+      const That = this
+      this.$notify({
+        title: '通知',
+        type: 'info',
+        duration: 0,
+        position: 'bottom-right',
+        dangerouslyUseHTMLString: true,
+        message: (
+          <div >
+            <div>通知:您有一条新的物流通知发货单号{this.invoiceOrderList.length && this.invoiceOrderList[0].id}</div>
+            <div style='text-align:right'><el-link type='primary' underline={false} onClick={() => That.handleJump()}>
+              点击查看详情
+            </el-link></div>
+          </div>
+        ),
+        onClose() {
+          That.handleInterVal()
+        }
+      })
+    },
+    // 获取物流列表
+    async getListInvoiceOrderTWO() {
+      const data = {
+        pageSize: this.pageSize,
+        pageNum: this.currentPage
+      }
+      const res = await getListInvoiceOrderTWO(data)
+      this.invoiceOrderList = res.data.records
+      this.listTotal = res.data.total
+      if (res.data.records.length) {
+        this.open()
+        this.handleClearInterVal()
+      } else {
+        this.handleInterVal()
+      }
+    },
+    handleJump() {
+      this.mesType = 3
+      this.$store.commit('user/showMessage', 'yes')
+      this.$notify.closeAll()
+    },
+    handleReset() {
+      this.mesType = null
+    }
   }
 }
 </script>

+ 26 - 0
src/utils/common.js

@@ -109,6 +109,32 @@ export const numToFixed = num => {
   return num.replace(/(\d)(?=(\d{3})+$)/g, '$1,')
 }
 
+/**
+ *
+ * @param {*} fn  是我们需要包装的事件回调
+ * @param {*} delay 是每次推迟执行的等待时间
+ */
+export const debounce = (fn, delay = 1000) => {
+  // 定时器
+  let timer = null
+  // 将debounce处理结果当作函数返回
+  return function () {
+    // 保留调用时的this上下文
+    let context = this
+    // 保留调用时传入的参数
+    let args = arguments
+    // 每次事件被触发时,都去清除之前的旧定时器
+    // console.log(timer)
+    if (timer) {
+      clearTimeout(timer)
+    }
+    // 设立新定时器
+    timer = setTimeout(function () {
+      fn.apply(context, args)
+    }, delay)
+  }
+}
+
 export default {
   successMsg,
   errorMsg,

+ 98 - 0
src/views/barcode/barcodeImport.vue

@@ -0,0 +1,98 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListCustomerCodeV2, exportListCustomerCodeV2, importListCustomerCodeV2, luBaoDownloadDownload } from '@/api/barcode'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '导入',
+              render: this.importButton(importListCustomerCodeV2)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '导入模版',
+              click: () => {
+                luBaoDownloadDownload({}, `${this.$route.meta.title}`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(_err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListCustomerCodeV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListCustomerCodeV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'></div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 98 - 0
src/views/barcode/barcodeVerification.vue

@@ -0,0 +1,98 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListCustomerCheckV2, exportListCustomerCheck, importListCustomerCheck, listCustomerCheckDownload } from '@/api/barcode'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '导入',
+              render: this.importButton(importListCustomerCheck)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '导入模版',
+              click: () => {
+                listCustomerCheckDownload({}, `${this.$route.meta.title}`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(_err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListCustomerCheckV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListCustomerCheck,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'></div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 80 - 0
src/views/barcode/largeStockBarcode.vue

@@ -0,0 +1,80 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListDaCangV2, exportListDaCangV2 } from '@/api/barcode'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        // [
+        //   [
+        //     {
+        //       name: '导入',
+        //       render: this.importButton(importCustomerV2)
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListDaCangV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListDaCangV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'></div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+  <style lang="scss" scoped></style>
+

+ 72 - 0
src/views/barcode/utboundBarcode.vue

@@ -0,0 +1,72 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListCodeV2, exportListCodeV2 } from '@/api/barcode'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListCodeV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListCodeV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'></div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+  <style lang="scss" scoped></style>
+

+ 185 - 75
src/views/basic_data/dealer/components/dealer_list-detail.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="sty">
-      <el-page-header @back="goBack" content="详情页面"></el-page-header>
+      <el-page-header content="详情" @back="goBack" />
     </div>
     <el-form :model="infoList" label-width="130px" size="small" label-position="right">
       <el-card class="">
@@ -13,218 +13,218 @@
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="创建组织" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="客户编码" prop="">
-                <el-input v-model="infoList.number"></el-input>
+                <el-input v-model="infoList.number" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="使用组织" prop="">
-                <el-input v-model="infoList.useOrgName"></el-input>
+                <el-input v-model="infoList.useOrgName" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="简称" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
           </el-row>
           <!-- </el-form> -->
         </div>
       </el-card>
-      <br />
+      <br>
       <el-card class="">
         <div slot="header" class="clearfix">
           <strong>基本信息</strong>
         </div>
         <span>地址</span>
-        <el-divider></el-divider>
+        <el-divider />
         <div>
           <!-- <el-form label-width="130px" size="small" label-position="right"> -->
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="国家" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="地区" prop="">
-                <el-input v-model="infoList.region"></el-input>
+                <el-input v-model="infoList.region" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="省份" prop="">
-                <el-input v-model="infoList.province"></el-input>
+                <el-input v-model="infoList.province" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="城市" prop="">
-                <el-input v-model="infoList.city"></el-input>
+                <el-input v-model="infoList.city" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="通信地址" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="邮政编码" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="公司网址" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="商城订单对应组织" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="联系邮箱" prop="">
-                <el-input v-model="infoList.email"></el-input>
+                <el-input v-model="infoList.email" />
               </el-form-item>
             </el-col>
           </el-row>
           <!-- </el-form> -->
         </div>
         <span>管理</span>
-        <el-divider></el-divider>
+        <el-divider />
         <div>
           <!-- <el-form label-width="130px" size="small" label-position="right"> -->
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="联系电话" prop="">
-                <el-input v-model="infoList.mobile"></el-input>
+                <el-input v-model="infoList.mobile" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="传真" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="公司类别" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="公司性质" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="公司规模" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
           </el-row>
           <!-- </el-form> -->
         </div>
         <span>相关</span>
-        <el-divider></el-divider>
+        <el-divider />
         <div>
           <!-- <el-form label-width="130px" size="small" label-position="right"> -->
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="对应供应商" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="对应集团客户" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="客户类别" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="客户分组" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="集团客户" prop="">
-                <el-checkbox></el-checkbox>
+                <el-checkbox />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="默认付款方" prop="">
-                <el-checkbox></el-checkbox>
+                <el-checkbox />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="不校验可发量" prop="">
-                <el-checkbox></el-checkbox>
+                <el-checkbox />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="对应组织" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="备注" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
           </el-row>
           <!-- </el-form> -->
         </div>
         <span>开票信息</span>
-        <el-divider></el-divider>
+        <el-divider />
         <div>
           <!-- <el-form label-width="130px" size="small" label-position="right"> -->
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="发票抬头" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="纳税登记号" prop="">
-                <el-input></el-input>
+                <el-input />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="开户银行" prop="">
-                <el-input v-model="infoList.bank"></el-input>
+                <el-input v-model="infoList.bank" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="银行账号" prop="">
-                <el-input v-model="infoList.bankAccount"></el-input>
+                <el-input v-model="infoList.bankAccount" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="开票联系电话" prop="">
-                <el-input v-model="infoList.invoicePhone"></el-input>
+                <el-input v-model="infoList.invoicePhone" />
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="开票通讯地址" prop="">
-                <el-input v-model="infoList.invoiceAddress"></el-input>
+                <el-input v-model="infoList.invoiceAddress" />
               </el-form-item>
             </el-col>
           </el-row>
           <!-- </el-form> -->
         </div>
         <span>智慧订货</span>
-        <el-divider></el-divider>
+        <el-divider />
         <div>
           <!-- <el-form label-width="130px" size="small" label-position="right"> -->
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="允许对接智慧订单" prop="">
-                <el-checkbox></el-checkbox>
+                <el-checkbox />
               </el-form-item>
             </el-col>
           </el-row>
@@ -232,14 +232,14 @@
         </div>
       </el-card>
     </el-form>
-    <br />
+    <br>
     <el-card>
       <div slot="header" class="clearfix">
         <strong>信用额度</strong>
       </div>
       <div class="diy-table-1">
         <el-row :gutter="0" class="xyed">
-          <div v-for="(v, i) in infoList.customerWallets" :key="i" v-show="v.type == 'COMMONLY'">
+          <div v-for="(v, i) in infoList.customerWallets" v-show="v.type == 'COMMONLY'" :key="i">
             <el-col :span="12" class="item">
               <div class="label">信用额度</div>
               <div class="value">{{ v.freeCreditAmount }}</div>
@@ -252,7 +252,7 @@
         </el-row>
       </div>
     </el-card>
-    <br />
+    <br>
     <el-card>
       <div slot="header" class="clearfix">
         <strong>标签信息</strong>
@@ -285,27 +285,45 @@
           </el-row>
           <el-col>
             <el-form-item label="分子公司">
-              <el-tag class="tagStyle" v-for="v in infoList.kingDeeCustomers" :key="v.id">{{ v.name }}</el-tag>
+              <el-tag v-for="v in infoList.kingDeeCustomers" :key="v.id" class="tagStyle">{{ v.name }}</el-tag>
             </el-form-item>
           </el-col>
           <el-col>
             <el-form-item label="提货方式">
-              <el-col :span="12">
+              <div class="pick">
+                <el-row v-if="dataList.length">
+                  <el-col v-for="(item, index) in dataList" :key="index" :span="24" class="pick-item">
+                    <el-checkbox-group v-model="categoryArr">
+                      <el-col :span="6" class="pick-item-category">
+                        <el-checkbox :label="item.id">
+                          {{ item.name }}
+                        </el-checkbox>
+                      </el-col>
+                    </el-checkbox-group>
+                    <el-col :span="18" class="pick-item-way">
+                      <el-checkbox v-model="item.isFront" :label="true"> 物流配送(嘉贤物流)</el-checkbox>
+                      <el-checkbox v-model="item.isPick" :label="true">商家自提</el-checkbox>
+                    </el-col>
+                  </el-col>
+                </el-row>
+              </div>
+              <div>注:设置配送方式后提货预约可根据配置的提货方式进行选择</div>
+              <div style="margin: 20px 0">
+                <el-button type="primary" size="default" @click="onSubmit">保存</el-button>
+              </div>
+
+              <!-- <el-col :span="12">
                 <div>
-                    <el-checkbox v-model="isFront" :label="true"> 物流配送(嘉贤物流)</el-checkbox>
+                  <el-checkbox v-model="isFront" :label="true"> 物流配送(嘉贤物流)</el-checkbox>
                 </div>
                 <div>选择商家自提需配置物流产品类别</div>
                 <div>
-                  <el-checkbox-group v-model="frontCategory">
-                    <el-checkbox v-for="(item, index) in dataList" :key="index" :label="item.id">
-                      {{ item.name }}
-                    </el-checkbox>
-                  </el-checkbox-group>
+
                 </div>
               </el-col>
               <el-col :span="12">
                 <div>
-                    <el-checkbox v-model="isPick" :label="true">商家自提</el-checkbox>
+                  <el-checkbox v-model="isPick" :label="true">商家自提</el-checkbox>
                 </div>
                 <div>选择商家自提需配置自提产品类别</div>
                 <div>
@@ -319,18 +337,43 @@
               <div>注:设置配送方式后提货预约可根据配置的提货方式进行选择</div>
               <div>
                 <el-button type="primary" size="default" @click="onSubmit">保存</el-button>
-              </div>
+              </div> -->
             </el-form-item>
           </el-col>
         </el-form>
       </div>
     </el-card>
+    <br>
+    <el-card>
+      <div slot="header" class="clearfix">
+        <strong>售后系统关联信息</strong>
+      </div>
+      <!-- type="flex" justify="center" align="middle" class="" -->
+      <el-row class="flex">
+        <el-col :span="2">售后系统编号</el-col>
+        <el-col
+          :span="3"
+          style="margin: 0 20px"
+        ><el-input v-model="infoList.afterNumber" placeholder="请输入售后系统编号" size="mini" clearable />
+        </el-col>
+        <el-col :span="4">售后系统绑定状态</el-col>
+        <el-col :span="3">{{ infoList.binding === 'YES' ? '是' : '否' }}</el-col>
+        <el-col :span="3">绑定时间</el-col>
+        <el-col :span="3">{{ infoList.bindingTime }}</el-col>
+        <el-col :span="3">绑定人</el-col>
+        <el-col :span="2">{{ infoList.bindingName }}</el-col>
+      </el-row>
+      <div style="margin: 20px 0">
+        <el-button type="primary" size="default" @click="onSave">保存</el-button>
+      </div>
+      <!-- <zj-table /> -->
+    </el-card>
   </div>
 </template>
 
 <script>
 import { getKingDeeCategory } from '@/api/basic_data/material'
-import { getDealerInfo, updateCustomer, updatePick } from '@/api/basic_data/dealer'
+import { getDealerInfo, updateCustomer, updatePick, updateSystem } from '@/api/basic_data/dealer'
 
 export default {
   props: {
@@ -344,37 +387,58 @@ export default {
       infoList: {},
       dataList: [],
       radio: [],
-      isFront:false,
-      isPick:false,
+      isFront: false,
+      isPick: false,
       pickCategory: [],
-      frontCategory: []
+      frontCategory: [],
+      categoryArr: [],
+      afterNumber: ''
     }
   },
 
   async created() {
-    this.getDataList()
+    await this.getDataList()
     const res = await getDealerInfo({ id: this.detailsId })
-    this.isFront = res.data.isFront
-    this.isPick = res.data.isPick
-    if (res.data.kingDeeCustomerCategoriesFront&& res.data.kingDeeCustomerCategoriesFront.length) {
+    // this.isFront = res.data.isFront
+    // this.isPick = res.data.isPick
+    if (res.data.kingDeeCustomerCategoriesFront && res.data.kingDeeCustomerCategoriesFront.length) {
       this.frontCategory = res.data.kingDeeCustomerCategoriesFront.map(k => {
         return k.categoryId
       })
     }
-    if (res.data.kingDeeCustomerCategories&& res.data.kingDeeCustomerCategories.length) {
+    if (res.data.kingDeeCustomerCategories && res.data.kingDeeCustomerCategories.length) {
       this.pickCategory = res.data.kingDeeCustomerCategories.map(k => {
         return k.categoryId
       })
     }
+    this.frontCategory.forEach(k => {
+      this.dataList.forEach(i => {
+        if (i.id === k) {
+          i.isFront = true
+        }
+      })
+    })
+    this.pickCategory.forEach(k => {
+      this.dataList.forEach(i => {
+        if (i.id === k) {
+          i.isPick = true
+        }
+      })
+    })
+    this.categoryArr = [...new Set([...this.frontCategory, ...this.pickCategory])]
     this.infoList = res.data
   },
   methods: {
     goBack() {
       this.$emit('close')
     },
-    //金蝶存货类别列表
+    // 金蝶存货类别列表
     async getDataList() {
       const res = await getKingDeeCategory()
+      res.data.forEach(k => {
+        k.isFront = false
+        k.isPick = false
+      })
       this.dataList = res.data
     },
 
@@ -387,25 +451,52 @@ export default {
       })
     },
     onSubmit() {
-      if (!this.isFront && !this.isPick) {
-        this.$errorMsg('必须选择一种提货方式')
-        return
-      }
-      if ((this.isFront && !this.frontCategory.length) || (this.isPick && !this.pickCategory.length)) {
+      this.pickCategory = []
+      this.frontCategory = []
+      if (this.categoryArr.length) {
+        for (let i = 0; i < this.dataList.length; i++) {
+          const item = this.dataList[i]
+          for (let j = 0; j < this.categoryArr.length; j++) {
+            const category = this.categoryArr[j]
+            if (category === item.id) {
+              if (item.isFront) {
+                this.frontCategory.push(category)
+              }
+              if (item.isPick) {
+                this.pickCategory.push(category)
+              }
+            }
+          }
+        }
+      } else {
         this.$errorMsg('必须选择产品类别')
         return
       }
- 
+
       updatePick({
         id: this.detailsId,
-        isFront: this.isFront?this.isFront:false,
-        isPick: this.isPick?this.isPick:false,
-        pickCategory:this.isPick? this.pickCategory.join(','):'',
-        frontCategory:this.isFront? this.frontCategory.join(','):''
+        isFront: !!this.frontCategory.length,
+        isPick: !!this.pickCategory.length,
+        pickCategory: this.pickCategory.length ? this.pickCategory.join(',') : '',
+        frontCategory: this.frontCategory.length ? this.frontCategory.join(',') : ''
       }).then(res => {
         this.$successMsg('保存成功')
         this.$emit('close')
       })
+    },
+    onSave() {
+      updateSystem({
+        id: this.detailsId,
+        afterNumber: this.afterNumber
+      }).then(res => {
+        getDealerInfo({ id: this.detailsId }).then(res => {
+          const { afterType, bindingTime, bindingName } = res.data
+          this.infoList.afterType = afterType
+          this.infoList.bindingTime = bindingTime
+          this.infoList.bindingName = bindingName
+          this.$successMsg('保存成功')
+        })
+      })
     }
   }
 }
@@ -427,7 +518,26 @@ export default {
     }
   }
 }
-
+.pick {
+  width: 600px;
+  border: 1px solid #ebeef5;
+  border-bottom: none;
+  &-item {
+    height: 40px;
+    border-bottom: 1px solid #ebeef5;
+    &-category {
+      border-right: 1px solid #ebeef5;
+    }
+    &-category,
+    &-way {
+      padding: 0 20px;
+    }
+  }
+}
+.flex {
+  display: flex;
+  align-items: center;
+}
 .tagStyle {
   margin: 0 18px;
 }

+ 420 - 0
src/views/basic_data/dealer/components/subMerchantDetail.vue

@@ -0,0 +1,420 @@
+<template>
+  <div>
+    <div class="sty">
+      <el-page-header content="详情" @back="goBack" />
+    </div>
+    <el-form :model="infoList" label-width="130px" size="small" label-position="right">
+      <el-card class="">
+        <div slot="header" class="clearfix">
+          <strong>客户</strong>
+        </div>
+        <div>
+          <!-- <el-form label-width="130px" size="small" label-position="right"> -->
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="创建组织" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="客户编码" prop="">
+                <el-input v-model="infoList.number" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="使用组织" prop="">
+                <el-input v-model="infoList.useOrgName" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="简称" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- </el-form> -->
+        </div>
+      </el-card>
+      <br>
+      <el-card class="">
+        <div slot="header" class="clearfix">
+          <strong>基本信息</strong>
+        </div>
+        <span>地址</span>
+        <el-divider />
+        <div>
+          <!-- <el-form label-width="130px" size="small" label-position="right"> -->
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="国家" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="地区" prop="">
+                <el-input v-model="infoList.region" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="省份" prop="">
+                <el-input v-model="infoList.province" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="城市" prop="">
+                <el-input v-model="infoList.city" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="通信地址" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="邮政编码" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="公司网址" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="商城订单对应组织" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="联系邮箱" prop="">
+                <el-input v-model="infoList.email" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- </el-form> -->
+        </div>
+        <span>管理</span>
+        <el-divider />
+        <div>
+          <!-- <el-form label-width="130px" size="small" label-position="right"> -->
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="联系电话" prop="">
+                <el-input v-model="infoList.mobile" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="传真" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="公司类别" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="公司性质" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="公司规模" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- </el-form> -->
+        </div>
+        <span>相关</span>
+        <el-divider />
+        <div>
+          <!-- <el-form label-width="130px" size="small" label-position="right"> -->
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="对应供应商" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="对应集团客户" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="客户类别" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="客户分组" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="集团客户" prop="">
+                <el-checkbox disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="默认付款方" prop="">
+                <el-checkbox disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="不校验可发量" prop="">
+                <el-checkbox disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="对应组织" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="备注" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- </el-form> -->
+        </div>
+        <span>开票信息</span>
+        <el-divider />
+        <div>
+          <!-- <el-form label-width="130px" size="small" label-position="right"> -->
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发票抬头" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="纳税登记号" prop="">
+                <el-input disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="开户银行" prop="">
+                <el-input v-model="infoList.bank" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="银行账号" prop="">
+                <el-input v-model="infoList.bankAccount" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="开票联系电话" prop="">
+                <el-input v-model="infoList.invoicePhone" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="开票通讯地址" prop="">
+                <el-input v-model="infoList.invoiceAddress" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- </el-form> -->
+        </div>
+        <span>智慧订货</span>
+        <el-divider />
+        <div>
+          <!-- <el-form label-width="130px" size="small" label-position="right"> -->
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="允许对接智慧订单" prop="">
+                <el-checkbox disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- </el-form> -->
+        </div>
+      </el-card>
+    </el-form>
+    <br>
+    <el-card>
+      <div slot="header" class="clearfix">
+        <strong>售后系统关联信息</strong>
+      </div>
+      <el-row :gutter="20" class="flex">
+        <el-col :span="4">售后系统销售编号</el-col>
+        <el-col :span="4"> <el-input v-model="infoList.afterNumber" disabled placeholder="" size="mini" /></el-col>
+        <el-col :span="4">售后系统绑定状态</el-col>
+        <el-col :span="10">{{ infoList.binding === 'YES' ? '是' : '否' }}</el-col>
+      </el-row>
+      <el-row :gutter="20" class="flex">
+        <el-col :span="8">
+          <el-radio-group v-model="infoList.afterType" disabled>
+            <el-radio v-for="item in afterTypeList" :key="item.value" :label="item.value">{{
+              item.label
+            }}</el-radio>
+          </el-radio-group>
+        </el-col>
+        <el-col :span="2"> 绑定时间 </el-col>
+        <el-col :span="4"> {{ infoList.bindingTime }}</el-col>
+        <el-col :span="2"> 绑定人 </el-col>
+        <el-col :span="4"> {{ infoList.bindingName }} </el-col>
+      </el-row>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { getKingDeeCategory } from '@/api/basic_data/material'
+import { getStageCustomerDetail, updateCustomer, updatePick } from '@/api/basic_data/dealer'
+
+export default {
+  props: {
+    detailsId: {
+      type: String,
+      required: true
+    }
+  },
+  data() {
+    return {
+      infoList: {},
+      dataList: [],
+      radio: [],
+      isFront: false,
+      isPick: false,
+      pickCategory: [],
+      frontCategory: [],
+      categoryArr: [],
+      code: '',
+      afterTypeList: [
+        { label: '绑定上级商户销售编号', value: 'CHARGE' },
+        { label: '绑定二级商户编号', value: 'STAGE' }
+      ]
+    }
+  },
+
+  async created() {
+    await this.getDataList()
+    const res = await getStageCustomerDetail({ id: this.detailsId })
+    // this.isFront = res.data.isFront
+    // this.isPick = res.data.isPick
+    if (res.data.kingDeeCustomerCategoriesFront && res.data.kingDeeCustomerCategoriesFront.length) {
+      this.frontCategory = res.data.kingDeeCustomerCategoriesFront.map(k => {
+        return k.categoryId
+      })
+    }
+    if (res.data.kingDeeCustomerCategories && res.data.kingDeeCustomerCategories.length) {
+      this.pickCategory = res.data.kingDeeCustomerCategories.map(k => {
+        return k.categoryId
+      })
+    }
+    this.frontCategory.forEach(k => {
+      this.dataList.forEach(i => {
+        if (i.id === k) {
+          i.isFront = true
+        }
+      })
+    })
+    this.pickCategory.forEach(k => {
+      this.dataList.forEach(i => {
+        if (i.id === k) {
+          i.isPick = true
+        }
+      })
+    })
+    this.categoryArr = [...new Set([...this.frontCategory, ...this.pickCategory])]
+    this.infoList = res.data
+  },
+  methods: {
+    goBack() {
+      this.$emit('close')
+    },
+    // 金蝶存货类别列表
+    async getDataList() {
+      const res = await getKingDeeCategory()
+      res.data.forEach(k => {
+        k.isFront = false
+        k.isPick = false
+      })
+      this.dataList = res.data
+    },
+
+    handelSubmit() {
+      updateCustomer({
+        id: this.infoList.id,
+        isFront: this.infoList.isFront
+      }).then(res => {
+        this.$successMsg(this.infoList.isFront ? '已更改为前置仓' : '已更改为经销商自有仓库')
+      })
+    },
+    onSubmit() {
+      this.pickCategory = []
+      this.frontCategory = []
+      this.dataList.map(k => {
+        this.categoryArr.map(i => {
+          if (i === k.id) {
+            if (k.isFront) {
+              this.frontCategory.push(i)
+            }
+            if (k.isPick) {
+              this.pickCategory.push(i)
+            }
+          } else {
+            this.$errorMsg('必须选择产品类别')
+            return
+          }
+        })
+      })
+
+      updatePick({
+        id: this.detailsId,
+        isFront: !!this.frontCategory.length,
+        isPick: !!this.pickCategory.length,
+        pickCategory: this.pickCategory.length ? this.pickCategory.join(',') : '',
+        frontCategory: this.frontCategory.length ? this.frontCategory.join(',') : ''
+      }).then(res => {
+        this.$successMsg('保存成功')
+        this.$emit('close')
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.sty {
+  margin-bottom: 20px;
+}
+
+::v-deep .diy-table-1 {
+  width: 50%;
+
+  .xyed {
+    border-top: 1px solid #ebeef5;
+
+    .item {
+      margin-bottom: 18px;
+    }
+  }
+}
+.pick {
+  width: 600px;
+  border: 1px solid #ebeef5;
+  border-bottom: none;
+  &-item {
+    height: 40px;
+    border-bottom: 1px solid #ebeef5;
+    &-category {
+      border-right: 1px solid #ebeef5;
+    }
+    &-category,
+    &-way {
+      padding: 0 20px;
+    }
+  }
+}
+.flex {
+  display: flex;
+  align-items: center;
+  margin-bottom: 20px;
+}
+.tagStyle {
+  margin: 0 18px;
+}
+</style>

+ 254 - 0
src/views/basic_data/dealer/components/subMerchantForm.vue

@@ -0,0 +1,254 @@
+<template>
+  <div>
+    <div class="sty">
+      <el-page-header :content="title" @back="goBack" />
+    </div>
+    <el-form ref="formData" :model="formData" label-width="120px" :inline="false" size="mini" label-position="left">
+      <el-card>
+        <div slot="header" class="clearfix">
+          <strong>客户信息</strong>
+        </div>
+        <el-row>
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="上级商户编码" prop="higherPrantNumber">
+                <el-input v-model="formData.higherPrantNumber" disabled placeholder="系统自动生成" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="上级商户信息" prop="higherPrantName">
+                <el-input v-model="formData.higherPrantName" disabled placeholder="系统自动生成" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item label="商户编码">
+                <el-input v-model="formData.number" disabled placeholder="创建自动生成(仅显示不能编辑)" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="商户名称" prop="name">
+                <el-input v-model="formData.name" placeholder="请输入客户信息" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="负责人" prop="chargeName">
+                <el-input v-model="formData.chargeName" placeholder="请输入负责人姓名" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="联系电话" prop="mobile">
+                <el-input v-model="formData.mobile" placeholder="请输入联系电话" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-col :span="12">
+            <el-form-item label="地址" prop="invoiceAddress">
+              <el-input v-model="formData.invoiceAddress" placeholder="请输入地址" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card>
+        <div slot="header" class="clearfix">
+          <strong>售后系统关联信息</strong>
+        </div>
+        <el-row :gutter="20" class="center">
+          <el-col :span="3">售后系统销售编号</el-col>
+          <el-col :span="4">
+            <el-form-item label-width="0" prop="afterNumber" style="margin: 0">
+              <el-input
+                v-model="formData.afterNumber"
+                placeholder="请输入售后系统销售编号"
+                size="mini"
+                :disabled="moduleType == 3"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">售后系统绑定状态</el-col>
+          <el-col :span="4">{{ formData.binding === 'YES' ? '是' : '否' }}</el-col>
+          <el-col v-if="moduleType !== 3 && moduleType !== 1" :span="4">
+            <el-button type="primary" size="mini" @click="handleBinding">绑定</el-button>
+          </el-col>
+        </el-row>
+        <el-row class="radio center">
+          <el-col :span="8">
+            <el-form-item label-width="0" prop="afterType" style="margin: 0">
+              <el-radio-group v-model="formData.afterType" :disabled="moduleType == 3">
+                <el-radio v-for="item in afterTypeList" :key="item.value" :label="item.value">{{
+                  item.label
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">绑定时间</el-col>
+          <el-col :span="4">{{ formData.bindingTime }}</el-col>
+          <el-col :span="3">绑定人</el-col>
+          <el-col :span="4">{{ formData.bindingName }}</el-col>
+        </el-row>
+      </el-card>
+      <el-card>
+        <div slot="header" class="clearfix">
+          <strong>使用状态</strong>
+        </div>
+        <el-form-item label-width="0" prop="forbidStatus" style="margin: 0">
+          <el-radio-group v-model="formData.forbidStatus" :disabled="moduleType == 3">
+            <el-radio label="A">正常</el-radio>
+            <el-radio label="B">禁用</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <div v-if="moduleType !== 3" style="margin: 20px">
+          <el-button type="primary" size="mini" @click="handleSubmit">提交</el-button>
+          <el-button type="primary" size="mini" @click="handleReset">重置</el-button>
+        </div>
+      </el-card>
+      <el-card v-if="moduleType == 3">
+        <div slot="header" class="clearfix">
+          <strong>审核信息</strong>
+        </div>
+        <el-row :gutter="20">
+          <el-col :span="8">
+            <el-form-item label="审核人">
+              <el-input v-model="formData.approvalName" placeholder="系统自动生成" disabled /> </el-form-item></el-col>
+          <el-col :span="8">
+            <el-form-item label="审核时间">
+              <el-input v-model="formData.approvalTime" placeholder="系统自动生成" disabled /> </el-form-item></el-col>
+          <el-col :span="24">
+            <el-form-item label="备注">
+              <el-input v-model="formData.approvalRemark" placeholder="请输入备注" /> </el-form-item></el-col>
+        </el-row>
+
+        <div style="margin: 20px">
+          <el-button type="primary" size="mini" @click="handleExamine">同意</el-button>
+          <el-button type="primary" size="mini" @click="handleExamine('SAVE')">驳回</el-button>
+        </div>
+      </el-card>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import {
+  addStagecustomer,
+  examineStagecustomer,
+  updateStagecustomer,
+  updateSystem,
+  getStageCustomerDetail
+} from '@/api/basic_data/dealer'
+
+export default {
+  props: {
+    moduleType: {
+      type: Number,
+      default: null
+    },
+    detailsId: {
+      type: String,
+      default: null
+    }
+  },
+  data() {
+    return {
+      title: '新增',
+      afterTypeList: [
+        { label: '绑定上级商户销售编号', value: 'CHARGE' },
+        { label: '绑定二级商户编号', value: 'STAGE' }
+      ],
+      formData: {
+        higherPrantNumber: '',
+        higherPrantName: '',
+        number: '',
+        name: '',
+        chargeName: '',
+        mobile: '',
+        invoiceAddress: '',
+        afterNumber: '',
+        binding: '否',
+        afterType: 'CHARGE',
+        bindingTime: '',
+        bindingName: '',
+        forbidStatus: 'A',
+        approvalName: '',
+        approvalTime: '',
+        approvalRemark: ''
+      }
+    }
+  },
+  mounted() {
+    if ((this.moduleType === 3 || this.moduleType === 4) && this.detailsId) {
+      this.title = this.moduleType === 3 ? '审核' : '编辑'
+      this.getStageCustomerDetail()
+    }
+  },
+  methods: {
+    goBack() {
+      this.$emit('close')
+    },
+    getStageCustomerDetail() {
+      getStageCustomerDetail({ id: this.detailsId }).then(res => {
+        this.formData = res.data
+      })
+    },
+    handleSubmit() {
+      if (this.moduleType !== 1) {
+        updateStagecustomer({
+          ...this.formData
+        }).then(res => {
+          this.$successMsg('编辑成功')
+        })
+      } else {
+        addStagecustomer({
+          ...this.formData
+        }).then(res => {
+          this.$successMsg('新增成功')
+        })
+      }
+      this.$emit('close')
+    },
+    handleExamine(status = 'OK') {
+      examineStagecustomer({
+        id: this.formData.id,
+        examineStatus: status,
+        approvalRemark: this.formData.approvalRemark
+      }).then(res => {
+        this.$successMsg(status === 'OK' ? '审核成功' : '驳回成功')
+        this.$emit('close')
+      })
+    },
+    handleBinding() {
+      updateSystem({
+        id: this.detailsId,
+        afterNumber: this.formData.afterNumber
+      }).then(res => {
+        getStageCustomerDetail({ id: this.detailsId }).then(res => {
+          const { afterType, bindingTime, bindingName } = res.data
+          this.formData.afterType = afterType
+          this.formData.bindingTime = bindingTime
+          this.formData.bindingName = bindingName
+          this.$successMsg('绑定成功')
+        })
+      })
+    },
+    handleReset() {
+      this.$refs.formData.resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.sty {
+  margin-bottom: 20px;
+}
+::v-deep .el-card {
+  margin-bottom: 20px;
+}
+.center {
+  display: flex;
+  align-items: center;
+}
+.radio {
+  padding: 20px 0;
+}
+</style>

+ 45 - 12
src/views/basic_data/dealer/dealer_list.vue

@@ -1,14 +1,14 @@
 <template>
   <template-page
     ref="pageRef"
-    :getList="getList"
-    :exportList="exportList"
+    :get-list="getList"
+    :export-list="exportList"
     :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :columnParsing="columnParsing"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
   >
     <Popu v-if="visible">
-      <DealerListDetail :detailsId="detailsId" @close="handleClose" />
+      <DealerListDetail :details-id="detailsId" @close="handleClose" />
     </Popu>
   </template-page>
 </template>
@@ -18,7 +18,9 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import add_callback_mixin from '@/components/template/add_callback_mixin.js'
 import Popu from '@/components/template/popu.vue'
-import { getDealerListV2, exportDealerListV2,importCustomerV2 } from '@/api/basic_data/dealer'
+
+import { getDealerListV2, exportDealerListV2, importCustomerV2, exportJiaXianV2 } from '@/api/basic_data/dealer'
+
 import DealerListDetail from './components/dealer_list-detail.vue'
 export default {
   components: { TemplatePage, Popu, DealerListDetail },
@@ -28,7 +30,7 @@ export default {
       visible: false,
       // 事件组合
       optionsEvensGroup: [
-       [
+        [
           [
             {
               name: '导入',
@@ -36,6 +38,37 @@ export default {
             }
           ]
         ],
+        [
+          [
+            {
+              name: '导出提贷物流存货类别',
+              click: (p) => {
+                const loading = this.$loading({
+                  lock: true,
+                  text: 'Loading',
+                  spinner: 'el-icon-loading',
+                  background: 'rgba(0, 0, 0, 0.7)'
+                })
+                exportJiaXianV2({
+                  pageNum: 1,
+                  pageSize: -1,
+                  params: this.$refs.pageRef.getParams().querylist
+                }, `${this.$route.meta.title}`)
+                  .then(_res => {
+                    this.$message({
+                      message: '导出成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(_err => {
+
+                  }).finally(() => loading.close()
+                  )
+              }
+            }
+          ]
+
+        ]
       ],
       // 表格属性
       tableAttributes: {
@@ -61,7 +94,7 @@ export default {
     // 列表导出函数
     exportList: exportDealerListV2,
     // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
+    columnParsing(_item, defaultData) {
       return defaultData
     },
     // 监听勾选变化
@@ -69,12 +102,12 @@ export default {
       this.recordSelected = data
     },
     operation() {
-      return (h, { row, index, column }) => {
+      return (_h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             <el-button
-              size="mini"
-              type="text"
+              size='mini'
+              type='text'
               onClick={ () => {
                 this.visible = true
                 this.detailsId = row.id

+ 135 - 0
src/views/basic_data/dealer/subMerchant.vue

@@ -0,0 +1,135 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :operation="operation()"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+    :replace-or-not-map="false"
+  >
+    <Popu v-if="visible">
+      <SubMerchantForm v-if="moduleType === 1 || moduleType === 3 || moduleType === 4" :module-type="moduleType" :details-id="detailsId" @close="handleClose" />
+      <SubMerchantDetail v-if="moduleType === 2" :details-id="detailsId" @close="handleClose" />
+    </Popu>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getStagecustomerListV2, exportStagecustomerV2 } from '@/api/basic_data/dealer'
+import SubMerchantDetail from './components/subMerchantDetail.vue'
+import SubMerchantForm from './components/subMerchantForm.vue'
+
+export default {
+  components: { TemplatePage, Popu, SubMerchantDetail, SubMerchantForm },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.visible = true
+                this.moduleType = 1
+              })
+            //   isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getStagecustomerListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportStagecustomerV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={ () => {
+                this.visible = true
+                this.moduleType = 2
+                this.detailsId = row.id
+              }}
+            >
+                查看
+            </el-button>
+            {row.examineStatus === 'SAVE' || row.examineStatus === 'WAIT'
+              ? <el-button
+                size='mini'
+                type='text'
+                onClick={ () => {
+                  this.visible = true
+                  this.moduleType = 4
+                  this.detailsId = row.id
+                }}
+              >
+            编辑
+              </el-button> : null
+            }
+            {row.examineStatus === 'SAVE' || row.examineStatus === 'WAIT'
+              ? <el-button
+                size='mini'
+                type='text'
+                onClick={ () => {
+                  this.visible = true
+                  this.moduleType = 3
+                  this.detailsId = row.id
+                }}
+              >
+                审核
+              </el-button> : null
+            }
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+      this.$refs.pageRef.refreshList()
+    }
+  }
+}
+</script>
+
+  <style lang="scss" scoped></style>
+

+ 18 - 3
src/views/basic_data/material/modify_list.vue

@@ -35,7 +35,7 @@ import {
   getPriceSubmit,
   getProductRricedel,
   getProductRriceDetail,
-  getProductRriceList,
+  productUpdPriceReview,
   getTypeList,
   examineData,
   v2ProductUpdPriceList,
@@ -266,7 +266,6 @@ export default {
     },
     operation() {
       return (h, { row, index, column }) => {
-        console.log(row)
         return (
           <div class="operation-btns">
             {row.examineStatus == '保存' ? (
@@ -312,7 +311,23 @@ export default {
             ) : (
               ''
             )}
-
+            {row.examineStatus == '审核通过' ? (
+              <el-popconfirm
+                onOnConfirm={async() => {
+                  productUpdPriceReview({ id: row.updPriceBillId }).then(() => {
+                    this.$successMsg('弃审成功')
+                    this.$refs.pageRef.refreshList()
+                  })
+                }}
+                title='是否确定需要审批该项内容?'
+              >
+                <el-button slot='reference' size='mini' type='text'>
+                  弃审
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
             <el-button
               size="mini"
               type="text"

+ 293 - 0
src/views/basic_data/priceSalesType.vue

@@ -0,0 +1,293 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :operation="operation()"
+    :table-events="tableEvents"
+    :table-attributes="tableAttributes"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <el-dialog title="价格类型" :visible.sync="visible" width="40%" @close="handleClose">
+      <el-form ref="formData" :model="formData" label-width="120px" :inline="false" size="mini" :disabled="disabled">
+        <el-form-item label="价格类型" prop="priceTypeId">
+          <el-select v-model="formData.priceTypeId" placeholder="请选择价格类型" clearable filterable>
+            <el-option
+              v-for="item in priceTypeList"
+              :key="item.priceTypeId"
+              :label="item.priceTypeName"
+              :value="item.priceTypeId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="销售类型名称" prop="saleId">
+          <el-select v-model="formData.saleId" placeholder="请选择销售类型名称" clearable filterable @change="handleChange">
+            <el-option
+              v-for="item in saleypeList"
+              :key="item.id"
+              :label="item.saleName"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="销售类型编码" prop="saleCode">
+          <el-input v-model="formData.saleCode" disabled placeholder="请选择销售类型生成" />
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-switch v-model="formData.status" :active-value="true" :inactive-value="false" />
+        </el-form-item>
+      </el-form>
+
+      <span slot="footer">
+        <el-button @click="handleClose">取消</el-button>
+        <el-button type="primary" :disabled="disabled" @click="handleSubmit">确定</el-button>
+      </span>
+    </el-dialog>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { saleTypeRebateListV2 } from '@/api/policy_list'
+import {
+  getProductPriceListV2,
+  getPriceSalesRelaListV2,
+  exportPriceSalesRelaListV2,
+  addPriceSalesRela,
+  editPriceSalesRela,
+  updatePriceSalesRelaStatus,
+  getPriceSalesRelaDetail,
+  delPriceSalesRela
+} from '@/api/priceType'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.handleShow()
+              })
+              // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async() => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                const ids = this.recordSelected.map(v => {
+                  return v.priceSaleTypeRelaId
+                })
+                const params = ids
+                await delPriceSalesRela(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      edit: false,
+      disabled: false,
+      formData: {
+        priceTypeId: '',
+        saleId: '',
+        saleCode: '',
+        status: true
+      },
+      priceTypeList: [],
+      saleypeList: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getPriceSalesRelaListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportPriceSalesRelaListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.colName === 'status') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div>
+              <el-switch
+                value={row.status}
+                onInput={value => (row.status = value)}
+                active-value='有效'
+                inactive-value='无效'
+                onChange={() => {
+                  updatePriceSalesRelaStatus({
+                    priceSaleTypeRelaId: row.priceSaleTypeRelaId,
+                    status: row.status === '有效' ? 'ON' : 'OFF'
+                  }).then(res => {
+                    this.$successMsg('状态更改成功')
+                  })
+                }}
+              ></el-switch>
+              <span style='margin-left:10px'>{row.statusMap && row.statusMap[row.status]}</span>
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              type='text'
+              size='default'
+              onClick={ async() => {
+                this.getDetail(row.priceSaleTypeRelaId)
+                this.disabled = true
+                this.handleShow()
+              }}
+            >详情</el-button>
+            <el-button
+              type='text'
+              size='default'
+              onClick={ async() => {
+                this.getDetail(row.priceSaleTypeRelaId)
+                this.edit = true
+                this.handleShow()
+              }}
+            >编辑</el-button>
+            <el-popconfirm
+              onOnConfirm={() => {
+                delPriceSalesRela([row.priceSaleTypeRelaId]).then(res => {
+                  this.$successMsg('删除成功')
+                  this.$refs.pageRef.refreshList()
+                })
+              }}
+              title='是否确定需要删除该项内容?'
+            >
+              <el-button slot='reference' size='mini' type='text'>
+                  删除
+              </el-button>
+            </el-popconfirm>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.edit = false
+      this.disabled = false
+      this.$refs.formData.resetFields()
+      this.addOff(() => {
+        this.visible = false
+      })()
+    },
+    handleShow() {
+      this.visible = true
+      this.getProductPriceListV2()
+      this.getSaleTypeRebateListV2()
+    },
+    handleChange(e) {
+      if (e) {
+        this.formData.saleCode = this.saleypeList.find(k => k.id === e).saleCode
+      } else {
+        this.formData.saleCode = ''
+      }
+    },
+    getProductPriceListV2() {
+      getProductPriceListV2({
+        'pageNum': 1,
+        'pageSize': -1,
+        'params': []
+      }).then(res => {
+        this.priceTypeList = res.data.records
+      })
+    },
+    getSaleTypeRebateListV2() {
+      saleTypeRebateListV2({
+        'pageNum': 1,
+        'pageSize': -1,
+        'params':
+          [
+            {
+              'param': 'a.status',
+              'compare': '=',
+              'value': 'true'
+            }
+          ]
+
+      }).then(res => {
+        this.saleypeList = res.data.records
+      })
+    },
+    async getDetail(priceSaleTypeRelaId) {
+      const { data } = await getPriceSalesRelaDetail({ priceSaleTypeRelaId })
+      this.formData = { ...data }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(valid => {
+        if (valid) {
+          const params = {
+            ...this.formData
+          }
+
+          if (!this.edit) {
+            params.priceSaleTypeRelaId = ''
+            addPriceSalesRela(params).then(res => {
+              this.handleClose()
+              this.$successMsg('新增成功')
+              this.$refs.pageRef.refreshList()
+            })
+          } else {
+            editPriceSalesRela(params).then(res => {
+              this.edit = false
+              this.handleClose()
+              this.$successMsg('编辑成功')
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-select{
+  width: 100%;
+}
+</style>

+ 234 - 0
src/views/basic_data/priceType.vue

@@ -0,0 +1,234 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :operation="operation()"
+    :table-events="tableEvents"
+    :table-attributes="tableAttributes"
+    :column-parsing="columnParsing"
+  >
+    <el-dialog title="价格类型" :visible.sync="visible" width="40%" @close="handleClose">
+      <el-form ref="formData" :model="formData" label-width="120px" :inline="false" size="mini" :disabled="disabled">
+        <el-form-item label="价格类型编号" prop="priceTypeCode">
+          <el-input v-model="formData.priceTypeCode" :disabled="edit"/>
+        </el-form-item>
+        <el-form-item label="价格类型名称" prop="priceTypeName">
+          <el-input v-model="formData.priceTypeName" />
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-switch v-model="formData.status" :active-value="true" :inactive-value="false" />
+        </el-form-item>
+      </el-form>
+      <span slot="footer">
+        <el-button @click="handleClose">取消</el-button>
+        <el-button type="primary" :disabled="disabled" @click="handleSubmit">确定</el-button>
+      </span>
+    </el-dialog>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import {
+  getProductPriceListV2,
+  exportProductPriceListV2,
+  addProductPrice,
+  editProductPrice,
+  updateProductPriceStatus,
+  getProductPriceDetail,
+  delProductPrice
+} from '@/api/priceType'
+import { async } from 'q'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.handleShow()
+              })
+              // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async() => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                const ids = this.recordSelected.map(v => {
+                  return v.priceTypeId
+                })
+                const params = ids
+                await delProductPrice(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      edit: false,
+      disabled: false,
+      formData: {
+        priceTypeCode: '',
+        priceTypeName: '',
+        status: true
+      }
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getProductPriceListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportProductPriceListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.colName === 'status') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div>
+              <el-switch
+                value={row.status}
+                onInput={value => (row.status = value)}
+                active-value='有效'
+                inactive-value='无效'
+                onChange={() => {
+                  updateProductPriceStatus({
+                    priceTypeId: row.priceTypeId,
+                    status: row.status === '有效' ? 'ON' : 'OFF'
+                  }).then(res => {
+                    this.$successMsg('状态更改成功')
+                  })
+                }}
+              ></el-switch>
+              <span style='margin-left:10px'>{row.statusMap && row.statusMap[row.status]}</span>
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              type='text'
+              size='default'
+              onClick={ async() => {
+                this.getDetail(row.priceTypeId)
+                this.disabled = true
+                this.handleShow()
+              }}
+            >详情</el-button>
+            <el-button
+              type='text'
+              size='default'
+              onClick={ async() => {
+                this.getDetail(row.priceTypeId)
+                this.edit = true
+                this.handleShow()
+              }}
+            >编辑</el-button>
+            <el-popconfirm
+              onOnConfirm={() => {
+                delProductPrice([row.priceTypeId]).then(res => {
+                  this.$successMsg('删除成功')
+                  this.$refs.pageRef.refreshList()
+                })
+              }}
+              title='是否确定需要删除该项内容?'
+            >
+              <el-button slot='reference' size='mini' type='text'>
+                  删除
+              </el-button>
+            </el-popconfirm>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.edit = false
+      this.disabled = false
+      this.$refs.formData.resetFields()
+      this.addOff(() => {
+        this.visible = false
+      })()
+    },
+    handleShow() {
+      this.visible = true
+    },
+    async getDetail(priceTypeId) {
+      const { data } = await getProductPriceDetail({ priceTypeId })
+      this.formData = { ...data }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(valid => {
+        if (valid) {
+          const params = {
+            ...this.formData
+          }
+
+          if (!this.edit) {
+            params.priceTypeId = ''
+            addProductPrice(params).then(res => {
+              this.handleClose()
+              this.$successMsg('新增成功')
+              this.$refs.pageRef.refreshList()
+            })
+          } else {
+            editProductPrice(params).then(res => {
+              this.edit = false
+              this.handleClose()
+              this.$successMsg('编辑成功')
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 103 - 0
src/views/delayRecord/delayRecordList.vue

@@ -0,0 +1,103 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :operation="operation()"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <popu v-if="visible">
+      <el-page-header slot="head" content="政策延期" @back="handleClose" />
+      <!-- <delay-record-form /> -->
+    </popu>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+// import DelayRecordForm from '../sales_policy/components/delayRecordForm.vue';
+import Popu from '@/components/template/popu.vue'
+import { getDealerListV2, exportDealerListV2 } from '@/api/basic_data/dealer'
+export default {
+  components: { TemplatePage, Popu,  },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.visible = true
+              })
+              // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getDealerListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportDealerListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={ () => {
+                this.visible = true
+                this.detailsId = row.id
+              }}
+            >
+                    查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+      <style lang="scss" scoped></style>
+

+ 204 - 10
src/views/deposit_home/components/deposit-apply-surrender.vue

@@ -80,6 +80,14 @@
             </div>
           </el-col>
           <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">格力内部资料备注</div>
+              <div class="value">{{ details.geLiInnerDataNote }}</div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">订单格力内部备注</div>
+              <div class="value">{{ details.orderGeLiInnerNote }}</div>
+            </el-col>
+          <el-col :xs="24" :sm="24" :lg="24" class="item">
             <div class="label">使用单位</div>
             <div class="value">{{ details.refUseUnit }}</div>
           </el-col>
@@ -101,6 +109,84 @@
               </el-form-item>
             </div>
           </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">登录有效期</div>
+            <div class="value">
+              {{ details.refBillsExpireDate }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">实际使用单位</div>
+            <div class="value">
+              {{ details.realUseUnit }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">实际安装地址</div>
+            <div class="value">
+              {{ details.realInstallAddress }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">项目编号</div>
+            <div class="value">
+              {{ details.refProjectNo }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">购买单位</div>
+            <div class="value">
+              {{ details.refBuyUnitName }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">合同变更批复意见</div>
+            <div class="value">
+              {{ details.refContractIdea }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">合同变更批复结果</div>
+            <div class="value">
+              {{ details.refContractResult }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">资料延期批复意见</div>
+            <div class="value">
+              {{ details.refDataDelayResult }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">资料延期批复结果</div>
+            <div class="value">
+              {{ details.refInstallAddress }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">工程机转零售批复意见</div>
+            <div class="value">
+              {{ details.refToRetailIdea }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">工程机转零售批复结果</div>
+            <div class="value">
+              {{ details.refToRetailResult }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">其他附件审批意见</div>
+            <div class="value">
+              {{ details.refOtherAnnexIdea }}
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">其他附件批复结果</div>
+            <div class="value">
+              {{ details.refOtherAnnexResult }}
+            </div>
+          </el-col>
           <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
             <div class="label">寄厂日期</div>
             <div class="value" style="padding: 0">
@@ -197,6 +283,12 @@
               {{ scope.row.totalAmount | numToFixed }}
             </template>
           </el-table-column>
+          <el-table-column align="right" label="销售数量" prop="salesQty" min-width="160" show-overflow-tooltip />
+          <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.salesAmount | numToFixed }}
+            </template>
+          </el-table-column>
           <el-table-column align="center" label="押金数量" prop="hasSendQty" min-width="160" show-overflow-tooltip />
           <el-table-column
             align="center"
@@ -257,6 +349,102 @@
         </el-table>
       </div>
     </div>
+    <h3>押金货品信息</h3>
+    <el-divider />
+    <!-- 列表 -->
+    <div class="mymain-container">
+      <div class="table">
+        <el-table
+          v-loading="listLoading"
+          :data="details.collectList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          show-summary
+          :summary-method="$getSummaries"
+        >
+          <el-table-column align="left" label="工程登录单号" prop="refEnginRecordNo" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.refEnginRecordNo" />
+              <span>{{ scope.row.refEnginRecordNo }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="规格型号" prop="specification" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.specification" />
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="基本单位编码" prop="unit" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.unit" />
+              <span>{{ scope.row.unit }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.customerWalletName" />
+              <span>{{ scope.row.customerWalletName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="现金钱包编码" prop="customerWalletNumber" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.customerWalletNumber" />
+              <span>{{ scope.row.customerWalletNumber }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="金蝶物料类型名称" prop="k3CategoryName" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.k3CategoryName" />
+              <span>{{ scope.row.k3CategoryName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="金蝶物料类型编码" prop="k3CategoryNumber" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.k3CategoryNumber" />
+              <span>{{ scope.row.k3CategoryNumber }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="金蝶物料名称" prop="materialName" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.materialName" />
+              <span>{{ scope.row.materialName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="金蝶物料编码" prop="materialNumber" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.materialNumber" />
+              <span>{{ scope.row.materialNumber }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="金蝶物料旧编码" prop="materialOldNumber" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.materialOldNumber" />
+              <span>{{ scope.row.materialOldNumber }}</span>
+            </template>
+          </el-table-column>
+ 
+          <el-table-column align="left" label="已发押金数量" prop="hasSendQty" min-width="130" show-overflow-tooltip />
+          <el-table-column align="left" label="单价" prop="price" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.price | numToFixed }}
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="已退押金金额" prop="refundDepositAmount" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.refundDepositAmount | numToFixed }}
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="押金金额" prop="depositAmount" min-width="130" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.depositAmount | numToFixed }}
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
     <h3>上传资料</h3>
     <el-divider />
     <!-- 筛选条件 -->
@@ -314,17 +502,17 @@
                         v-if="checkFileType(scope.row.fileUrl) == 'word'"
                         class="file"
                         src="@/assets/common/word.png"
-                      />
+                      >
                       <img
                         v-if="checkFileType(scope.row.fileUrl) == 'excel'"
                         class="file"
                         src="@/assets/common/excel.png"
-                      />
+                      >
                       <img
                         v-if="checkFileType(scope.row.fileUrl) == 'ppt'"
                         class="file"
                         src="@/assets/common/ppt.png"
-                      />
+                      >
 
                       <img
                         v-if="checkFileType(scope.row.fileUrl) == 'pdf'"
@@ -332,13 +520,13 @@
                         style="cursor: pointer"
                         src="@/assets/common/pdf.png"
                         @click="openPdf(scope.row.fileUrl)"
-                      />
+                      >
 
                       <img
                         v-if="checkFileType(scope.row.fileUrl) == 'file'"
                         class="file aaa"
                         src="@/assets/common/zip.jpeg"
-                      />
+                      >
                     </template>
                   </el-table-column>
                   <el-table-column
@@ -358,8 +546,7 @@
                         type="text"
                         class="textColor"
                         @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
-                        >下载</el-button
-                      >
+                      >下载</el-button>
                       <el-popconfirm
                         style="margin-left: 10px"
                         title="这是一段内容确定删除吗?"
@@ -433,6 +620,9 @@ import { downloadFiles, downloadPdf } from '@/utils/util'
 import { getFileUrl } from '@/api/common'
 
 export default {
+  components: {
+    imageUpload
+  },
   props: {
     depositManageId: {
       type: [String, Number],
@@ -443,9 +633,6 @@ export default {
       default: null
     }
   },
-  components: {
-    imageUpload
-  },
   data() {
     return {
       isDis: true,
@@ -504,7 +691,14 @@ export default {
             'contractAmount'
           ]
         })
+        res.data.collectList.forEach(item => {
+          // item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
+          item.sums1 = ['orderHasSendQty', 'dataQty', 'hasSendQty']
+          item.sums2 = ['price', 'refundDepositAmount', 'depositAmount']
+        })
         res.data.items = arr
+        res.data.realUseUnit =res.data.realUseUnit || res.data.refUseUnit
+          res.data.realInstallAddress =   res.data.realInstallAddress ||res.data.refInstallAddress
         this.details = res.data
       })
     },

+ 260 - 61
src/views/deposit_home/components/deposit_list-detail.vue

@@ -11,7 +11,7 @@
       <!-- <el-radio-button label="直调发货" /> -->
       <el-radio-button label="历史记录" />
     </el-radio-group>
-    <br /><br />
+    <br><br>
 
     <div v-show="engineering == '工程押金信息'">
       <div class="diy-table-1">
@@ -76,12 +76,20 @@
               <div class="label">工程差价总额</div>
               <div class="value">{{ details.depositDiffAmount }}</div>
             </el-col>
-            <el-col :xs="24" :sm="24" :lg="24" class="item" v-if="!isCustomer">
+            <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="24" class="item">
               <div class="label">格力内部备注</div>
               <div class="value">
-                <el-input v-model="details.geLiInerNote" placeholder="格力内部备注"></el-input>
+                <el-input v-model="details.geLiInerNote" placeholder="格力内部备注" />
               </div>
             </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">格力内部资料备注</div>
+              <div class="value">{{ details.geLiInnerDataNote }}</div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">订单格力内部备注</div>
+              <div class="value">{{ details.orderGeLiInnerNote }}</div>
+            </el-col>
             <el-col :xs="24" :sm="24" :lg="12" class="item">
               <div class="label">使用单位</div>
               <div class="value">{{ details.refUseUnit }}</div>
@@ -111,7 +119,85 @@
                 {{ details.refInstallAddress }}
               </div>
             </el-col>
-
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">登录有效期</div>
+              <div class="value">
+                {{ details.refBillsExpireDate }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">实际使用单位</div>
+            <div class="value">
+              <el-input v-model="details.realUseUnit" placeholder="实际使用单位" />
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="8" class="item">
+            <div class="label">实际安装地址</div>
+            <div class="value">
+              <el-input v-model="details.realInstallAddress" placeholder="实际使用单位" />
+            </div>
+          </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">项目编号</div>
+              <div class="value">
+                {{ details.refProjectNo }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">购买单位</div>
+              <div class="value">
+                {{ details.refBuyUnitName }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">合同变更批复意见</div>
+              <div class="value">
+                {{ details.refContractIdea }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">合同变更批复结果</div>
+              <div class="value">
+                {{ details.refContractResult }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">资料延期批复意见</div>
+              <div class="value">
+                {{ details.refDataDelayResult }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">资料延期批复结果</div>
+              <div class="value">
+                {{ details.refInstallAddress }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">工程机转零售批复意见</div>
+              <div class="value">
+                {{ details.refToRetailIdea }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">工程机转零售批复结果</div>
+              <div class="value">
+                {{ details.refToRetailResult }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">其他附件审批意见</div>
+              <div class="value">
+                {{ details.refOtherAnnexIdea }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">其他附件批复结果</div>
+              <div class="value">
+                {{ details.refOtherAnnexResult }}
+              </div>
+            </el-col>
+            
             <!--            <el-col :xs="24" :sm="24" :lg="8" class="item">-->
             <!--              <div class="label">寄厂日期</div>-->
             <!--              <div class="value" style="padding: 0">-->
@@ -155,7 +241,7 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.factoryNo" />
+                <CopyButton :copy-text="scope.row.factoryNo" />
                 <span>{{ scope.row.factoryNo }}</span>
               </template>
             </el-table-column>
@@ -168,13 +254,13 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.specialNo" />
+                <CopyButton :copy-text="scope.row.specialNo" />
                 <span>{{ scope.row.specialNo }}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="130" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialNumber" />
+                <CopyButton :copy-text="scope.row.materialNumber" />
                 <span>{{ scope.row.materialNumber }}</span>
               </template>
             </el-table-column>
@@ -186,19 +272,19 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialOldNumber" />
+                <CopyButton :copy-text="scope.row.materialOldNumber" />
                 <span>{{ scope.row.materialOldNumber }}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialName" />
+                <CopyButton :copy-text="scope.row.materialName" />
                 <span>{{ scope.row.materialName }}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="规格型号" prop="specification" min-width="300" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.specification" />
+                <CopyButton :copy-text="scope.row.specification" />
                 <span>{{ scope.row.specification }}</span>
               </template>
             </el-table-column>
@@ -252,6 +338,12 @@
                 {{ scope.row.totalAmount | numToFixed }}
               </template>
             </el-table-column>
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.salesAmount | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column align="right" label="押金数量" prop="hasSendQty" min-width="160" show-overflow-tooltip />
             <el-table-column
               align="right"
@@ -311,9 +403,109 @@
           </el-table>
         </div>
       </div>
+      <h3>押金货品信息</h3>
+      <el-divider />
+      <!-- 列表 -->
+      <div class="mymain-container">
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="details.collectList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            show-summary
+            :summary-method="$getSummaries"
+          >
+            <el-table-column align="left" label="工程登录单号" prop="refEnginRecordNo" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.refEnginRecordNo" />
+                <span>{{ scope.row.refEnginRecordNo }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.specification" />
+                <span>{{ scope.row.specification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="基本单位编码" prop="unit" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.unit" />
+                <span>{{ scope.row.unit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletName" />
+                <span>{{ scope.row.customerWalletName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包编码" prop="customerWalletNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletNumber" />
+                <span>{{ scope.row.customerWalletNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型名称" prop="k3CategoryName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryName" />
+                <span>{{ scope.row.k3CategoryName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型编码" prop="k3CategoryNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryNumber" />
+                <span>{{ scope.row.k3CategoryNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料名称" prop="materialName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialName" />
+                <span>{{ scope.row.materialName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料编码" prop="materialNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialNumber" />
+                <span>{{ scope.row.materialNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料旧编码" prop="materialOldNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialOldNumber" />
+                <span>{{ scope.row.materialOldNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="已发押金数量" prop="hasSendQty" min-width="130" show-overflow-tooltip />
+            <el-table-column align="left" label="单价" prop="price" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="已退押金金额" prop="refundDepositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.refundDepositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="押金金额" prop="depositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
       <h3 class="gdzl">工程资料</h3>
-      <el-button :disabled="isDis" class="batchDownload" type="primary" size="small" @click="batchDownloadFn"
-        >批量下载
+      <el-button
+        :disabled="isDis"
+        class="batchDownload"
+        type="primary"
+        size="small"
+        @click="batchDownloadFn"
+      >批量下载
       </el-button>
 
       <el-divider />
@@ -342,9 +534,9 @@
                   fit="cover"
                   :preview-src-list="[imageURL + scope.row.fileUrl]"
                 />
-                <img v-if="checkFileType(scope.row.fileUrl) == 'word'" class="file" src="@/assets/common/word.png" />
-                <img v-if="checkFileType(scope.row.fileUrl) == 'excel'" class="file" src="@/assets/common/excel.png" />
-                <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
+                <img v-if="checkFileType(scope.row.fileUrl) == 'word'" class="file" src="@/assets/common/word.png">
+                <img v-if="checkFileType(scope.row.fileUrl) == 'excel'" class="file" src="@/assets/common/excel.png">
+                <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png">
 
                 <img
                   v-if="checkFileType(scope.row.fileUrl) == 'pdf'"
@@ -352,13 +544,13 @@
                   style="cursor: pointer"
                   src="@/assets/common/pdf.png"
                   @click="openPdf(scope.row.fileUrl)"
-                />
+                >
 
                 <img
                   v-if="checkFileType(scope.row.fileUrl) == 'file'"
                   class="file aaa"
                   src="@/assets/common/zip.jpeg"
-                />
+                >
               </template>
             </el-table-column>
             <el-table-column align="left" label="下载文件名称" prop="fileName" min-width="160" show-overflow-tooltip>
@@ -368,8 +560,11 @@
             </el-table-column>
             <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-button type="text" class="textColor" @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
-                  >下载
+                <el-button
+                  type="text"
+                  class="textColor"
+                  @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
+                >下载
                 </el-button>
                 <!--                <el-button-->
                 <!--                  v-if="checkFileType(scope.row.fileUrl) == 'pdf'"-->
@@ -480,19 +675,19 @@
                       v-if="checkFileType(scope.row.fileUrl) == 'word'"
                       class="file"
                       src="@/assets/common/word.png"
-                    />
+                    >
                     <img
                       v-if="checkFileType(scope.row.fileUrl) == 'excel'"
                       class="file"
                       src="@/assets/common/excel.png"
-                    />
-                    <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
-                    <img v-if="checkFileType(scope.row.fileUrl) == 'pdf'" class="file" src="@/assets/common/pdf.png" />
+                    >
+                    <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png">
+                    <img v-if="checkFileType(scope.row.fileUrl) == 'pdf'" class="file" src="@/assets/common/pdf.png">
                     <img
                       v-if="checkFileType(scope.row.fileUrl) == 'file'"
                       class="file aaa"
                       src="@/assets/common/zip.jpeg"
-                    />
+                    >
                   </template>
                 </el-table-column>
                 <el-table-column
@@ -508,9 +703,11 @@
                 </el-table-column>
                 <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
                   <template slot-scope="scope">
-                    <el-button type="text" class="textColor" @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
-                      >下载</el-button
-                    >
+                    <el-button
+                      type="text"
+                      class="textColor"
+                      @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
+                    >下载</el-button>
                   </template>
                 </el-table-column>
               </el-table>
@@ -564,7 +761,7 @@
                   <el-col :xs="12" :sm="24" :lg="24" class="item">
                     <div class="label">复核说明</div>
                     <div class="value">
-                      <input v-model="details.reviewRemark" type="text" />
+                      <input v-model="details.reviewRemark" type="text">
                     </div>
                   </el-col>
                 </el-row>
@@ -578,26 +775,26 @@
         <el-button
           v-if="
             (details.examineStatus != 'OK' || (!isCustomer && details.examineStatus == 'OK')) &&
-            details.dataState != 'WAIT_REVIEW' &&
-            details.dataState != 'AMEND' &&
-            details.dataState != 'REVIEW'
+              details.dataState != 'WAIT_REVIEW' &&
+              details.dataState != 'AMEND' &&
+              details.dataState != 'REVIEW'
           "
           type="primary"
           size="small"
           @click="handleSvse"
-          >保存
+        >保存
         </el-button>
         <el-button
           v-if="
             (details.examineStatus != 'OK' || (!isCustomer && details.examineStatus == 'OK')) &&
-            details.dataState != 'WAIT_REVIEW' &&
-            details.dataState != 'AMEND' &&
-            details.dataState != 'REVIEW'
+              details.dataState != 'WAIT_REVIEW' &&
+              details.dataState != 'AMEND' &&
+              details.dataState != 'REVIEW'
           "
           type="primary"
           size="small"
           @click="handleReset"
-          >重置
+        >重置
         </el-button>
       </div>
     </div>
@@ -618,20 +815,20 @@
           >
             <el-table-column align="left" label="工程订单号" prop="enginOrderNo" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.enginOrderNo" />
+                <CopyButton :copy-text="scope.row.enginOrderNo" />
                 <span>{{ scope.row.enginOrderNo }}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip />
             <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialName" />
+                <CopyButton :copy-text="scope.row.materialName" />
                 <span>{{ scope.row.materialName }}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.specification" />
+                <CopyButton :copy-text="scope.row.specification" />
                 <span>{{ scope.row.specification }}</span>
               </template>
             </el-table-column>
@@ -673,20 +870,20 @@
           >
             <el-table-column align="left" label="发货单" prop="id" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.id" />
+                <CopyButton :copy-text="scope.row.id" />
                 <span>{{ scope.row.id }}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="发货申请日期" prop="theTime" min-width="160" show-overflow-tooltip />
             <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialName" />
+                <CopyButton :copy-text="scope.row.materialName" />
                 <span>{{ scope.row.materialName }}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.specification" />
+                <CopyButton :copy-text="scope.row.specification" />
                 <span>{{ scope.row.specification }}</span>
               </template>
             </el-table-column>
@@ -716,20 +913,20 @@
         <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="left" label="发货单" prop="id" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.id" />
+              <CopyButton :copy-text="scope.row.id" />
               <span>{{ scope.row.id }}</span>
             </template>
           </el-table-column>
           <el-table-column align="left" label="发货申请日期" prop="orderTime" min-width="160" show-overflow-tooltip />
           <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.materialName" />
+              <CopyButton :copy-text="scope.row.materialName" />
               <span>{{ scope.row.materialName }}</span>
             </template>
           </el-table-column>
           <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.specification" />
+              <CopyButton :copy-text="scope.row.specification" />
               <span>{{ scope.row.specification }}</span>
             </template>
           </el-table-column>
@@ -769,10 +966,8 @@
             highlight-current-row
             stripe
           >
-            <el-table-column align="left" label="受理日期" prop="checkDate" min-width="160" show-overflow-tooltip>
-            </el-table-column>
-            <el-table-column align="left" label="验收人" prop="checkName" min-width="160" show-overflow-tooltip>
-            </el-table-column>
+            <el-table-column align="left" label="受理日期" prop="checkDate" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="验收人" prop="checkName" min-width="160" show-overflow-tooltip />
             <el-table-column
               align="left"
               label="申请退押金备注
@@ -780,8 +975,7 @@
               prop="applyNote"
               min-width="160"
               show-overflow-tooltip
-            >
-            </el-table-column>
+            />
             <el-table-column
               align="left"
               label="验收说明
@@ -789,8 +983,7 @@
               prop="checkNote"
               min-width="160"
               show-overflow-tooltip
-            >
-            </el-table-column>
+            />
             <el-table-column
               align="left"
               label="是否退押
@@ -810,10 +1003,8 @@
               prop="submitName"
               min-width="160"
               show-overflow-tooltip
-            >
-            </el-table-column>
-            <el-table-column align="left" label="提交时间" prop="submitTime" min-width="160" show-overflow-tooltip>
-            </el-table-column>
+            />
+            <el-table-column align="left" label="提交时间" prop="submitTime" min-width="160" show-overflow-tooltip />
           </el-table>
         </div>
       </div>
@@ -870,14 +1061,14 @@ export default {
       original: []
     }
   },
-  created() {
-    this.getDetail()
-  },
   computed: {
     isCustomer() {
       return this.$store.getters.customerId && this.$store.getters.customerNumber
     }
   },
+  created() {
+    this.getDetail()
+  },
   methods: {
     getDetail() {
       if (this.engineering == '工程押金信息') {
@@ -887,7 +1078,7 @@ export default {
           } else {
             this.isDis = false
           }
-          let arr = []
+          const arr = []
           res.data.items.forEach(item => {
             if (Number(item.qty) > 0) {
               arr.push(item)
@@ -896,9 +1087,17 @@ export default {
             item.sums1 = ['orderHasSendQty', 'dataQty', 'qty', 'hasSendQty', 'contractQty']
             item.sums2 = ['totalAmount', 'diffAmount', 'price', 'depositAmount', 'contractPrice', 'contractAmount']
           })
+          res.data.collectList.forEach(item => {
+
+            // item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
+            item.sums1 = ['orderHasSendQty', 'dataQty', 'hasSendQty']
+            item.sums2 = [ 'price', 'refundDepositAmount', 'depositAmount']
+          })
           res.data.items = arr
           this.amendData = res.data.dataList.filter(k => k.dataPosition == 'AMEND')
           this.original = res.data.dataList.filter(k => k.dataPosition != 'AMEND')
+          res.data.realUseUnit =res.data.realUseUnit || res.data.refUseUnit
+          res.data.realInstallAddress =   res.data.realInstallAddress ||res.data.refInstallAddress
           this.details = res.data
         })
       } else if (this.engineering == '工程订单信息') {

+ 196 - 1
src/views/deposit_home/components/deposit_replenish.vue

@@ -82,6 +82,14 @@
                 <el-input v-model="details.geLiInerNote" placeholder="格力内部备注"></el-input>
               </div>
             </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">格力内部资料备注</div>
+              <div class="value">{{ details.geLiInnerDataNote }}</div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">订单格力内部备注</div>
+              <div class="value">{{ details.orderGeLiInnerNote }}</div>
+            </el-col>
             <el-col :xs="24" :sm="24" :lg="12" class="item">
               <div class="label">使用单位</div>
               <div class="value">{{ details.refUseUnit }}</div>
@@ -111,7 +119,84 @@
                 {{ details.refInstallAddress }}
               </div>
             </el-col>
-
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">登录有效期</div>
+              <div class="value">
+                {{ details.refBillsExpireDate }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际使用单位</div>
+              <div class="value">
+                {{ details.realUseUnit }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际安装地址</div>
+              <div class="value">
+                {{ details.realInstallAddress }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">项目编号</div>
+              <div class="value">
+                {{ details.refProjectNo }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">购买单位</div>
+              <div class="value">
+                {{ details.refBuyUnitName }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">合同变更批复意见</div>
+              <div class="value">
+                {{ details.refContractIdea }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">合同变更批复结果</div>
+              <div class="value">
+                {{ details.refContractResult }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">资料延期批复意见</div>
+              <div class="value">
+                {{ details.refDataDelayResult }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">资料延期批复结果</div>
+              <div class="value">
+                {{ details.refInstallAddress }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">工程机转零售批复意见</div>
+              <div class="value">
+                {{ details.refToRetailIdea }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">工程机转零售批复结果</div>
+              <div class="value">
+                {{ details.refToRetailResult }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">其他附件审批意见</div>
+              <div class="value">
+                {{ details.refOtherAnnexIdea }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">其他附件批复结果</div>
+              <div class="value">
+                {{ details.refOtherAnnexResult }}
+              </div>
+            </el-col>
             <!--            <el-col :xs="24" :sm="24" :lg="8" class="item">-->
             <!--              <div class="label">寄厂日期</div>-->
             <!--              <div class="value" style="padding: 0">-->
@@ -252,6 +337,12 @@
                 {{ scope.row.totalAmount | numToFixed }}
               </template>
             </el-table-column>
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.salesAmount | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column align="right" label="押金数量" prop="hasSendQty" min-width="160" show-overflow-tooltip />
             <el-table-column
               align="right"
@@ -311,6 +402,102 @@
           </el-table>
         </div>
       </div>
+      <h3>押金货品信息</h3>
+      <el-divider />
+      <!-- 列表 -->
+      <div class="mymain-container">
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="details.collectList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            show-summary
+            :summary-method="$getSummaries"
+          >
+            <el-table-column align="left" label="工程登录单号" prop="refEnginRecordNo" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.refEnginRecordNo" />
+                <span>{{ scope.row.refEnginRecordNo }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.specification" />
+                <span>{{ scope.row.specification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="基本单位编码" prop="unit" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.unit" />
+                <span>{{ scope.row.unit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletName" />
+                <span>{{ scope.row.customerWalletName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包编码" prop="customerWalletNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletNumber" />
+                <span>{{ scope.row.customerWalletNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型名称" prop="k3CategoryName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryName" />
+                <span>{{ scope.row.k3CategoryName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型编码" prop="k3CategoryNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryNumber" />
+                <span>{{ scope.row.k3CategoryNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料名称" prop="materialName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialName" />
+                <span>{{ scope.row.materialName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料编码" prop="materialNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialNumber" />
+                <span>{{ scope.row.materialNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料旧编码" prop="materialOldNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialOldNumber" />
+                <span>{{ scope.row.materialOldNumber }}</span>
+              </template>
+            </el-table-column>
+       
+            <el-table-column align="left" label="已发押金数量" prop="hasSendQty" min-width="130" show-overflow-tooltip />
+            <el-table-column align="left" label="单价" prop="price" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="已退押金金额" prop="refundDepositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.refundDepositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="押金金额" prop="depositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
       <h3 class="gdzl">工程资料</h3>
       <el-button :disabled="isDis" class="batchDownload" type="primary" size="small" @click="batchDownloadFn"
         >批量下载
@@ -935,9 +1122,17 @@ export default {
             item.sums1 = ['orderHasSendQty', 'dataQty', 'qty', 'hasSendQty', 'contractQty']
             item.sums2 = ['totalAmount', 'diffAmount', 'price', 'depositAmount', 'contractPrice', 'contractAmount']
           })
+          res.data.collectList.forEach(item => {
+
+// item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
+item.sums1 = ['orderHasSendQty', 'dataQty', 'hasSendQty']
+item.sums2 = [ 'price', 'refundDepositAmount', 'depositAmount']
+})
           res.data.items = arr
           this.amendData = res.data.dataList.filter(k => k.dataPosition == 'AMEND')
           this.original = res.data.dataList.filter(k => k.dataPosition != 'AMEND')
+          res.data.realUseUnit =res.data.realUseUnit || res.data.refUseUnit
+          res.data.realInstallAddress =   res.data.realInstallAddress ||res.data.refInstallAddress
           this.details = res.data
         })
       } else if (this.engineering == '工程订单信息') {

+ 152 - 6
src/views/deposit_home/components/refund_list-detail.vue

@@ -134,17 +134,46 @@
           <div class="label">安装地址</div>
           <div class="value">{{ detailList.refInstallAddress }}</div>
         </el-col>
-
+        <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">登录有效期</div>
+              <div class="value">
+                {{ detailList.refBillsExpireDate }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际使用单位</div>
+              <div class="value">
+                {{ detailList.realUseUnit }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际安装地址</div>
+              <div class="value">
+                {{ detailList.realInstallAddress }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">项目编号</div>
+              <div class="value">
+                {{ detailList.refProjectNo }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">购买单位</div>
+              <div class="value">
+                {{ detailList.refBuyUnitName }}
+              </div>
+            </el-col>
         <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">工程订单号</div>
           <div class="value">{{ detailList.customerName }}</div>
         </el-col> -->
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">经销商名称</div>
           <div class="value">{{ detailList.customerName }}</div>
         </el-col>
 
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">项目说明</div>
           <div class="value">{{ detailList.refProjectNote }}</div>
         </el-col>
@@ -153,7 +182,7 @@
           <div class="value">{{ detailList.customerName }}</div>
         </el-col> -->
 
-        <!-- <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <!-- <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">格力内部备注</div>
           <div class="value">{{ detailList.customerName }}</div>
         </el-col> -->
@@ -161,7 +190,7 @@
           <div class="label">文件编码</div>
           <div class="value">{{ detailList.customerName }}</div>
         </el-col> -->
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">备注</div>
           <!-- <div class="value">{{ detailList.remark }}</div> -->
           <div class="value">
@@ -172,7 +201,7 @@
             />
           </div>
         </el-col>
-        <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="16" class="item">
+        <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">格力内部备注</div>
           <!-- <div class="value">{{  detailList.geLiInerNote}}</div> -->
           <div class="value">
@@ -183,6 +212,14 @@
             />
           </div>
         </el-col>
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">格力内部资料备注</div>
+              <div class="value">{{ detailList.geLiInnerDataNote }}</div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">订单格力内部备注</div>
+              <div class="value">{{ detailList. orderGeLiInnerNote }}</div>
+            </el-col>
         <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">提交保证函</div>
           <!-- <div class="value">{{ detailList.remark }}</div> -->
@@ -471,6 +508,12 @@
                 {{ scope.row.totalAmount | numToFixed }}
               </template>
             </el-table-column>
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.salesAmount | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column align="right" label="押金数量" prop="hasSendQty" min-width="160" show-overflow-tooltip />
             <el-table-column
               align="right"
@@ -553,7 +596,102 @@
         </div>
       </div>
     </div>
+    <h3>押金货品信息</h3>
+      <el-divider />
+      <!-- 列表 -->
+      <div class="mymain-container">
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="detailList.collectList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            show-summary
+            :summary-method="$getSummaries"
+          >
+            <el-table-column align="left" label="工程登录单号" prop="refEnginRecordNo" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.refEnginRecordNo" />
+                <span>{{ scope.row.refEnginRecordNo }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.specification" />
+                <span>{{ scope.row.specification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="基本单位编码" prop="unit" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.unit" />
+                <span>{{ scope.row.unit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletName" />
+                <span>{{ scope.row.customerWalletName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包编码" prop="customerWalletNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletNumber" />
+                <span>{{ scope.row.customerWalletNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型名称" prop="k3CategoryName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryName" />
+                <span>{{ scope.row.k3CategoryName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型编码" prop="k3CategoryNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryNumber" />
+                <span>{{ scope.row.k3CategoryNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料名称" prop="materialName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialName" />
+                <span>{{ scope.row.materialName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料编码" prop="materialNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialNumber" />
+                <span>{{ scope.row.materialNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料旧编码" prop="materialOldNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialOldNumber" />
+                <span>{{ scope.row.materialOldNumber }}</span>
+              </template>
+            </el-table-column>
 
+            <el-table-column align="left" label="已发押金数量" prop="hasSendQty" min-width="130" show-overflow-tooltip />
+            <el-table-column align="left" label="单价" prop="price" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="已退押金金额" prop="refundDepositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.refundDepositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="押金金额" prop="depositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
     <h3 class="gdzl">工程资料</h3>
     <!--    <el-button :readonly="isDis" class="batchDownload" type="primary" size="small" @click="batchDownloadFn"-->
     <!--      >批量下载</el-button-->
@@ -1260,9 +1398,17 @@ export default {
           'contractAmount'
         ]
       })
+      res.data.collectList.forEach(item => {
+
+// item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
+item.sums1 = ['orderHasSendQty', 'dataQty', 'hasSendQty']
+item.sums2 = [ 'price', 'refundDepositAmount', 'depositAmount']
+})
       res.data.items = arr
       this.amendData = res.data.dataList.filter(k => k.dataPosition == 'AMEND')
       this.original = res.data.dataList.filter(k => k.dataPosition != 'AMEND')
+      res.data.realUseUnit =res.data.realUseUnit || res.data.refUseUnit
+          res.data.realInstallAddress =   res.data.realInstallAddress ||res.data.refInstallAddress
       this.detailList = res.data
       if (res.data.examineStatus == 'SAVE' || res.data.examineStatus == 'OK' || res.data.examineStatus == 'FAIL') {
         this.title = '详情'

+ 151 - 6
src/views/deposit_home/components/refund_reexamine.vue

@@ -134,17 +134,46 @@
           <div class="label">安装地址</div>
           <div class="value">{{ detailList.refInstallAddress }}</div>
         </el-col>
-
+        <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">登录有效期</div>
+              <div class="value">
+                {{ detailList.refBillsExpireDate }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际使用单位</div>
+              <div class="value">
+                {{ detailList.realUseUnit }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际安装地址</div>
+              <div class="value">
+                {{ detailList.realInstallAddress }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">项目编号</div>
+              <div class="value">
+                {{ detailList.refProjectNo }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">购买单位</div>
+              <div class="value">
+                {{ detailList.refBuyUnitName }}
+              </div>
+            </el-col>
         <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
             <div class="label">工程订单号</div>
             <div class="value">{{ detailList.customerName }}</div>
           </el-col> -->
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">经销商名称</div>
           <div class="value">{{ detailList.customerName }}</div>
         </el-col>
 
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">项目说明</div>
           <div class="value">{{ detailList.refProjectNote }}</div>
         </el-col>
@@ -161,7 +190,7 @@
             <div class="label">文件编码</div>
             <div class="value">{{ detailList.customerName }}</div>
           </el-col> -->
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">备注</div>
           <!-- <div class="value">{{ detailList.remark }}</div> -->
           <div class="value">
@@ -172,7 +201,7 @@
             />
           </div>
         </el-col>
-        <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="16" class="item">
+        <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">格力内部备注</div>
           <!-- <div class="value">{{  detailList.geLiInerNote}}</div> -->
           <div class="value">
@@ -183,6 +212,14 @@
             />
           </div>
         </el-col>
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">格力内部资料备注</div>
+              <div class="value">{{ detailList.geLiInnerDataNote }}</div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">订单格力内部备注</div>
+              <div class="value">{{ detailList. orderGeLiInnerNote }}</div>
+            </el-col>
         <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">提交保证函</div>
           <!-- <div class="value">{{ detailList.remark }}</div> -->
@@ -471,6 +508,12 @@
                 {{ scope.row.totalAmount | numToFixed }}
               </template>
             </el-table-column>
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.salesAmount | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column align="right" label="押金数量" prop="hasSendQty" min-width="160" show-overflow-tooltip />
             <el-table-column
               align="right"
@@ -553,7 +596,102 @@
         </div>
       </div>
     </div>
+    <h3>押金货品信息</h3>
+      <el-divider />
+      <!-- 列表 -->
+      <div class="mymain-container">
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="detailList.collectList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            show-summary
+            :summary-method="$getSummaries"
+          >
+            <el-table-column align="left" label="工程登录单号" prop="refEnginRecordNo" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.refEnginRecordNo" />
+                <span>{{ scope.row.refEnginRecordNo }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.specification" />
+                <span>{{ scope.row.specification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="基本单位编码" prop="unit" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.unit" />
+                <span>{{ scope.row.unit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletName" />
+                <span>{{ scope.row.customerWalletName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包编码" prop="customerWalletNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletNumber" />
+                <span>{{ scope.row.customerWalletNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型名称" prop="k3CategoryName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryName" />
+                <span>{{ scope.row.k3CategoryName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型编码" prop="k3CategoryNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryNumber" />
+                <span>{{ scope.row.k3CategoryNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料名称" prop="materialName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialName" />
+                <span>{{ scope.row.materialName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料编码" prop="materialNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialNumber" />
+                <span>{{ scope.row.materialNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料旧编码" prop="materialOldNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialOldNumber" />
+                <span>{{ scope.row.materialOldNumber }}</span>
+              </template>
+            </el-table-column>
 
+            <el-table-column align="left" label="已发押金数量" prop="hasSendQty" min-width="130" show-overflow-tooltip />
+            <el-table-column align="left" label="单价" prop="price" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="已退押金金额" prop="refundDepositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.refundDepositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="押金金额" prop="depositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
     <h3 class="gdzl">工程资料</h3>
     <!--    <el-button :readonly="isDis" class="batchDownload" type="primary" size="small" @click="batchDownloadFn"-->
     <!--      >批量下载</el-button-->
@@ -1063,10 +1201,17 @@ export default {
           'contractAmount'
         ]
       })
+      res.data.collectList.forEach(item => {
+
+// item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
+item.sums1 = ['orderHasSendQty', 'dataQty', 'hasSendQty']
+item.sums2 = [ 'price', 'refundDepositAmount', 'depositAmount']
+})
       res.data.items = arr
       this.amendData = res.data.dataList.filter(k => k.dataPosition == 'AMEND')
       this.original = res.data.dataList.filter(k => k.dataPosition != 'AMEND')
-
+      res.data.realUseUnit =res.data.realUseUnit || res.data.refUseUnit
+          res.data.realInstallAddress =   res.data.realInstallAddress ||res.data.refInstallAddress
       this.detailList = res.data
 
       if (res.data.examineStatus == 'SAVE' || res.data.examineStatus == 'OK' || res.data.examineStatus == 'FAIL') {

+ 151 - 5
src/views/deposit_home/components/refund_replenish.vue

@@ -134,17 +134,46 @@
           <div class="label">安装地址</div>
           <div class="value">{{ detailList.refInstallAddress }}</div>
         </el-col>
-
+        <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">登录有效期</div>
+              <div class="value">
+                {{ detailList.refBillsExpireDate }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际使用单位</div>
+              <div class="value">
+                {{ detailList.realUseUnit }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">实际安装地址</div>
+              <div class="value">
+                {{ detailList.realInstallAddress }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">项目编号</div>
+              <div class="value">
+                {{ detailList.refProjectNo }}
+              </div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="8" class="item">
+              <div class="label">购买单位</div>
+              <div class="value">
+                {{ detailList.refBuyUnitName }}
+              </div>
+            </el-col>
         <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
             <div class="label">工程订单号</div>
             <div class="value">{{ detailList.customerName }}</div>
           </el-col> -->
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">经销商名称</div>
           <div class="value">{{ detailList.customerName }}</div>
         </el-col>
 
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">项目说明</div>
           <div class="value">{{ detailList.refProjectNote }}</div>
         </el-col>
@@ -161,7 +190,7 @@
             <div class="label">文件编码</div>
             <div class="value">{{ detailList.customerName }}</div>
           </el-col> -->
-        <el-col :xs="24" :sm="24" :lg="16" class="item">
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">备注</div>
           <!-- <div class="value">{{ detailList.remark }}</div> -->
           <div class="value">
@@ -172,7 +201,7 @@
             />
           </div>
         </el-col>
-        <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="16" class="item">
+        <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">格力内部备注</div>
           <!-- <div class="value">{{  detailList.geLiInerNote}}</div> -->
           <div class="value">
@@ -183,6 +212,14 @@
             />
           </div>
         </el-col>
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">格力内部资料备注</div>
+              <div class="value">{{ detailList.geLiInnerDataNote }}</div>
+            </el-col>
+            <el-col :xs="24" :sm="24" :lg="24" class="item">
+              <div class="label">订单格力内部备注</div>
+              <div class="value">{{ detailList. orderGeLiInnerNote }}</div>
+            </el-col>
         <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">提交保证函</div>
           <!-- <div class="value">{{ detailList.remark }}</div> -->
@@ -471,6 +508,12 @@
                 {{ scope.row.totalAmount | numToFixed }}
               </template>
             </el-table-column>
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.salesAmount | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column align="right" label="押金数量" prop="hasSendQty" min-width="160" show-overflow-tooltip />
             <el-table-column
               align="right"
@@ -553,7 +596,102 @@
         </div>
       </div>
     </div>
+    <h3>押金货品信息</h3>
+      <el-divider />
+      <!-- 列表 -->
+      <div class="mymain-container">
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="detailList.collectList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            show-summary
+            :summary-method="$getSummaries"
+          >
+            <el-table-column align="left" label="工程登录单号" prop="refEnginRecordNo" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.refEnginRecordNo" />
+                <span>{{ scope.row.refEnginRecordNo }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.specification" />
+                <span>{{ scope.row.specification }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="基本单位编码" prop="unit" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.unit" />
+                <span>{{ scope.row.unit }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletName" />
+                <span>{{ scope.row.customerWalletName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="现金钱包编码" prop="customerWalletNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerWalletNumber" />
+                <span>{{ scope.row.customerWalletNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型名称" prop="k3CategoryName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryName" />
+                <span>{{ scope.row.k3CategoryName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料类型编码" prop="k3CategoryNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.k3CategoryNumber" />
+                <span>{{ scope.row.k3CategoryNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料名称" prop="materialName" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialName" />
+                <span>{{ scope.row.materialName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料编码" prop="materialNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialNumber" />
+                <span>{{ scope.row.materialNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="金蝶物料旧编码" prop="materialOldNumber" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.materialOldNumber" />
+                <span>{{ scope.row.materialOldNumber }}</span>
+              </template>
+            </el-table-column>
 
+            <el-table-column align="left" label="已发押金数量" prop="hasSendQty" min-width="130" show-overflow-tooltip />
+            <el-table-column align="left" label="单价" prop="price" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="已退押金金额" prop="refundDepositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.refundDepositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="押金金额" prop="depositAmount" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
     <h3 class="gdzl">工程资料</h3>
     <!--    <el-button :readonly="isDis" class="batchDownload" type="primary" size="small" @click="batchDownloadFn"-->
     <!--      >批量下载</el-button-->
@@ -1304,9 +1442,17 @@ export default {
           'contractAmount'
         ]
       })
+      res.data.collectList.forEach(item => {
+
+// item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
+item.sums1 = ['orderHasSendQty', 'dataQty', 'hasSendQty']
+item.sums2 = [ 'price', 'refundDepositAmount', 'depositAmount']
+})
       res.data.items = arr
       this.amendData = res.data.dataList.filter(k => k.dataPosition == 'AMEND')
       this.original = res.data.dataList.filter(k => k.dataPosition != 'AMEND')
+      res.data.realUseUnit =res.data.realUseUnit || res.data.refUseUnit
+          res.data.realInstallAddress =   res.data.realInstallAddress ||res.data.refInstallAddress
       this.detailList = res.data
       if (res.data.examineStatus == 'SAVE' || res.data.examineStatus == 'OK' || res.data.examineStatus == 'FAIL') {
         this.title = '详情'

+ 96 - 39
src/views/deposit_home/deposit_list.vue

@@ -4,20 +4,33 @@
       v-show="showPage == 1"
       ref="pageRef"
       :operation="operation()"
-      :optionsEvensGroup="optionsEvensGroup"
-      :getList="getList2"
-      :exportList="exportList"
-      :tableAttributes="tableAttributes"
-      :tableEvents="tableEvents"
-      :columnParsing="columnParsing"
-      :fieldBeansHook="fieldBeansHook"
+      :options-evens-group="optionsEvensGroup"
+      :get-list="getList2"
+      :export-list="exportList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :column-parsing="columnParsing"
+      :field-beans-hook="fieldBeansHook"
     >
+      <div slot="moreSearch">
+        <ul class="ulStyle">
+          <li class="title">
+            金额:<span class="num">{{ (Number(numSum.amountC) || 0) | numToFixed }}</span>
+          </li>
+          <li class="title">
+            数量:<span class="num">{{ Number(numSum.totalC) || 0 }}</span>
+          </li>
+          <li class="title">
+            项目数:<span class="num">{{ Number(numSum.totalEC) || 0 }}</span>
+          </li>
+        </ul>
+      </div>
     </template-page>
-    <div class="app-container" v-if="showPage == 2">
+    <div v-if="showPage == 2" class="app-container">
       <DepositListDetail
+        :deposit-manage-id="depositManageId"
+        :ref-engin-record-no="refEnginRecordNo"
         @updateList="updateList"
-        :depositManageId="depositManageId"
-        :refEnginRecordNo="refEnginRecordNo"
         @setShowPage="
           val => {
             $refs.pageRef.refreshList()
@@ -26,11 +39,11 @@
         "
       />
     </div>
-    <div class="app-container" v-else-if="showPage == 3">
+    <div v-else-if="showPage == 3" class="app-container">
       <DepositApplyDeduction
+        :deposit-manage-id="depositManageId"
+        :ref-engin-record-no="refEnginRecordNo"
         @updateList="updateList"
-        :depositManageId="depositManageId"
-        :refEnginRecordNo="refEnginRecordNo"
         @setShowPage="
           val => {
             $refs.pageRef.refreshList()
@@ -39,11 +52,11 @@
         "
       />
     </div>
-    <div class="app-container" v-else-if="showPage == 4">
+    <div v-else-if="showPage == 4" class="app-container">
       <DepositApplySurrender
+        :deposit-manage-id="depositManageId"
+        :ref-engin-record-no="refEnginRecordNo"
         @updateList="updateList"
-        :depositManageId="depositManageId"
-        :refEnginRecordNo="refEnginRecordNo"
         @setShowPage="
           val => {
             $refs.pageRef.refreshList()
@@ -52,11 +65,11 @@
         "
       />
     </div>
-    <div class="app-container" v-else-if="showPage == 5">
+    <div v-else-if="showPage == 5" class="app-container">
       <deposit_replenish
+        :deposit-manage-id="depositManageId"
+        :ref-engin-record-no="refEnginRecordNo"
         @updateList="updateList"
-        :depositManageId="depositManageId"
-        :refEnginRecordNo="refEnginRecordNo"
         @setShowPage="
           val => {
             $refs.pageRef.refreshList()
@@ -74,9 +87,8 @@ import { getDepositManageDate } from '@/api/engin_deposit/refund_list'
 import DepositApplyDeduction from './components/deposit-apply-deduction.vue'
 import DepositApplySurrender from './components/deposit-apply-surrender.vue'
 import { downloadFiles, handleImport } from '@/utils/util'
-import { depositManageHomeList, depositManageHomeListExport } from '@/api/deposit_list_v2.js'
+import { depositManageHomeList, depositManageHomeListExport, getCountList, updateDepositManageenginInfo } from '@/api/deposit_list_v2.js'
 import TemplatePage from '@/components/template/template-page-1.vue'
-import Mixin from '@/mixin'
 import deposit_replenish from './components/deposit_replenish.vue'
 
 export default {
@@ -193,7 +205,12 @@ export default {
       },
       recordSelected: [],
       depositManageId: '',
-      refEnginRecordNo: ''
+      refEnginRecordNo: '',
+      numSum: {
+        totalC: 0,
+        amountC: 0,
+        totalEC: 0
+      }
     }
   },
   computed: {
@@ -203,6 +220,30 @@ export default {
           [
             {
               name: '',
+              // isRole: this.$checkBtnRole('add', this.$route.meta.roles),
+              render: () => {
+                return (
+                  <el-popconfirm
+                    title='更新工程信息吗?'
+                    onOnConfirm={() => {
+                      updateDepositManageenginInfo().then(res => {
+                        this.$message.success('更新工程信息成功')
+                        this.$refs.pageRef.refreshList()
+
+                      })
+                    }}
+                  >
+                    <span slot='reference'>更新工程信息</span>
+                  </el-popconfirm>
+                )
+              }
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '',
               isRole: !this.isCustomer,
               render: () => {
                 return (
@@ -243,7 +284,14 @@ export default {
       return list
     },
     // 列表请求函数
-    getList2: depositManageHomeList,
+    getList2(...p) {
+      this.$refs.pageRef.showTable = false
+      this.recordSelected = []
+      getCountList(...p).then(res => {
+        this.numSum = res.data
+      })
+      return depositManageHomeList(...p)
+    },
     // 列表导出函数
     exportList: depositManageHomeListExport,
     // 表格列解析渲染数据更改
@@ -257,11 +305,11 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             <el-button
-              type="text"
-              class="textColor"
-              size="mini"
+              type='text'
+              class='textColor'
+              size='mini'
               onClick={() => {
                 this.detailFn(row)
               }}
@@ -270,8 +318,8 @@ export default {
             </el-button>
             {row.examineStatus == '保存' && this.$checkBtnRole('apply', this.$route.meta.roles) ? (
               <el-button
-                type="text"
-                class="textColor"
+                type='text'
+                class='textColor'
                 onClick={() => {
                   this.surrenderFn(row)
                 }}
@@ -283,16 +331,16 @@ export default {
             {((row.examineStatus == '审核通过' && row.dataState == '补充') ||
               (row.examineStatus == '审核通过' && row.dataState == '正常')) &&
             this.isCustomer ? (
-              <el-button
-                type="text"
-                class="textColor"
-                onClick={() => {
-                  this.replenishClick(row.depositManageId)
-                }}
-              >
+                <el-button
+                  type='text'
+                  class='textColor'
+                  onClick={() => {
+                    this.replenishClick(row.depositManageId)
+                  }}
+                >
                 补充资料
-              </el-button>
-            ) : null}
+                </el-button>
+              ) : null}
           </div>
         )
       }
@@ -363,4 +411,13 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.ulStyle{
+  list-style: none;
+  padding: 0;
+  li{
+    display: inline-block;
+    margin-right: 20px;
+  }
+}
+</style>

+ 67 - 50
src/views/deposit_home/refund_list.vue

@@ -4,16 +4,29 @@
       v-show="showSurrender == 0"
       ref="pageRef"
       :operation="operation()"
-      :optionsEvensGroup="optionsEvensGroup"
-      :getList="getList"
-      :exportList="exportList"
-      :tableAttributes="tableAttributes"
-      :tableEvents="tableEvents"
-      :columnParsing="columnParsing"
-      :replaceOrNotMap="false"
+      :options-evens-group="optionsEvensGroup"
+      :get-list="getList"
+      :export-list="exportList"
+      :table-attributes="tableAttributes"
+      :table-events="tableEvents"
+      :column-parsing="columnParsing"
+      :replace-or-not-map="false"
     >
-    </template-page>
-    <div class="app-container" v-if="showSurrender == 1">
+    <div slot="moreSearch">
+        <ul class="ulStyle">
+          <li class="title">
+            金额:<span class="num">{{ (Number(numSum.amountC) || 0) | numToFixed }}</span>
+          </li>
+          <li class="title">
+            数量:<span class="num">{{ Number(numSum.totalC) || 0 }}</span>
+          </li>
+          <li class="title">
+            项目数:<span class="num">{{ Number(numSum.totalEC) || 0 }}</span>
+          </li>
+        </ul>
+      </div>
+  </template-page>
+    <div v-if="showSurrender == 1" class="app-container">
       <refund-list-detail
         :detail-id="detailId"
         @updateList="updateList"
@@ -25,7 +38,7 @@
         "
       />
     </div>
-    <div class="app-container" v-else-if="showSurrender == 2">
+    <div v-else-if="showSurrender == 2" class="app-container">
       <refund-replenish
         :detail-id="detailId"
         @updateList="updateList"
@@ -37,7 +50,7 @@
         "
       />
     </div>
-    <div class="app-container" v-else-if="showSurrender == 3">
+    <div v-else-if="showSurrender == 3" class="app-container">
       <refund-reexamine
         :detail-id="detailId"
         @updateList="updateList"
@@ -56,19 +69,15 @@
 <script>
 import {
   examineData,
-  getDepositManageList,
   getDepositManageDate,
-  getDepositManagExport,
-  secondRefund,
-  getDepositCountList
-} from '@/api/engin_deposit/refund_list'
+  secondRefund } from '@/api/engin_deposit/refund_list'
 import { downloadFiles, handleImport } from '@/utils/util'
 import ExamineDialog from '@/components/Common/examine-dialog'
 import RefundListDetail from './components/refund_list-detail.vue'
 import RefundReplenish from './components/refund_replenish.vue'
 import RefundReexamine from './components/refund_reexamine.vue'
 import TemplatePage from '@/components/template/template-page-1.vue'
-import { depositManageHomeList, depositManageHomeListExport } from '@/api/deposit_list_v2.js'
+import { depositManageHomeList, depositManageHomeListExport, getCountList } from '@/api/deposit_list_v2.js'
 export default {
   components: {
     RefundListDetail,
@@ -217,7 +226,7 @@ export default {
               render: () => {
                 return (
                   <el-popconfirm
-                    title="批量审核吗?"
+                    title='批量审核吗?'
                     onOnConfirm={() => {
                       if (!this.selectData.length) {
                         this.$errorMsg('请选择')
@@ -226,7 +235,7 @@ export default {
                       this.batchExamine()
                     }}
                   >
-                    <span slot="reference">批量审核工程机已审单据</span>
+                    <span slot='reference'>批量审核工程机已审单据</span>
                   </el-popconfirm>
                 )
               }
@@ -240,7 +249,7 @@ export default {
               render: () => {
                 return (
                   <el-upload
-                    action=""
+                    action=''
                     http-request={this.handleImport}
                     file-list={this.importFileList}
                     show-file-list={false}
@@ -260,7 +269,14 @@ export default {
   },
   methods: {
     // 列表请求函数
-    getList: depositManageHomeList,
+    getList(...p) {
+      this.$refs.pageRef.showTable = false
+      this.recordSelected = []
+      getCountList(...p).then(res => {
+        this.numSum = res.data
+      })
+      return depositManageHomeList(...p)
+    },
     // 列表导出函数
     exportList: depositManageHomeListExport,
     // 表格列解析渲染数据更改
@@ -274,11 +290,11 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             {row.examineStatus == 'WAIT' && this.$checkBtnRole('examine', this.$route.meta.roles) ? (
               <el-button
-                type="text"
-                class="textColor"
+                type='text'
+                class='textColor'
                 onClick={() => {
                   this.examineFn(row.depositManageId)
                 }}
@@ -289,16 +305,16 @@ export default {
             {row.dataState == 'WAIT_REVIEW' &&
             row.examineStatus == 'OK' &&
             this.$checkBtnRole('examine', this.$route.meta.roles) ? (
-              <el-button
-                type="text"
-                class="textColor"
-                onClick={() => {
-                  this.reexamineClick(row.depositManageId)
-                }}
-              >
+                <el-button
+                  type='text'
+                  class='textColor'
+                  onClick={() => {
+                    this.reexamineClick(row.depositManageId)
+                  }}
+                >
                 复核
-              </el-button>
-            ) : null}
+                </el-button>
+              ) : null}
 
             {row.examineStatus == 'SAVE' ||
             row.examineStatus == 'OK' ||
@@ -306,25 +322,25 @@ export default {
             row.dataState == 'WAIT_REVIEW' ||
             row.dataState == 'REVIEW' ||
             row.dataState == 'AMEND' ? (
-              <el-button
-                type="text"
-                class="textColor"
-                onClick={() => {
-                  this.infoFn(row.depositManageId)
-                }}
-              >
+                <el-button
+                  type='text'
+                  class='textColor'
+                  onClick={() => {
+                    this.infoFn(row.depositManageId)
+                  }}
+                >
                 详情
-              </el-button>
-            ) : null}
+                </el-button>
+              ) : null}
             {row.examineStatus == 'OK' && !row.isRefundDeposit ? (
               <el-popconfirm
-                style="margin-left: 10px"
-                title="二次退押吗?"
+                style='margin-left: 10px'
+                title='二次退押吗?'
                 onOnConfirm={() => {
                   this.secondRefund(row)
                 }}
               >
-                <el-button slot="reference" type="text" size="mini">
+                <el-button slot='reference' type='text' size='mini'>
                   二次退押
                 </el-button>
               </el-popconfirm>
@@ -442,12 +458,13 @@ export default {
   }
 }
 
-.ulStyle {
+.ulStyle{
   list-style: none;
-  margin: 0;
-  padding: 10px 0;
-  background-color: #ffffff;
-  z-index: 1;
+  padding: 0;
+  li{
+    display: inline-block;
+    margin-right: 20px;
+  }
 }
 
 .title {

+ 102 - 0
src/views/executionRecord/commercial.vue

@@ -0,0 +1,102 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <!-- <popu v-if="visible">
+      <el-page-header slot="head" content="订单信息" @back="handleClose" />
+      <sales-return-order-detail v-if="visible" :refund-order-id="refundOrderId" type="commercial" />
+    </popu> -->
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import SalesReturnOrderDetail from './orderDetail.vue'
+import { getListTradeExecV2, exportListTradeExecV2 } from '@/api/executionRecord'
+export default {
+  components: { TemplatePage, Popu, SalesReturnOrderDetail },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        // [
+        //   [
+        //     {
+        //       name: '新增',
+        //       click: this.addOn(() => {
+        //         this.visible = true
+        //       })
+        //       // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      refundOrderId: null,
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListTradeExecV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListTradeExecV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={() => {
+                this.visible = true
+                this.refundOrderId = row.refundOrderId
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.refundOrderId = null
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 384 - 0
src/views/executionRecord/orderDetail.vue

@@ -0,0 +1,384 @@
+<template>
+  <div>
+    <h4>订单信息</h4>
+    <el-divider />
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">销售退货单</div>
+          <div class="value">{{ detailData.refundOrderId }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">订单日期</div>
+          <div class="value">{{ detailData.refOrderDate }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售订单</div>
+          <div class="value">{{ detailData.refOrderId }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{ detailData.customerNumber }}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{ detailData.customerName }}</div>
+        </el-col>
+      </el-row>
+      <!-- 政策订单 -->
+      <el-row v-if="type === 'policy'">
+        <el-col :span="8" class="item">
+          <div class="label">销售政策编码</div>
+          <div class="value">{{ detailData.policyCode }}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">销售政策</div>
+          <div class="value">{{ detailData.policyTitle }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">格力回复</div>
+          <div class="value">{{ detailData.geLiNote }}</div>
+        </el-col>
+      </el-row>
+      <!-- 零售订单 -->
+      <el-row v-if="type === 'retail'">
+        <!-- <el-col :span="8" class="item">
+          <div class="label">产品大类</div>
+          <div class="value">{{ detailData.id }}</div>
+        </el-col> -->
+        <el-col :span="24" class="item">
+          <div class="label">销售订单类型</div>
+          <div class="value">{{ orderType[detailData.refundOrderType] }}</div>
+        </el-col>
+      </el-row>
+      <!-- 商用工程订单 -->
+      <el-row v-if="type === 'commercial'">
+        <el-col :span="8" class="item">
+          <div class="label">工程信息编码</div>
+          <div class="value">{{ detailData.refEnginRecordNo }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程项目名称</div>
+          <div class="value">{{ detailData.refProjectName }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程信息单类型</div>
+          <div class="value">{{ detailData.refProjectType }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">厂工程编码</div>
+          <div class="value">{{ detailData.refFactoryNo }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">使用单位</div>
+          <div class="value">{{ detailData.refUseUnit }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label" />
+          <div class="value" />
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">联系人</div>
+          <div class="value">{{ detailData.refLinkman }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">固定电话</div>
+          <div class="value">{{ detailData.refTel }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">移动电话</div>
+          <div class="value">{{ detailData.id }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">不扣押金</div>
+          <div class="value">{{ detailData.takeDeposit?'不扣':'扣' }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">文件编码</div>
+          <div class="value">{{ detailData.id }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">业务员</div>
+          <div class="value">{{ detailData.serviceName }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">格力回复</div>
+          <div class="value">{{ detailData.geLiNote }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">格力内部备注</div>
+          <div class="value">{{ detailData.geLiInnerNote }}</div>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{ detailData.remark }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{ detailData.createBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单日期</div>
+          <div class="value">{{ detailData.createTime }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核人</div>
+          <div class="value">{{ detailData.examineBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核日期</div>
+          <div class="value">{{ detailData.examineTime }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">最后更新人</div>
+          <div class="value">{{ detailData.updateBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">最后更新日期</div>
+          <div class="value">{{ detailData.updateTime }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">关闭人</div>
+          <div class="value">{{ detailData.refundBy }}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">关闭日期</div>
+          <div class="value">{{ detailData.refundTime }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审核说明</div>
+          <div class="value">{{ detailData.examineRemark }}</div>
+        </el-col>
+      </el-row>
+    </div>
+    <h4>货品信息</h4>
+    <el-divider />
+    <zj-table
+      :table-attributes="tableAttributes"
+      :is-drop="true"
+      :columns="columns"
+      :table-data="policyData"
+    />
+  </div>
+</template>
+
+<script>
+import { getRefundDetail } from '@/api/supply/salesReturnOrder'
+
+export default {
+  props: {
+    refundOrderId: {
+      type: String,
+      default: null
+    },
+    type: {
+      type: String,
+      default: null
+    }
+  },
+  data() {
+    return {
+      moduleType: 1,
+      detailData: {},
+      policyData: [],
+      tableAttributes: {
+        border: true,
+        headerCellClassName: 'headerRowColor',
+        size: 'mini',
+        'summary-method': this.$getSummaries,
+        'show-summary': true
+      },
+      orderType: {
+        TRADE: '商用',
+        HOME: '家用',
+        RETAIL: '零售单',
+        RETAIL_POLICY: '销售政策单'
+      }
+    }
+  },
+  computed: {
+    columns() {
+      return [
+        {
+          columnAttributes: {
+            label: '序号',
+            prop: 'index'
+          },
+          render: (h, { props, index }) => {
+            return <div>{index + 1}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '销售类型',
+            prop: 'saleTypeName',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品编码',
+            prop: 'materialOldNumber',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料代码',
+            prop: 'materialCode',
+            width: 200
+          }
+
+        },
+        {
+          columnAttributes: {
+            label: '产品名称',
+            prop: 'materialName',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specification',
+            width: 300
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单位',
+            prop: 'unit',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单价',
+            prop: 'price',
+            width: 200
+          }
+        },
+        ...(() => {
+          return this.type !== 'commercial' ? [{
+            columnAttributes: {
+              label: '数量',
+              prop: 'qty',
+              width: 120
+            }
+          }] : [
+            {
+              columnAttributes: {
+                label: '工程信息数量',
+                prop: 'enginNum',
+                width: 120
+
+              }
+            },
+            {
+              columnAttributes: {
+                label: '数量',
+                prop: 'qty',
+                width: 120
+              }
+            }
+          ]
+        })(),
+        {
+          columnAttributes: {
+            label: '订单金额',
+            prop: 'totalAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '返利类型',
+            prop: 'customerWalletName2',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '使用返利金额',
+            prop: 'payRebateAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '格力折扣',
+            prop: 'discAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '现金钱包',
+            prop: 'customerWalletName',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '实付金额',
+            prop: 'payAmount',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '直调',
+            prop: 'directTransferStatus',
+            width: 120
+          }, render: (h, { row }) => {
+            const { directTransferStatus } = row
+            return <div>{directTransferStatus ? '是' : '否'}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '直调数量',
+            prop: 'directTransferQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '原订单数量',
+            prop: 'oldQty',
+            width: 120
+          }
+        },
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'remark',
+            width: 200
+          }
+        },
+        {
+          columnAttributes: {
+            label: '税率',
+            prop: 'tax',
+            width: 120
+          }
+        }
+      ]
+    }
+  },
+  mounted() {
+    getRefundDetail({ refundOrderId: this.refundOrderId }).then(res => {
+      res.data.items.forEach(item => {
+        item.sums1 = ['directTransferQty', 'enginNum', 'hasSendQty', 'oldQty', 'qty', 'rebateRate', 'tax']
+        item.sums2 = ['orgPrice', 'payAmount', 'payRebateAmount', 'price', 'totalAmount']
+      })
+      this.detailData = res.data
+      this.policyData = res.data.items
+    })
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 103 - 0
src/views/executionRecord/policy.vue

@@ -0,0 +1,103 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <!-- <popu v-if="visible">
+      <el-page-header slot="head" content="订单信息" @back="handleClose" />
+      <sales-return-order-detail v-if="visible" :refund-order-id="refundOrderId" type="policy" />
+    </popu> -->
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import SalesReturnOrderDetail from './orderDetail.vue'
+import { getListRetailExecV2, exportListRetailExecV2 } from '@/api/executionRecord'
+export default {
+  components: { TemplatePage, Popu, SalesReturnOrderDetail },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        // [
+        //   [
+        //     {
+        //       name: '新增',
+        //       click: this.addOn(() => {
+        //         this.visible = true
+        //       })
+        //       // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      detailsId: '',
+      refundOrderId: null
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListRetailExecV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListRetailExecV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={() => {
+                this.visible = true
+                this.refundOrderId = row.refundOrderId
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.refundOrderId = null
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 102 - 0
src/views/executionRecord/retail.vue

@@ -0,0 +1,102 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <!-- <popu v-if="visible">
+      <el-page-header slot="head" content="订单信息" @back="handleClose" />
+      <sales-return-order-detail v-if="visible" :refund-order-id="refundOrderId" type="retail" />
+    </popu> -->
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import SalesReturnOrderDetail from './orderDetail.vue'
+import { getListOtherExecV2, exportListOtherExecV2 } from '@/api/executionRecord'
+export default {
+  components: { TemplatePage, Popu, SalesReturnOrderDetail },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        // [
+        //   [
+        //     {
+        //       name: '新增',
+        //       click: this.addOn(() => {
+        //         this.visible = true
+        //       })
+        //       // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      refundOrderId: null,
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListOtherExecV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListOtherExecV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={() => {
+                this.visible = true
+                this.refundOrderId = row.refundOrderId
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.refundOrderId = null
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 52 - 66
src/views/finance/components/rebate_list-edit.vue

@@ -1,9 +1,9 @@
 <template>
   <div>
     <div class="sty">
-      <el-page-header @back="goBack" content="销售返利单"> </el-page-header>
+      <el-page-header content="销售返利单" @back="goBack" />
     </div>
-    <el-divider></el-divider>
+    <el-divider />
     <!-- 表头 -->
     <div>
       <el-form ref="searchForm" :model="searchForm" label-width="100px" size="small" label-position="left">
@@ -17,13 +17,12 @@
                 placeholder="系统自动生成"
                 default-time="23:59:59"
                 value-format="yyyy-MM-dd HH:mm:ss"
-              >
-              </el-date-picker>
+              />
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="备注" prop="remark">
-              <el-input v-model="searchForm.remark" placeholder=""></el-input>
+              <el-input v-model="searchForm.remark" placeholder="" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -34,13 +33,13 @@
       <div class="fl">
         <el-button type="primary" size="small" @click="addFn">保存</el-button>
       </div>
-      <div class="fr" v-if="state == 'SAVE'">
+      <div v-if="state == 'SAVE'" class="fr">
         <el-button type="primary" size="small" @click="addRowFn">添加行</el-button>
         <el-button type="primary" size="small" @click="delRowFn">删除行</el-button>
       </div>
     </div>
     <!-- 列表 -->
-    <div v-if="this.state != 'SAVE'" class="mymain-container">
+    <div v-if="state != 'SAVE' && state != 'OK' && state !='OK_ONE'" class="mymain-container">
       <div class="table">
         <el-table
           v-loading="listLoading"
@@ -53,63 +52,51 @@
           :row-class-name="rouClassNameFn"
           @row-click="onRowClick"
         >
-          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="返利类型" prop="walletName" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="right" label="返利总金额" prop="amount" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
-          </el-table-column>
+          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip />
+          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip />
+          <el-table-column align="left" label="返利类型" prop="walletName" min-width="160" show-overflow-tooltip />
+          <el-table-column align="right" label="返利总金额" prop="amount" min-width="160" show-overflow-tooltip />
+          <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip />
           <el-table-column
             align="left"
             label="政策文件流水号"
             prop="policyFileNo"
             min-width="160"
             show-overflow-tooltip
-          >
-          </el-table-column>
+          />
           <el-table-column align="left" label="政策文号" prop="policyDocNo" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyDocNo"></el-input>
+              <el-input v-model="scope.row.policyDocNo" />
             </template>
           </el-table-column>
-          <el-table-column align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip>
-          </el-table-column>
+          <el-table-column align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip />
           <el-table-column
             align="left"
             label="建立实际归属客户"
             prop="rewardActualCustomers"
             min-width="160"
             show-overflow-tooltip
-          >
-          </el-table-column>
+          />
           <el-table-column align="left" label="备注1" prop="remark1" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark1"></el-input>
+              <el-input v-model="scope.row.remark1" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注2" prop="remark2" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark2"></el-input>
+              <el-input v-model="scope.row.remark2" />
             </template>
           </el-table-column>
         </el-table>
       </div>
     </div>
     <!-- 列表 -->
-    <div v-if="this.state == 'SAVE'" class="mymain-container">
+    <div v-if="state == 'SAVE' || state =='OK' ||state =='OK_ONE'" class="mymain-container">
       <div class="table">
         <el-table
           v-loading="listLoading"
@@ -122,21 +109,21 @@
           :row-class-name="rouClassNameFn"
           @row-click="onRowClick"
         >
-          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip />
           <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input disabled v-model="scope.row.customerNumber"></el-input>
+              <el-input v-model="scope.row.customerNumber" disabled />
             </template>
           </el-table-column>
           <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-select
-                filterable
-                @change="changeCustomerFn($event, scope.$index, scope.row)"
                 v-model="scope.row.customerId"
+                filterable
                 placeholder="请选择"
+                @change="changeCustomerFn($event, scope.$index, scope.row)"
               >
-                <el-option v-for="item in customerData" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+                <el-option v-for="item in customerData" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </template>
           </el-table-column>
@@ -149,8 +136,7 @@
                   :key="item.customerWalletId"
                   :label="item.name"
                   :value="item.customerWalletId"
-                >
-                </el-option>
+                />
               </el-select>
               <!-- <el-select v-else v-model="scope.row.walletName" placeholder="请选择">
                 <el-option :label="scope.row.walletName" value=""> </el-option>
@@ -159,12 +145,12 @@
           </el-table-column>
           <el-table-column align="left" label="返利总金额" prop="amount" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input class="mountclass" v-model.number="scope.row.amount"></el-input>
+              <el-input v-model.number="scope.row.amount" class="mountclass" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input class="mountclass" v-model.number="scope.row.withholdAmount"></el-input>
+              <el-input v-model.number="scope.row.withholdAmount" class="mountclass" />
             </template>
           </el-table-column>
           <el-table-column
@@ -175,37 +161,37 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyFileNo"></el-input>
+              <el-input v-model="scope.row.policyFileNo" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策文号" prop="policyDocNo" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyDocNo"></el-input>
+              <el-input v-model="scope.row.policyDocNo" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyYear"></el-input>
+              <el-input v-model="scope.row.policyYear" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyMonth"></el-input>
+              <el-input v-model="scope.row.policyMonth" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyOrg"></el-input>
+              <el-input v-model="scope.row.policyOrg" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.customerArea"></el-input>
+              <el-input v-model="scope.row.customerArea" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.customerAttr"></el-input>
+              <el-input v-model="scope.row.customerAttr" />
             </template>
           </el-table-column>
           <el-table-column
@@ -216,17 +202,17 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.rewardActualCustomers"></el-input>
+              <el-input v-model="scope.row.rewardActualCustomers" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注1" prop="remark1" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark1"></el-input>
+              <el-input v-model="scope.row.remark1" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注2" prop="remark2" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark2"></el-input>
+              <el-input v-model="scope.row.remark2" />
             </template>
           </el-table-column>
         </el-table>
@@ -249,8 +235,8 @@ export default {
   },
   data() {
     return {
-      state: '', //单据状态
-      state2: false, //状态
+      state: '', // 单据状态
+      state2: false, // 状态
       dataList: [],
       listLoading: false, // 列表加载loading
       searchForm: {
@@ -277,9 +263,9 @@ export default {
     goBack() {
       this.$emit('setShowPage', 1)
     },
-    //获取详情数据
+    // 获取详情数据
     async getDataList() {
-      let res = await getRebateOrderDetail({ id: this.detailId })
+      const res = await getRebateOrderDetail({ id: this.detailId })
       //   this.searchForm.rebateOrderId = res.data.id;
       this.searchForm.theTime = res.data.theTime
       //   this.searchForm.createBy = res.data.createBy;
@@ -296,7 +282,7 @@ export default {
       this.dataList = res.data.items
       // this.$set(this.dataList, 'walletList', wallet.data)
     },
-    //保存
+    // 保存
     async addFn() {
       // await this.$refs.searchForm.validate();
 
@@ -319,10 +305,10 @@ export default {
       this.$message.success('保存成功')
       this.$emit('setShowPage', 1)
     },
-    //选择经销商名称事件
+    // 选择经销商名称事件
     async changeCustomerFn(v, index, value) {
       this.state2 = true
-      this.$nextTick(function () {
+      this.$nextTick(function() {
         value.customerWalletId = ''
         value.walletName = ''
       })
@@ -337,23 +323,23 @@ export default {
       this.$set(this.dataList[index], 'customerName', res2[0].name)
       this.$set(this.dataList[index], 'walletList', res.data)
     },
-    //获取经销商数据
+    // 获取经销商数据
     async getCustomerData() {
       const res = await getCustomerList({ pageSize: -1, pageNum: 1 })
       this.customerData = res.data.records
     },
     rouClassNameFn({ row, rowIndex }) {
-      //把每一行的索引放进row
+      // 把每一行的索引放进row
       row.index = rowIndex
     },
     onRowClick(row, event, column) {
       this.delIndex = row.index
     },
-    //删除行
+    // 删除行
     delRowFn() {
       this.dataList.splice(this.delIndex, 1)
     },
-    //添加行
+    // 添加行
     addRowFn() {
       this.dataList.push({
         customerNumber: '',

+ 83 - 0
src/views/logisticsBill/components/reconciliationDetail.vue

@@ -0,0 +1,83 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :operation="operation()"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getDealerListV2, exportDealerListV2, importCustomerV2 } from '@/api/basic_data/dealer'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '导入',
+              render: this.importButton(importCustomerV2)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getDealerListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportDealerListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'>
+
+        </div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+      <style lang="scss" scoped></style>
+

+ 73 - 0
src/views/logisticsBill/logisticsExpenses.vue

@@ -0,0 +1,73 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListCostBillV2, exportListCostBillV2 } from '@/api/logisticsBill'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListCostBillV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListCostBillV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'></div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+  <style lang="scss" scoped></style>
+

+ 111 - 0
src/views/logisticsBill/reconciliation.vue

@@ -0,0 +1,111 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getDealerListV2, exportDealerListV2, importCustomerV2 } from '@/api/basic_data/dealer'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '导入',
+              render: this.importButton(importCustomerV2)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getDealerListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportDealerListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'>
+          <el-button
+            size='mini'
+            type='text'
+            onClick={ () => {
+              this.visible = true
+              this.detailsId = row.id
+            }}
+          >
+              账单异常
+          </el-button>
+          <el-button
+            size='mini'
+            type='text'
+            onClick={ () => {
+              this.visible = true
+              this.detailsId = row.id
+            }}
+          >
+              已对账
+          </el-button>
+          <el-button
+            size='mini'
+            type='text'
+            onClick={ () => {
+              this.visible = true
+              this.detailsId = row.id
+            }}
+          >
+              详情
+          </el-button>
+        </div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+    <style lang="scss" scoped></style>
+

+ 72 - 0
src/views/logisticsBill/subExpenses.vue

@@ -0,0 +1,72 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <Popu v-if="visible" />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListSubCostBillV2, exportListSubCostBillV2 } from '@/api/logisticsBill'
+export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListSubCostBillV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListSubCostBillV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return <div class='operation-btns'></div>
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+  <style lang="scss" scoped></style>
+

+ 103 - 0
src/views/replaceRecord/replaceRecordList.vue

@@ -0,0 +1,103 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :operation="operation()"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  >
+    <popu v-if="visible">
+      <el-page-header slot="head" content="替换机型" @back="handleClose" />
+      <!-- <replace-record-form /> -->
+    </popu>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+// import ReplaceRecordForm from '../sales_policy/components/replaceRecordForm.vue';
+import Popu from '@/components/template/popu.vue'
+import { getDealerListV2, exportDealerListV2 } from '@/api/basic_data/dealer'
+export default {
+  components: { TemplatePage, Popu,  },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.visible = true
+              })
+              // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getDealerListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportDealerListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={ () => {
+                this.visible = true
+                this.detailsId = row.id
+              }}
+            >
+                    查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+      <style lang="scss" scoped></style>
+

+ 16 - 16
src/views/sales_control/adjust_warehouse.vue

@@ -3,16 +3,16 @@
     <template-page
       v-show="!pageType"
       ref="pageRef"
-      :getList="getList"
-      :exportList="exportList"
+      :get-list="getList"
+      :export-list="exportList"
       :operation="operation()"
-      :columnParsing="columnParsing"
-      :optionsEvensGroup="optionsEvensGroup"
-    >
-    </template-page>
-    <warehouse-form v-if="pageType == 1" :pageType="pageType" @close="handleClose" />
-    <warehouse-examine v-if="pageType == 2" :detailsId="detailsId" :pageType="pageType" @close="handleClose" />
-    <warehouse-details v-if="pageType == 3" :detailsId="detailsId" :pageType="pageType" @close="handleClose" />
+      :column-parsing="columnParsing"
+      :options-evens-group="optionsEvensGroup"
+      :replace-or-not-map="false"
+    />
+    <warehouse-form v-if="pageType == 1" :page-type="pageType" @close="handleClose" />
+    <warehouse-examine v-if="pageType == 2" :details-id="detailsId" :page-type="pageType" @close="handleClose" />
+    <warehouse-details v-if="pageType == 3" :details-id="detailsId" :page-type="pageType" @close="handleClose" />
   </div>
 </template>
 
@@ -83,10 +83,10 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             <el-button
-              size="mini"
-              type="text"
+              size='mini'
+              type='text'
               onClick={() => {
                 this.detailsId = row.id
                 this.pageType = 3
@@ -96,8 +96,8 @@ export default {
             </el-button>
             {row.examineStatus != 'OK' && row.examineStatus != 'FAIL' ? (
               <el-button
-                size="mini"
-                type="text"
+                size='mini'
+                type='text'
                 onClick={() => {
                   this.detailsId = row.id
                   this.pageType = 2
@@ -114,9 +114,9 @@ export default {
                     this.$refs.pageRef.refreshList()
                   })
                 }}
-                title="删除吗?"
+                title='删除吗?'
               >
-                <el-button slot="reference" size="mini" type="text">
+                <el-button slot='reference' size='mini' type='text'>
                   删除
                 </el-button>
               </el-popconfirm>

+ 30 - 30
src/views/sales_control/preposition_stock_list.vue

@@ -21,36 +21,36 @@ export default {
     return {
       // 事件组合
       optionsEvensGroup: [
-        [
-          [
-            {
-              name: '下载模板',
-              click: () => {
-                workerTemplateExcel({}, `${this.$route.meta.title}`)
-                  .then(res => {
-                    console.log('chengg')
-                    this.$message({
-                      message: '下载成功',
-                      type: 'success'
-                    })
-                  })
-                  .catch(err => {
-                    this.$message.error('下载失败')
-                  })
-              },
-              isRole: this.$checkBtnRole('import', this.$route.meta.roles)
-            }
-          ]
-        ],
-        [
-          [
-            {
-              name: '',
-              render: this.importButton(partsNewInImport),
-              isRole: this.$checkBtnRole('import', this.$route.meta.roles)
-            }
-          ]
-        ]
+        // [
+        //   [
+        //     {
+        //       name: '下载模板',
+        //       click: () => {
+        //         workerTemplateExcel({}, `${this.$route.meta.title}`)
+        //           .then(res => {
+        //             console.log('chengg')
+        //             this.$message({
+        //               message: '下载成功',
+        //               type: 'success'
+        //             })
+        //           })
+        //           .catch(err => {
+        //             this.$message.error('下载失败')
+        //           })
+        //       },
+        //       isRole: this.$checkBtnRole('import', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ],
+        // [
+        //   [
+        //     {
+        //       name: '',
+        //       render: this.importButton(partsNewInImport),
+        //       isRole: this.$checkBtnRole('import', this.$route.meta.roles)
+        //     }
+        //   ]
+        // ]
       ],
       // 表格属性
       tableAttributes: {

+ 27 - 68
src/views/sales_control/sales_management/components/customer_sales_details.vue

@@ -1,68 +1,25 @@
 <template>
   <div>
-    <el-page-header @back="handleBack" content="详情" style=" padding: 20px 20px 0 20px;"></el-page-header>
+    <el-page-header content="详情" style=" padding: 20px 20px 0 20px;" @back="handleBack" />
     <sales-header ref="header" />
-    <sales-table :dataList="dataList" :column="column" @handleSelection="handleSelection">
+    <sales-table :data-list="dataList" :column="column" @handleSelection="handleSelection">
       <template #events>
-        <el-button v-if="details.status == 1 && isFront !== false" type="primary" size="mini" @click="handleInform(2)"
-          >通知发货</el-button
-        >
-        <el-button v-if="details.status == 2 && isFront !== false" size="mini">撤销发货</el-button>
-        <el-button v-if="isFront === false && details.status == 1" type="primary" size="mini" @click="handleSignIn(4)">
+        <el-button
+          v-if="(details.status == 1 &&details.stockType == 1 )"
+          type="primary"
+          size="mini"
+          @click="handleInform(2)"
+        >通知发货</el-button>
+        <el-button v-if="(details.status == 2 && details.stockType == 1)" size="mini" @click="handleSendRevoke(1)">撤销发货</el-button>
+        <el-button v-if="(details.status == 1 && details.stockType == 2)" type="primary" size="mini" @click="handleSignIn(4)">
           签收
         </el-button>
       </template>
-
-      <!--      <template v-slot:operation="{item:{row,$index}}">-->
-      <!--        <el-popconfirm-->
-      <!--          style="margin-left: 10px"-->
-      <!--          title="删除?"-->
-      <!--          @onConfirm="handleDel(row,$index)"-->
-      <!--        >-->
-      <!--          <el-button slot="reference" type="text" size="mini">删除</el-button>-->
-      <!--        </el-popconfirm>-->
-      <!--      </template>-->
-      <!--      <div>-->
-      <!--        <h5>物流信息</h5>-->
-      <!--        <div class="diy-table-1">-->
-      <!--          <el-row>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="24" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--          </el-row>-->
-      <!--        </div>-->
-      <!--        <el-timeline :reverse="reverse">-->
-      <!--          <el-timeline-item-->
-      <!--            v-for="(activity, index) in activities"-->
-      <!--            :key="index"-->
-      <!--            :timestamp="activity.timestamp"-->
-      <!--            :color="activity.color"-->
-      <!--          >-->
-      <!--            {{ activity.content }}-->
-      <!--          </el-timeline-item>-->
-      <!--        </el-timeline>-->
-      <!--      </div>-->
     </sales-table>
+    <LogisticsTabs v-if="details && details.status !== 1 && details.stockType == 1 " :return-show="false" style="margin:20px;" :details-id="detailsId" :jiaxian-order-id="details.jiaxianOrderId"/>
     <sales-dialog
-      :dialogVisible="dialogVisible"
-      :customerNumber="customerNumber"
+      :dialog-visible="dialogVisible"
+      :customer-number="customerNumber"
       :func="getDialogList"
       @confirm="confirm"
     />
@@ -73,15 +30,16 @@
 import SalesDialog from '@/components/SalesDialog/SalesDialog'
 import SalesHeader from '@/components/SalesHeader/SalesHeader'
 import SalesTable from '@/components/SalesTable/SalesTable'
-import { addFrontOrder, getFrontOrderDetail, sbumitFrontOrder, signIn } from '@/api/sales'
+import { addFrontOrder, getFrontOrderDetail, sbumitFrontOrder, signIn, setSendRevoke } from '@/api/sales'
 import { getcustomerFrontList } from '@/api/stock'
-
+import LogisticsTabs from '@/components/LogisticsTabs'
 export default {
   name: 'WarehouseForm',
   components: {
     SalesHeader,
     SalesTable,
-    SalesDialog
+    SalesDialog,
+    LogisticsTabs
   },
   props: ['detailsId', 'pageType'],
   data() {
@@ -153,19 +111,17 @@ export default {
   },
   created() {
     this.isFront = JSON.parse(localStorage.getItem('supply_user')).isFront
-    console.log(this.isFront)
     if (this.detailsId) {
       getFrontOrderDetail({ id: this.detailsId }).then(res => {
-        this.dataList = res.data.orders
         this.details = res.data
+        this.dataList = res.data.orders
         this.$refs.header.screenForm = res.data
         this.$refs.header.screenForm.disabled = true
-
         this.$refs.header.screenForm.provinceId = res.data.province
         this.$refs.header.screenForm.cityId = res.data.city
         this.$refs.header.screenForm.areaId = res.data.area
         this.$refs.header.screenForm.streetId = res.data.street
-        this.$refs.header.screenForm.stockType = res.data.stockType == 1 ? '前置仓' : '商家仓'
+        this.$refs.header.screenForm.stockType = res.data.stockType
       })
     }
   },
@@ -217,7 +173,6 @@ export default {
       sbumitFrontOrder({ id: this.$refs.header.screenForm.id, status }).then(res => {
         this.$successMsg('发货通知')
         this.handleBack()
-
       })
     },
     handleSignIn(status) {
@@ -229,16 +184,20 @@ export default {
         signIn({ id: this.$refs.header.screenForm.id, status }).then(res => {
           this.$successMsg('签收')
           this.handleBack()
-
         })
-      }).catch(err => {
+      }).catch(() => {
 
       })
-
+    },
+    handleSendRevoke(status) {
+      setSendRevoke({ id: this.$refs.header.screenForm.id, status }).then(res => {
+        this.$successMsg('撤销发货')
+        this.handleBack()
+      })
     },
     handleBack() {
       this.$emit('close')
-    },
+    }
 
   }
 }

+ 61 - 26
src/views/sales_control/sales_management/components/customer_sales_form.vue

@@ -1,30 +1,33 @@
 <template>
   <div>
-    <el-page-header @back="handleBack" :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;"
-    ></el-page-header>
-    <sales-header ref="header" />
+    <el-page-header
+      :content="detailsId?'编辑':'新增'"
+      style=" padding: 20px 20px 0 20px;"
+      @back="handleBack"
+    />
+    <sales-header ref="header" @setStokType="setStokType" />
     <sales-table
-      :dataList="dataList"
+      :data-list="dataList"
       :column="column"
-      :isOperation="detailsId ? false : true"
-      isSelection
+      :is-operation="detailsId ? false : true"
+      is-selection
       @handleSelection="handleSelection"
     >
       <template #bts>
         <div v-if="!detailsId">
-          <el-button type="primary" v-if="dis" size="mini" @click="dialogVisible = true">添加 </el-button>
-          <el-button type="danger" v-if="dis" size="mini" @click="delChange">删除 </el-button>
+          <el-button v-if="dis" type="primary" size="mini" @click="handleAdd">添加 </el-button>
+          <el-button v-if="dis" type="danger" size="mini" @click="delChange">删除 </el-button>
         </div>
       </template>
       <template #events>
         <div v-if="!detailsId">
           <el-button type="primary" :disabled="!dis" size="mini" @click="handelSubmit(1)">提交</el-button>
-          <el-button size="mini" @click="onReset" v-if="dis">重置 </el-button>
-          <el-button size="mini" v-if="isFront !== false" :disabled="dis" @click="handleInform(2)">通知发货</el-button>
+          <el-button v-if="dis" size="mini" @click="onReset">重置 </el-button>
+          <el-button v-if="stokType == 1 || details.stockType ==1" size="mini" :disabled="dis" @click="handleInform(2)">通知发货</el-button>
         </div>
         <div v-else>
           <el-button type="primary" size="mini" @click="handelSubmit(2)">保存</el-button>
-          <el-button size="mini" v-if="!detailsId" @click="onReset">重置</el-button>
+          <el-button v-if="!detailsId" size="mini" @click="onReset">重置</el-button>
         </div>
       </template>
 
@@ -36,8 +39,9 @@
     </sales-table>
     <sales-dialog
       ref="dia"
-      :dialogVisible="dialogVisible"
-      :customerNumber="customerNumber"
+      :dialog-visible="dialogVisible"
+      :customer-number="customerNumber"
+      :data-list="dataList"
       :func="getDialogList"
       @confirm="confirm"
     />
@@ -85,8 +89,13 @@ export default {
           width: '300'
         },
         {
-          prop: 'stockQty',
-          label: '库存数量',
+          prop: 'frontStockNum',
+          label: ' 前置仓结存数量',
+          width: '180'
+        },
+        {
+          prop: 'customerStockNum',
+          label: '自有仓结存数量',
           width: '180'
         },
         {
@@ -104,13 +113,20 @@ export default {
         }
       ],
       isFront: JSON.parse(localStorage.getItem('supply_user')).isFront,
-      salesId: ''
+      salesId: '',
+      stokType: null,
+      details: {}
     }
   },
   created() {
     if (this.detailsId) {
       getFrontOrderDetail({ id: this.detailsId }).then(res => {
+        this.details = res.data
         this.dataList = res.data.orders
+        // this.dataList  = res.data.orders.map(k => {
+        //   k.disabledId = k.customerStockId
+        //   return k
+        // })
         this.customerNumber = res.data.customerNumber
         this.$refs.header.screenForm = res.data
         this.$refs.header.screenForm.disabled = this.disabled = true
@@ -139,8 +155,13 @@ export default {
           width: '300'
         },
         {
-          prop: 'stockQty',
-          label: '库存数量',
+          prop: 'frontStockNum',
+          label: ' 前置仓结存数量',
+          width: '180'
+        },
+        {
+          prop: 'customerStockNum',
+          label: '自有仓结存数量',
           width: '180'
         },
         {
@@ -188,7 +209,7 @@ export default {
       if (!this.detailsId) {
         this.$refs.header.screenForm.customerName = this.dataList[0].customerName
         this.$refs.header.screenForm.customerNumber = this.dataList[0].customerNumber
-        this.$refs.header.screenForm.stockType = this.dataList[0].stockType
+        // this.$refs.header.screenForm.stockType = this.dataList[0].stockType
       }
 
       this.customerNumber = this.dataList[0].customerNumber
@@ -213,10 +234,13 @@ export default {
       //   })
       // }
     },
-    //去掉相同数据
+    // 去掉相同数据
     resArr(arr1, arr2) {
       return arr1.filter(v => arr2.every(val => val.id != v.id))
     },
+    setStokType(e) {
+      this.stokType = e
+    },
     delChange() {
       if (this.dataList.length) {
         for (let i = 0; i < this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length; i++) {
@@ -241,13 +265,23 @@ export default {
       this.selection = data
     },
     handleInform(status = 2) {
-      console.log(33)
       sbumitFrontOrder({ id: this.salesId, status }).then(res => {
         this.$successMsg('通知发货')
         this.handleBack()
       })
     },
+    handleAdd() {
+      // if (!this.stokType) {
+      //   this.$errorMsg('请先选择发货仓库')
+      //   return
+      // }
+      this.dialogVisible = true
+    },
     handelSubmit(type, status = 1) {
+      if (!this.$refs.header.screenForm.stockType) {
+        this.$errorMsg('请选择仓库')
+        return
+      }
       if (!this.dataList.length) {
         this.$errorMsg('请添加产品')
         return
@@ -265,6 +299,7 @@ export default {
         ...this.$refs.header.screenForm,
         orders: this.dataList,
         status: status
+
       }
       this.$refs.header.$refs.form.validate(valid => {
         if (valid) {
@@ -309,10 +344,11 @@ export default {
                   type: 'text'
                 }
               ]
-              if (this.isFront ===false){
+              if (this.stokType === 2) {
                 this.handleBack()
-              }              this.salesId = res.data
-              this.$set(this.$refs.header.screenForm,'id',res.data)
+              }
+              this.salesId = res.data
+              this.$set(this.$refs.header.screenForm, 'id', res.data)
               this.$forceUpdate()
             })
           } else {
@@ -331,11 +367,10 @@ export default {
     onReset() {
       Object.assign(this.$data, this.$options.data())
       Object.assign(this.$refs.header.$data, this.$refs.header.$options.data())
-
     },
     handleBack() {
       this.$emit('close')
-    },
+    }
 
   }
 }

+ 272 - 57
src/views/sales_control/sales_management/components/return_sales_details.vue

@@ -1,26 +1,56 @@
 <template>
   <div>
-    <el-page-header @back="handleBack" content="详情" style="padding: 20px 20px 0 20px"></el-page-header>
+    <el-page-header
+      :content="detailsId ? '详情' : '新增'"
+      style="padding: 20px 20px 0 20px"
+      @back="handleBack"
+    />
     <return-sales-header ref="header" :details="details" />
-    <sales-table :dataList="dataList" :column="column" @handleSelection="handleSelection">
+    <sales-table
+      :data-list="dataList"
+      :column="column"
+      :is-operation="detailsId ? false : true"
+      is-selection
+      @handleSelection="handleSelection"
+    >
+      <template #bts>
+        <div v-if="!detailsId">
+          <el-button v-if="dis" type="primary" size="mini" @click="dialogVisible = true">添加</el-button>
+          <el-button v-if="dis" type="danger" size="mini" @click="delChange">删除</el-button>
+        </div>
+      </template>
       <template #events>
-        <el-button v-if="details.status == 1" type="primary" size="mini" @click="handleInform(2)">通知退货</el-button>
-        <el-button v-if="details.status == 2" disabled size="mini">撤销退货</el-button>
+        <div v-if="!detailsId">
+          <el-button type="primary" :disabled="!dis" size="mini" @click="handelSubmit(1)">提交</el-button>
+          <el-button v-if="dis" size="mini" @click="onReset">重置</el-button>
+          <el-button v-if="(details.stockType ==1 && details.status == 1)" size="mini" :disabled="dis" @click="handleInform(2)">退货通知</el-button>
+        </div>
+        <div v-else>
+          <el-button v-if="(details.stockType ==1 && details.status == 1)" size="mini" @click="handleInform(2)">退货通知</el-button>
+          <el-button v-if="(details.status == 2 && details.stockType == 1) || (details.status == 2 && details.stockType == 2)" size="mini" @click="handleSendRevoke(1)">撤销退货</el-button>
+        </div>
+      </template>
+      <template v-slot:custom="{ item: { row, $index } }">
+        <div>{{ diffQty(row) }}</div>
+      </template>
+      <!-- <template v-slot:custom="{ item: { row, $index } }">
+        <el-radio v-model="row.flag" label="1">增加</el-radio>
+        <el-radio v-model="row.flag" label="-1">减少</el-radio>
+      </template> -->
+      <template v-slot:operation="{ item: { row, $index } }">
+        <el-popconfirm v-if="dis" style="margin-left: 10px" title="删除?" @onConfirm="handleDel(row, $index)">
+          <el-button slot="reference" type="text" size="mini">删除</el-button>
+        </el-popconfirm>
       </template>
-
-      <!--      <template v-slot:operation="{item:{row,$index}}">-->
-      <!--        <el-popconfirm-->
-      <!--          style="margin-left: 10px"-->
-      <!--          title="删除?"-->
-      <!--          @onConfirm="handleDel(row,$index)"-->
-      <!--        >-->
-      <!--          <el-button slot="reference" type="text" size="mini">删除</el-button>-->
-      <!--        </el-popconfirm>-->
-      <!--      </template>-->
     </sales-table>
+    <LogisticsTabs v-if=" details && details.status !== 1 && details.stockType == 1" style="margin:20px;" :jiaxian-order-id="details.jiaxianOrderId"  :details-id="detailsId" :return-show="false" />
+
     <sales-dialog
-      :dialogVisible="dialogVisible"
-      :customerNumber="customerNumber"
+      ref="dia"
+      :data-list="dataList"
+      :dialog-visible="dialogVisible"
+      :return-id="returnId"
+      :item-id="itemId"
       :func="getDialogList"
       @confirm="confirm"
     />
@@ -31,24 +61,35 @@
 import SalesDialog from '@/components/SalesDialog/SalesDialog'
 import ReturnSalesHeader from '@/components/ReturnSalesHeader/ReturnSalesHeader'
 import SalesTable from '@/components/SalesTable/SalesTable'
-import { addFrontOrder, detailRefund, sbumitFrontOrder, sendRefund } from '@/api/sales'
-import { getcustomerFrontList } from '@/api/stock'
+import LogisticsTabs from '@/components/LogisticsTabs'
+
+import {
+  detailRefund,
+  addRefund,
+  sendRefund,
+  updateRefund,
+  listOrder,
+  sendRefundRevoke
+} from '@/api/sales'
 
 export default {
   name: 'WarehouseForm',
   components: {
     ReturnSalesHeader,
     SalesTable,
-    SalesDialog
+    SalesDialog,
+    LogisticsTabs
   },
   props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,
-      customerNumber: '',
+      returnId: '',
+      itemId: '',
       dataList: [],
       selection: [],
       flag: 1,
+      dis: true,
       details: {},
       column: [
         {
@@ -69,89 +110,263 @@ export default {
 
         {
           prop: 'qty',
-          label: '已退数量',
+          align: 'left',
+          label: '退货数量',
           width: '180'
         },
         // {
-        //   prop: 'volume',
-        //   label: '体积',
-        //   width: '180'
-        // },
-        // {
         //   prop: 'totalVolume',
         //   label: '总体积',
         //   width: '180'
         // },
         {
           prop: 'notes',
-          label: '备注'
+          label: '备注',
+          type: 'text'
         }
-      ]
+      ],
+      isFront: JSON.parse(localStorage.getItem('supply_user')).isFront,
+      salesId: ''
+    }
+  },
+  computed: {
+    diffQty() {
+      return row => {
+        return Number(row.qty) - Number(row.refundQty)
+      }
     }
   },
   created() {
-    console.log(this.$parent)
     if (this.detailsId) {
       detailRefund({ id: this.detailsId }).then(res => {
         this.dataList = res.data.orders
         this.details = res.data
+        console.log(this.details, 99)
+        this.dataList.forEach(k => {
+          this.$set(k, 'refundQty', k.qty)
+          k.diffQty = Number(k.qty) - Number(k.refundQty || 0)
+        })
+        this.details.customerOrderNo = res.data.customerOrderNo
         this.details.detailsId = res.data.id
-        // console.log(this.details );
+
+        this.returnId = res.data.id + this.dataList[0].materialCode
       })
+    } else {
+      Object.assign(this.$data, this.$options.data())
     }
   },
+
   methods: {
     getDialogList(p) {
-      return getcustomerFrontList(...p)
+      // let func = getcustomerFrontList
+      // if (this.isFront===true){
+      //   func = getcustomerFrontList
+      // }
+      // if (this.isFront===false){
+      //   func = getFrontListCustomer
+      // }
+      return listOrder(...p)
     },
     confirm(selected) {
+      for (let i = 0; i < selected.length; i++) {
+        if (selected[0].id != selected[i].id) {
+          this.$errorMsg('不能选择不一样的销售单')
+          return
+        }
+      }
+
       // console.log(selected)
-      this.dataList = selected
-      this.$refs.header.screenForm.customerName = this.dataList[0].customerName
-      this.$refs.header.screenForm.customerNumber = this.dataList[0].customerNumber
-      this.customerNumber = this.dataList[0].customerNumber
+      this.dataList = [...this.dataList, ...selected]
+      for (let i = 0; i < this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length; i++) {
+        for (let j = 0; j < this.dataList.length; j++) {
+          if (
+            this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.dataList[j].id ||
+            this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled === false
+          ) {
+            if (
+              this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].itemId == this.dataList[j].itemId ||
+              this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled === false
+            ) {
+              this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', false)
+            } else {
+              this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
+            }
+          } else {
+            this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
+          }
+        }
+      }
+      console.log(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData)
+      selected.forEach(k => {
+        k.diffQty = Number(k.qty) - Number(k.refundQty)
+        k.qty = k.refundQty
+      })
+      const obj = {
+        id: Object.freeze(this.dataList[0].id)
+      }
+      if (!this.detailsId) {
+        this.details = this.dataList[0]
+        this.details.customerOrderNo = obj.id
+      }
+      this.detailsId = this.detailsId
+
+      this.returnId = obj.id
+      this.itemId = this.dataList[0].itemId
       this.dialogVisible = false
+      this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.$refs.tableView.clearSelection()
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
+      this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.find(k => {
+        if (k.id == item.id) {
+          if (k.itemId == item.itemId) {
+            this.$set(k, 'disabled', true)
+          } else {
+            this.$set(k, 'disabled', false)
+          }
+          return
+        }
+      })
+      if (!this.dataList.length) {
+        this.returnId = ''
+      }
+      // if (!this.dataList.length){
+      //   this.$nextTick(()=>{
+      //     this.details = {}
+      //     this.returnId = ''
+      //   })
+      // }
+    },
+    // 去掉相同数据
+    resArr(arr1, arr2) {
+      return arr1.filter(v => arr2.every(val => val.id != v.id))
+    },
+    handleSendRevoke(status) {
+      sendRefundRevoke({ id: this.detailsId, status }).then(res => {
+        this.$successMsg('撤销退货')
+        this.handleBack()
+      })
     },
     delChange() {
-      this.dataList.forEach((k, i) => {
-        this.selection.forEach((l, e) => {
-          if (k.id === l.id) {
-            this.dataList.splice(i, 1)
-            this.selection.splice(e, 1)
+      if (this.dataList.length) {
+        for (let i = 0; i < this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length; i++) {
+          for (let j = 0; j < this.selection.length; j++) {
+            if (
+              this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.selection[j].id ||
+              this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled === false
+            ) {
+              if (
+                this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].itemId ==
+                  this.selection[j].itemId ||
+                this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled === false
+              ) {
+                this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', false)
+              } else {
+                this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
+              }
+            } else {
+              this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
+            }
           }
-        })
-      })
+        }
+        this.dataList = this.resArr(this.dataList, this.selection)
+
+        if (!this.dataList.length) {
+          this.returnId = ''
+        }
+      }
     },
     handleSelection(data) {
       this.selection = data
     },
+
+    handelSubmit(type, status = 1) {
+      const list = JSON.parse(JSON.stringify(this.dataList))
+
+      if (!list.length) {
+        this.$errorMsg('请添加产品')
+        return
+      }
+      for (let i = 0; i < list.length; i++) {
+        list[i].directFlag = list[i].flag
+        if (Number(list[i].qty) < 0 || !list[i].qty) {
+          this.$errorMsg(`第${i + 1}产品退货数量有误`)
+          return
+        }
+        list[i].id = ''
+      }
+
+      const params = {
+        ...this.$refs.header.details,
+        orders: list,
+        customerOrderNo: this.details.customerOrderNo,
+        status
+      }
+      if (type === 1) {
+        params.id = ''
+        addRefund(params).then(res => {
+          this.$successMsg('新增成功')
+          this.salesId = res.data
+          this.column = [
+            {
+              prop: 'materialName',
+              label: '产品名称',
+              width: '180'
+            },
+            {
+              prop: 'materialCode',
+              label: '物料编码',
+              width: '180'
+            },
+            {
+              prop: 'specification',
+              label: '规格型号',
+              width: '300'
+            },
+
+            {
+              prop: 'qty',
+              align: 'left',
+              label: '退货数量',
+              width: '180'
+            },
+
+            {
+              prop: 'notes',
+              label: '备注',
+              width: '180',
+
+              type: 'text'
+            }
+          ]
+          if (this.details.stockType === 2) {
+            this.handleBack()
+          }
+
+          this.dis = false
+          this.$forceUpdate()
+        })
+      } else {
+        updateRefund(params).then(res => {
+          this.$successMsg('编辑成功')
+          this.handleBack()
+          this.$forceUpdate()
+        })
+      }
+    },
     handleInform(status = 2) {
       sendRefund({ id: this.details.id, status }).then(res => {
         this.$successMsg('退货通知')
         this.handleBack()
       })
     },
-    handelSubmit() {
-      this.dataList.forEach(k => {
-        k.id = ''
-        k.directFlag = k.flag
-      })
-      const params = {
-        ...this.$refs.header.screenForm,
-        orders: this.dataList
-      }
-      addFrontOrder(params).then(res => {
-        this.$successMsg('新增成功')
-        this.handleBack()
-        this.$forceUpdate()
-      })
-    },
+
     handleBack() {
       this.$emit('close')
     },
+    onReset() {
+      Object.assign(this.$data, this.$options.data())
+    }
   }
 }
 </script>

+ 36 - 47
src/views/sales_control/sales_management/components/return_sales_form.vue

@@ -1,42 +1,40 @@
 <template>
   <div>
     <el-page-header
-      @back="handleBack"
       :content="detailsId ? '编辑' : '新增'"
       style="padding: 20px 20px 0 20px"
-    ></el-page-header>
+      @back="handleBack"
+    />
     <return-sales-header ref="header" :details="details" />
     <sales-table
-      :dataList="dataList"
+      :data-list="dataList"
       :column="column"
-      :isOperation="detailsId ? false : true"
-      isSelection
+      :is-operation="detailsId ? false : true"
+      is-selection
       @handleSelection="handleSelection"
     >
       <template #bts>
         <div v-if="!detailsId">
-          <el-button type="primary" v-if="dis" size="mini" @click="dialogVisible = true">添加</el-button>
-          <el-button type="danger" v-if="dis" size="mini" @click="delChange">删除</el-button>
+          <el-button v-if="dis" type="primary" size="mini" @click="dialogVisible = true">添加</el-button>
+          <el-button v-if="dis" type="danger" size="mini" @click="delChange">删除</el-button>
         </div>
       </template>
       <template #events>
-        <div v-if="!detailsId">
-          <el-button type="primary" :disabled="!dis" size="mini" @click="handelSubmit(1)">提交</el-button>
-          <el-button size="mini" @click="onReset" v-if="dis">重置</el-button>
-          <el-button size="mini" v-if="isFront !== false" :disabled="dis" @click="handleInform(2)">退货通知</el-button>
-        </div>
-        <div v-else>
-          <el-button type="primary" size="mini" @click="handelSubmit(2)">保存</el-button>
-          <el-button size="mini" @click="onReset" v-if="!detailsId">重置</el-button>
+        <div>
+          <el-button v-if="!detailsId" type="primary" :disabled="!dis" size="mini" @click="handelSubmit(1)">提交</el-button>
+          <el-button v-else type="primary" size="mini" @click="handelSubmit(2)">提交</el-button>
+          <el-button v-if="dis" size="mini" @click="onReset">重置</el-button>
+          <el-button v-if="$refs.header.details.stockType ==1" size="mini" :disabled="dis" @click="handleInform(2)">退货通知</el-button>
         </div>
+
       </template>
       <template v-slot:custom="{ item: { row, $index } }">
         <div>{{ diffQty(row) }}</div>
       </template>
-      <template v-slot:custom="{ item: { row, $index } }">
-        <el-radio label="1" v-model="row.flag">增加</el-radio>
-        <el-radio label="-1" v-model="row.flag">减少</el-radio>
-      </template>
+      <!-- <template v-slot:custom="{ item: { row, $index } }">
+        <el-radio v-model="row.flag" label="1">增加</el-radio>
+        <el-radio v-model="row.flag" label="-1">减少</el-radio>
+      </template> -->
       <template v-slot:operation="{ item: { row, $index } }">
         <el-popconfirm v-if="dis" style="margin-left: 10px" title="删除?" @onConfirm="handleDel(row, $index)">
           <el-button slot="reference" type="text" size="mini">删除</el-button>
@@ -45,9 +43,10 @@
     </sales-table>
     <sales-dialog
       ref="dia"
-      :dialogVisible="dialogVisible"
-      :returnId="returnId"
-      :itemId="itemId"
+      :data-list="dataList"
+      :dialog-visible="dialogVisible"
+      :return-id="returnId"
+      :item-id="itemId"
       :func="getDialogList"
       @confirm="confirm"
     />
@@ -59,17 +58,12 @@ import SalesDialog from '@/components/SalesDialog/SalesDialog'
 import ReturnSalesHeader from '@/components/ReturnSalesHeader/ReturnSalesHeader'
 import SalesTable from '@/components/SalesTable/SalesTable'
 import {
-  addFrontOrder,
   detailRefund,
-  getFrontOrderDetail,
   addRefund,
-  getFrontOrderList,
-  sbumitFrontOrder,
   sendRefund,
   updateRefund,
   listOrder
 } from '@/api/sales'
-import { getcustomerFrontList, getFrontListCustomer } from '@/api/stock'
 
 export default {
   name: 'WarehouseForm',
@@ -114,11 +108,12 @@ export default {
           isInput: true
         },
 
-        // {
-        //   prop: 'volume',
-        //   label: '体积',
-        //   width: '180'
-        // },
+        {
+          prop: 'diffQty',
+          label: '已退数量',
+          width: '180',
+          // isCustom: true
+        },
         // {
         //   prop: 'totalVolume',
         //   label: '总体积',
@@ -131,7 +126,7 @@ export default {
           type: 'text'
         }
       ],
-      isFront: JSON.parse(localStorage.getItem('supply_user')).isFront,
+      isFront: false,
       salesId: ''
     }
   },
@@ -144,6 +139,7 @@ export default {
   },
   created() {
     if (this.detailsId) {
+      this.dis = false
       detailRefund({ id: this.detailsId }).then(res => {
         this.dataList = res.data.orders
         this.details = res.data
@@ -163,13 +159,6 @@ export default {
 
   methods: {
     getDialogList(p) {
-      // let func = getcustomerFrontList
-      // if (this.isFront===true){
-      //   func = getcustomerFrontList
-      // }
-      // if (this.isFront===false){
-      //   func = getFrontListCustomer
-      // }
       return listOrder(...p)
     },
     confirm(selected) {
@@ -201,19 +190,18 @@ export default {
           }
         }
       }
-      console.log(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData)
       selected.forEach(k => {
         k.diffQty = Number(k.qty) - Number(k.refundQty)
         k.qty = k.refundQty
       })
-      let obj = {
+      const obj = {
         id: Object.freeze(this.dataList[0].id)
       }
       if (!this.detailsId) {
         this.details = this.dataList[0]
         this.details.customerOrderNo = obj.id
+        this.details.stockType = this.details.stockType == '嘉贤前置仓' ? 1 : 2
       }
-      this.detailsId = this.detailsId
 
       this.returnId = obj.id
       this.itemId = this.dataList[0].itemId
@@ -242,7 +230,7 @@ export default {
       //   })
       // }
     },
-    //去掉相同数据
+    // 去掉相同数据
     resArr(arr1, arr2) {
       return arr1.filter(v => arr2.every(val => val.id != v.id))
     },
@@ -300,6 +288,7 @@ export default {
         orders: list,
         customerOrderNo: this.details.customerOrderNo,
         status
+
       }
       if (type === 1) {
         params.id = ''
@@ -338,7 +327,7 @@ export default {
               type: 'text'
             }
           ]
-          if (this.isFront === false) {
+          if (this.details.stockType === 2) {
             this.handleBack()
           }
 
@@ -354,12 +343,12 @@ export default {
       }
     },
     handleInform(status = 2) {
-      sendRefund({ id: this.salesId, status }).then(res => {
+      sendRefund({ id: this.salesId || this.detailsId, status }).then(res => {
         this.$successMsg('退货通知')
         this.handleBack()
       })
     },
-    
+
     handleBack() {
       this.$emit('close')
     },

+ 16 - 16
src/views/sales_control/sales_management/customer_sales_list.vue

@@ -3,20 +3,20 @@
     <template-page
       v-show="!pageType"
       ref="pageRef"
-      :getList="getList"
-      :exportList="exportList"
+      :get-list="getList"
+      :export-list="exportList"
       :operation="operation()"
-      :columnParsing="columnParsing"
-      :optionsEvensGroup="optionsEvensGroup"
-    >
-    </template-page>
+      :column-parsing="columnParsing"
+      :options-evens-group="optionsEvensGroup"
+      :replace-or-not-map="false"
+    />
     <customer_sales_form
-      :detailsId="detailsId"
       v-if="pageType === 1 || pageType === 2"
-      :pageType="pageType"
+      :details-id="detailsId"
+      :page-type="pageType"
       @close="handleClose"
     />
-    <customer_sales_details  v-if="pageType==3" :detailsId="detailsId" :pageType="pageType" @close="handleClose" />
+    <customer_sales_details v-if="pageType==3" :details-id="detailsId" :page-type="pageType" @close="handleClose" />
   </div>
 </template>
 
@@ -103,10 +103,10 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             <el-button
-              size="mini"
-              type="text"
+              size='mini'
+              type='text'
               onClick={() => {
                 this.detailsId = row.id
                 this.pageType = 3
@@ -117,8 +117,8 @@ export default {
 
             {row.status == 1 ? (
               <el-button
-                size="mini"
-                type="text"
+                size='mini'
+                type='text'
                 onClick={() => {
                   this.detailsId = row.id
                   this.pageType = 2
@@ -135,9 +135,9 @@ export default {
                     this.$refs.pageRef.refreshList()
                   })
                 }}
-                title="删除吗?"
+                title='删除吗?'
               >
-                <el-button slot="reference" size="mini" type="text">
+                <el-button slot='reference' size='mini' type='text'>
                   删除
                 </el-button>
               </el-popconfirm>

+ 15 - 15
src/views/sales_control/sales_management/return_sales_list.vue

@@ -3,15 +3,15 @@
     <template-page
       v-show="!pageType"
       ref="pageRef"
-      :getList="getList"
-      :exportList="exportList"
+      :get-list="getList"
+      :export-list="exportList"
       :operation="operation()"
-      :columnParsing="columnParsing"
-      :optionsEvensGroup="optionsEvensGroup"
-    >
-    </template-page>
-    <return_sales_form v-if="pageType === 1 || pageType === 2" :details-id="detailsId" :pageType="pageType" @close="handleClose"/>
-    <return_sales_details v-if="pageType === 3" :details-id="detailsId" :pageType="pageType" @close="handleClose"/>
+      :column-parsing="columnParsing"
+      :options-evens-group="optionsEvensGroup"
+      :replace-or-not-map="false"
+    />
+    <return_sales_form v-if="pageType === 1 || pageType === 2" :details-id="detailsId" :page-type="pageType" @close="handleClose" />
+    <return_sales_details v-if="pageType === 3" :details-id="detailsId" :page-type="pageType" @close="handleClose" />
   </div>
 </template>
 
@@ -78,10 +78,10 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             <el-button
-              size="mini"
-              type="text"
+              size='mini'
+              type='text'
               onClick={() => {
                 this.detailsId = row.id
                 this.pageType = 3
@@ -92,8 +92,8 @@ export default {
 
             {row.status == 1 ? (
               <el-button
-                size="mini"
-                type="text"
+                size='mini'
+                type='text'
                 onClick={() => {
                   this.detailsId = row.id
                   this.pageType = 2
@@ -110,9 +110,9 @@ export default {
                     this.$refs.pageRef.refreshList()
                   })
                 }}
-                title="删除吗?"
+                title='删除吗?'
               >
-                <el-button slot="reference" size="mini" type="text">
+                <el-button slot='reference' size='mini' type='text'>
                   删除
                 </el-button>
               </el-popconfirm>

+ 122 - 104
src/views/sales_policy/components/AddCondition.vue

@@ -1,24 +1,26 @@
 <template>
   <el-container class="">
     <el-header height="20px">
-      <el-page-header @back="handleBack" :content="content"> </el-page-header>
-    </el-header> 
+      <el-page-header :content="content" @back="handleBack" />
+    </el-header>
     <div class="line">
-      <el-divider></el-divider>
+      <el-divider />
       <h4>限定条件</h4>
-      <el-divider></el-divider>
+      <el-divider />
     </div>
     <el-main v-if="!id">
       <el-row v-if="conditionBox.length">
         <el-row :gutter="50">
-          <el-col :xs="24" :sm="24" :lg="24" class="mgb" v-for="(item, index) in conditionBox" :key="index">
+          <el-col v-for="(item, index) in conditionBox" :key="index" :xs="24" :sm="24" :lg="24" class="mgb">
             <h5 v-if="index == 0">限定机型</h5>
             <h5 v-if="index > 0">配提机型</h5>
             <el-row>
               <el-row class="pdt">
-                <el-button type="primary" size="mini" @click=";(VisibleModle = true), getMaterialLists(index)"
-                  >添加机型</el-button
-                >
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click=";(VisibleModle = true), getMaterialLists(index)"
+                >添加机型</el-button>
 
                 <el-button type="primary" size="mini" @click="handleDeleteRow(index)">删除机型</el-button>
               </el-row>
@@ -31,16 +33,16 @@
                   @select="hanleSelectAll($event, index)"
                   @select-all="hanleSelectAll($event, index)"
                 >
-                  <el-table-column type="selection" width="55" align="left"> </el-table-column>
+                  <el-table-column type="selection" width="55" align="left" />
                   <el-table-column label="产品名称" width="300" show-overflow-tooltip align="left" prop="materialName">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.materialName" />
+                      <CopyButton :copy-text="scope.row.materialName" />
                       <span>{{ scope.row.materialName }}</span>
                     </template>
                   </el-table-column>
                   <el-table-column prop="specification" show-overflow-tooltip label="规格型号" align="left">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.specification" />
+                      <CopyButton :copy-text="scope.row.specification" />
                       <span>{{ scope.row.specification }}</span>
                     </template>
                   </el-table-column>
@@ -52,44 +54,44 @@
         <el-row>
           <el-form label-width="120px" :inline="false" size="mini">
             <el-row>
-              <el-form-item label="配置比例设置"> </el-form-item>
+              <el-form-item label="配置比例设置" />
             </el-row>
             <el-col :xs="24" :sm="8" :lg="8">
               <el-form-item label="限定机型">
-                <el-input size="mini" v-model="limit"></el-input>
+                <el-input v-model="limit" size="mini" />
               </el-form-item>
             </el-col>
 
-            <el-col :xs="24" :sm="8" :lg="8" v-for="(len, index) in conditionBox.length - 1">
+            <el-col v-for="(len, index) in conditionBox.length - 1" :xs="24" :sm="8" :lg="8">
               <el-form-item :label="'配提' + (index + 1) + '比例'">
-                <el-input size="mini" v-model="popArr['line_' + index]"></el-input>
+                <el-input v-model="popArr['line_' + index]" size="mini" />
               </el-form-item>
             </el-col>
           </el-form>
         </el-row>
-        <el-divider></el-divider>
+        <el-divider />
       </el-row>
     </el-main>
     <el-main v-else>
       <el-row>
         <el-row :gutter="50">
-          <el-col :xs="24" :sm="24" :lg="24" class="mgb" v-for="(item, index) in conditionBoxs" :key="index">
+          <el-col v-for="(item, index) in conditionBoxs" :key="index" :xs="24" :sm="24" :lg="24" class="mgb">
             <h5 v-if="index == 0">限定机型</h5>
             <h5 v-if="index > 0">配提机型</h5>
             <el-row>
               <el-row class="table">
                 <el-table style="width: 100%" :data="item" border>
-                  <el-table-column type="selection" width="55" align="left" v-if="!id"> </el-table-column>
-                  <el-table-column type="index" label="序号" width="55" align="left" v-else> </el-table-column>
+                  <el-table-column v-if="!id" type="selection" width="55" align="left" />
+                  <el-table-column v-else type="index" label="序号" width="55" align="left" />
                   <el-table-column label="产品名称" width="300" align="left" prop="materialName">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.materialName" />
+                      <CopyButton :copy-text="scope.row.materialName" />
                       <span>{{ scope.row.materialName }}</span>
                     </template>
                   </el-table-column>
                   <el-table-column prop="specification" label="规格型号" show-overflow-tooltip align="left">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.specification" />
+                      <CopyButton :copy-text="scope.row.specification" />
                       <span>{{ scope.row.specification }}</span>
                     </template>
                   </el-table-column>
@@ -101,28 +103,27 @@
         <el-row v-if="conditionBoxs.length">
           <el-form label-width="120px" :inline="false" size="mini">
             <el-row>
-              <el-form-item label="配置比例设置"> </el-form-item>
+              <el-form-item label="配置比例设置" />
             </el-row>
             <el-col :xs="24" :sm="8" :lg="8">
               <el-form-item label="限定机型">
-                <el-input size="mini" v-model="limit" :readonly="!id ? false : true"></el-input>
+                <el-input v-model="limit" size="mini" :readonly="!id ? false : true" />
               </el-form-item>
             </el-col>
 
-            <el-col :xs="24" :sm="8" :lg="8" v-for="(len, index) in conditionBoxs.length - 1">
+            <el-col v-for="(len, index) in conditionBoxs.length - 1" :xs="24" :sm="8" :lg="8">
               <el-form-item :label="'配提' + (index + 1) + '比例'">
-                <el-input size="mini" :readonly="!id ? false : true" v-model="popArr['line_' + index]"></el-input>
+                <el-input v-model="popArr['line_' + index]" size="mini" :readonly="!id ? false : true" />
               </el-form-item>
             </el-col>
           </el-form>
-          <el-col class="text_rihgt" v-if="false">
-            <el-button type="primary" size="mini" @click="">添加限定条件</el-button></el-col
-          >
+          <el-col v-if="false" class="text_rihgt">
+            <el-button type="primary" size="mini" @click="">添加限定条件</el-button></el-col>
         </el-row>
-        <el-divider></el-divider>
+        <el-divider />
       </el-row>
     </el-main>
-    <el-footer height="100px" v-if="!id">
+    <el-footer v-if="!id" height="100px">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="12" :offset="0">
           <el-button type="primary" size="mini" @click="handleSubmit">保存</el-button>
@@ -138,8 +139,8 @@
       append-to-body
       width="80%"
       center
-      @close="handleClose"
       :close-on-click-modal="false"
+      @close="handleClose"
     >
       <div>
         <el-container>
@@ -147,7 +148,7 @@
             <el-form label-width="0" :inline="false" size="mini">
               <el-col :xs="24" :sm="10" :lg="10" :offset="0">
                 <el-form-item label="">
-                  <el-input v-model="saleTypeCode" placeholder="类型编号"></el-input>
+                  <el-input v-model="saleTypeCode" placeholder="类型编号" />
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :sm="10" :lg="10" :offset="1">
@@ -162,7 +163,7 @@
               <el-row :gutter="50">
                 <el-col :xs="10" :ms="10" :lg="10">
                   <el-row>
-                    <el-row> </el-row>
+                    <el-row />
                     <el-row class="table">
                       <el-row class="title"> 可选产品列表 </el-row>
                       <el-table
@@ -174,8 +175,7 @@
                         @select-all="handleSelectionAllChange"
                         @selection-change="handleSelectionChange"
                       >
-                        <el-table-column type="selection" width="55" :selectable="selectable" align="left">
-                        </el-table-column>
+                        <el-table-column type="selection" width="55" :selectable="selectable" align="left" />
                         <el-table-column
                           label="产品编码"
                           prop="materialNumber"
@@ -184,7 +184,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialNumber" />
+                            <CopyButton :copy-text="scope.row.materialNumber" />
                             <span>{{ scope.row.materialNumber }}</span>
                           </template>
                         </el-table-column>
@@ -196,7 +196,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialName" />
+                            <CopyButton :copy-text="scope.row.materialName" />
                             <span>{{ scope.row.materialName }}</span>
                           </template>
                         </el-table-column>
@@ -208,7 +208,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.specification" />
+                            <CopyButton :copy-text="scope.row.specification" />
                             <span>{{ scope.row.specification }}</span>
                           </template>
                         </el-table-column>
@@ -218,19 +218,18 @@
                           min-width="160"
                           show-overflow-tooltip
                           align="right"
-                        >
-                        </el-table-column>
+                        />
                       </el-table>
                       <el-row class="mg">
                         <div>
                           <el-pagination
-                            @size-change="handleSizeChange"
-                            @current-change="handleCurrentChange"
                             :current-page="currentPage"
                             :page-size.sync="mySize"
                             :page-sizes="[10, 20, 30, 50]"
                             layout="total, sizes, prev, pager, next, jumper"
                             :total="listTotal"
+                            @size-change="handleSizeChange"
+                            @current-change="handleCurrentChange"
                           />
                         </div>
                       </el-row>
@@ -240,39 +239,47 @@
                 <el-col :xs="4" :ms="4" :lg="4" class="middle">
                   <el-row :gutter="20" justify="center" align="middle">
                     <el-row class="btn">
-                      <el-button type="primary" size="small " @click="handleAllAdd" :disabled="type == 2"
-                        >全部添加</el-button
-                      >
+                      <el-button
+                        type="primary"
+                        size="small "
+                        :disabled="type == 2"
+                        @click="handleAllAdd"
+                      >全部添加</el-button>
                     </el-row>
                     <el-row class="btn">
-                      <el-button type="primary" size="small " @click="handleAdd" :disabled="type == 2">增加</el-button>
+                      <el-button type="primary" size="small " :disabled="type == 2" @click="handleAdd">增加</el-button>
                     </el-row>
                     <el-row class="btn">
-                      <el-button type="primary" size="small " @click="handleDelete" :disabled="type == 1"
-                        >删除</el-button
-                      ></el-row
-                    >
-                    <el-row class="btn"
-                      ><el-button :disabled="type == 1" type="primary" size="small  " @click="handleAllDelete"
-                        >全部删除</el-button
-                      ></el-row
-                    >
+                      <el-button
+                        type="primary"
+                        size="small "
+                        :disabled="type == 1"
+                        @click="handleDelete"
+                      >删除</el-button></el-row>
+                    <el-row
+                      class="btn"
+                    ><el-button
+                      :disabled="type == 1"
+                      type="primary"
+                      size="small  "
+                      @click="handleAllDelete"
+                    >全部删除</el-button></el-row>
                   </el-row>
                 </el-col>
                 <el-col :xs="10" :ms="10" :lg="10">
                   <el-row>
-                    <el-row> </el-row>
+                    <el-row />
                     <el-row class="table">
                       <el-row class="title"> 已选产品列表 </el-row>
                       <el-table
                         style="width: 100%"
                         :data="conditList2"
-                        @select-all="handleSelectionAllChange2"
-                        @selection-change="handleSelectionChange2"
                         border
                         height="400"
+                        @select-all="handleSelectionAllChange2"
+                        @selection-change="handleSelectionChange2"
                       >
-                        <el-table-column type="selection" width="55" align="left"> </el-table-column>
+                        <el-table-column type="selection" width="55" align="left" />
                         <el-table-column
                           label="产品编码"
                           prop="materialNumber"
@@ -281,7 +288,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialNumber" />
+                            <CopyButton :copy-text="scope.row.materialNumber" />
                             <span>{{ scope.row.materialNumber }}</span>
                           </template>
                         </el-table-column>
@@ -293,7 +300,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialName" />
+                            <CopyButton :copy-text="scope.row.materialName" />
                             <span>{{ scope.row.materialName }}</span>
                           </template>
                         </el-table-column>
@@ -305,7 +312,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.specification" />
+                            <CopyButton :copy-text="scope.row.specification" />
                             <span>{{ scope.row.specification }}</span>
                           </template>
                         </el-table-column>
@@ -315,8 +322,7 @@
                           min-width="160"
                           show-overflow-tooltip
                           align="right"
-                        >
-                        </el-table-column>
+                        />
                       </el-table>
                       <el-row class="mg">
                         <!-- <Pagination /> -->
@@ -335,8 +341,7 @@
             VisibleModle = false
             handleClose()
           "
-          >取 消</el-button
-        >
+        >取 消</el-button>
         <el-button type="primary" @click="handleDiaSubmit">确 定</el-button>
       </span>
     </el-dialog>
@@ -367,36 +372,25 @@ export default {
       type: String,
       default: ''
     },
-    isShow:{
+    isShow: {
       type: Number,
+      default: null
     },
-    isFlag:{
-      type: [Number,String],
-    },
-    isEdit:{
-      type: [Number,String],
-    },
-    isCondition:{
-      type: [Number,String],
+    isFlag: {
+      type: [Number, String],
+      default: null
     },
-    code:{
-      type: [Number,String],
+    isEdit: {
+      type: [Number, String],
+      default: null
     },
-  },
-  watch: {
-    conditList: {
-      handler(newValue, oldValue) {
-        this.conditList = newValue
-      },
-      immediate: true,
-      deep: true
+    isCondition: {
+      type: [Number, String],
+      default: null
     },
-    conditList2: {
-      handler(newValue, oldValue) {
-        this.conditList2 = newValue
-      },
-      immediate: true,
-      deep: true
+    code: {
+      type: [Number, String],
+      default: null
     }
   },
 
@@ -448,6 +442,22 @@ export default {
       listLoadingArr: {}
     }
   },
+  watch: {
+    conditList: {
+      handler(newValue, oldValue) {
+        this.conditList = newValue
+      },
+      immediate: true,
+      deep: true
+    },
+    conditList2: {
+      handler(newValue, oldValue) {
+        this.conditList2 = newValue
+      },
+      immediate: true,
+      deep: true
+    }
+  },
   created() {
     this.getCommonApi()
   },
@@ -457,7 +467,7 @@ export default {
     content() {
       const textArr = ['新增条件', '编辑条件', '条件详情']
       const isShow = this.isShow - 2
-      let len = isShow ? 2 : isShow
+      const len = isShow ? 2 : isShow
       return textArr[len]
     }
   }),
@@ -479,7 +489,7 @@ export default {
      * @param {String} index - 索引值
      * @return Boolean
      */
-    selectable: function (row, index) {
+    selectable: function(row, index) {
       // row.disabled == undefined 才能被选中
       if (row.disabled == undefined) {
         return true
@@ -492,19 +502,15 @@ export default {
       if (id) {
         this.id = id
       }
-
-      console.log(555, policyId)
       if (this.id || policyId) {
         if (policyId) {
           this.edit = 'eidt'
         }
-        console.log(this.policyId, policyId, this.id)
         const res = await getConditionMaterialDetail({
           id: this.policyId || policyId || this.id
         })
-        console.log()
         this.pop = res.data.pop
-        let pop = res.data.pop.split(':')
+        const pop = res.data.pop.split(':')
         this.conditionBox = []
         for (let i = 0; i < pop.length; i++) {
           if (i == 0) {
@@ -523,6 +529,8 @@ export default {
             policyConditionId: res.data.id,
             popType: k + 1
           })
+          console.log(data.records, 'kanakn', policyId)
+
           if (policyId) {
             this.conditionBox.push(data.records)
           } else {
@@ -530,6 +538,12 @@ export default {
           }
           this.listLoadingArr[`listLoading${k}`] = false
         }
+        // if (this.conditionBox.length) {
+        //   for (let i = 0; i < this.conditionBox.length; i++) {
+        //     this.newConditionBox = [...this.newConditionBox, ...this.conditionBox[i]]
+        //   }
+        // }
+        // console.log( this.newConditionBox,' 999');
       }
     },
     toggleSelection(rows) {
@@ -582,8 +596,8 @@ export default {
         this.limit = ''
         this.pop = ''
         this.popArr = {}
-        this.isFlag = 1
-        // Object.assign(this.$data, this.$options.data());
+        // this.isFlag = 1
+        Object.assign(this.$data, this.$options.data())
         this.$emit('back')
         this.$emit('handleSubmitCon', this.code || this.comCode)
       })
@@ -642,7 +656,7 @@ export default {
         for (let j = 0; j < this.conditionBox.length; j++) {
           datas = [...datas, ...this.conditionBox[j]]
         }
-
+        console.log(datas, 'bianji');
         /**
          * @value newConditionBox 首页保存的所有选中者,即条件1
          * @value res.data.records,this.conditList 每次点击添加获取的最新数据
@@ -656,12 +670,11 @@ export default {
               for (let m = 0; m < this.newConditionBox[n].length; m++) {
                 if (m == index) {
                   this.$set(this.newConditionBox[n], m, [...this.conditionBox[index], ...this.newConditionBox[n][m]])
-                  console.log(this.newConditionBox, 'newenewnwn')
                 }
               }
             }
           }
-
+          console.log('编辑——————————')
           for (let j = 0; j < this.newConditionBox.length; j++) {
             for (let o = 0; o < this.newConditionBox[j].length; o++) {
               if (o == index) {
@@ -679,10 +692,15 @@ export default {
           }
           this.conditList = res.data.records
         } else {
+          console.log('新增——————————',datas,res.data.records)
+
           const newData = datas
           if (newData.length) {
             for (let i = 0; i < res.data.records.length; i++) {
               for (let k = 0; k < newData.length; k++) {
+                if (newData[k].policyMaterialId == res.data.records[i].id) {
+                  res.data.records[i].disabled = true
+                }
                 if (newData[k].id == res.data.records[i].id) {
                   res.data.records[i].disabled = true
                 }
@@ -723,7 +741,7 @@ export default {
       this.conditList2 = [...new Set([...this.conditList2, ...this.leftData])]
       this.$refs.multipleTable.clearSelection()
     },
-    //去掉相同数据
+    // 去掉相同数据
     resArr(arr1, arr2) {
       return arr1.filter(v => arr2.every(val => val.id != v.id))
     },

+ 84 - 30
src/views/sales_policy/components/AddPolicy.vue

@@ -5,7 +5,7 @@
         <div class="screen-container">
           <h4>销售政策信息</h4>
           <el-divider />
-          <el-form ref="form" :model="searchForm" label-width="120px" size="mini" class="demo-searchForm">
+          <el-form ref="form" :model="searchForm" label-width="160px" size="mini" class="demo-searchForm">
             <el-row>
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="销售政策编号">
@@ -62,8 +62,7 @@
                     placeholder="生效日期"
                     default-time="00:00:00"
                     value-format="yyyy-MM-dd HH:mm:ss"
-                  /> </el-form-item
-              ></el-col>
+                  /> </el-form-item></el-col>
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="失效日期" prop="endTime">
                   <el-date-picker
@@ -72,13 +71,25 @@
                     placeholder="失效日期"
                     default-time="00:00:00"
                     value-format="yyyy-MM-dd HH:mm:ss"
-                  /> </el-form-item
-              ></el-col>
+                  /> </el-form-item></el-col>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="表头备注" prop="remark">
                   <el-input v-model="searchForm.remark" placeholder="新风机变频挂机。按提货数量1:3开单" />
                 </el-form-item>
               </el-col>
+              <template v-if="searchForm.type === 'LIMIT'">
+
+                <el-col :xs="24" :ms="12" :lg="12">
+                  <el-form-item label="商家最少起提数量" prop="minBuyNum">
+                    <el-input v-model="searchForm.minBuyNum" type="number" placeholder="商家最少起提数量" />
+                  </el-form-item>
+                </el-col>
+                <el-col :xs="24" :ms="12" :lg="12">
+                  <el-form-item label="商家最大提货组数" prop="maxBuyNum">
+                    <el-input v-model="searchForm.maxBuyNum" type="number" placeholder="商家最大提货组数" />
+                  </el-form-item>
+                </el-col>
+              </template>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="政策封面图">
                   <ImageUpload class="elImageClose" :file-list="fileList" multiple :limit="3" />
@@ -117,10 +128,10 @@
             :data="dataList"
             row-key="index"
             use-virtual
-            fixedColumnsRoll
-            :dataChangesScrollTop="false"
+            fixed-columns-roll
+            :data-changes-scroll-top="false"
             inverse-current-row
-            bigDataCheckbox
+            big-data-checkbox
             element-loading-text="Loading"
             max-height="700"
             border
@@ -247,13 +258,21 @@
                 <template v-if="scope.row.fang">
                   {{ scope.row.priceType }}
                 </template>
-                <el-input
+                <el-select
                   v-else
                   v-model="scope.row.priceType"
-                  placeholder="价格类型"
                   size="mini"
+                  filterable
                   @change="setText($event, scope.$index, scope.row, 'priceType')"
-                />
+                  @focus="handlePriceType(scope.row)"
+                >
+                  <el-option
+                    v-for="item in priceList"
+                    :key="item.priceTypeId"
+                    :label="item.priceTypeName"
+                    :value="item.priceTypeId"
+                  />
+                </el-select>
               </template>
             </pl-table-column>
             <pl-table-column prop="price" label="单价" align="right" show-overflow-tooltip min-width="150">
@@ -341,9 +360,11 @@
             </pl-table-column>
             <pl-table-column fixed="right" label="操作" align="center" min-width="150">
               <template slot-scope="scope">
-                <el-button type="text" class="textColor el-popover-left" @click="scope.row.fang = !scope.row.fang"
-                  >编辑</el-button
-                >
+                <el-button
+                  type="text"
+                  class="textColor el-popover-left"
+                  @click="scope.row.fang = !scope.row.fang"
+                >编辑</el-button>
                 <el-popconfirm
                   confirm-button-text="好的"
                   cancel-button-text="不用了"
@@ -383,7 +404,7 @@
           <div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
             <div>
               <el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
-              <el-button type="primary" size="mini" @click="handleSave" v-loading="fullscreenLoading">保存</el-button>
+              <el-button v-loading="fullscreenLoading" type="primary" size="mini" @click="handleSave">保存</el-button>
             </div>
             <!--            <el-pagination-->
             <!--              :current-page="dcurrentPage"-->
@@ -401,8 +422,7 @@
             <el-row type="flex">
               <el-col :span="12">
                 <h4 style="display: inline-block; margin-right: 20px">条件信息</h4>
-                <el-button type="primary" size="mini" @click="isCondition = 1">添加</el-button></el-col
-              >
+                <el-button type="primary" size="mini" @click="isCondition = 1">添加</el-button></el-col>
             </el-row>
             <el-divider />
           </el-row>
@@ -428,8 +448,7 @@
                     scope.row.fang = false
                     conditName = scope.row.name
                   "
-                  >编辑</el-button
-                >
+                >编辑</el-button>
                 <el-button type="text" size="mini" @click="handleCondition(scope.row.id, scope.$index)">删除</el-button>
               </template>
             </el-table-column>
@@ -448,6 +467,7 @@
           <TabelTransfer
             v-if="searchForm.code"
             :code="searchForm.code"
+            :policy-type="searchForm.type"
             @handlEditPolicy="handleAddPolicy"
             @handleReset="handleReset"
           />
@@ -455,7 +475,7 @@
         </div>
       </div>
     </div>
-    <AddCondition v-show="isCondition == 1" :code="searchForm.code" @handleSubmitCon="handleSubmitCon" @back="handleBack"  :isShow="isShow" :isFlag="isFlag" :isCondition="isCondition"/>
+    <AddCondition v-show="isCondition == 1" ref="condition" :code="searchForm.code" :is-show="isShow" :is-flag="isFlag" :is-condition="isCondition" @handleSubmitCon="handleSubmitCon" @back="handleBack" />
   </div>
 </template>
 
@@ -476,13 +496,13 @@ import {
   setStauts,
   updateCondition
 } from '@/api/policy_list'
+import { getPriceSalesRelaListV2 } from '@/api/priceType'
 import { downloadFiles, handleImport } from '@/utils/util'
 // import Transfer from './Transfer'
 import TabelTransfer from './TabelTransfer'
 import AddCondition from './AddCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
 import { PlTable, PlTableColumn } from 'pl-table'
-import { nextTick } from 'process'
 
 export default {
   directives: {
@@ -490,7 +510,7 @@ export default {
       bind(el, binding) {
         // 获取element-ui定义好的scroll盒⼦
         const SELECTWRAP_DOM = el.querySelector('.el-table__body-wrapper')
-        SELECTWRAP_DOM.addEventListener('scroll', function () {
+        SELECTWRAP_DOM.addEventListener('scroll', function() {
           /**
            * scrollHeight 获取元素内容⾼度(只读)
            * scrollTop 获取或者设置元素的偏移值,常⽤于, 计算滚动条的位置, 当⼀个元素的容器没有产⽣垂直⽅向的滚动条, 那它的scrollTop的值默认为0.
@@ -506,8 +526,8 @@ export default {
       }
     }
   },
-  props: ['isShow','isFlag'],
   mixins: [Minxin],
+  props: ['isShow', 'isFlag'],
   data() {
     return {
       fang: false,
@@ -523,9 +543,11 @@ export default {
         title: '',
         mainId: '',
         mainName: '',
-        type: '',
+        type: 'PROVISION',
         isFullRebate: false,
-        commercialType: false
+        commercialType: false,
+        maxBuyNum: 0,
+        minBuyNum: 0
       },
       dataList: [],
       addList: [],
@@ -558,7 +580,8 @@ export default {
       dpageSize: 10,
       dcurrentPage: 1,
       rebateList: [],
-      fullscreenLoading: false
+      fullscreenLoading: false,
+      priceList: []
     }
   },
   computed: {
@@ -586,6 +609,11 @@ export default {
       })
     },
     setText(e, index, row, name) {
+      if (name === 'priceType') {
+        console.log(e, this.priceList.find(k => k.priceTypeId === e).priceTypeName)
+        this.dataList[index][name] = this.priceList.find(k => k.priceTypeId === e).priceTypeName
+        return
+      }
       this.dataList[index][name] = row[name]
     },
     // 下载excel模板
@@ -600,7 +628,10 @@ export default {
     handleCondition(id, index) {
       deleteCondition({ id }).then(res => {
         this.conditionList.splice(index, 1)
-        Object.assign(this.$children[9].$data, this.$children[9].$options.data())
+        this.$nextTick(() => {
+          Object.assign(this.$children[8].$data, this.$children[9].$options.data())
+        })
+        this.$refs
         this.$successMsg('删除成功')
       })
     },
@@ -710,6 +741,8 @@ export default {
 
       this.$set(row, 'saleTypeCode', item.saleCode)
       this.$set(row, 'saleTypeName', item.saleName)
+      this.$set(row, 'priceType', '')
+      this.priceList = []
       // this.$set(row,'saleTypeId',item.id)
     },
     // 修改条件名称
@@ -867,7 +900,7 @@ export default {
           })
         }
 
-        let imgUrl = []
+        const imgUrl = []
         this.fileList.forEach(k => {
           imgUrl.push(k.url)
         })
@@ -1006,9 +1039,30 @@ export default {
       Object.assign(this.$data, this.$options.data())
       this.getCommonApi()
     },
-    handleBack(){
-      this.isCondition = 0 
+    handleBack() {
+      this.isCondition = 0
+      // this.isFlag = 1
       this.$emit('upDataIsFlag')
+    },
+    getPriceSalesRelaListV2(val) {
+      getPriceSalesRelaListV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            'param': 'b.sale_code',
+            'compare': 'like',
+            'value': val
+          }
+        ]
+      }).then(res => {
+        this.priceList = res.data.records
+      })
+    },
+    handlePriceType(e) {
+      if (e.saleTypeCode) {
+        this.getPriceSalesRelaListV2(e.saleTypeCode)
+      }
     }
   },
   components: {

+ 401 - 245
src/views/sales_policy/components/Examine.vue

@@ -84,6 +84,20 @@
                 />
               </div>
             </el-col>
+            <template v-if="detail.type === 'LIMIT'">
+              <el-col :span="12" class="item">
+                <div class="label">商家最少起提数量</div>
+                <div class="value">
+                  {{ detail.minBuyNum }}
+                </div>
+              </el-col>
+              <el-col :span="12" class="item">
+                <div class="label">商家最大提货组数</div>
+                <div class="value">
+                  {{ detail.maxBuyNum }}
+                </div>
+              </el-col>
+            </template>
           </el-row>
 
           <el-row v-if="detail.imgSrc" class="img-box">
@@ -100,9 +114,9 @@
                     :preview-src-list="[$imageUrl + item]"
                     class="elImageClose"
                   />
-                  <img v-if="checkFileType(item) == 'word'" class="file" src="@/assets/common/word.png" />
-                  <img v-if="checkFileType(item) == 'excel'" class="file" src="@/assets/common/excel.png" />
-                  <img v-if="checkFileType(item) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
+                  <img v-if="checkFileType(item) == 'word'" class="file" src="@/assets/common/word.png">
+                  <img v-if="checkFileType(item) == 'excel'" class="file" src="@/assets/common/excel.png">
+                  <img v-if="checkFileType(item) == 'ppt'" class="file" src="@/assets/common/ppt.png">
 
                   <img
                     v-if="checkFileType(item) == 'pdf'"
@@ -110,9 +124,9 @@
                     style="cursor: pointer"
                     src="@/assets/common/pdf.png"
                     @click="openPdf(item)"
-                  />
+                  >
 
-                  <img v-if="checkFileType(item) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg" />
+                  <img v-if="checkFileType(item) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
                 </template>
               </div>
             </el-col>
@@ -176,79 +190,81 @@
             </el-row>
             <el-divider />
           </el-row>
-          <el-table
-            v-loading="listLoading"
-            :data="dataList"
-            element-loading-text="Loading"
-            border
-            max-height="700"
-            fit
-            highlight-current-row
-            stripe
-          >
-            <el-table-column fixed type="index" label="序号" width="50" align="left" />
-            <el-table-column prop="materialNumber" label="物料编码" min-width="160" show-overflow-tooltip align="left">
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.materialNumber" />
-                <span>{{ scope.row.materialNumber }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="materialName" label="产品名称" min-width="160" show-overflow-tooltip align="left">
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.materialName" />
-                <span>{{ scope.row.materialName }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="specification" label="规格型号" min-width="300" show-overflow-tooltip align="left">
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.specification" />
-                <span>{{ scope.row.specification }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              prop="saleTypeCode"
-              label="销售类型编码"
-              min-width="160"
-              show-overflow-tooltip
-              align="left"
-            />
-            <el-table-column prop="saleTypeName" label="销售类型" min-width="160" show-overflow-tooltip align="left" />
-            <el-table-column prop="discAmount" label="格力折扣" align="right" />
-            <el-table-column prop="price" label="单价" align="right" />
-            <el-table-column prop="orgPrice" label="原供价" align="right" min-width="150">
-              <template slot-scope="scope">
-                {{ scope.row.orgPrice }}
-              </template>
-            </el-table-column>
-            <el-table-column prop="priceType" label="价格类型" align="left" min-width="150">
-              <template slot-scope="scope">
-                {{ scope.row.priceType }}
-              </template>
-            </el-table-column>
-            <el-table-column label="返利钱包" align="left" min-width="200" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <template v-for="item in scope.row.walletRelaList">
-                  <el-tag v-if="item.type === 'REBATE'" style="margin: 5px" type="success" size="small">{{
-                    item.walletName
-                  }}</el-tag>
+          <div class="table">
+            <el-table
+              v-loading="listLoading"
+              :data="dataList"
+              element-loading-text="Loading"
+              border
+              max-height="700"
+              fit
+              highlight-current-row
+              stripe
+            >
+              <el-table-column fixed type="index" label="序号" width="50" align="left" />
+              <el-table-column prop="materialNumber" label="物料编码" min-width="160" show-overflow-tooltip align="left">
+                <template slot-scope="scope">
+                  <CopyButton :copy-text="scope.row.materialNumber" />
+                  <span>{{ scope.row.materialNumber }}</span>
                 </template>
-              </template>
-            </el-table-column>
-            <el-table-column label="现金钱包" align="left" min-width="200" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <template v-for="item in scope.row.walletRelaList">
-                  <el-tag v-if="item.type === 'COMMONLY'" style="margin: 5px" type="success" size="small">{{
-                    item.walletName
-                  }}</el-tag>
+              </el-table-column>
+              <el-table-column prop="materialName" label="产品名称" min-width="160" show-overflow-tooltip align="left">
+                <template slot-scope="scope">
+                  <CopyButton :copy-text="scope.row.materialName" />
+                  <span>{{ scope.row.materialName }}</span>
                 </template>
-              </template>
-            </el-table-column>
-            <el-table-column prop="status" label="状态" align="left" show-overflow-tooltip min-width="150">
-              <template slot-scope="scope">
-                {{ scope.row.status ? '启用' : '作废' }}
-              </template>
-            </el-table-column>
-          </el-table>
+              </el-table-column>
+              <el-table-column prop="specification" label="规格型号" min-width="300" show-overflow-tooltip align="left">
+                <template slot-scope="scope">
+                  <CopyButton :copy-text="scope.row.specification" />
+                  <span>{{ scope.row.specification }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="saleTypeCode"
+                label="销售类型编码"
+                min-width="160"
+                show-overflow-tooltip
+                align="left"
+              />
+              <el-table-column prop="saleTypeName" label="销售类型" min-width="160" show-overflow-tooltip align="left" />
+              <el-table-column prop="discAmount" label="格力折扣" align="right" />
+              <el-table-column prop="price" label="单价" align="right" />
+              <el-table-column prop="orgPrice" label="原供价" align="right" min-width="150">
+                <template slot-scope="scope">
+                  {{ scope.row.orgPrice }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="priceType" label="价格类型" align="left" min-width="150">
+                <template slot-scope="scope">
+                  {{ scope.row.priceType }}
+                </template>
+              </el-table-column>
+              <el-table-column label="返利钱包" align="left" min-width="200" show-overflow-tooltip>
+                <template slot-scope="scope">
+                  <template v-for="item in scope.row.walletRelaList">
+                    <el-tag v-if="item.type === 'REBATE'" style="margin: 5px" type="success" size="small">{{
+                      item.walletName
+                    }}</el-tag>
+                  </template>
+                </template>
+              </el-table-column>
+              <el-table-column label="现金钱包" align="left" min-width="200" show-overflow-tooltip>
+                <template slot-scope="scope">
+                  <template v-for="item in scope.row.walletRelaList">
+                    <el-tag v-if="item.type === 'COMMONLY'" style="margin: 5px" type="success" size="small">{{
+                      item.walletName
+                    }}</el-tag>
+                  </template>
+                </template>
+              </el-table-column>
+              <el-table-column prop="status" label="状态" align="left" show-overflow-tooltip min-width="150">
+                <template slot-scope="scope">
+                  {{ scope.row.status ? '启用' : '作废' }}
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
           <!-- 分页 -->
           <div style="margin: 20px 0">
             <el-pagination
@@ -325,8 +341,7 @@
                   <template slot-scope="scope">
                     <CopyButton :copy-text="scope.row.customerNumber" />
                     <span>{{ scope.row.customerNumber }}</span>
-                  </template></el-table-column
-                >
+                  </template></el-table-column>
                 <el-table-column prop="customerName" label="经销商名称" align="left">
                   <template slot-scope="scope">
                     <CopyButton :copy-text="scope.row.customerName" />
@@ -353,32 +368,33 @@
               <el-col :span="10" :offset="0">
                 <h5>未选经销商</h5>
                 <el-divider direction="horizontal" content-position="left" />
-
-                <el-table
-                  ref="multipleTable"
-                  :data="dataL"
-                  element-loading-text="Loading"
-                  border
-                  height="480px"
-                  fit
-                  highlight-current-row
-                  @select-all="handleSelectionAllChange"
-                  @selection-change="handleSelectionChange"
-                >
-                  <el-table-column type="selection" width="55" :selectable="selectable" align="left" />
-                  <el-table-column prop="number" label="经销商编码" align="left">
-                    <template slot-scope="scope">
-                      <CopyButton :copy-text="scope.row.number" />
-                      <span>{{ scope.row.number }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column prop="name" label="经销商名称" align="left">
-                    <template slot-scope="scope">
-                      <CopyButton :copy-text="scope.row.name" />
-                      <span>{{ scope.row.name }}</span>
-                    </template>
-                  </el-table-column>
-                </el-table>
+                <div class="table">
+                  <el-table
+                    ref="multipleTable"
+                    :data="dataL"
+                    element-loading-text="Loading"
+                    border
+                    height="480px"
+                    fit
+                    highlight-current-row
+                    @select-all="handleSelectionAllChange"
+                    @selection-change="handleSelectionChange"
+                  >
+                    <el-table-column type="selection" width="55" :selectable="selectable" align="left" />
+                    <el-table-column prop="number" label="经销商编码" align="left">
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.number" />
+                        <span>{{ scope.row.number }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="name" label="经销商名称" align="left">
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.name" />
+                        <span>{{ scope.row.name }}</span>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </div>
                 <!-- 分页 -->
                 <div style="margin: 20px 0">
                   <el-pagination
@@ -394,57 +410,45 @@
               </el-col>
               <el-col :span="4" class="middle_box" :offset="0">
                 <el-col>
-                  <el-button size="small" :disabled="type == 2" @click="handleAllAdd">全部添加</el-button></el-col
-                >
+                  <el-button size="small" :disabled="type == 2" @click="handleAllAdd">全部添加</el-button></el-col>
                 <el-col> <el-button size="small" :disabled="type == 2" @click="handleAdd">增加</el-button></el-col>
                 <el-col> <el-button size="small" :disabled="type == 1" @click="handleDelete">删除</el-button></el-col>
                 <el-col>
-                  <el-button size="small" :disabled="type == 1" @click="handleAllDelete">全部删除</el-button></el-col
-                >
+                  <el-button size="small" :disabled="type == 1" @click="handleAllDelete">全部删除</el-button></el-col>
               </el-col>
               <el-col :span="10" :offset="0">
                 <h5>已选经销商</h5>
                 <el-divider direction="horizontal" content-position="left" />
 
-                <el-table
-                  v-loading="listLoading"
-                  :data="custoList"
-                  element-loading-text="Loading"
-                  border
-                  height="480px"
-                  fit
-                  highlight-current-row
-                  stripe
-                  @select-all="handleSelectionAllChange2"
-                  @selection-change="handleSelectionChange2"
-                >
-                  <el-table-column type="selection" width="55" align="left" />
-                  <el-table-column prop="customerNumber" label="经销商编码" align="left">
-                    <template slot-scope="scope">
-                      <CopyButton :copy-text="scope.row.customerNumber" />
-                      <span>{{ scope.row.customerNumber }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column prop="customerName" label="经销商名称" align="left">
-                    <template slot-scope="scope">
-                      <CopyButton :copy-text="scope.row.customerName" />
-                      <span>{{ scope.row.customerName }}</span>
-                    </template>
-                  </el-table-column>
-                </el-table>
-                <!-- 分页 -->
-                <!-- <div style="margin: 20px 0">
-                  <el-pagination
-                    @size-change="handleSizeChanges"
-                    @current-change="handleCurrentChanges"
-                    :current-page="currentPages"
-                    :page-sizes="[10, 20, 30, 50]"
-                    :page-size="10"
-                    layout="total, sizes, prev, pager, next, jumper"
-                    :total="clistTotals"
+                <div class="table">
+                  <el-table
+                    v-loading="listLoading"
+                    :data="custoList"
+                    element-loading-text="Loading"
+                    border
+                    height="480px"
+                    fit
+                    highlight-current-row
+                    stripe
+                    @select-all="handleSelectionAllChange2"
+                    @selection-change="handleSelectionChange2"
                   >
-                  </el-pagination>
-                </div> -->
+                    <el-table-column type="selection" width="55" align="left" />
+                    <el-table-column prop="customerNumber" label="经销商编码" align="left">
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.customerNumber" />
+                        <span>{{ scope.row.customerNumber }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="customerName" label="经销商名称" align="left">
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.customerName" />
+                        <span>{{ scope.row.customerName }}</span>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </div>
+
               </el-col>
             </el-row>
           </template>
@@ -452,83 +456,64 @@
             <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
             <el-divider />
           </div>
-          <div>
-            <div class="table">
-              <el-table
-                v-loading="clistLoading"
-                :data="list"
-                element-loading-text="Loading"
-                border
-                fit
-                highlight-current-row
-                stripe
-                @select-all="handleSelectionAllChange2"
-                @selection-change="handleSelectionChange2"
-              >
-                <!-- <el-table-column type="selection" width="55" align="left" /> -->
-                <el-table-column
-                  prop="customerNumber"
-                  label="经销商编号
-"
-                  align="left"
-                >
-                  <template slot-scope="scope">
-                    <CopyButton :copy-text="scope.row.customerNumber" />
-                    <span>{{ scope.row.customerNumber }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column prop="customerName" label="经销商名称" align="left">
-                  <template slot-scope="scope">
-                    <CopyButton :copy-text="scope.row.customerName" />
-                    <span>{{ scope.row.customerName }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  prop="materialName"
-                  label="物料名称
-
+          <div class="table">
+            <el-table
+              v-if="detail.type == 'PROVISION'"
+              v-loading="clistLoading"
+              :data="list"
+              element-loading-text="Loading"
+              border
+              fit
+              highlight-current-row
+              stripe
+              @select-all="handleSelectionAllChange2"
+              @selection-change="handleSelectionChange2"
+            >
+              <el-table-column type="index" width="50" />
+              <el-table-column
+                prop="customerNumber"
+                label="经销商编号
 "
-                  align="left"
-                >
-                  <template slot-scope="scope">
-                    <CopyButton :copy-text="scope.row.materialName" />
-                    <span>{{ scope.row.materialName }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  prop="materialNumber"
-                  label="物料编号
-"
-                  align="left"
-                >
-                  <template slot-scope="scope">
-                    <CopyButton :copy-text="scope.row.materialNumber" />
-                    <span>{{ scope.row.materialNumber }}</span>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  prop="examineOrderNums"
-                  label="已审订单数
-"
-                  align="left"
-                >
-                  <template slot-scope="scope">
-                    {{ scope.row.examineOrderNums | numToFixed }}
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  prop="limitQty"
-                  label="购买量上限
-
-"
-                  align="left"
-                >
-                  <template slot-scope="scope">
-                    {{ scope.row.limitQty | numToFixed }}
-                  </template>
-                </el-table-column>
-              </el-table>
-            </div>
+                align="left"
+                min-width="300"
+              >
+                <template slot-scope="scope">
+                  <CopyButton :copy-text="scope.row.customerNumber" />
+                  <span>{{ scope.row.customerNumber }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
+                <template slot-scope="scope">
+                  <CopyButton :copy-text="scope.row.customerName" />
+                  <span>{{ scope.row.customerName }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="materialName" label="物料名称" align="left" min-width="200">
+                <template slot-scope="scope">
+                  {{ scope.row.materialName }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="materialNumber" label="物料编号" align="left" min-width="200">
+                <template slot-scope="scope">
+                  {{ scope.row.materialNumber }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="limitQty" label="订货上限" align="left" min-width="200">
+                <template slot-scope="scope">
+                  {{ scope.row.limitQty }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="orderNums" label="已下订单数" align="left" min-width="200">
+                <template slot-scope="scope">
+                  {{ scope.row.orderNums }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="examineOrderNums" label="已审订单数" align="left" min-width="200">
+                <template slot-scope="scope">
+                  {{ scope.row.examineOrderNums }}
+                </template>
+              </el-table-column>
+            </el-table>
             <!-- 分页 -->
             <div style="margin: 20px 0">
               <el-pagination
@@ -541,6 +526,114 @@
                 @current-change="handleCurrentChanges4"
               />
             </div>
+            <div>
+              <div>
+                <h4 style="display: inline-block; margin-right: 20px"> 经销商提货上限</h4>
+                <el-divider />
+              </div>
+              <div style="margin: 20px 0">
+                <!-- <el-upload
+                  class="import-btn cus-btn"
+                  :action="baseURL + 'policy/limit/group/import'"
+                  :http-request="handleImportPolicyLimitGroupPolicy"
+                  :file-list="importFileList"
+                  :show-file-list="false"
+                >
+                  <el-button type="primary" size="mini">导入经销商配提套数</el-button>
+                </el-upload> -->
+                <!-- <ExportButton
+                  style="display: inline-block;margin-right: 10px;"
+                  :ex-url="'policy/limit/group/export'"
+                  ex-text="导出经销商配提套数"
+                  :ex-params="{ policyId: detail.code }"
+                />
+                <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy">下载模板</el-button> -->
+              </div>
+              <!-- <el-row style="margin: 20px 0">
+                <el-col :span="12">
+                  <el-input v-model="policyKeyWord" placeholder="查找经销商" size="mini" />
+                </el-col>
+                <el-col :span="10" style="margin-left: 20px">
+                  <el-button size="mini" @click="getPolicyLimitGroupList">确定</el-button>
+                  <el-button size="mini" @click="onPolicyReset">重置</el-button>
+                </el-col>
+              </el-row> -->
+              <div>
+                <div class="table">
+                  <el-table
+                    v-loading="policyLoading"
+                    :data="policyLimitGroupList"
+                    element-loading-text="Loading"
+                    border
+                    fit
+                    highlight-current-row
+                    stripe
+                  >
+                    <el-table-column type="index" width="50" />
+                    <el-table-column
+                      prop="customerNumber"
+                      label="经销商编号
+"
+                      align="left"
+                      min-width="300"
+                    >
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.customerNumber" />
+                        <span>{{ scope.row.customerNumber }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.customerName" />
+                        <span>{{ scope.row.customerName }}</span>
+                      </template>
+                    </el-table-column>
+
+                    <template v-if="detail.type == 'LIMIT'">
+                      <el-table-column prop="minBuyNum" label="最小提货数量" align="left" min-width="200">
+                        <template slot-scope="scope">
+                          {{ scope.row.minBuyNum }}
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="maxBuyNum" label="最大提货组数" align="left" min-width="200">
+                        <template slot-scope="scope">
+                          {{ scope.row.maxBuyNum }}
+                        </template>
+                      </el-table-column>
+                    </template>
+                    <template v-else>
+                      <el-table-column prop="groupLimitNum" label="配提上限组数" align="left" min-width="200">
+                        <template slot-scope="scope">
+                          {{ scope.row.groupLimitNum }}
+                        </template>
+                      </el-table-column>
+                    </template>
+                    <!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
+                      <template slot-scope="scope">
+                        {{ scope.row.orderNums }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="examineOrderNums" label="配提上限已审订单数" align="left" width="200">
+                      <template slot-scope="scope">
+                        {{ scope.row.examineOrderNums }}
+                      </template>
+                    </el-table-column> -->
+                  </el-table>
+                </div>
+                <!-- 分页 -->
+                <div style="margin: 20px 0">
+                  <el-pagination
+                    :current-page="policyCurrentPages"
+                    :page-sizes="[10, 20, 30, 50]"
+                    :page-size="10"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="policyListTotal"
+                    @size-change="handlePolicySizeChanges"
+                    @current-change="handlePolicyCurrentChanges"
+                  />
+                </div>
+              </div>
+            </div>
           </div>
           <div v-if="isShow == 5 && detail.examineStatus == 'WAIT'" class="descriptions diy-table-1">
             <el-row>
@@ -569,7 +662,7 @@
         </div>
       </div>
     </div>
-    <AddCondition v-else :id="cid" @close="handleConditionClose" @back="handleBack" :isEdit="isEdit" />
+    <AddCondition v-else :id="cid" :is-edit="isEdit" @close="handleConditionClose" @back="handleBack" />
   </div>
 </template>
 
@@ -584,17 +677,22 @@ import {
   getPolicyDetail,
   toExamine,
   updatePolicy,
-  getPolicyList
+  getPolicyList,
+  getPolicyLimitGroupList
 } from '@/api/policy_list'
 import AddCondition from './AddCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
-
-import { handleImport } from '@/utils/util'
+import { downloadFiles, handleImport } from '@/utils/util'
 
 import Minxin from '@/mixin'
 
 export default {
   name: 'Examine',
+  components: {
+    AddCondition,
+    ImageUpload
+  },
+  mixins: [Minxin],
   props: {
     id: {
       type: String,
@@ -604,11 +702,6 @@ export default {
       type: Number
     }
   },
-  components: {
-    AddCondition,
-    ImageUpload
-  },
-  mixins: [Minxin],
   data() {
     return {
       baseURL: '',
@@ -678,7 +771,13 @@ export default {
       },
       list: [],
       cTotal: 1,
-      clistLoading: false
+      clistLoading: false,
+      policyLimitGroupList: [],
+      policyLoading: false,
+      policyCurrentPages: 1,
+      policyPageSize: 10,
+      policyListTotal: 0,
+      policyKeyWord: ''
     }
   },
   computed: {
@@ -721,6 +820,7 @@ export default {
         this.getConditionList()
         this.getCond()
         this.getPolicyList()
+        this.getPolicyLimitGroupList()
       })
     },
     getPolicyList() {
@@ -765,9 +865,9 @@ export default {
         }
         this.dataL = res.data.records
         for (let k = 0; k < this.dataL.length; k++) {
-          ;(this.dataL[k].customerId = this.dataL[k].id),
-            (this.dataL[k].customerName = this.dataL[k].name),
-            (this.dataL[k].customerNumber = this.dataL[k].number)
+          (this.dataL[k].customerId = this.dataL[k].id),
+          (this.dataL[k].customerName = this.dataL[k].name),
+          (this.dataL[k].customerNumber = this.dataL[k].number)
         }
 
         console.log(this.dataL, '获取经销商列表')
@@ -777,8 +877,13 @@ export default {
     // 更改每页数量
     handleSizeChanges(val) {
       this.pageSizes = val
-      this.currentPages = 1
-      this.getCond()
+      this.currentPage = 1
+      this.getCrList()
+    },
+    // 更改当前页
+    handleCurrentChanges(val) {
+      this.currentPage = val
+      this.getCrList()
     },
     handleBack() {
       this.isEdit = 1
@@ -807,11 +912,7 @@ export default {
     openPdf(pdfUrl) {
       window.open(this.$imageUrl + pdfUrl)
     },
-    // 更改当前页
-    handleCurrentChanges(val) {
-      this.currentPages = val
-      this.getCond()
-    },
+
     // 更改每页数量
     handleSizeChange2(val) {
       this.dpageSize = val
@@ -831,8 +932,8 @@ export default {
     getCond() {
       this.listLoading = true
       const custoParams = {
-        pageNum: this.currentPages,
-        pageSize: this.pageSizes,
+        pageNum: 1,
+        pageSize: -1,
         policyId: this.detail.code
       }
       getCustomerList(custoParams).then(res => {
@@ -929,7 +1030,7 @@ export default {
      * @param {String} index - 索引值
      * @return Boolean
      */
-    selectable: function (row, index) {
+    selectable: function(row, index) {
       // row.disabled == undefined 才能被选中
       if (row.disabled == undefined || row.disabled == false) {
         return true
@@ -1054,6 +1155,61 @@ export default {
         this.fileList = []
         this.isShow = 1
       }
+    },
+    getPolicyLimitGroupList() {
+      this.policyLoading = true
+      getPolicyLimitGroupList({
+        pageNum: this.policyCurrentPages,
+        pageSize: this.policyPageSize,
+        policyId: this.id,
+        keyword: this.policyKeyWord
+      }).then(res => {
+        this.policyLimitGroupList = res.data.records
+        this.policyListTotal = res.data.total
+        this.policyLoading = false
+      })
+    },
+    handlePolicySizeChanges(val) {
+      this.policyCurrentPages = 1
+      this.policyPageSize = val
+      this.getPolicyLimitGroupList()
+    },
+    onPolicyReset() {
+      this.policyCurrentPages = 1
+      this.policyPageSize = 10
+      this.policyKeyWord = ''
+      this.getPolicyLimitGroupList()
+    },
+    handlePolicyCurrentChanges(val) {
+      this.policyCurrentPages = val
+      this.getPolicyLimitGroupList()
+    },
+    hanleDownloadFilesPolicyLimitGroupPolicy() {
+      downloadFiles('policy/limit/group/download')
+    },
+    async handleImportPolicyLimitGroupPolicy(param) {
+      this.importLoading = true
+      const file = param.file
+      const formData = new FormData()
+      formData.append('file', file)
+      formData.append('policyId', this.id)
+      // formData.append('type', this.policyType)
+
+      // formData.append("mainId", this.searchForm.mainId);
+      const result = await handleImport('policy/limit/group/import', formData)
+      this.importLoading = false
+      this.importFileList = []
+      if (result.code === 200) {
+        await this.$alert(result.message, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        // this.policyLimitGroupList = result.data
+        this.getPolicyLimitGroupList()
+      } else {
+        await this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
+      }
     }
   }
 }

+ 114 - 0
src/views/sales_policy/components/OperationRecords.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <h4>操作记录</h4>
+    <div class="table">
+      <zj-table
+        :loading="loading"
+        :table-attributes="tableAttributes"
+        :is-drop="true"
+        :columns="columns"
+        :table-data="tableData"
+      />
+    </div>
+    <!-- 分页 -->
+    <div style="margin: 20px 0">
+      <el-pagination
+        :current-page="currentPages"
+        :page-sizes="[10, 20, 30, 50]"
+        :page-size="10"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="listTotal"
+        @size-change="handleSizeChanges"
+        @current-change="handleCurrentChanges"
+      />
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { commonLogList } from '@/api/common'
+export default {
+  props: {
+    policyId: {
+      type: String,
+      default: null
+    }
+  },
+  data() {
+    return {
+      tableAttributes: {
+        height: '100%'
+      },
+      tableData: [],
+      listTotal: 0,
+      currentPages: 1, // 当前页码
+      pageSizes: 10, // 每页数量
+      loading: false
+    }
+  },
+  computed: {
+    columns() {
+      return [{
+        columnAttributes: {
+          label: '帐号',
+          prop: 'userName'
+        }
+      },
+      {
+        columnAttributes: {
+          label: '操作内容',
+          prop: 'content'
+        }
+      },
+      {
+        columnAttributes: {
+          label: 'ip',
+          prop: 'ip'
+        }
+      },
+      {
+        columnAttributes: {
+          label: '模块名称',
+          prop: 'moduleName'
+        }
+      }]
+    }
+  },
+  mounted() {
+    this.getCommonLogList()
+  },
+  methods: {
+    getCommonLogList() {
+      this.loading = true
+      commonLogList({
+        objId: this.policyId,
+        pageNum: this.currentPages,
+        pageSize: this.pageSizes
+      }).then(res => {
+        this.tableData = res.data.records
+        this.listTotal = res.data.total
+        this.loading = false
+      })
+    },
+    // 更改每页数量
+    handleSizeChanges(val) {
+      this.pageSizes = val
+      this.currentPages = 1
+      this.getCommonLogList()
+    },
+    // 更改当前页
+    handleCurrentChanges(val) {
+      this.currentPages = val
+      this.getCommonLogList()
+    }
+  }
+
+}
+</script>
+
+<style lang="scss" scoped>
+.table{
+  height: 600px;
+}
+</style>

+ 567 - 151
src/views/sales_policy/components/TabelTransfer.vue

@@ -1,47 +1,52 @@
 <template>
   <div class="mymain-container">
+    <!-- 经销商信息 -->
     <slot name="header">
       <el-row class="radio">
         <el-radio-group v-model="region">
           <el-radio label="0">指定经销商</el-radio>
           <el-radio
-            label="1"
             v-if="!adminWebsit || !adminWebsit.websitNumber || (adminWebsit && adminWebsit.websitNumber === 'GZ')"
-            >广州经销商</el-radio
-          >
+            label="1"
+          >广州经销商</el-radio>
           <el-radio
-            label="2"
             v-if="!adminWebsit || !adminWebsit.websitNumber || (adminWebsit && adminWebsit.websitNumber === 'FS')"
-            >佛山经销商</el-radio
-          >
+            label="2"
+          >佛山经销商</el-radio>
         </el-radio-group>
-        <template  v-if="region == 0">
+        <template v-if="region == 0">
           <el-upload
-           class="import-btn"
-          :action="baseURL + 'student/import'"
-          :http-request="handleImport"
-          :file-list="importFileList"
-          :show-file-list="false"
-        >
-          <el-button type="primary" size="mini">导入经销商</el-button>
-        </el-upload>
-        <el-button  type="primary" size="mini" @click="hanleDownloadFiles">下载模板</el-button>
+            class="import-btn"
+            :action="baseURL + 'student/import'"
+            :http-request="handleImport"
+            :file-list="importFileList"
+            :show-file-list="false"
+          >
+            <el-button type="primary" size="mini">导入经销商</el-button>
+          </el-upload>
+          <el-button type="primary" size="mini" @click="hanleDownloadFiles">下载模板</el-button>
         </template>
       </el-row>
-      <el-row type="flex" v-if="region == 0">
+      <el-row v-if="region == 0" type="flex">
         <el-col :xs="24" :sm="12" :lg="14">
           <el-input v-model="keyword" placeholder="查找经销商" size="mini" />
         </el-col>
-        <el-col :xs="24" :sm="1" :lg="1" style="margin-left: 10px"
-          ><el-button size="mini" @click="submitScreenForm">确定</el-button></el-col
-        >
-        <el-col :xs="24" :sm="1" :lg="1" style="margin-left: 20px"
-          ><el-button size="mini" @click="resetScreenForm">重置</el-button></el-col
-        >
+        <el-col
+          :xs="24"
+          :sm="1"
+          :lg="1"
+          style="margin-left: 10px"
+        ><el-button size="mini" @click="submitScreenForm">确定</el-button></el-col>
+        <el-col
+          :xs="24"
+          :sm="1"
+          :lg="1"
+          style="margin-left: 20px"
+        ><el-button size="mini" @click="resetScreenForm">重置</el-button></el-col>
       </el-row>
     </slot>
-    <el-row :gutter="20" v-if="region == 0">
-      <el-col :span="10" :offset="0" >
+    <el-row v-if="region == 0" :gutter="20">
+      <el-col :span="10" :offset="0">
         <h5>未选经销商</h5>
         <el-divider direction="horizontal" content-position="left" />
         <div class="table">
@@ -62,12 +67,15 @@
             <!--            label="经销商编码"-->
             <!--            align="left"-->
             <!--          />-->
-            <el-table-column prop="name" label="经销商名称" align="left"
-              ><template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.name" />
-                <span>{{ scope.row.name }}</span>
-                <span class="red">{{scope.row.number}}</span>
-              </template>
+            <el-table-column
+              prop="name"
+              label="经销商名称"
+              align="left"
+            ><template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.name" />
+              <span>{{ scope.row.name }}</span>
+              <span class="red">{{ scope.row.number }}</span>
+            </template>
             </el-table-column>
           </el-table>
         </div>
@@ -116,133 +124,255 @@
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.customerName" />
                 <span>{{ scope.row.customerName }}</span>
-                <span class="red">{{scope.row.customerNumber}}</span>
+                <span class="red">{{ scope.row.customerNumber }}</span>
               </template>
             </el-table-column>
           </el-table>
         </div>
       </el-col>
     </el-row>
+    <!-- 销售政策类型 ———— 限量-->
     <div>
-      <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
 
-      <el-divider />
-    </div>
-    <div style="margin: 20px 0">
-      <el-upload
-        class="import-btn cus-btn"
-        :action="baseURL + 'student/import'"
-        :http-request="handleImports"
-        :file-list="importFileList"
-        :show-file-list="false"
-      >
-        <el-button type="primary" size="mini">导入经销商</el-button>
-      </el-upload>
-      <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicy">下载模板</el-button>
-    </div>
-    <el-row type="flex" style="margin: 20px 0" >
-      <el-col :xs="24" :sm="12" :lg="14">
-        <el-input v-model="keyword2" placeholder="查找经销商" size="mini" />
-      </el-col>
-      <el-col :xs="24" :sm="1" :lg="1" style="margin-left: 10px"
-        ><el-button size="mini" @click="submitScreenForm2">确定</el-button></el-col
-      >
-      <el-col :xs="24" :sm="1" :lg="1" style="margin-left: 20px"
-        ><el-button size="mini" @click="resetScreenForm2">重置</el-button></el-col
-      >
-    </el-row>
-    <div >
-      <div class="table">
-        <el-table
-          v-loading="clistLoading"
-          :data="list"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-          @select-all="handleSelectionAllChange2"
-          @selection-change="handleSelectionChange2"
-        >
-          <!-- <el-table-column type="selection" width="55" align="left" /> -->
-          <el-table-column
-            prop="customerNumber"
-            label="经销商编号
-"
-            align="left"
+      <div>
+        <div>
+          <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
+          <el-divider />
+        </div>
+        <div style="margin: 20px 0">
+          <el-upload
+            class="import-btn cus-btn"
+            :action="baseURL + 'student/import'"
+            :http-request="handleImports"
+            :file-list="importFileList"
+            :show-file-list="false"
           >
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.customerNumber" />
-              <span>{{ scope.row.customerNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="customerName" label="经销商名称" align="left">
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="materialName"
-            label="物料名称
+            <el-button type="primary" size="mini">导入经销商</el-button>
+          </el-upload>
+          <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicy">下载模板</el-button>
+        </div>
+        <el-row style="margin: 20px 0">
+          <el-col :span="12">
+            <el-input v-model="keyword2" placeholder="查找经销商" size="mini" />
+          </el-col>
+          <el-col :span="10" style="margin-left: 20px">
+            <el-button size="mini" @click="submitScreenForm2">确定</el-button>
+            <el-button size="mini" @click="resetScreenForm2">重置</el-button>
+            <template v-if="batch">
+              <!-- <el-button
+                v-if="list.length"
+                type="primary"
+                size="mini"
+                @click="()=>{
+                  visible = true
+                  handelBatchData()
+                }"
+              >批量修改上限</el-button> -->
 
-"
-            align="left"
-          >
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.materialName" />
-              <span>{{ scope.row.materialName }}</span>
+              <!-- <el-button
+                v-if="list.length"
+                type="primary"
+                size="mini"
+                @click="()=>{
+                  maxBuyNumVisible = true
+                  handelBatchData()
+                }"
+              >批量修改组数</el-button> -->
             </template>
-          </el-table-column>
-          <el-table-column
-            prop="materialNumber"
-            label="物料编号
-"
-            align="left"
+          </el-col>
+        </el-row>
+      </div>
+      <div>
+        <div class="table">
+          <el-table
+            v-loading="clistLoading"
+            :data="list"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            @select-all="handleSelectionAllChange2"
+            @selection-change="handleSelectionChange2"
           >
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.materialNumber" />
-              <span>{{ scope.row.materialNumber }}</span>
-            </template>
-          </el-table-column>
-
-          <el-table-column
-            prop="examineOrderNums"
-            label="已审订单数
+            <el-table-column type="index" width="50" />
+            <el-table-column
+              prop="customerNumber"
+              label="经销商编号
 "
-            align="left"
+              align="left"
+              min-width="300"
+            >
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerNumber" />
+                <span>{{ scope.row.customerNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
+              <template slot-scope="scope">
+                <CopyButton :copy-text="scope.row.customerName" />
+                <span>{{ scope.row.customerName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="materialName" label="物料名称" align="left" min-width="200">
+              <template slot-scope="scope">
+                {{ scope.row.materialName }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="materialNumber" label="物料编号" align="left" min-width="200">
+              <template slot-scope="scope">
+                {{ scope.row.materialNumber }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="limitQty" label="订货上限" align="left" min-width="200">
+              <template slot-scope="scope">
+                {{ scope.row.limitQty }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="orderNums" label="已下订单数" align="left" min-width="200">
+              <template slot-scope="scope">
+                {{ scope.row.orderNums }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="examineOrderNums" label="已审订单数" align="left" min-width="200">
+              <template slot-scope="scope">
+                {{ scope.row.examineOrderNums }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <!-- 分页 -->
+        <div style="margin: 20px 0">
+          <el-pagination
+            :current-page="policyList.currentPages"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="cTotal"
+            @size-change="handleSizeChanges2"
+            @current-change="handleCurrentChanges2"
+          />
+        </div>
+      </div>
+      <div>
+        <div>
+          <h4 style="display: inline-block; margin-right: 20px"> 经销商提货上限</h4>
+          <el-divider />
+        </div>
+        <div style="margin: 20px 0">
+          <el-upload
+            class="import-btn cus-btn"
+            :action="baseURL + 'policy/limit/group/import'"
+            :http-request="handleImportPolicyLimitGroupPolicy"
+            :file-list="importFileList"
+            :show-file-list="false"
           >
-            <template slot-scope="scope">
-              {{ scope.row.examineOrderNums | numToFixed }}
-            </template>
-          </el-table-column>
-
-          <el-table-column
-            prop="limitQty"
-            label="购买量上限
-
+            <el-button type="primary" size="mini">导入经销商配提套数</el-button>
+          </el-upload>
+          <ExportButton
+            style="display: inline-block;margin-right: 10px;"
+            :ex-url="'policy/limit/group/export'"
+            ex-text="导出经销商配提套数"
+            :ex-params="{ policyId: comCode || code }"
+          />
+          <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy">下载模板</el-button>
+          <!-- <el-button
+            v-if="policyLimitGroupList.length"
+            type="primary"
+            size="mini"
+            @click="()=>{
+              limitGroupvisible = true
+              handelLimitGroupData()
+            }"
+          >批量修改配提套数上限</el-button> -->
+        </div>
+        <el-row style="margin: 20px 0">
+          <el-col :span="12">
+            <el-input v-model="policyKeyWord" placeholder="查找经销商" size="mini" />
+          </el-col>
+          <el-col :span="10" style="margin-left: 20px">
+            <el-button size="mini" @click="getPolicyLimitGroupList">确定</el-button>
+            <el-button size="mini" @click="onPolicyReset">重置</el-button>
+          </el-col>
+        </el-row>
+        <div>
+          <div class="table">
+            <el-table
+              v-loading="policyLoading"
+              :data="policyLimitGroupList"
+              element-loading-text="Loading"
+              border
+              fit
+              highlight-current-row
+              stripe
+            >
+              <el-table-column type="index" width="50" />
+              <el-table-column
+                prop="customerNumber"
+                label="经销商编号
 "
-            align="left"
-          >
-            <template slot-scope="scope">
-              {{ scope.row.limitQty | numToFixed }}
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div style="margin: 20px 0">
-        <el-pagination
-          :current-page="policyList.currentPages"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="cTotal"
-          @size-change="handleSizeChanges2"
-          @current-change="handleCurrentChanges2"
-        />
+                align="left"
+                min-width="300"
+              >
+                <template slot-scope="scope">
+                  <CopyButton :copy-text="scope.row.customerNumber" />
+                  <span>{{ scope.row.customerNumber }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
+                <template slot-scope="scope">
+                  <CopyButton :copy-text="scope.row.customerName" />
+                  <span>{{ scope.row.customerName }}</span>
+                </template>
+              </el-table-column>
+
+              <template v-if="policyType == 'LIMIT'">
+                <el-table-column prop="minBuyNum" label="最小提货数量" align="left" min-width="200">
+                  <template slot-scope="scope">
+                    {{ scope.row.minBuyNum }}
+                  </template>
+                </el-table-column>
+                <el-table-column prop="maxBuyNum" label="最大提货组数" align="left" min-width="200">
+                  <template slot-scope="scope">
+                    {{ scope.row.maxBuyNum }}
+                  </template>
+                </el-table-column>
+              </template>
+              <template v-else>
+                <el-table-column prop="groupLimitNum" label="配提上限组数" align="left" min-width="200">
+                  <template slot-scope="scope">
+                    {{ scope.row.groupLimitNum }}
+                  </template>
+                </el-table-column>
+              </template>
+              <!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left">
+                <template slot-scope="scope">
+                  {{ scope.row.orderNums }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="examineOrderNums" label="配提上限已审订单数" align="left">
+                <template slot-scope="scope">
+                  {{ scope.row.examineOrderNums }}
+                </template>
+              </el-table-column> -->
+            </el-table>
+          </div>
+          <!-- 分页 -->
+          <div style="margin: 20px 0">
+            <el-pagination
+              :current-page="policyCurrentPages"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="policyListTotal"
+              @size-change="handlePolicySizeChanges"
+              @current-change="handlePolicyCurrentChanges"
+            />
+          </div>
+        </div>
       </div>
     </div>
+    <!-- 操作按钮 -->
     <slot name="footer">
       <el-row style="margin: 20px 0 0 0">
         <el-button type="primary" size="mini" @click="handleSave">
@@ -261,7 +391,10 @@ import {
   getConditionList,
   getCrList,
   getCustomerList,
-  getPolicyList
+  getPolicyList,
+  updateLimitGrouppdate,
+  updateLimitBatchupdate,
+  getPolicyLimitGroupList
 } from '@/api/policy_list'
 import { downloadFiles, handleImport } from '@/utils/util'
 import ImageUpload from '@/components/Common/image-upload.vue'
@@ -270,11 +403,12 @@ import Minxin from '@/mixin'
 export default {
   name: 'Examine',
   components: {
+    // eslint-disable-next-line vue/no-unused-components
     ImageUpload
   },
   mixins: [Minxin],
   // eslint-disable-next-line vue/require-prop-types
-  props: ['code', 'yregion'],
+  props: ['code', 'yregion', 'policyType', 'batch'],
   data() {
     return {
       keyword: '',
@@ -344,12 +478,88 @@ export default {
       },
       list: [],
       cTotal: 1,
-      clistLoading: false
+      clistLoading: false,
+      visible: false,
+      maxBuyNumVisible: false,
+      tableData: [],
+      tableAttributes: {
+        selectColumn: true
+      },
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      limitQty: null,
+      maxBuyNum: null,
+      limitQtyKeyWord: '',
+      maxBuyNumKeyWord: '',
+      selectedData: [],
+      batchCurrentPages: 1,
+      batchPageSizes: 10,
+      batchTotal: 0,
+      policyLimitGroupList: [],
+      policyLoading: false,
+      policyCurrentPages: 1,
+      policyPageSize: 10,
+      policyListTotal: 0,
+      policyKeyWord: '',
+      limitGroupvisible: false,
+      limitGroupNum: 0,
+      limitGroupKeyWord: '',
+      limitCurrentPages: 1,
+      limitTotal: 0,
+      limitPageSizes: 10,
+      limitTableData: [],
+      buyNumvisible: false,
+      minBuyNum: null
     }
   },
   computed: {
     adminWebsit() {
       return JSON.parse(localStorage.getItem('supply_user')).adminWebsit
+    },
+    columns() {
+      return [
+        {
+          columnAttributes: {
+            label: '经销商编码',
+            prop: 'customerNumber'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '经销商名称',
+            prop: 'customerName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料名称',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料编号',
+            prop: 'materialNumber'
+          }
+        }
+      ]
+    },
+    limitColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '经销商编码',
+            prop: 'customerNumber'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '经销商名称',
+            prop: 'customerName'
+          }
+        }
+      ]
     }
   },
   watch: {
@@ -366,6 +576,7 @@ export default {
 
       this.getCond()
       this.getPolicyList()
+      this.getPolicyLimitGroupList()
     }
   },
 
@@ -395,9 +606,9 @@ export default {
         }
         this.dataL = res.data.records
         for (let k = 0; k < this.dataL.length; k++) {
-          ;(this.dataL[k].customerId = this.dataL[k].id),
-            (this.dataL[k].customerName = this.dataL[k].name),
-            (this.dataL[k].customerNumber = this.dataL[k].number)
+          (this.dataL[k].customerId = this.dataL[k].id),
+          (this.dataL[k].customerName = this.dataL[k].name),
+          (this.dataL[k].customerNumber = this.dataL[k].number)
         }
         this.clistTotal = res.data.total
       })
@@ -504,6 +715,8 @@ export default {
       formData.append('file', file)
 
       formData.append('policyId', this.comCode || this.code)
+      formData.append('type', this.policyType)
+
       // formData.append("mainId", this.searchForm.mainId);
       const result = await handleImport('policy/limit/import', formData)
       console.log(result)
@@ -529,7 +742,7 @@ export default {
       downloadFiles('policy/limit/download')
     },
     getCommonApi(row) {
-      ;(this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId)
+      (this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId)
       console.log(this.cpolicyId, this.comCode, this.cpolicyId === this.comCode)
     },
     getCond() {
@@ -575,7 +788,7 @@ export default {
      * @param {String} index - 索引值
      * @return Boolean
      */
-    selectable: function (row, index) {
+    selectable: function(row, index) {
       // row.disabled == undefined 才能被选中
       if (row.disabled === undefined || row.disabled === false) {
         return true
@@ -679,6 +892,210 @@ export default {
       this.dataR = this.rightData = []
       this.keyword = ''
       this.$emit('handleReset')
+    },
+    selectionChange(data) {
+      this.selectedData = data
+    },
+    handelBatchData(search) {
+      if (search) {
+        this.batchCurrentPages = 1
+      }
+      getPolicyList({
+        pageNum: this.batchCurrentPages,
+        pageSize: this.batchPageSizes,
+        policyId: this.comCode || this.code,
+        keyword: this.limitQtyKeyWord
+      }).then(res => {
+        this.tableData = res.data.records
+        this.batchTotal = res.data.total
+      })
+    },
+    handleDialogVisible() {
+      this.visible = false
+      this.buyNumvisible = false
+      this.maxBuyNumVisible = false
+      this.batchCurrentPages = 1
+      this.batchPageSizes = 10
+      this.limitQty = 0
+      this.maxBuyNum = null
+      this.minBuyNum = 0
+      this.limitQtyKeyWord = ''
+      this.maxBuyNumKeyWord = ''
+    },
+    onSubmit(e, type) {
+      console.log(type)
+      if (!this.selectedData.length) {
+        this.$errorMsg('不能为空,请选择')
+        return
+      }
+      let params = {}
+
+      const customerIds = this.selectedData
+        .map(k => {
+          return k.customerId
+        })
+        .join(',')
+      const ids = this.selectedData
+        .map(k => {
+          return k.id
+        })
+        .join(',')
+      if (type) {
+        if (this.limitQty <= 0) {
+          this.$errorMsg('购买量上限不能小于0')
+          return
+        }
+        params = {
+          customerIds,
+          ids,
+          limitQty: this.limitQty
+        }
+      } else {
+        if (this.minBuyNum <= 0 || !this.minBuyNum) {
+          this.$errorMsg('最小提货数量不能小于0')
+          return
+        }
+        params = {
+          customerIds,
+          ids,
+          minBuyNum: this.minBuyNum,
+          maxBuyNum: this.maxBuyNum
+        }
+      }
+      updateLimitBatchupdate(params).then(res => {
+        this.handleDialogVisible()
+        this.getPolicyList()
+        this.$successMsg('批量修改成功')
+      })
+    },
+    handleBatchSizeChanges(val) {
+      this.batchCurrentPages = 1
+      this.batchPageSizes = val
+      this.handelBatchData()
+    },
+    onReset() {
+      this.limitQtyKeyWord = ''
+      this.maxBuyNumKeyWord = ''
+      this.handelBatchData()
+    },
+    handleBatchCurrentChanges(val) {
+      this.batchCurrentPages = val
+      this.handelBatchData()
+    },
+    getPolicyLimitGroupList() {
+      this.policyLoading = true
+      getPolicyLimitGroupList({
+        pageNum: this.policyCurrentPages,
+        pageSize: this.policyPageSize,
+        policyId: this.comCode || this.code,
+        keyword: this.policyKeyWord
+      }).then(res => {
+        this.policyLimitGroupList = res.data.records
+        this.policyListTotal = res.data.total
+        this.policyLoading = false
+      })
+    },
+    handlePolicySizeChanges(val) {
+      this.policyCurrentPages = 1
+      this.policyPageSize = val
+      this.getPolicyLimitGroupList()
+    },
+    onPolicyReset() {
+      this.policyCurrentPages = 1
+      this.policyPageSize = 10
+      this.policyKeyWord = ''
+      this.getPolicyLimitGroupList()
+    },
+    handlePolicyCurrentChanges(val) {
+      this.policyCurrentPages = val
+      this.getPolicyLimitGroupList()
+    },
+    hanleDownloadFilesPolicyLimitGroupPolicy() {
+      downloadFiles('policy/limit/group/download')
+    },
+    async handleImportPolicyLimitGroupPolicy(param) {
+      this.importLoading = true
+      const file = param.file
+      const formData = new FormData()
+      formData.append('file', file)
+      formData.append('policyId', this.comCode || this.code)
+      // formData.append('type', this.policyType)
+
+      // formData.append("mainId", this.searchForm.mainId);
+      const result = await handleImport('policy/limit/group/import', formData)
+      this.importLoading = false
+      this.importFileList = []
+      if (result.code === 200) {
+        await this.$alert(result.message, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        // this.policyLimitGroupList = result.data
+        this.getPolicyLimitGroupList()
+      } else {
+        await this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
+      }
+    },
+    handelLimitGroupData(search) {
+      if (search) {
+        this.limitCurrentPages = 1
+      }
+      this.limitGroupvisible = true
+      getPolicyLimitGroupList({
+        pageNum: this.limitCurrentPages,
+        pageSize: this.limitPageSizes,
+        policyId: this.comCode || this.code,
+        keyword: this.limitGroupKeyWord
+      }).then(res => {
+        this.limitTableData = res.data.records
+        this.limitTotal = res.data.total
+      })
+    },
+    onLimitSubmit(type) {
+      if (!this.selectedData.length) {
+        this.$errorMsg('不能为空,请选择')
+        return
+      }
+      if (this.limitGroupNum <= 0) {
+        this.$errorMsg('配提套数上限不能小于0')
+        return
+      }
+      const ids = this.selectedData
+        .map(k => {
+          return k.id
+        })
+        .join(',')
+      const params = {
+        ids,
+        limitGroupNum: this.limitGroupNum
+      }
+      updateLimitGrouppdate(params).then(res => {
+        this.handleLimitDialogVisible()
+        this.$successMsg('批量修改成功')
+        this.getPolicyLimitGroupList()
+      })
+    },
+    handleLimitSizeChanges(val) {
+      this.limitCurrentPages = 1
+      this.limitPageSizes = val
+      this.handelLimitGroupData()
+    },
+    handleLimitCurrentChanges(val) {
+      this.limitCurrentPages = val
+      this.handelLimitGroupData()
+    },
+    onLimitReset() {
+      this.limitGroupKeyWord = ''
+      this.handelLimitGroupData()
+    },
+    handleLimitDialogVisible() {
+      this.limitGroupvisible = false
+      this.limitGroupNum = 0
+      this.limitGroupKeyWord = ''
+      this.limitCurrentPages = 1
+      this.limitTotal = 0
+      this.limitPageSizes = 10
     }
   }
 }
@@ -747,8 +1164,7 @@ export default {
   display: flex;
   align-items: center;
 }
-.red{
-
+.red {
   color: #f00;
 }
 </style>

+ 164 - 0
src/views/sales_policy/components/delayRecordForm.vue

@@ -0,0 +1,164 @@
+<template>
+  <div>
+    <div>
+      <h4>政策延期</h4>
+      <el-divider />
+      <zj-table
+        :table-attributes="tableAttributes"
+        :is-drop="true"
+        :columns="columns"
+        :table-data="tableData"
+      />
+    </div>
+    <div style="margin: 20px 0;text-align: right;">
+      <el-button type="primary" size="mini" @click="onClose">取消</el-button>
+      <el-button type="primary" size="mini" @click="onSubmit">确定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { updateDelayPolicy } from '@/api/policy_list'
+export default {
+  props: {
+    recordSelected: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      tableData: [],
+      tableAttributes: {}
+    }
+  },
+  computed: {
+    columns() {
+      return [
+        {
+          columnAttributes: {
+            label: '销售政策编码',
+            prop: 'code'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '销售政策名称',
+            prop: 'title'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '销售政策类型',
+            prop: 'type'
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div>
+                {row.type === 'PROVISION' ? '配提' : '限量'}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '生效日期',
+            prop: 'startTime'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '失效日期',
+            prop: 'endTime'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '延期日期',
+            prop: 'materialName'
+          },
+          render: (h, { column, row, index }) => {
+            return <div style='margin:0 10px'>
+              <el-date-picker
+                style='width:100%'
+                value={row.date}
+                onInput={e => { row.date = e }}
+                type='datetime'
+                size='mini'
+                default-time='00:00:00'
+                picker-options={ this.setDisabled(row.startTime) }
+                value-format='yyyy-MM-dd HH:mm:ss'
+                placeholder='选择日期'>
+              </el-date-picker>
+            </div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作',
+            prop: ''
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div>
+                <el-button
+                  type='text'
+                  size='default'
+                  onClick={() => {
+                    this.tableData.splice(index, 1)
+                  }}
+                >
+                      删除
+                </el-button>
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  mounted() {
+    this.recordSelected.forEach(k => {
+      this.$set(k, 'date', '')
+    })
+    this.tableData = this.recordSelected
+  },
+  methods: {
+    setDisabled(e) {
+      return {
+        disabledDate: time => {
+          return time.getTime() < new Date(e).getTime() + 24 * 3600 * 1000
+        }
+      }
+    },
+    onSubmit() {
+      if (!this.tableData.every(k => !!k.endTime)) {
+        this.$errorMsg('政策没有失效时间不能延迟')
+        return
+      }
+      if (!this.tableData.every(k => !!k.date)) {
+        this.$errorMsg('请选择日期时间')
+        return
+      }
+      const list = this.tableData.map(k => {
+        return {
+          endTime: k.date,
+          policyId: k.id
+        }
+      })
+      updateDelayPolicy(list).then(res => {
+        this.$successMsg('批量修改成功')
+        this.onClose()
+      })
+    },
+    onClose() {
+      this.$emit('close')
+    }
+  }
+}
+</script>
+
+  <style lang="scss" scoped>
+
+  </style>
+

+ 650 - 93
src/views/sales_policy/components/details.vue

@@ -61,7 +61,22 @@
                 {{ detail.endTime }}
               </div>
             </el-col>
+            <template v-if="detail.type === 'LIMIT'">
+              <el-col :span="12" class="item">
+                <div class="label">商家最少起提数量</div>
+                <div class="value">
+                  {{ detail.minBuyNum }}
+                </div>
+              </el-col>
+              <el-col :span="12" class="item">
+                <div class="label">商家最大提货组数</div>
+                <div class="value">
+                  {{ detail.maxBuyNum }}
+                </div>
+              </el-col>
+            </template>
           </el-row>
+
           <el-row v-if="detail.imgSrc && isShow !== 5" class="img-box">
             <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
@@ -76,9 +91,9 @@
                     :preview-src-list="[$imageUrl + item]"
                     class="elImageClose"
                   />
-                  <img v-if="checkFileType(item) == 'word'" class="file" src="@/assets/common/word.png" />
-                  <img v-if="checkFileType(item) == 'excel'" class="file" src="@/assets/common/excel.png" />
-                  <img v-if="checkFileType(item) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
+                  <img v-if="checkFileType(item) == 'word'" class="file" src="@/assets/common/word.png">
+                  <img v-if="checkFileType(item) == 'excel'" class="file" src="@/assets/common/excel.png">
+                  <img v-if="checkFileType(item) == 'ppt'" class="file" src="@/assets/common/ppt.png">
 
                   <img
                     v-if="checkFileType(item) == 'pdf'"
@@ -86,9 +101,9 @@
                     style="cursor: pointer"
                     src="@/assets/common/pdf.png"
                     @click="openPdf(item)"
-                  />
+                  >
 
-                  <img v-if="checkFileType(item) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg" />
+                  <img v-if="checkFileType(item) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
                 </template>
                 <!-- <el-image
                   v-for="item in detail.imgSrc"
@@ -104,7 +119,7 @@
             <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
-                <ImageUpload :file-list="fileList" :multiple="false" />
+                <image-upload :file-list="fileList" :multiple="false" />
               </div>
             </el-col>
           </el-row>
@@ -169,9 +184,7 @@
                   <el-button size="mini">导入货品价格表</el-button>
                 </el-upload>
               </el-col>
-              <el-col :span="12" class="tr">
-
-              </el-col>
+              <el-col :span="12" class="tr" />
             </el-row>
             <el-divider />
           </el-row>
@@ -260,7 +273,6 @@
                   {{ scope.row.status ? '启用' : '作废' }}
                 </template>
               </el-table-column>
-
             </el-table>
           </div>
           <!-- 分页 -->
@@ -354,8 +366,7 @@
                     <template slot-scope="scope">
                       <CopyButton :copy-text="scope.row.customerNumber" />
                       <span>{{ scope.row.customerNumber }}</span>
-                    </template></el-table-column
-                  >
+                    </template></el-table-column>
                   <el-table-column prop="customerName" label="经销商名称" align="left">
                     <template slot-scope="scope">
                       <CopyButton :copy-text="scope.row.customerName" />
@@ -424,13 +435,11 @@
                 </el-col>
                 <el-col :span="4" class="middle_box" :offset="0">
                   <el-col>
-                    <el-button size="mini" :disabled="type == 2" @click="handleAllAdd">全部添加</el-button></el-col
-                  >
+                    <el-button size="mini" :disabled="type == 2" @click="handleAllAdd">全部添加</el-button></el-col>
                   <el-col> <el-button size="mini" :disabled="type == 2" @click="handleAdd">增加</el-button></el-col>
                   <el-col> <el-button size="mini" :disabled="type == 1" @click="handleDelete">删除</el-button></el-col>
                   <el-col>
-                    <el-button size="mini" :disabled="type == 1" @click="handleAllDelete">全部删除</el-button></el-col
-                  >
+                    <el-button size="mini" :disabled="type == 1" @click="handleAllDelete">全部删除</el-button></el-col>
                 </el-col>
                 <el-col :span="10" :offset="0">
                   <h5>已选经销商</h5>
@@ -478,36 +487,8 @@
                 </el-col>
               </el-row>
             </template>
+
             <template>
-              <div style="margin: 20px 0">
-                <!-- <el-upload
-        class="import-btn"
-        :action="baseURL + 'student/import'"
-        :http-request="handleImports"
-        :file-list="importFileList"
-        :show-file-list="false"
-      >
-        <el-button type="primary" size="mini">导入经销商</el-button>
-      </el-upload> -->
-                <!-- <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicy"
-        >下载模板</el-button
-      > -->
-              </div>
-              <!-- <el-row type="flex" style="margin: 20px 0">
-      <el-col :xs="24" :sm="12" :lg="14">
-        <el-input v-model="keyword2" placeholder="查找经销商" size="mini" />
-      </el-col>
-      <el-col :xs="24" :sm="1" :lg="1" style="margin-left: 10px"
-        ><el-button size="mini" @click="submitScreenForm2"
-          >确定</el-button
-        ></el-col
-      >
-      <el-col :xs="24" :sm="1" :lg="1" style="margin-left: 20px"
-        ><el-button size="mini" @click="resetScreenForm2"
-          >重置</el-button
-        ></el-col
-      >
-    </el-row> -->
               <div style="dispaly: flex">
                 <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
                 <ExportButton
@@ -515,9 +496,29 @@
                   :ex-url="'policy/limit/export'"
                   :ex-params="exParams"
                 />
+                <!-- <el-button
+                  v-if="detail.type !== 'PROVISION' && list.length"
+                  type="primary"
+                  size="mini"
+                  @click="()=>{
+                    visible = true
+                    handelBatchData()
+                  }"
+                >批量修改</el-button> -->
+                <template v-if="detail.type !== 'LIMIT'">
+
+                  <el-button
+                    v-if="list.length"
+                    type="primary"
+                    size="mini"
+                    @click="()=>{
+                      visible = true
+                      handelBatchData()
+                    }"
+                  >批量修改上限</el-button>
+                </template>
                 <el-divider />
               </div>
-
               <div>
                 <div class="table">
                   <el-table
@@ -531,67 +532,48 @@
                     @select-all="handleSelectionAllChange2"
                     @selection-change="handleSelectionChange2"
                   >
-                    <!-- <el-table-column type="selection" width="55" align="left" /> -->
+                    <el-table-column type="index" width="50" />
                     <el-table-column
                       prop="customerNumber"
                       label="经销商编号
 "
                       align="left"
+                      min-width="300"
                     >
                       <template slot-scope="scope">
                         <CopyButton :copy-text="scope.row.customerNumber" />
                         <span>{{ scope.row.customerNumber }}</span>
                       </template>
                     </el-table-column>
-                    <el-table-column prop="customerName" label="经销商名称" align="left">
+                    <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
                       <template slot-scope="scope">
                         <CopyButton :copy-text="scope.row.customerName" />
                         <span>{{ scope.row.customerName }}</span>
                       </template>
                     </el-table-column>
-                    <el-table-column
-                      prop="materialName"
-                      label="物料名称
-
-"
-                      align="left"
-                    >
+                    <el-table-column prop="materialName" label="物料名称" align="left" min-width="200">
                       <template slot-scope="scope">
-                        <CopyButton :copy-text="scope.row.materialName" />
-                        <span>{{ scope.row.materialName }}</span>
+                        {{ scope.row.materialName }}
                       </template>
                     </el-table-column>
-                    <el-table-column
-                      prop="materialNumber"
-                      label="物料编号
-"
-                      align="left"
-                    >
+                    <el-table-column prop="materialNumber" label="物料编号" align="left" min-width="200">
                       <template slot-scope="scope">
-                        <CopyButton :copy-text="scope.row.materialNumber" />
-                        <span>{{ scope.row.materialNumber }}</span>
+                        {{ scope.row.materialNumber }}
                       </template>
                     </el-table-column>
-                    <el-table-column
-                      prop="examineOrderNums"
-                      label="已审订单数
-"
-                      align="left"
-                    >
+                    <el-table-column prop="limitQty" label="购买量上限" align="left" min-width="200">
                       <template slot-scope="scope">
-                        {{ scope.row.examineOrderNums | numToFixed }}
+                        {{ scope.row.limitQty }}
                       </template>
                     </el-table-column>
-
-                    <el-table-column
-                      prop="limitQty"
-                      label="购买量上限
-
-"
-                      align="left"
-                    >
+                    <el-table-column prop="orderNums" label="已下订单数" align="left" min-width="200">
+                      <template slot-scope="scope">
+                        {{ scope.row.orderNums }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="examineOrderNums" label="已审订单数" align="left" min-width="200">
                       <template slot-scope="scope">
-                        {{ scope.row.limitQty | numToFixed }}
+                        {{ scope.row.examineOrderNums }}
                       </template>
                     </el-table-column>
                   </el-table>
@@ -610,6 +592,138 @@
                 </div>
               </div>
             </template>
+
+            <div>
+              <div>
+                <h4 style="display: inline-block; margin-right: 20px"> 经销商提货上限</h4>
+                <el-divider />
+              </div>
+              <div style="margin: 20px 0">
+                <!-- <el-upload
+                  class="import-btn cus-btn"
+                  :action="baseURL + 'policy/limit/group/import'"
+                  :http-request="handleImportPolicyLimitGroupPolicy"
+                  :file-list="importFileList"
+                  :show-file-list="false"
+                >
+                  <el-button type="primary" size="mini">导入经销商配提套数</el-button>
+                </el-upload> -->
+                <ExportButton
+                  style="display: inline-block; margin-right: 10px"
+                  :ex-url="'policy/limit/group/export'"
+                  ex-text="导出经销商配提套数"
+                  :ex-params="{ policyId: detail.code }"
+                />
+                <template v-if="detail.type !== 'LIMIT'">
+                  <el-button
+                    v-if="policyLimitGroupList.length"
+                    type="primary"
+                    size="mini"
+                    @click="()=>{
+                      limitGroupvisible = true
+                      handelLimitGroupData()
+                    }"
+                  >批量修改配提套数上限</el-button>
+                </template>
+                <template v-else>
+                  <el-button
+                    v-if="policyLimitGroupList.length"
+                    type="primary"
+                    size="mini"
+                    @click="()=>{
+                      buyNumvisible = true
+                      handelLimitGroupData()
+                    }"
+                  >批量修改上限</el-button>
+                </template>
+                <!-- <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy"
+                  >下载模板</el-button
+                > -->
+              </div>
+              <!-- <el-row style="margin: 20px 0">
+                <el-col :span="12">
+                  <el-input v-model="policyKeyWord" placeholder="查找经销商" size="mini" />
+                </el-col>
+                <el-col :span="10" style="margin-left: 20px">
+                  <el-button size="mini" @click="getPolicyLimitGroupList">确定</el-button>
+                  <el-button size="mini" @click="onPolicyReset">重置</el-button>
+                </el-col>
+              </el-row> -->
+              <div>
+                <div class="table">
+                  <el-table
+                    v-loading="policyLoading"
+                    :data="policyLimitGroupList"
+                    element-loading-text="Loading"
+                    border
+                    fit
+                    highlight-current-row
+                    stripe
+                  >
+                    <el-table-column type="index" width="50" />
+                    <el-table-column
+                      prop="customerNumber"
+                      label="经销商编号
+"
+                      align="left"
+                      width="300"
+                    >
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.customerNumber" />
+                        <span>{{ scope.row.customerNumber }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
+                      <template slot-scope="scope">
+                        <CopyButton :copy-text="scope.row.customerName" />
+                        <span>{{ scope.row.customerName }}</span>
+                      </template>
+                    </el-table-column>
+                    <template v-if="detail.type == 'LIMIT'">
+                      <el-table-column prop="minBuyNum" label="最小提货数量" align="left" min-width="200">
+                        <template slot-scope="scope">
+                          {{ scope.row.minBuyNum }}
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="maxBuyNum" label="最大提货组数" align="left" min-width="200">
+                        <template slot-scope="scope">
+                          {{ scope.row.maxBuyNum }}
+                        </template>
+                      </el-table-column>
+                    </template>
+                    <template v-else>
+                      <el-table-column prop="groupLimitNum" label="配提上限组数" align="left" min-width="200">
+                        <template slot-scope="scope">
+                          {{ scope.row.groupLimitNum }}
+                        </template>
+                      </el-table-column>
+                    </template>
+                    <!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
+                      <template slot-scope="scope">
+                        {{ scope.row.orderNums }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="examineOrderNums" label="配提上限已审订单数" align="left" width="200">
+                      <template slot-scope="scope">
+                        {{ scope.row.examineOrderNums }}
+                      </template>
+                    </el-table-column> -->
+                  </el-table>
+                </div>
+                <!-- 分页 -->
+                <div style="margin: 20px 0">
+                  <el-pagination
+                    :current-page="policyCurrentPages"
+                    :page-sizes="[10, 20, 30, 50]"
+                    :page-size="10"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="policyListTotal"
+                    @size-change="handlePolicySizeChanges"
+                    @current-change="handlePolicyCurrentChanges"
+                  />
+                </div>
+              </div>
+            </div>
           </div>
 
           <div v-if="isShow == 8 && detail.examineStatus == 'WAIT'" class="descriptions diy-table-1">
@@ -641,8 +755,157 @@
           <el-button v-if="isShow == 5" type="primary" size="default" @click="handleSave">保存</el-button>
         </div>
       </div>
+      <operation-records v-if="detail && detail.code" ref="operation" :policy-id="detail.code" />
+      <el-dialog
+        title="批量修改"
+        :visible.sync="visible"
+        width="50%"
+        :append-to-body="true"
+        :close-on-click-modal="false"
+        @close="handleDialogVisible"
+      >
+        <el-row :gutter="20">
+          <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
+            <el-col :span="4" :offset="0"> 购买量上限 </el-col>
+            <el-col :span="8" :offset="0"> <el-input v-model.number="limitQty" type="number" size="mini" /></el-col>
+          </el-col>
+          <el-col :span="24" :offset="0" style="margin-bottom: 20px">
+            <div style="display: flex">
+              <el-input v-model="limitQtyKeyWord" placeholder="输入关键字搜索" size="mini" />
+              <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelBatchData('search')">查询</el-button>
+              <el-button size="mini" @click="onReset">重置</el-button>
+            </div>
+          </el-col>
+        </el-row>
+
+        <zj-table
+          :table-attributes="tableAttributes"
+          :table-events="tableEvents"
+          :is-drop="true"
+          :columns="columns"
+          :table-data="tableData"
+        />
+        <div style="margin: 20px 0">
+          <el-pagination
+            :current-page="batchCurrentPages"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="batchTotal"
+            @size-change="handleBatchSizeChanges"
+            @current-change="handleBatchCurrentChanges"
+          />
+        </div>
+        <span slot="footer">
+          <el-button @click="handleDialogVisible">取消</el-button>
+          <el-button type="primary" @click="onSubmit($event,'limit')">确定</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog
+        title="批量修改"
+        :visible.sync="limitGroupvisible"
+        width="50%"
+        :append-to-body="true"
+        :close-on-click-modal="false"
+        @close="handleLimitDialogVisible"
+      >
+        <el-row :gutter="20">
+          <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
+            <el-col :span="4" :offset="0"> 配提套数上限 </el-col>
+            <el-col :span="8" :offset="0"> <el-input v-model.number="limitGroupNum" type="number" size="mini" /></el-col>
+          </el-col>
+          <el-col :span="24" :offset="0" style="margin-bottom: 20px">
+            <div style="display: flex">
+              <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
+              <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelLimitGroupData('search')">查询</el-button>
+              <el-button size="mini" @click="onLimitReset">重置</el-button>
+            </div>
+          </el-col>
+        </el-row>
+
+        <zj-table
+          :table-attributes="tableAttributes"
+          :table-events="tableEvents"
+          :is-drop="true"
+          :columns="limitColumns"
+          :table-data="limitTableData"
+        />
+        <div style="margin: 20px 0">
+          <el-pagination
+            :current-page="limitCurrentPages"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="limitTotal"
+            @size-change="handleLimitSizeChanges"
+            @current-change="handleLimitCurrentChanges"
+          />
+        </div>
+        <span slot="footer">
+          <el-button @click="handleLimitDialogVisible">取消</el-button>
+          <el-button type="primary" @click="onLimitSubmit($event, 'limit')">确定</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog
+        title="批量修改"
+        :visible.sync="buyNumvisible"
+        width="50%"
+        :append-to-body="true"
+        :close-on-click-modal="false"
+        @close="handleLimitDialogVisible"
+      >
+        <el-row :gutter="20">
+          <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
+            <el-col :span="4" :offset="0"> 最小提货数量 </el-col>
+            <el-col :span="8" :offset="0"> <el-input v-model.number="minBuyNum" type="number" size="mini" /></el-col>
+            <el-col :span="4" :offset="0"> 最大提货组数 </el-col>
+            <el-col :span="8" :offset="0"> <el-input v-model.number="maxBuyNum" type="number" size="mini" /></el-col>
+          </el-col>
+          <el-col :span="24" :offset="0" style="margin-bottom: 20px">
+            <div style="display: flex">
+              <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
+              <el-button
+                style="margin-left: 20px"
+                type="primary"
+                size="mini"
+                @click="handelLimitGroupData('search')"
+              >查询</el-button>
+              <el-button size="mini" @click="onLimitReset">重置</el-button>
+            </div>
+          </el-col>
+        </el-row>
+        <zj-table
+          :table-attributes="tableAttributes"
+          :table-events="tableEvents"
+          :is-drop="true"
+          :columns="limitColumns"
+          :table-data="limitTableData"
+        />
+        <div style="margin: 20px 0">
+          <el-pagination
+            :current-page="limitCurrentPages"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="limitTotal"
+            @size-change="handleLimitSizeChanges"
+            @current-change="handleLimitCurrentChanges"
+          />
+        </div>
+        <span slot="footer">
+          <el-button @click="handleLimitDialogVisible">取消</el-button>
+          <el-button type="primary" @click="onLimitSubmit">确定</el-button>
+        </span>
+      </el-dialog>
     </div>
-    <AddCondition v-else :id="cid" @close="handleConditionClose" @back="handleBack" :isEdit="isEdit" :isShow="isShow"/>
+    <add-condition
+      v-else
+      :id="cid"
+      :is-edit="isEdit"
+      :is-show="isShow"
+      @close="handleConditionClose"
+      @back="handleBack"
+    />
   </div>
 </template>
 
@@ -657,12 +920,15 @@ import {
   getPolicyDetail,
   toExamine,
   updatePolicy,
-  getPolicyList
+  getPolicyList,
+  updateLimitBatchupdate,
+  getPolicyLimitGroupList,
+  updateLimitGrouppdate
 } from '@/api/policy_list'
+import { downloadFiles, handleImport } from '@/utils/util'
 import AddCondition from './AddCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
-
-import { handleImport } from '@/utils/util'
+import OperationRecords from './OperationRecords.vue'
 
 import Minxin from '@/mixin'
 
@@ -670,10 +936,11 @@ export default {
   name: 'Examine',
   components: {
     AddCondition,
-    ImageUpload
+    ImageUpload,
+    OperationRecords
   },
-  props: ['id', 'isShow'],
   mixins: [Minxin],
+  props: ['id', 'isShow'],
   data() {
     return {
       baseURL: '',
@@ -742,7 +1009,39 @@ export default {
       },
       list: [],
       cTotal: 1,
-      clistLoading: false
+      clistLoading: false,
+      visible: false,
+      maxBuyNumVisible: false,
+      tableData: [],
+      tableAttributes: {
+        selectColumn: true
+      },
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      limitQty: null,
+      maxBuyNum: null,
+      limitQtyKeyWord: '',
+      maxBuyNumKeyWord: '',
+      selectedData: [],
+      batchCurrentPages: 1,
+      batchPageSizes: 10,
+      batchTotal: 0,
+      policyLimitGroupList: [],
+      policyLoading: false,
+      policyCurrentPages: 1,
+      policyPageSize: 10,
+      policyListTotal: 0,
+      policyKeyWord: '',
+      limitGroupvisible: false,
+      limitGroupNum: null,
+      limitGroupKeyWord: '',
+      limitCurrentPages: 1,
+      limitTotal: 0,
+      limitPageSizes: 10,
+      limitTableData: [],
+      buyNumvisible: false,
+      minBuyNum: null
     }
   },
   computed: {
@@ -750,6 +1049,50 @@ export default {
       return {
         policyId: this.detail.code
       }
+    },
+    columns() {
+      return [
+        {
+          columnAttributes: {
+            label: '经销商编码',
+            prop: 'customerNumber'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '经销商名称',
+            prop: 'customerName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料名称',
+            prop: 'materialName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '物料编号',
+            prop: 'materialNumber'
+          }
+        }
+      ]
+    },
+    limitColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '经销商编码',
+            prop: 'customerNumber'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '经销商名称',
+            prop: 'customerName'
+          }
+        }
+      ]
     }
   },
   created() {},
@@ -761,7 +1104,7 @@ export default {
       const title = '详情页'
       return title
     },
-    handleBack(){
+    handleBack() {
       this.isEdit = 1
     },
     getList() {
@@ -787,6 +1130,7 @@ export default {
         this.getConditionList()
         this.getCond()
         this.getPolicyList()
+        this.getPolicyLimitGroupList()
       })
     },
     getPolicyList() {
@@ -845,9 +1189,9 @@ export default {
         }
         this.dataL = res.data.records
         for (let k = 0; k < this.dataL.length; k++) {
-          ;(this.dataL[k].customerId = this.dataL[k].id),
-            (this.dataL[k].customerName = this.dataL[k].name),
-            (this.dataL[k].customerNumber = this.dataL[k].number)
+          (this.dataL[k].customerId = this.dataL[k].id),
+          (this.dataL[k].customerName = this.dataL[k].name),
+          (this.dataL[k].customerNumber = this.dataL[k].number)
         }
 
         console.log(this.dataL, '获取经销商列表')
@@ -994,7 +1338,7 @@ export default {
      * @param {String} index - 索引值
      * @return Boolean
      */
-    selectable: function (row, index) {
+    selectable: function(row, index) {
       // row.disabled == undefined 才能被选中
       if (row.disabled == undefined || row.disabled == false) {
         return true
@@ -1119,6 +1463,219 @@ export default {
         this.fileList = []
         this.isShow = 1
       }
+    },
+    selectionChange(data) {
+      this.selectedData = data
+    },
+    handelBatchData(search) {
+      if (search) {
+        this.batchCurrentPages = 1
+      }
+      getPolicyList({
+        pageNum: this.batchCurrentPages,
+        pageSize: this.batchPageSizes,
+        policyId: this.id,
+        keyword: this.limitQtyKeyWord
+      }).then(res => {
+        this.tableData = res.data.records
+        this.batchTotal = res.data.total
+      })
+    },
+    handleDialogVisible() {
+      this.visible = false
+      this.buyNumvisible = false
+      this.maxBuyNumVisible = false
+      this.batchCurrentPages = 1
+      this.batchPageSizes = 10
+      this.limitQty = null
+      this.maxBuyNum = null
+      this.minBuyNum = null
+      this.limitQtyKeyWord = ''
+      this.maxBuyNumKeyWord = ''
+    },
+    onSubmit(e, type) {
+      console.log(type)
+      if (!this.selectedData.length) {
+        this.$errorMsg('不能为空,请选择')
+        return
+      }
+      let params = {}
+
+      const customerIds = this.selectedData
+        .map(k => {
+          return k.customerId
+        })
+        .join(',')
+      const ids = this.selectedData
+        .map(k => {
+          return k.id
+        })
+        .join(',')
+      if (type) {
+        if (this.limitQty <= 0) {
+          this.$errorMsg('购买量上限不能小于0或不能为空')
+          return
+        }
+        params = {
+          customerIds,
+          ids,
+          limitQty: this.limitQty
+        }
+      }
+      updateLimitBatchupdate(params).then(res => {
+        this.handleDialogVisible()
+        this.getPolicyList()
+        this.getPolicyLimitGroupList()
+        this.$refs.operation.getCommonLogList()
+        this.$successMsg('批量修改成功')
+      })
+    },
+    handleBatchSizeChanges(val) {
+      this.batchCurrentPages = 1
+      this.batchPageSizes = val
+      this.handelBatchData()
+    },
+    onReset() {
+      this.limitQtyKeyWord = ''
+      this.maxBuyNumKeyWord = ''
+      this.handelBatchData()
+    },
+    handleBatchCurrentChanges(val) {
+      this.batchCurrentPages = val
+      this.handelBatchData()
+    },
+    getPolicyLimitGroupList() {
+      this.policyLoading = true
+      getPolicyLimitGroupList({
+        pageNum: this.policyCurrentPages,
+        pageSize: this.policyPageSize,
+        policyId: this.id,
+        keyword: this.policyKeyWord
+      }).then(res => {
+        this.policyLimitGroupList = res.data.records
+        this.policyListTotal = res.data.total
+        this.policyLoading = false
+      })
+    },
+    handlePolicySizeChanges(val) {
+      this.policyCurrentPages = 1
+      this.policyPageSize = val
+      this.getPolicyLimitGroupList()
+    },
+    onPolicyReset() {
+      this.policyCurrentPages = 1
+      this.policyPageSize = 10
+      this.policyKeyWord = ''
+      this.getPolicyLimitGroupList()
+    },
+    handlePolicyCurrentChanges(val) {
+      this.policyCurrentPages = val
+      this.getPolicyLimitGroupList()
+    },
+    hanleDownloadFilesPolicyLimitGroupPolicy() {
+      downloadFiles('policy/limit/group/download')
+    },
+    async handleImportPolicyLimitGroupPolicy(param) {
+      this.importLoading = true
+      const file = param.file
+      const formData = new FormData()
+      formData.append('file', file)
+      formData.append('policyId', this.id)
+      // formData.append('type', this.detail.type)
+
+      // formData.append("mainId", this.searchForm.mainId);
+      const result = await handleImport('policy/limit/group/import', formData)
+      this.importLoading = false
+      this.importFileList = []
+      if (result.code === 200) {
+        await this.$alert(result.message, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        // this.policyLimitGroupList = result.data
+        this.getPolicyLimitGroupList()
+      } else {
+        await this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
+      }
+    },
+    handelLimitGroupData(search) {
+      if (search) {
+        this.limitCurrentPages = 1
+      }
+      this.limitGroupvisible = true
+      getPolicyLimitGroupList({
+        pageNum: this.limitCurrentPages,
+        pageSize: this.limitPageSizes,
+        policyId: this.id,
+        keyword: this.limitGroupKeyWord
+      }).then(res => {
+        this.limitTableData = res.data.records
+        this.limitTotal = res.data.total
+      })
+    },
+    onLimitSubmit(e, type) {
+      if (!this.selectedData.length) {
+        this.$errorMsg('不能为空,请选择')
+        return
+      }
+
+      const ids = this.selectedData
+        .map(k => {
+          return k.id
+        })
+        .join(',')
+      let params = {}
+      if (type) {
+        if (this.limitGroupNum <= 0) {
+          this.$errorMsg('配提套数上限不能小于0或不能为空')
+          return
+        }
+        params = {
+          ids,
+          limitGroupNum: this.limitGroupNum
+        }
+      } else {
+        params = {
+          ids,
+          minBuyNum: this.minBuyNum,
+          maxBuyNum: this.maxBuyNum
+        }
+      }
+
+      updateLimitGrouppdate(params).then(res => {
+        this.handleLimitDialogVisible()
+        this.$successMsg('批量修改成功')
+        this.getPolicyLimitGroupList()
+        this.getPolicyList()
+        this.$refs.operation.getCommonLogList()
+      })
+    },
+    handleLimitSizeChanges(val) {
+      this.limitCurrentPages = 1
+      this.limitPageSizes = val
+      this.handelLimitGroupData()
+    },
+    handleLimitCurrentChanges(val) {
+      this.limitCurrentPages = val
+      this.handelLimitGroupData()
+    },
+    onLimitReset() {
+      this.limitGroupKeyWord = ''
+      this.handelLimitGroupData()
+    },
+    handleLimitDialogVisible() {
+      this.buyNumvisible = false
+      this.limitGroupvisible = false
+      this.limitGroupNum = null
+      this.limitGroupKeyWord = ''
+      this.limitCurrentPages = 1
+      this.limitTotal = 0
+      this.limitPageSizes = 10
+      this.maxBuyNum = null
+      this.minBuyNum = null
+      this.limitQtyKeyWord = ''
+      this.maxBuyNumKeyWord = ''
     }
   }
 }

+ 104 - 37
src/views/sales_policy/components/editPolicy.vue

@@ -5,7 +5,7 @@
         <div class="screen-container">
           <h4>销售政策信息</h4>
           <el-divider />
-          <el-form ref="form" :model="searchForm" label-width="120px" size="mini" class="demo-searchForm">
+          <el-form ref="form" :model="searchForm" label-width="160px" size="mini" class="demo-searchForm">
             <el-row>
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="销售政策编号">
@@ -82,6 +82,19 @@
                   <el-input v-model="searchForm.remark" placeholder="新风机变频挂机。按提货数量1:3开单" />
                 </el-form-item>
               </el-col>
+              <template v-if="searchForm.type === 'LIMIT'">
+
+                <el-col :xs="24" :ms="12" :lg="12">
+                  <el-form-item label="商家最少起提数量" prop="minBuyNum">
+                    <el-input v-model.number="searchForm.minBuyNum" type="number" placeholder="商家最少起提数量" />
+                  </el-form-item>
+                </el-col>
+                <el-col :xs="24" :ms="12" :lg="12">
+                  <el-form-item label="商家最大提货组数" prop="maxBuyNum">
+                    <el-input v-model.number="searchForm.maxBuyNum" type="number" placeholder="商家最大提货组数" />
+                  </el-form-item>
+                </el-col>
+              </template>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="政策封面图">
                   <ImageUpload class="elImageClose" :file-list="fileList" multiple :limit="3" />
@@ -120,10 +133,10 @@
               :data="dataList"
               row-key="index"
               use-virtual
-              fixedColumnsRoll
-              :dataChangesScrollTop="false"
+              fixed-columns-roll
+              :data-changes-scroll-top="false"
               inverse-current-row
-              bigDataCheckbox
+              big-data-checkbox
               element-loading-text="Loading"
               max-height="700"
               border
@@ -249,13 +262,21 @@
                   <template v-if="scope.row.fang">
                     {{ scope.row.priceType }}
                   </template>
-                  <el-input
+                  <el-select
                     v-else
                     v-model="scope.row.priceType"
-                    placeholder="价格类型"
                     size="mini"
+                    filterable
                     @change="setText($event, scope.$index, scope.row, 'priceType')"
-                  />
+                    @focus="handlePriceType(scope.row)"
+                  >
+                    <el-option
+                      v-for="item in priceList"
+                      :key="item.priceTypeId"
+                      :label="item.priceTypeName"
+                      :value="item.priceTypeId"
+                    />
+                  </el-select>
                 </template>
               </pl-table-column>
               <pl-table-column prop="price" label="单价" align="right" show-overflow-tooltip min-width="150">
@@ -343,8 +364,11 @@
               </pl-table-column>
               <pl-table-column fixed="right" label="操作" align="center" min-width="150">
                 <template slot-scope="scope">
-                  <el-button type="text" class="textColor el-popover-left" @click="scope.row.fang = !scope.row.fang"
-                    >编辑
+                  <el-button
+                    type="text"
+                    class="textColor el-popover-left"
+                    @click="scope.row.fang = !scope.row.fang"
+                  >编辑
                   </el-button>
                   <el-popconfirm
                     confirm-button-text="好的"
@@ -386,7 +410,7 @@
           <div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
             <div>
               <el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
-              <el-button type="primary" size="mini" @click="handleSave" v-loading="fullscreenLoading">保存</el-button>
+              <el-button v-loading="fullscreenLoading" type="primary" size="mini" @click="handleSave">保存</el-button>
             </div>
             <!--            <el-pagination-->
             <!--              :current-page="dcurrentPage"-->
@@ -431,7 +455,7 @@
                     scope.row.fang = false
                     conditName = scope.row.name
                   "
-                  >编辑
+                >编辑
                 </el-button>
                 <el-button type="text" size="mini" @click="handleCondition(scope.row.id, scope.$index)">删除</el-button>
                 <el-button type="text" size="mini" @click="catCond(scope.row)">查看条件</el-button>
@@ -452,7 +476,9 @@
           <TabelTransfer
             v-if="detail && detail.code"
             :code="detail.code"
+            :batch="true"
             :yregion="region"
+            :policy-type="searchForm.type"
             @handlEditPolicy="handlEditPolicy"
             @handleReset="handleReset"
           />
@@ -463,21 +489,21 @@
       v-show="isCondition === 1"
       ref="comDom"
       :code="searchForm.code"
+      :is-show="isShow"
+      :is-flag="isFlag"
+      :is-condition="isCondition"
       @handleSubmitCon="handleSubmitCon"
       @back="handleBack"
-      :isShow="isShow"
-      :isFlag="isFlag"
-      :isCondition="isCondition"
     />
     <AddCondition
       v-show="isCondition === 2"
       :id="cid"
       ref="cond"
       :code="searchForm.code"
-      :isShow="isShow"
-      :isFlag="isFlag"
+      :is-show="isShow"
+      :is-flag="isFlag"
+      :is-condition="isCondition"
       @back="handleBack"
-      :isCondition="isCondition"
     />
   </div>
 </template>
@@ -500,6 +526,8 @@ import {
   updatePolicy,
   setStauts
 } from '@/api/policy_list'
+import { getPriceSalesRelaListV2 } from '@/api/priceType'
+
 import { downloadFiles, handleImport } from '@/utils/util'
 // import Transfer from './Transfer'
 import TabelTransfer from './TabelTransfer'
@@ -509,18 +537,6 @@ import ImageUpload from '@/components/Common/image-upload.vue'
 import { PlTable, PlTableColumn } from 'pl-table'
 
 export default {
-  props: {
-    id: {
-      type: String,
-      default: ''
-    },
-    isShow: {
-      type: Number
-    },
-    isFlag: {
-      type: [Number, String]
-    }
-  },
   directives: {
     'el-select-loadmore': {
       bind(el, binding) {
@@ -530,7 +546,7 @@ export default {
           '.el-table__body-wrapper'
           // '.el-select-dropdown .el-select-dropdown__wrap'
         )
-        SELECTWRAP_DOM.addEventListener('scroll', function () {
+        SELECTWRAP_DOM.addEventListener('scroll', function() {
           /**
            * scrollHeight 获取元素内容⾼度(只读)
            * scrollTop 获取或者设置元素的偏移值,常⽤于, 计算滚动条的位置, 当⼀个元素的容器没有产⽣垂直⽅向的滚动条, 那它的scrollTop的值默认为0.
@@ -547,6 +563,18 @@ export default {
     }
   },
   mixins: [Minxin],
+  props: {
+    id: {
+      type: String,
+      default: ''
+    },
+    isShow: {
+      type: Number
+    },
+    isFlag: {
+      type: [Number, String]
+    }
+  },
   data() {
     return {
       fang: false,
@@ -564,7 +592,9 @@ export default {
         mainName: '',
         type: '',
         isFullRebate: false,
-        commercialType: false
+        commercialType: false,
+        maxBuyNum: 0,
+        minBuyNum: 0
       },
       conditName: '',
       dataList: [],
@@ -602,7 +632,8 @@ export default {
       cpolicyId: '',
       region: 0,
       fullscreenLoading: false,
-      srcList: []
+      srcList: [],
+      priceList: []
     }
   },
   computed: {
@@ -621,6 +652,11 @@ export default {
       })
     },
     setText(e, index, row, name) {
+      if (name === 'priceType') {
+        console.log(e, this.priceList.find(k => k.priceTypeId === e).priceTypeName)
+        this.dataList[index][name] = this.priceList.find(k => k.priceTypeId === e).priceTypeName
+        return
+      }
       this.dataList[index][name] = row[name]
     },
     // 下载excel模板
@@ -761,6 +797,9 @@ export default {
 
       this.$set(row, 'saleTypeCode', item.saleCode)
       this.$set(row, 'saleTypeName', item.saleName)
+      this.$set(row, 'priceType', '')
+      this.priceList = []
+
       // this.$set(row,'saleTypeId',item.id)
     },
     // 修改条件名称
@@ -832,10 +871,13 @@ export default {
           title: this.detail.title,
           type: this.detail.type,
           isFullRebate: this.detail.isFullRebate,
-          commercialType: this.detail.commercialType
+          commercialType: this.detail.commercialType,
+          maxBuyNum: this.detail.maxBuyNum,
+          minBuyNum: this.detail.minBuyNum
+
         }
         this.region = res.data.flag
- 
+
         // this.srcList = [this.$imageUrl + this.detail.imgSrc]
         if (this.isShow === 3 && this.detail.imgSrc) {
           this.detail.imgSrc.split(',').forEach(k => {
@@ -893,7 +935,6 @@ export default {
         .then(result => {
           result.data.records.forEach(k => {
             k.fang = true
-
             k.walletIds = []
             k.rebateWalletIds = []
             if (!k.specification) {
@@ -911,6 +952,11 @@ export default {
                 k.walletIds = [...k.walletIds, d.walletId]
               }
             }
+            // this.priceList.forEach(l => {
+            //   if (l.priceTypeName == k.priceType) {
+            //     k.priceType = l.priceTypeId
+            //   }
+            // })
           })
 
           this.dataList = result.data.records
@@ -954,7 +1000,7 @@ export default {
         //     this.searchForm.mainName = k.dictValue;
         //   }
         // });
-        let imgUrl = []
+        const imgUrl = []
         this.fileList.forEach(k => {
           imgUrl.push(k.url)
         })
@@ -1086,9 +1132,30 @@ export default {
     },
     handleBack() {
       this.isCondition = 0
- 
+
       this.$emit('upDataIsFlag')
+    },
+    getPriceSalesRelaListV2(val) {
+      getPriceSalesRelaListV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            'param': 'b.sale_code',
+            'compare': 'like',
+            'value': val
+          }
+        ]
+      }).then(res => {
+        this.priceList = res.data.records
+      })
+    },
+    handlePriceType(e) {
+      if (e.saleTypeCode) {
+        this.getPriceSalesRelaListV2(e.saleTypeCode)
+      }
     }
+
   },
   components: {
     // Transfer,

+ 420 - 0
src/views/sales_policy/components/replaceRecordForm.vue

@@ -0,0 +1,420 @@
+<template>
+  <div>
+    <div>
+      <h4>旧机型</h4>
+      <el-divider />
+      <zj-table :table-attributes="tableAttributes" :is-drop="true" :columns="oldColumns" :table-data="oldData" />
+      <div style="margin: 20px 0; text-align: right">
+        <el-button size="mini" @click="handleQuery">查询机型</el-button>
+      </div>
+    </div>
+    <div>
+      <h4>有效政策</h4>
+      <el-divider />
+      <zj-table
+        :table-attributes="{
+          ...tableAttributes, selectColumn: true
+        }"
+        :table-events="tableEvents"
+        :is-drop="true"
+        :columns="policyColumns"
+        :table-data="policyList"
+      />
+    </div>
+    <div>
+      <h4>新机型</h4>
+      <el-divider />
+      <zj-table :table-attributes="tableAttributes" :is-drop="true" :columns="newColumns" :table-data="newData" />
+    </div>
+    <div style="margin: 20px 0;text-align: right;">
+      <el-button type="primary" size="mini" @click="onClose">取消</el-button>
+      <el-button type="primary" size="mini" @click="onSubmit">确定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { updateMaterialPolicy, getK3List, getList } from '@/api/policy_list'
+
+export default {
+  props: {
+    recordSelected: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      loading: false,
+      oldData: [
+        {
+          name: '',
+          number: '',
+          specification: ''
+        }
+      ],
+      k3List: [],
+      newK3List: [],
+      policyList: [],
+      selectedData: [],
+      newData: [
+        {
+          name: '',
+          number: '',
+          specification: ''
+        }
+      ],
+      tableAttributes: {},
+      tableEvents: {
+        'selection-change': this.selectionChange
+      }
+    }
+  },
+  computed: {
+    oldColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '物料代码',
+            prop: 'number'
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div style='margin:0 10px'>
+                <el-select
+                  style='width:100%'
+                  value={row.number}
+                  onInput={e => (row.number = e)}
+                  onChange={e => this.setCheckeData(e, 'old')}
+                  filterable
+                  size='mini'
+                  remote
+                  reserve-keyword
+                  placeholder='请输入关键词'
+                  remote-method={e => this.remoteMethod(e, 'number', 'old')}
+                  loading={this.loading}
+                >
+                  {this.k3List.map(k => {
+                    return <el-option key={k.id} label={k.number} value={k.id}></el-option>
+                  })}
+                </el-select>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品名称',
+            prop: 'name'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specification'
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div style='margin:0 10px'>
+                <el-select
+                  style='width:100%'
+                  value={row.specification}
+                  onInput={e => (row.specification = e)}
+                  onChange={e => this.setCheckeData(e, 'old')}
+                  filterable
+                  size='mini'
+                  remote
+                  reserve-keyword
+                  placeholder='请输入规格型号'
+                  remote-method={e => this.remoteMethod(e, 'specification', 'old')}
+                  loading={this.loading}
+                >
+                  {this.k3List.map(k => {
+                    return <el-option key={k.id} label={k.specification} value={k.id}></el-option>
+                  })}
+                </el-select>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单价',
+            prop: 'title'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作',
+            prop: ''
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div>
+                <el-button
+                  type='text'
+                  size='default'
+                  onClick={() => {
+                    this.oldData = [
+                      {
+                        name: '',
+                        number: '',
+                        specification: ''
+                      }
+                    ]
+                  }}
+                >
+                  清空
+                </el-button>
+              </div>
+            )
+          }
+        }
+      ]
+    },
+    policyColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '政策编码',
+            prop: 'code'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '政策名称',
+            prop: 'title'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '政策类型',
+            prop: 'type'
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div>
+                {row.type === 'PROVISION' ? '配提' : '限量'}
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作',
+            prop: ''
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div>
+                <el-button type='text' size='default' onClick={() => {
+                  this.policyList.splice(index, 1)
+                }}>
+                  删除
+                </el-button>
+              </div>
+            )
+          }
+        }
+      ]
+    },
+    newColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '物料代码',
+            prop: 'number'
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div style='margin:0 10px'>
+                <el-select
+                  style='width:100%'
+                  value={row.number}
+                  onInput={e => (row.number = e)}
+                  onChange={e => this.setCheckeData(e)}
+                  filterable
+                  size='mini'
+                  remote
+                  reserve-keyword
+                  placeholder='请输入关键词'
+                  remote-method={e => this.remoteMethod(e, 'number')}
+                  loading={this.loading}
+                >
+                  {this.newK3List.map(k => {
+                    return <el-option key={k.id} label={k.number} value={k.id}></el-option>
+                  })}
+                </el-select>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品名称',
+            prop: 'name'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '规格型号',
+            prop: 'specification'
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div style='margin:0 10px'>
+                <el-select
+                  style='width:100%'
+                  value={row.specification}
+                  onInput={e => (row.specification = e)}
+                  onChange={e => this.setCheckeData(e)}
+                  filterable
+                  size='mini'
+                  remote
+                  reserve-keyword
+                  placeholder='请输入规格型号'
+                  remote-method={e => this.remoteMethod(e, 'specification')}
+                  loading={this.loading}
+                >
+                  {this.newK3List.map(k => {
+                    return <el-option key={k.id} label={k.specification} value={k.id}></el-option>
+                  })}
+                </el-select>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '单价',
+            prop: 'title'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作',
+            prop: ''
+          },
+          render: (h, { column, row, index }) => {
+            return (
+              <div>
+                <el-button
+                  type='text'
+                  size='default'
+                  onClick={() => {
+                    this.newData = [
+                      {
+                        name: '',
+                        number: '',
+                        specification: ''
+                      }
+                    ]
+                  }}
+                >
+                  清空
+                </el-button>
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  mounted() {
+    this.tableData = this.recordSelected
+  },
+  methods: {
+    remoteMethod(query, type, name) {
+      if (query !== '') {
+        this.loading = true
+        getK3List({
+          pageNum: 1,
+          pageSize: 100,
+          number: type === 'number' ? query : '',
+          oldNumber: '',
+          specification: type === 'specification' ? query : ''
+        }).then(res => {
+          if (name) {
+            this.k3List = res.data.records
+          } else {
+            this.newK3List = res.data.records
+          }
+          this.loading = false
+        })
+      } else {
+        this.options = []
+      }
+    },
+    setCheckeData(e, type) {
+      if (type) {
+        this.oldData[0].specification = e
+        this.oldData[0].number = e
+        if (e) {
+          const k3Obj = this.findData(e, type)
+          this.oldData[0].name = k3Obj.name
+        }
+      } else {
+        this.newData[0].specification = e
+        this.newData[0].number = e
+        if (e) {
+          const k3Obj = this.findData(e)
+          this.newData[0].name = k3Obj.name
+        }
+      }
+    },
+    handleQuery() {
+      const number = this.oldData[0].number
+      if (!number) {
+        this.$errorMsg('旧机型内容不能为空')
+        return
+      }
+      this.selectedData = []
+      const specification = this.findData(number, 'old').specification
+      getList({
+        pageNum: 1,
+        pageSize: -1,
+        specification: specification,
+        status: 1
+      }).then(res => {
+        this.policyList = res.data.records
+      })
+    },
+    selectionChange(data) {
+      this.selectedData = data
+    },
+    onSubmit() {
+      if (!this.selectedData.length) {
+        this.$errorMsg('请选择有效政策')
+        return
+      }
+      const policyIds = this.selectedData.map(k => k.id).join('')
+      const newMaterialId = this.newData[0].number
+      const oldMaterialId = this.oldData[0].number
+      if (!newMaterialId) {
+        this.$errorMsg('新机型内容不能为空')
+        return
+      }
+      updateMaterialPolicy({
+        policyIds,
+        newMaterialId,
+        oldMaterialId
+      }).then(res => {
+        this.$successMsg('批量修改成功')
+        this.onClose()
+      })
+    },
+    findData(e, type) {
+      if (type) {
+        return this.k3List.find(k => k.id === e)
+      } else {
+        return this.newK3List.find(k => k.id === e)
+      }
+    },
+    onClose() {
+      this.$emit('close')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 71 - 16
src/views/sales_policy/policy_list.vue

@@ -12,16 +12,16 @@
     :operation-column-width="200"
     :field-beans-hook="fieldBeansHook"
   >
-    <Popu v-if="isShow !== 1">
+    <popu v-if="isShow !== 1">
       <el-page-header slot="head" :content="content" @back="handleClose" />
-      <AddPolicy
+      <add-policy
         v-if="isShow === 2"
         :is-show="isShow"
         :is-flag="isFlag"
         @close="handleClose"
         @upDataIsFlag="upDataIsFlag"
       />
-      <EditPolicy
+      <edit-policy
         v-if="isShow === 3"
         :id="id"
         :is-show="isShow"
@@ -30,8 +30,28 @@
         @upDataIsFlag="upDataIsFlag"
       />
       <Details v-if="isShow === 4" :id="id" :is-show="isShow" @close="handleClose" />
-      <Examine v-if="isShow === 5" :id="id" :is-show="isShow" @close="handleClose" />
-    </Popu>
+      <examine v-if="isShow === 5" :id="id" :is-show="isShow" @close="handleClose" />
+    </popu>
+    <el-dialog
+      title="批量修改机型"
+      :visible.sync="replaceVisible"
+      width="80%"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="handleDialogClose"
+    >
+      <replace-record-form v-if="replaceVisible" :record-selected="recordSelected" @close="handleDialogClose" />
+    </el-dialog>
+    <el-dialog
+      title="批量修改延期"
+      :visible.sync="delayVisible"
+      width="80%"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="handleDialogClose"
+    >
+      <delay-record-form v-if="delayVisible" :record-selected="recordSelected" @close="handleDialogClose" />
+    </el-dialog>
   </template-page>
 </template>
 
@@ -39,28 +59,23 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import Popu from '@/components/template/popu.vue'
 import add_callback_mixin from '@/components/template/add_callback_mixin.js'
-
+import DelayRecordForm from './components/delayRecordForm.vue'
+import ReplaceRecordForm from './components/replaceRecordForm.vue'
 import {
   cancelPolicy,
   cloneList,
   deletePolicy,
   getCrList,
   getId,
-  getList,
   getpolicySubmit,
-  getTypeList,
   toExamine,
   setAbandon,
   policyListV2,
   policyListV2Export
 } from '@/api/policy_list'
-// import Minxin from '@/mixin'
 import { downloadFiles, handleImport } from '@/utils/util'
 import AddPolicy from './components/AddPolicy'
 import EditPolicy from './components/editPolicy'
-import AddModel from './components/AddModel'
-import Pagination from './components/Pagination'
-import AddCondition from './components/AddCondition'
 import Details from './components/details.vue'
 import Examine from './components/Examine'
 import { mapState } from 'vuex'
@@ -69,6 +84,8 @@ export default {
   mixins: [add_callback_mixin],
   data() {
     return {
+      replaceVisible: false,
+      delayVisible: false,
       showPage: true,
       // 事件组合
       optionsEvensGroup: [
@@ -81,12 +98,38 @@ export default {
               })
             }
           ]
+        ],
+        [
+          [
+            {
+              name: '批量修改机型',
+              click: () => {
+                this.replaceVisible = true
+              }
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量修改延期',
+              click: () => {
+                if (!this.recordSelected.length) {
+                  this.$errorMsg('请选择内容')
+                  return
+                }
+                this.delayVisible = true
+              }
+            }
+          ]
         ]
       ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: false
+        selectColumn: true,
+        selectable: this.selectable
+
       },
       // 表格事件
       tableEvents: {
@@ -170,6 +213,18 @@ export default {
     }
   }),
   methods: {
+    selectable(row, index) {
+      if (row.status === '有效' && row.examineStatus === '审核通过') {
+        return true
+      } else {
+        return false
+      }
+    },
+    handleDialogClose() {
+      this.replaceVisible = false
+      this.delayVisible = false
+      this.$refs.pageRef.refreshList()
+    },
     fieldBeansHook(list) {
       return [
         ...list,
@@ -522,16 +577,16 @@ export default {
       }
     }
   },
+  // eslint-disable-next-line vue/order-in-components
   components: {
     TemplatePage,
     Popu,
     Examine,
     Details,
-    AddModel,
     AddPolicy,
     EditPolicy,
-    Pagination,
-    AddCondition
+    DelayRecordForm,
+    ReplaceRecordForm
   }
 }
 </script>

+ 438 - 0
src/views/setting/jiaxianSubAccount.vue

@@ -0,0 +1,438 @@
+<template>
+  <div class="app-container">
+    <div class="setting_title">嘉贤子账号</div>
+    <el-divider />
+
+    <div class="mymain-container">
+      <div class="btn-group clearfix">
+        <div class="fl">
+          <el-button
+            v-if="checkBtnRole('add')"
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            @click="addOrEdit('add')"
+          >新增账号</el-button>
+        </div>
+        <!--        <div class="fr">-->
+        <!--          <ImportButton :im-url="'stock/importToll'" @importSuccess="getList" />-->
+        <!--        </div>-->
+      </div>
+
+      <div class="table">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+        >
+          <el-table-column align="left" label="序号" type="index" width="50" />
+          <el-table-column align="left" label="账号" prop="userName" />
+          <el-table-column align="left" label="创建时间" prop="createTime" />
+          <el-table-column align="left" label="最后登录时间" prop="lastLoginTime" />
+          <el-table-column align="left" label="主帐号" prop="isMaster">
+            <template slot-scope="scope">
+              <el-tag v-if="scope.row.isMaster" type="success">是</el-tag>
+              <el-tag v-else type="danger">否</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="操作" width="180">
+            <template slot-scope="scope">
+              <el-button type="text" @click="addOrEdit('edit', scope.row)">重置密码</el-button>
+              <!-- <el-button
+                v-if="checkBtnRole('detail')"
+                type="text"
+                @click="setMenuRole(scope.row.adminUserId, 'role')"
+              >设置权限</el-button> -->
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+          />
+        </div>
+      </div>
+    </div>
+
+    <!-- 设置权限 -->
+    <el-dialog
+      title="设置权限"
+      :visible.sync="roleFormVisible"
+      :show-close="false"
+      width="40%"
+      :close-on-click-modal="false"
+      custom-class="tree-dialog"
+      top="50px"
+    >
+      <el-tree
+        ref="tree"
+        :data="menuRoleList"
+        show-checkbox
+        :check-strictly="true"
+        :default-expand-all="true"
+        :expand-on-click-node="false"
+        node-key="moduleId"
+        highlight-current
+        :props="defaultProps"
+      >
+        <span slot-scope="{ node, data }" class="custom-tree-node">
+          <span>{{ node.label }}</span>
+          <span v-if="data.type < 3">
+            <el-button type="text" size="mini" @click="() => quickSelection(data)">一键全选</el-button>
+            <el-button
+              type="text"
+              size="mini"
+              style="color: #f56c6c"
+              @click="() => quickCancel(data)"
+            >一键取消</el-button>
+          </span>
+        </span>
+      </el-tree>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="roleFormVisible = false">{{ editId != 1 ? '取 消' : '关 闭' }}</el-button>
+        <el-button v-if="editId != 1" type="primary" @click="submitRoleForm('role')">确 定</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :close-on-click-modal="false"
+      width="45%"
+      :title="'add' === addFormType ? '新增' : '修改'"
+      @close="cancelAddForm"
+    >
+      <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm">
+        <el-form-item v-if="addFormType !== 'edit'" label="账号" prop="account">
+          <el-input v-model="ruleForm.account" type="text" autocomplete="off" disabled placeholder="系统自动生成" />
+        </el-form-item>
+        <el-form-item v-if="addFormType !== 'edit'" label="子经销商" prop="customerId">
+          <el-select v-model="ruleForm.customerId" placeholder="请选择子经销商" filterable style="width:100%">
+            <el-option
+              v-for="item in subCustomerList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="密码" prop="password">
+          <el-input v-model="ruleForm.password" type="password" autocomplete="off" />
+        </el-form-item>
+      </el-form>
+
+      <span slot="footer" class="dialog-footer">
+        <!--        <el-button type="primary" style="float: left;" @click="setMenuRole">设置权限</el-button>-->
+        <el-button @click="cancelAddForm">取 消</el-button>
+        <el-button type="primary" @click="submitAddForm">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+import { getStagecustomerListV2 } from '@/api/basic_data/dealer'
+import {
+  addJiaXianUser,
+  deleteRole,
+  editRole,
+  getJiaXianUserList,
+  getMenuList,
+  getRoleChecked,
+  setMenuRole,
+  editSubAccount
+} from '@/api/setting'
+
+export default {
+  data() {
+    return {
+      imageURL: this.$imageUrl,
+      dataList: null, // 列表数据
+      listLoading: true, // 列表加载loading
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+
+      editId: null,
+      addFormType: 'add',
+      addFormVisible: false,
+      addForm: {
+        name: '' // 角色名
+      },
+      addFormRules: {
+        name: [{ required: true, message: '请输入角色名', trigger: 'blur' }]
+      },
+
+      roleFormVisible: false,
+
+      menuRoleList: [],
+      defaultProps: {
+        children: 'children',
+        label: 'moduleName'
+      },
+      dialogVisible: false,
+      ruleForm: {
+        account: '',
+        password: '',
+        customerId: ''
+      },
+      rules: {
+        password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
+        customerId: [{ required: true, message: '请选择子经销商', trigger: 'blur' }]
+      },
+      subCustomerList: []
+    }
+  },
+  computed: {
+    ...mapGetters(['userid', 'name', 'customerId'])
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 查询按钮权限
+    checkBtnRole(value) {
+      // let btnRole = this.$route.meta.roles;
+      // if(!btnRole) {return true}
+      // let index = btnRole.indexOf(value);
+      // return index >= 0 ? true : false;
+      return true
+    },
+    // 获取子经销商
+    getStagecustomerListV2() {
+      getStagecustomerListV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          // {
+          //   param: 'a.higher_prant_number',
+          //   compare: 'like',
+          //   value: this.customerId
+          // }
+        ]
+      }).then(res => {
+        this.subCustomerList = res.data.records
+      })
+    },
+    getList() {
+      this.listLoading = true
+      const params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        customerId: this.customerId,
+        isMaster: false
+      }
+      getJiaXianUserList(params).then(res => {
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        this.listLoading = false
+      })
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      this.getList()
+    },
+
+    // 操作 - 删除
+    handleDelete(id) {
+      deleteRole({ adminRoleId: id }).then(res => {
+        this.getList()
+        this.$successMsg()
+      })
+    },
+
+    // 新增编辑
+    addOrEdit(type, row) {
+      this.addFormType = type
+      this.dialogVisible = true
+      if (type === 'edit') {
+        this.$nextTick(() => {
+          this.ruleForm = {
+            account: row.userName,
+            password: '',
+            adminUserId: row.adminUserId,
+            customerId: row.customerId
+          }
+        })
+      }
+      this.getStagecustomerListV2()
+    },
+
+    // 取消 新增编辑
+    cancelAddForm() {
+      this.dialogVisible = false
+      this.$nextTick(() => {
+        this.$refs.tree && this.$refs.tree.setCheckedKeys([])
+      })
+      this.$refs.ruleForm.resetFields()
+    },
+
+    // 提交 新增编辑
+    submitAddForm() {
+      this.$refs.ruleForm.validate(valid => {
+        const params = {
+          userName: this.ruleForm.account,
+          password: this.ruleForm.password,
+          customerId: this.ruleForm.customerId
+          // adminModuleIds:this.$refs.tree ? this.$refs.tree.getCheckedKeys().join(',') :
+        }
+        if (valid) {
+          if (this.addFormType === 'edit') {
+            params.adminUserId = this.ruleForm.adminUserId
+            editSubAccount(params).then(res => {
+              this.cancelAddForm()
+              this.getList()
+              this.$successMsg('编辑成功')
+            })
+          } else {
+            addJiaXianUser(params).then(res => {
+              this.cancelAddForm()
+              this.getList()
+              this.$successMsg('新增成功')
+            })
+          }
+        }
+      })
+    },
+
+    // 设置权限 - 获取列表
+    setMenuRole(id, type) {
+      this.roleFormVisible = true
+      this.editId = id
+      getMenuList({ adminUserId: this.userid }).then(res => {
+        this.menuRoleList = res.data
+      })
+      getRoleChecked({ adminUserId: id }).then(res => {
+        this.$refs.tree.setCheckedKeys(res.data)
+      })
+    },
+
+    // 设置权限 - 提交数据
+    submitRoleForm(type) {
+      const params = {
+        adminModuleIds: this.$refs.tree.getCheckedKeys().join(','),
+        adminRoleId: this.editId
+      }
+      setMenuRole(params).then(res => {
+        this.getList()
+        this.$successMsg()
+      })
+
+      this.roleFormVisible = false
+    },
+
+    // 一键全选
+    quickSelection(data) {
+      const nowChecked = this.$refs.tree.getCheckedKeys()
+      const thisId = data.moduleId
+      let childId = []
+      if (data.children.length) {
+        childId = this.familyTree(data.children)
+      }
+
+      const setChecked = nowChecked.concat([thisId]).concat(childId)
+
+      this.$refs.tree.setCheckedKeys(setChecked)
+    },
+
+    // 一键取消
+    quickCancel(data) {
+      const nowChecked = this.$refs.tree.getCheckedKeys()
+      const thisId = data.moduleId
+      let childId = []
+      if (data.children.length) {
+        childId = this.familyTree(data.children)
+      }
+
+      const setChecked = nowChecked
+      if (setChecked.indexOf(thisId) >= 0) {
+        setChecked.splice(setChecked.indexOf(thisId), 1)
+      }
+
+      if (childId.length) {
+        for (var i = 0; i < childId.length; i++) {
+          if (setChecked.indexOf(childId[i]) >= 0) {
+            setChecked.splice(setChecked.indexOf(childId[i]), 1)
+          }
+        }
+      }
+
+      this.$refs.tree.setCheckedKeys(setChecked)
+    },
+
+    // 递归子id
+    familyTree(arr) {
+      var temp = []
+      var forFn = function(list) {
+        for (var i = 0; i < list.length; i++) {
+          var item = list[i]
+          if (item.children) {
+            temp.push(item.moduleId)
+            forFn(item.children)
+          }
+        }
+      }
+      forFn(arr)
+      return temp
+    },
+
+    changeStatus(id, status) {
+      editRole({
+        adminRoleId: id,
+        visitSysStatus: status
+      }).then(res => {
+        this.getList()
+        this.$successMsg('编辑成功')
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .tree-dialog {
+  .el-dialog__body {
+    padding: 20px;
+    .el-tree {
+      max-height: calc(100vh - 140px - 54px - 70px);
+      overflow-y: scroll;
+      padding: 0 30px;
+      > .el-tree-node {
+        padding: 15px 0;
+        border: 1px dashed #ddd;
+        margin-bottom: 15px;
+        border-radius: 10px;
+      }
+    }
+  }
+}
+::v-deep .custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+</style>

+ 1 - 1
src/views/setting/sub_account.vue

@@ -248,7 +248,7 @@ export default {
     cancelAddForm() {
       this.dialogVisible = false
       this.$nextTick(() => {
-        this.$refs.tree.setCheckedKeys([])
+        this.$refs.tree && this.$refs.tree.setCheckedKeys([])
       })
       this.$refs.ruleForm.resetFields()
     },

+ 35 - 12
src/views/stock_control/preposition_stock_list.vue

@@ -1,30 +1,53 @@
 <template>
-  <template-page ref="pageRef" :getList="getList" :exportList="exportList" :columnParsing="columnParsing">
-  </template-page>
+  <template-page ref="pageRef" :get-list="getList" :export-list="exportList" :column-parsing="columnParsing" :options-evens-group="optionsEvensGroup" />
 </template>
 
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 
-import { getcustomerFrontList, partsNewInExport } from '@/api/stock'
+import { getcustomerFrontList, partsNewInExport, kunCunImportData, kunCunTiaoImportData, downloadkunCunDownload } from '@/api/stock'
 export default {
   components: { TemplatePage },
   mixins: [import_mixin],
   data() {
     return {
       // 事件组合
-      optionsEvensGroup: [
+      optionsEvensGroup: [[
         [
-          [
-            {
-              name: '批量删除',
-              click: this.dels,
-              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
-            }
-          ]
+          {
+            name: '导入',
+            render: this.importButton(kunCunImportData, '库存初始化')
+          }
+        ]
+      ],
+      [
+        [
+          {
+            name: '导入',
+            render: this.importButton(kunCunTiaoImportData, '库存调整')
+          }
         ]
       ],
+      [
+        [
+          {
+            name: '导入模版',
+            click: () => {
+              downloadkunCunDownload({}, `${this.$route.meta.title}`)
+                .then(_res => {
+                  this.$message({
+                    message: '下载成功',
+                    type: 'success'
+                  })
+                })
+                .catch(_err => {
+                  this.$message.error('下载失败')
+                })
+            }
+          }
+        ]
+      ]],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -46,7 +69,7 @@ export default {
     // 列表导出函数
     exportList: partsNewInExport,
     // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
+    columnParsing(_item, defaultData) {
       return defaultData
     },
     // 监听勾选变化

+ 17 - 51
src/views/stock_control/sales_management/components/customer_sales_details.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-    <el-page-header @back="handleBack" content="详情" style=" padding: 20px 20px 0 20px;"></el-page-header>
+    <el-page-header content="详情" style=" padding: 20px 20px 0 20px;" @back="handleBack" />
     <sales-header ref="header" />
-    <sales-table :dataList="dataList" :column="column"   @handleSelection="handleSelection">
+    <sales-table :data-list="dataList" :column="column" @handleSelection="handleSelection">
       <!--      <template #bts>-->
       <!--        <div>-->
       <!--          <el-button type="primary" size="mini" @click="dialogVisible=true">添加</el-button>-->
@@ -23,8 +23,8 @@
         </div>
       </template>
       <template v-slot:custom="{item:{row,$index}}">
-        <el-radio label="1" v-model="row.flag">增加</el-radio>
-        <el-radio label="-1" v-model="row.flag">减少</el-radio>
+        <el-radio v-model="row.flag" label="1">增加</el-radio>
+        <el-radio v-model="row.flag" label="-1">减少</el-radio>
       </template>
       <template v-slot:operation="{item:{row,$index}}">
         <el-popconfirm
@@ -35,46 +35,13 @@
           <el-button slot="reference" type="text" size="mini">删除</el-button>
         </el-popconfirm>
       </template>
-      <!--      <div>-->
-      <!--        <h5>物流信息</h5>-->
-      <!--        <div class="diy-table-1">-->
-      <!--          <el-row>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="6" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--            <el-col :span="24" class="item">-->
-      <!--              <div class="label">销售政策编号</div>-->
-      <!--              <div class="value">2222</div>-->
-      <!--            </el-col>-->
-      <!--          </el-row>-->
-      <!--        </div>-->
-      <!--        <el-timeline :reverse="reverse">-->
-      <!--          <el-timeline-item-->
-      <!--            v-for="(activity, index) in activities"-->
-      <!--            :key="index"-->
-      <!--            :timestamp="activity.timestamp"-->
-      <!--            :color="activity.color"-->
-      <!--          >-->
-      <!--            {{ activity.content }}-->
-      <!--          </el-timeline-item>-->
-      <!--        </el-timeline>-->
-      <!--      </div>-->
     </sales-table>
-    <sales-dialog :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList"
-                  @confirm="confirm"
+    <LogisticsTabs />
+    <sales-dialog
+      :dialog-visible="dialogVisible"
+      :customer-number="customerNumber"
+      :func="getDialogList"
+      @confirm="confirm"
     />
   </div>
 </template>
@@ -85,15 +52,17 @@ import SalesHeader from '@/components/SalesHeader/SalesHeader'
 import SalesTable from '@/components/SalesTable/SalesTable'
 import { addFrontOrder, getFrontOrderDetail, sbumitFrontOrder } from '@/api/sales'
 import { getcustomerFrontList } from '@/api/stock'
+import LogisticsTabs from '@/components/LogisticsTabs'
 
 export default {
   name: 'WarehouseForm',
   components: {
     SalesHeader,
     SalesTable,
-    SalesDialog
+    SalesDialog,
+    LogisticsTabs
   },
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,
@@ -126,7 +95,7 @@ export default {
         {
           prop: 'qty',
           label: '数量',
-          width: '180',
+          width: '180'
         },
         {
           prop: 'volume',
@@ -141,7 +110,7 @@ export default {
         {
           prop: 'notes',
           label: '备注',
-          width: '180',
+          width: '180'
 
         }
       ],
@@ -172,7 +141,6 @@ export default {
         this.$refs.header.screenForm.areaId = res.data.area
         this.$refs.header.screenForm.streetId = res.data.street
         this.$refs.header.screenForm.stockType = res.data.stockType == 1 ? '前置仓' : '商家仓'
-
       })
     }
   },
@@ -187,7 +155,6 @@ export default {
       this.$refs.header.screenForm.customerNumber = this.dataList[0].customerNumber
       this.customerNumber = this.dataList[0].customerNumber
       this.dialogVisible = false
-
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
@@ -236,11 +203,10 @@ export default {
         this.$successMsg('退货通知')
       })
     },
-     handleBack() {
+    handleBack() {
       this.$emit('close')
     }
 
-
   }
 }
 </script>

+ 17 - 15
src/views/stock_control/sales_management/components/customer_sales_form.vue

@@ -1,9 +1,12 @@
 <template>
   <div>
-    <el-page-header @back="handleBack" :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;"
-    ></el-page-header>
+    <el-page-header
+      :content="detailsId?'编辑':'新增'"
+      style=" padding: 20px 20px 0 20px;"
+      @back="handleBack"
+    />
     <sales-header ref="header" />
-    <sales-table :dataList="dataList" :column="column" isOperation isSelection @handleSelection="handleSelection">
+    <sales-table :data-list="dataList" :column="column" is-operation is-selection @handleSelection="handleSelection">
       <template #bts>
         <div>
           <el-button type="primary" size="mini" @click="dialogVisible=true">添加</el-button>
@@ -22,8 +25,8 @@
         </div>
       </template>
       <template v-slot:custom="{item:{row,$index}}">
-        <el-radio label="1" v-model="row.flag">增加</el-radio>
-        <el-radio label="-1" v-model="row.flag">减少</el-radio>
+        <el-radio v-model="row.flag" label="1">增加</el-radio>
+        <el-radio v-model="row.flag" label="-1">减少</el-radio>
       </template>
       <template v-slot:operation="{item:{row,$index}}">
         <el-popconfirm
@@ -35,8 +38,12 @@
         </el-popconfirm>
       </template>
     </sales-table>
-    <sales-dialog :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList"
-                  @confirm="confirm"
+    <sales-dialog
+      :data-list="dataList"
+      :dialog-visible="dialogVisible"
+      :customer-number="customerNumber"
+      :func="getDialogList"
+      @confirm="confirm"
     />
   </div>
 </template>
@@ -55,14 +62,14 @@ export default {
     SalesTable,
     SalesDialog
   },
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,
       customerNumber: '',
       dataList: [],
       selection: [],
-      disabled:false,
+      disabled: false,
       flag: 1,
       dis: true,
       column: [
@@ -118,7 +125,7 @@ export default {
       getFrontOrderDetail({ id: this.detailsId }).then(res => {
         this.dataList = res.data.orders
         this.$refs.header.screenForm = res.data
-        this.$refs.header.screenForm.disabled =this.disabled  = res.data.status !== 1?true:false
+        this.$refs.header.screenForm.disabled = this.disabled = res.data.status !== 1
 
         this.$refs.header.screenForm.provinceId = res.data.province
         this.$refs.header.screenForm.cityId = res.data.city
@@ -143,7 +150,6 @@ export default {
       this.$refs.header.screenForm.stockType = this.dataList[0].stockType
       this.customerNumber = this.dataList[0].customerNumber
       this.dialogVisible = false
-
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
@@ -152,7 +158,6 @@ export default {
           this.$refs.header.screenForm = {}
           this.customerNumber = ''
         })
-
       }
     },
     delChange() {
@@ -169,7 +174,6 @@ export default {
           this.$refs.header.screenForm = {}
           this.customerNumber = ''
         })
-
       }
     },
     handleSelection(data) {
@@ -211,14 +215,12 @@ export default {
 
           this.$forceUpdate()
         })
-
       } else {
         updateFrontOrder(params).then(res => {
           this.$successMsg('编辑成功')
           this.handleBack()
           this.$forceUpdate()
         })
-
       }
     },
     handleBack() {

+ 19 - 15
src/views/stock_control/sales_management/components/return_sales_details.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-    <el-page-header @back="handleBack" content="详情" style=" padding: 20px 20px 0 20px;"></el-page-header>
+    <el-page-header content="详情" style=" padding: 20px 20px 0 20px;" @back="handleBack" />
     <return-sales-header ref="header" :details="details" />
-    <sales-table :dataList="dataList" :column="column"   @handleSelection="handleSelection">
+    <sales-table :data-list="dataList" :column="column" @handleSelection="handleSelection">
       <template #bts>
         <div>
           <el-button type="primary" size="mini" @click="dialogVisible=true">添加</el-button>
@@ -17,8 +17,8 @@
       </template>
 
       <template v-slot:custom="{item:{row,$index}}">
-        <el-radio label="1" v-model="row.flag">增加</el-radio>
-        <el-radio label="-1" v-model="row.flag">减少</el-radio>
+        <el-radio v-model="row.flag" label="1">增加</el-radio>
+        <el-radio v-model="row.flag" label="-1">减少</el-radio>
       </template>
       <template v-slot:operation="{item:{row,$index}}">
         <el-popconfirm
@@ -30,8 +30,12 @@
         </el-popconfirm>
       </template>
     </sales-table>
-    <sales-dialog :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList"
-                  @confirm="confirm"
+    <LogisticsTabs />
+    <sales-dialog
+      :dialog-visible="dialogVisible"
+      :customer-number="customerNumber"
+      :func="getDialogList"
+      @confirm="confirm"
     />
   </div>
 </template>
@@ -42,15 +46,17 @@ import ReturnSalesHeader from '@/components/ReturnSalesHeader/ReturnSalesHeader'
 import SalesTable from '@/components/SalesTable/SalesTable'
 import { addFrontOrder, detailRefund, sbumitFrontOrder, sendRefund } from '@/api/sales'
 import { getcustomerFrontList } from '@/api/stock'
+import LogisticsTabs from '@/components/LogisticsTabs'
 
 export default {
   name: 'WarehouseForm',
   components: {
     ReturnSalesHeader,
     SalesTable,
-    SalesDialog
+    SalesDialog,
+    LogisticsTabs
   },
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,
@@ -83,7 +89,7 @@ export default {
         {
           prop: 'qty',
           label: '数量',
-          width: '180',
+          width: '180'
         },
         {
           prop: 'volume',
@@ -98,7 +104,7 @@ export default {
         {
           prop: 'notes',
           label: '备注',
-          width: '180',
+          width: '180'
 
         }
       ]
@@ -123,7 +129,6 @@ export default {
       this.$refs.header.screenForm.customerNumber = this.dataList[0].customerNumber
       this.customerNumber = this.dataList[0].customerNumber
       this.dialogVisible = false
-
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
@@ -145,7 +150,6 @@ export default {
       console.log(33)
       sendRefund({ id: this.details.id, status }).then(res => {
         this.$successMsg('退货通知')
-
       })
     },
     handelSubmit() {
@@ -159,13 +163,13 @@ export default {
       }
       addFrontOrder(params).then(res => {
         this.$successMsg('新增成功')
-      this.handleBack()
+        this.handleBack()
         this.$forceUpdate()
       })
     },
-    handleBack(){
+    handleBack() {
       this.$emit('close')
-    },
+    }
 
   }
 }

+ 39 - 41
src/views/stock_control/sales_management/components/return_sales_form.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-    <el-page-header @back="handleBack" :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;"></el-page-header>
-    <return-sales-header ref="header" :details="details"/>
-    <sales-table :dataList="dataList" :column="column" isOperation isSelection @handleSelection="handleSelection">
+    <el-page-header :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;" @back="handleBack" />
+    <return-sales-header ref="header" :details="details" />
+    <sales-table :data-list="dataList" :column="column" is-operation is-selection @handleSelection="handleSelection">
       <template #bts>
         <div>
           <el-button type="primary" size="mini" @click="dialogVisible=true">添加</el-button>
@@ -22,8 +22,8 @@
 
       </template>
       <template v-slot:custom="{item:{row,$index}}">
-        <el-radio label="1" v-model="row.flag">增加</el-radio>
-        <el-radio label="-1" v-model="row.flag">减少</el-radio>
+        <el-radio v-model="row.flag" label="1">增加</el-radio>
+        <el-radio v-model="row.flag" label="-1">减少</el-radio>
       </template>
       <template v-slot:operation="{item:{row,$index}}">
         <el-popconfirm
@@ -35,7 +35,7 @@
         </el-popconfirm>
       </template>
     </sales-table>
-    <sales-dialog :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList" @confirm="confirm" />
+    <sales-dialog :data-list="dataList" :dialog-visible="dialogVisible" :customer-number="customerNumber" :func="getDialogList" @confirm="confirm" />
   </div>
 </template>
 
@@ -60,16 +60,16 @@ export default {
     SalesTable,
     SalesDialog
   },
-  props:['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,
-      customerNumber:'',
+      customerNumber: '',
       dataList: [],
       selection: [],
-      flag:1,
-      dis:true,
-      details:{},
+      flag: 1,
+      dis: true,
+      details: {},
       column: [
         {
           prop: 'materialName',
@@ -100,7 +100,7 @@ export default {
         {
           prop: 'qty',
           label: '已退数量',
-          width: '180',
+          width: '180'
         },
         {
           prop: 'volume',
@@ -117,20 +117,20 @@ export default {
           label: '备注',
           width: '180',
           isInput: true,
-          type:'text'
+          type: 'text'
         }
       ]
     }
   },
   created() {
     if (this.detailsId) {
-      detailRefund({id:this.detailsId}).then(res=>{
+      detailRefund({ id: this.detailsId }).then(res => {
         this.dataList = res.data.orders
         this.details = res.data
         this.details.customerOrderNo = this.dataList[0].id
-        this.customerNumber=this.dataList[0].customerNumber
+        this.customerNumber = this.dataList[0].customerNumber
       })
-    }else{
+    } else {
       Object.assign(this.$data, this.$options.data())
     }
   },
@@ -146,20 +146,19 @@ export default {
       this.details = this.dataList[0]
       this.details.customerOrderNo = this.dataList[0].id
       this.details.id = ''
-      this.customerNumber=this.dataList[0].customerNumber
-       // this.$refs.header.details.customerName = this.dataList[0].customerName
-       // this.$refs.header.details.customerNumber = this.dataList[0].customerNumber
-       // this.$refs.header.details.customerNumber = this.dataList[0].pickTime
-       // this.$refs.header.details.customerNumber = this.dataList[0].userName
-       // this.$refs.header.details.customerNumber = this.dataList[0].phone
-       // this.$refs.header.details.customerNumber = this.dataList[0].stockType
+      this.customerNumber = this.dataList[0].customerNumber
+      // this.$refs.header.details.customerName = this.dataList[0].customerName
+      // this.$refs.header.details.customerNumber = this.dataList[0].customerNumber
+      // this.$refs.header.details.customerNumber = this.dataList[0].pickTime
+      // this.$refs.header.details.customerNumber = this.dataList[0].userName
+      // this.$refs.header.details.customerNumber = this.dataList[0].phone
+      // this.$refs.header.details.customerNumber = this.dataList[0].stockType
       this.dialogVisible = false
-
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
-      if (!this.dataList.length){
-        this.$nextTick(()=>{
+      if (!this.dataList.length) {
+        this.$nextTick(() => {
           this.details = {}
           this.customerNumber = ''
         })
@@ -174,8 +173,8 @@ export default {
           }
         })
       })
-      if (!this.dataList.length){
-        this.$nextTick(()=>{
+      if (!this.dataList.length) {
+        this.$nextTick(() => {
           this.details = {}
           this.customerNumber = ''
         })
@@ -185,16 +184,16 @@ export default {
       this.selection = data
     },
 
-    handelSubmit(type,status=1) {
-      if (!this.dataList.length){
+    handelSubmit(type, status = 1) {
+      if (!this.dataList.length) {
         this.$errorMsg('请添加产品')
         return
       }
       for (let i = 0; i < this.dataList.length; i++) {
         this.dataList[i].id = ''
         this.dataList[i].directFlag = this.dataList[i].flag
-        if (Number(this.dataList[i].refundQty)<0 || !this.dataList[i].refundQty){
-          this.$errorMsg(`第${i+1}产品退货数量有误`)
+        if (Number(this.dataList[i].refundQty) < 0 || !this.dataList[i].refundQty) {
+          this.$errorMsg(`第${i + 1}产品退货数量有误`)
           return
         }
       }
@@ -202,31 +201,30 @@ export default {
       const params = {
         ...this.$refs.header.details,
         orders: this.dataList,
-        customerOrderNo:this.details.customerOrderNo,
+        customerOrderNo: this.details.customerOrderNo,
         status
       }
-      if (type===1){
+      if (type === 1) {
         params.id = ''
         addRefund(params).then(res => {
           this.$successMsg('新增成功')
           // this.pageType = 0
-          this.dis =false
+          this.dis = false
           this.$forceUpdate()
         })
-
-      }else {
-        updateRefund(params).then(res=>{
+      } else {
+        updateRefund(params).then(res => {
           this.$successMsg('编辑成功')
           this.handleBack()
           this.$forceUpdate()
         })
       }
     },
-    handleBack(){
+    handleBack() {
       this.$emit('close')
     },
-    handleInform(status=2){
-      sendRefund({id:this.$refs.header.details.id,status})
+    handleInform(status = 2) {
+      sendRefund({ id: this.$refs.header.details.id, status })
     }
 
   }

+ 104 - 105
src/views/supply/apply/engin_list.vue

@@ -1,15 +1,15 @@
 <template>
   <template-page
     ref="pageRef"
-    :getList="getList"
+    :get-list="getList"
     :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-    :operationColumnWidth="200"
-    :replaceOrNotMap="false"
+    :options-evens-group="optionsEvensGroup"
+    :export-list="exportList"
+    :column-parsing="columnParsing"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :operation-column-width="200"
+    :replace-or-not-map="false"
   >
     <ExamineDialog :is-show.sync="isShowExamineDialog" :examine-form.sync="examineForm" @submit="submitExamineForm" />
 
@@ -17,7 +17,7 @@
       <EnginDetail v-if="isShowDetail" ref="refDetail" :list-item="queryItem" @backListFormDetail="backList" />
       <EnginExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
       <EnginForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
-      <EnginReturnForm v-if="isShowReturnForm" :isShow="isShow" :list-item="queryItem" @backListFormDetail="backList" />
+      <EnginReturnForm v-if="isShowReturnForm" :is-show="isShow" :list-item="queryItem" @backListFormDetail="backList" />
     </Popu>
   </template-page>
 </template>
@@ -86,7 +86,7 @@ export default {
           [
             {
               name: '批量审批',
-              click: async () => {
+              click: async() => {
                 if (this.recordSelected.length === 0) {
                   this.$message.error('请选择需要批量审批的数据')
                   return
@@ -234,7 +234,7 @@ export default {
   methods: {
     // 列表请求函数
     getList(...p) {
-      let params = {
+      const params = {
         ...p[0]
       }
       return invoiceListProjectV2(params)
@@ -251,7 +251,7 @@ export default {
     },
     fieldBeansHook(val) {
       if (this.isCustomer !== '') {
-        let res = val.filter(
+        const res = val.filter(
           v => v.jname !== 'refPowerCategory' && v.jname !== 'geLiInerNote' && v.jname !== 'geLiNote'
         )
         return res
@@ -262,7 +262,7 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             {this.$checkBtnRole('apply', this.$route.meta.roles) &&
             ((!this.isCustomer &&
               !row.automaticStatus &&
@@ -275,121 +275,120 @@ export default {
                 row.automaticStatus &&
                 (row.examineStatus === 'SAVE' || row.examineStatus === 'FAIL') &&
                 row.type === 2)) ? (
-              <el-popconfirm
-                onOnConfirm={async () => {
-                  this.handleSubmit(row.id, 'WAIT')
-                }}
-                title="是否确定需要申请该项内容?"
-              >
-                <el-button slot="reference" size="mini" type="text">
+                <el-popconfirm
+                  onOnConfirm={async() => {
+                    this.handleSubmit(row.id, 'WAIT')
+                  }}
+                  title='是否确定需要申请该项内容?'
+                >
+                  <el-button slot='reference' size='mini' type='text'>
                   申请
-                </el-button>
-              </el-popconfirm>
-            ) : (
-              ''
-            )}
+                  </el-button>
+                </el-popconfirm>
+              ) : (
+                ''
+              )}
 
             {this.$checkBtnRole('apply', this.$route.meta.roles) &&
             ((!this.isCustomer && !row.automaticStatus && row.examineStatus === 'WAIT') ||
               (this.isCustomer && !row.automaticStatus && row.examineStatus === 'WAIT' && row.type != 2) ||
               (!this.isCustomer && row.automaticStatus && row.examineStatus === 'WAIT' && row.type == 2)) ? (
-              <el-popconfirm
-                onOnConfirm={async () => {
-                  this.handleSubmit(row.id, 'SAVE')
-                }}
-                title="是否确定需要撤回该项内容?"
-              >
-                <el-button slot="reference" size="mini" type="text">
+                <el-popconfirm
+                  onOnConfirm={async() => {
+                    this.handleSubmit(row.id, 'SAVE')
+                  }}
+                  title='是否确定需要撤回该项内容?'
+                >
+                  <el-button slot='reference' size='mini' type='text'>
                   撤回
-                </el-button>
-              </el-popconfirm>
-            ) : (
-              ''
-            )}
+                  </el-button>
+                </el-popconfirm>
+              ) : (
+                ''
+              )}
 
             {this.$checkBtnRole('examine', this.$route.meta.roles) &&
             ((!this.isCustomer && !row.automaticStatus && row.examineStatus === 'OK') ||
               (this.isCustomer && !row.automaticStatus && row.examineStatus === 'OK' && row.type != 2) ||
               (!this.isCustomer && row.automaticStatus && row.examineStatus === 'OK' && row.type == 2)) ? (
-              <el-popconfirm
-                onOnConfirm={async () => {
-                  this.handleAbandon(row.id)
-                }}
-                title="是否确定需要弃审该项内容?"
-              >
-                <el-button slot="reference" size="mini" type="text">
+                <el-popconfirm
+                  onOnConfirm={async() => {
+                    this.handleAbandon(row.id)
+                  }}
+                  title='是否确定需要弃审该项内容?'
+                >
+                  <el-button slot='reference' size='mini' type='text'>
                   弃审
-                </el-button>
-              </el-popconfirm>
-            ) : (
-              ''
-            )}
+                  </el-button>
+                </el-popconfirm>
+              ) : (
+                ''
+              )}
 
             {this.$checkBtnRole('edit', this.$route.meta.roles) &&
-            !row.automaticStatus &&
+            (!row.automaticStatus &&
             (row.examineStatus === 'SAVE' || row.examineStatus === 'FAIL') &&
-            row.type === 1 ? (
-              <el-button
-                size="mini"
-                type="text"
-                onClick={async () => {
-                  this.toForm(row)
-                }}
-              >
+            row.type === 1) || (this.isCustomer &&
+                !row.automaticStatus &&
+                (row.examineStatus === 'SAVE' || row.examineStatus === 'FAIL') &&
+                row.type != 2 &&
+                row.type !== 1) ? (
+                <el-button
+                  size='mini'
+                  type='text'
+                  onClick={async() => {
+                    this.toForm(row)
+                  }}
+                >
                 编辑
-              </el-button>
-            ) : (
-              ''
-            )}
+                </el-button>
+              ) : (
+                ''
+              )}
 
             {this.$checkBtnRole('edit', this.$route.meta.roles) &&
             ((!this.isCustomer &&
               !row.automaticStatus &&
               (row.examineStatus === 'SAVE' || row.examineStatus === 'FAIL') &&
               row.type === 2) ||
-              (this.isCustomer &&
-                !row.automaticStatus &&
-                (row.examineStatus === 'SAVE' || row.examineStatus === 'FAIL') &&
-                row.type != 2 &&
-                row.type !== 1) ||
               (!this.isCustomer &&
                 row.automaticStatus &&
                 (row.examineStatus === 'SAVE' || row.examineStatus === 'FAIL') &&
                 row.type === 2)) ? (
-              <el-button
-                size="mini"
-                type="text"
-                onClick={async () => {
-                  this.toReturnForm(row)
-                }}
-              >
+                <el-button
+                  size='mini'
+                  type='text'
+                  onClick={async() => {
+                    this.toReturnForm(row)
+                  }}
+                >
                 编辑
-              </el-button>
-            ) : (
-              ''
-            )}
+                </el-button>
+              ) : (
+                ''
+              )}
 
             {this.$checkBtnRole('examine', this.$route.meta.roles) &&
             ((!this.isCustomer && !row.automaticStatus && row.examineStatus === 'WAIT') ||
               (this.isCustomer && !row.automaticStatus && row.examineStatus === 'WAIT' && row.type != 2) ||
               (!this.isCustomer && row.automaticStatus && row.examineStatus === 'WAIT' && row.type == 2)) ? (
-              <el-button
-                size="mini"
-                type="text"
-                onClick={async () => {
-                  this.toExamine(row)
-                }}
-              >
+                <el-button
+                  size='mini'
+                  type='text'
+                  onClick={async() => {
+                    this.toExamine(row)
+                  }}
+                >
                 审核
-              </el-button>
-            ) : (
-              ''
-            )}
+                </el-button>
+              ) : (
+                ''
+              )}
 
             <el-button
-              size="mini"
-              type="text"
-              onClick={async () => {
+              size='mini'
+              type='text'
+              onClick={async() => {
                 this.toDetail(row)
               }}
             >
@@ -400,19 +399,19 @@ export default {
             ((!this.isCustomer && !row.automaticStatus && row.examineStatus !== 'OK') ||
               (this.isCustomer && !row.automaticStatus && row.examineStatus !== 'OK' && row.type != 2) ||
               (!this.isCustomer && row.automaticStatus && row.examineStatus !== 'OK' && row.type == 2)) ? (
-              <el-popconfirm
-                onOnConfirm={async () => {
-                  this.handleDelete(row.id)
-                }}
-                title="是否确定需要删除该项内容?"
-              >
-                <el-button slot="reference" size="mini" type="text">
+                <el-popconfirm
+                  onOnConfirm={async() => {
+                    this.handleDelete(row.id)
+                  }}
+                  title='是否确定需要删除该项内容?'
+                >
+                  <el-button slot='reference' size='mini' type='text'>
                   删除
-                </el-button>
-              </el-popconfirm>
-            ) : (
-              ''
-            )}
+                  </el-button>
+                </el-popconfirm>
+              ) : (
+                ''
+              )}
           </div>
         )
       }
@@ -612,7 +611,7 @@ export default {
      * @param {String} index - 索引值
      * @return Boolean
      */
-    selectable: function (row, index) {
+    selectable: function(row, index) {
       if (row.automaticStatus) {
         return false
       }

+ 114 - 274
src/views/supply/engin/components/home_detail.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="detail-container">
     <div v-show="!isShowCheckOrder">
-      <el-page-header @back="goBack" content="详情"></el-page-header>
+      <el-page-header content="详情" @back="goBack" />
 
       <div id="printData">
         <div class="main-title">
@@ -110,6 +110,14 @@
               <div class="label">业务员</div>
               <div class="value">{{ detailData.serviceName }}</div>
             </el-col>
+            <el-col :span="8" class="item">
+              <div class="label">登录有效期</div>
+              <div class="value">{{ detailData.refBillsExpireDate }}</div>
+            </el-col>
+            <el-col :span="8" class="item">
+              <div class="label">项目编号</div>
+              <div class="value">{{ detailData.projectNo }}</div>
+            </el-col>
             <!-- <el-col :span="24" class="item">
               <div class="label">格力回复</div>
               <div class="value">{{detailData.note1}}</div>
@@ -123,14 +131,26 @@
               <div class="value">{{ detailData.refProjectType }}</div>
             </el-col>
             <el-col :span="24" class="item">
+              <div class="label">工程机转零售批复意见</div>
+              <div class="value">{{ detailData.refToRetailIdea }}</div>
+            </el-col>
+            <el-col :span="24" class="item">
+              <div class="label">合同变更批复意见</div>
+              <div class="value">{{ detailData.refContractIdea }}</div>
+            </el-col>
+            <el-col :span="24" class="item">
+              <div class="label">资料延期批复意见</div>
+              <div class="value">{{ detailData.refDataDelayIdea }}</div>
+            </el-col>
+            <el-col :span="24" class="item">
               <div class="label">其他附件审批意见</div>
               <div class="value">{{ detailData.refOtherAnnexIdea }}</div>
             </el-col>
-            <el-col :span="24" class="item" v-if="!isDealer">
+            <el-col v-if="!isDealer" :span="24" class="item">
               <div class="label">格力内部备注</div>
               <div class="value">
-                <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注"></el-input>
-                <el-divider direction="vertical"></el-divider>
+                <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注" />
+                <el-divider direction="vertical" />
                 <el-button type="text" @click="saveRemark">保存备注</el-button>
               </div>
             </el-col>
@@ -174,7 +194,7 @@
               <div class="label">审批说明</div>
               <div class="value">{{ detailData.examineNote }}</div>
             </el-col>
-            <el-col :span="24" class="item" v-if="!isDealer">
+            <el-col v-if="!isDealer" :span="24" class="item">
               <div class="label">引用记录</div>
               <div class="value">
                 {{ detailData.items[0] && detailData.items[0].useRefCount }}
@@ -199,42 +219,24 @@
             show-summary
             :summary-method="$getSummaries"
           >
-            <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-            <el-table-column
-              align="left"
-              label="销售类型"
-              prop="saleTypeName"
-              min-width="100"
-              show-overflow-tooltip
-            ></el-table-column>
+            <el-table-column align="center" label="序号" type="index" width="50" />
+            <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
             <el-table-column
               align="left"
               label="物料编码"
               prop="materialNumber"
               min-width="120"
               show-overflow-tooltip
-            ></el-table-column>
+            />
             <el-table-column
               align="left"
               label="产品编码"
               prop="materialOldNumber"
               min-width="120"
               show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="产品名称"
-              prop="materialName"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="规格型号"
-              prop="specification"
-              min-width="350"
-              show-overflow-tooltip
-            ></el-table-column>
+            />
+            <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip />
             <el-table-column
               align="left"
               label="实装规格型号"
@@ -248,13 +250,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column
-              align="right"
-              label="数量"
-              prop="qty"
-              min-width="100"
-              show-overflow-tooltip
-            ></el-table-column>
+            <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
             <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.price | numToFixed }}
@@ -266,20 +262,14 @@
               </template>
             </el-table-column>
 
-            <el-table-column
-              align="right"
-              label="工程登录数量"
-              prop="enginNum"
-              min-width="120"
-              show-overflow-tooltip
-            ></el-table-column>
+            <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip />
             <el-table-column
               align="left"
               label="现金钱包"
               prop="customerWalletName"
               min-width="100"
               show-overflow-tooltip
-            ></el-table-column>
+            />
 
             <el-table-column
               align="right"
@@ -287,7 +277,7 @@
               prop="customerWalletName2"
               min-width="100"
               show-overflow-tooltip
-            ></el-table-column>
+            />
             <el-table-column
               align="right"
               label="实付返利金额"
@@ -310,6 +300,15 @@
               </template>
             </el-table-column>
             <el-table-column
+              align="right"
+              label="退订数量"
+              prop="retiredQty"
+              min-width="100"
+              show-overflow-tooltip
+            />
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="100" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="100" show-overflow-tooltip />
+            <el-table-column
               align="left"
               label="是否直调"
               prop="isDirectTransfer"
@@ -326,23 +325,11 @@
               prop="directTransferQty"
               min-width="100"
               show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="right"
-              label="已发货数量"
-              prop="hasSendQty"
-              min-width="100"
-              show-overflow-tooltip
-            ></el-table-column>
+            />
+            <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
 
             <!-- <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column> -->
-            <el-table-column
-              align="left"
-              label="备注"
-              prop="remark"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
+            <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
             <el-table-column
               align="left"
               label="实装物料编号"
@@ -369,23 +356,11 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column
-              align="left"
-              label="税率"
-              prop="tax"
-              min-width="100"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="单位"
-              prop="unit"
-              min-width="100"
-              show-overflow-tooltip
-            ></el-table-column>
+            <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
+            <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
           </el-table>
         </div>
-        <div class="table" style="margin-top: 20px" v-if="detailData.examineStatus == 'OK'">
+        <div v-if="detailData.examineStatus == 'OK'" class="table" style="margin-top: 20px">
           <el-table
             :data="detailData.refundNoteList"
             element-loading-text="Loading"
@@ -397,10 +372,10 @@
             show-summary
             :summary-method="$getSummaries"
           >
-            <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-            <el-table-column align="left" label="创建人" prop="createBy" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="创建时间" prop="createTime" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="退订说明" prop="refundNote" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="序号" type="index" width="50" />
+            <el-table-column align="left" label="创建人" prop="createBy" show-overflow-tooltip />
+            <el-table-column align="left" label="创建时间" prop="createTime" show-overflow-tooltip />
+            <el-table-column align="left" label="退订说明" prop="refundNote" show-overflow-tooltip />
           </el-table>
         </div>
       </div>
@@ -409,22 +384,23 @@
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
           <el-button
+            v-if="!isDealer && (detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT')"
             type="danger"
             @click="closeData"
-            v-if="!isDealer && (detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT')"
-            >关闭订单</el-button
-          >
+          >关闭订单</el-button>
           <!-- <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button> -->
-          <el-button type="primary" @click="overData" :disabled="detailData.directTransferStatus" v-if="!isDealer"
-            >直调完结</el-button
-          >
           <el-button
+            v-if="!isDealer"
             type="primary"
-            @click="openDeliverDialog"
             :disabled="detailData.directTransferStatus"
+            @click="overData"
+          >直调完结</el-button>
+          <el-button
             v-if="!isDealer"
-            >直调发货</el-button
-          >
+            type="primary"
+            :disabled="detailData.directTransferStatus"
+            @click="openDeliverDialog"
+          >直调发货</el-button>
           <el-button @click="goBack">返回列表</el-button>
         </div>
       </div>
@@ -455,13 +431,13 @@
           <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="选择仓位" prop="position">
               <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
-                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="发货申请备注" prop="remark">
-              <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable></el-input>
+              <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -477,56 +453,20 @@
           stripe
           max-height="400"
         >
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column
-            align="center"
-            label="销售类型"
-            prop="saleTypeName"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
+          <el-table-column align="center" label="序号" type="index" width="50" />
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
           <el-table-column
             align="center"
             label="物料编码"
             prop="materialNumber"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="产品名称"
-            prop="materialName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="规格型号"
-            prop="specification"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="单位"
-            prop="unit"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="right"
-            label="订单数量"
-            prop="qty"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="right"
-            label="发货数量"
-            prop="hasSendQty"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
+          />
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
+          <el-table-column align="right" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip />
+          <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
           <el-table-column
             align="right"
             label="直调数量"
@@ -541,42 +481,24 @@
                 size="small"
                 type="number"
                 @mousewheel.native.prevent
-              ></el-input>
+              />
             </template>
           </el-table-column>
-          <el-table-column
-            align="right"
-            label="单价"
-            prop="price"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="right"
-            label="金额"
-            prop="totalAmount"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
+          <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip />
+          <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip />
           <el-table-column
             align="right"
             label="实际返利金额"
             prop="payRebateAmount"
             min-width="110"
             show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="备注"
-            prop="remark"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
+          />
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeDeliverDialog">取 消</el-button>
-        <el-button type="primary" @click="submitDeliverForm" :loading="formLoading">确 定</el-button>
+        <el-button type="primary" :loading="formLoading" @click="submitDeliverForm">确 定</el-button>
       </span>
     </el-dialog>
 
@@ -599,12 +521,7 @@
                 filterable
                 @change="changeWarehouse1"
               >
-                <el-option
-                  v-for="item in warehouseList1"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                ></el-option>
+                <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -617,7 +534,7 @@
                 filterable
                 @change="changePosition1"
               >
-                <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -630,12 +547,7 @@
                 filterable
                 @change="changeWarehouse2"
               >
-                <el-option
-                  v-for="item in warehouseList2"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                ></el-option>
+                <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -648,7 +560,7 @@
                 filterable
                 @change="changePosition2"
               >
-                <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -665,120 +577,48 @@
           stripe
           max-height="400"
         >
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column
-            align="center"
-            label="销售类型"
-            prop="saleTypeName"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
+          <el-table-column align="center" label="序号" type="index" width="50" />
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
           <el-table-column
             align="center"
             label="物料代码"
             prop="materialNumber"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="产品编码"
             prop="materialOldNumber"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="产品名称"
-            prop="materialName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="规格型号"
-            prop="specification"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="单位"
-            prop="unit"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="数量"
-            prop="qty"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="调出仓库"
-            prop="warehouse1"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="调出仓位"
-            prop="position1"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="调入仓库"
-            prop="warehouse2"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="调入仓位"
-            prop="position2"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="调出库存状态"
-            prop="status1"
-            min-width="110"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="调入库存状态"
-            prop="status2"
-            min-width="110"
-            show-overflow-tooltip
-          ></el-table-column>
+          />
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip />
+          <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip />
           <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
             <template slot-scope="">弘格</template>
           </el-table-column>
           <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
             <template slot-="scope">弘格</template>
           </el-table-column>
-          <el-table-column
-            align="center"
-            label="备注"
-            prop="remark"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeDirectDialog">取 消</el-button>
-        <el-button type="primary" @click="submitDirectForm" :loading="formLoading">确 定</el-button>
+        <el-button type="primary" :loading="formLoading" @click="submitDirectForm">确 定</el-button>
       </span>
     </el-dialog>
 
-    <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
+    <CheckOrder v-if="isShowCheckOrder" :check-order-id="checkOrderId" @backDetail="backDetail" />
   </div>
 </template>
 
@@ -801,7 +641,6 @@ export default {
   components: {
     CheckOrder
   },
-  props: ['listItem'],
   filters: {
     statusFilter(val) {
       const statusList = [
@@ -811,10 +650,11 @@ export default {
         // { label: '审核驳回', value: 'FAIL' },,
         { label: '已关闭', value: 'CLOSE' }
       ]
-      let obj = statusList.find(o => o.value == val)
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
       detailData: {},
@@ -957,7 +797,7 @@ export default {
     // 更改仓库
     changeWarehouse() {
       this.deliverForm.position = ''
-      let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse)
+      const obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse)
       this.positionList = obj.kingDeeStocks
     },
 
@@ -992,7 +832,7 @@ export default {
               return
             }
           }
-          let params = {
+          const params = {
             enginOrderId: this.detailData.enginOrderId,
             enginOrderType: 'HOME', // TRADE=商用 HOME=家用
             deliverDate: '',
@@ -1018,7 +858,7 @@ export default {
     // 更改调出仓库
     changeWarehouse1() {
       this.directForm.position1 = ''
-      let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
+      const obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
       this.positionList1 = obj.kingDeeStocks
       this.directGoodsList.forEach(item => {
         item.warehouse1 = obj.name
@@ -1028,7 +868,7 @@ export default {
     // 更改调入仓库
     changeWarehouse2() {
       this.directForm.position2 = ''
-      let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
+      const obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
       this.positionList2 = obj.kingDeeStocks
       this.directGoodsList.forEach(item => {
         item.warehouse2 = obj.name
@@ -1037,7 +877,7 @@ export default {
 
     // 更改调出仓位
     changePosition1() {
-      let obj = this.positionList1.find(o => o.id == this.directForm.position1)
+      const obj = this.positionList1.find(o => o.id == this.directForm.position1)
       this.directGoodsList.forEach(item => {
         item.position1 = obj.name
         item.status1 = obj.defStockStatusName
@@ -1046,7 +886,7 @@ export default {
 
     // 更改调入仓位
     changePosition2() {
-      let obj = this.positionList2.find(o => o.id == this.directForm.position2)
+      const obj = this.positionList2.find(o => o.id == this.directForm.position2)
       this.directGoodsList.forEach(item => {
         item.position2 = obj.name
         item.status2 = obj.defStockStatusName
@@ -1069,11 +909,11 @@ export default {
     submitDirectForm() {
       this.$refs.directForm.validate(valid => {
         if (valid) {
-          let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
-          let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
-          let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
-          let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
-          let params = {
+          const warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
+          const positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
+          const warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
+          const positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
+          const params = {
             orderNo: this.detailData.enginOrderId,
             orderType: 'HOME', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
             correspondId: this.directForm.warehouse1,

+ 33 - 4
src/views/supply/engin/components/home_examine.vue

@@ -3,7 +3,9 @@
     <el-page-header content="审批" @back="goBack" />
 
     <div class="main-title">
-      <div class="title">工程订单 <span style="margin-left: 20px">经销商名称:{{detailData.customerName}}</span></div>
+      <div class="title">
+        工程订单 <span style="margin-left: 20px">经销商名称:{{ detailData.customerName }}</span>
+      </div>
     </div>
 
     <div class="diy-table-1">
@@ -77,7 +79,7 @@
               :disabled="detailData.examineStatus == 'OK' && isDealer"
               clearable
             >
-              <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id" >
+              <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id">
                 <span>{{ item.saleName }}</span> <span style="color: #f00">{{ item.saleCode }}</span>
               </el-option>
             </el-select>
@@ -173,6 +175,14 @@
             <el-input v-model="detailData.note2" placeholder="请输入格力内部备注"></el-input>
           </div>
         </el-col> -->
+        <el-col :span="8" class="item">
+          <div class="label">登录有效期</div>
+          <div class="value">{{ detailData.refBillsExpireDate }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">项目编号</div>
+          <div class="value">{{ detailData.projectNo }}</div>
+        </el-col>
         <el-col :span="16" class="item">
           <div class="label">项目说明</div>
           <div class="value">
@@ -186,6 +196,18 @@
           </div>
         </el-col>
         <el-col :span="24" class="item">
+          <div class="label">工程机转零售批复意见</div>
+          <div class="value">{{ detailData.refToRetailIdea }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">合同变更批复意见</div>
+          <div class="value">{{ detailData.refContractIdea }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">资料延期批复意见</div>
+          <div class="value">{{ detailData.refDataDelayIdea }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
           <div class="label">其他附件审批意见</div>
           <div class="value">{{ detailData.refOtherAnnexIdea }}</div>
         </el-col>
@@ -348,6 +370,15 @@
             }}
           </template>
         </el-table-column>
+        <el-table-column
+              align="right"
+              label="退订数量"
+              prop="retiredQty"
+              min-width="100"
+              show-overflow-tooltip
+            />
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="100" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="100" show-overflow-tooltip />
         <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.isDirectTransfer ? '是' : '否' }}
@@ -625,7 +656,6 @@ export default {
               if (!res.data) {
                 this.$successMsg()
                 this.goBack()
-                
               } else {
                 this.$confirm('审批成功!是否跳转下一张待审批订单?', '提示', {
                   confirmButtonText: '跳转',
@@ -640,7 +670,6 @@ export default {
                   })
                   .catch(() => {
                     this.goBack()
-                    
                   })
               }
             })

+ 104 - 12
src/views/supply/engin/components/home_form.vue

@@ -136,6 +136,11 @@
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="登录有效期" prop="refBuyUnitName">
+            <el-input v-model="mainForm.refBuyUnitName" placeholder="请输入购买单位" :disabled="isDealer" />
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="联系人" prop="contactMan">
             <el-input v-model="mainForm.contactMan" placeholder="请输入联系人" />
           </el-form-item>
@@ -170,12 +175,37 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="跨区厂编号" prop="refBuyUnitName">
+            <el-input v-model="mainForm.refBuyUnitName" placeholder="请输入购买单位" :disabled="isDealer" />
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="24">
+          <el-form-item label="项目编号" prop="refProjectNo">
+            <el-input v-model="mainForm.refProjectNo" placeholder="请输入项目编号" :disabled="isDealer" />
+          </el-form-item>
+        </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
           <el-form-item label="项目说明" prop="projectRemark">
             <el-input v-model="mainForm.projectRemark" placeholder="请输入项目说明" :disabled="isDealer" />
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
+          <el-form-item label="工程机转零售批复意见" prop="refToRetailIdea">
+            <el-input v-model="mainForm.refToRetailIdea" placeholder="请输入其他附件审批意见" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="24">
+          <el-form-item label="合同变更批复意见" prop="refContractIdea">
+            <el-input v-model="mainForm.refContractIdea" placeholder="请输入其他附件审批意见" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="24">
+          <el-form-item label="资料延期批复意见" prop="refDataDelayIdea">
+            <el-input v-model="mainForm.refDataDelayIdea" placeholder="请输入其他附件审批意见" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="24">
           <el-form-item label="其他附件审批意见" prop="refOtherAnnexIdea">
             <el-input v-model="mainForm.refOtherAnnexIdea" placeholder="请输入其他附件审批意见" disabled />
           </el-form-item>
@@ -236,9 +266,9 @@
         <el-select
           v-model="warehouseValue"
           placeholder="请选择发货仓库"
-          @change="handleWarehouseValue"
           size="small"
           style="margin-right: 10px"
+          @change="handleWarehouseValue"
         >
           <el-option v-for="(item, index) in warehouseList" :key="index" :label="item.name" :value="item.id" />
         </el-select>
@@ -366,10 +396,13 @@
               (scope.row.price * scope.row.qty * 100 -
                 ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 -
                 ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) /
-              100
+                100
             }}
           </template>
         </el-table-column>
+        <el-table-column align="center" label="退订数量" prop="retiredQty" min-width="100" show-overflow-tooltip />
+        <el-table-column align="center" label="销售数量" prop="salesQty" min-width="100" show-overflow-tooltip />
+        <el-table-column align="center" label="销售金额" prop="salesAmount" min-width="100" show-overflow-tooltip />
         <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
           <template slot-scope="scope">
             <el-checkbox v-model="scope.row.isDirectTransfer" />
@@ -472,12 +505,12 @@
       :close-on-click-modal="false"
     >
       <el-form
+        v-if="mainForm.examineStatus !== 'SAVE'"
         ref="screenForm"
         :model="screenForm"
         label-width="0"
         size="small"
         label-position="left"
-        v-if="mainForm.examineStatus !== 'SAVE'"
       >
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
@@ -515,8 +548,11 @@
         >
           <el-table-column align="center" label="" width="100">
             <template slot-scope="scope">
-              <el-button type="primary" size="small" @click="chooseItem(scope.row.recordNo, scope.row.userid)"
-                >选择
+              <el-button
+                type="primary"
+                size="small"
+                @click="chooseItem(scope.row.recordNo, scope.row.userid)"
+              >选择
               </el-button>
             </template>
           </el-table-column>
@@ -807,6 +843,10 @@ export default {
         refBuyUnitName: '',
         refPromiseProvide: '',
         refOtherAnnexIdea: '',
+        refToRetailIdea: '',
+        refContractIdea: '',
+        refDataDelayIdea: '',
+        refProjectNo: '',
         isPlanOrder: this.listItem ? '' : true
       },
       mainFormRules: {
@@ -941,7 +981,7 @@ export default {
       immediate: true,
       deep: true
     },
-    'mainForm.saleType': function (newValue, oldValue) {
+    'mainForm.saleType': function(newValue, oldValue) {
       this.oldSaleType = oldValue
     }
   },
@@ -1228,6 +1268,12 @@ export default {
         this.mainForm.examineStatus = data.examineStatus
         this.mainForm.refBuyUnitName = data.refBuyUnitName
         this.mainForm.refPromiseProvide = data.refPromiseProvide
+        this.mainForm.refProjectNo = data.refProjectNo
+        this.mainForm.refToRetailIdea = data.refToRetailIdea
+        this.mainForm.refContractIdea = data.refContractIdea
+        this.mainForm.refDataDelayIdea = data.refDataDelayIdea
+        this.mainForm.refBillsExpireDate = data.refBillsExpireDate
+        this.mainForm.refBuyUnitCallMen = data.refBuyUnitCallMen
         this.correspondName = data.correspondName
         this.warehouseValue = data.correspondId
         this.mainForm.isPlanOrder = data.isPlanOrder
@@ -1541,7 +1587,6 @@ export default {
             refProjectCategory: this.mainForm.enginName || '',
             refTradeCategory: this.mainForm.loginType || '',
             refPromiseStatus: this.mainForm.promiseStatus || '',
-            refFactoryNo: this.mainForm.factoryNum || '',
             refUseUnit: this.mainForm.company || '',
             refLinkman: this.mainForm.contactMan || '',
             refTel: this.mainForm.tel || '',
@@ -1561,9 +1606,39 @@ export default {
             refProjectNote: this.mainForm.projectRemark,
             refProjectType: this.mainForm.projectType,
             refRegionWork: this.mainForm.regionWork,
-            refBuyUnitName: this.mainForm.refBuyUnitName,
             refPromiseProvide: this.mainForm.refPromiseProvide,
             refOtherAnnexIdea: this.mainForm.refOtherAnnexIdea,
+            refProjectNo: this.mainForm.refProjectNo,
+            contactMan: this.mainForm.contactMan,
+            tel: this.mainForm.tel,
+            refToRetailIdea: this.mainForm.refToRetailIdea,
+            refContractIdea: this.mainForm.refContractIdea,
+            refDataDelayIdea: this.mainForm.refDataDelayIdea,
+            refToRetailResult: this.mainForm.refToRetailResult,
+            refToRetailldea: this.mainForm.refToRetailldea,
+            refDataDelayResult: this.mainForm.refDataDelayResult,
+            refDataDelayldea: this.mainForm.refDataDelayldea,
+            refOtherAnnexResult: this.mainForm.refOtherAnnexResult,
+            refOtherAnnexldea: this.mainForm.refOtherAnnexldea,
+            refBuyUnitPhone: this.mainForm.refBuyUnitPhone,
+            refBuyUnitName: this.mainForm.refBuyUnitName,
+            refBuyUnitTel: this.mainForm.refBuyUnitTel,
+            refFactoryNo: this.mainForm.refFactoryNo,
+            refBillsExpireDate: this.mainForm.refBillsExpireDate,
+            refContractResult: this.mainForm.refContractResult,
+            refContractldea: this.mainForm.refContractldea,
+            refBuyUnitCallMen: this.mainForm.refBuyUnitCallMen,
+            // refToRetailResult: this.mainForm.refToRetailResult,
+            // refToRetailldea: this.mainForm.refToRetailldea,
+            // refDataDelayResult: this.mainForm.refDataDelayResult,
+            // refDataDelayldea: this.mainForm.refDataDelayldea,
+            // refOtherAnnexResult: this.mainForm.refOtherAnnexResult,
+            // refOtherAnnexldea: this.mainForm.refOtherAnnexldea,
+            // refBuyUnitPhone: this.mainForm.refBuyUnitPhone,
+            // refBuyUnitName: this.mainForm.refBuyUnitName,
+            // refBuyUnitTel: this.mainForm.refBuyUnitTel,
+            // refFactoryNo: this.mainForm.refFactoryNo,
+            // refBillsExpireDate: this.mainForm.refBillsExpireDate,
             items: goodsList
           }
           if (this.mainForm.examineStatus === 'WAIT') {
@@ -1577,7 +1652,6 @@ export default {
                 .then(res => {
                   this.$successMsg('编辑成功')
                   this.goBack()
-                  
                 })
                 .finally(res => {
                   this.formLoading = false
@@ -1587,7 +1661,6 @@ export default {
                 .then(res => {
                   this.$successMsg('新增成功')
                   this.goBack()
-                  
                 })
                 .finally(res => {
                   this.formLoading = false
@@ -1598,7 +1671,6 @@ export default {
               .then(res => {
                 this.$successMsg('提交审核成功')
                 this.goBack()
-                
               })
               .finally(res => {
                 this.formLoading = false
@@ -1631,7 +1703,24 @@ export default {
       this.mainForm.refBuyUnitName = data.buyUnitName
       this.mainForm.refPromiseProvide = data.promiseProvide === 1 ? '已保证' : '未保证'
       this.mainForm.refOtherAnnexIdea = data.otherAnnexIdea
-
+      this.mainForm.refProjectNo = data.projectNo
+      this.mainForm.refToRetailIdea = data.toRetailIdea
+      this.mainForm.refContractIdea = data.contractIdea
+      this.mainForm.refDataDelayIdea = data.dataDelayIdea
+      this.mainForm.refContractResult = data.contractResult
+      this.mainForm.refContractldea = data.contractldea
+      this.mainForm.refToRetailResult = data.toRetailResult
+      this.mainForm.refToRetailldea = data.toRetailldea
+      this.mainForm.refDataDelayResult = data.dataDelayResult
+      this.mainForm.refDataDelayldea = data.dataDelayldea
+      this.mainForm.refOtherAnnexResult = data.otherAnnexResult
+      this.mainForm.refOtherAnnexldea = data.otherAnnexldea
+      this.mainForm.refBuyUnitPhone = data.buyUnitPhone
+      this.mainForm.refBuyUnitName = data.buyUnitName
+      this.mainForm.refBuyUnitTel = data.buyUnitTel
+      this.mainForm.refFactoryNo = data.factoryNo
+      this.mainForm.refBillsExpireDate = data.billsExpireDate
+      this.mainForm.refBuyUnitCallMen = data.buyUnitCallMen
       const saleTypeItem = this.salesTypeList.find(o => o.id === this.mainForm.saleType)
 
       this.goodsList = data.items.map(item => {
@@ -1659,6 +1748,9 @@ export default {
           isDirectTransfer: false,
           directTransferQty: '',
           hasSendQty: '',
+          tdQty: 0,
+          salesQty: 0,
+          salesAmount: 0,
           remark: item.discri,
           tax: '',
           status1: '',

+ 56 - 27
src/views/supply/engin/components/home_return.vue

@@ -1,9 +1,11 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="退订"></el-page-header>
+    <el-page-header content="退订" @back="goBack" />
 
     <div class="main-title">
-      <div class="title">工程订单 <span style="margin-left: 20px">经销商名称:{{detailData.customerName}}</span></div>
+      <div class="title">
+        工程订单 <span style="margin-left: 20px">经销商名称:{{ detailData.customerName }}</span>
+      </div>
     </div>
 
     <div class="diy-table-1">
@@ -106,7 +108,14 @@
           <div class="label">格力内部备注</div>
           <div class="value">{{detailData.note2}}</div>
         </el-col> -->
-
+        <el-col :span="8" class="item">
+          <div class="label">登录有效期</div>
+          <div class="value">{{ detailData.refBillsExpireDate }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">项目编号</div>
+          <div class="value">{{ detailData.projectNo }}</div>
+        </el-col>
         <el-col :span="16" class="item">
           <div class="label">项目说明</div>
           <div class="value">{{ detailData.refProjectNote }}</div>
@@ -116,6 +125,18 @@
           <div class="value">{{ detailData.refProjectType }}</div>
         </el-col>
         <el-col :span="24" class="item">
+          <div class="label">工程机转零售批复意见</div>
+          <div class="value">{{ detailData.refToRetailIdea }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">合同变更批复意见</div>
+          <div class="value">{{ detailData.refContractIdea }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">资料延期批复意见</div>
+          <div class="value">{{ detailData.refDataDelayIdea }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
           <div class="label">其他附件审批意见</div>
           <div class="value">{{ detailData.refOtherAnnexIdea }}</div>
         </el-col>
@@ -162,49 +183,49 @@
         show-summary
         :summary-method="$getSummaries"
       >
-        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="序号" type="index" width="50" />
         <el-table-column
           align="left"
           label="引用记录"
           prop="useRefCount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="销售类型"
           prop="saleTypeName"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="物料编码"
           prop="materialNumber"
           min-width="120"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="产品编码"
           prop="materialOldNumber"
           min-width="120"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="产品名称"
           prop="materialName"
           min-width="160"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="规格型号"
           prop="specification"
           min-width="350"
           show-overflow-tooltip
-        ></el-table-column>
+        />
 
         <el-table-column
           align="left"
@@ -219,7 +240,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.price | numToFixed }}
@@ -231,8 +252,8 @@
           prop="enginNum"
           min-width="120"
           show-overflow-tooltip
-        ></el-table-column>
-        <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        />
+        <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.totalAmount | numToFixed }}
@@ -244,7 +265,7 @@
           prop="customerWalletName2"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column align="right" label="使用返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.rebateAmount | numToFixed }}
@@ -261,12 +282,21 @@
           prop="customerWalletName"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.payAmount | numToFixed }}
           </template>
         </el-table-column>
+        <el-table-column
+              align="right"
+              label="退订数量"
+              prop="retiredQty"
+              min-width="100"
+              show-overflow-tooltip
+            />
+            <el-table-column align="right" label="销售数量" prop="salesQty" min-width="100" show-overflow-tooltip />
+            <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="100" show-overflow-tooltip />
         <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.isDirectTransfer ? '是' : '否' }}
@@ -278,23 +308,23 @@
           prop="directTransferQty"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="right"
           label="可退数量"
           prop="refundableQty"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column align="right" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input
               v-model="scope.row.tdQty"
               size="mini"
-              @blur="hasTdQty(scope.row)"
               type="number"
+              @blur="hasTdQty(scope.row)"
               @mousewheel.native.prevent
-            ></el-input>
+            />
           </template>
         </el-table-column>
         <el-table-column
@@ -303,7 +333,7 @@
           prop="remark"
           min-width="160"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="实装物料编号"
@@ -330,7 +360,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
       </el-table>
     </div>
 
@@ -350,7 +380,7 @@
         <el-col :span="24" class="item">
           <div class="label">退订说明</div>
           <div class="value">
-            <el-input v-model="returnForm.remark" placeholder="请输入退订说明"></el-input>
+            <el-input v-model="returnForm.remark" placeholder="请输入退订说明" />
           </div>
         </el-col>
       </el-row>
@@ -359,7 +389,7 @@
     <div class="page-footer">
       <div class="footer">
         <el-button type="primary" @click="clickSubmitForm()">确定退订</el-button>
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px" v-if="!isDealer">
+        <el-popconfirm v-if="!isDealer" title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
           <el-button slot="reference">返回列表</el-button>
         </el-popconfirm>
       </div>
@@ -373,7 +403,6 @@ import { getOrderDetail, returnHome } from '@/api/supply/engin'
 export default {
   name: 'HomeReturn',
   componentName: 'HomeReturn',
-  props: ['listItem'],
   filters: {
     statusFilter(val) {
       const statusList = [
@@ -383,10 +412,11 @@ export default {
         // { label: '审核驳回', value: 'FAIL' },,
         { label: '已关闭', value: 'CLOSE' }
       ]
-      let obj = statusList.find(o => o.value == val)
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
       userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
@@ -455,7 +485,7 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          let params = {
+          const params = {
             enginOrderId: this.detailData.enginOrderId,
             items: this.detailData.items,
             refundNote: this.returnForm.remark,
@@ -464,7 +494,6 @@ export default {
           returnHome(params).then(res => {
             this.$successMsg()
             this.goBack()
-            
           })
         })
         .catch(() => {})

+ 18 - 14
src/views/supply/engin/home_list.vue

@@ -1,15 +1,15 @@
 <template>
   <template-page
     ref="pageRef"
-    :getList="getList"
+    :get-list="getList"
     :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-    :fieldBeansHook="fieldBeansHook"
-    :operationColumnWidth="200"
+    :options-evens-group="optionsEvensGroup"
+    :export-list="exportList"
+    :column-parsing="columnParsing"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :field-beans-hook="fieldBeansHook"
+    :operation-column-width="200"
   >
     <div slot="moreSearch">
       <ul class="ulStyle">
@@ -17,7 +17,10 @@
           金额:<span class="num">{{ (Number(numSum.amountC) || 0) | numToFixed }}</span>
         </li>
         <li class="title">
-          数量:<span class="num">{{ Number(numSum.totalC) || 0 | numToFixed }}</span>
+          数量:<span class="num">{{ Number(numSum.totalC) || 0 }}</span>
+        </li>
+        <li class="title">
+          项目数:<span class="num">{{ Number(numSum.totalEC) || 0 }}</span>
         </li>
       </ul>
 
@@ -28,8 +31,8 @@
             v-for="(item, index) in workerState"
             :key="index"
             :type="orderStatusParam == item.value ? 'primary' : null"
-            @click="handleOrderStatusParam(item.value, index)"
             size="mini"
+            @click="handleOrderStatusParam(item.value, index)"
             >{{ item.label }}</el-button
           >
         </div>
@@ -72,7 +75,6 @@ import { getNoRebateWalletList } from '@/api/policy_list'
 
 let that
 export default {
-  mixins: [add_callback_mixin],
   components: {
     HomeDetail,
     HomeForm,
@@ -95,6 +97,7 @@ export default {
       return MAP[val]
     }
   },
+  mixins: [add_callback_mixin],
   data() {
     return {
       orderStatusParam: '',
@@ -247,7 +250,8 @@ export default {
       typeList: [],
       numSum: {
         totalC: 0,
-        amountC: 0
+        amountC: 0,
+        totalEC: 0
       }
     }
   },
@@ -310,7 +314,6 @@ export default {
     // getList: v2EnginOrderHomeList,
     async getList(...p) {
       this.$refs.pageRef.showTable = false
-
       let params = {}
 
       if (this.orderStatusParam === '') {
@@ -334,6 +337,7 @@ export default {
         let res = await v2EnginOrderHomeCountList(params)
         this.numSum.totalC = res.data.totalC
         this.numSum.amountC = res.data.amountC
+        this.numSum.totalEC = res.data.totalEC
       } catch (error) {
         // console.log(error)
       }
@@ -380,7 +384,7 @@ export default {
         }
       })
       if (this.isCustomer !== '') {
-        let res = val.filter(
+        const res = val.filter(
           v => v.jname !== 'refPowerCategory' && v.jname !== 'geLiInerNote' && v.jname !== 'geLiNote'
         )
         return res

+ 15 - 15
src/views/supply/implement/components/sales_detail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="详情"></el-page-header>
+    <el-page-header content="详情" @back="goBack" />
 
     <div id="printMe">
       <div class="main-title">
@@ -54,9 +54,9 @@
           show-summary
           :summary-method="$getSummaries"
         >
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip>
-            <template slot-scope="scope">
+          <el-table-column align="center" label="序号" type="index" width="50" />
+          <el-table-column align="center" label="销售订单号" min-width="180" show-overflow-tooltip>
+            <template v-if=" scope.row" slot-scope="scope">
               {{
                 scope.row.orderType == 'TRADE' || scope.row.orderType == 'HOME'
                   ? scope.row.enginOrderNo
@@ -70,42 +70,42 @@
             prop="materialCode"
             min-width="120"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="产品编码"
             prop="materialOldNumber"
             min-width="120"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="产品名称"
             prop="materialName"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="规格型号"
             prop="specification"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="单位"
             prop="unit"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="right"
             label="数量"
             prop="refundableQty"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.price | numToFixed }}
@@ -122,7 +122,7 @@
             prop="headerRemark"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <!-- <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column> -->
           <el-table-column
             align="left"
@@ -130,14 +130,14 @@
             prop="invoiceRemark"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="业务员"
             prop="serviceName"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
         </el-table>
       </div>
 
@@ -175,7 +175,6 @@ import { getDetail } from '@/api/supply/sales'
 export default {
   name: 'SalesDetail',
   componentName: 'SalesDetail',
-  props: ['listItem'],
   directives: {
     print
   },
@@ -187,10 +186,11 @@ export default {
         { label: '审核通过', value: 'OK' }
         // { label: '审核驳回', value: 'FAIL' },,
       ]
-      let obj = statusList.find(o => o.value == val)
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
       printObj: {

+ 2 - 2
src/views/supply/implement/components/sales_return_form.vue

@@ -279,9 +279,9 @@
             min-width="120"
             show-overflow-tooltip
           ></el-table-column>
-          <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="120" show-overflow-tooltip
+          <el-table-column align="left" label="订单号"  min-width="120" show-overflow-tooltip
             >、
-            <template slot-scope="scope">
+            <template v-if=" scope.row" slot-scope="scope">
               {{
                 scope.row.orderType == 'TRADE' || scope.row.orderType == 'HOME'
                   ? scope.row.enginOrderNo

+ 30 - 13
src/views/supply/pickup/check.vue

@@ -98,7 +98,8 @@
                     <el-option
                       v-for="item in userList"
                       :key="item.id"
-                      :label="`${item.takerName} - ${item.customerName}`"
+                      :disabled="setDisabled(item)"
+                      :label="setLabel(item)"
                       :value="item.id"
                     />
                   </el-select>
@@ -521,8 +522,24 @@ export default {
         logisticsId: this.screenForm.logisticsId,
         invoiceId: this.screenForm.invoiceId
       }
-    }
-  },
+    },
+    setLabel() {
+      return (item) => {
+        const flag = +item.flag === 1 ? '有效' : +item.flag === 2 ? '停用' : '失效'
+        const del = +item.del === 1 ? '删除' : '正常'
+        const expireTime = new Date(item.expireTime).getTime() > new Date().getTime() ? '未过期' : '过期'
+
+        return `${item.takerName} - ${item.customerName} - ${item.phone} - ${flag} - ${del} - ${expireTime}`
+      }
+    },
+    setDisabled() {
+      return (item) => {
+        const flag = +item.flag === 1
+        const del = +item.del !== 1
+        const expireTime = new Date(item.expireTime).getTime() > new Date().getTime()
+        return !(flag & del && expireTime)
+      }
+    } },
   watch: {
     'screenForm.warehouse'() {
       if (this.check == 1) {
@@ -634,12 +651,12 @@ export default {
         mobile: this.screenForm.phone,
         code: this.screenForm.code
       }).then(res => {
-        this.$successMsg('验证成功')
-        this.screenForm.name = `${res.data[0].takerName} - ${res.data[0].customerName}`
-        this.screenForm.idCard = res.data[0].identity
-        this.screenForm.manId = res.data[0].id
-        this.screenForm.customerName = res.data[0].customerName
-        this.screenForm.customerId = res.data[0].customerId
+        this.$successMsg('验证成功,请选择提货人信息')
+        // this.screenForm.name = `${res.data[0].takerName} - ${res.data[0].customerName}`
+        // this.screenForm.idCard = res.data[0].identity
+        // this.screenForm.manId = res.data[0].id
+        // this.screenForm.customerName = res.data[0].customerName
+        // this.screenForm.customerId = res.data[0].customerId
         this.userList = res.data
         this.getListCustomer()
       })
@@ -759,13 +776,13 @@ export default {
           for (let i = 0; i < ids.length; i++) {
             console.log(this.dataList.some(e => e.id === ids[i]))
             if (!this.dataList.some(e => e.id === ids[i])) {
-              this.tableSelection= []
+              this.tableSelection = []
               this.$errorMsg(`单被商家取消预约,重新选择`)
               return
             }
           }
         } else {
-          this.tableSelection= []
+          this.tableSelection = []
           this.$errorMsg(`单被商家取消预约,重新选择`)
           return
         }
@@ -794,9 +811,9 @@ export default {
       })
     },
     refreshTableSelection() {
-     this.$refs.table.clearSelection()
+      this.$refs.table.clearSelection()
       this.tableSelection = []
-      console.log(333,'清空');
+      console.log(333, '清空')
     },
     async getNewDetailPrintDisString() {
       const params = []

File diff suppressed because it is too large
+ 599 - 91
src/views/supply/pickup/components/pickup_form.vue


+ 37 - 29
src/views/supply/pickup/pickup_list.vue

@@ -1,13 +1,13 @@
 <template>
   <template-page
     ref="pageRef"
-    :getList="getList"
+    :get-list="getList"
     :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
+    :options-evens-group="optionsEvensGroup"
+    :export-list="exportList"
+    :column-parsing="columnParsing"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
   >
     <Popu v-if="isShowForm">
       <PickupForm :list-item="queryItem" :flag="flag" @backListFormDetail="backList" />
@@ -112,7 +112,11 @@ export default {
     // this.getWarehouseList()
     // this.getPickupManList()
   },
-
+  activated() {
+    if (this.$route.query && this.$route.query.id) {
+      this.toForm({ id: this.$route.query.id }, true)
+    }
+  },
   methods: {
     // 列表请求函数
     getList: pickListV2,
@@ -129,11 +133,11 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             <el-button
-              size="mini"
-              type="text"
-              onClick={async () => {
+              size='mini'
+              type='text'
+              onClick={async() => {
                 this.toForm(row, true)
               }}
             >
@@ -142,9 +146,9 @@ export default {
 
             {this.$checkBtnRole('edit', this.$route.meta.roles) && !row.printNum ? (
               <el-button
-                size="mini"
-                type="text"
-                onClick={async () => {
+                size='mini'
+                type='text'
+                onClick={async() => {
                   this.toForm(row)
                 }}
               >
@@ -156,19 +160,19 @@ export default {
 
             {this.$checkBtnRole('cancel', this.$route.meta.roles) &&
             ((this.isDealer && !row.printNum) || !this.isDealer) ? (
-              <el-popconfirm
-                onOnConfirm={async () => {
-                  this.handleCancel(row.id)
-                }}
-                title={`是否确定需要${row.printNum ? '作废' : '取消'}该项内容?`}
-              >
-                <el-button slot="reference" size="mini" type="text">
-                  {row.printNum ? '作废' : '取消'}
-                </el-button>
-              </el-popconfirm>
-            ) : (
-              ''
-            )}
+                <el-popconfirm
+                  onOnConfirm={async() => {
+                    this.handleCancel(row.id)
+                  }}
+                  title={`是否确定需要${row.printNum ? '作废' : '取消'}该项内容?`}
+                >
+                  <el-button slot='reference' size='mini' type='text'>
+                    {row.printNum ? '作废' : '取消'}
+                  </el-button>
+                </el-popconfirm>
+              ) : (
+                ''
+              )}
           </div>
         )
       }
@@ -260,9 +264,13 @@ export default {
     },
 
     backList() {
-      this.queryItem = {}
       this.isShowForm = false
-      this.$refs.pageRef.refreshList()
+      if (this.$route.query && this.$route.query.id) {
+        this.$router.push('/supply/pickup/sum_list')
+      } else {
+        this.queryItem = {}
+        this.$refs.pageRef.refreshList()
+      }
     },
 
     // 取消/作废

+ 24 - 14
src/views/supply/pickup/sum_list.vue

@@ -1,21 +1,21 @@
 <template>
   <template-page
     ref="pageRef"
-    :getList="getList"
-    :exportList="exportList"
+    :get-list="getList"
+    :export-list="exportList"
     :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :columnParsing="columnParsing"
-    :defaultSearchData="searchData"
-    :replaceOrNotMap="false"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+    :default-search-data="searchData"
+    :replace-or-not-map="false"
   >
-    <el-dialog title="物流信息" :visible.sync="visible" width="60%" @close="onClose" :close-on-click-modal="false">
-      <el-timeline class="logistics" :reverse="false" v-if="logisticsDetail.length">
+    <el-dialog title="物流信息" :visible.sync="visible" width="60%" :close-on-click-modal="false" @close="onClose">
+      <el-timeline v-if="logisticsDetail.length" class="logistics" :reverse="false">
         <el-timeline-item
-          placement="top"
-          type="success"
           v-for="(item, index) in logisticsDetail"
           :key="index"
+          placement="top"
+          type="success"
           :timestamp="item.time"
         >
           <el-row :gutter="20">
@@ -94,13 +94,13 @@ export default {
       orderId: '',
       logisticsDetail: [],
       flag: false,
-      searchData: this.$route.query.id?[
+      searchData: this.$route.query.id ? [
         {
           param: 'pms.invoice_id',
           compare: '=',
           value: this.$route.query.id || ''
         }
-      ]:[]
+      ] : []
     }
   },
   watch: {
@@ -140,12 +140,22 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
+          <div class='operation-btns'>
             {row.pickType != '1' ? (
-              <el-button onClick={() => this.handLogistics(row)} type="text" size="small">
+              <el-button onClick={() => this.handLogistics(row)} type='text' size='small'>
                 物流信息
               </el-button>
             ) : null}
+            <el-button onClick={() => {
+              this.$router.push({
+                path: '/supply/pickup/pickup_list',
+                query: {
+                  id: row.id
+                }
+              })
+            }} type='text' size='small'>
+                详情
+            </el-button>
           </div>
         )
       }

+ 6 - 0
src/views/supply/policy/components/retail_detail.vue

@@ -84,6 +84,10 @@
               </el-radio-group>
             </div>
           </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">是否直调</div>
+            <div class="value">{{ detailData.isAllDirect?'是':'否' }}</div>
+          </el-col>
         </el-row>
       </div>
 
@@ -130,6 +134,8 @@
             </template>
           </el-table-column>
           <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip></el-table-column>
+
           <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.totalAmount | numToFixed }}

+ 6 - 0
src/views/supply/policy/components/retail_examine.vue

@@ -79,6 +79,10 @@
             </el-radio-group>
           </div>
         </el-col>
+        <el-col :span="24" class="item">
+            <div class="label">是否直调</div>
+            <div class="value">{{ detailData.isAllDirect?'是':'否' }}</div>
+          </el-col>
       </el-row>
     </div>
 
@@ -142,6 +146,8 @@
           show-overflow-tooltip
         ></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip />
+
         <el-table-column
           align="center"
           label="订单金额"

+ 20 - 2
src/views/supply/policy/components/retail_form.vue

@@ -73,6 +73,11 @@
             </el-radio-group>
           </el-form-item>
         </el-col>
+        <el-col :span="24" :sm="12" :lg="12">
+          <el-form-item label="是否直调" prop="isAllDirect">
+            <el-checkbox v-model="mainForm.isAllDirect">{{ mainForm.isAllDirect ? '是' : '否' }}</el-checkbox>
+          </el-form-item>
+        </el-col>
         <!--        <el-col :span="24" :sm="12" :lg="12" >-->
         <!--          <el-form-item label="计划单" prop="isPlanOrder">-->
         <!--            <el-radio-group v-model="mainForm.isPlanOrder">-->
@@ -141,6 +146,7 @@
             <el-input v-model="scope.row.qty" class="yinput" size="small" />
           </template>
         </el-table-column>
+        <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="订单金额" min-width="100" prop="compute_amount" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ (scope.row.price * scope.row.qty) | numToFixed }}
@@ -685,7 +691,8 @@ export default {
         policyRemark: '',
         policyId: '',
         k3ServiceId: '',
-        k3ServiceName: ''
+        k3ServiceName: '',
+        isAllDirect: false
       },
       // mainFormRules: {
       //   type: [{ required: true, message: "请选择品类", trigger: "change" }],
@@ -858,7 +865,12 @@ export default {
       handler(newValue, oldValue) {
         if (newValue && newValue.length) {
           newValue.forEach((item, index) => {
-            this.goodsList[index].policyConditionId = this.policyConditionId || this.goodsList[index].policyConditionId
+            if (this.mainForm.isAllDirect) {
+              this.$set(this.goodsList[index], 'isDirectTransfer', true)
+            }
+            if (this.policyConditionId) {
+              this.$set(this.goodsList[index], 'policyConditionId', this.policyConditionId || this.goodsList[index].policyConditionId)
+            }
             if (this.correspondId) {
               this.goodsList[index].correspondName = this.correspondName
               this.goodsList[index].correspondId = this.correspondId
@@ -877,6 +889,11 @@ export default {
       },
       immediate: true,
       deep: true
+    },
+    'mainForm.isAllDirect'(e) {
+      this.goodsList.forEach(k => {
+        this.$set(k, 'isDirectTransfer', e)
+      })
     }
   },
 
@@ -1892,6 +1909,7 @@ export default {
             return
           }
           const params = {
+            isAllDirect: this.mainForm.isAllDirect,
             theTime: this.mainForm.date,
             k3ServiceId: this.mainForm.k3ServiceId,
             k3ServiceName: this.mainForm.k3ServiceName,

+ 6 - 0
src/views/supply/policy/components/retail_return.vue

@@ -49,6 +49,10 @@
             </el-radio-group>
           </div>
         </el-col>
+        <el-col :span="24" class="item">
+            <div class="label">是否直调</div>
+            <div class="value">{{ detailData.isAllDirect?'是':'否' }}</div>
+          </el-col>
       </el-row>
     </div>
 
@@ -112,6 +116,8 @@
           show-overflow-tooltip
         ></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip></el-table-column>
+
         <el-table-column
           align="center"
           label="订单金额"

+ 76 - 72
src/views/supply/retail/components/retail_detail.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="detail-container">
     <div v-show="!isShowCheckOrder">
-      <el-page-header @back="goBack" content="详情"></el-page-header>
+      <el-page-header content="详情" @back="goBack" />
 
       <div class="main-title">
         <div class="title">提货进度</div>
@@ -11,7 +11,7 @@
           :text-inside="true"
           :stroke-width="26"
           :percentage="detailData.thjd ? (detailData.thjd * 1000) / 10 : 0"
-        ></el-progress>
+        />
       </div>
 
       <div class="main-title">
@@ -72,6 +72,10 @@
             <div class="label">关闭日期</div>
             <div class="value">{{ detailData.closeTime }}</div>
           </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">是否直调</div>
+            <div class="value">{{ detailData.isAllDirect?'是':'否' }}</div>
+          </el-col>
         </el-row>
       </div>
 
@@ -91,56 +95,56 @@
           show-summary
           :summary-method="$getSummaries"
         >
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="序号" type="index" width="50" />
           <el-table-column
             align="left"
             label="销售类型"
             prop="saleTypeName"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="物料编码"
             prop="materialCode"
             min-width="120"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="产品编码"
             prop="materialOldNumber"
             min-width="120"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="产品名称"
             prop="materialName"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="规格型号"
             prop="specification"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="单位"
             prop="unit"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="文件编号"
             prop="fileNo"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.price | numToFixed }}
@@ -152,7 +156,9 @@
             prop="qty"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
+          <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip />
+
           <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.totalAmount | numToFixed }}
@@ -164,7 +170,7 @@
             prop="customerWalletName2"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.payRebateAmount | numToFixed }}
@@ -181,7 +187,7 @@
             prop="customerWalletName"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.payAmount | numToFixed }}
@@ -198,28 +204,28 @@
             prop="directTransferQty"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="right"
             label="原订单数量"
             prop="oldQty"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="left"
             label="备注"
             prop="remark"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="right"
             label="税率"
             prop="tax"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
         </el-table>
       </div>
 
@@ -252,19 +258,17 @@
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
           <!-- <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'" v-if="!isDealer">提前开票</el-button> -->
           <el-button
+            v-if="!isDealer"
             type="primary"
-            @click="openDeliverDialog"
             :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus === true"
-            v-if="!isDealer"
-            >直调发货</el-button
-          >
+            @click="openDeliverDialog"
+          >直调发货</el-button>
           <el-button
+            v-if="!isDealer"
             type="primary"
-            @click="handleFinish"
             :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus"
-            v-if="!isDealer"
-            >直调完成</el-button
-          >
+            @click="handleFinish"
+          >直调完成</el-button>
           <el-button @click="goBack">返回列表</el-button>
         </div>
       </div>
@@ -296,13 +300,13 @@
           <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="选择仓位" prop="position">
               <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
-                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="发货申请备注" prop="remark">
-              <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable></el-input>
+              <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -318,42 +322,42 @@
           stripe
           max-height="400"
         >
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="序号" type="index" width="50" />
           <el-table-column
             align="center"
             label="销售类型"
             prop="saleTypeName"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="物料编码"
             prop="materialCode"
             min-width="120"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="产品编码"
             prop="materialOldNumber"
             min-width="120"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="产品名称"
             prop="materialName"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="规格型号"
             prop="specification"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <!-- <el-table-column align="left" label="文件编号" prop="fileNo" min-width="200" show-overflow-tooltip>
             </el-table-column> -->
           <el-table-column
@@ -362,30 +366,30 @@
             prop="unit"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="right"
             label="订单数量"
             prop="qty"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="right"
             label="发货数量"
             prop="hasSendQty"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column align="right" label="直调数量" prop="adjustNum" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input
                 v-model="scope.row.adjustNum"
                 size="small"
                 type="number"
-                @mousewheel.native.prevent
                 :disabled="!scope.row.isDirectTransfer || scope.row.adjustNum === 0"
-              ></el-input>
+                @mousewheel.native.prevent
+              />
             </template>
           </el-table-column>
           <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
@@ -414,7 +418,7 @@
             prop="remark"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -447,7 +451,7 @@
                   :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
           </el-col>
@@ -460,7 +464,7 @@
                 filterable
                 @change="changePosition1"
               >
-                <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -478,7 +482,7 @@
                   :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
           </el-col>
@@ -491,7 +495,7 @@
                 filterable
                 @change="changePosition2"
               >
-                <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -508,98 +512,98 @@
           stripe
           max-height="400"
         >
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="序号" type="index" width="50" />
           <el-table-column
             align="center"
             label="销售类型"
             prop="saleTypeName"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="产品编码"
             prop="materialCode"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="物料代码"
             prop="materialOldNumber"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="产品名称"
             prop="materialName"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="规格型号"
             prop="specification"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="单位"
             prop="unit"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="数量"
             prop="qty"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="调出仓库"
             prop="warehouse1"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="调出仓位"
             prop="position1"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="调入仓库"
             prop="warehouse2"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="调入仓位"
             prop="position2"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="调出库存状态"
             prop="status1"
             min-width="110"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column
             align="center"
             label="调入库存状态"
             prop="status2"
             min-width="110"
             show-overflow-tooltip
-          ></el-table-column>
+          />
           <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
             <template slot-scope="">弘格</template>
           </el-table-column>
@@ -612,7 +616,7 @@
             prop="remark"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          />
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -621,7 +625,7 @@
       </span>
     </el-dialog>
 
-    <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
+    <CheckOrder v-if="isShowCheckOrder" :check-order-id="checkOrderId" @backDetail="backDetail" />
   </div>
 </template>
 
@@ -642,7 +646,6 @@ export default {
   components: {
     CheckOrder
   },
-  props: ['listItem'],
   filters: {
     statusFilter(val) {
       const statusList = [
@@ -651,10 +654,11 @@ export default {
         { label: '审核通过', value: 'OK' }
         // { label: '审核驳回', value: 'FAIL' },,
       ]
-      let obj = statusList.find(o => o.value == val)
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
       detailData: {},
@@ -801,13 +805,13 @@ export default {
               return
             }
           }
-          let goodsList = this.goodsList.map(item => {
+          const goodsList = this.goodsList.map(item => {
             return {
               itemId: item.id,
               qty: item.adjustNum || 0
             }
           })
-          let params = {
+          const params = {
             orderNo: this.listItem.id,
             orderDate: '',
             remark: this.deliverForm.remark,
@@ -844,7 +848,7 @@ export default {
     // 更改调出仓库
     changeWarehouse1() {
       this.directForm.position1 = ''
-      let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
+      const obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
       this.positionList1 = obj.kingDeeStocks
       this.directGoodsList.forEach(item => {
         item.warehouse1 = obj.name
@@ -854,7 +858,7 @@ export default {
     // 更改调入仓库
     changeWarehouse2() {
       this.directForm.position2 = ''
-      let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
+      const obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
       this.positionList2 = obj.kingDeeStocks
       this.directGoodsList.forEach(item => {
         item.warehouse2 = obj.name
@@ -863,7 +867,7 @@ export default {
 
     // 更改调出仓位
     changePosition1() {
-      let obj = this.positionList1.find(o => o.id == this.directForm.position1)
+      const obj = this.positionList1.find(o => o.id == this.directForm.position1)
       this.directGoodsList.forEach(item => {
         item.position1 = obj.name
         item.status1 = obj.defStockStatusName
@@ -872,7 +876,7 @@ export default {
 
     // 更改调入仓位
     changePosition2() {
-      let obj = this.positionList2.find(o => o.id == this.directForm.position2)
+      const obj = this.positionList2.find(o => o.id == this.directForm.position2)
       this.directGoodsList.forEach(item => {
         item.position2 = obj.name
         item.status2 = obj.defStockStatusName
@@ -895,11 +899,11 @@ export default {
     submitDirectForm() {
       this.$refs.directForm.validate(valid => {
         if (valid) {
-          let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
-          let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
-          let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
-          let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
-          let params = {
+          const warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
+          const positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
+          const warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
+          const positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
+          const params = {
             orderNo: this.detailData.id,
             orderType: 'RETAIL', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
             correspondId: this.directForm.warehouse1,

+ 29 - 23
src/views/supply/retail/components/retail_examine.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="审批"></el-page-header>
+    <el-page-header content="审批" @back="goBack" />
 
     <div class="main-title">
-      <div class="title">订单信息 <span style="margin-left: 20px">经销商名称:{{detailData.customerName}}</span></div>
+      <div class="title">订单信息 <span style="margin-left: 20px">经销商名称:{{ detailData.customerName }}</span></div>
     </div>
 
     <div class="diy-table-1">
@@ -27,7 +27,7 @@
         <el-col :span="16" class="item">
           <div class="label">文件编号</div>
           <div class="value">
-            <el-input v-model="detailData.fileNo" placeholder="填写文件编号" clearable></el-input>
+            <el-input v-model="detailData.fileNo" placeholder="填写文件编号" clearable />
             <!-- {{ detailData.fileNo }} -->
           </div>
         </el-col>
@@ -35,7 +35,7 @@
           <div class="label">备注</div>
           <div class="value">
             <template v-if="userName">
-              <el-input v-model="detailData.remark" placeholder="填写备注" clearable></el-input>
+              <el-input v-model="detailData.remark" placeholder="填写备注" clearable />
             </template>
             <template v-else>
               {{ detailData.remark }}
@@ -54,6 +54,10 @@
           <div class="label">关闭人</div>
           <div class="value">{{ detailData.closeName }}</div>
         </el-col>
+        <el-col :span="24" class="item">
+            <div class="label">是否直调</div>
+            <div class="value">{{ detailData.isAllDirect?'是':'否' }}</div>
+          </el-col>
       </el-row>
     </div>
 
@@ -73,56 +77,58 @@
         show-summary
         :summary-method="$getSummaries"
       >
-        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="序号" type="index" width="50" />
         <el-table-column
           align="left"
           label="销售类型"
           prop="saleTypeName"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="物料编码"
           prop="materialCode"
           min-width="120"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="产品编码"
           prop="materialOldNumber"
           min-width="120"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="产品名称"
           prop="materialName"
           min-width="160"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="规格型号"
           prop="specification"
           min-width="160"
           show-overflow-tooltip
-        ></el-table-column>
-        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        />
+        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
         <el-table-column
           align="left"
           label="文件编号"
           prop="fileNo"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.price | numToFixed }}
           </template>
         </el-table-column>
-        <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
+        <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip />
+
         <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.totalAmount | numToFixed }}
@@ -134,7 +140,7 @@
           prop="customerWalletName2"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.payRebateAmount | numToFixed }}
@@ -151,7 +157,7 @@
           prop="customerWalletName"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.payAmount | numToFixed }}
@@ -168,22 +174,22 @@
           prop="directTransferQty"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="right"
           label="原订单数量"
           prop="oldQty"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        />
         <el-table-column
           align="left"
           label="备注"
           prop="remark"
           min-width="160"
           show-overflow-tooltip
-        ></el-table-column>
-        <el-table-column align="right" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
+        />
+        <el-table-column align="right" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
       </el-table>
     </div>
 
@@ -208,7 +214,7 @@
         <el-col :span="24" class="item">
           <div class="label">审批说明</div>
           <div class="value">
-            <el-input v-model="mainForm.remark" placeholder="请输入内容"></el-input>
+            <el-input v-model="mainForm.remark" placeholder="请输入内容" />
           </div>
         </el-col>
       </el-row>
@@ -216,7 +222,7 @@
 
     <div class="page-footer">
       <div class="footer">
-        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{
+        <el-button type="primary" :loading="formLoading" @click="clickSubmitForm">{{
           formLoading ? '提交中 ...' : '提 交'
         }}</el-button>
         <el-button @click="goBack">返回列表</el-button>
@@ -231,7 +237,6 @@ import { getDetail, examineData } from '@/api/supply/retail'
 export default {
   name: 'RetailExamine',
   componentName: 'RetailExamine',
-  props: ['listItem'],
   filters: {
     statusFilter(val) {
       const statusList = [
@@ -240,10 +245,11 @@ export default {
         { label: '审核通过', value: 'OK' }
         // { label: '审核驳回', value: 'FAIL' },,
       ]
-      let obj = statusList.find(o => o.value == val)
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
       detailData: {},

+ 28 - 13
src/views/supply/retail/components/retail_form.vue

@@ -73,14 +73,19 @@
             <el-input v-model="mainForm.remark" placeholder="请输入表头备注" />
           </el-form-item>
         </el-col>
-<!--        <el-col :span="24" :sm="12" :lg="12">-->
-<!--          <el-form-item label="计划单" prop="isPlanOrder">-->
-<!--            <el-radio-group v-model="mainForm.isPlanOrder">-->
-<!--              <el-radio :label="true">是</el-radio>-->
-<!--              <el-radio :label="false">否</el-radio>-->
-<!--            </el-radio-group>-->
-<!--          </el-form-item>-->
-<!--        </el-col>-->
+        <el-col :span="24" :sm="12" :lg="12">
+          <el-form-item label="是否直调" prop="isAllDirect">
+            <el-checkbox v-model="mainForm.isAllDirect">{{ mainForm.isAllDirect?'是':'否' }}</el-checkbox>
+          </el-form-item>
+        </el-col>
+        <!--        <el-col :span="24" :sm="12" :lg="12">-->
+        <!--          <el-form-item label="计划单" prop="isPlanOrder">-->
+        <!--            <el-radio-group v-model="mainForm.isPlanOrder">-->
+        <!--              <el-radio :label="true">是</el-radio>-->
+        <!--              <el-radio :label="false">否</el-radio>-->
+        <!--            </el-radio-group>-->
+        <!--          </el-form-item>-->
+        <!--        </el-col>-->
       </el-row>
     </el-form>
 
@@ -197,6 +202,7 @@
             <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
           </template>
         </el-table-column>
+        <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="订单金额" prop="compute_amount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ (scope.row.price * scope.row.qty) | numToFixed }}
@@ -311,7 +317,7 @@
             <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
           </template>
         </el-table-column>
-      </el-table>
+        </el-table-column></el-table>
     </div>
 
     <div class="page-footer">
@@ -575,6 +581,7 @@ export default {
   data() {
     return {
       mainForm: {
+        isAllDirect:'',
         orderNum: '',
         date: '',
         // type: '',
@@ -606,7 +613,8 @@ export default {
         proModel: '',
         price1: '',
         price2: '',
-        fileNum: ''
+        fileNum: '',
+        isAllDirect: false
       },
       currentPage: 1,
       listTotal: 0,
@@ -672,6 +680,9 @@ export default {
         if (newValue && newValue.length) {
           newValue.forEach((item, index) => {
             console.log(this.correspondName)
+            if (this.mainForm.isAllDirect) {
+              this.$set(this.goodsList[index], 'isDirectTransfer', true)
+            }
             if (this.correspondId) {
               this.goodsList[index].correspondName = this.correspondName
               this.goodsList[index].correspondId = this.correspondId
@@ -690,6 +701,11 @@ export default {
       },
       immediate: true,
       deep: true
+    },
+    'mainForm.isAllDirect'(e) {
+      this.goodsList.forEach(k => {
+        this.$set(k, 'isDirectTransfer', e)
+      })
     }
   },
 
@@ -910,7 +926,7 @@ export default {
 
     // 重置筛选表单
     resetScreenForm() {
-        this.$refs.screenForm.resetFields()
+      this.$refs.screenForm.resetFields()
       this.currentPage = 1
       this.getGoodsList()
     },
@@ -1102,6 +1118,7 @@ export default {
             // theTime: this.mainForm.date + ' 00:00:00',
             // mainId: this.mainForm.type,
             // mainName,
+            isAllDirect:this.mainForm.isAllDirect,
             k3ServiceId: this.mainForm.salesMan,
             isPlanOrder: this.mainForm.isPlanOrder,
             correspondName: this.correspondName,
@@ -1117,13 +1134,11 @@ export default {
             editData(params).then(res => {
               this.$successMsg('编辑成功')
               this.goBack()
-              
             })
           } else {
             addData(params).then(res => {
               this.$successMsg('添加成功')
               this.goBack()
-              
             })
           }
         }

+ 15 - 2
src/views/supply/retail/components/retail_return.vue

@@ -3,7 +3,9 @@
     <el-page-header @back="goBack" content="退订"></el-page-header>
 
     <div class="main-title">
-      <div class="title">订单信息 <span style="margin-left: 20px">经销商名称:{{detailData.customerName}}</span></div>
+      <div class="title">
+        订单信息 <span style="margin-left: 20px">经销商名称:{{ detailData.customerName }}</span>
+      </div>
     </div>
 
     <div class="diy-table-1">
@@ -44,6 +46,10 @@
           <div class="label">关闭人</div>
           <div class="value">{{ detailData.closeName }}</div>
         </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">是否直调</div>
+          <div class="value">{{ detailData.isAllDirect ? '是' : '否' }}</div>
+        </el-col>
       </el-row>
     </div>
 
@@ -112,6 +118,14 @@
           </template>
         </el-table-column>
         <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column
+          align="center"
+          label="已退订数量"
+          prop="retiredQty"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
+
         <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.totalAmount | numToFixed }}
@@ -320,7 +334,6 @@ export default {
         .then(res => {
           this.$successMsg('退订成功')
           this.goBack()
-     
         })
         .finally(res => {
           this.formLoading = false

+ 2 - 2
src/views/supply/sales/components/sales_return_form.vue

@@ -292,9 +292,9 @@
             min-width="120"
             show-overflow-tooltip
           ></el-table-column>
-          <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="120" show-overflow-tooltip
+          <el-table-column align="left" label="订单号"  min-width="120" show-overflow-tooltip
             >、
-            <template slot-scope="scope">
+            <template v-if=" scope.row" slot-scope="scope">
               {{
                 scope.row.orderType == 'TRADE' || scope.row.orderType == 'HOME'
                   ? scope.row.enginOrderNo

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