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'),
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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(() => {
|
||||||
|
|||||||
@ -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> -->
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user