From 34e8c6d9fb920bae39b9271cf9594565b296e447 Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Tue, 15 Oct 2024 14:43:48 +0800
Subject: [PATCH] 11
---
src/page/user/Warehouse/data.list.vue | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/src/page/user/Warehouse/data.list.vue b/src/page/user/Warehouse/data.list.vue
index b676e42..567d052 100644
--- a/src/page/user/Warehouse/data.list.vue
+++ b/src/page/user/Warehouse/data.list.vue
@@ -24,6 +24,7 @@
:key="index"
@click="$router.push(`/Stockdetail?codes=${item.positionSn}`)" >
<div @click.stop="pushRouter(item)">
+
<div class="title-box" style="justify-content: space-between;">
<div class="span" :style="item.isListed==false?'color:red;':''">{{ item.stockName }}</div>
<div
@@ -367,7 +368,7 @@
};
},
created(){
- // this.dsq()
+ this.dsq()
},
beforeDestroy() {
clearInterval(this.timer); // 在组件销毁前清除定时器
@@ -423,6 +424,29 @@
}
},
// 获取仓位列表
+ async getLists(laber) {
+ if (laber) {
+ this.dataList = [];
+ this.pageNum = 1;
+ this.finished = false;
+ }
+ const res = await getchicang({
+ state: this.actives,
+ stockType: laber || this.activeObj.laber,
+ pageNum: 1,
+ pageSize: 30,
+ });
+
+ this.loading = false;
+ if (res.status === 0) {
+ this.newdataList = res.data.list;
+ this.finished = true;
+ } else {
+ this.loading = false;
+ this.finished = true;
+ }
+ },
+ // 获取仓位列表
async getList(laber) {
if (laber) {
this.dataList = [];
@@ -439,20 +463,8 @@
this.loading = false;
if (res.status === 0) {
this.dataList = []
- this.newdataList = []
- if(this.actives == 0){
- this.dataList = res.data.list;
- }else{
- this.newdataList = res.data.list;
- }
- this.$forceUpdate(); // 强制Vue重新渲染
- // if (res.data.total <= this.dataList.length) {
+ this.dataList = res.data.list;
this.finished = true;
- // this.dsq()
- // this.timer = setInterval(() => {
- // this.getList();
- // }, 3000);
- // }
} else {
this.loading = false;
this.finished = true;
@@ -465,12 +477,11 @@
},
clickTabs(e) {
- this.dataList = [];
this.pageNum = 1;
this.finished = false;
this.actives = e.key;
- // this.newdataList = []
- // this.dataList = []
+ this.newdataList = []
+ this.dataList = []
if(e.key==1){
clearInterval(this.timer); // 在组件销毁前清除定时器
@@ -478,12 +489,12 @@
// setTimeout(()=>{
// clearInterval(this.timer); // 在组件销毁前清除定时器
// },3000)
- this.dsq()
+ this.getLists()
// this.startPolling();
// this.dsq()
}else{
clearInterval(this.timer); // 在组件销毁前清除定时器
- this.getList()
+ this.dsq()
}
this.$forceUpdate(); // 强制Vue重新渲染
--
Gitblit v1.9.3