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 }) => { //入库状态:已创建、已审核、收货中、收货完成、已关闭、已取消。 const statusColorMap = { '已创建': 'orange', '已审核': 'pink', '收货中': 'cyan', '收货完成': 'blue', '已关闭': 'green', '已取消': 'red' }; 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', type: JVxeTypes.selectDictSearch, width: 150, async: true, // 异步搜索,默认为 true //查询状态启用、未删除的物料 dict: 'base_item where iz_active=1 and del_flag=0,item_code,id', tipsContent: '请搜索物料', validateRules: [ { required: true, // 必填 }, ], }, { title: '单位', key: 'unit', type: JVxeTypes.select, dictCode: 'package_unit', width: '130px', placeholder: '请选择${title}', defaultValue: '托', }, { title: '容器', key: 'stockId', type: JVxeTypes.selectDictSearch, width: 150, async: true, // 异步搜索,默认为 true //查询状态为可用、启用、未删除的容器 dict: 'base_stock where status=0 and iz_active=1 and del_flag=0,stock_code,id', tipsContent: '请搜索容器', validateRules: [ { required: true, // 必填 }, ], }, { title: '库位', key: 'pointId', type: JVxeTypes.selectDictSearch, width: 150, async: true, // 异步搜索,默认为 true //查询状态为可用、启用、未删除的库位 dict: 'base_point where status=0 and iz_active=1 and del_flag=0,point_code,id', tipsContent: '请搜索库位', validateRules: [ { required: true, // 必填 }, ], }, { 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, }, { 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}', }, ];