fix(@vben/web-antd): erp 更新采购和销售退货表单,修复关联订单选择功能不统一详细可编辑的问题,统一文件名称格式

pull/205/head
xuzhiqiang 2025-08-22 17:17:20 +08:00
parent 4bd2e1d56e
commit efcfe2104f
10 changed files with 27 additions and 21 deletions

View File

@ -56,7 +56,10 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
label: '关联订单',
component: 'Input',
formItemClass: 'col-span-1',
disabled: true,
componentProps: {
disabled: formType === 'detail',
placeholder: '请选择关联订单',
},
rules: 'required',
},
{

View File

@ -303,7 +303,6 @@ defineExpose({ modalApi });
</template>
<template #orderNo="slotProps">
<SelectPurchaseOrderForm
:modal="Modal"
v-bind="slotProps"
:order-no="formData?.orderNo"
@update:order="handleUpdateOrder"

View File

@ -39,7 +39,13 @@ const handleOk = () => {
</script>
<template>
<Input v-bind="$attrs" disabled :value="orderNo">
<Input
v-bind="$attrs"
readonly
:value="orderNo"
:disabled="disabled"
@click="() => !disabled && (open = true)"
>
<template #addonAfter>
<div>
<IconifyIcon

View File

@ -15,7 +15,7 @@ import {
} from '#/api/erp/purchase/order';
import { useFormSchema } from '../data';
import PurchaseOrderItemForm from './PurchaseOrderItemForm.vue';
import PurchaseOrderItemForm from './purchase-order-item-form.vue';
const emit = defineEmits(['success']);
const formData = ref<ErpPurchaseOrderApi.PurchaseOrder>();
@ -92,7 +92,7 @@ const [Modal, modalApi] = useVbenModal({
message.error('子表单验证失败');
return;
}
} catch (error) {
} catch (error: any) {
message.error(error.message || '子表单验证失败');
return;
}
@ -160,15 +160,6 @@ const [Modal, modalApi] = useVbenModal({
modalApi.lock();
try {
formData.value = await getPurchaseOrder(data.id);
// URLFileUpload
if (
formData.value.fileUrl &&
typeof formData.value.fileUrl === 'string'
) {
formData.value.fileUrl = formData.value.fileUrl
? [formData.value.fileUrl]
: [];
}
// values
await formApi.setValues(formData.value);
//

View File

@ -92,7 +92,7 @@ watch(
props.discountPercent === null
? 0
: erpPriceMultiply(totalPrice, props.discountPercent / 100);
const finalTotalPrice = totalPrice - discountPrice;
const finalTotalPrice = totalPrice - discountPrice!;
//
emit('update:discount-price', discountPrice);
@ -108,9 +108,9 @@ onMounted(async () => {
function handleAdd() {
const newRow = {
productId: null,
productId: undefined,
productName: '',
productUnitId: null,
productUnitId: undefined,
productUnitName: '',
productBarCode: '',
count: 1,

View File

@ -57,6 +57,10 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
component: 'Input',
formItemClass: 'col-span-1',
rules: 'required',
componentProps: {
disabled: formType === 'detail',
placeholder: '请选择关联订单',
},
},
{
component: 'DatePicker',

View File

@ -305,7 +305,6 @@ defineExpose({ modalApi });
</template>
<template #orderNo="slotProps">
<SelectPurchaseOrderForm
:modal="Modal"
v-bind="slotProps"
:order-no="formData?.orderNo"
@update:order="handleUpdateOrder"

View File

@ -39,7 +39,13 @@ const handleOk = () => {
</script>
<template>
<Input v-bind="$attrs" readonly :value="orderNo">
<Input
v-bind="$attrs"
readonly
:value="orderNo"
:disabled="disabled"
@click="() => !disabled && (open = true)"
>
<template #addonAfter>
<div>
<IconifyIcon

View File

@ -299,7 +299,6 @@ defineExpose({ modalApi });
</template>
<template #orderNo="slotProps">
<SelectSaleOrderForm
:modal="Modal"
v-bind="slotProps"
:order-no="formData?.orderNo"
@update:order="handleUpdateOrder"

View File

@ -303,7 +303,6 @@ defineExpose({ modalApi });
</template>
<template #orderNo="slotProps">
<SelectSaleOrderForm
:modal="Modal"
v-bind="slotProps"
:order-no="formData?.orderNo"
@update:order="handleUpdateOrder"