2025-11-06 17:55:06 +08:00
|
|
|
import { BasicColumn } from '/@/components/Table';
|
|
|
|
|
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types';
|
|
|
|
|
import { render } from '@/utils/common/renderUtils';
|
|
|
|
|
//列表数据
|
|
|
|
|
export const columns: BasicColumn[] = [
|
|
|
|
|
{
|
|
|
|
|
title: '系统单号',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'orderNo',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '外部单号',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'thirdPartyOrderNo',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '任务号',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'no',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '订单状态',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'status_dictText',
|
|
|
|
|
customRender: ({ text }) => {
|
2025-11-09 19:36:23 +08:00
|
|
|
//入库状态:1.已创建;2.部分收货;3.收货完成;4.已取消。
|
2025-11-06 17:55:06 +08:00
|
|
|
const statusColorMap = {
|
|
|
|
|
'已创建': 'orange',
|
2025-11-09 19:36:23 +08:00
|
|
|
'部分收货': 'blue',
|
|
|
|
|
'收货完成': 'green',
|
|
|
|
|
'已取消': 'red',
|
2025-11-06 17:55:06 +08:00
|
|
|
};
|
|
|
|
|
const color = statusColorMap[text] || 'red';
|
|
|
|
|
return render.renderTag(text, color);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '单据类型',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'orderType_dictText',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '需求数量',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'orderQty',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '收货数量',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'receivedQty',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '供应商',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'supplierCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '外部仓库',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'whCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '订单日期',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'orderDate',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
//子表表格配置
|
|
|
|
|
export const asnDetailColumns: JVxeColumn[] = [
|
|
|
|
|
{
|
|
|
|
|
title: '入库单ID',
|
|
|
|
|
key: 'asnId',
|
|
|
|
|
type: JVxeTypes.hidden,
|
|
|
|
|
width: '130px',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '物料',
|
|
|
|
|
key: 'itemId',
|
2025-11-09 19:36:23 +08:00
|
|
|
type: JVxeTypes.selectSearch,
|
2025-11-06 17:55:06 +08:00
|
|
|
width: 150,
|
|
|
|
|
async: true, // 异步搜索,默认为 true
|
|
|
|
|
//查询状态启用、未删除的物料
|
2025-11-09 19:36:23 +08:00
|
|
|
dictCode: 'base_item where iz_active=1 and del_flag=0,item_code,id',
|
2025-11-06 17:55:06 +08:00
|
|
|
tipsContent: '请搜索物料',
|
|
|
|
|
validateRules: [
|
|
|
|
|
{
|
|
|
|
|
required: true, // 必填
|
2025-11-09 19:36:23 +08:00
|
|
|
message: '请选择${title}', // 显示的文本
|
2025-11-06 17:55:06 +08:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '单位',
|
|
|
|
|
key: 'unit',
|
|
|
|
|
type: JVxeTypes.select,
|
|
|
|
|
dictCode: 'package_unit',
|
|
|
|
|
width: '130px',
|
|
|
|
|
placeholder: '请选择${title}',
|
|
|
|
|
defaultValue: '托',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '容器',
|
|
|
|
|
key: 'stockId',
|
2025-11-09 19:36:23 +08:00
|
|
|
type: JVxeTypes.selectSearch,
|
2025-11-06 17:55:06 +08:00
|
|
|
width: 150,
|
|
|
|
|
async: true, // 异步搜索,默认为 true
|
|
|
|
|
//查询状态为可用、启用、未删除的容器
|
2025-11-13 16:58:05 +08:00
|
|
|
dictCode: 'base_stock where iz_active=1 and del_flag=0,stock_code,id',
|
2025-11-06 17:55:06 +08:00
|
|
|
tipsContent: '请搜索容器',
|
|
|
|
|
validateRules: [
|
|
|
|
|
{
|
|
|
|
|
required: true, // 必填
|
2025-11-09 19:36:23 +08:00
|
|
|
message: '请选择${title}', // 显示的文本
|
2025-11-06 17:55:06 +08:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '库位',
|
|
|
|
|
key: 'pointId',
|
2025-11-09 19:36:23 +08:00
|
|
|
type: JVxeTypes.selectSearch,
|
2025-11-06 17:55:06 +08:00
|
|
|
width: 150,
|
|
|
|
|
async: true, // 异步搜索,默认为 true
|
|
|
|
|
//查询状态为可用、启用、未删除的库位
|
2025-11-13 16:58:05 +08:00
|
|
|
dictCode: 'base_point where iz_active=1 and del_flag=0,point_code,id',
|
2025-11-06 17:55:06 +08:00
|
|
|
tipsContent: '请搜索库位',
|
|
|
|
|
validateRules: [
|
|
|
|
|
{
|
|
|
|
|
required: true, // 必填
|
2025-11-09 19:36:23 +08:00
|
|
|
message: '请选择${title}', // 显示的文本
|
2025-11-06 17:55:06 +08:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '需求数量',
|
|
|
|
|
key: 'orderQty',
|
|
|
|
|
type: JVxeTypes.inputNumber,
|
|
|
|
|
width: '130px',
|
|
|
|
|
validateRules: [
|
|
|
|
|
{
|
|
|
|
|
required: true, // 必填
|
|
|
|
|
message: '请输入${title}', // 显示的文本
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '收货数量',
|
|
|
|
|
key: 'receivedQty',
|
|
|
|
|
type: JVxeTypes.normal,
|
|
|
|
|
width: '130px',
|
|
|
|
|
defaultValue: '0',
|
|
|
|
|
disabled: true,
|
|
|
|
|
},
|
2025-11-09 19:36:23 +08:00
|
|
|
{
|
|
|
|
|
title: '明细状态',
|
|
|
|
|
key: 'status',
|
|
|
|
|
type: JVxeTypes.normal,
|
|
|
|
|
width: '120px',
|
|
|
|
|
defaultValue: '1',
|
|
|
|
|
formatter: ({ cellValue }) => {
|
|
|
|
|
//入库状态:1.已创建;2.部分收货;3.收货完成;4.已取消。
|
|
|
|
|
const statusMap = {
|
|
|
|
|
1: '已创建',
|
|
|
|
|
2: '部分收货',
|
|
|
|
|
3: '收货完成',
|
|
|
|
|
4: '已取消',
|
|
|
|
|
};
|
|
|
|
|
// 状态颜色映射
|
|
|
|
|
const statusColorMap = {
|
|
|
|
|
'已创建': 'orange',
|
|
|
|
|
'部分收货': 'blue',
|
|
|
|
|
'收货完成': 'green',
|
|
|
|
|
'已取消': 'red',
|
|
|
|
|
};
|
|
|
|
|
const text = statusMap[cellValue] || '未知状态';
|
|
|
|
|
const color = statusColorMap[text] || 'red';
|
|
|
|
|
return render.renderTag(text, color);
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-11-06 17:55:06 +08:00
|
|
|
{
|
|
|
|
|
title: '项目号',
|
|
|
|
|
key: 'project',
|
|
|
|
|
type: JVxeTypes.input,
|
|
|
|
|
width: '130px',
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '任务号',
|
|
|
|
|
key: 'taskNo',
|
|
|
|
|
type: JVxeTypes.input,
|
|
|
|
|
width: '130px',
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '批次号',
|
|
|
|
|
key: 'propC1',
|
|
|
|
|
type: JVxeTypes.input,
|
|
|
|
|
width: '130px',
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '库存状态',
|
|
|
|
|
key: 'propC3',
|
|
|
|
|
type: JVxeTypes.input,
|
|
|
|
|
width: '130px',
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
},
|
|
|
|
|
];
|