提交 98ba0c46 编写于 作者: changdi.hao's avatar changdi.hao

优化体验

上级 cf9727e7
...@@ -18,7 +18,10 @@ export default [{ ...@@ -18,7 +18,10 @@ export default [{
redirect: '/diagnosis-list' redirect: '/diagnosis-list'
}, { }, {
path: '/diagnosis-list', path: '/diagnosis-list',
component: diagnosisList component: diagnosisList,
meta: {
keepAlive: true // 需要被缓存
}
}, { }, {
path: '/diagnosis-im', path: '/diagnosis-im',
component: diagnosisIm component: diagnosisIm
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<el-row :gutter="60" type="flex" justify="center" align="center"> <el-row :gutter="60" type="flex" justify="center" align="center">
<el-button @click="cancle">{{editorType== 1 ? '取消' : '返回'}}</el-button> <el-button @click="cancle">{{editorType== 1 ? '取消' : '返回'}}</el-button>
<el-button type="primary" @click="save" v-if="editorType== 1">保存</el-button> <el-button type="primary" @click="save" v-if="editorType== 1" :disabled="btnDisable">保存</el-button>
</el-row> </el-row>
</div> </div>
</div> </div>
...@@ -303,6 +303,7 @@ export default { ...@@ -303,6 +303,7 @@ export default {
noable: false, noable: false,
editorType: 1, // //1为编辑状态,2为查看 editorType: 1, // //1为编辑状态,2为查看
loading: true, loading: true,
btnDisable: false,
oldDiagnoseAdvice: '', //旧的诊断建议 oldDiagnoseAdvice: '', //旧的诊断建议
formData: { formData: {
// 预约单信息 // 预约单信息
...@@ -553,9 +554,10 @@ export default { ...@@ -553,9 +554,10 @@ export default {
} }
}, },
save() { save() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
let url = `/diagnose/admin/diagnose/update`; let url = `/diagnose/admin/diagnose/update`;
this.formData.birthday = new Date(this.formData.birthdayStr); this.formData.birthday = new Date(this.formData.birthdayStr)
// this.formData.birthday = this.formData.birthdayStr; // this.formData.birthday = this.formData.birthdayStr;
let params = JSON.parse(JSON.stringify(this.formData)) let params = JSON.parse(JSON.stringify(this.formData))
params.illnessImageUrls = this.$refs.imgComponent ? [...this.$refs.imgComponent.setNewArr()] : [] params.illnessImageUrls = this.$refs.imgComponent ? [...this.$refs.imgComponent.setNewArr()] : []
...@@ -565,8 +567,11 @@ export default { ...@@ -565,8 +567,11 @@ export default {
if (!params.diagnoseAdvice) { if (!params.diagnoseAdvice) {
params.diagnoseAdvice = this.oldDiagnoseAdvice params.diagnoseAdvice = this.oldDiagnoseAdvice
} }
this.loading = true
this.btnDisable = true
this.POST(url, params).then(res => { this.POST(url, params).then(res => {
this.loading = false this.loading = false
this.btnDisable = false
if (res.code == "000000") { if (res.code == "000000") {
this.$message.success('保存成功'); this.$message.success('保存成功');
this.$router.back() this.$router.back()
...@@ -576,6 +581,9 @@ export default { ...@@ -576,6 +581,9 @@ export default {
type: "error" type: "error"
}) })
} }
}).catch(() => {
this.btnDisable = false
this.loading = false
}); });
return return
if (valid) { if (valid) {
......
...@@ -369,6 +369,9 @@ export default { ...@@ -369,6 +369,9 @@ export default {
} }
} }
}, },
activated() {
this.search()
},
created() { created() {
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册