Преглед изворни кода

[Fix] "All" btn now greyed out until a search is made

[Fix] "All" btn now downloads from all 3 categories instead of just the one currently selected
undefined
Harry Groves пре 1 недеља
родитељ
комит
428bf91f4a
5 измењених фајлова са 8 додато и 9 уклоњено
  1. +1
    -1
      src/app/api/stockIssue/actions.ts
  2. +2
    -2
      src/app/api/stockIssue/client.ts
  3. +3
    -4
      src/components/StockIssue/ExpiryHandleTab.tsx
  4. +1
    -1
      src/components/StockIssue/StockIssueRecordTab.tsx
  5. +1
    -1
      src/components/StockIssue/StockIssueSearchPanel.tsx

+ 1
- 1
src/app/api/stockIssue/actions.ts Прегледај датотеку

@@ -68,7 +68,7 @@ export interface SearchStockIssueRecordParams {
pageSize?: number;
}

/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */
/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */
export const fetchExpiryItemList = cache(async (filters?: ExpiryItemFilter) => {
const params = new URLSearchParams();
if (filters?.itemCode) params.set("itemCode", filters.itemCode);


+ 2
- 2
src/app/api/stockIssue/client.ts Прегледај датотеку

@@ -12,9 +12,9 @@ export interface ExportExpiryItemExcelParams extends ExpiryItemFilter {
}

/**
* FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07
* FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07
* GET /pickExecution/issues/expiryItem/excel
* Query: itemCode, itemName, lotNo, daysAhead, bucket (expired|today|upcoming)
* Query: itemCode, itemName, lotNo, daysAhead, bucket (expired|today|upcoming; omit for all categories)
* Response: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
* Optional Content-Disposition filename.
*/


+ 3
- 4
src/components/StockIssue/ExpiryHandleTab.tsx Прегледај датотеку

@@ -105,7 +105,7 @@ function canHandleExpiryItem(item: ExpiryItemResult): boolean {
return d != null && !d.isAfter(dayjs(), "day");
}

/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */
/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */
const ExpiryHandleTab: React.FC = () => {
const BATCH_CHUNK_SIZE = 20;
const { t } = useTranslation("stockIssue");
@@ -316,7 +316,7 @@ const ExpiryHandleTab: React.FC = () => {

const handleExportExcel = useCallback(
async (mode: "filtered" | "all") => {
if (mode === "filtered" && !hasSearched) return;
if (!hasSearched) return;
if (exportInFlightRef.current) return;
exportInFlightRef.current = true;
setExporting(mode);
@@ -325,7 +325,6 @@ const ExpiryHandleTab: React.FC = () => {
mode === "all"
? {
daysAhead,
bucket: resultTab,
}
: {
...lastFilters,
@@ -381,7 +380,7 @@ const ExpiryHandleTab: React.FC = () => {
variant="outlined"
startIcon={<FileDownload />}
onClick={() => handleExportExcel("all")}
disabled={exporting != null}
disabled={!hasSearched || exporting != null}
>
{exporting === "all" ? t("Exporting...") : t("Export all in tab")}
</Button>


+ 1
- 1
src/components/StockIssue/StockIssueRecordTab.tsx Прегледај датотеку

@@ -31,7 +31,7 @@ interface Props {
kind: RecordKind;
}

/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */
/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */
const StockIssueRecordTab: React.FC<Props> = ({ kind }) => {
const { t } = useTranslation("stockIssue");
const [items, setItems] = useState<StockIssueHandleRecord[]>([]);


+ 1
- 1
src/components/StockIssue/StockIssueSearchPanel.tsx Прегледај датотеку

@@ -49,7 +49,7 @@ interface Props<K extends string> {
disabled?: boolean;
}

/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */
/** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */
function StockIssueSearchPanel<K extends string>({
fields,
onSearch,


Loading…
Откажи
Сачувај