소스 검색

结算标准

linwenxin 1 년 전
부모
커밋
ac76172ab7

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

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