This commit is contained in:
oneao committed 2026-03-28 17:22:49 +08:00
1 parent ce466130c0
commit 9c026f00ad
36 files changed
+2230 -1036

No files matched your search

@@ -1,152 +1,269 @@
<script setup lang="ts">
import { deleteFileApi } from '@/request/api'
import { toast } from 'sard-uniapp'
import { ref } from 'vue'
import { loadPageDataApi } from '@/request/api'
import { useUserStore } from '@/store'
import { deepEqual, groupFieldsBySpan } from '@/utils/common'
import { getCurrentDate } from '@/utils/time'
const userStore = useUserStore()
onShow(() => {
userStore.requireLogin()
const pagingRef = ref<any>(null)
const dataList = ref<any[]>([])
const itemFields = [
{ label: '录入时间', value: item => item.b_inputdatetime, span: 12 },
{ label: '文件数量', value: item => item.v_file_count, span: 12 },
]
const groupedFields = groupFieldsBySpan(itemFields)
// 搜索关键字
const searchValue = ref('')
// onShow(() => {
// pagingRef.value?.reload()
// })
onMounted(() => {
pagingRef.value?.reload()
})
const swiperCurrent = ref(0)
const swiperList = [
{},
{},
{},
]
function handleToLogin() {
uni.reLaunch({
url: '/pages-sub/login/index',
})
// 搜索
function handleSearch() {
pagingRef.value.reload()
}
function toLinkUrl(url) {
if (!url) {
return
// 模拟分页请求
function queryList(pageNo: number, pageSize: number) {
toast.loading('正在加载中')
const userid = userStore.userInfo.userid
let searchCondition = `2 > 1 AND b_inputuser_id = '${userid}'`
if (searchValue.value) {
searchCondition += `b_container_no LIKE '%${searchValue.value}%' `
}
uni.navigateTo({
url,
loadPageDataApi({
viewName: 'v_container',
searchCondition,
page: pageNo,
size: pageSize,
orderField: 'b_inputdatetime desc',
})
.then((res) => {
const rows = res.data.rows || []
console.log(rows)
if (rows) {
pagingRef.value.complete(rows)
}
})
.finally(() => {
toast.hide()
})
}
function deleteAliyunFiles() {
const subids = [
787154320330821,
787154320388165,
]
subids.forEach((subid) => {
deleteFileApi(subid)
function handleToFile(itemData) {
const searchids = [itemData.b_id, itemData.father]
.filter(Boolean)
.join(',')
uni.navigateTo({
url: `/pages-sub/file/index?moduleid=xc_conyard_in&father=${itemData.father}&searchids=${encodeURIComponent(searchids)}&cateid=016&edit=1`,
})
}
</script>
<template>
<view>
<view class="swiper-container">
<swiper
:current="swiperCurrent"
autoplay
:interval="3000"
class="swiper"
@change="swiperCurrent = $event.detail.current"
<z-paging
ref="pagingRef" v-model="dataList"
auto-show-back-to-top
@query="queryList"
>
<template #top>
<view style="border-bottom: 1px solid #ddd;">
<sar-search
v-model="searchValue"
placeholder="请输入箱号搜索"
@search="handleSearch"
/>
</view>
</template>
<!-- 列表内容 -->
<view
v-for="(item, index) in dataList"
:key="index"
class="list-item"
>
<swiper-item>
<image
src="@/static/images/bg.jpg"
style="width: 100%;height:100%"
/>
</swiper-item>
<swiper-item>
<image
src="@/static/images/bg1.jpg"
style="width: 100%;height:100%"
/>
</swiper-item>
<swiper-item>
<image
src="@/static/images/bg2.jpg"
style="width: 100%;height:100%"
/>
</swiper-item>
</swiper>
<sar-swiper-dot
:current="swiperCurrent"
:list="swiperList"
/>
</view>
<view v-if="userStore.isLogined" class="grid-container">
<sar-grid :columns="1" gap="24rpx">
<sar-grid-item
@click="toLinkUrl('/pages-sub/upload/index')"
>
<view class="grid-item">
<image src="/static/images/home/waybill.png" />
<text>集装箱装货采集</text>
<view class="list-item__header">
<view class="list-item__main">
<sar-image
:src="item.b_container_img"
width="160rpx"
height="160rpx"
/>
</view>
</sar-grid-item>
</sar-grid>
</view>
<sar-result v-else status="warning" title="尚未登陆" style="margin-top: 32rpx;">
<sar-button
@click="handleToLogin"
>
前去登录
</sar-button>
</sar-result>
</view>
<view class="list-item__body">
<sar-row>
<sar-col :span="12">
<view class="list-item__info">
<view class="list-item__label">
集装箱号:
</view>
<view class="list-item__value" style="font-weight: bold;color:var(--sar-primary)">
{{ item.b_container_no }}
</view>
</view>
</sar-col>
</sar-row>
<sar-row>
<sar-col :span="12">
<view class="list-item__info">
<view class="list-item__label">
录入时间:
</view>
<view class="list-item__value">
{{ item.b_inputdatetime }}
</view>
</view>
</sar-col>
</sar-row>
<sar-row>
<sar-col :span="12">
<view class="list-item__info">
<view class="list-item__label">
照片数量:
</view>
<view class="list-item__value">
{{ item.v_file_count }}
</view>
</view>
</sar-col>
</sar-row>
</view>
<view class="list-item__footer">
<!-- <sar-button inline size="small" square @click="handleToFile(item)">
拍照
</sar-button> -->
</view>
<view class="list-item__line" />
</view>
</z-paging>
</view>
</template>
<style lang="scss" scoped>
<style scoped lang="scss">
@import '@/style/mixins.scss';
page {
background-color: #f1f5f9;
}
.dialog-loading {
display: flex;
justify-content: center;
align-items: center;
height: 200rpx;
}
.swiper-container {
position: relative;
.swiper {
height: 400rpx;
width: 100%;
/* tab 栏 */
.tabs {
display: flex;
border-bottom: 2rpx solid #eee;
background-color: #fff;
.tabs__item {
flex: 1;
text-align: center;
padding: 16rpx 0;
font-size: 30rpx;
color: #888;
}
.tabs__item--active {
color: var(--sar-primary);
font-weight: bold;
border-bottom: 4rpx solid var(--sar-primary);
}
}
.grid-container {
padding-top: 32rpx;
/* 列表项 */
.list-item {
position: relative;
padding: 16rpx;
background-color: #fff;
&.list-item--desktop {
.list-item__header {
max-width: 1000rpx;
margin: 0 auto;
}
:deep(.sar-grid__content) {
background-color: #fff;
}
:deep(.sar-grid) {
row-gap: 0 !important;
}
:deep(.sar-grid__item) {
margin-bottom: 24rpx;
.list-item__body {
max-width: 1000rpx;
margin: 0 auto;
}
.list-item__footer {
max-width: 1000rpx;
margin: 0 auto;
}
}
:deep(.sar-grid__wrapper) {
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
}
:deep(.sar-badge) {
width: 42rpx;
height: 42rpx;
}
.grid-item {
.list-item__header {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 36rpx;
image {
width: 128rpx;
height: 128rpx;
}
.list-item__body {
padding: 24rpx 0rpx;
display: flex;
flex-direction: column;
@include flexGap(16rpx, 'column');
.list-item__info {
display: flex;
align-items: start;
width: 100%;
font-size: 32rpx;
line-height: 1;
.list-item__label {
display: block;
min-width: 192rpx;
color: #4b5563;
text-align: right;
white-space: nowrap;
}
.list-item__value {
flex: 1;
color: #111827;
word-break: break-all;
}
}
text {
margin-top: 16rpx;
font-weight: 600;
color: #000;
}
.list-item__footer {
display: flex;
justify-content: flex-end;
@include flexGap(36rpx, '');
:deep(.sar-button) {
padding: 0rpx 48rpx;
font-size: 32rpx;
}
}
.list-item__line {
position: absolute;
bottom: 0rpx;
left: 0rpx;
height: 1px;
width: 100%;
background-color: #dcdcdc;
}
}
</style>