From 16255a805681a7a7bf813bcfbde752fbfb4b8256 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 10 八月 2026 09:16:28 +0800
Subject: [PATCH] chore(config): 更新生产环境API服务器配置
---
src/views/crm/saleQuotation/modules/item-form.vue | 50 ++++++++++++++++++++++++++------------------------
1 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/src/views/crm/saleQuotation/modules/item-form.vue b/src/views/crm/saleQuotation/modules/item-form.vue
index e3aacab..0de5bb2 100644
--- a/src/views/crm/saleQuotation/modules/item-form.vue
+++ b/src/views/crm/saleQuotation/modules/item-form.vue
@@ -2,14 +2,14 @@
import type { MdmItemApi } from '#/api/mdm/item';
import type { CrmSaleQuotationApi } from '#/api/crm/saleQuotation';
-import { computed, onMounted, ref } from 'vue';
+import { computed, ref } from 'vue';
import { erpPriceMultiply } from '#/packages/utils/src';
-import { InputNumber, Select } from 'ant-design-vue';
+import { InputNumber } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
-import { getItemPage } from '#/api/mdm/item';
+import MdmItemSelect from '#/views/basicData/mdm/components/select.vue';
import { useItemColumns } from '../data';
@@ -24,7 +24,7 @@
const emit = defineEmits(['change']);
const tableData = ref<CrmSaleQuotationApi.SaleQuotationItem[]>([]);
-const itemOptions = ref<MdmItemApi.Item[]>([]);
+const selectedItem = ref<MdmItemApi.Item>();
/** 鑾峰彇琛ㄦ牸鍚堣鏁版嵁 */
const summaries = computed(() => {
@@ -93,13 +93,23 @@
}
}
-/** 澶勭悊鐗╂枡鍙樻洿 */
-function handleItemChange(itemId: number, row: any) {
- const item = itemOptions.value.find((p) => p.id === itemId);
+/** 澶勭悊浜у搧鍙樻洿 */
+function handleItemChange(item: MdmItemApi.Item | undefined, row: any) {
if (!item) {
+ row.itemId = undefined;
+ row.itemName = undefined;
+ row.itemCode = undefined;
+ row.itemBarCode = undefined;
+ row.itemSpecification = undefined;
+ row.itemUnitName = undefined;
+ row.itemUnitName2 = undefined;
+ row.itemUnitName3 = undefined;
+ row.itemPrice = undefined;
+ row.quotationPrice = undefined;
+ row.totalPrice = 0;
return;
}
- row.itemId = itemId;
+ row.itemId = item.id;
row.itemName = item.name;
row.itemCode = item.code;
row.itemBarCode = item.barCode;
@@ -133,7 +143,7 @@
const item = tableData.value[i];
if (item) {
if (!item.itemId) {
- throw new Error(`绗� ${i + 1} 琛岋細鐗╂枡涓嶈兘涓虹┖`);
+ throw new Error(`绗� ${i + 1} 琛岋細浜у搧涓嶈兘涓虹┖`);
}
if (!item.count || item.count <= 0) {
throw new Error(`绗� ${i + 1} 琛岋細鏁伴噺涓嶈兘涓虹┖`);
@@ -173,25 +183,17 @@
getData,
resetData,
});
-
-/** 鍒濆鍖� */
-onMounted(async () => {
- const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 });
- itemOptions.value = res.list || [];
-});
</script>
<template>
<Grid class="w-full">
<template #itemId="{ row }">
- <Select
+ <MdmItemSelect
v-if="!disabled"
- v-model:value="row.itemId"
- :options="itemOptions"
- :field-names="{ label: 'name', value: 'id' }"
- class="w-full"
- placeholder="璇烽�夋嫨鐗╂枡"
- @change="(val) => handleItemChange(val, row)"
+ v-model:model-value="row.itemId"
+ :label="row.itemName"
+ placeholder="璇烽�夋嫨浜у搧"
+ @change="(item) => handleItemChange(item, row)"
/>
<span v-else>{{ row.itemName || '-' }}</span>
</template>
@@ -224,7 +226,7 @@
type: 'link',
danger: true,
popConfirm: {
- title: '纭鍒犻櫎璇ョ墿鏂欏悧锛�',
+ title: '纭鍒犻櫎璇ヤ骇鍝佸悧锛�',
confirm: handleDelete.bind(null, row),
},
},
@@ -247,7 +249,7 @@
class="mt-2 flex justify-center"
:actions="[
{
- label: '娣诲姞鐗╂枡',
+ label: '娣诲姞浜у搧',
type: 'default',
onClick: handleAdd,
},
--
Gitblit v1.9.3