From a9546154c39b7850746317af561573ed8ee503d1 Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Sun, 07 Apr 2024 16:02:07 +0800
Subject: [PATCH] new
---
src/page/user/Warehouse.vue | 37 ++++++++++++++++++++++++++-----------
1 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/src/page/user/Warehouse.vue b/src/page/user/Warehouse.vue
index 894987a..fb0a665 100644
--- a/src/page/user/Warehouse.vue
+++ b/src/page/user/Warehouse.vue
@@ -20,10 +20,18 @@
</div>
</template>
<template v-else>
- <itemCard :activeObj="activeObj" :itemClick="itemClick" />
+ <itemCard
+ @closingPosition="closingPosition"
+ :activeObj="activeObj"
+ :itemClick="itemClick"
+ />
</template>
<div v-show="active !== '1'">
- <dataList ref="dataListref" :activeObj="activeObj" />
+ <dataList
+ ref="dataListref"
+ :activeObj="activeObj"
+ @closingPosition="closingPosition"
+ />
</div>
</div>
</div>
@@ -45,7 +53,6 @@
tabsArr: [
{
title: this.$t("hometips"),
-
name: "1",
bgc: "rgb(8, 82, 196)",
laber: "ALL",
@@ -86,18 +93,23 @@
created() {
this.getMoneys();
},
- mounted(){
- if(this.$route.query.index=='0'){
- this.onClick({name:4})
- }else if(this.$route.query.index=='1'){
- this.onClick({name:2})
- }else{
-
+ mounted() {
+ if (this.$route.query.index == "0") {
+ let arr = this.tabsArr.filter((item) => item.name == 4)[0];
+ this.onClick(arr);
+ } else if (this.$route.query.index == "1") {
+ let arr = this.tabsArr.filter((item) => item.name == 2)[0];
+ this.onClick(arr);
+ } else {
}
},
methods: {
+ closingPosition() {
+ this.getMoneys();
+ },
itemClick() {
this.$refs.dataListref.getList(this.activeObj.laber);
+ this.getMoneys();
},
async getMoneys() {
const res = await getMoney();
@@ -111,12 +123,15 @@
}
});
});
+ let obj = arr.filter((item) => item.name == this.active)[0];
+ this.activeObj = obj;
+ console.log(obj, "0000000", res.data);
this.tabsArr = arr;
this.$forceUpdate(); // 强制Vue重新渲染
}
},
onClick(e) {
- console.log(e);
+ console.log(e, "====");
this.active = e.name;
this.activeObj = e;
this.getMoneys();
--
Gitblit v1.9.3