import { doFetch } from '@/utils/doFetch';
function getcolumns() {
    const common = [
        {
            title: "任务单号",
            dataIndex: "taskNo",
            key: "taskNo"
        },
        {
            title: "托盘编号",
            dataIndex: "trayNo",
            key: "trayNo"
        },
        {
            title: "出厂编号",
            dataIndex: "factoryNo",
            key: "factoryNo"
        },
        {
            title: "产品型号",
            dataIndex: "productModel",
            key: "productModel",
            hideInSearch: true
        },
        {
            title: "物料类别",
            dataIndex: "materialTypeName",
            key: "materialTypeName",
            hideInSearch: true
        },
        {
            title: "工单号",
            dataIndex: "jobNo",
            key: "jobNo"
        },
        {
            title: "来源区域",
            dataIndex: "sourceAreaName",
            key: "sourceAreaName",
            hideInSearch: true
        },
        {
            title: "来源位置",
            dataIndex: "sourceAreaPosition",
            key: "sourceAreaPosition",
            hideInSearch: true
        },
        {
            title: "目标区域",
            dataIndex: "targetAreaName",
            key: "targetAreaName",
            hideInSearch: true
        },
        {
            title: "目标位置",
            dataIndex: "targetAreaPosition",
            key: "targetAreaPosition",
            hideInSearch: true
        },
        {
            title: "单据类型",
            dataIndex: "documentTypeName",
            key: "documentTypeName",
            hideInSearch: true
        },
        {
            title: "来源单据",
            dataIndex: "sourceNo",
            key: "sourceNo",
            hideInSearch: true
        },
        {
            title: "创建时间",
            dataIndex: "distributeTime",
            key: "distributeTime",
            hideInSearch: true
        }
    ];
    return [
        {
            tab: '未完成',
            key: '1',
            columns: [
                ...common,
                {
                    title: '单据状态',
                    dataIndex: 'documentStatusName',
                    key: 'documentStatus',
                    valueType: 'select',
                    options: [
                        {
                            label: '待分配',
                            value: 0
                        },
                        {
                            label: '待执行',
                            value: 1
                        },
                        {
                            label: '执行中',
                            value: 2
                        }
                    ]
                }
            ],
            pathconfig: {
                list: '/ta_wms_workmanship/pmTaskManagement/queryList',
            },
        },
        {
            tab: '已完成',
            key: '2',
            columns: [
                ...common,
                {
                    title: "关单人",
                    dataIndex: "closeUserName",
                    key: "closeUserName",
                    hideInSearch: true
                },
                {
                    title: "关单时间",
                    dataIndex: "closeTime",
                    key: "closeTime",
                    hideInSearch: true
                },
                {
                    title: '完成时间',
                    dataIndex: 'finishTime',
                    key: 'finishTime',
                    hideInSearch: true
                },
                {
                    title: '单据状态',
                    dataIndex: 'documentStatusName',
                    key: 'documentStatus',
                    valueType: 'select',
                    options: [
                        {
                            label: '已完成',
                            value: 3
                        },
                        {
                            label: '已关单',
                            value: 4
                        },
                        {
                            label: '手工完成',
                            value: 5
                        }
                    ]
                }
            ],
            pathconfig: {
                add: '',
                edit: '',
                list: '/ta_wms_workmanship/pmTaskManagementHis/queryList',
                delete: '',
                detail: '',
            },
        }
    ];
}

export default getcolumns;