fix(@vben/web-antd): erp 更新采购和销售退货表单,修复关联订单选择功能不统一详细可编辑的问题,统一文件名称格式
parent
4bd2e1d56e
commit
efcfe2104f
|
|
@ -56,7 +56,10 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
||||||
label: '关联订单',
|
label: '关联订单',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-1',
|
formItemClass: 'col-span-1',
|
||||||
disabled: true,
|
componentProps: {
|
||||||
|
disabled: formType === 'detail',
|
||||||
|
placeholder: '请选择关联订单',
|
||||||
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,6 @@ defineExpose({ modalApi });
|
||||||
</template>
|
</template>
|
||||||
<template #orderNo="slotProps">
|
<template #orderNo="slotProps">
|
||||||
<SelectPurchaseOrderForm
|
<SelectPurchaseOrderForm
|
||||||
:modal="Modal"
|
|
||||||
v-bind="slotProps"
|
v-bind="slotProps"
|
||||||
:order-no="formData?.orderNo"
|
:order-no="formData?.orderNo"
|
||||||
@update:order="handleUpdateOrder"
|
@update:order="handleUpdateOrder"
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,13 @@ const handleOk = () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Input v-bind="$attrs" disabled :value="orderNo">
|
<Input
|
||||||
|
v-bind="$attrs"
|
||||||
|
readonly
|
||||||
|
:value="orderNo"
|
||||||
|
:disabled="disabled"
|
||||||
|
@click="() => !disabled && (open = true)"
|
||||||
|
>
|
||||||
<template #addonAfter>
|
<template #addonAfter>
|
||||||
<div>
|
<div>
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
} from '#/api/erp/purchase/order';
|
} from '#/api/erp/purchase/order';
|
||||||
|
|
||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
import PurchaseOrderItemForm from './PurchaseOrderItemForm.vue';
|
import PurchaseOrderItemForm from './purchase-order-item-form.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<ErpPurchaseOrderApi.PurchaseOrder>();
|
const formData = ref<ErpPurchaseOrderApi.PurchaseOrder>();
|
||||||
|
|
@ -92,7 +92,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
message.error('子表单验证失败');
|
message.error('子表单验证失败');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
message.error(error.message || '子表单验证失败');
|
message.error(error.message || '子表单验证失败');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -160,15 +160,6 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
try {
|
try {
|
||||||
formData.value = await getPurchaseOrder(data.id);
|
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
|
// 设置到 values
|
||||||
await formApi.setValues(formData.value);
|
await formApi.setValues(formData.value);
|
||||||
// 初始化子表单
|
// 初始化子表单
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ watch(
|
||||||
props.discountPercent === null
|
props.discountPercent === null
|
||||||
? 0
|
? 0
|
||||||
: erpPriceMultiply(totalPrice, props.discountPercent / 100);
|
: erpPriceMultiply(totalPrice, props.discountPercent / 100);
|
||||||
const finalTotalPrice = totalPrice - discountPrice;
|
const finalTotalPrice = totalPrice - discountPrice!;
|
||||||
|
|
||||||
// 发送计算结果给父组件
|
// 发送计算结果给父组件
|
||||||
emit('update:discount-price', discountPrice);
|
emit('update:discount-price', discountPrice);
|
||||||
|
|
@ -108,9 +108,9 @@ onMounted(async () => {
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
const newRow = {
|
const newRow = {
|
||||||
productId: null,
|
productId: undefined,
|
||||||
productName: '',
|
productName: '',
|
||||||
productUnitId: null,
|
productUnitId: undefined,
|
||||||
productUnitName: '',
|
productUnitName: '',
|
||||||
productBarCode: '',
|
productBarCode: '',
|
||||||
count: 1,
|
count: 1,
|
||||||
|
|
@ -57,6 +57,10 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-1',
|
formItemClass: 'col-span-1',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
|
componentProps: {
|
||||||
|
disabled: formType === 'detail',
|
||||||
|
placeholder: '请选择关联订单',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'DatePicker',
|
component: 'DatePicker',
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,6 @@ defineExpose({ modalApi });
|
||||||
</template>
|
</template>
|
||||||
<template #orderNo="slotProps">
|
<template #orderNo="slotProps">
|
||||||
<SelectPurchaseOrderForm
|
<SelectPurchaseOrderForm
|
||||||
:modal="Modal"
|
|
||||||
v-bind="slotProps"
|
v-bind="slotProps"
|
||||||
:order-no="formData?.orderNo"
|
:order-no="formData?.orderNo"
|
||||||
@update:order="handleUpdateOrder"
|
@update:order="handleUpdateOrder"
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,13 @@ const handleOk = () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Input v-bind="$attrs" readonly :value="orderNo">
|
<Input
|
||||||
|
v-bind="$attrs"
|
||||||
|
readonly
|
||||||
|
:value="orderNo"
|
||||||
|
:disabled="disabled"
|
||||||
|
@click="() => !disabled && (open = true)"
|
||||||
|
>
|
||||||
<template #addonAfter>
|
<template #addonAfter>
|
||||||
<div>
|
<div>
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,6 @@ defineExpose({ modalApi });
|
||||||
</template>
|
</template>
|
||||||
<template #orderNo="slotProps">
|
<template #orderNo="slotProps">
|
||||||
<SelectSaleOrderForm
|
<SelectSaleOrderForm
|
||||||
:modal="Modal"
|
|
||||||
v-bind="slotProps"
|
v-bind="slotProps"
|
||||||
:order-no="formData?.orderNo"
|
:order-no="formData?.orderNo"
|
||||||
@update:order="handleUpdateOrder"
|
@update:order="handleUpdateOrder"
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,6 @@ defineExpose({ modalApi });
|
||||||
</template>
|
</template>
|
||||||
<template #orderNo="slotProps">
|
<template #orderNo="slotProps">
|
||||||
<SelectSaleOrderForm
|
<SelectSaleOrderForm
|
||||||
:modal="Modal"
|
|
||||||
v-bind="slotProps"
|
v-bind="slotProps"
|
||||||
:order-no="formData?.orderNo"
|
:order-no="formData?.orderNo"
|
||||||
@update:order="handleUpdateOrder"
|
@update:order="handleUpdateOrder"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue