代码修改

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'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
return new Promise(async (resolve, reject) => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
const res = await apis.serviceStaffList.delItem(id);
if (config('http.code.success') === res.success) {
message.success(t('component.message.success.delete'));
await getPageList();
resolve();
} else {
reject(new Error('API returned failure'));
}
} catch (error) {
reject()
message.error(t('component.message.error.delete'));
reject(error);
}
});
}
})()
})
},
})
}

View File

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

View File

@ -362,7 +362,7 @@
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
<detail ref="detailRef" ></detail>
<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">
<LineOrder ref="lineOrderRef" />
</a-drawer> -->

View File

@ -102,7 +102,7 @@
</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-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
@ -126,7 +126,7 @@
<a-row :gutter="8" :wrap="false" style="margin-top: 20px;">
<a-col flex="auto">
<a-card title="回访列表">
<a-card title="待派单列表">
<div style="margin-bottom: 20px;">
<a-space>
<a-button type="primary">导入</a-button>