Files
pj_h5_cloud/src/pages/apply/stride-list.vue
T
2025-01-07 16:08:39 +08:00

126 lines
4.8 KiB
Vue

<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: [
{ id: null, name: '全部', disabled: false },
{ id: 1, name: '待审核', disabled: false },
{ id: 2, name: '已通过', disabled: false },
{ id: 3, name: '已拒绝', disabled: false },
]
}
const state = reactive<any>({
pa: {
processStatus: data.tabs[0].id,
},
})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, applyApi.strideList, null, 'data.records')
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa);
}
onLoad(() => {
});
onShow(() => {
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const doTab = (e: any) => {
const target = data.tabs[e];
state.pa.processStatus = target.id
pageRef.value.reload(true)
}
const doApply = async () => {
router.jump("/pages/apply/stride-apply")
}
const doCard = (v: any) => {
if (v.processStatus == 2) {
router.jump("/pages/apply/stride-items", { id: v.id })
} else {
router.jump("/pages/apply/stride-apply", { type: 'view', id: v.id })
}
}
</script>
<template>
<crud-layout title="跨单位就餐" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="5"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="h-30rpx" />
<view class="bg-white rounded-16rpx px-20rpx">
<z-tabs :list="data.tabs" @change="doTab" />
</view>
</template>
<view class="h-20rpx" />
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i"
@tap="doCard(v)">
<view class="flex-row items-center justify-between">
<view class="sub-text-30">跨单位就餐</view>
<view class="flex-row items-center">
<view class="second-text-26">{{ hooks.useTime(v.createTime, "") }}</view>
<view class="flex-row-center m-l-20rpx">
<tm-tag v-if="v.processStatus == 1" size="xs" color="info">待审核</tm-tag>
<tm-tag v-if="v.processStatus == 2" size="xs" color="success">已通过</tm-tag>
<tm-tag v-if="v.processStatus == 3" size="xs" color="error">已拒绝</tm-tag>
</view>
</view>
</view>
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>数量</text>
<text class="m-l-10rpx">{{ v.count }}</text>
</view>
<view class="color-red">
<text>已使用</text>
<text class="m-l-10rpx">{{ v.useCount }}</text>
</view>
</view>
<view v-if="v.processStatus != 1 && false">
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>审核人</text>
<text class="m-l-10rpx">{{ v.checkUserName }}</text>
</view>
<view class="flex items-center">
<text>审核时间</text>
<text class="m-l-10rpx"> {{ hooks.useTime(v.checkTime, "") }}</text>
</view>
</view>
</view>
<view class="flex items-center justify-end m-t-25rpx">
<text v-if="v.processStatus == 2" class="botder_btn">使用</text>
<text v-else class="botder_btn">查看</text>
</view>
</view>
<template #bottom>
<view
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
@tap="doApply">
申请
</view>
<view class="h-30rpx" />
</template>
</z-paging>
</crud-layout>
</template>
<style lang="scss" scoped></style>