Merge branch 'master' of http://192.168.30.2:3000/bonus/bonus-material-app
This commit is contained in:
		
						commit
						effce51e87
					
				| 
						 | 
					@ -307,7 +307,7 @@ const getTableList = async (isTap = false) => {
 | 
				
			||||||
// 滚动触底事件
 | 
					// 滚动触底事件
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
  if (total.value > tableList.value.length) {
 | 
					  if (total.value > tableList.value.length) {
 | 
				
			||||||
    queryParams.value.pageNum++
 | 
					    queryParams.value.pageSize += 5
 | 
				
			||||||
    getTableList()
 | 
					    getTableList()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -129,7 +129,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const onScrollTolower = debounce(() => {
 | 
						const onScrollTolower = debounce(() => {
 | 
				
			||||||
		if (total.value > tableList.value.length) {
 | 
							if (total.value > tableList.value.length) {
 | 
				
			||||||
			queryParams.value.pageNum++
 | 
								queryParams.value.pageSize += 5
 | 
				
			||||||
			getTableList()
 | 
								getTableList()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}, 500)
 | 
						}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,7 +159,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const onScrollTolower = debounce(() => {
 | 
						const onScrollTolower = debounce(() => {
 | 
				
			||||||
		if (total.value > tableList.value.length) {
 | 
							if (total.value > tableList.value.length) {
 | 
				
			||||||
			queryParams.value.pageNum++
 | 
								queryParams.value.pageSize += 5
 | 
				
			||||||
			getTableList()
 | 
								getTableList()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}, 500)
 | 
						}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -175,7 +175,7 @@ const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -145,7 +145,7 @@ onShow(() => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -295,7 +295,7 @@ const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log("下一页")
 | 
					    console.log("下一页")
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -227,7 +227,7 @@ const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('下一页')
 | 
					    console.log('下一页')
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,7 +133,7 @@ const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -137,7 +137,7 @@ const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,7 @@
 | 
				
			||||||
            </view>
 | 
					            </view>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <view class="table-list-item">
 | 
					            <view class="table-list-item">
 | 
				
			||||||
                <uni-row :gutter="24" style="display: flex;align-items: center">
 | 
					                <uni-row :gutter="24" style="display: flex; align-items: center">
 | 
				
			||||||
                    <uni-col :span="6">出库方式:</uni-col>
 | 
					                    <uni-col :span="6">出库方式:</uni-col>
 | 
				
			||||||
                    <uni-col :span="6">
 | 
					                    <uni-col :span="6">
 | 
				
			||||||
                        <view class="coding-btn" @tap="onCodeIdentify">编码识别</view>
 | 
					                        <view class="coding-btn" @tap="onCodeIdentify">编码识别</view>
 | 
				
			||||||
| 
						 | 
					@ -78,8 +78,8 @@
 | 
				
			||||||
            >
 | 
					            >
 | 
				
			||||||
                <view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId">
 | 
					                <view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId">
 | 
				
			||||||
                    <uni-row :gutter="24">
 | 
					                    <uni-row :gutter="24">
 | 
				
			||||||
                        <uni-col :span="6">物资类型:</uni-col>
 | 
					                        <uni-col :span="8">物资类型:</uni-col>
 | 
				
			||||||
                        <uni-col :span="14">
 | 
					                        <uni-col :span="12">
 | 
				
			||||||
                            <view class="cont">{{ item.materialName }}</view>
 | 
					                            <view class="cont">{{ item.materialName }}</view>
 | 
				
			||||||
                        </uni-col>
 | 
					                        </uni-col>
 | 
				
			||||||
                        <uni-col :span="4">
 | 
					                        <uni-col :span="4">
 | 
				
			||||||
| 
						 | 
					@ -90,7 +90,10 @@
 | 
				
			||||||
                                        borderColor="#409eff"
 | 
					                                        borderColor="#409eff"
 | 
				
			||||||
                                        activeBorderColor="#409eff"
 | 
					                                        activeBorderColor="#409eff"
 | 
				
			||||||
                                        :checked="item.checked"
 | 
					                                        :checked="item.checked"
 | 
				
			||||||
                                        :disabled="maxNum === isSelectNum && !item.checked"
 | 
					                                        :disabled="
 | 
				
			||||||
 | 
					                                            (maxNum === isSelectNum && !item.checked) ||
 | 
				
			||||||
 | 
					                                            isWithinOneMonth(item.nextCheckTime)
 | 
				
			||||||
 | 
					                                        "
 | 
				
			||||||
                                        style="transform: scale(0.7)"
 | 
					                                        style="transform: scale(0.7)"
 | 
				
			||||||
                                    />
 | 
					                                    />
 | 
				
			||||||
                                </label>
 | 
					                                </label>
 | 
				
			||||||
| 
						 | 
					@ -98,29 +101,47 @@
 | 
				
			||||||
                        </uni-col>
 | 
					                        </uni-col>
 | 
				
			||||||
                    </uni-row>
 | 
					                    </uni-row>
 | 
				
			||||||
                    <uni-row :gutter="24">
 | 
					                    <uni-row :gutter="24">
 | 
				
			||||||
                        <uni-col :span="6">规格型号:</uni-col>
 | 
					                        <uni-col :span="8">规格型号:</uni-col>
 | 
				
			||||||
                        <uni-col :span="16">
 | 
					                        <uni-col :span="14">
 | 
				
			||||||
                            <view class="cont">{{ item.materialModel }}</view>
 | 
					                            <view class="cont">{{ item.materialModel }}</view>
 | 
				
			||||||
                        </uni-col>
 | 
					                        </uni-col>
 | 
				
			||||||
                    </uni-row>
 | 
					                    </uni-row>
 | 
				
			||||||
                    <uni-row :gutter="24">
 | 
					                    <uni-row :gutter="24">
 | 
				
			||||||
                        <uni-col :span="6">设备编码:</uni-col>
 | 
					                        <uni-col :span="8">设备编码:</uni-col>
 | 
				
			||||||
                        <uni-col :span="16">
 | 
					                        <uni-col :span="14">
 | 
				
			||||||
                            <view class="cont">{{ item.maCode }}</view>
 | 
					                            <view class="cont">{{ item.maCode }}</view>
 | 
				
			||||||
                        </uni-col>
 | 
					                        </uni-col>
 | 
				
			||||||
                    </uni-row>
 | 
					                    </uni-row>
 | 
				
			||||||
                    <uni-row :gutter="24">
 | 
					                    <uni-row :gutter="24">
 | 
				
			||||||
                        <uni-col :span="6">设备状态:</uni-col>
 | 
					                        <uni-col :span="8">设备状态:</uni-col>
 | 
				
			||||||
                        <uni-col :span="16">
 | 
					                        <uni-col :span="14">
 | 
				
			||||||
                            <view class="cont">{{ item.statusName }}</view>
 | 
					                            <view class="cont">{{ item.statusName }}</view>
 | 
				
			||||||
                        </uni-col>
 | 
					                        </uni-col>
 | 
				
			||||||
                    </uni-row>
 | 
					                    </uni-row>
 | 
				
			||||||
                    <uni-row :gutter="24">
 | 
					                    <uni-row :gutter="24">
 | 
				
			||||||
                        <uni-col :span="6">设备数量:</uni-col>
 | 
					                        <uni-col :span="8">设备数量:</uni-col>
 | 
				
			||||||
                        <uni-col :span="16">
 | 
					                        <uni-col :span="14">
 | 
				
			||||||
                            <view class="cont">1</view>
 | 
					                            <view class="cont">1</view>
 | 
				
			||||||
                        </uni-col>
 | 
					                        </uni-col>
 | 
				
			||||||
                    </uni-row>
 | 
					                    </uni-row>
 | 
				
			||||||
 | 
					                    <uni-row :gutter="24">
 | 
				
			||||||
 | 
					                        <uni-col :span="8">本次检验时间:</uni-col>
 | 
				
			||||||
 | 
					                        <uni-col :span="14">
 | 
				
			||||||
 | 
					                            <view class="cont">{{ item.thisCheckTime }}</view>
 | 
				
			||||||
 | 
					                        </uni-col>
 | 
				
			||||||
 | 
					                    </uni-row>
 | 
				
			||||||
 | 
					                    <uni-row :gutter="24">
 | 
				
			||||||
 | 
					                        <uni-col :span="8">下次检验时间:</uni-col>
 | 
				
			||||||
 | 
					                        <uni-col :span="14">
 | 
				
			||||||
 | 
					                            <view
 | 
				
			||||||
 | 
					                                class="cont"
 | 
				
			||||||
 | 
					                                :style="{
 | 
				
			||||||
 | 
					                                    color: isWithinOneMonth(item.nextCheckTime) ? 'red' : '',
 | 
				
			||||||
 | 
					                                }"
 | 
				
			||||||
 | 
					                                >{{ item.nextCheckTime }}</view
 | 
				
			||||||
 | 
					                            >
 | 
				
			||||||
 | 
					                        </uni-col>
 | 
				
			||||||
 | 
					                    </uni-row>
 | 
				
			||||||
                </view>
 | 
					                </view>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <view class="loading-text">
 | 
					                <view class="loading-text">
 | 
				
			||||||
| 
						 | 
					@ -157,6 +178,7 @@ const maxNum = ref(0)
 | 
				
			||||||
const total = ref(0)
 | 
					const total = ref(0)
 | 
				
			||||||
const boxCode = ref('')
 | 
					const boxCode = ref('')
 | 
				
			||||||
const boxInfo = ref({})
 | 
					const boxInfo = ref({})
 | 
				
			||||||
 | 
					const checkedIds = ref([])
 | 
				
			||||||
// 编码设备列表查询参数
 | 
					// 编码设备列表查询参数
 | 
				
			||||||
const queryCodeParams = ref({
 | 
					const queryCodeParams = ref({
 | 
				
			||||||
    pageNum: 1,
 | 
					    pageNum: 1,
 | 
				
			||||||
| 
						 | 
					@ -186,6 +208,20 @@ onShow(() => {
 | 
				
			||||||
    console.log(queryParams.value)
 | 
					    console.log(queryParams.value)
 | 
				
			||||||
    getCodeDetailData(queryParams.value.id, queryParams.value.publishTask, queryParams.value.typeId) //获取详情
 | 
					    getCodeDetailData(queryParams.value.id, queryParams.value.publishTask, queryParams.value.typeId) //获取详情
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const isWithinOneMonth = (dateStr) => {
 | 
				
			||||||
 | 
					    if (!dateStr) {
 | 
				
			||||||
 | 
					        return false
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    const inputDate = new Date(dateStr)
 | 
				
			||||||
 | 
					    const today = new Date()
 | 
				
			||||||
 | 
					    today.setHours(0, 0, 0, 0) // 清除时分秒
 | 
				
			||||||
 | 
					    const futureLimit = new Date(today)
 | 
				
			||||||
 | 
					    futureLimit.setDate(today.getDate() + 30)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return inputDate >= today && inputDate <= futureLimit
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 获取编码列表
 | 
					// 获取编码列表
 | 
				
			||||||
const getCodeDetailData = async (id, publishTask, typeId) => {
 | 
					const getCodeDetailData = async (id, publishTask, typeId) => {
 | 
				
			||||||
    console.log('yyyyyyyyyy', id, publishTask, typeId)
 | 
					    console.log('yyyyyyyyyy', id, publishTask, typeId)
 | 
				
			||||||
| 
						 | 
					@ -203,16 +239,27 @@ const getCodeDetailData = async (id, publishTask, typeId) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 获取编码列表
 | 
					// 获取编码列表
 | 
				
			||||||
const getCodeDeviceListData = async () => {
 | 
					const getCodeDeviceListData = async () => {
 | 
				
			||||||
    // 记录已勾选的设备ID
 | 
					    const checkedIdSet = new Set(checkedIds.value)
 | 
				
			||||||
    const checkedIds = codeDeviceList.value.filter(e => e.checked).map(e => e.maId)
 | 
					 | 
				
			||||||
    const res = await getCodeDeviceListAPI(queryCodeParams.value)
 | 
					    const res = await getCodeDeviceListAPI(queryCodeParams.value)
 | 
				
			||||||
    // 合并新数据,并保持已勾选项的 checked 状态
 | 
					    const newRows = res.rows || []
 | 
				
			||||||
    const newRows = res.rows.map(e => ({
 | 
					    const map = new Map()
 | 
				
			||||||
        ...e,
 | 
					
 | 
				
			||||||
        checked: checkedIds.includes(e.maId)
 | 
					    // 先放入旧数据(可保留滚动加载场景)
 | 
				
			||||||
    }))
 | 
					    codeDeviceList.value.forEach((item) => {
 | 
				
			||||||
    codeDeviceList.value.push(...newRows)
 | 
					        map.set(item.maId, item)
 | 
				
			||||||
    total.value = res.total
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 再放入新数据,设置 checked 状态
 | 
				
			||||||
 | 
					    newRows.forEach((item) => {
 | 
				
			||||||
 | 
					        map.set(item.maId, {
 | 
				
			||||||
 | 
					            ...item,
 | 
				
			||||||
 | 
					            checked: checkedIdSet.has(item.maId),
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 更新最终列表
 | 
				
			||||||
 | 
					    codeDeviceList.value = Array.from(map.values())
 | 
				
			||||||
 | 
					    total.value = res.total || 0
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 编码搜索按钮
 | 
					// 编码搜索按钮
 | 
				
			||||||
| 
						 | 
					@ -226,7 +273,7 @@ const onCodeSearch = () => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    // console.log('滚动触底--')
 | 
					    // console.log('滚动触底--')
 | 
				
			||||||
    if (total.value > codeDeviceList.value.length) {
 | 
					    if (total.value > codeDeviceList.value.length) {
 | 
				
			||||||
        queryCodeParams.value.pageNum++
 | 
					        queryCodeParams.value.pageSize += 5
 | 
				
			||||||
        getCodeDeviceListData()
 | 
					        getCodeDeviceListData()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					@ -239,6 +286,11 @@ const finish = computed(() => {
 | 
				
			||||||
// 复选框事件
 | 
					// 复选框事件
 | 
				
			||||||
const onChangeChecked = (item) => {
 | 
					const onChangeChecked = (item) => {
 | 
				
			||||||
    item.checked = !item.checked
 | 
					    item.checked = !item.checked
 | 
				
			||||||
 | 
					    if (item.checked) {
 | 
				
			||||||
 | 
					        checkedIds.value.push(item.maId)
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					        checkedIds.value = checkedIds.value.filter((maId) => maId !== item.maId)
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 计算已选择数量
 | 
					// 计算已选择数量
 | 
				
			||||||
| 
						 | 
					@ -430,7 +482,7 @@ const boxOutBound = async () => {
 | 
				
			||||||
            outNum: 1,
 | 
					            outNum: 1,
 | 
				
			||||||
            parentId,
 | 
					            parentId,
 | 
				
			||||||
            typeId,
 | 
					            typeId,
 | 
				
			||||||
            publishTask
 | 
					            publishTask,
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    console.log(paramsList)
 | 
					    console.log(paramsList)
 | 
				
			||||||
| 
						 | 
					@ -525,8 +577,6 @@ const handleScanError = (error) => {
 | 
				
			||||||
    uni.showToast({ title: error.message, icon: 'none' })
 | 
					    uni.showToast({ title: error.message, icon: 'none' })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//查看是否是该规格型号
 | 
					//查看是否是该规格型号
 | 
				
			||||||
const getMaInfoScan = async () => {
 | 
					const getMaInfoScan = async () => {
 | 
				
			||||||
    let param = {
 | 
					    let param = {
 | 
				
			||||||
| 
						 | 
					@ -574,7 +624,7 @@ const confirmCodeOutBound = async () => {
 | 
				
			||||||
        typeId,
 | 
					        typeId,
 | 
				
			||||||
        typeName: codeData.value.typeName,
 | 
					        typeName: codeData.value.typeName,
 | 
				
			||||||
        typeModelName: codeData.value.typeModelName,
 | 
					        typeModelName: codeData.value.typeModelName,
 | 
				
			||||||
        publishTask
 | 
					        publishTask,
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
 | 
					    const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
 | 
				
			||||||
    console.log('333333333333', res)
 | 
					    console.log('333333333333', res)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -212,7 +212,7 @@ onShow(() => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,7 +159,7 @@ const onCodeSearch = () => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    // console.log('滚动触底--')
 | 
					    // console.log('滚动触底--')
 | 
				
			||||||
    if (total.value > codeDeviceList.value.length) {
 | 
					    if (total.value > codeDeviceList.value.length) {
 | 
				
			||||||
        queryCodeParams.value.pageNum++
 | 
					        queryCodeParams.value.pageSize += 5
 | 
				
			||||||
        getCodeDeviceListData()
 | 
					        getCodeDeviceListData()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -204,7 +204,7 @@ onShow(() => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -379,7 +379,7 @@ const handleReview = (action) => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    // console.log('滚动触底--')
 | 
					    // console.log('滚动触底--')
 | 
				
			||||||
    if (total.value > codeDeviceList.value.length) {
 | 
					    if (total.value > codeDeviceList.value.length) {
 | 
				
			||||||
        queryCodeParams.value.pageNum++
 | 
					        queryCodeParams.value.pageSize += 5
 | 
				
			||||||
        getCodeDeviceListData()
 | 
					        getCodeDeviceListData()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -264,7 +264,7 @@ onShow(() => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -223,7 +223,7 @@ onShow(() => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -212,7 +212,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const onScrollTolower = debounce(() => {
 | 
						const onScrollTolower = debounce(() => {
 | 
				
			||||||
		if (total.value > tableList.value.length) {
 | 
							if (total.value > tableList.value.length) {
 | 
				
			||||||
			queryParams.value.pageNum++
 | 
								queryParams.value.pageSize += 5
 | 
				
			||||||
			getTableList()
 | 
								getTableList()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}, 500)
 | 
						}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -225,7 +225,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const onScrollTolower = debounce(() => {
 | 
						const onScrollTolower = debounce(() => {
 | 
				
			||||||
		if (total.value > tableList.value.length) {
 | 
							if (total.value > tableList.value.length) {
 | 
				
			||||||
			queryParams.value.pageNum++
 | 
								queryParams.value.pageSize += 5
 | 
				
			||||||
			getTableList()
 | 
								getTableList()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}, 500)
 | 
						}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -217,7 +217,7 @@ onShow(() => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -245,7 +245,7 @@ onShow(() => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -257,7 +257,7 @@ const getTableList = async (isTap = false) => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -260,7 +260,7 @@ const getTableList = async (isTap = false) => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
  // 判断是否还有更多数据
 | 
					  // 判断是否还有更多数据
 | 
				
			||||||
  if (tableList.value.length < total.value) {
 | 
					  if (tableList.value.length < total.value) {
 | 
				
			||||||
    queryParams.value.pageNum++
 | 
					    queryParams.value.pageSize += 5
 | 
				
			||||||
    getTableList(false)
 | 
					    getTableList(false)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -225,7 +225,7 @@ const getTableList = async (isTap = false) => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -237,7 +237,7 @@ const getTableList = async (isTap = false) => {
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    // 判断是否还有更多数据
 | 
					    // 判断是否还有更多数据
 | 
				
			||||||
    if (tableList.value.length < total.value) {
 | 
					    if (tableList.value.length < total.value) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 5
 | 
				
			||||||
        getTableList(false)
 | 
					        getTableList(false)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,16 +2,16 @@
 | 
				
			||||||
    <!-- 退料任务 -->
 | 
					    <!-- 退料任务 -->
 | 
				
			||||||
    <view class="accept page-common"> 
 | 
					    <view class="accept page-common"> 
 | 
				
			||||||
        <uni-row :gutter="24" class="search-form"> 
 | 
					        <uni-row :gutter="24" class="search-form"> 
 | 
				
			||||||
            <uni-col :span="16">
 | 
					            <uni-col :span="18">
 | 
				
			||||||
                <view>
 | 
					                <view>
 | 
				
			||||||
                    <uni-easyinput placeholder="请输入内容"/>
 | 
					                    <uni-easyinput v-model="queryParams.keyWord" placeholder="请输入内容"/>
 | 
				
			||||||
                </view>
 | 
					                </view>
 | 
				
			||||||
            </uni-col>
 | 
					            </uni-col>
 | 
				
			||||||
            <uni-col :span="4">
 | 
					            <uni-col :span="6">
 | 
				
			||||||
                <view class="search" @click="">查询</view>
 | 
					                <view class="search" @click="getTableList">查询</view>
 | 
				
			||||||
            </uni-col> 
 | 
					            </uni-col>
 | 
				
			||||||
        </uni-row>
 | 
					        </uni-row>
 | 
				
			||||||
		<uni-row :gutter="24" class="search-form">
 | 
							<!-- <uni-row :gutter="24" class="search-form">
 | 
				
			||||||
			<uni-col :span="5">
 | 
								<uni-col :span="5">
 | 
				
			||||||
			    <view style="font-size: 24rpx;">物资类型:</view> 
 | 
								    <view style="font-size: 24rpx;">物资类型:</view> 
 | 
				
			||||||
			</uni-col>
 | 
								</uni-col>
 | 
				
			||||||
| 
						 | 
					@ -44,7 +44,7 @@
 | 
				
			||||||
                    </view> 
 | 
					                    </view> 
 | 
				
			||||||
				</scroll-view> 
 | 
									</scroll-view> 
 | 
				
			||||||
			</uni-col>
 | 
								</uni-col>
 | 
				
			||||||
		</uni-row>
 | 
							</uni-row> -->
 | 
				
			||||||
		<view style="width:100%;">
 | 
							<view style="width:100%;">
 | 
				
			||||||
			<uni-table border stripe emptyText="">
 | 
								<uni-table border stripe emptyText="">
 | 
				
			||||||
					<uni-tr>
 | 
										<uni-tr>
 | 
				
			||||||
| 
						 | 
					@ -185,26 +185,27 @@ const queryParams = ref({
 | 
				
			||||||
const onScrollTolower = debounce(() => {
 | 
					const onScrollTolower = debounce(() => {
 | 
				
			||||||
    console.log('触底事件')
 | 
					    console.log('触底事件')
 | 
				
			||||||
    if (total.value > tableList.value.length) {
 | 
					    if (total.value > tableList.value.length) {
 | 
				
			||||||
        queryParams.value.pageNum++
 | 
					        queryParams.value.pageSize += 10
 | 
				
			||||||
        getTableList()
 | 
					        getTableList()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}, 500)
 | 
					}, 500)
 | 
				
			||||||
// 获取列表数据
 | 
					// 获取列表数据
 | 
				
			||||||
const getTableList = async (isTap = false) => {
 | 
					const getTableList = async (isTap = false) => {
 | 
				
			||||||
    // console.log('queryParams.value查询参数', queryParams.value)
 | 
					  const res = await getRetainedEquipmentListApi(queryParams.value);
 | 
				
			||||||
    const res = await getRetainedEquipmentListApi(queryParams.value)
 | 
					  const newRows = res?.data?.rows || [];
 | 
				
			||||||
	console.log(res)
 | 
					  total.value = res?.data?.total || 0;
 | 
				
			||||||
    total.value = res.data.total
 | 
					
 | 
				
			||||||
    if (isTap) {
 | 
					  if (isTap || queryParams.pageNum === 1) {
 | 
				
			||||||
        tableList.value = res.data.rows
 | 
					    // 刷新或tab切换,直接替换
 | 
				
			||||||
    } else {
 | 
					    tableList.value = newRows;
 | 
				
			||||||
        if (res.data.rows.length == 0) {
 | 
					  } else {
 | 
				
			||||||
            tableList.value = []
 | 
					    // 加载更多,按 typeId 去重后合并
 | 
				
			||||||
        } else {
 | 
					    const existingIds = new Set(tableList.value.map(item => item.typeId));
 | 
				
			||||||
            tableList.value.push(...res.data.rows)
 | 
					    const filteredRows = newRows.filter(item => !existingIds.has(item.typeId));
 | 
				
			||||||
        }
 | 
					    tableList.value.push(...filteredRows);
 | 
				
			||||||
    }
 | 
					  }
 | 
				
			||||||
}
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const getRetainedEquipmentList = async () => {
 | 
					const getRetainedEquipmentList = async () => {
 | 
				
			||||||
	const res = await getRetainedEquipmentListApi({isApp:1})
 | 
						const res = await getRetainedEquipmentListApi({isApp:1})
 | 
				
			||||||
	console.log(res)
 | 
						console.log(res)
 | 
				
			||||||
| 
						 | 
					@ -264,10 +265,10 @@ onLoad(() => {
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
        // 搜索按钮
 | 
					        // 搜索按钮
 | 
				
			||||||
        .search {
 | 
					        .search {
 | 
				
			||||||
            height: 80rpx;
 | 
					            height: 60rpx;
 | 
				
			||||||
            background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
 | 
					            background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
 | 
				
			||||||
            text-align: center;
 | 
					            text-align: center;
 | 
				
			||||||
            line-height: 80rpx;
 | 
					            line-height: 60rpx;
 | 
				
			||||||
            color: #fff;
 | 
					            color: #fff;
 | 
				
			||||||
            border-radius: 12rpx;
 | 
					            border-radius: 12rpx;
 | 
				
			||||||
            font-size: 28rpx;
 | 
					            font-size: 28rpx;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@ import { http } from '@/utils/http'
 | 
				
			||||||
export const getRetainedEquipmentListApi = (data) => {
 | 
					export const getRetainedEquipmentListApi = (data) => {
 | 
				
			||||||
    return http({
 | 
					    return http({
 | 
				
			||||||
      method: 'GET',
 | 
					      method: 'GET',
 | 
				
			||||||
      url: '/material/complex_query/getRetainedEquipmentList',
 | 
					      url: '/material/complex_query/getPersonNum',
 | 
				
			||||||
      data,
 | 
					      data,
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue