From eea217ccf8f7d74ebc7f654d7443bd5fb9936680 Mon Sep 17 00:00:00 2001 From: zhongwenkai <3478244299@qq.com> Date: Fri, 26 Jun 2026 11:25:50 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=A4=87=E4=BB=B6=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93-=E7=89=A9=E6=96=99=E5=87=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.js | 7 +- src/locales/zh-CN.js | 15 +- .../pages/materialInbound/index.vue | 504 ++++++++++++++---- .../pages/materialOutbound/index.vue | 139 ++++- .../pages/sparepartInbound/index.vue | 500 +++++++++++++---- .../pages/sparepartOutbound/index.vue | 139 ++++- 6 files changed, 1061 insertions(+), 243 deletions(-) diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 5f8f6e6..adcb7ba 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -212,7 +212,8 @@ export default { all: 'All', noMore: 'No more data', confirmTitle: 'Confirm', - clear: 'Clear' + clear: 'Clear', + moreFilter: 'More Filters' }, moldGet: { moduleName: 'Mold Stock-out', @@ -1162,6 +1163,7 @@ export default { allStatus: 'All', selectMoldStatus: 'Select Mold Status', clear: 'Clear', + moreFilter: 'More Filters', name: 'Name', createTime: 'Created At', confirmDeleteContent: 'Confirm delete mold brand "{name}"?', @@ -1464,6 +1466,7 @@ export default { inboundStatus: 'Inbound Status', reset: 'Reset', clear: 'Clear', + moreFilter: 'More Filters', loading: 'Loading...', loadingMore: 'Loading more...', noMoreData: 'No more data', @@ -1600,6 +1603,7 @@ export default { all: 'All', reset: 'Reset', clear: 'Clear', + moreFilter: 'More Filters', loading: 'Loading...', loadingMore: 'Loading more...', noMoreData: 'No more data', @@ -1702,6 +1706,7 @@ export default { outboundStatus: 'Outbound Status', reset: 'Reset', clear: 'Clear', + moreFilter: 'More Filters', loading: 'Loading...', loadingMore: 'Loading more...', noMoreData: 'No more data', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index e14ae9b..4f25304 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -212,7 +212,8 @@ export default { all: '全部', noMore: '没有更多数据了', confirmTitle: '提示', - clear: '清除' + clear: '清除', + moreFilter: '更多筛选' }, moldGet: { moduleName: '模具出库', @@ -1802,6 +1803,12 @@ export default { tabPending: '待入库', tabAuditing: '待审核', searchPlaceholder: '搜索入库单号', + allStatus: '备件状态', + creator: '创建人', + inboundTime: '入库时间', + startTime: '开始时间', + endTime: '结束时间', + to: '至', sparepartInfo: '备件信息', inboundTime: '入库时间', creator: '创建人', @@ -1842,6 +1849,7 @@ export default { tabPending: '待出库', tabAuditing: '待审核', searchPlaceholder: '搜索出库单号', + allStatus: '出库状态', sparepartInfo: '备件信息', outboundTime: '出库时间', creator: '创建人', @@ -1855,6 +1863,8 @@ export default { rejectSuccess: '已驳回', deleteSuccess: '删除成功', empty: '暂无出库单据', + startTime: '开始时间', + endTime: '结束时间', createTitle: '新增备件出库' }, materialOutbound: { @@ -1862,9 +1872,12 @@ export default { tabPending: '待出库', tabAuditing: '待审核', searchPlaceholder: '搜索出库单号', + allStatus: '出库状态', sparepartInfo: '物料信息', materialInfo: '物料信息', outboundTime: '出库时间', + startTime: '开始时间', + endTime: '结束时间', creator: '创建人', quantity: '数量', reviewer: '审核人', diff --git a/src/pages_function/pages/materialInbound/index.vue b/src/pages_function/pages/materialInbound/index.vue index b56699c..9b3426c 100644 --- a/src/pages_function/pages/materialInbound/index.vue +++ b/src/pages_function/pages/materialInbound/index.vue @@ -4,37 +4,83 @@ - - + + + + {{ currentStatusLabel }} + + + - - - {{ currentStatusLabel }} - + + + - - - {{ item.label }} - - + + + + + - 重置 + + + + + 更多筛选 + + + + + 物料信息 + + + + 创建人 + + {{ selectedCreatorLabel }} + + + + + {{ item.label }} + + + + + + 入库时间 + + + + + + + + + 重置 + 确认 + + + + [ - { label: '全部', value: '' }, { label: '待入库', value: '0' }, { label: '待审核', value: '10' }, { label: '已入库', value: '20' }, { label: '已驳回', value: '1' } ]) +const statusPickerLabels = computed(() => { + return ['物料状态', ...statusOptions.value.map((item) => item.label)] +}) +const statusPickerIndex = computed(() => { + if (selectedStatus.value === '') return 0 + const idx = statusOptions.value.findIndex((item) => item.value === selectedStatus.value) + return idx >= 0 ? idx + 1 : 0 +}) const currentStatusLabel = computed(() => { + if (selectedStatus.value === '') return '物料状态' const current = statusOptions.value.find((item) => item.value === selectedStatus.value) - return current ? current.label : '全部' + return current ? current.label : '物料状态' }) + +const selectedCreatorLabel = computed(() => { + if (!selectedCreator.value) return '创建人' + const found = creatorOptions.value.find((u) => u.value === selectedCreator.value) + return found ? found.label : '创建人' +}) + const list = ref([]) const loading = ref(false) const loadingMore = ref(false) @@ -243,11 +308,16 @@ async function fetchList(reset) { loadingMore.value = true } try { + const inTimeRange = Array.isArray(inTimeFilter.value) ? inTimeFilter.value : [] const params = { pageNo: pageNo.value, pageSize: pageSize.value, no: searchKeyword.value.trim() || undefined, - statusList: selectedStatus.value !== '' ? [Number(selectedStatus.value)] : undefined + statusList: selectedStatus.value !== '' ? [Number(selectedStatus.value)] : undefined, + creator: selectedCreator.value || undefined, + inTime: inTimeRange.length === 2 + ? [inTimeRange[0] + ' 00:00:00', inTimeRange[1] + ' 23:59:59'] + : undefined } const res = await getMaterialInboundPage(params) const page = normalizePageData(res) @@ -262,16 +332,50 @@ async function fetchList(reset) { } } -function toggleStatusDropdown() { - showStatusDropdown.value = !showStatusDropdown.value +function onStatusFilterChange(event) { + const index = Number(event?.detail?.value || 0) + if (index === 0) { + selectedStatus.value = '' + } else { + const item = statusOptions.value[index - 1] + selectedStatus.value = item ? item.value : '' + } + fetchList(true) } -function selectStatus(item, _idx) { - selectedStatus.value = item.value - showStatusDropdown.value = false +function openFilterDrawer() { + loadCreatorOptions() + filterPopupRef.value?.open() +} + +function confirmFilterDrawer() { + filterPopupRef.value?.close() fetchList(true) } +function toggleCreatorPanel() { + creatorPanelOpen.value = !creatorPanelOpen.value +} + +function selectCreator(item) { + selectedCreator.value = selectedCreator.value === item.value ? null : item.value + creatorPanelOpen.value = false +} + +async function loadCreatorOptions() { + if (creatorOptions.value.length) return + try { + const res = await getSimpleUserList() + const data = Array.isArray(res) ? res : (Array.isArray(res?.data) ? res.data : []) + creatorOptions.value = data.map((u) => ({ + value: u.id || u.userId, + label: u.nickname || u.userName || u.name || String(u.id || '') + })) + } catch (e) { + console.error('loadCreatorOptions error', e) + } +} + function handleSearch() { clearSearchTimer() uni.hideKeyboard() @@ -289,6 +393,8 @@ function resetFilters() { clearSearchTimer() searchKeyword.value = '' selectedStatus.value = '' + selectedCreator.value = null + inTimeFilter.value = [] fetchList(true) } @@ -447,9 +553,7 @@ onUnload(() => { clearSearchTimer() }) -onHide(() => { - showStatusDropdown.value = false -}) +onHide(() => {})