Kaynağa Gözat

update

MergeProblem1
CANCERYS\kw093 15 saat önce
ebeveyn
işleme
fae1803c21
5 değiştirilmiş dosya ile 30 ekleme ve 15 silme
  1. +1
    -0
      src/app/api/stockTake/actions.ts
  2. +1
    -1
      src/components/FinishedGoodSearch/FGPickOrderTicketReleaseTable.tsx
  3. +26
    -13
      src/components/StockTakeManagement/ApproverAllCardList.tsx
  4. +1
    -1
      src/components/StockTakeManagement/StockTakeTab.tsx
  5. +1
    -0
      src/i18n/zh/common.json

+ 1
- 0
src/app/api/stockTake/actions.ts Dosyayı Görüntüle

@@ -91,6 +91,7 @@ export interface AllPickedStockTakeListReponse {
currentStockTakeItemNumber: number;
totalInventoryLotNumber: number;
stockTakeId: number;
stockTakeRoundId: number | null;
stockTakerName: string | null;
totalItemNumber: number;
startTime: string | null;


+ 1
- 1
src/components/FinishedGoodSearch/FGPickOrderTicketReleaseTable.tsx Dosyayı Görüntüle

@@ -4,7 +4,7 @@
* 權限說明(與全站一致):
* - 登入後 JWT / session 帶有 `abilities: string[]`(見 config/authConfig、authorities.ts)。
* - 導航「Finished Good Order」等使用 `requiredAbility: [AUTH.STOCK_FG, AUTH.ADMIN]`。
* - 本表「撤銷領取 / 強制完成」僅允許具 **ADMIN** 能力者操作(專案內以 ADMIN 作為管理員層級權限)。
* - 本表「撤銷領取 / 強制完成」僅允許具 **ADMIN** 能力者操作(對應 DB `authority.authority = 'ADMIN'`,例如 `user_authority` 對應 id=8 之權限列)。
* - 一般使用者可進入本頁與檢視列表;按鈕會 disabled 並以 Tooltip 提示。
*/



+ 26
- 13
src/components/StockTakeManagement/ApproverAllCardList.tsx Dosyayı Görüntüle

@@ -41,33 +41,45 @@ const ApproverAllCardList: React.FC<ApproverAllCardListProps> = ({
const data = await getApproverStockTakeRecords();
const list = Array.isArray(data) ? data : [];

// 找出最新一轮的 planStartDate
const withPlanStart = list.filter((s) => s.planStartDate);
if (withPlanStart.length === 0) {
// 用 stockTakeRoundId 聚合輪次;舊資料 roundId 可能為 null,fallback 到 stockTakeId
const roundGroups = new Map<number, AllPickedStockTakeListReponse[]>();
list.forEach((s) => {
const roundKey = s.stockTakeRoundId ?? s.stockTakeId;
const existing = roundGroups.get(roundKey) ?? [];
existing.push(s);
roundGroups.set(roundKey, existing);
});

if (roundGroups.size === 0) {
setSessions([]);
setPage(0);
return;
}

const latestPlanStart = withPlanStart
.map((s) => s.planStartDate as string)
.sort((a, b) => dayjs(b).valueOf() - dayjs(a).valueOf())[0];

// 这一轮下所有 section 的卡片
const roundSessions = list.filter((s) => s.planStartDate === latestPlanStart);
const allRounds = Array.from(roundGroups.values());
const latestRoundSessions = allRounds
.sort((a, b) => {
const aLatest = Math.max(
...a.map((s) => dayjs(s.planStartDate ?? s.startTime ?? 0).valueOf())
);
const bLatest = Math.max(
...b.map((s) => dayjs(s.planStartDate ?? s.startTime ?? 0).valueOf())
);
return bLatest - aLatest;
})[0];

// 汇总这一轮的总 item / lot 数
const totalItems = roundSessions.reduce(
const totalItems = latestRoundSessions.reduce(
(sum, s) => sum + (s.totalItemNumber || 0),
0
);
const totalLots = roundSessions.reduce(
const totalLots = latestRoundSessions.reduce(
(sum, s) => sum + (s.totalInventoryLotNumber || 0),
0
);

// 用这一轮里的第一条作为代表,覆盖汇总数字
const representative = roundSessions[0];
const representative = latestRoundSessions[0];
const mergedRound: AllPickedStockTakeListReponse = {
...representative,
totalItemNumber: totalItems,
@@ -120,6 +132,7 @@ const ApproverAllCardList: React.FC<ApproverAllCardListProps> = ({
const planStart = session.planStartDate
? dayjs(session.planStartDate).format(OUTPUT_DATE_FORMAT)
: "-";
const roundLabel = session.stockTakeRoundId ?? session.stockTakeId;

return (
<Grid key={session.stockTakeId} item xs={12} sm={6} md={4}>
@@ -140,7 +153,7 @@ const ApproverAllCardList: React.FC<ApproverAllCardListProps> = ({
>
<CardContent sx={{ pb: 1, flexGrow: 1 }}>
<Typography variant="subtitle1" fontWeight={600} sx={{ mb: 0.5 }}>
{t("Stock Take Round")}: {planStart}
{t("Stock Take Round")}: #{roundLabel}
</Typography>
<Typography variant="body2" color="text.secondary">
{t("Plan Start Date")}: {planStart}


+ 1
- 1
src/components/StockTakeManagement/StockTakeTab.tsx Dosyayı Görüntüle

@@ -88,7 +88,7 @@ const StockTakeTab: React.FC = () => {
onSnackbar={handleSnackbar}
/>
)} */}
{viewScope === "approver-all" && tabValue === 2 && (
{viewScope === "approver-all" && tabValue === 1 && (
<ApproverStockTakeAll
selectedSession={selectedSession}
onBack={handleBackToList}


+ 1
- 0
src/i18n/zh/common.json Dosyayı Görüntüle

@@ -158,6 +158,7 @@
"Setup Time": "生產前預備時間",
"Changeover Time": "生產後轉換時間",
"Warehouse": "倉庫",
"processing": "生產中",
"warehouse": "倉庫",
"Supplier": "供應商",
"Purchase Order": "採購單",


Yükleniyor…
İptal
Kaydet