Cpte-Vue3/src/views/shipping/Pick.data.ts

219 lines
4.7 KiB
TypeScript
Raw Normal View History

2025-11-14 22:55:53 +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',
2025-11-28 16:34:24 +08:00
width: '130px',
2025-11-14 22:55:53 +08:00
},
{
title: '外部单号',
align: 'center',
dataIndex: 'thirdOrderNo',
2025-11-28 16:34:24 +08:00
width: '130px',
2025-11-14 22:55:53 +08:00
},
{
title: '任务号',
align: 'center',
dataIndex: 'no',
2025-11-28 16:34:24 +08:00
width: '130px',
2025-11-14 22:55:53 +08:00
},
{
title: '订单状态',
align: 'center',
dataIndex: 'status_dictText',
2025-11-28 16:34:24 +08:00
width: '100px',
2025-11-14 22:55:53 +08:00
customRender: ({ text }) => {
2025-11-21 18:14:15 +08:00
//出库状态:1.已创建;2.部分分配;3.已分配;4.拣货中;5.拣货完成;6.已关闭;7.已取消。
2025-11-14 22:55:53 +08:00
const statusColorMap = {
: 'orange',
: 'cyan',
: 'cyan',
: 'blue',
: 'green',
: 'green',
: 'red',
};
const color = statusColorMap[text] || 'red';
return render.renderTag(text, color);
},
},
{
title: '单据类型',
align: 'center',
dataIndex: 'orderType_dictText',
2025-11-28 16:34:24 +08:00
width: '100px',
2025-11-14 22:55:53 +08:00
},
{
title: '需求数量',
align: 'center',
dataIndex: 'orderQty',
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
},
{
title: '分配数量',
align: 'center',
dataIndex: 'allocatedQty',
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
},
{
title: '拣货数量',
align: 'center',
dataIndex: 'pickedQty',
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
},
{
title: '外部仓库',
align: 'center',
dataIndex: 'whCode',
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
},
{
2025-11-28 16:34:24 +08:00
title: '客户',
2025-11-14 22:55:53 +08:00
align: 'center',
dataIndex: 'customerCode',
},
{
title: '订单日期',
align: 'center',
dataIndex: 'orderDate',
},
];
//子表表格配置
export const pickDetailColumns: JVxeColumn[] = [
{
title: '出库单ID',
key: 'pickId',
type: JVxeTypes.hidden,
},
{
title: '物料',
key: 'itemId',
type: JVxeTypes.selectSearch,
width: 150,
async: true, // 异步搜索,默认为 true
//查询状态启用、未删除的物料
dictCode: 'base_item where iz_active=1 and del_flag=0,item_code,id',
tipsContent: '请搜索物料',
validateRules: [
{
required: true, // 必填
message: '请选择${title}', // 显示的文本
},
],
},
{
title: '单位',
key: 'unit',
type: JVxeTypes.select,
dictCode: 'package_unit',
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
placeholder: '请选择${title}',
defaultValue: '托',
},
{
title: '需求数量',
key: 'orderQty',
type: JVxeTypes.inputNumber,
2025-11-28 16:34:24 +08:00
width: '110px',
2025-11-14 22:55:53 +08:00
validateRules: [
{
required: true, // 必填
message: '请输入${title}', // 显示的文本
},
],
},
{
title: '分配数量',
key: 'allocatedQty',
type: JVxeTypes.normal,
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
defaultValue: '0',
disabled: true,
},
{
title: '拣货数量',
key: 'pickedQty',
type: JVxeTypes.normal,
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
placeholder: '请输入${title}',
defaultValue: '0',
disabled: true,
},
{
title: '明细状态',
key: 'status',
type: JVxeTypes.normal,
2025-11-28 16:34:24 +08:00
width: '80px',
2025-11-14 22:55:53 +08:00
defaultValue: '1',
formatter: ({ cellValue }) => {
//入库状态:1.已创建;2.部分收货;3.收货完成;4.已取消。
const statusMap = {
1: '已创建',
2025-11-16 20:23:45 +08:00
2: '部分分配',
3: '已分配',
4: '拣货中',
5: '拣货完成',
6: '已关闭',
7: '已取消',
2025-11-14 22:55:53 +08:00
};
// 状态颜色映射
const statusColorMap = {
: 'orange',
2025-11-16 20:23:45 +08:00
: 'cyan',
: 'cyan',
: 'blue',
: 'green',
: 'green',
2025-11-14 22:55:53 +08:00
: 'red',
};
const text = statusMap[cellValue] || '未知状态';
const color = statusColorMap[text] || 'red';
return render.renderTag(text, color);
},
},
{
title: '项目号',
key: 'project',
type: JVxeTypes.input,
width: '130px',
placeholder: '请输入${title}',
defaultValue: null,
},
{
title: '任务号',
key: 'taskNo',
type: JVxeTypes.input,
width: '130px',
placeholder: '请输入${title}',
defaultValue: null,
},
{
title: '批次号',
key: 'propC1',
type: JVxeTypes.input,
width: '130px',
placeholder: '请输入${title}',
defaultValue: null,
},
{
title: '外部库存状态',
key: 'propC3',
type: JVxeTypes.input,
width: '130px',
placeholder: '请输入${title}',
defaultValue: null,
},
2025-11-28 16:34:24 +08:00
{
title: '返回报文',
key: 'resMessage',
type: JVxeTypes.normal,
width: '200px',
},
2025-11-14 22:55:53 +08:00
];