| | |
| | | import { usePapaParse } from './usePapaParse'; |
| | | import MatnrList from '../basicInfo/matnr/MatnrList'; |
| | | import request from '@/utils/request' |
| | | |
| | | import ImportExportOutlinedIcon from '@mui/icons-material/ImportExportOutlined'; |
| | | const ImportModal = ({ open, onClose, importTemp, useCodeImport, onceBatch = 10, value, parmas = {}}) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | |
| | | <Toolbar |
| | | sx={{ |
| | | width: '100%', |
| | | justifyContent: 'end' |
| | | }} |
| | | > |
| | | {importer.state === 'idle' ? ( |
| | |
| | | <Button |
| | | label="common.action.import.title" |
| | | variant="contained" |
| | | startIcon={<ImportExportOutlinedIcon />} |
| | | size='medium' |
| | | onClick={startImport} |
| | | disabled={!file} |
| | | /> |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.waitPakinItemLog"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ logId: recordId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinItemLog' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={false} |
| | | rowClick={ false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'pakinId', 'pakinItemId', 'asnId' ,'asnItemId', 'createBy$', 'fieldsIndex']} |
| | | > |
| | |
| | | <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> |
| | | <PageDrawer |
| | |
| | | ), |
| | | headerClassName: "custom", |
| | | }, |
| | | // { |
| | | // field: 'packName', |
| | | // headerName: translate('table.field.asnOrderItem.packName'), |
| | | // minWidth: 100, |
| | | // flex: 1, |
| | | // editable: true, |
| | | // }, |
| | | |
| | | { |
| | | field: 'platItemId', |
| | | headerName: translate('table.field.asnOrderItem.platItemId') + "*", |
| | |
| | | editable: true, |
| | | headerClassName: "custom", |
| | | }, |
| | | { |
| | | field: 'splrBatch', |
| | | headerName: translate('table.field.asnOrderItem.splrBatch'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | headerClassName: "custom", |
| | | |
| | | }, |
| | | |
| | | // { |
| | | // field: 'poCode', |
| | |
| | | "purchaseId": record, |
| | | "items": tabelData, |
| | | } |
| | | console.log('--------->'); |
| | | console.log(parmas); |
| | | const res = await request.post(`/asnOrder/purchases/save`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | notify(res.data.msg); |
| | |
| | | </Box> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} > |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > |
| | | <Button disabled={disabled} onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | |
| | | headerClassName: "custom", |
| | | }, |
| | | { |
| | | field: 'qty', |
| | | headerName: translate('table.field.asnOrderItem.qty') + "*", |
| | | type: 'number', |
| | | minWidth: 100, |
| | | flex: 1, |
| | | valueFormatter: (val) => val < 0 ? 0 : val, |
| | | }, |
| | | { |
| | | field: 'unit', |
| | | headerName: translate('table.field.asnOrderItem.stockUnit'), |
| | | minWidth: 100, |
| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Purchase, BaseParam> pageParam = new PageParam<>(baseParam, Purchase.class); |
| | | QueryWrapper<Purchase> wrapper = pageParam.buildWrapper(true); |
| | | wrapper.apply("anfme > qty"); |
| | | wrapper.ne("exce_status", POExceStatus.PO_EXCE_STATUS_ALL_DONE.val); |
| | | return R.ok().add(purchaseService.page(pageParam, wrapper)); |
| | | } |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R createByPo(Map<String, Object> params) { |
| | | Long purchaseId = Long.parseLong(params.get("purchaseId").toString()); |
| | | List<PurchaseItem> itemList = JSONArray.parseArray(JSONObject.toJSONString(params.get("items")), PurchaseItem.class); |
| | |
| | | String trackCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_LABEL_CODE, item); |
| | | if (StringUtils.isBlank(trackCode)) { |
| | | throw new CoolException("单据跟踪码生成失败:请检查「sys_asn_mantr_label」是否配置完成!!"); |
| | | } |
| | | |
| | | PurchaseItem service = purchaseItemService.getById(item.getId()); |
| | | Double qty = service.getQty() + item.getAnfme(); |
| | | if (qty.compareTo(service.getAnfme()) > 0) { |
| | | throw new CoolException("新建单据数量不能大于计划数量!!"); |
| | | } |
| | | orderItem.setAnfme(item.getAnfme()) |
| | | .setAsnId(order.getId()) |
| | |
| | | } |
| | | } |
| | | |
| | | if (!asnOrderItemService.remove(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .in(AsnOrderItem::getAsnId, ids))) { |
| | | throw new CoolException("Details Delete Fail"); |
| | | } |
| | | |
| | | if (!this.remove(new LambdaQueryWrapper<AsnOrder>() |
| | | .in(AsnOrder::getId, ids) |
| | | .eq(AsnOrder::getExceStatus, AsnExceStatus.ASN_EXCE_STATUS_UN_EXCE.val))) { |
| | | throw new CoolException("任务中单据不可删除!!"); |
| | | } |
| | | |
| | | |
| | | if (!asnOrderItemService.remove(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .in(AsnOrderItem::getAsnId, ids))) { |
| | | // throw new CoolException("Details Delete Fail"); |
| | | } |
| | | |
| | | return R.ok("操作成功!!"); |
| | | } |
| | | |