From f9e6eb6fc2c2e0c2a2b17238b817fcbfcb6bab56 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 10 八月 2026 16:38:45 +0800
Subject: [PATCH] feat(erp): 添加采购来票管理和付款关联功能
---
src/views/erp/purchase/request/modules/item-form.vue | 35 +++++++++++++++++++----------------
1 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/src/views/erp/purchase/request/modules/item-form.vue b/src/views/erp/purchase/request/modules/item-form.vue
index 61941ad..7cd972a 100644
--- a/src/views/erp/purchase/request/modules/item-form.vue
+++ b/src/views/erp/purchase/request/modules/item-form.vue
@@ -1,5 +1,4 @@
<script lang="ts" setup>
-import type { MdmItemApi } from '#/api/mdm/item';
import type { ErpPurchaseRequestApi } from '#/api/erp/purchase/request';
import { computed, nextTick, onMounted, ref, watch } from 'vue';
@@ -10,10 +9,10 @@
erpPriceMultiply,
} from '@vben/utils';
-import { Input, InputNumber, Select, DatePicker } from 'ant-design-vue';
+import { Input, InputNumber, DatePicker, Switch } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
-import { getItemPage } from '#/api/mdm/item';
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
import { useFormItemColumns } from '../data';
@@ -30,7 +29,6 @@
const emit = defineEmits(['update:items']);
const tableData = ref<ErpPurchaseRequestApi.PurchaseRequestItem[]>([]);
-const productOptions = ref<MdmItemApi.Item[]>([]);
/** 鑾峰彇琛ㄦ牸鍚堣鏁版嵁 */
const summaries = computed(() => {
@@ -98,6 +96,7 @@
demandTime: undefined,
remark: undefined,
totalPrice: 0,
+ qcCheckFlag: false,
};
tableData.value.push(newRow);
emit('update:items', [...tableData.value]);
@@ -113,12 +112,11 @@
}
/** 澶勭悊浜у搧鍙樻洿 */
-async function handleProductChange(productId: any, row: any) {
- const product = productOptions.value.find((p) => p.id === productId);
+function handleProductChange(product: any, row: any) {
if (!product) {
return;
}
- row.productId = productId;
+ row.productId = product.id;
row.productBarCode = product.barCode;
row.productUnitId = product.unitMeasureId;
row.productUnitName = product.unitMeasureName;
@@ -170,9 +168,7 @@
});
/** 鍒濆鍖� */
-onMounted(async () => {
- const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 });
- productOptions.value = res.list || [];
+onMounted(() => {
if (tableData.value.length === 0) {
handleAdd();
}
@@ -182,14 +178,11 @@
<template>
<Grid class="w-full">
<template #productId="{ row }">
- <Select
+ <MdmItemSelect
v-if="!disabled"
- v-model:value="row.productId"
- :options="productOptions"
- :field-names="{ label: 'name', value: 'id' }"
- class="w-full"
+ :model-value="row.productId"
placeholder="璇烽�夋嫨浜у搧"
- show-search
+ @update:model-value="row.productId = $event"
@change="handleProductChange($event, row)"
/>
<span v-else>{{ row.productName || '-' }}</span>
@@ -239,6 +232,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="[
--
Gitblit v1.9.3