This commit is contained in:
zlwu committed 2026-07-26 21:06:09 +08:00
1 parent 70bdd820ce
commit bede140d12
988 files changed
+692310 -775910

No files matched your search

@@ -367,7 +367,12 @@
</el-form>
<!-- 产品选择器对话框 -->
<ProductSelector :visible="productSelectorVisible" @update:visible="productSelectorVisible = $event" @confirm="handleProductConfirm" />
<ProductSelector
:visible="productSelectorVisible"
:supplier-id="form.supplierId"
@update:visible="productSelectorVisible = $event"
@confirm="handleProductConfirm"
/>
<!-- 客户选择器 -->
<CustomerSelector :visible="customerSelectorVisible" @update:visible="customerSelectorVisible = $event" @confirm="handleCustomerConfirm" />
@@ -471,6 +476,7 @@ import OpportunitySelector from '@/components/OpportunitySelector.vue';
import { fetchUserOptions } from '@/api/admin';
import { fetchContactsByCustomerId } from '@/api/crm/contact';
import { listAllSupplierInfo, type SupplierInfoVO } from '@/api/crm/supplierInfo';
import { removeProductsNotAllowedByHazard } from '@/utils/crm-supplier-hazard'
const props = withDefaults(
defineProps<{
@@ -789,7 +795,9 @@ const getQuoteInfo = async (id: string | number) => {
taxRate: parseFloat(item.taxRate || '13'), // 税率(%)
packageSpec: item.packageSpec || '', // 包装规格
deliveryMethod: item.deliveryMethod || '', // 送货方式
description: item.description
description: item.description,
isToxic: Number(item.isToxic || 0),
isExplosive: Number(item.isExplosive || 0)
}));
}
@@ -868,7 +876,9 @@ const getQuoteInfoForCopy = async (copyId: string | number) => {
taxRate: parseFloat(item.taxRate || '13'), // 税率(%)
packageSpec: item.packageSpec || '', // 包装规格
deliveryMethod: item.deliveryMethod || '', // 送货方式
description: item.description
description: item.description,
isToxic: Number(item.isToxic || 0),
isExplosive: Number(item.isExplosive || 0)
}));
}
@@ -1127,11 +1137,26 @@ const handleSupplierChange = (supplierId: number | undefined) => {
form.value.supplierId = supplier.id;
form.value.supplierName = supplier.supplierName || '';
updateQuoteTitleAndNo();
const allowToxic = Number((supplier as any).allowToxic || 0)
const allowExplosive = Number((supplier as any).allowExplosive || 0)
const { kept, removedNames } = removeProductsNotAllowedByHazard(
form.value.products || [],
allowToxic,
allowExplosive
)
form.value.products = kept
if (removedNames.length) {
$modal.msgWarning(`当前主体不支持以下产品,已自动移除:${removedNames.join('、')}`)
}
}
};
/** 添加产品 */
const handleAddProduct = () => {
if (!form.value.supplierId) {
$modal.msgWarning('请先选择报价主体')
return
}
productSelectorVisible.value = true;
};
@@ -1152,7 +1177,9 @@ const handleProductConfirm = (products: any[]) => {
taxAmount: 0,
subtotal: 0,
packageSpec: '',
deliveryMethod: ''
deliveryMethod: '',
isToxic: Number(product.isToxic || 0),
isExplosive: Number(product.isExplosive || 0)
};
form.value.products?.push(productForm);
});