Procházet zdrojové kódy

用户管理新增权限

pengyh před 1 rokem
rodič
revize
86fcb16cc6

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

@@ -88,7 +88,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							this.addData
+							this.addData()
 						}
 					})
 				],

+ 1 - 1
src/views/mallManagement/configCenter/business_type/index.vue

@@ -58,7 +58,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							this.addData
+							this.addData()
 						}
 					})
 				],

+ 12 - 12
src/views/mallManagement/configCenter/chargingStandard/index.vue

@@ -60,20 +60,20 @@ export default {
     }
   },
   computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
 				[
-					[
-						this.optionsEvensAuth("add", {
-							click: () => {
-								this.addData
-							}
-						})
-					],
-				]
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
+				],
 			]
-		},
+		]
+	},
     // 更多参数
     moreParameters() {
       return []

+ 2 - 2
src/views/mallManagement/configCenter/faultSelfExamination/index.vue

@@ -75,7 +75,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							this.addData
+							this.addData()
 						}
 					})
 				],
@@ -84,7 +84,7 @@ export default {
 				[
 					this.optionsEvensAuth("template", {
 						click: () => {
-							this.handleDownload
+							this.handleDownload()
 						}
 					})
 				],

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

@@ -65,7 +65,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							this.addData
+							this.addData()
 						}
 					})
 				],
@@ -75,7 +75,7 @@ export default {
 					this.optionsEvensAuth("del", {
 						name: '批量删除',
 						click: () => {
-							this.batchDelete
+							this.batchDelete()
 						}
 					})
 				],

+ 1 - 1
src/views/mallManagement/freight/index.vue

@@ -72,7 +72,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							this.addData
+							this.addData()
 						}
 					})
 				],

+ 11 - 11
src/views/mallManagement/goods/newclassify_index/index.vue

@@ -60,20 +60,20 @@ export default {
     }
   },
   computed: {
-		// 事件组合
-		optionsEvensGroup() {
-			return [
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
 				[
-					[
-						this.optionsEvensAuth("add", {
-							click: () => {
-								this.addData
-							}
-						})
-					]
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData()
+						}
+					})
 				]
 			]
-		},
+		]
+	},
     // 更多参数
     moreParameters() {
       return []

+ 1 - 1
src/views/mallManagement/storage/index.vue

@@ -58,7 +58,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							this.addData
+							this.addData()
 						}
 					})
 				],

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

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

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

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

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

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

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

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