Merge remote-tracking branch 'origin/feat/erp-purchase-plan' into 0.8.X

This commit is contained in:
2026-06-25 17:08:24 +08:00
38 changed files with 3559 additions and 2842 deletions

View File

@@ -0,0 +1,124 @@
import request from '@/utils/request'
// 采购计划列表
export function listPurchasePlan(query) {
return request({
url: '/erp/purchasePlan/list',
method: 'get',
params: query
})
}
// 总体到货进度统计(已完成 N / 共 M
export function purchasePlanStatistics(query) {
return request({
url: '/erp/purchasePlan/statistics',
method: 'get',
params: query
})
}
// 采购计划详情
export function getPurchasePlan(planId) {
return request({
url: '/erp/purchasePlan/' + planId,
method: 'get'
})
}
// 按销售合同取明细(选合同自动带出明细)
export function getItemsByOrders(orderIds) {
return request({
url: '/erp/purchasePlan/itemsByOrders',
method: 'get',
params: { orderIds: (orderIds || []).join(',') }
})
}
// 合同列表(左侧,含每个合同已有计划数)
export function listContracts(query) {
return request({
url: '/erp/purchasePlan/contracts',
method: 'get',
params: query
})
}
// 某合同下的所有采购计划
export function listPlansByContract(orderId) {
return request({
url: '/erp/purchasePlan/byContract/' + orderId,
method: 'get'
})
}
// 新增采购计划
export function addPurchasePlan(data) {
return request({
url: '/erp/purchasePlan',
method: 'post',
data
})
}
// 修改采购计划
export function updatePurchasePlan(data) {
return request({
url: '/erp/purchasePlan',
method: 'put',
data
})
}
// 审核(通过/驳回 + 申请意见)
export function auditPurchasePlan(data) {
return request({
url: '/erp/purchasePlan/audit',
method: 'put',
data
})
}
// 送审 / 重新送审
export function submitPurchasePlan(planId) {
return request({
url: '/erp/purchasePlan/submit/' + planId,
method: 'put'
})
}
// 删除采购计划
export function delPurchasePlan(planIds) {
return request({
url: '/erp/purchasePlan/' + planIds,
method: 'delete'
})
}
// 导入到货 Excel
export function importDelivery(planId, file) {
const formData = new FormData()
formData.append('file', file)
return request({
url: `/erp/purchasePlan/${planId}/importDelivery`,
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
}
// 某计划的到货明细
export function listDelivery(planId) {
return request({
url: `/erp/purchasePlan/${planId}/delivery`,
method: 'get'
})
}
// 删除到货明细
export function delDelivery(deliveryId) {
return request({
url: `/erp/purchasePlan/delivery/${deliveryId}`,
method: 'delete'
})
}