|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [formData, setFormData] = useState({ | 
|---|
|  |  |  | type: '', | 
|---|
|  |  |  | wkType: '', | 
|---|
|  |  |  | wkType: '7', | 
|---|
|  |  |  | checkType: '0', | 
|---|
|  |  |  | poCode: '', | 
|---|
|  |  |  | logisNo: '', | 
|---|
|  |  |  | arrTime: '' | 
|---|
|  |  |  | 
|---|
|  |  |  | const resetData = () => { | 
|---|
|  |  |  | setFormData({ | 
|---|
|  |  |  | type: '', | 
|---|
|  |  |  | wkType: '', | 
|---|
|  |  |  | wkType: '7', | 
|---|
|  |  |  | checkType: '0', | 
|---|
|  |  |  | poCode: '', | 
|---|
|  |  |  | logisNo: '', | 
|---|
|  |  |  | arrTime: '' | 
|---|
|  |  |  | 
|---|
|  |  |  | "orders": formData, | 
|---|
|  |  |  | "items": tabelData, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | const res = await request.post(`/outStock/items/save`, parmas); | 
|---|
|  |  |  | const res = await request.post(`/check/items/save`, parmas); | 
|---|
|  |  |  | if (res?.data?.code === 200) { | 
|---|
|  |  |  | setOpen(false); | 
|---|
|  |  |  | refresh(); | 
|---|
|  |  |  | 
|---|
|  |  |  | "orders": formData, | 
|---|
|  |  |  | "items": tabelData, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | const res = await request.post(`/outStock/items/update`, parmas); | 
|---|
|  |  |  | const res = await request.post(`/check/items/update`, parmas); | 
|---|
|  |  |  | if (res?.data?.code === 200) { | 
|---|
|  |  |  | setOpen(false); | 
|---|
|  |  |  | refresh(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const requestGetBody = async () => { | 
|---|
|  |  |  | const res = await request.post(`/checkItem/page`, { asnId }); | 
|---|
|  |  |  | const res = await request.post(`/checkItem/page`, { orderId: asnId }); | 
|---|
|  |  |  | if (res?.data?.code === 200) { | 
|---|
|  |  |  | setTableData(res.data.data.records) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | 
|---|
|  |  |  | aria-hidden | 
|---|
|  |  |  | fullWidth | 
|---|
|  |  |  | disableRestoreFocus | 
|---|
|  |  |  | maxWidth="lg"   // 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 
|---|
|  |  |  | maxWidth="xl"   // 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <DialogTitle id="form-dialog-title" sx={{ | 
|---|
|  |  |  | position: 'sticky', | 
|---|
|  |  |  | 
|---|
|  |  |  | <Grid container spacing={2}> | 
|---|
|  |  |  | <Grid item md={2}> | 
|---|
|  |  |  | <DictSelect | 
|---|
|  |  |  | label={translate("table.field.checkOrder.checkType")} | 
|---|
|  |  |  | label={translate("table.field.checkOrder.type")} | 
|---|
|  |  |  | value={formData.wkType} | 
|---|
|  |  |  | variant="filled" | 
|---|
|  |  |  | onChange={(e) => handleChange(e.target.value, 'wkType')} | 
|---|
|  |  |  | dictTypeCode="sys_check_order_type" | 
|---|
|  |  |  | required | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item md={2}> | 
|---|
|  |  |  | <DictSelect | 
|---|
|  |  |  | label={translate("table.field.checkOrder.checkType")} | 
|---|
|  |  |  | value={formData.checkType} | 
|---|
|  |  |  | variant="filled" | 
|---|
|  |  |  | onChange={(e) => handleChange(e.target.value, 'checkType')} | 
|---|
|  |  |  | dictTypeCode="sys_check_type" | 
|---|
|  |  |  | required | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | 
|---|
|  |  |  | </Box> | 
|---|
|  |  |  | <Box sx={{ mt: 2 }}> | 
|---|
|  |  |  | <Stack direction="row" spacing={2}> | 
|---|
|  |  |  | <Button variant="contained" onClick={() => setCreateDialog(true)}>新增物料</Button> | 
|---|
|  |  |  | <ConfirmButton label={'删除'} variant="outlined" color="error" onConfirm={handleDeleteItem} /> | 
|---|
|  |  |  | <Button variant="contained" onClick={() => setCreateDialog(true)} > | 
|---|
|  |  |  | {translate('common.action.newAddMats')} | 
|---|
|  |  |  | </Button> | 
|---|
|  |  |  | <ConfirmButton label={"toolbar.delete"} variant="outlined" color="error" onConfirm={handleDeleteItem} /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | </Box> | 
|---|
|  |  |  | <Box sx={{ mt: 2 }}> | 
|---|
|  |  |  | 
|---|
|  |  |  | const AsnOrderModalTable = ({ tabelData, setTableData, asnId, selectedRows, setSelectedRows, tableRef }) => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | const [check, setCheck] = useState([]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [columns, setColumns] = useState([ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'anfme', | 
|---|
|  |  |  | headerName: translate('table.field.outStockItem.anfme') + "*", | 
|---|
|  |  |  | headerName: translate('table.field.checkOrder.anfme') + "*", | 
|---|
|  |  |  | type: 'number', | 
|---|
|  |  |  | minWidth: 100, | 
|---|
|  |  |  | minWidth: 120, | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: true, | 
|---|
|  |  |  | valueFormatter: (val) => val < 0 ? 0 : val, | 
|---|
|  |  |  | 
|---|
|  |  |  | let cdata = useRef([]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | useEffect(() => { | 
|---|
|  |  |  | getDynamicFields(); | 
|---|
|  |  |  | if (check == null || check.length < 1) { | 
|---|
|  |  |  | getDynamicFields(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, []); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | useEffect(() => { | 
|---|
|  |  |  | 
|---|
|  |  |  | flex: 1, | 
|---|
|  |  |  | editable: false | 
|---|
|  |  |  | })) | 
|---|
|  |  |  | setCheck(cols); | 
|---|
|  |  |  | setColumns([...columns, ...cols, action]) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg); | 
|---|