| | |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em', |
| | |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | |
| | | {/* <OutOrderItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | OutOrderItemList.Context = React.createContext() |
| | | |
| | | export default OutOrderItemList; |
| | |
| | | |
| | | const CheckDiffList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <CheckButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | } |
| | | |
| | | export default CheckDiffList; |
| | | |
| | | const CheckButton = () => { |
| | | const record = useRecordContext(); |
| | | const handleEditClick = (btn) => { |
| | | btn.stopPropagation() |
| | | |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"ra.action.approved"} startIcon={<ApiOutlinedIcon />} onConfirm={handleEditClick} size={"small"} /> |
| | | ) |
| | | } |
| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | Button, |
| | | useRefresh, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | import BillStatusField from '../../../components/BillStatusField'; |
| | | import ApiOutlinedIcon from '@mui/icons-material/ApiOutlined'; |
| | | import ConfirmButton from '../../../components/ConfirmButton'; |
| | | 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 CheckDiffField from "../../../components/CheckDiffField"; |
| | | import CheckDiffResonDialog from "./CheckDiffResonDialog"; |
| | | import request from '@/utils/request'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | const orderId = useGetRecordId(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [waveRule, setWaveRule] = useState(false); |
| | | |
| | | //获取波次规则 |
| | | const closeDialog = async (value) => { |
| | | setWaveRule(false) |
| | | |
| | | } |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.checkOrder.exceStatus" /> |
| | | <BillStatusField cellClassName="status" source="exceStatus$" label="table.field.checkOrder.exceStatus" /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <CheckButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | {/* <CheckDiffResonDialog open={waveRule} setOpen={setWaveRule} onClose={closeDialog} /> */} |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | |
| | | const CheckButton = () => { |
| | | const record = useRecordContext(); |
| | | const handleEditClick = (btn) => { |
| | | btn.stopPropagation() |
| | | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const handleEditClick = async () => { |
| | | record.exceStatus = 2; |
| | | const { data: { code, data, msg } } = await request.post(`/checkDiffItem/update`, record); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"ra.action.approved"} startIcon={<ApiOutlinedIcon />} onConfirm={handleEditClick} size={"small"} /> |
| | | record?.exceStatus != 2 ? <><ConfirmButton label={"ra.action.approved"} startIcon={<ApiOutlinedIcon />} onConfirm={handleEditClick} size={"small"} /></> : <></> |
| | | ) |
| | | } |
| | | |
New file |
| | |
| | | import { Box, Card, Grid, List, LinearProgress, Select, MenuItem, ListItemText, ListItemAvatar, Avatar, ListItemButton, Dialog, DialogTitle, ListItem, DialogContent, DialogActions, Button } from "@mui/material"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE, DEFAULT_TYPE } from '@/config/setting'; |
| | | import { SimpleForm, TextInput, ReferenceInput, useTranslate, AutocompleteInput } from "react-admin"; |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { Delete, Edit, Add } from '@mui/icons-material'; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | import request from '@/utils/request'; |
| | | |
| | | const CheckDiffResonDialog = (props) => { |
| | | const translate = useTranslate(); |
| | | const { onClose, selectedValue, open, setOpen } = props; |
| | | const [siteNos, setSiteNos] = useState([]); |
| | | const [formData, setFormData] = useState({ |
| | | id: DEFAULT_TYPE |
| | | }); |
| | | |
| | | const handleClose = () => { |
| | | onClose(null); |
| | | } |
| | | |
| | | const handleSelect = () => { |
| | | onClose(formData); |
| | | } |
| | | |
| | | const handleListItemClick = (value) => { |
| | | onClose(value); |
| | | } |
| | | |
| | | const handleChange = (event) => { |
| | | console.log(event); |
| | | setFormData({ id: event }) |
| | | }; |
| | | |
| | | return ( |
| | | <Dialog |
| | | onClose={handleClose} |
| | | open={open} |
| | | aria-labelledby="alert-dialog-title" |
| | | aria-describedby="alert-dialog-description" |
| | | > |
| | | <DialogTitle id="alert-dialog-title">{translate("toolbar.selectWave")}</DialogTitle> |
| | | <DialogContent sx={{ width: 600 }}> |
| | | <SimpleForm toolbar={false} defaultValue={formData}> |
| | | <ReferenceInput source="id" reference="waveRule" > |
| | | <AutocompleteInput |
| | | label={'toolbar.selectWave'} |
| | | defaultValue={DEFAULT_TYPE} |
| | | onChange={handleChange} |
| | | /> |
| | | </ReferenceInput> |
| | | </SimpleForm> |
| | | </DialogContent> |
| | | <DialogActions> |
| | | <Button onClick={handleClose} variant="outlined">{translate('toolbar.cancel')}</Button> |
| | | <Button onClick={handleSelect} autoFocus startIcon={<SaveIcon />} variant="contained"> |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | | </DialogActions> |
| | | </Dialog> |
| | | ); |
| | | } |
| | | |
| | | export default CheckDiffResonDialog; |
| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.CheckDiff; |
| | | import com.vincent.rsf.server.manager.entity.CheckDiffItem; |
| | | import com.vincent.rsf.server.manager.enums.CheckDiffExceStatus; |
| | | import com.vincent.rsf.server.manager.service.CheckDiffItemService; |
| | | import com.vincent.rsf.server.manager.service.CheckDiffService; |
| | | import com.vincent.rsf.server.manager.service.impl.CheckDiffServiceImpl; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | public class CheckDiffItemController extends BaseController { |
| | | |
| | | @Autowired |
| | | private CheckDiffItemService checkDiffItemService; |
| | | @Autowired |
| | | private CheckDiffService checkDiffService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:list')") |
| | | @PostMapping("/checkDiffItem/page") |
| | |
| | | if (!checkDiffItemService.updateById(checkDiffItem)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | |
| | | List<CheckDiffItem> diffItems = checkDiffItemService.list(new LambdaQueryWrapper<CheckDiffItem>().eq(CheckDiffItem::getCheckId, checkDiffItem.getCheckId())); |
| | | if (!diffItems.isEmpty()) { |
| | | Map<Integer, List<CheckDiffItem>> listMap = diffItems.stream().collect(Collectors.groupingBy(CheckDiffItem::getExceStatus)); |
| | | List<CheckDiffItem> checkDiffItems = listMap.get(CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_END.val); |
| | | if (diffItems.size() == checkDiffItems.size()) { |
| | | if (!checkDiffService.update(new LambdaUpdateWrapper<CheckDiff>() |
| | | .eq(CheckDiff::getId, checkDiffItem.getCheckId()) |
| | | .set(CheckDiff::getExceStatus, CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_END.val))) { |
| | | throw new CoolException("盘点单状态更新失败!!"); |
| | | } |
| | | } else { |
| | | if (!checkDiffService.update(new LambdaUpdateWrapper<CheckDiff>() |
| | | .eq(CheckDiff::getId, checkDiffItem.getCheckId()) |
| | | .set(CheckDiff::getExceStatus, CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_HOLD.val))) { |
| | | throw new CoolException("盘点单状态更新失败!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | return R.ok("Update Success").add(checkDiffItem); |
| | | } |
| | | |
| | |
| | | |
| | | //盘点差异单执行状态 |
| | | CHECK_DIFF_EXCE_STATUS_INIT("0", "初始化"), |
| | | CHECK_DIFF_EXCE_STATUS_HOLD("1", "待审核"), |
| | | CHECK_DIFF_EXCE_STATUS_HOLD("1", "处理中"), |
| | | CHECK_DIFF_EXCE_STATUS_END("2", "已审核"), |
| | | |
| | | ; |