Selaa lähdekoodia

Merge branch 'feature/供应链二期开发' into develop

chenqilong 2 vuotta sitten
vanhempi
commit
c37306df6e
100 muutettua tiedostoa jossa 8765 lisäystä ja 9518 poistoa
  1. 1 2
      .env.development
  2. 2621 2892
      package-lock.json
  3. 1 1
      package.json
  4. 0 1
      src/App.vue
  5. 42 1
      src/api/basic_data/dealer.js
  6. 19 1
      src/api/basic_data/logistics.js
  7. 112 2
      src/api/basic_data/material.js
  8. 16 1
      src/api/basic_data/supplier.js
  9. 40 1
      src/api/basic_data/taker.js
  10. 62 1
      src/api/basic_data/warehouse.js
  11. 8 0
      src/api/common.js
  12. 111 0
      src/api/dataDictionary.js
  13. 65 0
      src/api/dataDictionary2.js
  14. 25 0
      src/api/deliver_list_v2.js
  15. 17 0
      src/api/deposit_list_v2.js
  16. 17 0
      src/api/fieldMan.js
  17. 9 1
      src/api/finance/account_list.js
  18. 17 0
      src/api/finance/change_list_v2.js
  19. 17 0
      src/api/finance/credit_list_v2.js
  20. 17 0
      src/api/finance/rebate_list_v2.js
  21. 17 0
      src/api/finance/receipt_list_v2.js
  22. 17 1
      src/api/finance/receivable_list.js
  23. 9 1
      src/api/issue.js
  24. 8 1
      src/api/notice.js
  25. 75 2
      src/api/policy_list.js
  26. 72 0
      src/api/stock.js
  27. 15 2
      src/api/supply/allot.js
  28. 33 1
      src/api/supply/commercial_list.js
  29. 38 1
      src/api/supply/deliver.js
  30. 67 1
      src/api/supply/engin.js
  31. 77 1
      src/api/supply/implement.js
  32. 49 2
      src/api/supply/pickup.js
  33. 19 2
      src/api/supply/policy.js
  34. 104 1
      src/api/supply/purchase.js
  35. 34 1
      src/api/supply/reserve.js
  36. 19 2
      src/api/supply/retail.js
  37. 45 1
      src/api/supply/sales.js
  38. 25 0
      src/api/zfireParam.js
  39. 1 1
      src/components/Common/examine-dialog.vue
  40. 477 0
      src/components/NotifyBox/index.vue
  41. 42 0
      src/components/template/add_callback_mixin.js
  42. BIN
      src/components/template/font/font_2075393_0cjq4n8ykvds.ttf
  43. BIN
      src/components/template/font/font_2075393_0cjq4n8ykvds.woff
  44. BIN
      src/components/template/font/font_2075393_0cjq4n8ykvds.woff2
  45. 12 4
      src/components/template/import_mixin.js
  46. 7 7
      src/components/template/operation_mixin.js
  47. 46 0
      src/components/template/popu.vue
  48. 17 21
      src/components/template/sel-export-column-list.vue
  49. 84 0
      src/components/template/selectData.js
  50. 416 78
      src/components/template/template-page-1.vue
  51. 38 17
      src/layout/components/AppMain.vue
  52. 84 229
      src/layout/components/Navbar.vue
  53. 8 80
      src/layout/components/Sidebar/SidebarItem.vue
  54. 7 6
      src/layout/components/TagsView/ScrollPane.vue
  55. 30 30
      src/layout/components/TagsView/index.vue
  56. 5 1
      src/main.js
  57. 33 14
      src/mixin/print.js
  58. 48 198
      src/permission.js
  59. 1 229
      src/router/index.js
  60. 2 1
      src/store/getters.js
  61. 9 4
      src/store/modules/user.js
  62. 3 1
      src/utils/common.js
  63. 445 0
      src/utils/panel2.js
  64. 10 0
      src/utils/request.js
  65. 16 0
      src/utils/util.js
  66. 1 2
      src/views/basic_data/dealer/components/dealer-apply-detail.vue
  67. 1 1
      src/views/basic_data/dealer/components/dealer_deposit_history.vue
  68. 2 2
      src/views/basic_data/dealer/components/dealer_list-detail.vue
  69. 4 2
      src/views/basic_data/dealer/dealer_apply.vue
  70. 9 5
      src/views/basic_data/dealer/dealer_deposit.vue
  71. 75 189
      src/views/basic_data/dealer/dealer_list.vue
  72. 211 453
      src/views/basic_data/dealer/dealer_stock.vue
  73. 136 216
      src/views/basic_data/logistics/logistics_list.vue
  74. 68 234
      src/views/basic_data/material/category_list.vue
  75. 4 3
      src/views/basic_data/material/components/material_list-detail.vue
  76. 15 12
      src/views/basic_data/material/components/modify_list-apply.vue
  77. 6 4
      src/views/basic_data/material/components/modify_list-approval.vue
  78. 3 2
      src/views/basic_data/material/components/modify_list-detail.vue
  79. 172 244
      src/views/basic_data/material/machine_list.vue
  80. 78 171
      src/views/basic_data/material/material_list.vue
  81. 234 427
      src/views/basic_data/material/modify_list.vue
  82. 177 270
      src/views/basic_data/material/price_list.vue
  83. 152 376
      src/views/basic_data/material/relation_list.vue
  84. 74 300
      src/views/basic_data/stock/Issue_list.vue
  85. 73 265
      src/views/basic_data/stock/material_list.vue
  86. 62 234
      src/views/basic_data/stock/product_list.vue
  87. 79 222
      src/views/basic_data/stock/product_list_customer.vue
  88. 73 292
      src/views/basic_data/stock/warehousing_list.vue
  89. 3 3
      src/views/basic_data/supplier/components/supplier_list-detail.vue
  90. 67 144
      src/views/basic_data/supplier/supplier_list.vue
  91. 118 146
      src/views/basic_data/taker/taker_car.vue
  92. 130 166
      src/views/basic_data/taker/taker_list.vue
  93. 55 0
      src/views/basic_data/wallet/wallet_list.vue
  94. 13 8
      src/views/basic_data/warehouse/components/warehouse_list-detail.vue
  95. 155 179
      src/views/basic_data/warehouse/warehouse_cost.vue
  96. 72 216
      src/views/basic_data/warehouse/warehouse_list.vue
  97. 174 231
      src/views/basic_data/warehouse/warehouse_site.vue
  98. 487 0
      src/views/dashboard.vue
  99. 0 653
      src/views/dashboard/index.vue
  100. 1 1
      src/views/deposit_home/components/deposit-apply-deduction.vue

+ 1 - 2
.env.development

@@ -3,6 +3,5 @@ ENV = 'development'
 
 # base api
 # 121.43.111.127 192.168.31.6
-#VUE_APP_BASE_API = 'http://127.0.0.1:10005/'
 VUE_APP_BASE_API = 'http://121.43.111.127:10005/'
-#VUE_APP_BASE_API = 'http://hg.zfire.top/api/'
+# VUE_APP_BASE_API = 'https://gyl.greeapps.com/supply_api/'

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2621 - 2892
package-lock.json


+ 1 - 1
package.json

@@ -15,7 +15,7 @@
     "test:ci": "npm run lint && npm run test:unit"
   },
   "dependencies": {
-    "@zjlib/element-plugins": "^1.1.2",
+    "@zjlib/element-plugins": "^2.3.0",
     "axios": "0.18.1",
     "clipboard": "^2.0.8",
     "concurrent-tasks": "^1.0.7",

+ 0 - 1
src/App.vue

@@ -10,7 +10,6 @@ export default {
   data() {
     return {}
   },
-
   methods: {}
 }
 </script>

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

@@ -1,5 +1,46 @@
-import request, { handleImport, postBlob } from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getDealerListV2(params) {
+  return request({
+    url: `/customer/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportDealerListV2(data, name) {
+  return postBlob({
+    url: '/customer/user/export/v2',
+    data,
+    name
+  })
+}
+export function getDealerStockListV2(params) {
+  return request({
+    url: `/customer/pt/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportDealerStockListV2(data, name) {
+  return postBlob({
+    url: '/customer/pt/user/export/v2',
+    data,
+    name
+  })
+}
 
+export function importCustomerV2(data) {
+  return handleImport('customer/import', data.formdata, data.id || '')
+}
+export function importCustomerPtV2(data) {
+  return handleImport('customer/pt/importData', data.formdata, data.id || '')
+}
+export function downloadCustomerPtV2(data, name) {
+  return getBlob({
+    url: 'customer/pt/download',
+    data,
+    name
+  })
+}
 //获取经销商列表
 export function getDealerList(params) {
   return request({

+ 19 - 1
src/api/basic_data/logistics.js

@@ -1,4 +1,22 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getLogisticsV2(params) {
+  return request({
+    url: `/logistics/listV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportLogisticsV2(data, name) {
+  return postBlob({
+    url: '/logistics/listV2/export',
+    data,
+    name
+  })
+}
+
+
+
+
 var qs = require('qs')
 export function getList(params) {
   return request({

+ 112 - 2
src/api/basic_data/material.js

@@ -1,4 +1,63 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getMaterialListV2(params) {
+  return request({
+    url: `/k3/material/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportMaterialListV2(data, name) {
+  return postBlob({
+    url: '/k3/material/export/v2',
+    data,
+    name
+  })
+}
+
+export function getMachineLlistV2(params) {
+  return request({
+    url: `/v2/machine-record/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportMachineLlistV2(data, name) {
+  return postBlob({
+    url: '/v2/machine-record/list/export',
+    data,
+    name
+  })
+}
+
+export function getCategoryListV2(params) {
+  return request({
+    url: `/v2/k3/category/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportCategoryListV2(data, name) {
+  return postBlob({
+    url: '/v2/k3/category/list/export',
+    data,
+    name
+  })
+}
+
+export function getProductListV2(params) {
+  return request({
+    url: `/v2/product-compose/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportProductListV2(data, name) {
+  return postBlob({
+    url: '/v2/product-compose/list/export',
+    data,
+    name
+  })
+}
 
 export function getList(params) {
   return request({
@@ -32,6 +91,7 @@ export function getMaterialList(params) {
 }
 
 export function getMaterialDetail(params) {
+  console.log(params, 999)
   return request({
     url: '/k3/material/detail',
     method: 'get',
@@ -165,6 +225,38 @@ export function getProductRriceEdit(params) {
   })
 }
 
+// 产品调价单-列表
+export function v2ProductUpdPriceList(data) {
+  return request({
+    url: `/v2/product-upd-price/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//产品调价单-导出
+export function v2ProductUpdPriceListExport(data, name) {
+  return postBlob({
+    url: '/v2/product-upd-price/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+//工程师组别配置API-模板下载
+export function productUpdPriceDownload(data, name) {
+  return getBlob({
+    url: 'product-upd-price/download',
+    data,
+    name
+  })
+}
+//导入调价单-导入
+export function productUpdPriceMaterialImport(data) {
+  return handleImport('/product-upd-price/material/import', data.formdata, data.id || '')
+}
+
 export function getProductRriceList(params) {
   return request({
     url: '/product-upd-price/list',
@@ -189,6 +281,25 @@ export function getProductRriceSubmit(params) {
   })
 }
 
+// 产品调价单-列表
+export function v2ProductPriceList(data) {
+  return request({
+    url: `/v2/product-price/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//产品调价单-导出
+export function v2ProductPriceListExport(data, name) {
+  return postBlob({
+    url: '/v2/product-price/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 // 产品价格列表
 export function getProductPriceList(params) {
   return request({
@@ -279,7 +390,6 @@ export function getKingDeeCategory() {
   })
 }
 
-
 //新增产品类别小类
 export function getProductCategoryAddSub(data) {
   return request({

+ 16 - 1
src/api/basic_data/supplier.js

@@ -1,4 +1,19 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListV2(params) {
+  return request({
+    url: `/supplier/listV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportListV2(data, name) {
+  return postBlob({
+    url: '/supplier/listV2/export',
+    data,
+    name
+  })
+}
+
 
 export function getList(params) {
   return request({

+ 40 - 1
src/api/basic_data/taker.js

@@ -1,4 +1,23 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 提货人档案-列表
+export function v2TakerRecordList(data) {
+  return request({
+    url: `/v2/taker-record/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//提货人档案-导出
+export function v2TakerRecordListExport(data, name) {
+  return postBlob({
+    url: '/v2/taker-record/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 //提货人档案列表
 export function getList(params) {
@@ -48,6 +67,26 @@ export function getCodeApi(params) {
     params
   })
 }
+
+// 提货车辆档案-列表
+export function v2TakerCarRecordList(data) {
+  return request({
+    url: `/v2/take-car-record/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//提货车辆档案-导出
+export function v2TakerCarRecordListExport(data, name) {
+  return postBlob({
+    url: '/v2/take-car-record/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 //提货车辆档案列表
 export function getCarList(params) {
   return request({

+ 62 - 1
src/api/basic_data/warehouse.js

@@ -1,4 +1,55 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+export function getListV2(params) {
+  return request({
+    url: `/stock/listV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListV2(data, name) {
+  return postBlob({
+    url: '/stock/listV2/export',
+    data,
+    name
+  })
+}
+export function importStockV2(data) {
+  return handleImport('stock/importToll', data.formdata, data.id || '')
+}
+
+export function getListStockV2(params) {
+  return request({
+    url: `/stock/listStockV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListStockV2(data, name) {
+  return postBlob({
+    url: '/stock/listStockV2/export',
+    data,
+    name
+  })
+}
+
+export function getListTollV2(params) {
+  return request({
+    url: `/stock/listTollV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListTollV2(data, name) {
+  return postBlob({
+    url: '/stock/listTollV2/export',
+    data,
+    name
+  })
+}
 
 export function getList(params) {
   return request({
@@ -16,6 +67,14 @@ export function getStockDetail(params) {
   })
 }
 
+export function getStockDetailStock(params) {
+  return request({
+    url: '/stock/detailStock',
+    method: 'get',
+    params
+  })
+}
+
 export function getListReserve(params) {
   return request({
     url: '/stock/listReserve',
@@ -24,6 +83,8 @@ export function getListReserve(params) {
   })
 }
 
+
+
 export function getListStock(params) {
   return request({
     url: '/stock/listStock',

+ 8 - 0
src/api/common.js

@@ -1,5 +1,13 @@
 import request from '@/utils/request'
 
+export function commonLogList(params) {
+  return request({
+    url: '/common/log/list',
+    method: 'get',
+    params
+  })
+}
+
 // 字典列表
 export function getDictList(params) {
   return request({

+ 111 - 0
src/api/dataDictionary.js

@@ -0,0 +1,111 @@
+import request, { postBlob } from '@/utils/request'
+
+export function getNoticeList(params) {
+  return request({
+    url: `/notice/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function getDataDictionary(data) {
+  return request({
+    url: `/dict/page?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function getDictRefPage(data) {
+  return request({
+    url: `/dict/ref/page?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function dictRefDel(params) {
+  return request({
+    url: '/dict/ref/del',
+    method: 'post',
+    params
+  })
+}
+
+export function getDataDictionaryExport(data, name) {
+  return postBlob({
+    url: '/dict/page/export',
+    data,
+    name
+  })
+}
+
+export function detailDictRef(params) {
+  return request({
+    url: `/dict/ref/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function updateDictRef(data) {
+  return request({
+    url: `/dict/ref/update`,
+    method: 'post',
+    data
+  })
+}
+export function addDictRef(data) {
+  return request({
+    url: `/dict/ref/add`,
+    method: 'post',
+    data
+  })
+}
+export function addDataDictionary(data) {
+  return request({
+    url: `/dict/add`,
+    method: 'post',
+    data
+  })
+}
+
+export function updateDataDictionary(data) {
+  return request({
+    url: `/dict/update`,
+    method: 'post',
+    data
+  })
+}
+
+export function delDataDictionary(params) {
+  return request({
+    url: `/dict/del`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictDetail(params) {
+  return request({
+    url: `/dict/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictListDict(params) {
+  return request({
+    url: `/dict/listDict`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictTypeList(data) {
+  return request({
+    url: `/dict/type/list`,
+    method: 'post',
+    data
+  })
+}

+ 65 - 0
src/api/dataDictionary2.js

@@ -0,0 +1,65 @@
+import request, { postBlob } from '@/utils/request'
+
+export function getDataDictionary(data) {
+  return request({
+    url: `/dict/page?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function getDataDictionaryExport(data, name) {
+  return postBlob({
+    url: '/dict/page/export',
+    data,
+    name
+  })
+}
+
+export function addDataDictionary(data) {
+  return request({
+    url: `/dict/add`,
+    method: 'post',
+    data
+  })
+}
+
+export function updateDataDictionary(data) {
+  return request({
+    url: `/dict/update`,
+    method: 'post',
+    data
+  })
+}
+
+export function delDataDictionary(params) {
+  return request({
+    url: `/dict/del`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictDetail(params) {
+  return request({
+    url: `/dict/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictListDict(params) {
+  return request({
+    url: `/common/dict/listDict`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictTypeList(data) {
+  return request({
+    url: `/dict/type/list`,
+    method: 'post',
+    data
+  })
+}

+ 25 - 0
src/api/deliver_list_v2.js

@@ -0,0 +1,25 @@
+import request, { postBlob } from '@/utils/request'
+
+export function invoiceListRetailV3(data) {
+  return request({
+    url: `/invoice/listRetailV3?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function invoiceListRetailV2(data) {
+  return request({
+    url: `/invoice/listRetailV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function invoiceListRetailV2Export(data, name) {
+  return postBlob({
+    url: '/invoice/listRetailV2/export',
+    data,
+    name
+  })
+}

+ 17 - 0
src/api/deposit_list_v2.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function depositManageHomeList(data) {
+  return request({
+    url: `/v2/deposit-manage/home/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function depositManageHomeListExport(data, name) {
+  return postBlob({
+    url: '/v2/deposit-manage/home/list/export',
+    data,
+    name
+  })
+}

+ 17 - 0
src/api/fieldMan.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function zfireSave(data, moduleId) {
+  return request({
+    url: `/zfire/save?moduleId=${moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function zfireDel(data, adminUserId, moduleId) {
+  return request({
+    url: `/zfire/delete?adminUserId=${adminUserId}&moduleId=${moduleId}`,
+    method: 'post',
+    data
+  })
+}

+ 9 - 1
src/api/finance/account_list.js

@@ -1,4 +1,12 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getFinanceStandingBookListV2(params) {
+  return request({
+    url: `/finance/standing/book/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
 
 // 台账列表
 export function getFinanceStandingBookList(params) {

+ 17 - 0
src/api/finance/change_list_v2.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function financeTransferList(data) {
+  return request({
+    url: `/finance/transfer/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function financeTransferListExport(data, name) {
+  return postBlob({
+    url: '/finance/transfer/list/listExport/v2',
+    data,
+    name
+  })
+}

+ 17 - 0
src/api/finance/credit_list_v2.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function getCreditList(data) {
+  return request({
+    url: `/credit/record/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function getCreditListExport(data, name) {
+  return postBlob({
+    url: '/credit/list/v2/export',
+    data,
+    name
+  })
+}

+ 17 - 0
src/api/finance/rebate_list_v2.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function rebateOrderList(data) {
+  return request({
+    url: `/rebate/order/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function rebateOrderListExport(data, name) {
+  return postBlob({
+    url: '/rebate/order/list/v2/export',
+    data,
+    name
+  })
+}

+ 17 - 0
src/api/finance/receipt_list_v2.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function k3ReceiptList(data) {
+  return request({
+    url: `/k3/receipt/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function k3ReceiptListExport(data, name) {
+  return postBlob({
+    url: '/k3/receipt/list/export/v2',
+    data,
+    name
+  })
+}

+ 17 - 1
src/api/finance/receivable_list.js

@@ -1,5 +1,21 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getFinanceOtherReceListV2(params) {
+  return request({
+    url: `/finance/other/rece/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
 
+//政策列表V2-导出
+export function exportFinanceOtherReceListV2(data, name) {
+  return postBlob({
+    url: '/finance/other/rece/listExport/v2',
+    method: 'post',
+    data,
+    name
+  })
+}
 // 其他应收单-新增
 export function getFinanceOtherReceAdd(data) {
   return request({

+ 9 - 1
src/api/issue.js

@@ -1,4 +1,12 @@
-import request from '@/utils/request'
+import request, { postBlob,  getBlob } from '@/utils/request'
+
+export function getListV2(params) {
+  return request({
+    url: `/com/list/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
 
 // 获取列表
 export function getList(params) {

+ 8 - 1
src/api/notice.js

@@ -1,5 +1,12 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
+export function getListV2(params) {
+  return request({
+    url: `/notice/list/v2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
 // 获取列表
 export function getList(params) {
   return request({

+ 75 - 2
src/api/policy_list.js

@@ -1,4 +1,23 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 政策-列表V2
+export function policyListV2(data) {
+  return request({
+    url: `/policy/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//政策列表V2-导出
+export function policyListV2Export(data, name) {
+  return postBlob({
+    url: '/policy/list/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 // 销售政策
 export function getList(params) {
@@ -199,8 +218,16 @@ export function getPolicyDetail(params) {
   })
 }
 
-// 对应经销商
+// 政策-列表V2
+export function policyCustomerCountListV2(data) {
+  return request({
+    url: `/policy/customer_count/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
 
+// 对应经销商
 export function getCustomerlist(params) {
   return request({
     url: '/policy/customer_count/list',
@@ -219,6 +246,24 @@ export function eidtBatch(params) {
 
 // 销售类型
 
+// 销售类型列表V2
+export function saleTypeRebateListV2(data) {
+  return request({
+    url: `/sale/type/rebate/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+//销售类型列表V2-导出
+export function saleTypeRebateListV2Export(data, name) {
+  return postBlob({
+    url: '/sale/type/list/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 export function getTypeList(params) {
   return request({
     url: '/sale/type/list',
@@ -268,7 +313,15 @@ export function updateType(params) {
 }
 
 // 返利钱包列表
+export function walletRebateListV2(data) {
+  return request({
+    url: `/wallet/rebate/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
 
+// 返利钱包列表
 export function getWalletList(params) {
   return request({
     url: '/wallet/rebate/list',
@@ -390,6 +443,26 @@ export function getCompanyList(params) {
     params
   })
 }
+
+// 返利钱包销售类型V2
+export function walletRebateSaletypeListV2(data) {
+  return request({
+    url: `/wallet/rebate_saletype/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//返利钱包销售类型V2-导出
+export function walletRebateSaletypeListV2Export(data, name) {
+  return postBlob({
+    url: '/wallet/rebate_saletype/list/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 // 返利钱包销售类型-列表
 export function getWalletRebateSaletypelist(params) {
   return request({

+ 72 - 0
src/api/stock.js

@@ -1,4 +1,68 @@
 import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListStockToDayV2(params) {
+  return request({
+    url: `/stock/manager/listStockToDayV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListStockToDayV2(data, name) {
+  return postBlob({
+    url: '/stock/manager/listStockToDayV2/export',
+    data,
+    name
+  })
+}
+
+export function getListStockToDayCustomerV2(params) {
+  return request({
+    url: `/stock/manager/listStockToDayCustomerV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListStockToDayCustomerV2(data, name) {
+  return postBlob({
+    url: '/stock/manager/listStockToDayCustomerV2/export',
+    data,
+    name
+  })
+}
+
+export function getStockListV2(params) {
+  return request({
+    url: `/stock/manager/listV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportStockListV2(data, name) {
+  return postBlob({
+    url: '/stock/manager/listV2/export',
+    data,
+    name
+  })
+}
+
+export function getStockManagerListV2(params) {
+  return request({
+    url: `/stock/manager/listCustomerV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportStockManagerListV2(data, name) {
+  return postBlob({
+    url: '/stock/manager/listCustomerV2/export',
+    data,
+    name
+  })
+}
+
 
 // 获取库存列表
 export function getStockList(params) {
@@ -71,6 +135,14 @@ export function getNoticeList(params) {
     params
   })
 }
+// 库存到货访问通知-列表
+export function getArrivalNotice(params) {
+  return request({
+    url: '/stock/visit/list',
+    method: 'get',
+    params
+  })
+}
 
 // 库存到货访问通知-数量
 export function getNoticeNum(params) {

+ 15 - 2
src/api/supply/allot.js

@@ -1,5 +1,18 @@
-import request from '@/utils/request'
-
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getTransferV2(params) {
+  return request({
+    url: `/v2/transfer/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportTransferV2(data, name) {
+  return postBlob({
+    url: '/v2/transfer/list/export',
+    data,
+    name
+  })
+}
 // 获取列表
 export function getList(params) {
   return request({

+ 33 - 1
src/api/supply/commercial_list.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
 // 删除
 export function getBusPriceDelete(params) {
@@ -31,6 +31,38 @@ export function getBusPriceExport(params) {
     params
   })
 }
+// 商用工程产品价格-列表
+export function v2BusPriceList(data) {
+  return request({
+    url: `/v2/bus/price/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//工程信息单-导出
+export function v2BusPriceListExport(data, name) {
+  return postBlob({
+    url: '/v2/bus/price/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+//下载商用工程产品价格模板
+export function v2BusPriceListExcel(data, name) {
+  return getBlob({
+    url: 'bus/price/download',
+    data,
+    name
+  })
+}
+//商用工程产品价格-导入
+export function v2BusPriceListImport(data) {
+  return handleImport('/bus/price/import', data.formdata, data.id || '')
+}
+
 // 商用工程产品价格列表
 export function getBusPriceList(params) {
   return request({

+ 38 - 1
src/api/supply/deliver.js

@@ -1,4 +1,22 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+export function getSumListV2(data) {
+  return request({
+    url: `/invoice/listV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+
+export function exportSumListV2(data, name) {
+  return postBlob({
+    url: '/invoice/listV2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 // 获取列表 - 零售发货单
 export function getDeliverList(params) {
@@ -36,6 +54,25 @@ export function getPasswordRecord(params) {
   })
 }
 
+// 工程申请发货单-列表V2
+export function invoiceListProjectV2(data) {
+  return request({
+    url: `/invoice/listProjectV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//工程申请发货单-列表V2导出
+export function invoiceListProjectV2Export(data, name) {
+  return postBlob({
+    url: '/invoice/listProjectV2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 // 获取列表 - 工程发货单
 export function getEnginList(params) {
   return request({

+ 67 - 1
src/api/supply/engin.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
 // 获取列表
 export function getList(params) {
@@ -46,6 +46,25 @@ export function getPositionList(params) {
 }
 
 // 工程信息单 - 获取列表
+export function v2EnginInfoOrderList(data) {
+  return request({
+    url: `/v2/engin-info-order/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//工程信息单-导出
+export function v2EnginInfoOrderListExport(data, name) {
+  return postBlob({
+    url: '/v2/engin-info-order/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+// 工程信息单 - 获取列表
 export function getEnginList(params) {
   return request({
     url: '/engin-info-order/list',
@@ -153,6 +172,53 @@ export function overEngin(params) {
   })
 }
 
+// 家用工程订单-列表统计
+export function v2EnginOrderHomeCountList(data) {
+  return request({
+    url: `/v2/engin-order/home/count-list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+// 家用工程订单-列表
+export function v2EnginOrderHomeList(data) {
+  return request({
+    url: `/v2/engin-order/home/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//家用工程订单-导出
+export function v2EnginOrderHomeListExport(data, name) {
+  return postBlob({
+    url: '/v2/engin-order/home/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+// 商用工程订单-列表
+export function v2EnginOrderTradeList(data) {
+  return request({
+    url: `/v2/engin-order/trade/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//商用工程订单-导出
+export function v2EnginOrderTradeListExport(data, name) {
+  return postBlob({
+    url: '/v2/engin-order/trade/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 // 工程订单 - 获取列表
 export function getOrderList(params) {
   return request({

+ 77 - 1
src/api/supply/implement.js

@@ -1,4 +1,61 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 销售执行明细列表-零售订单-V2
+export function retailExecRetailV2(data) {
+  return request({
+    url: `/retail/exec/retail/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//销售执行明细列表-政策零售订单-V2-导出
+export function retailExecRetailV2Export(data, name) {
+  return postBlob({
+    url: '/retail/exec/retail/export/v2',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+// 销售执行明细列表-政策零售订单-V2
+export function retailExecPolicyListV2(data) {
+  return request({
+    url: `/retail/exec/policy/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//销售执行明细列表-政策零售订单-V2-导出
+export function retailExecPolicyListV2Export(data, name) {
+  return postBlob({
+    url: '/retail/exec/policy/export/v2',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+// 销售执行明细列表-政策零售订单-V2
+export function retailExecEnginListV2(data) {
+  return request({
+    url: `/retail/exec/engin/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//销售执行明细列表-政策零售订单-V2-导出
+export function retailExecEnginListV2Export(data, name) {
+  return postBlob({
+    url: '/retail/exec/engin/export/v2',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 // 获取列表
 export function getList(params) {
@@ -35,3 +92,22 @@ export function getExecList(params) {
     params
   })
 }
+
+// 执行明细-列表
+export function v2EnginInfoOrderExcelList(data) {
+  return request({
+    url: `/v2/engin-info-order/exec/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//执行明细-导出
+export function v2EnginInfoOrderExcelListExport(data, name) {
+  return postBlob({
+    url: '/v2/engin-info-order/exec/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}

+ 49 - 2
src/api/supply/pickup.js

@@ -1,5 +1,53 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
+// 提货-列表V2
+export function pickListV2(data) {
+  return request({
+    url: `/pick/listV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+
+//提货-列表V2导出
+export function pickListV2Export(data, name) {
+  return postBlob({
+    url: '/pick/listV2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+
+
+export function getPickupListV2(data) {
+  return request({
+    url: `/pick/listV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+
+
+export function exportPickupListV2(data, name) {
+  return postBlob({
+    url: '/pick/listV2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+export function getListInvoiceNumberV2(data) {
+  return request({
+    url: `/invoice/listInvoiceNumberV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
 // 获取列表
 export function getPickupList(params) {
   return request({
@@ -194,4 +242,3 @@ export function getListOrderTrack(params) {
     params
   })
 }
-

+ 19 - 2
src/api/supply/policy.js

@@ -1,5 +1,22 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
+export function getRetailListV2(data) {
+  return request({
+    url: `/retail/listP/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+
+export function exportRetailListV2(data, name) {
+  return postBlob({
+    url: '/retail/listP/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 // 获取列表
 export function getList(params) {
   return request({
@@ -8,7 +25,7 @@ export function getList(params) {
     params
   })
 }
-
+ 
 // 获取详情
 export function getDetail(params) {
   return request({

+ 104 - 1
src/api/supply/purchase.js

@@ -1,4 +1,107 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getPlanCustomerListV2(params) {
+  return request({
+    url: `/plan/listCustomerV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportPlanCustomerListV2(data, name) {
+  return postBlob({
+    url: '/plan/listCustomerV2/export',
+    data,
+    name
+  })
+}
+
+export function getPurchaseOutListV2(params) {
+  return request({
+    url: `/stock/orderOutIn/listPurchaseOrderOutV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportPurchaseOutListV2(data, name) {
+  return postBlob({
+    url: '/stock/orderOutIn/listPurchaseOrderOutV2/export',
+    data,
+    name
+  })
+}
+
+export function getOtherStockInListV2(params) {
+  return request({
+    url: `/stock/orderOutIn/listOtherStockInV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportOtherStockInListV2(data, name) {
+  return postBlob({
+    url: '/stock/orderOutIn/listOtherStockInV2/export',
+    data,
+    name
+  })
+}
+export function getListOtherStockOutV2(params) {
+  return request({
+    url: `/stock/orderOutIn/listOtherStockOutV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportListOtherStockOutV2(data, name) {
+  return postBlob({
+    url: '/stock/orderOutIn/listOtherStockOutV2/export',
+    data,
+    name
+  })
+}
+
+export function getPlanListV2(params) {
+  return request({
+    url: `/plan/listCustomerV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportPlanListV2(data, name) {
+  return postBlob({
+    url: '/plan/listCustomerV2/export/export',
+    data,
+    name
+  })
+}
+export function getPurchaseOrderListV2(params) {
+  return request({
+    url: `/v2/purchaseOrder/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportPurchaseOrderV2(data, name) {
+  return postBlob({
+    url: '/v2/purchaseOrder/list/export',
+    data,
+    name
+  })
+}
+
+export function getPurchaseStockInListV2(params) {
+  return request({
+    url: `/v2/purchaseStockIn/list?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportPurchaseStockInV2(data, name) {
+  return postBlob({
+    url: '/v2/purchaseStockIn/list/export',
+    data,
+    name
+  })
+}
+
 
 // 获取采购单列表
 export function getPurchaseList(params) {

+ 34 - 1
src/api/supply/reserve.js

@@ -1,4 +1,37 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 导入
+export function reserveImportData(data) {
+  return handleImport('/reserve/importData', data.formdata, data.id || '')
+}
+
+// 下载模板
+export function reserveImportDataExcel(data, name) {
+  return getBlob({
+    url: '/reserve/download',
+    data,
+    name
+  })
+}
+
+// 提货-列表V2
+export function reserveListV2(data) {
+  return request({
+    url: `/reserve/listV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//提货-列表V2导出
+export function reserveListV2Export(data, name) {
+  return postBlob({
+    url: '/reserve/listV2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 // 获取列表
 export function getList(params) {

+ 19 - 2
src/api/supply/retail.js

@@ -1,5 +1,22 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
+export function getRetaillListV2(data) {
+  return request({
+    url: `/retail/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+
+export function exportRetaillListV2(data, name) {
+  return postBlob({
+    url: '/retail/list/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 // 获取列表
 export function getList(params) {
   return request({
@@ -8,7 +25,7 @@ export function getList(params) {
     params
   })
 }
-
+ 
 // 获取详情
 export function getDetail(params) {
   return request({

+ 45 - 1
src/api/supply/sales.js

@@ -1,4 +1,48 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 销售执行明细列表-零售订单-V2
+export function saleOrderListV2(data) {
+  return request({
+    url: `/sale/order/listV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//销售执行明细列表-政策零售订单-V2-导出
+export function saleOrderListV2Export(data, name) {
+  return postBlob({
+    url: '/sale/order/listV2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+export function getSaleOrderListV2(data) {
+  return request({
+    url: `/sale/order/listV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function getSaleOrderListV3(data) {
+  return request({
+    url: `/sale/order/listV3?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function exportSaleOrderListV2(data, name) {
+  return postBlob({
+    url: '/sale/order/listV2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 // 获取列表
 export function getList(params) {

+ 25 - 0
src/api/zfireParam.js

@@ -0,0 +1,25 @@
+import request, { postBlob } from '@/utils/request'
+
+export function zfireParamList(params) {
+  return request({
+    url: `/zfire/param/list`,
+    method: 'post',
+    params
+  })
+}
+
+export function zfireParamSave(data) {
+  return request({
+    url: `/zfire/param/save`,
+    method: 'post',
+    data
+  })
+}
+
+export function zfireParamDelete(params) {
+  return request({
+    url: `/zfire/param/delete`,
+    method: 'post',
+    params
+  })
+}

+ 1 - 1
src/components/Common/examine-dialog.vue

@@ -63,7 +63,7 @@ export default {
     submitForm() {
       this.$refs.examineForm.validate(valid => {
         if (valid) {
-          this.$parent.submitExamineForm()
+          this.$emit('submit')
           this.$refs.examineForm.resetFields()
         }
       })

+ 477 - 0
src/components/NotifyBox/index.vue

@@ -0,0 +1,477 @@
+<template>
+  <el-dialog
+    title="消息"
+    :visible.sync="showMessages"
+    :append-to-body="true"
+    width="50%"
+    :show-close="false"
+    :close-on-click-modal="false"
+  >
+    <el-radio-group v-model="type" size="mini" @change="checkFn">
+      <el-radio-button :label="0">系统通知</el-radio-button>
+      <el-radio-button :label="1">文件下发</el-radio-button>
+      <el-radio-button :label="2">返利确认单</el-radio-button>
+      <el-radio-button :label="3">物流通知</el-radio-button>
+      <el-radio-button :label="4">到货通知</el-radio-button>
+    </el-radio-group>
+    <!-- 系统通知 -->
+    <div v-show="type === 0" class="table">
+      <el-table
+        ref="table"
+        v-loading="listLoading"
+        class="cql"
+        :data="dataList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+      >
+        <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="标题" prop="title" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="来源" prop="source" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="时间" prop="issueTime" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-button type="text" class="textColor" @click="lookInDialog(scope.row.id)">查看</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!-- 文件下发 -->
+    <div v-show="type === 1" class="table">
+      <el-table
+        ref="table"
+        v-loading="listLoading"
+        :data="fileList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+      >
+        <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="标题" prop="title" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="来源" prop="operatorNickName" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="时间" prop="createTime" min-width="160" show-overflow-tooltip />
+        <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.id)">下载</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!-- 返利确认单 -->
+    <div v-show="type === 2" class="table">
+      <el-table
+        ref="table"
+        v-loading="listLoading"
+        :data="rebateList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+      >
+        <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="确认人" prop="examineBy" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="确认时间" prop="examineTime" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-button type="text" class="textColor" @click="secondFn(scope.row.rebateOrderId)">{{
+              isCustomer ? '确认' : '复核'
+            }}</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!-- 物流通知 -->
+    <div v-show="type === 3" class="table">
+      <el-table
+        ref="table"
+        v-loading="listLoading"
+        :data="invoiceOrderList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+      >
+        <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="发货单" prop="id" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-link v-if="!isCustomer" type="primary" :underline="false" @click="handleJump(scope.row.id)">{{
+              scope.row.id
+            }}</el-link>
+            <template v-else>{{ scope.row.id }}</template>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="内容" prop="orderTrackStatus" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="时间" prop="orderTrackTime" min-width="160" show-overflow-tooltip />
+        <el-table-column align="center" label="收货地址" prop="address" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ scope.row.address ? scope.row.address : '——' }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="收货客户" prop="receivingName" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">{{ scope.row.receivingName ? scope.row.receivingName : '——' }}</template>
+        </el-table-column>
+        <el-table-column align="center" label="" min-width="80" show-overflow-tooltip fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" class="textColor" @click="handLogistics(scope.row)">查看</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!-- 到货通知 -->
+    <div v-show="type == 4" class="table">
+      <div class="mymain-container">
+        <el-form ref="form" label-width="80px" label-position="left" size="mini">
+          <el-row>
+            <el-col>
+              <el-form-item prop="specification" label="规格型号">
+                <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>
+                </div>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div class="table">
+          <el-table
+            ref="table"
+            v-loading="listLoading"
+            :data="arrivalNoticeList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+          >
+            <el-table-column
+              property="materialOldNumber"
+              align="left"
+              min-width="120"
+              label="产品编号"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              property="materialNumber"
+              align="left"
+              min-width="100"
+              label="物料编码"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              property="materialName"
+              align="left"
+              min-width="250"
+              label="产品名称"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              property="specification"
+              align="left"
+              min-width="350"
+              label="规格型号"
+              show-overflow-tooltip
+            />
+            <el-table-column property="stockName" align="left" min-width="100" label="到货仓库" show-overflow-tooltip />
+            <el-table-column
+              property="updateTime"
+              align="left"
+              min-width="200"
+              label="到货通知时间"
+              show-overflow-tooltip
+            />
+          </el-table>
+        </div>
+      </div>
+    </div>
+    <!-- 分页 -->
+    <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>
+    <!-- 内层弹窗 -->
+    <el-dialog width="40%" title="消息标题" :visible.sync="inDialog" append-to-body>
+      <div class="detail-container">
+        <div class="title">{{ detailData.title }}</div>
+        <div class="text">
+          发布人:{{ detailData.issueNickName }}<el-divider direction="vertical" />发布时间:{{ detailData.issueTime }}
+        </div>
+        <el-divider />
+        <div class="content">{{ detailData.content }}</div>
+        <el-divider v-if="detailData.files && detailData.files.length > 0" />
+        <div v-if="detailData.files && detailData.files.length > 0" class="file">
+          <div>附件:</div>
+          <div class="file-list">
+            <div v-for="(item, index) in detailData.files" :key="index" class="item">
+              <el-image
+                v-if="checkFileType(item.url) == 'image'"
+                class="img"
+                :src="imageURL + item.url"
+                :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" />
+                <div class="name ellipsis-3">{{ item.name }}</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" type="primary" @click="confirmCheck(detailData.noticeId)">确认接收</el-button>
+        <el-button size="mini" @click="inDialog = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog
+      title="物流信息"
+      :visible.sync="visible"
+      width="60%"
+      append-to-body
+      :close-on-click-modal="false"
+      @close="onClose"
+    >
+      <el-timeline v-if="logisticsDetail.length" class="logistics" :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"> {{ item.status }} </el-col>
+            <el-col>
+              <div class="flex">
+                <div>{{ item.context }}</div>
+                <!-- <div>{{ item.createTime }}</div> -->
+              </div>
+            </el-col>
+          </el-row>
+        </el-timeline-item>
+      </el-timeline>
+      <div v-else class="tip">暂无物流信息</div>
+    </el-dialog>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" size="mini" @click="closeFn">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+import {
+  getNoticeList,
+  getComListList,
+  getComListDownload,
+  getNoticeDetail,
+  confirmCheck,
+  getRebateOrderList,
+  getListInvoiceOrder
+} from '@/api/dashboard'
+import { getArrivalNotice } from '@/api/stock'
+import { getListOrderTrack } from '@/api/supply/pickup'
+import { getFileUrl } from '@/api/common'
+export default {
+  data() {
+    return {
+      imageURL: this.$imageUrl,
+      type: 0,
+      currentPage: 1,
+      pageSize: 10,
+      listTotal: 0,
+      dataList: [],
+      listLoading: false,
+      fileList: [],
+      inDialog: false,
+      detailData: [],
+      rebateList: [],
+      invoiceOrderList: [],
+      visible: false,
+      orderId: '',
+      logisticsDetail: [],
+      arrivalNoticeList: [],
+      specification: '',
+      fnArr: ['getDataList', 'getFileList', 'getRebateList', 'getListInvoiceOrder', 'getArrivalNotice']
+    }
+  },
+  computed: {
+    ...mapGetters(['showMessages', 'isCustomer'])
+  },
+  created() {
+    this[this.fnArr[this.type]]()
+  },
+  methods: {
+    checkFn(i) {
+      this[this.fnArr[i]]()
+    },
+    // 获取文件列表数据
+    async getFileList() {
+      const data = {
+        needDown: true,
+        pageSize: this.pageSize,
+        pageNo: this.currentPage
+      }
+      const res = await getComListList(data)
+      this.fileList = res.data.records
+      this.listTotal = res.data.total
+    },
+    // 获取返利确认单数据
+    async getRebateList() {
+      const data = {
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        isSecondExamine: false
+      }
+      const res = await getRebateOrderList(data)
+      this.rebateList = res.data.records
+      this.listTotal = res.data.total
+    },
+    // 获取列表数据
+    async getDataList() {
+      const data = {
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        readFlag: false
+      }
+      const res = await getNoticeList(data)
+      console.log(res)
+      this.dataList = res.data.records
+      this.listTotal = res.data.total
+    },
+    // 获取物流列表
+    async getListInvoiceOrder() {
+      const data = {
+        pageSize: this.pageSize,
+        pageNum: this.currentPage
+      }
+      const res = await getListInvoiceOrder(data)
+      this.invoiceOrderList = res.data.records
+      this.listTotal = res.data.total
+    },
+    async getArrivalNotice() {
+      const data = {
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        specification: this.specification
+      }
+      const res = await getArrivalNotice(data)
+      this.arrivalNoticeList = res.data.records
+      this.listTotal = res.data.total
+    },
+    handleReset() {
+      this.pageSize = 10
+      this.pageNum = 1
+      this.specification = ''
+      this.getArrivalNotice()
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      this[this.fnArr[this.type]]()
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      this[this.fnArr[this.type]]()
+    },
+    openLink(url) {
+      getFileUrl({ key: url }).then(res => {
+        window.open(res.data)
+      })
+    },
+    // 复核
+    secondFn(id) {
+      this.$router.push({
+        path: '/finance/rebate_list',
+        query: {
+          id
+        }
+      })
+      this.type = 0
+      this.$store.commit('user/showMessage', 'no')
+    },
+    // 确认查收
+    confirmCheck(id) {
+      confirmCheck({ noticeIds: id }).then(res => {
+        this.$successMsg('查收成功')
+        this.inDialog = false
+        this[this.fnArr[this.type]]()
+      })
+    },
+    // 检查文件类型
+    checkFileType(url) {
+      if (!url) return ''
+      const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
+
+      if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
+        return 'image'
+      } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
+        return 'word'
+      } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
+        return 'excel'
+      } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
+        return 'ppt'
+      } else if (['pdf'].includes(fileSuffix)) {
+        return 'pdf'
+      } else {
+        return ''
+      }
+    },
+    // 查看
+    async lookInDialog(id) {
+      const res = await getNoticeDetail({ id })
+      this.detailData = res.data
+      this.inDialog = true
+    },
+    // 下载
+    async downloadFn(id) {
+      const res = await getComListDownload({ id })
+      if (res.data) {
+        window.open(this.imageURL + res.data)
+      }
+    },
+    // 关闭
+    closeFn() {
+      this.type = 0
+      this.$store.commit('user/showMessage', 'no')
+    },
+    handLogistics(row) {
+      getListOrderTrack({ orderId: row.id }).then(res => {
+        this.logisticsDetail = res.data
+      })
+      this.orderId = row.id
+      this.visible = true
+    },
+    onClose() {
+      this.logisticsDetail = []
+      this.orderId = ''
+      this.visible = false
+    },
+    handleJump(id) {
+      this.$router.push({ path: `/supply/pickup/sum_list?id=${id}` })
+      this.type = 0
+      this.$store.commit('user/showMessage', 'no')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 42 - 0
src/components/template/add_callback_mixin.js

@@ -0,0 +1,42 @@
+export default {
+  created() {
+    this.addInit()
+  },
+  methods: {
+    addInit() {
+      var { type } = this.$route.query
+      if (type && this.callback[type]) {
+        this.callback[type]()
+      }
+    },
+    addOn(callback, typeStr = 'add') {
+      if (!this.callback) {
+        this.callback = {}
+      }
+      if (callback) {
+        this.callback[typeStr] = callback
+      }
+      return () => {
+        var { type, ...p } = this.$route.query
+        this.$router.push({
+          query: {
+            ...p,
+            type: typeStr
+          }
+        })
+        callback && callback()
+      }
+    },
+    addOff(callback) {
+      return (...pm) => {
+        var { type, ...p } = this.$route.query
+        this.$router.push({
+          query: {
+            ...p
+          }
+        })
+        callback && callback(...pm)
+      }
+    }
+  }
+}

BIN
src/components/template/font/font_2075393_0cjq4n8ykvds.ttf


BIN
src/components/template/font/font_2075393_0cjq4n8ykvds.woff


BIN
src/components/template/font/font_2075393_0cjq4n8ykvds.woff2


+ 12 - 4
src/components/template/import_mixin.js

@@ -1,17 +1,25 @@
 export default {
   methods: {
-    // 导入按钮
-    importButton(func, name = '导入') {
-      console.log(333);
+    //导入按钮
+    importButton(func, name = '导入', params, fun1, fun2) {
       return () => {
         return (
           <el-upload
             action={'_'}
             http-request={data => {
+              fun1 && fun1()
               var formdata = new FormData()
               formdata.append('file', data.file)
+              if (!!params) {
+                for (const key in params) {
+                  if (Object.hasOwnProperty.call(params, key)) {
+                    formdata.append(key, params[key])
+                  }
+                }
+              }
               func({ formdata })
                 .then(res => {
+                  fun2 && fun2()
                   this.$refs.pageRef.refreshList()
                   this.$message({
                     type: 'success',
@@ -19,7 +27,7 @@ export default {
                   })
                 })
                 .catch(err => {
-                  console.log(err,55);
+                  fun2 && fun2()
                   this.$message({
                     type: 'error',
                     message: err.message || '导入失败'

+ 7 - 7
src/components/template/operation_mixin.js

@@ -10,7 +10,7 @@ export default {
                   size="mini"
                   type="primary"
                   onClick={() => {
-                    opt.view({ row, index, column });
+                    opt.view({ row, index, column })
                   }}
                 >
                   查看
@@ -21,7 +21,7 @@ export default {
                   size="mini"
                   type="primary"
                   onClick={() => {
-                    opt.editor({ row, index, column });
+                    opt.editor({ row, index, column })
                   }}
                 >
                   编辑
@@ -31,7 +31,7 @@ export default {
                 <el-popconfirm
                   title="这是一段内容确定删除吗?"
                   onConfirm={() => {
-                    opt.del({ row, index, column });
+                    opt.del({ row, index, column })
                   }}
                 >
                   <el-button size="mini" type="danger" slot="reference">
@@ -40,10 +40,10 @@ export default {
                 </el-popconfirm>
               ) : null}
             </div>
-          );
-        };
+          )
+        }
       }
-      return undefined;
+      return undefined
     }
   }
-};
+}

+ 46 - 0
src/components/template/popu.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="populayview">
+    <div class="populayview-sl">
+      <div class="populayview-sl-shuiy">
+        <slot name="head" />
+        <br v-if="$slots.head" />
+        <slot />
+        <zj-watermark color="rgba(200,200,200,.3)" position="absolute" :str="str" zIndex="101" />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  computed: {
+    str() {
+      return this.$store.state?.user?.name
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.populayview {
+  min-width: 860px;
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 100;
+  background: #fff;
+  overflow: hidden;
+  .populayview-sl {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+    .populayview-sl-shuiy {
+      padding: 20px;
+      min-height: 100%;
+      position: relative;
+    }
+  }
+}
+</style>

+ 17 - 21
src/components/template/sel-export-column-list.vue

@@ -2,11 +2,11 @@
   <el-dialog
     title="勾选导出列"
     :before-close="cancel"
+    :append-to-body="true"
     :visible.sync="dialogVisible"
     width="400px"
   >
     <el-table
-      :data="exportColumnList"
       v-bind="{
         height: '100%',
         style: 'width: 100%',
@@ -14,6 +14,7 @@
         headerCellClassName: 'headerRowColor',
         size: 'mini'
       }"
+      :data="exportColumnList"
     >
       <el-table-column
         v-bind="{
@@ -25,7 +26,7 @@
         <template slot="header" slot-scope="scope">
           <div>
             <el-checkbox v-model="isExport"></el-checkbox>
-            <span style="margin-left:5px">导出</span>
+            <span style="margin-left: 5px">导出</span>
           </div>
         </template>
         <template slot-scope="scope">
@@ -65,54 +66,49 @@ export default {
       dialogVisible: false,
       isExport: true,
       exportColumnList: []
-    };
+    }
   },
   watch: {
     columnList: {
       handler() {
         if (this.columnList && this.columnList.length) {
           this.exportColumnList = this.columnList.map(item => {
-            return { ...item.exportField, isExport: true };
-          });
-          this.dialogVisible = true;
+            return { ...item.exportField, isExport: !item.hidden }
+          })
+          this.dialogVisible = true
         } else {
-          this.exportColumnList = [];
-          this.dialogVisible = false;
+          this.exportColumnList = []
+          this.dialogVisible = false
         }
       },
       deep: true
     },
     exportColumnList: {
       handler() {
-        this.isExport = this.exportColumnList.every(
-          item => item.isExport === true
-        );
+        this.isExport = this.exportColumnList.every(item => item.isExport === true)
       },
       deep: true
     },
     isExport() {
-      if (
-        this.exportColumnList.every(item => item.isExport === true) !==
-        this.isExport
-      ) {
+      if (this.exportColumnList.every(item => item.isExport === true) !== this.isExport) {
         this.exportColumnList.map(item => {
-          item.isExport = this.isExport;
-        });
+          item.isExport = this.isExport
+        })
       }
     }
   },
   methods: {
     cancel() {
-      this.$emit("cancel");
+      this.$emit('cancel')
     },
     determine() {
       this.$emit(
-        "determine",
+        'determine',
         this.exportColumnList.filter(item => item.isExport)
-      );
+      )
     }
   }
-};
+}
 </script>
 
 <style lang="scss" scoped></style>

+ 84 - 0
src/components/template/selectData.js

@@ -0,0 +1,84 @@
+import { getStockListStock } from '@/api/setting'
+import { getWarehouseList } from '@/api/supply/engin'
+import { getCategoryList, getSalesmanList } from '@/api/common'
+import { getDealerList, getWalletCustomerList } from '@/api/basic_data/dealer'
+export default {
+  // 仓库下拉数据
+  STOCK() {
+    return new Promise((r, j) => {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1
+      })
+        .then(res => {
+          r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
+        })
+        .catch(j)
+    })
+  },
+  // 存货类别
+  CATEGORY() {
+    return new Promise((r, j) => {
+      getCategoryList({
+        pageNum: 1,
+        pageSize: -1
+      })
+        .then(res => {
+          r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
+        })
+        .catch(j)
+    })
+  },
+  // 经销商列表
+  CUSTOMER() {
+    return new Promise((r, j) => {
+      getDealerList({
+        pageNum: 1,
+        pageSize: -1
+      })
+        .then(res => {
+          r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
+        })
+        .catch(j)
+    })
+  },
+  // 经销商钱包列表
+  WALLET() {
+    return new Promise((r, j) => {
+      getWalletCustomerList({
+        pageNum: 1,
+        pageSize: -1
+      })
+        .then(res => {
+          r({ data: res.data.map(item => ({ dictCode: item.customerId, dictValue: item.customerWalletName })) })
+        })
+        .catch(j)
+    })
+  },
+  // 业务员列表
+  SERVICE() {
+    return new Promise((r, j) => {
+      getSalesmanList({
+        pageNum: 1,
+        pageSize: -1
+      })
+        .then(res => {
+          r({ data: res.data.records.map(item => ({ dictCode: item.adminUserId, dictValue: item.nickName })) })
+        })
+        .catch(j)
+    })
+  },
+  // 仓库
+  STOCK_NO() {
+    return new Promise((r, j) => {
+      getStockListStock({
+        pageNum: 1,
+        pageSize: -1
+      })
+        .then(res => {
+          r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
+        })
+        .catch(j)
+    })
+  }
+}

+ 416 - 78
src/components/template/template-page-1.vue

@@ -1,27 +1,70 @@
 <template>
-  <zj-page-template ref="zjpage" style="width: 100%;height: 100%;" :get-table-data="getTableData" :options-evens="evens"
-    :options-evens-group="selBtn(optionsEvensGroup)"
-    :table-attributes="{ ...defaultTableAttributes, ...tableAttributes }"
-    :table-events="{ ...defaultTableEvents, ...tableEvents }" :column-parsing="columnParsing" :reduction="reduction"
-    :plan="[...plan, ...morePlan]" :operation="operation" :operation-column-width="operationColumnWidth"
-    :show-table="showTable" :code-gather="codeGather" @columnWidthChange="columnWidthChange"
-    :lowerLine="true"
-    @columnListChange="columnListChange">
-    <sel-export-column-list :column-list="columnList" @determine="exportDetermine" @cancel="columnList = []" />
+  <div class="template-page-1">
+    <zj-page-template
+      ref="zjpage"
+      :getTableData="getTableData"
+      :optionsEvens="evens"
+      :optionsEvensGroup="selBtn(optionsEvensGroup)"
+      :tableAttributes="{ ...defaultTableAttributes, ...tableAttributes }"
+      :tableEvents="{ ...defaultTableEvents, ...tableEvents }"
+      :columnParsing="columnParsing"
+      :reduction="reduction"
+      :plan="[...defaultPlan, ...timePlan, ...paramList, ...morePlan]"
+      :operation="operationShow && pk ? caozuojl : operation"
+      :operationColumnWidth="(operation ? operationColumnWidth : 0) + (operationShow && pk ? 70 : 0)"
+      :showTable="showTable"
+      :codeGather="codeGather"
+      :loading="loading"
+      :lowerLine="true"
+      :onSavePlan="onSavePlan"
+      :onClosePlain="onClosePlain"
+      :defaultSearchData="defaultSearchData"
+      :replaceOrNotMap="replaceOrNotMap"
+      @columnWidthChange="columnWidthChange"
+      @columnListChange="columnListChange"
+    >
+      <template slot="more-search">
+        <slot name="moreSearch"></slot>
+      </template>
+    </zj-page-template>
+    <sel-export-column-list :columnList="columnList" @determine="exportDetermine" @cancel="columnList = []" />
     <slot />
-  </zj-page-template>
+    <el-dialog title="定义方案名" :visible.sync="dialogVisible" width="380px" :before-close="handleClose">
+      <el-input size="mini" maxlength="8" show-word-limit v-model="inputText" placeholder="请输入名称"></el-input>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button size="mini" type="primary" @click="onSavePlanqd">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="操作记录" :visible.sync="logDialogVisible" width="800px">
+      <zj-table
+        :columns="pgxxColumns"
+        :tableData="pgxxTableData"
+        :tableAttributes="{
+          height: '100%',
+          border: true
+        }"
+      ></zj-table>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-
-import { zfireSave, zfireDel, commonDict } from "@/api/user";
-import SelExportColumnList from './sel-export-column-list'
-
+import { commonLogList } from '@/api/common.js'
+import { zfireSave, zfireDel } from '@/api/fieldMan.js'
+import { dictListDict } from '@/api/dataDictionary2.js'
+import { zfireParamList, zfireParamSave, zfireParamDelete } from '@/api/zfireParam.js'
+import SelExportColumnList from './sel-export-column-list.vue'
+import selectData from './selectData.js'
 export default {
   components: {
     SelExportColumnList
   },
   props: {
+    loading: {
+      type: Boolean,
+      default: false
+    },
     // 事件组合
     optionsEvensGroup: {
       type: Array,
@@ -49,34 +92,62 @@ export default {
     exportList: {
       type: Function
     },
+    // 更多方案
     morePlan: {
       type: Array,
       default: () => []
     },
+    // 操作按钮
     operation: {
       type: Function
     },
+    // 是否显示操作记录
+    operationShow: {
+      type: Boolean,
+      default: true
+    },
+    // 获取操作记录的主键字段
+    operationRecordkey: {
+      type: String,
+      default: ''
+    },
+    // 操作按钮单元格宽度
     operationColumnWidth: {
       type: Number,
       default: 140
+    },
+    // 自定义列
+    cstomClumn: {
+      type: Function
+    },
+    // 结构数据钩子
+    fieldBeansHook: {
+      type: Function
+    },
+    // 菜单名称
+    customModuleName: {
+      type: String,
+      default: ''
+    },
+    defaultSearchData: {
+      type: Array,
+      default: () => []
+    },
+    replaceOrNotMap: {
+      type: Boolean,
+      default: true
+    },
+    setModuleId: {
+      type: [String, Number],
+      default: null
     }
   },
   data() {
     return {
-      // 菜单id
-      moduleId: this.$route.meta.moduleId,
-      // 菜单名
-      moduleName: this.$route.meta.title,
+      logDialogVisible: false,
+      dialogVisible: false,
       // 搜索的参数
       parameter: {},
-      plan: [
-        {
-          name: '默认方案',
-          paramCallback: () => {
-            return []
-          }
-        }
-      ],
       // 按钮集合
       evens: [],
       // 表格属性
@@ -88,12 +159,59 @@ export default {
       // 导出弹窗
       columnList: [],
       showTable: false,
-      codeGather: {}
+      codeGather: {},
+      frontCodes: [],
+      pk: '',
+      planItem: null,
+      inputText: '',
+      defaultPlan: [
+        {
+          name: '默认方案',
+          paramCallback: () => {
+            return []
+          }
+        }
+      ],
+      paramList: [],
+      timePlan: [],
+      pgxxColumns: [
+        {
+          columnAttributes: {
+            label: '帐号',
+            prop: 'userName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '操作内容',
+            prop: 'content'
+          }
+        },
+        {
+          columnAttributes: {
+            label: 'ip',
+            prop: 'ip'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '模块名称',
+            prop: 'moduleName'
+          }
+        }
+      ],
+      pgxxTableData: []
     }
   },
   computed: {
     userid() {
       return this.$store.getters.userid
+    },
+    moduleId() {
+      return this.setModuleId || this.$route.meta.moduleId
+    },
+    moduleName() {
+      return this.customModuleName || this.$route.meta.title
     }
   },
   mounted() {
@@ -108,41 +226,178 @@ export default {
         ]
       ]
     }
-
+    this.getZfireParamList()
   },
-
   methods: {
-    getDictCode(params) {
-      this.codeGather = {}
-      commonDict(params).then(res => {
-        if (res.data.length) {
-          res.data.map(item => {
-            if (!this.codeGather[params.code]) {
-              this.$set(this.codeGather,params.code,[])
+    setDefaultPlan(createTimeKey) {
+      this.$nextTick(() => {
+        if (createTimeKey) {
+          var [y, m, d] = new Date(new Date().getTime()).toJSON().split('T').join(' ').substr(0, 10).split('-')
+          this.timePlan = [
+            {
+              name: '今日',
+              paramCallback: () => {
+                return [
+                  { param: createTimeKey, compare: '>', value: `${y}-${m}-${Number(d) - 1} 23:59:59` },
+                  { param: createTimeKey, compare: '<', value: `${y}-${m}-${Number(d) + 1} 00:00:00` }
+                ]
+              }
+            },
+            {
+              name: '昨日',
+              paramCallback: () => {
+                return [
+                  { param: createTimeKey, compare: '>', value: `${y}-${m}-${Number(d) - 2} 23:59:59` },
+                  { param: createTimeKey, compare: '<', value: `${y}-${m}-${Number(d)} 00:00:00` }
+                ]
+              }
             }
-            this.$set(this.codeGather,params.code,[...this.codeGather[params.code],{
-              label: item.dictValue,
-              value: item.dictCode
-            }])
-          })
+          ]
         }
       })
     },
+    // 关闭方案命名弹窗
+    handleClose() {
+      this.planItem = null
+      this.inputText = ''
+      this.dialogVisible = false
+    },
+    // 获取方案记录
+    getZfireParamList() {
+      zfireParamList({
+        moduleId: this.moduleId
+      }).then(res => {
+        this.paramList = res.data.map(item => {
+          return {
+            name: item.name,
+            id: item.id,
+            closable: true,
+            paramCallback: () => {
+              return item.items.map(dav => {
+                if (dav.value[0] == '[' && dav.value[dav.value.length - 1] == ']') {
+                  return {
+                    param: dav.param,
+                    compare: dav.compare,
+                    value: dav.value.substring(1, dav.value.length - 1).split(',')
+                  }
+                }
+                return { param: dav.param, compare: dav.compare, value: dav.value }
+              })
+            }
+          }
+        })
+      })
+    },
+    // 点击获取保存方案数据
+    onSavePlan(p) {
+      if (this.paramList.length >= 10) {
+        this.$message.error('自定义方案最多支持保留10个')
+        return
+      }
+      if (p.length) {
+        this.planItem = p
+        this.dialogVisible = true
+      } else {
+        this.$message.error('请先设置搜索条件')
+      }
+    },
+    // 确定保存方案
+    onSavePlanqd() {
+      if (this.inputText) {
+        zfireParamSave({
+          moduleId: this.moduleId,
+          name: this.inputText,
+          items: this.planItem
+        }).then(res => {
+          this.handleClose()
+          this.getZfireParamList()
+        })
+      } else {
+        this.$message.error('请先填写方案名称')
+      }
+    },
+    // 删除方案
+    onClosePlain(p) {
+      if (p.id) {
+        this.$confirm('删除此方案, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            zfireParamDelete({ id: p.id }).then(res => {
+              this.$message({
+                message: '删除成功',
+                type: 'success'
+              })
+              this.getZfireParamList()
+            })
+          })
+          .catch(() => {})
+      }
+    },
+    // 全局操作记录按钮
+    caozuojl(h, { row, index, column }) {
+      return (
+        <div class="operation-btns">
+          <el-button
+            size="mini"
+            type="text"
+            onClick={() => {
+              if (row[this.pk]) {
+                commonLogList({
+                  objId: row[this.pk],
+                  pageNum: 1,
+                  pageSize: -1
+                }).then(res => {
+                  this.pgxxTableData = res.data.records
+                  this.logDialogVisible = true
+                })
+              }
+            }}
+          >
+            操作记录
+          </el-button>
+          {this.operation ? this.operation(h, { row, index, column }) : null}
+        </div>
+      )
+    },
+    // 过滤按钮集合
     selBtn(arr) {
       for (var i = 0; i < arr.length; i++) {
         if (Array.isArray(arr[i])) {
           this.selBtn(arr[i])
         }
-        if (
-          !(arr[i].isRole || arr[i].isRole === undefined) ||
-          arr[i].length == 0
-        ) {
+        if (!(arr[i].isRole || arr[i].isRole === undefined) || arr[i].length == 0) {
           arr.splice(i, 1)
           i--
         }
       }
       return arr
     },
+    // 获取下拉对应数据
+    getCodeGather() {
+      let codes = this.frontCodes.filter(key => (this.codeGather[key] ? false : true))
+      if (codes && codes.length) {
+        var codeGather = {}
+        Promise.all(
+          codes.map(code => {
+            if (selectData[code]) {
+              return selectData[code]()
+            }
+            return dictListDict({ code: code })
+          })
+        ).then(resAll => {
+          codes.map((code, index) => {
+            var arr = resAll[index].data.map(item => {
+              return { value: item.dictCode, label: item.dictValue }
+            })
+            codeGather[code] = arr
+          })
+          this.codeGather = { ...this.codeGather, ...codeGather }
+        })
+      }
+    },
     // 获取列表数据函数
     async getTableData(data) {
       if (!this.getList) {
@@ -157,19 +412,45 @@ export default {
           moduleId: this.moduleId
         }
         var res = await this.getList(this.parameter)
-        // res.data.records = []
         if (res.code == 200) {
           if (!this.showTable) {
             this.$nextTick(() => {
               this.showTable = true
             })
           }
-          res.fieldBeans.forEach(k => {
-            if (k.frontCode) {
-              this.getDictCode({ code: k.frontCode })
+          // 全局过滤特殊列表
+          /**------------------------------------------------------------------------------------------------------- */
+          var listcp = [...res.fieldBeans]
+          if (!~['100093', '600023', '', null, undefined].indexOf(this.$store.state?.user?.userInfo?.customerNumber)) {
+            for (var i = 0; i < listcp.length; i++) {
+              if (~['是否同步到格匠采购入库单', '同步格匠失败原因'].indexOf(listcp[i].label)) {
+                listcp.splice(i, 1)
+                i--
+              }
             }
-          });
-
+          }
+          res.fieldBeans = listcp
+          /**------------------------------------------------------------------------------------------------------- */
+          if (this.fieldBeansHook) {
+            res.fieldBeans = this.fieldBeansHook(res.fieldBeans) || res.fieldBeans
+          }
+          for (let item of res.fieldBeans) {
+            if (item.jname === 'createTime') {
+              this.setDefaultPlan(`${item.tbName ? item.tbName + '.' : ''}${item.colName}`)
+            }
+            if (item.pk) {
+              this.$nextTick(() => {
+                this.pk = item.colName
+              })
+            }
+            if (item.frontCode && !~this.frontCodes.indexOf(item.frontCode)) {
+              this.frontCodes.push(item.frontCode)
+            }
+            if (this.cstomClumn && item.label === 'cstomClumn') {
+              this.cstomClumn(item.jname, res.data.records, res.fieldBeans, this.parameter)
+            }
+          }
+          this.getCodeGather()
           return res
         }
       } catch (error) {
@@ -184,6 +465,7 @@ export default {
             ...item.exportField,
             sortNum: index,
             isCopy: item.isCopy,
+            tiling: item.tiling,
             isTotal: item.isTotal,
             isShow: !item.hidden,
             moduleId: this.moduleId,
@@ -193,8 +475,7 @@ export default {
         }),
         this.moduleId
       )
-        .then(res => {
-        })
+        .then(res => {})
         .catch(err => {
           this.$message.error('保存失败')
         })
@@ -218,8 +499,7 @@ export default {
         }),
         this.moduleId
       )
-        .then(res => {
-        })
+        .then(res => {})
         .catch(err => {
           this.$message.error('保存失败')
         })
@@ -228,7 +508,7 @@ export default {
     reduction() {
       zfireDel({}, this.userid, this.moduleId)
         .then(res => {
-          this.$refs.zjpage.refresh()
+          this.refreshList(true)
         })
         .catch(err => {
           this.$message.error('操作失败')
@@ -242,11 +522,37 @@ export default {
       if (!this.exportList) {
         return
       }
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        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))
+      )
       this.exportList(
         {
           ...this.parameter,
           pageSize: -1,
+          params: querylist.map(item => {
+            if (
+              // item.compare === '=' &&
+              typeof item.value == 'string' &&
+              (~item.value.indexOf(',') || ~item.value.indexOf(','))
+            ) {
+              // 去除换行
+              var str = item.value.replace(/\\n/g, '')
+              // 去除空格
+              str = str.replace(/[\t\r\f\n\s]*/g, '')
+              // 转中文逗号
+              str = str.replace(/,/g, ',')
+              // 切割为数组
+              item.value = str.split(',')
+            }
+            return item
+          }),
           exportFields: data
         },
         `${this.moduleName}.xlsx`
@@ -258,32 +564,53 @@ export default {
           })
           this.columnList = []
           this.evens[0][0].loading = false
+          loading.close()
         })
-        .catch(() => {
+        .catch(err => {
           this.$message.error('导出失败')
           this.columnList = []
           this.evens[0][0].loading = false
+          loading.close()
         })
     },
-    refreshList() {
-      this.$refs.zjpage.refresh()
+    refreshList(bool) {
+      if (bool === true) {
+        this.showTable = false
+        this.$refs.zjpage.refresh()
+      } else {
+        this.$refs.zjpage.refresh()
+      }
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
+.template-page-1 {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  box-sizing: border-box;
+  min-width: 860px;
+  overflow: auto;
+}
+.zj-page-template {
+  position: relative;
+  z-index: 0;
+}
 @font-face {
-  font-family: "aliyun_iconfont";
-  src: url("//at.alicdn.com/t/font_2075393_0cjq4n8ykvds.woff2?t=1647587689181") format("woff2"),
-    url("//at.alicdn.com/t/font_2075393_0cjq4n8ykvds.woff?t=1647587689181") format("woff"),
-    url("//at.alicdn.com/t/font_2075393_0cjq4n8ykvds.ttf?t=1647587689181") format("truetype");
+  font-family: 'aliyun_iconfont';
+  src: url('~@/components/template/font/font_2075393_0cjq4n8ykvds.woff2') format('woff2'),
+    url('~@/components/template/font/font_2075393_0cjq4n8ykvds.woff') format('woff'),
+    url('~@/components/template/font/font_2075393_0cjq4n8ykvds.ttf') format('truetype');
 }
-
 ::v-deep .el-table__cell {
   padding: 0 !important;
 }
-
+::v-deep .el-table--mini td,
+::v-deep .el-table--mini th {
+  padding: 0 !important;
+}
 ::v-deep .el-table__column-filter-trigger {
   .el-icon-arrow-down {
     font-family: aliyun_iconfont !important;
@@ -298,41 +625,52 @@ export default {
     -webkit-font-smoothing: antialiased;
     transform: translate(-2px, 1px);
     color: #c0c4cc;
+    width: 20px;
+    text-align: center;
   }
-
   .el-icon-arrow-down:before {
-    content: "\e64c" !important;
+    content: '\e64c' !important;
   }
 }
-
 ::v-deep .zj-buttons-group {
   .el-upload-list {
     display: none !important;
   }
 }
-
 ::v-deep .operation-btns {
   width: 100%;
-  height: 100%;
+  height: 35px;
   display: flex;
   flex-direction: row;
   align-items: center;
-
-  &>*:not(:last-child) {
+  & > *:not(:last-child) {
     margin-right: 5px;
   }
-
   .el-button {
     margin-left: 0 !important;
   }
 }
-
 ::v-deep .is-disabled {
-
   .el-textarea__inner,
-  .el-input__inner {
-    background-color: #fff;
-    color: #606266;
+  .el-input__inner,
+  .el-radio__label,
+  .el-radio__input {
+    background-color: #fff !important;
+    color: #606266 !important;
+    // border: none !important;
   }
 }
+::v-deep .el-checkbox.is-bordered.is-checked,
+::v-deep .el-radio.is-bordered.is-checked {
+  border-color: #409eff !important;
+}
+::v-deep .el-checkbox__input.is-checked .el-checkbox__inner,
+::v-deep .el-radio__input.is-checked .el-radio__inner {
+  border-color: #409eff !important;
+  background: #409eff !important;
+}
+::v-deep .el-checkbox.is-bordered {
+  margin-left: 0 !important;
+  margin-right: 10px !important;
+}
 </style>

+ 38 - 17
src/layout/components/AppMain.vue

@@ -1,24 +1,47 @@
 <template>
-  <section class="app-main">
-    <transition name="fade-transform" mode="out-in">
-      <keep-alive v-if="$route.name">
-        <router-view :key="$route.name" />
-      </keep-alive>
-      <router-view v-else />
-    </transition>
+  <section class="app-main" :style="{ paddingTop: show ? '140px' : '80px' }">
+    <div class="app-main-view">
+      <transition name="fade-transform" mode="out-in">
+        <keep-alive v-if="$route.name">
+          <router-view :key="$route.name" />
+        </keep-alive>
+        <router-view v-else />
+      </transition>
+      <!-- 通知框 -->
+      <notify-box />
+      <zj-watermark color="rgba(200,200,200,.3)" position="absolute" :str="str" z-index="99" />
+    </div>
   </section>
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
+import { setModuleId } from '@/utils/request'
+import NotifyBox from '@/components/NotifyBox'
 export default {
   name: 'AppMain',
+  components: {
+    NotifyBox
+  },
   computed: {
+    ...mapGetters(['show']),
     cachedViews() {
       return this.$store.state.tagsView.cachedViews
     },
     key() {
       return this.$route.path
+    },
+    str() {
+      return this.$store.state?.user?.name
+    }
+  },
+  watch: {
+    $route() {
+      setModuleId(this.$route.meta.moduleId)
     }
+  },
+  beforeCreate() {
+    setModuleId(this.$route.meta.moduleId)
   }
 }
 </script>
@@ -26,22 +49,20 @@ export default {
 <style scoped>
 .app-main {
   /*50 = navbar  */
-  min-height: calc(100vh - 50px);
+  height: 100vh;
   width: 100%;
   position: relative;
   overflow: hidden;
 }
 .fixed-header + .app-main {
   /* padding-top: 50px; */
-  padding-top: 80px;
+  /* padding-top: 80px; */
 }
-</style>
-
-<style lang="scss">
-// fix css style bug in open el-dialog
-.el-popup-parent--hidden {
-  .fixed-header {
-    padding-right: 15px;
-  }
+.app-main-view {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  overflow-x: hidden;
+  overflow-y: auto;
 }
 </style>

+ 84 - 229
src/layout/components/Navbar.vue

@@ -16,22 +16,22 @@
           ></i>
         </el-tooltip>
       </div> -->
-      <div class="right-menu-item" style="display: flex" v-if="isHongGe">
+      <div v-if="isHongGe" class="right-menu-item" style="display: flex">
         <el-select v-model="changeNum" filterable :disabled="!isHongGe" @change="handleChangeArea">
-          <el-option v-for="item in areaOpti" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          <el-option v-for="item in areaOpti" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </div>
-      <div class="right-menu-item hover-effect" style="display: flex" @click="handleShow">
+      <!-- <div class="right-menu-item hover-effect" style="display: flex" @click="handleShow">
         <el-badge>
           <i class="el-icon-message-solid" style="font-size: 24px; line-height: 50px" />
         </el-badge>
         <span style="font-size: 16px; margin-left: 15px">物流通知</span>
-      </div>
-      <div class="right-menu-item hover-effect" style="display: flex" @click="handleNotice('click')">
+      </div> -->
+      <div class="right-menu-item hover-effect" style="display: flex" @click="handleNotice">
         <el-badge value="示">
           <i class="el-icon-message-solid" style="font-size: 24px; line-height: 50px" />
         </el-badge>
-        <span style="font-size: 16px; margin-left: 15px">到货通知</span>
+        <span style="font-size: 16px; margin-left: 15px">物流到货通知</span>
       </div>
       <div class="right-menu-item hover-effect" @click="toEngine">
         <i class="el-icon-s-platform" style="font-size: 18px" />
@@ -78,173 +78,6 @@
         <el-button type="primary" @click="submitForm">确 定</el-button>
       </div>
     </el-dialog>
-
-    <el-dialog
-      title="到货通知"
-      :modal="false"
-      width="70%"
-      :visible.sync="hasNotice"
-      @close="handleNotice(false)"
-    >
-      <div class="mymain-container">
-        <el-form ref="form" :model="form" label-width="80px" label-position="left" size="mini">
-          <el-row>
-            <el-col>
-              <el-form-item prop="specification" label="规格型号">
-                <div style="display: flex">
-                  <el-input v-model="form.specification" clearable style="margin-right: 10px" />
-                  <el-button
-                    @click="
-                      form.specification = ''
-                      getNoticeList()
-                    "
-                    >重置</el-button
-                  >
-                  <el-button type="primary" @click="getNoticeLists">查询</el-button>
-                </div>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div class="table">
-          <el-table v-loading="listLoading" :data="noticeList" border>
-            <el-table-column
-              property="materialOldNumber"
-              align="left"
-              min-width="120"
-              label="产品编号"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              property="materialNumber"
-              align="left"
-              min-width="100"
-              label="物料编码"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              property="materialName"
-              align="left"
-              min-width="250"
-              label="产品名称"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              property="specification"
-              align="left"
-              min-width="350"
-              label="规格型号"
-              show-overflow-tooltip
-            />
-            <el-table-column property="stockName" align="left" min-width="100" label="到货仓库" show-overflow-tooltip />
-            <el-table-column
-              property="updateTime"
-              align="left"
-              min-width="200"
-              label="到货通知时间"
-              show-overflow-tooltip
-            />
-          </el-table>
-          <div class="flex">
-            <div />
-            <div class="fr">
-              <el-pagination
-                :current-page="currentPage2"
-                :page-sizes="[10, 20, 30, 50]"
-                :page-size="10"
-                layout="total, prev, pager, next"
-                :total="listTotal2"
-                @size-change="handleSizeChange2"
-                @current-change="handleCurrentChange2"
-              />
-            </div>
-          </div>
-        </div>
-      </div>
-    </el-dialog>
-    <el-dialog title="物流通知" :visible.sync="isLogistics" width="60%" :modal="false" @close="isLogistics = false">
-      <div class="table">
-        <el-table
-          ref="table"
-          v-loading="listLoading"
-          :data="invoiceOrderList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="发货单" prop="id" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-link v-if="!isCustomer" type="primary" :underline="false" @click="handleJump(scope.row.id)">{{
-                scope.row.id
-              }}</el-link>
-              <template v-else>{{ scope.row.id }}</template>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="内容" prop="orderTrackStatus" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="时间" prop="orderTrackTime" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="收货地址" prop="address" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.address ? scope.row.address : '——' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="收货客户" prop="receivingName" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">{{ scope.row.receivingName ? scope.row.receivingName : '——' }}</template>
-          </el-table-column>
-          <el-table-column align="center" label="" min-width="80" show-overflow-tooltip fixed="right">
-            <template slot-scope="scope">
-              <el-button type="text" class="textColor" @click="handLogistics(scope.row)">查看</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-
-      <!-- 分页 -->
-      <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>
-      <br />
-      <br />
-    </el-dialog>
-    <el-dialog
-      title="物流信息"
-      :visible.sync="visible"
-      width="60%"
-      @close="onClose"
-      :modal="false"
-      :close-on-click-modal="false"
-    >
-      <el-timeline class="logistics" :reverse="false" v-if="logisticsDetail.length">
-        <el-timeline-item
-          placement="top"
-          type="success"
-          v-for="(item, index) in logisticsDetail"
-          :key="index"
-          :timestamp="item.time"
-        >
-          <el-row :gutter="20">
-            <el-col class="logistics-title"> {{ item.status }} </el-col>
-            <el-col>
-              <div class="flex">
-                <div>{{ item.context }}</div>
-                <!-- <div>{{ item.createTime }}</div> -->
-              </div>
-            </el-col>
-          </el-row>
-        </el-timeline-item>
-      </el-timeline>
-      <div v-else class="tip">暂无物流信息</div>
-    </el-dialog>
     <!--    工程机多帐号-->
     <!--    <el-dialog-->
     <!--      title="绑定工程机系统"-->
@@ -314,11 +147,13 @@ export default {
     Breadcrumb,
     Hamburger,
     Screenfull,
+    // eslint-disable-next-line vue/no-unused-components
     NavMenu
   },
   mixins: [mixin],
   data() {
     return {
+      noticeType: 1,
       intivalId: '',
       timer: '',
       noticeCount: 0,
@@ -354,16 +189,23 @@ export default {
       pageSize2: 10, // 每页数量
       listTotal2: 0, // 列表总数
       myType: '',
-      changeNum: localStorage.getItem('user_change_num') || '1',
+      changeNum: 1,
       areaOpti: [
-        { label: '弘格', value: '1' },
-        { label: '广州', value: '2' },
-        { label: '佛山', value: '3'}
+        { label: '弘格', value: 1 },
+        { label: '广州', value: 2 },
+        { label: '佛山', value: 3 }
       ]
     }
   },
   mounted() {
-    const that = this
+    // 浏览器不同标签页监听
+    // window.addEventListener('storage', event => {
+    //   if (event.key === 'user_auto_num') {
+    //       this.$router.go(0)
+    //   }
+    // })
+    this.changeNum = this.autoChangeNum
+    // const that = this
     // 开定时器轮询未读消息接口(写在全局vuex里比较好)
     // that.initNotice();
     // that.tcMessage();
@@ -382,11 +224,9 @@ export default {
   beforeDestroy() {
     window.clearInterval(this.intivalId)
     window.clearInterval(this.timer)
-
-    console.log('退出清理定时器' + this.timer)
-
     this.websocketOnclose()
   },
+  // eslint-disable-next-line vue/order-in-components
   computed: {
     showBreadcrumb() {
       return this.$store.state.settings.breadcrumb
@@ -400,6 +240,9 @@ export default {
         if (!this.noticeList.length && !this.myType) {
           return false
         } else {
+          // if (this.noticeList.length) {
+          //   return true
+          // }
           return this.isNotice
         }
       },
@@ -407,26 +250,41 @@ export default {
         return e
       }
     },
-    ...mapGetters(['sidebar', 'avatar', 'device', 'name', 'isNotice', 'isCustomer', 'isHongGe'])
+    ...mapGetters(['sidebar', 'avatar', 'device', 'name', 'isNotice', 'isCustomer', 'isHongGe', 'autoChangeNum'])
   },
+
   methods: {
     getList() {
-      this.getNoticeList()
+      // this.getNoticeList()
+    },
+    handleChangeNotice(e) {
+      if (e === 2) {
+        this.currentPage2 = 1
+        this.pageSize2 = 10
+        this.listTotal2 = 0
+        this.getNoticeList()
+      } else {
+        this.pageSize = 10
+        this.currentPage = 1
+        this.listTotal = 0
+        this.getListInvoiceOrder()
+      }
     },
     getNoticeList() {
-      this.listLoading = true
+      // this.listLoading = true
       getNoticeList({
         pageNum: this.currentPage2,
         pageSize: this.pageSize2,
         specification: this.form.specification
       }).then(res => {
+        console.log(res.data.records, '999')
         this.noticeList = res.data.records
         this.listTotal2 = res.data.total
-        this.listLoading = false
+        // this.listLoading = false
       })
     },
     getNoticeLists() {
-      this.listLoading = true
+      // this.listLoading = true
       getNoticeList({
         pageNum: 1,
         pageSize: this.pageSize2,
@@ -434,22 +292,24 @@ export default {
       }).then(res => {
         this.noticeList = res.data.records
         this.listTotal2 = res.data.total
-        this.listLoading = false
+        // this.listLoading = false
       })
     },
-    handleNotice(flag = true) {
-      if (flag || flag == 'click') {
-        if (flag == 'click') {
-          this.myType = flag
-        }
-        this.getNoticeList()
-        this.$store.commit('user/SET_STATUS', true)
-      } else {
-        if (!flag) {
-          this.myType = ''
-        }
-        this.$store.commit('user/SET_STATUS', false)
-      }
+    // 获取物流列表
+    getListInvoiceOrder(data) {
+      // this.listLoading = true
+
+      getListInvoiceOrder({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage
+      }).then(res => {
+        this.invoiceOrderList = res.data.records
+        this.listTotal = res.data.total
+        // this.listLoading = false
+      })
+    },
+    handleNotice() {
+      this.$store.commit('user/showMessage', 'yes')
     },
     toggleSideBar() {
       this.$store.dispatch('app/toggleSideBar')
@@ -489,7 +349,7 @@ export default {
     //   }
     // },
     goNotice() {
-      this.$router.push('/notice/index')
+      this.$router.push('/notice')
     },
     openEngineAccount() {
       this.engineForm.engineList = this.userInfo.bindEnginList
@@ -601,7 +461,7 @@ export default {
     //     this.engineForm.engineList.splice(index, 1)
     //   }
     // }
-    initWebSocket: function () {
+    initWebSocket: function() {
       // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
       // var userId = this.$store.getters.userid;
       //
@@ -614,12 +474,12 @@ export default {
       // this.websock.onmessage = this.websocketOnmessage;
       // this.websock.onclose = this.websocketOnclose;
     },
-    websocketOnopen: function () {
+    websocketOnopen: function() {
       console.debug('WebSocket连接成功')
       // 心跳检测重置
       // this.heartCheck.reset().start();
     },
-    websocketOnerror: function (e) {
+    websocketOnerror: function(e) {
       console.debug('WebSocket连接发生错误,第%s次', this.wsConnectErrorTime)
 
       this.wsConnectErrorTime = this.wsConnectErrorTime + 1
@@ -631,13 +491,15 @@ export default {
 
       this.reconnect()
     },
-    websocketOnmessage: function (e) {
+    websocketOnmessage: function(e) {
       console.debug('-----接收消息-------', e.data)
+      // eslint-disable-next-line no-eval
       const data = eval('(' + e.data + ')') // 解析对象
       if (data.type === 'RebateOrderMsg') {
         if (data.res.hasMessage) {
           this.$notify.info({
             title: '消息',
+            // eslint-disable-next-line no-undef
             message: res.data.messages,
             position: 'bottom-right',
             duration: 4000,
@@ -646,7 +508,7 @@ export default {
         }
       }
     },
-    websocketOnclose: function (e) {
+    websocketOnclose: function(e) {
       console.debug('connection closed (' + e + ')')
       if (e) {
         console.debug('connection closed (' + e.code + ')')
@@ -666,25 +528,16 @@ export default {
       if (that.lockReconnect) return
       that.lockReconnect = true
       // 没连接上会一直重连,设置延迟避免请求过多
-      setTimeout(function () {
+      setTimeout(function() {
         console.debug('尝试重连...')
         that.initWebSocket()
         that.lockReconnect = false
       }, 20000)
     },
-    // 获取物流列表
-    async getListInvoiceOrder(data) {
-      this.invoiceOrderList = []
-      const res = await getListInvoiceOrder({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage
-      })
-      this.invoiceOrderList = res.data.records
-      this.listTotal = res.data.total
-    },
-    handleShow() {
-      ;(this.isLogistics = true), this.getListInvoiceOrder()
-    },
+
+    // handleShow() {
+    //   ;(this.isLogistics = true), this.getListInvoiceOrder()
+    // },
     // 更改每页数量
     handleSizeChange2(val) {
       this.pageSize2 = val
@@ -722,12 +575,11 @@ export default {
       this.visible = false
     },
     handleJump(id) {
-      this.$router.push({ path: `/exwarehouse/sum_list?id=${id}` })
-      this.isLogistics = false
+      this.$router.push({ path: `/supply/pickup/sum_list?id=${id}` })
+      this.$store.commit('user/SET_STATUS', false)
     },
     handleChangeArea(changeNum) {
       setUserChanging({ changeNum }).then(res => {
-        localStorage.setItem('user_change_num', changeNum)
         this.$router.go(0)
         this.$successMsg('切换成功')
       })
@@ -738,13 +590,16 @@ export default {
 
 <style lang="scss" scoped>
 @import '~@/styles/variables.scss';
-::v-deep .el-input__inner {
-  width: 80px;
-  font-size: 16px;
+.right-menu-item {
+  ::v-deep .el-input__inner {
+    width: 80px;
+    font-size: 16px;
 
-  color: #333333;
-  border: 0 !important;
+    color: #333333;
+    border: 0 !important;
+  }
 }
+
 ::v-deep .is-fixed {
   right: 10px !important;
 }
@@ -856,7 +711,7 @@ export default {
     }
   }
 }
-.tip{
+.tip {
   margin: 50px auto;
   text-align: center;
 }

+ 8 - 80
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,45 +1,23 @@
 <template>
-  <div v-if="!item.hidden">
-    <!-- <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren) && !item.alwaysShow"> -->
-    <template
-      v-if="
-        hasOneShowingChild(item.children, item) &&
-        (!onlyOneChild.children ||
-          onlyOneChild.noShowingChildren ||
-          (onlyOneChild.children &&
-          onlyOneChild.children&& onlyOneChild.children.length < 1 &&
-            (onlyOneChild.name == 'issue_index' ||
-              onlyOneChild.name == 'notice_index' ||
-              onlyOneChild.name == 'dashboard'))) &&
-        !item.alwaysShow
-      "
-    >
-      <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
-          <item :icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" :title="onlyOneChild.meta.title" />
+  <div v-if="!item.hidden || item.noShowingChildren">
+    <template v-if="!item.children || !item.children.length">
+      <app-link v-if="item.meta" :to="item.name">
+        <el-menu-item :index="item.name" :class="{ 'submenu-title-noDropdown': !isNest }">
+          <item :icon="item.meta.icon || (item.meta && item.meta.icon)" :title="item.meta.title" />
         </el-menu-item>
       </app-link>
     </template>
 
-    <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
+    <el-submenu v-else ref="subMenu" :index="item.name" popper-append-to-body>
       <template slot="title">
         <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
       </template>
-      <sidebar-item
-        v-for="child in item.children"
-        :key="child.path"
-        :is-nest="true"
-        :item="child"
-        :base-path="resolvePath(child.path)"
-        class="nest-menu"
-      />
+      <sidebar-item v-for="child in item.children" :key="child.name" :is-nest="true" :item="child" class="nest-menu" />
     </el-submenu>
   </div>
 </template>
 
 <script>
-import path from 'path'
-import { isExternal } from '@/utils/validate'
 import Item from './Item'
 import AppLink from './Link'
 import FixiOSBug from './FixiOSBug'
@@ -49,7 +27,6 @@ export default {
   components: { Item, AppLink },
   mixins: [FixiOSBug],
   props: {
-    // route object
     item: {
       type: Object,
       required: true
@@ -57,60 +34,11 @@ export default {
     isNest: {
       type: Boolean,
       default: false
-    },
-    basePath: {
-      type: String,
-      default: ''
     }
   },
   data() {
-    // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
-    // TODO: refactor with render function
-    this.onlyOneChild = null
     return {}
   },
-  methods: {
-    hasOneShowingChild(children = [], parent) {
-      const showingChildren = children.filter(item => {
-        if (item.hidden) {
-          return false
-        } else {
-          // Temp set(will be used if only has one showing child)
-
-          // 删除空的children
-          if (item.children&&item.children.length < 1) {
-            // delete item['children']
-          }
-
-          this.onlyOneChild = item
-
-          // console.log(item);
-          return true
-        }
-      })
-
-      // When there is only one child router, the child router is displayed by default
-      if (showingChildren&&showingChildren.length === 1) {
-        return true
-      }
-
-      // Show parent if there are no child router to display
-      if (showingChildren&&showingChildren.length === 0) {
-        this.onlyOneChild = { ...parent, path: '', noShowingChildren: true }
-        return true
-      }
-      return false
-    },
-    resolvePath(routePath) {
-      if (isExternal(routePath)) {
-        return routePath
-      }
-      if (isExternal(this.basePath)) {
-        return this.basePath
-      }
-
-      return path.resolve(this.basePath, routePath)
-    }
-  }
+  methods: {}
 }
 </script>

+ 7 - 6
src/layout/components/TagsView/ScrollPane.vue

@@ -55,16 +55,17 @@ export default {
         $scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth
       } else {
         // find preTag and nextTag
-        const currentIndex = tagList.findIndex(item => item === currentTag)
+        const currentIndex = tagList.findIndex(item => {
+          var c = JSON.parse(currentTag.getAttribute('data'))
+          var i = JSON.parse(item.getAttribute('data'))
+          return c.path === i.path
+        })
         const prevTag = tagList[currentIndex - 1]
         const nextTag = tagList[currentIndex + 1]
-
         // the tag's offsetLeft after of nextTag
-        const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing
-
+        const afterNextTagOffsetLeft = nextTag.offsetLeft + nextTag.offsetWidth + tagAndTagSpacing
         // the tag's offsetLeft before of prevTag
-        const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing
-
+        const beforePrevTagOffsetLeft = prevTag.offsetLeft - tagAndTagSpacing
         if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) {
           $scrollWrapper.scrollLeft = afterNextTagOffsetLeft - $containerWidth
         } else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) {

+ 30 - 30
src/layout/components/TagsView/index.vue

@@ -1,20 +1,19 @@
 <template>
   <div id="tags-view-container" class="tags-view-container">
     <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
-      <router-link
+      <div
         v-for="(tag, index) in visitedViews"
         ref="tag"
         :key="tag.path + index"
-        :class="isActive(tag) ? 'active' : ''"
-        :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
-        tag="span"
-        class="tags-view-item"
-        @click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
-        @contextmenu.prevent.native="openMenu(tag, $event)"
+        :class="['tags-view-item', isActive(tag) ? 'active' : '']"
+        :data="JSON.stringify({ path: tag.path, query: tag.query, fullPath: tag.fullPath })"
+        @click="djclick({ path: tag.path, query: tag.query, fullPath: tag.fullPath })"
+        @dblclick="sjclick(tag)"
+        @contextmenu.prevent="openMenu(tag, $event)"
       >
         {{ tag.title }}
         <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
-      </router-link>
+      </div>
     </scroll-pane>
     <ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
       <li @click="refreshSelectedTag(selectedTag)">刷新</li>
@@ -27,8 +26,8 @@
 
 <script>
 import ScrollPane from './ScrollPane'
-import path from 'path'
-
+import { clickBG } from '@/utils/util.js'
+const ev = new clickBG(200)
 export default {
   components: { ScrollPane },
   data() {
@@ -50,7 +49,6 @@ export default {
   },
   watch: {
     $route(val, oval) {
-      console.log(val, oval, 'route')
       this.addTags()
       this.moveToCurrentTag()
     },
@@ -67,6 +65,16 @@ export default {
     this.addTags()
   },
   methods: {
+    djclick(item) {
+      ev.click(() => {
+        this.$router.push(item)
+      })
+    },
+    sjclick(item) {
+      ev.dblClick(() => {
+        this.closeSelectedTag(item)
+      })
+    },
     isActive(route) {
       return route.path === this.$route.path
     },
@@ -97,7 +105,6 @@ export default {
     initTags() {
       const affixTags = (this.affixTags = this.filterAffixTags(this.routes))
       for (const tag of affixTags) {
-        // Must have tag name
         if (tag.name) {
           this.$store.dispatch('tagsView/addVisitedView', tag)
         }
@@ -114,10 +121,10 @@ export default {
       const tags = this.$refs.tag
       this.$nextTick(() => {
         for (const tag of tags) {
-          if (tag.to.path === this.$route.path) {
+          var to = JSON.parse(tag.getAttribute('data'))
+          if (to.path === this.$route.path) {
             this.$refs.scrollPane.moveToTarget(tag)
-            // when query is different then update
-            if (tag.to.fullPath !== this.$route.fullPath) {
+            if (to.fullPath !== this.$route.fullPath) {
               this.$store.dispatch('tagsView/updateVisitedView', this.$route)
             }
             break
@@ -128,18 +135,17 @@ export default {
     refreshSelectedTag(view) {
       if (window.location) {
         window.location.reload()
-      }else{
+      } else {
         this.$store.dispatch('tagsView/delCachedView', view).then(() => {
-        const { fullPath } = view
-        this.$nextTick(() => {
-          this.$router.replace({
-            path: fullPath,
-            redirect:'/'
+          const { fullPath } = view
+          this.$nextTick(() => {
+            this.$router.replace({
+              path: fullPath,
+              redirect: '/'
+            })
           })
         })
-      })
       }
-     
     },
     closeSelectedTag(view) {
       this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
@@ -163,15 +169,11 @@ export default {
       })
     },
     toLastView(visitedViews, view) {
-      console.log(1111)
       const latestView = visitedViews.slice(-1)[0]
       if (latestView) {
         this.$router.push(latestView.fullPath)
       } else {
-        // now the default is to redirect to the home page if there is no tags-view,
-        // you can adjust it according to your needs.
         if (view.name === 'Dashboard') {
-          // to reload home page
           this.$router.replace({ path: '/redirect' + view.fullPath })
         } else {
           this.$router.push('/')
@@ -184,13 +186,11 @@ export default {
       const offsetWidth = this.$el.offsetWidth // container width
       const maxLeft = offsetWidth - menuMinWidth // left boundary
       const left = e.clientX - offsetLeft + 15 // 15: margin right
-
       if (left > maxLeft) {
         this.left = maxLeft
       } else {
         this.left = left
       }
-
       this.top = e.clientY
       this.visible = true
       this.selectedTag = tag
@@ -214,6 +214,7 @@ export default {
   box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
   .tags-view-wrapper {
     .tags-view-item {
+      user-select: none;
       display: inline-block;
       position: relative;
       cursor: pointer;
@@ -274,7 +275,6 @@ export default {
 </style>
 
 <style lang="scss">
-//reset element css of el-icon-close
 .tags-view-wrapper {
   .tags-view-item {
     .el-icon-close {

+ 5 - 1
src/main.js

@@ -22,7 +22,6 @@ function endLoading() {
 import * as echarts from 'echarts'
 Vue.prototype.$echarts = echarts
 import '@/styles/index.scss' // global css
-console.log('333')
 import App from './App'
 import store from './store'
 import router from './router'
@@ -32,10 +31,15 @@ import '@/permission' // permission control
 
 import * as filters from './filters' // global filters
 import directives from './directives'
+
 import '@zjlib/element-plugins/dest/element-plugins.css'
 import ElementPlugins from '@zjlib/element-plugins'
 Vue.use(ElementPlugins)
 
+// // 本地引用;
+// import ElementPlugins from '@packages'
+// Vue.use(ElementPlugins)
+
 // 成功/错误提示
 import { successMsg, errorMsg, warningNotify, checkBtnRole, getSummaries, numToFixed } from '@/utils/common.js'
 Vue.prototype.$successMsg = successMsg

+ 33 - 14
src/mixin/print.js

@@ -2,6 +2,8 @@ import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-
 
 disAutoConnect()
 import panel from '@/utils/panel'
+import panel2 from '@/utils/panel2'
+
 import { addPrint, getDtailPrintDis } from '@/api/supply/pickup'
 import { getDeliverDetail } from '@/api/supply/deliver'
 import { addPrints } from '@/api/supply/pickup'
@@ -49,7 +51,10 @@ export default {
       scaleMin: 0.5,
       loading: false,
       hiprintTemplate: '',
-      addIds: []
+      addIds: [],
+      dataLength: 5,
+      panelData: '',
+      moduleType: ''
     }
   },
   computed: {
@@ -71,7 +76,7 @@ export default {
   },
   methods: {
     // 初始化打印模板
-    initPrint() {
+    initPrint(type) {
       hiprint.init({
         providers: [new defaultElementTypeProvider()]
       })
@@ -91,16 +96,25 @@ export default {
           ]
         }
       })
-      // eslint-disable-next-line no-undef
-      hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
-      this.hiprintTemplate = new hiprint.PrintTemplate({
-        template: panel,
-        settingContainer: '#PrintElementOptionSetting',
-        paginationContainer: '.hiprint-printPagination'
-      })
-      this.hiprintTemplate.design('#hiprint-printTemplate')
-      // 获取当前放大比例, 当zoom时传true 才会有
-      // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+      let panelData = panel
+
+      if (type === 0) {
+        panelData = panel2
+        this.dataLength = 4
+      }
+  
+        // eslint-disable-next-line no-undef
+        hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
+        this.hiprintTemplate = new hiprint.PrintTemplate({
+          template: panelData,
+          settingContainer: '#PrintElementOptionSetting',
+          paginationContainer: '.hiprint-printPagination'
+        })
+        // this.hiprintTemplate.design('#hiprint-printTemplate')
+        // 获取当前放大比例, 当zoom时传true 才会有
+        // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+  
+     
     },
     /**
      * 获取需要打印数据详情
@@ -283,6 +297,10 @@ export default {
       remark = funcType === 'getDtailPrintDis' ? data.invoicePickBeans[0].remark || '' : data.remark || ''
       console.log(data.invoicePickBeans[0], 'oo')
       const tuiHuoRen = data.createBy
+      let address = null
+      if (data.pickType === 2) {
+        address = data.invoicePickBeans[0].address || ''
+      }
       // 数量合计
       let total = 0
       // 初始化打印次数
@@ -292,14 +310,14 @@ export default {
       // 需要计算长度和数据裁切
       const invoicePickBeans = data.invoicePickBeans
       // 获取length向上取整
-      const len = Math.ceil(invoicePickBeans.length / 5)
+      const len = Math.ceil(invoicePickBeans.length / this.dataLength)
       for (let index = 0; index < len; index++) {
         const table = []
         //  length <= 0 则不执行打印
         if (invoicePickBeans.length) {
           // 取第一个条数据printNum
           printNum = invoicePickBeans[0].printNum
-          const newInvoicePickBeans = invoicePickBeans.splice(0, 5)
+          const newInvoicePickBeans = invoicePickBeans.splice(0, this.dataLength)
           for (let e = newInvoicePickBeans.length; e > 0; e--) {
             const tempData = newInvoicePickBeans[e - 1]
             total += Math.abs(+tempData.refundableQty)
@@ -353,6 +371,7 @@ export default {
           correspondNames: '',
           pickCar: data.pickCar || '',
           createBy: JSON.parse(localStorage.getItem('supply_user')).nickName,
+          address,
           table
         })
       }

+ 48 - 198
src/permission.js

@@ -1,30 +1,36 @@
 import router from './router'
-import { resetRouter } from './router'
 import store from './store'
 import { Message } from 'element-ui'
+import { getToken } from '@/utils/auth' // get token from cookie
 import NProgress from 'nprogress' // progress bar
 import 'nprogress/nprogress.css' // progress bar style
-import { getToken } from '@/utils/auth' // get token from cookie
 import getPageTitle from '@/utils/get-page-title'
 import Layout from '@/layout'
-const _import = require('./router/_import_' + process.env.NODE_ENV) // 获取组件的方法
-
+import RouterView from '@/views/routerView.vue'
+import IframeView from '@/views/iframeView.vue'
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
-
+const _import = require('./router/_import_' + process.env.NODE_ENV) // 获取组件的方法
 const whiteList = ['/login'] // no redirect whitelist
-
+const lay = {
+  path: '/',
+  redirect: '/dashboard',
+  component: Layout,
+  children: []
+}
+// 递归找最后一级页面
+function getc(obj) {
+  if (!obj.children || !obj.children.length) {
+    return obj
+  } else {
+    return getc(obj.children[0])
+  }
+}
 router.beforeEach(async (to, from, next) => {
-  // start progress bar
   NProgress.start()
-
-  // set page title
   document.title = getPageTitle(to.meta.title)
-
-  // determine whether the user has logged in
   const hasToken = getToken()
   if (hasToken) {
     if (to.path === '/login') {
-      // if is logged in, redirect to the home page
       next({ path: '/' })
       NProgress.done()
     } else {
@@ -33,75 +39,36 @@ router.beforeEach(async (to, from, next) => {
         next()
       } else {
         try {
-          // get user info
           await store.dispatch('user/getInfo')
-
-          // 请求获取路由表
           await store.dispatch('user/getRouter')
           if (store.getters.menus.length < 1) {
             global.antRouter = []
             next()
           }
-
           // 设置路由
-          var newRoutes = []
-
+          lay.children = []
           for (var route of store.getters.menus) {
-            const item = buildRootRoute(route)
-            newRoutes.push(item)
-          }
-          console.log(newRoutes, '8589')
-          // newRoutes.shift();
-          // 添加一项根目录重定向页面
-          if (newRoutes[0].path !== '/') {
-            let path = newRoutes[0].path
-            if (newRoutes[0].children.length > 0) {
-              path = `${path}/${newRoutes[0].children[0].path}`
-            }
-            if (newRoutes[0].children[0].children.length > 0) {
-              path = `${path}/${newRoutes[0].children[0].children[0].path}`
-            }
-            newRoutes.unshift({
-              path: '/',
-              component: Layout,
-              redirect: path
-            })
-          } else {
-            newRoutes[0].redirect = '/dashboard'
+            lay.children.push(buildRoute(route))
           }
-
-          console.log(newRoutes)
-          router.addRoutes(newRoutes) // 2.动态添加路由
-          global.antRouter = newRoutes // 3.将路由数据传递给全局变量,做侧边栏菜单渲染工作
-
-          // const menus = filterAsyncRouter(store.getters.menus) // 1.过滤路由
-          // console.log(menus);
-          // router.addRoutes(menus) // 2.动态添加路由
-          // global.antRouter = menus // 3.将路由数据传递给全局变量,做侧边栏菜单渲染工作
+          lay.redirect = getc(lay).name
+          router.addRoutes([lay])
+          global.antRouter = lay.children
           next({
             ...to,
             replace: true
           })
-          // next()
         } catch (error) {
-          // remove token and go to login page to re-login
           await store.dispatch('user/resetToken')
           Message.error(error || 'Has Error')
           next('/login')
-          // next(`/login?redirect=${to.path}`);
           NProgress.done()
         }
       }
     }
   } else {
-    /* has no token*/
-
     if (whiteList.indexOf(to.path) !== -1) {
-      // in the free login whitelist, go directly
       next()
     } else {
-      // other pages that do not have permission to access are redirected to the login page.
-      // next(`/login?redirect=${to.path}`);
       next('/login')
       NProgress.done()
     }
@@ -109,164 +76,47 @@ router.beforeEach(async (to, from, next) => {
 })
 
 router.afterEach(() => {
-  // finish progress bar
   NProgress.done()
 })
 
-// 遍历后台传来的路由字符串,转换为组件对象
-// function filterAsyncRouter(asyncRouterMap) {
-//   const accessedRouters = asyncRouterMap.filter((route) => {
-//     console.log(route);
-//     if (route.component) {
-//       if (route.component === "Layout") {
-//         route.component = Layout;
-//       } else {
-//         route.component = _import(route.component); // 导入组件
-//       }
-//     }
-//     if (route.children && route.children.length) {
-//       route.children = filterAsyncRouter(route.children);
-//     }
-//     return true;
-//   });
-//   return accessedRouters;
-// }
-
-function buildRootRoute(route) {
-  const { url, icon, moduleName, moduleId, code, type, fullUrl } = route
-  var item = {}
-  item.path = url
-  item.component = Layout
-  item.name = fullUrl || code
-  item.meta = {
-    title: moduleName,
-    icon: icon,
-    moduleId
-  }
-  if (code == 'index') {
-    item.path = '/'
-    item.alwaysShow = false
-    const children = route.children
-    route.children = []
-    route.children.push({
-      code: 'dashboard',
-      moduleName: '首页',
-      type: 2,
-      url: '/dashboard',
-      children: children
-    })
-  }
-  if (code == 'issue') {
-    const children = route.children
-    route.children = []
-    route.children.push({
-      code: 'issue_index',
-      moduleName: '文件下发',
-      type: 2,
-      url: '/index',
-      children: children
-    })
-    item.alwaysShow = false
-  }
-  if (code === 'notice') {
-    const children = route.children
-    route.children = []
-    route.children.push({
-      code: 'notice_index',
-      moduleName: '系统通知',
-      type: 2,
-      url: '/index',
-      children: children
-    })
-    item.alwaysShow = false
-  }
-  item.children = []
-  if ((route.hasOwnProperty('children') && type === 1) || code == 'issue' || code == 'notice' || code == 'index') {
-    for (var child of route.children) {
-      item.children.push(buildRoute(child, fullUrl))
-    }
-  }
-  return item
-}
-
-function buildRoute(route, p_url) {
+function buildRoute(route) {
   const { url, moduleName, icon, moduleId, code, type, hidden, fullUrl } = route
   var item = {}
-  if (url.substr(0, 1) === '/') {
-    item.path = url.substr(1)
-  } else {
-    item.path = url
-  }
-  try {
-    if (code == 'dashboard') {
-      // item.component = _import(`${url}/index`)
-      item.component = resolve => require(['@/views' + `${url}/index`], resolve)
-    } else {
-      if (fullUrl) {
-        item.component = _import(`${fullUrl}`)
-      } else {
-        item.component = _import(`${p_url}${url}`)
-      }
-    }
-  } catch (e) {
-    console.log(e)
-  }
+  item.path = fullUrl || code
   item.name = fullUrl || code
   item.meta = {
+    url,
     title: moduleName,
     icon: icon,
     moduleId
   }
-  if (route.children && type == 2) {
-    const roles = []
-    for (var role of route.children) {
-      roles.push(role.code)
-    }
-    item.meta.roles = roles
-  }
   item.hidden = hidden
-  item.children = []
-  // eslint-disable-next-line no-prototype-builtins
-  if (route.hasOwnProperty('children') && type === 1) {
-    for (var child of route.children) {
-      item.children.push(buildThirdRoute(child, `${p_url}${url}`))
+  if (route.children && route.children.length) {
+    if (type == 2) {
+      try {
+        item.component = _import(`${fullUrl}`)
+      } catch (e) {
+        console.log(e)
+      }
+      const roles = []
+      for (var role of route.children) {
+        roles.push(role.code)
+      }
+      item.meta.roles = roles
+    } else {
+      item.component = RouterView
+      item.children = route.children.map(child => buildRoute(child))
     }
-  }
-  return item
-}
-
-function buildThirdRoute(route, p_url) {
-  const { url, moduleName, icon, moduleId, code, hidden, type, fullUrl } = route
-  var item = {}
-  if (url.substr(0, 1) == '/') {
-    item.path = url.substr(1)
   } else {
-    tem.path = url
-  }
-  try {
-    if (fullUrl) {
-      item.component = _import(`${fullUrl}`)
+    if (type == 4) {
+      item.component = IframeView
     } else {
-      item.component = _import(`${p_url}${url}`)
-    }
-  } catch (e) {
-    console.log(e)
-  }
-  item.name = fullUrl || code
-
-  item.meta = {
-    title: moduleName,
-    icon: icon,
-    moduleId
-  }
-  if (route.children && type == 2) {
-    const roles = []
-    for (var role of route.children) {
-      roles.push(role.code)
+      try {
+        item.component = _import(`${fullUrl}`)
+      } catch (e) {
+        console.log(e)
+      }
     }
-    item.meta.roles = roles
   }
-  item.hidden = hidden
-  item.children = []
   return item
 }

+ 1 - 229
src/router/index.js

@@ -46,235 +46,7 @@ export const constantRoutes = [
     path: '/404',
     component: () => import('@/views/404'),
     hidden: true
-  },
-
-  // {
-  //   path: '/return_goods',
-  //   component: Layout,
-  //   children: [
-  //     {
-  //       path: 'new_apply',
-  //       name: 'new_apply',
-  //       component: () => import('@/views/supply/apply/new_apply'),
-  //       meta: { title: '零售退货申请', icon: '' }
-  //     },
-  //     {
-  //       path: 'new_engin',
-  //       name: 'new_apply',
-  //       component: () => import('@/views/supply/apply/new_engin'),
-  //       meta: { title: '工程退货申请', icon: '' }
-  //     }
-  //   ]
-  // }
-
-  // {
-  //   path: '/goods',
-  //   component: Layout,
-  //   name: 'goods',
-  //   meta: { title: '商品管理', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'goods_index',
-  //       name: 'goods_index',
-  //       component: () => import('@/views/goods/goods_index'),
-  //       meta: { title: '商品列表', icon: 'form' }
-  //     },
-  //     {
-  //       path: 'goods_add',
-  //       name: 'goods_add',
-  //       hidden: true,
-  //       component: () => import('@/views/goods/goods_add'),
-  //       meta: { title: '添加商品', icon: 'form', parent:{ name:'goods_index' }}
-  //     },
-  //     {
-  //       path: 'classify_index',
-  //       name: 'classify',
-  //       component: () => import('@/views/goods/classify_index'),
-  //       meta: { title: '分类管理', icon: 'form' }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/order',
-  //   component: Layout,
-  //   name: 'order',
-  //   meta: { title: '订单管理', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'order_list',
-  //       name: 'order_list',
-  //       component: () => import('@/views/order/order_list'),
-  //       meta: { title: '订单列表', icon: 'form'}
-  //     },
-  //     {
-  //       path: 'detail',
-  //       name: 'detail',
-  //       hidden: true,
-  //       component: () => import('@/views/order/detail'),
-  //       meta: { title: '订单详情', parent:{ name:'order_list' } },
-  //     },
-  //     {
-  //       path: 'order_refund',
-  //       name: 'order_refund',
-  //       component: () => import('@/views/order/order_refund'),
-  //       meta: { title: '维权订单', icon: 'form'},
-  //     },
-  //     {
-  //       path: 'order_refund/order_refund_detail',
-  //       name: 'order_refund_detail',
-  //       hidden: true,
-  //       component: () => import('@/views/order/order_refund_detail'),
-  //       meta: { title: '维权详情', parent:{ name:'order_refund' } }
-  //     },
-  //     {
-  //       path: 'invoice',
-  //       name: 'invoice',
-  //       component: () => import('@/views/order/invoice'),
-  //       meta: { title: '开发票', icon: 'form' }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/activity',
-  //   component: Layout,
-  //   name: 'activity',
-  //   meta: { title: '活动管理', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'seckill_index',
-  //       name: 'seckill_index',
-  //       component: () => import('@/views/activity/seckill_index'),
-  //       meta: { title: '秒杀活动', icon: 'form' }
-  //     },
-  //     {
-  //       path: 'seckill_add',
-  //       name: 'seckill_add',
-  //       hidden: true,
-  //       component: () => import('@/views/activity/seckill_add'),
-  //       meta: { title: '添加商品', icon: 'form', parent:{ name:'seckill_index' }}
-  //     },
-  //     {
-  //       path: 'coupon_index',
-  //       name: 'coupon',
-  //       component: () => import('@/views/activity/coupon_index'),
-  //       meta: { title: '优惠券设置', icon: 'form' }
-  //     }
-  //   ]
-  // },
-
-  // {
-  //   path: '/member',
-  //   component: Layout,
-  //   name: 'member',
-  //   meta: { title: '会员管理', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       name: 'index',
-  //       component: () => import('@/views/member/index'),
-  //       meta: { title: '会员管理', icon: 'form' }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/settlement',
-  //   component: Layout,
-  //   name: 'settlement',
-  //   meta: { title: '结算管理', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       name: 'settlement_index',
-  //       component: () => import('@/views/settlement/index'),
-  //       meta: { title: '结算管理', icon: 'form' }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/freight',
-  //   component: Layout,
-  //   name: 'freight',
-  //   meta: { title: '配送管理', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       name: 'freight_index',
-  //       component: () => import('@/views/freight/index'),
-  //       meta: { title: '配送管理', icon: 'form' }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/storage',
-  //   component: Layout,
-  //   name: 'storage',
-  //   meta: { title: '仓储管理', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       name: 'storage_index',
-  //       component: () => import('@/views/storage/index'),
-  //       meta: { title: '仓储管理', icon: 'form' }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/notice',
-  //   component: Layout,
-  //   name: 'notice',
-  //   meta: { title: '消息中心', icon: 'el-icon-s-help' },
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       name: 'notice_index',
-  //       component: () => import('@/views/notice/index'),
-  //       meta: { title: '消息列表', icon: 'form' }
-  //     }
-  //   ]
-  // },
-
-  // {
-  //   path: '/setting',
-  //   component: Layout,
-  //   name: 'Setting',
-  //   meta: { title: '系统设置', icon: 'el-icon-s-tools' },
-  //   alwaysShow: true,
-  //   children: [
-  //     {
-  //       path: 'personal',
-  //       name: 'personal',
-  //       component: () => import('@/views/setting/personal'),
-  //       meta: { title: '个人信息', icon: 'table' }
-  //     },
-  //     {
-  //       path: 'account',
-  //       name: 'account',
-  //       component: () => import('@/views/setting/account'),
-  //       meta: { title: '账户管理', icon: 'table' }
-  //     },
-  //     {
-  //       path: 'role',
-  //       name: 'role',
-  //       component: () => import('@/views/setting/role'),
-  //       meta: { title: '权限管理', icon: 'table' }
-  //     },
-  //     {
-  //       path: 'oplog',
-  //       name: 'oplog',
-  //       component: () => import('@/views/setting/oplog'),
-  //       meta: { title: '操作日志', icon: 'table' }
-  //     },
-  //     {
-  //       path: 'banner',
-  //       name: 'banner',
-  //       component: () => import('@/views/setting/banner'),
-  //       meta: { title: '轮播图管理', icon: 'table' }
-  //     }
-  //   ]
-  // },
-
-  // 404 page must be placed at the end !!!
-  // { path: '*', redirect: '/404', hidden: true }
+  }
 ]
 
 const createRouter = () =>

+ 2 - 1
src/store/getters.js

@@ -17,6 +17,7 @@ const getters = {
   code: state => state.sales.code,
   isCustomer: state => state.user.customerId && state.user.customerName && state.user.customerNumber,
   userInfo :state =>state.user.userInfo,
-  isHongGe:state => state.user.userInfo.isHongGe
+  isHongGe:state => state.user.userInfo.isHongGe,
+  autoChangeNum:state => state.user.changeNum
 }
 export default getters

+ 9 - 4
src/store/modules/user.js

@@ -16,6 +16,7 @@ const getDefaultState = () => {
     isNotice: false,
     websitNumber: '',
     isCollapse: true,
+    changeNum:1,
     userInfo: JSON.parse(localStorage.getItem('supply_user')) || {}
   }
 }
@@ -62,16 +63,18 @@ const mutations = {
   SET_USETINFO(state, data) {
     state.userInfo = data
   },
+  SET_CHANGEUNM(state, data){
+    state.changeNum = data  || 1
+
+  },
   showMessage: (state, value) => {
     if (value == 'yes') {
       state.showMessages = true
-    } else {
+    }else{
       state.showMessages = false
-      state.isNotice = true
     }
   },
   SET_MESSAGE(state, value) {
-    state.showMessages = value
     state.isNotice = value
   }
 }
@@ -116,7 +119,7 @@ const actions = {
           }
           console.log(data)
           let websitNumber
-          const { nickName, userName, customerId, customerName, customerNumber, isFront } = data
+          const { nickName, userName, customerId, customerName, customerNumber, changeNum, isFront } = data
 
           if (data.adminWebsit) {
             websitNumber = data.adminWebsit.websitNumber
@@ -147,6 +150,8 @@ const actions = {
           // },
           // ]
           // menus.push({ path: '*', redirect: '/404', hidden: true })
+          commit('SET_CHANGEUNM', changeNum)
+
           commit('SET_CUSTOMERID', customerId)
           commit('SET_CUSTOMERNAME', customerName)
           commit('SET_CUSTOMERNUMBER', customerNumber)

+ 3 - 1
src/utils/common.js

@@ -32,8 +32,10 @@ export const warningNotify = msg => {
  * @returns
  */
 export const checkBtnRole = (value, btnRole) => {
+  // console.log(btnRole)
+  // let condition = btnRole === undefined ? [] : btnRole
   if (!btnRole) {
-    return true
+    return false
   }
   let index = btnRole.indexOf(value)
   return index >= 0

+ 445 - 0
src/utils/panel2.js

@@ -0,0 +1,445 @@
+export default {
+  panels: [
+    {
+      index: 0,
+      height: 150,
+      width: 241,
+      paperCount: 222,
+      printElements: [
+        {
+          options: {
+            left: 0,
+            top: 25,
+            height: 27,
+            width: 640,
+            field: 'company',
+            fontSize: 19,
+            fontWeight: '600',
+            fontFamily: '黑体,宋体,微软雅黑',
+            textAlign: 'center',
+            lineHeight: 26
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 25,
+            top: 35,
+            height: 13,
+            lineHeight: 13,
+            width: 328,
+            fontSize: 12.5,
+            title: '打印日期',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'nowDate',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 590,
+            top: 35,
+            height: 13,
+            lineHeight: 13,
+            width: 328,
+            fontSize: 12.5,
+            title: '打印次数',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'printNum',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        // {
+        //   "options": {
+        //     "left": 25,
+        //     "top": 35,
+        //     "height": 13,
+        //     "lineHeight": 13,
+        //     "width": 328,
+        //     "fontSize": 12.5,
+        //     "title": "经销商编码",
+        //     "fontFamily": '黑体,宋体,微软雅黑',
+        //     "field": "customerNumber",
+        //     "color": "#000",
+        //     "textAlign": "left"
+        //   }, "printElementType": { "title": "", "type": "text" }
+        // },
+
+        {
+          options: {
+            left: 25,
+            top: 55,
+            height: 13,
+            lineHeight: 13,
+            width: 640,
+            fontSize: 12.5,
+            title: '经销商',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'customerName',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 500,
+            top: 55,
+            height: 13,
+            lineHeight: 13,
+            width: 300,
+            fontSize: 12.5,
+            title: '提货方式',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'pickTypeName',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 25,
+            top: 72,
+            height: 13,
+            lineHeight: 13,
+            width: 150,
+            fontSize: 12.5,
+            title: '出库单号',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'salesId',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 300,
+            top: 72,
+            height: 13,
+            lineHeight: 13,
+            width: 200,
+            fontSize: 12.5,
+            title: '发货单号',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'invoiceId',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+
+        {
+          options: {
+            left: 500,
+            top: 72,
+            height: 13,
+            lineHeight: 13,
+            width: 300,
+            fontSize: 12.5,
+            title: '仓库',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'correspondName',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 25,
+            top: 89,
+            height: 13,
+            lineHeight: 13,
+            width: 328,
+            fontSize: 12.5,
+            title: '工程登录编号',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'refEnginRecordNo',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 300,
+            top: 89,
+            height: 13,
+            lineHeight: 13,
+            width: 410,
+            fontSize: 12.5,
+            title: '使用单位',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'refUseUnit',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 25,
+            top: 106,
+            height: 13,
+            lineHeight: 13,
+            width: 633,
+            fontSize: 12.5,
+            title: '备注',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'headerRemark',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text', fontSize: 8 }
+        },
+        {
+          options: {
+            left: 23,
+            top: 123,
+            height: 410,
+            width: 630,
+            fontSize: 12.5,
+            field: 'table',
+            fontFamily: '黑体,宋体,微软雅黑',
+            lineHeight: 16,
+            tableFooterRepeat: 'last',
+            columns: [
+              [
+                {
+                  title: '订单号',
+                  field: 'enginOrderType',
+                  width: 60,
+                  align: 'left',
+                  colspan: 1,
+                  rowspan: 1,
+                  fontSize: 12.5
+                },
+                {
+                  title: '发货日期',
+                  field: 'createTime',
+                  width: 50,
+                  align: 'left',
+                  colspan: 1,
+                  rowspan: 1,
+                  fontSize: 12.5
+                },
+
+                {
+                  title: '存货名称',
+                  field: 'materialName',
+                  width: 100,
+                  align: 'left',
+                  colspan: 1,
+                  rowspan: 1,
+                  fontSize: 12.5
+                },
+                {
+                  title: '规格型号',
+                  field: 'specification',
+                  width: 140,
+                  align: 'left',
+                  overflow: 'hidden',
+                  colspan: 1,
+                  rowspan: 1,
+                  fontSize: 12.5
+                },
+                {
+                  title: '数量',
+                  field: 'refundableQty',
+                  width: 23,
+                  align: 'center',
+                  colspan: 1,
+                  rowspan: 1,
+                  fontSize: 12.5,
+                  tableSummary: 'sum'
+                },
+                // , {
+                //   "title": "订单备注",
+                //   "field": "headerRemark",
+                //   "width": 40,
+                //   "align": "center",
+                //   "colspan": 1,
+                //   "rowspan": 1,
+                //   "fontSize": 12.5,
+                // }
+                {
+                  title: '备注说明',
+                  field: 'pjxh1Text',
+                  width: 40,
+                  align: 'left',
+                  colspan: 2,
+                  rowspan: 1,
+                  fontSize: 12.5
+                }
+              ]
+            ]
+          },
+          printElementType: {
+            title: '表格',
+            type: 'table',
+            editable: true,
+            columnDisplayEditable: true, // 列显示是否能编辑
+            columnDisplayIndexEditable: true, // 列顺序显示是否能编辑
+            columnTitleEditable: true, // 列标题是否能编辑
+            columnResizable: true, // 列宽是否能调整
+            columnAlignEditable: true, // 列对齐是否调整
+            isEnableEditField: true, // 编辑字段
+            isEnableContextMenu: true, // 开启右键菜单 默认true
+            isEnableInsertRow: true, // 插入行
+            isEnableDeleteRow: true, // 删除行
+            isEnableInsertColumn: true, // 插入列
+            isEnableDeleteColumn: true, // 删除列
+            isEnableMergeCell: true // 合并单元格
+          }
+        },
+
+        {
+          options: {
+            left: 25,
+            top: 376,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 12.5,
+            title: '',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'takerName',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 25,
+            top: 410,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 12.5,
+            title: '打单',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'createBy',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 238,
+            top: 410,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 12.5,
+            title: '提单',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'takerDa',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 238,
+            top: 376,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 12.5,
+            title: '联系方式',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'takerPhone',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 463,
+            top: 376,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 12.5,
+            title: '车辆',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'pickCar',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 463,
+            top: 410,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 12.5,
+            title: '仓库',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'correspondNames',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        },
+        {
+          options: {
+            left: 25,
+            top: 393,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 12.5,
+            title: "送货地址",
+            fontFamily: "黑体,宋体,微软雅黑",
+            field: "address",
+            testData: "",
+            color: "#000",
+            textAlign: "left",
+          },
+          printElementType: { title: "", type: "text" },
+        },
+        {
+          options: {
+            left: 610,
+            top: 410,
+            height: 13,
+            lineHeight: 13,
+            width: 218,
+            fontSize: 16,
+            title: '',
+            fontFamily: '黑体,宋体,微软雅黑',
+            field: 'pageNumber',
+            testData: '',
+            color: '#000',
+            textAlign: 'left'
+          },
+          printElementType: { title: '', type: 'text' }
+        }
+      ],
+      paperNumberDisabled: true
+    }
+  ]
+}

+ 10 - 0
src/utils/request.js

@@ -3,6 +3,12 @@ import { MessageBox, Message } from 'element-ui'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
 
+var moduleId = ''
+
+export function setModuleId(val) {
+  moduleId = val
+}
+
 // create an axios instance
 const service = axios.create({
   baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
@@ -21,6 +27,7 @@ service.interceptors.request.use(
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation
       config.headers['x-token'] = getToken()
+      config.headers['moduleId'] = moduleId
     }
     return config
   },
@@ -92,6 +99,7 @@ export function postBlob(data) {
       url: process.env.VUE_APP_BASE_API + data.url, // 后端接口地址
       responseType: 'blob', // bolb格式的请求方式
       headers: {
+        moduleId,
         'x-token': getToken() // 请求头
       },
       data: data.data // 需要传给后端的请求参数体
@@ -126,6 +134,7 @@ export function getBlob(data) {
       responseType: 'blob',
       params: data.data, // 与post传参方式不同之处
       headers: {
+        moduleId,
         'x-token': getToken() // 请求头
       }
     })
@@ -163,6 +172,7 @@ export async function handleImport(url, formData, id = '') {
     axios
       .post(process.env.VUE_APP_BASE_API + url, formData, {
         headers: {
+          moduleId,
           'Content-Type': 'multipart/form-data',
           'x-token': getToken(),
           id

+ 16 - 0
src/utils/util.js

@@ -339,3 +339,19 @@ export function changeNumberMoneyToChinese(money) {
   ChineseStr = Symbol + ChineseStr
   return ChineseStr
 }
+
+// 区分单击事件和双击事件
+export function clickBG(millisecond) {
+  this.timer = null
+  this.click = callback => {
+    clearTimeout(this.timer)
+    this.timer = setTimeout(function () {
+      clearTimeout(this.timer)
+      callback && callback()
+    }, millisecond)
+  }
+  this.dblClick = callback => {
+    clearTimeout(this.timer)
+    callback && callback()
+  }
+}

+ 1 - 2
src/views/basic_data/dealer/components/dealer-apply-detail.vue

@@ -98,8 +98,7 @@ export default {
   },
   methods: {
     goBack() {
-      console.log(this.$parent)
-      this.$parent.isShow = true
+      this.$emit('close')
     }
   }
 }

+ 1 - 1
src/views/basic_data/dealer/components/dealer_deposit_history.vue

@@ -109,7 +109,7 @@ export default {
       this.dataList = res.data.records
     },
     goBack() {
-      this.$parent.showHistory = true
+      this.$emit('close')
     }
   }
 }

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

@@ -370,7 +370,7 @@ export default {
   },
   methods: {
     goBack() {
-      this.$parent.isShow = true
+      this.$emit('close')
     },
     //金蝶存货类别列表
     async getDataList() {
@@ -404,7 +404,7 @@ export default {
         frontCategory:this.isFront? this.frontCategory.join(','):''
       }).then(res => {
         this.$successMsg('保存成功')
-        this.$parent.isShow = true
+        this.$emit('close')
       })
     }
   }

+ 4 - 2
src/views/basic_data/dealer/dealer_apply.vue

@@ -141,8 +141,7 @@
         </div>
       </div>
     </div>
-
-    <DealerApplyDetail v-else />
+    <DealerApplyDetail v-else  @close="handleClose"/>
   </div>
 </template>
 
@@ -204,6 +203,9 @@ export default {
     },
     editFn() {
       this.isShow = false
+    },
+    handleClose(){
+      this.isShow = true
     }
   }
 }

+ 9 - 5
src/views/basic_data/dealer/dealer_deposit.vue

@@ -111,18 +111,19 @@
               <template slot-scope="scope">
                 <el-button
                   type="text"
-                  class="textColor"
+                 size="mini"
                   v-if="$checkBtnRole('edit', $route.meta.roles)"
                   @click="editFn(scope.row.id)"
                   >编辑</el-button
                 >
-                <el-button type="text" class="textColor" @click="logFn(scope.row.id)">记录</el-button>
+                <el-button type="text" size="mini" @click="logFn(scope.row.id)">记录</el-button>
                 <el-popconfirm
+                class="import-btn"
                   @onConfirm="deleFn(scope.row.id)"
                   v-if="$checkBtnRole('del', $route.meta.roles)"
                   title="这是一段内容确定删除吗?"
                 >
-                  <el-button type="text" class="textColor" slot="reference">删除</el-button>
+                  <el-button type="text" size="mini" slot="reference">删除</el-button>
                 </el-popconfirm>
               </template>
             </el-table-column>
@@ -209,7 +210,7 @@
     </div>
 
     <!-- 记录页面 -->
-    <DealerDepositHistory :historyId="historyId" v-else />
+    <DealerDepositHistory :historyId="historyId" @close="handleClose" v-else />
   </div>
 </template>
 
@@ -353,6 +354,9 @@ export default {
     }
   },
   methods: {
+    handleClose(){
+      this.showHistory = true
+    },
     // //押金
     // amountFn(e) {
     //   if (this.dialogForm.rate != 0 || this.dialogForm.rate != "") {
@@ -572,4 +576,4 @@ export default {
 //   padding: 12px;
 // }
 </style>
->
+

+ 75 - 189
src/views/basic_data/dealer/dealer_list.vue

@@ -1,209 +1,95 @@
 <template>
-  <div class="app-container">
-    <div v-if="isShow">
-      <!-- 筛选条件 -->
-      <div>
-        <Collapse :screen-form="searchForm">
-          <template #right_btn>
-            <el-button size="mini" @click="clearFn">清空</el-button>
-            <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
-          </template>
-          <template #search>
-            <el-form ref="searchForm" :model="searchForm" label-width="70px" size="mini" label-position="left">
-              <el-row :gutter="20">
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="名称" prop="keyword">
-                    <el-input v-model="searchForm.keyword" placeholder="请输入名称"></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-          </template>
-        </Collapse>
-      </div>
-      <!-- 按钮 -->
-      <div class="btn-group clearfix">
-        <div class="fr">
-          <ExportButton :exUrl="'customer/export'" :exParams="exParams" />
-        </div>
-        <div class="fl">
-          <ImportButton :imUrl="'customer/import'" @importSuccess="getList" />
-        </div>
-
-      </div>
-
-      <div class="mymain-container">
-        <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="客户编码" prop="number" min-width="110">
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.number" />
-                <span>{{ scope.row.number }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="客户名称" prop="name" min-width="260" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.name" />
-                <span>{{ scope.row.name }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="简称"
-              prop="shortName"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column prop="forbidStatus" align="left" label="禁用状态" min-width="100" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.forbidStatus === 'A'">正常</el-tag>
-                <el-tag size="mini" type="danger" v-else-if="scope.row.flag === 'B'">禁用</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="使用组织"
-              prop="useOrgName"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="更新人"
-              prop="updateBy"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="更新时间"
-              prop="updateTime"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-
-            <el-table-column
-              align="center"
-              label="操作"
-              prop="caozuo"
-              min-width="160"
-              show-overflow-tooltip
-              fixed="right"
-            >
-              <template slot-scope="scope">
-                <el-button type="text" class="textColor" @click="editFn(scope.row.id)">详情</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <!-- 分页 -->
-        <div class="fr">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="pageSize"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal"
-          >
-          </el-pagination>
-        </div>
-      </div>
-    </div>
-    <DealerListDetail :infoList="inforList" :detailsId="detailsId" v-else />
-  </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+  >
+    <Popu v-if="visible">
+      <DealerListDetail :detailsId="detailsId" @close="handleClose" />
+    </Popu>
+  </template-page>
 </template>
 
 <script>
-import { getDealerList, getDealerInfo } from '@/api/basic_data/dealer'
+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 DealerListDetail from './components/dealer_list-detail.vue'
-
 export default {
+  components: { TemplatePage, Popu, DealerListDetail },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      isShow: true,
-      dataList: [], // 列表数据
-      detailsId: '',
-      listLoading: false, // 列表加载loading
-      screenForm: {},
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      searchForm: {
-        keyword: ''
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+       [
+          [
+            {
+              name: '导入',
+              render: this.importButton(importCustomerV2)
+            }
+          ]
+        ],
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       },
-      inforList: {},
-      isCollapse: true
-    }
-  },
-  components: {
-    DealerListDetail
-  },
-  created() {
-    this.getList()
-  },
-  computed: {
-    exParams() {
-      return {
-        keyword: this.searchForm.keyword
-      }
+      recordSelected: [],
+
+      detailsId: ''
     }
   },
   methods: {
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getDealerListV2(...p)
     },
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+    // 列表导出函数
+    exportList: exportDealerListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
-    },
-    //搜索功能
-    async searchFn() {
-      this.currentPage = 1
-      this.getList()
-    },
-    //重置
-    clearFn() {
-      this.$refs.searchForm.resetFields()
-    },
-    //获取列表数据
-    async getList() {
-      let params = {
-        ...this.searchForm,
-        pageNum: this.currentPage,
-        pageSize: this.pageSize
+    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>
+        )
       }
-      const res = await getDealerList(params)
-      this.dataList = res.data.records
-      this.listTotal = res.data.total
     },
-    editFn(id) {
-      this.isShow = false
-      this.detailsId = id
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     }
   }
 }

+ 211 - 453
src/views/basic_data/dealer/dealer_stock.vue

@@ -1,310 +1,93 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="searchForm">
-        <template #right_btn>
-          <el-button size="mini" @click="clearFn">清空</el-button>
-          <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商名称" prop="customerName">
-                  <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          type="primary"
-          size="mini"
-          @click="addFn"
-          class="add-right"
-          icon="el-icon-plus"
-          >新增</el-button
-        >
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          @onConfirm="deleFn"
-          title="这是一段内容确定删除吗?"
-        >
-          <el-button
-            :disabled="ids.length < 1"
-            type="danger"
-            size="mini"
-            class="textColor"
-            icon="el-icon-minus"
-            slot="reference"
-            >批量删除</el-button
-          >
-        </el-popconfirm>
-      </div>
-      <div class="fr">
-        <el-button type="primary" size="mini" @click="downLoadFns">导出</el-button>
-        <el-button type="primary" size="mini" @click="downLoadFn">下载模板</el-button>
-        <el-upload
-          class="import-btn"
-          action=""
-          :http-request="handleImport"
-          :file-list="importFileList"
-          :show-file-list="false"
-        >
-          <el-button type="primary" size="mini">导入</el-button>
-        </el-upload>
-      </div>
-    </div>
-
-    <div class="mymain-container">
-      <!-- 列表 -->
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          @select="hanleSelect"
-          @select-all="hanleSelect"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column type="selection" align="center" min-width="51"></el-table-column>
-          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="110" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerNumber" />
-              <span>{{ scope.row.customerNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="金蝶部门编号" prop="k3OrgNumber" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.k3OrgNumber" />
-              <span>{{ scope.row.k3OrgNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="金蝶部门名称" prop="k3OrgName" min-width="200" show-overflow-tooltip>
-          </el-table-column>
-
-          <el-table-column
-            align="left"
-            label="钱包名称"
-            prop="customerWalletName"
-            min-width="200"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="业务员"
-            prop="serviceName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建人"
-            prop="createBy"
-            min-width="180"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新人"
-            prop="updateBy"
-            min-width="180"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新时间"
-            prop="updateTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="操作"
-            prop="caozuo"
-            min-width="160"
-            show-overflow-tooltip
-            fixed="right"
-          >
-            <template slot-scope="scope">
-              <el-button
-                type="text"
-                class="textColor"
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                @click="editFn(scope.row.id)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                @onConfirm="deleFn(scope.row.id)"
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                title="这是一段内容确定删除吗?"
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :operation="operation()"
+    :tableEvents="tableEvents"
+    :tableAttributes="tableAttributes"
+    :columnParsing="columnParsing"
+  >
+    <el-dialog :title="title" :visible.sync="dialogForm" width="50%" :show-close="false" :close-on-click-modal="false">
+      <el-form ref="addForm" :model="addForm" :rules="rules" label-width="100px" label-position="left">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="经销商名称" prop="customerId">
+              <el-select
+                filterable
+                class="selectStyle"
+                v-model="addForm.customerId"
+                placeholder="请选择"
+                @change="changeFn"
               >
-                <el-button type="text" class="textColor" slot="reference">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="pageSize"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
-
-    <!-- 弹窗 -->
-    <el-dialog :title="title" :visible.sync="dialogForm" width="30%" :show-close="false" :close-on-click-modal="false">
-      <el-form ref="addForm" :model="addForm" :rules="rules" label-width="100px" label-position="right">
-        <el-form-item label="经销商名称" prop="customerId">
-          <el-select
-            filterable
-            class="selectStyle"
-            v-model="addForm.customerId"
-            placeholder="请选择"
-            @change="changeFn"
-          >
-            <el-option v-for="item in dealerList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="经销商编码" prop="customerNumber">
-          <el-input disabled v-model="addForm.customerNumber"></el-input>
-          <!-- <template slot-scope="scope">
-            {{ scope.row }}
-          </template> -->
-        </el-form-item>
-        <el-form-item label="金蝶部门编号" prop="k3OrgNumber">
-          <!--          <el-input v-model="addForm.k3OrgNumber"></el-input>-->
-          <el-select class="selectStyle" v-model="addForm.k3OrgNumber" placeholder="请选择" filterable>
-            <el-option
-              v-for="item in k3DepartmentList"
-              :key="item.number"
-              :label="item.name + '(' + item.number + ')'"
-              :value="item.number"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="钱包" prop="customerWalletId">
-          <el-select class="selectStyle" v-model="addForm.customerWalletId" placeholder="请选择" filterable>
-            <el-option
-              v-for="item in walletList"
-              :key="item.customerWalletId"
-              :label="item.customerWalletName"
-              :value="item.customerWalletId"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="区域" prop="region">
-          <el-cascader
-            ref="locationCascader"
-            v-model="addForm.region"
-            class="selectStyle"
-            :options="options"
-            :props="props"
-            clearable
-          ></el-cascader>
-        </el-form-item>
-        <!-- <el-form-item label="一级区域" prop="oneParentId">
-          <el-select
-            class="selectStyle"
-            v-model="addForm.oneParentId"
-            placeholder="请选择"
-            filterable
-            @change="changeOneFn"
-          >
-            <el-option
-              v-for="item in oneList"
-              :key="item.adminWebsitId"
-              :label="item.name"
-              :value="item.adminWebsitId"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="二级区域" prop="">
-          <el-select
-            filterable
-            class="selectStyle"
-            v-model="addForm.twoParentId"
-            placeholder="请选择"
-            @change="changeTwoFn"
-          >
-            <el-option
-              v-for="item in twoList"
-              :key="item.adminWebsitId"
-              :label="item.name"
-              :value="item.adminWebsitId"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="三级区域" prop=""
-          ><el-select
-            class="selectStyle"
-            v-model="addForm.threeParentId"
-            placeholder="请选择"
-            filterable
-            @change="changeThreeFn"
-          >
-            <el-option
-              v-for="item in threeList"
-              :key="item.adminWebsitId"
-              :label="item.name"
-              :value="item.adminWebsitId"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item> -->
-        <el-form-item label="对应业务员" prop="serviceId">
-          <el-select class="selectStyle" v-model="addForm.serviceId" placeholder="请选择" filterable>
-            <el-option v-for="(item, i) in userList" :key="i" :label="item.nickName" :value="item.adminUserId">
-            </el-option>
-          </el-select>
-        </el-form-item>
+                <el-option v-for="item in dealerList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <el-col :span="12"
+            ><el-form-item label="经销商编码" prop="customerNumber">
+              <el-input disabled v-model="addForm.customerNumber"></el-input> </el-form-item
+          ></el-col>
+          <el-col :span="12">
+            <el-form-item label="金蝶部门编号" prop="k3OrgNumber">
+              <el-select class="selectStyle" v-model="addForm.k3OrgNumber" placeholder="请选择" filterable>
+                <el-option
+                  v-for="item in k3DepartmentList"
+                  :key="item.number"
+                  :label="item.name + '(' + item.number + ')'"
+                  :value="item.number"
+                >
+                </el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <el-col :span="12"
+            ><el-form-item label="钱包" prop="customerWalletId">
+              <el-select class="selectStyle" v-model="addForm.customerWalletId" placeholder="请选择" filterable>
+                <el-option
+                  v-for="item in walletList"
+                  :key="item.customerWalletId"
+                  :label="item.customerWalletName"
+                  :value="item.customerWalletId"
+                >
+                </el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <el-col :span="12">
+            <el-form-item label="区域" prop="region">
+              <el-cascader
+                ref="locationCascader"
+                v-model="addForm.region"
+                class="selectStyle"
+                :options="options"
+                :props="props"
+                clearable
+              ></el-cascader> </el-form-item
+          ></el-col>
+          <el-col :span="12"
+            ><el-form-item label="对应业务员" prop="serviceId">
+              <el-select class="selectStyle" v-model="addForm.serviceId" placeholder="请选择" filterable>
+                <el-option v-for="(item, i) in userList" :key="i" :label="item.nickName" :value="item.adminUserId">
+                </el-option>
+              </el-select> </el-form-item
+          ></el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="cancelFn">取 消</el-button>
         <el-button type="primary" @click="addDataListFn">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </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 {
-  getDealerStockList,
+  getDealerStockListV2,
+  exportDealerStockListV2,
   getDealerStockAdd,
   deleDealerStockList,
   getDictionaries,
@@ -314,36 +97,94 @@ import {
   getCustomerPtDetail,
   getCustomerPtUpdate,
   getWalletCustomerList,
-  getK3DepartmentList
+  getK3DepartmentList,
+  downloadCustomerPtV2,
+  importCustomerPtV2
 } from '@/api/basic_data/dealer'
 import { getDealerList } from '@/api/basic_data/dealer'
 import { getDepartmentList } from '@/api/setting'
-import { downloadFiles, handleImport } from '@/utils/util'
-
 export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.addFn()
+              }),
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let ids = this.recordSelected.map(v => {
+                  return v.id
+                })
+                let params = { ids: ids.toString() }
+                await deleDealerStockList(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '导入',
+              render: this.importButton(importCustomerPtV2)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '导入模版',
+              click: () => {
+                downloadCustomerPtV2({}, `${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: [],
       props: {
         checkStrictly: true,
         value: 'adminWebsitId',
         label: 'name'
-
-        // expandTrigger: "hover",
-        // lazy: true,
-        // lazyLoad(node, resolve) {
-        //   console.log(node);
-        //   const { value } = node;
-        //   setTimeout(async () => {
-        //     let res = await getAdminWebsitByparent({
-        //       parentId: value,
-        //     });
-        //     let aaa = res.data.map((v) => {
-        //       return { value: v.adminWebsitId, label: v.name };
-        //     });
-
-        //     resolve(aaa);
-        //   }, 0);
-        // },
       },
       options: [],
       importFileList: [],
@@ -356,9 +197,6 @@ export default {
         customerNumber: '',
         k3OrgNumber: '',
         region: [],
-        // oneParentId: "",
-        // twoParentId: "",
-        // threeParentId: "",
         serviceId: '',
         customerWalletId: ''
       },
@@ -367,15 +205,6 @@ export default {
         customerId: [{ required: true, message: '请选择经销商名称', trigger: 'change' }],
         customerWalletId: [{ required: true, message: '请选择经销商钱包', trigger: 'change' }],
         region: [{ required: true, message: '请选择区域', trigger: 'change' }],
-        // oneParentId: [
-        //   { required: true, message: "请选择一级区域", trigger: "blur" },
-        // ],
-        // twoParentId: [
-        //   { required: true, message: "请选择二级区域", trigger: "blur" },
-        // ],
-        // threeParentId: [
-        //   { required: true, message: "请选择三级区域", trigger: "blur" },
-        // ],
         serviceId: [{ required: true, message: '请选择业务员', trigger: 'change' }]
       },
 
@@ -390,27 +219,13 @@ export default {
       dataList: [], // 列表数据
       listLoading: false, // 列表加载loading
       dealerList: [],
-      // selectList: [],
       walletList: [], //产品大类列表
-      // oneList: [], //一级区域数据
-      // twoList: [], //二级区域数据
-      // threeList: [], //三级区域数据
       userList: [], //业务员
       ids: [],
       rowID: null, //编辑ID
       k3DepartmentList: []
     }
   },
-  async created() {
-    this.getTree()
-    // this.getAdminWebsit(1);
-    this.getList()
-    this.getK3DepartmentList()
-    this.getDealerDataList({ pageNum: 1, pageSize: -1 })
-    this.getUserList(1)
-    // this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
-  },
-  computed: {},
   watch: {
     'addForm.region': function (newValue) {
       // console.log(newValue, 888);
@@ -431,32 +246,60 @@ export default {
         this.walletList = res2.data
       }
     }
-    // "addForm.oneParentId": async function (newValue) {
-    //   if (newValue) {
-    //     let res = await getAdminWebsitByparent({
-    //       parentId: newValue,
-    //       // mainId: this.mainId,
-    //     });
-    //     this.twoList = res.data;
-    //   }
-    // },
-    // "addForm.twoParentId": async function (newValue) {
-    //   if (newValue) {
-    //     let res = await getAdminWebsitByparent({
-    //       parentId: newValue,
-    //       // mainId: this.mainId,
-    //     });
-    //     this.getUserList(newValue);
-    //     this.threeList = res.data;
-    //   }
-    // },
-    // "addForm.threeParentId": async function (newValue) {
-    //   if (newValue) {
-    //     this.getUserList(newValue);
-    //   }
-    // },
+  },
+  async created() {
+    this.getTree()
+    this.getK3DepartmentList()
+    this.getDealerDataList({ pageNum: 1, pageSize: -1 })
+    this.getUserList(1)
   },
   methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getDealerStockListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportDealerStockListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={() => {
+                  this.editFn(row.id)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : null}
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm onOnConfirm={() => this.deleFn(row.id)} title="这是一段内容确定删除吗?">
+                <el-button style="font-size:12px" type="text" size="mini" slot="reference">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    },
     // 导入
     async handleImport(param) {
       const file = param.file
@@ -466,7 +309,7 @@ export default {
       this.importFileList = []
       if (result.code == 200) {
         this.$message.success('导入成功')
-        await this.getList()
+        await this.$refs.pageRef.refreshList()
       } else {
         this.$message.error(result.message)
       }
@@ -484,39 +327,16 @@ export default {
     downLoadFns() {
       downloadFiles('customer/pt/export')
     },
-    // //改变产品大类
-    // changeSelectFn(value) {
-    //   // const res = this.categoryList.filter((v) => v.productCategoryId == value);
-    //   // console.log(res);
-    //   // this.mainId = res[0].productCategoryNumber;
-    // },
     //编辑
     async changeFn(v) {
       this.addForm.customerWalletId = ''
     },
-    // async changeOneFn(v) {
-    //   this.addForm.twoParentId = "";
-    //   this.addForm.threeParentId = "";
-    //   this.addForm.serviceId = "";
-    // },
-    // async changeTwoFn(v) {
-    //   this.addForm.threeParentId = "";
-    //   this.addForm.serviceId = "";
-    // },
-    // async changeThreeFn(v) {
-    //   this.addForm.serviceId = "";
-    // },
     async editFn(id) {
       this.title = '经销商业务关系管理 '
       this.rowID = id
       let res = await getCustomerPtDetail({ id })
-      // console.log(res);
-
       this.addForm.customerId = res.data.customerId
       this.addForm.customerWalletId = res.data.customerWalletId
-      // this.addForm.oneParentId = res.data.adminWebsitId1;
-      // this.addForm.twoParentId = res.data.adminWebsitId2;
-      // this.addForm.threeParentId = res.data.adminWebsitId3;
       this.addForm.region = [res.data.adminWebsitId1, res.data.adminWebsitId2, res.data.adminWebsitId3]
       this.addForm.serviceId = res.data.serviceId
       this.addForm.k3OrgNumber = res.data.k3OrgNumber
@@ -543,29 +363,7 @@ export default {
         this.options = res.data[0].children
       })
     },
-    // //根据父级查询部门
-    // async getAdminWebsit(data) {
-    //   let res = await getAdminWebsitByparent({
-    //     parentId: data,
-    //     // mainId: this.mainId,
-    //   });
-    //   let arr = res.data.map((v) => {
-    //     return {
-    //       value: v.adminWebsitId,
-    //       label: v.name,
-    //     };
-    //   });
 
-    //   // this.options = arr;
-
-    //   this.oneList = res.data;
-    // },
-    // //获取产品类别数据
-    // async getCategoryList() {
-    //   let res = await getProductCategoryList();
-    //   console.log(res);
-    //   this.categoryList = res.data;
-    // },
     // 筛选部分数据或者单个
     hanleSelect(selection) {
       // this.ids = selection.map((k) => {
@@ -593,7 +391,7 @@ export default {
         await deleDealerStockList({ ids: res })
       }
 
-      this.getList()
+      this.$refs.pageRef.refreshList()
 
       this.$message.success('删除成功')
       this.ids = []
@@ -612,8 +410,6 @@ export default {
       let data3 = this.userList.filter(v => {
         return v.adminUserId == this.addForm.serviceId
       })
-      // console.log(data3);
-      // console.log(data2, 22222);
 
       let value = {
         customerId: this.addForm.customerId,
@@ -644,19 +440,12 @@ export default {
       this.addForm.customerWalletId = ''
       this.addForm.region = []
       this.addForm.k3OrgNumber = ''
-
-      // this.addForm.oneParentId = "";
-      // this.addForm.twoParentId = "";
-      // this.addForm.threeParentId = "";
       this.addForm.serviceId = ''
-      // this.userList = [];
-      // this.twoList = [];
-      // this.threeList = [];
       this.walletList = []
       this.$nextTick(() => {
         this.$refs['addForm'].clearValidate()
       })
-      this.getList()
+      this.$refs.pageRef.refreshList()
       this.dialogForm = false
     },
     //取消
@@ -689,37 +478,6 @@ export default {
     async getDealerDataList(data) {
       const res = await getDealerList(data)
       this.dealerList = res.data.records
-    },
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
-    },
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
-    },
-    //搜索功能
-    searchFn() {
-      this.currentPage = 1
-      this.getList()
-    },
-    //重置
-    clearFn() {
-      this.$refs.searchForm.resetFields()
-    },
-    //获取列表数据
-    async getList() {
-      let params = {
-        customerName: this.searchForm.customerName,
-        pageNum: this.currentPage,
-        pageSize: this.pageSize
-      }
-      const res = await getDealerStockList(params)
-      this.dataList = res.data.records
-      this.listTotal = res.data.total
     }
   }
 }

+ 136 - 216
src/views/basic_data/logistics/logistics_list.vue

@@ -1,163 +1,14 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="120px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物流公司名称" prop="customerTel">
-                  <el-input placeholder="请输入物流公司名称" v-model="screenForm.logisticsCompany"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="客服电话" prop="logisticsCompany">
-                  <el-input placeholder="请输入客服电话" v-model="screenForm.customerTel"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="hanleAdd"
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          >新增</el-button
-        >
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          confirm-button-text="好的"
-          cancel-button-text="不用了"
-          icon="el-icon-info"
-          icon-color="red"
-          title="内容确定删除吗?"
-          @onConfirm="hanleDelete"
-        >
-          <el-button type="primary" size="mini" slot="reference" class="el-popover-left">删除</el-button>
-        </el-popconfirm>
-      </div>
-      <div class="fr">
-        <!-- <ExportButton :exUrl="'/logistics/export'" :exParams="exParams" /> -->
-
-        <el-button type="primary" size="mini" @click="handleExport">导出</el-button>
-        <!-- <el-button type="primary" size="mini" @click="hanlePrint"
-          >打印</el-button
-        > -->
-      </div>
-    </div>
-    <!-- 列表 -->
-    <div class="mymain-container">
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          @select="hanleSelectAll"
-          @select-all="hanleSelectAll"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column type="selection" align="center"></el-table-column>
-          <el-table-column
-            align="center"
-            label="物流公司名称"
-            prop="logisticsCompany"
-            min-width="160"
-            show-overflow-tooltip
-          >
-          </el-table-column>
-          <el-table-column
-            align="center"
-            label="物流公司代码"
-            prop="logisticsNumber"
-            min-width="160"
-            show-overflow-tooltip
-          >
-          </el-table-column>
-          <!-- <el-table-column
-            align="center"
-            label="提货人"
-            prop="pickName"
-            min-width="160"
-            show-overflow-tooltip
-          >
-          </el-table-column>
-          <el-table-column
-            align="center"
-            label="提货人电话"
-            prop="pickTel"
-            min-width="160"
-            show-overflow-tooltip
-          >
-          </el-table-column> -->
-          <el-table-column align="center" label="客服电话" prop="customerTel" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="center" label="创建人" prop="createBy" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="center" label="创建时间" prop="createTime" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="center" label="更新人" prop="updateBy" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="center" label="更新时间" prop="updateTime" min-width="160" show-overflow-tooltip>
-          </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="hanleDetail(scope.row)"
-                >详情</el-button
-              > -->
-              <el-button
-                type="text"
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                class="textColor"
-                @click="editFn(scope.row.id, scope.row)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                confirm-button-text="好的"
-                cancel-button-text="不用了"
-                icon="el-icon-info"
-                icon-color="red"
-                title="内容确定删除吗?"
-                @onConfirm="hanleDelete(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :operation="operation()"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="物流公司"
@@ -166,7 +17,7 @@
       :show-close="false"
       :close-on-click-modal="false"
     >
-      <el-form ref="form" :rules="type == 2 ? rules : ''" :model="diaLogForm" label-width="120px">
+      <el-form ref="form" :rules="rules" :model="diaLogForm" label-width="120px">
         <el-form-item label="物流公司名称" prop="logisticsCompany">
           <el-input v-model="diaLogForm.logisticsCompany"></el-input>
         </el-form-item>
@@ -184,22 +35,79 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="hanleCancel('form')">取 消</el-button>
+        <el-button @click="handleClose('form')">取 消</el-button>
         <el-button type="primary" @click="handelInfo('form')">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
-import { addInof, deleteInfo, getLogisticsList, updateInfo } from '@/api/basic_data/logistics'
+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 {
+  addInof,
+  deleteInfo,
+  getLogisticsList,
+  updateInfo,
+  getLogisticsV2,
+  exportLogisticsV2
+} from '@/api/basic_data/logistics'
 import { downloadFiles } from '@/utils/util'
-
 export default {
-  mixins: [Mixin],
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.hanleAdd()
+              }),
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let ids = this.recordSelected.map(v => {
+                  return v.id
+                })
+                let params = ids
+                await deleteInfo(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
       type: 1, // 1 ,2, 3
       diaLogForm: {
         id: null,
@@ -221,20 +129,60 @@ export default {
       rules: {
         logisticsCompany: [{ required: true, message: '请输入物流公司名称', trigger: 'blur' }],
         logisticsNumber: [{ required: true, message: '请输入物流公司代码', trigger: 'blur' }]
-        // pickName: [
-        //   { required: true, message: "请输入提货人", trigger: "blur" },
-        // ],
-        // pickTel: [
-        //   { required: true, message: "请输入提货人电话", trigger: "blur" },
-        // ],
-        // customerTel: [
-        //   { required: true, message: "请输入客服电话", trigger: "blur" },
-        // ],
-      },
-      isCollapse: true
+      }
     }
   },
   methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getLogisticsV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportLogisticsV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button type="text" size="mini" class="textColor" onClick={() => this.editFn(row.id, row)}>
+                编辑
+              </el-button>
+            ) : null}
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                confirm-button-text="好的"
+                cancel-button-text="不用了"
+                icon="el-icon-info"
+                icon-color="red"
+                title="内容确定删除吗?"
+                onOnConfirm={() => this.hanleDelete(row.id)}
+              >
+                <el-button slot="reference" type="text" size="mini" class="textColor el-popover-left">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.$refs['form'].resetFields()
+
+      this.addOff(() => {
+        this.type = 2
+        this.showDialogForm = false
+      })()
+    },
     //显示新增弹框
     hanleAdd() {
       this.type = 2
@@ -253,24 +201,10 @@ export default {
       }
       this.showDialogForm = true
     },
-    // 初始化数据
-    getList() {
-      this.listLoading = true
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        customerTel: this.screenForm.customerTel,
-        logisticsCompany: this.screenForm.logisticsCompany
-      }
-      getLogisticsList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-        console.log(this.dataList, 1233)
-      })
-    },
+
     //新增数据或者编辑数据请求接口  type 1 为编辑  type 2 新增
     handelInfo(formName) {
+      console.log(this.type, '999')
       if (this.type === 1) {
         const params = {
           ...this.diaLogForm
@@ -278,8 +212,8 @@ export default {
         updateInfo(params).then(res => {
           this.$successMsg('编辑成功')
           this.showDialogForm = false
-          this.getList()
-          this.hanleCancel()
+          this.$refs.pageRef.refreshList()
+          this.handleClose()
         })
         this.diaLogForm.id = null
       } else if (this.type === 2) {
@@ -288,8 +222,8 @@ export default {
             addInof(this.diaLogForm).then(res => {
               this.$successMsg('保存成功')
               this.showDialogForm = false
-              this.hanleCancel()
-              this.getList()
+              this.handleClose()
+              this.$refs.pageRef.refreshList()
             })
           } else {
             console.log('error submit!!')
@@ -305,7 +239,7 @@ export default {
       this.type = 3
       this.showDialogForm = true
       this.diaLogForm = detail
-      this.hanleCancel()
+      this.handleClose()
     },
     // 导出文档
     handleExport() {
@@ -318,29 +252,15 @@ export default {
 
     // 删除数据
     hanleDelete(id) {
-      this.hanleDeleteAllPromise(id).then(ids => {
-        deleteInfo(ids).then(() => {
-          this.$successMsg('删除成功')
-          this.getList()
-        })
+      deleteInfo([id]).then(() => {
+        this.$successMsg('删除成功')
+        this.$refs.pageRef.refreshList()
       })
-    },
-    // 取消按钮重置数据
-    hanleCancel(form) {
-      this.$refs['form'].resetFields()
-      // this.diaLogForm = {
-      //   id: null,
-      //   customerTel: "",
-      //   logisticsCompany: "",
-      //   logisticsNumber: "",
-      //   pickName: "",
-      //   pickTel: "",
-      // };
-      this.showDialogForm = false
     }
   }
 }
 </script>
+
 <style lang="scss" scoped>
 .textColor {
   color: black;

+ 68 - 234
src/views/basic_data/material/category_list.vue

@@ -1,253 +1,87 @@
 <template>
-  <div class="app-container">
-    <div>
-      <!-- 筛选条件 -->
-      <div>
-        <Collapse :screen-form="screenForm">
-          <template #right_btn>
-            <el-button size="mini" @click="resetScreenForm">清空</el-button>
-            <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-          </template>
-          <template #search>
-            <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-              <el-row :gutter="20">
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="名称" prop="keyword">
-                    <el-input placeholder="请输入名称" v-model="screenForm.keyword"></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-          </template>
-        </Collapse>
-      </div>
-      <div class="mymain-container">
-        <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="编码"
-              prop="number"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="创建组织"
-              prop="dictType"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="名称"
-              prop="name"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="使用组织"
-              prop="useOrgId"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column align="left" label="数据状态" prop="dataState" min-width="100"></el-table-column>
-            <el-table-column align="left" label="禁用状态" prop="disableState" min-width="100">
-              <template slot-scope="scope">
-                <el-tag type="success" size="mini" v-if="scope.row.forbidStatus == 'A'">正常</el-tag>
-                <el-tag type="danger" size="mini" v-else>禁用</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="创建人"
-              prop="createBy"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="创建日期"
-              prop="createTime"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="修改人"
-              prop="updateBy"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="修改日期"
-              prop="updateTime"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <!-- <el-table-column
-              align="left"
-              label="审核人"
-              prop="examine"
-              min-width="100"
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="审核日期"
-              prop="examineDate"
-              min-width="100"
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="禁用人"
-              prop="disable"
-              min-width="100"
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="禁用日期"
-              prop="disableDate"
-              min-width="100"
-            ></el-table-column> -->
-          </el-table>
-        </div>
-        <!-- 分页 -->
-        <div class="fr">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal"
-          >
-          </el-pagination>
-        </div>
-      </div>
-    </div>
-    <!-- <CategoryListDetail v-else /> -->
-  </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+  >
+
+  </template-page>
 </template>
 
 <script>
-import CategoryListDetail from './components/category_list-detail.vue'
-import { getCategoryList } from '@/api/basic_data/material'
-import Mixin from '@/mixin/index'
-
+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 { getCategoryListV2, exportCategoryListV2 } from '@/api/basic_data/material'
 export default {
-  mixins: [Mixin],
+  components: { TemplatePage, Popu,  },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      isShow: true,
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: [
-        {
-          code: 'ASDVDS_ASD',
-          createOrganize: '广州格匠机电工程',
-          name: '原材料',
-          useOrganize: '广州格匠机电工程',
-          dataState: '已审核',
-          disableState: '否',
-          create: 'Administrator',
-          createDate: '1993/8/8',
-          modify: 'Administrator',
-          modifyDate: '1993/8/8',
-          examine: 'Administrator',
-          examineDate: '1993/8/8',
-          disable: '',
-          disableDate: ''
-        },
-        {
-          code: 'ASDVDS_ASD',
-          createOrganize: '广州格匠机电工程',
-          name: '原材料',
-          useOrganize: '广州格匠机电工程',
-          dataState: '已审核',
-          disableState: '否',
-          create: 'Administrator',
-          createDate: '1993/8/8',
-          modify: 'Administrator',
-          modifyDate: '1993/8/8',
-          examine: 'Administrator',
-          examineDate: '1993/8/8',
-          disable: '',
-          disableDate: ''
-        },
-        {
-          code: 'ASDVDS_ASD',
-          createOrganize: '广州格匠机电工程',
-          name: '原材料',
-          useOrganize: '广州格匠机电工程',
-          dataState: '已审核',
-          disableState: '否',
-          create: 'Administrator',
-          createDate: '1993/8/8',
-          modify: 'Administrator',
-          modifyDate: '1993/8/8',
-          examine: 'Administrator',
-          examineDate: '1993/8/8',
-          disable: '',
-          disableDate: ''
-        },
-        {
-          code: 'ASDVDS_ASD',
-          createOrganize: '广州格匠机电工程',
-          name: '原材料',
-          useOrganize: '广州格匠机电工程',
-          dataState: '已审核',
-          disableState: '否',
-          create: 'Administrator',
-          createDate: '1993/8/8',
-          modify: 'Administrator',
-          modifyDate: '1993/8/8',
-          examine: 'Administrator',
-          examineDate: '1993/8/8',
-          disable: '',
-          disableDate: ''
-        }
+      visible: false,
+      // 事件组合
+      // 事件组合
+      optionsEvensGroup: [
+   
       ],
-      screenForm: {
-        keyword: ''
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       },
-      isCollapse: true
+      recordSelected: [],
+
+      detailsId: ''
     }
   },
-  components: {
-    CategoryListDetail
-  },
   methods: {
-    editFn() {
-      this.isShow = false
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getCategoryListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportCategoryListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-    // 初始化数据
-    getList() {
-      this.listLoading = true
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        keyword: this.screenForm.keyword
+    // 监听勾选变化
+    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>
+        )
       }
-      getCategoryList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     }
   }
 }
 </script>
 
-<style></style>
+<style lang="scss" scoped></style>

+ 4 - 3
src/views/basic_data/material/components/material_list-detail.vue

@@ -684,6 +684,7 @@ export default {
   data() {
     return {
       value1: '是',
+      value:'',
       dinghuo: true,
       isDisplace: ''
     }
@@ -694,8 +695,8 @@ export default {
   },
   methods: {
     goBack() {
-      console.log(this.$parent)
-      this.$parent.isShow = true
+      
+       this.$emit('close')
     },
     handleSave() {
       editCategory({
@@ -703,7 +704,7 @@ export default {
         isDisplace: this.isDisplace
       }).then(res => {
         this.$successMsg('编辑成功')
-        this.$parent.isShow = true
+         this.$emit('close')
       })
     }
   }

+ 15 - 12
src/views/basic_data/material/components/modify_list-apply.vue

@@ -529,7 +529,7 @@
       <el-button style="float: right" type="primary" size="small" @click="centerDialogVisible = true">添加</el-button>
     </div>
 
-    <el-dialog title="" :visible.sync="centerDialogVisible" width="80%" center>
+    <el-dialog title="" append-to-body :visible.sync="centerDialogVisible" width="80%" center>
       <div>
         <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
           <el-row :gutter="20">
@@ -636,7 +636,7 @@ import Mixin from '@/mixin/index'
 
 export default {
   mixins: [Mixin],
-  props: ['cid'],
+  props: ['cid', 'show'],
   data() {
     return {
       baseURL: '',
@@ -790,10 +790,11 @@ export default {
       this.serviceId = adminCompany.roleId
     },
     goBack() {
-      this.$parent.cid = ''
-      this.$parent.show = 1
-      // 更新父组件数据
-      this.$parent.getList()
+      // this.$parent.cid = ''
+      // this.$parent.show = 1
+      // // 更新父组件数据
+      // this.$parent.getList()
+      this.$emit('back')
     },
     indexMethod(index) {
       console.log(index)
@@ -959,7 +960,7 @@ export default {
         wall.data[u].walletName = wall.data[u].name
       }
       this.walleList = wall.data
-      if (this.$parent.show === 5) {
+      if (this.show === 5) {
         getProductRriceDetail({ id: this.cid }).then(res => {
           for (let i = 0; i < res.data.items.length; i++) {
             const linshi = []
@@ -1091,8 +1092,9 @@ export default {
         .then(res => {
           console.log(res.code, 'klkk')
           this.$successMsg('成功')
-          this.$parent.show = 1
-          this.$parent.getList()
+          // this.$parent.show = 1
+          // this.$parent.getList()
+          this.goBack()
         })
         .catch(err => {
           console.log(err)
@@ -1114,9 +1116,10 @@ export default {
       })
         .then(res => {
           this.$successMsg('成功')
-          this.$parent.cid = ''
-          this.$parent.show = 1
-          this.$parent.getList()
+          // this.$parent.cid = ''
+          // this.$parent.show = 1
+          // this.$parent.getList()
+          this.goBack()
         })
         .catch(err => {
           for (let j = 0; j < this.items.length; j++) {

+ 6 - 4
src/views/basic_data/material/components/modify_list-approval.vue

@@ -230,8 +230,9 @@ export default {
       })[0]?.saleName
     },
     goBack() {
-      console.log(this.$parent)
-      this.$parent.show = 1
+      // console.log(this.$parent)
+      // this.$parent.show = 1
+      this.$emit('back')
     },
     onSubmit() {
       const params = {
@@ -242,8 +243,9 @@ export default {
 
       getProductRriceConfirm(params).then(res => {
         this.$successMsg('已提交审核')
-        this.$parent.show = 1
-        this.$parent.getList()
+        // this.$parent.show = 1
+        // this.$parent.getList()
+        this.goBack()
       })
     },
     resetScreenForm() {

+ 3 - 2
src/views/basic_data/material/components/modify_list-detail.vue

@@ -235,8 +235,9 @@ export default {
       })[0]?.saleName
     },
     goBack() {
-      console.log(this.$parent)
-      this.$parent.show = 1
+      // console.log(this.$parent)
+      // this.$parent.show = 1
+      this.$emit('back')
     }
   }
 }

+ 172 - 244
src/views/basic_data/material/machine_list.vue

@@ -1,207 +1,14 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="screenForm" :is-show="false">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="名称" prop="name">
-                  <el-input placeholder="请输入名称" v-model="screenForm.name"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="型号" prop="model">
-                  <el-input placeholder="请输入型号" v-model="screenForm.model"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="编码" prop="number">
-                  <el-input placeholder="请输入编码" v-model="screenForm.number"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="体积" prop="volume">
-                  <el-input
-                    type="number"
-                    @mousewheel.native.prevent
-                    placeholder="请输入体积"
-                    v-model.number="screenForm.volume"
-                  ></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          type="primary"
-          size="mini"
-          icon="el-icon-plus"
-          @click=";(showDialogForm = true), (type = 1)"
-          >新增</el-button
-        >
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          confirm-button-text="好的"
-          cancel-button-text="不用了"
-          icon="el-icon-info"
-          icon-color="red"
-          :show-file-list="false"
-          title="内容确定删除吗?"
-          @onConfirm="hanleDeleteAll"
-        >
-          <el-button slot="reference" type="primary" icon="el-icon-delete" size="mini" class="textColor el-popover-left"
-            >删除</el-button
-          >
-        </el-popconfirm>
-      </div>
-      <div class="fr">
-        <!-- <el-upload
-          class="import-btn upload-demo"
-          :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="handleExport">导出</el-button>
-        <!-- <el-button
-          type="primary"
-          size="mini"
-          icon="el-icon-printer"
-          v-print="printObj"
-          >打 印</el-button
-        > -->
-      </div>
-    </div>
-    <div class="mymain-container" id="printMe">
-      <!-- 列表 -->
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          @select-all="hanleSelectAll"
-          @select="hanleSelectAll"
-          stripe
-        >
-          <el-table-column type="selection" align="left"></el-table-column>
-          <el-table-column align="left" label="类型" prop="type" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ findMachineType(scope.row.type) }}
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="名称"
-            prop="name"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="型号"
-            prop="model"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="编码"
-            prop="number"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="right"
-            label="体积"
-            prop="volume"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-
-          <el-table-column
-            align="left"
-            label="创建人"
-            prop="createBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新人"
-            prop="updateBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新时间"
-            prop="updateTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-
-          <el-table-column align="center" fixed="right" label="操作" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-button
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                type="text"
-                class="textColor"
-                @click="editFn(scope.row.id, scope.row)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                confirm-button-text="好的"
-                cancel-button-text="不用了"
-                icon="el-icon-info"
-                icon-color="red"
-                title="内容确定删除吗?"
-                @onConfirm="hanleDeleteAll(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :optionsEvensGroup="optionsEvensGroup"
+    :operation="operation()"
+    :tableEvents="tableEvents"
+    :tableAttributes="tableAttributes"
+    :columnParsing="columnParsing"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="产品信息"
@@ -227,7 +34,12 @@
           <el-input v-model="diaLogForm.number" size="normal"></el-input>
         </el-form-item>
         <el-form-item label="体积" prop="volume">
-          <el-input v-model="diaLogForm.volume" type="number" @mousewheel.native.prevent size="normal"></el-input>
+          <el-input
+            v-model.number="diaLogForm.volume"
+            type="number"
+            @mousewheel.native.prevent
+            size="normal"
+          ></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -235,24 +47,113 @@
         <el-button type="primary" @click="hanleInfo">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
+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 { downloadFiles, handleImport } from '@/utils/util'
-import { getDistList, getMachineAdd, getMachineDel, getMachineEdit, getMachineLlist } from '@/api/basic_data/material'
-import print from 'vue-print-nb'
-
+import {
+  getDistList,
+  getMachineAdd,
+  getMachineDel,
+  getMachineEdit,
+  getMachineLlistV2,
+  exportMachineLlistV2
+} from '@/api/basic_data/material'
 export default {
-  mixins: [Mixin],
-  directives: {
-    print
-  },
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      printObj: {
-        id: 'printMe'
+      visible: false,
+      // 事件组合
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.showDialogForm = true
+                this.type = 1
+              }),
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let ids = this.recordSelected.map(v => {
+                  return v.id
+                })
+                let params = ids
+                await getMachineDel(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ]
+        // [
+        //   [
+        //     {
+        //       name: '导入模版',
+        //       click: () => {
+        //         materialCategoryTemplateExcel({}, `${this.$route.meta.title}`)
+        //           .then(res => {
+        //             this.$message({
+        //               message: '下载成功',
+        //               type: 'success'
+        //             })
+        //           })
+        //           .catch(err => {
+        //             this.$message.error('下载失败')
+        //           })
+        //       }
+        //     }
+        //   ]
+        // ],
+        // [
+        //   [
+        //     {
+        //       name: '导出',
+        //       click: () => {
+        //         materialCategoryTemplateExcel({}, `${this.$route.meta.title}`)
+        //           .then(res => {
+        //             this.$message({
+        //               message: '下载成功',
+        //               type: 'success'
+        //             })
+        //           })
+        //           .catch(err => {
+        //             this.$message.error('下载失败')
+        //           })
+        //       }
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       },
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -311,8 +212,7 @@ export default {
             trigger: 'blur'
           }
         ]
-      },
-      isCollapse: true
+      }
     }
   },
   created() {
@@ -322,6 +222,53 @@ export default {
     })
   },
   methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getMachineLlistV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportMachineLlistV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button type="text" class="textColor" size="mini" onClick={() => this.editFn(row.id, row)}>
+                编辑
+              </el-button>
+            ) : null}
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                confirm-button-text="好的"
+                cancel-button-text="不用了"
+                icon="el-icon-info"
+                icon-color="red"
+                title="内容确定删除吗?"
+                onOnConfirm={() => this.hanleDeleteAll(row.id)}
+              >
+                <el-button slot="reference" type="text" size="mini" class="textColor el-popover-left">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    },
     editFn(id, row) {
       this.type = 2
       this.diaLogForm = {
@@ -338,6 +285,7 @@ export default {
       this.$refs.diaLogForm.resetFields()
     },
     hanleInfo() {
+      console.log(this.diaLogForm)
       this.$refs.diaLogForm.validate(valid => {
         if (valid) {
           if (this.type === 1) {
@@ -345,7 +293,7 @@ export default {
               this.$successMsg('保存成功')
               this.showDialogForm = false
               this.resetInfo()
-              this.getList()
+              this.$refs.pageRef.refreshList()
             })
           } else if (this.type === 2) {
             const params = {
@@ -355,7 +303,7 @@ export default {
               this.$successMsg('编辑成功')
               this.showDialogForm = false
               this.resetInfo()
-              this.getList()
+              this.$refs.pageRef.refreshList()
             })
             this.diaLogForm.id = null
           }
@@ -365,24 +313,7 @@ export default {
         }
       })
     },
-    // 初始化数据
-    getList() {
-      this.listLoading = true
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        name: this.screenForm.name,
-        number: this.screenForm.number,
-        model: this.screenForm.model,
-        volume: this.screenForm.volume
-      }
-      getMachineLlist(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-        console.log(this.dataList, 1233)
-      })
-    },
+
     // 导入
     async handleImport(param) {
       this.importLoading = true
@@ -397,7 +328,7 @@ export default {
         this.$alert(result.message, '导入成功', {
           confirmButtonText: '确定'
         })
-        this.getList()
+        this.$refs.pageRef.refreshList()
       } else {
         this.$alert(result.message, '导入失败', {
           confirmButtonText: '确定'
@@ -413,11 +344,9 @@ export default {
       downloadFiles('machine-record/export', screenData)
     },
     hanleDeleteAll(id) {
-      console.log(id)
-      this.hanleDeleteAllPromise(id).then(ids => {
-        getMachineDel(ids).then(res => {
-          this.getList()
-        })
+      const ids = [id]
+      getMachineDel(ids).then(res => {
+        this.$refs.pageRef.refreshList()
       })
     },
     resetInfo() {
@@ -441,7 +370,6 @@ export default {
   }
 }
 </script>
-
 <style lang="scss" scoped>
 ::v-deep .el-select {
   width: 100%;

+ 78 - 171
src/views/basic_data/material/material_list.vue

@@ -1,194 +1,101 @@
 <template>
-  <div class="app-container">
-    <div v-if="isShow">
-      <!-- 筛选条件 -->
-      <div>
-        <Collapse :screen-form="screenForm">
-          <template #right_btn>
-            <el-button size="mini" @click="resetScreenForm">清空</el-button>
-            <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-          </template>
-          <template #search>
-            <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-              <el-row :gutter="20">
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="名称" prop="keyword">
-                    <el-input v-model="screenForm.keyword" placeholder="请输入名称" />
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="物料编码" prop="number">
-                    <el-input v-model="screenForm.number" placeholder="请输入物料编码" />
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="金蝶编码" prop="oldNumber">
-                    <el-input v-model="screenForm.oldNumber" placeholder="请输入金蝶编码" />
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-          </template>
-        </Collapse>
-      </div>
-      <div class="mymain-container">
-        <div class="table">
-          <el-table
-            v-loading="listLoading"
-            :data="dataList"
-            element-loading-text="Loading"
-            border
-            fit
-            highlight-current-row
-            stripe
-          >
-            <!-- <el-table-column
-              type="selection"
-              align="left"
-              min-width="100"
-            ></el-table-column> -->
-            <el-table-column align="left" label="使用组织" prop="useOrgName" min-width="200" show-overflow-tooltip />
-            <el-table-column
-              align="left"
-              label="物料编码"
-              prop="number"
-              min-width="200"
-              label-class-name="bianma"
-              class-name="fontstyle"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.number" />
-                <span>{{ scope.row.number }}</span>
-              </template>
-            </el-table-column>
-
-            <el-table-column align="left" label="产品名称" prop="name" min-width="200" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.name" />
-                <span>{{ scope.row.name }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.specification" />
-                <span>{{ scope.row.specification }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="数据状态" prop="forbidStatus" min-width="100" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <el-tag size="mini" v-if="scope.row.forbidStatus == 'A'" type="success">正常</el-tag>
-                <el-tag size="mini" v-else type="danger">禁用</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="金蝶编码" prop="oldNumber" min-width="160" show-overflow-tooltip />
-            <el-table-column
-              align="left"
-              label="是否维护商城资料"
-              prop="maintainData"
-              min-width="150"
-              show-overflow-tooltip
-            />
-            <!--            <el-table-column-->
-            <!--              align="left"-->
-            <!--              label="是否维护内外机档案"-->
-            <!--              prop="maintainFiles"-->
-            <!--              min-width="100"-->
-            <!--            >-->
-            <!--              <template slot-scope="scope">-->
-            <!--                <el-tag v-if="scope.row.isSheath == true" type="success"-->
-            <!--                  >是</el-tag-->
-            <!--                >-->
-            <!--                <el-tag v-else type="danger">否</el-tag>-->
-            <!--              </template>-->
-            <!--            </el-table-column>-->
-            <el-table-column align="left" label="基本单位" prop="baseUnitId" min-width="100" show-overflow-tooltip />
-            <el-table-column align="left" label="已使用" prop="used" min-width="100" show-overflow-tooltip />
-            <el-table-column
-              align="center"
-              fixed="right"
-              label="操作"
-              prop="caozuo"
-              min-width="160"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <el-button type="text" class="textColor" @click="hanleDetail(scope.row.id)">详情</el-button>
-                <!-- <el-button type="text" class="textColor">删除</el-button> -->
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <!-- 分页 -->
-        <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>
-    <MaterialListDetail v-else :detail="detail" />
-  </div>
+  <template-page 
+    ref="pageRef"
+    :getList="getList"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :operation="operation()"
+    :columnParsing="columnParsing"
+  >
+    <Popu v-if="visible">
+      <MaterialListDetail  :detail="detail" @close="handleClose"/>
+    </Popu>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
-import { getMaterialDetail, getMaterialList } from '@/api/basic_data/material'
+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 { getMaterialDetail, getMaterialListV2,exportMaterialListV2 } from '@/api/basic_data/material'
 import MaterialListDetail from './components/material_list-detail.vue'
 
 export default {
-  components: { MaterialListDetail },
-  mixins: [Mixin],
+  components: { TemplatePage, Popu, MaterialListDetail },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      isShow: true,
-      screenForm: {
+      visible: false,
+      // 事件组合
+      // 事件组合
+      optionsEvensGroup: [
+       
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      searchForm: {
         // 筛选表单数据
-        keyword: '', // 名称
-        number: '',
-        oldNumber: ''
+        name: ''
       },
-      isCollapse: true
+      detail: {}
     }
   },
   methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getMaterialListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportMaterialListV2,
+    // 表格列解析渲染数据更改
+    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.hanleDetail(row.id)
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    },
     hanleDetail(id) {
       getMaterialDetail({ id }).then(res => {
-        console.log(res)
         this.detail = res.data
-        this.isShow = false
       })
     },
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        keyword: this.screenForm.keyword,
-        number: this.screenForm.number,
-        oldNumber: this.screenForm.oldNumber
-      }
-      getMaterialList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-    }
   }
 }
 </script>
 
-<style lang="scss" scoped>
-// ::v-deep .fontstyle {
-//   color: #0909ff;
-// }
-// ::v-deep .bianma {
-//   color: #409eff;
-// }
-</style>
+<style lang="scss" scoped></style>

+ 234 - 427
src/views/basic_data/material/modify_list.vue

@@ -1,425 +1,142 @@
 <template>
-  <div class="app-container">
-    <div v-if="show === 1">
-      <!-- 筛选条件 -->
-      <div>
-        <div>
-          <Collapse :screen-form="screenForm">
-            <template #right_btn>
-              <el-button size="mini" @click="resetScreenForm">清空</el-button>
-              <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-            </template>
-            <template #search>
-              <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-                <el-row :gutter="20">
-                  <el-col :xs="24" :sm="12" :lg="6">
-                    <el-form-item label="物料编码" prop="materialNumber">
-                      <el-input placeholder="请输入物料编码" v-model="screenForm.materialNumber"></el-input>
-                    </el-form-item>
-                  </el-col>
-                  <el-col :xs="24" :sm="12" :lg="6">
-                    <el-form-item label="产品名称" prop="materialName">
-                      <el-input placeholder="请输入产品名称" v-model="screenForm.materialName"></el-input>
-                    </el-form-item>
-                  </el-col>
-                  <el-col :xs="24" :sm="12" :lg="6">
-                    <el-form-item label="产品编码" prop="materialOldNumber">
-                      <el-input placeholder="请输入产品编码" v-model="screenForm.materialOldNumber"></el-input>
-                    </el-form-item>
-                  </el-col>
-                  <!--              <el-col :xs="24" :sm="12" :lg="6">-->
-                  <!--                <el-form-item label="生效日期" prop="startDate">-->
-                  <!--                  <el-date-picker-->
-                  <!--                    v-model="screenForm.startDate"-->
-                  <!--                    type="datetime"-->
-                  <!--                    placeholder="请输入生效日期"-->
-                  <!--                    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="endDate">-->
-                  <!--                  <el-date-picker-->
-                  <!--                    v-model="screenForm.endDate"-->
-                  <!--                    type="datetime"-->
-                  <!--                    placeholder="请输入生效日期"-->
-                  <!--                    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="saleTypeId">
-                      <el-select
-                        v-model="screenForm.saleTypeId"
-                        filterable
-                        placeholder="选择销售类型"
-                        style="width: 100%"
-                      >
-                        <el-option label="全部" value=""></el-option>
-                        <el-option
-                          v-for="item in typeList"
-                          :key="item.id"
-                          :label="item.saleName"
-                          :value="item.id"
-                        ></el-option>
-                      </el-select>
-                    </el-form-item>
-                  </el-col>
-                  <el-col :xs="24" :sm="12" :lg="6">
-                    <el-form-item label="产品类别" prop="k3CategoryNumber">
-                      <el-select style="width: 100%" placeholder="请选择产品类别" v-model="screenForm.k3CategoryNumber">
-                        <el-option label="全部" value=""></el-option>
-                        <el-option v-for="item in dictList" :label="item.name" :value="item.number"></el-option>
-                      </el-select>
-                    </el-form-item>
-                  </el-col>
-                  <el-col :xs="24" :sm="12" :lg="6">
-                    <el-form-item label="规格型号" prop="specification">
-                      <el-input placeholder="请输入规格型号" v-model="screenForm.specification"></el-input>
-                    </el-form-item>
-                  </el-col>
-                </el-row>
-              </el-form>
-            </template>
-          </Collapse>
-        </div>
-      </div>
-      <!-- 按钮 -->
-      <div class="btn-group clearfix">
-        <div class="fl">
-          <el-button
-            type="primary"
-            v-if="$checkBtnRole('add', $route.meta.roles)"
-            icon="el-icon-plus"
-            size="mini"
-            @click="addFn"
-            >新增</el-button
-          >
-          <!-- <el-button type="primary" size="mini">编辑</el-button> -->
-          <el-upload
-            v-if="$checkBtnRole('add', $route.meta.roles)"
-            style="margin-bottom: 10px"
-            class="import-btn"
-            :action="baseURL + 'student/import'"
-            :http-request="handleImport"
-            :file-list="importFileList"
-            :show-file-list="false"
-            :disabled="importLoading"
-            v-loading="importLoading"
-          >
-            <el-button type="primary" size="mini">导入调价单 </el-button>
-          </el-upload>
-          <el-button
-            v-if="$checkBtnRole('add', $route.meta.roles)"
-            type="primary"
-            size="mini"
-            @click="hanleDownloadFiles"
-            >下载模板
-          </el-button>
-          <el-popconfirm
-            v-if="$checkBtnRole('del', $route.meta.roles)"
-            confirm-button-text="好的"
-            cancel-button-text="不用了"
-            icon="el-icon-info"
-            icon-color="red"
-            title="内容确定删除吗?"
-            style="margin-right: 10px"
-            @onConfirm="hanleDeleteAll"
-          >
-            <el-button type="primary" size="mini" icon="el-icon-delete" slot="reference" class="el-popover-left"
-              >删除</el-button
-            >
-          </el-popconfirm>
-          <el-button
-            size="mini"
-            type="warning"
-            icon="el-icon-finished"
-            @click="batchExamine"
-            v-if="$checkBtnRole('examine', $route.meta.roles)"
-            >批量审批</el-button
-          >
-        </div>
-        <div class="fr">
-          <ExportButton :exUrl="'product-upd-price/export'" :exParams="exParams" />
-          <!-- <el-button type="primary" size="mini">导入</el-button>
-          <el-button type="primary" size="mini">导出</el-button>
-          <el-button type="primary" size="mini">打印</el-button> -->
-        </div>
-      </div>
-      <div class="mymain-container">
-        <!-- 列表 -->
-        <div class="table">
-          <el-table
-            v-loading="listLoading"
-            :data="dataList"
-            element-loading-text="Loading"
-            border
-            fit
-            highlight-current-row
-            @select-all="hanleSelectAll"
-            @select="hanleSelectAll"
-            :row-class-name="tableRowClassName"
-          >
-            <el-table-column type="selection" align="left" width="50"></el-table-column>
-            <el-table-column align="left" label="单据号" prop="updPriceBillId" min-width="200" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.updPriceBillId" />
-                <span>{{ scope.row.updPriceBillId }}</span>
-              </template>
-            </el-table-column>
-
-            <el-table-column
-              align="left"
-              label="销售类型"
-              prop="saleTypeName"
-              :formatter="formatterType"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <!-- <el-table-column
-              align="left"
-              label="产品类别"
-              prop="mainName"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column> -->
-            <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialNumber" />
-                <span>{{ scope.row.materialNumber }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="产品名称" prop="materialName" min-width="200" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialName" />
-                <span>{{ scope.row.materialName }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="产品编码"
-              prop="materialOldNumber"
-              min-width="200"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialOldNumber" />
-                <span>{{ scope.row.materialOldNumber }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.specification" />
-                <span>{{ scope.row.specification }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="计量单位"
-              prop="unit"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="right"
-              label="数量"
-              prop="qty"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="right"
-              label="批发价"
-              prop="batchPrice"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+    <ExamineDialog @submit="submitExamineForm" :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
 
-            <el-table-column
-              align="right"
-              label="格力折扣"
-              prop="discAmount"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="调价日期"
-              prop="createTime"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="生效日期"
-              prop="startDate"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="失效日期"
-              prop="endDate"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <!-- <el-table-column
-              align="left"
-              label="是否促销价"
-              prop="isPromote"
-              min-width="160"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.isPromote">是</el-tag>
-                <el-tag size="mini"  type="danger" v-else>否</el-tag>
-              </template>
-            </el-table-column> -->
-            <el-table-column align="left" label="返利类型(钱包)" prop="wallets" min-width="250" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <template v-for="(item, index) in comWallets(scope.row.wallets)">
-                  <template v-if="item.type === 'REBATE'">
-                    <el-tag type="success" style="margin: 0 10px" size="mini" :key="index">
-                      {{ item.walletName }}
-                    </el-tag>
-                  </template>
-                </template>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="现金钱包"
-              prop="modifyPriceDepartment"
-              min-width="350"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <template v-for="(item, index) in comWallets(scope.row.wallets)">
-                  <template v-if="item.type === 'COMMONLY'">
-                    <el-tag type="success" style="margin: 0 10px" size="mini" :key="index">
-                      {{ item.walletName }}
-                    </el-tag>
-                  </template>
-                </template>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="调价部门"
-              prop="adminWebsitName"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="调价业务员"
-              prop="serviceName"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="制单日期"
-              prop="createTime"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="审核人"
-              prop="confirmName"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="审核日期"
-              prop="confirmTime"
-              min-width="200"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column align="left" label="状态" prop="examineStatus" min-width="160" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.examineStatus == 'SAVE'">保存</el-tag>
-                <el-tag size="mini" type="danger" v-else-if="scope.row.examineStatus == 'WAIT'">待审核</el-tag>
-                <el-tag size="mini" type="danger" v-else-if="scope.row.examineStatus == 'OK'">通过</el-tag>
-                <el-tag size="mini" type="danger" v-else-if="scope.row.examineStatus == 'FAIL'">不通过</el-tag>
-                <el-tag size="mini" type="danger" v-else>审核</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column align="center" label="操作" fixed="right" min-width="160" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <template v-if="scope.row.examineStatus == 'SAVE'">
-                  <el-popconfirm
-                    title="确定提审吗?"
-                    @onConfirm="handleGetPriceSubmit(scope.row.updPriceBillId)"
-                    style="margin-right: 10px"
-                  >
-                    <el-button type="text" slot="reference">提审</el-button>
-                  </el-popconfirm>
-                </template>
-                <template v-if="scope.row.examineStatus == 'WAIT'">
-                  <el-button type="text" class="textColor" @click="approvalFn(scope.row.updPriceBillId)"
-                    >审批</el-button
-                  >
-                </template>
-                <el-button
-                  v-if="scope.row.examineStatus == 'SAVE'"
-                  type="text"
-                  class="textColor"
-                  @click="editFn(scope.row.updPriceBillId, scope.row)"
-                  >编辑</el-button
-                >
-                <el-button type="text" class="textColor" @click="detailFn(scope.row.updPriceBillId)">详情</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <!-- 分页 -->
-        <div class="fr">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal"
-          >
-          </el-pagination>
-        </div>
-      </div>
-    </div>
-    <ModifyListApply v-else-if="show === 2 || show == 5" :cid="cid" />
-    <ModifyListApproval v-else-if="show === 3" :detail="detail" />
-    <ModifyListDetail v-else :detail="detail" />
-    <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
-  </div>
+    <Popu v-if="show !== 1">
+      <!-- <el-page-header slot="head" :content="content" @back="handleClose" /> -->
+      <ModifyListApply v-if="show === 2 || show == 5" :cid="cid" :show="show" @back="handleClose" />
+      <ModifyListApproval v-if="show === 3" :detail="detail" @back="handleClose" />
+      <ModifyListDetail v-if="show === 4" :detail="detail" @back="handleClose" />
+    </Popu>
+  </template-page>
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import Popu from '@/components/template/popu.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
 import ModifyListApply from './components/modify_list-apply.vue'
 import ModifyListApproval from './components/modify_list-approval.vue'
 import ModifyListDetail from './components/modify_list-detail.vue'
 import ExamineDialog from '@/components/Common/examine-dialog'
-import Mixin from '@/mixin/index'
+// import Mixin from '@/mixin/index'
 import {
   getPriceSubmit,
   getProductRricedel,
   getProductRriceDetail,
   getProductRriceList,
   getTypeList,
-  examineData
+  examineData,
+  v2ProductUpdPriceList,
+  v2ProductUpdPriceListExport,
+  productUpdPriceDownload,
+  productUpdPriceMaterialImport
 } from '@/api/basic_data/material'
-import { downloadFiles, handleImport } from '@/utils/util'
+// import { downloadFiles, handleImport } from '@/utils/util'
 import { getCategoryList } from '@/api/common'
 
 export default {
-  mixins: [Mixin],
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
+      handleClose: this.addOff(() => {
+        if (this.show === 2 || this.show === 5) {
+          this.cid = ''
+          this.show = 1
+        }
+        this.show = 1
+        this.$refs.pageRef.refreshList()
+      }),
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.addFn()
+              })
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                this.hanleDeleteAll()
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量审批',
+              click: async () => {
+                this.batchExamine()
+              }
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '',
+              render: this.importButton(productUpdPriceMaterialImport, '导入', {
+                billType: 'GENERAL'
+              })
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '导入模版',
+              click: () => {
+                productUpdPriceDownload({}, `${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: [],
+
+      //
       baseURL: '',
       importFileList: [],
       importLoading: false,
@@ -495,7 +212,9 @@ export default {
     ExamineDialog,
     ModifyListApply,
     ModifyListApproval,
-    ModifyListDetail
+    ModifyListDetail,
+    TemplatePage,
+    Popu
   },
   computed: {
     exParams() {
@@ -533,6 +252,81 @@ export default {
     })
   },
   methods: {
+    // 列表请求函数
+    getList: v2ProductUpdPriceList,
+    // 列表导出函数
+    exportList: v2ProductUpdPriceListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        console.log(row)
+        return (
+          <div class="operation-btns">
+            {row.examineStatus == '保存' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleGetPriceSubmit(row.updPriceBillId)
+                }}
+                title="是否确定需要提审该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  提审
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.examineStatus == '待审核' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.approvalFn(row.updPriceBillId)
+                }}
+                title="是否确定需要审批该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  审批
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.examineStatus == '保存' ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.editFn(row.updPriceBillId, row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : (
+              ''
+            )}
+
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.detailFn(row.updPriceBillId)
+              }}
+            >
+              详情
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     formatterType(row) {
       for (let i = 0; i < this.typeList.length; i++) {
         if (this.typeList[i].id == row.saleTypeId) {
@@ -543,17 +337,28 @@ export default {
     addFn() {
       this.show = 2
     },
+    hanleDeleteAllPromise(id) {
+      return new Promise((resolve, reject) => {
+        const ids = id ? [id] : this.recordSelected.map(v => v.updPriceBillId)
+        if (!ids.length) {
+          this.$errorMsg('请选择删除内容')
+          return
+        }
+        resolve(ids)
+      })
+    },
     hanleDeleteAll(id) {
       this.hanleDeleteAllPromise(id).then(ids => {
         getProductRricedel(ids).then(res => {
           this.$successMsg('删除成功')
-          this.getList()
+          // this.getList()
+          this.$refs.pageRef.refreshList()
         })
       })
     },
     // 打开 批量审批
     batchExamine() {
-      if (this.ids.length) {
+      if (this.recordSelected.length) {
         this.isShowExamineDialog = true
         return
       }
@@ -564,7 +369,7 @@ export default {
       // let ids = this.dis.map(item => {
       //   return item
       // });
-      const ids = [...new Set(this.ids)]
+      const ids = [...new Set(this.recordSelected.map(v => v.updPriceBillId))]
       examineData({
         ids: ids.join(','),
         examineStatus: this.examineForm.status,
@@ -572,14 +377,16 @@ export default {
       }).then(res => {
         this.isShowExamineDialog = false
         this.$successMsg('修改成功')
-        this.getList()
+        // this.getList()
+        this.$refs.pageRef.refreshList()
       })
     },
     handleGetPriceSubmit(id) {
       console.log(id)
       getPriceSubmit({ ids: id }).then(res => {
         this.$successMsg('已提审')
-        this.getList()
+        // this.getList()
+        this.$refs.pageRef.refreshList()
       })
     },
     approvalFn(id) {
@@ -595,26 +402,26 @@ export default {
         this.show = 4
       })
     },
-    getList() {
-      this.listLoading = true
-      console.log(456654)
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        startDate: this.screenForm.startDate,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        saleTypeId: this.screenForm.saleTypeId,
-        k3CategoryNumber: this.screenForm.k3CategoryNumber,
-        specification: this.screenForm.specification
-      }
-      getProductRriceList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-    },
+    // getList() {
+    //   this.listLoading = true
+    //   console.log(456654)
+    //   let params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     materialName: this.screenForm.materialName,
+    //     materialNumber: this.screenForm.materialNumber,
+    //     startDate: this.screenForm.startDate,
+    //     materialOldNumber: this.screenForm.materialOldNumber,
+    //     saleTypeId: this.screenForm.saleTypeId,
+    //     k3CategoryNumber: this.screenForm.k3CategoryNumber,
+    //     specification: this.screenForm.specification
+    //   }
+    //   getProductRriceList(params).then(res => {
+    //     this.dataList = res.data.records
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    // },
     editFn(id, row) {
       this.cid = id
       this.show = 5

+ 177 - 270
src/views/basic_data/material/price_list.vue

@@ -1,247 +1,80 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料编码" prop="materialNumber">
-                  <el-input v-model="screenForm.materialNumber" placeholder="请输入物料编码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="materialName">
-                  <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品编码" prop="materialOldNumber">
-                  <el-input v-model="screenForm.materialOldNumber" placeholder="请输入产品编码" />
-                </el-form-item>
-              </el-col>
-              <!--          <el-col :xs="24" :sm="12" :lg="6">-->
-              <!--            <el-form-item label="生效日期" prop="startDate">-->
-              <!--              <el-date-picker-->
-              <!--                v-model="screenForm.startDate"-->
-              <!--                type="datetime"-->
-              <!--                placeholder="请输入生效日期"-->
-              <!--                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="endDate">-->
-              <!--              <el-date-picker-->
-              <!--                v-model="screenForm.endDate"-->
-              <!--                type="datetime"-->
-              <!--                placeholder="请输入生效日期"-->
-              <!--                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="saleTypeId">
-                  <el-select v-model="screenForm.saleTypeId" filterable placeholder="选择销售类型" style="width: 100%">
-                    <el-option label="全部" value="" />
-                    <el-option v-for="item in ztypeList" :key="item.id" :label="item.saleName" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品类别" prop="k3CategoryNumber">
-                  <el-select v-model="screenForm.k3CategoryNumber" style="width: 100%" placeholder="请选择产品类别">
-                    <el-option label="全部" value="" />
-                    <el-option v-for="item in dictList" :label="item.name" :value="item.number" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="规格型号" prop="specification">
-                  <el-input v-model="screenForm.specification" placeholder="请输入规格型号" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="备注" prop="specification">
-                  <el-input v-model="screenForm.remark" placeholder="请输入备注" />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div>
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          confirm-button-text="好的"
-          cancel-button-text="不用了"
-          icon="el-icon-info"
-          icon-color="red"
-          title="内容确定删除吗?"
-          @onConfirm="handleDelete"
-        >
-          <el-button type="primary" size="mini" icon="el-icon-delete" slot="reference" class="el-popover-left"
-            >删除</el-button
-          >
-        </el-popconfirm>
-        <el-button type="primary" style="margin-left: 10px" size="mini" @click="handleRevokeAll">批量作废</el-button>
-        <!--        <el-button type="primary" size="mini">导出</el-button>-->
-        <!-- <el-button type="primary" size="mini">打印</el-button> -->
-      </div>
-      <div class="fl"></div>
-    </div>
-    <div class="mymain-container">
-      <!-- 列表 -->
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          :row-class-name="tableRowClassName"
-          @select-all="hanleSelectAll"
-          @select="hanleSelectAll"
-        >
-          <el-table-column type="selection" align="left" width="50"></el-table-column>
-          <!--          <el-table-column type="selection" align="left" />-->
-          <!-- <el-table-column
-            align="left"
-            label="产品类别"
-            prop="mainName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column> -->
-          <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.materialNumber" />
-              <span>{{ scope.row.materialNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.materialOldNumber" />
-              <span>{{ scope.row.materialOldNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品名称" prop="materialName" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.materialName" />
-              <span>{{ scope.row.materialName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.specification" />
-              <span>{{ scope.row.specification }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip />
-          <el-table-column align="left" label="单位" prop="unit" min-width="160" show-overflow-tooltip />
-          <el-table-column align="left" label="数量下限" prop="qty" min-width="160" show-overflow-tooltip />
-          <el-table-column align="left" label="返利类型(钱包)" prop="wallets" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <template v-for="(item, index) in scope.row.wallets">
-                <template v-if="item.type === 'REBATE'">
-                  <el-tag :key="index" type="success" style="margin: 0 10px" size="mini">
-                    {{ item.walletName }}
-                  </el-tag>
-                </template>
-              </template>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="现金钱包"
-            prop="modifyPriceDepartment"
-            min-width="200"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <template v-for="(item, index) in scope.row.wallets">
-                <template v-if="item.type === 'COMMONLY'">
-                  <el-tag :key="index" type="success" style="margin: 0 10px" size="mini">
-                    {{ item.walletName }}
-                  </el-tag>
-                </template>
-              </template>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="生效日期" prop="startDate" min-width="160" show-overflow-tooltip />
-
-          <el-table-column align="left" label="失效日期" prop="endDate" min-width="160" show-overflow-tooltip />
-          <el-table-column align="left" label="是否销价" prop="isPromote" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" v-if="scope.row.isPromote" type="success">是</el-tag>
-              <el-tag size="mini" v-else type="danger">否</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="是否作废" prop="isRevoke" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" v-if="scope.row.isRevoke" type="success">是</el-tag>
-              <el-tag size="mini" v-else type="danger">否</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column align="right" label="批发价1" prop="batchPrice" min-width="160" show-overflow-tooltip />
-          <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="160" show-overflow-tooltip />
-          <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
-          <el-table-column fixed="left" width="150" label="操作" align="center">
-            <template slot-scope="scope">
-              <el-popconfirm
-                v-if="!scope.row.isRevoke"
-                style="margin-right: 10px"
-                title="作废吗?"
-                @onConfirm="handleRevoke(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" size="mini">作废</el-button>
-              </el-popconfirm>
-
-              <el-button
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                type="text"
-                size="mini"
-                @click="handleDelete(scope.row.id)"
-                >删除</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <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>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
-import { getProductDelete, getProductPriceList, getTypeList, handlePriceRevoke } from '@/api/basic_data/material'
+// import Mixin from '@/mixin/index'
+
+import TemplatePage from '@/components/template/template-page-1.vue'
+import {
+  getProductDelete,
+  getProductPriceList,
+  getTypeList,
+  handlePriceRevoke,
+  v2ProductPriceList,
+  v2ProductPriceListExport
+} from '@/api/basic_data/material'
 import { getCategoryList } from '@/api/common'
 
 export default {
-  mixins: [Mixin],
+  components: { TemplatePage },
+  mixins: [],
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                this.handleDelete()
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量作废',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要作废的数据')
+                  return
+                }
+                this.handleRevokeAll()
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      //待删除
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -263,61 +96,135 @@ export default {
     }
   },
   mounted() {
-    getCategoryList({ pageNum: 1, pageSize: -1 }).then(res => {
-      this.dictList = res.data.records
-      console.log(this.dictList, 777777)
-    })
+    // getCategoryList({ pageNum: 1, pageSize: -1 }).then(res => {
+    //   this.dictList = res.data.records
+    //   console.log(this.dictList, 777777)
+    // })
   },
   methods: {
+    // 列表请求函数
+    getList: v2ProductPriceList,
+    // 列表导出函数
+    exportList: v2ProductPriceListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {row.isRevoke === '否' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleRevoke(row.id)
+                }}
+                title="是否确定需要作废该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  作废
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleDelete(row.id)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     addFn() {
       this.showDialogForm = true
     },
 
+    hanleDeleteAllPromise(id) {
+      return new Promise((resolve, reject) => {
+        const ids = id
+          ? [id]
+          : this.recordSelected.map(v => {
+              return v.id
+            })
+        if (!ids.length) {
+          this.$errorMsg('请选择删除内容')
+          return
+        }
+        resolve(ids)
+      })
+    },
+
     handleDelete(id) {
       this.hanleDeleteAllPromise(id).then(ids => {
         getProductDelete(ids).then(res => {
           this.$successMsg('删除成功')
-          this.getList()
+          // this.getList()
+          this.$refs.pageRef.refreshList()
         })
       })
     },
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        k3CategoryNumber: this.screenForm.k3CategoryNumber,
-        endDate: this.screenForm.endDate,
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        saleTypeId: this.screenForm.saleTypeId,
-        specification: this.screenForm.specification,
-        startDate: this.screenForm.startDate,
-        remark: this.screenForm.remark
-      }
-      getProductPriceList(params).then(res => {
-        this.dataList = res.data.records
-        console.log(res.data.records)
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      getTypeList({ ...params, pageNum: 1, pageSize: -1 }).then(res => {
-        this.ztypeList = res.data.records
-        // console.log(this.ztypeList, "type1111");
-      })
-    },
+    // getList() {
+    //   this.listLoading = true
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     k3CategoryNumber: this.screenForm.k3CategoryNumber,
+    //     endDate: this.screenForm.endDate,
+    //     materialName: this.screenForm.materialName,
+    //     materialNumber: this.screenForm.materialNumber,
+    //     materialOldNumber: this.screenForm.materialOldNumber,
+    //     saleTypeId: this.screenForm.saleTypeId,
+    //     specification: this.screenForm.specification,
+    //     startDate: this.screenForm.startDate,
+    //     remark: this.screenForm.remark
+    //   }
+    //   getProductPriceList(params).then(res => {
+    //     this.dataList = res.data.records
+    //     console.log(res.data.records)
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    //   getTypeList({ ...params, pageNum: 1, pageSize: -1 }).then(res => {
+    //     this.ztypeList = res.data.records
+    //     // console.log(this.ztypeList, "type1111");
+    //   })
+    // },
     handleRevoke(id) {
       handlePriceRevoke({ ids: id }).then(res => {
         this.$successMsg('操作成功')
-        this.getList()
+        // this.getList()
+        this.$refs.pageRef.refreshList()
       })
     },
     handleRevokeAll() {
-      if (this.ids.length) {
-        handlePriceRevoke({ ids: this.ids.join('') }).then(res => {
+      if (this.recordSelected.length) {
+        handlePriceRevoke({
+          ids: this.recordSelected
+            .map(v => {
+              return v.id
+            })
+            .toString()
+        }).then(res => {
           this.$successMsg('操作成功')
-          this.getList()
+          // this.getList()
+          this.$refs.pageRef.refreshList()
         })
       } else {
         this.$errorMsg('请选择')

+ 152 - 376
src/views/basic_data/material/relation_list.vue

@@ -1,251 +1,14 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="name">
-                  <el-input placeholder="请输入产品名称" v-model="screenForm.name"></el-input>
-                  <!--
-                  <el-select placeholder="请选择产品类别" v-model="screenForm.name">
-                  <el-option label="默认" value=""></el-option>
-                    <el-option
-                      v-for="item in materialLis"
-                      :label="item.name"
-                      :value="item.name"
-                      :key="item.id"
-                    ></el-option>
-                  </el-select> -->
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品型号" prop="type">
-                  <el-input placeholder="请输入产品型号" v-model="screenForm.type"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="套机编码" prop="number">
-                  <el-input placeholder="请输入套机编码" v-model="screenForm.number"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品体积" prop="volume">
-                  <el-input placeholder="请输入产品体积" v-model="screenForm.volume"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="外机名称" prop="outsideName">
-                  <el-input placeholder="请输入外机名称" v-model="screenForm.outsideName"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="外机型号" prop="nickname">
-                  <el-input placeholder="请输入外机型号" v-model="screenForm.outsideType"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="外机编码" prop="outsideNumber">
-                  <el-input placeholder="请输入内机编码" v-model="screenForm.outsideNumber"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="内机名称" prop="innerName">
-                  <el-input placeholder="请输入内机名称" v-model="screenForm.innerName"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="内机型号" prop="innerType">
-                  <el-input placeholder="请输入内机型号" v-model="screenForm.innerType"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="内机编码" prop="innerNumber">
-                  <el-input placeholder="请输入内机编码" v-model="screenForm.innerNumber"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click=";(showDialogForm = true), (type = 1), hanleMachine()"
-          >新增</el-button
-        >
-
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          confirm-button-text="好的"
-          cancel-button-text="不用了"
-          icon="el-icon-info"
-          icon-color="red"
-          title="内容确定删除吗?"
-          @onConfirm="hanleDelete"
-        >
-          <el-button type="primary" size="mini" icon="el-icon-delete" slot="reference" class="el-popover-left"
-            >删除</el-button
-          >
-        </el-popconfirm>
-      </div>
-      <div class="fr">
-        <el-button type="primary" size="mini">导入</el-button>
-        <el-button type="primary" size="mini" @click="handleExport">导出</el-button>
-        <!-- <el-button type="primary" @click="hanlePrint" size="mini"
-          >打印</el-button
-        > -->
-      </div>
-    </div>
-    <div class="mymain-container">
-      <!-- 列表 -->
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          @select-all="hanleSelectAll"
-          @select="hanleSelectAll"
-          stripe
-        >
-          <el-table-column type="selection" align="left"></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" />
-              <span>{{ scope.row.materialName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品型号" prop="productModel" min-width="160" show-overflow-tooltip>
-            <!--            <template slot-scope="scope">-->
-            <!--              <CopyButton :copyText="scope.row.productModel" />-->
-            <!--              <span>{{scope.row.productModel}}</span>-->
-            <!--            </template>-->
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="套机编码"
-            prop="composeNumber"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="right"
-            label="体积"
-            prop="productVolume"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="内机编码"
-            prop="innerMachineNumber"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="外机编码"
-            prop="outsideMachineNumber"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="配件1"
-            prop="parts1"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="配件2"
-            prop="parts2"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建人"
-            prop="createBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-
-          <el-table-column
-            align="left"
-            label="更新人"
-            prop="updateBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新时间"
-            prop="updateTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-
-          <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-button
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                type="text"
-                class="textColor"
-                @click="editFn(scope.row.id, scope.row, scope.$index)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                confirm-button-text="好的"
-                cancel-button-text="不用了"
-                icon="el-icon-info"
-                icon-color="red"
-                title="内容确定删除吗?"
-                @onConfirm="hanleDelete(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :operation="operation()"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="产品信息"
@@ -316,15 +79,18 @@
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click=";(showDialogForm = false), resetInfo()">取 消</el-button>
+        <el-button @click="handleClose">取 消</el-button>
         <el-button type="primary" @click="hanleInfo">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
+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 { downloadFiles } from '@/utils/util'
 import {
   getDistList,
@@ -334,13 +100,72 @@ import {
   getProductDel,
   getProductDetail,
   getProductEdit,
-  getProductList
+  getProductListV2,
+  exportProductListV2
 } from '@/api/basic_data/material'
-
 export default {
-  mixins: [Mixin],
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
+      visible: false,
+      // 事件组合
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.showDialogForm = true
+                this.type = 1
+
+                this.hanleMachine()
+              }),
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let ids = this.recordSelected.map(v => {
+                  return v.id
+                })
+                let params = { ids: ids.join() }
+                await getProductDel(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ]
+        // [
+        //   [
+        //     {
+        //       name: '导入',
+        //       render: this.importButton(importCustomerPtV2)
+        //     }
+        //   ]
+        // ],
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -389,64 +214,7 @@ export default {
         type: ''
       },
       showDialogForm: false,
-      dataList: [
-        {
-          name: '新风机',
-          number: 'DSAFSAF232312321',
-          code: 'DSAFSAF232312321',
-          volume: '23M^3',
-          inCode: 'DSAFSAF232312321',
-          outCode: 'DSAFSAF232312321',
-          partsOne: '',
-          partsTwo: '',
-          create: 'admin',
-          createDate: '2022-09-12',
-          update: 'admin',
-          updateDate: '2022-09-12'
-        },
-        {
-          name: '新风机',
-          number: 'DSAFSAF232312321',
-          code: 'DSAFSAF232312321',
-          volume: '23M^3',
-          inCode: 'DSAFSAF232312321',
-          outCode: 'DSAFSAF232312321',
-          partsOne: '',
-          partsTwo: '',
-          create: 'admin',
-          createDate: '2022-09-12',
-          update: 'admin',
-          updateDate: '2022-09-12'
-        },
-        {
-          name: '新风机',
-          number: 'DSAFSAF232312321',
-          code: 'DSAFSAF232312321',
-          volume: '23M^3',
-          inCode: 'DSAFSAF232312321',
-          outCode: 'DSAFSAF232312321',
-          partsOne: '',
-          partsTwo: '',
-          create: 'admin',
-          createDate: '2022-09-12',
-          update: 'admin',
-          updateDate: '2022-09-12'
-        },
-        {
-          name: '新风机',
-          number: 'DSAFSAF232312321',
-          code: 'DSAFSAF232312321',
-          volume: '23M^3',
-          inCode: 'DSAFSAF232312321',
-          outCode: 'DSAFSAF232312321',
-          partsOne: '',
-          partsTwo: '',
-          create: 'admin',
-          createDate: '2022-09-12',
-          update: 'admin',
-          updateDate: '2022-09-12'
-        }
-      ],
+      dataList: [],
       screenForm: {
         innerName: '',
         innerNumber: '',
@@ -476,10 +244,66 @@ export default {
       machineConfigureId: ''
     }
   },
-  mounted() {
+  created() {
     this.getMaterMacList()
   },
   methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getProductListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportProductListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                type="text"
+                size="mini"
+                class="textColor"
+                onClick={() => {
+                  this.editFn(row.id, row, index)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : null}
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                confirm-button-text="好的"
+                cancel-button-text="不用了"
+                icon="el-icon-info"
+                icon-color="red"
+                
+                title="内容确定删除吗?"
+                onOnConfirm={() => this.hanleDelete(row.id)}
+              >
+                <el-button slot="reference"  size="mini" type="text" class="textColor el-popover-left">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.showDialogForm = false
+        this.resetInfo()
+      })()
+    },
     hanleAddData() {
       this.diaLogForm.items.push({
         id: '',
@@ -558,28 +382,7 @@ export default {
         }
       })
     },
-    getList() {
-      this.listLoading = true
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        innerName: this.screenForm.innerName,
-        innerNumber: this.screenForm.innerNumber,
-        innerType: this.screenForm.innerType,
-        name: this.screenForm.name,
-        number: this.screenForm.number,
-        outsideName: this.screenForm.outsideName,
-        outsideNumber: this.screenForm.outsideNumber,
-        outsideType: this.screenForm.outsideType,
-        type: this.screenForm.type,
-        volume: this.screenForm.volume
-      }
-      getProductList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-    },
+
     editFn(id, row, index) {
       console.log(row, '45465')
       let dateils = null
@@ -603,46 +406,19 @@ export default {
         dateils = res.data
         console.log(dateils)
         this.diaLogForm.materialId = dateils.materialId
-        this.materialLis.find(k => {
-          if (k.id == dateils.materialId) {
-            console.log(k, '5555')
-            this.diaLogForm.productModel = k.specification
-            this.diaLogForm.productNumber = k.number
-            this.diaLogForm.productVolume = k.volume
-          }
-        })
+        this.materialLis.length &&
+          this.materialLis.find(k => {
+            if (k.id == dateils.materialId) {
+              console.log(k, '5555')
+              this.diaLogForm.productModel = k.specification
+              this.diaLogForm.productNumber = k.number
+              this.diaLogForm.productVolume = k.volume
+            }
+          })
 
         getDistList({ sysDictEnum: 'MACHINE_CONFIGURE' }).then(disType => {
-          // disType.data.find((q) => {
-          //   if (q.dictCode == dateils.items[0].type) {
-          //     this.diaLogForm.type = q.dictCode;
-          //     this.getMachineLlist(q.dictCode);
-          //     this.machineList.map((l) => {
-          //     console.log(l.id == dateils.items[0].machineConfigureId);
-          //       if (l.id == dateils.items[0].machineConfigureId) {
-          //         this.$set(this.diaLogForm.items, 0, {
-          //           id: "",
-          //           machineConfigureId: l.id,
-          //           parentId: "",
-          //           innerOutsideMachineId: l.id,
-          //           model: l.model,
-          //           name: l.name,
-          //           number: l.number || "",
-          //           type: l.type,
-          //           volume: l.volume,
-          //         });
-          //         return;
-          //       }
-          //     });
-          //   }
-          // });
-
           this.DistType = disType.data
         })
-
-        //  const machineObj =   this.getMachineLlist(dateils.items[0].type)
-        console.log(this.diaLogForm, 'lll')
-
         this.showDialogForm = true
       })
     },
@@ -653,26 +429,26 @@ export default {
         getProductAdd({ ...this.diaLogForm }).then(res => {
           this.$successMsg('保存成功')
           this.resetInfo()
-          this.getList()
+          this.$refs.pageRef.refreshList()
         })
       } else if (this.type === 2) {
         const params = { ...this.diaLogForm }
         getProductEdit(params).then(res => {
           this.$successMsg('编辑成功')
           this.resetInfo()
-          this.getList()
+          this.$refs.pageRef.refreshList()
         })
       }
 
       this.showDialogForm = false
     },
     hanleDelete(id) {
-      this.hanleDeleteAllPromise(id).then(ids => {
-        getProductDel({ ids: ids.join(',') }).then(res => {
+    
+        getProductDel({ ids: id }).then(res => {
           this.$successMsg('删除成功')
-          this.getList()
+          this.$refs.pageRef.refreshList()
         })
-      })
+     
     },
     handleExport() {
       let screenData = {

+ 74 - 300
src/views/basic_data/stock/Issue_list.vue

@@ -1,323 +1,97 @@
 <template>
-  <!--  退料单-->
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="单据编号" prop="billNo">
-                  <el-input v-model="screenForm.billNo" placeholder="请输入单据编号" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="materialName">
-                  <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料编码" prop="materialNumber">
-                  <el-input v-model="screenForm.materialNumber" placeholder="请输入物料编码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="日期" prop="date">
-                  <el-date-picker
-                    v-model="screenForm.date"
-                    type="datetimerange"
-                    :default-time="['00:00:00','23:59:59']"
-
-                    range-separator="至"
-                    style="width: 100%"
-                    value-format="yyyy-MM-dd HH:mm:ss"
-                    start-placeholder="开始日期"
-                    end-placeholder="结束日期"
-                  />
-                </el-form-item>
-              </el-col>
-              <!--          <el-col :xs="24" :sm="12" :lg="6">-->
-              <!--            <el-form-item label="货主" prop="company">-->
-              <!--              <el-input-->
-              <!--                v-model="screenForm.company"-->
-              <!--                placeholder="请输入供货单位"-->
-              <!--              />-->
-              <!--            </el-form-item>-->
-              <!--          </el-col>-->
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="仓库" prop="correspondId">
-                  <el-select
-                    v-model="screenForm.correspondId"
-                    multiple
-                    style="width: 100%"
-                    placeholder="请选择仓库"
-                    size="mini"
-                    filterable
-                    clearable
-                  >
-                    <el-option
-                      v-for="(item, index) in warehouseList"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="mymain-container">
-      <div class="btn-group clearfix">
-        <!--        <div class="fr">-->
-        <!--          <ExportButton-->
-        <!--            :ex-url="'admin/user/mch/export'"-->
-        <!--            :ex-params="exParams"-->
-        <!--          />-->
-        <!--        </div>-->
-      </div>
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-          show-summary
-          :summary-method="$getSummaries"
-        >
-          <el-table-column label="序号" align="left" width="50" type="index" show-overflow-tooltip></el-table-column>
-
-          <el-table-column align="left" label="单据编号" prop="billNo" min-width="130" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.billNo" />
-              <span>{{ scope.row.billNo }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="库存方向" prop="stockId" min-width="100" show-overflow-tooltip>
-            <template v-slot="scope">
-              {{ '普通' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="退料日期" prop="fdate" min-width="120" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.fdate | dateToDayFilter }}
-            </template>
-          </el-table-column>
-
-          <el-table-column align="left" label="单据状态" prop="fdDocumentStatus" min-width="120" show-overflow-tooltip>
-            <template v-slot="scope">
-              {{ scope.row.fdDocumentStatus === 'C' ? '已审核' : '' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="入库类型" min-width="100" show-overflow-tooltip>
-            <template v-slot="scope">
-              {{ '其他入库' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="200" 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="materialNumber" min-width="200" 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="materialName" min-width="200" 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="specification" min-width="300" 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="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="left" label="收货仓库" prop="stockName" min-width="100" show-overflow-tooltip>
-          </el-table-column>
-
-          <el-table-column align="center" label="操作" width="100" fixed="right">
-            <template slot-scope="scope">
-              <el-popconfirm title="弃审吗?" @onConfirm="handleUnapprove(scope.row.id, scope.row.billNo)">
-                <el-button slot="reference" type="text">弃审</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </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>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+  >
+   
+  </template-page>
 </template>
 
 <script>
-import { getOtherStockInList, setApprovalPurchaseOrderIn } from '@/api/supply/purchase'
+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 { getOtherStockInListV2, setApprovalPurchaseOrderIn, exportOtherStockInListV2 } from '@/api/supply/purchase'
 import { getWarehouseList } from '@/api/supply/apply'
-
 export default {
-  name: 'MaterialList',
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: null, // 列表数据
-      listLoading: false, // 列表加载loading
-      screenForm: {
-        billNo: '',
-        correspondId: [],
-        endTime: '',
-        materialName: '',
-        date: [],
-        materialNumber: '',
-        materialOldNumber: '',
-        specification: '',
-        startTime: ''
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        //  [
+        //     [
+        //       {
+        //         name: '导入',
+        //         render: this.importButton(importCustomerV2)
+        //       }
+        //     ]
+        //   ],
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       },
-      isCollapse: true,
-      warehouseList: []
-    }
-  },
-  computed: {
-    exParams() {
-      return {
-        billNo: this.screenForm.billNo,
-        correspondId: this.screenForm.correspondId.join(','),
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : ''
-      }
-    },
-    isShowDetail() {
-      // eslint-disable-next-line no-prototype-builtins
-      return this.queryItem.hasOwnProperty('id')
+      recordSelected: [],
+
+      detailsId: ''
     }
   },
-  created() {
-    this.getWarehouseList()
-    this.getList()
-  },
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getOtherStockInListV2(...p)
     },
-    // 获取仓库列表
-    getWarehouseList() {
-      getWarehouseList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.warehouseList = res.data.records
-      })
+    // 列表导出函数
+    exportList: exportOtherStockInListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-    handleUnapprove(id, billNo) {
-      setApprovalPurchaseOrderIn({ id, billNo }).then(res => {
-        this.$successMsg('弃审成功')
-        this.getList()
-      })
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-    // 查询列表
-    getList() {
-      this.listLoading = true
-
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        billNo: this.screenForm.billNo,
-        correspondId: this.screenForm.correspondId.join(','),
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : ''
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-popconfirm title="弃审吗?" onOnConfirm={() => this.handleUnapprove(row.id, row.billNo)}>
+              <el-button slot="reference" type="text" size="mini">
+                弃审
+              </el-button>
+            </el-popconfirm>
+          </div>
+        )
       }
-      getOtherStockInList(params).then(res => {
-        res.data.records.forEach(item => {
-          item.sums1 = ['auxUnitQty']
-          item.sums2 = ['taxPrice', 'amount', 'entryTaxAmount', 'allAmount']
-        })
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-    },
-
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
     },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
-    },
-
-    // 进入详情
-    toDetail(item) {
-      this.queryItem = item
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     },
-
-    backList() {
-      this.queryItem = {}
+    handleUnapprove(id, billNo) {
+      setApprovalPurchaseOrderIn({ id, billNo }).then(res => {
+        this.$successMsg('弃审成功')
+        this.$refs.pageRef.refreshList()
+      })
     }
   }
 }
 </script>
 
-<style scoped></style>
+<style lang="scss" scoped></style>

+ 73 - 265
src/views/basic_data/stock/material_list.vue

@@ -1,183 +1,51 @@
 <template>
-  <!--  退料单-->
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="单据编号" prop="billNo">
-                  <el-input v-model="screenForm.billNo" placeholder="请输入单据编号" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="materialName">
-                  <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料编码" prop="materialNumber">
-                  <el-input v-model="screenForm.materialNumber" placeholder="请输入物料编码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="退料日期" prop="date">
-                  <el-date-picker
-                    v-model="screenForm.date"
-                    type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
-                    range-separator="至"
-                    style="width: 100%"
-                    value-format="yyyy-MM-dd HH:mm:ss"
-                    start-placeholder="开始日期"
-                    end-placeholder="结束日期"
-                  />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="供应商" prop="supplierName">
-                  <el-input v-model="screenForm.supplierName" placeholder="请输入供货单位" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="仓库" prop="correspondId">
-                  <el-select
-                    v-model="screenForm.correspondId"
-                    multiple
-                    style="width: 100%"
-                    placeholder="请选择仓库"
-                    size="mini"
-                    filterable
-                    clearable
-                  >
-                    <el-option
-                      v-for="(item, index) in warehouseList"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="mymain-container">
-      <!--      <div class="btn-group clearfix">-->
-      <!--        <div class="fr">-->
-      <!--          <ExportButton-->
-      <!--            :ex-url="'admin/user/mch/export'"-->
-      <!--            :ex-params="exParams"-->
-      <!--          />-->
-      <!--        </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 label="序号" align="left" width="50" type="index" show-overflow-tooltip></el-table-column>
-
-          <el-table-column align="left" label="单据编号" prop="billNo" min-width="130" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.billNo" />
-              <span>{{ scope.row.billNo }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="退料日期" prop="fdate" min-width="150" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="供货商" prop="supplierName" min-width="200" show-overflow-tooltip />
-          <el-table-column align="left" label="单据状态" prop="fdDocumentStatus" min-width="120" show-overflow-tooltip>
-            <template v-slot="scope">
-              {{ scope.row.fdDocumentStatus === 'C' ? '已审核' : '' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="200" 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="materialNumber" min-width="200" 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="materialName" min-width="200" 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="materialName" min-width="300" 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="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 align="right" label="仓库" prop="stockName" min-width="100" show-overflow-tooltip />
-          <!--          <el-table-column-->
-          <!--            align="right"-->
-          <!--            label="开票状态"-->
-          <!--            prop="taxPrice"-->
-          <!--            min-width="120"-->
-          <!--            show-overflow-tooltip-->
-          <!--          >-->
-          <!--            <template slot-scope="scope">-->
-          <!--              {{ scope.row.taxPrice | numToFixed }}-->
-          <!--            </template>-->
-          <!--          </el-table-column>-->
-          <el-table-column align="center" label="操作" width="100" fixed="right">
-            <template slot-scope="scope">
-              <el-popconfirm title="弃审吗?" @onConfirm="handleUnapprove(scope.row.id, scope.row.billNo)">
-                <el-button slot="reference" type="text">弃审</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </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>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+  >
+  </template-page>
 </template>
 
 <script>
-import { getPurchaseOutList, setApprovalPurchaseOrderOut } from '@/api/supply/purchase'
+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 { getPurchaseOutListV2, setApprovalPurchaseOrderOut, exportPurchaseOutListV2 } from '@/api/supply/purchase'
 import { getWarehouseList } from '@/api/supply/apply'
-
+import { thisExpression } from '@babel/types'
 export default {
-  name: 'MaterialList',
+  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: [],
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -199,37 +67,39 @@ export default {
       warehouseList: []
     }
   },
-  computed: {
-    exParams() {
-      return {
-        billNo: this.screenForm.billNo,
-        correspondId: this.screenForm.correspondId.join(','),
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        supplierName: this.screenForm.supplierName
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getPurchaseOutListV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportPurchaseOutListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-popconfirm title="弃审吗?" onOnConfirm={() => this.handleUnapprove(row.id, row.billNo)}>
+              <el-button slot="reference" type="text" size="mini">
+                弃审
+              </el-button>
+            </el-popconfirm>
+          </div>
+        )
       }
     },
-    isShowDetail() {
-      // eslint-disable-next-line no-prototype-builtins
-      return this.queryItem.hasOwnProperty('id')
-    }
-  },
-  created() {
-    this.getWarehouseList()
-    this.getList()
-  },
-  methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     },
     // 获取仓库列表
     getWarehouseList() {
@@ -243,73 +113,11 @@ export default {
     handleUnapprove(id, billNo) {
       setApprovalPurchaseOrderOut({ id, billNo }).then(res => {
         this.$successMsg('弃审成功')
-        this.getList()
-      })
-    },
-    // 查询列表
-    getList() {
-      this.listLoading = true
-
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        billNo: this.screenForm.billNo,
-        correspondId: this.screenForm.correspondId.join(','),
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        supplierName: this.screenForm.supplierName
-      }
-      getPurchaseOutList(params).then(res => {
-        res.data.records.forEach(item => {
-          item.sums1 = ['auxUnitQty']
-          item.sums2 = ['taxPrice', 'amount', 'entryTaxAmount', 'allAmount']
-        })
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
+        this.$refs.pageRef.refreshList()
       })
-    },
-
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
-    },
-
-    // 进入详情
-    toDetail(item) {
-      this.queryItem = item
-    },
-
-    backList() {
-      this.queryItem = {}
     }
   }
 }
 </script>
 
-<style scoped></style>
+<style lang="scss" scoped></style>

+ 62 - 234
src/views/basic_data/stock/product_list.vue

@@ -1,254 +1,82 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="90px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料代码" prop="materialNumber">
-                  <el-input v-model="screenForm.materialNumber" placeholder="请输入物料代码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品编码" prop="materialOldNumber">
-                  <el-input v-model="screenForm.materialOldNumber" placeholder="请输入产品编码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="materialName">
-                  <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="规格型号" prop="specification">
-                  <el-input v-model="screenForm.specification" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="仓库" prop="correspondId">
-                  <el-select
-                    v-model="screenForm.correspondId"
-                    multiple
-                    style="width: 100%"
-                    placeholder="请选择仓库"
-                    size="mini"
-                    filterable
-                    clearable
-                  >
-                    <el-option
-                      v-for="(item, index) in warehouseList"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="存货类别" prop="categoryId">
-                  <el-select
-                    v-model="screenForm.categoryId"
-                    style="width: 100%"
-                    placeholder="选择存货类别"
-                    filterable
-                    clearable
-                    multiple
-                  >
-                    <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-
-              <el-col :xs="24" :sm="12" :lg="12" class="tr">
-                <el-form-item>
-                  <el-button @click="resetScreenForm">清空</el-button>
-                  <el-button type="primary" @click="submitScreenForm">搜索</el-button>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="mymain-container">
-      <div class="btn-group clearfix">
-        <div>
-          <ExportButton :ex-url="'/stock/manager/exportStockToDay'" :ex-params="exParams" />
-        </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="仓库" prop="correspondName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="存货类别" prop="categoryName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="物料代码" prop="materialNumber" min-width="150" 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="150" 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="materialName" min-width="200" 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="specification" min-width="300" 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="right" label="可用数量" prop="stockAdequate" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="开单未提数量" prop="num" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="结存数量" prop="balanceNumber" min-width="100" show-overflow-tooltip />
-        </el-table>
-      </div>
-    </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>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+  >
+  </template-page>
 </template>
 
 <script>
-import { getListStockToDay } from '@/api/stock'
-import { getCategoryList } from '@/api/common'
-import { getWarehouseList } from '@/api/supply/apply'
+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 { getListStockToDayV2, exportListStockToDayV2 } from '@/api/stock'
 
 export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: null, // 列表数据
-      listLoading: false, // 列表加载loading
-      screenForm: {
-        categoryId: [],
-        correspondId: [],
-        materialName: '',
-        materialNumber: '',
-        materialOldNumber: '',
-        specification: ''
-      },
-      typeList: [],
-      warehouseList: [],
-      categoryList: [],
-      isCollapse: true
-    }
-  },
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
 
-  computed: {
-    exParams() {
-      return {
-        categoryId: this.screenForm.categoryId.join(','),
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
-      }
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
     }
   },
-  created() {
-    this.getList()
-  },
   methods: {
-    getList() {
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        categoryId: this.screenForm.categoryId.join(','),
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
-      }
-      this.listLoading = true
-      getListStockToDay(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      this.getWarehouseList()
-      this.getCategoryList()
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListStockToDayV2(...p)
     },
-    // 获取仓库列表
-    getWarehouseList() {
-      getWarehouseList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.warehouseList = res.data.records
-      })
+    // 列表导出函数
+    exportList: exportListStockToDayV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-
-    // 获取存货类别列表
-    getCategoryList() {
-      getCategoryList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.categoryList = res.data.records
-      })
-    },
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+    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>
+        )
+      }
     },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     }
   }
 }
 </script>
+
+<style lang="scss" scoped></style>

+ 79 - 222
src/views/basic_data/stock/product_list_customer.vue

@@ -1,246 +1,103 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="90px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料代码" prop="materialNumber">
-                  <el-input v-model="screenForm.materialNumber" placeholder="请输入物料代码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品编码" prop="materialOldNumber">
-                  <el-input v-model="screenForm.materialOldNumber" placeholder="请输入产品编码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="materialName">
-                  <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="规格型号" prop="specification">
-                  <el-input v-model="screenForm.specification" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="仓库" prop="correspondId">
-                  <el-select
-                    v-model="screenForm.correspondId"
-                    multiple
-                    style="width: 100%"
-                    placeholder="请选择仓库"
-                    size="mini"
-                    filterable
-                    clearable
-                  >
-                    <el-option
-                      v-for="(item, index) in warehouseList"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="存货类别">
-                  <el-select
-                    v-model="screenForm.categoryId"
-                    style="width: 100%"
-                    placeholder="选择存货类别"
-                    filterable
-                    clearable
-                  >
-                    <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="mymain-container">
-      <div class="btn-group clearfix">
-        <div>
-          <ExportButton :ex-url="'/stock/manager/exportStockToDay'" :ex-params="exParams" />
-        </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="仓库" prop="correspondName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="存货类别" prop="categoryName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="物料代码" prop="materialNumber" min-width="150" 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="150" 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="materialName" min-width="200" 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="specification" min-width="300" 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="right" label="可用数量" prop="stockAdequate" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="开单未提数量" prop="num" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="结存数量" prop="balanceNumber" min-width="100" show-overflow-tooltip />
-        </el-table>
-      </div>
-    </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>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+  >
+  </template-page>
 </template>
 
 <script>
-import { getListStockToDay } from '@/api/stock'
-import { getCategoryList } from '@/api/common'
-import { getWarehouseList } from '@/api/supply/apply'
+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 { getListStockToDayCustomerV2, exportListStockToDayCustomerV2 } from '@/api/stock'
 
 export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: null, // 列表数据
-      listLoading: false, // 列表加载loading
-      screenForm: {
-        categoryId: '',
-        correspondId: [],
-        materialName: '',
-        materialNumber: '',
-        materialOldNumber: '',
-        specification: ''
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       },
-      typeList: [],
-      warehouseList: [],
-      categoryList: [],
-      isCollapse: true
+      recordSelected: []
     }
   },
-
   computed: {
-    exParams() {
-      return {
-        categoryId: this.screenForm.categoryId,
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
+    filterNumber() {
+      return num => {
+        num = Number(num)
+        if (num <= 0) {
+          return '无货'
+        } else if (num >= 1 && num <= 50) {
+          return num
+        } else {
+          return '有货'
+        }
       }
     }
   },
-  created() {
-    this.getList()
-  },
   methods: {
-    getList() {
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        categoryId: this.screenForm.categoryId,
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
-      }
-      this.listLoading = true
-      getListStockToDay(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      this.getWarehouseList()
-      this.getCategoryList()
-    },
-    // 获取仓库列表
-    getWarehouseList() {
-      getWarehouseList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.warehouseList = res.data.records
-      })
-    },
-
-    // 获取存货类别列表
-    getCategoryList() {
-      getCategoryList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.categoryList = res.data.records
-      })
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListStockToDayCustomerV2(...p)
     },
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
+    // 列表导出函数
+    exportList: exportListStockToDayCustomerV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.colName === 'open_number') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div>{this.filterNumber(row.openNumber)}</div>
+          )
+        }
+      }
+      return defaultData
     },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+    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>
+        )
+      }
     },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     }
   }
 }
 </script>
+
+<style lang="scss" scoped></style>

+ 73 - 292
src/views/basic_data/stock/warehousing_list.vue

@@ -1,316 +1,97 @@
 <template>
-  <!--  退料单-->
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="单据编号" prop="billNo">
-                  <el-input v-model="screenForm.billNo" placeholder="请输入单据编号" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="materialName">
-                  <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料编码" prop="materialNumber">
-                  <el-input v-model="screenForm.materialNumber" placeholder="请输入物料编码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="日期" prop="date">
-                  <el-date-picker
-                    v-model="screenForm.date"
-                    type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
-                    range-separator="至"
-                    style="width: 100%"
-                    value-format="yyyy-MM-dd HH:mm:ss"
-                    start-placeholder="开始日期"
-                    end-placeholder="结束日期"
-                  />
-                </el-form-item>
-              </el-col>
-              <!--          <el-col :xs="24" :sm="12" :lg="6">-->
-              <!--            <el-form-item label="货主" prop="company">-->
-              <!--              <el-input-->
-              <!--                v-model="screenForm.company"-->
-              <!--                placeholder="请输入供货单位"-->
-              <!--              />-->
-              <!--            </el-form-item>-->
-              <!--          </el-col>-->
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="仓库" prop="correspondId">
-                  <el-select
-                    v-model="screenForm.correspondId"
-                    multiple
-                    style="width: 100%"
-                    placeholder="请选择仓库"
-                    size="mini"
-                    filterable
-                    clearable
-                  >
-                    <el-option
-                      v-for="(item, index) in warehouseList"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="mymain-container">
-      <div class="btn-group clearfix">
-        <!--        <div class="fr">-->
-        <!--          <ExportButton-->
-        <!--            :ex-url="'admin/user/mch/export'"-->
-        <!--            :ex-params="exParams"-->
-        <!--          />-->
-        <!--        </div>-->
-      </div>
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-          show-summary
-          :summary-method="$getSummaries"
-        >
-          <el-table-column label="序号" align="left" width="50" type="index" show-overflow-tooltip></el-table-column>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+  >
 
-          <el-table-column align="left" label="库存方向" prop="billNo" min-width="120" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ '普通' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="单据状态" prop="fdDocumentStatus" min-width="120" show-overflow-tooltip>
-            <template v-slot="scope">
-              {{ scope.row.fdDocumentStatus === 'C' ? '已审核' : '' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="业务类型" prop="fdate" min-width="120" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ '物料领用' }}
-            </template>
-          </el-table-column>
-
-          <el-table-column align="left" label="单据编号" prop="billNo" min-width="200" show-overflow-tooltip />
-          <el-table-column align="left" label="日期" prop="fdate" min-width="150" show-overflow-tooltip />
-          <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="200" 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="materialNumber" min-width="200" 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="200" 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="specification" min-width="300" 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="100" show-overflow-tooltip />
-          <el-table-column align="left" label="实发数量" prop="qty" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="发货仓库" prop="stockName" min-width="100" show-overflow-tooltip />
-          <!--          <el-table-column-->
-          <!--            align="left"-->
-          <!--            label="货主"-->
-          <!--            prop="uom"-->
-          <!--            min-width="100"-->
-          <!--            show-overflow-tooltip-->
-          <!--          />-->
-          <el-table-column align="center" label="操作" width="100" fixed="right">
-            <template slot-scope="scope">
-              <el-popconfirm title="弃审吗?" @onConfirm="handleUnapprove(scope.row.id, scope.row.billNo)">
-                <el-button slot="reference" type="text">弃审</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </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>
+  </template-page>
 </template>
 
 <script>
-import { getOtherStockOutList, setApprovalOtherStockOut } from '@/api/supply/purchase'
+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 { getListOtherStockOutV2, setApprovalPurchaseOrderIn, exportListOtherStockOutV2 } from '@/api/supply/purchase'
 import { getWarehouseList } from '@/api/supply/apply'
-
 export default {
-  name: 'MaterialList',
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: null, // 列表数据
-      listLoading: false, // 列表加载loading
-      screenForm: {
-        billNo: '',
-        correspondId: [],
-        endTime: '',
-        date: [],
-        materialName: '',
-        materialNumber: '',
-        materialOldNumber: '',
-        specification: '',
-        startTime: ''
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        //  [
+        //     [
+        //       {
+        //         name: '导入',
+        //         render: this.importButton(importCustomerV2)
+        //       }
+        //     ]
+        //   ],
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       },
-      isCollapse: true,
-      warehouseList: []
-    }
-  },
-  computed: {
-    exParams() {
-      return {
-        billNo: this.screenForm.billNo,
-        correspondId: this.screenForm.correspondId.join(','),
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : ''
-      }
-    },
-    isShowDetail() {
-      // eslint-disable-next-line no-prototype-builtins
-      return this.queryItem.hasOwnProperty('id')
+      recordSelected: [],
+
+      detailsId: ''
     }
   },
-  created() {
-    this.getWarehouseList()
-    this.getList()
-  },
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListOtherStockOutV2(...p)
     },
-    // 获取仓库列表
-    getWarehouseList() {
-      getWarehouseList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.warehouseList = res.data.records
-      })
+    // 列表导出函数
+    exportList: exportListOtherStockOutV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-    handleUnapprove(id, billNo) {
-      setApprovalOtherStockOut({ id, billNo }).then(res => {
-        this.$successMsg('弃审成功')
-        this.getList()
-      })
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-    // 查询列表
-    getList() {
-      this.listLoading = true
-
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        billNo: this.screenForm.billNo,
-        correspondId: this.screenForm.correspondId.join(','),
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : ''
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-popconfirm title="弃审吗?" onOnConfirm={() => this.handleUnapprove(row.id, row.billNo)}>
+              <el-button slot="reference" type="text" size="mini">
+                弃审
+              </el-button>
+            </el-popconfirm>
+          </div>
+        )
       }
-      getOtherStockOutList(params).then(res => {
-        res.data.records.forEach(item => {
-          item.sums1 = ['auxUnitQty']
-          item.sums2 = ['taxPrice', 'amount', 'entryTaxAmount', 'allAmount']
-        })
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-    },
-
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
     },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
-    },
-
-    // 进入详情
-    toDetail(item) {
-      this.queryItem = item
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     },
-
-    backList() {
-      this.queryItem = {}
+    handleUnapprove(id, billNo) {
+      setApprovalPurchaseOrderIn({ id, billNo }).then(res => {
+        this.$successMsg('弃审成功')
+        this.$refs.pageRef.refreshList()
+      })
     }
   }
 }
 </script>
 
-<style scoped></style>
+<style lang="scss" scoped></style>

+ 3 - 3
src/views/basic_data/supplier/components/supplier_list-detail.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="sty">
-      <el-page-header @back="goBack" content="详情页面"> </el-page-header>
+      <el-page-header @back="onClose" content="详情页面"> </el-page-header>
     </div>
     <el-form :model="infoList" label-width="130px" size="small" label-position="right">
       <el-card class="">
@@ -370,8 +370,8 @@ export default {
   },
   created() {},
   methods: {
-    goBack() {
-      this.$parent.isShow = true
+    onClose() {
+      this.$emit('close')
     }
   }
 }

+ 67 - 144
src/views/basic_data/supplier/supplier_list.vue

@@ -1,170 +1,93 @@
 <template>
-  <div class="app-container">
-    <div v-if="isShow">
-      <!-- 筛选条件 -->
-      <Collapse :screen-form="searchForm" screenFnName="searchFn">
-        <template #right_btn>
-          <el-button size="mini" @click="clearFn">清空</el-button>
-          <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="searchForm" :model="searchForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="名称" prop="name">
-                  <el-input v-model="searchForm.name" placeholder="请输入名称"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-      <div></div>
-
-      <!-- 表格 -->
-      <div class="mymain-container">
-        <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="编码"
-              prop="number"
-              min-width="60"
-              label-class-name="bianma"
-              class-name="fontstyle"
-            >
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.number" />
-                <span>{{ scope.row.number }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="使用组织" prop="useOrgName" min-width="160"></el-table-column>
-            <el-table-column align="left" label="名称" prop="name" min-width="200">
-              <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.name" />
-                <span>{{ scope.row.name }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="简称" prop="shortName" min-width="160"> </el-table-column>
-            <el-table-column align="left" label="供应商分组" prop="groupName" min-width="160"></el-table-column>
-            <el-table-column
-              align="center"
-              label="操作"
-              prop="caozuo"
-              min-width="160"
-              show-overflow-tooltip
-              fixed="right"
-            >
-              <template slot-scope="scope">
-                <el-button type="text" class="textColor" @click="editFn(scope.row.id)">详情</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-
-        <div class="fr">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal"
-          >
-          </el-pagination>
-        </div>
-      </div>
-    </div>
-    <SupplierListDetail :infoList="infoList" v-else />
-  </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :operation="operation()"
+    :columnParsing="columnParsing"
+  >
+    <Popu v-if="visible">
+      <supplier-list-detail :infoList="infoList"  @close="handleClose"/>
+    </Popu>
+  </template-page>
 </template>
 
 <script>
-import { getList, getInfoApi } from '@/api/basic_data/supplier'
+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 { getListV2,exportListV2,getInfoApi } from '@/api/basic_data/supplier'
 import SupplierListDetail from './components/supplier_list-detail.vue'
-
 export default {
+  components: { TemplatePage, Popu, SupplierListDetail },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
 
-      listLoading: false, // 加载
-      screenForm: {}, // 筛选表单数据
-      dataList: [], // 表格数据
-
-      isShow: true,
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
       searchForm: {
         // 筛选表单数据
         name: ''
       },
-      dataList: [],
       infoList: {},
-      isCollapse: true
     }
   },
-
-  components: {
-    SupplierListDetail
-  },
-
-  async created() {
-    await this.getList()
-  },
   methods: {
-    //搜索功能
-    async searchFn() {
-      await this.getList()
-    },
-    //重置
-    clearFn() {
-      this.$refs.searchForm.resetFields()
-    },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.getList()
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListV2(...p)
     },
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
+    // 列表导出函数
+    exportList: exportListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-    async editFn(id) {
-      this.isShow = false
-      const res = await getInfoApi({ id })
-      this.infoList = res.data
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-    async getList() {
-      let params = {
-        name: this.searchForm.name,
-        pageNum: this.currentPage,
-        pageSize: this.pageSize
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.visible = true
+                const res = await getInfoApi({ id:row.id })
+                this.infoList = res.data
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
       }
-      let res = await getList(params)
-      this.dataList = res.data.records
-      this.listTotal = res.data.total
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     }
   }
 }
 </script>
 
-<style lang="scss" scoped>
-.base {
-  padding: 20px;
-}
-.fr {
-  margin-top: 20px;
-}
-</style>
+<style lang="scss" scoped></style>

+ 118 - 146
src/views/basic_data/taker/taker_car.vue

@@ -1,145 +1,15 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="searchForm">
-        <template #right_btn>
-          <el-button size="mini" @click="clearFn">清空</el-button>
-          <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form :model="searchForm" ref="searchForm" label-width="100px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商名称" prop="customerName">
-                  <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="车牌" prop="carBrand">
-                  <el-input v-model="searchForm.carBrand" placeholder="请输入车牌"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          class="add-right"
-          @click="addDataList"
-          >新增</el-button
-        >
-
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          class="delClass"
-          @onConfirm="delFn"
-          title="这是一段内容确定删除吗?"
-        >
-          <el-button :disabled="ids.length < 1" slot="reference" type="danger" icon="el-icon-minus" size="mini"
-            >批量删除</el-button
-          >
-        </el-popconfirm>
-      </div>
-      <div class="fr">
-        <ExportButton :exUrl="'take-car-record/export'" :exParams="exParams" />
-      </div>
-    </div>
-    <!-- 列表 -->
-    <div class="mymain-container">
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          @select="hanleSelect"
-          @select-all="hanleSelect"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column type="selection" align="center" min-width="51"></el-table-column>
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="车辆车牌号"
-            prop="carBrand"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建者"
-            prop="createBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="150"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新者"
-            prop="updateBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新时间"
-            prop="updateTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip fixed="right">
-            <template slot-scope="scope">
-              <el-button type="text" v-if="$checkBtnRole('edit', $route.meta.roles)" @click="editFn(scope.row)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                @onConfirm="delFn(scope.row.id)"
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                title="这是一段内容确定删除吗?"
-              >
-                <el-button type="text" slot="reference">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
-
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :operationColumnWidth="200"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="提货车辆档案"
@@ -186,17 +56,68 @@
         <el-button type="primary" @click="addDataListFn">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import { getCarList, addDataListApi, delCarFn, editDataListApi } from '@/api/basic_data/taker'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import {
+  getCarList,
+  addDataListApi,
+  delCarFn,
+  editDataListApi,
+  v2TakerCarRecordList,
+  v2TakerCarRecordListExport
+} from '@/api/basic_data/taker'
 import { getDealerList } from '@/api/basic_data/dealer'
 import { downloadFiles } from '@/utils/util'
 
 export default {
+  components: {
+    TemplatePage
+  },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {
+                this.addDataList()
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                this.delFn()
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       listLoading: false, // 列表加载loading
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -250,6 +171,55 @@ export default {
     this.getDealerDataList({ pageNum: 1, pageSize: 10 })
   },
   methods: {
+    // 列表请求函数
+    getList: v2TakerCarRecordList,
+    // 列表导出函数
+    exportList: v2TakerCarRecordListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.delFn(row.id)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.editFn(row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     // 筛选部分数据或者单个
     hanleSelect(selection) {
       // this.ids = selection.map((k) => {
@@ -305,13 +275,14 @@ export default {
         let res = arr.toString()
         await delCarFn({ ids: res })
       } else {
-        let res = this.ids.toString()
+        let res = this.recordSelected.map(v => v.id).toString()
         await delCarFn({ ids: res })
       }
 
       this.$message.success('删除成功')
       this.ids = []
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
     },
     //获取经销商数据
     async getDealerDataList(data) {
@@ -353,7 +324,8 @@ export default {
       //   carBrand: "",
       // };
       await this.$refs.addForm.resetFields()
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
       this.dialogForm = false
     },
     //获取列表数据

+ 130 - 166
src/views/basic_data/taker/taker_list.vue

@@ -1,161 +1,16 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="searchForm">
-        <template #right_btn>
-          <el-button size="mini" @click="clearFn">清空</el-button>
-          <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商名称" prop="customerName">
-                  <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="提货人姓名" prop="takerName">
-                  <el-input v-model="searchForm.takerName" placeholder="请输入提货人姓名"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="电话" prop="phoneKeyword">
-                  <el-input v-model="searchForm.phoneKeyword" placeholder="请输入电话"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button v-if="$checkBtnRole('add', $route.meta.roles)" type="primary" size="mini" @click="addFn"
-          >新增</el-button
-        >
-      </div>
-      <div class="fr">
-        <ExportButton :exUrl="'taker-record/export'" :exParams="exParams" />
-      </div>
-    </div>
-    <!-- 列表 -->
-    <div class="mymain-container">
-      <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="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="提货人姓名"
-            prop="takerName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="身份证"
-            prop="identity"
-            min-width="170"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="联系电话"
-            prop="phone"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="备用电话"
-            prop="sparePhone"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="有效期"
-            prop="expireTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建人"
-            prop="createBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="状态" prop="flag" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" type="success" v-if="scope.row.flag === 1">有效</el-tag>
-              <el-tag size="mini" type="danger" v-else-if="scope.row.flag === 2">失效</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="center"
-            label="操作"
-            prop="caozuo"
-            min-width="160"
-            show-overflow-tooltip
-            fixed="right"
-          >
-            <template slot-scope="scope">
-              <el-button type="text" class="textColor" @click="seeFn(scope.row)">查看</el-button>
-              <el-popconfirm
-                @onConfirm="deleFn(scope.row.id)"
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                title="这是一段内容确定删除吗?"
-              >
-                <el-button type="text" class="textColor" slot="reference">删除</el-button>
-              </el-popconfirm>
-              <el-button type="text" class="textColor" @click="stopFn(scope.row.id)" v-if="scope.row.flag === 1"
-                >停用</el-button
-              >
-              <el-button type="text" class="textColor" @click="rebuild(scope.row)" v-else-if="scope.row.flag === 2"
-                >重建</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
-
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :operationColumnWidth="200"
+    :replaceOrNotMap="false"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="提货人档案"
@@ -240,18 +95,28 @@
         <el-button v-if="showOK" type="primary" @click="addDataFn">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
 import { mapGetters } from 'vuex'
-import { getList, addDataList, getCodeApi, stopTaker, deleDataList } from '@/api/basic_data/taker'
+import {
+  getList,
+  addDataList,
+  getCodeApi,
+  stopTaker,
+  deleDataList,
+  v2TakerRecordList,
+  v2TakerRecordListExport
+} from '@/api/basic_data/taker'
 import { getDealerList } from '@/api/basic_data/dealer'
 import { downloadFiles } from '@/utils/util'
 import fileUpload from '@/components/Common/file-upload.vue'
 export default {
   components: {
-    fileUpload
+    fileUpload,
+    TemplatePage
   },
   computed: {
     ...mapGetters(['customerId', 'customerName']),
@@ -265,6 +130,31 @@ export default {
   },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {
+                this.addFn()
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       baseURL: process.env.VUE_APP_BASE_API,
       isCollapse: true,
       fileList: [],
@@ -289,7 +179,7 @@ export default {
       rules: {
         customerId: [{ required: false, message: '请选择经销商', trigger: 'blur' }],
         takerName: [{ required: true, message: '请输入提货人姓名', trigger: 'blur' }],
-    
+
         phone: [
           {
             required: true,
@@ -328,11 +218,82 @@ export default {
     }
   },
   created() {
-    this.getDataList()
-
+    // this.getDataList()
     // await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
   },
   methods: {
+    // 列表请求函数
+    getList: v2TakerRecordList,
+    // 列表导出函数
+    exportList: v2TakerRecordListExport,
+    // 表格列解析渲染数据更改
+    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={async () => {
+                this.seeFn(row)
+              }}
+            >
+              查看
+            </el-button>
+
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.deleFn(row.id)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.flag === 1 ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.stopFn(row.id)
+                }}
+              >
+                停用
+              </el-button>
+            ) : (
+              ''
+            )}
+            {row.flag === 2 ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.rebuild(row)
+                }}
+              >
+                重建
+              </el-button>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     //重建
     rebuild(data) {
       this.showOK = true
@@ -354,7 +315,8 @@ export default {
     async deleFn(ids) {
       await deleDataList({ ids })
       this.$message.success('删除成功')
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
     },
     //查看
     seeFn(data) {
@@ -398,7 +360,8 @@ export default {
     async stopFn(id) {
       await stopTaker({ id })
       this.$message.success('成功')
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
     },
     //获取验证码
     async getCodeFn() {
@@ -498,7 +461,8 @@ export default {
       //   code: "",
       // };
       this.count = 0
-      this.getDataList()
+      // this.getDataList()
+      this.$refs.pageRef.refreshList()
       this.dialogForm = false
     },
     addFn() {

+ 55 - 0
src/views/basic_data/wallet/wallet_list.vue

@@ -136,13 +136,44 @@
       </div>
     </el-dialog>
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+    
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+
 import { getWalletList, getProductCategory, getWalletBiandMain, getWalletDetail } from '@/api/basic_data/wallet_list'
 export default {
+  components: {
+    TemplatePage
+  },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      //
       listLoading: false, // 列表加载loading
       searchForm: {
         walletName: '',
@@ -169,6 +200,30 @@ export default {
     // this.getCategoryList();
   },
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    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={async () => {}}>
+              详情
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     //确定
     async btnOK() {
       console.log(this.addForm)

+ 13 - 8
src/views/basic_data/warehouse/components/warehouse_list-detail.vue

@@ -2,7 +2,7 @@
   <div>
     <el-form label-width="120px" :inline="false" size="small" label-position="left">
       <div class="sty">
-        <el-page-header @back="goBack" content="详情页面"> </el-page-header>
+        <el-page-header @back="onClose" content="详情页面"> </el-page-header>
       </div>
       <el-card class="box-card">
         <div slot="header" class="clearfix">
@@ -264,13 +264,20 @@ export default {
     detail: {
       type: Object,
       default: {},
-      isReadonly: true
+    }
+  },
+  data() {
+    return {
+      isReadonly: false
     }
   },
   computed: {
     stockStatusType() {
       let typeStr = ''
-      const typeArr = this.detail.stockStatusType.split(',')
+      let typeArr =[]
+      if (this.detail&& typeof this.detail.stockStatusType ==  'string' ) {
+         typeArr = this.detail.stockStatusType &&  this.detail.stockStatusType.split(',')
+      }
       for (let i = 0; i < typeArr.length; i++) {
         switch (typeArr[i]) {
           case '1':
@@ -302,14 +309,12 @@ export default {
             break
         }
       }
-      console.log(typeStr)
       return typeStr
     }
   },
   methods: {
-    goBack() {
-      console.log(this.$parent)
-      this.$parent.isShow = true
+    onClose() {
+      this.$emit('close')
     },
     setStock() {
       setStock({
@@ -318,7 +323,7 @@ export default {
         id: this.detail.id
       }).then(res => {
         this.$successMsg('保存成功')
-        this.$parent.isShow = true
+        this.onClose()
       })
     }
   }

+ 155 - 179
src/views/basic_data/warehouse/warehouse_cost.vue

@@ -1,142 +1,14 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="120px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商名称" prop="customerName">
-                  <el-input placeholder="请输入经销商名称" v-model="screenForm.customerName"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          type="primary"
-          size="mini"
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          icon="el-icon-plus"
-          @click=";(showDialog = true), (type = 1)"
-          >新增</el-button
-        >
-
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          confirm-button-text="好的"
-          cancel-button-text="不用了"
-          icon="el-icon-info"
-          icon-color="red"
-          title="内容确定删除吗?"
-          @onConfirm="hanleDelete"
-        >
-          <el-button type="primary" size="mini" icon="el-icon-delete" slot="reference" class="el-popover-left"
-            >批量删除</el-button
-          >
-        </el-popconfirm>
-      </div>
-      <div class="fr">
-        <el-upload
-          class="import-btn"
-          :action="baseURL + 'student/import'"
-          :http-request="handleImport"
-          :file-list="importFileList"
-        >
-          <el-button type="primary" size="mini">导入</el-button>
-        </el-upload>
-        <el-button type="primary" size="mini" @click="handleExport">导出</el-button>
-        <!-- <el-button type="primary" size="mini" @click="hanlePrint"
-          >打印</el-button
-        > -->
-      </div>
-    </div>
-
-    <div class="mymain-container">
-      <!-- 列表 -->
-      <div class="table">
-        <!-- startprint -->
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-          @select-all="hanleSelectAll"
-          @select="hanleSelectAll"
-        >
-          <el-table-column type="selection" align="left" min-width="100" />
-
-          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerNumber" />
-              <span>{{ scope.row.customerNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="right" label="存放免费天数" prop="freeDay" min-width="160" show-overflow-tooltip />
-          <el-table-column align="right" label="收费规则(每立方米)" prop="toll" min-width="160" show-overflow-tooltip />
-          <el-table-column align="left" label="创建人" prop="createBy" min-width="200" show-overflow-tooltip />
-          <el-table-column align="left" label="创建时间" prop="createTime" min-width="200" show-overflow-tooltip />
-          <el-table-column align="left" label="更新人" prop="updateBy" min-width="200" show-overflow-tooltip />
-          <el-table-column align="left" label="更新时间" prop="updateTime" min-width="200" show-overflow-tooltip />
-          <el-table-column align="center" label="操作" fixed="right" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-button
-                type="text"
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                class="textColor"
-                @click="editFn(scope.row.id, scope.row)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                confirm-button-text="好的"
-                cancel-button-text="不用了"
-                icon="el-icon-info"
-                icon-color="red"
-                title="内容确定删除吗?"
-                @onConfirm="hanleDelete(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-        <!-- endprint -->
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
-
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :columnParsing="columnParsing"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="仓库费规则配置"
@@ -187,22 +59,91 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click=";(showDialog = false), kong()">取 消</el-button>
+        <el-button @click="handleClose">取 消</el-button>
         <el-button type="primary" @click="hanleInfo(dialogForm)">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
+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 { downloadFiles, handleImport } from '@/utils/util'
-import { addToll, deleteToll, getCustomerList, getListToll, updateToll } from '@/api/basic_data/warehouse'
+import {
+  addToll,
+  deleteToll,
+  getCustomerList,
+  getListTollV2,
+  updateToll,
+  exportListTollV2,
+  importStockV2
+} from '@/api/basic_data/warehouse'
 
 export default {
-  mixins: [Mixin],
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
+      visible: false,
+      // 事件组合
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.getCustomerList()
+                this.showDialog = true
+                this.type = 1
+              }),
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let ids = this.recordSelected.map(v => {
+                  return v.id
+                })
+                let params = { id: ids.join() }
+                await deleteToll(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '导入',
+              render: this.importButton(importStockV2)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
       dialogForm: {
         id: null,
         customerName: '',
@@ -230,14 +171,9 @@ export default {
         freeDay: '',
         toll: ''
       },
-      type: null, // 1 新增  2 修改  null 详情
-      isCollapse: true
+      type: null // 1 新增  2 修改  null 详情
     }
   },
-  created() {
-    this.getList()
-    this.getCustomerList()
-  },
   directives: {
     'el-select-loadmore': {
       bind(el, binding) {
@@ -260,7 +196,70 @@ export default {
     }
   },
   methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.$refs.pageRef.showTable = false
+      this.recordSelected = []
+      return getListTollV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListTollV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                type="text"
+                size="mini"
+                class="textColor"
+                onClick={() => {
+                  this.getCustomerList()
+                  this.editFn(row.id, row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : null}
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                confirm-button-text="好的"
+                cancel-button-text="不用了"
+                icon="el-icon-info"
+                icon-color="red"
+                title="内容确定删除吗?"
+                onOnConfirm={() => this.hanleDelete(row.id)}
+              >
+                <el-button slot="reference" type="text"  size="mini" class="textColor el-popover-left">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.dialogForm = {
+        customerName: '',
+        customerNumber: '',
+        freeDay: 0,
+        toll: 0
+      }
+      this.addOff(() => {
+        this.showDialog = false
+      })()
+    },
     editFn(id, row) {
+      console.log(row)
       ;(this.dialogForm = {
         id: id,
         customerName: row.customerName,
@@ -278,9 +277,9 @@ export default {
         }
         console.log(params, 78798)
         addToll(params).then(res => {
-          this.getList()
+          this.$refs.pageRef.refreshList()
           this.$successMsg('保存成功')
-          this.kong()
+          this.handleClose()
         })
       } else if (this.type === 2) {
         const paramss = {
@@ -288,28 +287,14 @@ export default {
         }
         updateToll(paramss).then(res => {
           this.$successMsg('编辑成功')
-          this.getList()
-          this.kong()
+          this.$refs.pageRef.refreshList()
+          this.handleClose()
           this.diaLogForm.id = null
         })
       }
       this.showDialog = false
     },
-    getList() {
-      this.listLoading = true
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        customerName: this.screenForm.customerName,
-        freeDay: this.screenForm.freeDay,
-        toll: this.screenForm.toll
-      }
-      getListToll(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-    },
+
     loadmore() {
       this.sleectBox.currentPage++
       this.getCustomerList()
@@ -345,7 +330,7 @@ export default {
     hanleDelete(id) {
       deleteToll({ id }).then(res => {
         this.$successMsg('删除成功')
-        this.getList()
+        this.$refs.pageRef.refreshList()
       })
     },
     // 导入
@@ -362,20 +347,12 @@ export default {
         this.$alert(result.message, '导入成功', {
           confirmButtonText: '确定'
         })
-        this.getList()
+        this.$refs.pageRef.refreshList()
       } else {
         this.$alert(result.message, '导入失败', {
           confirmButtonText: '确定'
         })
       }
-    },
-    kong() {
-      this.dialogForm = {
-        customerName: '',
-        customerNumber: '',
-        freeDay: 0,
-        toll: 0
-      }
     }
   }
 }
@@ -438,4 +415,3 @@ export default {
   padding: 12px;
 }
 </style>
->

+ 72 - 216
src/views/basic_data/warehouse/warehouse_list.vue

@@ -1,235 +1,91 @@
 <template>
-  <div class="app-container">
-    <div v-if="isShow">
-      <!-- 筛选条件 -->
-      <div>
-        <Collapse :screen-form="screenForm">
-          <template #right_btn>
-            <el-button size="mini" @click="resetScreenForm">清空</el-button>
-            <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-          </template>
-          <template #search>
-            <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-              <el-row :gutter="20">
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="名称" prop="name">
-                    <el-input placeholder="请输入名称" v-model="screenForm.name"></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-          </template>
-        </Collapse>
-      </div>
-      <div class="mymain-container">
-        <div class="table">
-          <el-table
-            v-loading="listLoading"
-            :data="dataList"
-            element-loading-text="Loading"
-            border
-            fit
-            highlight-current-row
-            stripe
-          >
-            <!-- <el-table-column
-              type="selection"
-              align="left"
-              min-width="100"
-            ></el-table-column> -->
-            <el-table-column
-              align="left"
-              label="编码"
-              prop="number"
-              min-width="160"
-              show-overflow-tooltip
-              label-class-name="bianma"
-              class-name="fontstyle"
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="名称"
-              prop="name"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="仓库地址"
-              prop="address"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="仓库负责人"
-              prop="principalName"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="仓库属性"
-              prop="stockProperty"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="第三方仓储类型"
-              prop="gysStockNumber"
-              min-width="160"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="数据状态"
-              prop="documentStatus"
-              min-width="100"
-              show-overflow-tooltip
-            ></el-table-column>
-            <el-table-column
-              align="left"
-              label="允许即时库存负库存"
-              prop="allowMinusQty"
-              min-width="150"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.allowMinusQty !== 'false'">是</el-tag>
-                <el-tag size="mini" type="danger" v-else>否</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="启用仓位管理"
-              prop="openLocation"
-              min-width="100"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.openLocation !== 'false'">是</el-tag>
-                <el-tag size="mini" type="danger" v-else>否</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="不参与可发量统计"
-              prop="notExpQty"
-              min-width="150"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.notExpQty !== 'false'">是</el-tag>
-                <el-tag size="mini" type="danger" v-else>否</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="参与预警" prop="availableAlert" min-width="100" show-overflow-tooltip>
-              <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.availableAlert !== 'false'">是</el-tag>
-                <el-tag size="mini" type="danger" v-else>否</el-tag>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="center"
-              label="操作"
-              fixed="right"
-              prop="caozuo"
-              min-width="160"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <el-button type="text" class="textColor" @click="hanleDetail(scope.row.id)">详情</el-button>
-                <!-- <el-button
-                  type="text"
-                  class="textColor"
-                  @click="editFn(scope.row.id, scope.row)"
-                  >编辑</el-button
-                >
-                <el-popconfirm
-                  confirm-button-text="好的"
-                  cancel-button-text="不用了"
-                  icon="el-icon-info"
-                  icon-color="red"
-                  title="内容确定删除吗?"
-                  @onConfirm="hanleDelete(scope.row.id)"
-                >
-                  <el-button
-                    slot="reference"
-                    type="text"
-                    class="textColor el-popover-left"
-                    >删除</el-button
-                  >
-                </el-popconfirm> -->
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <!-- 分页 -->
-        <div class="fr">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal"
-          >
-          </el-pagination>
-        </div>
-      </div>
-    </div>
-    <WarehouseListDetail v-else :detail="detail" />
-  </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :operation="operation()"
+    :columnParsing="columnParsing"
+  >
+    <Popu v-if="visible && detail">
+      <WarehouseListDetail  :detail="detail"  @close="handleClose"/>
+    </Popu>
+  </template-page>
 </template>
 
 <script>
-import { getList, getStockDetail } from '@/api/basic_data/warehouse'
-import Mixin from '@/mixin/index'
+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 { getListV2, exportListV2,getStockDetail } from '@/api/basic_data/warehouse'
 import WarehouseListDetail from './components/warehouse_list-detail.vue'
-
 export default {
-  mixins: [Mixin],
+  components: { TemplatePage, Popu, WarehouseListDetail },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      isShow: true,
-      screenForm: {
-        // 筛选表单数据
-        name: '' // 名称
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       },
+      recordSelected: [],
       detail: {},
-      isCollapse: true
     }
   },
-  components: {
-    WarehouseListDetail
-  },
-
   methods: {
-    editFn() {
-      this.isShow = false
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListV2(...p)
     },
-    getList() {
-      this.listLoading = true
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        name: this.screenForm.name
+    // 列表导出函数
+    exportList: exportListV2,
+    // 表格列解析渲染数据更改
+    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={async () => {
+                this.visible = true
+                getStockDetail({ id:row.id }).then(res => {
+              this.detail = res.data
+            })
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
       }
-      getList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
     },
-    //查看详情
-    hanleDetail(id) {
-      getStockDetail({ id }).then(res => {
-        this.detail = res.data
-      })
-      this.isShow = false
-    }
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    },
+
   }
 }
 </script>
+
+<style lang="scss" scoped></style>

+ 174 - 231
src/views/basic_data/warehouse/warehouse_site.vue

@@ -1,177 +1,14 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="仓库名称" prop="name">
-                  <el-input placeholder="请输入仓库名称" v-model="screenForm.name"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="仓位名称" prop="stockName">
-                  <el-input placeholder="请输入仓位名称" v-model="screenForm.stockName"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="newData(), (type = 1)"
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          >新增</el-button
-        >
-        <el-popconfirm
-          confirm-button-text="好的"
-          cancel-button-text="不用了"
-          icon="el-icon-info"
-          icon-color="red"
-          title="内容确定删除吗?"
-          @onConfirm="handleDeleteAll"
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-        >
-          <el-button slot="reference" type="primary" icon="el-icon-delete" size="mini" class="textColor el-popover-left"
-            >批量删除</el-button
-          >
-        </el-popconfirm>
-      </div>
-    </div>
-    <div class="mymain-container">
-      <!-- 列表 -->
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          @select-all="hanleSelectAll"
-          @select="hanleSelectAll"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column align="left" type="selection" width="55"> </el-table-column>
-          <el-table-column
-            align="left"
-            label="仓库名称"
-            prop="name"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="仓位名称" prop="kingDeeStocks" min-width="400" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <template v-if="scope.row.kingDeeStocks.length > 0">
-                <template v-for="item in scope.row.kingDeeStocks">
-                  <el-tag size="mini" type="danger" style="margin-right: 10px" :key="item" v-if="item">
-                    {{ item?item.name :''}}
-                  </el-tag>
-                </template>
-              </template>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="库存警戒线"
-            prop="stockCordon"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <!-- <el-table-column
-            align="left"
-            label="库存充足"
-            prop="status"
-            min-width="160"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <el-tag type="success" v-if="scope.row.status === 1">充足</el-tag>
-              <el-tag type="danger" v-else>不充足</el-tag>
-            </template>
-          </el-table-column> -->
-          <el-table-column
-            align="left"
-            label="创建人"
-            prop="createBy"
-            min-width="200"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="200"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="更新人"
-            prop="updateBy"
-            min-width="200"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="更新时间" prop="updateTime" min-width="200" show-overflow-tooltip>
-          </el-table-column>
-
-          <el-table-column align="center" fixed="right" label="操作" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <!-- <el-button
-                type="text"
-                class="textColor"
-                @click="hanleDetail(scope.row)"
-                >详情</el-button
-              > -->
-              <el-button
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                type="text"
-                class="textColor"
-                @click="editFn(scope.row.id, scope.row), (type = 2)"
-                >编辑</el-button
-              >
-              <el-popconfirm
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                confirm-button-text="好的"
-                cancel-button-text="不用了"
-                icon="el-icon-info"
-                icon-color="red"
-                title="内容确定删除吗?"
-                @onConfirm="hanleDelete(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
-
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :operation="operation()"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :columnParsing="columnParsing"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="仓库仓位对应关系"
@@ -181,45 +18,104 @@
       :close-on-click-modal="false"
     >
       <el-form ref="diaLogForm" :model="diaLogForm" label-width="70px" size="small" label-position="left">
-        <el-form-item label="仓库名称">
+        <el-form-item label="仓库名称" prop="name">
           <el-input v-model="diaLogForm.name"></el-input>
         </el-form-item>
-        <el-form-item label="仓位名称">
+        <el-form-item label="仓位名称" prop="stockIds">
           <el-select v-model="diaLogForm.stockIds" multiple filterable placeholder="请选择">
             <el-option v-for="item in cList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="库存警戒线">
+        <el-form-item label="库存警戒线" prop="stockCordon">
           <el-input v-model="diaLogForm.stockCordon"></el-input>
         </el-form-item>
         <!-- <el-form-item label="库存状态">
           <el-radio v-model="diaLogForm.status" label="1">充足</el-radio>
           <el-radio v-model="diaLogForm.status" label="2">补充足</el-radio>
         </el-form-item> -->
-        <el-form-item label="备注">
+        <el-form-item label="备注" prop="remark">
           <el-input type="textarea" v-model="diaLogForm.remark"></el-input>
         </el-form-item>
-        <el-form-item label="虚拟仓">
+        <el-form-item label="虚拟仓" prop="type">
           <el-radio v-model="diaLogForm.type" label="2">是</el-radio>
           <el-radio v-model="diaLogForm.type" label="1">否</el-radio>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="showDialogForm = false">取 消</el-button>
+        <el-button @click="onClose">取 消</el-button>
         <el-button type="primary" @click="hanleInfo">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
-import { addStock, deleteStock, getList, getListStock, updateStock } from '@/api/basic_data/warehouse'
-
+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 {
+  addStock,
+  deleteStock,
+  getList,
+  getListStockV2,
+  updateStock,
+  exportListStockV2,
+  getStockDetailStock
+} from '@/api/basic_data/warehouse'
+import { nextTick } from 'process'
 export default {
-  mixins: [Mixin],
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.newData()
+              }),
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let ids = this.recordSelected.map(v => {
+                  return v.id
+                })
+                let params = ids
+                await deleteStock({ id: params.join(',') })
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -266,11 +162,77 @@ export default {
         name: '' // 名称
       },
       type: null,
-      cList: {},
-      isCollapse: true
+      cList: {}
     }
   },
   methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListStockV2(...p)
+    },
+    // 列表导出函数
+    exportList: exportListStockV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={() => {
+                  this.editFn(row.id)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : null}
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                confirm-button-text="好的"
+                cancel-button-text="不用了"
+                icon="el-icon-info"
+                icon-color="red"
+                title="内容确定删除吗?"
+                onOnConfirm={() => {
+                  this.hanleDelete(row.id)
+                }}
+              >
+                <el-button  size="mini" slot="reference" type="text" class="textColor el-popover-left">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    },
+
+    onClose() {
+      this.diaLogForm = {
+        id: null,
+        type: '1',
+        name: '',
+        remark: '',
+        status: 1,
+        stockCordon: 0,
+        stockIds: [],
+        updateBy: '',
+        updateTime: ''
+      }
+      this.addOff(() => {
+        this.showDialogForm = false
+      })()
+    },
     newData() {
       this.showDialogForm = true
       this.type = 1
@@ -285,26 +247,29 @@ export default {
       })
     },
     //显示编辑,编辑数据初始化
-    editFn(id, row) {
-      this.type = 2
-      const arr = []
-      if (row.kingDeeStocks.length > 0) {
-        row.kingDeeStocks.forEach(el => {
-          arr.push(el.id)
-        })
-      }
-      this.newData()
-      console.log(row.type, '444')
-      this.diaLogForm = {
-        id,
-        name: row.name,
-        remark: row.remark,
-        status: row.status,
-        stockCordon: row.stockCordon,
-        type: row.type + '',
-        stockIds: row.stockIds === undefined ? arr : row.stockIds
-      }
-      this.showDialogForm = true
+    editFn(id) {
+      let row
+      getStockDetailStock({ id }).then(res => {
+        row = res.data
+        this.type = 2
+        const arr = []
+        if (row.kingDeeStocks && row.kingDeeStocks.length > 0) {
+          row.kingDeeStocks.forEach(el => {
+            arr.push(el.id)
+          })
+        }
+        this.newData()
+        this.diaLogForm = {
+          id,
+          name: row.name,
+          remark: row.remark,
+          status: row.status,
+          stockCordon: row.stockCordon,
+          type: row.type + '',
+          stockIds: row.stockIds === undefined ? arr : row.stockIds
+        }
+        this.showDialogForm = true
+      })
     },
 
     hanleInfo() {
@@ -313,7 +278,7 @@ export default {
         addStock(this.diaLogForm).then(res => {
           this.$successMsg('保存成功')
           this.showDialogForm = false
-          this.getList()
+          this.$refs.pageRef.refreshList()
         })
       } else if (this.type == 2) {
         const params = {
@@ -322,7 +287,7 @@ export default {
         updateStock(params).then(res => {
           this.$successMsg('编辑成功')
           this.showDialogForm = false
-          this.getList()
+          this.$refs.pageRef.refreshList()
         })
       }
       this.diaLogForm = {
@@ -336,33 +301,11 @@ export default {
         updateTime: ''
       }
     },
-    getList() {
-      this.listLoading = true
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        name: this.screenForm.name,
-        stockName: this.screenForm.stockName
-      }
-      getListStock(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-        console.log(this.dataList, 1233)
-      })
-    },
     // 删除数据
     hanleDelete(id) {
       deleteStock({ id: [id].join('') }).then(res => {
         this.$successMsg('删除成功')
-        this.getList()
-      })
-    },
-    handleDeleteAll() {
-      console.log()
-      deleteStock({ id: this.ids.join(',') }).then(res => {
-        this.$successMsg('删除成功')
-        this.getList()
+        this.$refs.pageRef.refreshList()
       })
     }
   }

+ 487 - 0
src/views/dashboard.vue

@@ -0,0 +1,487 @@
+<template>
+  <popu>
+    <div>
+      <div class="menu-list">
+        <div>
+          <div class="main-title">
+            <div class="title">常用菜单</div>
+            <div class="el-icon-setting" @click="dialogVisible = !dialogVisible" />
+          </div>
+          <div class="child">
+            <el-row :gutter="20">
+              <el-col
+                v-for="(it, idx) in normsMenuList"
+                :key="idx"
+                class="item"
+                :span="4"
+                style="margin-top: 16px; padding: 3px 20px"
+              >
+                <el-link class="link" :underline="false" @click="clickMenu(it.fullUrl)">{{ it.moduleName }}</el-link>
+              </el-col>
+            </el-row>
+          </div>
+        </div>
+        <div v-for="(item, index) in menuList" :key="index" class="group">
+          <div v-if="item.moduleName != '首页'">
+            <div class="main-title">
+              <div class="title">{{ item.moduleName }}</div>
+            </div>
+            <div v-if="item.children && item.children.length" class="child">
+              <el-row :gutter="20">
+                <el-col v-for="(it, idx) in item.children" :key="idx" class="item" :span="4">
+                  <el-link class="link" :underline="false" @click="clickMenu(it.fullUrl)">{{ it.moduleName }}</el-link>
+                </el-col>
+              </el-row>
+            </div>
+            <div v-else class="child">
+              <div class="item">
+                <el-link class="link" :underline="false" @click="clickMenu(item.fullUrl)">{{
+                  item.moduleName
+                }}</el-link>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <!-- 弹窗 -->
+      <el-dialog title="菜单配置" append-to-body :visible.sync="dialogVisible" width="70%">
+        <el-checkbox-group v-model="checkList" :max="10">
+          <div v-for="(item, index) in menuList" :key="index" class="group">
+            <div v-if="item.moduleName != '首页'">
+              <div v-if="item.children && item.children.length" class="dia-child">
+                <el-checkbox v-for="(it, idx) in item.children" :key="idx" :label="it.moduleId" class="dia-item">{{
+                  it.moduleName
+                }}</el-checkbox>
+              </div>
+              <div v-else class="child">
+                <el-checkbox class="dia-item" :label="item.moduleId">{{ item.moduleName }}</el-checkbox>
+              </div>
+            </div>
+          </div>
+        </el-checkbox-group>
+        <div class="dia-tip">( {{ checkList.length }} / 10 )注:最多选10个导航菜单</div>
+        <span slot="footer" class="dialog-footer">
+          <el-button
+            @click="
+              dialogVisible = false
+              checkList = []
+            "
+            >取 消</el-button
+          >
+          <el-button type="primary" @click="handleSaveMenu">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
+  </popu>
+</template>
+
+<script>
+import {
+  getNoticeList,
+  getComListList,
+  getComListDownload,
+  getNoticeDetail,
+  confirmCheck,
+  getRebateOrderList,
+  getRouter,
+  getMenuList,
+  setMenuList,
+  getListInvoiceOrder
+} from '@/api/dashboard'
+import { getArrivalNotice } from '@/api/stock'
+
+import { getListOrderTrack } from '@/api/supply/pickup'
+import { getFileUrl } from '@/api/common'
+import { mapGetters } from 'vuex'
+import popu from '@/components/template/popu.vue'
+export default {
+  name: 'Dashboard',
+  components: {
+    popu
+  },
+  created() {
+    getRouter({
+      flag: 'index',
+      adminUserId: this.userid
+    }).then(res => {
+      this.menuList = res.data
+      console.log(res.data)
+    })
+    this.getMenuList()
+  },
+  computed: {
+    ...mapGetters(['showMessages', 'userid', 'isCustomer'])
+  },
+  data() {
+    return {
+      imageURL: this.$imageUrl,
+      type: '1',
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: [],
+      listLoading: false, // 列表加载loading
+      fileList: [],
+      inDialog: false,
+      detailData: [],
+      rebateList: [],
+      // isCustomer: JSON.parse(localStorage.getItem('supply_user')).isCustomer,
+      menuList: [],
+      dialogVisible: false,
+      checkList: [],
+      normsMenuList: [],
+      invoiceOrderList: [],
+      bol: true,
+      visible: false,
+      orderId: '',
+      logisticsDetail: [],
+      arrivalNoticeList: [],
+      specification: ''
+    }
+  },
+
+  methods: {
+    // 获取常用菜单列表
+    getMenuList() {
+      getMenuList().then(res => {
+        this.normsMenuList = res.data
+        if (this.normsMenuList.length) {
+          this.normsMenuList.forEach(k => {
+            this.checkList.push(k.moduleId)
+          })
+        }
+      })
+    },
+    // 保存常用菜单
+    handleSaveMenu() {
+      setMenuList({ adminModuleIds: this.checkList.join(',') }).then(res => {
+        this.$successMsg('设置成功')
+        this.checkList = []
+        this.getMenuList()
+        this.dialogVisible = false
+      })
+    },
+    // 打开链接
+    openLink(url) {
+      getFileUrl({ key: url }).then(res => {
+        window.open(res.data)
+      })
+    },
+    // 复核
+    secondFn(id) {
+      this.$router.push({
+        path: '/finance/rebate_list',
+        query: {
+          id
+        }
+      })
+
+      this.$store.commit('user/showMessage', 'no')
+    },
+    // 确认查收
+    confirmCheck(id) {
+      confirmCheck({ noticeIds: id }).then(res => {
+        this.$successMsg('查收成功')
+        this.inDialog = false
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          readFlag: false
+        })
+      })
+    },
+    // 检查文件类型
+    checkFileType(url) {
+      if (!url) return ''
+      const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
+
+      if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
+        return 'image'
+      } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
+        return 'word'
+      } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
+        return 'excel'
+      } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
+        return 'ppt'
+      } else if (['pdf'].includes(fileSuffix)) {
+        return 'pdf'
+      } else {
+        return ''
+      }
+    },
+    // 查看
+    async lookInDialog(id) {
+      const res = await getNoticeDetail({ id })
+      // console.log(res, 7898);
+      this.detailData = res.data
+      this.inDialog = true
+    },
+    // 下载
+    async downloadFn(id) {
+      const res = await getComListDownload({ id })
+      if (res.data) {
+        window.open(this.imageURL + res.data)
+      }
+    },
+    // 获取文件列表数据
+    async getFileList(data) {
+      const res = await getComListList(data)
+      this.fileList = res.data.records
+      this.listTotal = res.data.total
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      if (this.type == 1) {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          readFlag: false
+        })
+      }
+      if (this.type == 2) {
+        this.getFileList({
+          needDown: true,
+          pageSize: this.pageSize,
+          pageNo: this.currentPage
+        })
+      }
+      if (this.type == 3) {
+        this.getRebateList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          isSecondExamine: false
+        })
+      }
+      if (this.type == 4) {
+        this.getListInvoiceOrder({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage
+        })
+      }
+      if (this.type == 5) {
+        this.getArrivalNotice({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage
+        })
+      }
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      if (this.type == 1) {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          readFlag: false
+        })
+      }
+      if (this.type == 2) {
+        this.getFileList({
+          needDown: true,
+          pageSize: this.pageSize,
+          pageNo: this.currentPage
+        })
+      }
+      if (this.type == 3) {
+        this.getRebateList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          isSecondExamine: false
+        })
+      }
+      if (this.type == 4) {
+        this.getListInvoiceOrder({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage
+        })
+      }
+      if (this.type == 5) {
+        this.getArrivalNotice({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage
+        })
+      }
+    },
+    // 获取返利确认单数据
+    async getRebateList(data) {
+      const res = await getRebateOrderList(data)
+      this.rebateList = res.data.records
+      this.listTotal = res.data.total
+    },
+    // 获取列表数据
+    async getDataList(data) {
+      const res = await getNoticeList(data)
+      console.log(res)
+      this.dataList = res.data.records
+      this.listTotal = res.data.total
+    },
+    // 获取物流列表
+    async getListInvoiceOrder(data) {
+      const res = await getListInvoiceOrder(data)
+      this.invoiceOrderList = res.data.records
+      this.listTotal = res.data.total
+    },
+    async getArrivalNotice(data) {
+      data = {
+        ...data,
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        specification: this.specification
+      }
+      const res = await getArrivalNotice(data)
+      this.arrivalNoticeList = res.data.records
+      this.listTotal = res.data.total
+    },
+    // 选择
+    checkFn(v) {
+      this.$refs.table.doLayout()
+      this.type = v
+      if (v == 1) {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          readFlag: false
+        })
+      }
+      if (v == 2) {
+        this.getFileList({
+          needDown: true,
+          pageSize: this.pageSize,
+          pageNo: this.currentPage
+        })
+      }
+      if (v == 3) {
+        this.getRebateList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          isSecondExamine: false
+        })
+      }
+      if (v == 4) {
+        this.getListInvoiceOrder({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage
+        })
+      }
+      if (this.type == 5) {
+        this.getArrivalNotice({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage
+        })
+      }
+    },
+    // 关闭
+    closeFn() {
+      this.$store.commit('user/showMessage', 'no')
+    },
+
+    // 点击菜单
+    clickMenu(path) {
+      const curlArr = ['/notice', '/issue']
+      // if (curlArr.includes(path)) {
+      //   path += '/index'
+      // }
+      this.$router.push({
+        path
+      })
+    },
+    handLogistics(row) {
+      getListOrderTrack({ orderId: row.id }).then(res => {
+        this.logisticsDetail = res.data
+      })
+      this.orderId = row.id
+      this.visible = true
+    },
+    onClose() {
+      this.logisticsDetail = []
+      this.orderId = ''
+      this.visible = false
+    },
+    handleJump(id) {
+      this.$router.push({ path: `/supply/pickup/sum_list?id=${id}` })
+      this.$store.commit('user/showMessage', 'no')
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+::v-deep .el-input__inner {
+  /* width: 80px; */
+  font-size: 16px;
+  color: #333333;
+  /* border: 0 !important; */
+}
+.dashboard {
+  &-container {
+    background: #f5f5f5;
+    padding: 30px;
+    min-height: calc(100vh - 86px);
+    .top-container {
+      .today-content {
+        font-size: 14px;
+      }
+    }
+  }
+}
+.cql {
+  ::v-deep.el-table__header-wrapper {
+    background-color: #f5f7fa;
+  }
+}
+.dia-menu-title {
+  padding: 10px 0;
+  color: #000;
+  font-weight: bold;
+}
+.dia-tip {
+  padding: 10px 0;
+  color: #000;
+  font-weight: bold;
+}
+.dia-child {
+  display: flex;
+  flex-wrap: wrap;
+}
+.dia-item {
+  flex: 0 1 220px;
+  padding: 3px 0;
+}
+.menu-list {
+  .main-title {
+    margin: 10px 0 0;
+    .el-icon-setting {
+      cursor: pointer;
+      font-size: 22px;
+    }
+  }
+  .group {
+    margin-bottom: 20px;
+    .child {
+      display: flex;
+      flex-wrap: wrap;
+      padding-left: 10px;
+      .el-row {
+        width: 100%;
+      }
+      .item {
+        margin-top: 16px;
+      }
+    }
+  }
+  ::v-deep .el-link--inner {
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+}
+.logistics-title {
+  padding-bottom: 10px;
+}
+.tip {
+  height: 200px;
+  text-align: center;
+  line-height: 200px;
+}
+</style>

+ 0 - 653
src/views/dashboard/index.vue

@@ -1,653 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="menu-list">
-      <div>
-        <div class="main-title">
-          <div class="title">常用菜单</div>
-          <div class="el-icon-setting" @click="dialogVisible = !dialogVisible" />
-        </div>
-        <div class="child">
-          <el-row :gutter="20">
-            <el-col
-              v-for="(it, idx) in normsMenuList"
-              :key="idx"
-              class="item"
-              :span="4"
-              style="margin-top: 16px; padding: 3px 20px"
-            >
-              <el-link class="link" :underline="false" @click="clickMenu(it.curUrl)">{{ it.moduleName }}</el-link>
-            </el-col>
-          </el-row>
-        </div>
-      </div>
-      <div v-for="(item, index) in menuList" :key="index" class="group">
-        <div v-if="item.moduleName != '首页'">
-          <div class="main-title">
-            <div class="title">{{ item.moduleName }}</div>
-          </div>
-          <div v-if="item.children && item.children.length" class="child">
-            <el-row :gutter="20">
-              <el-col v-for="(it, idx) in item.children" :key="idx" class="item" :span="4">
-                <el-link class="link" :underline="false" @click="clickMenu(it.curUrl)">{{ it.moduleName }}</el-link>
-              </el-col>
-            </el-row>
-          </div>
-          <div v-else class="child">
-            <div class="item">
-              <el-link class="link" :underline="false" @click="clickMenu(item.curUrl)">{{ item.moduleName }}</el-link>
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-    <!-- 弹窗 -->
-    <el-dialog title="菜单配置" :visible.sync="dialogVisible" width="70%">
-      <el-checkbox-group v-model="checkList" :max="10">
-        <div v-for="(item, index) in menuList" :key="index" class="group">
-          <div v-if="item.moduleName != '首页'">
-            <div v-if="item.children && item.children.length" class="dia-child">
-              <el-checkbox v-for="(it, idx) in item.children" :key="idx" :label="it.moduleId" class="dia-item">{{
-                it.moduleName
-              }}</el-checkbox>
-            </div>
-            <div v-else class="child">
-              <el-checkbox class="dia-item" :label="item.moduleId">{{ item.moduleName }}</el-checkbox>
-            </div>
-          </div>
-        </div>
-      </el-checkbox-group>
-      <div class="dia-tip">( {{ checkList.length }} / 10 )注:最多选10个导航菜单</div>
-      <span slot="footer" class="dialog-footer">
-        <el-button
-          @click="
-            dialogVisible = false
-            checkList = []
-          "
-          >取 消</el-button
-        >
-        <el-button type="primary" @click="handleSaveMenu">确 定</el-button>
-      </span>
-    </el-dialog>
-
-    <el-dialog title="消息" :visible.sync="showMessages" width="50%" :show-close="false" :close-on-click-modal="false">
-      <el-radio-group v-model="type" size="mini" @change="checkFn">
-        <el-radio-button label="1">系统通知</el-radio-button>
-        <el-radio-button label="2">文件下发</el-radio-button>
-        <el-radio-button label="3">返利确认单</el-radio-button>
-        <el-radio-button label="4">物流通知</el-radio-button>
-      </el-radio-group>
-      <br />
-      <br />
-      <!-- 系统通知 -->
-      <div v-show="type == '1'" class="table">
-        <el-table
-          ref="table"
-          v-loading="listLoading"
-          class="cql"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="标题" prop="title" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="来源" prop="source" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="时间" prop="issueTime" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-button type="text" class="textColor" @click="lookInDialog(scope.row.id)">查看</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 文件下发 -->
-      <div v-show="type == '2'" class="table">
-        <el-table
-          ref="table"
-          v-loading="listLoading"
-          :data="fileList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="标题" prop="title" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="来源" prop="operatorNickName" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="时间" prop="createTime" min-width="160" show-overflow-tooltip />
-          <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.id)">下载</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 返利确认单 -->
-      <div v-show="type == '3'" class="table">
-        <el-table
-          ref="table"
-          v-loading="listLoading"
-          :data="rebateList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
-          <el-table-column
-            align="center"
-            label="经销商名称"
-            prop="customerName"
-            min-width="160"
-            show-overflow-tooltip
-          />
-          <el-table-column align="center" label="确认人" prop="examineBy" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="确认时间" prop="examineTime" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-button type="text" class="textColor" @click="secondFn(scope.row.rebateOrderId)">{{
-                isCustomer ? '确认' : '复核'
-              }}</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 物流通知 -->
-      <div v-show="type == '4'" class="table">
-        <el-table
-          ref="table"
-          v-loading="listLoading"
-          :data="invoiceOrderList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-        <el-table-column align="center" type="index" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="发货单" prop="id" min-width="160" show-overflow-tooltip >
-            <template slot-scope="scope">
-              <el-link v-if="!isCustomer" type="primary" :underline="false" @click="handleJump(scope.row.id)">{{ scope.row.id }}</el-link>
-              <template v-else>{{ scope.row.id  }}</template>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="内容" prop="orderTrackStatus" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="时间" prop="orderTrackTime" min-width="160" show-overflow-tooltip />
-          <el-table-column align="center" label="收货地址" prop="address" min-width="160" show-overflow-tooltip >
-              <template slot-scope="scope">
-                  {{ scope.row.address?scope.row.address:'——' }}
-              </template>
-          </el-table-column>
-          <el-table-column align="center" label="收货客户" prop="receivingName" min-width="160" show-overflow-tooltip >
-            <template slot-scope="scope">{{ scope.row.receivingName?scope.row.receivingName:'——' }}</template>
-          </el-table-column>
-          <el-table-column align="center" label="" min-width="80" show-overflow-tooltip fixed="right">
-            <template slot-scope="scope">
-              <el-button type="text" class="textColor" @click="handLogistics(scope.row)">查看</el-button>
-
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <br />
-      <br />
-      <!-- 分页 -->
-      <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>
-      <br /><br />
-      <!-- 内层弹窗 -->
-      <el-dialog width="40%" title="消息标题" :visible.sync="inDialog" append-to-body>
-        <div class="detail-container">
-          <div class="title">{{ detailData.title }}</div>
-          <div class="text">
-            发布人:{{ detailData.issueNickName }}<el-divider direction="vertical" />发布时间:{{
-              detailData.issueTime
-            }}
-          </div>
-          <el-divider />
-          <div class="content">{{ detailData.content }}</div>
-          <el-divider v-if="detailData.files && detailData.files.length > 0" />
-          <div v-if="detailData.files && detailData.files.length > 0" class="file">
-            <div>附件:</div>
-            <div class="file-list">
-              <div v-for="(item, index) in detailData.files" :key="index" class="item">
-                <el-image
-                  v-if="checkFileType(item.url) == 'image'"
-                  class="img"
-                  :src="imageURL + item.url"
-                  :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" />
-                  <div class="name ellipsis-3">{{ item.name }}</div>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-        <div slot="footer" class="dialog-footer">
-          <el-button size="mini" type="primary" @click="confirmCheck(detailData.noticeId)">确认接收</el-button>
-          <el-button size="mini" @click="inDialog = false">关 闭</el-button>
-        </div>
-      </el-dialog>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" size="mini" @click="closeFn">关闭</el-button>
-      </div>
-    </el-dialog>
-    <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-timeline-item
-          placement="top"
-          type="success"
-          v-for="(item, index) in logisticsDetail"
-          :key="index"
-          :timestamp="item.time"
-        >
-          <el-row :gutter="20">
-            <el-col class="logistics-title"> {{ item.status }} </el-col>
-            <el-col>
-              <div class="flex">
-                <div>{{ item.context }}</div>
-                <!-- <div>{{ item.createTime }}</div> -->
-              </div>
-            </el-col>
-          </el-row>
-        </el-timeline-item>
-      </el-timeline>
-      <div v-else class="tip">暂无物流信息</div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import {
-  getNoticeList,
-  getComListList,
-  getComListDownload,
-  getNoticeDetail,
-  confirmCheck,
-  getRebateOrderList,
-  getRouter,
-  getMenuList,
-  setMenuList,
-  getListInvoiceOrder
-} from '@/api/dashboard'
-import { getListOrderTrack } from '@/api/supply/pickup'
-import { getFileUrl } from '@/api/common'
-import { mapGetters } from 'vuex'
-
-export default {
-  name: 'Dashboard',
-  created() {
-    this.getDataList({
-      pageSize: this.pageSize,
-      pageNum: this.currentPage,
-      readFlag: false
-    })
-
-    getRouter({
-      flag: 'index',
-      adminUserId: this.userid
-    }).then(res => {
-      this.menuList = res.data
-      console.log(res.data)
-    })
-    this.getMenuList()
-  },
-  computed: {
-    ...mapGetters(['showMessages', 'userid','isCustomer'])
-  },
-  data() {
-    return {
-      imageURL: this.$imageUrl,
-      type: '1',
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: [],
-      listLoading: false, // 列表加载loading
-      fileList: [],
-      inDialog: false,
-      detailData: [],
-      rebateList: [],
-      // isCustomer: JSON.parse(localStorage.getItem('supply_user')).isCustomer,
-      menuList: [],
-      dialogVisible: false,
-      checkList: [],
-      normsMenuList: [],
-      invoiceOrderList: [],
-      bol: true,
-      visible: false,
-      orderId: '',
-      logisticsDetail: []
-
-    }
-  },
-
-  methods: {
-    // 获取常用菜单列表
-    getMenuList() {
-      getMenuList().then(res => {
-        this.normsMenuList = res.data
-        if (this.normsMenuList.length) {
-          this.normsMenuList.forEach(k => {
-            this.checkList.push(k.moduleId)
-          })
-        }
-      })
-    },
-    // 保存常用菜单
-    handleSaveMenu() {
-      setMenuList({ adminModuleIds: this.checkList.join(',') }).then(res => {
-        this.$successMsg('设置成功')
-        this.checkList = []
-        this.getMenuList()
-        this.dialogVisible = false
-      })
-    },
-    // 打开链接
-    openLink(url) {
-      getFileUrl({ key: url }).then(res => {
-        window.open(res.data)
-      })
-    },
-    // 复核
-    secondFn(id) {
-      this.$router.push({
-        path: '/finance/rebate/rebate_list',
-        query: {
-          id
-        }
-      })
-
-      this.$store.commit('user/showMessage', 'no')
-    },
-    // 确认查收
-    confirmCheck(id) {
-      confirmCheck({ noticeIds: id }).then(res => {
-        this.$successMsg('查收成功')
-        this.inDialog = false
-        this.getDataList({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          readFlag: false
-        })
-      })
-    },
-    // 检查文件类型
-    checkFileType(url) {
-      if (!url) return ''
-      const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
-
-      if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
-        return 'image'
-      } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
-        return 'word'
-      } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
-        return 'excel'
-      } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
-        return 'ppt'
-      } else if (['pdf'].includes(fileSuffix)) {
-        return 'pdf'
-      } else {
-        return ''
-      }
-    },
-    // 查看
-    async lookInDialog(id) {
-      const res = await getNoticeDetail({ id })
-      // console.log(res, 7898);
-      this.detailData = res.data
-      this.inDialog = true
-    },
-    // 下载
-    async downloadFn(id) {
-      const res = await getComListDownload({ id })
-      if (res.data) {
-        window.open(this.imageURL + res.data)
-      }
-    },
-    // 获取文件列表数据
-    async getFileList(data) {
-      const res = await getComListList(data)
-      this.fileList = res.data.records
-      this.listTotal = res.data.total
-    },
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      if (this.type == 1) {
-        this.getDataList({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          readFlag: false
-        })
-      }
-      if (this.type == 2) {
-        this.getFileList({
-          needDown: true,
-          pageSize: this.pageSize,
-          pageNo: this.currentPage
-        })
-      }
-      if (this.type == 3) {
-        this.getRebateList({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          isSecondExamine: false
-        })
-      }
-      if (this.type == 4) {
-        this.getListInvoiceOrder({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage
-        })
-      }
-    },
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      if (this.type == 1) {
-        this.getDataList({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          readFlag: false
-        })
-      }
-      if (this.type == 2) {
-        this.getFileList({
-          needDown: true,
-          pageSize: this.pageSize,
-          pageNo: this.currentPage
-        })
-      }
-      if (this.type == 3) {
-        this.getRebateList({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          isSecondExamine: false
-        })
-      }
-      if (this.type == 4) {
-        this.getListInvoiceOrder({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage
-        })
-      }
-    },
-    // 获取返利确认单数据
-    async getRebateList(data) {
-      const res = await getRebateOrderList(data)
-      this.rebateList = res.data.records
-      this.listTotal = res.data.total
-    },
-    // 获取列表数据
-    async getDataList(data) {
-      const res = await getNoticeList(data)
-      console.log(res)
-      this.dataList = res.data.records
-      this.listTotal = res.data.total
-    },
-    // 获取物流列表
-    async getListInvoiceOrder(data) {
-      const res = await getListInvoiceOrder(data)
-      this.invoiceOrderList = res.data.records
-      this.listTotal = res.data.total
-    },
-    // 选择
-    checkFn(v) {
-      this.$refs.table.doLayout()
-      this.type = v
-      if (v == 1) {
-        this.getDataList({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          readFlag: false
-        })
-      }
-      if (v == 2) {
-        this.getFileList({
-          needDown: true,
-          pageSize: this.pageSize,
-          pageNo: this.currentPage
-        })
-      }
-      if (v == 3) {
-        this.getRebateList({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          isSecondExamine: false
-        })
-      }
-      if (v == 4) {
-        this.getListInvoiceOrder({
-          pageSize: this.pageSize,
-          pageNum: this.currentPage
-        })
-      }
-    },
-    // 关闭
-    closeFn() {
-      this.$store.commit('user/showMessage', 'no')
-    },
-
-    // 点击菜单
-    clickMenu(path) {
-      const curlArr = ['/notice', '/issue']
-      if (curlArr.includes(path)) {
-        path += '/index'
-      }
-      this.$router.push({
-        path
-      })
-    },
-    handLogistics(row) {
-      getListOrderTrack({ orderId: row.id }).then(res => {
-        this.logisticsDetail = res.data
-      })
-      this.orderId = row.id
-      this.visible = true
-    },
-    onClose() {
-      this.logisticsDetail = []
-      this.orderId = ''
-      this.visible = false
-    },
-    handleJump(id){
-      this.$router.push({path:`/exwarehouse/sum_list?id=${id}`})
-      this.$store.commit('user/SET_MESSAGE', false);
-      this.inDialog = false
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-.dashboard {
-  &-container {
-    background: #f5f5f5;
-    padding: 30px;
-    min-height: calc(100vh - 86px);
-    .top-container {
-      .today-content {
-        font-size: 14px;
-      }
-    }
-  }
-}
-.cql {
-  ::v-deep.el-table__header-wrapper {
-    background-color: #f5f7fa;
-  }
-}
-.dia-menu-title {
-  padding: 10px 0;
-  color: #000;
-  font-weight: bold;
-}
-.dia-tip {
-  padding: 10px 0;
-  color: #000;
-  font-weight: bold;
-}
-.dia-child {
-  display: flex;
-  flex-wrap: wrap;
-}
-.dia-item {
-  flex: 0 1 220px;
-  padding: 3px 0;
-}
-.menu-list {
-  .main-title {
-    margin: 10px 0 0;
-    .el-icon-setting {
-      cursor: pointer;
-      font-size: 22px;
-    }
-  }
-  .group {
-    margin-bottom: 20px;
-    .child {
-      display: flex;
-      flex-wrap: wrap;
-      padding-left: 10px;
-      .el-row {
-        width: 100%;
-      }
-      .item {
-        margin-top: 16px;
-      }
-    }
-  }
-  ::v-deep .el-link--inner {
-    white-space: nowrap;
-    overflow: hidden;
-    text-overflow: ellipsis;
-  }
-}
-.logistics-title {
-  padding-bottom: 10px;
-}
-.tip {
-  height: 200px;
-  text-align: center;
-  line-height: 200px;
-}
-</style>

+ 1 - 1
src/views/deposit_home/components/deposit-apply-deduction.vue

@@ -169,7 +169,7 @@ export default {
   },
   methods: {
     goBack() {
-      this.$parent.showPage = 1
+      this.$emit('setShowPage', 1)
     }
   }
 }

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä