Ver código fonte

update

MergeProblem1
CANCERYS\kw093 17 horas atrás
pai
commit
6639610f02
3 arquivos alterados com 59 adições e 17 exclusões
  1. +3
    -0
      src/components/Breadcrumb/Breadcrumb.tsx
  2. +8
    -0
      src/components/NavigationContent/NavigationContent.tsx
  3. +48
    -17
      src/components/StockTakeManagement/ApproverStockTakeAll.tsx

+ 3
- 0
src/components/Breadcrumb/Breadcrumb.tsx Ver arquivo

@@ -37,6 +37,9 @@ const pathToLabelMap: { [path: string]: string } = {
"/inventory": "Inventory",
"/settings/importTesting": "Import Testing",
"/do": "Delivery Order",
//"/doworkbench": "DO Workbench",
// "/doworkbench/pick": "DO Workbench pick",
// "/doworkbench/edit": "DO Workbench detail",
"/pickOrder": "Pick Order",
"/po": "Purchase Order",
"/po/workbench": "PO Workbench",


+ 8
- 0
src/components/NavigationContent/NavigationContent.tsx Ver arquivo

@@ -129,6 +129,14 @@ const NavigationContent: React.FC = () => {
requiredAbility: [AUTH.STOCK, AUTH.STOCK_TAKE, AUTH.STOCK_IN_BIND, AUTH.STOCK_FG, AUTH.ADMIN],
path: "/stockRecord",
},
/*
{
icon: <Description />,
label: "Do Workbench",
requiredAbility: [AUTH.STOCK, AUTH.STOCK_TAKE, AUTH.STOCK_IN_BIND, AUTH.STOCK_FG, AUTH.ADMIN],
path: "/doworkbench",
},
*/
],
},
{


+ 48
- 17
src/components/StockTakeManagement/ApproverStockTakeAll.tsx Ver arquivo

@@ -65,13 +65,14 @@ type ApprovedSortKey =
| "stockTakerName"
| "variance";

type ApproverSearchKey = "sectionDescription" | "stockTakeSession" | "itemKeyword" | "warehouseKeyword";
type ApproverSearchKey = "sectionDescription" | "stockTakeSession" | "itemKeyword" | "warehouseKeyword"|"status";

type ApproverSearchFilters = {
sectionDescription: string;
stockTakeSession: string;
itemKeyword: string;
warehouseKeyword: string;
status: string;
};

function buildApproverInventoryQuery(filters: ApproverSearchFilters): ApproverInventoryLotDetailsQuery {
@@ -232,6 +233,7 @@ const ApproverStockTakeAll: React.FC<ApproverStockTakeAllProps> = ({
stockTakeSession: inputs.stockTakeSession || "",
itemKeyword: inputs.itemKeyword || "",
warehouseKeyword: inputs.warehouseKeyword || "",
status: inputs.status || "All",
};
/*
if (!hasAnyApproverSearchCriterion(next)) {
@@ -280,6 +282,17 @@ const ApproverStockTakeAll: React.FC<ApproverStockTakeAllProps> = ({
paramName: "warehouseKeyword",
placeholder: "",
},
{
type: "select-labelled",
label: t("Record Status"),
paramName: "status",
options: [
{ label: t("All"), value: "All" },
{ label: t("Pending"), value: "pending" },
{ label: t("Not Match"), value: "notMatch" },
{ label: t("Pass"), value: "pass" }, // UI=Pass,值=completed
],
}
],
[t, sectionDescriptionAutocompleteOptions]
);
@@ -468,12 +481,22 @@ const ApproverStockTakeAll: React.FC<ApproverStockTakeAllProps> = ({
},
[approverQty, approverBadQty]
);

const normalizeStatus = (v: unknown) =>
String(v ?? "")
.trim()
.toLowerCase()
.replaceAll("_", "");
const filteredDetails = useMemo(() => {
const percent = parseFloat(variancePercentTolerance || "0");
const thresholdPercent = isNaN(percent) || percent < 0 ? 0 : percent;
return inventoryLotDetails.filter((detail) => {
const statusFilter = appliedFilters?.status ?? "All";
return inventoryLotDetails.filter((detail) => {
if (statusFilter !== "All") {
const rowStatus = normalizeStatus(detail.stockTakeRecordStatus);
const wanted = normalizeStatus(statusFilter);
if (rowStatus !== wanted) return false;
}
/*
if (detail.finalQty != null || detail.stockTakeRecordStatus === "completed") {
return true;
@@ -1110,20 +1133,26 @@ const ApproverStockTakeAll: React.FC<ApproverStockTakeAllProps> = ({
minWidth: 130,
flex: 0.6,
sortable: false,
renderCell: (params) => (
<Chip
size="small"
label={ t(`${params.row.stockTakeRecordStatus}`) || "-"}
color={
params.row.stockTakeRecordStatus === "completed"
? "success"
: params.row.stockTakeRecordStatus === "notMatch"
? "warning"
: "default"
}
variant="outlined"
/>
),
renderCell: (params) => {
const raw = params.row.stockTakeRecordStatus;
const status = String(raw ?? "").trim().toLowerCase();
const colorMap: Record<string, "success" | "warning" | "info" | "default" | "error"> = {
completed: "success",
notmatch: "warning",
pending: "info",
"not_match": "warning",
};
return (
<Chip
size="small"
label={t(`${status}`) || "-"}
color={colorMap[status] ?? "default"}
variant="outlined"
/>
);
}
},
{
field: "stockTakerName",
@@ -1306,6 +1335,8 @@ const ApproverStockTakeAll: React.FC<ApproverStockTakeAllProps> = ({
pageSizeOptions={[50, 100, 200, 500]}
getRowHeight={() => "auto"}
sx={{
backgroundColor: "transparent",
"& .MuiDataGrid-columnHeaders": { backgroundColor: "#fff" },
"& .MuiDataGrid-cell": { py: 1, alignItems: "flex-start" },
"& .MuiDataGrid-row": { minHeight: 80 },
}}


Carregando…
Cancelar
Salvar