新增任务列表更新状态
This commit is contained in:
parent
afabc19f0f
commit
6652da2387
@ -32,7 +32,10 @@
|
|||||||
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||||
</view>
|
</view>
|
||||||
-->
|
-->
|
||||||
|
<u-sticky bgColor="#0022C7" v-if="task_id>0&& !is_admin">
|
||||||
|
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='white' :scrollable="false" lineWidth='40'
|
||||||
|
inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
|
||||||
|
</u-sticky>
|
||||||
<view class="personnel_list">
|
<view class="personnel_list">
|
||||||
<view class="card" v-for="(item, index) in list" :key="item.id">
|
<view class="card" v-for="(item, index) in list" :key="item.id">
|
||||||
<view class="card_head">
|
<view class="card_head">
|
||||||
@ -120,7 +123,6 @@
|
|||||||
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<mybtn text="信息登记" v-if="showView" @click="navTo('/subpkg/newArchives/newArchives')"></mybtn>
|
<mybtn text="信息登记" v-if="showView" @click="navTo('/subpkg/newArchives/newArchives')"></mybtn>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -142,6 +144,12 @@
|
|||||||
task_id: -1,
|
task_id: -1,
|
||||||
is_admin: false,
|
is_admin: false,
|
||||||
list: [],
|
list: [],
|
||||||
|
current: 0,
|
||||||
|
tabLists: [{
|
||||||
|
name: '未更新',
|
||||||
|
}, {
|
||||||
|
name: '已更新'
|
||||||
|
}],
|
||||||
loadConfig: {
|
loadConfig: {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 15,
|
limit: 15,
|
||||||
@ -167,7 +175,7 @@
|
|||||||
title: '任务:信息更新'
|
title: '任务:信息更新'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.loadInformationList();
|
this.initLoad();
|
||||||
uni.$on('loadArchives', this.initLoad);
|
uni.$on('loadArchives', this.initLoad);
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@ -201,7 +209,7 @@
|
|||||||
this.loadConfig.page = 1;
|
this.loadConfig.page = 1;
|
||||||
this.loadConfig.status = "loadmore";
|
this.loadConfig.status = "loadmore";
|
||||||
this.list = [];
|
this.list = [];
|
||||||
this.is_admin ? null : await this.loadInformationList();
|
await this.loadInformationList();
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
},
|
},
|
||||||
async loadInformationList() {
|
async loadInformationList() {
|
||||||
@ -209,14 +217,19 @@
|
|||||||
if (this.loadConfig.status == "nomore") return;
|
if (this.loadConfig.status == "nomore") return;
|
||||||
this.loadConfig.status = "loading"
|
this.loadConfig.status = "loading"
|
||||||
let res = {};
|
let res = {};
|
||||||
if (this.is_admin) res = await taskInformationgist({
|
if (this.is_admin) {
|
||||||
|
res = await taskInformationgist({
|
||||||
id: this.task_id
|
id: this.task_id
|
||||||
});
|
});
|
||||||
else res = await informationList({
|
}
|
||||||
|
else {
|
||||||
|
res = await informationList({
|
||||||
page: this.loadConfig.page,
|
page: this.loadConfig.page,
|
||||||
limit: this.loadConfig.limit,
|
limit: this.loadConfig.limit,
|
||||||
user_id: that.user_id
|
user_id: that.user_id,
|
||||||
|
is_update: this.current
|
||||||
})
|
})
|
||||||
|
}
|
||||||
this.loadConfig.status = "loadmore"
|
this.loadConfig.status = "loadmore"
|
||||||
if (res.data.length < this.loadConfig.limit) {
|
if (res.data.length < this.loadConfig.limit) {
|
||||||
this.loadConfig.status = "nomore"
|
this.loadConfig.status = "nomore"
|
||||||
@ -224,6 +237,10 @@
|
|||||||
this.loadConfig.page++;
|
this.loadConfig.page++;
|
||||||
}
|
}
|
||||||
this.list = [...this.list, ...res.data];
|
this.list = [...this.list, ...res.data];
|
||||||
|
},
|
||||||
|
changeCurrent(e) {
|
||||||
|
this.current = e.index;
|
||||||
|
this.initLoad();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user