Merge remote-tracking branch 'origin/master'

master
zhongwenkai 3 days ago
commit a1a0d7e71e

@ -0,0 +1,19 @@
import request from '@/utils/request'
export function getProductInventoryPage(params = {}) {
return request({
url: '/admin-api/erp/stock/page',
method: 'get',
params: {
categoryType: 1,
...params
}
})
}
export function getProductDetail(id) {
return request({
url: '/admin-api/erp/product/get',
method: 'get',
params: { id }
})
}

File diff suppressed because it is too large Load Diff

@ -147,6 +147,8 @@ const literalMap = {
'产品出库': 'productOutbound.moduleName',
'新增产品出库': 'productOutbound.createTitle',
'产品出库详情': 'productOutbound.detailTitle',
'产品库存查询': 'productInventory.moduleName',
'产品库存详情': 'productInventory.detailTitle',
'产品盘点执行': 'productCheck.moduleName',
'新增产品盘点': 'productCheck.createTitle',
'执行盘点': 'productCheck.executeTitle',

File diff suppressed because it is too large Load Diff

@ -591,6 +591,20 @@
"navigationStyle": "custom"
}
},
{
"path": "productInventory/index",
"style": {
"navigationBarTitleText": "\u4ea7\u54c1\u5e93\u5b58\u67e5\u8be2",
"navigationStyle": "custom"
}
},
{
"path": "productInventory/detail",
"style": {
"navigationBarTitleText": "\u4ea7\u54c1\u5e93\u5b58\u8be6\u60c5",
"navigationStyle": "custom"
}
},
{
"path": "sparepartInventory/index",
"style": {

@ -3,76 +3,48 @@
<NavBar :title="t('equipmentLedger.moduleName')" />
<view class="filter-bar">
<view class="line-filter" @click="openLineCascader">
<text
:class="[
<view class="filter-row quick-row">
<view class="line-filter" @click="openLineCascader">
<text :class="[
'line-filter-text',
selectedLineId === '' ? 'placeholder' : '',
]"
>{{ selectedLineLabel }}</text
>
<uni-icons type="bottom" size="14" color="#a8adb7"></uni-icons>
</view>
<view class="keyword-wrap">
<input
id="equipment-ledger-keyword-input"
v-model="searchKeyword"
class="keyword-input"
type="text"
:placeholder="t('equipmentLedger.searchPlaceholder')"
confirm-type="search"
@confirm="handleSearch"
/>
</view>
<picker
:range="statusPickerLabels"
:value="statusPickerIndex"
@change="onStatusFilterChange"
>
<view class="status-filter">
<text
:class="[
]">{{ selectedLineLabel }}</text>
<uni-icons type="bottom" size="14" color="#a8adb7"></uni-icons>
</view>
<picker :range="statusPickerLabels" :value="statusPickerIndex" @change="onStatusFilterChange">
<view class="status-filter">
<text :class="[
'status-filter-text',
selectedStatus === '' ? 'placeholder' : '',
]"
>{{ selectedStatusLabel }}</text
>
<uni-icons type="bottom" size="14" color="#a8adb7"></uni-icons>
]">{{ selectedStatusLabel }}</text>
<uni-icons type="bottom" size="14" color="#a8adb7"></uni-icons>
</view>
</picker>
</view>
<view class="filter-row search-row">
<view class="keyword-wrap">
<input id="equipment-ledger-keyword-input" v-model="searchKeyword" class="keyword-input" type="text"
:placeholder="t('equipmentLedger.searchPlaceholder')" confirm-type="search" @confirm="handleSearch" />
</view>
<view class="icon-filter-btn" @click="refreshList">
<uni-icons type="refresh" size="24" color="#7b8491"></uni-icons>
</view>
</picker>
<view class="reset-filter-btn" @click="resetFilters">{{
resetFilterText
}}</view>
<!-- <view class="scan-btn" @click="handleScan">
<uni-icons type="scan" size="24" color="#1f2937"></uni-icons>
</view> -->
<view class="icon-filter-btn" @click="openFilterDrawer">
<uni-icons type="settings" size="24" color="#7b8491"></uni-icons>
</view>
</view>
</view>
<view class="list-scroll">
<view class="list-wrap">
<view
v-for="item in list"
:key="item.id"
class="ledger-card"
@click="openDetail(item)"
>
<view v-for="item in list" :key="item.id" class="ledger-card" @click="openDetail(item)">
<view class="card-top">
<text class="device-code">{{ textValue(item.deviceCode) }}</text>
<picker
:range="statusChangeLabels"
:value="getStatusChangeIndex(item.deviceStatus)"
:disabled="Boolean(statusUpdatingMap[item.id])"
@click.stop
@change="(e) => onItemStatusChange(item, e)"
>
<picker :range="statusChangeLabels" :value="getStatusChangeIndex(item.deviceStatus)"
:disabled="Boolean(statusUpdatingMap[item.id])" @click.stop @change="(e) => onItemStatusChange(item, e)">
<view class="status-chip">
<view
:class="['status-dot', getStatusClass(item.deviceStatus)]"
></view>
<text
:class="['status-text', getStatusClass(item.deviceStatus)]"
>{{ getStatusText(item.deviceStatus) }}</text
>
<view :class="['status-dot', getStatusClass(item.deviceStatus)]"></view>
<text :class="['status-text', getStatusClass(item.deviceStatus)]">{{ getStatusText(item.deviceStatus)
}}</text>
</view>
</picker>
</view>
@ -103,19 +75,127 @@
<uni-icons type="top" size="22" color="#ffffff"></uni-icons>
</view>
<up-cascader
:key="lineCascaderKey"
v-model:show="lineCascaderShow"
v-model="lineCascaderValue"
:data="lineCascaderOptions"
value-key="value"
label-key="label"
children-key="children"
header-direction="row"
:options-cols="2"
:auto-close="false"
@confirm="onLineCascaderConfirm"
/>
<uni-popup ref="filterPopupRef" type="right" background-color="#ffffff">
<view class="filter-drawer">
<view class="drawer-header">
<text class="drawer-title">{{ t('equipmentLedger.allFilter') }}</text>
</view>
<scroll-view scroll-y class="drawer-body">
<view class="drawer-section">
<view class="drawer-section-head">
<text class="drawer-section-title">{{ t('equipmentLedger.basicInfo') }}</text>
</view>
<view class="drawer-grid">
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceCode') }}</text>
<input v-model="deviceCodeFilter" class="drawer-input" type="text"
:placeholder="t('equipmentLedger.placeholderDeviceCode')" />
</view>
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceName') }}</text>
<input v-model="deviceNameFilter" class="drawer-input" type="text"
:placeholder="t('equipmentLedger.placeholderDeviceName')" />
</view>
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceBrand') }}</text>
<input v-model="deviceBrandFilter" class="drawer-input" type="text"
:placeholder="t('equipmentLedger.placeholderDeviceBrand')" />
</view>
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.sn') }}</text>
<input v-model="snFilter" class="drawer-input" type="text"
:placeholder="t('equipmentLedger.placeholderSn')" />
</view>
</view>
</view>
<view class="drawer-section">
<view class="drawer-section-head">
<text class="drawer-section-title">{{ t('equipmentLedger.categoryStatus') }}</text>
</view>
<view class="drawer-grid">
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceStatus') }}</text>
<picker :range="statusPickerLabels" :value="statusPickerIndex" @change="onDrawerStatusFilterChange">
<view class="drawer-picker">
<text :class="[
'drawer-picker-text',
selectedStatus === '' ? 'placeholder' : '',
]">{{ selectedStatusLabel }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af"></uni-icons>
</view>
</picker>
</view>
<view class="drawer-field drawer-field-wide">
<text class="drawer-label">{{ t('equipmentLedger.deviceType') }}</text>
<view class="drawer-picker" @click="toggleDrawerDeviceTypePanel">
<text :class="[
'drawer-picker-text',
selectedDeviceTypeId === '' ? 'placeholder' : '',
]">{{ selectedDeviceTypeLabel }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af"></uni-icons>
</view>
<scroll-view v-if="drawerDeviceTypePanelOpen" scroll-y class="drawer-option-panel">
<view v-for="option in drawerDeviceTypeOptions" :key="`device-type-${option.id}`" :class="[
'drawer-option-item',
String(selectedDeviceTypeId) === String(option.id) ? 'active' : '',
]" :style="{ paddingLeft: `${24 + option.level * 24}rpx` }"
@click="selectDrawerDeviceType(option)">
<text class="drawer-option-text">{{ option.name }}</text>
</view>
</scroll-view>
</view>
<view class="drawer-field drawer-field-wide">
<text class="drawer-label">{{ t('equipmentLedger.lineFilter') }}</text>
<view class="drawer-picker" @click="toggleDrawerLinePanel">
<text :class="[
'drawer-picker-text',
selectedLineId === '' ? 'placeholder' : '',
]">{{ selectedLineLabel }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af"></uni-icons>
</view>
<scroll-view v-if="drawerLinePanelOpen" scroll-y class="drawer-option-panel">
<view v-for="option in drawerLineOptions" :key="`line-${option.id}`" :class="[
'drawer-option-item',
String(selectedLineId) === String(option.id) ? 'active' : '',
]" :style="{ paddingLeft: `${24 + option.level * 24}rpx` }" @click="selectDrawerLine(option)">
<text class="drawer-option-text">{{ option.name }}</text>
</view>
</scroll-view>
</view>
</view>
</view>
<view class="drawer-section">
<view class="drawer-section-head">
<text class="drawer-section-title">{{ t('equipmentLedger.dateFilter') }}</text>
</view>
<view class="drawer-field drawer-field-wide">
<text class="drawer-label">{{ t('equipmentLedger.outgoingTime') }}</text>
<view class="drawer-date">
<uni-datetime-picker v-model="outgoingTimeFilter" type="date" :clear-icon="true"
:placeholder="t('equipmentLedger.placeholderOutgoingTime')" />
</view>
</view>
</view>
</scroll-view>
<view class="drawer-actions">
<view class="drawer-action reset" @click="resetFilters">{{
resetFilterText
}}</view>
<view class="drawer-action confirm" @click="confirmFilterDrawer">{{
t('functionCommon.confirm')
}}</view>
</view>
</view>
</uni-popup>
<up-cascader :key="lineCascaderKey" v-model:show="lineCascaderShow" v-model="lineCascaderValue"
:data="lineCascaderOptions" value-key="value" label-key="label" children-key="children" header-direction="row"
:options-cols="2" :auto-close="false" @confirm="onLineCascaderConfirm" />
<up-cascader :key="deviceTypeCascaderKey" v-model:show="deviceTypeCascaderShow" v-model="deviceTypeCascaderValue"
:data="deviceTypeCascaderOptions" value-key="value" label-key="label" children-key="children"
header-direction="row" :options-cols="2" :auto-close="false" @confirm="onDeviceTypeCascaderConfirm" />
<sv-focus-no-keyboard ref="focusNoKeyboardRef"></sv-focus-no-keyboard>
</view>
@ -131,6 +211,7 @@ import {
updateDeviceLedger,
} from '@/api/mes/deviceLedger';
import { getDeviceLineTree } from '@/api/mes/deviceLine';
import { getDeviceTypeTree } from '@/api/mes/deviceType';
import { DICT_TYPE, getDictLabel, initAllDict } from '@/utils/dict';
import useDictStore from '@/store/modules/dict';
@ -140,10 +221,24 @@ const resetFilterText = computed(() => t('functionCommon.reset'));
const searchKeyword = ref('');
const selectedStatus = ref('');
const selectedLineId = ref('');
const selectedDeviceTypeId = ref('');
const deviceCodeFilter = ref('');
const deviceNameFilter = ref('');
const deviceBrandFilter = ref('');
const snFilter = ref('');
const outgoingTimeFilter = ref('');
const drawerDeviceTypePanelOpen = ref(false);
const drawerLinePanelOpen = ref(false);
const filterPopupRef = ref(null);
const lineTree = ref([]);
const deviceTypeTree = ref([]);
const lineCascaderShow = ref(false);
const lineCascaderOpenedFromDrawer = ref(false);
const lineCascaderValue = ref([]);
const lineCascaderKey = ref(0);
const deviceTypeCascaderShow = ref(false);
const deviceTypeCascaderValue = ref([]);
const deviceTypeCascaderKey = ref(0);
const list = ref([]);
const loading = ref(false);
const loadingMore = ref(false);
@ -199,11 +294,31 @@ const selectedLineLabel = computed(() => {
);
return found?.name || t('equipmentLedger.lineFilter');
});
const drawerLineOptions = computed(() => [
{ id: '', name: t('functionCommon.all'), level: 0 },
...lineOptions.value,
]);
const deviceTypeOptions = computed(() => flattenLineTree(deviceTypeTree.value));
const deviceTypeCascaderOptions = computed(() => [
{ label: t('functionCommon.all'), value: '' },
...normalizeLineTreeForCascader(deviceTypeTree.value),
]);
const selectedDeviceTypeLabel = computed(() => {
if (selectedDeviceTypeId.value === '') return t('equipmentLedger.deviceType');
const found = deviceTypeOptions.value.find(
(item) => String(item.id) === String(selectedDeviceTypeId.value),
);
return found?.name || t('equipmentLedger.deviceType');
});
const drawerDeviceTypeOptions = computed(() => [
{ id: '', name: t('functionCommon.all'), level: 0 },
...deviceTypeOptions.value,
]);
onLoad(async () => {
activateKeywordFocus();
await initAllDict();
await fetchLineTree();
await fetchDeviceTypeTree();
await fetchList(true);
});
@ -240,6 +355,21 @@ async function fetchLineTree() {
}
}
async function fetchDeviceTypeTree() {
try {
const res = await getDeviceTypeTree({});
const root = res && res.data !== undefined ? res.data : res;
const treeData = Array.isArray(root)
? root
: Array.isArray(root?.data)
? root.data
: [];
deviceTypeTree.value = normalizeLineTree(treeData);
} catch (e) {
deviceTypeTree.value = [];
}
}
function normalizeLineTree(nodes) {
return (Array.isArray(nodes) ? nodes : []).map((node) => {
const children = normalizeLineTree(node.children);
@ -319,15 +449,24 @@ async function fetchList(reset) {
}
try {
const keyword = searchKeyword.value.trim();
const deviceCode = deviceCodeFilter.value.trim();
const deviceName = deviceNameFilter.value.trim();
const deviceBrand = deviceBrandFilter.value.trim();
const sn = snFilter.value.trim();
const params = {
pageNo: pageNo.value,
pageSize: pageSize.value,
deviceCode: keyword || undefined,
deviceName: keyword || undefined,
deviceCode: deviceCode || keyword || undefined,
deviceName: deviceName || keyword || undefined,
deviceStatus:
selectedStatus.value === '' ? undefined : selectedStatus.value,
deviceLine:
selectedLineId.value === '' ? undefined : selectedLineId.value,
deviceType:
selectedDeviceTypeId.value === '' ? undefined : selectedDeviceTypeId.value,
deviceBrand: deviceBrand || undefined,
sn: sn || undefined,
outgoingTime: outgoingTimeFilter.value || undefined,
};
const res = await getDeviceLedgerPage(params);
const page = normalizePageData(res);
@ -370,7 +509,68 @@ function onStatusFilterChange(e) {
fetchList(true);
}
function openLineCascader() {
function onDrawerStatusFilterChange(e) {
const idx = Number(e?.detail?.value || 0);
selectedStatus.value = statusOptions.value[idx]?.value ?? '';
}
function openFilterDrawer() {
filterPopupRef.value?.open();
}
function closeFilterDrawer() {
filterPopupRef.value?.close();
}
async function confirmFilterDrawer() {
drawerDeviceTypePanelOpen.value = false;
drawerLinePanelOpen.value = false;
closeFilterDrawer();
await fetchList(true);
}
async function refreshList() {
await fetchList(true);
}
function toggleDrawerDeviceTypePanel() {
drawerDeviceTypePanelOpen.value = !drawerDeviceTypePanelOpen.value;
if (drawerDeviceTypePanelOpen.value) drawerLinePanelOpen.value = false;
}
function toggleDrawerLinePanel() {
drawerLinePanelOpen.value = !drawerLinePanelOpen.value;
if (drawerLinePanelOpen.value) drawerDeviceTypePanelOpen.value = false;
}
function selectDrawerDeviceType(option) {
selectedDeviceTypeId.value = option?.id === '' ? '' : String(option?.id ?? '');
deviceTypeCascaderValue.value = selectedDeviceTypeId.value
? findLinePath(deviceTypeTree.value, selectedDeviceTypeId.value)
: [];
drawerDeviceTypePanelOpen.value = false;
}
function selectDrawerLine(option) {
selectedLineId.value = option?.id === '' ? '' : String(option?.id ?? '');
lineCascaderValue.value = selectedLineId.value
? findLinePath(lineTree.value, selectedLineId.value)
: [];
drawerLinePanelOpen.value = false;
}
function openDeviceTypeCascader() {
deviceTypeCascaderShow.value = true;
}
function onDeviceTypeCascaderConfirm(values) {
const selectedValues = Array.isArray(values) ? values : [];
const nextValue = selectedValues[selectedValues.length - 1] ?? '';
selectedDeviceTypeId.value = nextValue === '' ? '' : String(nextValue);
deviceTypeCascaderValue.value =
nextValue === '' ? [] : selectedValues.map((item) => String(item));
}
function openLineCascader(fromDrawer = false) {
lineCascaderOpenedFromDrawer.value = Boolean(fromDrawer);
lineCascaderShow.value = true;
}
@ -380,16 +580,29 @@ function onLineCascaderConfirm(values) {
selectedLineId.value = nextValue === '' ? '' : String(nextValue);
lineCascaderValue.value =
nextValue === '' ? [] : selectedValues.map((item) => String(item));
fetchList(true);
if (!lineCascaderOpenedFromDrawer.value) fetchList(true);
lineCascaderOpenedFromDrawer.value = false;
}
async function resetFilters() {
searchKeyword.value = '';
deviceCodeFilter.value = '';
deviceNameFilter.value = '';
deviceBrandFilter.value = '';
snFilter.value = '';
outgoingTimeFilter.value = '';
selectedStatus.value = '';
selectedLineId.value = '';
selectedDeviceTypeId.value = '';
drawerDeviceTypePanelOpen.value = false;
drawerLinePanelOpen.value = false;
lineCascaderValue.value = [];
deviceTypeCascaderValue.value = [];
lineCascaderShow.value = false;
lineCascaderOpenedFromDrawer.value = false;
deviceTypeCascaderShow.value = false;
lineCascaderKey.value += 1;
deviceTypeCascaderKey.value += 1;
closeFilterDrawer();
activateKeywordFocus();
await fetchList(true);
}
@ -549,16 +762,29 @@ function formatDateValue(value) {
}
.filter-bar {
display: grid;
grid-template-columns: minmax(0, 1fr) 160rpx 70rpx 0rpx;
gap: 14rpx;
padding: 18rpx 14rpx 20rpx;
background: #f3f4f6;
}
.filter-row {
display: flex;
align-items: center;
padding: 18rpx 3rpx 20rpx;
gap: 18rpx;
}
.search-row {
margin-top: 18rpx;
}
.quick-row>picker {
min-width: 0;
flex: 1;
}
.keyword-wrap,
.status-filter,
.line-filter {
.line-filter,
.icon-filter-btn {
height: 66rpx;
border: 1rpx solid #d9dde5;
background: #ffffff;
@ -566,6 +792,8 @@ function formatDateValue(value) {
}
.keyword-wrap {
min-width: 0;
flex: 1;
display: flex;
align-items: center;
}
@ -578,35 +806,30 @@ function formatDateValue(value) {
color: #374151;
}
.status-filter {
min-width: 140rpx;
.status-filter,
.line-filter {
min-width: 0;
flex: 1;
max-width: 300rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 18rpx;
padding: 0 18rpx 0 26rpx;
}
.line-filter {
.icon-filter-btn {
width: 66rpx;
flex: 0 0 66rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
padding: 0 56rpx;
grid-column: 1 / -1;
}
.line-filter :deep(.uni-icons) {
position: absolute;
right: 18rpx;
border-color: transparent;
background: transparent;
}
.status-filter-text,
.line-filter-text {
min-width: 0rpx;
flex: 1;
width: 120rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -614,16 +837,238 @@ function formatDateValue(value) {
color: #374151;
}
.line-filter .line-filter-text {
max-width: none;
text-align: center;
}
.status-filter-text.placeholder,
.line-filter-text.placeholder {
color: #a8adb7;
}
.filter-drawer {
width: 630rpx;
height: 100vh;
background: #f5f5f7;
display: flex;
flex-direction: column;
overflow: hidden;
border-radius: 28rpx 0 0 28rpx;
}
.drawer-header {
height: 104rpx;
padding: 18rpx 34rpx 0;
background: #ffffff;
display: flex;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
}
.drawer-back {
width: 58rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
}
.drawer-title {
color: #1f2937;
font-size: 34rpx;
line-height: 1.3;
font-weight: 700;
}
.drawer-body {
flex: 1;
min-height: 0;
padding-bottom: 40rpx;
box-sizing: border-box;
}
.drawer-section {
// margin-top: 20rpx;
margin-bottom: 18rpx;
padding: 28rpx 28rpx 30rpx;
border-radius: 24rpx;
background: #ffffff;
box-sizing: border-box;
}
.drawer-section-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24rpx;
}
.drawer-section-title {
font-size: 32rpx;
line-height: 1.3;
color: #1f2937;
font-weight: 700;
}
.drawer-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 22rpx 20rpx;
}
.drawer-field {
min-width: 0;
}
.drawer-field-wide {
grid-column: 1 / -1;
}
.drawer-label {
display: block;
margin-bottom: 12rpx;
font-size: 24rpx;
line-height: 1.3;
color: #4b5563;
font-weight: 500;
}
.drawer-input,
.drawer-picker,
.drawer-date {
width: 100%;
min-height: 74rpx;
border: 0;
border-radius: 8rpx;
background: #f7f8fb;
box-sizing: border-box;
}
.drawer-input {
height: 74rpx;
padding: 0 18rpx;
font-size: 26rpx;
color: #111827;
text-align: center;
}
.drawer-picker {
display: flex;
align-items: center;
justify-content: center;
padding: 0 18rpx;
gap: 8rpx;
}
.drawer-picker-text {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 26rpx;
color: #111827;
text-align: center;
}
.drawer-picker-text.placeholder {
color: #9ca3af;
}
.drawer-date {
display: flex;
align-items: center;
padding: 0 12rpx;
}
.drawer-option-panel {
max-height: 360rpx;
margin-top: 12rpx;
border-radius: 12rpx;
background: #f7f8fb;
overflow: hidden;
}
.drawer-option-item {
min-height: 72rpx;
padding-right: 24rpx;
display: flex;
align-items: center;
border-bottom: 1rpx solid #eceff3;
box-sizing: border-box;
}
.drawer-option-item:last-child {
border-bottom: 0;
}
.drawer-option-item.active {
background: rgba(23, 75, 120, 0.1);
}
.drawer-option-item.active .drawer-option-text {
color: #174b78;
font-weight: 600;
}
.drawer-option-text {
min-width: 0;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 26rpx;
color: #1f2937;
}
.drawer-date :deep(.uni-date) {
width: 100%;
}
.drawer-date :deep(.uni-date-x) {
min-height: 74rpx;
border: 0;
padding: 0;
background: transparent;
}
.drawer-date :deep(.uni-date__x-input) {
text-align: center;
font-size: 26rpx;
color: #111827;
}
.drawer-actions {
height: 126rpx;
padding: 18rpx 28rpx 24rpx;
box-sizing: border-box;
display: flex;
align-items: center;
gap: 0;
background: #ffffff;
box-shadow: 0 -8rpx 24rpx rgba(17, 24, 39, 0.06);
}
.drawer-action {
flex: 1;
height: 72rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-weight: 600;
border: 2rpx solid #174b78;
box-sizing: border-box;
}
.drawer-action.reset {
border-radius: 12rpx 0 0 12rpx;
background: #ffffff;
color: #174b78;
}
.drawer-action.confirm {
border-radius: 0 12rpx 12rpx 0;
background: #174b78;
color: #ffffff;
}
.scan-btn {
width: 64rpx;
height: 64rpx;

@ -18,7 +18,7 @@
/>
</view>
<view class="status-box" @click="openStatusPicker">
<text class="status-box-text">{{ selectedStatusLabel || t('productCheck.all') }}</text>
<text class="status-box-text">{{ selectedStatusLabel || t('productCheck.checkStatus') }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af" />
</view>
<view class="reset-filter-btn" @click="resetFilters">{{ t('productCheck.reset') }}</view>
@ -155,7 +155,6 @@ const selectedStatus = ref('')
const searchKeyword = ref('')
const statusPickerRef = ref(null)
const statusOptions = computed(() => [
{ label: t('productCheck.all'), value: '' },
{ label: t('productCheck.statusDraft'), value: '0' },
{ label: t('productCheck.statusAuditing'), value: '10' },
{ label: t('productCheck.statusApproved'), value: '20' },
@ -526,7 +525,7 @@ onUnload(() => clearSearchTimer())
<style lang="scss" scoped>
.page-container { min-height: 100vh; background: #f4f5f7; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 150rpx 96rpx; align-items: center; gap: 14rpx; padding: 18rpx 28rpx 20rpx; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 188rpx 96rpx; align-items: center; gap: 14rpx; padding: 18rpx 28rpx 20rpx; }
.keyword-box,
.status-box,
.reset-filter-btn { height: var(--app-form-control-height, 70rpx); background: #ffffff; border: 1rpx solid #d9dde5; box-sizing: border-box; display: flex; align-items: center; }
@ -535,7 +534,7 @@ onUnload(() => clearSearchTimer())
.status-box { justify-content: space-between; padding: 0 18rpx; }
.status-box-text,
.placeholder { font-size: 26rpx; }
.status-box-text { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-box-text { flex: 1; min-width: 0; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reset-filter-btn { justify-content: center; font-size: 24rpx; color: #4b5563; }
.list-scroll { height: calc(100vh - 194rpx); }
.list-wrap { padding: 0 24rpx 60rpx; }

@ -18,7 +18,7 @@
/>
</view>
<view class="status-box" @click="openStatusPicker">
<text class="status-box-text">{{ selectedStatusLabel || t('productInbound.all') }}</text>
<text class="status-box-text">{{ selectedStatusLabel || t('productInbound.inboundStatus') }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af" />
</view>
<view class="reset-filter-btn" @click="resetFilters">{{ t('productInbound.reset') }}</view>
@ -150,7 +150,6 @@ const selectedStatus = ref('')
const searchKeyword = ref('')
const statusPickerRef = ref(null)
const statusOptions = computed(() => [
{ label: t('productInbound.all'), value: '' },
{ label: t('productInbound.statusPending'), value: '0' },
{ label: t('productInbound.statusAuditing'), value: '10' },
{ label: t('productInbound.statusStored'), value: '20' }
@ -418,7 +417,7 @@ onUnload(() => clearSearchTimer())
<style lang="scss" scoped>
.page-container { min-height: 100vh; background: #f4f5f7; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 150rpx 96rpx; align-items: center; gap: 14rpx; padding: 18rpx 28rpx 20rpx; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 188rpx 96rpx; align-items: center; gap: 14rpx; padding: 18rpx 28rpx 20rpx; }
.keyword-box,
.status-box,
.reset-filter-btn { height: var(--app-form-control-height, 70rpx); background: #ffffff; border: 1rpx solid #d9dde5; box-sizing: border-box; display: flex; align-items: center; }
@ -427,7 +426,7 @@ onUnload(() => clearSearchTimer())
.status-box { justify-content: space-between; padding: 0 18rpx; }
.status-box-text,
.placeholder { font-size: 26rpx; }
.status-box-text { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-box-text { flex: 1; min-width: 0; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reset-filter-btn { justify-content: center; font-size: 24rpx; color: #4b5563; }
.list-scroll { height: calc(100vh - 194rpx); }
.list-wrap { padding: 0 24rpx 60rpx; }

@ -0,0 +1,297 @@
<template>
<view class="page-container">
<NavBar :title="t('productInventory.detailTitle')" />
<scroll-view scroll-y class="detail-scroll">
<view v-if="detail" class="content-section">
<view class="detail-card">
<view class="info-row-top">
<view class="item-image-wrap">
<image v-if="detailImage" :src="detailImage" class="item-image" mode="aspectFill" />
<view v-else class="item-image-placeholder">📦</view>
</view>
<view class="item-info-col">
<view class="item-row">
<text class="item-label">{{ t('productInventory.productName') }}</text>
<text class="item-value">{{ textValue(detail.name || detail.productName) }}</text>
</view>
<view class="item-row">
<text class="item-label">{{ t('productInventory.barCode') }}</text>
<text class="item-value">{{ textValue(detail.barCode || detail.productBarCode) }}</text>
</view>
<view class="item-row">
<text class="item-label">{{ t('productInventory.category') }}</text>
<text class="item-value">{{ textValue(detail.categoryName || detail.subCategoryName) }}</text>
</view>
</view>
</view>
</view>
<view class="section-card">
<view class="section-header">
<view class="section-icon">
<uni-icons type="info" size="22" color="#1f7cff" />
</view>
<text class="section-title">{{ t('productInventory.stockInfo') }}</text>
</view>
<view class="info-list">
<view class="info-row">
<text class="info-label">{{ t('productInventory.packagingRule') }}</text>
<text class="info-value">{{ textValue(detail.packagingRule) }}</text>
</view>
<view class="info-row">
<text class="info-label">{{ t('productInventory.warehouse') }}</text>
<text class="info-value">{{ textValue(detail.warehouseName) }}</text>
</view>
<view class="info-row block-row">
<text class="info-label">{{ t('productInventory.stockDisplay') }}</text>
<view class="tag-wrap">
<text v-for="item in stockDisplayList" :key="item" class="stock-tag">{{ item }}</text>
<text v-if="!stockDisplayList.length" class="info-value">-</text>
</view>
</view>
<view class="info-row block-row">
<text class="info-label">{{ t('productInventory.areaStockDisplay') }}</text>
<view class="tag-wrap">
<text v-for="item in areaStockDisplayList" :key="item" class="stock-tag area-tag">{{ item }}</text>
<text v-if="!areaStockDisplayList.length" class="info-value">-</text>
</view>
</view>
<view class="info-row">
<text class="info-label">{{ t('productInventory.totalPackageCount') }}</text>
<text class="info-value highlight">{{ formatStockCount(detail.totalPackageCount) }}</text>
</view>
<view class="info-row">
<text class="info-label">{{ t('productInventory.totalBaseCount') }}</text>
<text class="info-value highlight">{{ formatStockCount(detail.totalBaseCount) }}</text>
</view>
<view class="info-row">
<text class="info-label">{{ t('productInventory.unit') }}</text>
<text class="info-value">{{ textValue(detail.unitName) }}</text>
</view>
<view class="info-row">
<text class="info-label">{{ t('productInventory.latestInTime') }}</text>
<text class="info-value">{{ formatDateTime(getLatestInTime(detail)) }}</text>
</view>
<view class="info-row">
<text class="info-label">{{ t('productInventory.latestOutTime') }}</text>
<text class="info-value">{{ formatDateTime(getLatestOutTime(detail)) }}</text>
</view>
</view>
</view>
</view>
<view v-else-if="loading" class="hint">{{ t('functionCommon.loading') }}</view>
<view v-else class="hint">{{ t('functionCommon.loadFailed') }}</view>
</scroll-view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import NavBar from '@/components/common/NavBar.vue'
import { getProductDetail, getProductInventoryPage } from '@/api/mes/productInventory'
const { t } = useI18n()
const detail = ref(null)
const loading = ref(true)
const stockDisplayList = computed(() => formatStockDisplay(detail.value?.stockDisplay))
const areaStockDisplayList = computed(() => getAreaStockDisplayList(detail.value?.areaStocks))
const detailImage = computed(() => {
const images = detail.value?.images || detail.value?.image || detail.value?.picUrl
if (!images) return ''
if (Array.isArray(images) && images.length) return String(images[0])
return String(images).split(',')[0]?.trim() || ''
})
function textValue(value) {
if (value === 0) return '0'
if (value == null) return '-'
const text = String(value).trim()
return text || '-'
}
function formatStockCount(value) {
if (value === undefined || value === null || value === '') return '-'
const num = Number(value)
return Number.isFinite(num) ? num.toLocaleString() : String(value)
}
function formatStockDisplay(value) {
if (!value) return []
return String(value)
.split(',')
.map((item) => item.trim())
.filter(Boolean)
}
function getAreaStockDisplayList(value) {
if (!Array.isArray(value)) return []
return value
.map((item) => item?.stockDisplay?.trim())
.filter(Boolean)
}
function formatDateTime(value) {
if (!value) return '-'
if (Array.isArray(value) && value.length >= 3) {
const [year, month, day, hour = 0, minute = 0, second = 0] = value
const pad = (n) => String(n).padStart(2, '0')
return `${year}-${pad(month)}-${pad(day)} ${pad(hour)}:${pad(minute)}:${pad(second)}`
}
const text = String(value).trim()
if (!text) return '-'
const numeric = Number(text)
if (Number.isFinite(numeric)) {
const timestamp = text.length === 10 ? numeric * 1000 : numeric
const date = new Date(timestamp)
if (!Number.isNaN(date.getTime())) return formatDate(date)
}
const date = new Date(text)
return Number.isNaN(date.getTime()) ? text : formatDate(date)
}
function formatDate(date) {
const pad = (n) => String(n).padStart(2, '0')
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`
}
function getLatestInTime(row) {
return row?.latestInTime ?? row?.lastInTime ?? row?.recentInTime ?? row?.latestStockInTime ?? row?.lastStockInTime
}
function getLatestOutTime(row) {
return row?.latestOutTime ?? row?.lastOutTime ?? row?.recentOutTime ?? row?.latestStockOutTime ?? row?.lastStockOutTime
}
function normalizePageData(res) {
const root = res && res.data !== undefined ? res.data : res
const pageResult = root?.pageResult || root?.data?.pageResult || root?.data || root || {}
const candidateList = pageResult?.list || pageResult?.rows || pageResult?.records || []
return Array.isArray(candidateList) ? candidateList : []
}
function normalizeDetailData(res) {
const root = res && res.data !== undefined ? res.data : res
return root?.data || root || {}
}
function applyStockItem(item, productDetail = {}) {
detail.value = {
name: item?.name || item?.productName || productDetail?.name,
barCode: item?.barCode || item?.productBarCode || productDetail?.barCode,
categoryName: item?.categoryName || productDetail?.categoryName || productDetail?.subCategoryName,
standard: item?.standard || productDetail?.standard,
remark: item?.remark || productDetail?.remark,
images: productDetail?.images || item?.images,
image: productDetail?.image || item?.image,
picUrl: productDetail?.picUrl || item?.picUrl,
...productDetail,
...item,
stockDisplay: item?.stockDisplay || String(item?.count || '')
}
}
async function enrichProductDetail(productId) {
try {
const res = await getProductDetail(productId)
const product = normalizeDetailData(res)
if (detail.value) {
detail.value = {
...product,
...detail.value,
name: detail.value.name || detail.value.productName || product.name,
barCode: detail.value.barCode || detail.value.productBarCode || product.barCode,
categoryName: detail.value.categoryName || product.categoryName || product.subCategoryName,
standard: detail.value.standard || product.standard,
remark: detail.value.remark || product.remark,
images: detail.value.images || product.images,
image: detail.value.image || product.image,
picUrl: detail.value.picUrl || product.picUrl
}
}
} catch (e) {}
}
onLoad(async (options) => {
const id = options?.id || options?.productId
const warehouseId = options?.warehouseId
const areaId = options?.areaId
if (!id) {
loading.value = false
uni.showToast({ title: t('productInventory.noDetailId'), icon: 'none' })
return
}
try {
const cached = getApp().globalData?._productInventoryDetail
if (cached && String(cached.productId || cached.id) === String(id)) {
applyStockItem(cached)
getApp().globalData._productInventoryDetail = null
await enrichProductDetail(id)
loading.value = false
return
}
const [pageRes, productRes] = await Promise.all([
getProductInventoryPage({
pageNo: 1,
pageSize: 1,
productId: id,
warehouseId: warehouseId || undefined,
areaId: areaId || undefined
}),
getProductDetail(id)
])
const rows = normalizePageData(pageRes)
const product = normalizeDetailData(productRes)
if (rows[0]) {
applyStockItem(rows[0], product)
} else {
detail.value = {
...product,
stockDisplay: '-'
}
}
} catch (e) {
uni.showToast({ title: t('functionCommon.loadFailed'), icon: 'none' })
} finally {
loading.value = false
}
})
</script>
<style lang="scss" scoped>
.page-container { min-height: 100vh; background: #f5f7fb; }
.detail-scroll { height: calc(100vh - 120rpx); }
.content-section { padding: 20rpx 24rpx 40rpx; }
.detail-card { padding: 28rpx; margin-bottom: 20rpx; background: #ffffff; border-radius: 16rpx; box-shadow: 0 2rpx 12rpx rgba(15, 23, 42, 0.04); }
.info-row-top { display: flex; align-items: center; }
.item-image-wrap { width: 130rpx; height: 130rpx; border-radius: 12rpx; overflow: hidden; background: #f8fafc; border: 1rpx solid #f0f0f0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-right: 24rpx; }
.item-image { width: 100%; height: 100%; }
.item-image-placeholder { font-size: 48rpx; opacity: 0.2; }
.item-info-col { flex: 1; min-width: 0; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 16rpx; padding: 8rpx 0; }
.item-row:last-child { padding-bottom: 0; }
.item-label { font-size: 28rpx; color: #9ca3af; flex-shrink: 0; }
.item-value { font-size: 28rpx; color: #374151; text-align: right; word-break: break-all; }
.section-card { padding: 24rpx; margin-bottom: 20rpx; background: #ffffff; border: 1rpx solid #eef2f7; border-radius: 20rpx; box-shadow: 0 6rpx 18rpx rgba(15, 23, 42, 0.04); }
.section-header { display: flex; align-items: center; gap: 12rpx; margin-bottom: 22rpx; padding-bottom: 18rpx; border-bottom: 1rpx solid #f1f5f9; }
.section-icon { width: 40rpx; height: 40rpx; border-radius: 10rpx; background: #eff6ff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-title { font-size: 32rpx; font-weight: 600; color: #1f2937; }
.info-list { display: flex; flex-direction: column; }
.info-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20rpx; padding: 18rpx 0; border-bottom: 1rpx solid #f3f4f6; }
.info-row:last-child { border-bottom: 0; }
.info-row.block-row { flex-direction: column; gap: 12rpx; }
.info-label { width: 190rpx; font-size: 26rpx; color: #94a3b8; flex-shrink: 0; }
.info-value { flex: 1; text-align: right; font-size: 27rpx; color: #334155; line-height: 1.5; word-break: break-all; }
.info-value.highlight { color: #1f4b79; font-weight: 700; }
.tag-wrap { width: 100%; display: flex; flex-wrap: wrap; gap: 12rpx; justify-content: flex-end; }
.stock-tag { max-width: 100%; padding: 8rpx 16rpx; border-radius: 999rpx; color: #1d4ed8; background: #dbeafe; font-size: 24rpx; line-height: 1.35; word-break: break-all; }
.area-tag { color: #0369a1; background: #e0f2fe; }
.hint { padding: 160rpx 0; text-align: center; color: #94a3b8; font-size: 26rpx; }
</style>

@ -0,0 +1,281 @@
<template>
<view class="page-container">
<NavBar :title="t('productInventory.moduleName')" />
<view class="filter-bar">
<view class="keyword-box">
<input
id="product-inventory-keyword-input"
v-model="searchKeyword"
class="keyword-input"
type="text"
:placeholder="t('productInventory.searchPlaceholder')"
placeholder-class="placeholder"
:focus="keywordFocus"
confirm-type="search"
@blur="keywordFocus = false"
@confirm="handleSearch"
/>
</view>
<view class="reset-filter-btn" @click="resetFilters">{{ t('functionCommon.reset') }}</view>
</view>
<scroll-view
scroll-y
class="list-scroll"
:scroll-top="scrollTop"
:lower-threshold="80"
@scroll="onScroll"
@scrolltolower="loadMore"
>
<view class="list-wrap">
<view v-for="item in list" :key="itemKey(item)" class="stock-card" hover-class="stock-card-hover" @click="openDetail(item)">
<view class="card-header">
<text class="product-code">{{ textValue(item.name || item.productName) }}</text>
</view>
<view class="card-body">
<view class="row">
<text class="label">{{ t('productInventory.barCode') }}</text>
<text class="value">{{ textValue(item.barCode || item.productBarCode) }}</text>
</view>
<view class="row">
<text class="label">{{ t('productInventory.stockDisplay') }}</text>
<text class="value highlight">{{ textValue(item.stockDisplay) }}</text>
</view>
<view class="row">
<text class="label">{{ t('productInventory.count') }}</text>
<text class="value highlight">{{ formatStockCount(item.count) }}{{ textUnit(item.unitName) }}</text>
</view>
</view>
</view>
<view v-if="loading && pageNo === 1" class="hint">{{ t('functionCommon.loading') }}</view>
<view v-else-if="!list.length" class="hint empty">{{ t('productInventory.empty') }}</view>
<view v-else-if="loadingMore" class="hint">{{ t('functionCommon.loadingMore') }}</view>
<view v-else-if="finished" class="hint">{{ t('functionCommon.noMoreData') }}</view>
</view>
</scroll-view>
<view v-if="showGoTop" class="go-top-btn" @click="goTop">
<uni-icons type="arrow-up" size="20" color="#1f4b79" />
</view>
<sv-focus-no-keyboard ref="focusNoKeyboardRef"></sv-focus-no-keyboard>
</view>
</template>
<script setup>
import { nextTick, ref } from 'vue'
import { onLoad, onReady, onUnload } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import NavBar from '@/components/common/NavBar.vue'
import { getProductInventoryPage } from '@/api/mes/productInventory'
const { t } = useI18n()
const list = ref([])
const loading = ref(false)
const loadingMore = ref(false)
const finished = ref(false)
const pageNo = ref(1)
const pageSize = ref(10)
const total = ref(0)
const scrollTop = ref(0)
const showGoTop = ref(false)
const searchKeyword = ref('')
const keywordFocus = ref(false)
const focusNoKeyboardRef = ref(null)
const keywordInputSelector = '#product-inventory-keyword-input input, input#product-inventory-keyword-input'
let searchTimer = null
function focusKeywordNoKeyboard() {
nextTick(() => {
setTimeout(() => {
focusNoKeyboardRef.value?.focus(keywordInputSelector)
}, 80)
})
}
function textValue(value) {
if (value === 0) return '0'
if (value == null) return '-'
const text = String(value).trim()
return text || '-'
}
function textUnit(value) {
if (value == null || value === '') return ''
return String(value).trim()
}
function formatStockCount(value) {
if (value === undefined || value === null || value === '') return '-'
const num = Number(value)
return Number.isFinite(num) ? num.toLocaleString() : String(value)
}
function itemKey(item) {
return [item?.id, item?.productId, item?.warehouseId, item?.areaId].filter((value) => value !== undefined && value !== null).join('_')
}
function normalizePageData(res) {
const root = res && res.data !== undefined ? res.data : res
const pageResult = root?.pageResult || root?.data?.pageResult || root?.data || root || {}
const candidateList = pageResult?.list || pageResult?.rows || pageResult?.records || []
const candidateTotal = pageResult?.total ?? root?.total ?? root?.data?.total ?? candidateList.length
return {
list: Array.isArray(candidateList) ? candidateList : [],
total: Number(candidateTotal || 0)
}
}
function buildQuery(pageNoValue, pageSizeValue, includeKeyword = true) {
const keyword = searchKeyword.value.trim()
const scanMatch = keyword.match(/(?:productmaterial|product)[-_](\d+)/i)
return {
pageNo: pageNoValue,
pageSize: pageSizeValue,
categoryType: 1,
productId: scanMatch ? Number(scanMatch[1]) : undefined,
keyword: includeKeyword && !scanMatch ? keyword || undefined : undefined
}
}
async function fetchAllForSearch() {
const all = []
let currentPage = 1
const maxPage = 10
while (currentPage <= maxPage) {
const res = await getProductInventoryPage(buildQuery(currentPage, 100, false))
const page = normalizePageData(res)
all.push(...page.list)
if (page.list.length < 100) break
currentPage += 1
}
return all
}
async function fetchList(reset) {
if (reset) {
pageNo.value = 1
finished.value = false
}
if (pageNo.value === 1) loading.value = true
else loadingMore.value = true
try {
const keyword = searchKeyword.value.trim().toLowerCase()
if (keyword && reset) {
const allData = await fetchAllForSearch()
const scanMatch = keyword.match(/(?:productmaterial|product)[-_](\d+)/i)
const filtered = scanMatch
? allData.filter((item) => Number(item.productId) === Number(scanMatch[1]))
: allData.filter((item) => {
const code = String(item.barCode || item.productBarCode || '').toLowerCase()
const name = String(item.name || item.productName || '').toLowerCase()
return code.includes(keyword) || name.includes(keyword)
})
list.value = filtered
total.value = filtered.length
finished.value = true
} else {
const res = await getProductInventoryPage(buildQuery(pageNo.value, pageSize.value))
const page = normalizePageData(res)
total.value = page.total
list.value = reset ? page.list : [...list.value, ...page.list]
finished.value = list.value.length >= total.value || page.list.length < pageSize.value
}
} catch (e) {
if (!reset) pageNo.value = Math.max(1, pageNo.value - 1)
uni.showToast({ title: t('functionCommon.loadFailed'), icon: 'none' })
} finally {
loading.value = false
loadingMore.value = false
}
}
async function handleSearch() {
clearSearchTimer()
uni.hideKeyboard()
await fetchList(true)
}
async function resetFilters() {
clearSearchTimer()
searchKeyword.value = ''
keywordFocus.value = false
nextTick(() => {
keywordFocus.value = true
})
await fetchList(true)
}
async function loadMore() {
if (searchKeyword.value.trim()) return
if (loading.value || loadingMore.value || finished.value) return
pageNo.value += 1
await fetchList(false)
}
function openDetail(item) {
if (!item?.productId && !item?.id) {
uni.showToast({ title: t('productInventory.noDetailId'), icon: 'none' })
return
}
getApp().globalData._productInventoryDetail = item
const productId = item.productId || item.id
uni.navigateTo({
url: `/pages_function/pages/productInventory/detail?id=${encodeURIComponent(String(productId))}&warehouseId=${encodeURIComponent(String(item.warehouseId || ''))}&areaId=${encodeURIComponent(String(item.areaId || ''))}`
})
}
function onScroll(event) {
showGoTop.value = (event?.detail?.scrollTop || 0) > 600
}
function goTop() {
scrollTop.value = 0
}
function clearSearchTimer() {
if (searchTimer) {
clearTimeout(searchTimer)
searchTimer = null
}
}
onLoad(async () => {
await fetchList(true)
})
onReady(() => {
focusKeywordNoKeyboard()
})
onUnload(() => clearSearchTimer())
</script>
<style lang="scss" scoped>
.page-container { min-height: 100vh; background: #f4f5f7; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 96rpx; align-items: center; gap: 14rpx; padding: 18rpx 28rpx 20rpx; }
.keyword-box,
.reset-filter-btn { height: var(--app-form-control-height, 70rpx); background: #ffffff; border: 1rpx solid #d9dde5; box-sizing: border-box; display: flex; align-items: center; }
.keyword-box { padding: 0 20rpx; }
.keyword-input { width: 100%; font-size: 26rpx; color: #374151; }
.placeholder { font-size: 26rpx; }
.reset-filter-btn { justify-content: center; font-size: 24rpx; color: #4b5563; }
.list-scroll { height: calc(100vh - 194rpx); }
.list-wrap { padding: 0 24rpx 60rpx; }
.stock-card { margin-top: 20rpx; padding: 28rpx; background: #fff; border-radius: 22rpx; box-shadow: 0 8rpx 28rpx rgba(15, 23, 42, 0.06); }
.stock-card-hover { opacity: 0.86; }
.card-header { margin-bottom: 18rpx; }
.product-code { display: block; min-width: 0; font-size: 32rpx; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-body .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20rpx; margin-top: 12rpx; }
.card-body .row:first-child { margin-top: 0; }
.label { width: 150rpx; font-size: 25rpx; color: #94a3b8; flex-shrink: 0; }
.value { flex: 1; text-align: right; font-size: 27rpx; color: #334155; line-height: 1.5; word-break: break-all; }
.value.highlight { color: #1f4b79; font-weight: 700; }
.hint { padding: 36rpx 0; text-align: center; color: #94a3b8; font-size: 26rpx; }
.hint.empty { padding-top: 160rpx; }
.go-top-btn { position: fixed; right: 28rpx; bottom: calc(56rpx + env(safe-area-inset-bottom)); width: 92rpx; height: 92rpx; border-radius: 46rpx; background: rgba(255, 255, 255, 0.96); box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.12); display: flex; align-items: center; justify-content: center; }
</style>

@ -18,7 +18,7 @@
/>
</view>
<view class="status-box" @click="openStatusPicker">
<text class="status-box-text">{{ selectedStatusLabel || t('productOutbound.all') }}</text>
<text class="status-box-text">{{ selectedStatusLabel || t('productOutbound.outboundStatus') }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af" />
</view>
<view class="reset-filter-btn" @click="resetFilters">{{ t('productOutbound.reset') }}</view>
@ -150,7 +150,6 @@ const selectedStatus = ref('')
const searchKeyword = ref('')
const statusPickerRef = ref(null)
const statusOptions = computed(() => [
{ label: t('productOutbound.all'), value: '' },
{ label: t('productOutbound.statusPending'), value: '0' },
{ label: t('productOutbound.statusAuditing'), value: '10' },
{ label: t('productOutbound.statusStored'), value: '20' },
@ -420,7 +419,7 @@ onUnload(() => clearSearchTimer())
<style lang="scss" scoped>
.page-container { min-height: 100vh; background: #f4f5f7; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 150rpx 96rpx; align-items: center; gap: 14rpx; padding: 18rpx 28rpx 20rpx; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 188rpx 96rpx; align-items: center; gap: 14rpx; padding: 18rpx 28rpx 20rpx; }
.keyword-box,
.status-box,
.reset-filter-btn { height: var(--app-form-control-height, 70rpx); background: #ffffff; border: 1rpx solid #d9dde5; box-sizing: border-box; display: flex; align-items: center; }
@ -429,7 +428,7 @@ onUnload(() => clearSearchTimer())
.status-box { justify-content: space-between; padding: 0 18rpx; }
.status-box-text,
.placeholder { font-size: 26rpx; }
.status-box-text { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-box-text { flex: 1; min-width: 0; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reset-filter-btn { justify-content: center; font-size: 24rpx; color: #4b5563; }
.list-scroll { height: calc(100vh - 194rpx); }
.list-wrap { padding: 0 24rpx 60rpx; }

@ -121,6 +121,13 @@ const MENU_ROUTE_MAP = {
materialOutbound: '/pages_function/pages/materialOutbound/index',
materialoutbound: '/pages_function/pages/materialOutbound/index',
'物料出库': '/pages_function/pages/materialOutbound/index',
productInventory: '/pages_function/pages/productInventory/index',
productinventory: '/pages_function/pages/productInventory/index',
productStock: '/pages_function/pages/productInventory/index',
productstock: '/pages_function/pages/productInventory/index',
productinventoryquery: '/pages_function/pages/productInventory/index',
'产品库存': '/pages_function/pages/productInventory/index',
'产品库存查询': '/pages_function/pages/productInventory/index',
sparepartinventory: '/pages_function/pages/sparepartInventory/index',
'备件库存查询': '/pages_function/pages/sparepartInventory/index',
materialinventory: '/pages_function/pages/materialInventory/index',

Loading…
Cancel
Save