|  |  |  | 
|---|
|  |  |  | MenuItem | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } from '@mui/material'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import { DataGrid, useGridApiRef, GRID_DATE_COL_DEF,  GRID_DATETIME_COL_DEF,  getGridDateOperators, useGridApiContext } from '@mui/x-data-grid'; | 
|---|
|  |  |  | import { useForm, Controller, useWatch, FormProvider, useFormContext } from "react-hook-form"; | 
|---|
|  |  |  | import { LocalizationProvider, DatePicker, DateTimePicker } from '@mui/x-date-pickers'; | 
|---|
|  |  |  | import DialogCloseButton from "../../components/DialogCloseButton"; | 
|---|
|  |  |  | import StatusSelectInput from "../../components/StatusSelectInput"; | 
|---|
|  |  |  | import ConfirmButton from "../../components/ConfirmButton"; | 
|---|
|  |  |  | import AsnWareModal from "./AsnWareModal"; | 
|---|
|  |  |  | import { useForm, Controller, useWatch, FormProvider, useFormContext } from "react-hook-form"; | 
|---|
|  |  |  | import SaveIcon from '@mui/icons-material/Save'; | 
|---|
|  |  |  | import request from '@/utils/request'; | 
|---|
|  |  |  | import { Add, Edit, Delete } from '@mui/icons-material'; | 
|---|
|  |  |  | import _, { set } from 'lodash'; | 
|---|
|  |  |  | import { DataGrid, useGridApiRef, GRID_DATE_COL_DEF,  GRID_DATETIME_COL_DEF,  getGridDateOperators, useGridApiContext } from '@mui/x-data-grid'; | 
|---|
|  |  |  | import { LocalizationProvider, DatePicker, DateTimePicker } from '@mui/x-date-pickers'; | 
|---|
|  |  |  | import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; | 
|---|
|  |  |  | import DictionarySelect from "../../components/DictionarySelect"; | 
|---|
|  |  |  | import DictSelect from "../../components/DictSelect"; | 
|---|
|  |  |  | import "./asnOrder.css"; | 
|---|
|  |  |  | import { 'zhCN' as locale } from 'date-fns/locale'; | 
|---|
|  |  |  | import { format, } from 'date-fns'; | 
|---|
|  |  |  | import { DemoContainer } from '@mui/x-date-pickers/internals/demo'; | 
|---|
|  |  |  | import DictionarySelect from "../../components/DictionarySelect"; | 
|---|
|  |  |  | import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; | 
|---|
|  |  |  | import ConfirmButton from "../../components/ConfirmButton"; | 
|---|
|  |  |  | import { Add, Edit, Delete } from '@mui/icons-material'; | 
|---|
|  |  |  | import DictSelect from "../../components/DictSelect"; | 
|---|
|  |  |  | import SaveIcon from '@mui/icons-material/Save'; | 
|---|
|  |  |  | import AsnWareModal from "./AsnWareModal"; | 
|---|
|  |  |  | import request from '@/utils/request'; | 
|---|
|  |  |  | import _, { set } from 'lodash'; | 
|---|
|  |  |  | import "./asnOrder.css"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const AsnOrderModal = (props) => { | 
|---|
|  |  |  | const { open, setOpen, asnId, billReload } = props; | 
|---|
|  |  |  | 
|---|
|  |  |  | ...prevData, | 
|---|
|  |  |  | [name]: value | 
|---|
|  |  |  | })); | 
|---|
|  |  |  | console.log(formData); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const resetData = () => { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const requestGetBody = async () => { | 
|---|
|  |  |  | const res = await request.post(`/asnOrderItem/page`, { asnId }); | 
|---|
|  |  |  | const res = await request.post(`/asnOrderItem/page`, { orderId: asnId }); | 
|---|
|  |  |  | if (res?.data?.code === 200) { | 
|---|
|  |  |  | setTableData(res.data.data.records) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleDeleteItem = () => { | 
|---|
|  |  |  | if (selectedRows.length === 0) { | 
|---|
|  |  |  | notify('请选择要删除的行', {type: 'warning'}); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const newTableData = _.filter(tabelData, (item) => !selectedRows.includes(item.id)); | 
|---|
|  |  |  | setTableData(newTableData); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } = await request.post("companys/page", parmas); | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | setFormData(data.records) | 
|---|
|  |  |  | console.log(data.records) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } = await request.post("companys/page", parmas); | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | setFormData(data.records) | 
|---|
|  |  |  | console.log(data.records) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | ), | 
|---|
|  |  |  | headerClassName: "custom", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     field: 'packName', | 
|---|
|  |  |  | //     headerName: translate('table.field.asnOrderItem.packName'), | 
|---|
|  |  |  | //     minWidth: 100, | 
|---|
|  |  |  | //     flex: 1, | 
|---|
|  |  |  | //     editable: true, | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'platItemId', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.platItemId') + "*", | 
|---|
|  |  |  | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: true, | 
|---|
|  |  |  | headerClassName: "custom", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'splrBatch', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.splrBatch'), | 
|---|
|  |  |  | minWidth: 100, | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: true, | 
|---|
|  |  |  | headerClassName: "custom", | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | 
|---|
|  |  |  | //     flex: 1, | 
|---|
|  |  |  | //     editable: true, | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'purUnit', | 
|---|
|  |  |  | headerName: translate('table.field.asnOrderItem.purUnit'), | 
|---|
|  |  |  | minWidth: 100, | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     field: 'purUnit', | 
|---|
|  |  |  | //     headerName: translate('table.field.asnOrderItem.purUnit'), | 
|---|
|  |  |  | //     minWidth: 100, | 
|---|
|  |  |  | //     flex: 1, | 
|---|
|  |  |  | //     editable: false, | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | ]) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const action = { | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleSelectionChange = (ids) => { | 
|---|
|  |  |  | console.log(ids); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleSelectionChange = (ids) => { | 
|---|
|  |  |  | setSelectedRows(ids) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | pageSizeOptions={[10, 25, 50, 100]} | 
|---|
|  |  |  | pageSizeOptions={[15, 25, 50, 100]} | 
|---|
|  |  |  | editMode="row" | 
|---|
|  |  |  | checkboxSelection | 
|---|
|  |  |  | onRowSelectionModelChange={handleSelectionChange} | 
|---|