shish 3 lat temu
rodzic
commit
a5bd17b156

+ 18 - 18
pt/src/saas/shop/manage.vue

@@ -19,18 +19,18 @@
         <span>{{scope.row.founder == 1 ? '是' : scope.row.status == 2 ? '不是' : '-'}}</span>
       </template> 
       <!-- 操作 -->
-			<template #slot-column-option="{scope}">
-					<template>
-						<el-popover placement="top" width="160" :ref="'popover-' + scope.row.id">
-							<p>开店申请记录和管理员信息将被删除,确定要删除吗?</p>
-							<div style="text-align: right; margin: 0">
-								<el-button size="mini" type="text" @click="selfGetCancel(scope.row.id)">取消</el-button>
-								<el-button type="primary" size="mini" @click="noSendShipFn(scope.row)">确定</el-button>
-							</div>
-              				<el-button type="text" size="small" slot="reference">删除</el-button>
-						</el-popover>
-					</template>
-			</template>
+		<template #slot-column-option="{scope}">
+				<template>
+					<el-popover placement="top" width="160" :ref="'popover-' + scope.row.id">
+						<p>开店申请记录和管理员信息将被删除,确定要删除吗?</p>
+						<div style="text-align: right; margin: 0">
+							<el-button size="mini" type="text" @click="selfGetCancel(scope.row.id)">取消</el-button>
+							<el-button type="primary" size="mini" @click="noSendShipFn(scope.row)">确定</el-button>
+						</div>
+						<el-button type="text" size="small" slot="reference">删除</el-button>
+					</el-popover>
+				</template>
+		</template>
     </x-crud>
 	</div>
 </template>
@@ -138,18 +138,18 @@ export default {
 				.done();
 			app.refresh();
 		},
-    //取消删除
+    	//取消删除
 		selfGetCancel(id) {
 			this.$refs[`popover-` + id].doClose();
 		},
-    // 确定删除
+    	// 确定删除
 		noSendShipFn(item) {
-      console.log('item.id', item.id)
-      let param = { id: item.id }
+			console.log('item.id', item.id)
+			let param = { id: item.id }
 			this.$service.auth.shopAdminDelete(param).then(res => {
 				this.$message.success('操作成功!');
-        this.$refs[`popover-` + item.id].doClose();
-        this.app.refresh()
+				this.$refs[`popover-` + item.id].doClose();
+				this.app.refresh()
 			});
 		},
 	}

+ 7 - 0
pt/src/service/item-cat-relate/index.js

@@ -2,5 +2,12 @@ import { BaseService, Service } from '@/cool';
 @Service('item-cat-relate')
 export class ItemCatRelateService extends BaseService {
 
+	delRelate(data) {
+		return this.request({
+			url: '/del-relate',
+			params: data
+		});
+	}
+
 }
 export default new ItemCatRelateService();

+ 28 - 1
pt/src/views/item-cat-relate/list.vue

@@ -30,6 +30,21 @@
 					<span>排序</span>
 				</div>
 			</template>
+
+			<!-- 操作 -->
+			<template #slot-column-option="{scope}">
+					<template>
+						<el-popover placement="top" width="160" :ref="'popover-' + scope.row.id">
+							<p>确定要删除?</p>
+							<div style="text-align: right; margin: 0">
+								<el-button size="mini" type="text" @click="cancelDel(scope.row.id)">取消</el-button>
+								<el-button type="primary" size="mini" @click="confirmDel(scope.row)">确定</el-button>
+							</div>
+							<el-button type="text" size="small" slot="reference">删除</el-button>
+						</el-popover>
+					</template>
+			</template>
+
 		</x-crud>
 	</div>
 </template>
@@ -63,6 +78,18 @@ export default {
 	},
 	computed: {},
 	methods: {
+    	//取消删除
+		cancelDel(id) {
+			this.$refs[`popover-` + id].doClose();
+		},
+    	// 确定删除
+		confirmDel(item) {
+			this.$service.itemCatRelate.delRelate({ itemId: item.id }).then(res => {
+				this.$message.success('删除成功');
+				this.$refs[`popover-` + item.id].doClose();
+				this.app.refresh()
+			});
+		},
 		onLoad({ ctx, app }) {
 			this.app = app;
 			if (this.$route.query.catId) {
@@ -131,7 +158,7 @@ export default {
 							fixed: 'right',
 							label: '操作',
 						},
-						layout: [],
+						layout: ['slot-column-option'],
 					},
 				})
 				.set('pagination', {