import { genWorkercodeSearchModal, genWarehouseAuthSearchModal, genWarehouseAreaSearchModal } from "../../../SearchModal";
import { remote } from './remote'

let grid = { span: 8, labelCol: { span: 8 } };
const extendConfig = {
    mapper: { warehouseAreaCode: 'workarea' }
}
export const formItems = function (self) {
    return [
        ...genWorkercodeSearchModal(1, true, false, null, null, grid, { mapper: { jobnumber: 'workercode', locname: "personName" } }),
        ...genWarehouseAuthSearchModal(1, true, false, null, function (rowDate, form) {
            if(rowDate) {
                self.warehouseId = rowDate[0].companyId
            } else {
                self.warehouseId = ''
            }
            self.formWarehouseChange();
            self.disableItem()
        }, grid),
        ...genWarehouseAreaSearchModal(1, false, false, self.remoteBefore2, null, grid, extendConfig),
        {
            name: 'whAreaCategoryCode',
            label: '库别',
            ...remote('wms_storeroom'),
            type: 'select',
            ...grid
        },
        { type: 'input', name: 'assistantCode', label: '助记码', value: '', ...grid },
        { type: 'input', name: 'priority', label: '优先级', value: '', ...grid, required: true },
        { type: 'SwitchValue', name: 'isEnable', label: '是否启用', value: 1, ...grid },
    ]
};

export const tableCols1 = [
    { title: '编码', dataIndex: 'dictCode', key: 'dictCode', },
    { title: '名称', dataIndex: 'dictName', key: 'dictName', },
];

export const tableCols2 = [
    { hidden: true, title: 'stationId', dataIndex: 'stationId', key: 'stationId', },
    { title: '工作站编码', dataIndex: 'stationCode', key: 'stationCode', },
    { title: '工作站名称', dataIndex: 'stationName', key: 'stationName', },
    { title: '工作站类型', dataIndex: 'stationType', key: 'stationType', },
    { title: '复核台类别', dataIndex: 'stageGroup', key: 'stageGroup', },
    { title: '复核台类型', dataIndex: 'stageType', key: 'stageType', },
];


