Sfoglia il codice sorgente

update

reset-do-picking-order
Tommy\2Fi-Staff 2 settimane fa
parent
commit
e59d79797a
2 ha cambiato i file con 10 aggiunte e 5 eliminazioni
  1. +2
    -0
      src/components/Qc/QcComponent.tsx
  2. +8
    -5
      src/components/Qc/QcForm.tsx

+ 2
- 0
src/components/Qc/QcComponent.tsx Vedi File

@@ -487,6 +487,7 @@ useEffect(() => {
<QcForm <QcForm
rows={qcResult} rows={qcResult}
disabled={disabled} disabled={disabled}
compactLayout={compactLayout}
/> />
</Grid> </Grid>
</> </>
@@ -511,6 +512,7 @@ useEffect(() => {
<QcForm <QcForm
disabled={disabled} disabled={disabled}
rows={qcHistory} rows={qcHistory}
compactLayout={compactLayout}
/> />
</CollapsibleCard> </CollapsibleCard>
</Grid> </Grid>


+ 8
- 5
src/components/Qc/QcForm.tsx Vedi File

@@ -20,9 +20,11 @@ import { QcFormInput, QcResult } from "@/app/api/qc";
interface Props { interface Props {
rows: QcResult[]; rows: QcResult[];
disabled?: boolean; disabled?: boolean;
/** When true, use smaller typography and inputs to match 來貨詳情 (e.g. in QcStockInModal). */
compactLayout?: boolean;
} }


const QcForm: React.FC<Props> = ({ rows, disabled = false }) => {
const QcForm: React.FC<Props> = ({ rows, disabled = false, compactLayout = false }) => {
const { t } = useTranslation("purchaseOrder"); const { t } = useTranslation("purchaseOrder");
const apiRef = useGridApiRef(); const apiRef = useGridApiRef();
const { const {
@@ -71,7 +73,7 @@ const QcForm: React.FC<Props> = ({ rows, disabled = false }) => {
sx={{ sx={{
lineHeight: 1.5, lineHeight: 1.5,
padding: "4px", padding: "4px",
fontSize: 18,
fontSize: compactLayout ? 14 : 18,
}} }}
> >
<b>{`${params.row.order ?? "N/A"}. ${params.value}`}</b><br/> <b>{`${params.row.order ?? "N/A"}. ${params.value}`}</b><br/>
@@ -161,8 +163,9 @@ const QcForm: React.FC<Props> = ({ rows, disabled = false }) => {
onMouseDown={(e) => e.stopPropagation()} onMouseDown={(e) => e.stopPropagation()}
onKeyDown={(e) => e.stopPropagation()} onKeyDown={(e) => e.stopPropagation()}
inputProps={{ min: 0 }} inputProps={{ min: 0 }}
size={compactLayout ? "small" : "medium"}
sx={{ width: '100%', sx={{ width: '100%',
"& .MuiInputBase-input": {
"& .MuiInputBase-input": compactLayout ? undefined : {
padding: "0.75rem", padding: "0.75rem",
fontSize: 24, fontSize: 24,
}, },
@@ -202,7 +205,7 @@ const QcForm: React.FC<Props> = ({ rows, disabled = false }) => {
onMouseDown={(e) => e.stopPropagation()} onMouseDown={(e) => e.stopPropagation()}
onKeyDown={(e) => e.stopPropagation()} onKeyDown={(e) => e.stopPropagation()}
sx={{ width: '100%', sx={{ width: '100%',
"& .MuiInputBase-input": {
"& .MuiInputBase-input": compactLayout ? undefined : {
padding: "0.75rem", padding: "0.75rem",
fontSize: 24, fontSize: 24,
}, },
@@ -211,7 +214,7 @@ const QcForm: React.FC<Props> = ({ rows, disabled = false }) => {
); );
}, },
}, },
], [])
], [compactLayout, t, setValue, qcDisabled])


// const getRowId = (row :any) => { // const getRowId = (row :any) => {
// return qcRecord.findIndex(qc => qc == row); // return qcRecord.findIndex(qc => qc == row);


Caricamento…
Annulla
Salva