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