From c3651a1361b3c558d6b4f7a4a7995dbfece76a61 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 20 七月 2026 10:32:48 +0800
Subject: [PATCH] 银川 1.销售订单页面展示字段修改 2.修改商机中产品时,输入价格与数量,下方滑动条会自动到最前方,需要重新拉动滑动条才能看到价格与数量输入框
---
src/views/crm/product/components/edit-table.vue | 27 +++++++++------------------
1 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/src/views/crm/product/components/edit-table.vue b/src/views/crm/product/components/edit-table.vue
index e10c345..113080c 100644
--- a/src/views/crm/product/components/edit-table.vue
+++ b/src/views/crm/product/components/edit-table.vue
@@ -3,15 +3,15 @@
import type { CrmContractApi } from '#/api/crm/contract';
import type { MdmItemApi } from '#/api/mdm/item';
-import { nextTick, onMounted, ref, watch } from 'vue';
+import { nextTick, ref, watch } from 'vue';
import { erpPriceMultiply } from '@vben/utils';
-import { InputNumber, Select } from 'ant-design-vue';
+import { InputNumber } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { BizTypeEnum } from '#/api/crm/permission';
-import { getItemPage } from '#/api/mdm/item';
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
import { $t } from '#/locales';
import { useProductEditTableColumns } from './data';
@@ -39,12 +39,11 @@
}
/** 鍒囨崲浜у搧鏃跺悓姝ュ熀纭�淇℃伅 */
-function handleProductChange(itemId: any, row: any) {
- const product = productOptions.value.find((p) => p.id === itemId);
+function handleProductChange(product: MdmItemApi.Item | undefined, row: any) {
if (!product) {
return;
}
- row.itemId = itemId;
+ row.itemId = product.id;
row.itemName = product.name;
row.itemCode = product.code;
row.itemBarCode = product.barCode;
@@ -118,23 +117,15 @@
immediate: true,
},
);
-
-/** 鍒濆鍖� */
-const productOptions = ref<MdmItemApi.Item[]>([]); // 鐗╂枡涓嬫媺閫夐」
-onMounted(async () => {
- const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 });
- productOptions.value = res.list || [];
-});
</script>
<template>
<Grid class="w-full">
<template #itemId="{ row }">
- <Select
- v-model:value="row.itemId"
- :options="productOptions"
- :field-names="{ label: 'name', value: 'id' }"
- class="w-full"
+ <MdmItemSelect
+ :model-value="row.itemId"
+ placeholder="璇烽�夋嫨浜у搧"
+ @update:model-value="row.itemId = $event"
@change="handleProductChange($event, row)"
/>
</template>
--
Gitblit v1.9.3