Merge branch 'dev' of http://47.97.1.152:5880/r/wms-master into dev
# Conflicts:
# rsf-admin/src/i18n/en.js
# rsf-admin/src/i18n/zh.js
| | |
| | | |
| | | // export excel from all data |
| | | export: async (resource, params) => { |
| | | console.log("export", resource, params); |
| | | const _params = Common.integrateParams(params); |
| | | try { |
| | | const res = await request.post(`${resource}/export`, _params, { |
| | |
| | | const chineseMessages = { |
| | | ra: { |
| | | action: { |
| | | add_filter: '过滤条件', |
| | | add: '添加', |
| | | back: '返回', |
| | | bulk_actions: '1 item selected |||| %{smart_count} items selected', |
| | | cancel: '取消', |
| | | clear_array_input: '情空列表', |
| | | clear_input_value: '清空', |
| | | clone: '克隆', |
| | | confirm: '确定', |
| | | create: '添加', |
| | | create_item: '添加 %{item}', |
| | | delete: '删除', |
| | | edit: '编辑', |
| | | export: '导出', |
| | | list: '列表', |
| | | refresh: '刷新', |
| | | remove_filter: 'Remove this filter', |
| | | remove_all_filters: '移除所有', |
| | | remove: '移除', |
| | | save: '保存', |
| | | search: '搜索', |
| | | select_all: '全部选中', |
| | | select_row: '选中一行', |
| | | show: '显示', |
| | | sort: '排序', |
| | | undo: '撤销', |
| | | unselect: '取消选择', |
| | | expand: '展开', |
| | | close: '关闭', |
| | | open_menu: 'Open menu', |
| | | close_menu: 'Close menu', |
| | | update: '修改', |
| | | move_up: 'Move up', |
| | | move_down: 'Move down', |
| | | open: 'Open', |
| | | toggle_theme: 'Toggle light/dark mode', |
| | | select_columns: '筛选列', |
| | | update_application: 'Reload Application', |
| | | }, |
| | | boolean: { |
| | | true: '是', |
| | | false: '否', |
| | | null: ' ', |
| | | }, |
| | | page: { |
| | | create: 'Create %{name}', |
| | | dashboard: 'Dashboard', |
| | | edit: '%{name} %{recordRepresentation}', |
| | | error: 'Something went wrong', |
| | | list: '%{name}', |
| | | loading: 'Loading', |
| | | not_found: 'Not Found', |
| | | show: '%{name} %{recordRepresentation}', |
| | | empty: 'No %{name} yet.', |
| | | invite: 'Do you want to add one?', |
| | | }, |
| | | input: { |
| | | file: { |
| | | upload_several: |
| | | '拖放一些要上传的文件,或单击以选择一个', |
| | | upload_single: '拖放要上传的文件,或单击以选择它', |
| | | }, |
| | | image: { |
| | | upload_several: |
| | | 'Drop some pictures to upload, or click to select one.', |
| | | upload_single: |
| | | 'Drop a picture to upload, or click to select it.', |
| | | }, |
| | | references: { |
| | | all_missing: 'Unable to find references data.', |
| | | many_missing: |
| | | 'At least one of the associated references no longer appears to be available.', |
| | | single_missing: |
| | | 'Associated reference no longer appears to be available.', |
| | | }, |
| | | password: { |
| | | toggle_visible: 'Hide password', |
| | | toggle_hidden: 'Show password', |
| | | }, |
| | | }, |
| | | message: { |
| | | about: 'About', |
| | | are_you_sure: 'Are you sure?', |
| | | auth_error: |
| | | 'An error occurred while validating the authentication token.', |
| | | bulk_delete_content: |
| | | 'Are you sure you want to delete this %{name}? |||| Are you sure you want to delete these %{smart_count} items?', |
| | | bulk_delete_title: |
| | | '删除 %{name} |||| 删除 %{smart_count} %{name}', |
| | | bulk_update_content: |
| | | 'Are you sure you want to update this %{name}? |||| Are you sure you want to update these %{smart_count} items?', |
| | | bulk_update_title: |
| | | '修改 %{name} |||| 修改 %{smart_count} %{name}', |
| | | clear_array_input: 'Are you sure you want to clear the whole list?', |
| | | delete_content: '您确实要删除此项吗?', |
| | | delete_title: '删除 %{name} #%{id}', |
| | | details: 'Details', |
| | | error: "A client error occurred and your request couldn't be completed.", |
| | | |
| | | invalid_form: '表单无效 请检查是否有错误!', |
| | | loading: 'Please wait', |
| | | no: 'No', |
| | | not_found: |
| | | 'Either you typed a wrong URL, or you followed a bad link.', |
| | | yes: 'Yes', |
| | | unsaved_changes: |
| | | "Some of your changes weren't saved. Are you sure you want to ignore them?", |
| | | }, |
| | | navigation: { |
| | | no_results: '没有找到数据', |
| | | no_more_results: |
| | | 'The page number %{page} is out of boundaries. Try the previous page.', |
| | | page_out_of_boundaries: 'Page number %{page} out of boundaries', |
| | | page_out_from_end: 'Cannot go after last page', |
| | | page_out_from_begin: 'Cannot go before page 1', |
| | | page_range_info: '%{offsetBegin}-%{offsetEnd} of %{total}', |
| | | partial_page_range_info: |
| | | '%{offsetBegin}-%{offsetEnd} of more than %{offsetEnd}', |
| | | current_page: 'Page %{page}', |
| | | page: 'Go to page %{page}', |
| | | first: 'Go to first page', |
| | | last: 'Go to last page', |
| | | next: 'Go to next page', |
| | | previous: 'Go to previous page', |
| | | page_rows_per_page: '每页数量:', |
| | | skip_nav: 'Skip to content', |
| | | }, |
| | | sort: { |
| | | sort_by: 'Sort by %{field} %{order}', |
| | | ASC: 'ascending', |
| | | DESC: 'descending', |
| | | }, |
| | | auth: { |
| | | auth_check_error: 'Please login to continue', |
| | | user_menu: 'Profile', |
| | | username: 'Username', |
| | | password: 'Password', |
| | | sign_in: 'Sign in', |
| | | sign_in_error: 'Authentication failed, please retry', |
| | | logout: 'Logout', |
| | | }, |
| | | notification: { |
| | | updated: '修改成功 |||| %{smart_count} 项 修改成功', |
| | | created: '添加成功', |
| | | deleted: '删除成功 |||| %{smart_count} 项 删除成功', |
| | | bad_item: 'Incorrect element', |
| | | item_doesnt_exist: 'Element does not exist', |
| | | http_error: 'Server communication error', |
| | | data_provider_error: |
| | | 'dataProvider error. Check the console for details.', |
| | | i18n_error: |
| | | 'Cannot load the translations for the specified language', |
| | | canceled: 'Action cancelled', |
| | | logged_out: 'Your session has ended, please reconnect.', |
| | | not_authorized: "You're not authorized to access this resource.", |
| | | application_update_available: 'A new version is available.', |
| | | }, |
| | | validation: { |
| | | required: '必填项', |
| | | minLength: 'Must be %{min} characters at least', |
| | | maxLength: 'Must be %{max} characters or less', |
| | | minValue: 'Must be at least %{min}', |
| | | maxValue: 'Must be %{max} or less', |
| | | number: 'Must be a number', |
| | | email: 'Must be a valid email', |
| | | oneOf: 'Must be one of: %{options}', |
| | | regex: 'Must match a specific format (regexp): %{pattern}', |
| | | unique: 'Must be unique', |
| | | }, |
| | | saved_queries: { |
| | | label: '保存过滤', |
| | | query_name: 'Query name', |
| | | new_label: '保存过滤条件...', |
| | | new_dialog_title: 'Save current query as', |
| | | remove_label: '移除过滤条件', |
| | | remove_label_with_name: 'Remove query "%{name}"', |
| | | remove_dialog_title: '移除过滤条件?', |
| | | remove_message: |
| | | '您确定要移除已保存过滤条件吗?', |
| | | help: 'Filter the list and save this query for later', |
| | | }, |
| | | configurable: { |
| | | customize: 'Customize', |
| | | configureMode: 'Configure this page', |
| | | inspector: { |
| | | title: 'Inspector', |
| | | content: 'Hover the application UI elements to configure them', |
| | | reset: 'Reset Settings', |
| | | hideAll: 'Hide All', |
| | | showAll: 'Show All', |
| | | }, |
| | | Datagrid: { |
| | | title: 'Datagrid', |
| | | unlabeled: 'Unlabeled column #%{column}', |
| | | }, |
| | | SimpleForm: { |
| | | title: 'Form', |
| | | unlabeled: 'Unlabeled input #%{input}', |
| | | }, |
| | | SimpleList: { |
| | | title: 'List', |
| | | primaryText: 'Primary text', |
| | | secondaryText: 'Secondary text', |
| | | tertiaryText: 'Tertiary text', |
| | | }, |
| | | }, |
| | | ra: { |
| | | action: { |
| | | add_filter: "过滤条件", |
| | | add: "添加", |
| | | back: "返回", |
| | | bulk_actions: "1 item selected |||| %{smart_count} items selected", |
| | | cancel: "取消", |
| | | clear_array_input: "情空列表", |
| | | clear_input_value: "清空", |
| | | clone: "克隆", |
| | | confirm: "确定", |
| | | create: "添加", |
| | | create_item: "添加 %{item}", |
| | | delete: "删除", |
| | | edit: "编辑", |
| | | export: "导出", |
| | | import: "导入", |
| | | list: "列表", |
| | | refresh: "刷新", |
| | | remove_filter: "Remove this filter", |
| | | remove_all_filters: "移除所有", |
| | | remove: "移除", |
| | | save: "保存", |
| | | search: "搜索", |
| | | select_all: "全部选中", |
| | | select_row: "选中一行", |
| | | show: "显示", |
| | | sort: "排序", |
| | | undo: "撤销", |
| | | unselect: "取消选择", |
| | | expand: "展开", |
| | | close: "关闭", |
| | | open_menu: "Open menu", |
| | | close_menu: "Close menu", |
| | | update: "修改", |
| | | move_up: "Move up", |
| | | move_down: "Move down", |
| | | open: "Open", |
| | | toggle_theme: "Toggle light/dark mode", |
| | | select_columns: "筛选列", |
| | | update_application: "Reload Application", |
| | | }, |
| | | } |
| | | boolean: { |
| | | true: "是", |
| | | false: "否", |
| | | null: " ", |
| | | }, |
| | | page: { |
| | | create: "Create %{name}", |
| | | dashboard: "Dashboard", |
| | | edit: "%{name} %{recordRepresentation}", |
| | | error: "Something went wrong", |
| | | list: "%{name}", |
| | | loading: "Loading", |
| | | not_found: "Not Found", |
| | | show: "%{name} %{recordRepresentation}", |
| | | empty: "No %{name} yet.", |
| | | invite: "Do you want to add one?", |
| | | }, |
| | | input: { |
| | | file: { |
| | | upload_several: "拖放一些要上传的文件,或单击以选择一个", |
| | | upload_single: "拖放要上传的文件,或单击以选择它", |
| | | }, |
| | | image: { |
| | | upload_several: "Drop some pictures to upload, or click to select one.", |
| | | upload_single: "Drop a picture to upload, or click to select it.", |
| | | }, |
| | | references: { |
| | | all_missing: "Unable to find references data.", |
| | | many_missing: |
| | | "At least one of the associated references no longer appears to be available.", |
| | | single_missing: |
| | | "Associated reference no longer appears to be available.", |
| | | }, |
| | | password: { |
| | | toggle_visible: "Hide password", |
| | | toggle_hidden: "Show password", |
| | | }, |
| | | }, |
| | | message: { |
| | | about: "About", |
| | | are_you_sure: "Are you sure?", |
| | | auth_error: |
| | | "An error occurred while validating the authentication token.", |
| | | bulk_delete_content: |
| | | "Are you sure you want to delete this %{name}? |||| Are you sure you want to delete these %{smart_count} items?", |
| | | bulk_delete_title: "删除 %{name} |||| 删除 %{smart_count} %{name}", |
| | | bulk_update_content: |
| | | "Are you sure you want to update this %{name}? |||| Are you sure you want to update these %{smart_count} items?", |
| | | bulk_update_title: "修改 %{name} |||| 修改 %{smart_count} %{name}", |
| | | clear_array_input: "Are you sure you want to clear the whole list?", |
| | | delete_content: "您确实要删除此项吗?", |
| | | delete_title: "删除 %{name} #%{id}", |
| | | details: "Details", |
| | | error: "A client error occurred and your request couldn't be completed.", |
| | | |
| | | export default chineseMessages; |
| | | invalid_form: "表单无效 请检查是否有错误!", |
| | | loading: "Please wait", |
| | | no: "No", |
| | | not_found: "Either you typed a wrong URL, or you followed a bad link.", |
| | | yes: "Yes", |
| | | unsaved_changes: |
| | | "Some of your changes weren't saved. Are you sure you want to ignore them?", |
| | | }, |
| | | navigation: { |
| | | no_results: "没有找到数据", |
| | | no_more_results: |
| | | "The page number %{page} is out of boundaries. Try the previous page.", |
| | | page_out_of_boundaries: "Page number %{page} out of boundaries", |
| | | page_out_from_end: "Cannot go after last page", |
| | | page_out_from_begin: "Cannot go before page 1", |
| | | page_range_info: "%{offsetBegin}-%{offsetEnd} of %{total}", |
| | | partial_page_range_info: |
| | | "%{offsetBegin}-%{offsetEnd} of more than %{offsetEnd}", |
| | | current_page: "Page %{page}", |
| | | page: "Go to page %{page}", |
| | | first: "Go to first page", |
| | | last: "Go to last page", |
| | | next: "Go to next page", |
| | | previous: "Go to previous page", |
| | | page_rows_per_page: "每页数量:", |
| | | skip_nav: "Skip to content", |
| | | }, |
| | | sort: { |
| | | sort_by: "Sort by %{field} %{order}", |
| | | ASC: "ascending", |
| | | DESC: "descending", |
| | | }, |
| | | auth: { |
| | | auth_check_error: "Please login to continue", |
| | | user_menu: "Profile", |
| | | username: "Username", |
| | | password: "Password", |
| | | sign_in: "Sign in", |
| | | sign_in_error: "Authentication failed, please retry", |
| | | logout: "Logout", |
| | | }, |
| | | notification: { |
| | | updated: "修改成功 |||| %{smart_count} 项 修改成功", |
| | | created: "添加成功", |
| | | deleted: "删除成功 |||| %{smart_count} 项 删除成功", |
| | | bad_item: "Incorrect element", |
| | | item_doesnt_exist: "Element does not exist", |
| | | http_error: "Server communication error", |
| | | data_provider_error: "dataProvider error. Check the console for details.", |
| | | i18n_error: "Cannot load the translations for the specified language", |
| | | canceled: "Action cancelled", |
| | | logged_out: "Your session has ended, please reconnect.", |
| | | not_authorized: "You're not authorized to access this resource.", |
| | | application_update_available: "A new version is available.", |
| | | }, |
| | | validation: { |
| | | required: "必填项", |
| | | minLength: "Must be %{min} characters at least", |
| | | maxLength: "Must be %{max} characters or less", |
| | | minValue: "Must be at least %{min}", |
| | | maxValue: "Must be %{max} or less", |
| | | number: "Must be a number", |
| | | email: "Must be a valid email", |
| | | oneOf: "Must be one of: %{options}", |
| | | regex: "Must match a specific format (regexp): %{pattern}", |
| | | unique: "Must be unique", |
| | | }, |
| | | saved_queries: { |
| | | label: "保存过滤", |
| | | query_name: "Query name", |
| | | new_label: "保存过滤条件...", |
| | | new_dialog_title: "Save current query as", |
| | | remove_label: "移除过滤条件", |
| | | remove_label_with_name: 'Remove query "%{name}"', |
| | | remove_dialog_title: "移除过滤条件?", |
| | | remove_message: "您确定要移除已保存过滤条件吗?", |
| | | help: "Filter the list and save this query for later", |
| | | }, |
| | | configurable: { |
| | | customize: "Customize", |
| | | configureMode: "Configure this page", |
| | | inspector: { |
| | | title: "Inspector", |
| | | content: "Hover the application UI elements to configure them", |
| | | reset: "Reset Settings", |
| | | hideAll: "Hide All", |
| | | showAll: "Show All", |
| | | }, |
| | | Datagrid: { |
| | | title: "Datagrid", |
| | | unlabeled: "Unlabeled column #%{column}", |
| | | }, |
| | | SimpleForm: { |
| | | title: "Form", |
| | | unlabeled: "Unlabeled input #%{input}", |
| | | }, |
| | | SimpleList: { |
| | | title: "List", |
| | | primaryText: "Primary text", |
| | | secondaryText: "Secondary text", |
| | | tertiaryText: "Tertiary text", |
| | | }, |
| | | }, |
| | | }, |
| | | }; |
| | | |
| | | export default chineseMessages; |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import React, { |
| | | useState, |
| | | useRef, |
| | | useEffect, |
| | | useMemo, |
| | | useCallback, |
| | | } from "react"; |
| | | import { useNavigate } from "react-router-dom"; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import AsnOrderCreate from "./AsnOrderCreate"; |
| | | import AsnOrderPanel from "./AsnOrderPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import MyExportButton from "../components/MyExportButton"; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import ConstructionIcon from "@mui/icons-material/Construction"; |
| | | import UploadloadIcon from "@mui/icons-material/Upload"; |
| | | import { |
| | | PAGE_DRAWER_WIDTH, |
| | | OPERATE_MODE, |
| | | DEFAULT_PAGE_SIZE, |
| | | } from "@/config/setting"; |
| | | import * as Common from "@/utils/common"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | "& .css-1vooibu-MuiSvgIcon-root": { |
| | | height: ".9em", |
| | | }, |
| | | "& .RaDatagrid-row": { |
| | | cursor: "auto", |
| | | }, |
| | | "& .column-name": {}, |
| | | "& .opt": { |
| | | width: 200, |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.asnOrder.code" />, |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | | <TextInput source="type" label="table.field.asnOrder.type" />, |
| | | <TextInput source="wkType" label="table.field.asnOrder.wkType" />, |
| | | <NumberInput source="anfme" label="table.field.asnOrder.anfme" />, |
| | | <NumberInput source="qty" label="table.field.asnOrder.qty" />, |
| | | <TextInput source="logisNo" label="table.field.asnOrder.logisNo" />, |
| | | <DateInput source="arrTime" label="table.field.asnOrder.arrTime" />, |
| | | <SelectInput source="rleStatus" label="table.field.asnOrder.rleStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 正常' }, |
| | | { id: 1, name: ' 已释放' }, |
| | | ]} |
| | | />, |
| | | <TextInput source="code" label="table.field.asnOrder.code" />, |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | | <TextInput source="type" label="table.field.asnOrder.type" />, |
| | | <TextInput source="wkType" label="table.field.asnOrder.wkType" />, |
| | | <NumberInput source="anfme" label="table.field.asnOrder.anfme" />, |
| | | <NumberInput source="qty" label="table.field.asnOrder.qty" />, |
| | | <TextInput source="logisNo" label="table.field.asnOrder.logisNo" />, |
| | | <DateInput source="arrTime" label="table.field.asnOrder.arrTime" />, |
| | | <SelectInput |
| | | source="rleStatus" |
| | | label="table.field.asnOrder.rleStatus" |
| | | choices={[ |
| | | { id: 0, name: " 正常" }, |
| | | { id: 1, name: " 已释放" }, |
| | | ]} |
| | | />, |
| | | <TextInput source="name" label="table.field.asnOrder.name" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: "1", name: "common.enums.statusTrue" }, |
| | | { id: "0", name: "common.enums.statusFalse" }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ]; |
| | | |
| | | const AsnOrderList = () => { |
| | | const translate = useTranslate(); |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.asnOrder"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='asnOrder' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrder' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <AsnOrderPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.asnOrder.code" /> |
| | | <TextField source="poCode" label="table.field.asnOrder.poCode" /> |
| | | <NumberField source="poId" label="table.field.asnOrder.poId" /> |
| | | <TextField source="type" label="table.field.asnOrder.type" /> |
| | | <TextField source="wkType" label="table.field.asnOrder.wkType" /> |
| | | <NumberField source="anfme" label="table.field.asnOrder.anfme" /> |
| | | <NumberField source="qty" label="table.field.asnOrder.qty" /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | <DateField source="arrTime" label="table.field.asnOrder.arrTime" showTime /> |
| | | <TextField source="rleStatus$" label="table.field.asnOrder.rleStatus" sortable={false} /> |
| | | <TextField source="name" label="table.field.asnOrder.name" /> |
| | | const navigate = useNavigate(); |
| | | const assign = (record) => { |
| | | navigate(`/asnOrderItem?asnId=${record.id}`); |
| | | }; |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <AsnOrderCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | const importList = () => {}; |
| | | const inspection = () => {}; |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(["all"], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.asnOrder"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={ |
| | | <TopToolbar> |
| | | <Button onClick={importList} label={"toolbar.inspection"}> |
| | | <UploadloadIcon /> |
| | | </Button> |
| | | |
| | | <Button onClick={inspection} label={"ra.action.import"}> |
| | | <ConstructionIcon /> |
| | | </Button> |
| | | |
| | | <FilterButton /> |
| | | <MyCreateButton |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | <PageDrawer |
| | | title='AsnOrder Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | <SelectColumnsButton preferenceKey="asnOrder" /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | } |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey="asnOrder" |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <AsnOrderPanel />} |
| | | expandSingle={true} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.asnOrder.code" /> |
| | | <TextField source="poCode" label="table.field.asnOrder.poCode" /> |
| | | <NumberField source="poId" label="table.field.asnOrder.poId" /> |
| | | <TextField source="type" label="table.field.asnOrder.type" /> |
| | | <TextField source="wkType" label="table.field.asnOrder.wkType" /> |
| | | <NumberField source="anfme" label="table.field.asnOrder.anfme" /> |
| | | <NumberField source="qty" label="table.field.asnOrder.qty" /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | <DateField |
| | | source="arrTime" |
| | | label="table.field.asnOrder.arrTime" |
| | | showTime |
| | | /> |
| | | <TextField |
| | | source="rleStatus$" |
| | | label="table.field.asnOrder.rleStatus" |
| | | sortable={false} |
| | | /> |
| | | <TextField source="name" label="table.field.asnOrder.name" /> |
| | | |
| | | <ReferenceField |
| | | source="updateBy" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | | showTime |
| | | /> |
| | | <BooleanField |
| | | source="statusBool" |
| | | label="common.field.status" |
| | | sortable={false} |
| | | /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: "1px", fontSize: ".75rem" }} /> |
| | | <DeleteButton |
| | | sx={{ padding: "1px", fontSize: ".75rem" }} |
| | | mutationMode={OPERATE_MODE} |
| | | /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <AsnOrderCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <PageDrawer |
| | | title="AsnOrder Detail" |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | ></PageDrawer> |
| | | </Box> |
| | | ); |
| | | }; |
| | | |
| | | export default AsnOrderList; |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import React, { |
| | | useState, |
| | | useRef, |
| | | useEffect, |
| | | useMemo, |
| | | useCallback, |
| | | } from "react"; |
| | | import { useNavigate, useLocation } from "react-router-dom"; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import AsnOrderItemCreate from "./AsnOrderItemCreate"; |
| | | import AsnOrderItemPanel from "./AsnOrderItemPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import MyExportButton from "../components/MyExportButton"; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import QrCodeIcon from "@mui/icons-material/QrCode"; |
| | | import { |
| | | PAGE_DRAWER_WIDTH, |
| | | OPERATE_MODE, |
| | | DEFAULT_PAGE_SIZE, |
| | | } from "@/config/setting"; |
| | | import * as Common from "@/utils/common"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | "& .css-1vooibu-MuiSvgIcon-root": { |
| | | height: ".9em", |
| | | }, |
| | | "& .RaDatagrid-row": { |
| | | cursor: "auto", |
| | | }, |
| | | "& .column-name": {}, |
| | | "& .opt": { |
| | | width: 200, |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <NumberInput source="asnId" label="table.field.asnOrderItem.asnId" />, |
| | | <TextInput source="asnCode" label="table.field.asnOrderItem.asnCode" />, |
| | | <TextInput source="poDetlId" label="table.field.asnOrderItem.poDetlId" />, |
| | | <TextInput source="poDetlCode" label="table.field.asnOrderItem.poDetlCode" />, |
| | | <TextInput source="matnrId" label="table.field.asnOrderItem.matnrId" />, |
| | | <TextInput source="matnk" label="table.field.asnOrderItem.matnk" />, |
| | | <NumberInput source="anfme" label="table.field.asnOrderItem.anfme" />, |
| | | <TextInput source="stockUnit" label="table.field.asnOrderItem.stockUnit" />, |
| | | <NumberInput source="purQty" label="table.field.asnOrderItem.purQty" />, |
| | | <TextInput source="purUnit" label="table.field.asnOrderItem.purUnit" />, |
| | | <NumberInput source="qty" label="table.field.asnOrderItem.qty" />, |
| | | <TextInput source="splrCode" label="table.field.asnOrderItem.splrCode" />, |
| | | <TextInput source="splrName" label="table.field.asnOrderItem.splrName" />, |
| | | <TextInput source="qrcode" label="table.field.asnOrderItem.qrcode" />, |
| | | <TextInput source="barcode" label="table.field.asnOrderItem.barcode" />, |
| | | <TextInput source="packName" label="table.field.asnOrderItem.packName" />, |
| | | <NumberInput source="asnId" label="table.field.asnOrderItem.asnId" />, |
| | | <TextInput source="asnCode" label="table.field.asnOrderItem.asnCode" />, |
| | | <TextInput source="poDetlId" label="table.field.asnOrderItem.poDetlId" />, |
| | | <TextInput source="poDetlCode" label="table.field.asnOrderItem.poDetlCode" />, |
| | | <TextInput source="matnrId" label="table.field.asnOrderItem.matnrId" />, |
| | | <TextInput source="matnk" label="table.field.asnOrderItem.matnk" />, |
| | | <NumberInput source="anfme" label="table.field.asnOrderItem.anfme" />, |
| | | <TextInput source="stockUnit" label="table.field.asnOrderItem.stockUnit" />, |
| | | <NumberInput source="purQty" label="table.field.asnOrderItem.purQty" />, |
| | | <TextInput source="purUnit" label="table.field.asnOrderItem.purUnit" />, |
| | | <NumberInput source="qty" label="table.field.asnOrderItem.qty" />, |
| | | <TextInput source="splrCode" label="table.field.asnOrderItem.splrCode" />, |
| | | <TextInput source="splrName" label="table.field.asnOrderItem.splrName" />, |
| | | <TextInput source="qrcode" label="table.field.asnOrderItem.qrcode" />, |
| | | <TextInput source="barcode" label="table.field.asnOrderItem.barcode" />, |
| | | <TextInput source="packName" label="table.field.asnOrderItem.packName" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: "1", name: "common.enums.statusTrue" }, |
| | | { id: "0", name: "common.enums.statusFalse" }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ]; |
| | | |
| | | const AsnOrderItemList = () => { |
| | | const translate = useTranslate(); |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.asnOrderItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='asnOrderItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <AsnOrderItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.asnOrderItem.asnId" /> |
| | | <TextField source="asnCode" label="table.field.asnOrderItem.asnCode" /> |
| | | <TextField source="poDetlId" label="table.field.asnOrderItem.poDetlId" /> |
| | | <TextField source="poDetlCode" label="table.field.asnOrderItem.poDetlCode" /> |
| | | <TextField source="matnrId" label="table.field.asnOrderItem.matnrId" /> |
| | | <TextField source="matnk" label="table.field.asnOrderItem.matnk" /> |
| | | <NumberField source="anfme" label="table.field.asnOrderItem.anfme" /> |
| | | <TextField source="stockUnit" label="table.field.asnOrderItem.stockUnit" /> |
| | | <NumberField source="purQty" label="table.field.asnOrderItem.purQty" /> |
| | | <TextField source="purUnit" label="table.field.asnOrderItem.purUnit" /> |
| | | <NumberField source="qty" label="table.field.asnOrderItem.qty" /> |
| | | <TextField source="splrCode" label="table.field.asnOrderItem.splrCode" /> |
| | | <TextField source="splrName" label="table.field.asnOrderItem.splrName" /> |
| | | <TextField source="qrcode" label="table.field.asnOrderItem.qrcode" /> |
| | | <TextField source="barcode" label="table.field.asnOrderItem.barcode" /> |
| | | <TextField source="packName" label="table.field.asnOrderItem.packName" /> |
| | | const location = useLocation(); |
| | | const queryParams = new URLSearchParams(location.search); |
| | | const ruleId = queryParams.get("ruleId"); |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <AsnOrderItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | const creatCode = () => {}; |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(["all"], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.asnOrderItem"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={ |
| | | <TopToolbar> |
| | | <Button onClick={creatCode} label={"toolbar.creatcode"}> |
| | | <QrCodeIcon /> |
| | | </Button> |
| | | <FilterButton /> |
| | | <MyCreateButton |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | <PageDrawer |
| | | title='AsnOrderItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | <SelectColumnsButton preferenceKey="asnOrderItem" /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | } |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey="asnOrderItem" |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <AsnOrderItemPanel />} |
| | | expandSingle={true} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.asnOrderItem.asnId" /> |
| | | <TextField |
| | | source="asnCode" |
| | | label="table.field.asnOrderItem.asnCode" |
| | | /> |
| | | <TextField |
| | | source="poDetlId" |
| | | label="table.field.asnOrderItem.poDetlId" |
| | | /> |
| | | <TextField |
| | | source="poDetlCode" |
| | | label="table.field.asnOrderItem.poDetlCode" |
| | | /> |
| | | <TextField |
| | | source="matnrId" |
| | | label="table.field.asnOrderItem.matnrId" |
| | | /> |
| | | <TextField source="matnk" label="table.field.asnOrderItem.matnk" /> |
| | | <NumberField source="anfme" label="table.field.asnOrderItem.anfme" /> |
| | | <TextField |
| | | source="stockUnit" |
| | | label="table.field.asnOrderItem.stockUnit" |
| | | /> |
| | | <NumberField |
| | | source="purQty" |
| | | label="table.field.asnOrderItem.purQty" |
| | | /> |
| | | <TextField |
| | | source="purUnit" |
| | | label="table.field.asnOrderItem.purUnit" |
| | | /> |
| | | <NumberField source="qty" label="table.field.asnOrderItem.qty" /> |
| | | <TextField |
| | | source="splrCode" |
| | | label="table.field.asnOrderItem.splrCode" |
| | | /> |
| | | <TextField |
| | | source="splrName" |
| | | label="table.field.asnOrderItem.splrName" |
| | | /> |
| | | <TextField source="qrcode" label="table.field.asnOrderItem.qrcode" /> |
| | | <TextField |
| | | source="barcode" |
| | | label="table.field.asnOrderItem.barcode" |
| | | /> |
| | | <TextField |
| | | source="packName" |
| | | label="table.field.asnOrderItem.packName" |
| | | /> |
| | | |
| | | <ReferenceField |
| | | source="updateBy" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | | showTime |
| | | /> |
| | | <BooleanField |
| | | source="statusBool" |
| | | label="common.field.status" |
| | | sortable={false} |
| | | /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: "1px", fontSize: ".75rem" }} /> |
| | | <DeleteButton |
| | | sx={{ padding: "1px", fontSize: ".75rem" }} |
| | | mutationMode={OPERATE_MODE} |
| | | /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <AsnOrderItemCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <PageDrawer |
| | | title="AsnOrderItem Detail" |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | ></PageDrawer> |
| | | </Box> |
| | | ); |
| | | }; |
| | | |
| | | export default AsnOrderItemList; |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Button, |
| | | useTranslate, |
| | | } from 'react-admin'; |
| | | import { Fab, useMediaQuery } from '@mui/material'; |
| | | import ContentAdd from '@mui/icons-material/Add'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import { Link } from 'react-router-dom'; |
| | | import { Button, useTranslate } from "react-admin"; |
| | | import { Fab, useMediaQuery } from "@mui/material"; |
| | | import ContentAdd from "@mui/icons-material/Add"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import { Link } from "react-router-dom"; |
| | | |
| | | const MyCreateButton = (props) => { |
| | | const translate = useTranslate(); |
| | | const translate = useTranslate(); |
| | | const isSmall = useMediaQuery((theme) => theme.breakpoints.down("md")); |
| | | |
| | | const isSmall = useMediaQuery((theme) => |
| | | theme.breakpoints.down('md') |
| | | ); |
| | | return isSmall ? ( |
| | | <StyledFab |
| | | color="primary" |
| | | className={CreateButtonClasses.floating} |
| | | aria-label={label && translate(label)} |
| | | onClick={props.onClick} |
| | | {...props} |
| | | > |
| | | {defaultIcon} |
| | | </StyledFab> |
| | | ) : ( |
| | | <StyledButton |
| | | className={CreateButtonClasses.floating} |
| | | label={label} |
| | | onClick={props.onClick} |
| | | {...props} |
| | | > |
| | | {defaultIcon} |
| | | </StyledButton> |
| | | ); |
| | | }; |
| | | |
| | | return isSmall ? ( |
| | | <StyledFab |
| | | color="primary" |
| | | className={CreateButtonClasses.floating} |
| | | aria-label={label && translate(label)} |
| | | onClick={props.onClick} |
| | | {...props} |
| | | > |
| | | {defaultIcon} |
| | | </StyledFab> |
| | | ) : ( |
| | | <StyledButton |
| | | className={CreateButtonClasses.floating} |
| | | label={label} |
| | | onClick={props.onClick} |
| | | {...props} |
| | | > |
| | | {defaultIcon} |
| | | </StyledButton> |
| | | ); |
| | | } |
| | | |
| | | const label = 'ra.action.create'; |
| | | const PREFIX = 'RaCreateButton'; |
| | | const label = "ra.action.create"; |
| | | const PREFIX = "RaCreateButton"; |
| | | const defaultIcon = <ContentAdd />; |
| | | |
| | | export const CreateButtonClasses = { |
| | | root: `${PREFIX}-root`, |
| | | floating: `${PREFIX}-floating`, |
| | | root: `${PREFIX}-root`, |
| | | floating: `${PREFIX}-floating`, |
| | | }; |
| | | |
| | | const StyledFab = styled(Fab, { |
| | | name: PREFIX, |
| | | overridesResolver: (_props, styles) => styles.root, |
| | | name: PREFIX, |
| | | overridesResolver: (_props, styles) => styles.root, |
| | | })(({ theme }) => ({ |
| | | [`&.${CreateButtonClasses.floating}`]: { |
| | | color: theme.palette.getContrastText(theme.palette.primary.main), |
| | | margin: 0, |
| | | top: 'auto', |
| | | right: 20, |
| | | bottom: 60, |
| | | left: 'auto', |
| | | position: 'fixed', |
| | | zIndex: 1000, |
| | | }, |
| | | [`&.${CreateButtonClasses.floating}`]: { |
| | | color: theme.palette.getContrastText(theme.palette.primary.main), |
| | | margin: 0, |
| | | top: "auto", |
| | | right: 20, |
| | | bottom: 60, |
| | | left: "auto", |
| | | position: "fixed", |
| | | zIndex: 1000, |
| | | }, |
| | | })); |
| | | |
| | | const StyledButton = styled(Button, { |
| | | name: PREFIX, |
| | | overridesResolver: (_props, styles) => styles.root, |
| | | name: PREFIX, |
| | | overridesResolver: (_props, styles) => styles.root, |
| | | })({}); |
| | | |
| | | export default MyCreateButton; |
| | | export default MyCreateButton; |
| | |
| | | import * as React from 'react'; |
| | | import { useCallback } from 'react'; |
| | | import DownloadIcon from '@mui/icons-material/GetApp'; |
| | | import * as React from "react"; |
| | | import { useCallback } from "react"; |
| | | import DownloadIcon from "@mui/icons-material/GetApp"; |
| | | import { |
| | | Button, useDataProvider, useNotify, useListContext |
| | | } from 'react-admin'; |
| | | Button, |
| | | useDataProvider, |
| | | useNotify, |
| | | useListContext, |
| | | } from "react-admin"; |
| | | |
| | | const MyExportButton = (props) => { |
| | | const { |
| | | maxResults = 1000, |
| | | onClick, |
| | | label = 'ra.action.export', |
| | | icon = defaultIcon, |
| | | exporter: customExporter, |
| | | meta, |
| | | ...rest |
| | | } = props; |
| | | const { |
| | | maxResults = 1000, |
| | | onClick, |
| | | label = "ra.action.export", |
| | | icon = defaultIcon, |
| | | exporter: customExporter, |
| | | meta, |
| | | ...rest |
| | | } = props; |
| | | |
| | | const { |
| | | filter, |
| | | filterValues, |
| | | resource, |
| | | sort, |
| | | total, |
| | | } = useListContext(); |
| | | const { filter, filterValues, resource, sort, total } = useListContext(); |
| | | |
| | | const dataProvider = useDataProvider(); |
| | | const notify = useNotify(); |
| | | const dataProvider = useDataProvider(); |
| | | const notify = useNotify(); |
| | | |
| | | const handleClick = useCallback( |
| | | event => { |
| | | dataProvider.export(resource, { |
| | | sort, |
| | | filter: filter |
| | | ? { ...filterValues, ...filter } |
| | | : filterValues, |
| | | pagination: { page: 1, perPage: maxResults }, |
| | | meta, |
| | | }).then((res) => { |
| | | const url = window.URL.createObjectURL(new Blob([res.data], { type: res.headers['content-type'] })); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.setAttribute('download', `${resource}.xlsx`); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | link.remove(); |
| | | }).catch(error => { |
| | | console.error(error); |
| | | notify('ra.notification.http_error', { type: 'error' }); |
| | | }); |
| | | if (typeof onClick === 'function') { |
| | | onClick(event); |
| | | } |
| | | }, |
| | | [ |
| | | dataProvider, |
| | | filter, |
| | | filterValues, |
| | | maxResults, |
| | | notify, |
| | | onClick, |
| | | resource, |
| | | sort, |
| | | meta, |
| | | ] |
| | | ); |
| | | const handleClick = useCallback( |
| | | (event) => { |
| | | dataProvider |
| | | .export(resource, { |
| | | sort, |
| | | filter: filter ? { ...filterValues, ...filter } : filterValues, |
| | | pagination: { page: 1, perPage: maxResults }, |
| | | meta, |
| | | }) |
| | | .then((res) => { |
| | | const url = window.URL.createObjectURL( |
| | | new Blob([res.data], { type: res.headers["content-type"] }), |
| | | ); |
| | | const link = document.createElement("a"); |
| | | link.href = url; |
| | | link.setAttribute("download", `${resource}.xlsx`); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | link.remove(); |
| | | }) |
| | | .catch((error) => { |
| | | console.error(error); |
| | | notify("ra.notification.http_error", { type: "error" }); |
| | | }); |
| | | if (typeof onClick === "function") { |
| | | onClick(event); |
| | | } |
| | | }, |
| | | [ |
| | | dataProvider, |
| | | filter, |
| | | filterValues, |
| | | maxResults, |
| | | notify, |
| | | onClick, |
| | | resource, |
| | | sort, |
| | | meta, |
| | | ], |
| | | ); |
| | | |
| | | return ( |
| | | <Button |
| | | onClick={handleClick} |
| | | label={label} |
| | | disabled={total === 0} |
| | | {...sanitizeRestProps(rest)} |
| | | > |
| | | {icon} |
| | | </Button> |
| | | ); |
| | | return ( |
| | | <Button |
| | | onClick={handleClick} |
| | | label={label} |
| | | disabled={total === 0} |
| | | {...sanitizeRestProps(rest)} |
| | | > |
| | | {icon} |
| | | </Button> |
| | | ); |
| | | }; |
| | | |
| | | const defaultIcon = <DownloadIcon />; |
| | | |
| | | const sanitizeRestProps = ({ |
| | | resource, |
| | | ...rest |
| | | }) => rest; |
| | | const sanitizeRestProps = ({ resource, ...rest }) => rest; |
| | | |
| | | export default MyExportButton; |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import React, { |
| | | useState, |
| | | useRef, |
| | | useEffect, |
| | | useMemo, |
| | | useCallback, |
| | | } from "react"; |
| | | import { useNavigate } from "react-router-dom"; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import PurchaseCreate from "./PurchaseCreate"; |
| | | import PurchasePanel from "./PurchasePanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import MyExportButton from "../components/MyExportButton"; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import { |
| | | PAGE_DRAWER_WIDTH, |
| | | OPERATE_MODE, |
| | | DEFAULT_PAGE_SIZE, |
| | | } from "@/config/setting"; |
| | | import * as Common from "@/utils/common"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | "& .css-1vooibu-MuiSvgIcon-root": { |
| | | height: ".9em", |
| | | }, |
| | | "& .RaDatagrid-row": { |
| | | cursor: "auto", |
| | | }, |
| | | "& .column-name": {}, |
| | | "& .opt": { |
| | | width: 200, |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <TextInput source="code" label="table.field.purchase.code" />, |
| | | <TextInput source="type" label="table.field.purchase.type" />, |
| | | <TextInput source="source" label="table.field.purchase.source" />, |
| | | <DateInput source="preArr" label="table.field.purchase.preArr" />, |
| | | <NumberInput source="anfme" label="table.field.purchase.anfme" />, |
| | | <NumberInput source="qty" label="table.field.purchase.qty" />, |
| | | <NumberInput source="workQty" label="table.field.purchase.workQty" />, |
| | | <TextInput source="channel" label="table.field.purchase.channel" />, |
| | | <TextInput source="platCode" label="table.field.purchase.platCode" />, |
| | | <DateInput source="startTime" label="table.field.purchase.startTime" />, |
| | | <DateInput source="endTime" label="table.field.purchase.endTime" />, |
| | | <TextInput source="project" label="table.field.purchase.project" />, |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.purchase.code" />, |
| | | <TextInput source="type" label="table.field.purchase.type" />, |
| | | <TextInput source="from" label="table.field.purchase.from" />, |
| | | <DateInput source="preArr" label="table.field.purchase.preArr" />, |
| | | <NumberInput source="anfme" label="table.field.purchase.anfme" />, |
| | | <NumberInput source="qty" label="table.field.purchase.qty" />, |
| | | <NumberInput source="workQty" label="table.field.purchase.workQty" />, |
| | | <TextInput source="channel" label="table.field.purchase.channel" />, |
| | | <TextInput source="erpCode" label="table.field.purchase.erpCode" />, |
| | | <DateInput source="startTime" label="table.field.purchase.startTime" />, |
| | | <DateInput source="endTime" label="table.field.purchase.endTime" />, |
| | | <TextInput source="project" label="table.field.purchase.project" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: "1", name: "common.enums.statusTrue" }, |
| | | { id: "0", name: "common.enums.statusFalse" }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ]; |
| | | |
| | | const PurchaseList = () => { |
| | | const translate = useTranslate(); |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.purchase"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='purchase' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='purchase' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <PurchasePanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.purchase.code" /> |
| | | <TextField source="type" label="table.field.purchase.type" /> |
| | | <TextField source="source" label="table.field.purchase.source" /> |
| | | <DateField source="preArr" label="table.field.purchase.preArr" showTime /> |
| | | <NumberField source="anfme" label="table.field.purchase.anfme" /> |
| | | <NumberField source="qty" label="table.field.purchase.qty" /> |
| | | <NumberField source="workQty" label="table.field.purchase.workQty" /> |
| | | <TextField source="channel" label="table.field.purchase.channel" /> |
| | | <TextField source="platCode" label="table.field.purchase.platCode" /> |
| | | <DateField source="startTime" label="table.field.purchase.startTime" showTime /> |
| | | <DateField source="endTime" label="table.field.purchase.endTime" showTime /> |
| | | <TextField source="project" label="table.field.purchase.project" /> |
| | | const navigate = useNavigate(); |
| | | const assign = (record) => { |
| | | navigate(`/purchaseItem?poId=${record.id}`); |
| | | }; |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PurchaseCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(["all"], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.purchase"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={ |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | <PageDrawer |
| | | title='Purchase Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | <SelectColumnsButton preferenceKey="purchase" /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | } |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey="purchase" |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <PurchasePanel />} |
| | | expandSingle={true} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.purchase.code" /> |
| | | <TextField source="type" label="table.field.purchase.type" /> |
| | | <TextField source="from" label="table.field.purchase.from" /> |
| | | <DateField |
| | | source="preArr" |
| | | label="table.field.purchase.preArr" |
| | | showTime |
| | | /> |
| | | <NumberField source="anfme" label="table.field.purchase.anfme" /> |
| | | <NumberField source="qty" label="table.field.purchase.qty" /> |
| | | <NumberField source="workQty" label="table.field.purchase.workQty" /> |
| | | <TextField source="channel" label="table.field.purchase.channel" /> |
| | | <TextField source="erpCode" label="table.field.purchase.erpCode" /> |
| | | <DateField |
| | | source="startTime" |
| | | label="table.field.purchase.startTime" |
| | | showTime |
| | | /> |
| | | <DateField |
| | | source="endTime" |
| | | label="table.field.purchase.endTime" |
| | | showTime |
| | | /> |
| | | <TextField source="project" label="table.field.purchase.project" /> |
| | | |
| | | <ReferenceField |
| | | source="updateBy" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | | showTime |
| | | /> |
| | | <BooleanField |
| | | source="statusBool" |
| | | label="common.field.status" |
| | | sortable={false} |
| | | /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: "1px", fontSize: ".75rem" }} /> |
| | | <DeleteButton |
| | | sx={{ padding: "1px", fontSize: ".75rem" }} |
| | | mutationMode={OPERATE_MODE} |
| | | /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PurchaseCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <PageDrawer |
| | | title="Purchase Detail" |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | ></PageDrawer> |
| | | </Box> |
| | | ); |
| | | }; |
| | | |
| | | export default PurchaseList; |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import React, { |
| | | useState, |
| | | useRef, |
| | | useEffect, |
| | | useMemo, |
| | | useCallback, |
| | | } from "react"; |
| | | import { useNavigate, useLocation } from "react-router-dom"; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import PurchaseItemCreate from "./PurchaseItemCreate"; |
| | | import PurchaseItemPanel from "./PurchaseItemPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import MyExportButton from "../components/MyExportButton"; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import { |
| | | PAGE_DRAWER_WIDTH, |
| | | OPERATE_MODE, |
| | | DEFAULT_PAGE_SIZE, |
| | | } from "@/config/setting"; |
| | | import * as Common from "@/utils/common"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | "& .css-1vooibu-MuiSvgIcon-root": { |
| | | height: ".9em", |
| | | }, |
| | | "& .RaDatagrid-row": { |
| | | cursor: "auto", |
| | | }, |
| | | "& .column-name": {}, |
| | | "& .opt": { |
| | | width: 200, |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <NumberInput source="purchaseId" label="table.field.purchaseItem.purchaseId" />, |
| | | <TextInput source="platItemId" label="table.field.purchaseItem.platItemId" />, |
| | | <TextInput source="matnrCode" label="table.field.purchaseItem.matnrCode" />, |
| | | <TextInput source="matnrName" label="table.field.purchaseItem.matnrName" />, |
| | | <TextInput source="unit" label="table.field.purchaseItem.unit" />, |
| | | <NumberInput source="anfme" label="table.field.purchaseItem.anfme" />, |
| | | <NumberInput source="qty" label="table.field.purchaseItem.qty" />, |
| | | <NumberInput source="nromQty" label="table.field.purchaseItem.nromQty" />, |
| | | <NumberInput source="asnQty" label="table.field.purchaseItem.asnQty" />, |
| | | <NumberInput source="printQty" label="table.field.purchaseItem.printQty" />, |
| | | <TextInput source="splrName" label="table.field.purchaseItem.splrName" />, |
| | | <TextInput source="splrCode" label="table.field.purchaseItem.splrCode" />, |
| | | <TextInput source="splrBatch" label="table.field.purchaseItem.splrBatch" />, |
| | | <NumberInput |
| | | source="purchaseId" |
| | | label="table.field.purchaseItem.purchaseId" |
| | | />, |
| | | <TextInput source="erpId" label="table.field.purchaseItem.erpId" />, |
| | | <TextInput source="matnrCode" label="table.field.purchaseItem.matnrCode" />, |
| | | <TextInput source="matnrName" label="table.field.purchaseItem.matnrName" />, |
| | | <TextInput source="unit" label="table.field.purchaseItem.unit" />, |
| | | <NumberInput source="anfme" label="table.field.purchaseItem.anfme" />, |
| | | <NumberInput source="qty" label="table.field.purchaseItem.qty" />, |
| | | <NumberInput source="nomQty" label="table.field.purchaseItem.nomQty" />, |
| | | <NumberInput source="asnQty" label="table.field.purchaseItem.asnQty" />, |
| | | <NumberInput source="printQty" label="table.field.purchaseItem.printQty" />, |
| | | <TextInput source="pulrName" label="table.field.purchaseItem.pulrName" />, |
| | | <TextInput source="pulrCode" label="table.field.purchaseItem.pulrCode" />, |
| | | <TextInput source="pulrBatch" label="table.field.purchaseItem.pulrBatch" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: "1", name: "common.enums.statusTrue" }, |
| | | { id: "0", name: "common.enums.statusFalse" }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ]; |
| | | |
| | | const PurchaseItemList = () => { |
| | | const translate = useTranslate(); |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.purchaseItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='purchaseItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='purchaseItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <PurchaseItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="purchaseId" label="table.field.purchaseItem.purchaseId" /> |
| | | <TextField source="platItemId" label="table.field.purchaseItem.platItemId" /> |
| | | <TextField source="matnrCode" label="table.field.purchaseItem.matnrCode" /> |
| | | <TextField source="matnrName" label="table.field.purchaseItem.matnrName" /> |
| | | <TextField source="unit" label="table.field.purchaseItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.purchaseItem.anfme" /> |
| | | <NumberField source="qty" label="table.field.purchaseItem.qty" /> |
| | | <NumberField source="nromQty" label="table.field.purchaseItem.nromQty" /> |
| | | <NumberField source="asnQty" label="table.field.purchaseItem.asnQty" /> |
| | | <NumberField source="printQty" label="table.field.purchaseItem.printQty" /> |
| | | <TextField source="splrName" label="table.field.purchaseItem.splrName" /> |
| | | <TextField source="splrCode" label="table.field.purchaseItem.splrCode" /> |
| | | <TextField source="splrBatch" label="table.field.purchaseItem.splrBatch" /> |
| | | const location = useLocation(); |
| | | const queryParams = new URLSearchParams(location.search); |
| | | const ruleId = queryParams.get("ruleId"); |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PurchaseItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(["all"], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.purchaseItem"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={ |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | <PageDrawer |
| | | title='PurchaseItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | <SelectColumnsButton preferenceKey="purchaseItem" /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | } |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey="purchaseItem" |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <PurchaseItemPanel />} |
| | | expandSingle={true} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField |
| | | source="purchaseId" |
| | | label="table.field.purchaseItem.purchaseId" |
| | | /> |
| | | <TextField source="erpId" label="table.field.purchaseItem.erpId" /> |
| | | <TextField |
| | | source="matnrCode" |
| | | label="table.field.purchaseItem.matnrCode" |
| | | /> |
| | | <TextField |
| | | source="matnrName" |
| | | label="table.field.purchaseItem.matnrName" |
| | | /> |
| | | <TextField source="unit" label="table.field.purchaseItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.purchaseItem.anfme" /> |
| | | <NumberField source="qty" label="table.field.purchaseItem.qty" /> |
| | | <NumberField |
| | | source="nomQty" |
| | | label="table.field.purchaseItem.nomQty" |
| | | /> |
| | | <NumberField |
| | | source="asnQty" |
| | | label="table.field.purchaseItem.asnQty" |
| | | /> |
| | | <NumberField |
| | | source="printQty" |
| | | label="table.field.purchaseItem.printQty" |
| | | /> |
| | | <TextField |
| | | source="pulrName" |
| | | label="table.field.purchaseItem.pulrName" |
| | | /> |
| | | <TextField |
| | | source="pulrCode" |
| | | label="table.field.purchaseItem.pulrCode" |
| | | /> |
| | | <TextField |
| | | source="pulrBatch" |
| | | label="table.field.purchaseItem.pulrBatch" |
| | | /> |
| | | |
| | | <ReferenceField |
| | | source="updateBy" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | | showTime |
| | | /> |
| | | <BooleanField |
| | | source="statusBool" |
| | | label="common.field.status" |
| | | sortable={false} |
| | | /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: "1px", fontSize: ".75rem" }} /> |
| | | <DeleteButton |
| | | sx={{ padding: "1px", fontSize: ".75rem" }} |
| | | mutationMode={OPERATE_MODE} |
| | | /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PurchaseItemCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <PageDrawer |
| | | title="PurchaseItem Detail" |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | ></PageDrawer> |
| | | </Box> |
| | | ); |
| | | }; |
| | | |
| | | export default PurchaseItemList; |
| | |
| | | }); |
| | | }; |
| | | |
| | | console.log(SerialRuleItem); |
| | | |
| | | return ( |
| | | <> |
| | | <Dialog |