import { doFetch } from '@/utils/doFetch';
function getcolumns(setdrawer) {
const common = [
{
title: "入库类型",
dataIndex: "inStoreTypeName",
key: "inStoreTypeName",
hideInSearch:true
},
{
title: "出厂编号",
dataIndex: "factoryNo",
key: "factoryNo"
},
{
title: "产品型号",
dataIndex: "productModel",
key: "productModel",
hideInSearch: true
},
{
title: "工单号",
dataIndex: "jobNo",
key: "jobNo"
},
{
title: "来源区域",
dataIndex: "sourceAreaName",
key: "sourceAreaName",
hideInSearch: true
},
{
title: "来源位置",
dataIndex: "sourcePositionName",
key: "sourcePositionName",
hideInSearch: true
},
{
title: "目标区域",
dataIndex: "targetAreaName",
key: "targetAreaName",
hideInSearch: true
},
{
title: "目标位置",
dataIndex: "targetPositionName",
key: "targetPositionName",
hideInSearch: true
},
{
title: "创建时间",
dataIndex: "distributeTime",
key: "distributeTime",
hideInSearch: true
},
];
return [
{
tab: '未完成',
key: '1',
columns: [
{
title: '基础信息',
valueType: 'split'
},
{
title: "入库单号",
dataIndex: "inStoreNo",
key: "inStoreNo",
render: (_, row) => {
return {
let res = await doFetch({ url: '/ta_wms_workmanship/wmsInStoreProduct/queryDetail', params: { id: row.id } });
setdrawer(s => {
return {
...s,
val: 'detailaddon',
item: res?.data?.data??{},
title: '入库单详情',
open: true
}
})
}} >{row.inStoreNo}
}
},
...common,
{
title: '状态',
dataIndex: 'inStoreStatusName',
key: 'inStoreStatus',
valueType: 'select',
options: [
{
label: '待分配',
value: 0
},
{
label: '待执行',
value: 1
},
{
label: '执行中',
value: 2
}
]
}
],
pathconfig: {
list: '/ta_wms_workmanship/wmsInStoreProduct/queryPage',
},
},
{
tab: '已完成',
key: '2',
columns: [
{
title: '基础信息',
valueType: 'split'
},
{
title: "入库单号",
dataIndex: "inStoreNo",
key: "inStoreNo",
render: (_, row) => {
return {
let res = await doFetch({ url: '/ta_wms_workmanship/wmsInStoreProductHis/queryDetail', params: { id: row.id } });
setdrawer(s => {
return {
...s,
val: 'detailaddon',
item: res?.data?.data??{},
title: '入库单详情',
open: true
}
})
}} >{row.inStoreNo}
}
},
...common,
{
title: '完成时间',
dataIndex: 'finishTime',
key: 'finishTime',
hideInSearch: true
},
{
title: '状态',
dataIndex: 'inStoreStatusName',
key: 'inStoreStatus',
valueType: 'select',
options: [
{
label: '已完成',
value: 3
},
{
label: '已关单',
value: 4
}
]
}
],
pathconfig: {
add: '',
edit: '',
list: '/ta_wms_workmanship/wmsInStoreProductHis/queryPage',
delete: '',
detail: '',
},
}
];
}
export default getcolumns;