feat: restructure basic info menu, add kitting monitor table, and implement user preferences api
This commit is contained in:
@ -44,8 +44,41 @@ export function deleteBom(bomNo: string, version: string) {
|
||||
}
|
||||
|
||||
// MRP 齐套模拟计算
|
||||
export function calculateKitting(entries: { bom_no: string; target_qty: number }[]) {
|
||||
return request({
|
||||
export interface BomKittingEntry {
|
||||
bom_no: string
|
||||
target_qty: number
|
||||
}
|
||||
|
||||
export interface BomSummary {
|
||||
bom_no: string
|
||||
parent_name: string
|
||||
version: string
|
||||
max_producible: number
|
||||
}
|
||||
|
||||
export interface KittingMaterial {
|
||||
base_id: number
|
||||
material_name: string
|
||||
spec: string
|
||||
unit: string
|
||||
required_qty: number
|
||||
available_qty: number
|
||||
shortage: number
|
||||
bom_sources: Array<{
|
||||
bom_no: string
|
||||
dosage: number
|
||||
loss_rate: number
|
||||
target_qty: number
|
||||
}>
|
||||
}
|
||||
|
||||
export interface KittingResult {
|
||||
bom_summary: BomSummary[]
|
||||
materials: KittingMaterial[]
|
||||
}
|
||||
|
||||
export function calculateKitting(entries: BomKittingEntry[]) {
|
||||
return request<KittingResult>({
|
||||
url: '/v1/bom/calculate-kitting',
|
||||
method: 'post',
|
||||
data: entries
|
||||
|
||||
18
inventory-web/src/api/user.ts
Normal file
18
inventory-web/src/api/user.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 读取当前用户的 preferences
|
||||
export function getUserPreferences() {
|
||||
return request({
|
||||
url: '/v1/user/preferences',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 保存/更新当前用户的 preferences
|
||||
export function saveUserPreferences(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/v1/user/preferences',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -39,17 +39,24 @@ const routes: Array<RouteRecordRaw> = [
|
||||
]
|
||||
},
|
||||
|
||||
// 3. 基础信息
|
||||
// 3. 基础信息(父级菜单)
|
||||
{
|
||||
path: '/material',
|
||||
path: '/basic',
|
||||
component: Layout,
|
||||
redirect: '/material/index',
|
||||
meta: { title: '基础信息', icon: 'Box' },
|
||||
redirect: '/basic/material',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
path: 'material',
|
||||
name: 'MaterialBase',
|
||||
component: () => import('@/views/material/list.vue'),
|
||||
meta: { title: '基础信息', icon: 'Box' }
|
||||
meta: { title: '物料基础信息', icon: 'Box' }
|
||||
},
|
||||
{
|
||||
path: 'kitting',
|
||||
name: 'BasicKitting',
|
||||
component: () => import('@/views/basic/kitting/index.vue'),
|
||||
meta: { title: '产能与齐套分析', icon: 'Cpu' }
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -159,12 +166,6 @@ const routes: Array<RouteRecordRaw> = [
|
||||
name: 'BomManage',
|
||||
component: BomManage,
|
||||
meta: { title: 'BOM配方管理', icon: 'list' }
|
||||
},
|
||||
{
|
||||
path: 'kitting',
|
||||
name: 'BomKitting',
|
||||
component: () => import('@/views/basic/kitting/index.vue'),
|
||||
meta: { title: '齐套计算器', icon: 'Cpu' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user