diff --git a/.env.development b/.env.development index 36ba276..7ead1c9 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,5 @@ API_URL=http://localhost:8090/api NEXTAUTH_SECRET=secret NEXT_PUBLIC_API_URL=http://localhost:8090/api -NEXT_PUBLIC_MONITORING_ENABLED=false \ No newline at end of file +NEXT_PUBLIC_MONITORING_ENABLED=false +NEXT_PUBLIC_QC_MEASUREMENT_ENABLED=false \ No newline at end of file diff --git a/.env.production b/.env.production index ea6edd1..021a5c5 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,5 @@ API_URL=http://10.10.0.81:8090/api NEXTAUTH_SECRET=secret NEXTAUTH_URL=http://10.10.0.81:3000 -NEXT_PUBLIC_API_URL=http://10.10.0.81:8090/api \ No newline at end of file +NEXT_PUBLIC_API_URL=http://10.10.0.81:8090/api +NEXT_PUBLIC_QC_MEASUREMENT_ENABLED=false \ No newline at end of file diff --git a/src/app/(main)/report/ItemQcReportFilters.tsx b/src/app/(main)/report/ItemQcReportFilters.tsx new file mode 100644 index 0000000..c383835 --- /dev/null +++ b/src/app/(main)/report/ItemQcReportFilters.tsx @@ -0,0 +1,93 @@ +"use client"; + +import React from "react"; +import { + FormHelperText, + Grid, + MenuItem, + TextField, +} from "@mui/material"; + +export type QcItemFilter = "measurable" | "non_measurable"; + +export const REP010_DEFAULT_CRITERIA: Record = { + qcItemFilter: "measurable", +}; + +interface ItemQcReportFiltersProps { + criteria: Record; + onFieldChange: (name: string, value: string) => void; +} + +const gridSize = { xs: 12, sm: 6 }; + +export default function ItemQcReportFilters({ + criteria, + onFieldChange, +}: ItemQcReportFiltersProps) { + const qcItemFilter = (criteria.qcItemFilter || "measurable") as QcItemFilter; + + return ( + + + onFieldChange("lastInDateStart", e.target.value)} + InputLabelProps={{ shrink: true }} + /> + + + onFieldChange("lastInDateEnd", e.target.value)} + InputLabelProps={{ shrink: true }} + /> + + + onFieldChange("qcType", e.target.value)} + > + 全部 + IQC + EPQC + + + + onFieldChange("itemCode", e.target.value)} + placeholder="e.g. MJ0364" + /> + + + onFieldChange("qcItemFilter", e.target.value)} + > + 只包含溫度濕度 + 不包含溫度濕度 + + + {qcItemFilter === "measurable" + ? "僅匯出已填寫實測值的溫度/濕度 QC 項目。" + : "僅匯出非溫度/濕度之其他 QC 檢驗項目。"} + + + + ); +} diff --git a/src/app/(main)/report/page.tsx b/src/app/(main)/report/page.tsx index 504ae28..83bb62b 100644 --- a/src/app/(main)/report/page.tsx +++ b/src/app/(main)/report/page.tsx @@ -393,7 +393,7 @@ export default function ReportPage() { 搜索條件: {currentReport.title} - + {currentReport.fields.map((field) => { const options = field.dynamicOptions @@ -650,30 +650,7 @@ export default function ReportPage() { {loading ? "生成 Excel..." : "下載報告 (Excel)"} - ) : currentReport.id === 'rep-006' ? ( - <> - - - - ) : currentReport.id === 'rep-010' ? ( + ) : currentReport.id === 'rep-006' || currentReport.id === 'rep-010' ? ( <>