Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
a3cdeb529f | |
|
3c72344828 | |
|
458483bc1c | |
|
bbb56b7ca8 |
|
@ -0,0 +1,39 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function sel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/case/cases',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function insert(data) {
|
||||||
|
return request({
|
||||||
|
url: '/case/case',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updatee(data) {
|
||||||
|
return request({
|
||||||
|
url: '/case/case',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function dele(data) {
|
||||||
|
return request({
|
||||||
|
url: '/case/case/' + data,
|
||||||
|
method: 'Delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function sele(data) {
|
||||||
|
return request({
|
||||||
|
url: '/case/sele/' + data,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function List(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/list',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addAdd2(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/add',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function updAll(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/upd',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function delAll(manageId) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/del?manageId='+manageId,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,11 +1,10 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Router from 'vue-router'
|
import Router from 'vue-router'
|
||||||
|
|
||||||
Vue.use(Router)
|
|
||||||
|
|
||||||
/* Layout */
|
/* Layout */
|
||||||
import Layout from '@/layout'
|
import Layout from '@/layout'
|
||||||
|
|
||||||
|
Vue.use(Router)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: sub-menu only appear when route children.length >= 1
|
* Note: sub-menu only appear when route children.length >= 1
|
||||||
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
|
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
|
||||||
|
@ -77,6 +76,19 @@ export const constantRoutes = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/manage',
|
||||||
|
component: Layout,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index',
|
||||||
|
name: '疾病管理',
|
||||||
|
component: () => import('@/views/manage/index'),
|
||||||
|
meta: { title: '疾病管理', icon: 'el-icon-platform-eleme' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/form',
|
path: '/form',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
@ -114,6 +126,18 @@ export const constantRoutes = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/case',
|
||||||
|
component: Layout,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index',
|
||||||
|
name: 'Form',
|
||||||
|
component: () => import('@/views/case/index'),
|
||||||
|
meta: { title: '病例信息', icon: 'form' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/nested',
|
path: '/nested',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|
|
@ -43,26 +43,26 @@ const actions = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// get user info
|
// // get user info
|
||||||
getInfo({ commit, state }) {
|
// getInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
// return new Promise((resolve, reject) => {
|
||||||
getInfo(state.token).then(response => {
|
// getInfo(state.token).then(response => {
|
||||||
const { data } = response
|
// const { data } = response
|
||||||
|
//
|
||||||
if (!data) {
|
// if (!data) {
|
||||||
return reject('Verification failed, please Login again.')
|
// return reject('Verification failed, please Login again.')
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
const { username, avatar } = data
|
// const { username, avatar } = data
|
||||||
|
//
|
||||||
commit('SET_NAME', username)
|
// commit('SET_NAME', name)
|
||||||
commit('SET_AVATAR', avatar)
|
// commit('SET_AVATAR', username)
|
||||||
resolve(data)
|
// resolve(data)
|
||||||
}).catch(error => {
|
// }).catch(error => {
|
||||||
reject(error)
|
// reject(error)
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
|
|
||||||
// user logout
|
// user logout
|
||||||
logout({ commit, state }) {
|
logout({ commit, state }) {
|
||||||
|
|
|
@ -0,0 +1,157 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<template>
|
||||||
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
<el-table-column label="病例ID" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.caseId }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="病名" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.caseName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="得病时间" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.caseTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="病情详情" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.caseMessage }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" @click="handleEdit(scope.row.caseId)">编辑</el-button>
|
||||||
|
<el-button size="mini" type="danger" @click="handleDelete(scope.row.caseId)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
<el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="centerDialogVisible"
|
||||||
|
width="30%"
|
||||||
|
center>
|
||||||
|
<span>
|
||||||
|
<el-form ref="form" :model="aaa" label-width="80px">
|
||||||
|
<el-form-item label="病例ID">
|
||||||
|
<el-input v-model="aaa.caseId"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="病名">
|
||||||
|
<el-input v-model="aaa.caseName"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="得病时间">
|
||||||
|
<el-input v-model="aaa.caseTime"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="病情详情">
|
||||||
|
<el-input v-model="aaa.caseMessage"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</span>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {dele, sel, sele, updatee} from "@/api/cases";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
pageSize: 3,
|
||||||
|
pageNum: 1
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
table: [],
|
||||||
|
centerDialogVisible: false,
|
||||||
|
aaa: {
|
||||||
|
caseId: '',
|
||||||
|
caseName: '',
|
||||||
|
caseTime: '',
|
||||||
|
caseMessage: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
onSubmit(){
|
||||||
|
updatee(this.aaa).then(res=>{
|
||||||
|
this.$message.success("成功")
|
||||||
|
window.location.reload()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
show() {
|
||||||
|
sel(this.form).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.tableData = res.data.list
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleEdit(id) {
|
||||||
|
sele(id).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.aaa = res.data
|
||||||
|
})
|
||||||
|
this.centerDialogVisible = true
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
dele(id).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
window.location.reload()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.show()
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,204 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<el-button type="primary" @click="addAll">添加病史人</el-button>
|
||||||
|
|
||||||
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
|
||||||
|
<el-table-column label="id" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.manageId }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="病史名称" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.caseName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="病史详情" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.caseMessage }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="用户" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.username }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="日期" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.caseTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="handleEdit(scope.row)">修改病史人</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.manageId)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form :model="manage">
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="病史id" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="manage.caseId" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="addAll1">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog :title="title1" :visible.sync="dialogFormVisible1">
|
||||||
|
<el-form :model="manage">
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="病史id" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="manage.caseId" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="病史名称" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="manage.caseName" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="病史详情" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="manage.caseMessage" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="用户" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="manage.id" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="updAll">修改病史人</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import { addAdd2, delAll, List, updAll } from '@/api/manage'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
tableData:[],
|
||||||
|
manage:{},
|
||||||
|
dialogFormVisible:false,
|
||||||
|
dialogFormVisible1:false,
|
||||||
|
formLabelWidth:'120px',
|
||||||
|
title:'添加病史人',
|
||||||
|
title1:'修改病史人',
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
handleDelete(manageId){
|
||||||
|
delAll(manageId).then(
|
||||||
|
res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.manageList()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
updAll(){
|
||||||
|
updAll(this.manage).then(
|
||||||
|
res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.manageList()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
handleEdit(obj){
|
||||||
|
this.manage=obj
|
||||||
|
this.title='修改病史人'
|
||||||
|
this.dialogFormVisible1=true
|
||||||
|
|
||||||
|
},
|
||||||
|
addAll1(){
|
||||||
|
addAdd2(this.manage).then(
|
||||||
|
res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.manageList()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
addAll(){
|
||||||
|
this.manage={}
|
||||||
|
this.title='添加病史人'
|
||||||
|
this.dialogFormVisible=true
|
||||||
|
},
|
||||||
|
manageList(){
|
||||||
|
List().then(
|
||||||
|
res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.$message.success(res.msg)
|
||||||
|
this.tableData=res.data
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.manageList()
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in New Issue