From 97e7f13e283087eb1e557660c15d8d67c80f567d Mon Sep 17 00:00:00 2001 From: zhouz <> Date: Wed, 22 Jul 2026 13:38:15 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=B8=83=E5=B1=80=E3=80=81=E6=97=A5=E6=9C=9F=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=E3=80=81=E5=AD=90=E5=BC=B9=E7=AA=97=E6=89=93?= =?UTF-8?q?=E5=BC=80/=E5=85=B3=E9=97=AD=E9=97=AE=E9=A2=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 31a3906e24de6b8e5baeecf08f8c16c19dba98de. --- .../src/views/wms/iostorinv/modules/form.vue | 62 +++++++------------ .../iostorinv/modules/inventory-select.vue | 6 -- .../wms/iostorinv/modules/manual-detail.vue | 23 ++++--- 3 files changed, 34 insertions(+), 57 deletions(-) diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/form.vue index 66005e0c..c38f46fb 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/form.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/form.vue @@ -5,10 +5,10 @@ import { computed, ref, watch } from 'vue'; import { useVbenModal } from '@vben/common-ui'; -import dayjs from 'dayjs'; import { message } from 'antdv-next'; import { useVbenForm } from '#/adapter/form'; +import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { type OutboundCreateReq, type OutboundDetail, @@ -18,10 +18,11 @@ import { getBsrealStorAttrSimpleList } from '#/api/wms/bsrealstorattr'; import { getSimpleDictDataList } from '#/api/system/dict/data'; import { $t } from '#/locales'; -import InventorySelectModalComponent from './inventory-select.vue'; -import ManualDetailModalComponent from './manual-detail.vue'; +import InventorySelect from './inventory-select.vue'; +import ManualDetail from './manual-detail.vue'; const emit = defineEmits(['success']); +const formData = ref(); // ========== 仓库选项 ========== const storOptions = ref< @@ -50,7 +51,7 @@ async function loadBillTypeOptions() { const [Form, formApi] = useVbenForm({ commonConfig: { componentProps: { class: 'w-full' }, - formItemClass: 'col-span-1', + formItemClass: 'col-span-2', labelWidth: 80, }, layout: 'horizontal', @@ -86,6 +87,7 @@ const [Form, formApi] = useVbenForm({ fieldName: 'bizDate', label: '业务日期', rules: 'required', + defaultValue: new Date(), component: 'DatePicker', componentProps: { showTime: true, @@ -125,8 +127,7 @@ const [Form, formApi] = useVbenForm({ }); // ========== 明细数据 ========== -type DetailRow = OutboundDetail & { vehicleCode?: string; materialName?: string }; -const detailList = ref([]); +const detailList = ref<(OutboundDetail & { vehicleCode?: string; materialName?: string })[]>([]); function updateSummary() { const totalWeight = detailList.value @@ -148,7 +149,6 @@ watch( ); // ========== 明细表格 ========== -const vxeGridRef = ref(); const gridOptions = computed(() => ({ columns: [ { type: 'seq', title: '序号', width: 50 }, @@ -164,8 +164,6 @@ const gridOptions = computed(() => ({ data: detailList.value, height: 'auto', rowConfig: { keyField: 'materialCode', isHover: true }, - toolbarConfig: false, - pagerConfig: false, })); function handleDeleteDetail(index: number) { @@ -173,8 +171,11 @@ function handleDeleteDetail(index: number) { updateSummary(); } -// ========== 库存选择弹窗(子组件自带 Modal,用 ref 调用 open) ========== -const inventorySelectRef = ref>(); +// ========== 库存选择弹窗 ========== +const [InventorySelectModal, inventorySelectModalApi] = useVbenModal({ + connectedComponent: InventorySelect, + destroyOnClose: true, +}); function handleSelectFromInventory() { const storId = formApi.getValues().storId; @@ -182,7 +183,7 @@ function handleSelectFromInventory() { message.warning('请先选择仓库'); return; } - inventorySelectRef.value?.open({ storId }); + inventorySelectModalApi.setData({ storId }).open(); } function onInventorySelected(rows: any[]) { @@ -204,24 +205,18 @@ function onInventorySelected(rows: any[]) { updateSummary(); } -// ========== 手动新增弹窗(子组件自带 Modal,用 ref 调用 open) ========== -const manualDetailRef = ref>(); +// ========== 手动新增弹窗 ========== +const [ManualDetailModal, manualDetailModalApi] = useVbenModal({ + connectedComponent: ManualDetail, + destroyOnClose: true, +}); function handleManualAdd() { - manualDetailRef.value?.open(); + manualDetailModalApi.setData({}).open(); } function onManualAdded(detail: any) { - detailList.value.push({ - materialCode: detail.materialCode, - materialId: String(detail.materialId ?? ''), - materialName: detail.materialName, - planQty: detail.planQty, - qtyUnitId: String(detail.qtyUnitId ?? ''), - qtyUnitName: detail.qtyUnitName, - pcsn: detail.pcsn, - remark: detail.remark, - }); + detailList.value.push(detail); updateSummary(); } @@ -274,10 +269,6 @@ const [Modal, modalApi] = useVbenModal({ if (isOpen) { await loadStorOptions(); await loadBillTypeOptions(); - // 业务日期默认当天 - formApi.setValues({ - bizDate: dayjs().format('YYYY-MM-DD HH:mm:ss'), - }); } if (!isOpen) { detailList.value = []; @@ -303,7 +294,7 @@ const [Modal, modalApi] = useVbenModal({ - + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/inventory-select.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/inventory-select.vue index c9081143..fb95bcb1 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/inventory-select.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/iostorinv/modules/inventory-select.vue @@ -101,12 +101,6 @@ const [Modal, modalApi] = useVbenModal({ } }, }); - -/** 暴露给父组件调用 */ -function open(data: { storId: string }) { - modalApi.setData(data).open(); -} -defineExpose({ open });