库存展示修改 主数据层级联动
This commit is contained in:
1 parent
7f621dd553
commit
3c6dfda5e5
13 files changed
+488
-42
No files matched your search
@@ -41,6 +41,8 @@ public class InventoryViewDto
|
|||||||
|
|
||||||
public decimal Qty { get; set; }
|
public decimal Qty { get; set; }
|
||||||
|
|
||||||
|
public decimal AvailableQty { get; set; }
|
||||||
|
|
||||||
public decimal PendingInboundQty { get; set; }
|
public decimal PendingInboundQty { get; set; }
|
||||||
|
|
||||||
public decimal PendingOutboundQty { get; set; }
|
public decimal PendingOutboundQty { get; set; }
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ namespace WmsLite.Api.Dtos.Orders;
|
|||||||
|
|
||||||
public abstract class OrderSaveRequestBase
|
public abstract class OrderSaveRequestBase
|
||||||
{
|
{
|
||||||
[Required]
|
|
||||||
[StringLength(128)]
|
[StringLength(128)]
|
||||||
public string OrderNo { get; set; } = string.Empty;
|
public string OrderNo { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,6 @@ namespace WmsLite.Api.Services.Interfaces;
|
|||||||
public interface IOrderNumberGenerator
|
public interface IOrderNumberGenerator
|
||||||
{
|
{
|
||||||
Task<string> NextInboundOrderNoAsync(string tenantId, string ownerCode, CancellationToken cancellationToken = default);
|
Task<string> NextInboundOrderNoAsync(string tenantId, string ownerCode, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
Task<string> NextOutboundOrderNoAsync(string tenantId, string ownerCode, CancellationToken cancellationToken = default);
|
||||||
}
|
}
|
||||||
@@ -281,6 +281,7 @@ public class InventoryService : IInventoryService
|
|||||||
LocationCode = item.LocationCode,
|
LocationCode = item.LocationCode,
|
||||||
MaterialName = materialName,
|
MaterialName = materialName,
|
||||||
Qty = item.Qty,
|
Qty = item.Qty,
|
||||||
|
AvailableQty = item.Qty - item.PendingOutboundQty - item.FrozenQty,
|
||||||
PendingInboundQty = item.PendingInboundQty,
|
PendingInboundQty = item.PendingInboundQty,
|
||||||
PendingOutboundQty = item.PendingOutboundQty,
|
PendingOutboundQty = item.PendingOutboundQty,
|
||||||
FrozenQty = item.FrozenQty,
|
FrozenQty = item.FrozenQty,
|
||||||
|
|||||||
@@ -15,10 +15,16 @@ public class OrderNumberGenerator : IOrderNumberGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> NextInboundOrderNoAsync(string tenantId, string ownerCode, CancellationToken cancellationToken = default)
|
public async Task<string> NextInboundOrderNoAsync(string tenantId, string ownerCode, CancellationToken cancellationToken = default)
|
||||||
|
=> await NextOrderNoAsync<Models.InboundOrder>(tenantId, ownerCode, "IN", "入库单");
|
||||||
|
|
||||||
|
public async Task<string> NextOutboundOrderNoAsync(string tenantId, string ownerCode, CancellationToken cancellationToken = default)
|
||||||
|
=> await NextOrderNoAsync<Models.OutboundOrder>(tenantId, ownerCode, "OUT", "出库单");
|
||||||
|
|
||||||
|
private async Task<string> NextOrderNoAsync<TOrder>(string tenantId, string ownerCode, string prefix, string displayName)
|
||||||
|
where TOrder : Models.BaseEntity, new()
|
||||||
{
|
{
|
||||||
var tenant = tenantId.Trim();
|
var tenant = tenantId.Trim();
|
||||||
var owner = ownerCode.Trim();
|
var owner = ownerCode.Trim();
|
||||||
var prefix = "IN";
|
|
||||||
var datePart = DateTime.Now.ToString("yyyyMMdd", CultureInfo.InvariantCulture);
|
var datePart = DateTime.Now.ToString("yyyyMMdd", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
const int maxAttempts = 5;
|
const int maxAttempts = 5;
|
||||||
@@ -26,8 +32,9 @@ public class OrderNumberGenerator : IOrderNumberGenerator
|
|||||||
{
|
{
|
||||||
var seq = await AllocateSequenceAsync(tenant, owner, prefix, datePart);
|
var seq = await AllocateSequenceAsync(tenant, owner, prefix, datePart);
|
||||||
var no = $"{prefix}{datePart}{seq.ToString("D5", CultureInfo.InvariantCulture)}";
|
var no = $"{prefix}{datePart}{seq.ToString("D5", CultureInfo.InvariantCulture)}";
|
||||||
var exists = await _db.Queryable<Models.InboundOrder>()
|
var exists = await _db.Queryable<TOrder>()
|
||||||
.Where(x => !x.IsDeleted && x.TenantId == tenant && x.OwnerCode == owner && x.OrderNo == no)
|
.Where(x => !x.IsDeleted && x.TenantId == tenant && x.OwnerCode == owner)
|
||||||
|
.Where("order_no = @orderNo", new { orderNo = no })
|
||||||
.AnyAsync();
|
.AnyAsync();
|
||||||
if (!exists)
|
if (!exists)
|
||||||
{
|
{
|
||||||
@@ -35,7 +42,7 @@ public class OrderNumberGenerator : IOrderNumberGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new BusinessException("生成唯一入库单单号失败,请重试。");
|
throw new BusinessException($"生成唯一{displayName}单号失败,请重试。");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<int> AllocateSequenceAsync(string tenantId, string ownerCode, string prefix, string dateYyyyMmDd)
|
private async Task<int> AllocateSequenceAsync(string tenantId, string ownerCode, string prefix, string dateYyyyMmDd)
|
||||||
|
|||||||
@@ -574,6 +574,7 @@ public class OutboundOrderService : OrderServiceBase, IOutboundOrderService
|
|||||||
private readonly IOutboundPickTaskRepository _pickTaskRepository;
|
private readonly IOutboundPickTaskRepository _pickTaskRepository;
|
||||||
private readonly ILocationRepository _locationRepository;
|
private readonly ILocationRepository _locationRepository;
|
||||||
private readonly IInventoryAllocationService _allocationService;
|
private readonly IInventoryAllocationService _allocationService;
|
||||||
|
private readonly IOrderNumberGenerator _orderNumberGenerator;
|
||||||
private readonly ICurrentUserContext _userContext;
|
private readonly ICurrentUserContext _userContext;
|
||||||
|
|
||||||
public OutboundOrderService(
|
public OutboundOrderService(
|
||||||
@@ -583,6 +584,7 @@ public class OutboundOrderService : OrderServiceBase, IOutboundOrderService
|
|||||||
IOutboundPickTaskRepository pickTaskRepository,
|
IOutboundPickTaskRepository pickTaskRepository,
|
||||||
ILocationRepository locationRepository,
|
ILocationRepository locationRepository,
|
||||||
IInventoryAllocationService allocationService,
|
IInventoryAllocationService allocationService,
|
||||||
|
IOrderNumberGenerator orderNumberGenerator,
|
||||||
IInventoryRepository inventoryRepository,
|
IInventoryRepository inventoryRepository,
|
||||||
IInventoryMovementService inventoryMovementService,
|
IInventoryMovementService inventoryMovementService,
|
||||||
ICurrentUserContext userContext) : base(inventoryRepository, inventoryMovementService)
|
ICurrentUserContext userContext) : base(inventoryRepository, inventoryMovementService)
|
||||||
@@ -593,6 +595,7 @@ public class OutboundOrderService : OrderServiceBase, IOutboundOrderService
|
|||||||
_pickTaskRepository = pickTaskRepository;
|
_pickTaskRepository = pickTaskRepository;
|
||||||
_locationRepository = locationRepository;
|
_locationRepository = locationRepository;
|
||||||
_allocationService = allocationService;
|
_allocationService = allocationService;
|
||||||
|
_orderNumberGenerator = orderNumberGenerator;
|
||||||
_userContext = userContext;
|
_userContext = userContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,16 +641,22 @@ public class OutboundOrderService : OrderServiceBase, IOutboundOrderService
|
|||||||
{
|
{
|
||||||
return await _tx.ExecuteAsync(async () =>
|
return await _tx.ExecuteAsync(async () =>
|
||||||
{
|
{
|
||||||
if (await _orderRepository.GetByOrderNoAsync(_userContext.TenantId.Trim(), _userContext.OwnerCode.Trim(), request.OrderNo) is not null)
|
var tenantId = _userContext.TenantId.Trim();
|
||||||
|
var ownerCode = _userContext.OwnerCode.Trim();
|
||||||
|
var orderNo = string.IsNullOrWhiteSpace(request.OrderNo)
|
||||||
|
? await _orderNumberGenerator.NextOutboundOrderNoAsync(tenantId, ownerCode)
|
||||||
|
: request.OrderNo.Trim();
|
||||||
|
|
||||||
|
if (await _orderRepository.GetByOrderNoAsync(tenantId, ownerCode, orderNo) is not null)
|
||||||
{
|
{
|
||||||
throw new BusinessException($"Outbound order '{request.OrderNo}' already exists.");
|
throw new BusinessException($"Outbound order '{orderNo}' already exists.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var order = new OutboundOrder
|
var order = new OutboundOrder
|
||||||
{
|
{
|
||||||
TenantId = _userContext.TenantId.Trim(),
|
TenantId = tenantId,
|
||||||
OwnerCode = _userContext.OwnerCode.Trim(),
|
OwnerCode = ownerCode,
|
||||||
OrderNo = request.OrderNo.Trim(),
|
OrderNo = orderNo,
|
||||||
BizType = request.BizType?.Trim(),
|
BizType = request.BizType?.Trim(),
|
||||||
Remark = request.Remark?.Trim(),
|
Remark = request.Remark?.Trim(),
|
||||||
Attrs = request.Attrs,
|
Attrs = request.Attrs,
|
||||||
@@ -891,6 +900,11 @@ public class TransferOrderService : OrderServiceBase, ITransferOrderService
|
|||||||
{
|
{
|
||||||
return await _tx.ExecuteAsync(async () =>
|
return await _tx.ExecuteAsync(async () =>
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(request.OrderNo))
|
||||||
|
{
|
||||||
|
throw new BusinessException("OrderNo is required.");
|
||||||
|
}
|
||||||
|
|
||||||
if (await _orderRepository.GetByOrderNoAsync(_userContext.TenantId.Trim(), _userContext.OwnerCode.Trim(), request.OrderNo) is not null)
|
if (await _orderRepository.GetByOrderNoAsync(_userContext.TenantId.Trim(), _userContext.OwnerCode.Trim(), request.OrderNo) is not null)
|
||||||
{
|
{
|
||||||
throw new BusinessException($"Transfer order '{request.OrderNo}' already exists.");
|
throw new BusinessException($"Transfer order '{request.OrderNo}' already exists.");
|
||||||
@@ -1066,6 +1080,11 @@ public class StocktakeOrderService : OrderServiceBase, IStocktakeOrderService
|
|||||||
{
|
{
|
||||||
return await _tx.ExecuteAsync(async () =>
|
return await _tx.ExecuteAsync(async () =>
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(request.OrderNo))
|
||||||
|
{
|
||||||
|
throw new BusinessException("OrderNo is required.");
|
||||||
|
}
|
||||||
|
|
||||||
if (await _orderRepository.GetByOrderNoAsync(_userContext.TenantId.Trim(), _userContext.OwnerCode.Trim(), request.OrderNo) is not null)
|
if (await _orderRepository.GetByOrderNoAsync(_userContext.TenantId.Trim(), _userContext.OwnerCode.Trim(), request.OrderNo) is not null)
|
||||||
{
|
{
|
||||||
throw new BusinessException($"Stocktake order '{request.OrderNo}' already exists.");
|
throw new BusinessException($"Stocktake order '{request.OrderNo}' already exists.");
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ export type CrudField = {
|
|||||||
hideInSearch?: boolean;
|
hideInSearch?: boolean;
|
||||||
/** 是否参与表格搜索;不设则按字段名启发式(编码/名称类默认可搜) */
|
/** 是否参与表格搜索;不设则按字段名启发式(编码/名称类默认可搜) */
|
||||||
searchable?: boolean;
|
searchable?: boolean;
|
||||||
|
formRender?: (ctx: { field: CrudField; isEdit: boolean; disabled: boolean }) => React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
type CrudPageProps = {
|
type CrudPageProps = {
|
||||||
@@ -100,7 +101,10 @@ export default function CrudPage({
|
|||||||
|
|
||||||
const renderFormItem = (field: CrudField) => {
|
const renderFormItem = (field: CrudField) => {
|
||||||
const rules = field.required ? [{ required: true, message: `请输入${field.title}` }] : undefined;
|
const rules = field.required ? [{ required: true, message: `请输入${field.title}` }] : undefined;
|
||||||
const disabled = field.readOnly || (field.readOnlyOnEdit && isEdit);
|
const disabled = Boolean(field.readOnly || (field.readOnlyOnEdit && isEdit));
|
||||||
|
if (field.formRender) {
|
||||||
|
return field.formRender({ field, isEdit, disabled });
|
||||||
|
}
|
||||||
const common = {
|
const common = {
|
||||||
key: field.name,
|
key: field.name,
|
||||||
name: field.name,
|
name: field.name,
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
import React, { useCallback, useRef, useState } from 'react';
|
||||||
|
import { Select } from 'antd';
|
||||||
|
import { pagedList } from '@/services/api';
|
||||||
|
|
||||||
|
type Option = { label: string; value: string };
|
||||||
|
|
||||||
|
type MasterDataSelectProps = Omit<React.ComponentProps<typeof Select<string>>, 'options' | 'onSearch'> & {
|
||||||
|
controller: string;
|
||||||
|
buildParams?: (keyword: string) => Record<string, any>;
|
||||||
|
optionLabel?: (row: Record<string, any>) => string;
|
||||||
|
afterChange?: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function MasterDataSelect({
|
||||||
|
controller,
|
||||||
|
buildParams,
|
||||||
|
optionLabel,
|
||||||
|
afterChange,
|
||||||
|
...selectProps
|
||||||
|
}: MasterDataSelectProps) {
|
||||||
|
const [options, setOptions] = useState<Option[]>([]);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const timerRef = useRef<ReturnType<typeof setTimeout>>();
|
||||||
|
|
||||||
|
const fetchOptions = useCallback(
|
||||||
|
async (keyword: string) => {
|
||||||
|
setLoading(true);
|
||||||
|
try {
|
||||||
|
const res = await pagedList<Record<string, any>>(controller, {
|
||||||
|
current: 1,
|
||||||
|
pageSize: 50,
|
||||||
|
...(buildParams ? buildParams(keyword) : keyword ? { keyword } : {}),
|
||||||
|
});
|
||||||
|
setOptions(
|
||||||
|
(res.data || []).map((row) => ({
|
||||||
|
value: String(row.code),
|
||||||
|
label: optionLabel ? optionLabel(row) : `${row.code} (${row.name || '-'})`,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
} catch {
|
||||||
|
setOptions([]);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[controller, buildParams, optionLabel],
|
||||||
|
);
|
||||||
|
|
||||||
|
React.useEffect(() => () => clearTimeout(timerRef.current), []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Select<string>
|
||||||
|
{...selectProps}
|
||||||
|
showSearch
|
||||||
|
allowClear
|
||||||
|
loading={loading}
|
||||||
|
filterOption={false}
|
||||||
|
optionFilterProp="label"
|
||||||
|
options={options}
|
||||||
|
onSearch={(value) => {
|
||||||
|
clearTimeout(timerRef.current);
|
||||||
|
timerRef.current = setTimeout(() => void fetchOptions(value.trim()), 250);
|
||||||
|
}}
|
||||||
|
onOpenChange={(open) => {
|
||||||
|
if (open) void fetchOptions('');
|
||||||
|
}}
|
||||||
|
onChange={(value, option) => {
|
||||||
|
selectProps.onChange?.(value, option);
|
||||||
|
afterChange?.();
|
||||||
|
}}
|
||||||
|
onClear={() => {
|
||||||
|
selectProps.onClear?.();
|
||||||
|
afterChange?.();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
ProTable,
|
ProTable,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
import { Button, Form, Input, InputNumber, message, Modal, Select, Space, Table, Typography } from 'antd';
|
import { Button, Drawer, Form, Input, InputNumber, message, Modal, Select, Space, Table, Typography } from 'antd';
|
||||||
import type { FormListFieldData } from 'antd/es/form/FormList';
|
import type { FormListFieldData } from 'antd/es/form/FormList';
|
||||||
import { EyeOutlined, PlusOutlined, ReloadOutlined } from '@ant-design/icons';
|
import { EyeOutlined, PlusOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||||
import {
|
import {
|
||||||
@@ -23,6 +23,7 @@ import {
|
|||||||
} from '@/services/api';
|
} from '@/services/api';
|
||||||
import { useDictionary } from '@/contexts/DictionaryContext';
|
import { useDictionary } from '@/contexts/DictionaryContext';
|
||||||
import type { OrderRow } from '@/types/orders';
|
import type { OrderRow } from '@/types/orders';
|
||||||
|
import MasterDataSelect from './MasterDataSelect';
|
||||||
|
|
||||||
type OrderKind = 'inbound' | 'outbound' | 'transfer' | 'stocktake';
|
type OrderKind = 'inbound' | 'outbound' | 'transfer' | 'stocktake';
|
||||||
|
|
||||||
@@ -483,11 +484,126 @@ function inboundLinesEditorColumns(
|
|||||||
return cols;
|
return cols;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function OutboundMaterialCell({ rowKey }: { rowKey: React.Key }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
return (
|
||||||
|
<Form.Item noStyle dependencies={[['lines', rowKey, 'inventoryKind']]}>
|
||||||
|
{() => {
|
||||||
|
const ik = Number(form.getFieldValue(['lines', rowKey, 'inventoryKind']) ?? 1);
|
||||||
|
if (ik === 2) return <span style={{ color: '#999' }}>-</span>;
|
||||||
|
return (
|
||||||
|
<Form.Item name={[rowKey as never, 'materialCode']} rules={[{ required: true, message: '请选择物料' }]} noStyle>
|
||||||
|
<MasterDataSelect controller="Material" placeholder="搜物料编码/名称" size="small" style={{ minWidth: 180 }} />
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function OutboundWarehouseCell({ rowKey }: { rowKey: React.Key }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
return (
|
||||||
|
<Form.Item name={[rowKey as never, 'warehouseCode']} rules={[{ required: true, message: '请选择仓库' }]} noStyle>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Warehouse"
|
||||||
|
placeholder="搜仓库"
|
||||||
|
size="small"
|
||||||
|
style={{ minWidth: 160 }}
|
||||||
|
afterChange={() => {
|
||||||
|
form.setFieldValue(['lines', rowKey, 'areaCode'], undefined);
|
||||||
|
form.setFieldValue(['lines', rowKey, 'locationCode'], undefined);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function OutboundAreaCell({ rowKey }: { rowKey: React.Key }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
return (
|
||||||
|
<Form.Item noStyle dependencies={[['lines', rowKey, 'warehouseCode']]}>
|
||||||
|
{() => {
|
||||||
|
const warehouseCode = String(form.getFieldValue(['lines', rowKey, 'warehouseCode']) || '').trim();
|
||||||
|
return (
|
||||||
|
<Form.Item name={[rowKey as never, 'areaCode']} rules={[{ required: true, message: '请选择库区' }]} noStyle>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Area"
|
||||||
|
placeholder={warehouseCode ? '搜库区' : '先选仓库'}
|
||||||
|
size="small"
|
||||||
|
style={{ minWidth: 150 }}
|
||||||
|
disabled={!warehouseCode}
|
||||||
|
buildParams={(keyword) => ({ warehouseCode, ...(keyword ? { keyword } : {}) })}
|
||||||
|
afterChange={() => form.setFieldValue(['lines', rowKey, 'locationCode'], undefined)}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function OutboundLocationCell({ rowKey }: { rowKey: React.Key }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
return (
|
||||||
|
<Form.Item noStyle dependencies={[['lines', rowKey, 'warehouseCode'], ['lines', rowKey, 'areaCode']]}>
|
||||||
|
{() => {
|
||||||
|
const warehouseCode = String(form.getFieldValue(['lines', rowKey, 'warehouseCode']) || '').trim();
|
||||||
|
const areaCode = String(form.getFieldValue(['lines', rowKey, 'areaCode']) || '').trim();
|
||||||
|
const disabled = !warehouseCode || !areaCode;
|
||||||
|
return (
|
||||||
|
<Form.Item name={[rowKey as never, 'locationCode']} noStyle>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Location"
|
||||||
|
placeholder={disabled ? '自动分配' : '可选指定库位'}
|
||||||
|
size="small"
|
||||||
|
style={{ minWidth: 160 }}
|
||||||
|
disabled={disabled}
|
||||||
|
buildParams={(keyword) => ({ warehouseCode, areaCode, ...(keyword ? { keyword } : {}) })}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function outboundLinesEditorColumns(
|
||||||
|
fields: FormListFieldData[],
|
||||||
|
remove: (index: number | number[]) => void,
|
||||||
|
): ColumnsType<FormListFieldData> {
|
||||||
|
const qtyDef: LineFieldDef = { key: 'qty', title: '数量', width: 88, type: 'number', required: true };
|
||||||
|
const unitDef: LineFieldDef = { key: 'unit', title: '单位', width: 72, type: 'text', required: true };
|
||||||
|
return [
|
||||||
|
{ title: '物料', key: 'materialCode', width: 220, render: (_u, rowField) => <OutboundMaterialCell rowKey={rowField.name} /> },
|
||||||
|
{ title: '仓库', key: 'warehouseCode', width: 180, render: (_u, rowField) => <OutboundWarehouseCell rowKey={rowField.name} /> },
|
||||||
|
{ title: '库区', key: 'areaCode', width: 170, render: (_u, rowField) => <OutboundAreaCell rowKey={rowField.name} /> },
|
||||||
|
{ title: '指定库位', key: 'locationCode', width: 180, render: (_u, rowField) => <OutboundLocationCell rowKey={rowField.name} /> },
|
||||||
|
{ title: '数量', key: 'qty', width: 100, render: (_u, rowField) => renderLineCell(rowField, qtyDef) },
|
||||||
|
{ title: '单位', key: 'unit', width: 90, render: (_u, rowField) => renderLineCell(rowField, unitDef) },
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: '_op',
|
||||||
|
width: 56,
|
||||||
|
fixed: 'right',
|
||||||
|
render: (_u, rowField) => (
|
||||||
|
<Button type="link" size="small" danger disabled={fields.length <= 1} onClick={() => remove(rowField.name)}>
|
||||||
|
删
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
function linesEditorColumns(
|
function linesEditorColumns(
|
||||||
kind: OrderKind,
|
kind: OrderKind,
|
||||||
fields: FormListFieldData[],
|
fields: FormListFieldData[],
|
||||||
remove: (index: number | number[]) => void,
|
remove: (index: number | number[]) => void,
|
||||||
): any[] {
|
): any[] {
|
||||||
|
if (kind === 'outbound') {
|
||||||
|
return outboundLinesEditorColumns(fields, remove);
|
||||||
|
}
|
||||||
|
|
||||||
const defs = lineFieldsForKind(kind);
|
const defs = lineFieldsForKind(kind);
|
||||||
const cols: any[] = defs.map((def) => ({
|
const cols: any[] = defs.map((def) => ({
|
||||||
title: def.title,
|
title: def.title,
|
||||||
@@ -853,7 +969,7 @@ export default function OrderPage({ title, controller, kind }: OrderPageProps) {
|
|||||||
[kind],
|
[kind],
|
||||||
);
|
);
|
||||||
|
|
||||||
const createModalWidth = kind === 'inbound' ? 1180 : 1040;
|
const createModalWidth = kind === 'inbound' || kind === 'outbound' ? 1180 : 1040;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -935,7 +1051,7 @@ export default function OrderPage({ title, controller, kind }: OrderPageProps) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await createRecord(controller, {
|
await createRecord(controller, {
|
||||||
orderNo: values.orderNo,
|
...(kind === 'outbound' ? {} : { orderNo: values.orderNo }),
|
||||||
bizType: values.bizType,
|
bizType: values.bizType,
|
||||||
remark: values.remark,
|
remark: values.remark,
|
||||||
attrs: parseJsonObject(values.attrsJson, {}),
|
attrs: parseJsonObject(values.attrsJson, {}),
|
||||||
@@ -948,7 +1064,7 @@ export default function OrderPage({ title, controller, kind }: OrderPageProps) {
|
|||||||
return true;
|
return true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{kind !== 'inbound' && (
|
{kind !== 'inbound' && kind !== 'outbound' && (
|
||||||
<ProFormText name="orderNo" label="单号" rules={[{ required: true, message: '请输入单号' }]} />
|
<ProFormText name="orderNo" label="单号" rules={[{ required: true, message: '请输入单号' }]} />
|
||||||
)}
|
)}
|
||||||
{kind === 'inbound' ? (
|
{kind === 'inbound' ? (
|
||||||
@@ -998,13 +1114,12 @@ export default function OrderPage({ title, controller, kind }: OrderPageProps) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
|
|
||||||
<Modal
|
<Drawer
|
||||||
title={`单据明细 — ${viewerTitle}`}
|
title={`单据明细 — ${viewerTitle}`}
|
||||||
open={viewerOpen}
|
open={viewerOpen}
|
||||||
width={kind === 'inbound' || kind === 'outbound' ? 1280 : 1040}
|
width={kind === 'inbound' || kind === 'outbound' ? 1280 : 1040}
|
||||||
footer={null}
|
|
||||||
destroyOnHidden
|
destroyOnHidden
|
||||||
onCancel={() => setViewerOpen(false)}
|
onClose={() => setViewerOpen(false)}
|
||||||
>
|
>
|
||||||
<ProTable<Record<string, any>>
|
<ProTable<Record<string, any>>
|
||||||
loading={viewerLoading}
|
loading={viewerLoading}
|
||||||
@@ -1034,7 +1149,7 @@ export default function OrderPage({ title, controller, kind }: OrderPageProps) {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Drawer>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title="确认入库"
|
title="确认入库"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
} from 'antd';
|
} from 'antd';
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
import CrudPage from '@/components/CrudPage';
|
import CrudPage from '@/components/CrudPage';
|
||||||
|
import MasterDataSelect from '@/components/MasterDataSelect';
|
||||||
import { useDictionary } from '@/contexts/DictionaryContext';
|
import { useDictionary } from '@/contexts/DictionaryContext';
|
||||||
import { batchCreateLocations } from '@/services/api';
|
import { batchCreateLocations } from '@/services/api';
|
||||||
import {
|
import {
|
||||||
@@ -26,6 +27,74 @@ import {
|
|||||||
|
|
||||||
const defaultCodeTemplate = '{Warehouse}-{Area}-{Zone}-{Aisle}-R{Row:D2}C{Col:D2}L{Layer:D2}';
|
const defaultCodeTemplate = '{Warehouse}-{Area}-{Zone}-{Aisle}-R{Row:D2}C{Col:D2}L{Layer:D2}';
|
||||||
|
|
||||||
|
function LocationWarehouseSelect({ disabled }: { disabled: boolean }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
name="warehouseCode"
|
||||||
|
label="仓库编码"
|
||||||
|
rules={[{ required: true, message: '请选择仓库' }]}
|
||||||
|
>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Warehouse"
|
||||||
|
placeholder="搜索仓库"
|
||||||
|
disabled={disabled}
|
||||||
|
afterChange={() => {
|
||||||
|
form.setFieldValue('areaCode', undefined);
|
||||||
|
form.setFieldValue('zoneCode', undefined);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function LocationAreaSelect({ disabled }: { disabled: boolean }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
const warehouseCode = Form.useWatch('warehouseCode', form);
|
||||||
|
const wh = String(warehouseCode || '').trim();
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
name="areaCode"
|
||||||
|
label="库区编码"
|
||||||
|
rules={[{ required: true, message: '请选择库区' }]}
|
||||||
|
>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Area"
|
||||||
|
placeholder={wh ? '搜索库区' : '先选仓库'}
|
||||||
|
disabled={disabled || !wh}
|
||||||
|
buildParams={(keyword) => ({ warehouseCode: wh, ...(keyword ? { keyword } : {}) })}
|
||||||
|
afterChange={() => form.setFieldValue('zoneCode', undefined)}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function LocationZoneSelect({ disabled }: { disabled: boolean }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
const warehouseCode = Form.useWatch('warehouseCode', form);
|
||||||
|
const areaCode = Form.useWatch('areaCode', form);
|
||||||
|
const wh = String(warehouseCode || '').trim();
|
||||||
|
const area = String(areaCode || '').trim();
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
name="zoneCode"
|
||||||
|
label="分区编码"
|
||||||
|
rules={[{ required: true, message: '请选择分区' }]}
|
||||||
|
>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Zone"
|
||||||
|
placeholder={wh && area ? '搜索分区' : '先选仓库/库区'}
|
||||||
|
disabled={disabled || !wh || !area}
|
||||||
|
buildParams={(keyword) => ({
|
||||||
|
warehouseCode: wh,
|
||||||
|
areaCode: area,
|
||||||
|
...(keyword ? { keyword } : {}),
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function LocationPage() {
|
export default function LocationPage() {
|
||||||
const { buildSelectOptions } = useDictionary();
|
const { buildSelectOptions } = useDictionary();
|
||||||
const reloadTableRef = useRef<(() => void) | null>(null);
|
const reloadTableRef = useRef<(() => void) | null>(null);
|
||||||
@@ -231,6 +300,7 @@ export default function LocationPage() {
|
|||||||
required: true,
|
required: true,
|
||||||
readOnlyOnEdit: true,
|
readOnlyOnEdit: true,
|
||||||
searchable: true,
|
searchable: true,
|
||||||
|
formRender: ({ disabled }) => <LocationWarehouseSelect disabled={disabled} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'areaCode',
|
name: 'areaCode',
|
||||||
@@ -238,6 +308,7 @@ export default function LocationPage() {
|
|||||||
required: true,
|
required: true,
|
||||||
readOnlyOnEdit: true,
|
readOnlyOnEdit: true,
|
||||||
searchable: true,
|
searchable: true,
|
||||||
|
formRender: ({ disabled }) => <LocationAreaSelect disabled={disabled} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'zoneCode',
|
name: 'zoneCode',
|
||||||
@@ -245,6 +316,7 @@ export default function LocationPage() {
|
|||||||
required: true,
|
required: true,
|
||||||
readOnlyOnEdit: true,
|
readOnlyOnEdit: true,
|
||||||
searchable: true,
|
searchable: true,
|
||||||
|
formRender: ({ disabled }) => <LocationZoneSelect disabled={disabled} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'aisleCode',
|
name: 'aisleCode',
|
||||||
|
|||||||
@@ -1,4 +1,36 @@
|
|||||||
import CrudPage from '@/components/CrudPage';
|
import CrudPage from '@/components/CrudPage';
|
||||||
|
import MasterDataSelect from '@/components/MasterDataSelect';
|
||||||
|
import { Form } from 'antd';
|
||||||
|
|
||||||
|
function ZoneWarehouseSelect({ disabled }: { disabled: boolean }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
return (
|
||||||
|
<Form.Item name="warehouseCode" label="仓库编码" rules={[{ required: true, message: '请选择仓库' }]}>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Warehouse"
|
||||||
|
placeholder="搜索仓库"
|
||||||
|
disabled={disabled}
|
||||||
|
afterChange={() => form.setFieldValue('areaCode', undefined)}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ZoneAreaSelect({ disabled }: { disabled: boolean }) {
|
||||||
|
const form = Form.useFormInstance();
|
||||||
|
const warehouseCode = Form.useWatch('warehouseCode', form);
|
||||||
|
const wh = String(warehouseCode || '').trim();
|
||||||
|
return (
|
||||||
|
<Form.Item name="areaCode" label="库区编码" rules={[{ required: true, message: '请选择库区' }]}>
|
||||||
|
<MasterDataSelect
|
||||||
|
controller="Area"
|
||||||
|
placeholder={wh ? '搜索库区' : '先选仓库'}
|
||||||
|
disabled={disabled || !wh}
|
||||||
|
buildParams={(keyword) => ({ warehouseCode: wh, ...(keyword ? { keyword } : {}) })}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function ZonePage() {
|
export default function ZonePage() {
|
||||||
return (
|
return (
|
||||||
@@ -7,8 +39,20 @@ export default function ZonePage() {
|
|||||||
controller="Zone"
|
controller="Zone"
|
||||||
defaultValues={{ attrs: '{}' }}
|
defaultValues={{ attrs: '{}' }}
|
||||||
fields={[
|
fields={[
|
||||||
{ name: 'warehouseCode', title: '仓库编码', required: true, readOnlyOnEdit: true },
|
{
|
||||||
{ name: 'areaCode', title: '库区编码', required: true, readOnlyOnEdit: true },
|
name: 'warehouseCode',
|
||||||
|
title: '仓库编码',
|
||||||
|
required: true,
|
||||||
|
readOnlyOnEdit: true,
|
||||||
|
formRender: ({ disabled }) => <ZoneWarehouseSelect disabled={disabled} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'areaCode',
|
||||||
|
title: '库区编码',
|
||||||
|
required: true,
|
||||||
|
readOnlyOnEdit: true,
|
||||||
|
formRender: ({ disabled }) => <ZoneAreaSelect disabled={disabled} />,
|
||||||
|
},
|
||||||
{ name: 'code', title: '分区编码', required: true, readOnlyOnEdit: true },
|
{ name: 'code', title: '分区编码', required: true, readOnlyOnEdit: true },
|
||||||
{ name: 'name', title: '分区名称', required: true },
|
{ name: 'name', title: '分区名称', required: true },
|
||||||
{ name: 'attrs', title: '扩展字段', valueType: 'json', hideInTable: true, hideInSearch: true },
|
{ name: 'attrs', title: '扩展字段', valueType: 'json', hideInTable: true, hideInSearch: true },
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { ProColumns, ProTable, ActionType } from '@ant-design/pro-components';
|
import { ProColumns, ProTable, ActionType } from '@ant-design/pro-components';
|
||||||
import { Button } from 'antd';
|
import { Button, Drawer, Form, InputNumber, Space, Typography, message } from 'antd';
|
||||||
import { ReloadOutlined } from '@ant-design/icons';
|
import { ExportOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||||
import React, { useMemo, useRef } from 'react';
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
||||||
import { useDictionary } from '@/contexts/DictionaryContext';
|
import { useDictionary } from '@/contexts/DictionaryContext';
|
||||||
import { pagedList } from '@/services/api';
|
import { actionRecord, createRecord, pagedList } from '@/services/api';
|
||||||
import type { InventoryBalanceRow } from '@/types/inventory';
|
import type { InventoryBalanceRow } from '@/types/inventory';
|
||||||
|
|
||||||
const kindEnumFallback = {
|
const kindEnumFallback = {
|
||||||
@@ -21,6 +21,22 @@ const statusEnumFallback = {
|
|||||||
export default function InventoryBalancePage() {
|
export default function InventoryBalancePage() {
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const { buildValueEnum } = useDictionary();
|
const { buildValueEnum } = useDictionary();
|
||||||
|
const [outboundOpen, setOutboundOpen] = useState(false);
|
||||||
|
const [outboundLoading, setOutboundLoading] = useState(false);
|
||||||
|
const [currentStock, setCurrentStock] = useState<InventoryBalanceRow | null>(null);
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
const availableQtyOf = useCallback((row: InventoryBalanceRow) => Number(row.availableQty ?? 0), []);
|
||||||
|
|
||||||
|
const openOutbound = useCallback((row: InventoryBalanceRow) => {
|
||||||
|
setCurrentStock(row);
|
||||||
|
form.resetFields();
|
||||||
|
form.setFieldsValue({
|
||||||
|
qty: Math.max(0, availableQtyOf(row)),
|
||||||
|
unit: row.unit || 'pcs',
|
||||||
|
});
|
||||||
|
setOutboundOpen(true);
|
||||||
|
}, [availableQtyOf, form]);
|
||||||
|
|
||||||
const columns: ProColumns<InventoryBalanceRow>[] = useMemo(
|
const columns: ProColumns<InventoryBalanceRow>[] = useMemo(
|
||||||
() => [
|
() => [
|
||||||
@@ -42,7 +58,8 @@ export default function InventoryBalancePage() {
|
|||||||
{ title: '分区(编码)', dataIndex: 'zoneCode', width: 88, ellipsis: true, search: true },
|
{ title: '分区(编码)', dataIndex: 'zoneCode', width: 88, ellipsis: true, search: true },
|
||||||
{ title: '分区名称', dataIndex: 'zoneName', width: 120, ellipsis: true, search: false },
|
{ title: '分区名称', dataIndex: 'zoneName', width: 120, ellipsis: true, search: false },
|
||||||
{ title: '库位', dataIndex: 'locationCode', width: 110, ellipsis: true, search: true },
|
{ title: '库位', dataIndex: 'locationCode', width: 110, ellipsis: true, search: true },
|
||||||
{ title: '可用数量', dataIndex: 'qty', width: 100, search: false, valueType: 'digit' },
|
{ title: '账面数量', dataIndex: 'qty', width: 100, search: false, valueType: 'digit' },
|
||||||
|
{ title: '可分配量', dataIndex: 'availableQty', width: 100, search: false, valueType: 'digit' },
|
||||||
{
|
{
|
||||||
title: '待入数量',
|
title: '待入数量',
|
||||||
dataIndex: 'pendingInboundQty',
|
dataIndex: 'pendingInboundQty',
|
||||||
@@ -66,25 +83,111 @@ export default function InventoryBalancePage() {
|
|||||||
search: false,
|
search: false,
|
||||||
valueEnum: { ...statusEnumFallback, ...buildValueEnum('InventoryStatus') },
|
valueEnum: { ...statusEnumFallback, ...buildValueEnum('InventoryStatus') },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
valueType: 'option',
|
||||||
|
width: 100,
|
||||||
|
fixed: 'right',
|
||||||
|
render: (_, row) => (
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
icon={<ExportOutlined />}
|
||||||
|
disabled={availableQtyOf(row) <= 0 || Number(row.inventoryKind) !== 1}
|
||||||
|
onClick={() => openOutbound(row)}
|
||||||
|
>
|
||||||
|
出库
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
[buildValueEnum],
|
[availableQtyOf, buildValueEnum, openOutbound],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProTable<InventoryBalanceRow>
|
<>
|
||||||
actionRef={actionRef}
|
<ProTable<InventoryBalanceRow>
|
||||||
rowKey="id"
|
actionRef={actionRef}
|
||||||
headerTitle="库存余额"
|
rowKey="id"
|
||||||
columns={columns}
|
headerTitle="库存工作台"
|
||||||
scroll={{ x: 'max-content' }}
|
columns={columns}
|
||||||
search={{ labelWidth: 'auto' }}
|
scroll={{ x: 'max-content' }}
|
||||||
options={{ density: true, reload: false, setting: true }}
|
search={{ labelWidth: 'auto' }}
|
||||||
request={(params) => pagedList('Inventory', params)}
|
options={{ density: true, reload: false, setting: true }}
|
||||||
toolBarRender={() => [
|
request={(params) => pagedList('Inventory', params)}
|
||||||
<Button key="reload" icon={<ReloadOutlined />} onClick={() => actionRef.current?.reload()}>
|
toolBarRender={() => [
|
||||||
刷新
|
<Button key="reload" icon={<ReloadOutlined />} onClick={() => actionRef.current?.reload()}>
|
||||||
</Button>,
|
刷新
|
||||||
]}
|
</Button>,
|
||||||
/>
|
]}
|
||||||
|
/>
|
||||||
|
<Drawer
|
||||||
|
title="从库存发起出库"
|
||||||
|
open={outboundOpen}
|
||||||
|
width={480}
|
||||||
|
destroyOnHidden
|
||||||
|
onClose={() => setOutboundOpen(false)}
|
||||||
|
extra={
|
||||||
|
<Space>
|
||||||
|
<Button onClick={() => setOutboundOpen(false)}>取消</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
loading={outboundLoading}
|
||||||
|
onClick={async () => {
|
||||||
|
if (!currentStock) return;
|
||||||
|
const values = await form.validateFields();
|
||||||
|
setOutboundLoading(true);
|
||||||
|
try {
|
||||||
|
const order = await createRecord<{ id: string }>('OutboundOrder', {
|
||||||
|
bizType: 'outbound_default',
|
||||||
|
remark: `从库存工作台发起:${currentStock.materialCode || currentStock.containerCode}`,
|
||||||
|
lines: [
|
||||||
|
{
|
||||||
|
inventoryKind: currentStock.inventoryKind,
|
||||||
|
materialCode: currentStock.materialCode,
|
||||||
|
containerCode: currentStock.containerCode,
|
||||||
|
warehouseCode: currentStock.warehouseCode,
|
||||||
|
areaCode: currentStock.areaCode,
|
||||||
|
locationCode: currentStock.locationCode,
|
||||||
|
qty: Number(values.qty),
|
||||||
|
unit: currentStock.unit || 'pcs',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
await actionRecord('OutboundOrder', 'pending', order.id);
|
||||||
|
message.success('已创建出库单并生成拣货任务');
|
||||||
|
setOutboundOpen(false);
|
||||||
|
actionRef.current?.reload();
|
||||||
|
} finally {
|
||||||
|
setOutboundLoading(false);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
创建并待拣
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{currentStock && (
|
||||||
|
<>
|
||||||
|
<Typography.Paragraph>
|
||||||
|
{currentStock.materialCode} · {currentStock.warehouseCode}/{currentStock.areaCode}/{currentStock.locationCode}
|
||||||
|
</Typography.Paragraph>
|
||||||
|
<Typography.Paragraph type="secondary">
|
||||||
|
账面 {currentStock.qty ?? 0},待出 {currentStock.pendingOutboundQty ?? 0},冻结 {currentStock.frozenQty ?? 0},可分配 {availableQtyOf(currentStock)}
|
||||||
|
</Typography.Paragraph>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
<Form form={form} layout="vertical">
|
||||||
|
<Form.Item
|
||||||
|
name="qty"
|
||||||
|
label="出库数量"
|
||||||
|
rules={[{ required: true, message: '请输入出库数量' }]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0.000001} max={currentStock ? availableQtyOf(currentStock) : undefined} style={{ width: '100%' }} />
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Drawer>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ export type InventoryBalanceRow = {
|
|||||||
zoneCode: string;
|
zoneCode: string;
|
||||||
locationCode: string;
|
locationCode: string;
|
||||||
qty?: number;
|
qty?: number;
|
||||||
|
availableQty?: number;
|
||||||
pendingInboundQty?: number;
|
pendingInboundQty?: number;
|
||||||
pendingOutboundQty?: number;
|
pendingOutboundQty?: number;
|
||||||
frozenQty?: number;
|
frozenQty?: number;
|
||||||
|
|||||||
Reference in new issue
Block a user