Merge branch 'claude/sharp-rubin' into claude/gallant-shamir

This commit is contained in:
panchengyong
2026-03-14 14:27:21 +08:00
3 changed files with 104 additions and 0 deletions

View File

@@ -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 }> {

View File

@@ -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() {