浏览代码

Merge remote-tracking branch 'origin/lin_yb' into feature/权限配置

pengyh 1 年之前
父节点
当前提交
1c58512809
共有 62 个文件被更改,包括 6861 次插入4885 次删除
  1. 7 7
      package-lock.json
  2. 1 1
      package.json
  3. 115 0
      src/api/applicationWithoutFee.js
  4. 16 0
      src/api/workOrderPool.js
  5. 2 2
      src/components/template/operation_mixin.js
  6. 14 19
      src/components/template/template-page-1.vue
  7. 18 2
      src/permission.js
  8. 642 639
      src/views/auxiliaryFittings/attachmentProfile/index.vue
  9. 88 88
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryChargeManagement/index.vue
  10. 6 4
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryMaterialClass/index.vue
  11. 83 84
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryPriceManagement/index.vue
  12. 31 33
      src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventory/index.vue
  13. 0 6
      src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventoryDetails/index.vue
  14. 0 6
      src/views/auxiliaryFittings/inventoryManagement/masterAuInvenDetails/index.vue
  15. 31 33
      src/views/auxiliaryFittings/inventoryManagement/masterAuxiliaryInven/index.vue
  16. 0 6
      src/views/auxiliaryFittings/inventoryManagement/masterPaInvenDetails/index.vue
  17. 31 33
      src/views/auxiliaryFittings/inventoryManagement/masterPartsInven/index.vue
  18. 31 33
      src/views/auxiliaryFittings/inventoryManagement/partsInventory/index.vue
  19. 0 6
      src/views/auxiliaryFittings/inventoryManagement/partsInventoryDetails/index.vue
  20. 27 15
      src/views/auxiliaryFittings/purchasingManagement/components/inStorage.vue
  21. 27 15
      src/views/auxiliaryFittings/purchasingManagement/components/retStorage.vue
  22. 49 47
      src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js
  23. 152 131
      src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue
  24. 152 131
      src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue
  25. 258 234
      src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue
  26. 133 121
      src/views/auxiliaryFittings/salesManagement/auxiliaryAdjustPriceOrder/index.vue
  27. 256 233
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue
  28. 139 131
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue
  29. 55 46
      src/views/auxiliaryFittings/salesManagement/transaction/index.vue
  30. 191 179
      src/views/auxiliaryFittings/settleAccountManagement/salesWithdraw/index.vue
  31. 314 294
      src/views/auxiliaryFittings/settleAccountManagement/settleAccountWeixinPay/index.vue
  32. 139 134
      src/views/auxiliaryFittings/supplier/index.vue
  33. 114 0
      src/views/engineeringMaintenance/allInclusiveExpense/index.vue
  34. 195 0
      src/views/engineeringMaintenance/applicationWithoutFee/index.vue
  35. 59 0
      src/views/engineeringMaintenance/feeSettlementIncluded/index.vue
  36. 77 0
      src/views/engineeringMaintenance/feeSettlementIncluded/pages/collect.vue
  37. 170 0
      src/views/engineeringMaintenance/feeSettlementIncluded/pages/offline.vue
  38. 104 0
      src/views/engineeringMaintenance/feeSettlementIncludedwx/index.vue
  39. 271 0
      src/views/engineeringMaintenance/mixins/feel.js
  40. 62 69
      src/views/mallManagement/goods/goods_add/index.vue
  41. 5 2
      src/views/mallManagement/goods/goods_index/index.vue
  42. 18 4
      src/views/setting/role/index.vue
  43. 107 111
      src/views/workOrder/appraise/index.vue
  44. 87 87
      src/views/workOrder/basicConfiguration/assessmentItemAllocation/index.vue
  45. 82 83
      src/views/workOrder/basicConfiguration/orderType/index.vue
  46. 334 316
      src/views/workOrder/basicConfiguration/settlementStandard/components/install.vue
  47. 252 234
      src/views/workOrder/basicConfiguration/settlementStandard/components/other.vue
  48. 360 342
      src/views/workOrder/basicConfiguration/settlementStandard/components/repair.vue
  49. 25 22
      src/views/workOrder/basicConfiguration/settlementStandard/index.vue
  50. 372 369
      src/views/workOrder/settleAccountsManagement/rewardsPunishmentsOrder/index.vue
  51. 199 196
      src/views/workOrder/settleAccountsManagement/settleAccountsOrder/index.vue
  52. 219 207
      src/views/workOrder/settleAccountsManagement/summaryBill/index.vue
  53. 6 2
      src/views/workOrder/workOrderPool/detail.vue
  54. 96 39
      src/views/workOrder/workOrderPool/detailModule/Payment/index.vue
  55. 5 2
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue
  56. 117 1
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/basicInfo.js
  57. 9 6
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/pandanxinxi.js
  58. 2 1
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/productColumns.js
  59. 63 55
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/serviceInfo.js
  60. 377 0
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/wb_productColumns.js
  61. 32 13
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js
  62. 34 11
      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=="
         }
       }

+ 1 - 1
package.json

@@ -18,7 +18,7 @@
     "@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-plugins": "^2.13.9",
     "@zjlib/element-ui2": "^1.0.3",
     "axios": "0.18.1",
     "chatgpt": "^4.1.2",

+ 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
+  })
+}
+

+ 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`,

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

@@ -61,7 +61,7 @@ export default {
                           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("exp", {
-          //   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>

+ 256 - 233
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,56 +224,56 @@ 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: center;align-items: center;position: relative;">
 				<h1 style="text-align:center;margin: 10px 0;">${data.websitName}销售单</h1>
@@ -264,7 +286,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;font-size: 16px;margin-bottom: 10px;">
 		  	<div>联系电话: ${data.workerMobile}</div>
@@ -316,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>

+ 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
+								this.workerAmount += item.workerAmount
+								this.websitAmount += item.websitAmount
+							})
+							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>

+ 314 - 294
src/views/auxiliaryFittings/settleAccountManagement/settleAccountWeixinPay/index.vue

@@ -1,24 +1,26 @@
 <template>
-	<template-page 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="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 = {}">
+	<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>
@@ -26,81 +28,83 @@
 				<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>{{ formData.companyWechatName }}</td>
 						<td class="bold" align="center">关联工单号</td>
-						<td>{{formData.workerOrderId}}</td>
+						<td>{{ formData.workerOrderId }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">结算单号</td>
-						<td>{{formData.settlementOrderId}}</td>
+						<td>{{ formData.settlementOrderId }}</td>
 						<td class="bold" align="center">工单品牌</td>
-						<td>{{formData.brand}}</td>
+						<td>{{ formData.brand }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">客户姓名</td>
-						<td>{{formData.userName}}</td>
+						<td>{{ formData.userName }}</td>
 						<td class="bold" align="center">客户电话</td>
-						<td>{{formData.userMobile}}</td>
+						<td>{{ formData.userMobile }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">师傅姓名</td>
-						<td>{{formData.workerName}}</td>
+						<td>{{ formData.workerName }}</td>
 						<td class="bold" align="center">师傅身份证号</td>
-						<td>{{formData.identity}}</td>
+						<td>{{ formData.identity }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">师傅联系电话</td>
-						<td>{{formData.workerMobile}}</td>
+						<td>{{ formData.workerMobile }}</td>
 						<td class="bold" align="center">订单金额</td>
-						<td>{{formData.totalAmount}}</td>
+						<td>{{ formData.totalAmount }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">销售类型</td>
-						<td>{{formData.settlementType == 'OWN'?'自由':formData.settlementType == 'OUT'?'外购':''}}</td>
+						<td>{{ formData.settlementType == 'OWN' ? '自由' : formData.settlementType == 'OUT' ? '外购' : '' }}</td>
 						<td class="bold" align="center">创建人</td>
-						<td>{{formData.createBy}}</td>
+						<td>{{ formData.createBy }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">创建时间</td>
-						<td>{{formData.createTime}}</td>
+						<td>{{ formData.createTime }}</td>
 						<td class="bold" align="center">支付状态</td>
-						<td>{{formData.payStatus == 'CANCEL'?'取消':formData.payStatus == 'PAID'?'已支付':formData.payStatus == 'WAIT'?'待支付':''}}</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>{{ formData.orderId }}</td>
 						<td class="bold" align="center">支付时间</td>
-						<td>{{formData.payTime}}</td>
+						<td>{{ formData.payTime }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">分账单号</td>
-						<td>{{formData.settlementOrderId}}</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>
+						<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>{{ formData.amount }}</td>
 						<td class="bold" align="center">分账时间</td>
-						<td>{{formData.settlementTime}}</td>
+						<td>{{ formData.settlementTime }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">师傅分账金额</td>
-						<td>{{formData.workerAmount}}</td>
+						<td>{{ formData.workerAmount }}</td>
 						<td class="bold" align="center">师傅分账金额手续费</td>
-						<td>{{formData.workerProceAmount}}</td>
+						<td>{{ formData.workerProceAmount }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">商户分账金额</td>
-						<td>{{formData.websitAmount}}</td>
+						<td>{{ formData.websitAmount }}</td>
 						<td class="bold" align="center">商户分账金额手续费</td>
-						<td>{{formData.websitProceAmount}}</td>
+						<td>{{ formData.websitProceAmount }}</td>
 					</tr>
 					<tr>
 						<td class="bold" align="center">操作人</td>
-						<td>{{formData.updateBy}}</td>
+						<td>{{ formData.updateBy }}</td>
 						<td class="bold" align="center">操作时间</td>
-						<td>{{formData.updateTime}}</td>
+						<td>{{ formData.updateTime }}</td>
 					</tr>
 				</table>
 			</el-card>
@@ -123,35 +127,42 @@
 						</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 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>
+							<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>
+			<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>
@@ -163,249 +174,258 @@ 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";
+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: ''
-    }
-  },
-  computed: {
-	  // 事件组合
-	  optionsEvensGroup() {
-	  	return [
-	  		[
-	  			[
-	  				this.optionsEvensAuth("bulkSettlement", {
-						isRole: this.tabIndex== 2,
-	  					click: () => {
-	  						this.batchSettleAccounts()
-	  					}
-	  				})
-	  			],
-	  		],
-			[
+	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(() => {
+				this.tabIndexShow = true
+			})
+		}
+	},
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
 				[
-					this.optionsEvensAuth("bulkWithdrawal", {
-						isRole: this.tabIndex== 2,
-						click: () => {
-							this.batchWithdraw()
-						}
-					})
+					[
+						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 })
+		},
+		// 更多参数
+		moreParameters() {
+			return []
 		}
-	    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?'查看明细':'详情'
+	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()
+							})
+						}
+					}
 				},
-				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);
+							}
 						})
 					}
-				}
-			},
-			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
+				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)
+						}
+					}
 				},
-				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)
 					}
-				}
-			},
-			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);
-				}
 			})
-		});
-	},
-  }
+		},
+		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>
+.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>

+ 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 []
+      })()]
+    }
+  }
+}

+ 62 - 69
src/views/mallManagement/goods/goods_add/index.vue

@@ -13,32 +13,24 @@
     <div class="form-container" v-show="step == 0">
       <div class="title">基础信息</div>
       <el-form ref="step1Form" :model="step1Form" :rules="step1FormRules" label-width="120px">
-		<el-form-item label="品牌:" prop="brand">
-			<el-select v-model="step1Form.brand" value-key="id" placeholder="请选择">
-			    <el-option
-			      v-for="item in brandList"
-			      :key="item.id"
-			      :label="item.brandName"
-			      :value="item">
-			    </el-option>
-			</el-select>
-		</el-form-item>
-		<el-form-item label="工单类型:" prop="orderSmallType">
-			<el-select v-model="step1Form.orderSmallType" placeholder="请选择">
-			    <el-option
-			      v-for="item in orderTypeList"
-			      :key="item.id"
-			      :label="item.orderSmallTypeText"
-			      :value="item.id">
-			    </el-option>
-			</el-select>
-		</el-form-item>
-		<el-form-item label="是否虚拟商品:" prop="isVr">
-			 <el-radio-group v-model="step1Form.isVr">
-			    <el-radio :label="true">是</el-radio>
-			    <el-radio :label="false">否</el-radio>
-			  </el-radio-group>
-		</el-form-item>
+        <el-form-item label="品牌:" prop="brand">
+          <el-select v-model="step1Form.brand" value-key="id" placeholder="请选择">
+            <el-option v-for="item in brandList" :key="item.id" :label="item.brandName" :value="item">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="工单类型:" prop="orderSmallType">
+          <el-select v-model="step1Form.orderSmallType" placeholder="请选择">
+            <el-option v-for="item in orderTypeList" :key="item.id" :label="item.orderSmallTypeText" :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="是否虚拟商品:" prop="isVr">
+          <el-radio-group v-model="step1Form.isVr">
+            <el-radio :label="true">是</el-radio>
+            <el-radio :label="false">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
         <el-form-item label="商品名称:" prop="goodsName">
           <el-input v-model="step1Form.goodsName" placeholder="请输入商品名称" maxlength="200" show-word-limit></el-input>
         </el-form-item>
@@ -57,10 +49,10 @@
           </div>
         </el-form-item>
         <el-form-item label="轮播图:" prop="images">
-          <el-upload v-if="showImageListUpload2" multiple :limit="6" ref="imageListUpload2" class="avatar-uploader2 imageListUpload2"
-            style="height: 0;" :action="baseURL + 'common/upload'" :headers="myHeaders" name="file"
-            :show-file-list="false" :on-success="uploadSuccess2" :on-exceed="uploadExceed2"
-            :before-upload="beforeUpload2">
+          <el-upload v-if="showImageListUpload2" multiple :limit="6" ref="imageListUpload2"
+            class="avatar-uploader2 imageListUpload2" style="height: 0;" :action="baseURL + 'common/upload'"
+            :headers="myHeaders" name="file" :show-file-list="false" :on-success="uploadSuccess2"
+            :on-exceed="uploadExceed2" :before-upload="beforeUpload2">
           </el-upload>
           <div class="images">
             <div class="item" v-for="(item, index) in step1Form.images" :key="index">
@@ -411,7 +403,7 @@ import { quillEditor } from 'vue-quill-editor'
 import 'quill/dist/quill.core.css'
 import 'quill/dist/quill.snow.css'
 import 'quill/dist/quill.bubble.css'
-
+import { EventBus } from '@/utils/eventBus'
 // 工具栏配置
 const toolbarOptions = [
   ['bold', 'italic', 'underline', 'strike'],
@@ -452,9 +444,9 @@ export default {
         marketing: '',
         attrs: [],
         tags: [],
-		isVr: false,
-		orderSmallType: '',
-		brand: {},
+        isVr: false,
+        orderSmallType: '',
+        brand: {},
         // logoUrl: '',
         // showDate: [],
       },
@@ -471,23 +463,23 @@ export default {
         classify: [
           { required: true, message: '请选择商品分类', trigger: 'change' }
         ],
-		brand: [
+        brand: [
           { required: true, message: '请选择品牌', trigger: 'change' }
         ],
-		orderSmallType: [
-		  { required: true, message: '请选择工单类型', trigger: 'change' }
-		],
-		isVr: [
-		  { required: true, message: '请选择是否虚拟商品', trigger: 'change' }
-		]
+        orderSmallType: [
+          { required: true, message: '请选择工单类型', trigger: 'change' }
+        ],
+        isVr: [
+          { required: true, message: '请选择是否虚拟商品', trigger: 'change' }
+        ]
       },
       imagesList: [], // 图片墙展示列表
 
       classifyList: [],
       freightList: [],
       moduleList: [],
-			orderTypeList: [],
-			brandList: [],
+      orderTypeList: [],
+      brandList: [],
 
       step2Form: {
         specType: true,
@@ -612,8 +604,8 @@ export default {
 
     this.getFreightList();
     this.getModuleList();
-	this.getTypeList()
-	this.getBrand()
+    this.getTypeList()
+    this.getBrand()
 
     if (this.isEdit) {
       this.canCompute = false;
@@ -640,18 +632,18 @@ export default {
         })
       })
     },
-		
-		getTypeList(){
-			getTypeList({pageNum: 1,pageSize: -1,params: [{param: 'a.order_type',compare: '=',value: 'INSTALL'},{param: 'a.status',compare: '=',value: true}]}).then(res => {
-				this.orderTypeList = res.data.records
-			})
-		},
-	getBrand(){
-		getBrand().then(res => {
-			this.brandList = res.data
-		})
-	},
-		
+
+    getTypeList() {
+      getTypeList({ pageNum: 1, pageSize: -1, params: [{ param: 'a.order_type', compare: '=', value: 'INSTALL' }, { param: 'a.status', compare: '=', value: true }] }).then(res => {
+        this.orderTypeList = res.data.records
+      })
+    },
+    getBrand() {
+      getBrand().then(res => {
+        this.brandList = res.data
+      })
+    },
+
     // getMarketingList() {
     //   let classifyList = this.classifyList;
     //   let categoryId = '';
@@ -733,9 +725,9 @@ export default {
           marketing: data.marketingId,
           attrs: data.tags,
           tags: data.tagsLabel,
-		  brand: {id: data.brandId,brandName: data.brandName},
-		  isVr: data.isVr,
-		  orderSmallType: data.orderSmallType
+          brand: { id: data.brandId, brandName: data.brandName },
+          isVr: data.isVr,
+          orderSmallType: data.orderSmallType
           // logoUrl: data.logo,
           // showDate: data.logoStartTime ? [data.logoStartTime.slice(0, 10), data.logoEndTime.slice(0, 10)] : [],
         }
@@ -1018,11 +1010,11 @@ export default {
 
         templateId: this.step3Form.moduleId,
         content: this.step3Form.detailContent,
-		
-		isVr: this.step1Form.isVr,
-		orderSmallType: this.step1Form.orderSmallType,
-		brandId: this.step1Form.brand.id,
-		brandName: this.step1Form.brand.brandName,
+
+        isVr: this.step1Form.isVr,
+        orderSmallType: this.step1Form.orderSmallType,
+        brandId: this.step1Form.brand.id,
+        brandName: this.step1Form.brand.brandName,
       }
       console.log(params);
 
@@ -1054,6 +1046,7 @@ export default {
 
     goBack() {
       this.$router.go(-1);
+      EventBus.$emit("updateGoodsListPage")
       // this.$store.dispatch("tagsView/delView", this.$route);
     },
 
@@ -1182,15 +1175,15 @@ export default {
 
     // 轮播图 - 点击上传图片
     uploadImage(id) {
-      if(this.step1Form.images.length>=6){
+      if (this.step1Form.images.length >= 6) {
         this.$errorMsg('最多上传6张轮播图');
-        return 
+        return
       }
 
       this.showImageListUpload2 = false
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.showImageListUpload2 = true
-        this.$nextTick(()=>{
+        this.$nextTick(() => {
           this.uploadImageId = id;
           document.querySelector('.imageListUpload2 input').click();
         })

+ 5 - 2
src/views/mallManagement/goods/goods_index/index.vue

@@ -289,7 +289,7 @@
 <script>
 import { getGoodsList, deleteGoods, getClassifyList, getGoodsStateCount, cloneGoods, editGoods, goodsPutOn, goodsPutOff, checkSeckill, getGoodsDetail, getModuleList, setCommomModule, setFreight, getFreightList } from '@/api/goods'
 import Clipboard from 'clipboard'
-
+import { EventBus } from '@/utils/eventBus'
 export default {
   data() {
     return {
@@ -354,8 +354,11 @@ export default {
   },
   created() {
     this.getList();
-
+    
     this.getClassifyList();
+    EventBus.$on("updateGoodsListPage",()=>{
+      this.getList();
+    })
   },
   methods: {
 

+ 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);

+ 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>

+ 82 - 83
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="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-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,
@@ -66,6 +56,18 @@ export default {
     }
   },
   computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth("add", {
+              click: this.addData
+            })
+          ]
+        ]
+      ]
+    },
     // 更多参数
     moreParameters() {
       return []
@@ -85,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: '所属业务线',
@@ -102,11 +104,11 @@ export default {
           prop: 'orderSmallTypeText',
           rules: [...required]
         }
-      },{
+      }, {
         md: 24,
         isShow: true,
         name: 'slot-component',
-        attributes: { },
+        attributes: {},
         formItemAttributes: {
           label: '状态',
           prop: 'status',
@@ -173,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()
@@ -244,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()
@@ -259,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]
         },

+ 34 - 11
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,17 +116,19 @@ export default {
       return [
         [
           [
-          this.optionsEvensAuth(["createWorkOrder", "createWbWorkOrder"], {
-              name: '创建工单',
+            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
               }
             })
@@ -218,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: {} })
@@ -230,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: {} })
@@ -239,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(',')
@@ -251,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 => {
@@ -315,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) {
@@ -377,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
             })