commit
3c72344828
|
@ -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',
|
||||||
|
})
|
||||||
|
}
|
|
@ -76,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,
|
||||||
|
|
|
@ -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', name)
|
// commit('SET_NAME', name)
|
||||||
commit('SET_AVATAR', username)
|
// 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 }) {
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-button :loading="loading" type="primary" style="width:30%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
|
<el-button :loading="loading" type="primary" style="width:30%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
|
||||||
<el-button :loading="loading" type="primary" style="width:30%;margin-bottom:30px;" @click="dialogFormVisible = true">注册</el-button>
|
<el-button type="primary" style="width:30%;margin-bottom:30px;" @click="dialogFormVisible = true">注册</el-button>
|
||||||
<el-button :loading="loading" type="primary" style="width:30%;margin-bottom:30px;" @click="From = true">找回密码</el-button>
|
<el-button type="primary" style="width:30%;margin-bottom:30px;" @click="From = true">找回密码</el-button>
|
||||||
<div class="tips">
|
<div class="tips">
|
||||||
<span style="margin-right:20px;">username: admin</span>
|
<span style="margin-right:20px;">username: admin</span>
|
||||||
<span> password: any</span>
|
<span> password: any</span>
|
||||||
|
|
|
@ -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