Ver código fonte

合并权限更改,工程维保

pengyh 1 ano atrás
pai
commit
daae28bc5d
99 arquivos alterados com 9559 adições e 5624 exclusões
  1. 7 7
      package-lock.json
  2. 0 109
      package.json
  3. 115 0
      src/api/applicationWithoutFee.js
  4. 64 0
      src/api/auxiliaryFittings/settleAccountOfflinePay.js
  5. 74 0
      src/api/auxiliaryFittings/settleAccountWeixinPay.js
  6. 37 0
      src/api/engineeringMaintenance/basicData.js
  7. 16 0
      src/api/workOrderPool.js
  8. 3 3
      src/components/template/operation_mixin.js
  9. 14 19
      src/components/template/template-page-1.vue
  10. 18 2
      src/permission.js
  11. 642 639
      src/views/auxiliaryFittings/attachmentProfile/index.vue
  12. 88 88
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryChargeManagement/index.vue
  13. 6 4
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryMaterialClass/index.vue
  14. 83 84
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryPriceManagement/index.vue
  15. 31 33
      src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventory/index.vue
  16. 0 6
      src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventoryDetails/index.vue
  17. 0 6
      src/views/auxiliaryFittings/inventoryManagement/masterAuInvenDetails/index.vue
  18. 31 33
      src/views/auxiliaryFittings/inventoryManagement/masterAuxiliaryInven/index.vue
  19. 0 6
      src/views/auxiliaryFittings/inventoryManagement/masterPaInvenDetails/index.vue
  20. 31 33
      src/views/auxiliaryFittings/inventoryManagement/masterPartsInven/index.vue
  21. 31 33
      src/views/auxiliaryFittings/inventoryManagement/partsInventory/index.vue
  22. 0 6
      src/views/auxiliaryFittings/inventoryManagement/partsInventoryDetails/index.vue
  23. 27 15
      src/views/auxiliaryFittings/purchasingManagement/components/inStorage.vue
  24. 27 15
      src/views/auxiliaryFittings/purchasingManagement/components/retStorage.vue
  25. 49 47
      src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js
  26. 152 131
      src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue
  27. 152 131
      src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue
  28. 258 234
      src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue
  29. 133 121
      src/views/auxiliaryFittings/salesManagement/auxiliaryAdjustPriceOrder/index.vue
  30. 260 239
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue
  31. 139 131
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue
  32. 2 1
      src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue
  33. 2 1
      src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue
  34. 55 46
      src/views/auxiliaryFittings/salesManagement/transaction/index.vue
  35. 191 179
      src/views/auxiliaryFittings/settleAccountManagement/salesWithdraw/index.vue
  36. 341 0
      src/views/auxiliaryFittings/settleAccountManagement/settleAccountOfflinePay/index.vue
  37. 434 0
      src/views/auxiliaryFittings/settleAccountManagement/settleAccountWeixinPay/index.vue
  38. 139 134
      src/views/auxiliaryFittings/supplier/index.vue
  39. 114 0
      src/views/engineeringMaintenance/allInclusiveExpense/index.vue
  40. 195 0
      src/views/engineeringMaintenance/applicationWithoutFee/index.vue
  41. 794 0
      src/views/engineeringMaintenance/basicData/detail.vue
  42. 197 0
      src/views/engineeringMaintenance/basicData/index.vue
  43. 59 0
      src/views/engineeringMaintenance/feeSettlementIncluded/index.vue
  44. 77 0
      src/views/engineeringMaintenance/feeSettlementIncluded/pages/collect.vue
  45. 170 0
      src/views/engineeringMaintenance/feeSettlementIncluded/pages/offline.vue
  46. 104 0
      src/views/engineeringMaintenance/feeSettlementIncludedwx/index.vue
  47. 271 0
      src/views/engineeringMaintenance/mixins/feel.js
  48. 6 1
      src/views/login/index.vue
  49. 73 59
      src/views/mallManagement/activity/coupon_index/index.vue
  50. 51 46
      src/views/mallManagement/activity/seckill_index/index_1.vue
  51. 33 32
      src/views/mallManagement/activity/seckill_index/index_2.vue
  52. 1 1
      src/views/mallManagement/activity/special_index/index.vue
  53. 3 3
      src/views/mallManagement/brand/index.vue
  54. 3 1
      src/views/mallManagement/configCenter/annunciationConfig/index.vue
  55. 55 49
      src/views/mallManagement/configCenter/business_type/index.vue
  56. 57 51
      src/views/mallManagement/configCenter/chargingStandard/index.vue
  57. 73 64
      src/views/mallManagement/configCenter/faultSelfExamination/index.vue
  58. 5 5
      src/views/mallManagement/configCenter/serviceProduct/index.vue
  59. 5 2
      src/views/mallManagement/configCenter/slideshowConfig/index.vue
  60. 57 56
      src/views/mallManagement/freight/index.vue
  61. 5 5
      src/views/mallManagement/goods/classify_index/index.vue
  62. 60 59
      src/views/mallManagement/goods/explain_index/index.vue
  63. 9 9
      src/views/mallManagement/goods/goods_index/index.vue
  64. 71 61
      src/views/mallManagement/goods/newclassify_index/index.vue
  65. 48 47
      src/views/mallManagement/goods/watermark/index.vue
  66. 12 12
      src/views/mallManagement/order/order_list/index.vue
  67. 9 9
      src/views/mallManagement/order/order_refund/index.vue
  68. 31 27
      src/views/mallManagement/settlement/index.vue
  69. 42 39
      src/views/mallManagement/storage/index.vue
  70. 1 1
      src/views/setting/departmentManage/index.vue
  71. 18 4
      src/views/setting/role/index.vue
  72. 35 31
      src/views/userManagement/customerManagement/index.vue
  73. 84 71
      src/views/userManagement/distributorManagement/index.vue
  74. 65 61
      src/views/userManagement/masterManagement/index.vue
  75. 45 46
      src/views/userManagement/workerProfileInit/index.vue
  76. 20 17
      src/views/valueAddedService/extendedWarrantyWork/index.vue
  77. 21 19
      src/views/valueAddedService/orderBranchAccount/index.vue
  78. 81 68
      src/views/valueAddedService/orderSettleManag/index.vue
  79. 28 23
      src/views/valueAddedService/valueAddedConfig/index.vue
  80. 107 111
      src/views/workOrder/appraise/index.vue
  81. 87 87
      src/views/workOrder/basicConfiguration/assessmentItemAllocation/index.vue
  82. 116 97
      src/views/workOrder/basicConfiguration/orderType/index.vue
  83. 334 316
      src/views/workOrder/basicConfiguration/settlementStandard/components/install.vue
  84. 252 234
      src/views/workOrder/basicConfiguration/settlementStandard/components/other.vue
  85. 360 342
      src/views/workOrder/basicConfiguration/settlementStandard/components/repair.vue
  86. 25 22
      src/views/workOrder/basicConfiguration/settlementStandard/index.vue
  87. 372 369
      src/views/workOrder/settleAccountsManagement/rewardsPunishmentsOrder/index.vue
  88. 199 196
      src/views/workOrder/settleAccountsManagement/settleAccountsOrder/index.vue
  89. 219 207
      src/views/workOrder/settleAccountsManagement/summaryBill/index.vue
  90. 6 2
      src/views/workOrder/workOrderPool/detail.vue
  91. 96 39
      src/views/workOrder/workOrderPool/detailModule/Payment/index.vue
  92. 5 2
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue
  93. 117 1
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/basicInfo.js
  94. 9 6
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/pandanxinxi.js
  95. 2 1
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/productColumns.js
  96. 63 55
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/serviceInfo.js
  97. 377 0
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/wb_productColumns.js
  98. 32 13
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js
  99. 41 9
      src/views/workOrder/workOrderPool/index.vue

+ 7 - 7
package-lock.json

@@ -4425,9 +4425,9 @@
           "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ=="
         },
         "postcss": {
-          "version": "8.4.32",
-          "resolved": "http://121.41.110.30:4873/postcss/-/postcss-8.4.32.tgz",
-          "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==",
+          "version": "8.4.33",
+          "resolved": "http://121.41.110.30:4873/postcss/-/postcss-8.4.33.tgz",
+          "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==",
           "requires": {
             "nanoid": "^3.3.7",
             "picocolors": "^1.0.0",
@@ -4716,9 +4716,9 @@
       "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
     },
     "@zjlib/element-plugins": {
-      "version": "2.13.8",
-      "resolved": "http://121.41.110.30:4873/@zjlib%2felement-plugins/-/element-plugins-2.13.8.tgz",
-      "integrity": "sha512-I9/yswo9fRxe9NoCB9tl6NmcaLEJUGsc+MPemUlph3wj8WbTYplGvRuQlY/9ZaVjPWbLjbUyqusf//dE/tIp2g==",
+      "version": "2.13.9",
+      "resolved": "http://121.41.110.30:4873/@zjlib%2felement-plugins/-/element-plugins-2.13.9.tgz",
+      "integrity": "sha512-3OBzQqTFIaV2AYu0KHMWgdSz04bOQSO3UHMJBCx08wXjcBezzrXoODQLdfWBYQDNhE+hpZo3mfxTLcOwbANrzw==",
       "requires": {
         "@turf/turf": "^6.5.0",
         "@vuemap/vue-amap": "^0.1.12",
@@ -4763,7 +4763,7 @@
       "dependencies": {
         "vue-plugin-hiprint": {
           "version": "0.0.17",
-          "resolved": "https://registry.npmmirror.com/vue-plugin-hiprint/-/vue-plugin-hiprint-0.0.17.tgz",
+          "resolved": "http://121.41.110.30:4873/vue-plugin-hiprint/-/vue-plugin-hiprint-0.0.17.tgz",
           "integrity": "sha512-pV7aemrQXJfpcxLUFlV5qSbJffWjyU982ByyahV0Ietr0i8N/rhmtCJ6vCp0Eptip9Oy4yQl6tWkFuAVE6uH3g=="
         }
       }

+ 0 - 109
package.json

@@ -1,109 +0,0 @@
-{
-  "name": "vue-admin-template",
-  "version": "4.4.0",
-  "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
-  "author": "Pan <panfree23@gmail.com>",
-  "scripts": {
-    "dev": "vue-cli-service serve ",
-    "build:prod": "vue-cli-service build",
-    "build:stage": "vue-cli-service build --mode staging",
-    "prettier": "npx prettier --write .",
-    "preview": "node build/index.js --preview",
-    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
-    "lint": "eslint --ext .js,.vue src",
-    "test:unit": "jest --clearCache && vue-cli-service test:unit",
-    "test:ci": "npm run lint && npm run test:unit"
-  },
-  "dependencies": {
-    "@turf/turf": "^6.5.0",
-    "@vue-office/excel": "^1.3.0",
-    "@vue/composition-api": "^1.7.1",
-    "@zjlib/element-plugins": "^2.13.8",
-    "@zjlib/element-ui2": "^1.0.3",
-    "axios": "0.18.1",
-    "chatgpt": "^4.1.2",
-    "clipboard": "^2.0.8",
-    "concurrent-tasks": "^1.0.7",
-    "core-js": "^3.6.5",
-    "echarts": "^5.1.1",
-    "file-saver": "^2.0.5",
-    "html2canvas": "^1.4.1",
-    "js-cookie": "2.2.0",
-    "js-perform-lock": "^1.0.5",
-    "jspdf": "^2.5.1",
-    "keydown-even": "^1.2.0",
-    "md5": "^2.3.0",
-    "normalize.css": "7.0.0",
-    "nprogress": "0.2.0",
-    "nrm": "^1.2.5",
-    "openai": "^3.1.0",
-    "path-to-regexp": "2.4.0",
-    "pl-table": "^2.7.5",
-    "qrcodejs2": "0.0.2",
-    "screenfull": "^4.2.0",
-    "socket.io-client": "^4.6.0",
-    "uuid": "^9.0.0",
-    "v-low-code": "^1.0.1",
-    "v-remote-component": "^1.0.9",
-    "v-scale": "^1.0.1",
-    "v-scroll-view": "^1.0.2",
-    "v-socket-io-plugins": "^1.0.8",
-    "vue": "2.6.10",
-    "vue-demi": "^0.14.5",
-    "vue-ls": "^4.0.0",
-    "vue-plugin-hiprint": "0.0.56",
-    "vue-quill-editor": "^3.0.6",
-    "vue-router": "3.0.6",
-    "vuex": "3.1.0",
-    "webpack": "^4.46.0",
-    "yarn": "^1.22.18"
-  },
-  "devDependencies": {
-    "@vue/babel-plugin-jsx": "^1.1.1",
-    "@vue/cli-plugin-babel": "4.4.4",
-    "@vue/cli-plugin-eslint": "4.4.4",
-    "@vue/cli-plugin-unit-jest": "4.4.4",
-    "@vue/cli-service": "4.4.4",
-    "@vue/test-utils": "1.0.0-beta.29",
-    "autoprefixer": "9.5.1",
-    "babel-eslint": "10.1.0",
-    "babel-jest": "23.6.0",
-    "babel-plugin-dynamic-import-node": "2.3.3",
-    "chalk": "2.4.2",
-    "compression-webpack-plugin": "4.0",
-    "connect": "3.6.6",
-    "eslint": "^6.7.2",
-    "eslint-plugin-vue": "6.2.2",
-    "html-webpack-plugin": "3.2.0",
-    "less-loader": "^6.1.1",
-    "mockjs": "1.0.1-beta3",
-    "runjs": "4.3.2",
-    "sass": "1.26.8",
-    "sass-loader": "8.0.2",
-    "script-ext-html-webpack-plugin": "2.1.3",
-    "serve-static": "1.13.2",
-    "svg-sprite-loader": "4.1.3",
-    "svgo": "1.2.2",
-    "uglifyjs-webpack-plugin": "^2.2.0",
-    "vue-template-compiler": "2.6.10",
-    "webpack-cli": "^4.9.1"
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions"
-  ],
-  "engines": {
-    "node": ">=8.9",
-    "npm": ">= 3.0.0"
-  },
-  "license": "MIT",
-  "main": "babel.config.js",
-  "directories": {
-    "test": "tests"
-  },
-  "repository": {
-    "type": "git",
-    "url": "ssh://git@gogs.zfire.top:2222/gj-train/gj-manager-front.git"
-  },
-  "keywords": []
-}

+ 115 - 0
src/api/applicationWithoutFee.js

@@ -0,0 +1,115 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+export function enginMaterialListAll(data) {
+  return request({
+    url: `/engin/material/listAll?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginMaterialListAllExport(data, name) {
+  return postBlob({
+    url: '/engin/material/listAll/export',
+    data,
+    name
+  })
+}
+
+export function enginMaterialList(data) {
+  return request({
+    url: `/engin/material/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginMaterialListExport(data, name) {
+  return postBlob({
+    url: '/engin/material/list/export',
+    data,
+    name
+  })
+}
+
+export function enginMaterialDetail(params) {
+  return request({
+    url: `/engin/material/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginMaterialExamine(params) {
+  return request({
+    url: `/engin/material/examine`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginMaterialListPageSettlementV2(data) {
+  return request({
+    url: `/engin/material/list/pageSettlementV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginMaterialPageSettlementExport(data, name) {
+  return postBlob({
+    url: '/engin/material/pageSettlementExport',
+    data,
+    name
+  })
+}
+
+export function enginMaterialListLine(data) {
+  return request({
+    url: `/engin/material/listLine?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginMaterialListLineExport(data, name) {
+  return postBlob({
+    url: '/engin/material/listLine/export',
+    data,
+    name
+  })
+}
+
+export function enginMaterialLineSettlement(params) {
+  return request({
+    url: `/engin/material/lineSettlement`,
+    method: 'post',
+    params
+  })
+}
+
+
+export function enginMaterialListWechat(data) {
+  return request({
+    url: `/engin/material/listWechat?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginMaterialListWechatExport(data, name) {
+  return postBlob({
+    url: '/engin/material/listWechat/export',
+    data,
+    name
+  })
+}
+
+export function enginMaterialLineSettlementHui(params) {
+  return request({
+    url: `/engin/material/lineSettlementHui`,
+    method: 'post',
+    params
+  })
+}
+

+ 64 - 0
src/api/auxiliaryFittings/settleAccountOfflinePay.js

@@ -0,0 +1,64 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取汇总列表
+export function listPageV1(data) {
+  return request({
+    url: `/settlementOrder/list/pageLineSettlementV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+// 获取明细列表
+export function listPageV2(data) {
+  return request({
+    url: `/settlementOrder/list/pageV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//导出
+export function pageExport2(data, name) {
+  return postBlob({
+    url: '/settlementOrder/pageExport',
+    data,
+    name
+  })
+}
+
+//导出
+export function pageExport1(data, name) {
+  return postBlob({
+    url: '/settlementOrder/pageLineSettlementExport',
+    data,
+    name
+  })
+}
+
+// 详情
+export function getDetail(params) {
+  return request({
+    url: `/settlementOrder/detail`,
+    method: 'post',
+    params
+  })
+}
+
+// 退款
+export function refund(params) {
+  return request({
+    url: `/settlementOrder/refund`,
+    method: 'post',
+    params
+  })
+}
+
+// 结算
+export function settleAccounts(params) {
+  return request({
+    url: `/settlementOrder/lineSettlement`,
+    method: 'post',
+    params
+  })
+}

+ 74 - 0
src/api/auxiliaryFittings/settleAccountWeixinPay.js

@@ -0,0 +1,74 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取汇总列表
+export function listPageV1(data) {
+  return request({
+    url: `/settlementOrder/list/pageSettlementV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+// 获取明细列表
+export function listPageV2(data) {
+  return request({
+    url: `/settlementOrder/list/pageV2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+
+//导出
+export function pageExport2(data, name) {
+  return postBlob({
+    url: '/settlementOrder/pageExport',
+    data,
+    name
+  })
+}
+
+//导出
+export function pageExport1(data, name) {
+  return postBlob({
+    url: '/settlementOrder/pageSettlementExport',
+    data,
+    name
+  })
+}
+
+// 详情
+export function getDetail(params) {
+  return request({
+    url: `/settlementOrder/detail`,
+    method: 'post',
+    params
+  })
+}
+
+// 退款
+export function refund(params) {
+  return request({
+    url: `/settlementOrder/refund`,
+    method: 'post',
+    params
+  })
+}
+
+// 提现
+export function withdraw(params) {
+  return request({
+    url: `/settlementOrder/over`,
+    method: 'post',
+    params
+  })
+}
+
+// 结算
+export function settleAccounts(params) {
+  return request({
+    url: `/settlementOrder/settlement`,
+    method: 'post',
+    params
+  })
+}

+ 37 - 0
src/api/engineeringMaintenance/basicData.js

@@ -0,0 +1,37 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取列表
+export function listPageV2(data) {
+  return request({
+    url: `/engin/project/repair/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//导出
+export function pageExport(data, name) {
+  return postBlob({
+    url: '/engin/project/repair/list/export',
+    data,
+    name
+  })
+}
+
+// 保存
+export function save(data) {
+  return request({
+    url: `/engin/project/repair/save`,
+    method: 'post',
+    data
+  })
+}
+
+// 详情
+export function getDetail(params) {
+  return request({
+    url: `/engin/project/repair/detail`,
+    method: 'post',
+    params
+  })
+}

+ 16 - 0
src/api/workOrderPool.js

@@ -30,6 +30,22 @@ export function orderBaseSettleNormDetail(params) {
   })
 }
 
+export function enginMaterialCancel(params) {
+  return request({
+    url: `/engin/material/cancel`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginMaterialDetailWorker(params) {
+  return request({
+    url: `/engin/material/detailWorker`,
+    method: 'post',
+    params
+  })
+}
+
 export function changeOrderGetOrderList(params) {
   return request({
     url: `/changeOrder/getOrderList`,

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

@@ -56,12 +56,12 @@ export default {
                   if (opt[key]?.prompt) {
                     return role && (opt[key]?.conditions ? opt[key]?.conditions({ row, index, column }) : true) ? (
                       <el-popconfirm
-                        title={opt[key]?.prompt}
+                        title={setBtnName(opt[key]?.prompt, { row, index, column })}
                         onConfirm={() => {
                           opt[key]?.click({ row, index, column })
                         }}
                       >
-                        <el-button size="mini" type={opt[key]?.btnType || 'primary'} slot="reference">
+                        <el-button size="mini" type={opt[key]?.btnType || 'text'} slot="reference">
                           {setBtnName(opt[key]?.name, { row, index, column }) || role.moduleName}
                         </el-button>
                       </el-popconfirm>
@@ -70,7 +70,7 @@ export default {
                     return role && (opt[key]?.conditions ? opt[key]?.conditions({ row, index, column }) : true) ? (
                       <el-button
                         size="mini"
-                        type={opt[key]?.btnType || 'primary'}
+                        type={opt[key]?.btnType || 'text'}
                         onClick={() => {
                           opt[key]?.click({ row, index, column })
                         }}

+ 14 - 19
src/components/template/template-page-1.vue

@@ -137,26 +137,16 @@ export default {
       type: Array,
       default: () => [15, 30, 50, 100, 150, 200],
     },
+    expCode: {
+      type: String,
+      default: 'exp'
+    },
   },
   data() {
     return {
       dialogVisible: false,
       // 搜索的参数
       parameter: {},
-      // 按钮集合
-      evens: this.exportList
-        ? [[
-          {
-            name: '导出',
-            click: this.export,
-            loading: false
-          }
-          // this.optionsEvensAuth("export", {
-          //   click: this.export,
-          //   loading: false
-          // })
-        ]]
-        : [],
       // 表格属性
       defaultTableAttributes: {},
       // 表格事件
@@ -192,6 +182,15 @@ export default {
     },
     moduleName() {
       return this.customModuleName || this.$route.meta.title
+    },
+    evens() {
+      return this.exportList
+        ? [[
+          this.optionsEvensAuth(this.expCode, {
+            click: this.export
+          })
+        ]]
+        : []
     }
   },
   mounted() {
@@ -500,7 +499,7 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
       })
-      if (this.evens[0]) this.evens[0][0].loading = true
+
       var { querylist, ...p } = this.getParams()
 
       var pms = {
@@ -549,24 +548,20 @@ export default {
                 type: 'success'
               })
               this.columnList = []
-              if (this.evens[0]) this.evens[0][0].loading = false
               loading.close()
             })
             .catch(err => {
               this.$message.error('导出失败')
               this.columnList = []
-              if (this.evens[0]) this.evens[0][0].loading = false
               loading.close()
             })
         } else {
           this.$message.error('导出条件没有查到任何符合条件的数据,请调整查询条件再导出。')
           this.columnList = []
-          if (this.evens[0]) this.evens[0][0].loading = false
           loading.close()
         }
       } else {
         this.columnList = []
-        if (this.evens[0]) this.evens[0][0].loading = false
         loading.close()
       }
     },

+ 18 - 2
src/permission.js

@@ -29,6 +29,7 @@ function getc(obj) {
 }
 
 router.beforeEach(async (to, from, next) => {
+
   NProgress.start()
   document.title = getPageTitle(to.meta.title)
   const hasToken = getToken()
@@ -48,16 +49,31 @@ router.beforeEach(async (to, from, next) => {
             global.antRouter = []
             next()
           }
+
+          var userInfo = JSON.parse(localStorage.getItem('greemall_user'))
+          var moduleObj = {
+            // 辅材配件
+            auxiliaryFittings: userInfo.moduleMaterialPart,
+            // 维保
+            engineeringMaintenance: userInfo.moduleWb,
+            // 延保
+            valueAddedService: userInfo.moduleYb,
+          }
+
           // 设置路由
           lay.children = []
           for (var route of store.getters.menus) {
-            lay.children.push(...buildRoute(route))
+            if (moduleObj[route.code] !== false) {
+              lay.children.push(...buildRoute(route))
+            }
           }
           lay.redirect = getc(lay).path
           router.addRoutes([lay])
           global.antRouter = []
           for (var route of store.getters.menus) {
-            global.antRouter.push(...buildRoute(route, '', false))
+            if (moduleObj[route.code] !== false) {
+              global.antRouter.push(...buildRoute(route, '', false))
+            }
           }
           next({
             ...to,

+ 642 - 639
src/views/auxiliaryFittings/attachmentProfile/index.vue

@@ -1,19 +1,19 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  <el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
-	    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
-	    <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-	      <zj-form-module :title="formDialogTitles[formDialogType]" label-width="170px" :showPackUp="false"
-	        :form-data="formData" :form-items="formItems" :disabled="formDialogType==2">
-	      </zj-form-module>
-	    </zj-form-container>
-	    <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formCancel">取 消</el-button>
-			<el-button size="mini" type="primary" @click="formConfirm()">确定</el-button>
-	    </div>
-	  </el-dialog>
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+		:operationColumnWidth="50" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+		:column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+		<el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+			:show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+			<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+				<zj-form-module :title="formDialogTitles[formDialogType]" label-width="170px" :showPackUp="false"
+					:form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
+				</zj-form-module>
+			</zj-form-container>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="mini" @click="formCancel">取 消</el-button>
+				<el-button size="mini" type="primary" @click="formConfirm()">确定</el-button>
+			</div>
+		</el-dialog>
 	</template-page>
 </template>
 
@@ -23,647 +23,650 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, updateStatus, listImport1, listImport2, getTypeList, getCategoryList } from "@/api/auxiliaryFittings/attachmentProfile";
+import { listPageV2, pageExport, getDetail, add, edit, updateStatus, listImport1, listImport2, getTypeList, getCategoryList } from "@/api/auxiliaryFittings/attachmentProfile";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	],
-		[
-			[
-				{
-					name: '批量上架',
-					click: ()=>{
-						this.updateStatus('ON')
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			formData: {
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				goodsType: 'P',
+				goodsStockUnit: '',
+				goodsCode: '',
+				goodsName: '',
+				normType: 'M',
+				status: 'ON',
+				categoryList: [],
+				brandList: [],
+				marketPrice: '',
+				normAmount: '',
+				selfWebsitAmount: '',
+				selfWorkerAmount: '',
+				outWebsitAmount: '',
+				outWorkerAmount: '',
+				remark: ''
+			},
+			partsUnitList: [],
+			brandList: [],
+			categoryList: []
+		}
+	},
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					],
+				],
+				[
+					[
+						this.optionsEvensAuth("shelfInBulk", {
+							click: () => {
+								this.updateStatus('ON')
+							}
+						}),
+					],
+				],
+				[
+					[
+						this.optionsEvensAuth("batchRemoval", {
+							click: () => {
+								this.updateStatus('OFF')
+							}
+						}),
+					],
+				],
+				[
+					[
+						this.optionsEvensAuth("template", {
+							click: this.handleDownload1
+						}),
+					],
+					[
+						this.optionsEvensAuth("imp", ({ moduleName }) => {
+							return {
+								name: moduleName,
+								render: () => {
+									return this.importButton(listImport1, moduleName)
+								}
+							}
+						}),
+					],
+				],
+				[
+					[
+						this.optionsEvensAuth("importTemplate", {
+							click: this.handleDownload2
+						}),
+					],
+					[
+						this.optionsEvensAuth("Import", ({ moduleName }) => {
+							return {
+								name: moduleName,
+								render: () => {
+									return this.importButton(listImport2, moduleName)
+								}
+							}
+						}),
+					],
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+
+		//加法 
+		accAdd() {
+			return function (arg1, arg2) {
+				var r1, r2, m;
+				try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
+				try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
+				m = Math.pow(10, Math.max(r1, r2))
+				return (arg1 * m + arg2 * m) / m
+			}
+		},
+		//减法 
+		Subtr() {
+			return function (arg1, arg2) {
+				var r1, r2, m, n;
+				try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
+				try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
+				m = Math.pow(10, Math.max(r1, r2));
+				n = (r1 >= r2) ? r1 : r2;
+				return ((arg1 * m - arg2 * m) / m).toFixed(2);
+			}
+		},
+		formItems() {
+			return [{
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', disabled: true },
+				formItemAttributes: {
+					label: '所属商户',
+					prop: 'companyName',
+					rules: [...required]
+				},
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'slot-component',
+				attributes: {},
+				formItemAttributes: {
+					label: '状态',
+					prop: 'status',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-radio-group v-model={this.formData.status}>
+							<el-radio disabled={this.formDialogType == 2} label="ON">上架</el-radio>
+							<el-radio disabled={this.formDialogType == 2} label="OFF">下架</el-radio>
+						</el-radio-group>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入配件名称', },
+				formItemAttributes: {
+					label: '配件名称',
+					prop: 'goodsName',
+					rules: [...required]
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'el-select-add',
+				labelKey: 'dictValue',
+				valueKey: 'dictValue',
+				options: this.partsUnitList,
+				attributes: { placeholder: '请选择单位', filterable: true, clearable: true },
+				formItemAttributes: {
+					label: '单位',
+					prop: 'goodsStockUnit',
+					rules: [...required]
+				},
+				events: {
+					change: (e) => {
+						this.$refs.formRef.validateField(['goodsStockUnit'], (valid, invalidFields, errLabels) => { })
 					}
 				}
-			]
-		],
-		[
-			[
-				{
-					name: '批量下架',
-					click: ()=>{
-						this.updateStatus('OFF')
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入配件代码' },
+				formItemAttributes: {
+					label: '配件代码',
+					prop: 'goodsCode',
+					rules: [...required]
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'slot-component',
+				attributes: {},
+				formItemAttributes: {
+					label: '收费类型',
+					prop: 'normType',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-radio-group v-model={this.formData.normType}>
+							<el-radio disabled={this.formDialogType == 2} label="M">配件物料</el-radio>
+							<el-radio disabled={this.formDialogType == 2} label="S">服务收费</el-radio>
+						</el-radio-group>
+					)
+				}
+			}, {
+				md: 24,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'el-checkbox-add',
+				labelKey: 'dictValue',
+				valueKey: 'dictCode',
+				attributes: {},
+				options: this.brandList,
+				formItemAttributes: {
+					label: '适用品牌',
+					prop: 'brandList',
+					rules: [...required]
+				},
+				events: {
+					change: (e) => {
+						this.$refs.formRef.validateField(['brandList'], (valid, invalidFields, errLabels) => { })
 					}
 				}
-			]
-		],
-		[
-		  [
-		    {
-		      name: '下载配件物料导入模板',
-		      click: this.handleDownload1
-		    }
-		  ],
-		  [
-		    {
-		      name: '导入配件物料模板',
-		      render: () => {
-		        return this.importButton(listImport1, '导入模板')
-		      }
-		    }
-		  ],
-		],
-		[
-          [
-            {
-              name: '下载服务收费导入模板',
-              click: this.handleDownload2
-            }
-          ],
-          [
-            {
-              name: '导入服务收费模板',
-              render: () => {
-                return this.importButton(listImport2, '导入模板')
-              }
-            }
-          ],
-        ],
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		goodsType: 'P',
-		goodsStockUnit: '',
-		goodsCode: '',
-		goodsName: '',
-		normType: 'M',
-		status: 'ON',
-		categoryList: [],
-		brandList: [],
-		marketPrice: '',
-		normAmount: '',
-		selfWebsitAmount: '',
-		selfWorkerAmount: '',
-		outWebsitAmount: '',
-		outWorkerAmount: '',
-		remark: ''
-      },
-	  partsUnitList: [],
-	  brandList: [],
-	  categoryList: []
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-	
-	//加法 
-	accAdd(){
-		return function(arg1,arg2){
-			var r1,r2,m;
-			try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} 
-			try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} 
-			m=Math.pow(10,Math.max(r1,r2)) 
-			return (arg1*m+arg2*m)/m 
-		}
-	},
-	//减法 
-	Subtr(){ 
-		return function(arg1,arg2){
-			var r1,r2,m,n;
-			try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} 
-			try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} 
-			m=Math.pow(10,Math.max(r1,r2)); 
-			n=(r1>=r2)?r1:r2; 
-			return ((arg1*m-arg2*m)/m).toFixed(2); 
+			}, {
+				md: 24,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'el-checkbox-add',
+				labelKey: 'name',
+				valueKey: 'categoryId',
+				attributes: {},
+				options: this.categoryList,
+				formItemAttributes: {
+					label: '适用产品大类',
+					prop: 'categoryList',
+					rules: [...required]
+				},
+				events: {
+					change: (e) => {
+						this.$refs.formRef.validateField(['categoryList'], (valid, invalidFields, errLabels) => { })
+					}
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '销售价格',
+					prop: 'marketPrice',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.marketPrice} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+							</div>
+							<div style="color: #EA8000">注:维护网点销售给师傅的价格</div>
+						</div>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '收费标准',
+					prop: 'normAmount',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.normAmount} onChange={(e) => {
+									this.formData.normAmount = Number(e).toFixed(2)
+									if (this.formData.selfWorkerAmount > e) {
+										this.formData.normAmount = ''
+										return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
+									} else if (this.formData.outWorkerAmount > e) {
+										this.formData.outWorkerAmount = ''
+										return this.$message.warning('外购配件师傅分账金额必须小于收费标准!');
+									}
+									this.formData.selfWebsitAmount = this.Subtr(e, this.formData.selfWorkerAmount)
+									this.formData.outWebsitAmount = this.Subtr(e, this.formData.outWorkerAmount)
+									this.$refs.formRef.validateField(['selfWebsitAmount'], (valid, invalidFields, errLabels) => { })
+									this.$refs.formRef.validateField(['outWebsitAmount'], (valid, invalidFields, errLabels) => { })
+								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+							</div>
+							<div style="color: #EA8000">注:分账金额需扣除手续费0.6%</div>
+						</div>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '自有库存师傅分账金额',
+					prop: 'selfWorkerAmount',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					const that = this
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.selfWorkerAmount} onChange={(e) => {
+									this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
+									if (e && (Number(e) > Number(that.formData.normAmount))) {
+										that.formData.selfWorkerAmount = ''
+										return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
+									}
+									that.formData.selfWebsitAmount = this.Subtr(that.formData.normAmount, e)
+								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+							</div>
+						</div>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? false : true,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '师傅分账比例',
+					prop: 'selfWorkerAmount',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					const that = this
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.selfWorkerAmount} onChange={(e) => {
+									this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
+									if (e && (Number(e) < 0)) {
+										return this.$message.warning('师傅分账比例不能为0!');
+									}
+									if (e && (this.accAdd(Number(e), Number(that.formData.selfWebsitAmount)) > 100)) {
+										this.formData.selfWorkerAmount = 0
+										return this.$message.warning('商户与师傅分账比例和最大只能100%!');
+									} else {
+										that.formData.selfWebsitAmount = this.Subtr(100, e)
+									}
+								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
+							</div>
+						</div>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '外购配件师傅分账金额',
+					prop: 'outWorkerAmount',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					const that = this
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.outWorkerAmount} onChange={(e) => {
+									this.formData.outWorkerAmount = Number(this.formData.outWorkerAmount).toFixed(2)
+									if (Number(e) > Number(that.formData.normAmount)) {
+										this.formData.outWorkerAmount = ''
+										return this.$message.warning('外购配件师傅分账金额必须小于收费标准!');
+									}
+									this.formData.outWebsitAmount = this.Subtr(this.formData.normAmount, e)
+								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+							</div>
+						</div>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '自有库存商户分账金额',
+					prop: 'selfWebsitAmount',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.selfWebsitAmount} disabled type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+							</div>
+						</div>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? false : true,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '商户分账比例',
+					prop: 'selfWebsitAmount',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					const that = this
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.selfWebsitAmount} onChange={(e) => {
+									this.formData.selfWebsitAmount = Number(this.formData.selfWebsitAmount).toFixed(2)
+									if (e && (Number(e) < 0)) {
+										return this.$message.warning('商户分账比例不能为0!');
+									}
+									if (e && (this.accAdd(Number(e), Number(that.formData.selfWorkerAmount)) > 100)) {
+										this.formData.selfWebsitAmount = 0
+										return this.$message.warning('商户与师傅分账比例和最大只能100%!');
+									} else {
+										that.formData.selfWorkerAmount = this.Subtr(100, e)
+									}
+								}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
+							</div>
+						</div>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.formData.normType == 'M' ? true : false,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', type: 'number' },
+				formItemAttributes: {
+					label: '外购配件商户分账金额',
+					prop: 'outWebsitAmount',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<div style="position: relative;">
+							<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+								<el-input v-model={this.formData.outWebsitAmount} disabled type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+							</div>
+						</div>
+					)
+				}
+			}, {
+				md: 24,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入备注内容', type: "textarea", rows: 5 },
+				formItemAttributes: {
+					label: '备注',
+					prop: 'remark',
+					rules: []
+				}
+			}]
 		}
 	},
-    formItems() {
-      return [{
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入', disabled: true },
-        formItemAttributes: {
-          label: '所属商户',
-          prop: 'companyName',
-          rules: [...required]
-        },
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'slot-component',
-        attributes: { },
-        formItemAttributes: {
-          label: '状态',
-          prop: 'status',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.status}>
-				    <el-radio disabled={this.formDialogType==2} label="ON">上架</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label="OFF">下架</el-radio>
-				</el-radio-group>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入配件名称', },
-        formItemAttributes: {
-          label: '配件名称',
-          prop: 'goodsName',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-select-add',
-		labelKey: 'dictValue',
-		valueKey: 'dictValue',
-		options: this.partsUnitList,
-        attributes: { placeholder: '请选择单位',filterable: true, clearable: true },
-        formItemAttributes: {
-          label: '单位',
-          prop: 'goodsStockUnit',
-          rules: [...required]
-        },
-		events: {
-			change:(e)=>{
-				this.$refs.formRef.validateField(['goodsStockUnit'],(valid, invalidFields, errLabels) => {})
+	methods: {
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				if (this.examineStatus) {
+					pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
+				}
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
 			}
-		}
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入配件代码' },
-        formItemAttributes: {
-          label: '配件代码',
-          prop: 'goodsCode',
-          rules: [...required]
-        }
-      }, {
-        md: 12,
-        isShow: true,
-        name: 'slot-component',
-        attributes: {},
-        formItemAttributes: {
-          label: '收费类型',
-          prop: 'normType',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.normType}>
-				    <el-radio disabled={this.formDialogType==2} label="M">配件物料</el-radio>
-					<el-radio disabled={this.formDialogType==2} label="S">服务收费</el-radio>
-				</el-radio-group>
-			)
-		}
-      }, {
-        md: 24,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'el-checkbox-add',
-		labelKey: 'dictValue',
-		valueKey: 'dictCode',
-        attributes: {},
-		options: this.brandList,
-        formItemAttributes: {
-          label: '适用品牌',
-          prop: 'brandList',
-          rules: [...required]
-        },
-		events: {
-			change:(e)=>{
-				this.$refs.formRef.validateField(['brandList'],(valid, invalidFields, errLabels) => {})
+		},
+		getTypeList(value, type) {
+			getTypeList({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.dict_type", "compare": "=", "value": `${value}` }, { "param": "a.status", "compare": "=", "value": "ON" }] }).then(res => {
+				this[type] = res.data.records
+			})
+		},
+		getCategoryList() {
+			getCategoryList({ "type": 2 }).then(res => {
+				this.categoryList = res.data
+			})
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'idCardImg') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
 			}
-		}
-      }, {
-        md: 24,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'el-checkbox-add',
-		labelKey: 'name',
-		valueKey: 'categoryId',
-        attributes: {},
-		options: this.categoryList,
-        formItemAttributes: {
-          label: '适用产品大类',
-          prop: 'categoryList',
-          rules: [...required]
-        },
-		events: {
-			change:(e)=>{
-				this.$refs.formRef.validateField(['categoryList'],(valid, invalidFields, errLabels) => {})
+			if (item.jname === 'selfWorkerAmount') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div>{row.normType == 'M' ? row.selfWorkerAmount : (row.selfWorkerAmount + '%')}</div>
+					)
+				}
 			}
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '销售价格',
-          prop: 'marketPrice',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.marketPrice} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-					</div>
-					<div style="color: #EA8000">注:维护网点销售给师傅的价格</div>
-				</div>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '收费标准',
-          prop: 'normAmount',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.normAmount} onChange={(e)=>{
-							this.formData.normAmount = Number(e).toFixed(2)
-							if(this.formData.selfWorkerAmount > e){
-								this.formData.normAmount = ''
-								return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
-							}else if(this.formData.outWorkerAmount > e){
-								this.formData.outWorkerAmount = ''
-								return this.$message.warning('外购配件师傅分账金额必须小于收费标准!');
-							}
-							this.formData.selfWebsitAmount = this.Subtr(e,this.formData.selfWorkerAmount)
-							this.formData.outWebsitAmount = this.Subtr(e,this.formData.outWorkerAmount)
-							this.$refs.formRef.validateField(['selfWebsitAmount'],(valid, invalidFields, errLabels) => {})
-							this.$refs.formRef.validateField(['outWebsitAmount'],(valid, invalidFields, errLabels) => {})
-						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-					</div>
-					<div style="color: #EA8000">注:分账金额需扣除手续费0.6%</div>
-				</div>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '自有库存师傅分账金额',
-          prop: 'selfWorkerAmount',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			const that = this
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.selfWorkerAmount} onChange={(e)=>{
-							this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
-							if(e && (Number(e) > Number(that.formData.normAmount))){
-								that.formData.selfWorkerAmount = ''
-								return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
-							}
-							that.formData.selfWebsitAmount =  this.Subtr(that.formData.normAmount,e)
-						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-					</div>
-				</div>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?false:true,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '师傅分账比例',
-          prop: 'selfWorkerAmount',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			const that = this
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.selfWorkerAmount} onChange={(e)=>{
-							this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
-							if(e && (Number(e) < 0)){
-								return this.$message.warning('师傅分账比例不能为0!');
-							}
-							if(e && (this.accAdd(Number(e),Number(that.formData.selfWebsitAmount)) >100)){
-								this.formData.selfWorkerAmount = 0
-								return this.$message.warning('商户与师傅分账比例和最大只能100%!');
-							}else{
-								that.formData.selfWebsitAmount = this.Subtr(100,e)
-							}
-						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
-					</div>
-				</div>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '外购配件师傅分账金额',
-          prop: 'outWorkerAmount',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			const that = this
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.outWorkerAmount} onChange={(e)=>{
-							this.formData.outWorkerAmount = Number(this.formData.outWorkerAmount).toFixed(2)
-							if(Number(e) > Number(that.formData.normAmount)){
-								this.formData.outWorkerAmount = ''
-								return this.$message.warning('外购配件师傅分账金额必须小于收费标准!');
-							}
-							this.formData.outWebsitAmount = this.Subtr(this.formData.normAmount,e)
-						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-					</div>
-				</div>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '自有库存商户分账金额',
-          prop: 'selfWebsitAmount',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.selfWebsitAmount} disabled type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-					</div>
-				</div>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?false:true,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '商户分账比例',
-          prop: 'selfWebsitAmount',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			const that = this
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.selfWebsitAmount} onChange={(e)=>{
-							this.formData.selfWebsitAmount = Number(this.formData.selfWebsitAmount).toFixed(2)
-							if(e && (Number(e) < 0)){
-								return this.$message.warning('商户分账比例不能为0!');
-							}
-							if(e && (this.accAdd(Number(e),Number(that.formData.selfWorkerAmount)) >100)){
-								this.formData.selfWebsitAmount = 0
-								return this.$message.warning('商户与师傅分账比例和最大只能100%!');
-							}else{
-								that.formData.selfWorkerAmount = this.Subtr(100,e)
-							}
-						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
-					</div>
-				</div>
-			)
-		}
-      }, {
-        md: 12,
-        isShow: this.formData.normType == 'M'?true:false,
-        name: 'slot-component',
-        attributes: { placeholder: '请输入', type: 'number' },
-        formItemAttributes: {
-          label: '外购配件商户分账金额',
-          prop: 'outWebsitAmount',
-          rules: [...required]
-        },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<div style="position: relative;">
-					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.outWebsitAmount} disabled type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-					</div>
-				</div>
-			)
-		}
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入备注内容',type: "textarea", rows: 5 },
-        formItemAttributes: {
-          label: '备注',
-          prop: 'remark',
-          rules: []
-        }
-      }]
-    }
-  },
-  methods: {
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.examineStatus) {
-	      pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
-	    }
-		cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-	getTypeList(value,type){
-		getTypeList({"pageNum":1,"pageSize":-1,"params":[{"param":"a.dict_type","compare":"=","value":`${value}`},{"param":"a.status","compare":"=","value": "ON"}]}).then(res => {
-		   this[type] = res.data.records
-		})
-	},
-	getCategoryList(){
-		getCategoryList({"type":2}).then(res => {
-		   this.categoryList = res.data
-		})
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		 	defaultData.render = (h, { row, index, column }) => {
-		   		return (
-		     		<div style="padding:0 6px;cursor: pointer;">
-		    	   		{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		    	 	</div>
-		   		)
-		 	}
-		}
-		if(item.jname === 'selfWorkerAmount'){
-			defaultData.render = (h, { row, index, column }) => {
-			  	return (
-			   		<div>{row.normType == 'M'?row.selfWorkerAmount:(row.selfWorkerAmount + '%')}</div>
-			  	)
+			if (item.jname === 'selfWebsitAmount') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div>{row.normType == 'M' ? row.selfWebsitAmount : (row.selfWebsitAmount + '%')}</div>
+					)
+				}
 			}
-		}
-		if(item.jname === 'selfWebsitAmount'){
-			defaultData.render = (h, { row, index, column }) => {
-			  	return (
-			   		<div>{row.normType == 'M'?row.selfWebsitAmount: (row.selfWebsitAmount + '%')}</div>
-			  	)
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit: {
+					click: ({ row, index, column }) => {
+						getDetail({ id: row.goodsId }).then(res => {
+							Object.assign(this.formData, res.data, {
+								brandList: res.data.brandList ? res.data.brandList : [],
+								categoryList: res.data.categoryList ? res.data.categoryList : [],
+
+							})
+							console.log(this.formData)
+							this.formDialogType = 1
+							this.openForm()
+						})
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+			console.log(this.partsUnitList, this.brandList, this.categoryList)
+		},
+		openForm() {
+			this.getTypeList('PARTS_UNIT', 'partsUnitList')
+			this.getTypeList('BRAND', 'brandList')
+			this.getCategoryList()
+			this.formDialog = true;
+		},
+		formCancel() {
+			this.$refs.formRef.$refs.inlineForm.clearValidate()
+			this.$data.formData = this.$options.data().formData
+			this.formDialog = false
+		},
+		updateStatus(stateEnum) {
+			if (this.recordSelected.length == 0) {
+				return this.$message.warning('请至少勾选一条数据!');
 			}
-		}
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-		    getDetail({ id: row.goodsId }).then(res => {
-		      Object.assign(this.formData, res.data, {
-				  brandList: res.data.brandList?res.data.brandList:[],
-				  categoryList: res.data.categoryList?res.data.categoryList:[],
-				  
-			  })
-			   console.log(this.formData)
-		      this.formDialogType = 1
-		      this.openForm()
-		    })
-		  }}>编辑</el-button>
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-	  console.log(this.partsUnitList,this.brandList,this.categoryList)
-    },
-    openForm() {
-	  this.getTypeList('PARTS_UNIT','partsUnitList')
-	  this.getTypeList('BRAND','brandList')
-	  this.getCategoryList()
-      this.formDialog = true;
-    },
-    formCancel() {
-      this.$refs.formRef.$refs.inlineForm.clearValidate()
-      this.$data.formData = this.$options.data().formData
-      this.formDialog = false
-    },
-	updateStatus(stateEnum){
-		if(this.recordSelected.length == 0){
-			return this.$message.warning('请至少勾选一条数据!');
-		}
-		console.log(this.recordSelected)
-		this.$confirm(`请确认是否${stateEnum=='OFF'?'下架':'上架'}该配件, 是否继续?`, '提示', {
-			confirmButtonText: '确定',
-			cancelButtonText: '取消',
-			type: 'warning'
-		}).then(() => {
-			updateStatus({
-				stateEnum,
-				ids: this.recordSelected.map(item=>{return item.goodsId}).join(',')
-			}).then(res => {
-				if (res.code == 200) {
-					this.$message({ type: 'success', message: `${stateEnum=='ON'?'上架':'下架'}成功!` })
-					this.$refs.pageRef.refreshList()
-				} else {
-					this.$message.error(res.msg);
+			console.log(this.recordSelected)
+			this.$confirm(`请确认是否${stateEnum == 'OFF' ? '下架' : '上架'}该配件, 是否继续?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				updateStatus({
+					stateEnum,
+					ids: this.recordSelected.map(item => { return item.goodsId }).join(',')
+				}).then(res => {
+					if (res.code == 200) {
+						this.$message({ type: 'success', message: `${stateEnum == 'ON' ? '上架' : '下架'}成功!` })
+						this.$refs.pageRef.refreshList()
+					} else {
+						this.$message.error(res.msg);
+					}
+				})
+			});
+		},
+		formConfirm() {
+			this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+				if (valid) {
+					([add, edit][this.formDialogType])(this.formData).then(res => {
+						this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+						this.formCancel()
+						this.$refs.pageRef.refreshList()
+					})
 				}
 			})
-		});
-	},
-    formConfirm() {
-      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-        if (valid) {
-          ([add, edit][this.formDialogType])(this.formData).then(res => {
-            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
-            this.formCancel()
-            this.$refs.pageRef.refreshList()
-          })
-        }
-      })
-    },
-	// 下载导入模版
-	handleDownload1() {
-		commonTemplateDownload({ name: '配件模板(配件物料).xlsx' }, `${this.$route.meta.title}`).then(res => {
-		    this.$message({
-		        message: '下载成功',
-		        type: 'success'
-		    })
-		}).catch(err => {
-		    this.$message.error('下载失败')
-		})
-	  // downloadFiles('charging/standard/download');
-	},
-	handleDownload2() {
-		commonTemplateDownload({ name: '配件模板(服务收费).xlsx' }, `${this.$route.meta.title}`).then(res => {
-		    this.$message({
-		        message: '下载成功',
-		        type: 'success'
-		    })
-		}).catch(err => {
-		    this.$message.error('下载失败')
-		})
-	  // downloadFiles('charging/standard/download');
-	},
-  }
+		},
+		// 下载导入模版
+		handleDownload1() {
+			commonTemplateDownload({ name: '配件模板(配件物料).xlsx' }, `${this.$route.meta.title}`).then(res => {
+				this.$message({
+					message: '下载成功',
+					type: 'success'
+				})
+			}).catch(err => {
+				this.$message.error('下载失败')
+			})
+			// downloadFiles('charging/standard/download');
+		},
+		handleDownload2() {
+			commonTemplateDownload({ name: '配件模板(服务收费).xlsx' }, `${this.$route.meta.title}`).then(res => {
+				this.$message({
+					message: '下载成功',
+					type: 'success'
+				})
+			}).catch(err => {
+				this.$message.error('下载失败')
+			})
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 88 - 88
src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryChargeManagement/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <el-dialog title="" width="860px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -25,34 +25,76 @@ import { materialNormList, materialNormListExport, materialNormAdd, materialNorm
 import { materialCategoryTree } from "@/api/auxiliaryMaterialClass";
 import { getTypeList } from "@/api/auxiliaryFittings/attachmentProfile";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ["新增", "编辑"],
+      formDialog: false,
+      formData: {
+        companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        "categoryId": "",
+        "companyWechatId": "",
+        "createBy": "",
+        "createTime": "",
+        "normAmount": 0,
+        "normCode": "",
+        "normId": "",
+        "normName": "",
+        "normType": "",
+        "outWebsitAmount": 0,
+        "outWorkerAmount": 0,
+        "parentCategoryId": "",
+        "remark": "",
+        "selfWebsitAmount": 0,
+        "selfWorkerAmount": 0,
+        "specification": "",
+        "status": "ON",
+        "unit": "",
+      },
+      partsUnitList: [],
+      materialCategoryTree: []
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
         [
           [
-            {
-              name: '新建',
-              isRole: true,
+            this.optionsEvensAuth("add", {
               click: this.addData
-            }
+            }),
           ],
           [
-            {
+            this.optionsEvensAuth(["imp", "template"], {
               name: '导入物料',
               click: () => { }
-            },
-            {
-              name: '导入物料收费',
-              render: () => {
-                return this.importButton(materialNormImport, '导入物料收费')
+            }),
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(materialNormImport, moduleName)
+                }
               }
-            },
-            {
-              name: '下载物料收费模板',
+            }),
+            this.optionsEvensAuth("template", {
               click: () => {
                 commonTemplateDownload({ name: '辅材收费标准模板(物料收费).xlsx' }, `辅材收费标准模板(物料收费)`)
                   .then(res => {
@@ -65,21 +107,22 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            },
+            }),
           ],
           [
-            {
+            this.optionsEvensAuth(["Import", "downloadTemplate"], {
               name: '导入服务',
               click: () => { }
-            },
-            {
-              name: '导入服务收费',
-              render: () => {
-                return this.importButton(materialNormImport2, '导入服务收费')
+            }),
+            this.optionsEvensAuth("Import", ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(materialNormImport2, moduleName)
+                }
               }
-            },
-            {
-              name: '下载服务收费模板',
+            }),
+            this.optionsEvensAuth("downloadTemplate", {
               click: () => {
                 commonTemplateDownload({ name: '辅材收费标准模板(服务收费).xlsx' }, `辅材收费标准模板(服务收费)`)
                   .then(res => {
@@ -92,14 +135,12 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            },
+            }),
           ],
         ],
         [
           [
-            {
-              name: '批量上架',
-              isRole: true,
+            this.optionsEvensAuth("batchLaunch", {
               click: () => {
                 if (this.recordSelected.length) {
                   this.setRowStatus("ON")
@@ -110,12 +151,10 @@ export default {
                   });
                 }
               }
-            }
+            }),
           ],
           [
-            {
-              name: '批量下架',
-              isRole: true,
+            this.optionsEvensAuth("batchRemoval", {
               click: () => {
                 if (this.recordSelected.length) {
                   this.setRowStatus("OFF")
@@ -126,51 +165,11 @@ export default {
                   });
                 }
               }
-            }
-          ],
-        ],
-      ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增", "编辑"],
-      formDialog: false,
-      formData: {
-        companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-        "categoryId": "",
-        "companyWechatId": "",
-        "createBy": "",
-        "createTime": "",
-        "normAmount": 0,
-        "normCode": "",
-        "normId": "",
-        "normName": "",
-        "normType": "",
-        "outWebsitAmount": 0,
-        "outWorkerAmount": 0,
-        "parentCategoryId": "",
-        "remark": "",
-        "selfWebsitAmount": 0,
-        "selfWorkerAmount": 0,
-        "specification": "",
-        "status": "ON",
-        "unit": "",
-      },
-      partsUnitList: [],
-      materialCategoryTree: []
-    }
-  },
-  computed: {
+            }),
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -411,20 +410,21 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
             materialNormDetail({ id: row.normId }).then(res => {
               Object.assign(this.formData, res.data)
               this.formDialogType = 1
               this.openForm()
             })
-          }}>编辑</el-button>
-        </div>
-      )
+          }
+        },
+      })
     },
+
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 6 - 4
src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryMaterialClass/index.vue

@@ -3,7 +3,8 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button size="small" type="primary" icon="el-icon-plus" @click="addData">添加</el-button>
+          <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus"
+            @click="addData">添加</el-button>
         </div>
       </div>
       <div class="table">
@@ -18,9 +19,10 @@
           <el-table-column align="center" prop="sort" label="排序"></el-table-column>
           <el-table-column align="right" label="操作" width="120" fixed="right">
             <template slot-scope="scope">
-              <el-button v-if="scope.row.parentCategoryId == 0" type="primary" size="mini" icon="el-icon-plus"
-                @click="addDatapat(scope.row)"></el-button>
-              <el-button type="primary" size="mini" icon="el-icon-edit" @click="setDataup(scope.row)"></el-button>
+              <el-button v-if="scope.row.parentCategoryId == 0 && $restrict('add')" type="primary" size="mini"
+                icon="el-icon-plus" @click="addDatapat(scope.row)"></el-button>
+              <el-button v-if="$restrict('edit')" type="primary" size="mini" icon="el-icon-edit"
+                @click="setDataup(scope.row)"></el-button>
             </template>
           </el-table-column>
         </el-table>

+ 83 - 84
src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryPriceManagement/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <el-dialog title="" width="860px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -25,84 +25,12 @@ import { websitGoodsmImport, materialNormList, materialNormListExport, materialN
 import { materialCategoryTree } from "@/api/auxiliaryMaterialClass";
 import { getTypeList } from "@/api/auxiliaryFittings/attachmentProfile";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新建',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-          [
-            {
-              name: '导入辅材',
-              click: () => { }
-            },
-            {
-              name: '导入辅材模板',
-              render: () => {
-                return this.importButton(websitGoodsmImport, '导入辅材模板')
-              }
-            },
-            {
-              name: '下载辅材模板',
-              click: () => {
-                commonTemplateDownload({ name: '辅材模板.xlsx' }, `辅材模板`)
-                  .then(res => {
-                    this.$message({
-                      message: '下载成功',
-                      type: 'success'
-                    })
-                  })
-                  .catch(err => {
-                    this.$message.error('下载失败')
-                  })
-              }
-            },
-          ],
-        ],
-        [
-          [
-            {
-              name: '批量上架',
-              isRole: true,
-              click: () => {
-                if (this.recordSelected.length) {
-                  this.setRowStatus("ON")
-                } else {
-                  this.$message({
-                    type: 'warning',
-                    message: `请先勾选需要设置的数据!`,
-                  });
-                }
-              }
-            }
-          ],
-          [
-            {
-              name: '批量下架',
-              isRole: true,
-              click: () => {
-                if (this.recordSelected.length) {
-                  this.setRowStatus("OFF")
-                } else {
-                  this.$message({
-                    type: 'warning',
-                    message: `请先勾选需要设置的数据!`,
-                  });
-                }
-              }
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -153,6 +81,76 @@ export default {
     }
   },
   computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth("add", {
+              click: this.addData
+            }),
+          ],
+          [
+            this.optionsEvensAuth(["imp", "template"], {
+              name: '导入辅材',
+              click: () => { }
+            }),
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(websitGoodsmImport, moduleName)
+                }
+              }
+            }),
+            this.optionsEvensAuth("template", {
+              click: () => {
+                commonTemplateDownload({ name: '辅材模板.xlsx' }, `辅材模板`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            }),
+          ],
+        ],
+        [
+          [
+            this.optionsEvensAuth("batchLaunch", {
+              click: () => {
+                if (this.recordSelected.length) {
+                  this.setRowStatus("ON")
+                } else {
+                  this.$message({
+                    type: 'warning',
+                    message: `请先勾选需要设置的数据!`,
+                  });
+                }
+              }
+            }),
+          ],
+          [
+            this.optionsEvensAuth("batchRemoval", {
+              click: () => {
+                if (this.recordSelected.length) {
+                  this.setRowStatus("OFF")
+                } else {
+                  this.$message({
+                    type: 'warning',
+                    message: `请先勾选需要设置的数据!`,
+                  });
+                }
+              }
+            }),
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -304,20 +302,21 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
+
+    operation() {
+			return this.operationBtn({
+				edit: {
+					click: ({ row, index, column }) => {
             materialNormDetail({ id: row.goodsId }).then(res => {
               Object.assign(this.formData, res.data)
               this.formDialogType = 1
               this.openForm()
             })
-          }}>编辑</el-button>
-        </div>
-      )
-    },
+					}
+				},
+			})
+		},
+
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 31 - 33
src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventory/index.vue

@@ -10,17 +10,32 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { websitStockList, websitStockListExport, websitStockImportM, } from "@/api/inventoryManagement";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
         [
           [
-            {
-              name: '辅材网点库存模板',
+            this.optionsEvensAuth("template", {
               click: () => {
                 commonTemplateDownload({ name: '辅材网点库存.xlsx' }, `${this.$route.meta.title}`)
                   .then(res => {
@@ -33,32 +48,21 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            }
+            }),
           ],
           [
-            {
-              name: '导入模板',
-              render: () => {
-                return this.importButton(websitStockImportM, '导入模板')
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(websitStockImportM, moduleName)
+                }
               }
-            }
+            }),
           ],
-        ],
-      ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-    }
-  },
-  computed: {
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -77,12 +81,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 0 - 6
src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventoryDetails/index.vue

@@ -49,12 +49,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 0 - 6
src/views/auxiliaryFittings/inventoryManagement/masterAuInvenDetails/index.vue

@@ -49,12 +49,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 31 - 33
src/views/auxiliaryFittings/inventoryManagement/masterAuxiliaryInven/index.vue

@@ -10,17 +10,32 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { workerStockList, workerStockListExport, workerStockImportM, } from "@/api/inventoryManagement";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
         [
           [
-            {
-              name: '辅材师傅库存模板',
+            this.optionsEvensAuth("template", {
               click: () => {
                 commonTemplateDownload({ name: '辅材师傅库存.xlsx' }, `${this.$route.meta.title}`)
                   .then(res => {
@@ -33,32 +48,21 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            }
+            }),
           ],
           [
-            {
-              name: '导入模板',
-              render: () => {
-                return this.importButton(workerStockImportM, '导入模板')
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(workerStockImportM, moduleName)
+                }
               }
-            }
+            }),
           ],
-        ],
-      ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-    }
-  },
-  computed: {
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -77,12 +81,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 0 - 6
src/views/auxiliaryFittings/inventoryManagement/masterPaInvenDetails/index.vue

@@ -49,12 +49,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 31 - 33
src/views/auxiliaryFittings/inventoryManagement/masterPartsInven/index.vue

@@ -10,17 +10,32 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { workerStockListP, workerStockListPExport, workerStockImportP, } from "@/api/inventoryManagement";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
         [
           [
-            {
-              name: '配件师傅库存模板',
+            this.optionsEvensAuth("template", {
               click: () => {
                 commonTemplateDownload({ name: '配件师傅库存.xlsx' }, `${this.$route.meta.title}`)
                   .then(res => {
@@ -33,32 +48,21 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            }
+            }),
           ],
           [
-            {
-              name: '导入模板',
-              render: () => {
-                return this.importButton(workerStockImportP, '导入模板')
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(workerStockImportP, moduleName)
+                }
               }
-            }
+            }),
           ],
-        ],
-      ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-    }
-  },
-  computed: {
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -77,12 +81,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 31 - 33
src/views/auxiliaryFittings/inventoryManagement/partsInventory/index.vue

@@ -10,17 +10,32 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { websitStockListP, websitStockListPExport, websitStockImportP, } from "@/api/inventoryManagement";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
         [
           [
-            {
-              name: '配件网点库存模板',
+            this.optionsEvensAuth("template", {
               click: () => {
                 commonTemplateDownload({ name: '配件网点库存.xlsx' }, `${this.$route.meta.title}`)
                   .then(res => {
@@ -33,32 +48,21 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            }
+            }),
           ],
           [
-            {
-              name: '导入模板',
-              render: () => {
-                return this.importButton(websitStockImportP, '导入模板')
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(websitStockImportP, moduleName)
+                }
               }
-            }
+            }),
           ],
-        ],
-      ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-    }
-  },
-  computed: {
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -77,12 +81,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 0 - 6
src/views/auxiliaryFittings/inventoryManagement/partsInventoryDetails/index.vue

@@ -49,12 +49,6 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'></div>
-      )
-    },
   }
 }
 </script>

+ 27 - 15
src/views/auxiliaryFittings/purchasingManagement/components/inStorage.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
     :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
-    :column-parsing="columnParsing" :operation="operation" :replaceOrNotMap="false">
+    :column-parsing="columnParsing" :operation="operation()" :replaceOrNotMap="false">
     <div class="cartographer">
       <el-dialog :title="({ M: '辅材入库单', P: '配件入库单' })[storageType]" width="100%" :modal="false" :visible.sync="formDialog"
         :before-close="formCancel">
@@ -28,6 +28,7 @@
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 import form_tpl from "../mixins/form_tpl.js"
 import { websitPurchaseInList, websitPurchaseInListExport, websitPurchaseInAdd, websitPurchaseInEdit, websitPurchaseInConfirm, websitPurchaseInDetail } from "@/api/purchasingManagement.js"
 export default {
@@ -38,7 +39,7 @@ export default {
     }
   },
   components: { TemplatePage },
-  mixins: [import_mixin, form_tpl],
+  mixins: [import_mixin, form_tpl, operation_mixin],
   data() {
     return {
       formData: {
@@ -78,22 +79,33 @@ export default {
     },
     // 列表导出函数
     exportList: websitPurchaseInListExport,
-    // 操作按钮
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == "SAVE"
+          },
+          click: ({ row, index, column }) => {
             this.getDetail(row.purchaseId, 1)
-          }}>编辑</el-button> : null}
-          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
-            this.getDetail(row.purchaseId, 3)
-          }}>审核</el-button> : null}
-          <el-button type="text" onClick={() => {
+          }
+        },
+        detail: {
+          click: ({ row, index, column }) => {
             this.getDetail(row.purchaseId, 2)
-          }}>详情</el-button>
-        </div>
-      )
+          }
+        },
+        examine: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == "SAVE"
+          },
+          click: ({ row, index, column }) => {
+            this.getDetail(row.purchaseId, 3)
+          }
+        },
+      })
     },
+
     getDetail(purchaseId, type) {
       websitPurchaseInDetail({ purchaseId }).then(res => {
         Object.assign(this.formData, res.data, {

+ 27 - 15
src/views/auxiliaryFittings/purchasingManagement/components/retStorage.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
     :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
-    :column-parsing="columnParsing" :operation="operation" :replaceOrNotMap="false">
+    :column-parsing="columnParsing" :operation="operation()" :replaceOrNotMap="false">
     <div class="cartographer">
       <el-dialog :title="({ M: '辅材退货单', P: '配件退货单' })[storageType]" width="100%" :modal="false" :visible.sync="formDialog"
         :before-close="formCancel">
@@ -29,6 +29,7 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import form_tpl from "../mixins/form_tpl.js"
+import operation_mixin from '@/components/template/operation_mixin.js'
 import { websitPurchaseRetList, websitPurchaseRetListExport, websitPurchaseRetAdd, websitPurchaseRetEdit, websitPurchaseRetConfirm, websitPurchaseRetDetail } from "@/api/purchasingManagement.js"
 export default {
   props: {
@@ -38,7 +39,7 @@ export default {
     }
   },
   components: { TemplatePage },
-  mixins: [import_mixin, form_tpl],
+  mixins: [import_mixin, form_tpl, operation_mixin],
   data() {
     return {
       formData: {
@@ -80,22 +81,33 @@ export default {
     },
     // 列表导出函数
     exportList: websitPurchaseRetListExport,
-    // 操作按钮
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == "SAVE"
+          },
+          click: ({ row, index, column }) => {
             this.getDetail(row.purchaseRetId, 1)
-          }}>编辑</el-button> : null}
-          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
-            this.getDetail(row.purchaseRetId, 3)
-          }}>审核</el-button> : null}
-          <el-button type="text" onClick={() => {
+          }
+        },
+        detail: {
+          click: ({ row, index, column }) => {
             this.getDetail(row.purchaseRetId, 2)
-          }}>详情</el-button>
-        </div>
-      )
+          }
+        },
+        examine: {
+          conditions: ({ row, index, column }) => {
+            return row.flag == "SAVE"
+          },
+          click: ({ row, index, column }) => {
+            this.getDetail(row.purchaseRetId, 3)
+          }
+        },
+      })
     },
+
     getDetail(purchaseRetId, type) {
       websitPurchaseRetDetail({ purchaseRetId }).then(res => {
         Object.assign(this.formData, res.data, {

+ 49 - 47
src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js

@@ -10,22 +10,42 @@ import { required, mobileRequired, mobile } from '@/components/template/rules_ve
 export default {
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      formDialog: false,
+      formDialogType: 0, // 0:新增, 1:编辑, 2:查看, 3:审核
+      formDialogTitles: ['新增', '编辑', '查看', '审核'],
+      pageType: this?.$route?.name,
+      materialCategoryListL1: [],
+      materialCategoryListL2: [],
+      materialNormList: [],
+      peijianList: [],
+      websitPurchaseInList: []
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup(){
+      return [
         [
           [
-            {
-              name: '新建',
-              isRole: true,
+            this.optionsEvensAuth("add", {
               click: this.addData
-            }
+            }),
           ],
         ],
         [
           [
-            {
+            this.optionsEvensAuth("template", {
               isRole: !!~['auxiliaryMaterialsStorage', 'partsStorage'].indexOf(this?.$route?.name),
-              name: '采购入库模板',
               click: () => {
                 commonTemplateDownload({ name: '采购入库模板.xlsx' }, `${this.$route.meta.title}`)
                   .then(res => {
@@ -38,23 +58,24 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            }
+            }),
           ],
           [
-            {
-              isRole: !!~['auxiliaryMaterialsStorage', 'partsStorage'].indexOf(this?.$route?.name),
-              name: '导入模板',
-              render: () => {
-                return this.importButton(websitPurchaseInImport, '导入模板', { goodsType: this.storageType })
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                isRole: !!~['auxiliaryMaterialsStorage', 'partsStorage'].indexOf(this?.$route?.name),
+                name: moduleName,
+                render: () => {
+                  return this.importButton(websitPurchaseInImport, moduleName, { goodsType: this.storageType })
+                }
               }
-            }
+            }),
           ],
         ],
         [
           [
-            {
+            this.optionsEvensAuth("template", {
               isRole: !!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this?.$route?.name),
-              name: '采购退货模板',
               click: () => {
                 commonTemplateDownload({ name: '采购退货模板.xlsx' }, `${this.$route.meta.title}`)
                   .then(res => {
@@ -67,41 +88,22 @@ export default {
                     this.$message.error('下载失败')
                   })
               }
-            }
+            }),
           ],
           [
-            {
-              isRole: !!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this?.$route?.name),
-              name: '导入模板',
-              render: () => {
-                return this.importButton(websitPurchaseRetImport, '导入模板', { goodsType: this.storageType })
+            this.optionsEvensAuth("imp", ({ moduleName }) => {
+              return {
+                isRole: !!~['returnAuxiliaryMaterials', 'partsReturn'].indexOf(this?.$route?.name),
+                name: moduleName,
+                render: () => {
+                  return this.importButton(websitPurchaseRetImport, moduleName, { goodsType: this.storageType })
+                }
               }
-            }
+            }),
           ],
         ],
-      ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      recordSelected: [],
-      formDialog: false,
-      formDialogType: 0, // 0:新增, 1:编辑, 2:查看, 3:审核
-      formDialogTitles: ['新增', '编辑', '查看', '审核'],
-      pageType: this?.$route?.name,
-      materialCategoryListL1: [],
-      materialCategoryListL2: [],
-      materialNormList: [],
-      peijianList: [],
-      websitPurchaseInList: []
-    }
-  },
-  computed: {
+      ]
+    },
     moreParameters() {
       return [
         {

+ 152 - 131
src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue

@@ -1,23 +1,22 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="110"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="flag" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-		    	<el-radio-button label="SAVE">保存</el-radio-button>
-		    	<el-radio-button label="SUBMIT">提交</el-radio-button>
-		    	<el-radio-button label="WAIT">待审核</el-radio-button>
-		    	<el-radio-button label="OK">审核通过</el-radio-button>
-		    	<!-- <el-radio-button label="FAIL">驳回</el-radio-button> -->
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :operationColumnWidth="110" :options-evens-group="optionsEvensGroup"
+			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="flag" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">保存</el-radio-button>
+					<el-radio-button label="SUBMIT">提交</el-radio-button>
+					<el-radio-button label="WAIT">待审核</el-radio-button>
+					<el-radio-button label="OK">审核通过</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<attachmentNewReturnDetail :id="id" @back="backList" :formType="formDialogType" :title="'配件新件返还' + formDialogTitles[formDialogType]"></attachmentNewReturnDetail>
+			<attachmentNewReturnDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'配件新件返还' + formDialogTitles[formDialogType]"></attachmentNewReturnDetail>
 		</div>
 	</div>
 </template>
@@ -29,126 +28,148 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/attachmentNewReturn";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/attachmentNewReturn";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload, attachmentNewReturnDetail },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-		id: '',
-		flag: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
+	components: { TemplatePage, ImageUpload, attachmentNewReturnDetail },
+	mixins: [import_mixin,operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			flag: ''
+		}
 	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { }
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' },{ "param": "a.type", "compare": "=", "value": 'NEW' },{'param': 'a.flag', "compare": "=", "value": this.flag})
-			cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			<el-button type="text" onClick={() => {
-				this.id = row.partsRetId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>{row.flag == 'SAVE'?'编辑':"详情"}</el-button>
-			{row.flag == 'SUBMIT'?<el-button type="text" onClick={() => {
-				this.id = row.partsRetId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>确认收货</el-button>:null}
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	// 下载导入模版
-	handleDownload() {
-	  // downloadFiles('charging/standard/download');
-	},
-  }
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' }, { "param": "a.type", "compare": "=", "value": 'NEW' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'idCardImg') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.partsRetId
+						this.formDialogType = 1
+						this.openForm()
+					}
+				},
+				detail: {
+					conditions: ({ row, index, column }) => {
+						return row.flag != 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.partsRetId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+				verify: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SUBMIT'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.partsRetId
+						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+						this.openForm()
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		// 下载导入模版
+		handleDownload() {
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 152 - 131
src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue

@@ -1,23 +1,22 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="110"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="flag" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-		    	<el-radio-button label="SAVE">保存</el-radio-button>
-		    	<el-radio-button label="SUBMIT">提交</el-radio-button>
-		    	<el-radio-button label="WAIT">待审核</el-radio-button>
-		    	<el-radio-button label="OK">审核通过</el-radio-button>
-		    	<!-- <el-radio-button label="FAIL">驳回</el-radio-button> -->
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :operationColumnWidth="110" :options-evens-group="optionsEvensGroup"
+			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="flag" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">保存</el-radio-button>
+					<el-radio-button label="SUBMIT">提交</el-radio-button>
+					<el-radio-button label="WAIT">待审核</el-radio-button>
+					<el-radio-button label="OK">审核通过</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<attachmentOldReturnDetail :id="id" @back="backList" :formType="formDialogType" :title="'配件旧件返还' + formDialogTitles[formDialogType]"></attachmentOldReturnDetail>
+			<attachmentOldReturnDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'配件旧件返还' + formDialogTitles[formDialogType]"></attachmentOldReturnDetail>
 		</div>
 	</div>
 </template>
@@ -29,126 +28,148 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/attachmentNewReturn";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/attachmentNewReturn";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload, attachmentOldReturnDetail },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-		id: '',
-		flag: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
+	components: { TemplatePage, ImageUpload, attachmentOldReturnDetail },
+	mixins: [import_mixin,operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			flag: ''
+		}
 	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { }
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' },{ "param": "a.type", "compare": "=", "value": 'OLD' },{'param': 'a.flag', "compare": "=", "value": this.flag})
-			cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			<el-button type="text" onClick={() => {
-				this.id = row.partsRetId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>{row.flag == 'SAVE'?'编辑':"详情"}</el-button>
-			{row.flag == 'SUBMIT'?<el-button type="text" onClick={() => {
-				this.id = row.partsRetId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>确认收货</el-button>:null}
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	// 下载导入模版
-	handleDownload() {
-	  // downloadFiles('charging/standard/download');
-	},
-  }
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' }, { "param": "a.type", "compare": "=", "value": 'OLD' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'idCardImg') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.partsRetId
+						this.formDialogType = 1
+						this.openForm()
+					}
+				},
+				detail: {
+					conditions: ({ row, index, column }) => {
+						return row.flag != 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.partsRetId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+				verify: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SUBMIT'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.partsRetId
+						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+						this.openForm()
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		// 下载导入模版
+		handleDownload() {
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 258 - 234
src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue

@@ -1,25 +1,25 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="140"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="flag" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-		    	<el-radio-button label="SAVE">保存</el-radio-button>
-		    	<el-radio-button label="SUBMIT">提交</el-radio-button>
-		    	<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
-		    	<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
-		    	<el-radio-button label="CANCEL">取消订单</el-radio-button>
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :operationColumnWidth="140" :options-evens-group="optionsEvensGroup"
+			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="flag" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">保存</el-radio-button>
+					<el-radio-button label="SUBMIT">提交</el-radio-button>
+					<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
+					<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
+					<el-radio-button label="CANCEL">取消订单</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<attachmentSalesOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'配件销售订单' + formDialogTitles[formDialogType]"></attachmentSalesOrderDetail>
+			<attachmentSalesOrderDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'配件销售订单' + formDialogTitles[formDialogType]"></attachmentSalesOrderDetail>
 		</div>
-		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList"  />
+		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
 	</div>
 </template>
 
@@ -30,167 +30,190 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 import { getWebsit } from "@/api/customerManagement";
 import printPreview from '../components/preview.vue'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
-
+import operation_mixin from '@/components/template/operation_mixin.js'
 disAutoConnect()
 export default {
-  components: { TemplatePage, ImageUpload, attachmentSalesOrderDetail, printPreview },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-	  id: '',
-	  flag: '',
-	  websitList:[]
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {},
-	filterArr(){
-		return function (arr, size) {
-		  //判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
-		  if (!arr.length || !size || size < 1) return []
-		  let [start, end, result] = [null, null, []]
-		  for (let i = 0; i < Math.ceil(arr.length / size); i++) {
-		    start = i * size
-		    end = start + size
-		    result.push(arr.slice(start, end))
-		  }
-		  return result
+	components: { TemplatePage, ImageUpload, attachmentSalesOrderDetail, printPreview },
+	mixins: [import_mixin,operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			flag: '',
+			websitList: []
 		}
-	}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
-	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
-	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' },{'param': 'a.flag', "compare": "=", "value": this.flag})
-		cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
 	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			<el-button type="text" onClick={() => {
-				this.id = row.salesId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>{row.flag == 'SAVE'?'编辑':"详情"}</el-button>
-			{row.flag == 'PAY_NOT_TAKE'?<el-button type="text" onClick={() => {
-				this.id = row.salesId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>确认提货</el-button>:null}
-			<el-button type="text" onClick={() => this.toPrint(row, 2)}>
-			  打印
-			</el-button>
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	getWebsit(){
-		getWebsit({type: 'C'}).then(res => {
-			this.websitList = res.data
-		})
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { },
+		filterArr() {
+			return function (arr, size) {
+				//判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
+				if (!arr.length || !size || size < 1) return []
+				let [start, end, result] = [null, null, []]
+				for (let i = 0; i < Math.ceil(arr.length / size); i++) {
+					start = i * size
+					end = start + size
+					result.push(arr.slice(start, end))
+				}
+				return result
+			}
+		}
 	},
-	// 点击打印
-	async toPrint(row, type) {
-		this.getWebsit()
-		let pagingData = []
-		const { data } = await getDetail({
-		  salesId: row.salesId
-		})
-		pagingData = this.filterArr(data.items,4)
-		// 初始化模板,否则生成的模板叠加
-		hiprint.init()
-		this.hiprintTemplate = new hiprint.PrintTemplate()
-		// 兼容批量打印
-		// let params = !type ? this.filterArr() : [row.salesId]
-		let len = pagingData.length
-		let loadingLen = len
-		// 使用 i-- 提升for效率
-		this.$startLoading()
-		for (let i = 0; i < len; i++) {
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
 			try {
-			let websitHtml = ''
-			let html = ''
-			let num = 0
-			let totalAmount = 0
-			pagingData[i].forEach(item=>{
-				totalAmount = (Number(item.saleAmount)*100 + totalAmount*100)/100
-				num += Number(item.salesQty)
-				html += `
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'P' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'idCardImg') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+		
+		operation() {
+			return this.operationBtn({
+				edit: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = 1
+						this.openForm()
+					}
+				},
+				detail: {
+					conditions: ({ row, index, column }) => {
+						return row.flag != 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+				verify: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'PAY_NOT_TAKE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+						this.openForm()
+					}
+				},
+				print: {
+					click: ({ row, index, column }) => {
+						this.toPrint(row, 2)
+					}
+				},
+			})
+		},
+
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		getWebsit() {
+			getWebsit({ type: 'C' }).then(res => {
+				this.websitList = res.data
+			})
+		},
+		// 点击打印
+		async toPrint(row, type) {
+			this.getWebsit()
+			let pagingData = []
+			const { data } = await getDetail({
+				salesId: row.salesId
+			})
+			pagingData = this.filterArr(data.items, 4)
+			// 初始化模板,否则生成的模板叠加
+			hiprint.init()
+			this.hiprintTemplate = new hiprint.PrintTemplate()
+			// 兼容批量打印
+			// let params = !type ? this.filterArr() : [row.salesId]
+			let len = pagingData.length
+			let loadingLen = len
+			// 使用 i-- 提升for效率
+			this.$startLoading()
+			for (let i = 0; i < len; i++) {
+				try {
+					let websitHtml = ''
+					let html = ''
+					let num = 0
+					let totalAmount = 0
+					pagingData[i].forEach(item => {
+						totalAmount = (Number(item.saleAmount) * 100 + totalAmount * 100) / 100
+						num += Number(item.salesQty)
+						html += `
 					<tr align="center">
 					<td>${item.goodsName || ''}</td>
 					<td>${item.goodsSpecification || ''}</td>
@@ -202,61 +225,61 @@ export default {
 					<td></td>
 					</tr>
 				`
-			})
-			this.websitList.slice(0,5).forEach(item=>{
-				websitHtml += `
+					})
+					this.websitList.slice(0, 5).forEach(item => {
+						websitHtml += `
 					<div style="display: flex;font-size: 14px;margin-bottom: 6px;">
 						<div style="margin-right: 10px;">${item.name}</div>
 						<div style="margin-right: 10px;">${item.websitPhone}</div>
 						<div>地址: ${item.address}</div>
 					</div>
 				`
-			})
-			// 模板基础配置
-			this.panel = this.hiprintTemplate.addPrintPanel({
-				height: 140,
-				width: 241,
-				fontFamily: '黑体',
-				fontSize: 13,
-				paperFooter: 340,
-				paperHeader: 10,
-				paperNumberDisabled: true
-			})
-		
-			// 获取收款单模板和基础配置
-			this.panel.addPrintHtml({
-				options: {
-				width: 633,
-				top: 30,
-				left: 20,
-				fontFamily: '黑体',
-				fontSize: 13,
-				content: this.setTableDom(data,html,websitHtml,totalAmount,num,len,i)
+					})
+					// 模板基础配置
+					this.panel = this.hiprintTemplate.addPrintPanel({
+						height: 140,
+						width: 241,
+						fontFamily: '黑体',
+						fontSize: 13,
+						paperFooter: 340,
+						paperHeader: 10,
+						paperNumberDisabled: true
+					})
+
+					// 获取收款单模板和基础配置
+					this.panel.addPrintHtml({
+						options: {
+							width: 633,
+							top: 30,
+							left: 20,
+							fontFamily: '黑体',
+							fontSize: 13,
+							content: this.setTableDom(data, html, websitHtml, totalAmount, num, len, i)
+						}
+					})
+
+					loadingLen--
+				} catch (error) {
+					console.log(999, error)
+					this.$endLoading()
+					return
 				}
-			})
-		
-			loadingLen--
-			} catch (error) {
-			console.log(999,error)
-			this.$endLoading()
-			return
 			}
-		}
-		if (loadingLen === 0) {
-			this.$endLoading()
-		}
-		console.log(333)
-		// 预览打印内容
-		this.$refs.preView.show(this.hiprintTemplate, this.panel)
-	},
-	// 打印模板
-	setTableDom(data,html,websitHtml,totalAmount,num,length,page) {
-	  return `
+			if (loadingLen === 0) {
+				this.$endLoading()
+			}
+			console.log(333)
+			// 预览打印内容
+			this.$refs.preView.show(this.hiprintTemplate, this.panel)
+		},
+		// 打印模板
+		setTableDom(data, html, websitHtml, totalAmount, num, length, page) {
+			return `
 	   <div style="font-family:'黑体';font-size: 16px;">
 			<div style="display: flex;justify-content: space-between;align-items: center;">
 				<div style="width: 28%;"></div>
 				<h1 style="text-align:center;margin: 10px 0;">${data.websitName}销售单</h1>
-				<div>共 ${length}页 第 ${page+1} 页</div>
+				<div>共 ${length}页 第 ${page + 1} 页</div>
 			</div>
 		  <div style="display: flex;justify-content: space-between;">
 			<div style="width: 28%;"></div>
@@ -265,7 +288,7 @@ export default {
 		  </div>
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
 		  	<div>客户: ${data.workerName}</div>
-		  	<div>摘要: ${data.payType == 'CASH'?'现金':'微信'}</div>
+		  	<div>摘要: ${data.payType == 'CASH' ? '现金' : '微信'}</div>
 		  </div>
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin-bottom: 10px;">
 		  	<div>联系电话: ${data.workerMobile}</div>
@@ -318,29 +341,30 @@ export default {
 	      </div>
 	   </div>
 	  `
-	},
-	handleRefreshList() {
-	  this.recordSelected = []
-	  this.$refs.pageRef.refreshList()
-	},
-	handleInitPrint() {
-	  this.$nextTick(() => {
-	    this.initPrint()
-	  })
-	},
-	// 下载导入模版
-	handleDownload() {
-	  // downloadFiles('charging/standard/download');
-	},
-  }
+		},
+		handleRefreshList() {
+			this.recordSelected = []
+			this.$refs.pageRef.refreshList()
+		},
+		handleInitPrint() {
+			this.$nextTick(() => {
+				this.initPrint()
+			})
+		},
+		// 下载导入模版
+		handleDownload() {
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 133 - 121
src/views/auxiliaryFittings/salesManagement/auxiliaryAdjustPriceOrder/index.vue

@@ -1,20 +1,20 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="flag" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-		    	<el-radio-button label="SAVE">已保存</el-radio-button>
-		    	<el-radio-button label="OK">已审核</el-radio-button>
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+			:column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="flag" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">已保存</el-radio-button>
+					<el-radio-button label="OK">已审核</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliaryAdjustPriceOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材调价单' + formDialogTitles[formDialogType]"></auxiliaryAdjustPriceOrderDetail>
+			<auxiliaryAdjustPriceOrderDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'辅材调价单' + formDialogTitles[formDialogType]"></auxiliaryAdjustPriceOrderDetail>
 		</div>
 	</div>
 </template>
@@ -26,119 +26,131 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
+import { listPageV2, pageExport } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload, auxiliaryAdjustPriceOrderDetail },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-	  id: '',
-	  flag: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
+	components: { TemplatePage, ImageUpload, auxiliaryAdjustPriceOrderDetail },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			flag: ''
+		}
 	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { }
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.flag) {
-	      pam.params.push({ "param": "a.flag", "compare": "=", "value": this.flag })
-	    }
-			cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  {row.flag == 'SAVE'?<el-button type="text" onClick={() => {
-			this.id = row.sheetId
-		    this.formDialogType = 1
-		    this.openForm()
-		  }}>编辑</el-button>:null}
-		  {row.flag == 'OK'?<el-button type="text" onClick={() => {
-		  	this.id = row.sheetId
-		    this.formDialogType = 2
-		    this.openForm()
-		  }}>详情</el-button>:null}
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	// 下载导入模版
-	handleDownload() {
-	  // downloadFiles('charging/standard/download');
-	},
-  }
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				if (this.flag) {
+					pam.params.push({ "param": "a.flag", "compare": "=", "value": this.flag })
+				}
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.sheetId
+						this.formDialogType = 1
+						this.openForm()
+					}
+				},
+				detail: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'OK'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.sheetId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		// 下载导入模版
+		handleDownload() {
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 260 - 239
src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue

@@ -1,25 +1,25 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="140"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="flag" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-				<el-radio-button label="SAVE">保存</el-radio-button>
-				<el-radio-button label="SUBMIT">提交</el-radio-button>
-		    	<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
-		    	<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
-		    	<el-radio-button label="CANCEL">取消订单</el-radio-button>
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :operationColumnWidth="140" :options-evens-group="optionsEvensGroup"
+			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="flag" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">保存</el-radio-button>
+					<el-radio-button label="SUBMIT">提交</el-radio-button>
+					<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
+					<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
+					<el-radio-button label="CANCEL">取消订单</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliarySalesOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
+			<auxiliarySalesOrderDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
 		</div>
-		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList"  />
+		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
 	</div>
 </template>
 
@@ -30,167 +30,189 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 import { getWebsit } from "@/api/customerManagement";
 import printPreview from '../components/preview.vue'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
-
+import operation_mixin from '@/components/template/operation_mixin.js'
 disAutoConnect()
 export default {
-  components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail, printPreview },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-		id: '',
-		flag: '',
-		websitList:[]
-	}
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {},
-	filterArr(){
-		return function (arr, size) {
-		  //判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
-		  if (!arr.length || !size || size < 1) return []
-		  let [start, end, result] = [null, null, []]
-		  for (let i = 0; i < Math.ceil(arr.length / size); i++) {
-		    start = i * size
-		    end = start + size
-		    result.push(arr.slice(start, end))
-		  }
-		  return result
+	components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail, printPreview },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			flag: '',
+			websitList: []
 		}
-	}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
-	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' },{'param': 'a.flag', "compare": "=", "value": this.flag})
-		cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			<el-button type="text" onClick={() => {
-				this.id = row.salesId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>{row.flag == 'SAVE'?'编辑':"详情"}</el-button>
-			{row.flag == 'PAY_NOT_TAKE'?<el-button type="text" onClick={() => {
-				this.id = row.salesId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>确认提货</el-button>:null}
-			<el-button type="text" onClick={() => this.toPrint(row, 2)}>
-			  打印
-			</el-button>
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	getWebsit(){
-		getWebsit({type: 'C'}).then(res => {
-			this.websitList = res.data
-		})
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { },
+		filterArr() {
+			return function (arr, size) {
+				//判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
+				if (!arr.length || !size || size < 1) return []
+				let [start, end, result] = [null, null, []]
+				for (let i = 0; i < Math.ceil(arr.length / size); i++) {
+					start = i * size
+					end = start + size
+					result.push(arr.slice(start, end))
+				}
+				return result
+			}
+		}
 	},
-	// 点击打印
-	async toPrint(row, type) {
-		this.getWebsit()
-		let pagingData = []
-		const { data } = await getDetail({
-		  salesId: row.salesId
-		})
-		pagingData = this.filterArr(data.items,4)
-		// 初始化模板,否则生成的模板叠加
-		hiprint.init()
-		this.hiprintTemplate = new hiprint.PrintTemplate()
-		// 兼容批量打印
-		// let params = !type ? this.filterArr() : [row.salesId]
-		let len = pagingData.length
-		let loadingLen = len
-		// 使用 i-- 提升for效率
-		this.$startLoading()
-		for (let i = 0; i < len; i++) {
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
 			try {
-			let websitHtml = ''
-			let html = ''
-			let num = 0
-			let totalAmount = 0
-			pagingData[i].forEach(item=>{
-				totalAmount = (Number(item.saleAmount)*100 + totalAmount*100)/100
-				num += Number(item.salesQty)
-				html += `
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'idCardImg') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = 1
+						this.openForm()
+					}
+				},
+				detail: {
+					conditions: ({ row, index, column }) => {
+						return row.flag != 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+				confirmDelivery: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'PAY_NOT_TAKE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+						this.openForm()
+					}
+				},
+				print: {
+					click: ({ row, index, column }) => {
+						this.toPrint(row, 2)
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		getWebsit() {
+			getWebsit({ type: 'C' }).then(res => {
+				this.websitList = res.data
+			})
+		},
+		// 点击打印
+		async toPrint(row, type) {
+			this.getWebsit()
+			let pagingData = []
+			const { data } = await getDetail({
+				salesId: row.salesId
+			})
+			pagingData = this.filterArr(data.items, 4)
+			// 初始化模板,否则生成的模板叠加
+			hiprint.init()
+			this.hiprintTemplate = new hiprint.PrintTemplate()
+			// 兼容批量打印
+			// let params = !type ? this.filterArr() : [row.salesId]
+			let len = pagingData.length
+			let loadingLen = len
+			// 使用 i-- 提升for效率
+			this.$startLoading()
+			for (let i = 0; i < len; i++) {
+				try {
+					let websitHtml = ''
+					let html = ''
+					let num = 0
+					let totalAmount = 0
+					pagingData[i].forEach(item => {
+						totalAmount = (Number(item.saleAmount) * 100 + totalAmount * 100) / 100
+						num += Number(item.salesQty)
+						html += `
 					<tr align="center">
 					<td>${item.goodsName}</td>
 					<td>${item.goodsSpecification}</td>
@@ -202,61 +224,60 @@ export default {
 					<td></td>
 					</tr>
 				`
-			})
-			this.websitList.slice(0,5).forEach(item=>{
-				websitHtml += `
+					})
+					this.websitList.slice(0, 5).forEach(item => {
+						websitHtml += `
 					<div style="display: flex;font-size: 14px;margin-bottom: 6px;">
 						<div style="margin-right: 10px;">${item.name}</div>
 						<div style="margin-right: 10px;">${item.websitPhone}</div>
 						<div>地址: ${item.address}</div>
 					</div>
 				`
-			})
-			// 模板基础配置
-			this.panel = this.hiprintTemplate.addPrintPanel({
-				height: 140,
-				width: 241,
-				fontFamily: '黑体',
-				fontSize: 13,
-				paperFooter: 340,
-				paperHeader: 10,
-				paperNumberDisabled: true
-			})
-		
-			// 获取收款单模板和基础配置
-			this.panel.addPrintHtml({
-				options: {
-				width: 633,
-				top: 30,
-				left: 20,
-				fontFamily: '黑体',
-				fontSize: 13,
-				content: this.setTableDom(data,html,websitHtml,totalAmount,num,len,i)
+					})
+					// 模板基础配置
+					this.panel = this.hiprintTemplate.addPrintPanel({
+						height: 140,
+						width: 241,
+						fontFamily: '黑体',
+						fontSize: 13,
+						paperFooter: 340,
+						paperHeader: 10,
+						paperNumberDisabled: true
+					})
+
+					// 获取收款单模板和基础配置
+					this.panel.addPrintHtml({
+						options: {
+							width: 633,
+							top: 30,
+							left: 20,
+							fontFamily: '黑体',
+							fontSize: 13,
+							content: this.setTableDom(data, html, websitHtml, totalAmount, num, len, i)
+						}
+					})
+
+					loadingLen--
+				} catch (error) {
+					console.log(999, error)
+					this.$endLoading()
+					return
 				}
-			})
-		
-			loadingLen--
-			} catch (error) {
-			console.log(999,error)
-			this.$endLoading()
-			return
 			}
-		}
-		if (loadingLen === 0) {
-			this.$endLoading()
-		}
-		console.log(333)
-		// 预览打印内容
-		this.$refs.preView.show(this.hiprintTemplate, this.panel)
-	},
-	// 打印模板
-	setTableDom(data,html,websitHtml,totalAmount,num,length,page) {
-	  return `
+			if (loadingLen === 0) {
+				this.$endLoading()
+			}
+			console.log(333)
+			// 预览打印内容
+			this.$refs.preView.show(this.hiprintTemplate, this.panel)
+		},
+		// 打印模板
+		setTableDom(data, html, websitHtml, totalAmount, num, length, page) {
+			return `
 	   <div style="font-family:'黑体';font-size: 16px;">
-			<div style="display: flex;justify-content: space-between;align-items: center;">
-				<div style="width: 28%;"></div>
+			<div style="display: flex;justify-content: center;align-items: center;position: relative;">
 				<h1 style="text-align:center;margin: 10px 0;">${data.websitName}销售单</h1>
-				<div>共 ${length}页 第 ${page+1} 页</div>
+				<div style="position: absolute;right:0;">共 ${length}页 第 ${page+1} 页</div>
 			</div>
 		  <div style="display: flex;justify-content: space-between;">
 			<div style="width: 28%;"></div>
@@ -265,12 +286,11 @@ export default {
 		  </div>
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
 		  	<div>客户: ${data.workerName}</div>
-		  	<div>摘要: ${data.payType == 'CASH'?'现金':'微信'}</div>
+		  	<div>摘要: ${data.payType == 'CASH' ? '现金' : '微信'}</div>
 		  </div>
-		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin-bottom: 10px;">
+		  <div style="display: flex;font-size: 16px;margin-bottom: 10px;">
 		  	<div>联系电话: ${data.workerMobile}</div>
-		  	<div>收货地址: </div>
-			<div style="width: 28%;"></div>
+		  	<div style="margin-left: 50px;">收货地址: </div>
 		  </div>
 	      <div >
 	        <table border=".5" cellspacing="0" width="856"
@@ -318,29 +338,30 @@ export default {
 	      </div>
 	   </div>
 	  `
-	},
-	handleRefreshList() {
-	  this.recordSelected = []
-	  this.$refs.pageRef.refreshList()
-	},
-	handleInitPrint() {
-	  this.$nextTick(() => {
-	    this.initPrint()
-	  })
-	},
-	// 下载导入模版
-	handleDownload() {
-		// downloadFiles('charging/standard/download');
-	},
-  }
+		},
+		handleRefreshList() {
+			this.recordSelected = []
+			this.$refs.pageRef.refreshList()
+		},
+		handleInitPrint() {
+			this.$nextTick(() => {
+				this.initPrint()
+			})
+		},
+		// 下载导入模版
+		handleDownload() {
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 139 - 131
src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue

@@ -1,23 +1,22 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="110"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="retState" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-		    	<el-radio-button label="SAVE">保存</el-radio-button>
-				<el-radio-button label="SUBMIT">提交</el-radio-button>
-				<el-radio-button label="WAIT">待审核</el-radio-button>
-		    	<el-radio-button label="OK">审核通过</el-radio-button>
-				<!-- <el-radio-button label="FAIL">驳回</el-radio-button> -->
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :operationColumnWidth="110" :options-evens-group="optionsEvensGroup"
+			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="retState" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">保存</el-radio-button>
+					<el-radio-button label="SUBMIT">提交</el-radio-button>
+					<el-radio-button label="WAIT">待审核</el-radio-button>
+					<el-radio-button label="OK">审核通过</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliarySalesReturnOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售退货单' + formDialogTitles[formDialogType]"></auxiliarySalesReturnOrderDetail>
+			<auxiliarySalesReturnOrderDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'辅材销售退货单' + formDialogTitles[formDialogType]"></auxiliarySalesReturnOrderDetail>
 		</div>
 	</div>
 </template>
@@ -29,126 +28,135 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload, auxiliarySalesReturnOrderDetail },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-		id: '',
-		retState: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
+	components: { TemplatePage, ImageUpload, auxiliarySalesReturnOrderDetail },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			retState: ''
+		}
 	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { }
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' },{'param': 'a.ret_state', "compare": "=", "value": this.retState})
-			cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			<el-button type="text" onClick={() => {
-				this.id = row.salesRetId
-				this.formDialogType = 2
-				this.openForm()
-			}}>查看</el-button>
-			{row.retState == 'WAIT'?<el-button type="text" onClick={() => {
-				this.id = row.salesRetId
-				this.formDialogType = 2
-				this.openForm()
-			}}>确认收货</el-button>:null}
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	// 下载导入模版
-	handleDownload() {
-	  // downloadFiles('charging/standard/download');
-	},
-  }
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.ret_state', "compare": "=", "value": this.retState })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'idCardImg') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				detail: {
+					click: ({ row, index, column }) => {
+						this.id = row.salesRetId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+				Confirm: {
+					conditions: ({ row, index, column }) => {
+						return row.retState == 'WAIT'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesRetId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		// 下载导入模版
+		handleDownload() {
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 2 - 1
src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue

@@ -38,7 +38,7 @@
 						</el-col>
 						<el-col :span="8">
 							<el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.buyPeople">
+								<el-radio-group v-model="formData.buyPeople" @change="formData.workerName = '';formData.workerMobile=''">
 								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="WORKER">内部师傅</el-radio>
 								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="CUSTOMER">客户</el-radio>
 								</el-radio-group>
@@ -270,6 +270,7 @@
 					],
 					workerMobile: [
 						{ required: true, message: '请输入联系电话', trigger: 'blur' },
+						{ required: true, message: '请输入联系电话', trigger: 'change' },
 						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
 					],
 					workerName: [

+ 2 - 1
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -38,7 +38,7 @@
 						</el-col>
 						<el-col :span="8">
 							<el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
-								<el-radio-group v-model="formData.buyPeople">
+								<el-radio-group v-model="formData.buyPeople" @change="formData.workerName = '';formData.workerMobile=''">
 								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="WORKER">内部师傅</el-radio>
 								    <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="CUSTOMER">客户</el-radio>
 								</el-radio-group>
@@ -296,6 +296,7 @@
 					],
 					workerMobile: [
 						{ required: true, message: `请输入联系电话`, trigger: 'blur' },
+						{ required: true, message: `请输入联系电话`, trigger: 'change' },
 						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
 					],
 					workerName: [

+ 55 - 46
src/views/auxiliaryFittings/salesManagement/transaction/index.vue

@@ -1,17 +1,22 @@
 <template>
-	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		</template-page>
-		<div class="detail" v-if="formDialog">
-			<auxiliarySalesOrderDetail v-if="orderSource == 'M_SALES'" :id="id" @back="backList" :formType="2" title="辅材销售订单详情"></auxiliarySalesOrderDetail>
-			<attachmentSalesOrderDetail v-if="orderSource == 'P_SALES'" :id="id" @back="backList" :formType="2" title="配件销售订单详情"></attachmentSalesOrderDetail>
-			<auxiliarySalesReturnOrderDetail v-if="orderSource == 'SALES_RET'" :id="id" @back="backList" :formType="2" title="辅材销售退货单详情"></auxiliarySalesReturnOrderDetail>
-			<attachmentNewReturnDetail v-if="orderSource == 'NEW_PARTS_RET'" :id="id" @back="backList" :formType="2" title="配件新件返还详情"></attachmentNewReturnDetail>
-			<attachmentOldReturnDetail v-if="orderSource == 'OLD_PARTS_RET'" :id="id" @back="backList" :formType="2" title="配件旧件返还详情"></attachmentOldReturnDetail>
-		</div>
-	</div>
+  <div class="page">
+    <template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+      :table-events="tableEvents" :operationColumnWidth="50" :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+    </template-page>
+    <div class="detail" v-if="formDialog">
+      <auxiliarySalesOrderDetail v-if="orderSource == 'M_SALES'" :id="id" @back="backList" :formType="2" title="辅材销售订单详情">
+      </auxiliarySalesOrderDetail>
+      <attachmentSalesOrderDetail v-if="orderSource == 'P_SALES'" :id="id" @back="backList" :formType="2"
+        title="配件销售订单详情"></attachmentSalesOrderDetail>
+      <auxiliarySalesReturnOrderDetail v-if="orderSource == 'SALES_RET'" :id="id" @back="backList" :formType="2"
+        title="辅材销售退货单详情"></auxiliarySalesReturnOrderDetail>
+      <attachmentNewReturnDetail v-if="orderSource == 'NEW_PARTS_RET'" :id="id" @back="backList" :formType="2"
+        title="配件新件返还详情"></attachmentNewReturnDetail>
+      <attachmentOldReturnDetail v-if="orderSource == 'OLD_PARTS_RET'" :id="id" @back="backList" :formType="2"
+        title="配件旧件返还详情"></attachmentOldReturnDetail>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -23,10 +28,11 @@ import auxiliarySalesReturnOrderDetail from '../components/auxiliarySalesReturnO
 import attachmentNewReturnDetail from '../components/attachmentNewReturnDetail.vue'
 import attachmentOldReturnDetail from '../components/attachmentOldReturnDetail.vue'
 import { downloadFiles } from '@/utils/util'
-import { listPageV2,pageExport } from "@/api/auxiliaryFittings/transaction";
+import { listPageV2, pageExport } from "@/api/auxiliaryFittings/transaction";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, auxiliarySalesOrderDetail, attachmentSalesOrderDetail, auxiliarySalesReturnOrderDetail, attachmentNewReturnDetail, attachmentOldReturnDetail},
-  mixins: [import_mixin],
+  components: { TemplatePage, auxiliarySalesOrderDetail, attachmentSalesOrderDetail, auxiliarySalesReturnOrderDetail, attachmentNewReturnDetail, attachmentOldReturnDetail },
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
       // 事件组合
@@ -43,9 +49,9 @@ export default {
       // 勾选选中行
       recordSelected: [],
       /** 表单变量 */
-	  id: '',
-	  orderSource: '',
-	  formDialog: false
+      id: '',
+      orderSource: '',
+      formDialog: false
     }
   },
   computed: {
@@ -56,7 +62,7 @@ export default {
   },
   methods: {
     // 列表请求函数
-		getList: listPageV2,
+    getList: listPageV2,
     // 列表导出函数
     exportList: pageExport,
     // 表格列解析渲染数据更改
@@ -67,36 +73,39 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-			this.id = row.orderId
-			this.orderSource = row.orderSource
-			if(row.orderSource){
-				this.formDialog = true
-			}else{
-				this.$message.warning('订单来源为空!')
-			}
-		  }}>查看</el-button>
-        </div>
-      )
+
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            this.id = row.orderId
+            this.orderSource = row.orderSource
+            if (row.orderSource) {
+              this.formDialog = true
+            } else {
+              this.$message.warning('订单来源为空!')
+            }
+          }
+        }
+      })
+    },
+
+    backList() {
+      this.id = ''
+      this.formDialog = false;
+      this.$refs.pageRef.refreshList()
     },
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
-	},
   }
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+  height: 100%;
+}
+
+.tab {
+  padding: 20px 20px 0 20px;
+}
 </style>

+ 191 - 179
src/views/auxiliaryFittings/settleAccountManagement/salesWithdraw/index.vue

@@ -1,17 +1,18 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="110"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  
-	  <div slot="moreSearch">
-	    <el-radio-group v-model="status" size="mini" @change="changeType">
-	    	<el-radio-button label="">全部</el-radio-button>
-	    	<el-radio-button label="0">待发放</el-radio-button>
-	    	<el-radio-button label="1">已发放</el-radio-button>
-	    </el-radio-group>
-	    <br><br>
-	  </div>
-		<el-dialog title="详情" width="80%" :modal="true" :visible.sync="formDialog" :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" @close="formDialog = false;formData = {}">
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+		:operationColumnWidth="110" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+		:column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+
+		<div slot="moreSearch">
+			<el-radio-group v-model="status" size="mini" @change="changeType">
+				<el-radio-button label="">全部</el-radio-button>
+				<el-radio-button label="0">待发放</el-radio-button>
+				<el-radio-button label="1">已发放</el-radio-button>
+			</el-radio-group>
+			<br><br>
+		</div>
+		<el-dialog title="详情" width="80%" :modal="true" :visible.sync="formDialog" :show-close="true"
+			:close-on-click-modal="false" :modal-append-to-body="false" @close="formDialog = false; formData = {}">
 			<el-card class="box-card">
 				<div slot="header" class="clearfix">
 					<span>提现信息</span>
@@ -19,47 +20,47 @@
 				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
 					<tr>
 						<td class="bold" align="center">提现类型</td>
-						<td>{{formData.type == 1?'销售提现':'服务提现'}}</td>
+						<td>{{ formData.type == 1 ? '销售提现' : '服务提现' }}</td>
 						<td class="bold" align="center">单据编号</td>
-						<td>{{formData.id}}</td>
+						<td>{{ formData.id }}</td>
 						<td class="bold" align="center">所属商户</td>
-						<td>{{formData.companyWechatName}}</td>
+						<td>{{ formData.companyWechatName }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">发放状态</td>
-						<td>{{formData.status == 0?'待发放':formData.status == 1?'已发放':''}}</td>
+						<td>{{ formData.status == 0 ? '待发放' : formData.status == 1 ? '已发放' : '' }}</td>
 						<td class="bold" align="center">师傅姓名</td>
-						<td>{{formData.workerName}}</td>
+						<td>{{ formData.workerName }}</td>
 						<td class="bold" align="center">师傅编号</td>
-						<td>{{formData.workerId}}</td>
+						<td>{{ formData.workerId }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">师傅身份证号</td>
-						<td>{{formData.idcard}}</td>
+						<td>{{ formData.idcard }}</td>
 						<td class="bold" align="center">师傅联系电话</td>
-						<td>{{formData.workerMobile}}</td>
+						<td>{{ formData.workerMobile }}</td>
 						<td class="bold" align="center">申请时间</td>
-						<td>{{formData.createTime}}</td>
+						<td>{{ formData.createTime }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">账户类型</td>
-						<td>{{formData.accountType}}</td>
+						<td>{{ formData.accountType }}</td>
 						<td class="bold" align="center">开户银行</td>
-						<td>{{formData.bank}}</td>
+						<td>{{ formData.bank }}</td>
 						<td class="bold" align="center">开户支行</td>
-						<td>{{formData.subBank}}</td>
+						<td>{{ formData.subBank }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">持卡人</td>
-						<td>{{formData.bankUserName}}</td>
+						<td>{{ formData.bankUserName }}</td>
 						<td class="bold" align="center">银行卡号</td>
-						<td>{{formData.bankNo}}</td>
+						<td>{{ formData.bankNo }}</td>
 						<td class="bold" align="center">提现金额</td>
-						<td>¥{{formData.amount}}</td>
+						<td>¥{{ formData.amount }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">备注</td>
-						<td colspan="5">{{formData.remark}}</td>
+						<td colspan="5">{{ formData.remark }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center"><span style="color: red;">*</span>转账凭证</td>
@@ -88,33 +89,37 @@
 						</tr>
 					</thead>
 					<tbody>
-						<tr v-for="(item,index) in formData.withdrawalOrderItems" :key="index">
-							<td align="center">{{item.id}}</td>
-							<td align="center">{{item.goodsType == 'M'?'辅材':'配件'}}</td>
+						<tr v-for="(item, index) in formData.withdrawalOrderItems" :key="index">
+							<td align="center">{{ item.id }}</td>
+							<td align="center">{{ item.goodsType == 'M' ? '辅材' : '配件' }}</td>
 							<!-- <td align="center">{{item.chargeType=='ACC'?'配件物料':item.chargeType=='SERV'?'服务收费':''}}</td> -->
-							<td align="center">{{item.num}}</td>
+							<td align="center">{{ item.num }}</td>
 							<!-- <td align="center">{{item.goodsAmount}}</td> -->
-							<td align="center">{{item.totalPrice}}</td>
-							<td align="center">{{item.settlementType == 'OWN'?'自有':item.settlementType == 'OUT'?'外购':''}}</td>
-							<td align="center">{{item.workerAmount}}</td>
-							<td align="center">{{item.websitAmount}}</td>
+							<td align="center">{{ item.totalPrice }}</td>
+							<td align="center">{{ item.settlementType == 'OWN' ? '自有' : item.settlementType == 'OUT' ? '外购' : '' }}</td>
+							<td align="center">{{ item.workerAmount }}</td>
+							<td align="center">{{ item.websitAmount }}</td>
 						</tr>
 						<!-- <tr>
 							<td style="color: #ffffff;">隐身</td><td></td><td></td><td></td><td></td><td></td><td></td>
 						</tr> -->
 						<tr>
-							<td align="center">总计</td><td></td></td><td>
-							<td align="center">{{totalAmount || 0}}</td><td></td>
-							<td align="center">{{workerAmount || 0}}</td>
-							<td align="center">{{websitAmount || 0}}</td>
+							<td align="center">总计</td>
+							<td></td>
+							</td>
+							<td>
+							<td align="center">{{ totalAmount || 0 }}</td>
+							<td></td>
+							<td align="center">{{ workerAmount || 0 }}</td>
+							<td align="center">{{ websitAmount || 0 }}</td>
 						</tr>
 					</tbody>
 				</table>
 			</el-card>
-		  <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formDialog = false;formData = {}">取 消</el-button>
-			<el-button size="mini" v-if="formData.status == 0" type="primary" @click="update(formData.id)">设为已发</el-button>
-		  </div>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="mini" @click="formDialog = false; formData = {}">取 消</el-button>
+				<el-button size="mini" v-if="formData.status == 0" type="primary" @click="update(formData.id)">设为已发</el-button>
+			</div>
 		</el-dialog>
 	</template-page>
 </template>
@@ -125,150 +130,157 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, update } from "@/api/auxiliaryFittings/salesWithdraw";
+import { listPageV2, pageExport, getDetail, update } from "@/api/auxiliaryFittings/salesWithdraw";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-		// 事件组合
-		optionsEvensGroup: [],
-		// 表格属性
-		tableAttributes: {
-			// 启用勾选列
-			selectColumn: true
-		},
-		// 表格事件
-		tableEvents: {
-			'selection-change': this.selectionChange
-		},
-		// 勾选选中行
-		recordSelected: [],
-		formDialogType: 0,
-		formDialogTitles: ["新增","编辑", "详情"],
-		formDialog: false,
-		formData: {},
-		status: '',
-		totalAmount: 0,
-		workerAmount: 0,
-		websitAmount: 0
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    }
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 事件组合
+			optionsEvensGroup: [],
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			formData: {},
+			status: '',
+			totalAmount: 0,
+			workerAmount: 0,
+			websitAmount: 0
+		}
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.status || this.status >= 0) {
-	      pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
-	    }
-		cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
+	computed: {
+		// 更多参数
+		moreParameters() {
+			return []
+		}
 	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				if (this.status || this.status >= 0) {
+					pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
+				}
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
 		openForm() {
-		  this.formDialog = true;
+			this.formDialog = true;
 		},
 		formCancel() {
-		  this.$refs.formRef.$refs.inlineForm.clearValidate()
-		  this.$data.formData = this.$options.data().formData
-		  this.formDialog = false
+			this.$refs.formRef.$refs.inlineForm.clearValidate()
+			this.$data.formData = this.$options.data().formData
+			this.formDialog = false
 		},
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-			this.totalAmount = 0
-			this.workerAmount = 0
-			this.websitAmount = 0
-		    getDetail({ id: row.id }).then(res => {
-		      Object.assign(this.formData, res.data,{
-				  certImg:res.data?.certImg ? res.data?.certImg?.split(",").map(item=>({url:item})) : []
-			  })
-			  res.data.withdrawalOrderItems.forEach(item=>{
-			  	this.totalAmount += item.totalPrice
-			  	this.workerAmount += item.workerAmount
-			  	this.websitAmount += item.websitAmount
-			  })
-		      this.formDialogType = 1
-		      this.openForm()
-		    })
-		  }}>查看</el-button>
-		  {row.status == 0? <el-button type="text" onClick={() => {
-		  	this.totalAmount = 0
-		  	this.workerAmount = 0
-		  	this.websitAmount = 0
-		  	getDetail({ id: row.id }).then(res => {
-		  	  Object.assign(this.formData, res.data,{
-				  certImg:res.data?.certImg ? res.data?.certImg?.split(",").map(item=>({url:item})) : []
-			  })
-		  	  res.data.withdrawalOrderItems.forEach(item=>{
-		  	  	this.totalAmount += item.totalPrice
-		  	  	this.workerAmount += item.workerAmount
-		  	  	this.websitAmount += item.websitAmount
-		  	  })
-		  	  this.formDialogType = 1
-		  	  this.openForm()
-		  	})
-		  }}>设为已发</el-button>:null}
-		  
-        </div>
-      )
-    },
-	update(id){
-		if(this.formData.certImg.length == 0){
-			return this.$message.warning('请先上传转账凭证!');
-		}
-		this.$confirm('请确认是否设为已发放, 是否继续?', '提示', {
-			confirmButtonText: '确定',
-			cancelButtonText: '取消',
-			type: 'warning'
-		}).then(() => {
-			update({ id, certImg: this.formData.certImg.map(item=>item.url).join(",") }).then(res => {
-			  if (res.code == 200) {
-			  	this.$message({ type: 'success', message: '设为已发放成功!' })
-				this.formDialog = false
-			  	this.$refs.pageRef.refreshList()
-			  } else {
-			  	this.$message.error(res.msg);
-			  }
+
+		operation() {
+			return this.operationBtn({
+				detail: {
+					click: ({ row, index, column }) => {
+						this.totalAmount = 0
+						this.workerAmount = 0
+						this.websitAmount = 0
+						getDetail({ id: row.id }).then(res => {
+							Object.assign(this.formData, res.data, {
+								certImg: res.data?.certImg ? res.data?.certImg?.split(",").map(item => ({ url: item })) : []
+							})
+							res.data.withdrawalOrderItems.forEach(item => {
+								this.totalAmount += (item.totalPrice * 100 + this.totalAmount * 100) / 100
+								this.workerAmount = (item.workerAmount * 100 + this.workerAmount * 100) / 100
+								this.websitAmount += (item.websitAmount * 100 + this.websitAmount * 100) / 100
+							})
+							this.formDialogType = 1
+							this.openForm()
+						})
+					}
+				},
+				setSent: {
+					conditions: ({ row, index, column }) => {
+						return row.status == 0
+					},
+					click: ({ row, index, column }) => {
+						this.totalAmount = 0
+						this.workerAmount = 0
+						this.websitAmount = 0
+						getDetail({ id: row.id }).then(res => {
+							Object.assign(this.formData, res.data, {
+								certImg: res.data?.certImg ? res.data?.certImg?.split(",").map(item => ({ url: item })) : []
+							})
+							res.data.withdrawalOrderItems.forEach(item => {
+								this.totalAmount += item.totalPrice
+								this.workerAmount += item.workerAmount
+								this.websitAmount += item.websitAmount
+							})
+							this.formDialogType = 1
+							this.openForm()
+						})
+					}
+				}
 			})
-		});
-	},
-  }
+		},
+
+		update(id) {
+			if (this.formData.certImg.length == 0) {
+				return this.$message.warning('请先上传转账凭证!');
+			}
+			this.$confirm('请确认是否设为已发放, 是否继续?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				update({ id, certImg: this.formData.certImg.map(item => item.url).join(",") }).then(res => {
+					if (res.code == 200) {
+						this.$message({ type: 'success', message: '设为已发放成功!' })
+						this.formDialog = false
+						this.$refs.pageRef.refreshList()
+					} else {
+						this.$message.error(res.msg);
+					}
+				})
+			});
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
-	.bold{
-		width: 160px;
-		font-weight: bold;
-		background-color: #f0f0f0;
-	}
+.tab {
+	padding: 20px 20px 0 20px;
+}
+
+.bold {
+	width: 160px;
+	font-weight: bold;
+	background-color: #f0f0f0;
+}
 </style>

+ 341 - 0
src/views/auxiliaryFittings/settleAccountManagement/settleAccountOfflinePay/index.vue

@@ -0,0 +1,341 @@
+<template>
+	<template-page ref="pageRef" v-if="tabIndexShow" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="120"
+	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+	  :operation="operation()" :exportList="tabIndex==1?exportList1:exportList2">
+	  <div slot="moreSearch" style="margin-bottom: 10px;">
+		<el-radio-group v-model="tabIndex" size="mini" @change="changeType">
+			<el-radio-button label="1">汇总</el-radio-button>
+			<el-radio-button label="2">明细</el-radio-button>
+		</el-radio-group>
+	  </div>
+	  <div slot="moreSearch" v-if="tabIndex == 2">
+	    <el-radio-group v-model="status" size="mini" @change="changeType">
+	    	<el-radio-button label="">全部</el-radio-button>
+	    	<el-radio-button label="WAIT">待结算</el-radio-button>
+			<el-radio-button label="OVER">已完成</el-radio-button>
+	    </el-radio-group>
+	    <br><br>
+	  </div>
+		<el-dialog title="详情" width="80%" :modal="true" :visible.sync="formDialog" :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" @close="formDialog = false;formData = {}">
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>基础信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<tr>
+						<td class="bold" align="center">所属商户</td>
+						<td>{{formData.companyWechatName}}</td>
+						<td class="bold" align="center">关联工单号</td>
+						<td>{{formData.workerOrderId}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">结算单号</td>
+						<td>{{formData.settlementOrderId}}</td>
+						<td class="bold" align="center">工单品牌</td>
+						<td>{{formData.brand}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">客户姓名</td>
+						<td>{{formData.userName}}</td>
+						<td class="bold" align="center">客户电话</td>
+						<td>{{formData.userMobile}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅姓名</td>
+						<td>{{formData.workerName}}</td>
+						<td class="bold" align="center">师傅身份证号</td>
+						<td>{{formData.identity}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅联系电话</td>
+						<td>{{formData.workerMobile}}</td>
+						<td class="bold" align="center">订单金额</td>
+						<td>{{formData.totalAmount}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">销售类型</td>
+						<td>{{formData.settlementType == 'OWN'?'自由':formData.settlementType == 'OUT'?'外购':''}}</td>
+						<td class="bold" align="center">创建人</td>
+						<td>{{formData.createBy}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">创建时间</td>
+						<td>{{formData.createTime}}</td>
+						<td class="bold" align="center">支付状态</td>
+						<td>{{formData.payStatus == 'CANCEL'?'取消':formData.payStatus == 'PAID'?'已支付':formData.payStatus == 'WAIT'?'待支付':''}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">操作人</td>
+						<td>{{formData.updateBy}}</td>
+						<td class="bold" align="center">操作时间</td>
+						<td>{{formData.updateTime}}</td>
+					</tr>
+				</table>
+			</el-card>
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>订单信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<thead>
+						<tr>
+							<th class="bold" align="center">名称</th>
+							<th class="bold" align="center">收费类型</th>
+							<th class="bold" align="center">数量</th>
+							<th class="bold" align="center">单价</th>
+							<th class="bold" align="center">订单金额</th>
+							<th class="bold" align="center">销售类型</th>
+							<th class="bold" align="center">师傅分账金额</th>
+							<th class="bold" align="center">商户分账金额</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr v-for="(item,index) in formData.settlementOrderItemList" :key="index">
+							<td align="center">{{item.goodsName}}</td>
+							<td align="center">{{item.chargeType=='ACC'?(item.goodsType == 'M'?'辅材':'配件')+'物料':item.chargeType=='SERV'?'服务收费':''}}</td>
+							<td align="center">{{item.num}}</td>
+							<td align="center">{{item.goodsAmount}}</td>
+							<td align="center">{{item.totalAmount}}</td>
+							<td align="center">{{item.settlementType == 'OWN'?'自有':item.settlementType == 'OUT'?'外购':''}}</td>
+							<td align="center">{{item.workerAmount}}</td>
+							<td align="center">{{item.websitAmount}}</td>
+						</tr>
+						<!-- <tr>
+							<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
+						</tr> -->
+						<tr>
+							<td align="center">总计</td><td></td><td></td><td></td>
+							<td align="center">{{totalAmount}}</td><td></td>
+							<td align="center">{{workerAmount}}</td>
+							<td align="center">{{websitAmount}}</td>
+						</tr>
+					</tbody>
+				</table>
+			</el-card>
+		  <div slot="footer" class="dialog-footer">
+			<el-button size="mini" @click="formDialog = false;formData = {}">取 消</el-button>
+			<el-button size="mini" v-if="formData.status == 'WAIT'" type="primary" @click="settleAccounts(formData.settlementOrderId)">确认结算</el-button>
+			<el-button size="mini" v-if="formData.status == 'WAIT_ING'" type="primary" @click="withdraw(formData.settlementOrderId)">确认提现</el-button>
+		  </div>
+		</el-dialog>
+	</template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import { downloadFiles } from '@/utils/util'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { listPageV1,listPageV2,pageExport1,pageExport2, getDetail, refund, settleAccounts } from "@/api/auxiliaryFittings/settleAccountOfflinePay";
+export default {
+  components: { TemplatePage, ImageUpload },
+  mixins: [import_mixin,operation_mixin],
+  data() {
+    return {
+		// 表格属性
+		tableAttributes: {
+			// 启用勾选列
+			selectColumn: true
+		},
+		// 表格事件
+		tableEvents: {
+			'selection-change': this.selectionChange
+		},
+		// 勾选选中行
+		recordSelected: [],
+		formDialogType: 0,
+		formDialogTitles: ["新增","编辑", "详情"],
+		formDialog: false,
+		formData: {},
+		status: '',
+		totalAmount: 0,
+		workerAmount: 0,
+		websitAmount: 0,
+		tabIndex: 1,
+		workerId: '',
+		websitId: '',
+		tabIndexShow: true
+    }
+  },
+  watch: {
+  	tabIndex() {
+  		this.tabIndexShow = false
+  		this.$nextTick(() => {
+			if(this.tabIndex == 1){
+				this.status = ''
+			}
+  			this.tabIndexShow = true
+  		})
+  	}
+  },
+  computed: {
+	  // 事件组合
+	  optionsEvensGroup() {
+	  	return [
+	  		[
+	  			[
+	  				this.optionsEvensAuth("bulkSettlement", {
+						isRole: this.tabIndex== 2,
+	  					click: () => {
+	  						this.batchSettleAccounts()
+	  					}
+	  				})
+	  			],
+	  		]
+	  	]
+	  },
+    // 更多参数
+    moreParameters() {
+      return []
+    }
+  },
+  methods: {
+	// 切换状态
+	changeType(val) {
+	  this.workerId = ''
+	  this.websitId = ''
+	  this.$refs.pageRef.refreshList()
+	},
+    // 列表请求函数
+	getList(p) {
+	  try {
+	    var pam = JSON.parse(JSON.stringify(p))
+		pam.params.push({ "param": "a.pay_type", "compare": "=", "value": 'LINE' })
+	    if (this.status && this.tabIndex==2) {
+	      pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
+	    }
+		if(this.workerId){
+			pam.params.push({ "param": "a.websit_id", "compare": "=", "value": this.websitId },{ "param": "a.worker_id", "compare": "=", "value": this.workerId })
+		}
+	    return this.tabIndex==1?listPageV1(pam):listPageV2(pam)
+	  } catch (error) {
+	    console.log(error)
+	  }
+	},
+    // 列表导出函数
+    exportList1: pageExport1,
+    exportList2: pageExport2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+		return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+		openForm() {
+		  this.formDialog = true;
+		},
+		formCancel() {
+		  this.$refs.formRef.$refs.inlineForm.clearValidate()
+		  this.$data.formData = this.$options.data().formData
+		  this.formDialog = false
+		},
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				name: ({ row, index, column }) => {
+					return this.tabIndex==1?'查看明细':'详情'
+				},
+				click: ({ row, index, column }) => {
+					if(this.tabIndex==1){
+						this.workerId = row.workerId
+						this.websitId = row.websitId
+						this.tabIndex = 2
+						this.$refs.pageRef.refreshList()
+					}else{
+						this.totalAmount = 0
+						this.workerAmount = 0
+						this.websitAmount = 0
+						getDetail({ id: row.settlementOrderId }).then(res => {
+						  Object.assign(this.formData, res.data)
+						  res.data.settlementOrderItemList.forEach(item=>{
+							  this.totalAmount += (item.totalAmount*100 +  this.totalAmount*100)/100
+							  this.workerAmount = (item.workerAmount*100 +  this.workerAmount*100)/100
+							  this.websitAmount += (item.websitAmount*100 +  this.websitAmount*100)/100
+						  })
+						  this.formDialogType = 1
+						  this.openForm()
+						})
+					}
+				}
+			},
+			refund: {
+				btnType: 'text',
+				prompt: '确认是否退款?',
+				conditions: ({ row, index, column }) => {
+					return row.totalAmount > 0 && this.tabIndex==2
+				},
+				click: ({ row, index, column }) => {
+					refund({ id: row.settlementOrderId }).then(res => {
+					  if (res.code == 200) {
+					  	this.$message({ type: 'success', message: '退款成功!' })
+					  	this.$refs.pageRef.refreshList()
+					  } else {
+					  	this.$message.error(res.msg);
+					  }
+					})
+				}
+			},
+			settlement: {
+				btnType: 'text',
+				conditions: ({ row, index, column }) => {
+					return row.status == 'WAIT' || this.tabIndex==1
+				},
+				click: ({ row, index, column }) => {
+					if(this.tabIndex==1){
+						this.status = 'WAIT'
+						this.workerId = row.workerId
+						this.websitId = row.websitId
+						this.tabIndex = 2
+						this.$refs.pageRef.refreshList()
+					}else{
+						this.settleAccounts(row.settlementOrderId)
+					}
+				}
+			}
+		})
+	},
+	batchSettleAccounts(){
+		if(this.recordSelected.length == 0){
+			return this.$message.warning('请至少勾选一条数据!');
+		}
+		this.settleAccounts(this.recordSelected.map(item=>{return item.settlementOrderId}).join(','))
+	},
+	settleAccounts(id){
+		this.$confirm(`请确认是否结算选中数据, 是否继续?`, '提示', {
+			confirmButtonText: '确定',
+			cancelButtonText: '取消',
+			type: 'warning'
+		}).then(() => {
+			settleAccounts({
+				id
+			}).then(res => {
+				if (res.code == 200) {
+					this.$message({ type: 'success', message: `结算成功!` })
+					this.$refs.pageRef.refreshList()
+					this.formDialog = false
+				} else {
+					this.$message.error(res.msg);
+				}
+			})
+		});
+	}
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+	.tab{
+		padding: 20px 20px 0 20px;
+	}
+	.bold{
+		width: 160px;
+		font-weight: bold;
+		background-color: #f0f0f0;
+	}
+</style>

+ 434 - 0
src/views/auxiliaryFittings/settleAccountManagement/settleAccountWeixinPay/index.vue

@@ -0,0 +1,434 @@
+<template>
+	<template-page ref="pageRef" v-if="tabIndexShow" :get-list="getList" :table-attributes="tableAttributes"
+		:table-events="tableEvents" :operationColumnWidth="120" :options-evens-group="optionsEvensGroup"
+		:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()"
+		:exportList="tabIndex == 1 ? exportList1 : exportList2">
+		<div slot="moreSearch" style="margin-bottom: 10px;">
+			<el-radio-group v-model="tabIndex" size="mini" @change="changeType">
+				<el-radio-button label="1">汇总</el-radio-button>
+				<el-radio-button label="2">明细</el-radio-button>
+			</el-radio-group>
+		</div>
+		<div slot="moreSearch" v-if="tabIndex == 2">
+			<el-radio-group v-model="status" size="mini" @change="changeType">
+				<el-radio-button label="">全部</el-radio-button>
+				<el-radio-button label="WAIT">待结算</el-radio-button>
+				<el-radio-button label="WAIT_ING">可提现</el-radio-button>
+				<el-radio-button label="ING">提现中</el-radio-button>
+				<el-radio-button label="OVER">已提现</el-radio-button>
+			</el-radio-group>
+			<br><br>
+		</div>
+		<el-dialog title="详情" width="80%" :modal="true" :visible.sync="formDialog" :show-close="true"
+			:close-on-click-modal="false" :modal-append-to-body="false" @close="formDialog = false; formData = {}">
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>基础信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<tr>
+						<td class="bold" align="center">所属商户</td>
+						<td>{{ formData.companyWechatName }}</td>
+						<td class="bold" align="center">关联工单号</td>
+						<td>{{ formData.workerOrderId }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">结算单号</td>
+						<td>{{ formData.settlementOrderId }}</td>
+						<td class="bold" align="center">工单品牌</td>
+						<td>{{ formData.brand }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">客户姓名</td>
+						<td>{{ formData.userName }}</td>
+						<td class="bold" align="center">客户电话</td>
+						<td>{{ formData.userMobile }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅姓名</td>
+						<td>{{ formData.workerName }}</td>
+						<td class="bold" align="center">师傅身份证号</td>
+						<td>{{ formData.identity }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅联系电话</td>
+						<td>{{ formData.workerMobile }}</td>
+						<td class="bold" align="center">订单金额</td>
+						<td>{{ formData.totalAmount }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">销售类型</td>
+						<td>{{ formData.settlementType == 'OWN' ? '自由' : formData.settlementType == 'OUT' ? '外购' : '' }}</td>
+						<td class="bold" align="center">创建人</td>
+						<td>{{ formData.createBy }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">创建时间</td>
+						<td>{{ formData.createTime }}</td>
+						<td class="bold" align="center">支付状态</td>
+						<td>{{ formData.payStatus == 'CANCEL' ? '取消' : formData.payStatus == 'PAID' ? '已支付' : formData.payStatus ==
+							'WAIT' ? '待支付' : '' }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">支付订单号</td>
+						<td>{{ formData.orderId }}</td>
+						<td class="bold" align="center">支付时间</td>
+						<td>{{ formData.payTime }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">分账单号</td>
+						<td>{{ formData.settlementOrderId }}</td>
+						<td class="bold" align="center">分账状态</td>
+						<td>{{ formData.status == 'WAIT' ? '待结算' : formData.status == 'WAIT_ING' ? '可提现' : formData.status ==
+							'ING' ? '提现中' : formData.status == 'OVER' ? '已提现' : '' }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">分账金额</td>
+						<td>{{ formData.amount }}</td>
+						<td class="bold" align="center">分账时间</td>
+						<td>{{ formData.settlementTime }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅分账金额</td>
+						<td>{{ formData.workerAmount }}</td>
+						<td class="bold" align="center">师傅分账金额手续费</td>
+						<td>{{ formData.workerProceAmount }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">商户分账金额</td>
+						<td>{{ formData.websitAmount }}</td>
+						<td class="bold" align="center">商户分账金额手续费</td>
+						<td>{{ formData.websitProceAmount }}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">操作人</td>
+						<td>{{ formData.updateBy }}</td>
+						<td class="bold" align="center">操作时间</td>
+						<td>{{ formData.updateTime }}</td>
+					</tr>
+				</table>
+			</el-card>
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>订单信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<thead>
+						<tr>
+							<th class="bold" align="center">名称</th>
+							<th class="bold" align="center">收费类型</th>
+							<th class="bold" align="center">数量</th>
+							<th class="bold" align="center">单价</th>
+							<th class="bold" align="center">订单金额</th>
+							<th class="bold" align="center">销售类型</th>
+							<th class="bold" align="center">手续费</th>
+							<th class="bold" align="center">师傅分账金额</th>
+							<th class="bold" align="center">商户分账金额</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr v-for="(item, index) in formData.settlementOrderItemList" :key="index">
+							<td align="center">{{ item.goodsName }}</td>
+							<td align="center">{{ item.chargeType == 'ACC' ? (item.goodsType ==
+								'M' ? '辅材' : '配件') + '物料' : item.chargeType == 'SERV' ? '服务收费' : '' }}</td>
+							<td align="center">{{ item.num }}</td>
+							<td align="center">{{ item.goodsAmount }}</td>
+							<td align="center">{{ item.totalAmount }}</td>
+							<td align="center">{{ item.settlementType == 'OWN' ? '自有' : item.settlementType == 'OUT' ? '外购' : '' }}</td>
+							<td align="center">{{ (item.websitProceAmount * 100 + item.workerProceAmount * 100) / 100 }}</td>
+							<td align="center">{{ item.workerAmount }}</td>
+							<td align="center">{{ item.websitAmount }}</td>
+						</tr>
+						<!-- <tr>
+							<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
+						</tr> -->
+						<tr>
+							<td align="center">总计</td>
+							<td></td>
+							<td></td>
+							<td></td>
+							<td align="center">{{ totalAmount }}</td>
+							<td></td>
+							<td align="center">{{ commissionAmount }}</td>
+							<td align="center">{{ workerAmount }}</td>
+							<td align="center">{{ websitAmount }}</td>
+						</tr>
+					</tbody>
+				</table>
+			</el-card>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="mini" @click="formDialog = false; formData = {}">取 消</el-button>
+				<el-button size="mini" v-if="formData.status == 'WAIT'" type="primary"
+					@click="settleAccounts(formData.settlementOrderId)">确认结算</el-button>
+				<el-button size="mini" v-if="formData.status == 'WAIT_ING'" type="primary"
+					@click="withdraw(formData.settlementOrderId)">确认提现</el-button>
+			</div>
+		</el-dialog>
+	</template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import { downloadFiles } from '@/utils/util'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { listPageV1, listPageV2, pageExport1, pageExport2, getDetail, refund, settleAccounts, withdraw } from "@/api/auxiliaryFittings/settleAccountWeixinPay";
+export default {
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			formData: {},
+			status: '',
+			totalAmount: 0,
+			workerAmount: 0,
+			websitAmount: 0,
+			commissionAmount: 0,
+			tabIndex: 1,
+			workerId: '',
+			websitId: '',
+			tabIndexShow: true
+		}
+	},
+	watch: {
+		tabIndex() {
+			this.tabIndexShow = false
+			this.$nextTick(() => {
+				if(this.tabIndex == 1){
+					this.status = ''
+				}
+				this.tabIndexShow = true
+			})
+		}
+	},
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("bulkSettlement", {
+							isRole: this.tabIndex == 2,
+							click: () => {
+								this.batchSettleAccounts()
+							}
+						})
+					],
+				],
+				[
+					[
+						this.optionsEvensAuth("bulkWithdrawal", {
+							isRole: this.tabIndex == 2,
+							click: () => {
+								this.batchWithdraw()
+							}
+						})
+					],
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		}
+	},
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.workerId = ''
+			this.websitId = ''
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ "param": "a.pay_type", "compare": "=", "value": 'WECHAT' })
+				if (this.status && this.tabIndex == 2) {
+					pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
+				}
+				if (this.workerId) {
+					pam.params.push({ "param": "a.websit_id", "compare": "=", "value": this.websitId }, { "param": "a.worker_id", "compare": "=", "value": this.workerId })
+				}
+				return this.tabIndex == 1 ? listPageV1(pam) : listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList1: pageExport1,
+		exportList2: pageExport2,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		formCancel() {
+			this.$refs.formRef.$refs.inlineForm.clearValidate()
+			this.$data.formData = this.$options.data().formData
+			this.formDialog = false
+		},
+		// 表格操作列
+		operation() {
+			return this.operationBtn({
+				detail: {
+					btnType: 'text',
+					name: ({ row, index, column }) => {
+						return this.tabIndex == 1 ? '查看明细' : '详情'
+					},
+					click: ({ row, index, column }) => {
+						if (this.tabIndex == 1) {
+							this.workerId = row.workerId
+							this.websitId = row.websitId
+							this.tabIndex = 2
+							this.$refs.pageRef.refreshList()
+						} else {
+							this.totalAmount = 0
+							this.workerAmount = 0
+							this.websitAmount = 0
+							this.commissionAmount = 0
+							getDetail({ id: row.settlementOrderId }).then(res => {
+								Object.assign(this.formData, res.data)
+								res.data.settlementOrderItemList.forEach(item => {
+									this.totalAmount += (item.totalAmount * 100 + this.totalAmount * 100) / 100
+									this.workerAmount = (item.workerAmount * 100 + this.workerAmount * 100) / 100
+									this.websitAmount += (item.websitAmount * 100 + this.websitAmount * 100) / 100
+									this.commissionAmount += (item.websitProceAmount * 100 + item.workerProceAmount * 100 + this.commissionAmount * 100) / 100
+								})
+								this.formDialogType = 1
+								this.openForm()
+							})
+						}
+					}
+				},
+				refund: {
+					btnType: 'text',
+					prompt: '确认是否退款?',
+					conditions: ({ row, index, column }) => {
+						return row.totalAmount > 0 && this.tabIndex == 2
+					},
+					click: ({ row, index, column }) => {
+						refund({ id: row.settlementOrderId }).then(res => {
+							if (res.code == 200) {
+								this.$message({ type: 'success', message: '退款成功!' })
+								this.$refs.pageRef.refreshList()
+							} else {
+								this.$message.error(res.msg);
+							}
+						})
+					}
+				},
+				settlement: {
+					btnType: 'text',
+					conditions: ({ row, index, column }) => {
+						return row.status == 'WAIT' || this.tabIndex == 1
+					},
+					click: ({ row, index, column }) => {
+						if (this.tabIndex == 1) {
+							this.status = 'WAIT'
+							this.workerId = row.workerId
+							this.websitId = row.websitId
+							this.tabIndex = 2
+							this.$refs.pageRef.refreshList()
+						} else {
+							this.settleAccounts(row.settlementOrderId)
+						}
+					}
+				},
+				withdraw: {
+					btnType: 'text',
+					conditions: ({ row, index, column }) => {
+						return row.status == 'WAIT_ING' && this.tabIndex == 2
+					},
+					click: ({ row, index, column }) => {
+						this.withdraw(row.settlementOrderId)
+					}
+				},
+			})
+		},
+		batchSettleAccounts() {
+			if (this.recordSelected.length == 0) {
+				return this.$message.warning('请至少勾选一条数据!');
+			}
+			this.settleAccounts(this.recordSelected.map(item => { return item.settlementOrderId }).join(','))
+		},
+		settleAccounts(id) {
+			this.$confirm(`请确认是否结算选中数据, 是否继续?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				settleAccounts({
+					id
+				}).then(res => {
+					if (res.code == 200) {
+						this.$message({ type: 'success', message: `结算成功!` })
+						this.$refs.pageRef.refreshList()
+						this.formDialog = false
+					} else {
+						this.$message.error(res.msg);
+					}
+				})
+			});
+		},
+		batchWithdraw() {
+			if (this.recordSelected.length == 0) {
+				return this.$message.warning('请至少勾选一条数据!');
+			}
+			this.withdraw(this.recordSelected.map(item => { return item.settlementOrderId }).join(','))
+		},
+		withdraw(id) {
+			this.$confirm(`请确认是否提现选中数据, 是否继续?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				withdraw({
+					id
+				}).then(res => {
+					if (res.code == 200) {
+						this.$message({ type: 'success', message: `提现成功!` })
+						this.$refs.pageRef.refreshList()
+						this.formDialog = false
+					} else {
+						this.$message.error(res.msg);
+					}
+				})
+			});
+		},
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+.tab {
+	padding: 20px 20px 0 20px;
+}
+
+.bold {
+	width: 160px;
+	font-weight: bold;
+	background-color: #f0f0f0;
+}</style>

+ 139 - 134
src/views/auxiliaryFittings/supplier/index.vue

@@ -1,20 +1,20 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  <el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
-	    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
-	    <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-	      <zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
-	        :form-data="formData" :form-items="formItems" :disabled="formDialogType==2">
-	      </zj-form-module>
-	    </zj-form-container>
-	    <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formCancel">取 消</el-button>
-			<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">确定</el-button>
-	    </div>
-	  </el-dialog>
-	</template-page>
+  <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+    :operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+    :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+    <el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+      :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+      <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+        <zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
+          :form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
+        </zj-form-module>
+      </zj-form-container>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="formCancel">取 消</el-button>
+        <el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">确定</el-button>
+      </div>
+    </el-dialog>
+  </template-page>
 </template>
 
 <script>
@@ -22,23 +22,13 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit } from "@/api/auxiliaryFittings/supplier";
+import { listPageV2, pageExport, getDetail, add, edit } from "@/api/auxiliaryFittings/supplier";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -52,32 +42,44 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
+      formDialogTitles: ["新增", "编辑", "详情"],
       formDialog: false,
       formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		venderName: '',
-		linkName: '',
-		linkTel: '',
-		address: '',
-		zipNo: '',
-		email: '',
-		www: '',
-		telNo: '',
-		corporation: '',
-		faxNo: '',
-		licenseId: '',
-		khBank: '',
-		bankRow: '',
-		accNo: '',
-		remark: '',
-		status: 'ON',
-		venderType: 'M',
-		imageUrl: []
+        companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        venderName: '',
+        linkName: '',
+        linkTel: '',
+        address: '',
+        zipNo: '',
+        email: '',
+        www: '',
+        telNo: '',
+        corporation: '',
+        faxNo: '',
+        licenseId: '',
+        khBank: '',
+        bankRow: '',
+        accNo: '',
+        remark: '',
+        status: 'ON',
+        venderType: 'M',
+        imageUrl: []
       }
     }
   },
   computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth("add", {
+              click: this.addData
+            }),
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -97,21 +99,21 @@ export default {
         md: 12,
         isShow: true,
         name: 'slot-component',
-        attributes: { },
+        attributes: {},
         formItemAttributes: {
           label: '状态',
           prop: 'status',
           rules: [...required]
         },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.status}>
-				    <el-radio disabled={this.formDialogType==2} label="ON">启用</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label="OFF">禁用</el-radio>
-				</el-radio-group>
-			)
-		}
+        render: (h, { props, onInput }) => {
+          var { value } = props
+          return (
+            <el-radio-group v-model={this.formData.status}>
+              <el-radio disabled={this.formDialogType == 2} label="ON">启用</el-radio>
+              <el-radio disabled={this.formDialogType == 2} label="OFF">禁用</el-radio>
+            </el-radio-group>
+          )
+        }
       }, {
         md: 12,
         isShow: true,
@@ -140,28 +142,28 @@ export default {
         formItemAttributes: {
           label: '联系电话',
           prop: 'linkTel',
-          rules: [...required,...mobile]
+          rules: [...required, ...mobile]
         }
       }, {
         md: 12,
         isShow: true,
         name: 'slot-component',
-        attributes: { },
+        attributes: {},
         formItemAttributes: {
           label: '供应类型',
           prop: 'venderType',
           rules: [...required]
         },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.venderType}>
-				    <el-radio disabled={this.formDialogType==2} label="M">辅材</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label="P">配件</el-radio>
-					<el-radio disabled={this.formDialogType==2} label="A">辅材和配件</el-radio>
-				</el-radio-group>
-			)
-		}
+        render: (h, { props, onInput }) => {
+          var { value } = props
+          return (
+            <el-radio-group v-model={this.formData.venderType}>
+              <el-radio disabled={this.formDialogType == 2} label="M">辅材</el-radio>
+              <el-radio disabled={this.formDialogType == 2} label="P">配件</el-radio>
+              <el-radio disabled={this.formDialogType == 2} label="A">辅材和配件</el-radio>
+            </el-radio-group>
+          )
+        }
       }, {
         md: 12,
         isShow: true,
@@ -273,25 +275,25 @@ export default {
           rules: []
         }
       }, {
-		md: 24,
-		isShow: true,
-		name: 'slot-component',
-		formItemAttributes: {
-			label: '营业执照',
-			prop: 'imageUrl',
-			rules: []
-		},
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<ImageUpload fileList={this.formData.imageUrl} limit={1} isEdit={this.formDialogType !== 2} />
-			)
-		}
-	}, {
+        md: 24,
+        isShow: true,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '营业执照',
+          prop: 'imageUrl',
+          rules: []
+        },
+        render: (h, { props, onInput }) => {
+          var { value } = props
+          return (
+            <ImageUpload fileList={this.formData.imageUrl} limit={1} isEdit={this.formDialogType !== 2} />
+          )
+        }
+      }, {
         md: 24,
         isShow: true,
         name: 'el-input',
-        attributes: { placeholder: '请输入备注内容',type: "textarea", rows: 5 },
+        attributes: { placeholder: '请输入备注内容', type: "textarea", rows: 5 },
         formItemAttributes: {
           label: '备注',
           prop: 'remark',
@@ -302,62 +304,65 @@ export default {
   },
   methods: {
     // 列表请求函数
-	getList(p) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.examineStatus) {
-	      pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
-	    }
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
+    getList(p) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.examineStatus) {
+          pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
+        }
+        return listPageV2(pam)
+      } catch (error) {
+        console.log(error)
+      }
+    },
     // 列表导出函数
     exportList: pageExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
+      if (item.jname === 'idCardImg') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+            </div>
+          )
+        }
+      }
       return defaultData
     },
     // 监听勾选变化
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
             getDetail({ id: row.venderId }).then(res => {
-              Object.assign(this.formData, res.data,{
-				  imageUrl:res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item=>({url:item})) : []
-			  })
+              Object.assign(this.formData, res.data, {
+                imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : []
+              })
               this.formDialogType = 2
               this.openForm()
             })
-          }}>查看</el-button>
-		  <el-button type="text" onClick={() => {
-		    getDetail({ id: row.venderId }).then(res => {
-		      Object.assign(this.formData, res.data,{
-				  imageUrl:res.data?.imageUrl?  res.data?.imageUrl?.split(",").map(item=>({url:item})) : []
-			  })
-			   console.log(this.formData)
-		      this.formDialogType = 1
-		      this.openForm()
-		    })
-		  }}>编辑</el-button>
-        </div>
-      )
+          }
+        },
+        edit: {
+          click: ({ row, index, column }) => {
+            getDetail({ id: row.venderId }).then(res => {
+              Object.assign(this.formData, res.data, {
+                imageUrl: res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item => ({ url: item })) : []
+              })
+              console.log(this.formData)
+              this.formDialogType = 1
+              this.openForm()
+            })
+          }
+        },
+      })
     },
+
     addData() {
       this.formDialogType = 0
       this.openForm()
@@ -374,9 +379,9 @@ export default {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
           ([add, edit][this.formDialogType])({
-			  ...this.formData,
-			  imageUrl:this.formData.imageUrl.map(item=>item.url).join(",")
-		  }).then(res => {
+            ...this.formData,
+            imageUrl: this.formData.imageUrl.map(item => item.url).join(",")
+          }).then(res => {
             this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
             this.formCancel()
             this.$refs.pageRef.refreshList()
@@ -389,7 +394,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.tab {
+  padding: 20px 20px 0 20px;
+}
 </style>

+ 114 - 0
src/views/engineeringMaintenance/allInclusiveExpense/index.vue

@@ -0,0 +1,114 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+    <div class="cartographer_big">
+      <el-dialog title="详情" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
+        <zj-page-container v-if="formBool">
+          <zj-page-fill class="neibuview" v-if="formBool">
+            <zj-form-container v-if="formBool" :formAttributes="{ 'label-position': 'top' }">
+              <zj-form-module v-if="formBool" title="费用信息" :form-data="formData" :form-items="formItems">
+              </zj-form-module>
+            </zj-form-container>
+          </zj-page-fill>
+        </zj-page-container>
+      </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 operation_mixin from '@/components/template/operation_mixin.js'
+import { enginMaterialListAll, enginMaterialListAllExport, enginMaterialDetail } from "@/api/applicationWithoutFee.js"
+import feel from "../mixins/feel.js"
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin, feel],
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {}
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push({ "param": "is_all_fee", "compare": "=", "value": "YES" })
+        if (this.$route.query.rpProjectRepairId) {
+          pam.params.push({ "param": "rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
+        }
+        cb && cb(pam)
+        return enginMaterialListAll(pam)
+      } catch (err) {
+        console.log(err)
+      }
+    },
+
+    // 列表导出函数
+    exportList: enginMaterialListAllExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        }
+      })
+    },
+
+    handleClose() {
+      this.formData = {}
+      this.formBool = false
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 195 - 0
src/views/engineeringMaintenance/applicationWithoutFee/index.vue

@@ -0,0 +1,195 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents"
+    :moreParameters="moreParameters">
+    <div class="cartographer_big">
+      <el-dialog title="详情" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
+        <zj-page-container v-if="formBool">
+          <zj-page-fill class="neibuview">
+            <zj-form-container ref="formRef" :form-data="formData" :formAttributes="{ 'label-position': 'top' }">
+              <zj-form-module title="费用信息" :form-data="formData" :form-items="formItems">
+              </zj-form-module>
+              <zj-form-module v-if="formBool && formData.payType !== 'WECHAT'" title="审批信息" :form-data="formData"
+                :form-items="spFormItems">
+                <div v-if="openType === 1" style="text-align:right">
+                  <el-button size="mini" type="danger" plain @click="WAITfun">确定</el-button>
+                </div>
+              </zj-form-module>
+            </zj-form-container>
+          </zj-page-fill>
+        </zj-page-container>
+      </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 operation_mixin from '@/components/template/operation_mixin.js'
+import { enginMaterialList, enginMaterialListExport, enginMaterialDetail, enginMaterialExamine } from "@/api/applicationWithoutFee.js"
+import { required } from '@/components/template/rules_verify.js'
+import feel from "../mixins/feel.js"
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin, feel],
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {
+        examineStatus: "",
+        examineRemark: "",
+      },
+      openType: 0
+    }
+  },
+  computed: {
+    moreParameters() {
+      return [
+        {
+          name: '状态',
+          key: 'examineStatus',
+          value: '',
+          conditions: [
+            { label: "全部", value: "" },
+            { label: "待审核", value: "WAIT" },
+            { label: "审核通过", value: "OK" },
+            { label: "驳回", value: "FAIL" },
+            { label: "取消", value: "NO" },
+            { label: "已支付", value: "PAID" },
+            { label: "未支付", value: "NO_PAID" },
+          ]
+        }
+      ]
+    },
+    spFormItems() {
+      return [{
+        name: 'el-radio',
+        md: 24,
+        options: [{ value: "OK", label: "审批通过" }, { value: "FAIL", label: "审批驳回" }],
+        attributes: { disabled: this.openType == 0 },
+        formItemAttributes: { label: '审批状态', prop: 'examineStatus', rules: [...required] },
+      }, {
+        name: 'el-input',
+        md: 24,
+        attributes: { disabled: this.openType == 0, type: "textarea", placeholder: '' },
+        formItemAttributes: { label: '审批备注', prop: 'examineRemark' },
+      }]
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        pam.params.push({ "param": "is_all_fee", "compare": "=", "value": "NO" })
+        if (pam.examineStatus) {
+          pam.params.push({ "param": "examine_status", "compare": "=", "value": pam.examineStatus })
+        }
+        if (this.$route.query.rpProjectRepairId) {
+          pam.params.push({ "param": "rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
+        }
+        cb && cb(pam)
+        return enginMaterialList(pam)
+      } catch (err) {
+        console.log(err)
+      }
+    },
+
+    // 列表导出函数
+    exportList: enginMaterialListExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.openType = 0
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
+        examine: {
+          conditions: ({ row, index, column }) => {
+            return row.examineStatus == "WAIT"
+          },
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.openType = 1
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
+      })
+    },
+
+    handleClose() {
+      this.$refs.formRef.$refs.inlineForm.clearValidate()
+      this.formData = {}
+      this.formBool = false
+    },
+
+    WAITfun() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginMaterialExamine({
+            id: this.formData.orderId,
+            examineStatus: this.formData.examineStatus,
+            examineRemark: this.formData.examineRemark
+          }).then(res => {
+            this.$refs.pageRef.refreshList()
+            this.handleClose()
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 794 - 0
src/views/engineeringMaintenance/basicData/detail.vue

@@ -0,0 +1,794 @@
+<template>
+	<div class="s-page">
+		<el-page-header @back="goBack" :content="title"></el-page-header>
+		<el-divider></el-divider>
+		<div slot="moreSearch" v-if="formType != 0">
+		  <el-radio-group v-model="tabIndex" size="small" @change="">
+		  	<el-radio-button :label="1">基础资料</el-radio-button>
+		  	<el-radio-button :label="2">修改记录</el-radio-button>
+		  </el-radio-group>
+		  <br><br>
+		</div>
+		<template v-if="tabIndex == 1">
+			<el-card class="box-card">
+				<div style="margin-bottom: 20px;font-weight: bold;">项目信息</div>
+				<div class="mymain-container">
+					<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+						<el-row :gutter="20" justify="start">
+							<el-col :span="12">
+								<el-form-item label="所属商户" :required="true" >
+									<el-input type="text" :value="companyName" disabled></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
+								<el-form-item label="项目名称" prop="projectName">
+									<el-input type="text" v-model="formData.projectName" :disabled="formType==2" placeholder="请输入"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
+								<el-form-item label="负责人" prop="manger">
+									<el-input type="text" v-model="formData.manger" :disabled="formType==2" placeholder="请输入"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
+								<el-form-item label="联系电话" prop="mobile">
+									<el-input type="number" v-model="formData.mobile" :disabled="formType==2" placeholder="请输入"></el-input>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
+								<el-form-item label="维保时间" prop="dateList">
+									<el-date-picker
+									 :disabled="formType==2"
+									  v-model="formData.dateList"
+									  @change="selectDate"
+									  value-format="yyyy-MM-dd"
+									  type="daterange"
+									  range-separator="至"
+									  start-placeholder="开始日期"
+									  end-placeholder="结束日期">
+									</el-date-picker>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
+								<el-form-item label="工单类型" prop="orderSmallTypeText">
+									<el-checkbox-group v-model="formData.checkTypeList">
+									    <el-checkbox v-for="(item,index) in orderTypeList" :disabled="formType==2" :key="index" :label="item.id">{{item.orderSmallTypeText}}</el-checkbox>
+									</el-checkbox-group>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
+								<el-form-item label="包含全部费用" prop="isAllFee">
+									<el-radio-group v-model="formData.isAllFee" @change="(e)=>{
+										if(e == 'YES'){
+											formData.feePayMethod = ''
+										}
+									}">
+									    <el-radio :disabled="formType==2" label="YES">是</el-radio>
+									    <el-radio :disabled="formType==2" label="NO">否</el-radio>
+									</el-radio-group>
+								</el-form-item>
+							</el-col>
+							<el-col :span="12">
+								<el-form-item v-if="formData.isAllFee == 'NO'" label="费用支付方式" prop="feePayMethod">
+									<el-radio-group v-model="formData.feePayMethod">
+										<el-radio :disabled="formType==2" label="EXAMINE">审批后结算</el-radio>
+										<el-radio :disabled="formType==2" label="SITE">现场支付</el-radio>
+									</el-radio-group>
+								</el-form-item>
+							</el-col>
+							<el-col :span="24">
+								<el-form-item label="项目地址" prop="province" :required="true">
+									<el-row>
+										<el-col :span="5" style="margin-right: 12px;">
+											<el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
+										</el-col>
+										<el-col :span="5" style="margin-right: 12px;">
+											<el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
+										</el-col>
+										<el-col :span="5" style="margin-right: 12px;">
+											<el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
+										</el-col>
+										<el-col :span="8">
+											<el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
+										</el-col>
+									</el-row>
+								</el-form-item>
+							</el-col>
+							<el-col :span="24">
+								<el-form-item label="" prop="address">
+									<el-row :gutter="20">
+										<el-col :span="22">
+											<el-input type="text" v-model="formData.address" :disabled="formType==2" placeholder="详细地址"></el-input>
+										</el-col>
+										<el-col :span="2">
+											<geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
+										</el-col>
+									</el-row>
+								</el-form-item>
+							</el-col>
+							
+							<el-col :span="24">
+								<el-form-item label="项目说明">
+									<el-input type="textarea" :rows="4" :disabled="formType==2" v-model="formData.remark" placeholder="请输入"></el-input>
+								</el-form-item>
+							</el-col>
+						</el-row>
+					</el-form>
+				</div>
+			</el-card>
+			<br/>
+			<el-card class="box-card">
+				<el-tabs v-model="typeIndex" @change="changeType">
+				    <el-tab-pane label="项目设备" name="1"></el-tab-pane>
+				    <el-tab-pane label="项目人员" name="2"></el-tab-pane>
+				    <el-tab-pane label="服务网点" name="3"></el-tab-pane>
+				</el-tabs>
+				<el-button size="small" v-if="formType!=2" type="primary" @click="add()">新增</el-button>
+				<div class="table">
+					<!-- 项目设备 -->
+					<el-form ref="formData1" :model="formData1">
+						<el-table v-show="typeIndex == 1" :data="formData1.productList" element-loading-text="Loading" border fit highlight-current-row stripe>
+							<el-table-column label="品牌" align="center">
+								<template slot-scope="scope">
+									<el-form-item :prop="'productList.' + scope.$index + '.brand'" :rules="[{ required: true, message: `请选择品牌`, trigger: 'blur' }]">
+										<el-select v-model="scope.row.brand" @change="(e)=>{
+											scope.row.brandId = e.id
+											scope.row.brandName = e.brandName
+										}" value-key="id" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
+										    <el-option
+										      v-for="(item,ind) in brandList"
+										      :key="ind"
+										      :label="item.brandName"
+										      :value="item">
+										    </el-option>
+										</el-select>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="产品大类" align="center">
+								<template slot-scope="scope">
+									<el-form-item :prop="'productList.' + scope.$index + '.main'" :rules="[{ required: true, message: `请选择产品大类`, trigger: 'blur' }]">
+										<el-select v-model="scope.row.main" value-key="categoryId" @change="(e)=>{
+											scope.row.mainId = e.categoryId
+											scope.row.mainName = e.name
+											if(e.categoryId == 0){
+												scope.row.small = {categoryId: '0', name: '不限'}
+												scope.row.smallName = '不限'
+												scope.row.smallId = '0'
+											}else{
+												scope.row.small = null
+												scope.row.smallName = ''
+												scope.row.smallId = ''
+											}
+											
+											scope.row.smallList = e.children?[...[{categoryId: '0', name: '不限'}],...e.children]:[]
+										}" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
+										    <el-option
+										      v-for="(item,ind) in mainList"
+										      :key="ind"
+										      :label="item.name"
+										      :value="item">
+										    </el-option>
+										  </el-select>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="产品小类" align="center">
+								<template slot-scope="scope">
+									<el-form-item :prop="'productList.' + scope.$index + '.small'" :rules="[{ required: true, message: `请选择产品小类`, trigger: 'blur' }]">
+										<el-select v-model="scope.row.small" @focus="()=>{
+												if(!scope.row.main){return this.$message.warning('请先选择产品大类!');}
+											}" @change="(e)=>{
+												scope.row.smallName = e.name
+												scope.row.smallId = e.categoryId
+												scope.row.smallImg = e.imgUrl
+											}" :disabled="isEdit1 != scope.$index || formType == 2" value-key="categoryId" placeholder="请选择" style="width: 100%;">
+										    <el-option
+										      v-for="(item,ind) in scope.row.smallList"
+										      :key="ind"
+										      :label="item.name"
+										      :value="item">
+										    </el-option>
+										  </el-select>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="系列名称">
+								<template slot-scope="scope">
+									<el-form-item>
+										<el-input type="text" v-model="scope.row.seriesName" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="机型名称">
+								<template slot-scope="scope">
+									<el-form-item>
+										<el-input type="text" v-model="scope.row.productName" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column align="center" label="设备套数">
+								<template slot-scope="scope">
+									<el-form-item :prop="'productList.' + scope.$index + '.num'" :rules="[{ required: true, message: `请输入设备套数`, trigger: 'blur' }]">
+										<el-input type="number" v-model="scope.row.num" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="内机数量" >
+								<template slot-scope="scope">
+									<el-form-item>
+										<el-input type="number" v-model="scope.row.inNum" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column prop="" align="center" label="外机数量">
+								<template slot-scope="scope">
+									<el-form-item>
+										<el-input type="number" v-model="scope.row.outNum" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="操作" align="right" width="140">
+								<template slot-scope="scope" v-if="formType != 2">
+									<el-button size="mini" type="primary" v-if="scope.$index != isEdit1" @click="edit(1,scope.$index)">编辑</el-button>
+									<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+								</template>
+							</el-table-column>
+						</el-table>
+					</el-form>
+					<!-- 项目人员 -->
+					<el-form v-show="typeIndex == 2" ref="formData2" :rules="rules2" :model="formData2" label-width="0" size="small" label-position="left">
+						<el-table :data="formData2.byList" element-loading-text="Loading" border fit highlight-current-row stripe>
+							<el-table-column align="center" label="姓名">
+								<template slot-scope="scope">
+									<el-form-item :prop="'byList.' + scope.$index + '.name'" :rules="[{ required: true, message: `请输入姓名`, trigger: 'blur' }]">
+										<el-input type="text" v-model="scope.row.name" :disabled="isEdit2 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column align="center" label="联系电话" >
+								<template slot-scope="scope">
+									<el-form-item :prop="'byList.' + scope.$index + '.mobile'"
+										:rules="[{ required: true, message: `请输入联系电话`, trigger: 'blur' },{ pattern:/^((1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }]">
+										<el-input type="number" v-model="scope.row.mobile" :disabled="isEdit2 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="费用审批">
+								<template slot-scope="scope">
+									<el-form-item :prop="'byList.' + scope.$index + '.feeExamine'" :rules="[{ required: true, message: `请选择费用审批`, trigger: 'blur' }]">
+										<el-select v-model="scope.row.feeExamine" :disabled="isEdit2 != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
+										    <el-option
+										      v-for="item in [{id: 'YES',name: '是'},{id: 'NO',name: '否'}]"
+										      :key="item.id"
+										      :label="item.name"
+										      :value="item.id">
+										    </el-option>
+										  </el-select>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="操作" align="right" width="140">
+								<template slot-scope="scope" v-if="formType != 2">
+									<el-button size="mini" type="primary" v-if="scope.$index != isEdit2" @click="edit(2,scope.$index)">编辑</el-button>
+									<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+								</template>
+							</el-table-column>
+						</el-table>
+					</el-form>
+					<!-- 服务网点 -->
+					<el-form v-show="typeIndex == 3" ref="formData3" :model="formData3" label-width="0" size="small" label-position="left">
+						<el-table :data="formData3.websitList" element-loading-text="Loading" border fit highlight-current-row stripe>
+							<el-table-column align="center" label="网点名称">
+								<template slot-scope="scope">
+									<el-form-item :prop="'websitList.' + scope.$index + '.websit'" :rules="[{ required: true, message: `请选择网点名称`, trigger: 'blur' }]">
+										<el-select v-model="scope.row.websit" @change="(e)=>{
+											scope.row.websitId = e.websitId
+											scope.row.websitName = e.name
+											scope.row.linkName = e.linkName
+											scope.row.mobile = e.websitPhone
+											scope.row.address = e.address
+										}" value-key="websitId" :disabled="isEdit3 != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
+										    <el-option
+										      v-for="item in websitData"
+										      :key="item.websitId"
+										      :label="item.name"
+										      :value="item">
+										    </el-option>
+										  </el-select>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column align="center" label="联系人">
+								<template slot-scope="scope">
+									<el-form-item>
+										<el-input type="text" v-model="scope.row.linkName" disabled placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column align="center" label="移动电话" >
+								<template slot-scope="scope">
+									<el-form-item>
+										<el-input type="number" v-model="scope.row.mobile" disabled placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column align="center" label="地址" >
+								<template slot-scope="scope">
+									<el-form-item>
+										<el-input type="text" v-model="scope.row.address" disabled placeholder="请输入"></el-input>
+									</el-form-item>
+								</template>
+							</el-table-column>
+							<el-table-column label="操作" align="right" width="140">
+								<template slot-scope="scope" v-if="formType != 2">
+									<el-button size="mini" type="primary" v-if="scope.$index != isEdit3" @click="edit(3,scope.$index)">编辑</el-button>
+									<el-button size="mini" type="danger" @click="del(scope.$index)">删除</el-button>
+								</template>
+							</el-table-column>
+						</el-table>
+					</el-form>
+				</div>
+			</el-card>
+			<div class="page-footer">
+				<div class="footer">
+					<el-button v-if="formType != 2" size="small" type="primary" @click="confirm()">保存</el-button>
+					<el-button size="small" type="info" @click="goBack">返回</el-button>
+				</div>
+			</div>
+		</template>
+		<template v-else>
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>修改记录</span>
+				</div>
+				
+				<div class="table">
+					<el-table :data="historyList" element-loading-text="Loading" border fit highlight-current-row stripe>
+						<el-table-column prop="typeText" align="center" label="操作类型" ></el-table-column>
+						<el-table-column prop="content" align="left" label="操作内容"></el-table-column>
+						<el-table-column prop="createBy" align="center" label="操作人"></el-table-column>
+						<el-table-column prop="createTime" align="center" label="操作时间"></el-table-column>
+					</el-table>
+				</div>
+			</el-card>
+		</template>
+	</div>
+</template>
+
+<script>
+	import { getWebsit } from "@/api/customerManagement";
+	import { lbsAmapRegion } from '@/api/common.js'
+	import geographicalPosi from '@/components/geographicalPosi/index.vue'
+	import { getMainList } from "@/api/workOrder/settlementStandardInstall";
+	import { getBrand } from '@/api/goods'
+	import { getDetail, save } from "@/api/engineeringMaintenance/basicData";
+	import request from '@/utils/request'
+	export default {
+		components: {geographicalPosi},
+		props: ['id','title','formType'],
+		data() {
+			return {
+				tabIndex: 1,
+				typeIndex: '1',
+				orderTypeList: [],
+				websitData: [],
+				brandList: [],
+				historyList: [],
+				provinceList: [],
+				cityList: [],
+				areaList: [],
+				streetList: [],
+				mainList: [],
+				formData: {
+					dateList: [],
+					checkTypeList: [],
+					projectName: '',
+					manger: '',
+					mobile: '',
+					startTime: '',
+					endTime: '',
+					orderSmallTypeText: '安装',
+					isAllFee: 'YES',
+					feePayMethod: '',
+					province: '',
+					provinceId: '',
+					city: '',
+					cityId: '',
+					area: '',
+					areaId: '',
+					street: '',
+					streetId: '',
+					address: '',
+					lat: '',
+					lng: '',
+					remark: ''
+				},
+				formData1: {
+					productList: [],
+				},
+				formData2: {
+					byList: [],
+				},
+				formData3: {
+					websitList: [],
+				},
+				isEdit1: 0,
+				isEdit2: 0,
+				isEdit3: 0,
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				rules: {
+					projectName: [
+						{ required: true, message: '请输入项目名称', trigger: 'blur' },
+					],
+					manger: [
+						{ required: true, message: '请输入负责人名称', trigger: 'blur' },
+					],
+					mobile: [
+						{ required: true, message: `请输入联系电话`, trigger: 'blur' },
+						{ required: true, message: `请输入联系电话`, trigger: 'change' },
+						{ pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+					],
+					dateList: [
+						{ required: true, message: '请选择维保时间', trigger: 'change' }
+					],
+					checkTypeList: [
+						{ required: true, message: '请选择工单类型', trigger: 'change' }
+					],
+					address: [
+						{ required: true, message: '请选择详细地址', trigger: 'change' }
+					],
+					feePayMethod: [
+						{ required: true, message: '请选择费用支付方式', trigger: 'change' }
+					],
+					isAllFee: [
+						{ required: true, message: '', trigger: '' }
+					],
+					orderSmallTypeText: [
+						{ required: true, message: '', trigger: '' }
+					]
+				},
+				rules1: {},
+				rules2: {},
+				rules3: {},
+				isSave: true
+			};
+		},
+		computed: {
+			filterChildren(){
+				return function(id){
+					let data = []
+					this.mainList.forEach(item=>{
+						if(item.categoryId == id){
+							data = item.children?[...[{categoryId: '0', name: '不限'}],...item.children]:[]
+						}
+					})
+					return data
+				}
+			},
+		},
+		created() {
+			this.initData()
+			if(this.id){
+				this.getDetail()
+			}
+		},
+		methods: {
+			// 返回
+			goBack() {
+				this.$emit('back');
+			},
+			async getDetail(){
+				const that = this
+				this.formData.checkTypeList = []
+				getDetail({id: this.id}).then( async res => {
+					Object.assign(this.formData, res.data, {
+
+					})
+					this.historyList = res.data.operatorLogList
+					this.formData.dateList = [res.data.startTime,res.data.endTime]
+					this.formData1.productList = res.data.productList.map(item=>{
+						return Object.assign(item, {
+							smallList: this.filterChildren(item.mainId),
+							brand: {id: item.brandId,brandName: item.brandName},
+							main: {categoryId: item.mainId,name: item.mainName},
+							small: {categoryId: item.smallId,name: item.smallName}
+						})
+					})
+
+					res.data.websitList.map(item=>{
+						item.websit = {websitId: item.websitId,name: item.websitName}
+					})
+					res.data.typeList.forEach(item=>{
+						this.formData.checkTypeList.push(item.id)
+					})
+					this.formData2.byList = res.data.byList
+					this.formData3.websitList = res.data.websitList
+					
+					
+					console.log(this.formData1.productList,'123123123')
+				})
+			},
+			initData(){
+				this.getOrderType()
+				this.getBrandList()
+				this.getWebsit()
+				this.getMainList()
+				this.getinitlbslist()
+			},
+			getOrderType(){
+				request({
+					url: `/order/smalltype/list`,
+					method: 'post',
+					data: {
+						pageNum: 1,
+						pageSize: -1,
+						params: [{param: 'a.is_rp_project_repair',compare: '=', value: 'YES'}]
+					}
+				}).then(res => {
+					this.orderTypeList = res.data.records
+				})
+			},
+			getBrandList(){
+				getBrand().then(res => {
+					this.brandList = [...[{id: '0',brandName: '不限'}],...res.data]
+				})
+			},
+			getMainList(){
+				getMainList({type: 2}).then(res => {
+					this.mainList = [...[{categoryId: '0',name: '不限',children: [{categoryId: '0',name: '不限'}]}],...res.data]
+				})
+			},
+			getinitlbslist() {
+			  // 初始化请求省市区街道下拉选项数据
+			  lbsAmapRegion({ pid: 0 }).then(res => {
+			    this.provinceList = res.data
+			    // 创建工单时获取ip地址定位赋值
+			    if (!this.id && this.$IpAdd.province) {
+			      var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
+			      if (item) {
+			        this.formData.provinceId = item.id
+			        this.formData.province = item.name
+			      }
+			    }
+			    if (this.formData.provinceId) {
+			      lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+			        this.cityList = res.data
+			        // 创建工单时获取ip地址定位赋值
+			        if (!this.id && this.$IpAdd.city) {
+			          var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
+			          if (item2) {
+			            this.formData.cityId = item2.id
+			            this.formData.city = item2.name
+			          }
+			        }
+			        if (this.formData.cityId) {
+			          lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+			            this.areaList = res.data
+			          })
+			        }
+			        if (this.formData.areaId) {
+			          lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+			            this.streetList = res.data
+			          })
+			        }
+			      })
+			    }
+			  })
+			},
+			selectAddress(data){
+				this.formData.lng = data.center[0]
+				this.formData.lat = data.center[1]
+				// 获取定位的省市区街道
+				var { province, city, district, township } = data.data.addressComponent
+				// 获取选中省名称id
+				var { id, name } = this.provinceList.find(item => item.name === province)
+				this.formData.provinceId = id
+				this.formData.province = name
+				// 请求市选项
+				lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+				  // 赋值市选项
+				  this.cityList = res.data
+				  // 获取选中市名称id
+				  var { id, name } = res.data.find(item => item.name === city)
+				  this.formData.cityId = id
+				  this.formData.city = name
+				  // 请求区选项
+				  lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+				    // 赋值区选项
+				    this.areaList = res.data
+				    // 获取选中区名称id
+				    var { id, name } = res.data.find(item => item.name === district)
+				    this.formData.areaId = id
+				    this.formData.area = name
+				    // 请求街道选项
+				    lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+				      // 赋值街道选项
+				      this.streetList = res.data
+				      // 获取选中街道名称id
+				      var { id, name } = res.data.find(item => item.name === township)
+				      this.formData.streetId = id
+				      this.formData.street = name
+				      // 赋值GPS详细地址
+				      this.formData.address = data.name
+				    })
+				  })
+				})
+			},
+			selectDate(e){
+				this.formData.startTime = e[0] + ' 00:00:00'
+				this.formData.endTime = e[1] + ' 23:59:59'
+			},
+			getWebsit(){
+				getWebsit({type: 'C'}).then(res => {
+					this.websitData = res.data
+				})
+			},
+			getCategory(websitId){
+				getCategory({websitId}).then(res => {
+					this.mainList = res.data
+				})
+			},
+			changeType(){
+				
+			},
+			preserveRuleForm(name) {
+				let is_save = false
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						is_save = true
+					} else {
+						is_save = false;
+					}
+				});
+				return is_save
+			},
+			edit(typeIndex,index){
+				if(this.preserveRuleForm('formData' + this.typeIndex)){
+					this['isEdit' + typeIndex] = index
+				}
+			},
+			add(){
+				if(!this.preserveRuleForm('formData' + this.typeIndex)){return false}
+				let name = this.typeIndex == 1?'productList':this.typeIndex == 2?'byList':'websitList'
+				this['isEdit' + this.typeIndex] = 0
+				// if(this['formData' + this.typeIndex][name].length != 0){this['isEdit' + this.typeIndex] += 1}
+				if(this.typeIndex == 1){
+					this['formData' + this.typeIndex][name].unshift({
+						brand: null,
+						brandId: '',
+						brandName: '',
+						inNum: '',
+						main: null,
+						mainId: '',
+						mainName: '',
+						num: '',
+						outNum: '',
+						productName: '',
+						seriesName: '',
+						small: null,
+						smallId: '',
+						smallName: '',
+						smallImg: ''
+					})
+				}else if(this.typeIndex == 2){
+					this['formData' + this.typeIndex][name].unshift({
+						name: '',
+						mobile: '',
+						feeExamine: ''
+					})
+				}else{
+					this['formData' + this.typeIndex][name].unshift({
+						websit: null,
+						websitId: '',
+						websitName: '',
+						linkName: '',
+						mobile: '',
+						address: ''
+					})
+				}
+			},
+			del(index){
+				let name = this.typeIndex == 1?'productList':this.typeIndex == 2?'byList':'websitList'
+				this['formData' + this.typeIndex][name].splice(index,1)
+			},
+			confirm(){
+				const that = this
+				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+					if (valid) {
+						if(that.formData1.productList.length == 0){
+							that.typeIndex = '1'
+							return that.$message.error('请添加项目设备信息');
+						}
+						if(that.formData2.byList.length == 0){
+							that.typeIndex = '2'
+							return that.$message.error('请添加项目人员信息');
+						}
+						if(that.formData3.websitList.length == 0){
+							that.typeIndex = '3'
+							return that.$message.error('请添加服务网点信息');
+						}
+						if(!that.preserveRuleForm('formData1')){
+							return that.typeIndex = '1'
+						}
+						if(!that.preserveRuleForm('formData2')){
+							return that.typeIndex = '2'
+						}
+						if(!that.preserveRuleForm('formData3')){
+							return that.typeIndex = '3'
+						}
+						this.save()
+					}
+				})
+			},
+			save(){
+				if(!this.isSave){
+					return false
+				}
+				this.isSave = false
+				setTimeout(()=>{
+					this.isSave = true
+				},3000)
+				let data = this.orderTypeList.filter((it) => {
+				   const index = this.formData.checkTypeList.findIndex((item) => item === it.id)
+				   return index !== -1
+				 })
+				
+				const that = this
+				let params = {
+					...this.formData,
+					byList: this.formData2.byList,
+					productList: this.formData1.productList,
+					websitList: this.formData3.websitList,
+					typeList: data
+				}
+				save(params).then(res => {
+					that.$message.success('保存成功!')
+					setTimeout(()=>{
+						that.goBack()
+					},1500)
+				})
+			}
+		}
+	};
+</script>
+
+<style scoped="scoped" lang="scss">
+	.s-page {
+		padding: 20px;
+		background-color: #ffffff;
+	}
+	.page-footer {
+		height: 70px;
+	}
+	
+	.footer {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		z-index: 1;
+		width: 100%;
+		background: #fff;
+		padding: 15px 40px;
+		box-sizing: border-box;
+		transition: all 0.28s;
+		text-align: right;
+		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+	
+		&.hideSidebar {
+			margin-left: 54px;
+			width: calc(100vw - 54px);
+		}
+	
+		&.openSidebar {
+			margin-left: 210px;
+			width: calc(100vw - 210px);
+		}
+	
+		.tips {
+			font-size: 12px;
+			color: red;
+			margin-top: 10px;
+		}
+	}
+</style>

+ 197 - 0
src/views/engineeringMaintenance/basicData/index.vue

@@ -0,0 +1,197 @@
+<template>
+	<div class="page">
+		<template-page v-if="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="150"
+		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+		  :operation="operation()">
+		</template-page>
+		<div class="detail" v-else>
+			<detail :id="id" @back="backList" :formType="formDialogType" :title="'工程维保' + formDialogTitles[formDialogType]"></detail>
+		</div>
+	</div>	
+	
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import detail from './detail.vue'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { listPageV2,pageExport, getDetail, save } from "@/api/engineeringMaintenance/basicData";
+export default {
+  components: { TemplatePage, ImageUpload, detail },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ["新增","编辑", "详情"],
+      formDialog: false,
+      formData: {
+		
+      },
+	  id: ''
+    }
+  },
+  computed: {
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
+			]
+		]
+	},
+    formItems() {
+    }
+  },
+  methods: {
+    // 列表请求函数
+	getList: listPageV2,
+    // 列表导出函数
+    exportList: pageExport,
+	backList() {
+		this.id = ''
+		this.formDialog = false;
+		this.$nextTick(()=>{
+			this.$refs.pageRef.refreshList()
+		})
+	},
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+		if (item.jname === 'serviceCode') {
+		        defaultData.render = (h, { row, index, column }) => {
+		          return (
+		            <div style="cursor: pointer;display: flex">
+		              {row.serviceCode ? row.serviceCode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="cover" style="width:80px;height:80px;" />) : null}
+		            </div>
+		          )
+		        }
+		 }
+		if (item.jname === 'startTime') {
+		        defaultData.render = (h, { row, index, column }) => {
+		          return (
+		            <div style="cursor: pointer;display: flex">
+		              {row.startTime.substring(0,10)}
+		            </div>
+		          )
+		        }
+		 }
+		if (item.jname === 'endTime') {
+		        defaultData.render = (h, { row, index, column }) => {
+		          return (
+		            <div style="cursor: pointer;display: flex">
+		              {row.endTime.substring(0,10)}
+		            </div>
+		          )
+		        }
+		 }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    // 表格操作列
+    operation() {
+		return this.operationBtn({
+			edit: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.id = row.id
+					this.formDialogType = 1
+					this.openForm()
+				}
+			},
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.id = row.id
+					this.formDialogType = 2
+					this.openForm()
+				}
+			},
+			// expenseApply: {
+			// 	btnType: 'text',
+			// 	click: ({ row, index, column }) => {
+			// 		this.$router.push({
+			// 			name: row.isAllFee=='YES'?"allInclusiveExpense":'applicationWithoutFee',
+			// 			query: {
+			// 				rpProjectRepairId:row.id
+			// 			}
+			// 		})
+			// 	}
+			// },
+			serviceOrderDetail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.$router.push({
+						name: "workOrderPool",
+						query: {
+							rpProjectRepairId:row.id
+						}
+					})
+				}
+			}
+		})
+    },
+    addData() {
+      this.formDialogType = 0
+      this.openForm()
+    },
+    openForm() {
+      this.formDialog = true;
+    },
+    formCancel() {
+      this.$refs.formRef.$refs.inlineForm.clearValidate()
+      this.$data.formData = this.$options.data().formData
+      this.formDialog = false
+    },
+    formConfirm() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          (save)({
+			  ...this.formData,
+			  imgUrl:this.formData.imgUrl.map(item=>item.url).join(",")
+		  }).then(res => {
+            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+            this.formCancel()
+            this.$refs.pageRef.refreshList()
+          })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+	.tab{
+		padding: 20px 20px 0 20px;
+	}
+	.page{
+		height: 100%;
+	}
+</style>

+ 59 - 0
src/views/engineeringMaintenance/feeSettlementIncluded/index.vue

@@ -0,0 +1,59 @@
+<template>
+  <zj-page-container>
+    <div class="tab">
+      <el-radio-group v-model="tabType" size="small" @change="tabTypeChange">
+        <el-radio-button label="collect">汇总</el-radio-button>
+        <el-radio-button label="offline">明细</el-radio-button>
+      </el-radio-group>
+    </div>
+    <zj-page-fill>
+      <collect v-if="tabTypeCk == 'collect'" key="collect" />
+      <offline v-if="tabTypeCk == 'offline'" key="offline" :websitId="websitId" :workerId="workerId" :status="status" />
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { EventBus } from '@/utils/eventBus'
+import collect from './pages/collect.vue'
+import offline from './pages/offline.vue'
+export default {
+  components: { collect, offline },
+  data() {
+    return {
+      tabType: 'collect',
+      tabTypeCk: 'collect',
+      websitId: "",
+      workerId: "",
+      status: "",
+    }
+  },
+  created() {
+    EventBus.$on("tabTypeCkChange", ({ websitId, workerId, status, tabTypeCk }) => {
+      this.websitId = websitId
+      this.workerId = workerId
+      this.status = status
+      this.$nextTick(() => {
+        this.tabTypeCk = tabTypeCk
+        this.tabType = tabTypeCk
+      })
+    })
+  },
+  methods: {
+    tabTypeChange() {
+      this.websitId = ""
+      this.workerId = ""
+      this.status = ""
+      this.$nextTick(() => {
+        this.tabTypeCk = this.tabType
+      })
+    }
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+</style>

+ 77 - 0
src/views/engineeringMaintenance/feeSettlementIncluded/pages/collect.vue

@@ -0,0 +1,77 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { enginMaterialListPageSettlementV2, enginMaterialPageSettlementExport, enginMaterialDetail, enginMaterialLineSettlementHui } from "@/api/applicationWithoutFee.js"
+import { EventBus } from '@/utils/eventBus'
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {}
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: enginMaterialListPageSettlementV2,
+
+    // 列表导出函数
+    exportList: enginMaterialPageSettlementExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            var { websitId, workerId } = row
+            EventBus.$emit("tabTypeCkChange", { websitId, workerId, status: "", tabTypeCk: "offline" })
+          }
+        },
+        settle: {
+          prompt:"是否确认结算!",
+          conditions: ({ row, index, column }) => {
+            return row.totalAmount != row.giveAmount
+          },
+          click: ({ row, index, column }) => {
+            var { websitId, workerId } = row
+            enginMaterialLineSettlementHui({ websitId, workerId }).then(res => {
+              this.$refs.pageRef.refreshList()
+            })
+          }
+        },
+      })
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 170 - 0
src/views/engineeringMaintenance/feeSettlementIncluded/pages/offline.vue

@@ -0,0 +1,170 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+    <div class="cartographer_big">
+      <el-dialog title="详情" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
+        <zj-page-container v-if="formBool">
+          <zj-page-fill class="neibuview" v-if="formBool">
+            <zj-form-container v-if="formBool" :formAttributes="{ 'label-position': 'top' }">
+              <zj-form-module v-if="formBool" title="费用信息" :form-data="formData" :form-items="formItems">
+                <div v-if="openType === 1" style="text-align:right">
+                  <el-button size="mini" type="danger" plain @click="WAITfun">确定结算</el-button>
+                </div>
+              </zj-form-module>
+            </zj-form-container>
+          </zj-page-fill>
+        </zj-page-container>
+      </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 operation_mixin from '@/components/template/operation_mixin.js'
+import { enginMaterialListLine, enginMaterialListLineExport, enginMaterialDetail, enginMaterialLineSettlement } from "@/api/applicationWithoutFee.js"
+import feel from "../../mixins/feel.js"
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin, feel],
+  props: {
+    websitId: {
+      type: [String, Number],
+      default: ""
+    },
+    workerId: {
+      type: [String, Number],
+      default: ""
+    },
+    status: {
+      type: [String, Number],
+      default: ""
+    },
+  },
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {},
+      openType: 0
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.websitId) {
+          pam.params.push({ "param": "websit_id", "compare": "=", "value": this.websitId })
+        }
+        if (this.workerId) {
+          pam.params.push({ "param": "worker_id", "compare": "=", "value": this.workerId })
+        }
+        if (this.status) {
+          pam.params.push({ "param": "status", "compare": "=", "value": this.status })
+        }
+        cb && cb(pam)
+        return enginMaterialListLine(pam)
+      } catch (err) {
+        console.log(err)
+      }
+    },
+
+    // 列表导出函数
+    exportList: enginMaterialListLineExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail_mx: {
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.openType = 0
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
+        settle_mx: {
+          conditions: ({ row, index, column }) => {
+            return row.status == "WAIT"
+          },
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.openType = 1
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
+      })
+    },
+
+    handleClose() {
+      this.formData = {}
+      this.formBool = false
+    },
+
+    WAITfun() {
+      this.$confirm('是否确定结算?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        enginMaterialLineSettlement({
+          id: this.formData.orderId
+        }).then(res => {
+          this.$refs.pageRef.refreshList()
+          this.handleClose()
+        })
+      }).catch(() => {
+
+      });
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 104 - 0
src/views/engineeringMaintenance/feeSettlementIncludedwx/index.vue

@@ -0,0 +1,104 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+    <div class="cartographer_big">
+      <el-dialog title="详情" width="100%" :modal="false" :visible.sync="formBool" :before-close="handleClose">
+        <zj-page-container v-if="formBool">
+          <zj-page-fill class="neibuview" v-if="formBool">
+            <zj-form-container ref="formRef" v-if="formBool" :formAttributes="{ 'label-position': 'top' }">
+              <zj-form-module title="费用信息" :form-data="formData" :form-items="formItems">
+              </zj-form-module>
+            </zj-form-container>
+          </zj-page-fill>
+        </zj-page-container>
+      </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 operation_mixin from '@/components/template/operation_mixin.js'
+import { enginMaterialListWechat, enginMaterialListWechatExport, enginMaterialDetail } from "@/api/applicationWithoutFee.js"
+import { required } from '@/components/template/rules_verify.js'
+import feel from "../mixins/feel.js"
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin, feel],
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {},
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: enginMaterialListWechat,
+
+    // 列表导出函数
+    exportList: enginMaterialListWechatExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            enginMaterialDetail({
+              id: row.orderId
+            }).then(res => {
+              this.formData = res.data
+              this.$nextTick(() => {
+                this.formBool = true
+              })
+            })
+          }
+        },
+      })
+    },
+
+    handleClose() {
+      this.$refs.formRef.$refs.inlineForm.clearValidate()
+      this.formData = {}
+      this.formBool = false
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 271 - 0
src/views/engineeringMaintenance/mixins/feel.js

@@ -0,0 +1,271 @@
+
+export default {
+  computed: {
+    formItems() {
+      return [{
+        md: 24,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '基本信息',
+        },
+        render: (h, { props, onInput }) => {
+          var { formData } = props
+          return (
+            <el-descriptions border title="" column={2} colon={false} labelStyle={{ width: '13%' }} contentStyle={{ width: '37%' }}>
+              <el-descriptions-item label="所属商户">
+                {formData.companyWechatName}
+              </el-descriptions-item>
+              <el-descriptions-item label="申请单号">
+                {formData.orderId}
+              </el-descriptions-item>
+              <el-descriptions-item label="项目名称">
+                {formData.rpProjectRepairName}
+              </el-descriptions-item>
+              <el-descriptions-item label="工单单号">
+                {formData.workerOrderId}
+              </el-descriptions-item>
+              <el-descriptions-item label="负责人">
+                {formData.userName}
+              </el-descriptions-item>
+              <el-descriptions-item label="联系电话">
+                {formData.userMobile}
+              </el-descriptions-item>
+              <el-descriptions-item label="项目地址">
+                {formData.pgOrderBase.address}
+              </el-descriptions-item>
+              <el-descriptions-item label="创单人">
+                {formData.pgOrderBase.createBy}
+              </el-descriptions-item>
+              <el-descriptions-item label="创单人电话">
+                {formData.pgOrderBase.createMobile}
+              </el-descriptions-item>
+              <el-descriptions-item label="创单时间">
+                {formData.pgOrderBase.createTime}
+              </el-descriptions-item>
+              <el-descriptions-item label="工单类型">
+                {formData.orderSmallTypeText}
+              </el-descriptions-item>
+              <el-descriptions-item label="网点名称">
+                {formData.websitName}
+              </el-descriptions-item>
+              <el-descriptions-item label="申请人">
+                {formData.workerName}
+              </el-descriptions-item>
+              <el-descriptions-item label="联系电话">
+                {formData.workerMobile}
+              </el-descriptions-item>
+              <el-descriptions-item label="申请时间">
+                {formData.createTime}
+              </el-descriptions-item>
+              <el-descriptions-item label="包含全部费用">
+                {({ YES: "是", NO: "否" })[formData.isAllFee]}
+              </el-descriptions-item>
+
+              {!!~["applicationWithoutFee", "feeSettlementIncluded", "feeSettlementIncludedwx"].indexOf(this?.$route?.name) ? <el-descriptions-item label="费用支付方式">
+                {({ EXAMINE: "审批后结算", SITE: "现场支付" })[formData.feePayMethod]}
+              </el-descriptions-item> : null}
+
+              {!!~["applicationWithoutFee"].indexOf(this?.$route?.name) && formData.feePayMethod == "EXAMINE" ? [
+                <el-descriptions-item label="费用单状态">
+                  {({ WAIT: "待审", OK: "通过", FAIL: "驳回", PAID: "现场支付", NO: "取消", NO_PAID: "未支付" })[formData.examineStatus]}
+                </el-descriptions-item>,
+                <el-descriptions-item label="审批人">
+                  {formData.examineName}
+                </el-descriptions-item>,
+                <el-descriptions-item label="审批时间">
+                  {formData.examineTime}
+                </el-descriptions-item>,
+                <el-descriptions-item label="取消人">
+                  {formData.cancelName}
+                </el-descriptions-item>,
+                <el-descriptions-item label="取消时间">
+                  {formData.cancelTime}
+                </el-descriptions-item>
+              ] : null}
+
+              {!!~["feeSettlementIncluded"].indexOf(this?.$route?.name) && formData.feePayMethod == "EXAMINE" ? [
+                <el-descriptions-item label="结算状态">
+                  {({ WAIT: "待结算", OVER: "已结算" })[formData.status]}
+                </el-descriptions-item>,
+                <el-descriptions-item label="结算人">
+                  {formData.settleName}
+                </el-descriptions-item>,
+                <el-descriptions-item label="结算时间">
+                  {formData.settleTime}
+                </el-descriptions-item>
+              ] : null}
+            </el-descriptions>
+          )
+        }
+      }, {
+        md: 24,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '费用明细',
+        },
+        render: (h, { props, onInput }) => {
+          var { formData } = props
+          return (
+            <zj-table
+              columns={[{
+                columnAttributes: {
+                  label: '费用名称',
+                  prop: 'goodsName',
+                }
+              }, {
+                columnAttributes: {
+                  label: '费用类型',
+                  prop: 'chargeType',
+                },
+                render: (h, { row, column, index }) => {
+                  return (
+                    <div style="padding-left:10px">
+                      {({ MCC: "辅材物料", ACC: "配件物料", SERV: "服务收费" })[row.chargeType]}
+                    </div>
+                  )
+                }
+              }, {
+                columnAttributes: {
+                  label: '单价',
+                  prop: 'goodsAmount',
+                }
+              }, {
+                columnAttributes: {
+                  label: '数量',
+                  prop: 'num',
+                }
+              }, {
+                columnAttributes: {
+                  label: '费用金额',
+                  prop: 'totalAmount',
+                }
+              },
+              ]}
+              table-data={formData.rpMaterialOrderItems}
+            />
+          )
+        }
+      },
+      {
+        md: 8,
+        isShow: this.formData.rpMaterialOrderItems.filter(item => item.chargeType == "MCC").length,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '辅材费用合计',
+        },
+        render: (h, { props, onInput }) => {
+          var { formData } = props
+          return <span>{[0, 0, 0, ...formData.rpMaterialOrderItems.filter(item => item.chargeType == "MCC").map(item => item.totalAmount)].reduce(function (prev, curr, idx, arr) {
+            return prev + curr;
+          }).toFixed(2)}</span>
+        }
+      },
+      {
+        md: 8,
+        isShow: this.formData.rpMaterialOrderItems.filter(item => item.chargeType == "ACC").length,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '配件费用合计',
+        },
+        render: (h, { props, onInput }) => {
+          var { formData } = props
+          return <span>{[0, 0, 0, ...formData.rpMaterialOrderItems.filter(item => item.chargeType == "ACC").map(item => item.totalAmount)].reduce(function (prev, curr, idx, arr) {
+            return prev + curr;
+          }).toFixed(2)}</span>
+        }
+      },
+      {
+        md: 8,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '服务收费费用合计',
+        },
+        render: (h, { props, onInput }) => {
+          var { formData } = props
+          return <span>{[0, 0, 0, ...formData.rpMaterialOrderItems.filter(item => item.chargeType == "SERV").map(item => item.totalAmount)].reduce(function (prev, curr, idx, arr) {
+            return prev + curr;
+          }).toFixed(2)}</span>
+        }
+      },
+      {
+        md: 8,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '总金额',
+        },
+        render: (h, { props, onInput }) => {
+          var { formData } = props
+          return <span>{[0, 0, 0, ...formData.rpMaterialOrderItems.map(item => item.totalAmount)].reduce(function (prev, curr, idx, arr) {
+            return prev + curr;
+          }).toFixed(2)}</span>
+        }
+      }, {
+        name: 'el-input',
+        md: 24,
+        attributes: { disabled: true, type: "textarea", placeholder: '' },
+        formItemAttributes: { label: '申请备注', prop: 'remark' },
+      },
+      ...(() => {
+        if (this.formData.payType == 'WECHAT') {
+          return [{
+            md: 24,
+            name: 'slot-component',
+            formItemAttributes: {
+              label: '交易记录',
+            },
+            render: (h, { props, onInput }) => {
+              var { formData } = props
+              return (
+                <zj-table
+                  columns={[{
+                    columnAttributes: {
+                      label: 'id',
+                      prop: 'orderId',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易类型',
+                      prop: 'goodsType',
+                    },
+                    render: (h, { row }) => {
+                      return <div>
+                        {({ M: "辅材", P: "配件" })[row.goodsType]}
+                      </div>
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易金额',
+                      prop: 'totalAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易状态',
+                      prop: 'payStatus',
+                    },
+                    render: (h, { row }) => {
+                      return <div>
+                        {({ CANCEL: "取消", WAIT: "待支付", PAID: "已支付" })[row.payStatus]}
+                      </div>
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '交易时间',
+                      prop: 'payTime',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '创建时间',
+                      prop: 'createTime',
+                    }
+                  }]}
+                  table-data={[formData]}
+                />
+              )
+            }
+          }]
+        }
+        return []
+      })()]
+    }
+  }
+}

+ 6 - 1
src/views/login/index.vue

@@ -73,7 +73,12 @@
         </div>
 		<div class="info-item">
 			<el-link href="https://www.zfire.top/#/" :underline="false" target="_blank">
-			  {{ companyList[0] && companyList[0].companyName ? companyList[0].companyName : '' }}
+				{{ companyList[0] && companyList[0].companyName ? companyList[0].companyName : '' }}
+			</el-link>
+		</div>
+		<div class="info-item">
+			<el-link href="https://mp.weixin.qq.com" :underline="false" target="_blank">
+			  微信公众号&小程序
 			</el-link>
 		</div>
         <div class="link_gs">

+ 73 - 59
src/views/mallManagement/activity/coupon_index/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <el-dialog title="" width="1000px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -33,23 +33,12 @@ import selectMember from "@/components/selectComponent/selectMember.vue"
 import selectGoods from "@/components/selectComponent/selectGoods.vue"
 import { MEMBER_CURRENT_TYPE_FILTER } from "@/filters/index.js"
 import ImageUpload from '@/components/file-upload'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, selectMember, selectGoods, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新增优惠券',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -92,6 +81,20 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
+			]
+		]
+	},
     isService() {
       if (this.formData.receiveCrowd == 3) {
         return true;
@@ -467,51 +470,62 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getCouponDetail({ couponId: row.couponId }).then(res => {
-              Object.assign(this.formData, res.data, {
-                receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
-                activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
-                imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
-              })
-              this.formDialogType = 2
-              this.openForm()
-            })
-          }}>查看</el-button>
-          {row.releaseFlag === 'WAIT' ? <el-button type="text" onClick={() => {
-            getCouponDetail({ couponId: row.couponId }).then(res => {
-              Object.assign(this.formData, res.data, {
-                receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
-                activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
-                imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
-              })
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button> : null}
-          {row.releaseFlag === 'START' ? <el-popconfirm
-            title="确定取消吗?"
-            onConfirm={() => {
-              changeFlag(row.couponId)
-            }}
-          >
-            <el-button type="text" slot="reference">取消</el-button>
-          </el-popconfirm> : null}
-          {row.releaseFlag === 'START' ? <el-popconfirm
-            title="确定补发业务员优惠券吗?"
-            onConfirm={() => {
-              reissueCoupon(row.couponId)
-            }}
-          >
-            <el-button type="text" slot="reference">补发业务员优惠券</el-button>
-          </el-popconfirm> : null}
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getCouponDetail({ couponId: row.couponId }).then(res => {
+						Object.assign(this.formData, res.data, {
+							receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
+							activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
+							imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
+						})
+						this.formDialogType = 2
+						this.openForm()
+					})
+				}
+				},
+			edit: {
+				btnType: 'text',
+				conditions: ({ row, index, column }) => {
+					return row.releaseFlag === 'WAIT'
+				},
+				click: ({ row, index, column }) => {
+					getCouponDetail({ couponId: row.couponId }).then(res => {
+						Object.assign(this.formData, res.data, {
+							receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
+							activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
+							imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
+						})
+						this.formDialogType = 1
+						this.openForm()
+					})
+				}
+			},
+			cancel: {
+				btnType: 'text',
+				prompt: '确定取消吗?',
+				conditions: ({ row, index, column }) => {
+					return row.releaseFlag === 'START'
+				},
+				click: ({ row, index, column }) => {
+					changeFlag(row.couponId)
+				}
+			},
+			reissue: {
+				btnType: 'text',
+				prompt:  '确定补发业务员优惠券吗?',
+				conditions: ({ row, index, column }) => {
+					return row.releaseFlag === 'START'
+				},
+				click: ({ row, index, column }) => {
+					reissueCoupon(row.couponId)
+				}
+			},
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 51 - 46
src/views/mallManagement/activity/seckill_index/index_1.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <div slot="moreSearch">
       <el-radio-group v-model="type" size="mini" @change="changeType">
         <el-radio-button label="">全部</el-radio-button>
@@ -17,31 +17,14 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { closeActivityStatus, openActivityStatus, secKillGoodsActivityListPageV2, secKillGoodsActivityListPageV2Export } from '@/api/seckill'
-
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       type: "",
       statistics: {},
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '添加秒杀活动',
-              isRole: true,
-              click: () => {
-                this.$router.push({
-                  name: "seckill_add",
-                  query: {}
-                })
-              }
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -56,6 +39,23 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.$router.push({
+							  name: "seckill_add",
+							  query: {}
+							})
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -91,32 +91,37 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-popconfirm
-            title={`是否确定${row.status ? "关闭" : "开启"}?`}
-            onConfirm={() => {
-              (row.status ? closeActivityStatus : openActivityStatus)({ secKillId: row.secKillId }).then(res => {
-                this.$message({ type: 'success', message: `${row.status ? "关闭" : "开启"}成功!` })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">{row.status ? "关闭" : "开启"}</el-button>
-          </el-popconfirm>
-          <el-button type="text" onClick={() => {
-            this.$router.push({
-              name: "seckill_add",
-              query: {
-                id: row.secKillId
-              }
-            })
-          }}>编辑</el-button>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+		  edit: {
+			btnType: 'text',
+		    click: ({ row, index, column }) => {
+		      this.$router.push({
+		        name: "seckill_add",
+		        query: {
+		          id: row.secKillId
+		        }
+		      })
+		    }
+		  },
+		  status: {
+				btnType: 'text',
+				name: ({ row, index, column }) => {
+					return row.status ? "关闭" : "开启"
+				},
+					prompt:  ({ row, index, column }) => {
+					return `是否确定${row.status ? "关闭" : "开启"}?`
+				},
+		    click: ({ row, index, column }) => {
+		      (row.status ? closeActivityStatus : openActivityStatus)({ secKillId: row.secKillId }).then(res => {
+		        this.$message({ type: 'success', message: `${row.status ? "关闭" : "开启"}成功!` })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  },
+		})
+	},
   }
 }
 </script>

+ 33 - 32
src/views/mallManagement/activity/seckill_index/index_2.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <div slot="moreSearch">
       <el-radio-group v-model="type" size="mini" @change="changeType">
         <el-radio-button label="">全部</el-radio-button>
@@ -17,10 +17,10 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { secKillGoodsSpecListPageV2, secKillGoodsSpecListPageV2Export, closeGoodsStatus, openGoodsStatus, deleteGoods } from '@/api/seckill'
-
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       type: "",
@@ -83,35 +83,36 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-popconfirm
-            title={`是否确定${row.status ? "关闭" : "开启"}?`}
-            onConfirm={() => {
-              (row.status ? closeGoodsStatus : openGoodsStatus)({ secKillSpecId: row.secKillSpecId }).then(res => {
-                this.$message({ type: 'success', message: `${row.status ? "关闭" : "开启"}成功!` })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">{row.status ? "关闭" : "开启"}</el-button>
-          </el-popconfirm>
-          <el-popconfirm
-            title={`是否确定删除?`}
-            onConfirm={() => {
-              deleteGoods({ secKillSpecId: row.secKillSpecId }).then(res => {
-                this.$message({ type: 'success', message: `删除成功!` })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+		  del: {
+		  	btnType: 'text',
+		  	prompt: '确定删除吗?',
+		    click: ({ row, index, column }) => {
+		      deleteGoods({ secKillSpecId: row.secKillSpecId }).then(res => {
+		        this.$message({ type: 'success', message: `删除成功!` })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  },
+		  status: {
+				btnType: 'text',
+				name: ({ row, index, column }) => {
+					return row.status ? "关闭" : "开启"
+				},
+					prompt:  ({ row, index, column }) => {
+					return `是否确定${row.status ? "关闭" : "开启"}?`
+				},
+		    click: ({ row, index, column }) => {
+		      (row.status ? closeGoodsStatus : openGoodsStatus)({ secKillSpecId: row.secKillSpecId }).then(res => {
+		        this.$message({ type: 'success', message: `${row.status ? "关闭" : "开启"}成功!` })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  },
+		})
+	},
   }
 }
 </script>

+ 1 - 1
src/views/mallManagement/activity/special_index/index.vue

@@ -14,7 +14,7 @@
       >
         <el-table-column align="center" label="操作" width="200" fixed="right">
           <template slot-scope="scope">
-            <el-button type="text" @click="toConfigure(scope.row)">配置</el-button>
+            <el-button v-if="$restrict('set')" type="text" @click="toConfigure(scope.row)">配置</el-button>
           </template>
         </el-table-column>
         <el-table-column

+ 3 - 3
src/views/mallManagement/brand/index.vue

@@ -3,7 +3,7 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button size="small" type="primary" icon="el-icon-plus" @click="addOrEdit('add')">添加品牌</el-button>
+          <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEdit('add')">添加品牌</el-button>
         </div>
       </div>
 
@@ -30,8 +30,8 @@
           <el-table-column align="center" label="修改时间" prop="updateTime" min-width="160"></el-table-column>
           <el-table-column align="center" label="操作" fixed="right" width="120">
             <template slot-scope="scope">
-              <el-button type="text" @click="addOrEdit('edit', scope.row.id)">编辑</el-button>
-              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.id)">
+              <el-button type="text" v-if="$restrict('edit')" @click="addOrEdit('edit', scope.row.id)">编辑</el-button>
+              <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.id)">
                 <el-button slot="reference" type="text">删除</el-button>
               </el-popconfirm>
             </template>

+ 3 - 1
src/views/mallManagement/configCenter/annunciationConfig/index.vue

@@ -16,7 +16,7 @@
     </div>
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="submitMainForm">保存</el-button>
+        <el-button v-if="$restrict('save')" type="primary" @click="submitMainForm">保存</el-button>
       </div>
     </div>
   </div>
@@ -25,8 +25,10 @@
 <script>
 import { mapGetters } from 'vuex'
 import { getNotice, addNotice, editNotice } from '@/api/setting'
+import operation_mixin from '@/components/template/operation_mixin.js'
 
 export default {
+	mixins: [operation_mixin],
   data() {
     return {
       mainData: {

+ 55 - 49
src/views/mallManagement/configCenter/business_type/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation">
+    :operation="operation()">
     <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -23,23 +23,12 @@ import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { chargingStandardTypeList2, getTypeList, getTypeDetail, saveType, deleteType } from "@/api/miniapp";
 import ImageUpload from '@/components/file-upload'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '添加业务类型',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -62,6 +51,20 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -107,41 +110,44 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getTypeDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 2
-              this.openForm()
-            })
-          }}>查看</el-button>
-          <el-button type="text" onClick={() => {
-            getTypeDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteType({ id: row.id }).then(res => {
-                this.$message({
-                  type: 'success',
-                  message: `删除成功!`,
-                })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getTypeDetail({ id: row.id }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 2
+					  this.openForm()
+					})
+				}
+			},
+			edit: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getTypeDetail({ id: row.id }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 1
+					  this.openForm()
+					})
+				}
+			},
+			del: {
+				btnType: 'text',
+				prompt: '确定删除吗?',
+				click: ({ row, index, column }) => {
+					deleteType({ id: row.id }).then(res => {
+					  this.$message({
+					    type: 'success',
+					    message: `删除成功!`,
+					  })
+					  this.$refs.pageRef.refreshList()
+					})
+				}
+			}
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 57 - 51
src/views/mallManagement/configCenter/chargingStandard/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation">
+    :operation="operation()">
     <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -24,23 +24,12 @@ import { required, mobileRequired, mobile } from '@/components/template/rules_ve
 import { chargingStandardList2, getMainList, getMainDetail, saveMain, deleteMain, getTypeList, getBrandList } from "@/api/miniapp";
 import { getClassifyList } from '@/api/goods'
 import ImageUpload from '@/components/file-upload'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '添加收费标准',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -71,6 +60,20 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -193,43 +196,46 @@ export default {
       this.recordSelected = data
     },
     // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getMainDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data, {
-                imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : [],
-              })
-              this.formDialogType = 2
-              this.openForm()
-            })
-          }}>查看</el-button>
-          <el-button type="text" onClick={() => {
-            getMainDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data, {
-                imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : [],
-              })
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteMain({ id: row.id }).then(res => {
-                this.$message({
-                  type: 'success',
-                  message: `删除成功!`,
-                })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
+    operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+			  click: ({ row, index, column }) => {
+			    getMainDetail({ id: row.id }).then(res => {
+			      Object.assign(this.formData, res.data, {
+			        imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : [],
+			      })
+			      this.formDialogType = 2
+			      this.openForm()
+			    })
+			  }
+			},
+		  edit: {
+				btnType: 'text',
+		    click: ({ row, index, column }) => {
+		      getMainDetail({ id: row.id }).then(res => {
+		        Object.assign(this.formData, res.data, {
+		          imageUrl: res.data.imageUrl ? [{ url: res.data.imageUrl }] : [],
+		        })
+		        this.formDialogType = 1
+		        this.openForm()
+		      })
+		    }
+		  },
+		  del: {
+				btnType: 'text',
+				prompt: '确定删除吗?',
+		    click: ({ row, index, column }) => {
+		      deleteMain({ id: row.id }).then(res => {
+		        this.$message({
+		          type: 'success',
+		          message: `删除成功!`,
+		        })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  }
+		})
     },
     addData() {
       this.formDialogType = 0

+ 73 - 64
src/views/mallManagement/configCenter/faultSelfExamination/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <div slot="moreSearch">
       <el-radio-group v-model="type" size="mini" @change="changeType">
         <el-radio-button :label="''">全部</el-radio-button>
@@ -32,39 +32,13 @@ import { required, mobileRequired, mobile } from '@/components/template/rules_ve
 import { chargingStandardList3, chargingStandardList3PageExport, chargingStandardImport, getMainList, getMainDetail, saveMain, deleteMain, getBrandList } from "@/api/miniapp";
 import { getClassifyList } from '@/api/goods'
 import { downloadFiles } from '@/utils/util'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       type: "",
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '下载导入模板',
-              click: this.handleDownload
-            }
-          ],
-          [
-            {
-              name: '导入模板',
-              render: () => {
-                return this.importButton(chargingStandardImport, '导入模板')
-              }
-            }
-          ],
-        ],
-        [
-          [
-            {
-              name: '添加',
-              click: this.addData
-            }
-          ],
-        ]
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -94,6 +68,38 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
+			],
+			[
+				[
+					this.optionsEvensAuth("template", {
+						click: () => {
+							this.handleDownload()
+						}
+					})
+				],
+			],
+			[
+				[
+					this.optionsEvensAuth("imp", {
+						render: () => {
+						  return this.importButton(chargingStandardImport, '导入模板')
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -216,41 +222,44 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getMainDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 2
-              this.openForm()
-            })
-          }}>查看</el-button>
-          <el-button type="text" onClick={() => {
-            getMainDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteMain({ id: row.id }).then(res => {
-                this.$message({
-                  type: 'success',
-                  message: `删除成功!`,
-                })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getMainDetail({ id: row.id }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 2
+					  this.openForm()
+					})
+				}
+			},
+			edit: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getMainDetail({ id: row.id }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 1
+					  this.openForm()
+					})
+				}
+			},
+			del: {
+				btnType: 'text',
+				prompt: '确定删除吗?',
+				click: ({ row, index, column }) => {
+					deleteMain({ id: row.id }).then(res => {
+					  this.$message({
+					    type: 'success',
+					    message: `删除成功!`,
+					  })
+					  this.$refs.pageRef.refreshList()
+					})
+				}
+			}
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 5 - 5
src/views/mallManagement/configCenter/serviceProduct/index.vue

@@ -3,7 +3,7 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add')">添加分类</el-button>
+          <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add')">添加分类</el-button>
         </div>
         <div class="fr">
           <el-input placeholder="请输入分类名称进行搜索" v-model="screenForm.keyword" size="small" style="width: 240px;" clearable>
@@ -35,10 +35,10 @@
           </el-table-column>
           <el-table-column align="right" label="操作" width="150" fixed="right">
             <template slot-scope="scope">
-              <el-button type="primary" size="mini" icon="el-icon-plus" v-if="scope.row.level == 1" @click="addOrEditChild('add', scope.row.categoryId)"></el-button>
-              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 1" @click="addOrEditParent('edit', scope.row.categoryId)"></el-button>
-              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 2" @click="addOrEditChild('edit', scope.row.categoryId)"></el-button>
-              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.categoryId)" >
+              <el-button type="primary" size="mini" icon="el-icon-plus" v-if="scope.row.level == 1 && $restrict('add')" @click="addOrEditChild('add', scope.row.categoryId)"></el-button>
+              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 1 && $restrict('edit')" @click="addOrEditParent('edit', scope.row.categoryId)"></el-button>
+              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 2 && $restrict('edit')" @click="addOrEditChild('edit', scope.row.categoryId)"></el-button>
+              <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.categoryId)" >
                 <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
               </el-popconfirm>
 

+ 5 - 2
src/views/mallManagement/configCenter/slideshowConfig/index.vue

@@ -65,7 +65,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							this.addData
+							this.addData()
 						}
 					})
 				],
@@ -75,7 +75,7 @@ export default {
 					this.optionsEvensAuth("del", {
 						name: '批量删除',
 						click: () => {
-							this.batchDelete
+							this.batchDelete()
 						}
 					})
 				],
@@ -226,6 +226,7 @@ export default {
     operation() {
 		return this.operationBtn({
 		  edit: {
+			btnType: 'text',
 		    click: ({ row, index, column }) => {
 		      getBannerDetail({ id: row.id }).then(res => {
 		        Object.assign(this.formData, res.data, {
@@ -237,6 +238,7 @@ export default {
 		    }
 		  },
 		  del: {
+			btnType: 'text',
 			prompt: '确定删除吗?',
 		    click: ({ row, index, column }) => {
 		      deleteBanner({ carouselMapId: row.id }).then(() => {
@@ -246,6 +248,7 @@ export default {
 		    }
 		  },
 		  status: {
+			btnType: 'text',
 			name: ({ row, index, column }) => {
 				return row.state ? '隐藏' : '显示'
 			},

+ 57 - 56
src/views/mallManagement/freight/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <el-dialog title="" width="1165px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -34,23 +34,12 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { freightListPageV2, freightPageExport, deleteFreight, addOrEditFreight, getFreightDetail, getRegionTree, changeFreightStatus } from "@/api/freight";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新建',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -76,6 +65,20 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -215,48 +218,46 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getFreightDetail({ freightTemplateId: row.freightTemplateId }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button>
-          {row.status ? <el-popconfirm style="margin-right: 10px;" title="确定禁用吗?"
-            onConfirm={() => {
-              changeFreightStatus({ freightTemplateId: row.freightTemplateId, status: false }).then(res => {
-                this.$message({ type: 'success', message: '禁用成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}>
-            <el-button slot="reference" type="text">禁用</el-button>
-          </el-popconfirm> : <el-popconfirm style="margin-right: 10px;" title="确定启用吗?"
-            onConfirm={() => {
-              changeFreightStatus({ freightTemplateId: row.freightTemplateId, status: true }).then(res => {
-                this.$message({ type: 'success', message: '启用成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}>
-            <el-button slot="reference" type="text">启用</el-button>
-          </el-popconfirm>}
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteFreight({ freightTemplateId: row.freightTemplateId }).then(() => {
-                this.$message({ type: 'success', message: '删除成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			edit: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getFreightDetail({ freightTemplateId: row.freightTemplateId }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 1
+					  this.openForm()
+					})
+				}
+			},
+			del: {
+				btnType: 'text',
+				prompt: '确定删除吗?',
+				click: ({ row, index, column }) => {
+					deleteFreight({ freightTemplateId: row.freightTemplateId }).then(() => {
+					  this.$message({ type: 'success', message: '删除成功!' })
+					  this.$refs.pageRef.refreshList()
+					})
+				}
+			},
+			status: {
+				name: ({ row, index, column }) => {
+					return row.status?'禁用':'启用'
+				},
+				btnType: 'text',
+				prompt: ({ row, index, column }) => {
+					return `是否${row.status?'禁用':'启用'}?`
+				},
+				click: ({ row, index, column }) => {
+					changeFreightStatus({ freightTemplateId: row.freightTemplateId, status: !row.status }).then(res => {
+					  this.$message({ type: 'success', message: `${row.status?'禁用':'启用'}成功!` })
+					  this.$refs.pageRef.refreshList()
+					})
+				}
+			},
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 5 - 5
src/views/mallManagement/goods/classify_index/index.vue

@@ -3,7 +3,7 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add')">添加分类</el-button>
+          <el-button v-if="$restrict('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add')">添加分类</el-button>
         </div>
         <div class="fr">
           <el-input placeholder="请输入分类名称进行搜索" v-model="screenForm.keyword" size="small" style="width: 240px;" clearable>
@@ -35,10 +35,10 @@
           </el-table-column>
           <el-table-column align="right" label="操作" width="150" fixed="right">
             <template slot-scope="scope">
-              <el-button type="primary" size="mini" icon="el-icon-plus" v-if="scope.row.level == 1" @click="addOrEditChild('add', scope.row.categoryId)"></el-button>
-              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 1" @click="addOrEditParent('edit', scope.row.categoryId)"></el-button>
-              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 2" @click="addOrEditChild('edit', scope.row.categoryId)"></el-button>
-              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.categoryId)" >
+              <el-button type="primary" size="mini" icon="el-icon-plus" v-if="scope.row.level == 1 && $restrict('add')" @click="addOrEditChild('add', scope.row.categoryId)"></el-button>
+              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 1 && $restrict('edit')" @click="addOrEditParent('edit', scope.row.categoryId)"></el-button>
+              <el-button type="primary" size="mini" icon="el-icon-edit" v-if="scope.row.level == 2 && $restrict('edit')" @click="addOrEditChild('edit', scope.row.categoryId)"></el-button>
+              <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="handleDelete(scope.row.categoryId)" >
                 <el-button slot="reference" size="mini" icon="el-icon-delete"></el-button>
               </el-popconfirm>
 

+ 60 - 59
src/views/mallManagement/goods/explain_index/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
   </template-page>
 </template>
 
@@ -9,40 +9,12 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { deleteModule, templateListPageV2, templatePageExport } from '@/api/goods'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '添加模块',
-              isRole: true,
-              click: () => {
-                this.$router.push({
-                  name: "explain_add",
-                  query: {}
-                })
-              }
-            }
-          ],
-          [
-            {
-              name: '编辑公共模块',
-              isRole: true,
-              click: () => {
-                this.$router.push({
-                  name: "explain_common",
-                  query: {}
-                })
-              }
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -57,6 +29,35 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.$router.push({
+							  name: "explain_add",
+							  query: {}
+							})
+						}
+					})
+				],
+			],
+			[
+				[
+					this.optionsEvensAuth("explain_common", {
+						click: () => {
+							this.$router.push({
+							  name: "explain_common",
+							  query: {}
+							})
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -78,34 +79,34 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            this.$router.push({
-              name: "explain_add",
-              query: {
-                id: row.commonTemplateId
-              }
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteModule({
-                commonTemplateId: row.commonTemplateId
-              }).then(res => {
-                this.$message({ type: 'success', message: '删除成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+		  edit: {
+			btnType: 'text',
+		    click: ({ row, index, column }) => {
+		      this.$router.push({
+		        name: "explain_add",
+		        query: {
+		          id: row.commonTemplateId
+		        }
+		      })
+		    }
+		  },
+		  del: {
+			btnType: 'text',
+			prompt: '确定删除吗?',
+		    click: ({ row, index, column }) => {
+		      deleteModule({
+		        commonTemplateId: row.commonTemplateId
+		      }).then(res => {
+		        this.$message({ type: 'success', message: '删除成功!' })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  }
+		})
+	},
   }
 }
 </script>

+ 9 - 9
src/views/mallManagement/goods/goods_index/index.vue

@@ -73,11 +73,11 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button type="primary" icon="el-icon-plus" size="small" @click="addOrEdit('add')">添加商品</el-button>
-          <el-button size="small" @click="batchOperation('on')">批量上架</el-button>
-          <el-button size="small" @click="batchOperation('off')">批量下架</el-button>
-          <el-button size="small" @click="batchOperation('module')">批量设置模块</el-button>
-          <el-button size="small" @click="batchOperation('freight')">批量设置运费</el-button>
+          <el-button v-if="$restrict('add')" type="primary" icon="el-icon-plus" size="small" @click="addOrEdit('add')">添加商品</el-button>
+          <el-button v-if="$restrict('batchLaunch')" size="small" @click="batchOperation('on')">批量上架</el-button>
+          <el-button v-if="$restrict('batchRemova')" size="small" @click="batchOperation('off')">批量下架</el-button>
+          <el-button v-if="$restrict('batchSet')" size="small" @click="batchOperation('module')">批量设置模块</el-button>
+          <el-button v-if="$restrict('batchSetfreight')" size="small" @click="batchOperation('freight')">批量设置运费</el-button>
         </div>
       </div>
 
@@ -167,12 +167,12 @@
                 </el-popconfirm>
               </template> -->
 
-              <el-button type="primary" size="mini" @click="addOrEdit('edit', scope.row.goodsId)">编辑</el-button>
-              <el-popconfirm style="margin-left: 10px; margin-right: 10px" title="确定克隆吗?" @confirm="clone(scope.row.goodsId)" >
+              <el-button v-if="$restrict('edit')" type="primary" size="mini" @click="addOrEdit('edit', scope.row.goodsId)">编辑</el-button>
+              <el-popconfirm v-if="$restrict('clone')" style="margin-left: 10px; margin-right: 10px" title="确定克隆吗?" @confirm="clone(scope.row.goodsId)" >
                 <el-button slot="reference" type="primary" size="mini">克隆</el-button>
               </el-popconfirm>
-              <el-button type="primary" size="mini" class="tag-read" @click="copy(scope.row.goodsId)" :data-clipboard-text="scope.row.goodsId">复制链接</el-button>
-              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @confirm="delItem(scope.row.goodsId, scope.row.goodsSpecId)" >
+              <el-button v-if="$restrict('copyLink')" type="primary" size="mini" class="tag-read" @click="copy(scope.row.goodsId)" :data-clipboard-text="scope.row.goodsId">复制链接</el-button>
+              <el-popconfirm v-if="$restrict('del')" style="margin-left: 10px;" title="确定删除吗?" @confirm="delItem(scope.row.goodsId, scope.row.goodsSpecId)" >
                 <el-button slot="reference" size="mini">删除</el-button>
               </el-popconfirm>
             </template>

+ 71 - 61
src/views/mallManagement/goods/newclassify_index/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList" :operationColumnWidth="160">
+    :operation="operation()" :exportList="exportList" :operationColumnWidth="160">
     <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -30,23 +30,12 @@ import {
   changeNewclassify,
   deleteNewclassify
 } from "@/api/goods";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新建',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -71,6 +60,20 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				]
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -137,53 +140,60 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            this.$router.push({
-              name: "newclassify_set",
-              query: {
-                item: row
-              },
-            });
-          }}>配置</el-button>
-          <el-button type="text" onClick={() => {
-            getNewclassifyDetail({ newsCategoryId: row.goodsNewsCategoryId }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title={`是否确定${Number(row.status) ? "关闭" : "开启"}?`}
-            onConfirm={() => {
-              changeNewclassify({
-                goodsNewsCategoryId: row.goodsNewsCategoryId,
-                status: Number(row.status) ? 0 : 1,
-              }).then(res => {
-                this.$message({ type: 'success', message: `${Number(row.status) ? "关闭" : "开启"}成功!` })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">{Number(row.status) ? "关闭" : "开启"}</el-button>
-          </el-popconfirm>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteNewclassify({ goodsNewsCategoryId: row.goodsNewsCategoryId }).then(() => {
-                this.$message({ type: 'success', message: '删除成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			disposition: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.$router.push({
+						name: "newclassify_set",
+						query: {
+							item: row
+						},
+					});
+				}
+			},
+			edit: {  
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getNewclassifyDetail({ newsCategoryId: row.goodsNewsCategoryId }).then(res => {
+						Object.assign(this.formData, res.data)
+						this.formDialogType = 1
+						this.openForm()
+					})
+				}
+			},
+			del: {
+				btnType: 'text',
+				prompt: '确定删除吗?',
+				click: ({ row, index, column }) => {
+					deleteNewclassify({ goodsNewsCategoryId: row.goodsNewsCategoryId }).then(() => {
+						this.$message({ type: 'success', message: '删除成功!' })
+						this.$refs.pageRef.refreshList()
+					})
+				}
+			},
+			status: {
+				btnType: 'text',
+				name: ({ row, index, column }) => {
+					return Number(row.status) ? "关闭" : "开启"
+				},
+				prompt:  ({ row, index, column }) => {
+					return `是否确定${Number(row.status) ? "关闭" : "开启"}?`
+				},
+				click: ({ row, index, column }) => {
+					changeNewclassify({
+						goodsNewsCategoryId: row.goodsNewsCategoryId,
+						status: Number(row.status) ? 0 : 1,
+					}).then(res => {
+						this.$message({ type: 'success', message: `${Number(row.status) ? "关闭" : "开启"}成功!` })
+						this.$refs.pageRef.refreshList()
+					})
+				}
+			},
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 48 - 47
src/views/mallManagement/goods/watermark/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
   </template-page>
 </template>
 
@@ -9,28 +9,12 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { deleteModule, templateListPageV2, templatePageExport } from '@/api/goods'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '添加水印',
-              isRole: true,
-              click: () => {
-                this.$router.push({
-                  name: "watermark_add",
-                  query: {}
-                })
-              }
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -45,6 +29,23 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.$router.push({
+							  name: "watermark_add",
+							  query: {}
+							})
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -66,34 +67,34 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            this.$router.push({
-              name: "watermark_add",
-              query: {
-                id: row.commonTemplateId
-              }
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteModule({
-                commonTemplateId: row.commonTemplateId
-              }).then(res => {
-                this.$message({ type: 'success', message: '删除成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+		  edit: {
+			btnType: 'text',
+		    click: ({ row, index, column }) => {
+		      this.$router.push({
+		        name: "watermark_add",
+		        query: {
+		          id: row.commonTemplateId
+		        }
+		      })
+		    }
+		  },
+		  del: {
+			btnType: 'text',
+			prompt: '确定删除吗?',
+		    click: ({ row, index, column }) => {
+		      deleteModule({
+		        commonTemplateId: row.commonTemplateId
+		      }).then(res => {
+		        this.$message({ type: 'success', message: '删除成功!' })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  }
+		})
+	},
   }
 }
 </script>

+ 12 - 12
src/views/mallManagement/order/order_list/index.vue

@@ -113,13 +113,13 @@
           <el-tab-pane label="已关闭" name="CLOSE"></el-tab-pane>
           <el-tab-pane label="已超时" name="TIMEOUT"></el-tab-pane>
         </el-tabs>
-        <el-button class="fl" type="primary" size="small" @click="batchRemark">批量备注</el-button>
+        <el-button v-if="$restrict('batchNote')" class="fl" type="primary" size="small" @click="batchRemark">批量备注</el-button>
         <el-button class="fl" type="primary" size="small" @click="batchShipmentVisible = true"
-          v-show="tabCurrent == 'DFH'">批量发货</el-button>
-        <el-button class="fl" size="small" @click="downloadTemplate" v-show="tabCurrent == 'DFH'">下载批量发货模版</el-button>
+          v-show="tabCurrent == 'DFH' && $restrict('batchDelivery')">批量发货</el-button>
+        <el-button class="fl" size="small" @click="downloadTemplate" v-show="tabCurrent == 'DFH' && $restrict('template')">下载批量发货模版</el-button>
       </div>
       <div class="fr">
-        <el-button size="small" type="primary" @click="handleExport">导出报表</el-button>
+        <el-button v-if="$restrict('exp')" size="small" type="primary" @click="handleExport">导出报表</el-button>
       </div>
     </div>
     <div class="order-main-container">
@@ -147,8 +147,8 @@
           <span><b>商户</b>:{{ order.companyWechatName || '无' }}</span>
           <span><b>网点</b>:{{ order.websitName || '无' }}</span>
           <div class="fr">
-            <el-link type="primary" :underline="false" @click="showRemark(order.orderId, order.remark)">订单备注</el-link>
-            <el-link type="primary" :underline="false" @click="queryDetail(order.orderId)">查看详情</el-link>
+            <el-link type="primary" v-if="$restrict('orderNote')" :underline="false" @click="showRemark(order.orderId, order.remark)">订单备注</el-link>
+            <el-link type="primary" v-if="$restrict('detail')" :underline="false" @click="queryDetail(order.orderId)">查看详情</el-link>
             <!-- <el-link type="primary" :underline="false" @click="queryWorkOrder(order.orderId)">订单工单</el-link> -->
           </div>
         </div>
@@ -236,25 +236,25 @@
               <div class="col-item">
                 <div class="operate">
                   <el-popconfirm title="确定取消订单吗?" @confirm="cancelOrder(order.orderId)"
-                    v-if="order.orderStatus === 'NOPAY'">
+                    v-if="order.orderStatus === 'NOPAY' && $restrict('cancelOrder')">
                     <el-button slot="reference" type="text" size="small">取消订单</el-button>
                   </el-popconfirm>
-                  <el-button type="text" size="small" v-if="order.orderStatus === 'DFH'"
+                  <el-button type="text" size="small" v-if="order.orderStatus === 'DFH' && $restrict('deliver')"
                     @click="showLogistics(order, 'add')">发货</el-button>
-                  <el-button type="text" size="small" v-if="order.orderStatus === 'DFH'"
+                  <el-button type="text" size="small" v-if="order.orderStatus === 'DFH' && $restrict('changeShippingaddress')"
                     @click="openAddressForm(order)">修改收货地址</el-button>
                   <el-button type="text" size="small"
-                    v-if="order.orderStatus === 'YFH' && order.orderDetails.some(i => i.workOrderType === 'INSTALL')"
+                    v-if="order.orderStatus === 'YFH' && $restrict('changeDeliverynumber') && order.orderDetails.some(i => i.workOrderType === 'INSTALL')"
                     @click="showLogistics(order, 'edit')">
                     修改快递单号
                   </el-button>
                   <el-button type="text" size="small"
-                    v-if="(order.orderStatus === 'YFH' || order.orderStatus === 'OVER') && order.orderDetails.some(i => i.workOrderType === 'INSTALL')"
+                    v-if="(order.orderStatus === 'YFH' || order.orderStatus === 'OVER') && $restrict('viewLogistics') && order.orderDetails.some(i => i.workOrderType === 'INSTALL')"
                     @click="queryLogistics(order.logisticsNo, order.companyCode)">
                     查看物流
                   </el-button>
                   <!-- toWorkOrderDetail(order.orderId) -->
-                  <el-button type="text" size="small" v-if="order.toWorkOrder"
+                  <el-button type="text" size="small" v-if="order.toWorkOrder && $restrict('workOrder_detail')"
                     @click="queryWorkOrder(order.orderId)">查看工单</el-button>
                 </div>
               </div>

+ 9 - 9
src/views/mallManagement/order/order_refund/index.vue

@@ -90,7 +90,7 @@
         </el-tabs>
       </div>
       <div class="fr">
-        <el-button size="small" type="primary" @click="handleExport">导出报表</el-button>
+        <el-button v-if="$restrict('exp')" size="small" type="primary" @click="handleExport">导出报表</el-button>
       </div>
     </div>
     <div class="order-main-container">
@@ -115,8 +115,8 @@
               <span><b>发货状态</b>:{{order.logisticsNo ? '已发货' : '未发货'}}</span>
             </el-col>
             <el-col :xs="24" :sm="24" :lg="4" style="text-align: right;">
-              <el-link type="primary" :underline="false" @click="showRemark(order.orderRefundId, order.remark)">订单备注</el-link>
-              <el-link type="primary" :underline="false" @click="showDetail(index)">查看详情</el-link>
+              <el-link type="primary" v-if="$restrict('orderNote')" :underline="false" @click="showRemark(order.orderRefundId, order.remark)">订单备注</el-link>
+              <el-link type="primary" v-if="$restrict('detail')" :underline="false" @click="showDetail(index)">查看详情</el-link>
               <!-- <el-link type="primary" :underline="false" @click="queryWorkOrder(order.orderId)">订单工单</el-link> -->
             </el-col>
           </el-row>
@@ -192,27 +192,27 @@
               <div class="col-item">
                 <div class="operate" v-if="order.orderStatus === 'DSJCL'">
                   <div>
-                    <el-button slot="reference" type="text" size="small" @click="changeExamineStatus(order.orderRefundId,'OK')">同意</el-button>
+                    <el-button v-if="$restrict('agree')" slot="reference" type="text" size="small" @click="changeExamineStatus(order.orderRefundId,'OK')">同意</el-button>
                   </div>
                   <div>
-                    <el-button slot="reference" type="text" size="small" @click="changeExamineStatus(order.orderRefundId,'FAIL')">拒绝</el-button>
+                    <el-button v-if="$restrict('reject')" slot="reference" type="text" size="small" @click="changeExamineStatus(order.orderRefundId,'FAIL')">拒绝</el-button>
                   </div>
                   <div>
                     <!-- toWorkOrderDetail(order.orderId) -->
-                    <el-button type="text" size="small" v-if="order.toWorkOrder" @click="queryWorkOrder(order.orderId)">查看工单</el-button>
+                    <el-button type="text" size="small" v-if="order.toWorkOrder && $restrict('workOrder_detail')" @click="queryWorkOrder(order.orderId)">查看工单</el-button>
                   </div>
                 </div>
                 <div class="operate" v-if="order.orderStatus === 'DSJSH'">
-                  <div>
+                  <div v-if="$restrict('confirmReceipt')">
                     <el-popconfirm title="确定要收货吗?" @confirm="receiveProd(order.orderRefundId)">
                       <el-button slot="reference" type="text" size="small">确认收货</el-button>
                     </el-popconfirm>
                   </div>
-                  <div v-if="order.logisticsNo">
+                  <div v-if="order.logisticsNo && $restrict('viewLogistics')">
                     <el-button type="text" size="small" @click="queryLogistics(order.logisticsNo)">查看物流</el-button>
                   </div>
                   <div>
-                    <el-button type="text" size="small" v-if="order.toWorkOrder" @click="toWorkOrderDetail(order.orderId)">查看工单</el-button>
+                    <el-button type="text" size="small" v-if="order.toWorkOrder && $restrict('workOrder_detail')" @click="toWorkOrderDetail(order.orderId)">查看工单</el-button>
                   </div>
                 </div>
               </div>

+ 31 - 27
src/views/mallManagement/settlement/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -22,9 +22,10 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { orderShareListPageV2, orderSharePageExport, settlement, saveRemark } from "@/api/settlement";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       // 事件组合
@@ -81,31 +82,34 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            Object.assign(this.formData, row)
-            this.formDialogType = 0
-            this.openForm()
-          }}>备注</el-button>
-          {row.orderStatus == 'OVER' && ~["EXCEPTION", "ING"].indexOf(row.status) ? <el-popconfirm
-            title="是否确定结算?"
-            onConfirm={() => {
-              settlement({
-                orderId: row.orderId
-              }).then(res => {
-                this.$message({ type: 'success', message: `结算成功!` })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">结算</el-button>
-          </el-popconfirm> : null}
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			remark: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					Object.assign(this.formData, row)
+					this.formDialogType = 0
+					this.openForm()
+				}
+			},
+			account: {
+				conditions: ({ row, index, column }) => {
+					return row.orderStatus === 'OVER' && ~["EXCEPTION", "ING"].indexOf(row.status)
+				},
+				btnType: 'text',
+				prompt: '是否确定结算?',
+					click: ({ row, index, column }) => {
+						settlement({
+							orderId: row.orderId
+						}).then(res => {
+							this.$message({ type: 'success', message: `结算成功!` })
+							this.$refs.pageRef.refreshList()
+						})
+					}
+				},
+		})
+	},
     openForm() {
       this.formDialog = true;
     },

+ 42 - 39
src/views/mallManagement/storage/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -22,23 +22,12 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { storageListPageV2, storagePageExport, addStorage, deleteStorage, editStorage, getStorageDetail } from "@/api/storage";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新建',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -62,6 +51,20 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -113,31 +116,31 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getStorageDetail({ id: row.storageId }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteStorage({ storageId: row.storageId }).then(() => {
-                this.$message({ type: 'success', message: '删除成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			edit: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getStorageDetail({ id: row.storageId }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 1
+					  this.openForm()
+					})
+				}
+			},
+			del: {
+				btnType: 'text',
+				prompt: '确定删除吗?',
+				click: ({ row, index, column }) => {
+					deleteStorage({ storageId: row.storageId }).then(() => {
+					  this.$message({ type: 'success', message: '删除成功!' })
+					  this.$refs.pageRef.refreshList()
+					})
+				}
+			}
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 1 - 1
src/views/setting/departmentManage/index.vue

@@ -77,7 +77,7 @@
         <el-form-item label="联系人电话" prop="websitPhone">
           <el-input placeholder="请输入联系人电话" maxlength="11" type="number" v-model="mainForm.websitPhone"></el-input>
         </el-form-item>
-        <el-form-item label="地址" prop="address" required>
+        <el-form-item label="地址" prop="address">
           <div style="display:flex;">
             <el-input placeholder="请选择地址" readonly style="margin-right: 20px;" v-model="mainForm.address"></el-input>
             <geographicalPosi :formData="mainForm" @selectPosi="selectAddress"></geographicalPosi>

+ 18 - 4
src/views/setting/role/index.vue

@@ -56,12 +56,12 @@
     </el-dialog>
 
     <!-- 设置权限 -->
-    <el-dialog title="设置权限" :visible.sync="roleFormVisible" :show-close="false" width="40%" :close-on-click-modal="false"
+    <el-dialog title="设置权限" :visible.sync="roleFormVisible" :show-close="false" width="1000" :close-on-click-modal="false"
       custom-class="tree-dialog" top="50px">
       <!-- :check-strictly="true" -->
-      <el-tree :data="menuRoleList" show-checkbox :default-expand-all="true" node-key="moduleId" ref="tree"
+      <zj-tree :data="menuRoleList" show-checkbox :default-expand-all="true" node-key="moduleId" ref="tree"
         highlight-current :props="defaultProps">
-      </el-tree>
+      </zj-tree>
       <div slot="footer" class="dialog-footer">
         <el-button @click="roleFormVisible = false">{{ editId != 1 ? '取 消' : '关 闭' }}</el-button>
         <el-button type="primary" @click="submitRoleForm" v-if="editId != 1">确 定</el-button>
@@ -201,8 +201,22 @@ export default {
     setMenuRole(id) {
       this.roleFormVisible = true;
       this.editId = id;
+
+      function aaa(list){
+        for(var item of list){
+          if(item.type==3){
+            item.tiling = true
+            item.labelWidthNum = 115
+          }
+          if(item.children && item.children.length){
+            aaa(item.children)
+          }
+        }
+      }
+
       getMenuList({ adminUserId: this.userid }).then(res => {
-        this.menuRoleList = res.data;
+        aaa(res.data);
+        this.menuRoleList = res.data
       })
       getMenuRoleIds({ adminRoleId: id }).then(res => {
         this.$refs.tree.setCheckedKeys(res.data);

+ 35 - 31
src/views/userManagement/customerManagement/index.vue

@@ -2,7 +2,7 @@
 	<div>
 		<template-page v-if="!isShowMemberDetail" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="200"
 		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation">
+		  :operation="operation()">
 		 <!-- :exportList="exportList" -->
 		  <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
 		    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
@@ -52,9 +52,10 @@ import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { memberListPageV2,memberPageExport, memberAudit, memberInner, getWebsit } from "@/api/customerManagement";
 import MemberDetail from "@/components/Mall/Member/member-detail";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, MemberDetail },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       // 事件组合
@@ -113,30 +114,34 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-		// 详情返回显示列表
-		backListFromMemberDetail() {
-		  this.queryUser = {}
-		},
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			<el-button type="text" onClick={() => {
-			  this.queryUser = row
-			}}>详情</el-button>
-          {row.examineStatus != 'WAIT' ?<el-button type="text" onClick={() => {
-          this.workerForm.userId = row.userId
-          getWebsit({type: 'C'}).then(res => {
-                   this.websitList = res.data
-             this.dialogVisible = true
-                })
-          }}>设为工程师</el-button>:null}
-          {row.examineStatus != 'WAIT' ?<el-button type="text" onClick={() => {
-				this.$confirm('请确认是否设为分销员, 是否继续?', '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
+	// 详情返回显示列表
+	backListFromMemberDetail() {
+	  this.queryUser = {}
+	},
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.queryUser = row
+				}
+			},
+			setWorker: {
+				btnType: 'text',
+				prompt: '请确认是否设为工程师?',
+				click: ({ row, index, column }) => {
+					this.workerForm.userId = row.userId
+					getWebsit({type: 'C'}).then(res => {
+						this.websitList = res.data
+						this.dialogVisible = true
+					})
+				}
+			},
+			setService: {
+				btnType: 'text',
+				prompt: '请确认是否设为分销员?',
+				click: ({ row, index, column }) => {
 					memberInner({
 						type: 'SERVICE',
 						userIds: row.userId
@@ -148,11 +153,10 @@ export default {
 							this.$message.error(res.msg);
 						}
 					})
-				});
-			}}>设为分销员</el-button>:null}
-        </div>
-      )
-    },
+				}
+			},
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 84 - 71
src/views/userManagement/distributorManagement/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="280"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation">
+    :operation="operation()">
 	<!-- :exportList="exportList" -->
 	<div slot="moreSearch">
 	  <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
@@ -56,9 +56,10 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { memberListService2,memberPageExport, getMemberDetail, memberAudit, memberInner, memberInsideInner, getWebsit } from "@/api/distributorManagement";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       // 事件组合
@@ -218,75 +219,87 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          {row.examineStatus == 'WAIT' ? <el-button type="text" onClick={() => {
-			this.workerForm.userId = row.userId
-            getMemberDetail({ userId: row.userId }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 0
-              this.openForm()
-            })
-          }}>审核</el-button> : null}
-          <el-button type="text" onClick={() => {
-            getMemberDetail({ userId: row.userId }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>详情</el-button>
-			{row.examineStatus != 'WAIT' ?<el-button type="text" onClick={() => {
-			this.workerForm.userId = row.userId
-			getWebsit({type: 'C'}).then(res => {
-							this.websitList = res.data
-				this.dialogVisible = true
-						})
-			}}>设为工程师</el-button>:null}
-			
-			{row.examineStatus != 'WAIT' ?<el-button type="text" onClick={() => {
-			this.$confirm('请确认是否设为客户, 是否继续?', '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				memberInner({
-					type: 'GENERAL',
-					userIds: row.userId
-				}).then(res => {
-					if (res.code == 200) {
-						this.$message({ type: 'success', message: '设为客户成功!' })
-						this.$refs.pageRef.refreshList()
-					} else {
-						this.$message.error(res.msg);
-					}
-				})
-			});
-			}}>设为客户</el-button>:null}
-			
-			<el-button type="text" onClick={() => {
-			this.$confirm(`请确认是否${row.innerr?'取消':'设为'}内部分销员, 是否继续?`, '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				memberInsideInner({
-					innerr: !row.innerr,
-					userIds: row.userId
-				}).then(res => {
-					if (res.code == 200) {
-						this.$message({ type: 'success', message: (row.innerr?'取消':'设为')+ '内部分销员成功!' })
-						this.$refs.pageRef.refreshList()
-					} else {
-						this.$message.error(res.msg);
-					}
-				})
-			});
-			}}>{ (row.innerr?'取消':'设为')+'内部分销员'}</el-button>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getMemberDetail({ userId: row.userId }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 1
+					  this.openForm()
+					})
+				}
+			},
+			examine: {
+				btnType: 'text',
+				conditions: ({ row, index, column }) => {
+					return row.examineStatus == 'WAIT'
+				},
+				click: ({ row, index, column }) => {
+					getMemberDetail({ userId: row.userId }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 0
+					  this.openForm()
+					})
+				}
+			},
+			setWorker: {
+				btnType: 'text',
+				prompt: '请确认是否设为工程师?',
+				conditions: ({ row, index, column }) => {
+					return row.examineStatus != 'WAIT'
+				},
+				click: ({ row, index, column }) => {
+					this.workerForm.userId = row.userId
+					getWebsit({type: 'C'}).then(res => {
+						this.websitList = res.data
+						this.dialogVisible = true
+					})
+				}
+			},
+			setCustomer: {
+				btnType: 'text',
+				prompt: '请确认是否设为客户?',
+				click: ({ row, index, column }) => {
+					memberInner({
+						type: 'GENERAL',
+						userIds: row.userId
+					}).then(res => {
+						if (res.code == 200) {
+							this.$message({ type: 'success', message: '设为客户成功!' })
+							this.$refs.pageRef.refreshList()
+						} else {
+							this.$message.error(res.msg);
+						}
+					})
+				}
+			},
+			setService: {
+				name: ({ row, index, column }) => {
+					return `${row.innerr?'取消':'设为'}内部分销员`
+				},
+				btnType: 'text',
+				prompt: ({ row, index, column }) => {
+					return `请确认是否${row.innerr?'取消':'设为'}内部分销员?`
+				},
+				click: ({ row, index, column }) => {
+					memberInsideInner({
+						innerr: !row.innerr,
+						userIds: row.userId
+					}).then(res => {
+						if (res.code == 200) {
+							this.$message({ type: 'success', message: (row.innerr?'取消':'设为')+ '内部分销员成功!' })
+							this.$refs.pageRef.refreshList()
+						} else {
+							this.$message.error(res.msg);
+						}
+					})
+				}
+			},
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 65 - 61
src/views/userManagement/masterManagement/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="200"
 	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation">
+	  :operation="operation()">
 		<!-- :exportList="exportList" -->
 	  <div slot="moreSearch">
 	    <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
@@ -33,9 +33,10 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { memberListPageV2,memberPageExport, getMemberDetail, memberAudit, memberInner } from "@/api/masterManagement";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       // 事件组合
@@ -204,65 +205,68 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          {row.examineStatus == 'WAIT' ? <el-button type="text" onClick={() => {
-            getMemberDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 0
-              this.openForm()
-            })
-          }}>审核</el-button> : null}
-          <el-button type="text" onClick={() => {
-            getMemberDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data)
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>详情</el-button>
-		  <el-button type="text" onClick={() => {
-			this.$confirm('请确认是否设为分销员, 是否继续?', '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				memberInner({
-					type: 'SERVICE',
-					userIds: row.userId
-				}).then(res => {
-					if (res.code == 200) {
-						this.$message({ type: 'success', message: '设为分销员成功!' })
-						this.$refs.pageRef.refreshList()
-					} else {
-						this.$message.error(res.msg);
-					}
-				})
-			});
-		  }}>设为分销员</el-button>
-		  <el-button type="text" onClick={() => {
-			this.$confirm('请确认是否设为客户, 是否继续?', '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				memberInner({
-					type: 'GENERAL',
-					userIds: row.userId
-				}).then(res => {
-					if (res.code == 200) {
-						this.$message({ type: 'success', message: '设为客户成功!' })
-						this.$refs.pageRef.refreshList()
-					} else {
-						this.$message.error(res.msg);
-					}
-				})
-			});
-		  }}>设为客户</el-button>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					getMemberDetail({ id: row.id }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 1
+					  this.openForm()
+					})
+				}
+			},
+			examine: {
+				btnType: 'text',
+				conditions: ({ row, index, column }) => {
+					return row.examineStatus == 'WAIT'
+				},
+				click: ({ row, index, column }) => {
+					getMemberDetail({ id: row.id }).then(res => {
+					  Object.assign(this.formData, res.data)
+					  this.formDialogType = 0
+					  this.openForm()
+					})
+				}
+			},
+			setService: {
+				btnType: 'text',
+				prompt: '请确认是否设为分销员?',
+				click: ({ row, index, column }) => {
+					memberInner({
+						type: 'SERVICE',
+						userIds: row.userId
+					}).then(res => {
+						if (res.code == 200) {
+							this.$message({ type: 'success', message: '设为分销员成功!' })
+							this.$refs.pageRef.refreshList()
+						} else {
+							this.$message.error(res.msg);
+						}
+					})
+				}
+			},
+			setCustomer: {
+				btnType: 'text',
+				prompt: '请确认是否设为客户?',
+				click: ({ row, index, column }) => {
+					memberInner({
+						type: 'GENERAL',
+						userIds: row.userId
+					}).then(res => {
+						if (res.code == 200) {
+							this.$message({ type: 'success', message: '设为客户成功!' })
+							this.$refs.pageRef.refreshList()
+						} else {
+							this.$message.error(res.msg);
+						}
+					})
+				}
+			},
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 45 - 46
src/views/userManagement/workerProfileInit/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
 	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation">
+	  :operation="operation()">
 	   <!-- :exportList="exportList" -->
 	</template-page>
 </template>
@@ -14,30 +14,12 @@ import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { listPageV2,pageExport, del, listImport } from "@/api/workerProfileInit";
 import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-		[
-		  [
-		    {
-		      name: '下载导入模板',
-		      click: this.handleDownload
-		    }
-		  ],
-		  [
-		    {
-		      name: '导入师傅资料',
-		      render: () => {
-		        return this.importButton(listImport, '导入师傅资料')
-		      }
-		    }
-		  ],
-		]
-	  ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -57,6 +39,27 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("download", {
+						click: () => {
+							this.handleDownload()
+						}
+					})
+				],
+				[
+					this.optionsEvensAuth("import", {
+						render: () => {
+						  return this.importButton(listImport, '导入师傅资料')
+						}
+					})
+				]
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -88,31 +91,27 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-		    this.$confirm(`请确认是否删除该数据, 是否继续?`, '提示', {
-		    	confirmButtonText: '确定',
-		    	cancelButtonText: '取消',
-		    	type: 'warning'
-		    }).then(() => {
-		    	del({
-		    		id: row.id
-		    	}).then(res => {
-		    		if (res.code == 200) {
-		    			this.$message({ type: 'success', message: `删除成功!` })
-		    			this.$refs.pageRef.refreshList()
-		    		} else {
-		    			this.$message.error(res.msg);
-		    		}
-		    	})
-		    });
-		  }}>删除</el-button>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			del: {
+				btnType: 'text',
+				prompt: '确定删除吗?',
+				click: ({ row, index, column }) => {
+					del({
+						id: row.id
+					}).then(res => {
+						if (res.code == 200) {
+							this.$message({ type: 'success', message: `删除成功!` })
+							this.$refs.pageRef.refreshList()
+						} else {
+							this.$message.error(res.msg);
+						}
+					})
+				}
+			}
+		})
+	},
     addData() {
       this.formDialogType = 0
       this.openForm()

+ 20 - 17
src/views/valueAddedService/extendedWarrantyWork/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <template-page ref="pageRef" :getList="getList" :operation="operation" :exportList="exportList"
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
     :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents"
     :screeningAnalysis="screeningAnalysis" :filterMethod="filterMethod" :replaceOrNotMap="true">
   </template-page>
@@ -11,11 +11,12 @@ import import_mixin from '@/components/template/import_mixin.js'
 import { orderBaseList, orderBaseListExport } from "@/api/workOrderPool.js"
 import ywgdjs from "@/assets/ywgdjs.png"
 import yjs from "@/assets/yjs.png"
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: {
     TemplatePage,
   },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       // 表格属性
@@ -104,21 +105,23 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            this.$router.push({
-              name: "workOrderPool",
-              query: {
-                id: row.id,
-              }
-            })
-          }}>详情</el-button>
-        </div>
-      )
-    },
+		
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.$router.push({
+					  name: "workOrderPool",
+					  query: {
+					    id: row.id,
+					  }
+					})
+				}
+			}
+		})
+	},
   }
 }
 </script>

+ 21 - 19
src/views/valueAddedService/orderBranchAccount/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :more-parameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <div class="cartographer">
       <el-dialog title="明细" width="100%" :modal="false" :visible.sync="formDialog"
         :before-close="() => { formDialog = false }">
@@ -14,6 +14,7 @@
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 import {
   increOrderSettleCountList,
   increOrderSettleCountListExport
@@ -21,7 +22,7 @@ import {
 import { increOrderSettleList } from "@/api/orderSettleManag.js"
 export default {
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
       // 事件组合
@@ -63,23 +64,24 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 操作按钮
-    operation(h, { row, index, column }) {
-      return (
-        <div class="operation-btns">
-          <el-button type="text" onClick={() => {
-            this.detailParams = [...this.detailParams.filter(item => item.param === "a.pay_time"), {
-              param: "a.websit_id",
-              compare: "=",
-              value: row.websitId
-            }];
-            this.$nextTick(() => {
-              this.formDialog = true
-            })
-          }}>明细</el-button>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.detailParams = [...this.detailParams.filter(item => item.param === "a.pay_time"), {
+					  param: "a.websit_id",
+					  compare: "=",
+					  value: row.websitId
+					}];
+					this.$nextTick(() => {
+					  this.formDialog = true
+					})
+				}
+			}
+		})
+	},
     // 明细列表
     getList2(p) {
       var pam = JSON.parse(JSON.stringify(p))

+ 81 - 68
src/views/valueAddedService/orderSettleManag/index.vue

@@ -1,6 +1,6 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
-    :table-events="tableEvents" :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation"
+    :table-events="tableEvents" :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()"
     :operationColumnWidth="200" :optionsEvensGroup="optionsEvensGroup">
     <div class="cartographer">
       <el-dialog :title="formTypeName[formType]" width="100%" :modal="false" :visible.sync="formDialog"
@@ -30,6 +30,7 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import { increOrderSettleList, increOrderSettleListExport, increOrderSettleDetail, increOrderSettleConfirm, increOrderSettleRefund } from "@/api/orderSettleManag.js"
 import ImageUpload from '@/components/file-upload'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   props: {
     storageType: {
@@ -38,27 +39,9 @@ export default {
     }
   },
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [[
-        [
-          {
-            name: '批量结算',
-            click: () => {
-              if (this.recordSelected.length === 0) {
-                this.$message.warning('请勾选订单')
-                return
-              }
-              increOrderSettleConfirm(this.recordSelected.map(item => item.id)).then(res => {
-                this.$message({ type: 'success', message: `成功!` })
-                this.$refs.pageRef.refreshList()
-              })
-            }
-          },
-        ]
-      ]],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -80,6 +63,27 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("bulkSettlemen", {
+						click: () => {
+							if (this.recordSelected.length === 0) {
+							  this.$message.warning('请勾选订单')
+							  return
+							}
+							increOrderSettleConfirm(this.recordSelected.map(item => item.id)).then(res => {
+							  this.$message({ type: 'success', message: `成功!` })
+							  this.$refs.pageRef.refreshList()
+							})
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -336,54 +340,63 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 操作按钮
-    operation(h, { row, index, column }) {
-
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            this.formType = 0
-            this.getDetail(row.id)
-          }}>查看</el-button>
-          {["PAID", "REFUND"].includes(row.payStatus) ? (
-            <el-button type="text" onClick={() => {
-              this.$router.push({
-                name: "workOrderPool",
-                query: {
-                  pgIncreItemId: row.id,
-                }
-              })
-            }}>服务单明细</el-button>
-          ) : null}
-          {["PAID"].includes(row.payStatus) && ["ING"].includes(row.settleStatus) && (() => {
-            var currentDate = new Date(row.payTime);
-            currentDate.setDate(currentDate.getDate() + 7);
-            currentDate.setHours(23);
-            currentDate.setMinutes(59);
-            currentDate.setSeconds(59);
-            return currentDate > new Date() 
-          })() ? (
-            <el-popconfirm
-              title={`是否确定退款?`}
-              onConfirm={() => {
-                increOrderSettleRefund({ id: row.id }).then(res => {
-                  this.$message({ type: 'success', message: `退款成功!` })
-                  this.$refs.pageRef.refreshList()
-                })
-              }}
-            >
-              <el-button type="text" slot="reference">退款</el-button>
-            </el-popconfirm>
-          ) : null}
-          {["PAID"].includes(row.payStatus) && ["ING"].includes(row.settleStatus) ? (
-            <el-button type="text" onClick={() => {
-              this.formType = 1
-              this.getDetail(row.id)
-            }}>结算</el-button>
-          ) : null}
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.formType = 0
+					this.getDetail(row.id)
+				}
+			},
+			orderDetail: {
+				btnType: 'text',
+				conditions: ({ row, index, column }) => {
+					return ["PAID", "REFUND"].includes(row.payStatus)
+				},
+				click: ({ row, index, column }) => {
+					this.$router.push({
+					  name: "workOrderPool",
+					  query: {
+					    pgIncreItemId: row.id,
+					  }
+					})
+				}
+			},
+			refund: {
+				btnType: 'text',
+				prompt: '是否确定退款?',
+				conditions: ({ row, index, column }) => {
+					return ["PAID"].includes(row.payStatus) && ["ING"].includes(row.settleStatus) && (() => {
+						var currentDate = new Date(row.payTime);
+						currentDate.setDate(currentDate.getDate() + 7);
+						currentDate.setHours(23);
+						currentDate.setMinutes(59);
+						currentDate.setSeconds(59);
+						return currentDate > new Date() 
+					})()
+				},
+				click: ({ row, index, column }) => {
+					increOrderSettleRefund({ id: row.id }).then(res => {
+					  this.$message({ type: 'success', message: `退款成功!` })
+					  this.$refs.pageRef.refreshList()
+					})
+				}
+			},
+			settlement: {
+				btnType: 'text',
+				prompt: '是否确定结算?',
+				conditions: ({ row, index, column }) => {
+					return ["PAID"].includes(row.payStatus) && ["ING"].includes(row.settleStatus)
+				},
+				click: ({ row, index, column }) => {
+					this.formType = 1
+					this.getDetail(row.id)
+				}
+			},
+		})
+	},
     getDetail(id) {
       increOrderSettleDetail({ id }).then(res => {
         Object.assign(this.formData, res.data)

+ 28 - 23
src/views/valueAddedService/valueAddedConfig/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
     :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
-    :column-parsing="columnParsing" :operation="operation" :replaceOrNotMap="false">
+    :column-parsing="columnParsing" :operation="operation()" :replaceOrNotMap="false">
     <div class="cartographer">
       <el-dialog title="增值服务配置" width="100%" :modal="false" :visible.sync="formDialog" :before-close="formCancel">
         <zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -25,6 +25,7 @@ import { increConfigList, increConfigListExport, increConfigDetail, increConfigA
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { getClassifyList } from '@/api/goods'
 import { getDataDictionary } from '@/api/dataDictionary.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   props: {
     storageType: {
@@ -33,20 +34,9 @@ export default {
     }
   },
   components: { TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin,operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [[
-        [
-          {
-            name: '新增',
-            click: () => {
-              this.openForm()
-            }
-          },
-        ]
-      ]],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -77,6 +67,20 @@ export default {
     }
   },
   computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: () => {
+								this.openForm()
+							}
+						})
+					],
+				]
+			]
+		},
     // 更多参数
     moreParameters() {
       return []
@@ -474,16 +478,17 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 操作按钮
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            this.getDetail(row.id)
-          }}>详情</el-button>
-        </div>
-      )
-    },
+	// 表格操作列
+	operation() {
+		return this.operationBtn({
+			detail: {
+				btnType: 'text',
+				click: ({ row, index, column }) => {
+					this.getDetail(row.id)
+				}
+			}
+		})
+	},
     panduancp() {
       try {
         this.formData.pgIncreItems.map((row, index) => {

+ 107 - 111
src/views/workOrder/appraise/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :exportList="exportList">
+		:options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+		:exportList="exportList">
 	</template-page>
 </template>
 
@@ -10,125 +10,121 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport } from "@/api/workOrder/appraise";
+import { listPageV2, pageExport } from "@/api/workOrder/appraise";
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-	  appraise_status: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {
-		return []
-    }
-  },
-  created() {
-    if (this.$route.query.type == 1) {
-		this.appraise_status = 'C'
-		this.$nextTick(() => {
-			this.appraise_status = ''
-			this.$router.push({ name: "appraise", params: {}, query: {} })
-		})
-    }
-  },
-  methods: {
-    // 列表请求函数
-	getList(p,cb) {
-		try {
-			var pam = JSON.parse(JSON.stringify(p))
-			pam.params.push({'param': 'a.appraise_status', "compare": "=", "value": this.appraise_status})
-			cb && cb(pam)
-			return listPageV2(pam)
-		} catch (error) {
-			console.log(error)
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin],
+	data() {
+		return {
+			// 事件组合
+			optionsEvensGroup: [],
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: false
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			appraise_status: ''
 		}
 	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'id') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return (
-					<div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
-						<span style="color:#008dd4;" onClick={() => {
-							this.$router.push({
+	computed: {
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() {
+			return []
+		}
+	},
+	created() {
+		if (this.$route.query.type == 1) {
+			this.appraise_status = 'C'
+			this.$nextTick(() => {
+				this.appraise_status = ''
+				this.$router.push({ name: "appraise", params: {}, query: {} })
+			})
+		}
+	},
+	methods: {
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ 'param': 'a.appraise_status', "compare": "=", "value": this.appraise_status })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'id') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
+							<span style="color:#008dd4;" onClick={() => {
+								this.$router.push({
 									name: "workOrderPool",
 									query: {
-										id:row.id,
+										id: row.id,
 										activeName: "Evaluation",
 									}
-							})
-						}}>{row.id}</span>
-						{column.isCopy ? (
-            		    <i
-							style="color:#008dd4;"
-							class={['el-icon-document-copy', column.columnCopyClass]}
-							data-clipboard-text={row[column.columnAttributes.prop]}
-						></i>
-						) : null}
-					</div>
-          		)
+								})
+							}}>{row.id}</span>
+							{column.isCopy ? (
+								<i
+									style="color:#008dd4;"
+									class={['el-icon-document-copy', column.columnCopyClass]}
+									data-clipboard-text={row[column.columnAttributes.prop]}
+								></i>
+							) : null}
+						</div>
+					)
+				}
+				defaultData.columnAttributes.width = 200
 			}
-			defaultData.columnAttributes.width = 200
-		}
-		if (item.jname === 'appraiseImgUrl') {
-		    defaultData.render = (h, { row, index, column }) => {
-		      return (
-		        <div style="cursor: pointer;display: flex;justify-content: center;">
-		          {row.appraiseImgUrl ? row.appraiseImgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;cursor: pointer;" />) : null}
-		          </div>
-		      )
-		    }
-			defaultData.columnAttributes.width = 200
-		}
-		if (item.jname === 'appraiseContent') {
-		    defaultData.render = (h, { row, index, column }) => {
-		      return (
-				<span>{row.appraiseContent}</span>
-		      )
-		    }
-		defaultData.columnAttributes.width = 200
-		}
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      
-    }
-  }
+			if (item.jname === 'appraiseImgUrl') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="cursor: pointer;display: flex;justify-content: center;">
+							{row.appraiseImgUrl ? row.appraiseImgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;cursor: pointer;" />) : null}
+						</div>
+					)
+				}
+				defaultData.columnAttributes.width = 200
+			}
+			if (item.jname === 'appraiseContent') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<span>{row.appraiseContent}</span>
+					)
+				}
+				defaultData.columnAttributes.width = 200
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 87 - 87
src/views/workOrder/basicConfiguration/assessmentItemAllocation/index.vue

@@ -1,20 +1,20 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
-	    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
-	    <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-	      <zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
-	        :form-data="formData" :form-items="formItems" :disabled="formDialogType==2">
-	      </zj-form-module>
-	    </zj-form-container>
-	    <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formCancel">取 消</el-button>
-			<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">确定</el-button>
-	    </div>
-	  </el-dialog>
-	</template-page>
+  <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+    :operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+    :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+    <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+      :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+      <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+        <zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
+          :form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
+        </zj-form-module>
+      </zj-form-container>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="formCancel">取 消</el-button>
+        <el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">确定</el-button>
+      </div>
+    </el-dialog>
+  </template-page>
 </template>
 
 <script>
@@ -22,23 +22,13 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, del } from "@/api/workOrder/assessmentItemAllocation";
+import { listPageV2, pageExport, getDetail, add, edit, del } from "@/api/workOrder/assessmentItemAllocation";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -52,17 +42,29 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
+      formDialogTitles: ["新增", "编辑", "详情"],
       formDialog: false,
       formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		type: 'REWARD',
-		name: '',
-		amount: '',
+        companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        type: 'REWARD',
+        name: '',
+        amount: '',
       }
     }
   },
   computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth("add", {
+              click: this.addData
+            })
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -92,21 +94,21 @@ export default {
         md: 24,
         isShow: true,
         name: 'slot-component',
-        attributes: { },
+        attributes: {},
         formItemAttributes: {
           label: '考核类型',
           prop: 'type',
           rules: [...required]
         },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.type}>
-					<el-radio disabled={this.formDialogType==2} label="REWARD">奖励</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label="PUNISH">惩罚</el-radio>
-				</el-radio-group>
-			)
-		}
+        render: (h, { props, onInput }) => {
+          var { value } = props
+          return (
+            <el-radio-group v-model={this.formData.type}>
+              <el-radio disabled={this.formDialogType == 2} label="REWARD">奖励</el-radio>
+              <el-radio disabled={this.formDialogType == 2} label="PUNISH">惩罚</el-radio>
+            </el-radio-group>
+          )
+        }
       }, {
         md: 24,
         isShow: true,
@@ -117,20 +119,20 @@ export default {
           prop: 'amount',
           rules: [...required]
         },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-					<el-input v-model={this.formData.amount} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
-				</div>
-			)
-		}
+        render: (h, { props, onInput }) => {
+          var { value } = props
+          return (
+            <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+              <el-input v-model={this.formData.amount} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+            </div>
+          )
+        }
       }]
     }
   },
   methods: {
     // 列表请求函数
-	getList: listPageV2,
+    getList: listPageV2,
     // 列表导出函数
     exportList: pageExport,
     // 表格列解析渲染数据更改
@@ -141,38 +143,36 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-		    getDetail({ id: row.id }).then(res => {
-		      Object.assign(this.formData, res.data)
-		      this.formDialogType = 1
-		      this.openForm()
-		    })
-		  }}>编辑</el-button>
-		  <el-button type="text" style="color: #FF0000" onClick={() => {
-		  this.$confirm('请确认是否删除该数据, 是否继续?', '提示', {
-		  	confirmButtonText: '确定',
-		  	cancelButtonText: '取消',
-		  	type: 'warning'
-		  }).then(() => {
-		  	del({
-		  		id: row.id
-		  	}).then(res => {
-		  		if (res.code == 200) {
-		  			this.$message({ type: 'success', message: '删除成功!' })
-		  			this.$refs.pageRef.refreshList()
-		  		} else {
-		  			this.$message.error(res.msg);
-		  		}
-		  	})
-		  });
-		  }}>删除</el-button>
-        </div>
-      )
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
+            getDetail({ id: row.id }).then(res => {
+              Object.assign(this.formData, res.data)
+              this.formDialogType = 1
+              this.openForm()
+            })
+          }
+        },
+        del: {
+          prompt: "请确认是否删除该数据, 是否继续?",
+          click: ({ row, index, column }) => {
+            del({
+              id: row.id
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message({ type: 'success', message: '删除成功!' })
+                this.$refs.pageRef.refreshList()
+              } else {
+                this.$message.error(res.msg);
+              }
+            })
+          }
+        }
+      })
     },
+
     addData() {
       this.formDialogType = 0
       this.openForm()
@@ -201,7 +201,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.tab {
+  padding: 20px 20px 0 20px;
+}
 </style>

+ 116 - 97
src/views/workOrder/basicConfiguration/orderType/index.vue

@@ -1,20 +1,20 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
-	    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
-	    <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-	      <zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
-	        :form-data="formData" :form-items="formItems" :disabled="formDialogType==2">
-	      </zj-form-module>
-	    </zj-form-container>
-	    <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formCancel">取 消</el-button>
-			<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">确定</el-button>
-	    </div>
-	  </el-dialog>
-	</template-page>
+  <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+    :operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+    :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+    <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+      :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+      <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+        <zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
+          :form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
+        </zj-form-module>
+      </zj-form-container>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="formCancel">取 消</el-button>
+        <el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">确定</el-button>
+      </div>
+    </el-dialog>
+  </template-page>
 </template>
 
 <script>
@@ -22,23 +22,13 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, save, del } from "@/api/workOrder/orderType";
+import { listPageV2, pageExport, getDetail, save, del } from "@/api/workOrder/orderType";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -52,7 +42,7 @@ export default {
       recordSelected: [],
       /** 表单变量 */
       formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
+      formDialogTitles: ["新增", "编辑", "详情"],
       formDialog: false,
       formData: {
 		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
@@ -60,11 +50,24 @@ export default {
 		orderType: '',
 		status: true,
 		sortNum: '',
-		imgUrl: []
+		imgUrl: [],
+		isRpProjectRepair: 'NO'
       }
     }
   },
   computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth("add", {
+              click: this.addData
+            })
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -84,7 +87,7 @@ export default {
         md: 24,
         isShow: true,
         name: 'el-select',
-		options: [{label: '安装',value: 'INSTALL'},{label: '维修',value: 'REPAIR'}],
+        options: [{ label: '安装', value: 'INSTALL' }, { label: '维修', value: 'REPAIR' }],
         attributes: { placeholder: '请选择' },
         formItemAttributes: {
           label: '所属业务线',
@@ -101,11 +104,11 @@ export default {
           prop: 'orderSmallTypeText',
           rules: [...required]
         }
-      },{
+      }, {
         md: 24,
         isShow: true,
         name: 'slot-component',
-        attributes: { },
+        attributes: {},
         formItemAttributes: {
           label: '状态',
           prop: 'status',
@@ -115,22 +118,41 @@ export default {
 			var { value } = props
 			return (
 				<el-radio-group v-model={this.formData.status}>
-				    <el-radio disabled={this.formDialogType==2} label={true}>启用</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label={false}>禁用</el-radio>
+						<el-radio disabled={this.formDialogType==2} label={true}>启用</el-radio>
+						<el-radio disabled={this.formDialogType==2} label={false}>禁用</el-radio>
 				</el-radio-group>
 			)
 		}
-      }, {
-        md: 24,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '排序数字越小越靠前', type: 'number' },
-        formItemAttributes: {
-          label: '排序',
-          prop: 'sortNum',
-          rules: []
-        }
-      }, {
+    }, {
+      md: 24,
+      isShow: true,
+      name: 'el-input',
+      attributes: { placeholder: '排序数字越小越靠前', type: 'number' },
+      formItemAttributes: {
+        label: '排序',
+        prop: 'sortNum',
+        rules: []
+      }
+    }, {
+      md: 24,
+      isShow: true,
+      name: 'slot-component',
+      attributes: {},
+      formItemAttributes: {
+        label: '是否工程维保',
+        prop: 'isRpProjectRepair',
+        rules: [...required]
+      },
+		render: (h, { props, onInput }) => {
+			var { value } = props
+			return (
+				<el-radio-group v-model={this.formData.isRpProjectRepair}>
+						<el-radio disabled={this.formDialogType==2} label="YES">是</el-radio>
+						<el-radio disabled={this.formDialogType==2} label="NO">否</el-radio>
+				</el-radio-group>
+			)
+		}
+    }, {
 		md: 24,
 		isShow: true,
 		name: 'slot-component',
@@ -153,61 +175,58 @@ export default {
   },
   methods: {
     // 列表请求函数
-	getList: listPageV2,
+    getList: listPageV2,
     // 列表导出函数
     exportList: pageExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
-		if (item.jname === 'imgUrl') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.imgUrl ? row.imgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="cover" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
+      if (item.jname === 'imgUrl') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.imgUrl ? row.imgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="cover" style="width:80px;height:80px;" />) : null}
+            </div>
+          )
+        }
+      }
       return defaultData
     },
     // 监听勾选变化
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-		    getDetail({ id: row.id }).then(res => {
-		      Object.assign(this.formData, res.data,{
-				  imgUrl:res.data?.imgUrl?  res.data?.imgUrl?.split(",").map(item=>({url:item})) : []
-			  })
-			   console.log(this.formData)
-		      this.formDialogType = 1
-		      this.openForm()
-		    })
-		  }}>编辑</el-button>
-		  <el-button type="text" style="color: #FF0000" onClick={() => {
-			this.$confirm('请确认是否删除该数据, 是否继续?', '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				del({
-					id: row.id
-				}).then(res => {
-					if (res.code == 200) {
-						this.$message({ type: 'success', message: '删除成功!' })
-						this.$refs.pageRef.refreshList()
-					} else {
-						this.$message.error(res.msg);
-					}
-				})
-			});
-		  }}>删除</el-button>
-        </div>
-      )
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
+            getDetail({ id: row.id }).then(res => {
+              Object.assign(this.formData, res.data, {
+                imgUrl: res.data?.imgUrl ? res.data?.imgUrl?.split(",").map(item => ({ url: item })) : []
+              })
+              this.formDialogType = 1
+              this.openForm()
+            })
+          }
+        },
+        del: {
+          prompt: "请确认是否删除该数据, 是否继续?",
+          click: ({ row, index, column }) => {
+            del({
+              id: row.id
+            }).then(res => {
+              if (res.code == 200) {
+                this.$message({ type: 'success', message: '删除成功!' })
+                this.$refs.pageRef.refreshList()
+              } else {
+                this.$message.error(res.msg);
+              }
+            })
+          }
+        }
+      })
     },
+
     addData() {
       this.formDialogType = 0
       this.openForm()
@@ -224,9 +243,9 @@ export default {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
           (save)({
-			  ...this.formData,
-			  imgUrl:this.formData.imgUrl.map(item=>item.url).join(",")
-		  }).then(res => {
+            ...this.formData,
+            imgUrl: this.formData.imgUrl.map(item => item.url).join(",")
+          }).then(res => {
             this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
             this.formCancel()
             this.$refs.pageRef.refreshList()
@@ -239,7 +258,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.tab {
+  padding: 20px 20px 0 20px;
+}
 </style>

+ 334 - 316
src/views/workOrder/basicConfiguration/settlementStandard/components/install.vue

@@ -1,7 +1,8 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList" :replaceOrNotMap="true">
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+		:operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+		:column-parsing="columnParsing" :operation="operation()" :exportList="exportList" :replaceOrNotMap="true"
+		expCode="exp_az">
 	</template-page>
 </template>
 
@@ -10,338 +11,355 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, add, edit, del, getMainList, getTypeList } from "@/api/workOrder/settlementStandardInstall";
+import { listPageV2, pageExport, add, edit, del, getMainList, getTypeList } from "@/api/workOrder/settlementStandardInstall";
 import { thousands } from '@/utils/common'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-      },
-	  editIndex: null,
-	  mainList: [],
-	  smallList: [],
-	  typeList: []
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {
-		return []
-    }
-  },
-  created(){
-	this.getMainList()
-	this.getTypeList()
-  },
-  methods: {
-    // 列表请求函数
-	getList: listPageV2,
-	getList(p) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-		this.editIndex = null
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: false
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			formData: {
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+			},
+			editIndex: null,
+			mainList: [],
+			smallList: [],
+			typeList: []
+		}
 	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'typeName') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index?(
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.type`} rules={[{required: true, message: '工单类型不能为空', trigger: 'blur'}]}>
-							<el-select value={{orderSmallTypeText:row.typeName,id: row.type}} value-key="id" placeholder="请选择"
-								onInput={(val)=>{
-									row.type = val.id
-									row.typeName = val.orderSmallTypeText
-								}}>
-								{
-									this.typeList.map((item, index) => {
-								 		return <el-option key={item.id} label={item.orderSmallTypeText} value={item}></el-option>
-								 	})
-								 }
-							</el-select>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.typeName}</div>)
-		  	}
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add_az", {
+							click: this.addData
+						})
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() {
+			return []
 		}
-		if (item.jname === 'parentCategoryName') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index?(
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.parentCategoryId`} rules={[{required: true, message: '产品大类不能为空', trigger: 'blur'}]}>
-							<el-select value={{categoryId:row.parentCategoryId,name: row.parentCategoryName}} value-key="categoryId" placeholder="请选择"
-									onInput={(val)=>{
-										row.parentCategoryId=val.categoryId
-										row.parentCategoryName=val.name
+	},
+	created() {
+		this.getMainList()
+		this.getTypeList()
+	},
+	methods: {
+		// 列表请求函数
+		getList: listPageV2,
+		getList(p) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				this.editIndex = null
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'typeName') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.type`} rules={[{ required: true, message: '工单类型不能为空', trigger: 'blur' }]}>
+								<el-select value={{ orderSmallTypeText: row.typeName, id: row.type }} value-key="id" placeholder="请选择"
+									onInput={(val) => {
+										row.type = val.id
+										row.typeName = val.orderSmallTypeText
+									}}>
+									{
+										this.typeList.map((item, index) => {
+											return <el-option key={item.id} label={item.orderSmallTypeText} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.typeName}</div>)
+				}
+			}
+			if (item.jname === 'parentCategoryName') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.parentCategoryId`} rules={[{ required: true, message: '产品大类不能为空', trigger: 'blur' }]}>
+								<el-select value={{ categoryId: row.parentCategoryId, name: row.parentCategoryName }} value-key="categoryId" placeholder="请选择"
+									onInput={(val) => {
+										row.parentCategoryId = val.categoryId
+										row.parentCategoryName = val.name
 										row.categoryName = ''
 										row.categoryId = ''
-										this.smallList = [...[{name: '通用', categoryId: '0'}],...(val.children?val.children:[])]
+										this.smallList = [...[{ name: '通用', categoryId: '0' }], ...(val.children ? val.children : [])]
 									}}>
-								{
-									this.mainList.map((item, index) => {
-								 		return <el-option key={item.categoryId} label={item.name} value={item}></el-option>
-								 	})
-								 }
-							</el-select>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.parentCategoryName}</div>)
-		  	}
-		}
-		if (item.jname === 'categoryName') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.categoryId`} rules={[{required: true, message: '产品小类不能为空', trigger: 'blur'}]}>
-							<el-select value={{categoryId: row.categoryId,name: row.categoryName}} value-key="categoryId" placeholder="请选择"
-									onInput={(val)=>{
-										row.categoryName=val.name
-										row.categoryId=val.categoryId
+									{
+										this.mainList.map((item, index) => {
+											return <el-option key={item.categoryId} label={item.name} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.parentCategoryName}</div>)
+				}
+			}
+			if (item.jname === 'categoryName') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.categoryId`} rules={[{ required: true, message: '产品小类不能为空', trigger: 'blur' }]}>
+								<el-select value={{ categoryId: row.categoryId, name: row.categoryName }} value-key="categoryId" placeholder="请选择"
+									onInput={(val) => {
+										row.categoryName = val.name
+										row.categoryId = val.categoryId
+									}}>
+									{
+										this.smallList.map((item, index) => {
+											return <el-option key={item.id} label={item.name} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.categoryName}</div>)
+				}
+			}
+			if (item.jname === 'label') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.label`} rules={[{ required: true, message: '功率不能为空', trigger: 'blur' }]}>
+								<el-input type="text" value={row.label} placeholder="请输入"
+									onInput={(val) => {
+										row.label = val
+									}}>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.label}</div>)
+				}
+			}
+			if (item.jname === 'normAmount') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.normAmount`} rules={[{ required: true, message: '结算标准不能为空', trigger: 'blur' }]}>
+								<el-input type="text" value={row.normAmount} placeholder="请输入"
+									onInput={(val) => {
+										row.normAmount = val
+									}}>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{thousands(row.normAmount)}</div>)
+				}
+			}
+			if (item.jname === 'remark') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.remark`}>
+								<el-input type="text" value={row.remark} placeholder="请输入"
+									onInput={(val) => {
+										row.remark = val
 									}}>
-								{
-									this.smallList.map((item, index) => {
-										return <el-option key={item.id} label={item.name} value={item}></el-option>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.remark}</div>)
+				}
+				defaultData.columnAttributes.width = 200
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit_az: {
+					conditions: ({ row, index, column }) => {
+						return row.id
+					},
+					name: ({ row, index, column }) => {
+						return this.editIndex == index ? '确定' : '编辑'
+					},
+					click: ({ row, index, column }) => {
+						this.$refs.pageRef.tableForm().validate((valid) => {
+							if (valid) {
+								if (this.editIndex != index) {
+									this.mainList.forEach(item => {
+										if (item.categoryId == row.parentCategoryId) {
+											this.smallList = [...[{ name: '通用', categoryId: '0' }], ...(item.children ? item.children : [])]
+										}
 									})
-								 }
-							</el-select>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.categoryName}</div>)
-		  	}
-		}
-		if (item.jname === 'label') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.label`} rules={[{required: true, message: '功率不能为空', trigger: 'blur'}]}>
-							<el-input type="text" value={row.label} placeholder="请输入"
-								onInput={(val)=>{
-									row.label=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.label}</div>)
-		  	}
-		}
-		if (item.jname === 'normAmount') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.normAmount`} rules={[{required: true, message: '结算标准不能为空', trigger: 'blur'}]}>
-							<el-input type="text" value={row.normAmount} placeholder="请输入"
-								onInput={(val)=>{
-									row.normAmount=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{thousands(row.normAmount)}</div>)
-		  	}
-		}
-		if (item.jname === 'remark') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.remark`}>
-							<el-input type="text" value={row.remark} placeholder="请输入"
-								onInput={(val)=>{
-									row.remark=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.remark}</div>)
-		  	}
-			defaultData.columnAttributes.width = 200
-		}
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			{row.id?<el-button type="text" onClick={() => {
-				this.$refs.pageRef.tableForm().validate((valid) => {
-					if (valid) {
-						if(this.editIndex != index){
-							this.mainList.forEach(item =>{
-								if(item.categoryId == row.parentCategoryId){
-									this.smallList = [...[{name: '通用', categoryId: '0'}],...(item.children?item.children:[])]
+									this.editIndex = index
+								} else {
+									this.edit(row)
 								}
-							})
-							this.editIndex = index
-						}else{
-							this.edit(row)
-						}
-					} else {
-						console.log('error submit!!');
-						return false;
+							} else {
+								console.log('error submit!!');
+								return false;
+							}
+						});
 					}
-				});
-			}}>{this.editIndex == index?'确定':'编辑'}</el-button>:null}
-			{!row.id?<el-button type="text" onClick={() => {
-				this.$refs.pageRef.tableForm().validate((valid) => {
-					if (valid) {
-						this.add(row)
-					} else {
-						console.log('error submit!!');
-						return false;
+				},
+				save_az: {
+					conditions: ({ row, index, column }) => {
+						return !row.id
+					},
+					click: ({ row, index, column }) => {
+						this.$refs.pageRef.tableForm().validate((valid) => {
+							if (valid) {
+								this.add(row)
+							} else {
+								console.log('error submit!!');
+								return false;
+							}
+						});
 					}
-				});
-			}}>保存</el-button>:null}
-			<el-button type="text" style="color: #FF0000" onClick={() => {
-				row.id?this.$confirm('请确认是否删除该数据, 是否继续?', '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					del({
-						id: row.id
-					}).then(res => {
-						if (res.code == 200) {
-							this.$message({ type: 'success', message: '删除成功!' })
-							this.$refs.pageRef.refreshList()
+				},
+				del_az: {
+					prompt: "请确认是否删除该数据, 是否继续?",
+					click: ({ row, index, column }) => {
+						if (row.id) {
+							del({
+								id: row.id
+							}).then(res => {
+								if (res.code == 200) {
+									this.$message({ type: 'success', message: '删除成功!' })
+									this.$refs.pageRef.refreshList()
+								} else {
+									this.$message.error(res.msg);
+								}
+							})
 						} else {
-							this.$message.error(res.msg);
+							this.$refs.pageRef.deleteRowData(0);
+							this.editIndex = null
 						}
+					}
+				}
+			})
+		},
+
+		getMainList() {
+			getMainList({ type: 2 }).then(res => {
+				this.mainList = [...[{ name: '通用', categoryId: '0' }], ...res.data]
+				console.log(this.mainList)
+			})
+		},
+		getTypeList() {
+			getTypeList({ pageNum: 1, pageSize: -1, params: [{ param: 'a.order_type', compare: '=', value: 'INSTALL' }, { param: 'a.status', compare: '=', value: true }] }).then(res => {
+				this.typeList = res.data.records
+			})
+		},
+		addData() {
+			this.$refs.pageRef.tableForm().validate((valid) => {
+				if (valid) {
+					this.editIndex = 0
+					this.$refs.pageRef.insertionData(0, {
+						settleNormType: 'INSTALL',
+						typeName: '',
+						type: '',
+						categoryName: '',
+						categoryId: '',
+						parentCategoryName: '',
+						parentCategoryId: '',
+						label: '',
+						normAmount: '',
+						remark: ''
 					})
-				}): this.$refs.pageRef.deleteRowData(0);this.editIndex = null
-			}}>删除</el-button>
-        </div>
-      )
-    },
-	getMainList(){
-		getMainList({type: 2}).then(res => {
-			this.mainList = [...[{name: '通用', categoryId: '0'}],...res.data]
-			console.log(this.mainList)
-		})
-	},
-	getTypeList(){
-		getTypeList({pageNum: 1,pageSize: -1,params: [{param: 'a.order_type',compare: '=',value: 'INSTALL'},{param: 'a.status',compare: '=',value: true}]}).then(res => {
-			this.typeList = res.data.records
-		})
-	},
-    addData() {
-		this.$refs.pageRef.tableForm().validate((valid) => {
-			if (valid) {
-				this.editIndex = 0
-				this.$refs.pageRef.insertionData(0,{
-					settleNormType: 'INSTALL',
-					typeName: '',
-					type: '',
-					categoryName: '',
-					categoryId: '',
-					parentCategoryName: '',
-					parentCategoryId: '',
-					label: '',
-					normAmount: '',
-					remark: ''
-				})
-			} else {
-				console.log('error submit!!');
-				return false;
-			}
-		});
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-    add(row){
-		add({
-			settleNormType: 'INSTALL',
-			typeName: row.typeName,
-			type: row.type,
-			parentCategoryName: row.parentCategoryName,
-			parentCategoryId: row.parentCategoryId,
-			categoryName: row.categoryName,
-			categoryId: row.categoryId,
-			label: row.label,
-			normAmount: row.normAmount,
-			remark: row.remark
-		}).then(res => {
-			if(res.code ==200){
-				this.editIndex = null
-				this.$message({ type: 'success', message: `保存成功!` })
-				this.$refs.pageRef.refreshList()
-			}
-		})
-	},
-	edit(row){
-		edit({
-			id: row.id,
-			settleNormType: 'INSTALL',
-			typeName: row.typeName,
-			type: row.type,
-			parentCategoryName: row.parentCategoryName,
-			parentCategoryId: row.parentCategoryId,
-			categoryName: row.categoryName,
-			categoryId: row.categoryId,
-			label: row.label,
-			normAmount: row.normAmount,
-			remark: row.remark
-		}).then(res => {
-			if(res.code ==200){
-				this.editIndex = null
-				this.$message({ type: 'success', message: `保存成功!` })
-				this.$refs.pageRef.refreshList()
-			}
-		})
+				} else {
+					console.log('error submit!!');
+					return false;
+				}
+			});
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		add(row) {
+			add({
+				settleNormType: 'INSTALL',
+				typeName: row.typeName,
+				type: row.type,
+				parentCategoryName: row.parentCategoryName,
+				parentCategoryId: row.parentCategoryId,
+				categoryName: row.categoryName,
+				categoryId: row.categoryId,
+				label: row.label,
+				normAmount: row.normAmount,
+				remark: row.remark
+			}).then(res => {
+				if (res.code == 200) {
+					this.editIndex = null
+					this.$message({ type: 'success', message: `保存成功!` })
+					this.$refs.pageRef.refreshList()
+				}
+			})
+		},
+		edit(row) {
+			edit({
+				id: row.id,
+				settleNormType: 'INSTALL',
+				typeName: row.typeName,
+				type: row.type,
+				parentCategoryName: row.parentCategoryName,
+				parentCategoryId: row.parentCategoryId,
+				categoryName: row.categoryName,
+				categoryId: row.categoryId,
+				label: row.label,
+				normAmount: row.normAmount,
+				remark: row.remark
+			}).then(res => {
+				if (res.code == 200) {
+					this.editIndex = null
+					this.$message({ type: 'success', message: `保存成功!` })
+					this.$refs.pageRef.refreshList()
+				}
+			})
+		}
 	}
-  }
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
-	.redbordererr {
-	  ::v-deep .el-form-item {
-	    margin: 0 !important;
-	    overflow: hidden;
-	  }
+.tab {
+	padding: 20px 20px 0 20px;
+}
+
+.redbordererr {
+	::v-deep .el-form-item {
+		margin: 0 !important;
+		overflow: hidden;
 	}
+}
 </style>

+ 252 - 234
src/views/workOrder/basicConfiguration/settlementStandard/components/other.vue

@@ -1,7 +1,8 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList" :replaceOrNotMap="true">
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+		:operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+		:column-parsing="columnParsing" :operation="operation()" :exportList="exportList" :replaceOrNotMap="true"
+		expCode="exp_qt">
 	</template-page>
 </template>
 
@@ -11,250 +12,267 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { del } from "@/api/workOrder/settlementStandardInstall";
-import { listPageV2,pageExport, add, edit } from "@/api/workOrder/settlementStandardOther";
+import { listPageV2, pageExport, add, edit } from "@/api/workOrder/settlementStandardOther";
 import { thousands } from '@/utils/common'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-      },
-	  editIndex: null,
-	  mainList: [],
-	  smallList: [],
-	  typeList: []
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {
-		return []
-    }
-  },
-  methods: {
-    // 列表请求函数
-	getList: listPageV2,
-	getList(p) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-		this.editIndex = null
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'typeName') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.typeName`} rules={[{required: true, message: '其他费用类型不能为空', trigger: 'blur'}]}>
-							<el-input type="text" value={row.typeName} placeholder="请输入"
-								onInput={(val)=>{
-									row.typeName=val
-									row.type=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.typeName}</div>)
-		  	}
-		}
-		if (item.jname === 'label') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.label`} rules={[{required: true, message: '功率不能为空', trigger: 'blur'}]}>
-							<el-input type="text" value={row.label} placeholder="请输入"
-								onInput={(val)=>{
-									row.label=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.label}</div>)
-		  	}
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: false
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			formData: {
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+			},
+			editIndex: null,
+			mainList: [],
+			smallList: [],
+			typeList: []
 		}
-		if (item.jname === 'normAmount') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.normAmount`} rules={[{required: true, message: '单价不能为空', trigger: 'blur'}]}>
-							<el-input type="text" value={row.normAmount} placeholder="请输入"
-								onInput={(val)=>{
-									row.normAmount=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{thousands(row.normAmount)}</div>)
-		  	}
-		}
-		if (item.jname === 'remark') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.remark`}>
-							<el-input type="text" value={row.remark} placeholder="请输入"
-								onInput={(val)=>{
-									row.remark=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.remark}</div>)
-		  	}
-			defaultData.columnAttributes.width = 200
+	},
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add_qt", {
+							click: this.addData
+						})
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() {
+			return []
 		}
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			{row.id?<el-button type="text" onClick={() => {
-				this.$refs.pageRef.tableForm().validate((valid) => {
-					if (valid) {
-						if(this.editIndex != index){
-							this.editIndex = index
-						}else{
-							this.edit(row)
-						}
-					} else {
-						console.log('error submit!!');
-						return false;
+	},
+	methods: {
+		// 列表请求函数
+		getList: listPageV2,
+		getList(p) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				this.editIndex = null
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'typeName') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.typeName`} rules={[{ required: true, message: '其他费用类型不能为空', trigger: 'blur' }]}>
+								<el-input type="text" value={row.typeName} placeholder="请输入"
+									onInput={(val) => {
+										row.typeName = val
+										row.type = val
+									}}>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.typeName}</div>)
+				}
+			}
+			if (item.jname === 'label') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.label`} rules={[{ required: true, message: '功率不能为空', trigger: 'blur' }]}>
+								<el-input type="text" value={row.label} placeholder="请输入"
+									onInput={(val) => {
+										row.label = val
+									}}>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.label}</div>)
+				}
+			}
+			if (item.jname === 'normAmount') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.normAmount`} rules={[{ required: true, message: '单价不能为空', trigger: 'blur' }]}>
+								<el-input type="text" value={row.normAmount} placeholder="请输入"
+									onInput={(val) => {
+										row.normAmount = val
+									}}>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{thousands(row.normAmount)}</div>)
+				}
+			}
+			if (item.jname === 'remark') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.remark`}>
+								<el-input type="text" value={row.remark} placeholder="请输入"
+									onInput={(val) => {
+										row.remark = val
+									}}>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.remark}</div>)
+				}
+				defaultData.columnAttributes.width = 200
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit_qt: {
+					conditions: ({ row, index, column }) => {
+						return row.id
+					},
+					name: ({ row, index, column }) => {
+						return this.editIndex == index ? '确定' : '编辑'
+					},
+					click: ({ row, index, column }) => {
+						this.$refs.pageRef.tableForm().validate((valid) => {
+							if (valid) {
+								if (this.editIndex != index) {
+									this.editIndex = index
+								} else {
+									this.edit(row)
+								}
+							} else {
+								console.log('error submit!!');
+								return false;
+							}
+						});
 					}
-				});
-			}}>{this.editIndex == index?'确定':'编辑'}</el-button>:null}
-			{!row.id?<el-button type="text" onClick={() => {
-				this.$refs.pageRef.tableForm().validate((valid) => {
-					if (valid) {
-						this.add(row)
-					} else {
-						console.log('error submit!!');
-						return false;
+				},
+				save_qt: {
+					conditions: ({ row, index, column }) => {
+						return !row.id
+					},
+					click: ({ row, index, column }) => {
+						this.$refs.pageRef.tableForm().validate((valid) => {
+							if (valid) {
+								this.add(row)
+							} else {
+								console.log('error submit!!');
+								return false;
+							}
+						});
 					}
-				});
-			}}>保存</el-button>:null}
-			<el-button type="text" style="color: #FF0000" onClick={() => {
-				row.id?this.$confirm('请确认是否删除该数据, 是否继续?', '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					del({
-						id: row.id
-					}).then(res => {
-						if (res.code == 200) {
-							this.$message({ type: 'success', message: '删除成功!' })
-							this.$refs.pageRef.refreshList()
+				},
+				del_qt: {
+					prompt: "请确认是否删除该数据, 是否继续?",
+					click: ({ row, index, column }) => {
+						if (row.id) {
+							del({
+								id: row.id
+							}).then(res => {
+								if (res.code == 200) {
+									this.$message({ type: 'success', message: '删除成功!' })
+									this.$refs.pageRef.refreshList()
+								} else {
+									this.$message.error(res.msg);
+								}
+							})
 						} else {
-							this.$message.error(res.msg);
+							this.$refs.pageRef.deleteRowData(0);
+							this.editIndex = null
 						}
+					}
+				}
+			})
+		},
+
+		addData() {
+			this.$refs.pageRef.tableForm().validate((valid) => {
+				if (valid) {
+					this.editIndex = 0
+					this.$refs.pageRef.insertionData(0, {
+						companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+						settleNormType: 'OTHER',
+						typeName: '',
+						type: '',
+						label: '',
+						normAmount: '',
+						remark: ''
 					})
-				}): this.$refs.pageRef.deleteRowData(0);this.editIndex = null
-			}}>删除</el-button>
-        </div>
-      )
-    },
-    addData() {
-		this.$refs.pageRef.tableForm().validate((valid) => {
-			if (valid) {
-				this.editIndex = 0
-				this.$refs.pageRef.insertionData(0,{
-					companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-					settleNormType: 'OTHER',
-					typeName: '',
-					type: '',
-					label: '',
-					normAmount: '',
-					remark: ''
-				})
-			} else {
-				console.log('error submit!!');
-				return false;
-			}
-		});
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-    add(row){
-		add(row).then(res => {
-			if(res.code ==200){
-				this.editIndex = null
-				this.$message({ type: 'success', message: `保存成功!` })
-				this.$refs.pageRef.refreshList()
-			}
-		})
-	},
-	edit(row){
-		edit({
-			id: row.id,
-			settleNormType: 'OTHER',
-			typeName: row.typeName,
-			type: row.type,
-			label: row.label,
-			normAmount: row.normAmount,
-			remark: row.remark
-		}).then(res => {
-			if(res.code ==200){
-				this.editIndex = null
-				this.$message({ type: 'success', message: `编辑成功!` })
-				this.$refs.pageRef.refreshList()
-			}
-		})
+				} else {
+					console.log('error submit!!');
+					return false;
+				}
+			});
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		add(row) {
+			add(row).then(res => {
+				if (res.code == 200) {
+					this.editIndex = null
+					this.$message({ type: 'success', message: `保存成功!` })
+					this.$refs.pageRef.refreshList()
+				}
+			})
+		},
+		edit(row) {
+			edit({
+				id: row.id,
+				settleNormType: 'OTHER',
+				typeName: row.typeName,
+				type: row.type,
+				label: row.label,
+				normAmount: row.normAmount,
+				remark: row.remark
+			}).then(res => {
+				if (res.code == 200) {
+					this.editIndex = null
+					this.$message({ type: 'success', message: `编辑成功!` })
+					this.$refs.pageRef.refreshList()
+				}
+			})
+		}
 	}
-  }
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
-	.redbordererr {
-	  ::v-deep .el-form-item {
-	    margin: 0 !important;
-	    overflow: hidden;
-	  }
+.tab {
+	padding: 20px 20px 0 20px;
+}
+
+.redbordererr {
+	::v-deep .el-form-item {
+		margin: 0 !important;
+		overflow: hidden;
 	}
+}
 </style>

+ 360 - 342
src/views/workOrder/basicConfiguration/settlementStandard/components/repair.vue

@@ -1,7 +1,7 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList" :replaceOrNotMap="true">
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+		:operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+		:column-parsing="columnParsing" :operation="operation()" :exportList="exportList" :replaceOrNotMap="true" expCode="exp_wx">
 	</template-page>
 </template>
 
@@ -11,366 +11,384 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { del, getMainList, getTypeList } from "@/api/workOrder/settlementStandardInstall";
-import { listPageV2,pageExport, add, edit } from "@/api/workOrder/settlementStandardRepair";
+import { listPageV2, pageExport, add, edit } from "@/api/workOrder/settlementStandardRepair";
 import { thousands } from '@/utils/common'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-      },
-	  editIndex: null,
-	  mainList: [],
-	  smallList: [],
-	  typeList: []
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {
-		return []
-    }
-  },
-  created(){
-	this.getMainList()
-	this.getTypeList()
-  },
-  methods: {
-    // 列表请求函数
-	getList: listPageV2,
-	getList(p) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-		this.editIndex = null
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: false
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			formData: {
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+			},
+			editIndex: null,
+			mainList: [],
+			smallList: [],
+			typeList: []
+		}
 	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'typeName') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index?(
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.type`} rules={[{required: true, message: '工单类型不能为空', trigger: 'blur'}]}>
-							<el-select value-key="id" value={{orderSmallTypeText:row.typeName,id: row.type}} placeholder="请选择"
-								onInput={(val)=>{
-									row.type = val.id
-									row.typeName = val.orderSmallTypeText
-								}}>
-								{
-									this.typeList.map((item, index) => {
-								 		return <el-option key={item.id} label={item.orderSmallTypeText} value={item}></el-option>
-								 	})
-								 }
-							</el-select>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.typeName}</div>)
-		  	}
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add_wx", {
+							click: this.addData
+						})
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() {
+			return []
 		}
-		if (item.jname === 'parentCategoryName') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index?(
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.parentCategoryId`} rules={[{required: true, message: '产品大类不能为空', trigger: 'blur'}]}>
-							<el-select value={{categoryId:row.parentCategoryId,name: row.parentCategoryName}} value-key="name" placeholder="请选择"
-									onInput={(val)=>{
-										row.parentCategoryId=val.categoryId
-										row.parentCategoryName=val.name
+	},
+	created() {
+		this.getMainList()
+		this.getTypeList()
+	},
+	methods: {
+		// 列表请求函数
+		getList: listPageV2,
+		getList(p) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				this.editIndex = null
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'typeName') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.type`} rules={[{ required: true, message: '工单类型不能为空', trigger: 'blur' }]}>
+								<el-select value-key="id" value={{ orderSmallTypeText: row.typeName, id: row.type }} placeholder="请选择"
+									onInput={(val) => {
+										row.type = val.id
+										row.typeName = val.orderSmallTypeText
+									}}>
+									{
+										this.typeList.map((item, index) => {
+											return <el-option key={item.id} label={item.orderSmallTypeText} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.typeName}</div>)
+				}
+			}
+			if (item.jname === 'parentCategoryName') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.parentCategoryId`} rules={[{ required: true, message: '产品大类不能为空', trigger: 'blur' }]}>
+								<el-select value={{ categoryId: row.parentCategoryId, name: row.parentCategoryName }} value-key="name" placeholder="请选择"
+									onInput={(val) => {
+										row.parentCategoryId = val.categoryId
+										row.parentCategoryName = val.name
 										row.categoryName = ''
 										row.categoryId = ''
-										this.smallList = [...[{name: '通用', categoryId: '0'}],...(val.children?val.children:[])]
+										this.smallList = [...[{ name: '通用', categoryId: '0' }], ...(val.children ? val.children : [])]
 									}}>
-								{
-									this.mainList.map((item, index) => {
-								 		return <el-option key={item.categoryId} label={item.name} value={item}></el-option>
-								 	})
-								 }
-							</el-select>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.parentCategoryName}</div>)
-		  	}
-		}
-		if (item.jname === 'categoryName') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.categoryId`} rules={[{required: true, message: '产品小类不能为空', trigger: 'blur'}]}>
-							<el-select value={{categoryId: row.categoryId,name: row.categoryName}} value-key="name" placeholder="请选择"
-									onInput={(val)=>{
-										row.categoryName=val.name
-										row.categoryId=val.categoryId
+									{
+										this.mainList.map((item, index) => {
+											return <el-option key={item.categoryId} label={item.name} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.parentCategoryName}</div>)
+				}
+			}
+			if (item.jname === 'categoryName') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.categoryId`} rules={[{ required: true, message: '产品小类不能为空', trigger: 'blur' }]}>
+								<el-select value={{ categoryId: row.categoryId, name: row.categoryName }} value-key="name" placeholder="请选择"
+									onInput={(val) => {
+										row.categoryName = val.name
+										row.categoryId = val.categoryId
 									}}>
-								{
-									this.smallList.map((item, index) => {
-										return <el-option key={item.id} label={item.name} value={item}></el-option>
-									})
-								 }
-							</el-select>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.categoryName}</div>)
-		  	}
-		}
-		if (item.jname === 'label') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.label`} rules={[{required: true, message: '质保类型不能为空', trigger: 'blur'}]}>
-							<el-select value={row.label} placeholder="请选择"
-									onInput={(val)=>{
-										row.label=val
+									{
+										this.smallList.map((item, index) => {
+											return <el-option key={item.id} label={item.name} value={item}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.categoryName}</div>)
+				}
+			}
+			if (item.jname === 'label') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.label`} rules={[{ required: true, message: '质保类型不能为空', trigger: 'blur' }]}>
+								<el-select value={row.label} placeholder="请选择"
+									onInput={(val) => {
+										row.label = val
 									}}>
-								{
-									[{id: 'INSIDE',name: '保内'},{id: 'OUT',name: '保外'}].map((item, index) => {
-										return <el-option key={item.id} label={item.name} value={item.id}></el-option>
-									})
-								 }
-							</el-select>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.label}</div>)
-		  	}
-		}
-		if (item.jname === 'repairAmount') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.repairAmount`} rules={[{required: true, message: '上门票不能为空', trigger: 'blur'}]}>
-							<el-input type="text" value={row.repairAmount} placeholder="请输入"
-								onInput={(val)=>{
-									row.repairAmount=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{thousands(row.repairAmount)}</div>)
-		  	}
-		}
-		if (item.jname === 'normAmount') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.normAmount`} rules={[{required: true, message: '维修费结算比例不能为空', trigger: 'blur'}]}>
-							<div style="display:flex;">
-								<el-input type="text" value={row.normAmount} placeholder="请输入"
-									onInput={(val)=>{
-										row.normAmount=val
+									{
+										[{ id: 'INSIDE', name: '保内' }, { id: 'OUT', name: '保外' }].map((item, index) => {
+											return <el-option key={item.id} label={item.name} value={item.id}></el-option>
+										})
+									}
+								</el-select>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.label}</div>)
+				}
+			}
+			if (item.jname === 'repairAmount') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.repairAmount`} rules={[{ required: true, message: '上门票不能为空', trigger: 'blur' }]}>
+								<el-input type="text" value={row.repairAmount} placeholder="请输入"
+									onInput={(val) => {
+										row.repairAmount = val
 									}}>
 								</el-input>
-							</div>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.normAmount} %</div>)
-		  	}
-		}
-		if (item.jname === 'remark') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return this.editIndex == index? (
-					<div class="redbordererr">
-						<el-form-item prop={`tableData.${index}.remark`}>
-							<el-input type="text" value={row.remark} placeholder="请输入"
-								onInput={(val)=>{
-									row.remark=val
-								}}>
-							</el-input>
-						</el-form-item>
-					</div>
-		    	):(<div style="padding: 6px;">{row.remark}</div>)
-		  	}
-			defaultData.columnAttributes.width = 200
-		}
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			{row.id?<el-button type="text" onClick={() => {
-				this.$refs.pageRef.tableForm().validate((valid) => {
-					if (valid) {
-						if(this.editIndex != index){
-							row = Object.assign(row,{
-								label: row.label =='保内'?'INSIDE':'OUT'
-							})
-							this.mainList.forEach(item =>{
-								if(item.categoryId == row.parentCategoryId){
-									this.smallList = [...[{name: '通用', categoryId: '0'}],...(item.children?item.children:[])]
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{thousands(row.repairAmount)}</div>)
+				}
+			}
+			if (item.jname === 'normAmount') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.normAmount`} rules={[{ required: true, message: '维修费结算比例不能为空', trigger: 'blur' }]}>
+								<div style="display:flex;">
+									<el-input type="text" value={row.normAmount} placeholder="请输入"
+										onInput={(val) => {
+											row.normAmount = val
+										}}>
+									</el-input>
+								</div>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.normAmount} %</div>)
+				}
+			}
+			if (item.jname === 'remark') {
+				defaultData.render = (h, { row, index, column }) => {
+					return this.editIndex == index ? (
+						<div class="redbordererr">
+							<el-form-item prop={`tableData.${index}.remark`}>
+								<el-input type="text" value={row.remark} placeholder="请输入"
+									onInput={(val) => {
+										row.remark = val
+									}}>
+								</el-input>
+							</el-form-item>
+						</div>
+					) : (<div style="padding: 6px;">{row.remark}</div>)
+				}
+				defaultData.columnAttributes.width = 200
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+
+		operation() {
+			return this.operationBtn({
+				edit_wx: {
+					conditions: ({ row, index, column }) => {
+						return row.id
+					},
+					name: ({ row, index, column }) => {
+						return this.editIndex == index ? '确定' : '编辑'
+					},
+					click: ({ row, index, column }) => {
+						this.$refs.pageRef.tableForm().validate((valid) => {
+							if (valid) {
+								if (this.editIndex != index) {
+									row = Object.assign(row, {
+										label: row.label == '保内' ? 'INSIDE' : 'OUT'
+									})
+									this.mainList.forEach(item => {
+										if (item.categoryId == row.parentCategoryId) {
+											this.smallList = [...[{ name: '通用', categoryId: '0' }], ...(item.children ? item.children : [])]
+										}
+									})
+									this.editIndex = index
+								} else {
+									this.edit(row)
 								}
-							})
-							this.editIndex = index
-						}else{
-							this.edit(row)
-						}
-					} else {
-						console.log('error submit!!');
-						return false;
+							} else {
+								console.log('error submit!!');
+								return false;
+							}
+						});
 					}
-				});
-			}}>{this.editIndex == index?'确定':'编辑'}</el-button>:null}
-			{!row.id?<el-button type="text" onClick={() => {
-				this.$refs.pageRef.tableForm().validate((valid) => {
-					if (valid) {
-						this.add(row)
-					} else {
-						console.log('error submit!!');
-						return false;
+				},
+				save_wx: {
+					conditions: ({ row, index, column }) => {
+						return !row.id
+					},
+					click: ({ row, index, column }) => {
+						this.$refs.pageRef.tableForm().validate((valid) => {
+							if (valid) {
+								this.add(row)
+							} else {
+								console.log('error submit!!');
+								return false;
+							}
+						});
 					}
-				});
-			}}>保存</el-button>:null}
-			<el-button type="text" style="color: #FF0000" onClick={() => {
-				row.id?this.$confirm('请确认是否删除该数据, 是否继续?', '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					type: 'warning'
-				}).then(() => {
-					del({
-						id: row.id
-					}).then(res => {
-						if (res.code == 200) {
-							this.$message({ type: 'success', message: '删除成功!' })
-							this.$refs.pageRef.refreshList()
+				},
+				del_wx: {
+					prompt: "请确认是否删除该数据, 是否继续?",
+					click: ({ row, index, column }) => {
+						if (row.id) {
+							del({
+								id: row.id
+							}).then(res => {
+								if (res.code == 200) {
+									this.$message({ type: 'success', message: '删除成功!' })
+									this.$refs.pageRef.refreshList()
+								} else {
+									this.$message.error(res.msg);
+								}
+							})
 						} else {
-							this.$message.error(res.msg);
+							this.$refs.pageRef.deleteRowData(0);
+							this.editIndex = null
 						}
+					}
+				}
+			})
+		},
+
+		getMainList() {
+			getMainList({ type: 2 }).then(res => {
+				this.mainList = res.data
+			})
+		},
+		getTypeList() {
+			getTypeList({ pageNum: 1, pageSize: -1, params: [{ param: 'a.order_type', compare: '=', value: 'REPAIR' }, { param: 'a.status', compare: '=', value: true }] }).then(res => {
+				this.typeList = res.data.records
+			})
+		},
+		addData() {
+			this.$refs.pageRef.tableForm().validate((valid) => {
+				if (valid) {
+					this.editIndex = 0
+					this.$refs.pageRef.insertionData(0, {
+						companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+						settleNormType: 'REPAIR',
+						typeName: '',
+						type: '',
+						categoryName: '',
+						categoryId: '',
+						parentCategoryName: '',
+						parentCategoryId: '',
+						label: '',
+						normAmount: '',
+						repairAmount: '',
+						remark: ''
 					})
-				}): this.$refs.pageRef.deleteRowData(0);this.editIndex = null
-			}}>删除</el-button>
-        </div>
-      )
-    },
-	getMainList(){
-		getMainList({type: 2}).then(res => {
-			this.mainList = res.data
-		})
-	},
-	getTypeList(){
-		getTypeList({pageNum: 1,pageSize: -1,params: [{param: 'a.order_type',compare: '=',value: 'REPAIR'},{param: 'a.status',compare: '=',value: true}]}).then(res => {
-			this.typeList = res.data.records
-		})
-	},
-    addData() {
-		this.$refs.pageRef.tableForm().validate((valid) => {
-			if (valid) {
-				this.editIndex = 0
-				this.$refs.pageRef.insertionData(0,{
-					companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-					settleNormType: 'REPAIR',
-					typeName: '',
-					type: '',
-					categoryName: '',
-					categoryId: '',
-					parentCategoryName: '',
-					parentCategoryId: '',
-					label: '',
-					normAmount: '',
-					repairAmount: '',
-					remark: ''
-				})
-			} else {
-				console.log('error submit!!');
-				return false;
-			}
-		});
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-    add(row){
-		add({
-			settleNormType: 'REPAIR',
-			typeName: row.typeName,
-			type: row.type,
-			parentCategoryName: row.parentCategoryName,
-			parentCategoryId: row.parentCategoryId,
-			categoryName: row.categoryName,
-			categoryId: row.categoryId,
-			label: row.label,
-			normAmount: row.normAmount,
-			repairAmount: row.repairAmount,
-			remark: row.remark
-		}).then(res => {
-			if(res.code ==200){
-				this.editIndex = null
-				this.$message({ type: 'success', message: `保存成功!` })
-				this.$refs.pageRef.refreshList()
-			}
-		})
-	},
-	edit(row){
-		edit({
-			id: row.id,
-			settleNormType: 'REPAIR',
-			typeName: row.typeName,
-			type: row.type,
-			parentCategoryName: row.parentCategoryName,
-			parentCategoryId: row.parentCategoryId,
-			categoryName: row.categoryName,
-			categoryId: row.categoryId,
-			label: row.label,
-			normAmount: row.normAmount,
-			repairAmount: row.repairAmount,
-			remark: row.remark
-		}).then(res => {
-			if(res.code ==200){
-				this.editIndex = null
-				this.$message({ type: 'success', message: `保存成功!` })
-				this.$refs.pageRef.refreshList()
-			}
-		})
+				} else {
+					console.log('error submit!!');
+					return false;
+				}
+			});
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		add(row) {
+			add({
+				settleNormType: 'REPAIR',
+				typeName: row.typeName,
+				type: row.type,
+				parentCategoryName: row.parentCategoryName,
+				parentCategoryId: row.parentCategoryId,
+				categoryName: row.categoryName,
+				categoryId: row.categoryId,
+				label: row.label,
+				normAmount: row.normAmount,
+				repairAmount: row.repairAmount,
+				remark: row.remark
+			}).then(res => {
+				if (res.code == 200) {
+					this.editIndex = null
+					this.$message({ type: 'success', message: `保存成功!` })
+					this.$refs.pageRef.refreshList()
+				}
+			})
+		},
+		edit(row) {
+			edit({
+				id: row.id,
+				settleNormType: 'REPAIR',
+				typeName: row.typeName,
+				type: row.type,
+				parentCategoryName: row.parentCategoryName,
+				parentCategoryId: row.parentCategoryId,
+				categoryName: row.categoryName,
+				categoryId: row.categoryId,
+				label: row.label,
+				normAmount: row.normAmount,
+				repairAmount: row.repairAmount,
+				remark: row.remark
+			}).then(res => {
+				if (res.code == 200) {
+					this.editIndex = null
+					this.$message({ type: 'success', message: `保存成功!` })
+					this.$refs.pageRef.refreshList()
+				}
+			})
+		}
 	}
-  }
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
-	.redbordererr {
-	  ::v-deep .el-form-item {
-	    margin: 0 !important;
-	    overflow: hidden;
-	  }
+.tab {
+	padding: 20px 20px 0 20px;
+}
+
+.redbordererr {
+	::v-deep .el-form-item {
+		margin: 0 !important;
+		overflow: hidden;
 	}
+}
 </style>

+ 25 - 22
src/views/workOrder/basicConfiguration/settlementStandard/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="page">
+	<zj-page-container>
 		<div class="tab">
 			<el-radio-group v-model="tabType" size="small">
 				<el-radio-button label="install">安装费用结算标准</el-radio-button>
@@ -7,10 +7,12 @@
 				<el-radio-button label="other">其他费用结算标准</el-radio-button>
 			</el-radio-group>
 		</div>
-		<install v-if="tabType == 'install'"></install>
-		<repair v-if="tabType == 'repair'"></repair>
-		<other v-if="tabType == 'other'"></other>
-	</div>
+		<zj-page-fill>
+			<install v-if="tabType == 'install'"></install>
+			<repair v-if="tabType == 'repair'"></repair>
+			<other v-if="tabType == 'other'"></other>
+		</zj-page-fill>
+	</zj-page-container>
 </template>
 
 <script>
@@ -18,25 +20,26 @@ import install from './components/install'
 import repair from './components/repair'
 import other from './components/other'
 export default {
-  components: { install, repair, other },
-  data() {
-    return {
-      tabType: 'install'
-    }
-  },
-  computed: {},
-  created(){
-	
-  },
-  methods: {}
+	components: { install, repair, other },
+	data() {
+		return {
+			tabType: 'install'
+		}
+	},
+	computed: {},
+	created() {
+
+	},
+	methods: {}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 372 - 369
src/views/workOrder/settleAccountsManagement/rewardsPunishmentsOrder/index.vue

@@ -1,19 +1,19 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  <el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
-	    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
-	    <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-	      <zj-form-module :title="formDialogTitles[formDialogType]" label-width="110px" :showPackUp="false"
-	        :form-data="formData" :form-items="formItems" :disabled="formDialogType==2">
-	      </zj-form-module>
-	    </zj-form-container>
-	    <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formCancel">取 消</el-button>
-			<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">提交</el-button>
-	    </div>
-	  </el-dialog>
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+		:operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+		:column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+		<el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+			:show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+			<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+				<zj-form-module :title="formDialogTitles[formDialogType]" label-width="110px" :showPackUp="false"
+					:form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
+				</zj-form-module>
+			</zj-form-container>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="mini" @click="formCancel">取 消</el-button>
+				<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">提交</el-button>
+			</div>
+		</el-dialog>
 	</template-page>
 </template>
 
@@ -22,373 +22,376 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, del, getExamine } from "@/api/workOrder/rewardsPunishmentsOrder";
+import { listPageV2, pageExport, getDetail, add, edit, del, getExamine } from "@/api/workOrder/rewardsPunishmentsOrder";
 import { getWebsit } from "@/api/customerManagement";
 import { getWorker } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-	  type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		websit: {},
-		websitName: '',
-		websitId: '',
-		worker: {},
-		workerId: '',
-		workerName: '',
-		mobile: '',
-		idcard: '',
-		examineProjectName: '',
-		examineProjectId: '',
-		examineProjectType: '',
-		examineProjectAmount: '',
-		examineProject: {},
-		orderBaseId: '',
-		fileUrl: [],
-		remark: ''
-      },
-	  websitList: [],
-	  workerList: [],
-	  examineList: []
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {
-		return [{
-			md: 12,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', disabled: true },
-			formItemAttributes: {
-			label: '所属商户',
-			prop: 'companyName',
-			rules: [...required]
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: false
 			},
-		}, {
-			md: 12,
-			isShow: this.type==1,
-			name: 'slot-component',
-			attributes: { placeholder: '请输入网点名称',},
-			formItemAttributes: {
-			label: '网点名称',
-			prop: 'websitId',
-			rules: [...required]
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
 			},
-			render: (h, { props, onInput }) => {
-				var { value } = props
-				return (
-					<el-select v-model={this.formData.websit} disabled={this.formDialogType!=0} value-key="websitId" onChange={(e)=>{
-						this.formData.websitId = e.websitId
-						this.formData.websitName = e.name
-						this.formData.worker = {}
-						this.formData.workerId = ''
-						this.formData.workerName = ''
-						this.formData.idcard = ''
-						this.formData.mobile = ''
-						this.getWorker()
-					}} placeholder="请选择" style="width: 100%;">
-						{
-							this.websitList.map((item, index) => {
-								return <el-option key={item.websitId} label={item.name} value={item}></el-option>
-							})
-						}
-					</el-select>
-				)
-			}
-		}, {
-			md: 12,
-			isShow: this.type==0,
-			name: 'el-input',
-			attributes: { placeholder: '请输入网点名称', disabled: true },
-			formItemAttributes: {
-			label: '网点名称',
-			prop: 'websitName',
-			rules: [...required]
-			}
-		}, {
-			md: 12,
-			isShow: true,
-			name: 'slot-component',
-			attributes: { placeholder: '请选择工程师',},
-			formItemAttributes: {
-			label: '选择工程师',
-			prop: 'workerId',
-			rules: [...required]
-			},
-			render: (h, { props, onInput }) => {
-				var { value } = props
-				return (
-					<el-select v-model={this.formData.worker} disabled={this.formDialogType!=0} value-key="nickName" onChange={(e)=>{
-						this.formData.workerId = e.userId
-						this.formData.workerName = e.nickName
-						this.formData.idcard = e.idCard
-						this.formData.mobile = e.mobile
-					}} placeholder="请选择" style="width: 100%;">
-						{
-							this.workerList.map((item, index) => {
-								return <el-option key={item.userId} label={item.nickName} value={item}></el-option>
-							})
-						}
-					</el-select>
-				)
-			}
-		}, {
-			md: 12,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', },
-			formItemAttributes: {
-				label: '身份证',
-				prop: 'idcard',
-				rules: this.formData.idcard?[
-					{ pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
-				]:[]
-			}
-		}, {
-			md: 12,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', },
-			formItemAttributes: {
-				label: '联系电话',
-				prop: 'mobile',
-				rules: this.formData.mobile?[
-					{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
-				]:[]
-			}
-		}, {
-			md: 12,
-			isShow: true,
-			name: 'slot-component',
-			attributes: { placeholder: '请选择考核项目',},
-			formItemAttributes: {
-			label: '选择考核项目',
-			prop: 'examineProjectName',
-			rules: [...required]
-			},
-			render: (h, { props, onInput }) => {
-				var { value } = props
-				return (
-					<el-select v-model={this.formData.examineProject} disabled={this.formDialogType!=0} value-key="name" onChange={(e)=>{
-						this.formData.examineProjectId = e.id
-						this.formData.examineProjectName = e.name
-						this.formData.examineProjectType = e.type
-						this.formData.examineProjectAmount = e.amount
-					}} placeholder="请选择" style="width: 100%;">
-						{
-							this.examineList.map((item, index) => {
-								return <el-option key={item.id} label={item.name} value={item}></el-option>
-							})
-						}
-					</el-select>
-				)
-			}
-		}, {
-			md: 12,
-			isShow: true,
-			name: 'slot-component',
-			attributes: { },
-			formItemAttributes: {
-			label: '考核类型',
-			prop: 'examineProjectType',
-			rules: [...required]
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
+			formData: {
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				websit: {},
+				websitName: '',
+				websitId: '',
+				worker: {},
+				workerId: '',
+				workerName: '',
+				mobile: '',
+				idcard: '',
+				examineProjectName: '',
+				examineProjectId: '',
+				examineProjectType: '',
+				examineProjectAmount: '',
+				examineProject: {},
+				orderBaseId: '',
+				fileUrl: [],
+				remark: ''
 			},
-			render: (h, { props, onInput }) => {
-				var { value } = props
-				return (
-					<el-radio-group v-model={this.formData.examineProjectType}>
-						<el-radio disabled={true} label="REWARD">奖励</el-radio>
-						<el-radio disabled={true} label="PUNISH">惩罚</el-radio>
-					</el-radio-group>
-				)
-			}
-		}, {
-			md: 12,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', type: 'number', disabled: true },
-			formItemAttributes: {
-			label: '考核金额',
-			prop: 'examineProjectAmount',
-			rules: [...required]
-			}
-		}, {
-			md: 12,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入'},
-			formItemAttributes: {
-				label: '关联工单号',
-				prop: 'orderBaseId',
-				rules: []
-			}
-		}, {
-			md: 24,
-			isShow: true,
-			name: 'slot-component',
-			formItemAttributes: {
-				label: '附件',
-				prop: 'fileUrl',
-				rules: []
-			},
-			render: (h, { props, onInput }) => {
-				var { value } = props
-				return (
-					<ImageUpload fileList={this.formData.fileUrl} limit={1} isEdit={this.formDialogType !== 2} />
-				)
-			}
-		}, {
-			md: 24,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入备注内容',type: "textarea", rows: 5 },
-			formItemAttributes: {
-			label: '备注',
-			prop: 'remark',
-			rules: []
-			}
-		}]
-    }
-  },
-  created(){
-	  if(this.$route.query.id){
-		  this.openDetail(this.$route.query.id)
-	  }
-  },
-  methods: {
-    // 列表请求函数
-	getList: listPageV2,
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'fileUrl') {
-			defaultData.render = (h, { row, index, column }) => {
-			  	return (
-			    	<div style="padding:0 6px;cursor: pointer;">
-			      		{row.fileUrl ? row.fileUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		      		</div>
-		    	)
-		  	}
+			websitList: [],
+			workerList: [],
+			examineList: []
 		}
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-		    this.openDetail(row.id)
-		  }}>详情</el-button>
-        </div>
-      )
-    },
-	openDetail(id){
-		getDetail({ id }).then(res => {
-		  Object.assign(this.formData, res.data,{
-		    fileUrl:res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
-		    worker: {workerId: res.data.workerId,nickName: res.data.workerName},
-		    websit: {websitId: res.data.websitId,websitName: res.data.websitName},
-		    examineProject: {name: res.data.examineProjectName}
-		  })
-		  this.getExamine()
-		  this.getWebsit()
-		  this.getWorker()
-		  this.formDialogType = 2
-		  this.openForm()
-		})
-	},
-	getExamine(){
-		getExamine({pageNum: 1,pageSize: -1,params: []}).then(res => {
-			this.examineList = res.data.records
-		})
 	},
-	getWebsit(){
-		if(this.type == 0){
-			this.formData.websitId = JSON.parse(localStorage.getItem('greemall_user')).adminWebsitId
-			this.formData.websitName = JSON.parse(localStorage.getItem('greemall_user')).nickName
-		}else{
-			getWebsit({type: 'C'}).then(res => {
-				this.websitList = res.data
-			})
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						})
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() {
+			return [{
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', disabled: true },
+				formItemAttributes: {
+					label: '所属商户',
+					prop: 'companyName',
+					rules: [...required]
+				},
+			}, {
+				md: 12,
+				isShow: this.type == 1,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入网点名称', },
+				formItemAttributes: {
+					label: '网点名称',
+					prop: 'websitId',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-select v-model={this.formData.websit} disabled={this.formDialogType != 0} value-key="websitId" onChange={(e) => {
+							this.formData.websitId = e.websitId
+							this.formData.websitName = e.name
+							this.formData.worker = {}
+							this.formData.workerId = ''
+							this.formData.workerName = ''
+							this.formData.idcard = ''
+							this.formData.mobile = ''
+							this.getWorker()
+						}} placeholder="请选择" style="width: 100%;">
+							{
+								this.websitList.map((item, index) => {
+									return <el-option key={item.websitId} label={item.name} value={item}></el-option>
+								})
+							}
+						</el-select>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: this.type == 0,
+				name: 'el-input',
+				attributes: { placeholder: '请输入网点名称', disabled: true },
+				formItemAttributes: {
+					label: '网点名称',
+					prop: 'websitName',
+					rules: [...required]
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'slot-component',
+				attributes: { placeholder: '请选择工程师', },
+				formItemAttributes: {
+					label: '选择工程师',
+					prop: 'workerId',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-select v-model={this.formData.worker} disabled={this.formDialogType != 0} value-key="nickName" onChange={(e) => {
+							this.formData.workerId = e.userId
+							this.formData.workerName = e.nickName
+							this.formData.idcard = e.idCard
+							this.formData.mobile = e.mobile
+						}} placeholder="请选择" style="width: 100%;">
+							{
+								this.workerList.map((item, index) => {
+									return <el-option key={item.userId} label={item.nickName} value={item}></el-option>
+								})
+							}
+						</el-select>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', },
+				formItemAttributes: {
+					label: '身份证',
+					prop: 'idcard',
+					rules: this.formData.idcard ? [
+						{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
+					] : []
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', },
+				formItemAttributes: {
+					label: '联系电话',
+					prop: 'mobile',
+					rules: this.formData.mobile ? [
+						{ pattern: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
+					] : []
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'slot-component',
+				attributes: { placeholder: '请选择考核项目', },
+				formItemAttributes: {
+					label: '选择考核项目',
+					prop: 'examineProjectName',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-select v-model={this.formData.examineProject} disabled={this.formDialogType != 0} value-key="name" onChange={(e) => {
+							this.formData.examineProjectId = e.id
+							this.formData.examineProjectName = e.name
+							this.formData.examineProjectType = e.type
+							this.formData.examineProjectAmount = e.amount
+						}} placeholder="请选择" style="width: 100%;">
+							{
+								this.examineList.map((item, index) => {
+									return <el-option key={item.id} label={item.name} value={item}></el-option>
+								})
+							}
+						</el-select>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'slot-component',
+				attributes: {},
+				formItemAttributes: {
+					label: '考核类型',
+					prop: 'examineProjectType',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-radio-group v-model={this.formData.examineProjectType}>
+							<el-radio disabled={true} label="REWARD">奖励</el-radio>
+							<el-radio disabled={true} label="PUNISH">惩罚</el-radio>
+						</el-radio-group>
+					)
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', type: 'number', disabled: true },
+				formItemAttributes: {
+					label: '考核金额',
+					prop: 'examineProjectAmount',
+					rules: [...required]
+				}
+			}, {
+				md: 12,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入' },
+				formItemAttributes: {
+					label: '关联工单号',
+					prop: 'orderBaseId',
+					rules: []
+				}
+			}, {
+				md: 24,
+				isShow: true,
+				name: 'slot-component',
+				formItemAttributes: {
+					label: '附件',
+					prop: 'fileUrl',
+					rules: []
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<ImageUpload fileList={this.formData.fileUrl} limit={1} isEdit={this.formDialogType !== 2} />
+					)
+				}
+			}, {
+				md: 24,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入备注内容', type: "textarea", rows: 5 },
+				formItemAttributes: {
+					label: '备注',
+					prop: 'remark',
+					rules: []
+				}
+			}]
 		}
 	},
-	getWorker(){
-		getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-			this.workerList = res.data.records
-		})
+	created() {
+		if (this.$route.query.id) {
+			this.openDetail(this.$route.query.id)
+		}
 	},
-    addData() {
-		this.getExamine()
-		this.getWebsit()
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-    formCancel() {
-      this.$refs.formRef.$refs.inlineForm.clearValidate()
-      this.$data.formData = this.$options.data().formData
-      this.formDialog = false
-    },
-    formConfirm() {
-      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-        if (valid) {
-          ([add, edit][this.formDialogType])({
-			  ...this.formData,
-			  fileUrl:this.formData.fileUrl.map(item=>item.url).join(",")
-		  }).then(res => {
-            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
-            this.formCancel()
-            this.$refs.pageRef.refreshList()
-          })
-        }
-      })
-    }
-  }
+	methods: {
+		// 列表请求函数
+		getList: listPageV2,
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'fileUrl') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.fileUrl ? row.fileUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				detail: {
+					click: ({ row, index, column }) => {
+						this.openDetail(row.id)
+					}
+				}
+			})
+		},
+		
+		openDetail(id) {
+			getDetail({ id }).then(res => {
+				Object.assign(this.formData, res.data, {
+					fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item => ({ url: item })) : [],
+					worker: { workerId: res.data.workerId, nickName: res.data.workerName },
+					websit: { websitId: res.data.websitId, websitName: res.data.websitName },
+					examineProject: { name: res.data.examineProjectName }
+				})
+				this.getExamine()
+				this.getWebsit()
+				this.getWorker()
+				this.formDialogType = 2
+				this.openForm()
+			})
+		},
+		getExamine() {
+			getExamine({ pageNum: 1, pageSize: -1, params: [] }).then(res => {
+				this.examineList = res.data.records
+			})
+		},
+		getWebsit() {
+			if (this.type == 0) {
+				this.formData.websitId = JSON.parse(localStorage.getItem('greemall_user')).adminWebsitId
+				this.formData.websitName = JSON.parse(localStorage.getItem('greemall_user')).nickName
+			} else {
+				getWebsit({ type: 'C' }).then(res => {
+					this.websitList = res.data
+				})
+			}
+		},
+		getWorker() {
+			getWorker({ pageNum: 1, pageSize: -1, params: [{ param: 'b.websit_id', compare: '=', value: this.formData.websitId }] }).then(res => {
+				this.workerList = res.data.records
+			})
+		},
+		addData() {
+			this.getExamine()
+			this.getWebsit()
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		formCancel() {
+			this.$refs.formRef.$refs.inlineForm.clearValidate()
+			this.$data.formData = this.$options.data().formData
+			this.formDialog = false
+		},
+		formConfirm() {
+			this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+				if (valid) {
+					([add, edit][this.formDialogType])({
+						...this.formData,
+						fileUrl: this.formData.fileUrl.map(item => item.url).join(",")
+					}).then(res => {
+						this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+						this.formCancel()
+						this.$refs.pageRef.refreshList()
+					})
+				}
+			})
+		}
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 199 - 196
src/views/workOrder/settleAccountsManagement/settleAccountsOrder/index.vue

@@ -1,27 +1,27 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
-	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-	  :operation="operation" :exportList="exportList">
-	  <div slot="moreSearch">
-	    <el-radio-group v-model="poolStatus" size="mini" @change="changeType">
-	    	<el-radio-button label="">全部</el-radio-button>
-			<el-radio-button label="NO">未汇总</el-radio-button>
-			<el-radio-button label="YES">已汇总</el-radio-button>
-	    </el-radio-group>
-	    <br><br>
-	  </div>
-	  <el-dialog title="" width="600px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
-	    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
-	    <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-	      <zj-form-module :title="formDialogTitles[formDialogType]" label-width="120px" :showPackUp="false"
-	        :form-data="formData" :form-items="formItems" :disabled="formDialogType==2">
-	      </zj-form-module>
-	    </zj-form-container>
-	    <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formCancel">取 消</el-button>
-			<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">提交</el-button>
-	    </div>
-	  </el-dialog>
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+		:operationColumnWidth="80" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+		:column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+		<div slot="moreSearch">
+			<el-radio-group v-model="poolStatus" size="mini" @change="changeType">
+				<el-radio-button label="">全部</el-radio-button>
+				<el-radio-button label="NO">未汇总</el-radio-button>
+				<el-radio-button label="YES">已汇总</el-radio-button>
+			</el-radio-group>
+			<br><br>
+		</div>
+		<el-dialog title="" width="600px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+			:show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+			<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+				<zj-form-module :title="formDialogTitles[formDialogType]" label-width="120px" :showPackUp="false"
+					:form-data="formData" :form-items="formItems" :disabled="formDialogType == 2">
+				</zj-form-module>
+			</zj-form-container>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="mini" @click="formCancel">取 消</el-button>
+				<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">提交</el-button>
+			</div>
+		</el-dialog>
 	</template-page>
 </template>
 
@@ -30,189 +30,192 @@ import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, pool } from "@/api/workOrder/settleAccountsOrder";
+import { listPageV2, pageExport, pool } from "@/api/workOrder/settleAccountsOrder";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '汇总',
-	  				click: this.poolData
-	  			}
-	  		],
-	  	],
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["汇总"],
-      formDialog: false,
-	  type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		month: (new Date().getFullYear()) + '-' + ((new Date().getMonth() + 1)>9?(new Date().getMonth() + 1):('0'+(new Date().getMonth() + 1))),
-		createdTime: [],
-		starDate: '',
-		endDate: '',
-      },
-	  poolStatus: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {
-		return [{
-			md: 24,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', disabled: true },
-			formItemAttributes: {
-			label: '所属商户',
-			prop: 'companyName',
-			rules: [...required]
+	components: { TemplatePage, ImageUpload },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: false
 			},
-		}, {
-			md: 24,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', disabled: true },
-			formItemAttributes: {
-			label: '月份',
-			prop: 'month',
-			rules: [...required]
-			}
-		}, {
-			md: 24,
-			isShow: true,
-			name: 'slot-component',
-			attributes: { placeholder: '请选择',},
-			formItemAttributes: {
-			label: '创建结算单时间',
-			prop: 'createdTime',
-			rules: [...required]
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
 			},
-			render: (h, { props, onInput }) => {
-				var { value } = props
-				return (
-					<el-date-picker
-						v-model={this.formData.createdTime}
-						type="daterange"
-						range-separator="至"
-						value-format="yyyy-MM-dd"
-						start-placeholder="开始日期"
-						end-placeholder="结束日期"
-						onChange={e=>{
-							this.formData.starDate = e[0]
-							this.formData.endDate = e[1]
-						}}>
-				    </el-date-picker>
-				)
-			}
-		}]
-    }
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["汇总"],
+			formDialog: false,
+			type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
+			formData: {
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				month: (new Date().getFullYear()) + '-' + ((new Date().getMonth() + 1) > 9 ? (new Date().getMonth() + 1) : ('0' + (new Date().getMonth() + 1))),
+				createdTime: [],
+				starDate: '',
+				endDate: '',
+			},
+			poolStatus: ''
+		}
 	},
-	// 列表请求函数
-	getList(p,cb) {
-		try {
-			var pam = JSON.parse(JSON.stringify(p))
-			pam.params.push({'param': 'a.pool_status', "compare": "=", "value": this.poolStatus})
-			cb && cb(pam)
-			return listPageV2(pam)
-		} catch (error) {
-			console.log(error)
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("collect", {
+							click: this.poolData
+						})
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() {
+			return [{
+				md: 24,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', disabled: true },
+				formItemAttributes: {
+					label: '所属商户',
+					prop: 'companyName',
+					rules: [...required]
+				},
+			}, {
+				md: 24,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', disabled: true },
+				formItemAttributes: {
+					label: '月份',
+					prop: 'month',
+					rules: [...required]
+				}
+			}, {
+				md: 24,
+				isShow: true,
+				name: 'slot-component',
+				attributes: { placeholder: '请选择', },
+				formItemAttributes: {
+					label: '创建结算单时间',
+					prop: 'createdTime',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-date-picker
+							v-model={this.formData.createdTime}
+							type="daterange"
+							range-separator="至"
+							value-format="yyyy-MM-dd"
+							start-placeholder="开始日期"
+							end-placeholder="结束日期"
+							onChange={e => {
+								this.formData.starDate = e[0]
+								this.formData.endDate = e[1]
+							}}>
+						</el-date-picker>
+					)
+				}
+			}]
 		}
 	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-				if(row.settleOrderType == 'EXAMINE'){
-					this.$router.push({
-							name: "rewardsPunishmentsOrder",
-							query: {
-								id:row.examineProjectId
-							}
-					})
-				}else{
-					this.$router.push({
-							name: "workOrderPool",
-							query: {
-								id:row.orderBaseId,
-								activeName: "SettleAccounts",
-							}
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ 'param': 'a.pool_status', "compare": "=", "value": this.poolStatus })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				detail: {
+					click: ({ row, index, column }) => {
+						if (row.settleOrderType == 'EXAMINE') {
+							this.$router.push({
+								name: "rewardsPunishmentsOrder",
+								query: {
+									id: row.examineProjectId
+								}
+							})
+						} else {
+							this.$router.push({
+								name: "workOrderPool",
+								query: {
+									id: row.orderBaseId,
+									activeName: "SettleAccounts",
+								}
+							})
+						}
+					}
+				}
+			})
+		},
+
+		poolData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		formCancel() {
+			this.$refs.formRef.$refs.inlineForm.clearValidate()
+			this.$data.formData = this.$options.data().formData
+			this.formDialog = false
+		},
+		formConfirm() {
+			this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+				if (valid) {
+					pool({
+						starDate: this.formData.starDate + ' 00:00:00',
+						endDate: this.formData.endDate + ' 23:59:59',
+						month: this.formData.month
+					}).then(res => {
+						this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+						this.formCancel()
+						this.$refs.pageRef.refreshList()
 					})
 				}
-		  }}>详情</el-button>
-        </div>
-      )
-    },
-    poolData() {
-		this.formDialogType = 0
-		this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-    formCancel() {
-      this.$refs.formRef.$refs.inlineForm.clearValidate()
-      this.$data.formData = this.$options.data().formData
-      this.formDialog = false
-    },
-    formConfirm() {
-      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-        if (valid) {
-          pool({
-			  starDate: this.formData.starDate + ' 00:00:00',
-			  endDate: this.formData.endDate + ' 23:59:59',
-			  month: this.formData.month
-		  }).then(res => {
-            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
-            this.formCancel()
-            this.$refs.pageRef.refreshList()
-          })
-        }
-      })
-    }
-  }
+			})
+		}
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 219 - 207
src/views/workOrder/settleAccountsManagement/summaryBill/index.vue

@@ -1,21 +1,21 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="120"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation">
-		  <!--  :exportList="exportList" -->
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="status" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-				<el-radio-button label="NO">待发放</el-radio-button>
-				<el-radio-button label="YES">已发放</el-radio-button>
-				<el-radio-button label="NOT">驳回</el-radio-button>
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :operationColumnWidth="120" :options-evens-group="optionsEvensGroup"
+			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()">
+			<!--  :exportList="exportList" -->
+			<div slot="moreSearch">
+				<el-radio-group v-model="status" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="NO">待发放</el-radio-button>
+					<el-radio-button label="YES">已发放</el-radio-button>
+					<el-radio-button label="NOT">驳回</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<detailList :id="id" @back="backList" :title="'汇总账单明细-'+id"></detailList>
+			<detailList :id="id" @back="backList" :title="'汇总账单明细-' + id"></detailList>
 		</div>
 	</div>
 </template>
@@ -26,210 +26,222 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import detailList from './detailList.vue'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, cancel, confirm } from "@/api/workOrder/summaryBill";
+import { listPageV2, pageExport, cancel, confirm } from "@/api/workOrder/summaryBill";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload, detailList },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '驳回',
-	  				click: this.cancelMore
-	  			}
-	  		],
-	  	],
-		[
-			[
-				{
-					name: '发放',
-					click: this.confirmMore
-				}
-			]
-		]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true,
-		selectable: this.selectable
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["汇总"],
-      formDialog: false,
-	  type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
-      formData: {
-		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		month: (new Date().getFullYear()) + '-' + ((new Date().getMonth() + 1)>9?(new Date().getMonth() + 1):('0'+(new Date().getMonth() + 1))),
-		createdTime: [],
-		starDate: '',
-		endDate: '',
-      },
-	  status: '',
-	  id: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {
-		return [{
-			md: 24,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', disabled: true },
-			formItemAttributes: {
-			label: '所属商户',
-			prop: 'companyName',
-			rules: [...required]
+	components: { TemplatePage, ImageUpload, detailList },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true,
+				selectable: this.selectable
 			},
-		}, {
-			md: 24,
-			isShow: true,
-			name: 'el-input',
-			attributes: { placeholder: '请输入', disabled: true },
-			formItemAttributes: {
-			label: '月份',
-			prop: 'month',
-			rules: [...required]
-			}
-		}, {
-			md: 24,
-			isShow: true,
-			name: 'slot-component',
-			attributes: { placeholder: '请选择',},
-			formItemAttributes: {
-			label: '创建结算单时间',
-			prop: 'createdTime',
-			rules: [...required]
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
 			},
-			render: (h, { props, onInput }) => {
-				var { value } = props
-				return (
-					<el-date-picker
-						v-model={this.formData.createdTime}
-						type="daterange"
-						range-separator="至"
-						start-placeholder="开始日期"
-						end-placeholder="结束日期"
-						onChange={e=>{
-							this.formData.starDate = e[0]
-							this.formData.endDate = e[1]
-						}}>
-				    </el-date-picker>
-				)
-			}
-		}]
-    }
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
-	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
-	},
-	selectable(row, index) {
-	  return ["NO"].includes(Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0])
-	},
-    // 列表请求函数
-    getList(p,cb) {
-		try {
-			var pam = JSON.parse(JSON.stringify(p))
-			pam.params.push({'param': 'a.status', "compare": "=", "value": this.status})
-			cb && cb(pam)
-			return listPageV2(pam)
-		} catch (error) {
-			console.log(error)
-		}
-    },
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-		return (
-			<div class='operation-btns'>
-				<el-button type="text" onClick={() => {
-					this.id = row.id
-					this.formDialog = true
-				}}>明细</el-button>
-				{row.status == 'NO'?<el-button type="text" onClick={() => {
-					this.confirm([row.id])
-				}}>发放</el-button>:null}
-				{row.status == 'NO'?<el-button type="text" onClick={() => {
-					this.cancel([row.id])
-				}}>驳回</el-button>:null}
-			</div>
-		)
-    },
-	cancelMore(){
-		if(this.recordSelected.length == 0){
-			return this.$message.warning('请至少勾选一条数据!');
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["汇总"],
+			formDialog: false,
+			type: JSON.parse(localStorage.getItem('greemall_user')).type, //type=1商户, type=0网点
+			formData: {
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				month: (new Date().getFullYear()) + '-' + ((new Date().getMonth() + 1) > 9 ? (new Date().getMonth() + 1) : ('0' + (new Date().getMonth() + 1))),
+				createdTime: [],
+				starDate: '',
+				endDate: '',
+			},
+			status: '',
+			id: ''
 		}
-		this.cancel(this.recordSelected.map(item=>{return item.id}))
 	},
-    cancel(ids) {
-		this.$confirm('请确认是否驳回选中的数据, 是否继续?', '提示', {
-			confirmButtonText: '确定',
-			cancelButtonText: '取消',
-			type: 'warning'
-		}).then(() => {
-			cancel(ids).then(res => {
-				this.$message({ type: 'success', message: `驳回成功!` })
-				this.$refs.pageRef.refreshList()
-			})
-		});
-    },
-	confirmMore(){
-		if(this.recordSelected.length == 0){
-			return this.$message.warning('请至少勾选一条数据!');
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("rejectPl", {
+							click: this.cancelMore
+						})
+					],
+					[
+						this.optionsEvensAuth("issuePl", {
+							click: this.confirmMore
+						})
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() {
+			return [{
+				md: 24,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', disabled: true },
+				formItemAttributes: {
+					label: '所属商户',
+					prop: 'companyName',
+					rules: [...required]
+				},
+			}, {
+				md: 24,
+				isShow: true,
+				name: 'el-input',
+				attributes: { placeholder: '请输入', disabled: true },
+				formItemAttributes: {
+					label: '月份',
+					prop: 'month',
+					rules: [...required]
+				}
+			}, {
+				md: 24,
+				isShow: true,
+				name: 'slot-component',
+				attributes: { placeholder: '请选择', },
+				formItemAttributes: {
+					label: '创建结算单时间',
+					prop: 'createdTime',
+					rules: [...required]
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<el-date-picker
+							v-model={this.formData.createdTime}
+							type="daterange"
+							range-separator="至"
+							start-placeholder="开始日期"
+							end-placeholder="结束日期"
+							onChange={e => {
+								this.formData.starDate = e[0]
+								this.formData.endDate = e[1]
+							}}>
+						</el-date-picker>
+					)
+				}
+			}]
 		}
-		this.confirm(this.recordSelected.map(item=>{return item.id}))
 	},
-	confirm(ids){
-		this.$confirm('请确认是否发放选中的数据, 是否继续?', '提示', {
-			confirmButtonText: '确定',
-			cancelButtonText: '取消',
-			type: 'warning'
-		}).then(() => {
-			confirm(ids).then(res => {
-				this.$message({ type: 'success', message: `发放成功!` })
-				this.$refs.pageRef.refreshList()
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		selectable(row, index) {
+			return ["NO"].includes(Object.entries(row.selectMapData.status).find(([key, val]) => val == row.status)?.[0])
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ 'param': 'a.status', "compare": "=", "value": this.status })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				detail: {
+					click: ({ row, index, column }) => {
+						this.id = row.id
+						this.formDialog = true
+					}
+				},
+				issue: {
+					conditions: ({ row, index, column }) => {
+						return row.status == 'NO'
+					},
+					click: ({ row, index, column }) => {
+						this.confirm([row.id])
+					}
+				},
+				reject: {
+					conditions: ({ row, index, column }) => {
+						return row.status == 'NO'
+					},
+					click: ({ row, index, column }) => {
+						this.cancel([row.id])
+					}
+				},
 			})
-		});
+		},
+
+
+		cancelMore() {
+			if (this.recordSelected.length == 0) {
+				return this.$message.warning('请至少勾选一条数据!');
+			}
+			this.cancel(this.recordSelected.map(item => { return item.id }))
+		},
+		cancel(ids) {
+			this.$confirm('请确认是否驳回选中的数据, 是否继续?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				cancel(ids).then(res => {
+					this.$message({ type: 'success', message: `驳回成功!` })
+					this.$refs.pageRef.refreshList()
+				})
+			});
+		},
+		confirmMore() {
+			if (this.recordSelected.length == 0) {
+				return this.$message.warning('请至少勾选一条数据!');
+			}
+			this.confirm(this.recordSelected.map(item => { return item.id }))
+		},
+		confirm(ids) {
+			this.$confirm('请确认是否发放选中的数据, 是否继续?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				confirm(ids).then(res => {
+					this.$message({ type: 'success', message: `发放成功!` })
+					this.$refs.pageRef.refreshList()
+				})
+			});
+		}
 	}
-  }
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
-	.page{
-		height: 100%;
-	}
+.tab {
+	padding: 20px 20px 0 20px;
+}
+
+.page {
+	height: 100%;
+}
 </style>

+ 6 - 2
src/views/workOrder/workOrderPool/detail.vue

@@ -13,11 +13,11 @@
         height: activeName === 'workOrderInfo' ? '100%' : '0px',
         overflow: activeName === 'workOrderInfo' ? '' : 'hidden'
       }">
-        <workOrderInfo :id="id" ref="workOrderInfo" />
+        <workOrderInfo :id="id" ref="workOrderInfo" :workOrderType="workOrderType" />
       </div>
       <OperationDetail v-if="activeName == 'operationDetails'" :id="id" ref="operationDetails" />
       <CompletionDetails v-if="activeName == 'detailsCompletion'" :id="id" ref="detailsCompletion" />
-      <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" />
+      <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" :workOrderType="workOrderType" />
       <Evaluation v-if="activeName == 'Evaluation' && EvaluationShow" :id="id" ref="Evaluation" />
       <SettleAccounts v-if="activeName == 'SettleAccounts' && SettleAccountsShow" :id="id" ref="SettleAccounts" />
     </div>
@@ -46,6 +46,10 @@ export default {
       type: [String, Number],
       default: null
     },
+    workOrderType: {
+      type: [Number],
+      default: null
+    },
   },
   data() {
     return {

+ 96 - 39
src/views/workOrder/workOrderPool/detailModule/Payment/index.vue

@@ -3,8 +3,12 @@
     <zj-page-fill class="neibuview">
       <template v-if="payData.length">
         <zj-form-container :formAttributes="{ 'label-position': 'top' }">
-          <template v-for="(item, index) in payData.length">
-            <zj-form-module :title="'支付费用' + (index + 1)" :form-data="payData[index]" :form-items="formItems" />
+          <template v-for="(item, index) in payData">
+            <zj-form-module :title="'支付费用' + (index + 1)" :form-data="payData[index]" :form-items="formItems">
+              <div v-if="item.examineStatus === 'FAIL'" style="text-align:right">
+                <el-button size="mini" type="danger" plain @click="enginMaterialCancelFun(item)">取消申请</el-button>
+              </div>
+            </zj-form-module>
           </template>
         </zj-form-container>
       </template>
@@ -16,13 +20,18 @@
 <script>
 import { listPageV2 } from "@/api/workOrder/appraise";
 import { tableDataParsing } from "@/utils/common.js"
-import { changeOrderGetOrderList } from "@/api/workOrderPool.js";
+import { changeOrderGetOrderList, enginMaterialDetailWorker, enginMaterialCancel } from "@/api/workOrderPool.js";
+
 export default {
   props: {
     id: {
       type: [String, Number],
       default: null,
-    }
+    },
+    workOrderType: {
+      type: Number,
+      default: 0, // 0普通工单, 1维保工单
+    },
   },
   data() {
     return {
@@ -32,13 +41,7 @@ export default {
   watch: {
     id: {
       handler(newVal, oldVal) {
-        if (this.id) {
-          changeOrderGetOrderList({
-            id: this.id
-          }).then(res => {
-            this.payData = res.data
-          })
-        }
+        this.getxiangqing()
       },
       deep: true,
       immediate: true,
@@ -62,9 +65,6 @@ export default {
               <el-descriptions-item label="工单号">
                 {formData.workerOrderId}
               </el-descriptions-item>
-              {/* <el-descriptions-item label="流水号">
-                {formData.wechatOrder}
-              </el-descriptions-item> */}
               <el-descriptions-item label="工程师名称">
                 {formData.workerName}
               </el-descriptions-item>
@@ -72,7 +72,7 @@ export default {
                 {formData.workerMobile}
               </el-descriptions-item>
               <el-descriptions-item label="支付方式">
-                微信
+                {({ WECHAT: "微信支付", LINE: "线下支付", EXAMINE: "审批" })[formData.payType] || "微信支付"}
               </el-descriptions-item>
               <el-descriptions-item label="客户名称">
                 {formData.pgOrderBase.userName}
@@ -86,12 +86,28 @@ export default {
               <el-descriptions-item label="支付总金额">
                 {formData.totalAmount}
               </el-descriptions-item>
-              <el-descriptions-item label="总手续费">
-                {formData.commissionAmount}
-              </el-descriptions-item>
+              {this?.workOrderType == 0 ? (
+                <el-descriptions-item label="总手续费">
+                  {formData.commissionAmount}
+                </el-descriptions-item>
+              ) : null}
               <el-descriptions-item label="支付时间">
                 {formData.payTime}
               </el-descriptions-item>
+              <el-descriptions-item label="">
+              </el-descriptions-item>
+              {this?.workOrderType == 1 ? [
+                (<el-descriptions-item label=""></el-descriptions-item>),
+                (<el-descriptions-item label="审批状态">
+                  {({ WAIT: "待审", OK: "审批", FAIL: "驳回", NO: "取消" })[formData.examineStatus] || ""}
+                </el-descriptions-item>),
+                (<el-descriptions-item label="审批人">
+                  {formData.examineName}
+                </el-descriptions-item>),
+                (<el-descriptions-item label="审批时间">
+                  {formData.examineTime}
+                </el-descriptions-item>),
+              ] : null}
             </el-descriptions>
           )
         }
@@ -125,28 +141,35 @@ export default {
                   label: '费用金额',
                   prop: 'totalAmount',
                 }
-              }, {
-                columnAttributes: {
-                  label: '师傅分账金额',
-                  prop: 'workerAmount',
+              },
+              ...(() => {
+                if (this?.workOrderType == 0) {
+                  return [{
+                    columnAttributes: {
+                      label: '师傅分账金额',
+                      prop: 'workerAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '师傅手续费',
+                      prop: 'workerProceAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '网点分账金额',
+                      prop: 'websitAmount',
+                    }
+                  }, {
+                    columnAttributes: {
+                      label: '网点手续费',
+                      prop: 'websitProceAmount',
+                    }
+                  }]
                 }
-              }, {
-                columnAttributes: {
-                  label: '师傅手续费',
-                  prop: 'workerProceAmount',
-                }
-              }, {
-                columnAttributes: {
-                  label: '网点分账金额',
-                  prop: 'websitAmount',
-                }
-              }, {
-                columnAttributes: {
-                  label: '网点手续费',
-                  prop: 'websitProceAmount',
-                }
-              }]}
-              table-data={formData.workerOrderItems}
+                return []
+              })(),
+              ]}
+              table-data={[formData.workerOrderItems, formData.rpMaterialOrderItems][this?.workOrderType]}
             />
           )
         }
@@ -213,6 +236,40 @@ export default {
       }]
     }
   },
+  methods: {
+    getxiangqing() {
+      if (this.id) {
+        if (this?.workOrderType == 0) {
+          changeOrderGetOrderList({
+            id: this.id
+          }).then(res => {
+            this.payData = res.data
+          })
+        } else if (this?.workOrderType == 1) {
+          enginMaterialDetailWorker({
+            workerOrderId: this.id
+          }).then(res => {
+            this.payData = res.data
+          })
+        }
+
+      }
+    },
+    enginMaterialCancelFun(item) {
+      this.$confirm('是否确认取消申请?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        enginMaterialCancel({
+          id: item.orderId
+        }).then(res => {
+          this.getxiangqing()
+        })
+      }).catch(() => {
+      });
+    }
+  }
 }
 </script>
 

+ 5 - 2
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue

@@ -9,7 +9,8 @@
           </div>
           <div slot="right" style="width: 55%; position: relative">
             <div class="pgxxTable">
-              <zj-table :columns="logColumns" :table-data="logList" :table-attributes="{ height: '100%', border: true }" />
+              <zj-table :columns="logColumns" :table-data="logList"
+                :table-attributes="{ height: '100%', border: true }" />
             </div>
           </div>
         </zj-form-module>
@@ -18,7 +19,7 @@
         <!-- 服务信息 -->
         <zj-form-module title="服务信息" label-width="110px" :form-data="orderInfo" :form-items="serviceInfo" />
         <!-- 产品信息 -->
-        <zj-form-module title="产品信息" :form-data="orderInfo" :form-items="product" />
+        <zj-form-module title="产品信息" :form-data="orderInfo" :form-items="workOrderType == 1 ? product_wb : product" />
         <!-- 其它信息 -->
         <zj-form-module title="其它信息" :form-data="orderInfo" :form-items="otherInfo" />
         <!-- 派单信息 -->
@@ -64,6 +65,7 @@ import basicInfo from './mixins/basicInfo.js'
 import dispatchInfo from './mixins/dispatchInfo.js'
 import otherInfo from './mixins/otherInfo.js'
 import productColumns from './mixins/productColumns.js'
+import wb_productColumns from './mixins/wb_productColumns.js'
 import serviceInfo from './mixins/serviceInfo.js'
 import pandanxinxi from './mixins/pandanxinxi.js'
 import copyInfo from './buttons/copyInfo.vue'
@@ -92,6 +94,7 @@ export default {
     dispatchInfo,
     otherInfo,
     productColumns,
+    wb_productColumns,
     serviceInfo,
     pandanxinxi,
   ],

+ 117 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/basicInfo.js

@@ -1,4 +1,5 @@
 import { lbsAmapRegion } from '@/api/common.js'
+import { listPageV2, getDetail } from "@/api/engineeringMaintenance/basicData";
 import geographicalPosi from '@/components/geographicalPosi/index.vue'
 export default {
   data() {
@@ -7,12 +8,81 @@ export default {
       cityList: [],
       areaList: [],
       streetList: [],
+      wb_project: []
     }
   },
+  created() {
+    function getTimef(sfm = "00:00:00") {
+      var currentDate = new Date();
+      var year = currentDate.getFullYear();
+      var month = ('0' + (currentDate.getMonth() + 1)).slice(-2); // 月份从0开始,需要加1
+      var day = ('0' + currentDate.getDate()).slice(-2);
+      return year + '-' + month + '-' + day + ' ' + sfm
+    }
+    listPageV2({
+      "pageNum": 1,
+      "pageSize": -1,
+      "params": [
+        { "param": "a.start_time", "compare": "<=", "value": getTimef() },
+        { "param": "a.end_time", "compare": ">=", "value": getTimef() }
+      ]
+    }).then(res => {
+      this.wb_project = res.data.records.map(item => {
+        return {
+          value: item.id,
+          label: item.projectName,
+          data: item,
+        }
+      })
+    })
+  },
   computed: {
     // 基本信息数据模型
     basicInfo() {
       return [
+        ...(() => {
+          if (this.workOrderType == 1) {
+            return [{
+              isShow: this.formOptions.rpProjectRepairId.isShow,
+              name: 'el-select',
+              md: 12,
+              options: this.wb_project,
+              attributes: {
+                disabled: !this.formOptions.rpProjectRepairId.isEdit,
+                placeholder: '请选择',
+                clearable: true,
+                filterable: true
+              },
+              formItemAttributes: {
+                label: '维保项目',
+                prop: 'rpProjectRepairId',
+                rules: this.formOptions.rpProjectRepairId.isRules
+              },
+              events: {
+                change: (val) => {
+                  this.getorderDetail(() => {
+                    if (val) {
+                      this.orderInfo.rpProjectRepairId = val
+                      this.orderInfo.rpProjectRepairName = this.wb_project.find(item => item.value == val).label
+                      this.getWeiBaoDetail()
+                    }
+                  })
+                }
+              }
+            }, {
+              name: 'slot-component',
+              md: 12,
+              formItemAttributes: {
+                'label-width': '0px',
+                prop: '',
+              },
+              render: (h, { props }) => {
+                return null
+              }
+            },]
+          }
+          return []
+        })(),
         {
           isShow: this.formOptions.userName.isShow,
           name: 'el-input',
@@ -236,12 +306,58 @@ export default {
     }
   },
   methods: {
+    getWeiBaoDetail() {
+      if (this.orderInfo.rpProjectRepairId) {
+        getDetail({
+          id: this.orderInfo.rpProjectRepairId
+        }).then(res => {
+
+          if (!this.id) {
+            this.orderInfo.userName = res.data.manger
+            this.orderInfo.linkName = res.data.manger
+            this.orderInfo.userMobile = res.data.mobile
+            this.orderInfo.provinceId = res.data.provinceId
+            this.orderInfo.province = res.data.province
+            this.orderInfo.cityId = res.data.cityId
+            this.orderInfo.city = res.data.city
+            this.orderInfo.areaId = res.data.areaId
+            this.orderInfo.area = res.data.area
+            this.orderInfo.streetId = res.data.streetId
+            this.orderInfo.street = res.data.street
+            this.orderInfo.gpsAddress = res.data.gpsAddress || res.data.address
+            this.orderInfo.lat = res.data.lat
+            this.orderInfo.lng = res.data.lng
+            this.orderInfo.address = res.data.address
+          }
+
+          // 工单小类下拉
+          this.orderSmallTypeData = res.data.typeList.map(item => ({
+            value: item.id,
+            label: item.orderSmallTypeText
+          }))
+
+          // 网点下拉数据
+          this.websitList = (res.data.websitList || []).map(item => ({
+            label: item.websitName,
+            value: item.websitId
+          }))
+
+          // 获取师傅
+          this.getWorkers()
+
+          // 产品信息可选项
+          this.productList_wb = (res.data.productList || [])
+
+          this.getinitlbslist()
+        })
+      }
+    },
     getinitlbslist() {
       // 初始化请求省市区街道下拉选项数据
       lbsAmapRegion({ pid: 0 }).then(res => {
         this.provinceList = res.data
         // 创建工单时获取ip地址定位赋值
-        if (!this.id && this.$IpAdd.province) {
+        if (!this.id && this.workOrderType == 0 && this.$IpAdd.province) {
           var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
           if (item) {
             this.orderInfo.provinceId = item.id

+ 9 - 6
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/pandanxinxi.js

@@ -212,12 +212,15 @@ export default {
     }
   },
   created() {
-    getWebsit({ type: "C", status: true, isAll: this.isAllWebsit || this.id ? true : false }).then(res => {
-      this.websitList = res.data.map(item => ({
-        label: item.name,
-        value: item.websitId
-      }))
-    })
+    // 普通工单选择网点数据
+    if (this.workOrderType == 0 || this.isAllWebsit) {
+      getWebsit({ type: "C", status: true, isAll: this.isAllWebsit || this.id ? true : false }).then(res => {
+        this.websitList = res.data.map(item => ({
+          label: item.name,
+          value: item.websitId
+        }))
+      })
+    }
   },
   methods: {
     getWorkers() {

+ 2 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/productColumns.js

@@ -246,6 +246,7 @@ export default {
                         "mainId": "",
                         "mainName": "",
                         "num": "",
+                        "insideCode": "",
                         "orderBaseId": this.id || '',
                         "productId": "",
                         "productName": "",
@@ -355,7 +356,7 @@ export default {
     },
     delProduct(row, index) {
       this.appointVerify(this.getVfyKey(this.isEditIndex), (v) => {
-        if (v && this.id) {
+        if (v && this.id && row.id) {
           orderBaseProductDelete({
             orderProductId: row.id
           }).then(res => {

+ 63 - 55
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/serviceInfo.js

@@ -50,46 +50,53 @@ export default {
             rules: this.formOptions.orderSmallType.isRules
           }
         },
-        {
-          isShow: this.formOptions.orderChannelId.isShow && !this.id,
-          name: 'el-select',
-          md: 6,
-          options: this.orderChannels,
-          attributes: {
-            disabled: !this.formOptions.orderChannelId.isEdit,
-            placeholder: '请选择',
-            clearable: true,
-            filterable: true
-          },
-          formItemAttributes: {
-            label: '工单渠道',
-            prop: 'orderChannelId',
-            rules: this.formOptions.orderChannelId.isRules
-          },
-          events: {
-            change: (val) => {
-              if (val) {
-                this.orderInfo.orderChannelText = this.orderChannels.find(item => item.value == val).label
-              } else {
-                this.orderInfo.orderChannelText = ''
+        ...(() => {
+          if (this.workOrderType == 0) {
+            // 普通工单
+            return [{
+              isShow: this.formOptions.orderChannelId.isShow,
+              name: 'el-select',
+              md: 6,
+              options: this.orderChannels,
+              attributes: {
+                disabled: !this.formOptions.orderChannelId.isEdit,
+                placeholder: '请选择',
+                clearable: true,
+                filterable: true
+              },
+              formItemAttributes: {
+                label: '工单渠道',
+                prop: 'orderChannelId',
+                rules: this.formOptions.orderChannelId.isRules
+              },
+              events: {
+                change: (val) => {
+                  if (val) {
+                    this.orderInfo.orderChannelText = this.orderChannels.find(item => item.value == val).label
+                  } else {
+                    this.orderInfo.orderChannelText = ''
+                  }
+                }
               }
-            }
-          }
-        },
-        {
-          isShow: this.formOptions.orderChannelId.isShow && this.id,
-          name: 'el-input',
-          md: 6,
-          options: [],
-          attributes: {
-            disabled: !this.formOptions.orderChannelId.isEdit,
-          },
-          formItemAttributes: {
-            label: '工单渠道',
-            prop: 'orderChannelText',
-            rules: this.formOptions.orderChannelId.isRules
+            }]
+          } else if (this.workOrderType == 1) {
+            this.orderInfo.orderChannelId = "工程维保"
+            // 维保工单
+            return [{
+              isShow: this.formOptions.orderChannelId.isShow,
+              name: 'el-input',
+              md: 6,
+              attributes: {
+                disabled: !this.formOptions.orderChannelId.isEdit,
+              },
+              formItemAttributes: {
+                label: '工单渠道',
+                prop: 'orderChannelId',
+                rules: this.formOptions.orderChannelId.isRules
+              }
+            }]
           }
-        },
+        })(),
         {
           isShow: this.formOptions.appointmentTime.isShow,
           name: 'el-date-picker',
@@ -111,7 +118,6 @@ export default {
             rules: this.formOptions.appointmentTime.isRules
           }
         },
-
         {
           isShow: this.formOptions.saleCompany.isShow,
           name: 'el-input',
@@ -125,25 +131,27 @@ export default {
             prop: 'saleCompany',
             rules: this.formOptions.saleCompany.isRules
           }
-        }
-
+        },
       ]
     }
   },
   created() {
-    // 获取工单类型
-    listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
-      this.orderSmallTypeData = res.data.records.map(item => ({
-        value: item.id,
-        label: item.orderSmallTypeText
-      }))
-    })
-    // 获取工单渠道
-    getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "ORDER_CHANNEL" }] }).then(res => {
-      this.orderChannels = res.data.records.map(item => ({
-        value: item.dictCode,
-        label: item.dictValue
-      }))
-    })
+    // 普通工单选择网点数据
+    if (this.workOrderType == 0) {
+      // 获取工单类型
+      listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
+        this.orderSmallTypeData = res.data.records.map(item => ({
+          value: item.id,
+          label: item.orderSmallTypeText
+        }))
+      })
+      // 获取工单渠道
+      getDataDictionary({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }, { "param": "a.dict_type", "compare": "=", "value": "ORDER_CHANNEL" }] }).then(res => {
+        this.orderChannels = res.data.records.map(item => ({
+          value: item.dictCode,
+          label: item.dictValue
+        }))
+      })
+    }
   },
 }

+ 377 - 0
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/wb_productColumns.js

@@ -0,0 +1,377 @@
+import { getClassifyList } from '@/api/goods'
+import { getDataDictionary } from '@/api/dataDictionary.js'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { orderBaseProductList, orderBaseProductAdd, orderBaseProductUpdate, orderBaseProductDelete } from "@/api/workOrderPool.js"
+export default {
+  data() {
+    return {
+      isEditIndex: -1,
+      productList_wb: []
+    }
+  },
+  computed: {
+    productColumns_wb() {
+      return [
+        {
+          columnAttributes: {
+            label: '产品品牌',
+            prop: 'brandId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? <div class="redbordererr">
+              <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
+                <el-select
+                  disabled={!this.formOptions.orderProducts.isEdit}
+                  value={row[column.columnAttributes.prop]}
+                  onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                  onChange={(val) => {
+                    if (val) {
+                      var data = this.huoquweiyi('brandId', 'brandName').find(item => item.value == val)
+                      row.brandName = data.label
+                    } else {
+                      row.brandName = ""
+                    }
+                  }}
+                  placeholder="请选择">
+                  {this.huoquweiyi('brandId', 'brandName').map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)}
+                </el-select>
+              </el-form-item>
+            </div> : <div style="padding-left:10px">{row.brandName}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品大类',
+            prop: 'mainId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? <div class="redbordererr">
+              <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
+                <el-select
+                  disabled={!this.formOptions.orderProducts.isEdit}
+                  value={row[column.columnAttributes.prop]}
+                  onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                  onChange={(val) => {
+                    row.smallId = ""
+                    row.smallName = ""
+                    if (val) {
+                      var data = this.huoquweiyi('mainId', 'mainName').filter(item => {
+                        return !!this.productList_wb.filter(v => v.mainId == item.value).find(v2 => v2.brandId == row.brandId)
+                      }).find(item => item.value == val)
+                      row.mainName = data.label
+                    } else {
+                      row.mainName = ""
+                    }
+                  }}
+                  placeholder="请选择">
+                  {
+                    this.huoquweiyi('mainId', 'mainName').filter(item => {
+                      return !!this.productList_wb.filter(v => v.mainId == item.value).find(v2 => v2.brandId == row.brandId)
+                    }).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)
+                  }
+                </el-select>
+              </el-form-item>
+            </div> : <div style="padding-left:10px">{row.mainName}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品小类',
+            prop: 'smallId'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? <div class="redbordererr">
+              <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
+                <el-select
+                  disabled={!this.formOptions.orderProducts.isEdit}
+                  value={row[column.columnAttributes.prop]}
+                  onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                  onChange={(val) => {
+                    if (val) {
+                      var data = this.huoquweiyi('smallId', 'smallName', "smallImg").filter(item => {
+                        return !!this.productList_wb.filter(v => v.smallId == item.value).find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
+                      }).find(item => item.value == val)
+                      row.smallName = data.label
+                      row.imgUrl = data.smallImg
+                    } else {
+                      row.smallName = ""
+                      row.imgUrl = ""
+                    }
+                  }}
+                  placeholder="请选择">
+                  {
+                    this.huoquweiyi('smallId', 'smallName', "smallImg").filter(item => {
+                      return !!this.productList_wb.filter(v => v.smallId == item.value).find(v2 => v2.brandId == row.brandId && v2.mainId == row.mainId)
+                    }).map((item, index_) => <el-option key={index_} label={item.label} value={item.value}></el-option>)
+                  }
+                </el-select>
+              </el-form-item>
+            </div> : <div style="padding-left:10px">{row.smallName}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '产品机型',
+            prop: 'productName'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? <div class="redbordererr">
+              <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`}>
+                <el-input
+                  disabled={!this.formOptions.orderProducts.isEdit}
+                  value={row[column.columnAttributes.prop]}
+                  onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                  placeholder="请输入内容"
+                >
+                </el-input>
+              </el-form-item>
+            </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '内机条码',
+            prop: 'insideCode'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? <div class="redbordererr">
+              <el-form-item label="" label-width="0px">
+                <el-input
+                  disabled={!this.formOptions.orderProducts.isEdit}
+                  value={row[column.columnAttributes.prop]}
+                  onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                  placeholder="请输入内容"
+                >
+                </el-input>
+              </el-form-item>
+            </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '数量',
+            prop: 'num'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? <div class="redbordererr">
+              <el-form-item label="" label-width="0px" prop={`orderProducts.${index}.${column.columnAttributes.prop}`} rules={required}>
+                <el-input
+                  disabled={!this.formOptions.orderProducts.isEdit}
+                  value={row[column.columnAttributes.prop]}
+                  onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                  placeholder="请输入内容"
+                >
+                </el-input>
+              </el-form-item>
+            </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '备注',
+            prop: 'remark'
+          },
+          render: (h, { row, column, index }) => {
+            return this.isEditIndex == index ? <div class="redbordererr">
+              <el-form-item label="" label-width="0px">
+                <el-input
+                  disabled={!this.formOptions.orderProducts.isEdit}
+                  value={row[column.columnAttributes.prop]}
+                  onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                  placeholder="请输入内容"
+                >
+                </el-input>
+              </el-form-item>
+            </div> : <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+          }
+        },
+        ...(() => {
+          if (this.formOptions.orderProducts.isEdit) {
+            return [
+              {
+                columnAttributes: {
+                  label: '操作',
+                },
+                render: (h, { row, column, index }) => {
+                  return <div style="padding-left:10px">
+                    <el-button type="text" onClick={() => {
+                      this.delProduct_wb(row, index)
+                    }}>删除</el-button>
+                    {this.isEditIndex == index && <el-button type="text" onClick={() => {
+                      this.eidtProduct_wb(row, index)
+                    }}>确定</el-button>}
+                    {this.isEditIndex == -1 && <el-button type="text" onClick={() => {
+                      this.isEditIndex = index
+                    }}>编辑</el-button>}
+                  </div>
+                }
+              },
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    product_wb() {
+      return [{
+        isShow: this.formOptions.orderProducts.isShow,
+        name: 'slot-component',
+        md: 24,
+        formItemAttributes: {
+          label: '',
+          'label-width': '0px',
+          prop: 'orderProducts',
+          errLabel: '产品信息',
+          rules: this.formOptions.orderProducts.isRules
+        },
+        render: (h, { props }) => {
+          return (
+            <div>
+              {this.formOptions.orderProducts.isEdit ? <div>
+                <el-button size="mini" type="primary" onClick={() => {
+                  this.appointVerify(this.getVfyKey_wb(this.isEditIndex, false), (v) => {
+                    if (v) {
+                      try {
+                        this.orderInfo.orderProducts.map((item, index_) => {
+                          var row = this.orderInfo.orderProducts[index_ + 1]
+                          if (row) {
+                            if (
+                              `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` == `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}`
+                            ) {
+                              throw new Error('');
+                            }
+                          }
+                        })
+                      } catch (error) {
+                        this.$message.warning('产品机型重复')
+                        return
+                      }
+                      this.isEditIndex = 0
+                      this.orderInfo.orderProducts.unshift({
+                        "brandId": "",
+                        "brandName": "",
+                        "createBy": "",
+                        "createTime": "",
+                        "mainId": "",
+                        "mainName": "",
+                        "num": "",
+                        "insideCode": "",
+                        "orderBaseId": this.id || '',
+                        "productId": "",
+                        "productName": "",
+                        "remark": "",
+                        "smallId": "",
+                        "smallName": "",
+                        "imgUrl": ""
+                      })
+                    }
+                  })
+                }}>新增</el-button>
+              </div> : null}
+              <zj-table
+                columns={this.productColumns_wb}
+                table-data={this.orderInfo.orderProducts}
+              />
+            </div>
+          )
+        }
+      }]
+    },
+  },
+  methods: {
+    huoquweiyi(value, label, ...keys) {
+      var obj = {}
+      this.productList_wb.map(item => {
+        obj[item[value]] = {
+          label: item[label]
+        }
+        for (var key of keys) {
+          obj[item[value]][key] = item[key]
+        }
+      })
+      return Object.keys(obj).map(value => {
+        return {
+          value: value,
+          ...obj[value]
+        }
+      })
+    },
+    getVfyKey_wb(index, bool = true) {
+      return [
+        ...(() => {
+          if (bool) {
+            return [
+              `orderProducts`,
+            ]
+          }
+          return []
+        })(),
+        ...(() => {
+          if (index > -1) {
+            return [
+              `orderProducts.${index}.brandId`,
+              `orderProducts.${index}.mainId`,
+              `orderProducts.${index}.smallId`,
+              `orderProducts.${index}.productName`,
+              `orderProducts.${index}.num`,
+              `orderProducts.${index}.remark`,
+            ]
+          }
+          return []
+        })()
+      ]
+    },
+    // 重新获取赋值
+    getOrderBaseProduct_wb() {
+      if (this.id) {
+        orderBaseProductList({
+          orderBaseId: this.id
+        }).then((res) => {
+          this.orderInfo.orderProducts = res.data || []
+        })
+      }
+    },
+    eidtProduct_wb(row, index) {
+      try {
+        this.orderInfo.orderProducts.map((item, index_) => {
+          if (
+            `${row.brandId}_${row.mainId}_${row.smallId}_${row.productName}` == `${item.brandId}_${item.mainId}_${item.smallId}_${item.productName}` &&
+            index_ != index
+          ) {
+            throw new Error('');
+          }
+        })
+      } catch (error) {
+        this.$message.warning('产品机型重复')
+        return
+      }
+      this.appointVerify(this.getVfyKey_wb(this.isEditIndex), (v) => {
+        if (v) {
+          if (this.id) {
+            [orderBaseProductAdd, orderBaseProductUpdate][row.id ? 1 : 0](row).then(res => {
+              this.isEditIndex = -1
+              this.getOrderBaseProduct_wb()
+              this.getOrderBaseLogList()
+            })
+          } else {
+            this.isEditIndex = -1
+          }
+        }
+      })
+    },
+    delProduct_wb(row, index) {
+      this.appointVerify(this.getVfyKey_wb(this.isEditIndex), (v) => {
+        if (v && this.id && row.id) {
+          orderBaseProductDelete({
+            orderProductId: row.id
+          }).then(res => {
+            this.getOrderBaseProduct_wb()
+            this.getOrderBaseLogList()
+          })
+        } else {
+          this.orderInfo.orderProducts.splice(index, 1)
+        }
+      })
+    }
+  },
+}

+ 32 - 13
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -2,6 +2,8 @@ import { required, mobileRequired, mobile, httpUrl, email } from '@/components/t
 import { orderBaseDetail, orderBaseProductList } from "@/api/workOrderPool.js"
 var initdata_ = {
   // 基础信息--------------------
+  // 维保项目
+  rpProjectRepairId: "",
   // 客户名称
   userName: "",
   // 联系人
@@ -51,7 +53,11 @@ export default {
     id: {
       type: [String, Number],
       default: null,
-    }
+    },
+    workOrderType: {
+      type: Number,
+      default: 0, // 0普通工单, 1维保工单
+    },
   },
   data() {
     return {
@@ -62,12 +68,19 @@ export default {
     id: {
       handler(newVal, oldVal) {
         this.getorderDetail((data) => {
-          this.$nextTick(() => {
-            // 获取地址信息
-            this.getinitlbslist()
-            // 获取可选师傅
-            this.getWorkers()
-          })
+          if (this.workOrderType == 0) {
+            this.$nextTick(() => {
+              // 获取地址信息
+              this.getinitlbslist()
+              // 获取可选师傅
+              this.getWorkers()
+            })
+          } else if (this.workOrderType == 1) {
+            this.$nextTick(() => {
+              // 获取维保单详情
+              this.getWeiBaoDetail()
+            })
+          }
         })
         this.getOrderBaseLogList()
       },
@@ -133,21 +146,27 @@ export default {
       var finish = !!~['YWG', 'YJS', 'YQX'].indexOf(this.orderInfo.orderStatus)
       return {
         // 基础信息--------------------
+        // 维保项目
+        rpProjectRepairId: {
+          isEdit: this.id ? false : true,
+          isShow: this.workOrderType == 1,
+          isRules: [...required]
+        },
         // 客户名称
         userName: {
-          isEdit: !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 联系人
         linkName: {
-          isEdit: !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 客户电话
         userMobile: {
-          isEdit: !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...mobileRequired]
         },
@@ -159,13 +178,13 @@ export default {
         },
         // gps地址
         gpsAddress: {
-          isEdit: !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 详细地址
         address: {
-          isEdit: !finish,
+          isEdit: this.workOrderType == 0 && !finish,
           isShow: true,
           isRules: []
         },
@@ -177,7 +196,7 @@ export default {
           isRules: [...required]
         },
         orderChannelId: {
-          isEdit: this.id ? false : true,
+          isEdit: this.id || this.workOrderType == 1 ? false : true,
           isShow: true,
           isRules: [...required]
         },

+ 41 - 9
src/views/workOrder/workOrderPool/index.vue

@@ -7,14 +7,14 @@
     <!-- 创建工单 -->
     <div class="cartographer_big">
       <el-dialog title="创建工单" width="100%" :modal="false" :visible.sync="createFormBool" :before-close="handleClose">
-        <workOrderInfo v-if="createFormBool" />
+        <workOrderInfo :workOrderType="workOrderType" v-if="createFormBool" />
       </el-dialog>
     </div>
     <!-- 工单详情 -->
     <div class="cartographer_big">
       <el-dialog :title="'工单详情-' + id" width="100%" :modal="false" :visible.sync="detailFormBool"
         :before-close="handleClose">
-        <Detail v-if="detailFormBool" :id="id" />
+        <Detail v-if="detailFormBool" :id="id" :workOrderType="workOrderType" />
       </el-dialog>
     </div>
     <!-- 批量预约/改约 -->
@@ -81,6 +81,7 @@ export default {
       orderTypeList: [],
       orderStatusList: [],
       defaultSearchData: [],
+      workOrderType: 0
     }
   },
   computed: {
@@ -115,8 +116,19 @@ export default {
       return [
         [
           [
+            this.optionsEvensAuth(["createWorkOrder", "createWbWorkOrder"], {
+              name: "创建工单",
+              click: () => { }
+            }),
             this.optionsEvensAuth("createWorkOrder", {
               click: () => {
+                this.workOrderType = 0
+                this.createFormBool = true
+              }
+            }),
+            this.optionsEvensAuth("createWbWorkOrder", {
+              click: () => {
+                this.workOrderType = 1
                 this.createFormBool = true
               }
             })
@@ -209,7 +221,7 @@ export default {
           this.detailFormBool = false
           this.recordSelected = []
           this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.sale_order_id", "compare": "like", "value": this.$route.query.saleOrderId, label: "销售订单号" }]
+            this.defaultSearchData = [{ "param": "a.sale_order_id", "compare": "=", "value": this.$route.query.saleOrderId, label: "销售订单号" }]
             this.$nextTick(() => {
               // this.defaultSearchData = []
               this.$router.push({ name: "workOrderPool", params: {}, query: {} })
@@ -221,7 +233,19 @@ export default {
           this.detailFormBool = false
           this.recordSelected = []
           this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.pg_incre_order_id", "compare": "like", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" }]
+            this.defaultSearchData = [{ "param": "a.pg_incre_order_id", "compare": "=", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" }]
+            this.$nextTick(() => {
+              // this.defaultSearchData = []
+              this.$router.push({ name: "workOrderPool", params: {}, query: {} })
+            })
+          })
+        }
+        if (this.$route.query.rpProjectRepairId) {
+          this.createFormBool = false
+          this.detailFormBool = false
+          this.recordSelected = []
+          this.$nextTick(() => {
+            this.defaultSearchData = [{ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId, label: "维保配置ID" }]
             this.$nextTick(() => {
               // this.defaultSearchData = []
               this.$router.push({ name: "workOrderPool", params: {}, query: {} })
@@ -230,11 +254,11 @@ export default {
         }
       }
     },
-    
+
     selectable(row, index) {
-      return !["YWG", "YJS", "YQX"].includes(Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0])
+      return !["YWG", "YJS", "YQX"].includes(Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0]) && !row.rpProjectRepairId
     },
-    
+
     screeningAnalysis(jname, val) {
       if (jname == 'orderFlags') {
         return (val || []).map(item => item.tagName).join(',')
@@ -242,14 +266,14 @@ export default {
         return val
       }
     },
-    
+
     filterMethod(value, row, column) {
       if (column['property'] == 'orderFlags') {
         return (row[column['property']] || []).map(item => item.tagName).join(',') === value
       }
       return row[column['property']] === value
     },
-    
+
     // 获取统计
     getOrderBaseStatusCount(...p) {
       orderBaseStatusCount(...p).then(res => {
@@ -306,6 +330,9 @@ export default {
         if (this.$route.query.pgIncreItemId && !pam.params.find(item => item.param == "a.pg_incre_order_id")) {
           pam.params.push({ "param": "a.pg_incre_order_id", "compare": "like", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" })
         }
+        if (this.$route.query.rpProjectRepairId  && !pam.params.find(item => item.param == "a.rp_project_repair_id")) {
+          pam.params.push({ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
+        }
         cb && cb(pam)
         return orderBaseList(pam)
       } catch (err) {
@@ -368,6 +395,11 @@ export default {
         edit: {
           click: ({ row, index, column }) => {
             this.id = row.id
+            if (row.rpProjectRepairId) {
+              this.workOrderType = 1
+            } else {
+              this.workOrderType = 0
+            }
             this.$nextTick(() => {
               this.detailFormBool = true
             })