فهرست منبع

销售管理权限修改

pengyh 1 سال پیش
والد
کامیت
ec75450a06

+ 4 - 2
src/views/mallManagement/configCenter/mallConfig/index.vue

@@ -359,9 +359,9 @@
 
       <div class="page-footer">
         <div class="footer" :class="classObj">
-          <el-button type="primary" @click="submitStep1Form" :loading="formLoading" v-if="step == 'first'">{{ formLoading
+          <el-button type="primary" @click="submitStep1Form" :loading="formLoading" v-if="step == 'first' && $restrict('save')">{{ formLoading
             ? '保存中 ...' : '保 存' }}</el-button>
-          <el-button type="primary" @click="submitStep2Form" :loading="formLoading" v-if="step == 'second'">{{ formLoading
+          <el-button type="primary" @click="submitStep2Form" :loading="formLoading" v-if="step == 'second' && $restrict('save')">{{ formLoading
             ? '保存中 ...' : '保 存' }}</el-button>
         </div>
       </div>
@@ -378,7 +378,9 @@
 import { getToken, getUserid } from '@/utils/auth';
 import { getTemplate, editAccount, editTemplate, getDetail } from "@/api/merchant";
 import { getInfo } from '@/api/user'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
+	mixins: [operation_mixin],
   data() {
     return {
       isAdmin: JSON.parse(localStorage.getItem("greemall_user")).type === 2,

+ 64 - 59
src/views/mallManagement/configCenter/slideshowConfig/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
     :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation" :exportList="exportList">
+    :operation="operation()" :exportList="exportList">
     <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
       :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
       <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
@@ -23,32 +23,12 @@ import import_mixin from '@/components/template/import_mixin.js'
 import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
 import { carouselMapListPageV2, carouselMapPageExport, changeBannerStatus, addBanner, editBanner, getBannerDetail, deleteBanner, getGoodsList, batchDeleteBanner } from '@/api/setting'
 import ImageUpload from '@/components/file-upload'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, ImageUpload },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新增轮播图',
-              isRole: true,
-              click: this.addData
-            }
-          ],
-        ],
-        [
-          [
-            {
-              name: '批量删除',
-              isRole: true,
-              click: this.batchDelete
-            }
-          ],
-        ],
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -78,6 +58,30 @@ export default {
     }
   },
   computed: {
+	// 事件组合
+	optionsEvensGroup() {
+		return [
+			[
+				[
+					this.optionsEvensAuth("add", {
+						click: () => {
+							this.addData
+						}
+					})
+				],
+			],
+			[
+				[
+					this.optionsEvensAuth("del", {
+						name: '批量删除',
+						click: () => {
+							this.batchDelete
+						}
+					})
+				],
+			]
+		]
+	},
     // 更多参数
     moreParameters() {
       return []
@@ -219,42 +223,43 @@ export default {
       this.recordSelected = data
     },
     // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getBannerDetail({ id: row.id }).then(res => {
-              Object.assign(this.formData, res.data, {
-                imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
-              })
-              this.formDialogType = 1
-              this.openForm()
-            })
-          }}>编辑</el-button>
-          <el-popconfirm
-            title="确定删除吗?"
-            onConfirm={() => {
-              deleteBanner({ carouselMapId: row.id }).then(() => {
-                this.$message({ type: 'success', message: '删除成功!' })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">删除</el-button>
-          </el-popconfirm>
-          <el-popconfirm
-            title={`确定${row.state ? '隐藏' : '显示'}吗?`}
-            onConfirm={() => {
-              changeBannerStatus({ carouselMapId: row.id, state: !row.state }).then(() => {
-                this.$message({ type: 'success', message: `${row.state ? '隐藏' : '显示'}成功!` })
-                this.$refs.pageRef.refreshList()
-              })
-            }}
-          >
-            <el-button type="text" slot="reference">{row.state ? '隐藏' : '显示'}</el-button>
-          </el-popconfirm>
-        </div>
-      )
+    operation() {
+		return this.operationBtn({
+		  edit: {
+		    click: ({ row, index, column }) => {
+		      getBannerDetail({ id: row.id }).then(res => {
+		        Object.assign(this.formData, res.data, {
+		          imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
+		        })
+		        this.formDialogType = 1
+		        this.openForm()
+		      })
+		    }
+		  },
+		  del: {
+			prompt: '确定删除吗?',
+		    click: ({ row, index, column }) => {
+		      deleteBanner({ carouselMapId: row.id }).then(() => {
+		        this.$message({ type: 'success', message: '删除成功!' })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  },
+		  status: {
+			name: ({ row, index, column }) => {
+				return row.state ? '隐藏' : '显示'
+			},
+		  	prompt:  ({ row, index, column }) => {
+				return `确定${row.state ? '隐藏' : '显示'}吗?`
+			},
+		    click: ({ row, index, column }) => {
+		      changeBannerStatus({ carouselMapId: row.id, state: !row.state }).then(() => {
+		        this.$message({ type: 'success', message: `${row.state ? '隐藏' : '显示'}成功!` })
+		        this.$refs.pageRef.refreshList()
+		      })
+		    }
+		  },
+		})
     },
     addData() {
       this.formDialogType = 0

+ 35 - 46
src/views/workOrder/projectMaintenance/basicData/index.vue

@@ -29,17 +29,6 @@ export default {
   mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		],
-	  	],
-	  ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
@@ -77,7 +66,7 @@ export default {
 				[
 					this.optionsEvensAuth("add", {
 						click: () => {
-							
+							this.addData
 						}
 					})
 				],
@@ -191,40 +180,40 @@ export default {
     // 表格操作列
     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})) : []
-		        })
-		         console.log(this.formData)
-		        this.formDialogType = 1
-		        this.openForm()
-		      })
-		    }
-		  },
-		  detail: {
-		    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})) : []
-		        })
-		         console.log(this.formData)
-		        this.formDialogType = 2
-		        this.openForm()
-		      })
-		    }
-		  },
-		  expenseApply: {
-		    click: ({ row, index, column }) => {
-		      
-		    }
-		  },
-		  serviceOrderDetail: {
-		    click: ({ row, index, column }) => {
-		      
-		    }
-		  }
+			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})) : []
+						})
+						console.log(this.formData)
+						this.formDialogType = 1
+						this.openForm()
+					})
+				}
+			},
+			detail: {
+				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})) : []
+						})
+						console.log(this.formData)
+						this.formDialogType = 2
+						this.openForm()
+					})
+				}
+			},
+			expenseApply: {
+				click: ({ row, index, column }) => {
+					
+				}
+			},
+			serviceOrderDetail: {
+				click: ({ row, index, column }) => {
+					
+				}
+			}
 		})
     },
     addData() {