mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-23 20:44:58 +08:00
修改更改
This commit is contained in:
parent
147e82c394
commit
3524a8bfb3
|
@ -14,7 +14,7 @@
|
|||
"crypto-js": "^4.2.0",
|
||||
"echarts": "^5.4.1",
|
||||
"element-china-area-data": "^6.1.0",
|
||||
"element-plus": "2.7.2",
|
||||
"element-plus": "2.7.3",
|
||||
"js-cookie": "^3.0.5",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.1.7",
|
||||
|
|
|
@ -4,6 +4,7 @@ const dictUrl = "/admin/dict";
|
|||
const dictPageUrl = "/admin/dict/tree";
|
||||
const dictItemUrl = "/admin/dict/item";
|
||||
const dictItemPageUrl = "/admin/dict/item/page";
|
||||
const dictListByTypeUrl = "/admin/dict/type";
|
||||
|
||||
export function dictPage(current: number, size: number, name?: string) {
|
||||
return new Promise(resolve => {
|
||||
|
@ -96,4 +97,14 @@ export function deleteDictItem(id: string): Promise<any> {
|
|||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getDictListByType(type: string): Promise<any> {
|
||||
return new Promise<any>(resolve => {
|
||||
request.get(dictListByTypeUrl + "/" + type).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
|
@ -10,6 +10,8 @@ const updateHospitalUrl = "/admin/hospital/updateHospital";
|
|||
const getHospitalManagerUrl = "/admin/hospital/getHospitalManager";
|
||||
const changeHospitalUrl = "/admin/hospital/changeHospital";
|
||||
const getCurrentHospitalUrl = "/admin/hospital/getCurrentHospital";
|
||||
const getCountByCityUrl = "/admin/hospital/getCountByCity";
|
||||
const getCountByProvinceUrl = "/admin/hospital/getCountByProvince";
|
||||
|
||||
export const getHospitalList = () => {
|
||||
return new Promise(resolve => {
|
||||
|
@ -45,7 +47,7 @@ export function saveHospital(hospital: any) {
|
|||
})
|
||||
}
|
||||
|
||||
export function getHospitalPage(current: number, size: number, name?: string) {
|
||||
export function getHospitalPage(current: number, size: number, name?: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getHospitalPageUrl, {
|
||||
offset: current,
|
||||
|
@ -119,4 +121,24 @@ export function getCurrentHospital() {
|
|||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getCountByProvince(): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.post(getCountByProvinceUrl).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getCountByCity(province: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getCountByCityUrl, {province}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
|
@ -2,9 +2,14 @@ import request from "@/utils/request";
|
|||
|
||||
const getDatabaseListUrl = "/admin/medicine/getDatabaseList";
|
||||
const getSurgeryCountUrl = "/admin/medicine/getSurgeryCount";
|
||||
const getSurgeryCountMUrl = "/admin/medicine/getSurgeryCountM"
|
||||
const getSurgeryDurationUrl = "/admin/medicine/getSurgeryDuration";
|
||||
const getSurgeryDurationMUrl = "/admin/medicine/getSurgeryDurationM"
|
||||
const getSurgeryTypeProportionUrl = "/admin/medicine/getSurgeryTypeProportion";
|
||||
const getSurgeryTypeProportionMUrl = "/admin/medicine/getSurgeryTypeProportionM"
|
||||
const getSurgeryOtherDurationUrl = "/admin/medicine/getSurgeryOtherDuration";
|
||||
const getSurgeryOtherDurationMUrl = "/admin/medicine/getSurgeryOtherDurationM"
|
||||
|
||||
|
||||
export function getDatabaseList() {
|
||||
return new Promise(resolve => {
|
||||
|
@ -26,6 +31,16 @@ export function getSurgeryCount(start: string, end: string): Promise<any> {
|
|||
})
|
||||
}
|
||||
|
||||
export function getSurgeryCountM(startTime: string, endTime: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryCountMUrl, {startTime, endTime}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getSurgeryDuration(start: string, end: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryDurationUrl, {start, end}).then(res => {
|
||||
|
@ -36,6 +51,16 @@ export function getSurgeryDuration(start: string, end: string): Promise<any> {
|
|||
})
|
||||
}
|
||||
|
||||
export function getSurgeryDurationM(startTime: string, endTime: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryDurationMUrl, {startTime, endTime}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getSurgeryTypeProportion(start: string, end: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryTypeProportionUrl, {start, end}).then(res => {
|
||||
|
@ -46,6 +71,16 @@ export function getSurgeryTypeProportion(start: string, end: string): Promise<an
|
|||
})
|
||||
}
|
||||
|
||||
export function getSurgeryTypeProportionM(startTime: string, endTime: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryTypeProportionMUrl, {startTime, endTime}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getSurgeryOtherDuration(start: string, end: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryOtherDurationUrl, {start, end}).then(res => {
|
||||
|
@ -54,4 +89,14 @@ export function getSurgeryOtherDuration(start: string, end: string): Promise<any
|
|||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getSurgeryOtherDurationM(startTime: string, endTime: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryOtherDurationMUrl, {startTime, endTime}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
const patientInfoUrl = "/admin/medicine/getPatientInfo";
|
||||
const getPatientPageUrl = "/admin/medicine/getPatientPage";
|
||||
const getPatientSurgeryListUrl = "/admin/medicine/getPatientSurgeryList";
|
||||
const getSurgeryTableDataUrl = "/admin/medicine/getSurgeryTableData";
|
||||
|
||||
export function getPatientInfo(name: string, id: string, date: string) {
|
||||
export function getPatientInfo(name: string, id: string, date: string): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.postForm(patientInfoUrl, {
|
||||
patientName: name,
|
||||
|
@ -14,4 +17,41 @@ export function getPatientInfo(name: string, id: string, date: string) {
|
|||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function getPatientPage(params: {
|
||||
offset: number,
|
||||
limit: number,
|
||||
name?: string,
|
||||
dept?: string
|
||||
}): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getPatientPageUrl, params).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getPatientSurgeryList(name: string, code: string, surgery: string, type: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getPatientSurgeryListUrl, { name, code, surgery, type }).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getSurgeryTableData(name: string, code: string, date: string, table: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getSurgeryTableDataUrl, {
|
||||
name, code, date, table
|
||||
}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
219
src/api/user.ts
219
src/api/user.ts
|
@ -1,4 +1,4 @@
|
|||
import request, {CommonHeaderEnum, getData, postData} from "@/utils/request";
|
||||
import request, { CommonHeaderEnum, getData, postData } from "@/utils/request";
|
||||
|
||||
const userInfoUrl = '/admin/user/info'
|
||||
|
||||
|
@ -8,124 +8,163 @@ const editPasswordUrl = '/admin/user/password'
|
|||
|
||||
const userPageUrl = '/admin/user/page'
|
||||
|
||||
const userListUrl = "/admin/user/list"
|
||||
|
||||
const userUrl = '/admin/user'
|
||||
|
||||
const modifyPwUrl = "/admin/user/modifyPw"
|
||||
|
||||
const getUserListByHospitalUrl = "/admin/user/getUserListByHospital";
|
||||
|
||||
const getUserCountUrl = "/admin/user/getUserCount";
|
||||
|
||||
const getCountByDateUrl = "/admin/user/getCountByDate";
|
||||
|
||||
export function getUserInfo() {
|
||||
return new Promise(resolve => {
|
||||
getData(userInfoUrl).then((data: any) => {
|
||||
resolve(data.data)
|
||||
})
|
||||
})
|
||||
return new Promise(resolve => {
|
||||
getData(userInfoUrl).then((data: any) => {
|
||||
resolve(data.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUserInfo(data: any) {
|
||||
return new Promise(resolve => {
|
||||
request.request({
|
||||
url: editUserUrl,
|
||||
method: 'put',
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
})
|
||||
})
|
||||
return new Promise(resolve => {
|
||||
request.request({
|
||||
url: editUserUrl,
|
||||
method: 'put',
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function editPassword(data: any) {
|
||||
return new Promise(resolve => {
|
||||
request.request({
|
||||
url: editPasswordUrl,
|
||||
method: "PUT",
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
return new Promise(resolve => {
|
||||
request.request({
|
||||
url: editPasswordUrl,
|
||||
method: "PUT",
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function userPage(data: any) {
|
||||
return new Promise(resolve => {
|
||||
request({
|
||||
url: userPageUrl,
|
||||
method: "post",
|
||||
headers: {
|
||||
'Content-Type': CommonHeaderEnum.FORM_CONTENT_TYPE
|
||||
},
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
})
|
||||
return new Promise(resolve => {
|
||||
request({
|
||||
url: userPageUrl,
|
||||
method: "post",
|
||||
headers: {
|
||||
'Content-Type': CommonHeaderEnum.FORM_CONTENT_TYPE
|
||||
},
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function userList(data: any): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(userListUrl, data)
|
||||
.then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function addUser(data: any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
postData(userUrl, data).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
postData(userUrl, data).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function modifyPw(data: any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: modifyPwUrl,
|
||||
method: "post",
|
||||
headers: {
|
||||
'Content-Type': CommonHeaderEnum.FORM_CONTENT_TYPE
|
||||
},
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: modifyPwUrl,
|
||||
method: "post",
|
||||
headers: {
|
||||
'Content-Type': CommonHeaderEnum.FORM_CONTENT_TYPE
|
||||
},
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUI(data: any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: userUrl,
|
||||
method: "put",
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: userUrl,
|
||||
method: "put",
|
||||
data
|
||||
}).then((res: any) => {
|
||||
resolve(res.data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteU(ids: any[]) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: userUrl,
|
||||
method: "delete",
|
||||
data: ids
|
||||
}).then((res: any) => {
|
||||
resolve(true)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: userUrl,
|
||||
method: "delete",
|
||||
data: ids
|
||||
}).then((res: any) => {
|
||||
resolve(true)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserListByHospital(hospitalId: string) {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getUserListByHospitalUrl, {hospitalId}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err);
|
||||
})
|
||||
})
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getUserListByHospitalUrl, { hospitalId }).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserCount(): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.post(getUserCountUrl).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getCountByDate(startTime: string, endTime: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
request.postForm(getCountByDateUrl, {
|
||||
startTime, endTime
|
||||
}).then(res => {
|
||||
resolve(res.data)
|
||||
}).catch(err => {
|
||||
resolve(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ export const useUserStore = defineStore('login', {
|
|||
return new Promise(resolve => {
|
||||
if (this.userInfo.menuPathList.paths.length == 0) {
|
||||
getUserMenu().then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
if (res && res.code == 0) {
|
||||
const paths: any = [];
|
||||
const menus: any = [];
|
||||
res.data.forEach((item: any) => {
|
||||
|
|
|
@ -119,17 +119,29 @@ const getData = (date: any) => {
|
|||
let num = 0
|
||||
const start = new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth(), 1)
|
||||
const end = new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth() + 1, 0)
|
||||
medicineApi.getSurgeryCount(dateFormater("yyyy-MM-dd", start), dateFormater("yyyy-MM-dd", end)).then(res => {
|
||||
medicineApi.getSurgeryCountM(dateFormater("yyyy-MM-dd", start), dateFormater("yyyy-MM-dd", end)).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.forEach((item: any) => {
|
||||
xData.push(item.time)
|
||||
const time = "" + new Date(item.date).getDate()
|
||||
xData.push(time.padStart(2, "0"))
|
||||
data.push(item.count)
|
||||
num += item.count
|
||||
num += Number(item.count)
|
||||
})
|
||||
total.value = num
|
||||
}
|
||||
initChart({xData, data})
|
||||
})
|
||||
// medicineApi.getSurgeryCount(dateFormater("yyyy-MM-dd", start), dateFormater("yyyy-MM-dd", end)).then(res => {
|
||||
// if (res.code == 0) {
|
||||
// res.data.forEach((item: any) => {
|
||||
// xData.push(item.time)
|
||||
// data.push(item.count)
|
||||
// num += item.count
|
||||
// })
|
||||
// total.value = num
|
||||
// }
|
||||
// initChart({xData, data})
|
||||
// })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<div class="date-btn text-color">
|
||||
<div class="btn-box">
|
||||
<el-icon @click="getData(upMonth)">
|
||||
<ArrowLeft/>
|
||||
<ArrowLeft />
|
||||
</el-icon>
|
||||
<el-date-picker v-model="currentMonth" format="YYYY年MM月" type="month" :editable="false" :clearable="false"
|
||||
@change="getData"/>
|
||||
@change="getData" />
|
||||
<el-icon @click="getData(downMonth)">
|
||||
<ArrowRight/>
|
||||
<ArrowRight />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -20,11 +20,11 @@
|
|||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import {onMounted, ref} from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import * as echarts from 'echarts';
|
||||
import * as medicineApi from '@/api/medicine'
|
||||
import {dateFormater, getWeekDates} from "@/utils/date-util";
|
||||
import {generateRandomColor} from "@/utils/other";
|
||||
import { dateFormater, getWeekDates } from "@/utils/date-util";
|
||||
import { generateRandomColor } from "@/utils/other";
|
||||
|
||||
const chartDom = ref()
|
||||
|
||||
|
@ -94,22 +94,38 @@ const getData = (date: any) => {
|
|||
|
||||
const start = dateFormater("yyyy-MM-dd", new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth(), 1))
|
||||
const end = dateFormater("yyyy-MM-dd", new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth() + 1, 0))
|
||||
medicineApi.getSurgeryTypeProportion(start, end).then(res => {
|
||||
medicineApi.getSurgeryTypeProportionM(start, end).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.forEach((item: any, i: number) => {
|
||||
const c = generateRandomColor()
|
||||
color.push(c)
|
||||
pieData.value.push({
|
||||
value: item.count,
|
||||
name: item._id,
|
||||
name: item.surgeryType,
|
||||
itemStyle: {
|
||||
color: c
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
initChart({data: pieData.value, color})
|
||||
});
|
||||
initChart({ data: pieData.value, color })
|
||||
})
|
||||
// medicineApi.getSurgeryTypeProportion(start, end).then(res => {
|
||||
// if (res.code == 0) {
|
||||
// res.data.forEach((item: any, i: number) => {
|
||||
// const c = generateRandomColor()
|
||||
// color.push(c)
|
||||
// pieData.value.push({
|
||||
// value: item.count,
|
||||
// name: item._id,
|
||||
// itemStyle: {
|
||||
// color: c
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
// initChart({ data: pieData.value, color })
|
||||
// })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -137,7 +153,7 @@ const getData = (date: any) => {
|
|||
align-items: center;
|
||||
color: $text2-color;
|
||||
|
||||
& > :deep(.el-date-editor) {
|
||||
&> :deep(.el-date-editor) {
|
||||
font-size: 14px;
|
||||
|
||||
.el-input__wrapper {
|
||||
|
@ -186,4 +202,5 @@ const getData = (date: any) => {
|
|||
padding: 5px 0;
|
||||
}
|
||||
}
|
||||
}</style>
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -139,16 +139,26 @@ const getData = (date: any) => {
|
|||
const weekDates = getWeekDates(currentMonth.value)
|
||||
const start = dateFormater("yyyy-MM-dd", weekDates.start)
|
||||
const end = dateFormater("yyyy-MM-dd", weekDates.end.setDate(weekDates.end.getDate() + 1))
|
||||
medicineApi.getSurgeryOtherDuration(start, end).then(res => {
|
||||
medicineApi.getSurgeryOtherDurationM(start, end).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.forEach((item: any) => {
|
||||
xData.push(new Date(item._id))
|
||||
data[0].push(item.aicount)
|
||||
data[1].push(item.doccount)
|
||||
xData.push(new Date(item.date))
|
||||
data[0].push(Number(item.aicount))
|
||||
data[1].push(Number(item.doccount))
|
||||
})
|
||||
}
|
||||
initChart({dataName, xData, data})
|
||||
})
|
||||
// medicineApi.getSurgeryOtherDuration(start, end).then(res => {
|
||||
// if (res.code == 0) {
|
||||
// res.data.forEach((item: any) => {
|
||||
// xData.push(new Date(item._id))
|
||||
// data[0].push(item.aicount)
|
||||
// data[1].push(item.doccount)
|
||||
// })
|
||||
// }
|
||||
// initChart({dataName, xData, data})
|
||||
// })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -113,20 +113,37 @@ const getData = (date: any) => {
|
|||
|
||||
const start = dateFormater("yyyy-MM-dd", new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth(), 1))
|
||||
const end = dateFormater("yyyy-MM-dd", new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth() + 1, 0))
|
||||
medicineApi.getSurgeryDuration(start, end).then(res => {
|
||||
|
||||
medicineApi.getSurgeryDurationM(start, end).then(res => {
|
||||
const xData: any = []
|
||||
const data: any = []
|
||||
let num = 0
|
||||
if (res.code == 0) {
|
||||
res.data.forEach((item: any) => {
|
||||
xData.push(item._id)
|
||||
const time = new Date(item.date).getDate() + ""
|
||||
xData.push(time.padStart(2, "0"))
|
||||
data.push(item.duration)
|
||||
num += item.duration
|
||||
num += Number(item.duration)
|
||||
})
|
||||
}
|
||||
total.value = Number(num.toFixed(1))
|
||||
initChart({xData, data})
|
||||
})
|
||||
|
||||
// medicineApi.getSurgeryDuration(start, end).then(res => {
|
||||
// const xData: any = []
|
||||
// const data: any = []
|
||||
// let num = 0
|
||||
// if (res.code == 0) {
|
||||
// res.data.forEach((item: any) => {
|
||||
// xData.push(item._id)
|
||||
// data.push(item.duration)
|
||||
// num += item.duration
|
||||
// })
|
||||
// }
|
||||
// total.value = Number(num.toFixed(1))
|
||||
// initChart({xData, data})
|
||||
// })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -2,19 +2,15 @@
|
|||
<div class="week-calendar-part">
|
||||
<div class="header-box">
|
||||
<el-icon @click="minusWeek()">
|
||||
<ArrowLeft/>
|
||||
<ArrowLeft />
|
||||
</el-icon>
|
||||
<div class="date-block">
|
||||
<span @click="handleDatePickerOpen">{{ getMonthTitle() }}</span>
|
||||
<el-date-picker ref="datePickerRef"
|
||||
popper-class="week-calendar-picker"
|
||||
class="month-date-pick"
|
||||
v-model="month"
|
||||
type="month"
|
||||
@change="setMonthWeek()"/>
|
||||
<el-date-picker ref="datePickerRef" popper-class="week-calendar-picker" class="month-date-pick"
|
||||
v-model="month" type="month" @change="setMonthWeek()" />
|
||||
</div>
|
||||
<el-icon @click="addWeek()">
|
||||
<ArrowRight/>
|
||||
<ArrowRight />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="week-box">
|
||||
|
@ -23,14 +19,14 @@
|
|||
<th v-for="item in weekCn" :key="item">{{ item }}</th>
|
||||
</tr>
|
||||
<tr v-if="week.length > 0" class="">
|
||||
<td v-for="item in week" :key="item"
|
||||
:class="{
|
||||
'record-mark': recordWeek.some((r: any) => r == dateFormater('yyyy-MM-dd', item)),
|
||||
'active':
|
||||
dateFormater('yyyy-MM-dd', item) == dateFormater('yyyy-MM-dd', currentDate)}">
|
||||
<span :class="{
|
||||
'text2-color': item.getDate() > week[6].getDate()
|
||||
}" @click="setDate(item)">{{ dateFormater('dd', item) }}</span>
|
||||
<td v-for="item in week" :key="item" :class="{
|
||||
'record-mark': recordWeek.some((r: any) => r == dateFormater('yyyy-MM-dd', item)),
|
||||
'active':
|
||||
dateFormater('yyyy-MM-dd', item) == dateFormater('yyyy-MM-dd', currentDate)
|
||||
}">
|
||||
<span :class="{
|
||||
'text2-color': item.getDate() > week[6].getDate()
|
||||
}" @click="setDate(item)">{{ dateFormater('dd', item) }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -38,35 +34,35 @@
|
|||
<el-button text icon="Plus" style="width: 100%;margin-bottom: 5px;" @click="addRecord()">新建</el-button>
|
||||
<div class="record-box ">
|
||||
<el-empty v-if="record.length < 1" :description="dateFormater('MM月dd日', currentDate) + '没有任何记录'"
|
||||
style="padding: 0;"/>
|
||||
style="padding: 0;" />
|
||||
<div class="record-item" v-for="(item, index) in record" :key="'record-' + index" @click="viewRecord(item)">
|
||||
<div class="icon-box">
|
||||
<i class="icon-RectangleCopy"></i>
|
||||
</div>
|
||||
<div class="text-box">
|
||||
<p class="main-color" style="font-weight: 600;cursor: pointer;">{{
|
||||
item.title
|
||||
}}</p>
|
||||
item.title
|
||||
}}</p>
|
||||
<p p class=" text2-color font14">{{ item.date + " " + item.time }}</p>
|
||||
</div>
|
||||
<el-icon class="remove-icon" @click.stop="remoteRecord(item, index)">
|
||||
<Close/>
|
||||
<Close />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="isRecordDialog" title="详情">
|
||||
<RecordForm ref="recordFormRef" @remove-event="planRemoveEvent" @close="isRecordDialog = false"
|
||||
@saveData="saveData"/>
|
||||
@saveData="saveData" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import {onMounted, ref} from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import RecordForm from './record-form.vue'
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {dateFormater, getDays, getFirstDayOfWeek} from '@/utils/date-util'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { dateFormater, getDays, getFirstDayOfWeek } from '@/utils/date-util'
|
||||
import * as dailyPlanApi from "@/api/daily-plan";
|
||||
|
||||
const monthCn = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
|
||||
|
@ -126,10 +122,10 @@ function getWeekPlanList(startDate: any, endDate: any) {
|
|||
recordWeek.value = [];
|
||||
dailyPlanApi.getPlanDateList(dateFormater("yyyy-MM-dd", startDate),
|
||||
dateFormater("yyyy-MM-dd", endDate)).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
recordWeek.value = res.data;
|
||||
}
|
||||
});
|
||||
if (res.code == 0) {
|
||||
recordWeek.value = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const handleDatePickerOpen = () => {
|
||||
|
@ -214,7 +210,7 @@ const planRemoveEvent = () => {
|
|||
.date-block {
|
||||
position: relative;
|
||||
|
||||
& > span {
|
||||
&>span {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,193 +1,189 @@
|
|||
<template>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="60" :disabled="type === 'view'">
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入姓名"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住院号" prop="code" :label-width="rightWidth">
|
||||
<el-input v-model="formData.code" placeholder="请输入住院号" :disabled="type === 'edit'"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio label="男">男</el-radio>
|
||||
<el-radio label="女">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="科室" prop="dept" :label-width="rightWidth">
|
||||
<el-select v-model="formData.dept" placeholder="请选择科室">
|
||||
<el-option v-for="item in getDeptData()" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身高" prop="bodyHeight">
|
||||
<el-input v-model="formData.bodyHeight" placeholder="请输入身高"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="有无病史" prop="isMedicalHistory" :label-width="rightWidth">
|
||||
<el-radio-group v-model="formData.isMedicalHistory">
|
||||
<el-radio label="无">无</el-radio>
|
||||
<el-radio label="有">有</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体重" prop="bodyWeight">
|
||||
<el-input v-model="formData.bodyWeight" placeholder="请输入体重"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="病史名称" prop="medicalHistoryName" :label-width="rightWidth">
|
||||
<el-input v-model="formData.medicalHistoryName" placeholder="请输入病史"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input v-model="formData.age" placeholder="请输入年龄"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="过敏史名称" prop="allergyHistoryName" :label-width="rightWidth">
|
||||
<el-input v-model="formData.allergyHistoryName" placeholder="请输入过敏史"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="formData.phone" placeholder="请输入电话"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住院时间" prop="hospitalTime" :label-width="rightWidth">
|
||||
<el-date-picker v-model="formData.hospitalTime" type="date" placeholder="请输入住院时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="60" :disabled="type === 'view'">
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="姓名">
|
||||
<el-input v-model="formData.姓名" readonly placeholder="请输入姓名"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住院号" prop="住院号" :label-width="rightWidth">
|
||||
<el-input v-model="formData.住院号" readonly placeholder="请输入住院号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="性别">
|
||||
<el-input v-model="formData.性别" readonly placeholder="请输入住院号" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="科室" prop="科室" :label-width="rightWidth">
|
||||
<el-input v-model="formData.科室" readonly placeholder="请输入住院号" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身高" prop="身高">
|
||||
<el-input v-model="formData.身高" readonly placeholder="请输入身高"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="有无病史" prop="有无病史" :label-width="rightWidth">
|
||||
<el-input v-model="formData.有无病史" readonly placeholder="请输入身高"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="体重" prop="体重">
|
||||
<el-input v-model="formData.体重" readonly placeholder="请输入体重"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="病史名称" prop="病史名称" :label-width="rightWidth">
|
||||
<el-input v-model="formData.病史名称" readonly placeholder="请输入病史"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年龄" prop="年龄">
|
||||
<el-input v-model="formData.年龄" readonly placeholder="请输入年龄"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="过敏史名称" prop="过敏史名称" :label-width="rightWidth">
|
||||
<el-input v-model="formData.过敏史名称" readonly placeholder="请输入过敏史"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="电话">
|
||||
<el-input v-model="formData.电话" readonly placeholder="请输入电话"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住院时间" prop="住院时间" :label-width="rightWidth">
|
||||
<el-input v-model="formData.住院时间" readonly placeholder="请输入住院时间"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div v-if="type === 'add'" style="text-align: right;">
|
||||
<el-button class="f18" @click="close">取消</el-button>
|
||||
<el-button class="f18" type="primary" @click="saveData">确认</el-button>
|
||||
</div>
|
||||
<div v-else-if="type === 'edit'" style="text-align: right;">
|
||||
<el-button class="f18" @click="close">取消</el-button>
|
||||
<el-button class="f18" type="primary" @click="saveData">更新</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<!-- <div v-if="type === 'add'" style="text-align: right;">
|
||||
<el-button class="f18" @click="close">取消</el-button>
|
||||
<el-button class="f18" type="primary" @click="saveData">确认</el-button>
|
||||
</div>-->
|
||||
<!-- <div v-else-if="type === 'edit'" style="text-align: right;">-->
|
||||
<div style="text-align: right;">
|
||||
<el-button class="f18" @click="close">取消</el-button>
|
||||
<!-- <el-button class="f18" type="primary" @click="saveData">更新</el-button>-->
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getDeptData } from '@/static-data/core'
|
||||
import {onMounted, reactive, ref, toRefs, watch} from 'vue'
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {getDeptData} from '@/static-data/core'
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
const props = defineProps({
|
||||
type: String
|
||||
type: String
|
||||
})
|
||||
|
||||
const gutter = 20
|
||||
const rightWidth = 100
|
||||
const rules = reactive({
|
||||
name: [
|
||||
{ required: true, message: '请输入姓名', trigger: ['blur', 'change'] },
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '请输入住院号', trigger: ['blur', 'change'] },
|
||||
],
|
||||
dept: [
|
||||
{ required: true, message: '请选择科室', trigger: ['blur', 'change'] },
|
||||
],
|
||||
hospitalTime: [
|
||||
{ required: true, message: '请输入住院时间', trigger: ['blur', 'change'] },
|
||||
],
|
||||
name: [
|
||||
{required: true, message: '请输入姓名', trigger: ['blur', 'change']},
|
||||
],
|
||||
code: [
|
||||
{required: true, message: '请输入住院号', trigger: ['blur', 'change']},
|
||||
],
|
||||
dept: [
|
||||
{required: true, message: '请选择科室', trigger: ['blur', 'change']},
|
||||
],
|
||||
hospitalTime: [
|
||||
{required: true, message: '请输入住院时间', trigger: ['blur', 'change']},
|
||||
],
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
const formData = ref({
|
||||
id: '',
|
||||
userName: '',
|
||||
name: '',
|
||||
role: '',
|
||||
mailbox: '',
|
||||
phone: '',
|
||||
enable: true,
|
||||
id: '',
|
||||
userName: '',
|
||||
name: '',
|
||||
role: '',
|
||||
mailbox: '',
|
||||
phone: '',
|
||||
enable: true,
|
||||
} as any)
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
resetData()
|
||||
resetData()
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
formData,
|
||||
resetData,
|
||||
formData,
|
||||
resetData,
|
||||
})
|
||||
|
||||
function close() {
|
||||
emit('close')
|
||||
emit('close')
|
||||
}
|
||||
|
||||
function resetData() {
|
||||
formRef.value.resetFields()
|
||||
formData.value = {
|
||||
id: '',
|
||||
name: '',
|
||||
code: '',
|
||||
sex: '',
|
||||
dept: '',
|
||||
bodyHeight: '',
|
||||
isMedicalHistory: '',
|
||||
bodyWeight: '',
|
||||
medicalHistoryName: '',
|
||||
age: '',
|
||||
allergyHistoryName: '',
|
||||
phone: '',
|
||||
hospitalTime: ''
|
||||
}
|
||||
formRef.value.resetFields()
|
||||
formData.value = {
|
||||
id: '',
|
||||
name: '',
|
||||
code: '',
|
||||
sex: '',
|
||||
dept: '',
|
||||
bodyHeight: '',
|
||||
isMedicalHistory: '',
|
||||
bodyWeight: '',
|
||||
medicalHistoryName: '',
|
||||
age: '',
|
||||
allergyHistoryName: '',
|
||||
phone: '',
|
||||
hospitalTime: ''
|
||||
}
|
||||
}
|
||||
|
||||
const saveData = async () => {
|
||||
await formRef.value.validate((valid: any, fields: any) => {
|
||||
if (valid) {
|
||||
ElMessage.success('保存成功!')
|
||||
close()
|
||||
} else {
|
||||
// console.log('error submit!', fields)
|
||||
}
|
||||
})
|
||||
await formRef.value.validate((valid: any, fields: any) => {
|
||||
if (valid) {
|
||||
ElMessage.success('保存成功!')
|
||||
close()
|
||||
} else {
|
||||
// console.log('error submit!', fields)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
:deep(.el-form-item) {
|
||||
.el-form-item__label {
|
||||
display: block;
|
||||
text-align: justify;
|
||||
text-align-last: justify;
|
||||
// padding: 0 10px 0 20px;
|
||||
.el-form-item__label {
|
||||
display: block;
|
||||
text-align: justify;
|
||||
text-align-last: justify;
|
||||
// padding: 0 10px 0 20px;
|
||||
|
||||
&:before {
|
||||
display: none;
|
||||
}
|
||||
&:before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-row>.el-col.el-col-12:first-of-type {
|
||||
padding: 0 30px 0 30px !important;
|
||||
|
||||
.el-row > .el-col.el-col-12:first-of-type {
|
||||
padding: 0 30px 0 30px !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import type { MenuItem } from '@/utils/public-interface'
|
||||
import {ref} from 'vue'
|
||||
import type {MenuItem} from '@/utils/public-interface'
|
||||
import CommonMenu from '@/components/common-menu.vue'
|
||||
import PageTabs from '@/components/page-tabs.vue'
|
||||
|
||||
|
|
|
@ -1,77 +1,77 @@
|
|||
<template>
|
||||
<div class="table-page">
|
||||
<div class="search-part" v-show="isSearch">
|
||||
<div class="search-cell">
|
||||
<span class="label">患者姓名</span>
|
||||
<el-input v-model="queryParams.name" placeholder="请输入患者姓名"></el-input>
|
||||
</div>
|
||||
<div class="search-cell">
|
||||
<span class="label">科室名</span>
|
||||
<el-select v-model="queryParams.dept" placeholder="请选择科室名">
|
||||
<el-option v-for="item in getDeptData()" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button type="primary" icon="Search" @click="queryData(queryParams)">查询</el-button>
|
||||
<el-button icon="Refresh" @click="queryParams = {}">重置</el-button>
|
||||
</div>
|
||||
<div class="button-part" style="justify-content: space-between;">
|
||||
<div>
|
||||
<!-- <el-button type="primary" icon="FirstAidKit" @click="addData">新增</el-button>-->
|
||||
<el-button icon="FirstAidKit" @click="importData">导入</el-button>
|
||||
<el-button icon="Delete" @click="removeData()">删除</el-button>
|
||||
</div>
|
||||
<TableAbility @searchBtn="isSearch = !isSearch" @refreshBtn="queryData({})"
|
||||
@downloadBtn="exportData('患者信息', tableData)"></TableAbility>
|
||||
</div>
|
||||
<div class="table-part">
|
||||
<el-table ref="tableRef" v-loading="loading" :data="tableData" height="100%" border show-overflow-tooltip
|
||||
@row-click="tableRowClick">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="#" width="55" align="center" />
|
||||
<el-table-column property="code" label="住院号" width="120" align="center" />
|
||||
<el-table-column property="name" label="姓名" width="120" align="center" />
|
||||
<el-table-column label="手机号" width="220" align="center">
|
||||
<template #default="scope">{{ scope.row.phone.slice(0, 3) + '****' + scope.row.phone.slice(7)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="dept" label="科室" width="160" align="center" />
|
||||
<el-table-column property="doctor" label="主诊医生" width="160" align="center" />
|
||||
<el-table-column label="手术数据" header-align="center">
|
||||
<template #default="scope">
|
||||
<span @click.stop style="padding: 0 50px;">
|
||||
<el-button v-if="scope.row.userInfo" type="primary" round
|
||||
@click="viewUserInfo(scope.row)">个人信息</el-button>
|
||||
<el-button v-if="scope.row.surgeryInfo" type="primary" round
|
||||
@click="viewSurgeryInfo(scope.row)">手术信息</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination-part">
|
||||
<CommonPagination :total="100" @paginationChange="paginationChange" />
|
||||
</div>
|
||||
<div class="table-page">
|
||||
<div class="search-part" v-show="isSearch">
|
||||
<div class="search-cell">
|
||||
<span class="label">患者姓名</span>
|
||||
<el-input v-model="queryParams.name" placeholder="请输入患者姓名"></el-input>
|
||||
</div>
|
||||
<div class="search-cell">
|
||||
<span class="label">科室名</span>
|
||||
<el-select style="min-width: 120px;" v-model="queryParams.dept" placeholder="请选择科室名">
|
||||
<el-option v-for="item in deptList" :key="item.label" :label="item.label" :value="item.label"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button type="primary" icon="Search" @click="queryData()">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetSearch">重置</el-button>
|
||||
</div>
|
||||
<el-dialog v-model="isFormDialog" :title="formDialogTitle" width="40%">
|
||||
<PatientsForm ref="patientsFormRef" :type="formDialogTitle === '增加患者' ? 'add' : 'edit'"
|
||||
@close="isFormDialog = false" />
|
||||
</el-dialog>
|
||||
<ImportDialog ref="importDialogRef" title="患者导入" templateUrl="#" importUrl="#" />
|
||||
<div class="button-part" style="justify-content: space-between;">
|
||||
<div>
|
||||
<!-- <el-button type="primary" icon="FirstAidKit" @click="addData">新增</el-button>-->
|
||||
<!-- <el-button icon="FirstAidKit" @click="importData">导入</el-button>
|
||||
<el-button icon="Delete" @click="removeData()">删除</el-button>-->
|
||||
</div>
|
||||
<TableAbility @searchBtn="isSearch = !isSearch" @refreshBtn="queryData()"
|
||||
@downloadBtn="exportData('患者信息', tableData)"></TableAbility>
|
||||
</div>
|
||||
<div class="table-part">
|
||||
<el-table ref="tableRef" v-loading="loading" :data="tableData" height="100%" border show-overflow-tooltip
|
||||
@row-click="tableRowClick">
|
||||
<!-- <el-table-column type="selection" width="55"/>-->
|
||||
<el-table-column type="index" label="#" width="55" align="center"/>
|
||||
<el-table-column property="住院号" label="住院号" width="120" align="center"/>
|
||||
<el-table-column property="姓名" label="姓名" width="120" align="center"/>
|
||||
<el-table-column label="手机号" width="220" align="center">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.电话">{{
|
||||
scope.row.电话.slice(0, 3) + '****' + scope.row.电话.slice(7)
|
||||
}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="科室" label="科室" width="160" align="center"/>
|
||||
<!-- <el-table-column property="doctor" label="主诊医生" width="160" align="center"/>-->
|
||||
<el-table-column label="手术数据" header-align="center">
|
||||
<template #default="scope">
|
||||
<span @click.stop style="padding: 0 50px;">
|
||||
<el-button type="primary" round
|
||||
@click="viewUserInfo(scope.row)">个人信息</el-button>
|
||||
<el-button type="primary" round
|
||||
@click="viewSurgeryInfo(scope.row)">手术信息</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination-part">
|
||||
<CommonPagination :total="total" @paginationChange="paginationChange"/>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="isFormDialog" :title="formDialogTitle" width="40%">
|
||||
<PatientsForm ref="patientsFormRef" @close="isFormDialog = false"/>
|
||||
</el-dialog>
|
||||
<!--<ImportDialog ref="importDialogRef" title="患者导入" templateUrl="#" importUrl="#" />-->
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { tableRemoveRow, exportData } from '@/utils/table-util'
|
||||
import {ref, onMounted} from 'vue'
|
||||
import {useRouter} from 'vue-router'
|
||||
import {exportData, tableRemoveRow} from '@/utils/table-util'
|
||||
import CommonPagination from '@/components/common-pagination.vue'
|
||||
import PatientsForm from './form/patients-form.vue'
|
||||
import ImportDialog from '@/components/import-dialog.vue'
|
||||
import { getDeptData } from '@/static-data/core'
|
||||
import * as patientApi from "@/api/patient";
|
||||
import PatientsForm from "@/views/patients-manage/form/patients-form.vue";
|
||||
import {getDictListByType} from "@/api/dict";
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const tableRef = ref()
|
||||
const patientsFormRef = ref()
|
||||
const importDialogRef = ref()
|
||||
|
@ -84,68 +84,105 @@ const queryParams = ref({
|
|||
dept: ''
|
||||
} as any)
|
||||
const tableData = ref([] as any)
|
||||
let current = 0
|
||||
let size = 10
|
||||
const total = ref(0)
|
||||
const deptList = ref([] as any)
|
||||
|
||||
queryData({ name: '测试', dept: getDeptData()[0].label })
|
||||
onMounted(() => {
|
||||
current = 0
|
||||
total.value = 0
|
||||
queryParams.value = {
|
||||
name: '',
|
||||
dept: ''
|
||||
}
|
||||
getDeptList()
|
||||
queryData()
|
||||
})
|
||||
|
||||
function queryData(e: any) {
|
||||
loading.value = true
|
||||
tableData.value = []
|
||||
setTimeout(() => {
|
||||
while (tableData.value.length < 10) {
|
||||
tableData.value.push({
|
||||
code: '123456', // 住院号
|
||||
name: e.name || '测试',
|
||||
phone: '12312345678',
|
||||
dept: e.dept || '测试',
|
||||
doctor: '张医生',
|
||||
userInfo: Boolean(tableData.value.length < 2),
|
||||
surgeryInfo: Boolean(tableData.value.length < 1)
|
||||
|
||||
})
|
||||
}
|
||||
loading.value = false
|
||||
}, 200);
|
||||
function resetSearch() {
|
||||
queryParams.value = {
|
||||
name: '',
|
||||
dept: ''
|
||||
}
|
||||
queryData()
|
||||
}
|
||||
|
||||
const addData = () => {
|
||||
isFormDialog.value = true
|
||||
formDialogTitle.value = '增加患者'
|
||||
setTimeout(() => {
|
||||
patientsFormRef.value.resetData()
|
||||
}, 0)
|
||||
function queryData() {
|
||||
loading.value = true
|
||||
current = 0
|
||||
total.value = 0
|
||||
tableData.value = []
|
||||
getList()
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
function getList() {
|
||||
patientApi.getPatientPage({
|
||||
limit: size,
|
||||
offset: current,
|
||||
name: queryParams.value.name,
|
||||
dept: queryParams.value.dept
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
total.value = res.data.total
|
||||
tableData.value = res.data.records
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/*const addData = () => {
|
||||
isFormDialog.value = true
|
||||
formDialogTitle.value = '增加患者'
|
||||
setTimeout(() => {
|
||||
patientsFormRef.value.resetData()
|
||||
}, 0)
|
||||
}*/
|
||||
|
||||
const importData = () => {
|
||||
setTimeout(() => {
|
||||
importDialogRef.value.open()
|
||||
}, 0);
|
||||
setTimeout(() => {
|
||||
importDialogRef.value.open()
|
||||
}, 0);
|
||||
}
|
||||
const removeData = (e?: any) => {
|
||||
const selectRow = e || tableRef.value.getSelectionRows()
|
||||
tableRemoveRow({ data: selectRow }, (res: boolean) => {
|
||||
if (res) {
|
||||
// console.log('调用删除', selectRow)
|
||||
}
|
||||
})
|
||||
const selectRow = e || tableRef.value.getSelectionRows()
|
||||
tableRemoveRow({data: selectRow}, (res: boolean) => {
|
||||
if (res) {
|
||||
// console.log('调用删除', selectRow)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const viewUserInfo = (e: any) => {
|
||||
isFormDialog.value = true
|
||||
formDialogTitle.value = '个人信息'
|
||||
setTimeout(() => {
|
||||
patientsFormRef.value.resetData()
|
||||
patientsFormRef.value.formData = JSON.parse(JSON.stringify(e))
|
||||
}, 0)
|
||||
isFormDialog.value = true
|
||||
formDialogTitle.value = '个人信息'
|
||||
setTimeout(() => {
|
||||
patientsFormRef.value.resetData()
|
||||
patientsFormRef.value.formData = JSON.parse(JSON.stringify(e))
|
||||
}, 0)
|
||||
}
|
||||
const viewSurgeryInfo = (e: any) => {
|
||||
router.push({
|
||||
path: '/patients-manage/surgery-info',
|
||||
query: e
|
||||
})
|
||||
router.push({
|
||||
path: '/patients-manage/surgery-info',
|
||||
query: e
|
||||
})
|
||||
}
|
||||
const tableRowClick = (row: any) => {
|
||||
tableRef.value.toggleRowSelection(row)
|
||||
tableRef.value.toggleRowSelection(row)
|
||||
}
|
||||
const paginationChange = (page: number, s: number) => {
|
||||
current = page
|
||||
size = s
|
||||
getList()
|
||||
}
|
||||
const paginationChange = (page: number, size: number) => {
|
||||
|
||||
function getDeptList() {
|
||||
deptList.value = []
|
||||
getDictListByType("sys_dept").then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
deptList.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -3,17 +3,24 @@
|
|||
<div class="header-box">
|
||||
<h3 class="f18">电子病史</h3>
|
||||
<div class="btn-box">
|
||||
<TableAbility :isDownload="tableData && tableData.length > 0" @searchBtn="isSearch = !isSearch" @refreshBtn="queryData(queryParams)"
|
||||
@downloadBtn="exportMultiData('电子病史', tableData, 'startTime', 'data')"></TableAbility>
|
||||
<TableAbility :isDownload="tableData && tableData.length > 0" @searchBtn="isSearch = !isSearch"
|
||||
@refreshBtn="queryData(queryParams)"
|
||||
|
||||
@downloadBtn="exportMultiData('电子病史', tableData, 'startTime', 'data')">
|
||||
</TableAbility>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-box" v-show="isSearch">
|
||||
<div class="search-cell">
|
||||
<span class="label">姓名</span>
|
||||
<el-select v-model="queryParams.name" popper-class="custom-patients-option" filterable placeholder="请选择(可搜索)"
|
||||
remote :remote-method="remoteSearchName" @change="selectNameChange">
|
||||
<el-option v-for="(item, index) in patientsOption.slice(0, 999)" :key="'name-' + index"
|
||||
:label="item.name" :value="item.code" />
|
||||
<el-select v-model="queryParams.name" popper-class="custom-patients-option" filterable
|
||||
|
||||
placeholder="请选择(可搜索)"
|
||||
style="min-width: 211px;" remote :remote-method="remoteSearchName">
|
||||
<el-option v-for="(item, index) in patientsOption" @click="selectNameChange(item)"
|
||||
|
||||
:key="'name-' + index"
|
||||
:label="item.姓名" :value="item.住院号"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="search-cell">
|
||||
|
@ -22,7 +29,7 @@
|
|||
</div>
|
||||
<div class="search-cell">
|
||||
<span class="label">性别</span>
|
||||
<el-select v-model="queryParams.sex">
|
||||
<el-select v-model="queryParams.sex" @change="genderChange" clearable style="min-width: 60px;">
|
||||
<el-option label="男" value="男"></el-option>
|
||||
<el-option label="女" value="女"></el-option>
|
||||
</el-select>
|
||||
|
@ -33,9 +40,10 @@
|
|||
</div>
|
||||
<div class="search-cell">
|
||||
<span class="label">麻醉方式</span>
|
||||
<el-select v-model="queryParams.narcotismWay">
|
||||
<el-option v-for="item in getNarcotismWay()" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
<el-select v-model="queryParams.narcotismWay" clearable style="min-width: 230px;">
|
||||
<el-option v-for="item in narcotismWay" :key="item.value" :label="item.label"
|
||||
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button type="primary" icon="Search" @click="queryData(queryParams)">查询</el-button>
|
||||
|
@ -46,35 +54,48 @@
|
|||
<ul class="list-box">
|
||||
<li class="list-item" v-for="(item, index) in tableData" :key="'time-' + index"
|
||||
:class="{ 'active': timeActive === index }" @click="selectTime(item, index)">
|
||||
<b>{{ dateFormater('yyyy.MM.dd', item.startTime) }}</b>{{ dateFormater(' HH:mm:ss', item.startTime)
|
||||
<b>{{ dateFormater('yyyy.MM.dd', item.Time) }}</b>{{
|
||||
dateFormater(' HH:mm:ss', item.Time)
|
||||
}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right-box">
|
||||
|
||||
<div class="type-box">
|
||||
<div class="type-item text-row-1" v-for="(item, index) in getFormTypes().slice(0, 6)" :key="'type-' + index"
|
||||
:class="{ 'active': item.name === queryParams.type }" @click="formTypeChange(item.name)">{{
|
||||
item.name
|
||||
}}</div>
|
||||
<div class="type-item text-row-1" v-for="(item, index) in surgeryTable.slice(0, 6)"
|
||||
|
||||
:key="'type-' + index"
|
||||
:class="{ 'active': item.value === queryParams.type }" @click="formTypeChange(item.value)">{{
|
||||
item.label
|
||||
}}
|
||||
</div>
|
||||
<div class="type-item" v-for="(item, index) in customFormTypes" :key="'custom-type-' + index"
|
||||
:class="{ 'active': item.name === queryParams.type }" @click="customFormTypeChange(item, index)">
|
||||
<span class="text-row-1">{{ item.name || '+' }}</span>
|
||||
<el-icon v-if="item.name" @click.stop="removeCustomFormType(index)">
|
||||
<Close />
|
||||
:class="{ 'active': item.value === queryParams.type }"
|
||||
|
||||
@click="customFormTypeChange(item, index)">
|
||||
<span class="text-row-1">{{ item.label || '+' }}</span>
|
||||
<el-icon v-if="item.label" @click.stop="removeCustomFormType(index)">
|
||||
<Close/>
|
||||
</el-icon>
|
||||
</div>
|
||||
<el-select v-model="queryParams.type" filterable placeholder="搜索更多表单" @change="formTypeChange">
|
||||
<el-option v-for="(item, index) in getFormTypes()" :key="'type-option-' + index" :label="item.name"
|
||||
:value="item.name"></el-option>
|
||||
<el-select v-model="queryParams.type" filterable placeholder="搜索更多表单"
|
||||
|
||||
@change="formTypeChange">
|
||||
<el-option v-for="(item, index) in surgeryTable" :key="'type-option-' + index"
|
||||
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table class="custom-table" :data="tableData[timeActive]?.data" border height="100%"
|
||||
:cell-class-name="tableCellFilter">
|
||||
<el-table-column v-for="item in tableData[timeActive]?.dataKey" :key="item" :prop="item"
|
||||
:label="item" align="center" />
|
||||
</el-table>
|
||||
|
||||
<div @scroll="tableScroll" ref="tableContainerRef" class="table-box">
|
||||
<table class="list-box">
|
||||
<thead ref="listHeaderRef">
|
||||
</thead>
|
||||
<tbody ref="tableListRef"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -82,90 +103,192 @@
|
|||
|
||||
<el-dialog v-model="selectFormTypesDialog" title="请选择表单" width="400px">
|
||||
<el-select :model-value="queryParams.type" filterable placeholder="搜索更多表单" @change="addFormType">
|
||||
<el-option v-for="(item, index) in getFormTypes()" :key="'type-option-' + index" :label="item.name"
|
||||
:value="item.name"></el-option>
|
||||
<el-option v-for="(item, index) in surgeryTable" :key="'type-option-' + index" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { exportMultiData } from '@/utils/table-util'
|
||||
import { dateFormater } from '@/utils/date-util'
|
||||
import { getPatients, getNarcotismWay, getFormTypes, getDataAlarmState } from '@/static-data/core'
|
||||
import {getDictListByType} from "@/api/dict"
|
||||
import * as patientApi from "@/api/patient"
|
||||
import {getDataAlarmState} from '@/static-data/core'
|
||||
import {dateFormater} from '@/utils/date-util'
|
||||
import {exportMultiData} from '@/utils/table-util'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {onMounted, ref} from 'vue'
|
||||
import {useRoute} from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const patients = getPatients()
|
||||
|
||||
const selectFormTypesDialog = ref()
|
||||
const isSearch = ref(true)
|
||||
const queryParams = ref({} as any)
|
||||
const timeActive = ref<number>(0)
|
||||
const timeActive = ref(0)
|
||||
const customFormTypes = ref([] as any)
|
||||
const customFormTypeIndex = ref<number>()
|
||||
const customFormTypeIndex = ref()
|
||||
const tableData = ref([] as any)
|
||||
const patientsOption = ref([] as any)
|
||||
const narcotismWay = ref([] as any)
|
||||
const surgeryTable = ref([] as any)
|
||||
const tableContainerRef = ref()
|
||||
const tableListRef = ref()
|
||||
const listHeaderRef = ref()
|
||||
let itemTotal = 0
|
||||
const itemHeight = 50
|
||||
let lastScrollLeft = 0;
|
||||
|
||||
queryParams.value = route.query
|
||||
if (queryParams.value.code) queryData(queryParams.value)
|
||||
try {
|
||||
customFormTypes.value = JSON.parse(localStorage.getItem("customFormTypes") || '[]')
|
||||
while (customFormTypes.value.length < 4) {
|
||||
customFormTypes.value.push({})
|
||||
onMounted(() => {
|
||||
init()
|
||||
getAnesthesiaType()
|
||||
getSurgeryTable()
|
||||
})
|
||||
|
||||
function tableScroll(e: any) {
|
||||
if (!(tableContainerRef.value.scrollLeft != lastScrollLeft)) {
|
||||
renderList()
|
||||
}
|
||||
} catch (error) { }
|
||||
}
|
||||
|
||||
function rendHeader() {
|
||||
const tableItem = tableData.value[timeActive.value]
|
||||
if (tableItem && tableItem.dataKey) {
|
||||
const item = document.createElement('tr')
|
||||
item.className = 'row'
|
||||
item.className = 'row title'
|
||||
for (const row of tableItem.dataKey) {
|
||||
const span = document.createElement('th')
|
||||
span.className = 'column'
|
||||
span.innerText = row
|
||||
item.appendChild(span)
|
||||
}
|
||||
listHeaderRef.value.appendChild(item)
|
||||
}
|
||||
}
|
||||
|
||||
function renderList() {
|
||||
tableListRef.value.innerHTML = '';
|
||||
const containerHeight = tableContainerRef.value.clientHeight
|
||||
const scrollTop = tableContainerRef.value.scrollTop
|
||||
|
||||
const startIndex = Math.floor(scrollTop / itemHeight);
|
||||
const endIndex = Math.min(itemTotal - 1, Math.ceil((scrollTop + containerHeight) / itemHeight));
|
||||
|
||||
const tableItem = tableData.value[timeActive.value]
|
||||
const items = [];
|
||||
if (tableItem && tableItem.data) {
|
||||
for (let i = startIndex; i <= endIndex; i++) {
|
||||
const item = document.createElement('tr')
|
||||
item.className = 'row'
|
||||
item.style.top = `${i * itemHeight + itemHeight}px`
|
||||
const rows = Object.assign({}, tableItem.data[i])
|
||||
delete rows._id
|
||||
for (const row in rows) {
|
||||
const span = document.createElement('td')
|
||||
span.className = 'column'
|
||||
span.innerText = rows[row]
|
||||
item.appendChild(span)
|
||||
}
|
||||
items.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
items.forEach(item => tableListRef.value.appendChild(item))
|
||||
|
||||
tableListRef.value.style.height = `${itemTotal * itemHeight}px`;
|
||||
}
|
||||
|
||||
function init() {
|
||||
queryParams.value = {
|
||||
code: route.query["住院号"],
|
||||
name: route.query["姓名"]
|
||||
}
|
||||
if (queryParams.value.code) queryData(queryParams.value)
|
||||
try {
|
||||
customFormTypes.value = JSON.parse(localStorage.getItem("customFormTypes") || '[]')
|
||||
while (customFormTypes.value.length < 4) {
|
||||
customFormTypes.value.push({})
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function queryData(e: any) {
|
||||
async function queryData(e: any) {
|
||||
tableListRef.value.innerHTML = '';
|
||||
tableData.value = []
|
||||
|
||||
if (!e.code) {
|
||||
ElMessage.warning('住院号为必填项!')
|
||||
return
|
||||
}
|
||||
tableData.value = []
|
||||
for (let i = 1; i < 11; i++) {
|
||||
const obj = {
|
||||
startTime: new Date(2023, 11, i, 6),
|
||||
endTime: new Date(2023, 11, i, 10),
|
||||
dataKey: ['ID', 'Phase', 'BIS', 'HR', 'SBP', 'DBP', 'ST', 'TEMP', 'SPO2', 'EtCo2', 'PPG', 'ABG', 'TOF', 'TIME'],
|
||||
data: [] as Array<any>
|
||||
}
|
||||
for (let j = 1; j < 100; j++) {
|
||||
const data = {} as any
|
||||
for (let key of obj.dataKey) {
|
||||
if (key === 'ID') data[key] = j
|
||||
else if (key === 'Phase') data[key] = 2
|
||||
else data[key] = Number((Math.random() * 100).toFixed(2))
|
||||
if (!queryParams.value.type) {
|
||||
ElMessage.warning("请选择手术表单!")
|
||||
return
|
||||
}
|
||||
|
||||
const res: any = await patientApi.getPatientSurgeryList(
|
||||
queryParams.value.name,
|
||||
queryParams.value.code,
|
||||
queryParams.value.surgeryName,
|
||||
queryParams.value.narcotismWay
|
||||
)
|
||||
if (res.code == 0) {
|
||||
tableData.value = res.data;
|
||||
}
|
||||
if (tableData.value.length > 0) {
|
||||
const tableItem = tableData.value[timeActive.value]
|
||||
patientApi.getSurgeryTableData(
|
||||
queryParams.value.name,
|
||||
queryParams.value.code,
|
||||
dateFormater('yyyyMMdd', tableItem.Time),
|
||||
queryParams.value.type
|
||||
).then((res: any) => {
|
||||
if (res.code == 0 && res.data.length > 0) {
|
||||
itemTotal = res.data.length
|
||||
tableItem.data = res.data
|
||||
|
||||
const temp = Object.assign({}, res.data[0])
|
||||
delete temp._id
|
||||
tableItem.dataKey = Object.keys(temp)
|
||||
}
|
||||
obj.data.push(data)
|
||||
}
|
||||
obj.data.reverse()
|
||||
tableData.value.push(obj)
|
||||
rendHeader()
|
||||
renderList()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const remoteSearchName = (e: any) => {
|
||||
if (e) {
|
||||
patientsOption.value = patients.filter((o: any) => o.name.indexOf(e) !== -1)
|
||||
patientApi.getPatientPage({offset: 0, limit: 999, name: e}).then((res: any) => {
|
||||
patientsOption.value = res.data.records;
|
||||
})
|
||||
}
|
||||
}
|
||||
const selectNameChange = (e: string) => {
|
||||
queryParams.value.code = e
|
||||
|
||||
const selectNameChange = (e: any) => {
|
||||
queryParams.value.code = e['住院号']
|
||||
queryParams.value.name = e['姓名']
|
||||
queryParams.value.sex = e['性别']
|
||||
}
|
||||
|
||||
function genderChange() {
|
||||
queryParams.value.code = ''
|
||||
queryParams.value.name = ''
|
||||
}
|
||||
|
||||
const selectTime = (item: any, index: number) => {
|
||||
timeActive.value = index
|
||||
if (queryParams.value) {
|
||||
queryData(queryParams.value)
|
||||
}
|
||||
}
|
||||
const formTypeChange = (e: string) => {
|
||||
// console.log(e)
|
||||
queryParams.value.type = e
|
||||
queryData(queryParams.value)
|
||||
}
|
||||
const customFormTypeChange = (e: any, index: number) => {
|
||||
if (e.name) {
|
||||
formTypeChange(e.name)
|
||||
if (e.value) {
|
||||
formTypeChange(e.value)
|
||||
} else {
|
||||
customFormTypeIndex.value = index
|
||||
selectFormTypesDialog.value = true
|
||||
|
@ -175,16 +298,39 @@ const removeCustomFormType = (index: number) => {
|
|||
customFormTypes.value[index] = {}
|
||||
localStorage.setItem("customFormTypes", JSON.stringify(customFormTypes.value))
|
||||
}
|
||||
const tableCellFilter = ({ row, column, rowIndex, columnIndex }: any) => {
|
||||
const tableCellFilter = ({row, column, rowIndex, columnIndex}: any) => {
|
||||
return 'alarm-' + getDataAlarmState(row[column.label], column.label)
|
||||
}
|
||||
const addFormType = (e: any) => {
|
||||
if (customFormTypeIndex.value !== undefined) {
|
||||
customFormTypes.value[customFormTypeIndex.value] = { name: e }
|
||||
localStorage.setItem("customFormTypes", JSON.stringify(customFormTypes.value))
|
||||
surgeryTable.value.filter((item: any) => {
|
||||
|
||||
return item.value == e
|
||||
|
||||
}).forEach((element: any) => {
|
||||
customFormTypes.value[customFormTypeIndex.value] = element;
|
||||
localStorage.setItem("customFormTypes", JSON.stringify(customFormTypes.value))
|
||||
});
|
||||
}
|
||||
selectFormTypesDialog.value = false
|
||||
}
|
||||
|
||||
function getAnesthesiaType() {
|
||||
narcotismWay.value = [];
|
||||
getDictListByType('sys_anesthesia_type').then(res => {
|
||||
if (res.code == 0) {
|
||||
narcotismWay.value = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getSurgeryTable() {
|
||||
getDictListByType("sys_surgery_table").then(res => {
|
||||
if (res.code == 0) {
|
||||
surgeryTable.value = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
@ -207,7 +353,9 @@ const addFormType = (e: any) => {
|
|||
color: $main-color;
|
||||
}
|
||||
|
||||
.btn-box {}
|
||||
.btn-box {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.search-box {
|
||||
|
@ -216,7 +364,7 @@ const addFormType = (e: any) => {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>*~* {
|
||||
& > * ~ * {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
|
@ -316,6 +464,7 @@ const addFormType = (e: any) => {
|
|||
&.active {
|
||||
background: #c77000;
|
||||
}
|
||||
|
||||
.el-icon {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
|
@ -340,6 +489,50 @@ const addFormType = (e: any) => {
|
|||
.table-box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
|
||||
:deep(.list-box) {
|
||||
position: relative;
|
||||
width: auto;
|
||||
|
||||
thead {
|
||||
color: white;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.row {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
color: black;
|
||||
font-family: '宋体';
|
||||
font-weight: 600;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
|
||||
.column {
|
||||
height: 50px;
|
||||
min-width: 5vw;
|
||||
border: 1px solid #18b2bd;
|
||||
|
||||
&.alarm-min {
|
||||
background-color: #bdd7ef;
|
||||
}
|
||||
|
||||
&.alarm-max {
|
||||
background-color: #f9cbad;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
.column {
|
||||
background-color: $main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table.custom-table) {
|
||||
--el-table-border-color: #18b2bd;
|
||||
|
|
|
@ -157,7 +157,6 @@ const removeData = (e?: any) => {
|
|||
})
|
||||
}
|
||||
const enableChange = (e: any) => {
|
||||
console.log(e)
|
||||
updateUserInfo({
|
||||
username: e.username,
|
||||
lockFlag: e.lockFlag ? '1' : '0'
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import * as echarts from 'echarts'
|
||||
import chinaJson from '@/assets/map/china.json'
|
||||
import chinaJson from '@/assets/map/china.json';
|
||||
import * as echarts from 'echarts';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import * as hospitalApi from "@/api/hospital"
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
|
@ -17,18 +18,32 @@ const props = defineProps({
|
|||
|
||||
const chartDom = ref()
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
const provinceObj = await getProvinceData()
|
||||
const data: any = []
|
||||
chinaJson.features.forEach((item: any) => {
|
||||
data.push({
|
||||
name: item.properties.name,
|
||||
value: Math.ceil(Math.random() * 100),
|
||||
value: provinceObj[item.properties.adcode] ? provinceObj[item.properties.adcode] : 0,
|
||||
adcode: item.properties.adcode
|
||||
})
|
||||
})
|
||||
initMap({data})
|
||||
initMap({ data })
|
||||
})
|
||||
|
||||
async function getProvinceData() {
|
||||
const res = await hospitalApi.getCountByProvince()
|
||||
if (res.code == 0) {
|
||||
const obj: any = {}
|
||||
for (const key of Object.keys(res.data)) {
|
||||
obj[key.padEnd(6, '0')] = res.data[key]
|
||||
}
|
||||
return obj
|
||||
} else {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
function initMap(chartData: any) {
|
||||
const chart = echarts.init(chartDom.value as HTMLElement);
|
||||
chart.clear();
|
||||
|
@ -116,5 +131,4 @@ function initMap(chartData: any) {
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
<div class="total-box">
|
||||
<div class="total-item">
|
||||
<p class="label">本日</p>
|
||||
<p class="value">+ {{ total.day }}</p>
|
||||
<p class="value">+ {{ countMap.todayTotal }}</p>
|
||||
</div>
|
||||
<div class="total-item">
|
||||
<p class="label">本周</p>
|
||||
<p class="value">+ {{ total.week }}</p>
|
||||
<p class="value">+ {{ countMap.weekTotal }}</p>
|
||||
</div>
|
||||
<div class="total-item">
|
||||
<p class="label">本月</p>
|
||||
<p class="value">+ {{ total.month }}</p>
|
||||
<p class="value">+ {{ countMap.monthTotal }}</p>
|
||||
</div>
|
||||
<div class="total-item">
|
||||
<p class="label">本年</p>
|
||||
<p class="value">+ {{ total.year }}</p>
|
||||
<p class="value">+ {{ countMap.yearTotal }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="date-btn text-color">
|
||||
|
@ -37,23 +37,28 @@
|
|||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { dateFormater, getFirstDayOfWeek, getCurrentDate, getDays } from '@/utils/date-util';
|
||||
import { dateFormater, getCurrentDate, getDays, getFirstDayOfWeek } from '@/utils/date-util';
|
||||
import * as userApi from "@/api/user"
|
||||
|
||||
const chartDom = ref()
|
||||
const total = ref({
|
||||
day: 2,
|
||||
week: 8,
|
||||
month: 32,
|
||||
year: 103
|
||||
})
|
||||
const currentMonth = ref(new Date())
|
||||
const countMap = ref({} as any)
|
||||
|
||||
onMounted(() => {
|
||||
getData(new Date())
|
||||
getUserCount()
|
||||
})
|
||||
|
||||
function getUserCount() {
|
||||
userApi.getUserCount().then(res => {
|
||||
if (res.code == 0) {
|
||||
countMap.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function initChart(chartData: any) {
|
||||
const chart = echarts.init(chartDom.value as HTMLElement);
|
||||
chart.clear();
|
||||
|
@ -116,19 +121,36 @@ function initChart(chartData: any) {
|
|||
chart.resize()
|
||||
})
|
||||
}
|
||||
|
||||
const setDate = (type: string) => {
|
||||
getData(getDays(currentMonth.value, type === 'up' ? -7 : 7))
|
||||
}
|
||||
const getData = (date: any) => {
|
||||
currentMonth.value = new Date(date)
|
||||
const dataName = ['新增用户']
|
||||
const xData = []
|
||||
const data = [] as any
|
||||
for (let i = 1; i < 8; i++) {
|
||||
xData.push(getFirstDayOfWeek(date, i))
|
||||
data.push(Math.ceil(Math.random() * 16 + 2))
|
||||
for (let i = 0; i < 7; i++) {
|
||||
xData.push(getFirstDayOfWeek(date, i + 1))
|
||||
}
|
||||
initChart({ dataName, xData, data })
|
||||
|
||||
getWeekCountList(xData, data)
|
||||
}
|
||||
|
||||
function getWeekCountList(xData: any, data: any) {
|
||||
userApi.getCountByDate(dateFormater("yyyy-MM-dd", xData[0]) + " 00:00:00",
|
||||
dateFormater("yyyy-MM-dd", xData[6]) + " 23:59:59").then(res => {
|
||||
if (res.code == 0) {
|
||||
xData.forEach((item: any) => {
|
||||
if (res.data[dateFormater("yyyy-MM-dd", item)]) {
|
||||
data.push(res.data[dateFormater("yyyy-MM-dd", item)])
|
||||
} else {
|
||||
data.push(0)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
initChart({ dataName: ['新增用户'], xData, data })
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -138,9 +160,11 @@ const getData = (date: any) => {
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 20px 40px;
|
||||
|
||||
h3.title {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.total-box {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
|
@ -150,18 +174,22 @@ const getData = (date: any) => {
|
|||
color: $text2-color;
|
||||
font-size: 18px;
|
||||
line-height: 2;
|
||||
|
||||
.total-item {
|
||||
text-align: center;
|
||||
|
||||
.value {
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
color: #00aab7;
|
||||
}
|
||||
|
||||
&:nth-child(odd) .value {
|
||||
color: #f8b300;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.date-btn {
|
||||
position: reactive;
|
||||
width: 100%;
|
||||
|
@ -170,16 +198,18 @@ const getData = (date: any) => {
|
|||
justify-content: space-between;
|
||||
align-items: center;
|
||||
z-index: 1;
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: $text2-color;
|
||||
|
||||
&>:deep(.el-date-editor) {
|
||||
&> :deep(.el-date-editor) {
|
||||
font-size: 14px;
|
||||
|
||||
.el-input__wrapper {
|
||||
|
|
|
@ -188,7 +188,6 @@ const selectNameChange = (e: any) => {
|
|||
manager.value.name = e.name;
|
||||
}
|
||||
const saveData = () => {
|
||||
console.log(formData.value)
|
||||
ElMessageBox.confirm(
|
||||
"是否保存",
|
||||
{
|
||||
|
|
|
@ -10,39 +10,59 @@
|
|||
<li v-for="(item, key) in citys.c">{{ item.n }}:{{ item.t }}所</li>
|
||||
</ul>
|
||||
<ul v-else>
|
||||
<li v-for="(item, key) in chinaCitys" :key="key" @click="getObj(item, key)">{{ item.n }}:{{ item.t }}所</li>
|
||||
<li v-for="(item, key) in chinaCitys" :key="key" @click="getObj(item, key)">{{ item.n }}:{{ item.t }}所
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import AreaCityData from '@/assets/map/area_format_object.json'
|
||||
import MapChart from './chart/map-chart.vue'
|
||||
import CityMapChart from './chart/city-map-chart.vue'
|
||||
import AreaCityData from '@/assets/map/area_format_object.json';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import CityMapChart from './chart/city-map-chart.vue';
|
||||
import MapChart from './chart/map-chart.vue';
|
||||
import * as hospitalApi from "@/api/hospital"
|
||||
|
||||
const cityMapChartRef = ref()
|
||||
const isCityMap = ref(false)
|
||||
const citys = ref<any>()
|
||||
const chinaCitys = ref<any>()
|
||||
|
||||
initChinaCitys()
|
||||
onMounted(() => {
|
||||
initChinaCitys()
|
||||
})
|
||||
|
||||
// 二级城市数据初始化
|
||||
function initChinaCitys() {
|
||||
async function initChinaCitys() {
|
||||
const provinceData = await getProvinceData()
|
||||
const cityData = AreaCityData as any
|
||||
for (let key in cityData) {
|
||||
cityData[key].n = cityNameFormatter(cityData[key].n)
|
||||
cityData[key].t = Math.floor(Math.random() * 30)
|
||||
cityData[key].t = provinceData[key.padEnd(6, '0')] ? provinceData[key.padEnd(6, '0')] : 0
|
||||
}
|
||||
chinaCitys.value = cityData
|
||||
}
|
||||
|
||||
async function getProvinceData() {
|
||||
const res = await hospitalApi.getCountByProvince()
|
||||
if (res.code == 0) {
|
||||
const obj: any = {}
|
||||
for (const key of Object.keys(res.data)) {
|
||||
obj[key] = res.data[key]
|
||||
}
|
||||
return obj
|
||||
} else {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
// 三级城市数据初始化
|
||||
function initCitys(data: any, adcode: string) {
|
||||
async function initCitys(data: any, adcode: string) {
|
||||
const cityData = await getCityData(adcode)
|
||||
data.n = cityNameFormatter(data.n)
|
||||
for (let key in data.c) {
|
||||
data.c[key].t = Math.floor(Math.random() * 10)
|
||||
data.c[key].t = cityData[key] ? cityData[key] : 0
|
||||
}
|
||||
citys.value = data
|
||||
// 显示二级地图
|
||||
|
@ -51,6 +71,20 @@ function initCitys(data: any, adcode: string) {
|
|||
cityMapChartRef.value.setMap(adcode + '0000', data)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
async function getCityData(province: string) {
|
||||
const res = await hospitalApi.getCountByCity(province)
|
||||
if (res.code == 0) {
|
||||
const obj: any = {}
|
||||
for (const key of Object.keys(res.data)) {
|
||||
obj[key] = res.data[key]
|
||||
}
|
||||
return obj
|
||||
} else {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
// 名称格式化
|
||||
function cityNameFormatter(name: string) {
|
||||
if (['北京', '天津', '上海', '重庆'].some((n: string) => n === name)) name = name + '市'
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<div class="left-box">
|
||||
<div class="total-box block-border" @click="router.push('/system-manage/user-list')">
|
||||
<span class="label"><el-icon><UserFilled /></el-icon>用户列表</span>
|
||||
<span class="value">{{ total.user }}</span>
|
||||
<span class="value">{{ countMap.total }}</span>
|
||||
</div>
|
||||
<div class="total-box block-border" @click="router.push('/system-manage/hospitals')">
|
||||
<span class="label"><el-icon><OfficeBuilding /></el-icon>合作医院列表</span>
|
||||
<span class="value">{{ total.hospitals }}</span>
|
||||
<span class="value">{{ hospitalTotal }}</span>
|
||||
</div>
|
||||
<div class="chart-total-box">
|
||||
<div class="title">用户数据统计</div>
|
||||
|
@ -34,19 +34,40 @@
|
|||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import {onMounted, ref} from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import SystemLogs from "@/components/system-logs.vue"
|
||||
import UserChart from './chart/user-chart.vue'
|
||||
import MapChart from './chart/map-chart.vue'
|
||||
import * as userApi from "@/api/user"
|
||||
import { getHospitalPage } from '@/api/hospital'
|
||||
|
||||
const countMap = ref({} as any)
|
||||
const hospitalTotal = ref(0)
|
||||
|
||||
onMounted(() => {
|
||||
getUserCount()
|
||||
getHospitalTotal()
|
||||
})
|
||||
|
||||
function getUserCount() {
|
||||
userApi.getUserCount().then(res => {
|
||||
if (res.code == 0) {
|
||||
countMap.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getHospitalTotal() {
|
||||
getHospitalPage(0, 0).then(res => {
|
||||
if (res.code == 0) {
|
||||
hospitalTotal.value = res.data.total
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const total = {
|
||||
user: 300,
|
||||
hospitals: 29
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
|
|
@ -5,62 +5,74 @@
|
|||
<span class="label">用户名</span>
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名"></el-input>
|
||||
</div>
|
||||
<el-button type="primary" icon="Search" @click="queryData(queryParams)">查询</el-button>
|
||||
<el-button icon="Refresh" @click="queryParams = {}">重置</el-button>
|
||||
<el-button type="primary" icon="Search" @click="searchData">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetSearch">重置</el-button>
|
||||
</div>
|
||||
<div class="button-part" style="justify-content: space-between;">
|
||||
<div></div>
|
||||
<TableAbility :isDownload="false" @searchBtn="isSearch = !isSearch" @refreshBtn="queryData({})"></TableAbility>
|
||||
<TableAbility :isDownload="false" @searchBtn="isSearch = !isSearch" @refreshBtn="init"></TableAbility>
|
||||
</div>
|
||||
<div class="table-part">
|
||||
<el-table ref="tableRef" v-loading="loading" :data="tableData" height="100%" border show-overflow-tooltip
|
||||
:row-class-name="({ row }: any) => !row.enable && 'disable'" @row-click="tableRowClick">
|
||||
<el-table-column type="selection" width="55" />
|
||||
:row-class-name="({ row }: any) => row.lockFlag == 1 && 'disable'" @row-click="tableRowClick">
|
||||
<!--<el-table-column type="selection" width="55"/>-->
|
||||
<el-table-column type="index" label="#" width="55" align="center" />
|
||||
<el-table-column property="hospital" label="医院名称" width="200" align="center" />
|
||||
<!--<el-table-column property="hospital" label="医院名称" width="200" align="center"/>-->
|
||||
<el-table-column property="name" label="姓名" width="120" align="center" />
|
||||
<el-table-column label="手机号" width="220" align="center">
|
||||
<template #default="scope">{{ scope.row.phone.slice(0, 3) + '****' + scope.row.phone.slice(7)
|
||||
}}</template>
|
||||
<template #default="scope">{{
|
||||
scope.row.phone.slice(0, 3) + '****' + scope.row.phone.slice(7)
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="role" label="角色" width="220" align="center" />
|
||||
<el-table-column label="启用" width="120" align="center">
|
||||
<el-table-column label="角色" width="220" align="center">
|
||||
<template #default="scope">
|
||||
<span @click.stop><el-switch v-model="scope.row.enable" @change="enableChange(scope.row)" /></span>
|
||||
<span v-for="(item, index) in scope.row.roleList" :key="index">
|
||||
{{ item.roleName }} {{ (scope.row.roleList.length - 1) == index ? '' : ',' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="锁定" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<span @click.stop>
|
||||
<el-switch v-model="scope.row.lockFlag" @click="enableChange(scope.row)" />
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<span @click.stop>
|
||||
<el-button link icon="RefreshLeft" @click="resetPassword(scope.row)"
|
||||
:disabled="!scope.row.enable">密码</el-button>
|
||||
:disabled="scope.row.lockFlag == 1">密码</el-button>
|
||||
<el-button link icon="EditPen" @click="editData(scope.row)"
|
||||
:disabled="!scope.row.enable">修改</el-button>
|
||||
:disabled="scope.row.lockFlag == 1">修改</el-button>
|
||||
<el-button link icon="Delete" @click="removeData(scope.row)"
|
||||
:disabled="!scope.row.enable">删除</el-button>
|
||||
:disabled="scope.row.lockFlag == 1">删除</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination-part">
|
||||
<CommonPagination :total="100" @paginationChange="paginationChange" />
|
||||
<CommonPagination :total="total" @paginationChange="paginationChange" />
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="isFormDialog" :title="formDialogTitle" width="750px">
|
||||
<UserForm ref="userFormRef" :type="formDialogTitle === '添加' ? 'add' : 'edit'" @close="isFormDialog = false" />
|
||||
<DoctorForm ref="doctorFormRef" :type="formDialogTitle === '添加' ? 'add' : 'edit'" @close="isFormDialog = false"
|
||||
@save="doctorFormSave" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { tableRemoveRow } from '@/utils/table-util'
|
||||
import CommonPagination from '@/components/common-pagination.vue'
|
||||
import UserForm from './form/user-form.vue'
|
||||
import * as userApi from "@/api/user"
|
||||
import DoctorForm from "@/views/permissions-manage/form/doctor-form.vue";
|
||||
|
||||
const tableRef = ref()
|
||||
const userFormRef = ref()
|
||||
const doctorFormRef = ref()
|
||||
const isSearch = ref(true)
|
||||
const loading = ref(true)
|
||||
const isFormDialog = ref(false)
|
||||
|
@ -69,55 +81,117 @@ const queryParams = ref({
|
|||
userName: ''
|
||||
} as any)
|
||||
const tableData = ref([] as any)
|
||||
let current = 0
|
||||
let size = 10
|
||||
const total = ref(0)
|
||||
|
||||
queryData({ userName: '测试' })
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
|
||||
function queryData(e: any) {
|
||||
loading.value = true
|
||||
function init() {
|
||||
current = 0
|
||||
total.value = 0
|
||||
tableData.value = []
|
||||
setTimeout(() => {
|
||||
while (tableData.value.length < 10) {
|
||||
tableData.value.push({
|
||||
hospital: '北京朝阳医院',
|
||||
userName: 'cscs',
|
||||
name: e.userName || '测试',
|
||||
phone: '12312345678',
|
||||
role: '高级管理员',
|
||||
enable: true,
|
||||
})
|
||||
}
|
||||
loading.value = false
|
||||
}, 200);
|
||||
getUseList()
|
||||
}
|
||||
|
||||
function getUseList() {
|
||||
loading.value = true
|
||||
userApi.userList({
|
||||
current,
|
||||
size,
|
||||
name: queryParams.value.userName
|
||||
}).then((res: any) => {
|
||||
loading.value = false
|
||||
total.value = res.data.total
|
||||
tableData.value = res.data.records
|
||||
}).catch(error => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function searchData() {
|
||||
init()
|
||||
}
|
||||
|
||||
function resetSearch() {
|
||||
queryParams.value.userName = ""
|
||||
init()
|
||||
}
|
||||
|
||||
const removeData = (e?: any) => {
|
||||
const selectRow = e || tableRef.value.getSelectionRows()
|
||||
const selectRow = e ? [e] : tableRef.value.getSelectionRows()
|
||||
|
||||
tableRemoveRow({ data: selectRow }, (res: boolean) => {
|
||||
if (res) {
|
||||
// console.log('调用删除', selectRow)
|
||||
const index = tableData.value.findIndex((item: any) => item === selectRow)
|
||||
tableData.value.splice(index, 1)
|
||||
const ids: any = [];
|
||||
selectRow.forEach((row: any) => {
|
||||
ids.push(row.userId)
|
||||
})
|
||||
userApi.deleteU(ids).then(res => {
|
||||
ElMessage.success("删除成功")
|
||||
}).catch(() => {
|
||||
ElMessage.error("删除失败")
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const enableChange = (e: any) => {
|
||||
ElMessage.success(e.enable ? '启用成功' : '禁用成功')
|
||||
userApi.updateUserInfo({
|
||||
username: e.username,
|
||||
lockFlag: e.lockFlag ? '1' : '0'
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success(e.lockFlag ? '锁定成功' : '解锁成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
const resetPassword = (e: any) => {
|
||||
ElMessageBox.confirm('是否确定要重置密码?', '系统提醒', { type: 'warning', draggable: true }).then(() => {
|
||||
ElMessage.success('重置成功!')
|
||||
}).catch(() => { })
|
||||
ElMessageBox.prompt('是否确定要重置密码?', '系统提醒', {
|
||||
type: 'warning',
|
||||
draggable: true,
|
||||
inputPattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z\s]).{9,15}$/,
|
||||
inputErrorMessage: "密码至少包含字母、数字、特殊字符,不少于9位,最多15位"
|
||||
}).then((inputVal) => {
|
||||
userApi.modifyPw({
|
||||
username: e.username,
|
||||
password: inputVal.value
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('重置成功!')
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
const editData = (e: any) => {
|
||||
isFormDialog.value = true
|
||||
formDialogTitle.value = '修改'
|
||||
setTimeout(() => {
|
||||
userFormRef.value.resetData()
|
||||
userFormRef.value.formData = JSON.parse(JSON.stringify(e))
|
||||
doctorFormRef.value.resetData()
|
||||
const val = JSON.parse(JSON.stringify(e));
|
||||
val.role = []
|
||||
val.roleList.forEach((role: any) => {
|
||||
val.role.push(role.roleId)
|
||||
})
|
||||
doctorFormRef.value.formData = val
|
||||
}, 0)
|
||||
}
|
||||
const tableRowClick = (row: any) => {
|
||||
tableRef.value.toggleRowSelection(row)
|
||||
}
|
||||
const paginationChange = (page: number, size: number) => {
|
||||
|
||||
const doctorFormSave = (data: any, type: string) => {
|
||||
init()
|
||||
}
|
||||
const paginationChange = (page: number, s: number) => {
|
||||
current = page
|
||||
size = s
|
||||
getUseList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user