| | |
| | | locNo: "loc No.", |
| | | name: "name", |
| | | code: "code", |
| | | compDirect: "code direct", |
| | | compDirect: "actuator direction", |
| | | locSts: "loc sts", |
| | | offset: "offset", |
| | | offset: "height", |
| | | row: "row", |
| | | bay: "bay", |
| | | lev: "lev", |
| | |
| | | locNo: "库位号", |
| | | name: "名称", |
| | | code: "地面码", |
| | | compDirect: "码方向", |
| | | compDirect: "货叉方向", |
| | | locSts: "库位状态", |
| | | offset: "偏移量", |
| | | offset: "高度", |
| | | row: "排", |
| | | bay: "列", |
| | | lev: "层", |
| | |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <TextInput source="locNo" label="table.field.loc.locNo" alwaysOn />, |
| | | <ReferenceInput source="locSts" label="table.field.loc.locSts" reference="locSts" alwaysOn> |
| | | <AutocompleteInput label="table.field.loc.locSts" optionText="name" filterToQuery={(val) => ({ name: val })} /> |
| | |
| | | <NumberInput source="row" label="table.field.loc.row" alwaysOn />, |
| | | <NumberInput source="bay" label="table.field.loc.bay" alwaysOn />, |
| | | <NumberInput source="lev" label="table.field.loc.lev" alwaysOn />, |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <ReferenceInput source="code" label="table.field.loc.code" reference="code" alwaysOn> |
| | | <ReferenceInput source="code" label="table.field.loc.code" reference="code"> |
| | | <AutocompleteInput label="table.field.loc.code" optionText="data" filterToQuery={(val) => ({ data: val })} /> |
| | | </ReferenceInput>, |
| | | <DateInput label='common.time.after' source="timeStart" />, |
| | |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <LocPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'locType', 'uuid', 'statusBool', 'updateBy', 'createTime', 'createBy', 'memo']} |
| | | omit={['id', 'locType', 'uuid', 'zpallet', 'barcode' |
| | | , 'statusBool', 'updateBy', 'createTime', 'createBy', 'memo']} |
| | | rowSx={rowSx(drawerVal || null)} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | <ReferenceField source="code" label="table.field.loc.code" reference="code" link={false} sortable={false}> |
| | | <TextField source="data" /> |
| | | </ReferenceField> |
| | | <FunctionField |
| | | label="table.field.loc.compDirect" |
| | | sortable={false} |
| | | render={(record) => getCompDirectLabel(translate, record?.compDirect)} |
| | | /> |
| | | <ReferenceField source="locSts" label="table.field.loc.locSts" reference="locSts" link={false} sortable={true}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | |
| | | <NumberField source="bay" label="table.field.loc.bay" /> |
| | | <NumberField source="lev" label="table.field.loc.lev" /> |
| | | <NumberField source="offset" label="table.field.loc.offset" /> |
| | | <FunctionField |
| | | label="table.field.loc.compDirect" |
| | | sortable={false} |
| | | render={(record) => getCompDirectLabel(translate, record?.compDirect)} |
| | | /> |
| | | <TextField source="barcode" label="table.field.loc.barcode" /> |
| | | <TextField source="zpallet" label="table.field.loc.zpallet" /> |
| | | <ReferenceField source="locType" label="table.field.loc.locType" reference="locType" link={false} sortable={false}> |
| | |
| | | const compDirectMap = { |
| | | 1: 'page.loc.enums.compDirect.left', |
| | | 2: 'page.loc.enums.compDirect.right', |
| | | 3: 'page.loc.enums.compDirect.forward', |
| | | }; |
| | | |
| | | export const compDirectChoices = [ |
| | | { id: 1, name: compDirectMap[1] }, |
| | | { id: 2, name: compDirectMap[2] }, |
| | | { id: 3, name: compDirectMap[3] }, |
| | | { id: 1, name: 'page.loc.enums.compDirect.left' }, |
| | | { id: 2, name: 'page.loc.enums.compDirect.right' }, |
| | | { id: 3, name: 'page.loc.enums.compDirect.forward' }, |
| | | ]; |
| | | |
| | | export const getCompDirectLabel = (translate, compDirect, fallback = '-') => { |
| | | const key = compDirectMap[compDirect]; |
| | | if (!key) { |
| | | const choice = compDirectChoices.find((item) => item.id === compDirect); |
| | | if (!choice) { |
| | | return fallback; |
| | | } |
| | | return typeof translate === 'function' |
| | | ? translate(key, { _: fallback }) |
| | | : key; |
| | | ? translate(choice.name, { _: fallback }) |
| | | : choice.name; |
| | | }; |