2023.11.1修改
This commit is contained in:
@@ -16,7 +16,7 @@ const api = {
|
||||
},
|
||||
editHospital: data => {
|
||||
return service({
|
||||
url: '/article',
|
||||
url: '/hospital',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
|
@@ -51,6 +51,7 @@ const question_form = ref({
|
||||
answer: '',
|
||||
title: ''
|
||||
})
|
||||
const apiForm = ref(null)
|
||||
const note_list = ref([
|
||||
// {
|
||||
// content: '',
|
||||
@@ -96,18 +97,19 @@ const onReset = () => {
|
||||
}
|
||||
}
|
||||
function openDialog(type) {
|
||||
dialogFormVisible.value = true
|
||||
// let params = {}
|
||||
switch (type) {
|
||||
case 'add':
|
||||
dialogTitle.value = '新增医院'
|
||||
form.value = {}
|
||||
// form.value = {}
|
||||
break
|
||||
case 'edit':
|
||||
// params.question_id = question_id.value
|
||||
dialogTitle.value = '编辑医院信息'
|
||||
break
|
||||
}
|
||||
dialogFormVisible.value = true
|
||||
|
||||
// router.push({name:'addCourse',params})
|
||||
}
|
||||
async function onDelete() {
|
||||
@@ -172,28 +174,28 @@ function closeDialog() {
|
||||
form.value = {}
|
||||
}
|
||||
async function enterDialog() { // 提交
|
||||
// form.value.score = parseInt(form.value.score)
|
||||
// form.value.teacher_id = 0
|
||||
// form.value.question = JSON.stringify(question_form.value)
|
||||
let func_name = 'addHospital'
|
||||
if (form.value.ID) { // 编辑
|
||||
func_name = 'editHospital'
|
||||
}
|
||||
form.value.todos = todo_list.value
|
||||
form.value.notes = note_list.value
|
||||
const res = await api[func_name](form.value)
|
||||
if (res.code === 0) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: res.msg
|
||||
})
|
||||
// if (tableData.value.length === ids.length && page.value > 1) {
|
||||
// page.value--
|
||||
// }
|
||||
// deleteVisible.value = false
|
||||
closeDialog()
|
||||
getHospitalList()
|
||||
}
|
||||
await apiForm.value.validate(async(valid, fields) => {
|
||||
if (valid) {
|
||||
console.log('submit!')
|
||||
let func_name = 'addHospital'
|
||||
if (form.value.ID) { // 编辑
|
||||
func_name = 'editHospital'
|
||||
}
|
||||
form.value.todos = todo_list.value
|
||||
form.value.notes = note_list.value
|
||||
const res = await api[func_name](form.value)
|
||||
if (res.code === 0) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: res.msg
|
||||
})
|
||||
getHospitalList()
|
||||
closeDialog()
|
||||
}
|
||||
} else {
|
||||
// console.log('error submit!', fields)
|
||||
}
|
||||
})
|
||||
}
|
||||
function addRowFunc(type) {
|
||||
// {
|
||||
|
Reference in New Issue
Block a user