报表申报智能运输页面完成

This commit is contained in:
zx
2026-04-23 14:35:54 +08:00
parent 6f1db0f92e
commit 5ca85c1f0d
53 changed files with 3659 additions and 292 deletions

View File

@@ -1,6 +1,6 @@
<!-- 仓库/存储区选择 -->
<template>
<navigation :title="isWarehousing.value ? '仓库选择' : '存储区选择'" :back-url="backUrl"></navigation>
<navigation :title="title" :back-url="backUrl"></navigation>
<view class="contentBox">
<view class="topSearch">
@@ -11,7 +11,7 @@
<!-- 仓库/存储列表 -->
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getList">
<uni-list class="listBox">
<uni-list-item v-for="item in infoList" :key="item.id" clickable @click="onChecked(item)">
<uni-list-item v-for="item in infoList" :key="item.id" clickable @tap="onChecked(item)">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;" v-if="isWarehousing">
<view class="line title">
@@ -34,8 +34,8 @@
<view class="line content">
<p>备注</p>
<p>
<span v-if="item?.remark"></span>
<span v-else class="empty">未填写</span>
<text v-if="item?.remark"></text>
<text v-else class="empty">未填写</text>
</p>
</view>
@@ -46,8 +46,8 @@
</view>
<view class="line content">
<p>
<span v-if="item?.remark">{{ item?.remark }}</span>
<span v-else class="empty">未填写</span>
<text v-if="item?.remark">{{ item?.remark }}</text>
<text v-else class="empty">未填写</text>
</p>
</view>
</view>
@@ -58,14 +58,36 @@
</view>
</template>
<script setup>
import { computed, ref, toRefs } from 'vue';
import { ref, toRefs } from 'vue';
import { onShow } from "@dcloudio/uni-app";
import { getWarehousingInfo } from '@/api/system';
import getRepository from "@/api/getRepository";
import { objectToQuery } from '../until';
import Navigation from '../components/Navigation.vue';
import { watch } from 'vue';
const OPERATE_CONFIG = {
materialQuery: {
toCheckUrl: '/pages/warehousing/Declaration/components/materialQueryDetail',
title: '请选择物资查询仓库',
},
inventoryAgeView: {
toCheckUrl: '/pages/warehousing/InventoryInfo/components/inventoryAgeDetail',
title: '请选择物资库龄查询仓库'
},
dailyReport: {
toCheckUrl: '/pages/warehousing/Report/components/dailyDetail',
title: '请选择查看日报表的仓库'
},
monthlyReport: {
toCheckUrl: '/pages/warehousing/Report/components/monthlyDetail',
title: '请选择查看月报表的仓库'
},
warehouseReport: {
toCheckUrl: '/pages/warehousing/Report/components/warehouseDetail',
title: '请选择查看库存的仓库'
},
}
const props = defineProps({
// 是否为仓库查询
isWarehousing: {
@@ -85,9 +107,8 @@ const { isWarehousing, pathParams } = toRefs(props)
const queryParams = ref({
keyword: ''
})
const title = ref('')
const backUrl = ref('')
// stockIn 入库单开单 stockIn_Detail入库单编辑 issueUniqueCode唯一码 issueUniqueCode_inbound入库生成唯一码
const keyType = computed(() => pathParams.value.type || pathParams.value.back)
// 绑定:加载屏
const pagingRef = ref(null)
// 数据:仓库/存储区
@@ -115,6 +136,7 @@ const getWarehousing = () => {
res.data.forEach(e => {
e.showMore = false;
});
infoList.value = res.data
pagingRef.value.complete(res.data)
}).catch(res => {
pagingRef.value.complete(false)
@@ -126,6 +148,7 @@ const getRepositoryInfo = async () => {
res.data.forEach(e => {
e.showMore = false;
});
infoList.value = res.data
pagingRef.value.complete(res.data)
}).catch(res => {
pagingRef.value.complete(false)
@@ -136,10 +159,12 @@ const getRepositoryInfo = async () => {
const toBack = (keyType) => {
console.log('监听', keyType);
let url = ''
let query = objectToQuery(pathParams.value)
switch (keyType) {
case 'stockIn':
// 入库单开单
url = '/pages/warehousing/stockIn/create'
break;
case 'stockOut':
// 出库单开单
@@ -149,45 +174,75 @@ const toBack = (keyType) => {
// 出库单出库
url = '/pages/warehousing/stockOut/components/outAway'
break;
case 'my':
// 出库单出库
url = '/pages/warehousing/stockIn/create'
break;
case 'materialQuery':
// 物资查询
url = 'pages/warehousing/index'
query = ''
break;
case 'inventoryAgeView':
// 库龄
url = 'pages/warehousing/index'
query = ''
break;
case 'dailyReport':
// 日报
query = ''
url = 'pages/warehousing/index'
break;
case 'monthlyReport':
// 月报
query = ''
url = 'pages/warehousing/index'
break;
default:
url = 'pages/warehousing/index';
query = '';
break;
}
const query = objectToQuery(pathParams.value)
backUrl.value = `${url}${query}`
backUrl.value = query ? `${url}${query}` : url
}
// 选择:仓库/存储区
const onChecked = (val) => {
const flag = isWarehousing.value ? 'app_warehousing' : 'app_storageArea'
let infoChecked = uni.getStorageSync(flag);
if (!Array.isArray(infoChecked)) {
infoChecked = [];
const toUrl = OPERATE_CONFIG?.[pathParams.value?.type]?.toCheckUrl;
let params = val.materialId ? { warehouseCode: val.deptId, materialId: val.materialId } : { warehouseCode: val.deptId }
if (pathParams.value.type === 'warehouseReport') {
params.title = val.deptName
}
const query = objectToQuery(params);
if (toUrl) {
uni.navigateTo({ url: toUrl + query });
return;
}
const flag = isWarehousing.value ? "app_warehousing" : "app_storageArea";
let infoChecked = uni.getStorageSync(flag) || [];
if (!Array.isArray(infoChecked)) infoChecked = [];
if (val) {
infoChecked = [{ ...val }]
infoChecked = [{ ...val }];
uni.setStorageSync(flag, infoChecked);
}
// 返回list
uni.navigateTo({
url: backUrl.value
})
}
// 监听:确保 pathParams 变化时一定执行 toBack()
uni.navigateTo({ url: backUrl.value });
};
watch(
() => pathParams.value,
(d) => {
console.log('pathParams 变化:', d);
if (!d) return
if (!d) return;
const type = d.type || d.back;
console.log(type, 'eeeeeee');
toBack(type)
const titleStr = OPERATE_CONFIG?.[d.type]?.title;
if (titleStr) {
title.value = titleStr;
} else {
title.value = isWarehousing.value ? "仓库选择" : "存储区选择";
}
toBack(type);
},
{ deep: true, immediate: true }
)
);
onShow(() => {
pagingRef.value?.reload?.()
})