From 90093ac0c5530364f04ba1183749353fcd3175d5 Mon Sep 17 00:00:00 2001 From: hwj Date: Fri, 26 Jun 2026 11:09:57 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=8D=AE/=E5=87=BA=E5=BA=93=E5=8D=95=E6=8D=AE-=E7=BB=8F?= =?UTF-8?q?=E5=8A=9E=E4=BA=BA-=E9=BB=98=E8=AE=A4=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/erp/stock/in/StockInForm.vue | 11 +++++++++-- src/views/erp/stock/out/StockOutForm.vue | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/views/erp/stock/in/StockInForm.vue b/src/views/erp/stock/in/StockInForm.vue index cb114824..b8e61f5c 100644 --- a/src/views/erp/stock/in/StockInForm.vue +++ b/src/views/erp/stock/in/StockInForm.vue @@ -170,12 +170,14 @@ import { StockInApi, StockInApproveRecordVO, StockInVO } from '@/api/erp/stock/i import StockInItemForm from './components/StockInItemForm.vue' import { SupplierApi, SupplierVO } from '@/api/erp/purchase/supplier' import { getSimpleUserList, type UserVO } from '@/api/system/user' +import { useUserStore } from '@/store/modules/user' /** ERP 其它入库单 表单 */ defineOptions({ name: 'StockInForm' }) const { t } = useI18n() // 国际化 -const message = useMessage() // 消息弹窗 +const message = useMessage() +const userStore = useUserStore() const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 @@ -268,6 +270,11 @@ const normalizeUserId = (value: any) => { if (value === undefined || value === null || value === '') return undefined return String(value) } + +const getCurrentStockUserId = () => { + const userId = userStore.getUser?.id + return userId ? String(userId) : undefined +} defineExpose({ open }) // 提供 open 方法,用于打开弹窗 const handleInTypeChange = () => { @@ -329,7 +336,7 @@ const resetForm = () => { items: [], isCode: true, no: undefined, - stockUserId: undefined, + stockUserId: getCurrentStockUserId(), status: undefined } auditRecordList.value = [] diff --git a/src/views/erp/stock/out/StockOutForm.vue b/src/views/erp/stock/out/StockOutForm.vue index df30b9d3..34fbdf61 100644 --- a/src/views/erp/stock/out/StockOutForm.vue +++ b/src/views/erp/stock/out/StockOutForm.vue @@ -169,12 +169,14 @@ import { dateFormatter, getNowDateTime } from '@/utils/formatTime' import { StockOutApi, StockOutApproveRecordVO, StockOutVO } from '@/api/erp/stock/out' import StockOutItemForm from './components/StockOutItemForm.vue' import { getSimpleUserList, type UserVO } from '@/api/system/user' +import { useUserStore } from '@/store/modules/user' /** ERP 其它入库单 表单 */ defineOptions({ name: 'StockOutForm' }) const { t } = useI18n() // 国际化 -const message = useMessage() // 消息弹窗 +const message = useMessage() +const userStore = useUserStore() const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 @@ -259,6 +261,11 @@ const normalizeUserId = (value: any) => { if (value === undefined || value === null || value === '') return undefined return String(value) } + +const getCurrentStockUserId = () => { + const userId = userStore.getUser?.id + return userId ? String(userId) : undefined +} defineExpose({ open }) // 提供 open 方法,用于打开弹窗 const handleOutTypeChange = () => { @@ -303,7 +310,7 @@ const resetForm = () => { items: [], isCode: true, no: undefined, - stockUserId: undefined, + stockUserId: getCurrentStockUserId(), status: undefined } auditRecordList.value = []