feat: 采购订单自动生成到货通知单功能
在采购订单查看页面新增"生成到货通知单"按钮,已审核的采购订单可一键生成到货通知单, 自动携带供应商信息和未到货物料明细行。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -173,6 +173,11 @@ export function exportPurchaseOrder(params: PurchaseOrderQuery): Promise<Blob> {
|
||||
return request.post('/erp/po/order/export', params, { responseType: 'blob' })
|
||||
}
|
||||
|
||||
// 根据采购订单生成到货通知单
|
||||
export function genArrivalNotice(orderId: number): Promise<number> {
|
||||
return request.post(`/erp/po/order/genArrivalNotice/${orderId}`).then((res: any) => res.data)
|
||||
}
|
||||
|
||||
// ============ 供应商 API(使用 MOM md_vendor,表 erp_po_supplier 在 my_mes 中未建) ============
|
||||
|
||||
export function getPoSupplierList(params?: { supplierName?: string; contact1?: string; pageNum?: number; pageSize?: number }): Promise<{ rows: PoSupplier[]; total: number }> {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<el-button @click="handleSwitchToEdit">编辑</el-button>
|
||||
<el-button type="success" @click="handleApprove" :disabled="form.status !== 'PREPARE'">审核</el-button>
|
||||
<el-button type="warning" @click="handleUnapprove" :disabled="form.status !== 'APPROVED'">反审核</el-button>
|
||||
<el-button type="info" @click="handleGenArrivalNotice" :disabled="form.status !== 'APPROVED'">生成到货通知单</el-button>
|
||||
<el-button @click="handlePrint">打印</el-button>
|
||||
<el-button @click="toggleHeaderCollapse">{{ headerCollapsed ? '展开' : '收起' }}</el-button>
|
||||
</template>
|
||||
@@ -379,6 +380,7 @@ import {
|
||||
approvePurchaseOrder,
|
||||
unapprovePurchaseOrder,
|
||||
genPurchaseOrderCode,
|
||||
genArrivalNotice,
|
||||
getPoSupplierList,
|
||||
getLeadInList,
|
||||
STATUS_MAP,
|
||||
@@ -817,6 +819,18 @@ async function handleUnapprove() {
|
||||
}
|
||||
}
|
||||
|
||||
// ============ Generate arrival notice ============
|
||||
async function handleGenArrivalNotice() {
|
||||
if (!form.orderId) return
|
||||
try {
|
||||
await ElMessageBox.confirm('确认根据当前采购订单生成到货通知单吗?', '生成到货通知单', { type: 'info' })
|
||||
const noticeId = await genArrivalNotice(form.orderId)
|
||||
ElMessage.success('到货通知单生成成功')
|
||||
} catch (error: any) {
|
||||
if (error !== 'cancel') console.error('生成到货通知单失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// ============ View-mode actions ============
|
||||
function handleNewFromView() { router.push('/purchasing/order/new') }
|
||||
function handleSwitchToEdit() {
|
||||
|
||||
Reference in New Issue
Block a user