浏览代码

Merge branch 'Additional_authority' of ssh://gogs.zfire.top:2222/zfire-front/zfire-newmall-admin into develop

linwenxin 1 年之前
父节点
当前提交
828c37ae6a
共有 39 个文件被更改,包括 4890 次插入4657 次删除
  1. 2 2
      src/components/template/operation_mixin.js
  2. 14 19
      src/components/template/template-page-1.vue
  3. 18 2
      src/permission.js
  4. 642 639
      src/views/auxiliaryFittings/attachmentProfile/index.vue
  5. 88 88
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryChargeManagement/index.vue
  6. 6 4
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryMaterialClass/index.vue
  7. 83 84
      src/views/auxiliaryFittings/auxiliaryDataManagement/auxiliaryPriceManagement/index.vue
  8. 31 33
      src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventory/index.vue
  9. 0 6
      src/views/auxiliaryFittings/inventoryManagement/auxiliaryInventoryDetails/index.vue
  10. 0 6
      src/views/auxiliaryFittings/inventoryManagement/masterAuInvenDetails/index.vue
  11. 31 33
      src/views/auxiliaryFittings/inventoryManagement/masterAuxiliaryInven/index.vue
  12. 0 6
      src/views/auxiliaryFittings/inventoryManagement/masterPaInvenDetails/index.vue
  13. 31 33
      src/views/auxiliaryFittings/inventoryManagement/masterPartsInven/index.vue
  14. 31 33
      src/views/auxiliaryFittings/inventoryManagement/partsInventory/index.vue
  15. 0 6
      src/views/auxiliaryFittings/inventoryManagement/partsInventoryDetails/index.vue
  16. 27 15
      src/views/auxiliaryFittings/purchasingManagement/components/inStorage.vue
  17. 27 15
      src/views/auxiliaryFittings/purchasingManagement/components/retStorage.vue
  18. 49 47
      src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js
  19. 152 131
      src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue
  20. 152 131
      src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue
  21. 258 234
      src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue
  22. 133 121
      src/views/auxiliaryFittings/salesManagement/auxiliaryAdjustPriceOrder/index.vue
  23. 257 234
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue
  24. 139 131
      src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue
  25. 55 46
      src/views/auxiliaryFittings/salesManagement/transaction/index.vue
  26. 191 179
      src/views/auxiliaryFittings/settleAccountManagement/salesWithdraw/index.vue
  27. 259 240
      src/views/auxiliaryFittings/settleAccountManagement/settleAccount/index.vue
  28. 139 134
      src/views/auxiliaryFittings/supplier/index.vue
  29. 107 111
      src/views/workOrder/appraise/index.vue
  30. 87 87
      src/views/workOrder/basicConfiguration/assessmentItemAllocation/index.vue
  31. 115 116
      src/views/workOrder/basicConfiguration/orderType/index.vue
  32. 334 316
      src/views/workOrder/basicConfiguration/settlementStandard/components/install.vue
  33. 252 234
      src/views/workOrder/basicConfiguration/settlementStandard/components/other.vue
  34. 360 342
      src/views/workOrder/basicConfiguration/settlementStandard/components/repair.vue
  35. 25 22
      src/views/workOrder/basicConfiguration/settlementStandard/index.vue
  36. 372 369
      src/views/workOrder/settleAccountsManagement/rewardsPunishmentsOrder/index.vue
  37. 199 196
      src/views/workOrder/settleAccountsManagement/settleAccountsOrder/index.vue
  38. 219 207
      src/views/workOrder/settleAccountsManagement/summaryBill/index.vue
  39. 5 5
      src/views/workOrder/workOrderPool/index.vue

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

+ 257 - 234
src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue

@@ -1,25 +1,25 @@
 <template>
 	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="140"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="flag" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-				<el-radio-button label="SAVE">保存</el-radio-button>
-				<el-radio-button label="SUBMIT">提交</el-radio-button>
-		    	<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
-		    	<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
-		    	<el-radio-button label="CANCEL">取消订单</el-radio-button>
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :operationColumnWidth="140" :options-evens-group="optionsEvensGroup"
+			:moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="flag" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">保存</el-radio-button>
+					<el-radio-button label="SUBMIT">提交</el-radio-button>
+					<el-radio-button label="PAY_NOT_TAKE">已支付未提货</el-radio-button>
+					<el-radio-button label="PAY_TAKE">已支付已提货</el-radio-button>
+					<el-radio-button label="CANCEL">取消订单</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliarySalesOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
+			<auxiliarySalesOrderDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
 		</div>
-		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList"  />
+		<print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
 	</div>
 </template>
 
@@ -30,167 +30,189 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 import { getWebsit } from "@/api/customerManagement";
 import printPreview from '../components/preview.vue'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
-
+import operation_mixin from '@/components/template/operation_mixin.js'
 disAutoConnect()
 export default {
-  components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail, printPreview },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-		id: '',
-		flag: '',
-		websitList:[]
-	}
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {},
-	filterArr(){
-		return function (arr, size) {
-		  //判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
-		  if (!arr.length || !size || size < 1) return []
-		  let [start, end, result] = [null, null, []]
-		  for (let i = 0; i < Math.ceil(arr.length / size); i++) {
-		    start = i * size
-		    end = start + size
-		    result.push(arr.slice(start, end))
-		  }
-		  return result
+	components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail, printPreview },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			flag: '',
+			websitList: []
 		}
-	}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
-	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' },{'param': 'a.flag', "compare": "=", "value": this.flag})
-		cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-			<el-button type="text" onClick={() => {
-				this.id = row.salesId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>{row.flag == 'SAVE'?'编辑':"详情"}</el-button>
-			{row.flag == 'PAY_NOT_TAKE'?<el-button type="text" onClick={() => {
-				this.id = row.salesId
-				this.formDialogType = row.flag == 'SAVE'?1:2
-				this.openForm()
-			}}>确认提货</el-button>:null}
-			<el-button type="text" onClick={() => this.toPrint(row, 2)}>
-			  打印
-			</el-button>
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	getWebsit(){
-		getWebsit({type: 'C'}).then(res => {
-			this.websitList = res.data
-		})
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { },
+		filterArr() {
+			return function (arr, size) {
+				//判断如果不是数组(就没有length),或者size没有传值,size小于1,就返回空数组
+				if (!arr.length || !size || size < 1) return []
+				let [start, end, result] = [null, null, []]
+				for (let i = 0; i < Math.ceil(arr.length / size); i++) {
+					start = i * size
+					end = start + size
+					result.push(arr.slice(start, end))
+				}
+				return result
+			}
+		}
 	},
-	// 点击打印
-	async toPrint(row, type) {
-		this.getWebsit()
-		let pagingData = []
-		const { data } = await getDetail({
-		  salesId: row.salesId
-		})
-		pagingData = this.filterArr(data.items,4)
-		// 初始化模板,否则生成的模板叠加
-		hiprint.init()
-		this.hiprintTemplate = new hiprint.PrintTemplate()
-		// 兼容批量打印
-		// let params = !type ? this.filterArr() : [row.salesId]
-		let len = pagingData.length
-		let loadingLen = len
-		// 使用 i-- 提升for效率
-		this.$startLoading()
-		for (let i = 0; i < len; i++) {
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
 			try {
-			let websitHtml = ''
-			let html = ''
-			let num = 0
-			let totalAmount = 0
-			pagingData[i].forEach(item=>{
-				totalAmount = (Number(item.saleAmount)*100 + totalAmount*100)/100
-				num += Number(item.salesQty)
-				html += `
+				var pam = JSON.parse(JSON.stringify(p))
+				pam.params.push({ "param": "a.goods_type", "compare": "=", "value": 'M' }, { 'param': 'a.flag', "compare": "=", "value": this.flag })
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			if (item.jname === 'idCardImg') {
+				defaultData.render = (h, { row, index, column }) => {
+					return (
+						<div style="padding:0 6px;cursor: pointer;">
+							{row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+						</div>
+					)
+				}
+			}
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = 1
+						this.openForm()
+					}
+				},
+				detail: {
+					conditions: ({ row, index, column }) => {
+						return row.flag != 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+				confirmDelivery: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'PAY_NOT_TAKE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.salesId
+						this.formDialogType = row.flag == 'SAVE' ? 1 : 2
+						this.openForm()
+					}
+				},
+				print: {
+					click: ({ row, index, column }) => {
+						this.toPrint(row, 2)
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		getWebsit() {
+			getWebsit({ type: 'C' }).then(res => {
+				this.websitList = res.data
+			})
+		},
+		// 点击打印
+		async toPrint(row, type) {
+			this.getWebsit()
+			let pagingData = []
+			const { data } = await getDetail({
+				salesId: row.salesId
+			})
+			pagingData = this.filterArr(data.items, 4)
+			// 初始化模板,否则生成的模板叠加
+			hiprint.init()
+			this.hiprintTemplate = new hiprint.PrintTemplate()
+			// 兼容批量打印
+			// let params = !type ? this.filterArr() : [row.salesId]
+			let len = pagingData.length
+			let loadingLen = len
+			// 使用 i-- 提升for效率
+			this.$startLoading()
+			for (let i = 0; i < len; i++) {
+				try {
+					let websitHtml = ''
+					let html = ''
+					let num = 0
+					let totalAmount = 0
+					pagingData[i].forEach(item => {
+						totalAmount = (Number(item.saleAmount) * 100 + totalAmount * 100) / 100
+						num += Number(item.salesQty)
+						html += `
 					<tr align="center">
 					<td>${item.goodsName}</td>
 					<td>${item.goodsSpecification}</td>
@@ -202,61 +224,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 +287,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 +340,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>

+ 259 - 240
src/views/auxiliaryFittings/settleAccountManagement/settleAccount/index.vue

@@ -1,19 +1,20 @@
 <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="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="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" :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="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>
@@ -21,81 +22,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>
@@ -117,33 +120,40 @@
 						</tr>
 					</thead>
 					<tbody>
-						<tr v-for="(item,index) in formData.settlementOrderItemList" :key="index">
-							<td align="center">{{item.goodsName}}</td>
-							<td align="center">{{item.chargeType=='ACC'?(item.goodsType == 'M'?'辅材':'配件')+'物料':item.chargeType=='SERV'?'服务收费':''}}</td>
-							<td align="center">{{item.num}}</td>
-							<td align="center">{{item.goodsAmount}}</td>
-							<td align="center">{{item.totalAmount}}</td>
-							<td align="center">{{item.settlementType == 'OWN'?'自有':item.settlementType == 'OUT'?'外购':''}}</td>
-							<td align="center">{{item.workerAmount}}</td>
-							<td align="center">{{item.websitAmount}}</td>
+						<tr v-for="(item, index) in formData.settlementOrderItemList" :key="index">
+							<td align="center">{{ item.goodsName }}</td>
+							<td align="center">{{ item.chargeType == 'ACC' ? (item.goodsType ==
+								'M' ? '辅材' : '配件') + '物料' : item.chargeType == 'SERV' ? '服务收费' : '' }}</td>
+							<td align="center">{{ item.num }}</td>
+							<td align="center">{{ item.goodsAmount }}</td>
+							<td align="center">{{ item.totalAmount }}</td>
+							<td align="center">{{ item.settlementType == 'OWN' ? '自有' : item.settlementType == 'OUT' ? '外购' : '' }}</td>
+							<td align="center">{{ item.workerAmount }}</td>
+							<td align="center">{{ item.websitAmount }}</td>
 						</tr>
 						<!-- <tr>
 							<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
 						</tr> -->
 						<tr>
-							<td align="center">总计</td><td></td><td></td><td></td>
-							<td align="center">{{totalAmount}}</td><td></td>
-							<td align="center">{{workerAmount}}</td>
-							<td align="center">{{websitAmount}}</td>
+							<td align="center">总计</td>
+							<td></td>
+							<td></td>
+							<td></td>
+							<td align="center">{{ totalAmount }}</td>
+							<td></td>
+							<td align="center">{{ workerAmount }}</td>
+							<td align="center">{{ websitAmount }}</td>
 						</tr>
 					</tbody>
 				</table>
 			</el-card>
-		  <div slot="footer" class="dialog-footer">
-			<el-button size="mini" @click="formDialog = false;formData = {}">取 消</el-button>
-			<el-button size="mini" v-if="formData.status == 'WAIT'" type="primary" @click="settleAccounts(formData.settlementOrderId)">确认结算</el-button>
-			<el-button size="mini" v-if="formData.status == 'WAIT_ING'" type="primary" @click="withdraw(formData.settlementOrderId)">确认提现</el-button>
-		  </div>
+			<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>
@@ -154,202 +164,211 @@ 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, refund, settleAccounts, withdraw } from "@/api/auxiliaryFittings/settleAccount";
+import { listPageV2, pageExport, getDetail, refund, settleAccounts, withdraw } from "@/api/auxiliaryFittings/settleAccount";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
-  data() {
-    return {
+	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,
+		}
+	},
+	computed: {
 		// 事件组合
-		optionsEvensGroup: [
-			[
+		optionsEvensGroup() {
+			return [
 				[
-					{
-						name: '批量结算',
-						click: ()=>{
-							this.batchSettleAccounts()
+					[
+						this.optionsEvensAuth("bulkSettlement", {
+							click: this.batchSettleAccounts
 						}
-					}
-				]
-			],
-			[
-				[
-					{
-						name: '批量提现',
-						click: ()=>{
-							this.batchWithdraw()
+						),
+					],
+					[
+						this.optionsEvensAuth("bulkWithdrawal", {
+							click: this.batchWithdraw
 						}
-					}
+						),
+					],
 				]
-			],
-		],
-		// 表格属性
-		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()
-	},
-    // 列表请求函数
-	getList(p) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.status) {
-	      pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
-	    }
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
+		// 更多参数
+		moreParameters() {
+			return []
+		}
 	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-		return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				if (this.status) {
+					pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
+				}
+				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.settlementOrderId }).then(res => {
-		      Object.assign(this.formData, res.data)
-			  res.data.settlementOrderItemList.forEach(item=>{
-				  this.totalAmount += (item.totalAmount*100 +  this.totalAmount*100)/100
-				  this.workerAmount = (item.workerAmount*100 +  this.workerAmount*100)/100
-				  this.websitAmount += (item.websitAmount*100 +  this.websitAmount*100)/100
-			  })
-		      this.formDialogType = 1
-		      this.openForm()
-		    })
-		  }}>查看</el-button>
-		  {row.totalAmount > 0? <el-button type="text" onClick={() => {
-		  	this.$confirm('请确认是否退款, 是否继续?', '提示', {
-		  		confirmButtonText: '确定',
-		  		cancelButtonText: '取消',
-		  		type: 'warning'
-		  	}).then(() => {
-		  		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);
-		  		  }
-		  		})
-		  	});
-		  }}>退款</el-button>:null}
-		  {row.status == 'WAIT'? <el-button type="text" onClick={() => {
-		  	this.settleAccounts(row.settlementOrderId)
-		  }}>结算</el-button>:null}
-		  {row.status == 'WAIT_ING'? <el-button type="text" onClick={() => {
-		  	this.withdraw(row.settlementOrderId)
-		  }}>提现</el-button>:null}
-        </div>
-      )
-    },
-	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);
-				}
+
+		operation() {
+			return this.operationBtn({
+				detail: {
+					click: ({ row, index, column }) => {
+						this.totalAmount = 0
+						this.workerAmount = 0
+						this.websitAmount = 0
+						getDetail({ id: row.settlementOrderId }).then(res => {
+							Object.assign(this.formData, res.data)
+							res.data.settlementOrderItemList.forEach(item => {
+								this.totalAmount += (item.totalAmount * 100 + this.totalAmount * 100) / 100
+								this.workerAmount = (item.workerAmount * 100 + this.workerAmount * 100) / 100
+								this.websitAmount += (item.websitAmount * 100 + this.websitAmount * 100) / 100
+							})
+							this.formDialogType = 1
+							this.openForm()
+						})
+					}
+				},
+				refund: {
+					prompt: "请确认是否退款, 是否继续?",
+					conditions: ({ row, index, column }) => {
+						return row.totalAmount > 0
+					},
+					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: {
+					conditions: ({ row, index, column }) => {
+						return row.status == 'WAIT'
+					},
+					click: ({ row, index, column }) => {
+						this.settleAccounts(row.settlementOrderId)
+					}
+				},
+				withdraw: {
+					conditions: ({ row, index, column }) => {
+						return row.status == 'WAIT_ING'
+					},
+					click: ({ row, index, column }) => {
+						this.withdraw(row.settlementOrderId)
+					}
+				},
 			})
-		});
-	},
-  }
+		},
+
+		batchSettleAccounts() {
+			if (this.recordSelected.length == 0) {
+				return this.$message.warning('请至少勾选一条数据!');
+			}
+			this.settleAccounts(this.recordSelected.map(item => { return item.settlementOrderId }).join(','))
+		},
+		settleAccounts(id) {
+			this.$confirm(`请确认是否结算选中数据, 是否继续?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				settleAccounts({
+					id
+				}).then(res => {
+					if (res.code == 200) {
+						this.$message({ type: 'success', message: `结算成功!` })
+						this.$refs.pageRef.refreshList()
+						this.formDialog = false
+					} else {
+						this.$message.error(res.msg);
+					}
+				})
+			});
+		},
+		batchWithdraw() {
+			if (this.recordSelected.length == 0) {
+				return this.$message.warning('请至少勾选一条数据!');
+			}
+			this.withdraw(this.recordSelected.map(item => { return item.settlementOrderId }).join(','))
+		},
+		withdraw(id) {
+			this.$confirm(`请确认是否提现选中数据, 是否继续?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				withdraw({
+					id
+				}).then(res => {
+					if (res.code == 200) {
+						this.$message({ type: 'success', message: `提现成功!` })
+						this.$refs.pageRef.refreshList()
+						this.formDialog = false
+					} else {
+						this.$message.error(res.msg);
+					}
+				})
+			});
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
-	.bold{
-		width: 160px;
-		font-weight: bold;
-		background-color: #f0f0f0;
-	}
+.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>

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

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

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

+ 5 - 5
src/views/workOrder/workOrderPool/index.vue

@@ -115,7 +115,7 @@ export default {
       return [
         [
           [
-          this.optionsEvensAuth(["createWorkOrder", "createWbWorkOrder"], {
+            this.optionsEvensAuth(["createWorkOrder", "createWbWorkOrder"], {
               name: '创建工单',
               click: () => { }
             }),
@@ -239,11 +239,11 @@ export default {
         }
       }
     },
-    
+
     selectable(row, index) {
       return !["YWG", "YJS", "YQX"].includes(Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0])
     },
-    
+
     screeningAnalysis(jname, val) {
       if (jname == 'orderFlags') {
         return (val || []).map(item => item.tagName).join(',')
@@ -251,14 +251,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 => {