Commit 000c78229d1092f2bfd0b499c4b17e063a30a88c
1 parent
7215508b
feat: 订单管理编辑保存按钮新增loading状态
Showing
1 changed file
with
7 additions
and
2 deletions
src/views/project/order/FormDetail/index.vue
@@ -199,7 +199,7 @@ | @@ -199,7 +199,7 @@ | ||
199 | const picUrl = ref(''); | 199 | const picUrl = ref(''); |
200 | let fields = reactive({ baseFields: {} }); | 200 | let fields = reactive({ baseFields: {} }); |
201 | 201 | ||
202 | - const [register, { closeDrawer }] = useDrawerInner((data) => { | 202 | + const [register, { setDrawerProps, closeDrawer }] = useDrawerInner((data) => { |
203 | // baseFormPanelRef.value.setFieldValue('isEditPacketPrice', false); | 203 | // baseFormPanelRef.value.setFieldValue('isEditPacketPrice', false); |
204 | activeKey.value = | 204 | activeKey.value = |
205 | // role.value === ROLE.INSPECT ? '5' : role.value === ROLE.BUSINESS ? '2' : '1'; | 205 | // role.value === ROLE.INSPECT ? '5' : role.value === ROLE.BUSINESS ? '2' : '1'; |
@@ -360,8 +360,10 @@ | @@ -360,8 +360,10 @@ | ||
360 | } | 360 | } |
361 | }); | 361 | }); |
362 | const handleSubmit = async () => { | 362 | const handleSubmit = async () => { |
363 | + if (isLoading.value) return; | ||
364 | + isLoading.value = true; | ||
365 | + setDrawerProps({ confirmLoading: true }); | ||
363 | try { | 366 | try { |
364 | - isLoading.value = true; | ||
365 | if (id.value) { | 367 | if (id.value) { |
366 | const forms = { orderId: id.value } as any; | 368 | const forms = { orderId: id.value } as any; |
367 | if (activeKey.value === '1') { | 369 | if (activeKey.value === '1') { |
@@ -417,6 +419,8 @@ | @@ -417,6 +419,8 @@ | ||
417 | 100 !== | 419 | 100 !== |
418 | 1 | 420 | 1 |
419 | ) { | 421 | ) { |
422 | + setDrawerProps({ confirmLoading: false }); | ||
423 | + isLoading.value = false; | ||
420 | return message.error('占比相加不等于1'); | 424 | return message.error('占比相加不等于1'); |
421 | } | 425 | } |
422 | 426 | ||
@@ -481,6 +485,7 @@ | @@ -481,6 +485,7 @@ | ||
481 | } finally { | 485 | } finally { |
482 | // 无论成功或失败,都将 loading 状态设置为 false | 486 | // 无论成功或失败,都将 loading 状态设置为 false |
483 | isLoading.value = false; | 487 | isLoading.value = false; |
488 | + setDrawerProps({ confirmLoading: false }); | ||
484 | } | 489 | } |
485 | }; | 490 | }; |
486 | const getFormattedDate = (): string => { | 491 | const getFormattedDate = (): string => { |