fix(@vben/web-antd): erp 更新采购和销售退货表单,修复关联订单选择功能不统一详细可编辑的问题,统一文件名称格式
parent
4bd2e1d56e
commit
efcfe2104f
|
|
@ -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',
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -303,7 +303,6 @@ defineExpose({ modalApi });
|
|||
</template>
|
||||
<template #orderNo="slotProps">
|
||||
<SelectPurchaseOrderForm
|
||||
:modal="Modal"
|
||||
v-bind="slotProps"
|
||||
:order-no="formData?.orderNo"
|
||||
@update:order="handleUpdateOrder"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
// 将字符串形式的文件URL转换为数组形式以适配FileUpload组件
|
||||
if (
|
||||
formData.value.fileUrl &&
|
||||
typeof formData.value.fileUrl === 'string'
|
||||
) {
|
||||
formData.value.fileUrl = formData.value.fileUrl
|
||||
? [formData.value.fileUrl]
|
||||
: [];
|
||||
}
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
// 初始化子表单
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -305,7 +305,6 @@ defineExpose({ modalApi });
|
|||
</template>
|
||||
<template #orderNo="slotProps">
|
||||
<SelectPurchaseOrderForm
|
||||
:modal="Modal"
|
||||
v-bind="slotProps"
|
||||
:order-no="formData?.orderNo"
|
||||
@update:order="handleUpdateOrder"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -299,7 +299,6 @@ defineExpose({ modalApi });
|
|||
</template>
|
||||
<template #orderNo="slotProps">
|
||||
<SelectSaleOrderForm
|
||||
:modal="Modal"
|
||||
v-bind="slotProps"
|
||||
:order-no="formData?.orderNo"
|
||||
@update:order="handleUpdateOrder"
|
||||
|
|
|
|||
|
|
@ -303,7 +303,6 @@ defineExpose({ modalApi });
|
|||
</template>
|
||||
<template #orderNo="slotProps">
|
||||
<SelectSaleOrderForm
|
||||
:modal="Modal"
|
||||
v-bind="slotProps"
|
||||
:order-no="formData?.orderNo"
|
||||
@update:order="handleUpdateOrder"
|
||||
|
|
|
|||
Loading…
Reference in New Issue