Parcourir la source

【193】上架、下架页签显示数据不正确 (解决)

wangning il y a 5 ans
Parent
commit
de31d0efd6
2 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. 6 1
      hd/src/sass/goods/list.vue
  2. 1 1
      hd/src/views/goods/goods-list.vue

+ 6 - 1
hd/src/sass/goods/list.vue

@@ -13,6 +13,7 @@
 						:key="index"
 						:key="index"
 						:label="`${item.text}(${item.val})`"
 						:label="`${item.text}(${item.val})`"
 						:name="item.key"
 						:name="item.key"
+            @click="tabClick(item.key)"
 					>
 					>
 					</el-tab-pane>
 					</el-tab-pane>
 				</el-tabs>
 				</el-tabs>
@@ -40,7 +41,7 @@
 
 
 			<!-- 状态 -->
 			<!-- 状态 -->
 			<template #table-column-status="{scope}">
 			<template #table-column-status="{scope}">
-				<span>{{ scope.row.status == 1 ? '上架' : '下架' }}</span>
+				<span>{{ scope.row.status == 1 ? '上架' : scope.row.status == 0 ? '下架' : '-'}}</span>
 			</template>
 			</template>
 		</x-crud>
 		</x-crud>
 		<!-- 添加商品 -->
 		<!-- 添加商品 -->
@@ -87,6 +88,10 @@ export default {
 		handleClick(tab, e) {
 		handleClick(tab, e) {
 			this.app.refresh({ type: this.tabIndex });
 			this.app.refresh({ type: this.tabIndex });
 		},
 		},
+    // 切换tab
+    tabClick(key) {
+      this.tabIndex = key
+    },
 		// 打开链接
 		// 打开链接
 		openLinkFn(link) {
 		openLinkFn(link) {
 			this.sortLink = link || '';
 			this.sortLink = link || '';

+ 1 - 1
hd/src/views/goods/goods-list.vue

@@ -156,7 +156,7 @@ export default {
 	},
 	},
 	methods: {
 	methods: {
 		handleClick(tab, e) {
 		handleClick(tab, e) {
-			this.app.refresh({ type: this.tabIndex });
+			this.app.refresh({ status: this.tabIndex });
 		},
 		},
 		// 打开链接
 		// 打开链接
 		openLinkFn(item) {
 		openLinkFn(item) {