From 21a11657b0c65047cbd145c7f885a9a32ecb9977 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 18 Jul 2025 11:25:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=A1=E6=A0=B8=E9=A1=B5=E9=9D=A2:=20?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=8A=B6=E6=80=81=E6=97=B6,=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=AE=B0=E5=BD=95=E5=92=8C=E6=80=BB=E6=95=B0=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/products/Audit.jsx | 42 ++++++++++++++++++++++++------------ tailwind.config.js | 1 + 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/views/products/Audit.jsx b/src/views/products/Audit.jsx index 3fb2941..223ce22 100644 --- a/src/views/products/Audit.jsx +++ b/src/views/products/Audit.jsx @@ -1,17 +1,18 @@ import { useEffect, useState } from 'react'; import { useParams, Link } from 'react-router-dom'; -import { App, Empty, Button, Collapse, Table, Space } from 'antd'; +import { App, Empty, Button, Collapse, Table, Space, Alert } from 'antd'; import { useProductsTypes, useProductsAuditStatesMapVal } from '@/hooks/useProductsSets'; import SecondHeaderWrapper from '@/components/SecondHeaderWrapper'; import { useTranslation } from 'react-i18next'; import useProductsStore, { postProductsQuoteAuditAction, } from '@/stores/Products/Index'; -import { cloneDeep, isEmpty, isNotEmpty } from '@/utils/commons'; +import { cloneDeep, groupBy, isEmpty, isNotEmpty } from '@/utils/commons'; import useAuthStore from '@/stores/Auth'; import RequireAuth from '@/components/RequireAuth'; import { PERM_PRODUCTS_MANAGEMENT, PERM_PRODUCTS_OFFER_AUDIT, PERM_PRODUCTS_OFFER_PUT } from '@/config'; import Header from './Detail/Header'; import dayjs from 'dayjs'; import { usingStorage } from '@/hooks/usingStorage'; +import { ClockCircleFilled, ClockCircleOutlined, PlusCircleFilled, PlusCircleOutlined } from '@ant-design/icons'; const PriceTable = ({ productType, dataSource, refresh }) => { const { t } = useTranslation('products'); @@ -55,9 +56,11 @@ const PriceTable = ({ productType, dataSource, refresh }) => { const trCls = tri%2 !== 0 ? ' bg-stone-50' : ''; // 奇偶行 const [infoI, quoteI] = r.rowSpanI; const bigTrCls = quoteI === 0 && tri !== 0 ? 'border-collapse border-double border-0 border-t-4 border-stone-300' : ''; // 合并行双下划线 - const editedCls = (r.audit_state_id <= 0 && isNotEmpty(r.lastedit_changed)) ? '!bg-red-100' : ''; // <=待审核, 变更: 红色 + // && isNotEmpty(r.lastedit_changed) + const editedCls = (r.audit_state_id === 0 ) ? '!bg-amber-100' : ''; // 待审核, 黄 + const newCls = (r.audit_state_id === -1 ) ? '!bg-sky-100' : ''; // 新增, 蓝 const editedCls_ = isNotEmpty(r.lastedit_changed) ? (r.audit_state_id === 0 ? '!bg-red-100' : '!bg-sky-100') : ''; - return [trCls, bigTrCls, editedCls].join(' '); + return [trCls, bigTrCls, newCls, editedCls].join(' '); }; const columns = [ @@ -123,14 +126,8 @@ const TypesPanels = (props) => { const hasDataTypes = Object.keys(agencyProducts); const _show = productsTypes .filter((kk) => hasDataTypes.includes(kk.value)) - .map((ele) => ({ - ...ele, - extra: t('Table.Total', { total: agencyProducts[ele.value].length }), - children: ( - { + const _children = agencyProducts[ele.value].reduce( (r, c, ri) => r.concat( c.quotation.map((q, i) => ({ @@ -147,11 +144,28 @@ const TypesPanels = (props) => { })) ), [] - )} + ); + const _childrenByState = groupBy(_children, 'audit_state_id'); + // console.log(_childrenByState); + return { + ...ele, + extra: + {_childrenByState['1']?.length > 0 && } + {_childrenByState['2']?.length > 0 && } />} + {_childrenByState['0']?.length > 0 && } + {_childrenByState['3']?.length > 0 && } + {_childrenByState['-1']?.length > 0 && } />} + {t('Table.Total', { total: _children.length })} + , + children: ( + ), - })); + }}); setShowTypes(_show); setActiveKey(isEmpty(_show) ? [] : [_show[0].key]); diff --git a/tailwind.config.js b/tailwind.config.js index ae60bd0..d997d31 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -8,6 +8,7 @@ export default { 'text-muted', 'bg-red-100', 'bg-sky-100', + 'bg-amber-100', ], darkMode: 'media', theme: {