Files
zgty-mas-m/pages/sampleWarehouse/sampleDispatchExternal/index.vue
2025-11-20 17:23:48 +08:00

81 lines
1.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<navbar-back title="样品调拨"></navbar-back>
<view class="p8">
<up-subsection
activeColor="#0055A2"
mode="subsection"
:list="list"
:current="current"
@change="changeTab"
></up-subsection>
<scroll-view style="height: 82vh" scroll-y scroll-with-animation @scrolltolower="handleScrolltolower">
<view class="data-item" v-for="(item, index) in listData" @click="handleDetail(item)">
<view
>申请人<text>{{ item.applyUser }}</text></view
>
<view
>申请时间<text>{{ nx.$dayjs(item.applyTime).format('YYYY-MM-DD HH:mm:ss') }}</text></view
>
<view
>申请事由<text>{{ item.applyContent }}</text></view
>
</view>
<up-loadmore v-if="listData.length > 0" :status="loadStatus" />
<up-empty v-else mode="data" text="暂无数据" marginTop="50"> </up-empty>
</scroll-view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue'
import { useListData } from '@/nx/hooks/usePageListData'
import nx from '@/nx'
const list = ref(['待处理', '已处理'])
let dataList = ref([])
const current = ref(0)
function changeTab(index) {
current.value = index
getInitData()
}
const searchParams = computed(() => {
if (current.value === 0) {
return {
finishStatus: 'pending'
}
} else {
return {
finishStatus: 'completed'
}
}
})
const { listData, scrollToLower, loadStatus, getInitData } = useListData({
searchParams,
api: nx.$api.sampleWarehouse.querySampleDispatchApply,
needInitListData: true
})
function handleScrolltolower() {
scrollToLower()
}
function handleDetail(item) {
nx.$store('biz').flagInfo = item
uni.navigateTo({
url: '/pages/sampleWarehouse/sampleDispatchExternal/detail'
})
}
</script>
<style lang="scss" scoped>
.data-item {
padding: 8px;
border-bottom: 1px solid #eee;
color: #909399;
text {
color: #000;
}
}
</style>