feat: 打通采购申请与入库的按单入库链路
后端变更: - PurchaseRequest 新增 base_id 硬关联 MaterialBase,StockBuy 新增 request_id 关联采购单 - handle_inbound 支持 request_id 入参,入库后自动反写采购单状态为已完成 - 新增 get_approved_requests 接口,返回已审批未入库采购单列表(含物料信息+历史数据回退匹配) - create_purchase_request 新增 name+spec_model 自动匹配 MaterialBase - 新增 SQL 和 Alembic 数据库迁移脚本 前端变更: - 入库表单新增"从采购单导入"弹窗,支持搜索/选中已审批采购单并一键填充物料和商务信息 - 单价/总价交叉推算,缺项自动补全 - 选中行蓝色高亮+点击整行选中,行级交互优化
This commit is contained in:
@ -3,6 +3,7 @@ import request from '@/utils/request'
|
||||
export interface PurchaseItem {
|
||||
id?: number
|
||||
request_no?: string
|
||||
base_id?: number
|
||||
name: string
|
||||
spec_model?: string
|
||||
quantity: number
|
||||
@ -22,6 +23,17 @@ export interface PurchaseItem {
|
||||
reject_reason?: string
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
// [新增] 关联物料基础信息(已审批未入库列表返回)
|
||||
material?: {
|
||||
id: number
|
||||
company_name: string
|
||||
name: string
|
||||
spec_model: string
|
||||
category: string
|
||||
unit: string
|
||||
type: string
|
||||
is_inspection_required: boolean
|
||||
} | null
|
||||
}
|
||||
|
||||
export interface Approver {
|
||||
@ -98,3 +110,16 @@ export function searchMaterialPurchase(keyword: string, page: number = 1) {
|
||||
params: { keyword, page }
|
||||
})
|
||||
}
|
||||
|
||||
// [新增] 获取已审批通过且未入库的采购单列表(供库管按单入库使用)
|
||||
export function getApprovedUnstockedRequests(params: {
|
||||
page?: number
|
||||
limit?: number
|
||||
keyword?: string
|
||||
}) {
|
||||
return request({
|
||||
url: '/purchase/approved-unstocked',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user