generated from Leo_Ding/web-template
代码修改
This commit is contained in:
parent
5ab7ac4081
commit
cdae903b31
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
})()
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -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(() => {
|
||||
|
||||
@ -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> -->
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user