From 20eae58b25403e8cc58f9e72e411f40798f0bd2c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 16 七月 2026 13:49:59 +0800
Subject: [PATCH] 银川 1.确认收货与质检流程
---
src/views/erp/purchase/order/index.vue | 27 +++++++++
src/api/mes/wm/arrivalnotice/line/index.ts | 1
src/views/erp/purchase/request/index.vue | 4 +
src/views/mes/qc/template/data.ts | 13 +++
src/views/erp/purchase/request/data.ts | 34 ++++++++++
src/views/wls/arrivalnotice/modules/line-list.vue | 9 ++
src/views/erp/purchase/order/modules/form.vue | 20 ++++++
src/views/erp/purchase/request/modules/item-form.vue | 13 ++++
src/api/erp/purchase/order/index.ts | 7 ++
src/views/wls/arrivalnotice/data.ts | 6 ++
10 files changed, 127 insertions(+), 7 deletions(-)
diff --git a/src/api/erp/purchase/order/index.ts b/src/api/erp/purchase/order/index.ts
index 1a75e5a..000cdf2 100644
--- a/src/api/erp/purchase/order/index.ts
+++ b/src/api/erp/purchase/order/index.ts
@@ -110,3 +110,10 @@
name: string; // 娴佺▼鍚嶇О
version: number; // 鐗堟湰鍙�
}
+
+/** 纭鏀惰揣 */
+export function confirmReceipt(id: number) {
+ return requestClient.post<number>('/erp/purchase-order/confirm-receipt', null, {
+ params: { id },
+ });
+}
diff --git a/src/api/mes/wm/arrivalnotice/line/index.ts b/src/api/mes/wm/arrivalnotice/line/index.ts
index 19c917f..ab36b10 100644
--- a/src/api/mes/wm/arrivalnotice/line/index.ts
+++ b/src/api/mes/wm/arrivalnotice/line/index.ts
@@ -17,6 +17,7 @@
iqcCheckFlag?: boolean; // 鏄惁妫�楠�
iqcId?: number; // 鏉ユ枡妫�楠屽崟缂栧彿
iqcCode?: string; // 鏉ユ枡妫�楠屽崟缂栫爜
+ iqcCheckResult?: number; // 璐ㄦ缁撴灉锛�1鍚堟牸 2鐗归噰 3涓嶅悎鏍奸��璐� 4涓嶅悎鏍兼姤搴�
remark?: string; // 澶囨敞
}
}
diff --git a/src/views/erp/purchase/order/index.vue b/src/views/erp/purchase/order/index.vue
index a4e1bec..1d76f59 100644
--- a/src/views/erp/purchase/order/index.vue
+++ b/src/views/erp/purchase/order/index.vue
@@ -11,6 +11,7 @@
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
+ confirmReceipt,
deletePurchaseOrder,
exportPurchaseOrder,
getPurchaseOrderPage,
@@ -77,6 +78,21 @@
try {
await updatePurchaseOrderStatus(row.id!, status);
message.success(`${status === 20 ? '瀹℃壒' : '鍙嶅鎵�'}鎴愬姛`);
+ handleRefresh();
+ } finally {
+ hideLoading();
+ }
+}
+
+/** 纭鏀惰揣 */
+async function handleConfirmReceipt(row: ErpPurchaseOrderApi.PurchaseOrder) {
+ const hideLoading = message.loading({
+ content: '纭鏀惰揣涓�...',
+ duration: 0,
+ });
+ try {
+ const arrivalNoticeId = await confirmReceipt(row.id!);
+ message.success(`纭鏀惰揣鎴愬姛锛屽凡鐢熸垚鍒拌揣閫氱煡鍗昤);
handleRefresh();
} finally {
hideLoading();
@@ -200,6 +216,17 @@
},
},
{
+ label: '纭鏀惰揣',
+ type: 'link',
+ icon: ACTION_ICON.VIEW,
+ auth: ['erp:purchase-order:confirm-receipt'],
+ ifShow: () => row.status === 20 && row.inStatus !== 2,
+ popConfirm: {
+ title: `纭鏀惰揣${row.no}鍚楋紵`,
+ confirm: handleConfirmReceipt.bind(null, row),
+ },
+ },
+ {
label: $t('common.delete'),
type: 'link',
danger: true,
diff --git a/src/views/erp/purchase/order/modules/form.vue b/src/views/erp/purchase/order/modules/form.vue
index 73448a3..baae4ee 100644
--- a/src/views/erp/purchase/order/modules/form.vue
+++ b/src/views/erp/purchase/order/modules/form.vue
@@ -7,11 +7,12 @@
import { useVbenModal } from '@vben/common-ui';
-import { message } from 'ant-design-vue';
+import { message, Button } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
import {
+ confirmReceipt,
createPurchaseOrder,
getPurchaseApproveProcessList,
getPurchaseOrder,
@@ -112,6 +113,20 @@
message.success($t('ui.actionMessage.operationSuccess'));
}
+/** 纭鏀惰揣 */
+async function handleConfirmReceipt() {
+ if (!formData.value?.id) return;
+ const hideLoading = message.loading({ content: '纭鏀惰揣涓�...', duration: 0 });
+ try {
+ await confirmReceipt(formData.value.id);
+ message.success('纭鏀惰揣鎴愬姛锛屽凡鐢熸垚鍒拌揣閫氱煡鍗�');
+ await modalApi.close();
+ emit('success');
+ } finally {
+ hideLoading();
+ }
+}
+
/** 鍒涘缓鎴栨洿鏂伴噰璐鍗� */
const [Modal, modalApi] = useVbenModal({
async onConfirm() {
@@ -204,5 +219,8 @@
/>
</template>
</Form>
+ <template v-if="formType === 'detail' && formData?.status === 20 && formData?.inStatus !== 2" #prepend-footer>
+ <Button type="primary" @click="handleConfirmReceipt">纭鏀惰揣</Button>
+ </template>
</Modal>
</template>
diff --git a/src/views/erp/purchase/request/data.ts b/src/views/erp/purchase/request/data.ts
index 78201dd..eeb1013 100644
--- a/src/views/erp/purchase/request/data.ts
+++ b/src/views/erp/purchase/request/data.ts
@@ -3,7 +3,6 @@
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
-import { erpPriceInputFormatter } from '@vben/utils';
import { getSupplierSimpleList } from '#/api/erp/purchase/supplier';
import { getSimpleUserList } from '#/api/system/user';
@@ -55,7 +54,7 @@
rules: 'required',
},
{
- label: '渚涘簲鍟嗭紙鍙�夛級',
+ label: '渚涘簲鍟�',
fieldName: 'supplierId',
component: 'ApiSelect',
componentProps: {
@@ -67,6 +66,7 @@
valueField: 'id',
disabled: formType === 'detail',
},
+ rules: 'required',
},
{
fieldName: 'discountPercent',
@@ -76,6 +76,17 @@
placeholder: '璇疯緭鍏ヤ紭鎯犵巼',
min: 0,
max: 100,
+ precision: 2,
+ disabled: formType === 'detail',
+ },
+ },
+ {
+ fieldName: 'depositPrice',
+ label: '瀹氶噾',
+ component: 'InputNumber',
+ componentProps: {
+ placeholder: '璇疯緭鍏ュ畾閲�',
+ min: 0,
precision: 2,
disabled: formType === 'detail',
},
@@ -186,6 +197,13 @@
title: '澶囨敞',
minWidth: 150,
slots: { default: 'remark' },
+ },
+ {
+ field: 'qcCheckFlag',
+ title: '鏄惁璐ㄦ',
+ minWidth: 80,
+ fixed: 'right',
+ slots: { default: 'qcCheckFlag' },
},
{
title: '鎿嶄綔',
@@ -311,6 +329,18 @@
minWidth: 120,
},
{
+ field: 'depositPrice',
+ title: '瀹氶噾',
+ formatter: 'formatAmount2',
+ minWidth: 120,
+ },
+ {
+ field: 'qcCheckFlag',
+ title: '鏄惁璐ㄦ',
+ minWidth: 80,
+ slots: { default: 'qcCheckFlag' },
+ },
+ {
field: 'productNames',
title: '鐢宠浜у搧',
minWidth: 150,
diff --git a/src/views/erp/purchase/request/index.vue b/src/views/erp/purchase/request/index.vue
index 347fbf8..f9d2d0e 100644
--- a/src/views/erp/purchase/request/index.vue
+++ b/src/views/erp/purchase/request/index.vue
@@ -197,6 +197,10 @@
<Tag v-else-if="row.status === 30" color="error">瀹℃牳涓嶉�氳繃</Tag>
<Tag v-else-if="row.status === 40" color="warning">宸插彇娑�</Tag>
</template>
+ <template #qcCheckFlag="{ row }">
+ <Tag v-if="row.qcCheckFlag" color="success">鏄�</Tag>
+ <Tag v-else color="default">鍚�</Tag>
+ </template>
<template #actions="{ row }">
<TableAction
:actions="[
diff --git a/src/views/erp/purchase/request/modules/item-form.vue b/src/views/erp/purchase/request/modules/item-form.vue
index 61941ad..4265d46 100644
--- a/src/views/erp/purchase/request/modules/item-form.vue
+++ b/src/views/erp/purchase/request/modules/item-form.vue
@@ -10,7 +10,7 @@
erpPriceMultiply,
} from '@vben/utils';
-import { Input, InputNumber, Select, DatePicker } from 'ant-design-vue';
+import { Input, InputNumber, Select, DatePicker, Switch } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getItemPage } from '#/api/mdm/item';
@@ -98,6 +98,7 @@
demandTime: undefined,
remark: undefined,
totalPrice: 0,
+ qcCheckFlag: false,
};
tableData.value.push(newRow);
emit('update:items', [...tableData.value]);
@@ -239,6 +240,16 @@
<Input v-if="!disabled" v-model:value="row.remark" class="w-full" @change="handleRowChange(row)" />
<span v-else>{{ row.remark || '-' }}</span>
</template>
+ <template #qcCheckFlag="{ row }">
+ <Switch
+ v-if="!disabled"
+ v-model:checked="row.qcCheckFlag"
+ checked-children="鏄�"
+ un-checked-children="鍚�"
+ @change="handleRowChange(row)"
+ />
+ <span v-else>{{ row.qcCheckFlag ? '鏄�' : '鍚�' }}</span>
+ </template>
<template #actions="{ row }">
<TableAction
:actions="[
diff --git a/src/views/mes/qc/template/data.ts b/src/views/mes/qc/template/data.ts
index c848e9a..6301c05 100644
--- a/src/views/mes/qc/template/data.ts
+++ b/src/views/mes/qc/template/data.ts
@@ -17,7 +17,7 @@
import { z } from '#/adapter/form';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
-import { MdItemSelect } from '#/views/mes/md/item/components';
+import { getItemList } from '#/api/mdm/item';
import { MdUnitMeasureSelect } from '#/views/mes/md/unitmeasure/components';
import { QcIndicatorSelect } from '#/views/mes/qc/indicator/components';
@@ -421,9 +421,18 @@
{
fieldName: 'itemId',
label: '浜у搧鐗╂枡',
- component: markRaw(MdItemSelect),
+ component: 'ApiSelect',
componentProps: {
placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
+ allowClear: true,
+ showSearch: true,
+ api: getItemList,
+ labelField: 'name',
+ valueField: 'id',
+ optionRender: (option: any) => {
+ const item = option.data;
+ return `${item.code} - ${item.name}`;
+ },
},
formItemClass: 'col-span-3',
rules: 'required',
diff --git a/src/views/wls/arrivalnotice/data.ts b/src/views/wls/arrivalnotice/data.ts
index 136ed26..e275e2f 100644
--- a/src/views/wls/arrivalnotice/data.ts
+++ b/src/views/wls/arrivalnotice/data.ts
@@ -307,6 +307,12 @@
},
},
{
+ field: 'iqcCheckResult',
+ title: '璐ㄦ缁撴灉',
+ width: 100,
+ slots: { default: 'iqcCheckResult' },
+ },
+ {
field: 'qualifiedQuantity',
title: '鍚堟牸鏁伴噺',
width: 100,
diff --git a/src/views/wls/arrivalnotice/modules/line-list.vue b/src/views/wls/arrivalnotice/modules/line-list.vue
index 29a152a..78617a6 100644
--- a/src/views/wls/arrivalnotice/modules/line-list.vue
+++ b/src/views/wls/arrivalnotice/modules/line-list.vue
@@ -10,7 +10,7 @@
import { useVbenModal } from '@vben/common-ui';
-import { Button, message } from 'ant-design-vue';
+import { Button, message, Tag } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -133,6 +133,13 @@
</Button>
<span v-else>-</span>
</template>
+ <template #iqcCheckResult="{ row }">
+ <Tag v-if="row.iqcCheckResult === 1" color="success">鍚堟牸</Tag>
+ <Tag v-else-if="row.iqcCheckResult === 2" color="warning">鐗归噰</Tag>
+ <Tag v-else-if="row.iqcCheckResult === 3" color="error">涓嶅悎鏍奸��璐�</Tag>
+ <Tag v-else-if="row.iqcCheckResult === 4" color="error">涓嶅悎鏍兼姤搴�</Tag>
+ <span v-else>-</span>
+ </template>
<template #actions="{ row }">
<TableAction
:actions="[
--
Gitblit v1.9.3