代码修改

This commit is contained in:
qiuyuan 2025-11-12 14:11:12 +08:00
parent 5ab7ac4081
commit cdae903b31
4 changed files with 27 additions and 21 deletions

View File

@ -280,23 +280,22 @@ function handleDelete({ id }) {
content: t('button.confirm'), content: t('button.confirm'),
okText: t('button.confirm'), okText: t('button.confirm'),
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise(async (resolve, reject) => {
; (async () => { try {
try { const res = await apis.serviceStaffList.delItem(id);
const { success } = await apis.productOrder.delItem(id).catch(() => { if (config('http.code.success') === res.success) {
throw new Error() message.success(t('component.message.success.delete'));
}) await getPageList();
if (config('http.code.success') === success) { resolve();
resolve() } else {
message.success(t('component.message.success.delete')) reject(new Error('API returned failure'));
await getPageList()
}
} catch (error) {
reject()
} }
})() } catch (error) {
}) message.error(t('component.message.error.delete'));
}, reject(error);
}
});
}
}) })
} }

View File

@ -119,14 +119,21 @@ function handleOk() {
break break
} }
hideLoading() hideLoading()
if (config('http.code.success') === true) {
//
if (result && config('http.code.success') === result.success) {
hideModal() hideModal()
//
emit('ok') emit('ok')
//
message.success('操作成功')
} else {
message.error('操作失败')
} }
} catch (error) { } catch (error) {
console.log(error.message) console.log(error.message)
hideLoading() hideLoading()
// message.error(error.message) message.error('操作失败')
} }
}) })
.catch(() => { .catch(() => {

View File

@ -362,7 +362,7 @@
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog> <edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
<detail ref="detailRef" ></detail> <detail ref="detailRef" ></detail>
<LineOrder2 ref="lineOrderRef" /> <LineOrder2 ref="lineOrderRef" />
<TransferOut ref="transferRef" /> <TransferOut ref="transferRef" @ok="onOk" />
<!-- <a-drawer v-model:open="lineOpen" class="custom-class" width="600" root-class-name="root-class-name" :root-style="{ color: 'blue' }" :title="lineTitle" placement="right"> <!-- <a-drawer v-model:open="lineOpen" class="custom-class" width="600" root-class-name="root-class-name" :root-style="{ color: 'blue' }" :title="lineTitle" placement="right">
<LineOrder ref="lineOrderRef" /> <LineOrder ref="lineOrderRef" />
</a-drawer> --> </a-drawer> -->

View File

@ -102,7 +102,7 @@
</a-collapse> </a-collapse>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<a-row :gutter="gutter" style="margin-top: 16px;"> <a-row :gutter="gutter" style="margin-top: 26px;">
<a-col :span="24" style="text-align: right;"> <a-col :span="24" style="text-align: right;">
<a-space> <a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
@ -126,7 +126,7 @@
<a-row :gutter="8" :wrap="false" style="margin-top: 20px;"> <a-row :gutter="8" :wrap="false" style="margin-top: 20px;">
<a-col flex="auto"> <a-col flex="auto">
<a-card title="回访列表"> <a-card title="待派单列表">
<div style="margin-bottom: 20px;"> <div style="margin-bottom: 20px;">
<a-space> <a-space>
<a-button type="primary">导入</a-button> <a-button type="primary">导入</a-button>