OfficeApp/pages/oaExamine/oaExamine.vue

142 lines
3.9 KiB
Vue
Raw Normal View History

2023-07-15 17:51:20 +08:00
<template>
<view class="all_box">
2023-09-18 18:38:37 +08:00
<u-sticky bgColor="#0022C7">
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='white' :scrollable="false" lineWidth='20'
inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
</u-sticky>
<u-tabs style="background-color: #fff;" :list="typeTabLists" @click="changeTypeCurrent" lineColor='#0022C7' lineWidth='40'
inactiveStyle='color:#0022C7' activeStyle="color:#0022C7"></u-tabs>
2023-09-19 16:48:15 +08:00
<view v-if="check_status==2||check_status==3" class="p_list">
<block v-for="(item,index) in list" :key="index">
<merchantAudit :datas="item"></merchantAudit>
</block>
2023-07-15 17:51:20 +08:00
</view>
<u-empty v-if="list.length==0&&loadConfig.status=='nomore'" icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
2023-07-15 17:51:20 +08:00
</view>
</template>
<script>
2023-07-25 08:11:50 +08:00
import { Toast } from '@/libs/uniApi.js'
import { approveLists, approveTypes } from "@/api/approve.js"
2023-09-18 18:38:37 +08:00
import merchantAudit from '@/components/merchantAudit/merchantAudit.vue'
2023-07-15 17:51:20 +08:00
export default {
components: {
2023-09-18 18:38:37 +08:00
merchantAudit
2023-07-15 17:51:20 +08:00
},
data() {
return {
2023-09-22 17:36:26 +08:00
tabLists: [ {
name: '审核中',
2023-09-22 17:36:26 +08:00
id: 1
2023-07-15 17:51:20 +08:00
}, {
2023-09-22 17:36:26 +08:00
name: '已通过',
id: 2
}, {
2023-09-22 17:36:26 +08:00
name: '未通过',
id: 3
}, {
name: '全部',
id: 0
},],
typeTabLists: [],
current: 0,
2023-09-22 17:36:26 +08:00
currentID: 1, // 审核中,已通过,为通过,全部
typeCurrent: 0,
2023-09-22 17:36:26 +08:00
check_status: 0, // 审批类型
list: [],
loadConfig: {
page: 1,
2023-09-23 11:37:52 +08:00
limit: 10,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
2023-07-15 17:51:20 +08:00
}
},
onLoad() {
this.initType();
2023-07-15 17:51:20 +08:00
},
onShow() {
2023-09-23 11:37:52 +08:00
if(this.typeTabLists.length>0){
this.loadConfig.page = 1;
this.loadConfig.status = "loading";
this.list = [];
this.$u.sleep(200).then(()=>{
this.loadList();
})
}
},
async onPullDownRefresh() {
await this.initList();
this.$u.sleep(200).then(()=>{
uni.stopPullDownRefresh();
})
},
onReachBottom() {
this.loadList();
2023-07-15 17:51:20 +08:00
},
methods: {
async initType(){
let res = await approveTypes();
res.data.forEach((item)=>{
2023-09-21 15:08:48 +08:00
if(item.id!=1) this.typeTabLists.push({
id: item.id,
name: item.title
})
})
2023-09-19 16:42:57 +08:00
this.check_status = this.typeTabLists[0].id;
2023-09-19 14:16:57 +08:00
this.$nextTick(()=>{
this.initList();
})
},
async initList(){
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
await this.loadList();
},
async loadList(){
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let query = {
type: this.check_status,
page: this.loadConfig.page,
limit: this.loadConfig.limit
}
2023-09-22 17:36:26 +08:00
this.currentID?query.check_status=this.currentID:null;
let res = await approveLists(query);
this.loadConfig.status = "loadmore"
if (res.data.lists.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.lists];
},
2023-09-18 18:38:37 +08:00
changeCurrent(e) {
this.current = e.index;
2023-09-22 17:36:26 +08:00
this.currentID = e.id;
this.initList();
},
changeTypeCurrent(e) {
this.typeCurrent = e.index;
this.check_status = e.id;
this.initList();
2023-07-15 17:51:20 +08:00
},
},
}
</script>
<style lang="scss" scoped>
.all_box {
padding-bottom: 21rpx;
}
2023-09-18 18:38:37 +08:00
.p_list{
padding-top: 28rpx;
2023-07-15 17:51:20 +08:00
}
2023-07-20 10:22:50 +08:00
</style>