diff --git a/src/app/api/qc/index.ts b/src/app/api/qc/index.ts index 7fb9691..95ffefd 100644 --- a/src/app/api/qc/index.ts +++ b/src/app/api/qc/index.ts @@ -20,7 +20,7 @@ export interface QcData { qcItemId: number, code: string, name: string, - qcDescription: string, + description: string, qcPassed: boolean | undefined failQty: number | undefined remarks: string | undefined diff --git a/src/app/global.css b/src/app/global.css index 8410aea..7d2ff9a 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -4,8 +4,4 @@ html, body { overscroll-behavior: none; -} - -.swal2-custom-zindex { - z-index: 10000 !important; } \ No newline at end of file diff --git a/src/components/PoDetail/PutAwayForm.tsx b/src/components/PoDetail/PutAwayForm.tsx index e02e064..9706376 100644 --- a/src/components/PoDetail/PutAwayForm.tsx +++ b/src/components/PoDetail/PutAwayForm.tsx @@ -229,7 +229,9 @@ const PutAwayForm: React.FC = ({ itemDetail, warehouse, disabled, setRowM flex: 0.2, editable: false, renderCell(params) { - return `${params.api.getRowIndexRelativeToVisibleRows(params.id) + 1}.` + return + {`${params.api.getRowIndexRelativeToVisibleRows(params.id) + 1}.`} + }, }, { @@ -238,7 +240,9 @@ const PutAwayForm: React.FC = ({ itemDetail, warehouse, disabled, setRowM flex: 1, editable: false, renderCell(params) { - return `${(arrayToDateTimeString(params.value))}`; + return + {`${(arrayToDateTimeString(params.value))}`} + }, }, { @@ -246,6 +250,11 @@ const PutAwayForm: React.FC = ({ itemDetail, warehouse, disabled, setRowM headerName: t("putawayUser"), flex: 1, editable: false, + renderCell(params) { + return + {params.value} + + } }, { field: "qty", @@ -254,38 +263,55 @@ const PutAwayForm: React.FC = ({ itemDetail, warehouse, disabled, setRowM editable: false, headerAlign: "right", align: "right", + renderCell(params) { + return + {params.value} + + } }, { field: "warehouse", headerName: t("warehouse"), flex: 2, editable: false, - renderEditCell: (params) => { - const index = params.api.getRowIndexRelativeToVisibleRows(params.row.id) - // console.log(index) - // console.log(watch(`putAwayLines.${index}.warehouse`)) - return o.value === itemDetail.defaultWarehouseId)} - // value={options.find((o) => o.value === watch(`putAwayLines.${index}.warehouseId`))} - defaultValue={options.find((o) => o.value === watch(`putAwayLines.${index}.warehouseId`))} - onChange={(event, value) => { - params.api.setEditCellValue({ id: params.id, field: params.field, value: options.find((o) => o.value === value.value)?.label ?? ""}) - params.api.setEditCellValue({ id: params.id, field: "warehouseId", value: value.value}) - // setValue(`putAwayLines.${index}.warehouseId`, value.value) - // setValue(`putAwayLines.${index}.warehouse`, options.find((o) => o.value === value.value)?.label ?? "") - }} - renderInput={(params) => ( - - )} - /> + renderCell(params) { + return + {params.value} + } + // renderEditCell: (params) => { + // const index = params.api.getRowIndexRelativeToVisibleRows(params.row.id) + // // console.log(index) + // // console.log(watch(`putAwayLines.${index}.warehouse`)) + // return o.value === itemDetail.defaultWarehouseId)} + // // value={options.find((o) => o.value === watch(`putAwayLines.${index}.warehouseId`))} + // defaultValue={options.find((o) => o.value === watch(`putAwayLines.${index}.warehouseId`))} + // onChange={(event, value) => { + // params.api.setEditCellValue({ id: params.id, field: params.field, value: options.find((o) => o.value === value.value)?.label ?? ""}) + // params.api.setEditCellValue({ id: params.id, field: "warehouseId", value: value.value}) + // // setValue(`putAwayLines.${index}.warehouseId`, value.value) + // // setValue(`putAwayLines.${index}.warehouse`, options.find((o) => o.value === value.value)?.label ?? "") + // }} + // sx={{ + // // Style the dropdown options + // "& .MuiAutocomplete-option": { + // fontSize: 24, + // }, + // }} + // renderInput={(params) => ( + // + // )} + // /> + // } // renderCell(params) { // return <>{filteredWarehouse[0].name} // }, diff --git a/src/components/PoDetail/QcComponent.tsx b/src/components/PoDetail/QcComponent.tsx index c9e770e..83cf68a 100644 --- a/src/components/PoDetail/QcComponent.tsx +++ b/src/components/PoDetail/QcComponent.tsx @@ -237,10 +237,10 @@ const QcComponent: React.FC = ({ itemDetail, disabled = false }) => { const qcColumns: GridColDef[] = useMemo(() => [ { - field: "code", + field: "name", headerName: t("qcItem"), wrapText: true, - flex: 2, + flex: 2.5, renderCell: (params) => { const index = params.api.getRowIndexRelativeToVisibleRows(params.id) + 1; return ( @@ -248,17 +248,18 @@ const QcComponent: React.FC = ({ itemDetail, disabled = false }) => { sx={{ lineHeight: 1.5, padding: "4px", + fontSize: 18, }} > {`${index}. ${params.value}`}
- {params.row.name} + {params.row.description} )}, }, { field: 'qcResult', headerName: t("qcResult"), - flex: 1.5, + flex: 1, renderCell: (params) => { const rowValue = params.row; const index = Number(params.id);//params.api.getRowIndexRelativeToVisibleRows(params.id); @@ -307,14 +308,13 @@ const QcComponent: React.FC = ({ itemDetail, disabled = false }) => { { field: "failQty", headerName: t("failedQty"), - flex: 1, + flex: 0.5, // editable: true, renderCell: (params) => { const index = Number(params.id);//params.api.getRowIndexRelativeToVisibleRows(params.id); return ( = ({ itemDetail, disabled = false }) => { onMouseDown={(e) => e.stopPropagation()} onKeyDown={(e) => e.stopPropagation()} inputProps={{ min: 0 }} - sx={{ width: '100%' }} + sx={{ width: '100%', + "& .MuiInputBase-input": { + padding: "0.75rem", + fontSize: 24, + }, + }} /> ); }, @@ -369,7 +374,12 @@ const QcComponent: React.FC = ({ itemDetail, disabled = false }) => { onClick={(e) => e.stopPropagation()} onMouseDown={(e) => e.stopPropagation()} onKeyDown={(e) => e.stopPropagation()} - sx={{ width: '100%' }} + sx={{ width: '100%', + "& .MuiInputBase-input": { + padding: "0.75rem", + fontSize: 24, + }, + }} /> ); }, diff --git a/src/components/PoDetail/StockInForm.tsx b/src/components/PoDetail/StockInForm.tsx index 1a770f5..9373d74 100644 --- a/src/components/PoDetail/StockInForm.tsx +++ b/src/components/PoDetail/StockInForm.tsx @@ -54,6 +54,35 @@ type EntryError = // type PoQcRow = TableRow, EntryError>; +const textfieldSx = { + width: "100%", + "& .MuiInputBase-root": { + // height: "120", // Scales with root font size + height: "5rem", // Scales with root font size + }, + "& .MuiInputBase-input": { + height: "100%", + boxSizing: "border-box", + padding: "0.75rem", + fontSize: 24, + }, + "& .MuiInputLabel-root": { + fontSize: 24, + transform: "translate(14px, 1.5rem) scale(1)", + "&.MuiInputLabel-shrink": { + fontSize: 18, + transform: "translate(14px, -9px) scale(1)", + }, + // [theme.breakpoints.down("sm")]: { + // fontSize: "1rem", + // transform: "translate(14px, 1.5rem) scale(1)", + // "&.MuiInputLabel-shrink": { + // fontSize: "0.875rem", + // }, + // }, + }, +}; + const StockInForm: React.FC = ({ // qc, itemDetail, @@ -136,6 +165,7 @@ const StockInForm: React.FC = ({ {...register("dnNo", { // required: "productLotNo required!", })} + sx={textfieldSx} disabled={disabled} // error={Boolean(errors.productLotNo)} // helperText={errors.productLotNo?.message} @@ -148,6 +178,7 @@ const StockInForm: React.FC = ({ {...register("itemName", { // required: "productLotNo required!", })} + sx={textfieldSx} disabled={true} // error={Boolean(errors.productLotNo)} // helperText={errors.productLotNo?.message} @@ -160,6 +191,7 @@ const StockInForm: React.FC = ({ {...register("poCode", { // required: "productLotNo required!", })} + sx={textfieldSx} disabled={true} // error={Boolean(errors.productLotNo)} // helperText={errors.productLotNo?.message} @@ -180,7 +212,7 @@ const StockInForm: React.FC = ({ > = ({ {...register("supplier", { // required: "productLotNo required!", })} + sx={textfieldSx} disabled={true} /> @@ -222,51 +255,52 @@ const StockInForm: React.FC = ({ {...register("productLotNo", { // required: "productLotNo required!", })} + sx={textfieldSx} disabled={disabled} error={Boolean(errors.productLotNo)} helperText={errors.productLotNo?.message} /> - - { - return ( - - { - if (!date) return; - setValue( - "productionDate", - date.format(INPUT_DATE_FORMAT), - ); - // field.onChange(date); - }} - inputRef={field.ref} - slotProps={{ - textField: { - // required: true, - error: Boolean(errors.productionDate?.message), - helperText: errors.productionDate?.message, - }, - }} - /> - - ); - }} - /> - - {putawayMode || ( + {putawayMode || (<> + + { + return ( + + { + if (!date) return; + setValue( + "productionDate", + date.format(INPUT_DATE_FORMAT), + ); + // field.onChange(date); + }} + inputRef={field.ref} + slotProps={{ + textField: { + // required: true, + error: Boolean(errors.productionDate?.message), + helperText: errors.productionDate?.message, + }, + }} + /> + + ); + }} + /> + = ({ {...register("qty", { required: "qty required!", })} + sx={textfieldSx} disabled={true} /> - + )} = ({ > = ({ {...register("receivedQty", { required: "receivedQty required!", })} + sx={textfieldSx} disabled={true} /> @@ -331,33 +367,47 @@ const StockInForm: React.FC = ({ - {putawayMode ? ( + {putawayMode ? (<> sum + p.qty, 0) ?? 0} / ${itemDetail.acceptedQty}` - } + value={itemDetail.acceptedQty} // disabled={true} // disabled={disabled} // error={Boolean(errors.acceptedQty)} // helperText={errors.acceptedQty?.message} /> + + sum + p.qty, 0) ?? 0} + // disabled={true} + // disabled={disabled} + // error={Boolean(errors.acceptedQty)} + // helperText={errors.acceptedQty?.message} + /> + ) : (