|
|
|
@ -2,9 +2,8 @@
|
|
|
|
|
import { getListAssembleReportApi } from '@/services/assembleReport'
|
|
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { formatDate } from '@/utils/index'
|
|
|
|
|
import { useLoginStore } from '@/stores/modules/login'
|
|
|
|
|
// 是否加载中标记
|
|
|
|
|
const isLoading = ref(false)
|
|
|
|
|
const userStore = useLoginStore()
|
|
|
|
|
const userId = userStore.userInfo.userId
|
|
|
|
|
// 请求参数
|
|
|
|
@ -17,10 +16,22 @@ const queryParams: Required<any> = {
|
|
|
|
|
onLoad(() => {
|
|
|
|
|
getData()
|
|
|
|
|
})
|
|
|
|
|
// 是否分页结束
|
|
|
|
|
const isFinish = ref(false)
|
|
|
|
|
const isLoading = ref(false)
|
|
|
|
|
const dataList = ref([])
|
|
|
|
|
const getData = async () => {
|
|
|
|
|
try {
|
|
|
|
|
if (isLoading.value) return
|
|
|
|
|
if (isFinish.value === true) {
|
|
|
|
|
return uni.showToast({ icon: 'none', title: '没有更多数据~' })
|
|
|
|
|
}
|
|
|
|
|
isLoading.value = true
|
|
|
|
|
const data = await getListAssembleReportApi(queryParams)
|
|
|
|
|
isLoading.value = false
|
|
|
|
|
data.list.forEach((e) => {
|
|
|
|
|
e.createTime = formatDate(e.createTime, 'YYYY-MM-DD')
|
|
|
|
|
})
|
|
|
|
|
// 数组追加
|
|
|
|
|
dataList.value.push(...data.list)
|
|
|
|
|
// 分页条件
|
|
|
|
@ -35,8 +46,6 @@ const getData = async () => {
|
|
|
|
|
isLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 是否分页结束
|
|
|
|
|
const isFinish = ref(false)
|
|
|
|
|
// 是否触发下拉刷新
|
|
|
|
|
const isTriggered = ref(false)
|
|
|
|
|
// 自定义下拉刷新被触发
|
|
|
|
@ -56,17 +65,20 @@ const onRefresherrefresh = async () => {
|
|
|
|
|
<template>
|
|
|
|
|
<view class="viewport">
|
|
|
|
|
<scroll-view enable-back-to-top scroll-y class="data-list" refresher-enabled :refresher-triggered="isTriggered"
|
|
|
|
|
@refresherrefresh="onRefresherrefresh" @scrolltolower="getListData">
|
|
|
|
|
@refresherrefresh="onRefresherrefresh" @scrolltolower="getData">
|
|
|
|
|
<view class="list-item" v-for="(item, index) in dataList" :key="item.dispatchId">
|
|
|
|
|
<view class="item-hd">
|
|
|
|
|
<view class="index">{{ dataList.length - index }}</view>
|
|
|
|
|
<view class="assembleCode">包装条形码:{{ item.assembleCode}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="time label">报工时间: {{ item.createTime }}</view>
|
|
|
|
|
<view class="code label">产品编码: {{ item.projectSubCode }}</view>
|
|
|
|
|
<view class="name label">产品名称: {{ item.projectSubName }}</view>
|
|
|
|
|
<view class="procedureName label">报工工序: {{ item.procedureName }}</view>
|
|
|
|
|
<view class="code label">报工数量: {{ item.amount }}</view>
|
|
|
|
|
<view class="ownerName label">报工人: {{ item.ownerName }}</view>
|
|
|
|
|
<view class="item-row">
|
|
|
|
|
<view class="procedureName label">报工工序: {{ item.procedureName }}</view>
|
|
|
|
|
<view class="code label">报工数量: {{ item.amount }}</view>
|
|
|
|
|
<view class="ownerName label">报工人: {{ item.ownerName }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 底部提示文字 -->
|
|
|
|
|
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
|
|
|
|
@ -136,7 +148,7 @@ page {
|
|
|
|
|
background: #F6F9F3;
|
|
|
|
|
.index {
|
|
|
|
|
width: 40rpx;
|
|
|
|
|
background: #3AC33D;
|
|
|
|
|
background: #c1e2c2;
|
|
|
|
|
color: #015C03;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
@ -153,6 +165,11 @@ page {
|
|
|
|
|
width: 40rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.item-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding-right: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
.label {
|
|
|
|
|
line-height: 60rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|