Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

生命周期 #73

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/admin/@types/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ declare global {
const CategoriesAPI: typeof import('@raipiot-2f/api')['CategoriesAPI']
const Columns: typeof import('../src/shared/components/RpEditTable/Columns')['default']
const DashboardAPI: typeof import('@raipiot-2f/api')['DashboardAPI']
const DateRangeToStartAndEnd: typeof import('../src/shared/utils/dateRange')['DateRangeToStartAndEnd']
const DateUtils: typeof import('@raipiot-infra/utils')['DateUtils']
const Depts: typeof import('../src/features/system/index')['Depts']
const DeptsAPI: typeof import('@raipiot-2f/api')['DeptsAPI']
Expand All @@ -78,6 +79,7 @@ declare global {
const Invitations: typeof import('../src/features/srm/index')['Invitations']
const InvitationsAPI: typeof import('@raipiot-2f/api')['InvitationsAPI']
const LangUtils: typeof import('@raipiot-infra/utils')['LangUtils']
const LifeCycle: typeof import('../src/features/srm/index')['LifeCycle']
const LineMdChevronSmallDoubleLeft: typeof import('~icons/line-md/chevron-small-double-left.jsx')['default']
const LineMdMenuFoldLeft: typeof import('~icons/line-md/menu-fold-left.jsx')['default']
const LineMdMenuFoldRight: typeof import('~icons/line-md/menu-fold-right.jsx')['default']
Expand All @@ -92,6 +94,7 @@ declare global {
const MaterialSymbolsAccountCircle: typeof import('~icons/material-symbols/account-circle.jsx')['default']
const MaterialSymbolsAccountCircleOutline: typeof import('~icons/material-symbols/account-circle-outline.jsx')['default']
const MaterialSymbolsAccountTreeOutlineRounded: typeof import('~icons/material-symbols/account-tree-outline-rounded.jsx')['default']
const MaterialSymbolsAddShoppingCart: typeof import('~icons/material-symbols/add-shopping-cart.jsx')['default']
const MaterialSymbolsArrowBackRounded: typeof import('~icons/material-symbols/arrow-back-rounded.jsx')['default']
const MaterialSymbolsBadgeAccountHorizontalOutline: typeof import('~icons/material-symbols/badge-account-horizontal-outline.jsx')['default']
const MaterialSymbolsBook2Rounded: typeof import('~icons/material-symbols/book2-rounded.jsx')['default']
Expand All @@ -105,12 +108,14 @@ declare global {
const MaterialSymbolsContactPhoneOutlineSharp: typeof import('~icons/material-symbols/contact-phone-outline-sharp.jsx')['default']
const MaterialSymbolsContactSupportOutlineRounded: typeof import('~icons/material-symbols/contact-support-outline-rounded.jsx')['default']
const MaterialSymbolsContractOutlineRounded: typeof import('~icons/material-symbols/contract-outline-rounded.jsx')['default']
const MaterialSymbolsCycleRounded: typeof import('~icons/material-symbols/cycle-rounded.jsx')['default']
const MaterialSymbolsDashboardRounded: typeof import('~icons/material-symbols/dashboard-rounded.jsx')['default']
const MaterialSymbolsDashboardSharp: typeof import('~icons/material-symbols/dashboard-sharp.jsx')['default']
const MaterialSymbolsDataInfoAlert: typeof import('~icons/material-symbols/data-info-alert.jsx')['default']
const MaterialSymbolsDocsOutline: typeof import('~icons/material-symbols/docs-outline.jsx')['default']
const MaterialSymbolsDomainVerificationOutlineSharp: typeof import('~icons/material-symbols/domain-verification-outline-sharp.jsx')['default']
const MaterialSymbolsDownload: typeof import('~icons/material-symbols/download.jsx')['default']
const MaterialSymbolsDriveFolderUploadOutlineRounded: typeof import('~icons/material-symbols/drive-folder-upload-outline-rounded.jsx')['default']
const MaterialSymbolsEdit: typeof import('~icons/material-symbols/edit.jsx')['default']
const MaterialSymbolsErrorCircleRounded: typeof import('~icons/material-symbols/error-circle-rounded.jsx')['default']
const MaterialSymbolsExitToAppSharp: typeof import('~icons/material-symbols/exit-to-app-sharp.jsx')['default']
Expand All @@ -124,6 +129,7 @@ declare global {
const MaterialSymbolsGroupRounded: typeof import('~icons/material-symbols/group-rounded.jsx')['default']
const MaterialSymbolsGroupsRounded: typeof import('~icons/material-symbols/groups-rounded.jsx')['default']
const MaterialSymbolsHomeWorkOutlineRounded: typeof import('~icons/material-symbols/home-work-outline-rounded.jsx')['default']
const MaterialSymbolsHouseOutlineRounded: typeof import('~icons/material-symbols/house-outline-rounded.jsx')['default']
const MaterialSymbolsKeyVerticalRounded: typeof import('~icons/material-symbols/key-vertical-rounded.jsx')['default']
const MaterialSymbolsKeyboardArrowDownRounded: typeof import('~icons/material-symbols/keyboard-arrow-down-rounded.jsx')['default']
const MaterialSymbolsLineEndArrowRounded: typeof import('~icons/material-symbols/line-end-arrow-rounded.jsx')['default']
Expand All @@ -136,6 +142,7 @@ declare global {
const MaterialSymbolsPaidOutlineRounded: typeof import('~icons/material-symbols/paid-outline-rounded.jsx')['default']
const MaterialSymbolsPersonPinRounded: typeof import('~icons/material-symbols/person-pin-rounded.jsx')['default']
const MaterialSymbolsPhoneIphone: typeof import('~icons/material-symbols/phone-iphone.jsx')['default']
const MaterialSymbolsRebaseEditOutlineSharp: typeof import('~icons/material-symbols/rebase-edit-outline-sharp.jsx')['default']
const MaterialSymbolsRefreshRounded: typeof import('~icons/material-symbols/refresh-rounded.jsx')['default']
const MaterialSymbolsSearchRounded: typeof import('~icons/material-symbols/search-rounded.jsx')['default']
const MaterialSymbolsSettingsApplicationsOutlineRounded: typeof import('~icons/material-symbols/settings-applications-outline-rounded.jsx')['default']
Expand All @@ -144,6 +151,7 @@ declare global {
const MaterialSymbolsShieldPersonRounded: typeof import('~icons/material-symbols/shield-person-rounded.jsx')['default']
const MaterialSymbolsShoppingBagOutlineSharp: typeof import('~icons/material-symbols/shopping-bag-outline-sharp.jsx')['default']
const MaterialSymbolsShoppingCartOutlineRounded: typeof import('~icons/material-symbols/shopping-cart-outline-rounded.jsx')['default']
const MaterialSymbolsSourceNotesRounded: typeof import('~icons/material-symbols/source-notes-rounded.jsx')['default']
const MaterialSymbolsSpeakerNotesOutlineRounded: typeof import('~icons/material-symbols/speaker-notes-outline-rounded.jsx')['default']
const MaterialSymbolsTableRowsNarrowOutlineSharp: typeof import('~icons/material-symbols/table-rows-narrow-outline-sharp.jsx')['default']
const MaterialSymbolsTranslateRounded: typeof import('~icons/material-symbols/translate-rounded.jsx')['default']
Expand All @@ -158,6 +166,7 @@ declare global {
const PermCodeProvider: typeof import('../src/shared/providers/PermCodeProvider/index')['PermCodeProvider']
const Perms: typeof import('../src/features/system/index')['Perms']
const PostsAPI: typeof import('@raipiot-2f/api')['PostsAPI']
const Process: typeof import('../src/features/srm/index')['Process']
const QueryClient: typeof import('@tanstack/react-query')['QueryClient']
const QueryClientProvider: typeof import('@tanstack/react-query')['QueryClientProvider']
const Questionnaires: typeof import('../src/features/srm/index')['Questionnaires']
Expand All @@ -173,6 +182,8 @@ declare global {
const RpBasicTable: typeof import('../src/shared/components/RpBasicTable/index')['default']
const RpBoolean: typeof import('../src/shared/components/RpBoolean/index')['default']
const RpButton: typeof import('../src/shared/components/RpButton/index')['default']
const RpCompanyPick: typeof import('../src/shared/components/RpCompanyPick/index')['default']
const RpDebounceSelect: typeof import('../src/shared/components/RpDebounceSelect/index')['default']
const RpDeletePopconfirm: typeof import('../src/shared/components/RpDeletePopconfirm/index')['default']
const RpDynamicForm: typeof import('../src/shared/components/RpDynamicForm/index')['default']
const RpEditTable: typeof import('../src/shared/components/RpEditTable/index')['default']
Expand All @@ -199,6 +210,9 @@ declare global {
const RpWithSkeleton: typeof import('../src/shared/components/RpWithSkeleton/index')['default']
const RpWithTag: typeof import('../src/shared/components/RpWithTag/index')['default']
const RpWithTooltip: typeof import('../src/shared/components/RpWithTooltip/index')['default']
const SampleSheets: typeof import('../src/features/srm/index')['SampleSheets']
const SampleSheetsAPI: typeof import('@raipiot-2f/api')['SampleSheetsAPI']
const StartAndEndToDateRange: typeof import('../src/shared/utils/dateRange')['StartAndEndToDateRange']
const StorageConfig: typeof import('@raipiot-infra/config')['StorageConfig']
const SupplierBlackList: typeof import('../src/features/srm/index')['SupplierBlackList']
const SupplierEntry: typeof import('../src/features/srm/index')['SupplierEntry']
Expand Down Expand Up @@ -237,6 +251,7 @@ declare global {
const invitationsAPI: typeof import('../src/shared/api/index')['invitationsAPI']
const keepPreviousData: typeof import('@tanstack/react-query')['keepPreviousData']
const lazy: typeof import('react')['lazy']
const lifecycleAPI: typeof import('../src/shared/api/index')['lifecycleAPI']
const memo: typeof import('react')['memo']
const menusAPI: typeof import('../src/shared/api/index')['menusAPI']
const motion: typeof import('framer-motion')['motion']
Expand All @@ -252,6 +267,7 @@ declare global {
const resourcePoolScopesAPI: typeof import('../src/shared/api/index')['resourcePoolScopesAPI']
const rolesAPI: typeof import('../src/shared/api/index')['rolesAPI']
const router: typeof import('@/shared/router')['router']
const sampleSheetsAPI: typeof import('../src/shared/api/index')['sampleSheetsAPI']
const scopesAPI: typeof import('../src/shared/api/index')['scopesAPI']
const startTransition: typeof import('react')['startTransition']
const suppliersAPI: typeof import('../src/shared/api/index')['suppliersAPI']
Expand Down
3 changes: 2 additions & 1 deletion apps/admin/src/features/layouts/BaseLayout/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export default function Tabs() {
onEdit={onEdit}
size="small"
items={tabStore.records.map(({ path }) => {
const { title, icon } = getRouterStaticData(path)
// 需要将 query 参数去掉才能匹配到路由配置
const { title, icon } = getRouterStaticData(path.replace(/\?.*$/, ''))
return {
label: (
<ADropdown
Expand Down
7 changes: 6 additions & 1 deletion apps/admin/src/features/menus/constants/router-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export const routerMenuMap = new Map<ModuleMenuCode, () => MenuItem[]>([
getRouteMeta('/srm/resource-pool-plans')
]
},
getRouteMeta('/srm/questionnaires')
getRouteMeta('/srm/questionnaires'),
{
label: '生命周期管理',
key: '/srm/lifecycle',
children: [getRouteMeta('/srm/lifecycle/supplier'), getRouteMeta('/srm/lifecycle/category')]
}
]
],
[ModuleMenuCode.SOURCE, () => []],
Expand Down
1 change: 1 addition & 0 deletions apps/admin/src/features/srm/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { Invitations } from './invitations'
export { LifeCycle } from './lifecycle'
export { Questionnaires } from './questionnaires'
export { ResourcePoolPlans } from './resource-pool-plans'
export { ResourcePoolScopes } from './resource-pool-scopes'
Expand Down
Empty file.
136 changes: 136 additions & 0 deletions apps/admin/src/features/srm/lifecycle/components/CreateFormTabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
export function CreateFormTabs() {
// 知道是升级还是降级

// 读取附件数量

const [activeKey, setActiveKey] = useState('1')
const { open, close, openCreate } = useModal()

return (
<>
<ATabs
tabBarExtraContent={{
right: (
<AFlex gap={6}>
{activeKey === '2' && (
<AButton
onClick={openCreate}
type="link"
>
上传附件
</AButton>
)}
<Link to="/">
<AButton>查看供应商业务关联单据</AButton>
</Link>
</AFlex>
)
}}
defaultActiveKey="1"
onChange={setActiveKey}
items={[
{
key: '1',
label: '品类情况',
children: (
<ATable
pagination={false}
columns={[
{
title: '品类代码',
dataIndex: 'categoryCode'
},
{
title: '品类名称',
dataIndex: 'categoryName'
},
{
title: '当前状态',
dataIndex: 'categoryStatus'
}
]}
dataSource={[
{
key: '1',
categoryCode: '1',
categoryName: '品类名称',
categoryStatus: '品类状态'
}
]}
/>
)
},
{
key: '2',
label: '附件(2)',
children: (
<ATable
scroll={{
x: 1600
}}
columns={[
{
title: '文件编号',
dataIndex: 'fileCode'
},
{
title: '附件名称',
dataIndex: 'fileName'
},
{
title: '附件大小 (MB)',
dataIndex: 'fileSize'
},
{
title: '上传人',
dataIndex: 'uploader'
},
{
title: '上传时间',
dataIndex: 'uploadTime'
},
{
title: '文件类型',
dataIndex: 'fileType'
},
{
title: '文件生效日期',
dataIndex: 'effectiveDate'
},
{
title: '文件失效日期',
dataIndex: 'expiryDate'
},
{
title: '备注',
dataIndex: 'remark'
}
]}
/>
)
}
]}
/>
<AModal
open={open}
onCancel={close}
title="上传附件"
>
<div className="m-4">
<AUpload.Dragger
rootClassName="h-[650px]"
name="file"
multiple
customRequest={({ file, onSuccess }) => {
console.log(file)
onSuccess?.(undefined)
}}
>
<MaterialSymbolsDriveFolderUploadOutlineRounded className="mx-auto my-12 text-[86px] opacity-10" />
<p className="ant-upload-hint">支持单击或拖动附件(50MB以下)到此区域进行上传</p>
</AUpload.Dragger>
</div>
</AModal>
</>
)
}
1 change: 1 addition & 0 deletions apps/admin/src/features/srm/lifecycle/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './CreateFormTabs'
28 changes: 28 additions & 0 deletions apps/admin/src/features/srm/lifecycle/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { LifecycleStage, LifecycleSupplierApplyListDtoStatus } from '@raipiot-2f/api'

export const lifecycleOptions = [
{ label: '注册', value: LifecycleStage.REGISTER },
{ label: '推荐', value: LifecycleStage.PREMOTE },
{ label: '潜在', value: LifecycleStage.POTENTIAL },
{ label: '合格', value: LifecycleStage.VALID },
{ label: '淘汰', value: LifecycleStage.DISUSE }
]

export const lifecycleApplicationFormOptions = [
{
label: '新建',
value: LifecycleSupplierApplyListDtoStatus.NEW
},
{
label: '待审批',
value: LifecycleSupplierApplyListDtoStatus.PENDING
},
{
label: '审批通过',
value: LifecycleSupplierApplyListDtoStatus.APPROVED
},
{
label: '审批驳回',
value: LifecycleSupplierApplyListDtoStatus.REJECTED
}
]
1 change: 1 addition & 0 deletions apps/admin/src/features/srm/lifecycle/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './useSearchForm'
Loading