Commit 34a3d7db by yuzhenWang

Merge branch 'feature-20260316wyz-预约修改' into 'test'

修改预约提交loading

See merge request !95
parents 99e7cc48 ea3141b0
...@@ -695,27 +695,6 @@ const handleFileChange = async file => { ...@@ -695,27 +695,6 @@ const handleFileChange = async file => {
return false // 阻止自动上传 return false // 阻止自动上传
} }
const execlUpload = () => {
// exprotLoading.value = true
// let data = {
// // appointmentBizId: idsObj.value.appointmentBizId,
// file: currentFile.value
// }
// try {
// if (currentFile.value) {
// uploadExcel(data).then(res => {
// if (res.code == 200) {
// proxy.$message.success('预约导入成功')
// execlDialog.value = false
// exprotLoading.value = false
// }
// })
// }
// } catch (error) {
// proxy.$message.error(error.message)
// exprotLoading.value = false
// }
}
// 获取预约详情 // 获取预约详情
function getAppointmentInfo(appointmentBizId, changeTab) { function getAppointmentInfo(appointmentBizId, changeTab) {
getAppointmentDetail(appointmentBizId).then(res => { getAppointmentDetail(appointmentBizId).then(res => {
...@@ -1061,8 +1040,9 @@ const handleSubmit = async type => { ...@@ -1061,8 +1040,9 @@ const handleSubmit = async type => {
if (type == 'submit') { if (type == 'submit') {
submitLoading.value = true submitLoading.value = true
// 新增预约单 // 新增预约单
addAppointment(submitAppointmentObj.value).then(res => { try {
if (res.code == 200) { const res = await addAppointment(submitAppointmentObj.value)
if (res.code === 200) {
submitLoading.value = false submitLoading.value = false
proxy.$message.success('预约成功') proxy.$message.success('预约成功')
editStatus.value = false editStatus.value = false
...@@ -1071,10 +1051,15 @@ const handleSubmit = async type => { ...@@ -1071,10 +1051,15 @@ const handleSubmit = async type => {
type: 'add' type: 'add'
}) })
} else { } else {
console.log('出错了', res)
submitLoading.value = false submitLoading.value = false
} }
}) } catch (error) {
console.error('新增请求异常:', error)
submitLoading.value = false
}
} }
return
} }
// 代表修改预约单 因为编辑暂存也会有预约id // 代表修改预约单 因为编辑暂存也会有预约id
if (idsObj.value.appointmentBizId && type == 'submit') { if (idsObj.value.appointmentBizId && type == 'submit') {
...@@ -1084,7 +1069,18 @@ const handleSubmit = async type => { ...@@ -1084,7 +1069,18 @@ const handleSubmit = async type => {
} }
submitLoading.value = true submitLoading.value = true
// 编辑预约单 // 编辑预约单
editAppointmentDetail(submitAppointmentObj.value).then(res => { // editAppointmentDetail(submitAppointmentObj.value).then(res => {
// if (res.code == 200) {
// submitLoading.value = false
// editStatus.value = true
// getAppointmentInfo(idsObj.value.appointmentBizId)
// proxy.$message.success('修改预约单成功')
// } else {
// submitLoading.value = false
// }
// })
try {
const res = await editAppointmentDetail(submitAppointmentObj.value)
if (res.code == 200) { if (res.code == 200) {
submitLoading.value = false submitLoading.value = false
editStatus.value = true editStatus.value = true
...@@ -1093,7 +1089,11 @@ const handleSubmit = async type => { ...@@ -1093,7 +1089,11 @@ const handleSubmit = async type => {
} else { } else {
submitLoading.value = false submitLoading.value = false
} }
}) } catch (error) {
console.error('修改请求异常:', error)
submitLoading.value = false
}
return
} }
// 新增预约暂存 // 新增预约暂存
if (type == 'storage') { if (type == 'storage') {
...@@ -1103,7 +1103,17 @@ const handleSubmit = async type => { ...@@ -1103,7 +1103,17 @@ const handleSubmit = async type => {
submitAppointmentObj.value.apiAppointmentInfoDto.fnaNo = props.processDetail.fnaNo submitAppointmentObj.value.apiAppointmentInfoDto.fnaNo = props.processDetail.fnaNo
submitLoading.value = true submitLoading.value = true
// 暂存预约单 // 暂存预约单
storageAppointment(submitAppointmentObj.value).then(res => { // storageAppointment(submitAppointmentObj.value).then(res => {
// if (res.code == 200) {
// submitLoading.value = false
// proxy.$message.success('预约暂存成功')
// router.push({ path: '/sign/appointment' })
// } else {
// submitLoading.value = false
// }
// })
try {
const res = await storageAppointment(submitAppointmentObj.value)
if (res.code == 200) { if (res.code == 200) {
submitLoading.value = false submitLoading.value = false
proxy.$message.success('预约暂存成功') proxy.$message.success('预约暂存成功')
...@@ -1111,13 +1121,28 @@ const handleSubmit = async type => { ...@@ -1111,13 +1121,28 @@ const handleSubmit = async type => {
} else { } else {
submitLoading.value = false submitLoading.value = false
} }
}) } catch (error) {
console.error('暂存请求异常:', error)
submitLoading.value = false
}
} }
// 编辑状态下预约暂存 // 编辑状态下预约暂存
if (type == 'editStorage') { if (type == 'editStorage') {
submitLoading.value = true submitLoading.value = true
// 暂存预约单 // 暂存预约单
appointmentEditStorage(submitAppointmentObj.value).then(res => { // appointmentEditStorage(submitAppointmentObj.value).then(res => {
// if (res.code == 200) {
// submitLoading.value = false
// proxy.$message.success('预约暂存提交成功')
// editStatus.value = true
// getAppointmentInfo(idsObj.value.appointmentBizId)
// } else {
// submitLoading.value = false
// }
// })
try {
const res = await appointmentEditStorage(submitAppointmentObj.value)
if (res.code == 200) { if (res.code == 200) {
submitLoading.value = false submitLoading.value = false
proxy.$message.success('预约暂存提交成功') proxy.$message.success('预约暂存提交成功')
...@@ -1126,7 +1151,10 @@ const handleSubmit = async type => { ...@@ -1126,7 +1151,10 @@ const handleSubmit = async type => {
} else { } else {
submitLoading.value = false submitLoading.value = false
} }
}) } catch (error) {
console.error('预约暂存请求异常:', error)
submitLoading.value = false
}
} }
} }
const handleEdit = () => { const handleEdit = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment