public/agriculture-login-bg.png
src/api/mes/qc/seedQuality/index.ts
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ import { requestClient } from '#/api/request'; export namespace MesQcSeedQualityApi { export interface Indicator { code: string; value: number; minValue: number; maxValue: number; } export interface SubmitParams { code: string; itemId: number; batchCode?: string; indicators: Indicator[]; reason?: string; } } export function submitSeedQuality(data: MesQcSeedQualityApi.SubmitParams) { return requestClient.post<number>('/mes/qc/seed-quality/submit', data); } src/api/mes/wm/materialstock/index.ts
@@ -28,6 +28,10 @@ reservedQuantity?: number; // å ç¨é inTransitQuantity?: number; // å¨éé availableQuantity?: number; // å¯ç¨é stockState?: number; // åºåç¶æï¼10æååºï¼20åæ ¼åºï¼30å·²åºåº expiryDate?: string; // æææ ageDays?: number; // åºé¾å¤©æ° warningLevel?: 'LOW_STOCK' | 'EXPIRING' | 'AGEING' | null; // é£é©ç±»å receiptTime?: string; // å ¥åºæ¥æ frozen?: boolean; // æ¯å¦å»ç» createTime?: Date; // å建æ¶é´ src/api/mes/wm/productsales/detail/index.ts
@@ -19,6 +19,8 @@ locationName?: string; // åºåºåç§° areaId?: number; // åºä½ç¼å· areaName?: string; // åºä½åç§° bagCodeId?: number; // è¢ç ç¼å· palletCodeId?: number; // æçç ç¼å· remark?: string; // 夿³¨ } } src/api/mes/wm/productsales/index.ts
@@ -23,7 +23,38 @@ shippingNumber?: string; // è¿è¾åå· status?: number; // åæ®ç¶æ remark?: string; // 夿³¨ stockState?: number; // åºåç¶æ createTime?: Date; // å建æ¶é´ } export interface ProductSalesScanRequest { salesId: number; scanContent: string; quantity?: number; } export interface ProductSalesScanResponse { scanType?: 'BAG' | 'PALLET' | string; codeId?: number; scanContent?: string; itemId?: number; itemCode?: string; itemName?: string; batchId?: number; batchCode?: string; materialStockId?: number; availableQuantity?: number; scanQuantity?: number; outboundQuantity?: number; alreadyScanned?: boolean; detailId?: number; warehouseId?: number; locationId?: number; areaId?: number; palletExpanded?: boolean; bagCount?: number; inboundBagCount?: number; message?: string; } } @@ -62,6 +93,16 @@ return requestClient.put(`/mes/wm/product-sales/submit?id=${id}`); } /** æ«ç æ£è´§ */ export function scanProductSales( data: MesWmProductSalesApi.ProductSalesScanRequest, ) { return requestClient.post<MesWmProductSalesApi.ProductSalesScanResponse>( '/mes/wm/product-sales/scan', data, ); } /** æ§è¡æ£è´§ */ export function stockProductSales(id: number) { return requestClient.put(`/mes/wm/product-sales/stock?id=${id}`); src/layouts/auth.vue
@@ -8,7 +8,7 @@ declare const __APP_LOGO__: string; const appName = computed(() => preferences.copyright.companyName); const appName = computed(() => 'ç§æ¤ä¸æ°ååå¹³å°'); const logo = computed(() => __APP_LOGO__ || preferences.logo.source); const logoDark = computed(() => preferences.logo.sourceDark); </script> @@ -18,8 +18,8 @@ :app-name="appName" :logo="logo" :logo-dark="logoDark" :page-description="$t('authentication.pageDesc')" :page-title="$t('authentication.pageTitle')" page-description="æ°åèµè½åä¸ Â· ç§æå¼é¢æªæ¥" page-title="ç§æ¤ä¸æ°ååå¹³å°" > <!-- èªå®ä¹å·¥å ·æ --> <!-- <template #toolbar></template> --> src/packages/@core/ui-kit/shadcn-ui/src/components/input-password/input-password.vue
@@ -42,16 +42,18 @@ <slot name="strengthText"> </slot> </p> </template> <div <button :class="{ 'top-3': !!passwordStrength, 'top-1/2 -translate-y-1/2 items-center': !passwordStrength, }" class="text-foreground/60 hover:text-foreground absolute inset-y-0 right-0 flex cursor-pointer pr-3 text-lg leading-5" type="button" aria-label="忢å¯ç å¯è§æ§" class="text-foreground/60 hover:text-foreground absolute inset-y-0 right-0 flex cursor-pointer rounded-sm border-0 bg-transparent p-0 pr-3 text-lg leading-5 focus-visible:ring-2 focus-visible:ring-emerald-500/50 focus-visible:outline-none" @click="show = !show" > <Eye v-if="show" class="size-4" /> <EyeOff v-else class="size-4" /> </div> </button> </div> </template> src/packages/effects/common-ui/src/ui/authentication/login.vue
@@ -104,7 +104,7 @@ </script> <template> <div @keydown.enter.prevent="handleSubmit"> <div class="authentication-login" @keydown.enter.prevent="handleSubmit"> <slot name="title"> <Title> <slot name="title"> @@ -124,7 +124,7 @@ <div v-if="showRememberMe || showForgetPassword" class="mb-7 flex items-center justify-between" class="mb-6 flex items-center justify-between" > <div class="flex-center"> <VbenCheckbox @@ -138,8 +138,11 @@ <span v-if="showForgetPassword" class="vben-link text-sm font-normal" class="vben-link cursor-pointer rounded-sm text-sm font-normal outline-none focus-visible:ring-2 focus-visible:ring-emerald-500/50" role="link" tabindex="0" @click="handleGo(forgetPasswordPath)" @keydown.enter.prevent="handleGo(forgetPasswordPath)" > {{ $t('authentication.forgetPassword') }} </span> @@ -150,7 +153,7 @@ }" :loading="loading" aria-label="login" class="h-11 w-full rounded-xl text-base font-semibold shadow-sm transition-shadow duration-200 hover:shadow-md focus-visible:ring-2 focus-visible:ring-primary/40" class="h-12 w-full rounded-xl bg-emerald-600 text-base font-semibold tracking-[0.18em] text-white shadow-[0_10px_24px_rgba(5,150,105,0.22)] transition-[background-color,box-shadow] duration-200 hover:bg-emerald-700 hover:shadow-[0_12px_28px_rgba(5,150,105,0.3)] focus-visible:ring-2 focus-visible:ring-emerald-500/50 disabled:cursor-not-allowed disabled:opacity-70" @click="handleSubmit" > {{ submitButtonText || $t('common.login') }} src/packages/effects/layouts/src/authentication/authentication.vue
@@ -7,7 +7,6 @@ import { Copyright } from '../basic/copyright'; import AuthenticationFormView from './form.vue'; import SloganIcon from './icons/slogan.vue'; import Toolbar from './toolbar.vue'; interface Props { @@ -43,19 +42,18 @@ * @zh_CN æ ¹æ®ä¸»é¢éæ©åéç logo 徿 */ const logoSrc = computed(() => { // å¦ææ¯æè²ä¸»é¢ä¸æä¾äº logoDarkï¼åä½¿ç¨æè²ä¸»é¢ç logo if (isDark.value && props.logoDark) { return props.logoDark; } // å¦å使ç¨é»è®¤ç logo return props.logo; }); </script> <template> <div :class="[isDark ? 'dark' : '']" class="flex min-h-full flex-1 overflow-x-hidden select-none" class="agri-auth flex min-h-full flex-1 overflow-x-hidden select-none" > <template v-if="toolbar"> <slot name="toolbar"> @@ -65,7 +63,7 @@ <!-- 左侧认è¯é¢æ¿ --> <AuthenticationFormView v-if="authPanelLeft" class="min-h-full w-2/5 flex-1" class="agri-left-panel min-h-full w-2/5 flex-1" data-side="left" > <template v-if="copyright" #copyright> @@ -79,10 +77,10 @@ </AuthenticationFormView> <slot name="logo"> <!-- å¤´é¨ Logo ååºç¨åç§° --> <!-- å¤´é¨ Logo ååºç¨åç§°ï¼å°å±å±ç¤ºï¼å¤§å±ç±åçåºä»£æ¿ï¼ --> <div v-if="logoSrc || appName" class="absolute top-0 left-0 z-10 flex flex-1" class="agri-mini-logo absolute top-0 left-0 z-10 flex flex-1" @click="clickLogo" > <div @@ -104,34 +102,161 @@ </slot> <!-- ç³»ç»ä»ç» --> <div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block"> <div class="absolute inset-0 size-full bg-background-deep dark:bg-[#070709]" > <div class="login-background absolute top-0 left-0 size-full"></div> <div v-if="!authPanelCenter" class="relative hidden w-0 flex-[1.18] lg:block"> <div class="agri-promo-layer absolute inset-0 size-full overflow-hidden"> <div :key="authPanelLeft ? 'left' : authPanelRight ? 'right' : 'center'" class="mr-20 flex-col-center h-full px-8 text-center" :class="{ 'enter-x': authPanelLeft, '-enter-x': authPanelRight, }" class="agri-promo relative flex h-full flex-col justify-center px-8 text-left" > <template v-if="sloganImage"> <img :alt="appName" :src="sloganImage" class="h-64 w-2/5 animate-float" /> </template> <SloganIcon v-else :alt="appName" class="h-64 w-2/5 animate-float" /> <div class="text-1xl mt-6 font-sans text-foreground lg:text-2xl"> {{ pageTitle }} <!-- åçåº --> <div class="agri-brand"> <div class="flex items-center gap-4"> <svg viewBox="0 0 64 64" class="size-14 shrink-0" aria-hidden="true"> <circle cx="32" cy="32" r="25" fill="none" stroke="#6ee7b7" stroke-width="2.5" stroke-linecap="round" stroke-dasharray="118 40" transform="rotate(-30 32 32)" /> <circle cx="32" cy="32" r="25" fill="none" stroke="#a7f3d0" stroke-width="2.5" stroke-linecap="round" stroke-dasharray="26 132" transform="rotate(115 32 32)" /> <circle cx="53" cy="17" r="3" fill="#6ee7b7" /> <circle cx="9" cy="41" r="2.4" fill="#a7f3d0" /> <path d="M32 45c0-8 0-12 0-16" stroke="#a7f3d0" stroke-width="2.4" stroke-linecap="round" fill="none" /> <path d="M32 34C24 32 19.5 26 19.5 19.5 27.5 21.5 32 26 32 34Z" fill="#34d399" /> <path d="M32 30c6.5-1.5 10.5-6.5 10.5-12C36 20 32 24 32 30Z" fill="#6ee7b7" /> <path d="M20 47q12-6 24 0" stroke="#a7f3d0" stroke-width="2.4" stroke-linecap="round" fill="none" /> </svg> <div> <div class="agri-brand-title text-3xl font-semibold tracking-[0.14em] xl:text-4xl"> {{ pageTitle }} </div> <div class="agri-brand-sub mt-2 text-xs tracking-[0.3em] xl:text-sm"> AGRICULTURE DIGITAL PLATFORM </div> </div> </div> <div class="agri-brand-tag mt-6 flex items-center gap-4"> <span class="agri-brand-tag-line h-px w-12"></span> <span class="text-base tracking-[0.22em]">{{ pageDescription }}</span> <span class="agri-brand-tag-line h-px w-12"></span> </div> </div> <div class="mt-2 dark:text-muted-foreground"> {{ pageDescription }} <div class="mt-12 flex items-start gap-10"> <!-- æ°æ®å¡çå --> <div class="agri-stats flex w-60 shrink-0 flex-col gap-4" aria-label="å¹³å°è¿è¡æ¦è§"> <div class="agri-stat"> <span class="agri-stat-icon"> <svg viewBox="0 0 24 24" class="size-5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M12 20v-8" /> <path d="M12 12C12 8 9 5 4.5 4.5 5 9 8 12 12 12Z" /> <path d="M12 10c0-3.5 2.6-6 7-6.5-.4 4-3 6.5-7 6.5Z" /> <path d="M5 20h14" /> </svg> </span> <div> <span class="agri-stat-label">ç§æ¤é¢ç§¯</span> <div class="agri-stat-num">12,580<i>亩</i></div> <span class="agri-stat-trend agri-stat-up">è¾æ¨æ¥ â 2.35%</span> </div> </div> <div class="agri-stat"> <span class="agri-stat-icon"> <svg viewBox="0 0 24 24" class="size-5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <rect x="6" y="6" width="12" height="12" rx="2" /> <rect x="10" y="10" width="4" height="4" /> <path d="M9 2v4M15 2v4M9 18v4M15 18v4M2 9h4M2 15h4M18 9h4M18 15h4" /> </svg> </span> <div> <span class="agri-stat-label">å¨çº¿è®¾å¤</span> <div class="agri-stat-num">1,286<i>å°</i></div> <span class="agri-stat-trend agri-stat-up">è¾æ¨æ¥ â 5.21%</span> </div> </div> <div class="agri-stat"> <span class="agri-stat-icon"> <svg viewBox="0 0 24 24" class="size-5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M12 3s-6 6.6-6 11a6 6 0 0 0 12 0c0-4.4-6-11-6-11Z" /> <path d="M9.5 14a2.5 2.5 0 0 0 2.5 2.5" /> </svg> </span> <div> <span class="agri-stat-label">仿¥çæº</span> <div class="agri-stat-num">328<i>亩</i></div> <span class="agri-stat-trend agri-stat-up">è¾æ¨æ¥ â 1.15%</span> </div> </div> <div class="agri-stat"> <span class="agri-stat-icon agri-stat-icon-warn"> <svg viewBox="0 0 24 24" class="size-5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M18 9a6 6 0 1 0-12 0c0 5-2 6-2 6h16s-2-1-2-6" /> <path d="M10.3 19a2 2 0 0 0 3.4 0" /> </svg> </span> <div> <span class="agri-stat-label">AI é¢è¦</span> <div class="agri-stat-num">6<i>æ¡</i></div> <span class="agri-stat-trend agri-stat-down">è¾æ¨æ¥ â 12.50%</span> </div> </div> </div> <!-- çæµé¢æ¿å --> <div class="agri-monitors hidden w-72 shrink-0 flex-col gap-6 xl:flex"> <div class="agri-monitor"> <div class="agri-monitor-title">å壤墿 çæµ</div> <div class="mt-3 flex items-baseline gap-2"> <svg viewBox="0 0 24 24" class="size-5 self-center" aria-hidden="true"> <path d="M12 3c0 0-6 6.6-6 11a6 6 0 0 0 12 0c0-4.4-6-11-6-11Z" fill="#7dd3fc" /> </svg> <strong>68.5%</strong> <span>å壤湿度</span> </div> <svg viewBox="0 0 260 92" class="mt-3 w-full" aria-hidden="true"> <defs> <linearGradient id="agriSoilGrad" x1="0" y1="0" x2="0" y2="1"> <stop offset="0%" stop-color="rgba(110, 231, 183, 0.55)" /> <stop offset="100%" stop-color="rgba(110, 231, 183, 0.04)" /> </linearGradient> </defs> <g stroke="rgba(255, 255, 255, 0.14)" stroke-dasharray="3 4" stroke-width="1"> <path d="M28 10h226" /><path d="M28 45h226" /><path d="M28 80h226" /> </g> <g fill="rgba(255, 255, 255, 0.55)" font-size="8"> <text x="2" y="13">100%</text><text x="6" y="48">50%</text><text x="6" y="83">0%</text> </g> <path d="M28 62 C48 58 60 68 76 60 C94 51 108 64 124 56 C142 47 158 54 174 42 C192 30 210 40 228 30 C240 24 248 27 254 22 L254 80 L28 80 Z" fill="url(#agriSoilGrad)" /> <path d="M28 62 C48 58 60 68 76 60 C94 51 108 64 124 56 C142 47 158 54 174 42 C192 30 210 40 228 30 C240 24 248 27 254 22" fill="none" stroke="#6ee7b7" stroke-width="2" stroke-linecap="round" /> </svg> <div class="agri-monitor-axis"> <span>00:00</span><span>06:00</span><span>12:00</span><span>18:00</span><span>24:00</span> </div> </div> <div class="agri-monitor agri-monitor-ai"> <div class="agri-monitor-title flex items-center gap-2"> <svg viewBox="0 0 24 24" class="size-4.5" fill="none" stroke="#a7f3d0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9Z" /> <path d="M19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9Z" /> </svg> AI æºè½åæ </div> <p> å½åä½ç©é¿å¿è¯å¥½ï¼å壤墿 éå®ï¼æªæ¥3å¤©æ ææ¾éé¨ï¼å»ºè®®éæ¶çæºï¼ä¿è¯ä½ç©ç¨³äº§é«äº§ã </p> </div> </div> </div> </div> </div> </div> @@ -154,37 +279,431 @@ </div> <!-- å³ä¾§è®¤è¯é¢æ¿ --> <AuthenticationFormView v-if="authPanelRight" class="min-h-full w-2/5 flex-1" data-side="right" > <template v-if="copyright" #copyright> <slot name="copyright"> <Copyright v-if="preferences.copyright.enable" v-bind="preferences.copyright" /> </slot> </template> </AuthenticationFormView> <div v-if="authPanelRight" class="agri-form-wrap relative"> <AuthenticationFormView class="agri-form-panel min-h-full w-full" data-side="right" /> <!-- å¡çå³ä¸æ å¶è£ 饰 --> <svg class="pointer-events-none absolute top-0 right-0 h-36 w-40" viewBox="0 0 180 150" aria-hidden="true" > <path d="M180 4c-26 22-38 52-36 92" fill="none" stroke="#4ade80" stroke-width="2" stroke-linecap="round" /> <g fill="#4ade80" opacity="0.85"> <path d="M160 22q-16-10-30-2 12 12 30 2Z" /> <path d="M150 44q-18-6-30 4 14 10 30-4Z" /> <path d="M146 70q-18-2-28 10 16 7 28-10Z" /> <path d="M146 96q-16 2-24 14 16 4 24-14Z" /> </g> <g fill="#86efac" opacity="0.7"> <path d="M164 34q4-16 18-22 2 16-18 22Z" /> <path d="M156 60q6-14 20-18 0 16-20 18Z" /> <path d="M152 86q8-12 22-14-2 16-22 14Z" /> </g> <g fill="#bbf7d0" opacity="0.45"> <path d="M96 118q-14-8-26-1 10 10 26 1Z" /> <path d="M70 136q-12-6-22 0 9 8 22 0Z" /> </g> </svg> <!-- å¡çåºé¨ååºæç» --> <svg class="agri-farm pointer-events-none absolute inset-x-0 bottom-0 h-24 w-full" viewBox="0 0 560 130" preserveAspectRatio="xMidYMax slice" aria-hidden="true" > <path d="M0 92 Q120 62 260 88 T560 80 V130 H0 Z" fill="#dcfce7" /> <path d="M0 112 Q160 88 320 110 T560 104 V130 H0 Z" fill="#bbf7d0" /> <g fill="#a7f3d0"> <path d="M36 76 L58 58 L80 76 Z" /> <rect x="42" y="76" width="32" height="22" fill="#ecfdf5" /> <rect x="54" y="84" width="9" height="14" fill="#86efac" /> </g> <g> <rect x="116" y="78" width="4" height="16" fill="#86efac" /> <circle cx="118" cy="70" r="12" fill="#86efac" /> <rect x="146" y="84" width="3.5" height="12" fill="#6ee7b7" /> <circle cx="148" cy="78" r="8" fill="#6ee7b7" /> </g> <g stroke="#6ee7b7" stroke-width="3" stroke-linecap="round"> <path d="M470 100V64" /> <path d="M470 64l-14-10M470 64l16-6M470 64l-2 18" /> </g> <g fill="#a7f3d0"> <path d="M498 82 L514 68 L530 82 Z" /> <rect x="503" y="82" width="22" height="16" fill="#ecfdf5" /> </g> </svg> </div> </div> </template> <style scoped> .login-background { background: radial-gradient(circle at 72% 38%, hsl(var(--primary) / 24%), transparent 42%), linear-gradient(145deg, hsl(var(--background-deep)) 0%, hsl(var(--background)) 100%); filter: blur(70px); .agri-auth { position: relative; min-height: 100dvh; overflow-y: auto; background-color: #124b39; background-image: url('/agriculture-login-bg.png'); background-position: center; background-size: cover; isolation: isolate; } .dark { .login-background { background: radial-gradient(circle at 72% 38%, hsl(var(--primary) / 18%), transparent 42%), linear-gradient(145deg, hsl(var(--background-deep)) 0%, hsl(var(--background)) 100%); filter: blur(70px); .login-background { background-image: none; filter: saturate(1.06) contrast(1.01); } .agri-left-panel, .agri-left-panel :deep(*) { background-color: transparent !important; } /* åçæåï¼ç½è² + æåé´å½±ä¿è¯å¨èæ¯å¾ä¸çå¯è¯»æ§ */ .agri-brand-title { color: #fff; text-shadow: 0 2px 10px rgba(2, 44, 34, 0.6); } .agri-brand-sub { color: rgba(240, 253, 250, 0.92); text-shadow: 0 1px 6px rgba(2, 44, 34, 0.55); } .agri-brand-tag { color: rgba(240, 253, 250, 0.92); text-shadow: 0 1px 6px rgba(2, 44, 34, 0.55); } .agri-brand-tag-line { background: rgba(167, 243, 208, 0.8); } /* 大å±éèå·¦ä¸è§å° logoï¼ç±åçåºå±ç¤º */ @media (min-width: 1024px) { .agri-mini-logo { display: none; } } /* ---------- åçä¸å 容 ---------- */ .agri-promo { max-width: 780px; margin-left: clamp(2rem, 6vw, 7rem); padding-top: 3rem; padding-bottom: 4.5rem; } .agri-brand svg { filter: drop-shadow(0 6px 16px rgba(16, 185, 129, 0.35)); } /* ---------- æ°æ®å¡ç ---------- */ .agri-stat { display: flex; align-items: center; gap: 0.85rem; border: 1px solid rgba(167, 243, 208, 0.42); border-radius: 1.1rem; background: linear-gradient(135deg, rgba(8, 87, 65, 0.66), rgba(4, 57, 49, 0.3)); padding: 0.9rem 1rem; box-shadow: 0 12px 28px rgba(0, 36, 28, 0.16); transition: border-color 200ms ease, background 200ms ease; color: rgba(236, 253, 245, 0.92); backdrop-filter: blur(12px); } .agri-stat-icon { display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; flex-shrink: 0; border-radius: 9999px; background: linear-gradient(135deg, #10b981, #047857); color: #ecfdf5; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); } .agri-stat-icon-warn { background: linear-gradient(135deg, #f59e0b, #b45309); } .agri-stat-label { font-size: 0.75rem; color: rgba(236, 253, 245, 0.75); } .agri-stat-num { margin-top: 0.1rem; font-size: 1.35rem; font-weight: 700; color: #fff; line-height: 1.2; } .agri-stat-num i { margin-left: 0.3rem; font-size: 0.75rem; font-style: normal; font-weight: 400; color: rgba(236, 253, 245, 0.8); } .agri-stat-trend { display: block; margin-top: 0.15rem; font-size: 0.7rem; } .agri-stat-up { color: #6ee7b7; } .agri-stat-down { color: #fca5a5; } /* ---------- çæµé¢æ¿ ---------- */ .agri-monitor { border: 1px solid rgba(125, 211, 252, 0.4); border-radius: 1.1rem; background: linear-gradient(160deg, rgba(8, 51, 68, 0.6), rgba(6, 78, 59, 0.32)); padding: 1rem 1.1rem; color: rgba(236, 253, 245, 0.92); backdrop-filter: blur(12px); box-shadow: 0 0 24px rgba(56, 189, 248, 0.18), 0 14px 30px rgba(0, 36, 28, 0.18); } .agri-monitor-title { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; color: #bae6fd; } .agri-monitor strong { font-size: 1.6rem; font-weight: 700; color: #fff; } .agri-monitor strong + span, .agri-monitor-title + div span { font-size: 0.75rem; color: rgba(236, 253, 245, 0.75); } .agri-monitor-axis { display: flex; justify-content: space-between; margin-top: 0.35rem; padding-left: 1.6rem; font-size: 0.7rem; color: rgba(255, 255, 255, 0.6); } .agri-monitor-ai { margin-left: 2.5rem; border-color: rgba(167, 243, 208, 0.4); box-shadow: 0 0 24px rgba(52, 211, 153, 0.16), 0 14px 30px rgba(0, 36, 28, 0.18); } .agri-monitor-ai p { margin: 0.6rem 0 0; font-size: 0.78rem; line-height: 1.7; color: rgba(236, 253, 245, 0.85); } /* ---------- å³ä¾§ç»å½å¡ç ---------- */ .agri-form-wrap { align-self: center; max-height: calc(100dvh - 5rem); margin: 2.5rem clamp(1rem, 4vw, 4.5rem) 2.5rem 1.5rem; width: 40%; flex: 0.82 1 0%; /* å¤å±ç»ä¸åè§è£åªï¼é¿å åºé¨æç»çå å¼è£ 饰æå¡çç´è§å */ overflow: hidden; border-radius: 1.75rem; box-shadow: 0 24px 70px rgba(2, 44, 34, 0.24); } .agri-form-panel { overflow: auto; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 1.75rem; background: rgba(250, 253, 251, 0.96) !important; backdrop-filter: blur(18px); } /* 表åå 容ä¸ç§»ï¼ä¸ºåºé¨æç»çåºç©ºé´ */ .agri-form-wrap :deep(.side-content) { margin-bottom: 4.5rem; } /* æ é¢ä¸ç绿è²è£ é¥°æ¡ */ .agri-form-wrap :deep(h2 + p)::after { content: ''; display: block; width: 2.75rem; height: 0.28rem; margin-top: 0.8rem; border-radius: 9999px; background: #16a34a; } /* è¾å ¥æ¡åç¼å¾æ */ .agri-form-wrap :deep(input[autocomplete='username']), .agri-form-wrap :deep(input[autocomplete='current-password']) { padding-left: 2.6rem; background-repeat: no-repeat; background-position: 0.85rem center; background-size: 1.05rem; } .agri-form-wrap :deep(input[autocomplete='username']) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); } .agri-form-wrap :deep(input[autocomplete='current-password']) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); } /* è¾å ¥æ¡æ´ä½è´¨æï¼å é«ãåè§ãæåè¾¹æ¡ãèç¦ç»¿è²å å */ .agri-form-wrap :deep(input) { height: 3rem; border-radius: 0.75rem; border-color: rgba(15, 118, 110, 0.16); background-color: #fff; font-size: 0.95rem; transition: border-color 200ms ease, box-shadow 200ms ease; } .agri-form-wrap :deep(input:hover) { border-color: rgba(16, 185, 129, 0.45); } .agri-form-wrap :deep(input:focus), .agri-form-wrap :deep(input:focus-visible) { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16); outline: none; } .dark .agri-form-wrap :deep(input) { border-color: rgba(255, 255, 255, 0.16); background-color: rgba(255, 255, 255, 0.06); } .dark .agri-form-wrap :deep(input:focus), .dark .agri-form-wrap :deep(input:focus-visible) { border-color: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2); } @media (max-width: 1023px) { .agri-farm { display: none; } } /* ---------- æè²æ¨¡å¼ ---------- */ .dark .login-background { background-image: linear-gradient(90deg, rgba(2, 26, 20, 0.9), rgba(2, 26, 20, 0.62)), url('/agriculture-login-bg.png'); } .dark .agri-form-panel { background: rgba(13, 31, 25, 0.96) !important; } .dark .agri-form-wrap > svg { opacity: 0.35; } /* ---------- ååºå¼ ---------- */ @media (max-width: 1023px) { .agri-promo { margin-left: 2rem; } .agri-form-wrap { margin-right: 1.25rem; } } @media (max-height: 720px) and (min-width: 1024px) { .agri-form-wrap { max-height: calc(100dvh - 2rem); margin-top: 1rem; margin-bottom: 1rem; } .agri-promo { padding-top: 1.5rem; padding-bottom: 3rem; } .agri-promo .mt-12 { margin-top: 2rem; } } @media (max-width: 767px) { .agri-form-wrap { align-self: stretch; margin: 1rem; width: auto; flex: none; } .agri-form-panel { border-radius: 1.5rem; } } /* ---------- å ¥åºå¨ç»ï¼çº¯ CSSï¼å¨ç»ç»æå¿ ç¶åçäºå¯è§æï¼ ---------- */ @media (prefers-reduced-motion: no-preference) { .agri-promo { animation: agri-in-left 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) both; } .agri-form-wrap { animation: agri-in-right 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) both; } .agri-stat, .agri-monitor { animation: agri-in-up 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both; } .agri-stat:nth-child(1) { animation-delay: 0.2s; } .agri-stat:nth-child(2) { animation-delay: 0.28s; } .agri-stat:nth-child(3) { animation-delay: 0.36s; } .agri-stat:nth-child(4) { animation-delay: 0.44s; } .agri-monitor:nth-child(1) { animation-delay: 0.3s; } .agri-monitor:nth-child(2) { animation-delay: 0.4s; } } @keyframes agri-in-left { from { opacity: 0; transform: translateX(-28px); } } @keyframes agri-in-right { from { opacity: 0; transform: translateX(28px); } } @keyframes agri-in-up { from { opacity: 0; transform: translateY(18px); } } @media (prefers-reduced-motion: reduce) { .agri-auth :deep(*) { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } } </style> src/packages/effects/layouts/src/authentication/form.vue
@@ -10,7 +10,7 @@ <template> <div class="relative flex-col-center bg-background px-6 py-10 lg:flex-initial lg:px-8 dark:bg-background-deep" class="relative flex-col-center bg-background px-6 py-8 lg:flex-initial lg:px-10 dark:bg-background-deep" > <slot></slot> <!-- Router View with Transition and KeepAlive --> src/views/_core/authentication/login.vue
@@ -48,6 +48,8 @@ { component: 'VbenInput', componentProps: { 'aria-label': $t('authentication.username'), autocomplete: 'username', placeholder: $t('authentication.usernameTip'), }, fieldName: 'username', @@ -60,6 +62,8 @@ { component: 'VbenInputPassword', componentProps: { 'aria-label': $t('authentication.password'), autocomplete: 'current-password', placeholder: $t('authentication.passwordTip'), }, fieldName: 'password', @@ -79,6 +83,8 @@ ref="loginRef" :form-schema="formSchema" :loading="authStore.loginLoading" title="欢è¿åæ¥" sub-title="ç»å½ç§æ¤ä¸æ°ååå¹³å°ï¼å¼å¯æºæ §ç§æ¤" :show-code-login="false" :show-qrcode-login="false" :show-third-party-login="false" src/views/mes/qc/seedQuality/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,208 @@ <script setup lang="ts"> import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue'; import { message, Modal } from 'ant-design-vue'; import { IconifyIcon } from '@vben/icons'; import { gsap } from 'gsap'; import MdItemSelect from '#/views/mes/md/item/components/select.vue'; import { submitSeedQuality, type MesQcSeedQualityApi, } from '#/api/mes/qc/seedQuality'; interface IndicatorForm { code: string; label: string; unit: string; value?: number; minValue?: number; maxValue?: number; } const pageRoot = ref<HTMLElement>(); const code = ref(''); const itemId = ref<number>(); const batchCode = ref(''); const reason = ref(''); const loading = ref(false); const submittedId = ref<number>(); let animationContext: gsap.Context | undefined; const indicators = ref<IndicatorForm[]>([ { code: 'purity', label: '纯度', unit: '%', minValue: 0, maxValue: 100 }, { code: 'cleanliness', label: 'å度', unit: '%', minValue: 0, maxValue: 100 }, { code: 'germination_rate', label: 'åè½ç', unit: '%', minValue: 0, maxValue: 100 }, { code: 'moisture', label: 'æ°´å', unit: '%', minValue: 0, maxValue: 100 }, ]); const enteredCount = computed(() => indicators.value.filter((item) => item.value !== undefined && item.value !== null).length); const passedCount = computed(() => indicators.value.filter(isPassed).length); const allEntered = computed(() => enteredCount.value === indicators.value.length); const overallPassed = computed(() => allEntered.value && passedCount.value === indicators.value.length); function isPassed(item: IndicatorForm) { return item.value !== undefined && item.value !== null && item.minValue !== undefined && item.maxValue !== undefined && item.value >= item.minValue && item.value <= item.maxValue; } function resetForm(clearResult = true) { code.value = ''; itemId.value = undefined; batchCode.value = ''; reason.value = ''; if (clearResult) submittedId.value = undefined; indicators.value.forEach((item) => { item.value = undefined; item.minValue = 0; item.maxValue = 100; }); } async function submit() { if (!code.value.trim() || !itemId.value) { message.warning('请填åè¢ç å¹¶éæ©ç©æ'); return; } if (!allEntered.value) { message.warning('请å å¡«ååé¡¹ææ ç宿µå¼'); return; } if (indicators.value.some((item) => item.minValue === undefined || item.maxValue === undefined || item.minValue > item.maxValue)) { message.warning('ææ ä¸éä¸è½å¤§äºä¸é'); return; } if (!overallPassed.value && !reason.value.trim()) { message.warning('æ£éªä¸åæ ¼æ¶å¿ 须填åä¸åæ ¼åå '); return; } if (!overallPassed.value) { const confirmed = await new Promise<boolean>((resolve) => { Modal.confirm({ title: '确认æäº¤ä¸åæ ¼ç»æï¼', content: 'ä¸åæ ¼åå°ç±åç«¯ä»æååºå䏿¸ é¤ï¼å¹¶ä¿çä¸åæ ¼åå ç¨äºè´¨éåæã', okText: '确认æäº¤', cancelText: 'è¿åä¿®æ¹', okButtonProps: { danger: true }, onOk: () => resolve(true), onCancel: () => resolve(false), }); }); if (!confirmed) return; } loading.value = true; try { submittedId.value = await submitSeedQuality({ code: code.value.trim(), itemId: itemId.value, batchCode: batchCode.value.trim() || undefined, indicators: indicators.value.map(({ code: indicatorCode, value, minValue, maxValue }) => ({ code: indicatorCode, value: value as number, minValue: minValue as number, maxValue: maxValue as number, })), reason: reason.value.trim() || undefined, }); message.success(`è´¨æ£æäº¤æåï¼è´¨æ£ç¼å·ï¼${submittedId.value}`); if (pageRoot.value && !window.matchMedia('(prefers-reduced-motion: reduce)').matches) { gsap.fromTo('.result-card', { scale: 0.97, autoAlpha: 0.5 }, { scale: 1, autoAlpha: 1, duration: 0.35, ease: 'power2.out' }); } resetForm(false); } catch (error) { const response = error as { message?: string; msg?: string }; message.error(response.message ?? response.msg ?? 'è´¨æ£æäº¤å¤±è´¥ï¼è¯·æ£æ¥è¡¨ååéè¯'); } finally { loading.value = false; } } onMounted(async () => { await nextTick(); if (!pageRoot.value) return; animationContext = gsap.context(() => { const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; gsap.from('.page-header, .summary-card, .form-card, .result-card', { autoAlpha: reduceMotion ? 1 : 0, y: reduceMotion ? 0 : 14, duration: reduceMotion ? 0 : 0.4, stagger: reduceMotion ? 0 : 0.06, ease: 'power2.out', }); }, pageRoot.value); }); onUnmounted(() => animationContext?.revert()); </script> <template> <div ref="pageRoot" class="quality-page"> <header class="page-header"> <div> <div class="eyebrow">MES / è´¨é管ç</div> <h1>ç§åè´¨æ£</h1> <p>å½å ¥çº¯åº¦ãå度ãåè½çåæ°´åï¼ç³»ç»æ ¹æ®æ åèå´èªå¨å¤å®æ£éªç»è®º</p> </div> <div class="header-badge"><IconifyIcon icon="ep:checked" /> åé¡¹ææ æ£éª</div> </header> <section class="summary-grid" aria-label="è´¨æ£æè¦"> <div class="summary-card blue"><IconifyIcon icon="ep:document-checked" /><div><span>æ£éªé¡¹ç®</span><strong>4</strong><small>纯度ãå度ãåè½çãæ°´å</small></div></div> <div class="summary-card green"><IconifyIcon icon="ep:success-filled" /><div><span>å½ååæ ¼é¡¹</span><strong>{{ passedCount }} / 4</strong><small>宿¶ä¾æ®ä¸ä¸é夿</small></div></div> <div class="summary-card" :class="overallPassed ? 'green' : allEntered ? 'red' : 'blue'"><IconifyIcon :icon="overallPassed ? 'ep:circle-check-filled' : allEntered ? 'ep:warning-filled' : 'ep:edit-pen'" /><div><span>æ»ä½ç»è®º</span><strong>{{ overallPassed ? 'åæ ¼' : allEntered ? 'ä¸åæ ¼' : 'å¾ å½å ¥' }}</strong><small>{{ overallPassed ? 'å¯æäº¤åæ ¼ç»æ' : allEntered ? '请填åä¸åæ ¼åå ' : `å·²å½å ¥ ${enteredCount} / 4 项` }}</small></div></div> </section> <section class="content-grid"> <a-card class="form-card" :bordered="false"> <template #title><div class="card-title"><IconifyIcon icon="ep:edit-pen" />è´¨æ£ä¿¡æ¯</div></template> <a-form layout="vertical"> <div class="base-grid"> <a-form-item label="è¢ç " required><a-input v-model:value="code" size="large" :disabled="loading" placeholder="请è¾å ¥ææ«æè¢ç " /></a-form-item> <a-form-item label="ç©æ" required> <MdItemSelect v-model="itemId" :disabled="loading" size="large" placeholder="è¯·éæ©ç©æ" /> </a-form-item> <a-form-item label="çäº§æ¹æ¬¡"><a-input v-model:value="batchCode" size="large" :disabled="loading" placeholder="请è¾å ¥æ¹æ¬¡å·ï¼éå¡«ï¼" /></a-form-item> </div> <a-divider orientation="left">ææ ç»æ</a-divider> <div class="indicator-list"> <div v-for="item in indicators" :key="item.code" class="indicator-row" :class="{ failed: !isPassed(item) }"> <div class="indicator-name"><span class="indicator-dot" :class="isPassed(item) ? 'pass' : 'fail'" /><strong>{{ item.label }}</strong><small>{{ item.unit }}</small></div> <a-input-number v-model:value="item.value" class="indicator-input" :disabled="loading" :min="0" :precision="3" placeholder="宿µå¼" /> <span class="range-separator">èå´</span> <a-input-number v-model:value="item.minValue" class="range-input" :disabled="loading" :min="0" :precision="3" placeholder="ä¸é" /> <span>â</span> <a-input-number v-model:value="item.maxValue" class="range-input" :disabled="loading" :min="0" :precision="3" placeholder="ä¸é" /> <a-tag :color="isPassed(item) ? 'success' : 'error'">{{ isPassed(item) ? 'åæ ¼' : 'è¶ åºèå´' }}</a-tag> </div> </div> <a-form-item label="ä¸åæ ¼åå " :required="!overallPassed" class="reason-item"><a-textarea v-model:value="reason" :disabled="loading" :rows="3" :maxlength="500" show-count :placeholder="overallPassed ? 'åæ ¼ç»ææ éå¡«å' : '请说æä¸åæ ¼åå '" /></a-form-item> <div class="form-actions"><a-button :disabled="loading" @click="resetForm">éç½®</a-button><a-button type="primary" size="large" :loading="loading" @click="submit"><IconifyIcon icon="ep:upload-filled" />æäº¤è´¨æ£</a-button></div> </a-form> </a-card> <a-card class="result-card" :bordered="false"> <template #title><div class="card-title"><IconifyIcon icon="ep:data-analysis" />å¤å®è¯´æ</div></template> <div class="result-hero" :class="overallPassed ? 'passed' : allEntered ? 'failed-result' : 'pending-result'"><IconifyIcon :icon="overallPassed ? 'ep:circle-check-filled' : allEntered ? 'ep:warning-filled' : 'ep:edit-pen'" /><strong>{{ overallPassed ? 'å½åç»æåæ ¼' : allEntered ? 'å½ååå¨ä¸åæ ¼é¡¹' : 'çå¾ å½å ¥ææ ' }}</strong><span>{{ allEntered ? '宿µå¼éå¤äºæå°å¼ä¸æå¤§å¼ä¹é´' : `å·²å½å ¥ ${enteredCount} / 4 项宿µå¼` }}</span></div> <div class="rule-list"><div><IconifyIcon icon="ep:check" /><span>åé¡¹ææ å¿ é¡»å ¨é¨æäº¤</span></div><div><IconifyIcon icon="ep:check" /><span>è¾¹çå¼æåæ ¼å¤ç</span></div><div><IconifyIcon icon="ep:check" /><span>ä¸åæ ¼ç»æéä¿çåå </span></div><div><IconifyIcon icon="ep:check" /><span>è´¨æ£å䏿£éªæ¶é´ç±æå¡ç«¯è®°å½</span></div></div> <a-alert message="åºåæµè½¬ç±å端å¤ç" description="åæ ¼åå°ä»æååºè½¬å ¥æ£å¼åºåï¼ä¸åæ ¼åå°ç´æ¥æ¸ 餿ååºåå¹¶ä¿çä¸åæ ¼åå ãè´¨æ£ååæ£éªæ¶é´ç±æå¡ç«¯è®°å½ï¼æ¬é¡µé¢ä¸éæ©ä»åºãåºåºæåºä½ã" type="info" show-icon /> <div v-if="submittedId" class="success-note"><IconifyIcon icon="ep:success-filled" /><span>æè¿æäº¤è´¨æ£ç¼å·ï¼<strong>{{ submittedId }}</strong></span></div> </a-card> </section> </div> </template> <style scoped> .quality-page { min-height: 100%; padding: 24px; background: #f4f7fb; color: #172033; } .page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }.eyebrow { color: #1677ff; font-size: 12px; font-weight: 700; letter-spacing: .08em; }.page-header h1 { margin: 6px 0; font-size: 28px; }.page-header p { margin: 0; color: #718096; }.header-badge { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid #cfe0fb; border-radius: 7px; color: #1677ff; background: #f0f6ff; font-size: 13px; font-weight: 600; } .summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }.summary-card { display: flex; align-items: flex-start; gap: 14px; padding: 17px 19px; border: 1px solid #e8edf5; border-radius: 10px; background: #fff; box-shadow: 0 3px 12px #243b5310; }.summary-card > .iconify { flex: 0 0 38px; width: 38px; height: 38px; padding: 9px; border-radius: 8px; font-size: 20px; }.summary-card.blue > .iconify { color: #1677ff; background: #eaf3ff; }.summary-card.green > .iconify { color: #17a673; background: #e6f8f0; }.summary-card.red > .iconify { color: #e05252; background: #fff0f0; }.summary-card span, .summary-card small { display: block; color: #7b8799; font-size: 12px; }.summary-card strong { display: block; margin: 4px 0; font-size: 23px; }.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .75fr); gap: 18px; }.form-card, .result-card { border-radius: 10px; box-shadow: 0 3px 12px #243b5310; }.card-title { display: flex; align-items: center; gap: 9px; font-weight: 700; }.card-title :deep(.iconify) { color: #1677ff; }.base-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 16px; }.full-width { width: 100%; } .indicator-list { display: flex; flex-direction: column; gap: 10px; }.indicator-row { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid #e8edf5; border-radius: 7px; background: #fbfcfe; }.indicator-row.failed { border-color: #ffd6d6; background: #fffafa; }.indicator-name { display: flex; align-items: center; gap: 8px; min-width: 82px; }.indicator-name small { color: #8793a5; font-size: 12px; }.indicator-dot { width: 8px; height: 8px; border-radius: 50%; }.indicator-dot.pass { background: #20b878; }.indicator-dot.fail { background: #e05252; }.indicator-input { width: 105px; }.range-input { width: 88px; }.range-separator { margin-left: auto; color: #8793a5; font-size: 12px; }.reason-item { margin-top: 18px; }.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 5px; }.form-actions :deep(.iconify) { margin-right: 5px; } .result-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0 22px; padding: 25px 15px; border-radius: 8px; text-align: center; }.result-hero :deep(.iconify) { font-size: 35px; }.result-hero strong { font-size: 18px; }.result-hero span { color: #718096; font-size: 12px; }.result-hero.passed { color: #16835b; background: #effaf5; }.result-hero.failed-result { color: #c53e3e; background: #fff3f3; }.result-hero.pending-result { color: #1677ff; background: #f0f6ff; }.rule-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }.rule-list div { display: flex; align-items: center; gap: 9px; color: #59677b; font-size: 13px; }.rule-list :deep(.iconify) { color: #20b878; }.success-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 11px 12px; border-radius: 7px; color: #16835b; background: #effaf5; font-size: 13px; } @media (max-width: 1050px) { .content-grid { grid-template-columns: 1fr; }.base-grid { grid-template-columns: repeat(3, 1fr); } } @media (max-width: 760px) { .quality-page { padding: 14px; }.page-header { display: block; }.header-badge { margin-top: 14px; }.summary-grid, .base-grid { grid-template-columns: 1fr; }.indicator-row { flex-wrap: wrap; }.range-separator { margin-left: 0; }.indicator-input { flex: 1; min-width: 105px; }.range-input { flex: 1; min-width: 75px; } } </style> src/views/wls/materialstock/data.ts
@@ -62,6 +62,20 @@ }, }, { fieldName: 'stockState', label: 'åºåç¶æ', component: 'Select', componentProps: { allowClear: true, options: [ { label: 'æååºï¼å¾ è´¨æ£ï¼', value: 10 }, { label: 'åæ ¼åºï¼æ£å¼åºåï¼', value: 20 }, { label: 'å·²åºåºï¼é宿£åï¼', value: 30 }, ], placeholder: 'è¯·éæ©åºåç¶æ', }, }, { fieldName: 'frozen', label: 'æ¯å¦å»ç»', component: 'Select', @@ -103,6 +117,21 @@ minWidth: 120, }, { field: 'stockState', title: 'åºåç¶æ', width: 150, cellRender: { name: 'CellTag', props: { options: [ { label: 'æååº', value: 10, color: 'orange' }, { label: 'åæ ¼åº', value: 20, color: 'green' }, { label: 'å·²åºåº', value: 30, color: 'default' }, ], }, }, }, { field: 'quantity', title: 'å¨åºæ°é', width: 100, src/views/wls/productsales/data.ts
@@ -570,6 +570,23 @@ ): VxeTableGridOptions<MesWmProductSalesDetailApi.ProductSalesDetail>['columns'] { return [ { field: 'itemName', title: 'ç©æ', minWidth: 140, }, { field: 'batchCode', title: 'æ¹æ¬¡å·', minWidth: 130, }, { field: 'bagCodeId', title: 'æ«ç æ¥æº', minWidth: 110, formatter: ({ row }) => row.palletCodeId ? `æçç #${row.palletCodeId}` : row.bagCodeId ? `è¢ç #${row.bagCodeId}` : 'æå·¥æ£è´§', }, { field: 'warehouseName', title: 'ä»åºåç§°', minWidth: 100, src/views/wls/productsales/modules/form.vue
@@ -16,6 +16,7 @@ createProductSales, finishProductSales, getProductSales, scanProductSales, shippingProductSales, stockProductSales, submitProductSales, @@ -29,6 +30,10 @@ const emit = defineEmits(['success']); const formType = ref<FormType>('create'); const formData = ref<MesWmProductSalesApi.ProductSales>(); const scanContent = ref(''); const scanQuantity = ref<number>(); const scanLoading = ref(false); const scanRefreshKey = ref(0); const originalSnapshot = ref(''); // 表ååå§æ°æ®å¿«ç §ï¼ç¨äºæäº¤æ¶è·³è¿æªåæ´çä¿åè¯·æ± const isEditable = computed(() => // æ¯å¦ä¸ºç¼è¾æ¨¡å¼ï¼å¯ä¿åï¼ @@ -96,6 +101,31 @@ emit('success'); } finally { modalApi.unlock(); } } /** æ«ç æ£è´§ï¼æ«ç æªé常以åè½¦ç»æè¾å ¥ */ async function handleScan() { if (!formData.value?.id || !scanContent.value.trim() || scanLoading.value) { return; } scanLoading.value = true; try { const result = await scanProductSales({ quantity: scanQuantity.value, salesId: formData.value.id, scanContent: scanContent.value.trim(), }); message[result.alreadyScanned ? 'warning' : 'success']( result.alreadyScanned ? `该ç å·²æ«æï¼æç»ç¼å·ï¼${result.detailId ?? '-'}` : `${result.message || 'æ«ç æå'}${result.scanType ? `ï¼${result.scanType === 'PALLET' ? 'æçç ' : 'è¢ç '}ï¼` : ''}`, ); scanContent.value = ''; scanQuantity.value = undefined; scanRefreshKey.value += 1; } finally { scanLoading.value = false; } } @@ -231,9 +261,30 @@ <template v-if="formData?.id"> <Divider>ç©æä¿¡æ¯</Divider> <div class="mx-4"> <div v-if="isStock" class="mb-3 flex items-center gap-2 px-4"> <a-input v-model:value="scanContent" :disabled="scanLoading" autofocus class="flex-1" placeholder="è¯·æ«æè¢ç ææçç ï¼å车æäº¤" @press-enter="handleScan" /> <a-input-number v-model:value="scanQuantity" :disabled="scanLoading" :min="0" placeholder="æ°éï¼å¯éï¼" style="width: 140px" /> <Button :loading="scanLoading" type="default" @click="handleScan"> æ«ç </Button> </div> <LineList :form-type="formType" :notice-id="formData.noticeId" :refresh-key="scanRefreshKey" :sales-id="formData.id" /> </div> src/views/wls/productsales/modules/line-list.vue
@@ -5,7 +5,7 @@ import type { MesWmProductSalesDetailApi } from '#/api/mes/wm/productsales/detail'; import type { MesWmProductSalesLineApi } from '#/api/mes/wm/productsales/line'; import { computed, reactive } from 'vue'; import { computed, reactive, watch } from 'vue'; import { useVbenModal } from '@vben/common-ui'; @@ -28,6 +28,7 @@ formType: FormType; noticeId?: number; salesId: number; refreshKey?: number; }>(); const isEditable = computed(() => @@ -57,6 +58,15 @@ gridApi.query(); } watch( () => props.refreshKey, (refreshKey, previousRefreshKey) => { if (refreshKey !== undefined && refreshKey !== previousRefreshKey) { handleRefresh(); } }, ); /** æ·»å ç©æ */ function handleCreate() { lineFormModalApi