Browse Source

数据源管理、组织管理

newMaster
1747191978@qq.com 4 months ago
parent
commit
ee05b77f71
  1. 14
      acupuncture-后台/src/api/medicalFile.js
  2. 66
      acupuncture-后台/src/api/member.js
  3. 8
      acupuncture-后台/src/api/patientFile.js
  4. 52
      acupuncture-后台/src/router/index.js
  5. 4
      acupuncture-后台/src/store/modules/permission.js
  6. 313
      acupuncture-后台/src/views/member/dataSources.vue
  7. 368
      acupuncture-后台/src/views/member/index.vue

14
acupuncture-后台/src/api/medicalFile.js

@ -3,7 +3,7 @@ import request from "@/utils/request";
// 获取列表
export function treatmentQuery(data) {
return request({
url: "/treatment/list",
url: "/admin/treatment/list",
method: "post",
data: data,
});
@ -11,7 +11,7 @@ export function treatmentQuery(data) {
// 添加患者档案
export function treatmentAdd(data) {
return request({
url: "/treatment/add",
url: "/admin/treatment/add",
method: "post",
data: data,
});
@ -19,7 +19,7 @@ export function treatmentAdd(data) {
// 修改患者档案
export function treatmentUpd(data) {
return request({
url: "/treatment/upd",
url: "/admin/treatment/upd",
method: "post",
data: data,
});
@ -27,7 +27,7 @@ export function treatmentUpd(data) {
// 删除患者档案
export function treatmentDel(data) {
return request({
url: "/treatment/del",
url: "/admin/treatment/del",
method: "post",
data: data,
});
@ -35,14 +35,14 @@ export function treatmentDel(data) {
// 档案详情
export function queryRecord(data) {
return request({
url: "/treatment/queryRecord",
url: "/admin/treatment/queryRecord",
method: "post",
data: data,
});
}// 档案详情
export function saveAidRecord(data) {
return request({
url: "/treatment/saveAidRecord",
url: "/admin/treatment/saveAidRecord",
method: "post",
data: data,
});
@ -51,7 +51,7 @@ export function saveAidRecord(data) {
export function queueAdd(data) {
return request({
url: "/patientQueueRelation/add",
url: "/admin/patientQueueRelation/add",
method: "post",
data: data,
});

66
acupuncture-后台/src/api/member.js

@ -0,0 +1,66 @@
import request from "@/utils/request";
// 获取租户列表
export function tenantsList(data) {
return request({
url: "/tenants/list",
method: "post",
data: data,
});
}
// 新增租户
export function tenantsAdd(data) {
return request({
url: "/tenants/add",
method: "post",
data: data,
});
}
// 修改租户
export function tenantsUpd(data) {
return request({
url: "/tenants/upd",
method: "post",
data: data,
});
}
// 删除租户
export function tenantsDel(data) {
return request({
url: "/tenants/del",
method: "post",
data: data,
});
}
// ------ 数据源 ------
// 获取数据源列表
export function dataSourcesList(data) {
return request({
url: "/dataSources/list",
method: "post",
data: data,
});
}// 新增数据源
export function dataSourcesAdd(data) {
return request({
url: "/dataSources/add",
method: "post",
data: data,
});
}
// 修改数据源
export function dataSourcesUpd(data) {
return request({
url: "/dataSources/upd",
method: "post",
data: data,
});
}
// 删除数据源
export function dataSourcesDel(data) {
return request({
url: "/dataSources/del",
method: "post",
data: data,
});
}

8
acupuncture-后台/src/api/patientFile.js

@ -3,7 +3,7 @@ import request from "@/utils/request";
// 获取列表
export function queryPatient(data) {
return request({
url: "/patient/list",
url: "/admin/patient/list",
method: "post",
data: data,
});
@ -11,7 +11,7 @@ export function queryPatient(data) {
// 添加患者档案
export function patientAdd(data) {
return request({
url: "/patient/add",
url: "/admin/patient/add",
method: "post",
data: data,
});
@ -19,7 +19,7 @@ export function patientAdd(data) {
// 修改患者档案
export function patientUpd(data) {
return request({
url: "/patient/upd",
url: "/admin/patient/upd",
method: "post",
data: data,
});
@ -27,7 +27,7 @@ export function patientUpd(data) {
// 删除患者档案
export function patientDel(data) {
return request({
url: "/patient/del",
url: "/admin/patient/del",
method: "post",
data: data,
});

52
acupuncture-后台/src/router/index.js

@ -74,32 +74,32 @@ export const constantRoutes = [
},
],
},
{
path: "/patientFile",
component: Layout,
redirect: "patientFile",
children: [
{
path: "/patientIndex",
component: () => import("@/views/patientFile/index"),
name: "patientIndex",
meta: { title: "患者档案", icon: "dashboard", },
},
],
},
{
path: "/medicalFile",
component: Layout,
redirect: "medicalFile",
children: [
{
path: "/medicalIndex",
component: () => import("@/views/medicalFile/index"),
name: "medicalIndex",
meta: { title: "诊疗档案", icon: "dashboard", },
},
],
},
// {
// path: "/patientFile",
// component: Layout,
// redirect: "patientFile",
// children: [
// {
// path: "/patientIndex",
// component: () => import("@/views/patientFile/index"),
// name: "patientIndex",
// meta: { title: "患者档案", icon: "dashboard", },
// },
// ],
// },
// {
// path: "/medicalFile",
// component: Layout,
// redirect: "medicalFile",
// children: [
// {
// path: "/medicalIndex",
// component: () => import("@/views/medicalFile/index"),
// name: "medicalIndex",
// meta: { title: "诊疗档案", icon: "dashboard", },
// },
// ],
// },
{
path: "/followFile",
meta: { title: "随访档案", icon: "dashboard", },

4
acupuncture-后台/src/store/modules/permission.js

@ -34,8 +34,8 @@ const permission = {
return new Promise((resolve) => {
// 向后端请求路由数据
getRouters().then((res) => {
const sdata = JSON.parse(JSON.stringify([]));
const rdata = JSON.parse(JSON.stringify([]));
const sdata = JSON.parse(JSON.stringify(res.data));
const rdata = JSON.parse(JSON.stringify(res.data));
const sidebarRoutes = filterAsyncRouter(sdata);
const rewriteRoutes = filterAsyncRouter(rdata, false, true);
const asyncRoutes = filterDynamicRoutes(dynamicRoutes);

313
acupuncture-后台/src/views/member/dataSources.vue

@ -0,0 +1,313 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="80px">
<el-form-item label="数据源key" prop="dataSourceKey">
<el-input v-model="queryParams.param.dataSourceKey" placeholder="请输入" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
@click="handleDelete">删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange" max-height="600">
<el-table-column type="selection" width="55" align="center" />
<el-table-column fixed label="类型" align="center" prop="name" min-width="100" >
<template slot-scope="scope">
<span v-if="scope.row.type == 0">MySQL</span>
<span v-if="scope.row.type == 1">Oracle</span>
</template>
</el-table-column>
<el-table-column fixed label="连接信息" align="center" prop="url" show-overflow-tooltip
min-width="100">
</el-table-column>
<el-table-column fixed label="数据源kye" align="center" prop="dataSourceKey" show-overflow-tooltip
min-width="80" />
<el-table-column label="创建人/创建时间" align="center" min-width="140">
<template slot-scope="scope">
<div>{{scope.row.createBy}}</div>
<span>
{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}
</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
@click="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改公告对话框 -->
<el-dialog class="popup" :title="title" :visible.sync="open" width="780px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="140px" class="formStep">
<el-form-item label="类型" prop="type">
<el-radio-group v-model="form.type">
<el-radio label="0">MySQL</el-radio>
<el-radio label="1">Oracle</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="连接信息" prop="url">
<el-input v-model="form.url" placeholder="请输入" />
</el-form-item>
<el-form-item label="数据源key" prop="dataSourceKey">
<el-input v-model="form.dataSourceKey" placeholder="请输入" />
</el-form-item>
<el-form-item label="用户名" prop="username">
<el-input v-model="form.username" placeholder="请输入" />
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password" placeholder="请输入" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
dataSourcesList,
dataSourcesAdd,
dataSourcesUpd,
dataSourcesDel
} from "@/api/member";
export default {
name: "Notice",
dicts: ["sys_normal_disable", "sys_user_sex"],
data() {
return {
dataSourceList: [],
queryParams:{
param:{
name: "",
}
},
listData:[],
title:'',
open: false,
total:0,
form:{},
loading:false,
showSearch:true,
multiple: false,
//
rules: {
type: [{
required: true,
message: "类型不能为空",
trigger: "blur",
}],
url: [{
required: true,
message: "连接信息不能为空",
trigger: "blur",
}],
dataSourceKey: [{
required: true,
message: "数据源key不能为空",
trigger: "blur",
}],
username: [{
required: true,
message: "用户名不能为空",
trigger: "blur",
}],
password: [{
required: true,
message: "密码不能为空",
trigger: "blur",
}],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询公告列表 */
getList() {
this.loading = true;
dataSourcesList(this.queryParams).then((res) => {
this.listData = res.data.list;
this.total = res.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
"name": "",
"leader": "",
"contactPhone": "",
"dataSourceId": '',
"status": "",
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.param = {
name: "",
};
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增诊疗档案";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.open = true;
this.title = "修改诊疗档案";
this.form = JSON.parse(JSON.stringify(row))
},
/** 诊疗档案 */
submitForm: function() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
dataSourcesUpd(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
dataSourcesAdd(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const idList = row.id ? [row.id] : this.ids;
this.$modal
.confirm("是否确认删除当前选择的数据?")
.then(function() {
return dataSourcesDel({
idList: idList,
});
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
},
};
</script>
<style scoped src="@/assets/styles/common.css"></style>
<style scoped>
.div-title1 {
font-size: 22px;
font-weight: bold;
margin-bottom: 10px;
}
.div-title2 {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.div-title3 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.span-but {
display: inline-block;
border-radius: 4px;
border: 1px solid #dcdfe6;
line-height: 32px;
padding: 0 15px;
margin: 5px;
}
.span-but-active {
border: 1px solid #1890ff;
}
.human-body {
display: flex;
flex-wrap: wrap;
}
.human-body>>>.el-form-item {
width: 49%;
margin-right: 2%;
}
.human-body>>>.el-form-item:nth-of-type(2n) {
margin-right: 0;
}
.formStep1>>>.el-form-item__label {}
.form-item-zd {
width: 100%;
text-align: left;
}
.form-item-age {
display: flex;
align-items: center;
}
.form-item-age span {
margin: 0 10px;
}
.form-item-age>>>.el-input {
width: 100px;
}
>>>.el-drawer.rtl {
width: 50% !important;
}
</style>

368
acupuncture-后台/src/views/member/index.vue

@ -0,0 +1,368 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="80px">
<el-form-item label="组织名称" prop="name">
<el-input v-model="queryParams.param.name" placeholder="请输入" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
@click="handleDelete">删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange" max-height="600">
<el-table-column type="selection" width="55" align="center" />
<el-table-column fixed label="组织名称" align="center" prop="name" min-width="100" />
<el-table-column fixed label="联系电话" align="center" prop="contactPhone" show-overflow-tooltip
min-width="100">
</el-table-column>
<el-table-column fixed label="数据源" align="center" prop="dataSourceKey" show-overflow-tooltip
min-width="80" />
<el-table-column label="状态" align="center" show-overflow-tooltip min-width="100">
<template slot-scope="scope" v-if="scope.row.status != null">
<span v-if="scope.row.status == 0" style="color: #67C23A">启用</span>
<span v-if="scope.row.status == 1" style="color: #F56C6C">禁用</span>
</template>
</el-table-column>
<el-table-column label="创建人/创建时间" align="center" min-width="140">
<template slot-scope="scope">
<div>{{scope.row.createBy}}</div>
<span>
{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}
</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
@click="handleUpdate(scope.row)" :disabled="scope.row.id == 1 || scope.row.id == 2">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete"
@click="handleDelete(scope.row)" :disabled="scope.row.id == 1 || scope.row.id == 2">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改公告对话框 -->
<el-dialog class="popup" :title="title" :visible.sync="open" width="780px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="140px" class="formStep">
<el-form-item label="组织名称" prop="name">
<el-input v-model="form.name" placeholder="请输入" />
</el-form-item>
<el-form-item label="组织负责人" prop="leader">
<el-input v-model="form.leader" placeholder="请输入" />
</el-form-item>
<el-form-item label="联系电话" prop="contactPhone">
<el-input v-model="form.contactPhone" placeholder="请输入" />
</el-form-item>
<el-form-item label="数据源" prop="dataSourceId">
<el-select v-model="form.dataSourceId" placeholder="请选择">
<el-option v-for="item in dataSourceList" :key="item.id" :label="item.dataSourceKey"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio :label="0">启用</el-radio>
<el-radio :label="1">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
tenantsList,
tenantsAdd,
tenantsUpd,
tenantsDel,
dataSourcesList
} from "@/api/member";
import {
followupQuery
} from "@/api/followupFile";
export default {
name: "Notice",
dicts: ["sys_normal_disable", "sys_user_sex"],
data() {
return {
dataSourceList: [],
queryParams:{
param:{
name: "",
}
},
listData:[],
title:'',
open: false,
total:0,
form:{},
loading:false,
showSearch:true,
multiple: false,
//
rules: {
code: [{
required: true,
message: "CODE不能为空",
trigger: "blur",
}],
name: [{
required: true,
message: "组织名称不能为空",
trigger: "blur",
}],
leader: [{
required: true,
message: "负责人不能为空",
trigger: "blur",
}],
contactPhone: [{
required: true,
message: "手机号码不能为空",
trigger: "blur"
}, {
pattern: /^1[3456789]\d{9}$/,
message: '手机号码格式不正确',
trigger: 'blur'
}],
dataSourceId: [{
required: true,
message: "数据源不能为空",
trigger: "change",
}],
status: [{
required: true,
message: "状态不能为空",
trigger: "blur",
}],
},
};
},
created() {
let idCard = this.$route.query.idCard;
this.queryParams.param.keywords = idCard || "";
this.getList();
this.getDataSource();
},
methods: {
//
getDataSource() {
dataSourcesList({
pageNum: -1,
param: {},
}).then((res) => {
this.dataSourceList = res.data.list;
});
},
/** 查询公告列表 */
getList() {
this.loading = true;
tenantsList(this.queryParams).then((res) => {
this.listData = res.data.list;
this.total = res.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
"name": "",
"leader": "",
"contactPhone": "",
"dataSourceId": '',
"status": "",
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.param = {
name: "",
};
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增诊疗档案";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.open = true;
this.title = "修改诊疗档案";
this.form = JSON.parse(JSON.stringify(row))
},
/** 诊疗档案 */
submitForm: function() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
tenantsUpd(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
tenantsAdd(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const idList = row.id ? [row.id] : this.ids;
this.$modal
.confirm("是否确认删除当前选择的数据?")
.then(function() {
return tenantsDel({
idList: idList,
});
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download1(
"/treatment/exportTreatment", {
...this.queryParams.params,
},
`诊疗档案.xlsx`
);
},
/** 下载按钮操作 */
handleDownload() {
window.open(
`${process.env.VUE_APP_API_QZURL}/acupuncture/profile/TreamentTemplate.xlsx`
);
// this.download1(
// "/patient/export", {},
// `.xlsx`
// );
},
/** 导入按钮操作 */
handleImport() {
this.fileList = [];
this.importOpen = true;
},
},
};
</script>
<style scoped src="@/assets/styles/common.css"></style>
<style scoped>
.div-title1 {
font-size: 22px;
font-weight: bold;
margin-bottom: 10px;
}
.div-title2 {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.div-title3 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.span-but {
display: inline-block;
border-radius: 4px;
border: 1px solid #dcdfe6;
line-height: 32px;
padding: 0 15px;
margin: 5px;
}
.span-but-active {
border: 1px solid #1890ff;
}
.human-body {
display: flex;
flex-wrap: wrap;
}
.human-body>>>.el-form-item {
width: 49%;
margin-right: 2%;
}
.human-body>>>.el-form-item:nth-of-type(2n) {
margin-right: 0;
}
.formStep1>>>.el-form-item__label {}
.form-item-zd {
width: 100%;
text-align: left;
}
.form-item-age {
display: flex;
align-items: center;
}
.form-item-age span {
margin: 0 10px;
}
.form-item-age>>>.el-input {
width: 100px;
}
>>>.el-drawer.rtl {
width: 50% !important;
}
</style>
Loading…
Cancel
Save