feat:空载具出入库、及各模块任务类补齐

This commit is contained in:
zhouz
2026-08-04 18:59:51 +08:00
parent afb512cf6c
commit 9b0da46c0d
39 changed files with 1648 additions and 584 deletions

View File

@@ -183,7 +183,7 @@ export function getInboundGroupPlates(storId: string) {
export function createInbound(data: {
billType: string;
bizDate: string;
bizDate: number;
groupIds: string[];
remark?: string;
storId: string;
@@ -193,7 +193,7 @@ export function createInbound(data: {
export function updateInbound(data: {
billType: string;
bizDate: string;
bizDate: number;
groupIds: string[];
iostorinvId: string;
remark?: string;

View File

@@ -2,6 +2,8 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { WmsIostorInvApi } from '#/api/wms/iostorinv';
import dayjs from 'dayjs';
import { Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
@@ -95,6 +97,10 @@ const [Grid, gridApi] = useVbenVxeGrid({
...getRangePickerDefaultProps(),
allowClear: true,
},
defaultValue: [
dayjs().subtract(7, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
],
fieldName: 'createTime',
label: '创建日期',
},
@@ -157,7 +163,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
</template>
<template #actions="{ row }">
<TableAction :actions="[
{ label: '修改', icon: ACTION_ICON.EDIT, type: 'link', onClick: edit.bind(null, row) },
{
label: '修改',
icon: ACTION_ICON.EDIT,
type: 'link',
disabled: row.billStatus !== '10',
onClick: edit.bind(null, row),
},
{
label: '分配货位',
icon: ACTION_ICON.SEND,
@@ -173,7 +185,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
disabled: row.billStatus !== '10',
onClick: remove.bind(null, row),
},
{ label: '完成', icon: ACTION_ICON.CIRCLE_CHECK, type: 'link', onClick: complete.bind(null, row) },
{
label: '完成',
icon: ACTION_ICON.CIRCLE_CHECK,
type: 'link',
disabled: row.billStatus !== '30',
onClick: complete.bind(null, row),
},
]" />
</template>
</Grid>

View File

@@ -26,6 +26,7 @@ const pickerLoading = ref(false);
const pickerSelectedKeys = ref<string[]>([]);
const pickerPage = ref(1);
const pickerPageSize = ref(10);
const remarkValue = ref('');
const search = reactive({
extCode: '',
materialCode: '',
@@ -112,29 +113,12 @@ const [Form, formApi] = useVbenForm({
},
{
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
defaultValue: dayjs().format('YYYY-MM-DD HH:mm:ss'),
componentProps: { class: 'w-full', format: 'YYYY-MM-DD' },
defaultValue: dayjs(),
fieldName: 'bizDate',
label: '业务日期',
rules: 'required',
},
{
component: 'Textarea',
componentProps: {
allowClear: true,
disabled: false,
maxlength: 1000,
placeholder: '请输入备注',
rows: 3,
showCount: true,
},
fieldName: 'remark',
formItemClass: 'col-span-1 md:col-span-2 xl:col-span-4',
label: '备注',
},
],
showDefaultActions: false,
wrapperClass: 'grid grid-cols-1 gap-x-6 gap-y-1 md:grid-cols-2 xl:grid-cols-4',
@@ -208,19 +192,19 @@ async function save() {
const { valid } = await formApi.validate();
if (!valid) return;
if (selectedGroups.value.length === 0) return message.warning('请添加箱号物料');
const values = await formApi.getValues();
const normalizedBizDate = dayjs(values.bizDate);
if (!normalizedBizDate.isValid() || normalizedBizDate.year() < 2000) {
return message.warning('业务日期无效,请重新选择');
}
modalApi.lock();
try {
const values = await formApi.getValues();
const rawBizDate = values.bizDate as number | string;
// 日期组件在不同适配器下可能返回字符串、毫秒或秒级时间戳,统一转换后再提交。
const normalizedBizDate = typeof rawBizDate === 'number' && rawBizDate < 1_000_000_000_000
? dayjs(rawBizDate * 1000)
: dayjs(rawBizDate);
const payload = {
billType: String(values.billType),
bizDate: normalizedBizDate.startOf('day').format('YYYY-MM-DD HH:mm:ss'),
// 后端 LocalDateTime 的 JSON 反序列化器按毫秒时间戳接收,需与出库保存保持一致。
bizDate: normalizedBizDate.startOf('day').valueOf(),
groupIds: selectedGroups.value.map((item) => String(item.groupId)),
remark: values.remark ? String(values.remark) : undefined,
remark: remarkValue.value || undefined,
storId: String(values.storId),
};
if (editData.value?.iostorinvId) {
@@ -244,11 +228,16 @@ const [ModalComponent, modalApi] = useVbenModal({
allGroups.value = [];
selectedGroups.value = [];
pickerSelectedKeys.value = [];
remarkValue.value = '';
resetSearch();
await formApi.resetForm();
if (editData.value?.iostorinvId) {
const data = await getIostorInv(editData.value.iostorinvId);
await formApi.setValues(data);
await formApi.setValues({
...data,
bizDate: data.bizDate ? dayjs(data.bizDate) : dayjs(),
});
remarkValue.value = data.remark || '';
selectedGroups.value = (data.details || []).map((item) => ({
extCode: item.sourceBillCode,
groupId: String(item.sourceBilldtlId),
@@ -283,6 +272,17 @@ const [ModalComponent, modalApi] = useVbenModal({
</div>
<div class="form-content">
<Form />
<div class="remark-row">
<span class="remark-label">备注</span>
<Input.TextArea
v-model:value="remarkValue"
allow-clear
:maxlength="1000"
placeholder="请输入备注"
:rows="3"
show-count
/>
</div>
</div>
</section>
@@ -394,6 +394,20 @@ const [ModalComponent, modalApi] = useVbenModal({
box-shadow: 0 1px 3px rgb(15 23 42 / 4%);
}
.remark-row {
display: grid;
grid-template-columns: 86px minmax(0, 1fr);
align-items: start;
padding: 0 24px 18px;
}
.remark-label {
padding-top: 5px;
padding-right: 12px;
color: #606a78;
text-align: right;
}
.detail-card {
margin-top: 16px;
}

View File

@@ -2,6 +2,8 @@ import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { WmsIostorInvApi } from '#/api/wms/iostorinv';
import dayjs from 'dayjs';
import { getRangePickerDefaultProps } from '#/utils';
import { getBsrealStorAttrSimpleList } from '#/api/wms/bsrealstorattr';
import {getDictOptions} from "@vben/hooks";
@@ -309,6 +311,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'createTime',
label: '创建时间',
component: 'RangePicker',
defaultValue: [
dayjs().subtract(7, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
],
componentProps: {
...getRangePickerDefaultProps(),
allowClear: true,

View File

@@ -1,10 +1,13 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import dayjs from 'dayjs';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { getBsrealStorAttrSimpleList } from '#/api/wms/bsrealstorattr';
import { getRangePickerDefaultProps } from '#/utils';
export function useGridFormSchema(): VbenFormSchema[] {
return [
@@ -34,6 +37,19 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'billStatus',
label: '单据状态',
},
{
component: 'RangePicker',
componentProps: {
...getRangePickerDefaultProps(),
allowClear: true,
},
defaultValue: [
dayjs().subtract(7, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
],
fieldName: 'createTime',
label: '创建时间',
},
];
}