new
zzzz
2024-04-07 a9546154c39b7850746317af561573ed8ee503d1
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,9 +93,23 @@
  created() {
    this.getMoneys();
  },
  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();
@@ -102,11 +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, "====");
      this.active = e.name;
      this.activeObj = e;
      this.getMoneys();
@@ -159,4 +184,4 @@
  // padding: 0.10667rem 0.34667rem;
  color: #fff;
}
</style>
</style>