Merge branch 'main' of http://47.97.125.165:8902/jiangs/transitPlatForm-Vue3
@ -1,8 +1,8 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 若依管理系统
|
||||
VITE_APP_TITLE = 检验平台流转系统
|
||||
|
||||
# 开发环境配置
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
# 检验平台流转系统/开发环境
|
||||
VITE_APP_BASE_API = '/dev-api'
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 若依管理系统
|
||||
VITE_APP_TITLE = 检验平台流转系统
|
||||
|
||||
# 生产环境配置
|
||||
VITE_APP_ENV = 'production'
|
||||
|
||||
# 若依管理系统/生产环境
|
||||
# 检验平台流转系统/生产环境
|
||||
VITE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 若依管理系统
|
||||
VITE_APP_TITLE = 检验平台流转系统
|
||||
|
||||
# 生产环境配置
|
||||
VITE_APP_ENV = 'staging'
|
||||
|
||||
# 若依管理系统/生产环境
|
||||
# 检验平台流转系统/生产环境
|
||||
VITE_APP_BASE_API = '/stage-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
|
||||
126
src/api/checkCode/index.ts
Normal file
@ -0,0 +1,126 @@
|
||||
//@ts-ignore js语法检查忽略
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 生成条码
|
||||
export function addObj(query?: Object) {
|
||||
return request({
|
||||
url: 'zyreq/add',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 查询申请单列表
|
||||
export function fetchCodeList(query?: Object) {
|
||||
return request({
|
||||
url: '/zyreq/query',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询项目
|
||||
export function fetchCodeDetail(query?: Object) {
|
||||
return request({
|
||||
url: 'zyreq/detail',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 执行条码
|
||||
export function fetchCodeExec(query?: Object) {
|
||||
return request({
|
||||
url: '/zyreq/exec',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 执行条码
|
||||
export function printSendSample(query?: Object) {
|
||||
return request({
|
||||
url: '/zyreq/printSendSample',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 获取申请单主表信息
|
||||
export function fetchCodeReqmain(query?: Object) {
|
||||
return request({
|
||||
url: 'zyreq/reqmain',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询报告单列表
|
||||
export function reportList(query?: Object) {
|
||||
return request({
|
||||
url: '/report/ReportList',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 查询报告Pdf预览
|
||||
export function reportViewPdf(query?: Object) {
|
||||
return request({
|
||||
url: '/report/pdf',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询报告Pdf打印
|
||||
export function reportPrintPdf(query?: Object) {
|
||||
return request({
|
||||
url: '/report/print',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 查询项目报告
|
||||
export function reportResult(query?: Object) {
|
||||
return request({
|
||||
url: '/report/result',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 查询微生物报告
|
||||
export function reportMedList(query?: Object) {
|
||||
return request({
|
||||
url: '/report/MedList',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 查询微生物报告
|
||||
export function reportFsresult(query?: Object) {
|
||||
return request({
|
||||
url: '/report/fsresult',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 打印机插件检查
|
||||
export function printcheck(query?: Object) {
|
||||
return request({
|
||||
url: '/regRequestInfo/printcheck',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 打印机插件设置
|
||||
export function printsetup(query?: Object) {
|
||||
return request({
|
||||
url: '/regRequestInfo/printsetup',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 取消采样
|
||||
export function cancelExecSQD(query?: Object) {
|
||||
return request({
|
||||
url: '/zyreq/cancelExecSQD',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
@ -38,10 +38,10 @@ export function delComDictService(data?: Object) {
|
||||
}
|
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getComDicts(zdlb?: Object) {
|
||||
export function getComDicts(dict_type?: Object) {
|
||||
return request({
|
||||
url: '/comdict/getComDicts',
|
||||
url: '/transitdict/regdict/getInfoOne',
|
||||
method: 'get',
|
||||
params: zdlb
|
||||
params: dict_type
|
||||
})
|
||||
}
|
||||
@ -1,68 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
//获取项目信息
|
||||
export function queryXmInfoList(query: any) {
|
||||
//查询申请单信息
|
||||
export function queryRegRequestInfo(query: Object) {
|
||||
return request({
|
||||
url: '/reqInput/queryXmInfoList',
|
||||
url: '/regRequestInfo/queryRegRequestInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//保存病人信息
|
||||
export function saveReqInfo(query: any) {
|
||||
export function saveReqInfo(query: Object) {
|
||||
return request({
|
||||
url: '/reqInput/saveReqInfo',
|
||||
url: '/regRequestInfo/saveReqInfo',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
//保存病人信息
|
||||
export function queryPatList(query: any) {
|
||||
|
||||
|
||||
//开单项目信息
|
||||
export function getXmItemInfo(query: Object) {
|
||||
return request({
|
||||
url: '/reqInput/queryPatList',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
//查询病人信息
|
||||
export function queryPatInfo(query: any) {
|
||||
return request({
|
||||
url: '/reqInput/queryPatInfo',
|
||||
url: '/regRequestInfo/getItemInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//不可开单项目列表
|
||||
export function queryCreateReqList(query: any) {
|
||||
return request({
|
||||
url: '/reqInput/queryCreateReqList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//可开单项目列表
|
||||
export function queryCanCreateReqList(query: any) {
|
||||
return request({
|
||||
url: '/reqInput/queryCanCreateReqList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//保存可开单项目
|
||||
export function saveCanCreaeReqList(query: any) {
|
||||
return request({
|
||||
url: '/reqInput/saveCanCreaeReqList',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
//获取病人明细信息
|
||||
export function queryPatDetail(query: any) {
|
||||
export function queryReqDetail(query: Object) {
|
||||
return request({
|
||||
url: '/reqInput/queryPatDetail',
|
||||
url: '/regRequestInfo/queryReqDetail',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//打印条码
|
||||
export function reqPrint(query: Object) {
|
||||
return request({
|
||||
url: '/regRequestInfo/print',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
//作废申请单
|
||||
export function cancelReq(query: Object) {
|
||||
return request({
|
||||
url: '/regRequestInfo/cancelReq',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
||||
46
src/api/liswork/xtwh/configdictApi.ts
Normal file
@ -0,0 +1,46 @@
|
||||
//参数设置字典
|
||||
// @ts-ignore
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典列表
|
||||
export function listconfigdict(params:any) {
|
||||
return request({
|
||||
url: '/configdict/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典详细
|
||||
export function getconfigdict(id:number) {
|
||||
return request({
|
||||
url: `/configdict/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export function addconfigdict(params:any) {
|
||||
return request({
|
||||
url: '/configdict',
|
||||
method: 'post',
|
||||
data:params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export function updateconfigdict(params:any) {
|
||||
return request({
|
||||
url: '/configdict',
|
||||
method: 'put',
|
||||
data:params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export function delconfigdict(id:any) {
|
||||
return request({
|
||||
url: `/configdict/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -2,12 +2,13 @@ import request from '@/utils/request'
|
||||
import type { SysRegister, LoginInfoResult, UserInfoResult, CaptchaInfoResult, AjaxResult } from '@/types'
|
||||
|
||||
// 登录方法
|
||||
export function login(username: string, password: string, code: string, uuid: string): Promise<LoginInfoResult> {
|
||||
export function login(username: string, password: string, code: string, uuid: string, loginParam?: Object): Promise<LoginInfoResult> {
|
||||
const data = {
|
||||
username,
|
||||
password,
|
||||
code,
|
||||
uuid
|
||||
uuid,
|
||||
loginParam
|
||||
}
|
||||
return request({
|
||||
url: '/login',
|
||||
@ -20,6 +21,15 @@ export function login(username: string, password: string, code: string, uuid: st
|
||||
})
|
||||
}
|
||||
|
||||
// 单点登录
|
||||
export function loginAnonymous(data: { username: string; yljg: string }): Promise<LoginInfoResult> {
|
||||
return request({
|
||||
url: '/loginAnonymous',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 注册方法
|
||||
export function register(data: SysRegister): Promise<AjaxResult> {
|
||||
return request({
|
||||
|
||||
58
src/api/mzcx/cydj.ts
Normal file
@ -0,0 +1,58 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询采样登记列表
|
||||
export function querySQD(query: Object) {
|
||||
return request({
|
||||
url: '/mzcx/querySQD',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询采样登记列表
|
||||
export function printBarcode(query: Object) {
|
||||
return request({
|
||||
url: '/mzcx/printBarcode',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function printBarcodeall(data: Object) {
|
||||
return request({
|
||||
url: '/mzcx/printBarcode',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 查询病人列表
|
||||
export function queryPatList() {
|
||||
return request({
|
||||
url: '/mzcx/queryPatList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 打印回单
|
||||
export function printBackpaper(data: Object) {
|
||||
return request({
|
||||
url: '/mzcx/printBackpaper',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改采样登记
|
||||
export function updateReqmain(data: Object) {
|
||||
return request({
|
||||
url: '/system/reqmain',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除采样登记
|
||||
export function delReqmain(sqh: string) {
|
||||
return request({
|
||||
url: '/system/reqmain/' + sqh,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
163
src/api/mzcx/index.ts
Normal file
@ -0,0 +1,163 @@
|
||||
//@ts-ignore js语法检查忽略
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
// 查询条码类别
|
||||
export function feeitemclassList(query?: Object) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 报告领取规则
|
||||
export function rptgetrules(query?: Object) {
|
||||
return request({
|
||||
url: '/rptgetrule/query',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 新增条码类别
|
||||
export function feeitemclassAdd(query?: Object) {
|
||||
return request({
|
||||
url: '/feeitemclass/add',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 修改条码类别
|
||||
export function feeitemclassUpdate(query?: Object) {
|
||||
return request({
|
||||
url: '/feeitemclass/update',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 删除条码类别
|
||||
export function feeitemclassDel(query?: Object) {
|
||||
return request({
|
||||
url: '/feeitemclass/del',
|
||||
method: 'delete',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 收费项目维护列表
|
||||
export function xmfeeList(query?: Object) {
|
||||
return request({
|
||||
url: 'xmfee/query',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 收费项目新增
|
||||
export function xmfeeadd(query?: Object) {
|
||||
return request({
|
||||
url: 'xmfee/addXmfee',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 收费项目修改
|
||||
export function xmfeeUpdate(query?: Object) {
|
||||
return request({
|
||||
url: 'xmfee/update',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 收费项目删除
|
||||
export function xmfeeDel(query?: Object) {
|
||||
return request({
|
||||
url: 'xmfee/del',
|
||||
method: 'delete',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 报告领取规则维护列表
|
||||
export function rptgetruleList(query?: Object) {
|
||||
return request({
|
||||
url: 'rptgetrule/query',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 报告领取规则明细列表
|
||||
export function rptgetruleDetail(query?: Object) {
|
||||
return request({
|
||||
url: 'rptgetrule/queryDetail',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 报告领取规则新增
|
||||
export function rptgetruleadd(query?: Object) {
|
||||
return request({
|
||||
url: 'rptgetrule/add',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 报告领取规则修改
|
||||
export function rptgetruleUpdate(query?: Object) {
|
||||
return request({
|
||||
url: 'rptgetrule/update',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 报告领取规则删除
|
||||
export function rptgetruleDel(query?: Object) {
|
||||
return request({
|
||||
url: 'rptgetrule/del',
|
||||
method: 'delete',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 报告领取规则明细删除
|
||||
export function rptgetruleDelDetail(query?: Object) {
|
||||
return request({
|
||||
url: 'rptgetrule/delDetail',
|
||||
method: 'delete',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 获取条码已对照项目
|
||||
export function feeitemvsList(query?: Object) {
|
||||
return request({
|
||||
url: '/item/compare',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 获取条码未对照项目
|
||||
export function noCompareList(query?: Object) {
|
||||
return request({
|
||||
url: '/item/noCompare',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 保存对照的项目
|
||||
export function feeitemvAdd(query?: Object) {
|
||||
return request({
|
||||
url: '/feeitemvsclass/add',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 删除对照的项目
|
||||
export function feeitemvDel(query?: Object) {
|
||||
return request({
|
||||
url: '/item/update',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
44
src/api/regional/dict/diagnosis.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询诊断列表
|
||||
export function listdiagnosis(query: Object) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询诊断详细
|
||||
export function getdiagnosis(diagnosisId: number) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis/' + diagnosisId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增诊断
|
||||
export function adddiagnosis(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改诊断
|
||||
export function updatediagnosis(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除诊断
|
||||
export function deldiagnosis(diagnosisId: number) {
|
||||
return request({
|
||||
url: '/transitdict/diagnosis/' + diagnosisId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/regional/dict/hospital.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询医疗机构列表
|
||||
export function listhospital(query?: Object) {
|
||||
return request({
|
||||
url: '/transitdict/hospital/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询医疗机构详细
|
||||
export function gethospital(hospitalId: number) {
|
||||
return request({
|
||||
url: '/transitdict/hospital/' + hospitalId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增医疗机构
|
||||
export function addhospital(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/hospital',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改医疗机构
|
||||
export function updatehospital(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/hospital',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除医疗机构
|
||||
export function delhospital(hospitalId: number) {
|
||||
return request({
|
||||
url: '/transitdict/hospital/' + hospitalId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/regional/dict/itemclass.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询诊断列表
|
||||
export function listitemclass(query: Object) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询诊断详细
|
||||
export function getitemclass(itemclassId: number) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass/' + itemclassId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增诊断
|
||||
export function additemclass(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改诊断
|
||||
export function updateitemclass(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除诊断
|
||||
export function delitemclass(itemclassId: number) {
|
||||
return request({
|
||||
url: '/transitdict/itemclass/' + itemclassId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
52
src/api/regional/dict/regdict.ts
Normal file
@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典列表
|
||||
export function listregdict(query: Object) {
|
||||
return request({
|
||||
url: '/transitdict/regdict/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获取字典最大编码
|
||||
export function getMaxDictCode(query: Object) {
|
||||
return request({
|
||||
url: '/transitdict/regdict/getMaxDictCode',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典详细
|
||||
export function getregdict(regdictId: number) {
|
||||
return request({
|
||||
url: '/transitdict/regdict/' + regdictId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export function addregdict(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/regdict',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export function updateregdict(data: Object) {
|
||||
return request({
|
||||
url: '/transitdict/regdict',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export function delregdict(regdictId: number) {
|
||||
return request({
|
||||
url: '/transitdict/regdict/' + regdictId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
100
src/api/regional/index.ts
Normal file
@ -0,0 +1,100 @@
|
||||
// @ts-ignore
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取流转数据
|
||||
export function querySample(query?: Object) {
|
||||
return request({
|
||||
url: '/transit/querySample',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获取未签收的标本
|
||||
export function querySampleSign(query?: Object) {
|
||||
return request({
|
||||
url: '/transit/querySampleSign',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 签收标本
|
||||
export function sampleSign(query?: Object) {
|
||||
return request({
|
||||
url: '/transit/sampleSign',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
// 退回的标本
|
||||
export function querySampleSignBack(query?: Object) {
|
||||
return request({
|
||||
url: '/transit/querySampleSignBack',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 标本报表
|
||||
export function sampleTypeCount(query?: Object) {
|
||||
return request({
|
||||
url: '/transitReport/sampleTypeCount',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 标本报表费用
|
||||
export function sampleitemCount(query?: Object) {
|
||||
return request({
|
||||
url: '/transitReport/itemCount',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 标本报表费用
|
||||
export function getallcount(query?: Object) {
|
||||
return request({
|
||||
url: '/transitstat/getallcount',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获取流转项目列表
|
||||
export function getXmList(query?: Object) {
|
||||
return request({
|
||||
url: '/item/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 新增项目
|
||||
export function addXmInfo(query?: Object) {
|
||||
return request({
|
||||
url: '/item/add',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
// 修改项目
|
||||
export function updateXmInfo(query?: Object) {
|
||||
return request({
|
||||
url: '/item/update',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
// 删除项目
|
||||
export function deleteXmInfo(query?: Object) {
|
||||
return request({
|
||||
url: '/item/delete',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
// 获取已打印的条码数据
|
||||
export function sampleCollect(query?: Object) {
|
||||
return request({
|
||||
url: '/transit/sampleCollect',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
BIN
src/assets/images/xjt.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/assets/images/yjt.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
@ -347,7 +347,8 @@ aside {
|
||||
|
||||
&.is-active {
|
||||
border-bottom: .125rem solid #1F6DD3 !important;
|
||||
background-color: #e9f1fb;
|
||||
background-color: #1F6DD3;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,8 @@
|
||||
<template>
|
||||
<div class="common-table-container">
|
||||
<vxe-table :data="tableData" :loading="loading" border :checkbox-config="config.checkboxConfig"
|
||||
:height="scrollYConfig.height" @checkbox-change="handleCheckboxChange" :row-config="rowConfig"
|
||||
:height="scrollYConfig.height" @checkbox-change="handleCheckboxChange"
|
||||
:row-config="{ isHover: true, height: 30, isCurrent: true, keyField: keyField ? keyField : '_index' }"
|
||||
:show-overflow="showOverflow" @current-change="handleRowClick" ref="tableRef" :size="size"
|
||||
:current-row="currentRow" :scroll-y="scrollYConfig" :tooltip-config="{ appendToBody: true, zIndex: 3000 }"
|
||||
:header-cell-class-name="enableColumnDrag ? 'el-table-header-cell' : ''" v-bind="$attrs">
|
||||
@ -27,12 +28,23 @@
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column v-bind="column" v-if="column.field">
|
||||
<template v-if="column.headerSlot" #header="scope">
|
||||
<slot :name="column.headerSlot" :column="scope.column" :$index="scope.$index" />
|
||||
</template>
|
||||
<!-- 自定义列模板 -->
|
||||
<template v-if="column.slotName" #default="scope">
|
||||
<slot :name="column.slotName" :row="scope.row" :$index="scope.$rowIndex"></slot>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</template>
|
||||
|
||||
<!-- 操作列 -->
|
||||
<vxe-column v-if="$slots.action" :title="config.actionLabel || '操作'" :width="config.actionWidth"
|
||||
:fixed="config.actionFixed || ''" :align="config.actionAlign || 'center'">
|
||||
<template #default="scope">
|
||||
<slot name="action" :row="scope.row" :column="scope.column" :$index="scope.$index" />
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</template>
|
||||
@ -76,11 +88,9 @@ const props = defineProps({
|
||||
required: true
|
||||
},
|
||||
// 行配置
|
||||
rowConfig: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
isHover: true, height: 30, isCurrent: true, keyField: '_index'
|
||||
})
|
||||
keyField: {
|
||||
type: String,
|
||||
default: 'id'
|
||||
},
|
||||
// 表格配置
|
||||
config: {
|
||||
@ -92,11 +102,7 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 是否高亮当前行 已废弃
|
||||
highlightCurrentRow: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
|
||||
|
||||
// 纵向滚动配置
|
||||
scrollYConfig: {
|
||||
@ -129,10 +135,10 @@ const handleRowClick = (params: { row: any }) => {
|
||||
emits('current-change', params.row)
|
||||
}
|
||||
|
||||
const handleCheckboxChange = ({ checked, records }: { checked: boolean, records: any[] }) => {
|
||||
const handleCheckboxChange = ({ checked, row, records }: { checked: boolean, row: any, records: any[] }) => {
|
||||
// console.log('选中的数据:', records);
|
||||
// console.log('是否全选:', checked);
|
||||
emits('selection-change', records)
|
||||
emits('selection-change', checked, row, records)
|
||||
};
|
||||
|
||||
// 处理行选择
|
||||
|
||||
@ -4,8 +4,7 @@
|
||||
@toggleClick="toggleSideBar" />
|
||||
|
||||
<div class="app-name">
|
||||
<!-- {{ formatDict(userStore.sysLoginParam.loginYLJG || '1', 'HOS') }} -->
|
||||
医疗机构
|
||||
{{ yljgName }}
|
||||
</div>
|
||||
|
||||
<div class="right-menu">
|
||||
@ -52,11 +51,13 @@ import RuoYiDoc from '@/components/RuoYi/Doc/index.vue'
|
||||
import useAppStore from '@/store/modules/app'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useSettingsStore from '@/store/modules/settings'
|
||||
import { formatDict, getDictData } from '@/hooks'
|
||||
import { listhospital } from '@/api/regional/dict/hospital'
|
||||
const appStore = useAppStore()
|
||||
const userStore = useUserStore()
|
||||
const settingsStore = useSettingsStore()
|
||||
|
||||
|
||||
const yljgName = ref('区域检验平台')
|
||||
function toggleSideBar(): void {
|
||||
appStore.toggleSideBar()
|
||||
}
|
||||
@ -132,7 +133,9 @@ async function toggleTheme(event?: MouseEvent): Promise<void> {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDictData('HOS')
|
||||
listhospital({ pageSize: 100, pageNum: 1 }).then((resp: any) => {
|
||||
yljgName.value = resp.rows.find((item: any) => item.hospitalId == userStore.sysLoginParam.loginYLJG)?.hospitalName || '区域检验平台'
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -11,10 +11,15 @@ import 'vxe-pc-ui/lib/style.css'
|
||||
import VXETable from 'vxe-table'
|
||||
import 'vxe-table/lib/style.css'
|
||||
import '@/assets/styles/index.scss' // global css
|
||||
import '@/utils/polyfills';
|
||||
import {
|
||||
setupRem
|
||||
} from './utils/rem';
|
||||
|
||||
|
||||
setupRem(); // 初始化rem适配
|
||||
|
||||
|
||||
import App from './App.vue'
|
||||
import store from './store'
|
||||
import router from './router'
|
||||
|
||||
@ -47,6 +47,12 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/register.vue'),
|
||||
hidden: true
|
||||
},
|
||||
// 大屏
|
||||
{
|
||||
path: '/statistics/overview',
|
||||
component: () => import('@/views/regional/statistics/overview/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
component: () => import('@/views/error/404.vue'),
|
||||
|
||||
36
src/store/modules/printStore.ts
Normal file
@ -0,0 +1,36 @@
|
||||
// 打印状态管理
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const usePrintStore = defineStore('printStore', {
|
||||
state: () => ({
|
||||
isConnected: false, // 存储连接状态
|
||||
clientInfo: null, // 存储客户端信息
|
||||
printerList: [] as any[], // 存储打印机列表
|
||||
defaultPrinter: '' as string, // 存储默认打印机名称
|
||||
}),
|
||||
actions: {
|
||||
setConnected(status: boolean) {
|
||||
this.isConnected = status
|
||||
},
|
||||
setClientInfo(info: any) {
|
||||
this.clientInfo = info
|
||||
},
|
||||
setPrinterList(list: any[]) {
|
||||
this.printerList = list
|
||||
},
|
||||
|
||||
setDefaultPrinter(printerName: string) {
|
||||
this.defaultPrinter = printerName
|
||||
}
|
||||
},
|
||||
|
||||
// 持久化配置
|
||||
persist: {
|
||||
// 指定要持久化的状态字段
|
||||
pick: ['defaultPrinter',],
|
||||
// 可选配置:自定义存储键名(默认是store的id)
|
||||
// key: 'common_store',
|
||||
// 可选配置:指定存储位置(默认是localStorage 也可以用sessionStorage)
|
||||
storage: localStorage,
|
||||
}
|
||||
})
|
||||
@ -1,18 +1,25 @@
|
||||
import router from '@/router'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { login, logout, getInfo } from '@/api/login'
|
||||
import { login, logout, getInfo, loginAnonymous } from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import { isHttp, isEmpty } from "@/utils/validate"
|
||||
import defAva from '@/assets/images/profile.jpg'
|
||||
|
||||
interface RoleInfo {
|
||||
roleName: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
interface UserState {
|
||||
token: string | undefined
|
||||
id: string | number
|
||||
name: string
|
||||
nickName: string
|
||||
roleName: string
|
||||
avatar: string
|
||||
roles: string[]
|
||||
permissions: string[]
|
||||
sysLoginParam: Object
|
||||
}
|
||||
|
||||
const useUserStore = defineStore(
|
||||
@ -23,19 +30,40 @@ const useUserStore = defineStore(
|
||||
id: '',
|
||||
name: '',
|
||||
nickName: '',
|
||||
roleName: '',
|
||||
avatar: '',
|
||||
roles: [],
|
||||
permissions: []
|
||||
permissions: [],
|
||||
sysLoginParam: {}, // 登录参数
|
||||
}),
|
||||
actions: {
|
||||
// 单点登录
|
||||
loginAnonymous(data: { name: string; yljg: string }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
loginAnonymous({
|
||||
username: data.name,
|
||||
yljg: data.yljg
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
setToken(res.token)
|
||||
this.token = res.token
|
||||
resolve(true)
|
||||
}
|
||||
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
login(userInfo: { username: string; password: string; code: string; uuid: string }) {
|
||||
login(userInfo: { username: string; password: string; code: string; uuid: string; loginParam: Object }) {
|
||||
const username = userInfo.username.trim()
|
||||
const password = userInfo.password
|
||||
const code = userInfo.code
|
||||
const uuid = userInfo.uuid
|
||||
const loginParam = userInfo.loginParam
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
login(username, password, code, uuid, loginParam).then(res => {
|
||||
setToken(res.token)
|
||||
this.token = res.token
|
||||
resolve()
|
||||
@ -50,12 +78,15 @@ const useUserStore = defineStore(
|
||||
getInfo().then(res => {
|
||||
const user = res.user
|
||||
let avatar = user.avatar || ''
|
||||
this.sysLoginParam = user.sysLoginParam
|
||||
if (!isHttp(avatar)) {
|
||||
avatar = (isEmpty(avatar)) ? defAva : import.meta.env.VITE_APP_BASE_API + avatar
|
||||
}
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.roles
|
||||
const roles = res.user.roles as any[]
|
||||
if (roles && roles.length > 0) {
|
||||
this.roles = roles
|
||||
this.permissions = res.permissions
|
||||
this.roleName = (roles[0] as RoleInfo).roleName
|
||||
} else {
|
||||
this.roles = ['ROLE_DEFAULT']
|
||||
}
|
||||
@ -64,16 +95,16 @@ const useUserStore = defineStore(
|
||||
this.nickName = user.nickName || ''
|
||||
this.avatar = avatar
|
||||
/* 初始密码提示 */
|
||||
if(res.isDefaultModifyPwd) {
|
||||
ElMessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
if (res.isDefaultModifyPwd) {
|
||||
ElMessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
/* 过期密码提示 */
|
||||
if(!res.isDefaultModifyPwd && res.isPasswordExpired) {
|
||||
ElMessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
if (!res.isDefaultModifyPwd && res.isPasswordExpired) {
|
||||
ElMessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
|
||||
@ -10,7 +10,7 @@ export interface UserQueryParams extends PageDomain {
|
||||
/** 手机号码 */
|
||||
phonenumber?: string;
|
||||
/** 状态(0正常 1停用) */
|
||||
status?: '0' | '1';
|
||||
status?: string;
|
||||
/** 部门编号 */
|
||||
deptId?: number;
|
||||
/** 创建时间 */
|
||||
@ -56,6 +56,8 @@ export interface SysUser extends BaseEntity {
|
||||
roleIds?: number[];
|
||||
/** 岗位组 */
|
||||
postIds?: number[];
|
||||
// 登录参数
|
||||
sysLoginParam?: Object;
|
||||
}
|
||||
|
||||
/** 注册信息 */
|
||||
|
||||
@ -76,11 +76,11 @@ export function comDict(...args: string[]): Promise<DictResult> {
|
||||
} else {
|
||||
// 缓存不存在,发起请求并记录 Promise
|
||||
const promise = getComDicts({
|
||||
zdlb: dictType
|
||||
dict_type: dictType
|
||||
}).then((resp: any) => {
|
||||
const dictList = resp.data.map((p: any) => ({
|
||||
label: p.zdmc,
|
||||
value: p.zddh,
|
||||
label: p.dictName,
|
||||
value: p.dictCode,
|
||||
elTagType: "",
|
||||
elTagClass: ""
|
||||
}));
|
||||
|
||||
145
src/utils/groupHelper.ts
Normal file
@ -0,0 +1,145 @@
|
||||
|
||||
// 定义通用类型
|
||||
interface GroupOriginValues {
|
||||
[key: string]: string | number | null | undefined
|
||||
}
|
||||
|
||||
interface GroupMetaItem {
|
||||
groupSeq: number
|
||||
key: string
|
||||
originValues: GroupOriginValues
|
||||
itemCount: number
|
||||
firstRowIndex: number | null
|
||||
}
|
||||
// @ts-ignore
|
||||
interface GroupedItem<T> extends T {
|
||||
rowSeq: number // 组内行序号
|
||||
groupSeq?: number // 组序号(可选)
|
||||
}
|
||||
|
||||
interface GroupData<T> {
|
||||
groupSeq: number
|
||||
key: string
|
||||
originValues: GroupOriginValues
|
||||
items: GroupedItem<T>[]
|
||||
}
|
||||
|
||||
interface UseGroupTableDataReturn<T> {
|
||||
tableData: ComputedRef<(GroupedItem<T> & { [key: string]: string | number | '' })[]>
|
||||
groupMeta: ComputedRef<GroupMetaItem[]>
|
||||
groupedData: ComputedRef<GroupData<T>[]>
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用多字段分组函数
|
||||
* @param rawList - 原始数据列表
|
||||
* @param groupFields - 分组字段(单个字段传字符串,多个传数组)
|
||||
* @param showFields - 每组仅第一条显示的字段
|
||||
* @param sortField - 排序字段(默认按orderDate降序)
|
||||
* @param originalData - 原始数据赋值字段(可选)
|
||||
* @returns 表格渲染数据 + 分组元信息
|
||||
*/
|
||||
export function useGroupTableData<T extends Record<string, any>>(
|
||||
rawList: string[],
|
||||
groupFields: string,
|
||||
showFields: string | string[],
|
||||
sortField: string = 'orderDate',
|
||||
originalData: string[]
|
||||
): UseGroupTableDataReturn<T> {
|
||||
// 处理参数格式:确保为数组
|
||||
const groupFieldArr = Array.isArray(groupFields) ? groupFields : [groupFields]
|
||||
const showFieldArr = Array.isArray(showFields) ? showFields : [showFields]
|
||||
|
||||
// 1. 核心分组逻辑
|
||||
const groupedData = computed<GroupData<T>[]>(() => {
|
||||
const groups: Record<string, {
|
||||
key: string
|
||||
originValues: GroupOriginValues
|
||||
items: GroupedItem<T>[]
|
||||
}> = {}
|
||||
|
||||
rawList.forEach((item: any) => {
|
||||
// 生成分组key(多字段拼接,避免重复)
|
||||
const groupKey = groupFieldArr.map(field => item[field] ?? '').join('_')
|
||||
|
||||
if (!groups[groupKey]) {
|
||||
groups[groupKey] = {
|
||||
key: groupKey,
|
||||
originValues: groupFieldArr.reduce((obj, field) => {
|
||||
obj[field] = item[field] ?? ''
|
||||
return obj
|
||||
}, {} as GroupOriginValues),
|
||||
items: []
|
||||
}
|
||||
}
|
||||
// 处理仅第一条显示的字段
|
||||
showFieldArr.forEach((field, i) => {
|
||||
originalData.forEach((v, _i) => {
|
||||
if (i == _i) {
|
||||
item[field] = item[v]
|
||||
}
|
||||
})
|
||||
})
|
||||
// 添加组内行序号
|
||||
groups[groupKey].items.push({
|
||||
...item,
|
||||
rowSeq: groups[groupKey].items.length + 1
|
||||
})
|
||||
})
|
||||
|
||||
// 2. 按指定字段降序排序分组
|
||||
const sortedGroupKeys = Object.keys(groups).sort((a, b) => {
|
||||
const aSortValue = groups[a].originValues[sortField] ?? ''
|
||||
const bSortValue = groups[b].originValues[sortField] ?? ''
|
||||
// 兼容日期/字符串/数字排序
|
||||
if (aSortValue && bSortValue && !isNaN(new Date(aSortValue).getTime())) {
|
||||
return new Date(bSortValue).getTime() - new Date(aSortValue).getTime()
|
||||
}
|
||||
return String(bSortValue).localeCompare(String(aSortValue))
|
||||
})
|
||||
|
||||
// 3. 生成带组序号的分组数据
|
||||
return sortedGroupKeys.map((key, groupIndex) => ({
|
||||
groupSeq: groupIndex + 1,
|
||||
...groups[key]
|
||||
}))
|
||||
})
|
||||
|
||||
// 4. 构造扁平化表格数据
|
||||
const tableData = computed(() => {
|
||||
const result: (GroupedItem<T> & { [key: string]: string | number | '' })[] = []
|
||||
groupedData.value.forEach(group => {
|
||||
group.items.forEach((item, idx) => {
|
||||
const processedItem = { ...item }
|
||||
|
||||
// 处理仅第一条显示的字段
|
||||
showFieldArr.forEach(field => {
|
||||
processedItem[field] = idx === 0 ? (item[field] ?? '') : ''
|
||||
})
|
||||
|
||||
// 组序号仅每组第一条显示
|
||||
processedItem.groupSeq = idx === 0 ? group.groupSeq : ''
|
||||
|
||||
result.push(processedItem)
|
||||
})
|
||||
})
|
||||
return result
|
||||
})
|
||||
|
||||
// 5. 生成分组元信息(用于合并单元格)
|
||||
const groupMeta = computed<GroupMetaItem[]>(() => {
|
||||
return groupedData.value.map(group => ({
|
||||
groupSeq: group.groupSeq,
|
||||
key: group.key,
|
||||
originValues: group.originValues,
|
||||
itemCount: group.items.length,
|
||||
firstRowIndex: null
|
||||
}))
|
||||
})
|
||||
|
||||
return {
|
||||
tableData,
|
||||
groupMeta,
|
||||
groupedData
|
||||
}
|
||||
}
|
||||
21
src/utils/polyfills.ts
Normal file
@ -0,0 +1,21 @@
|
||||
// 检测浏览器是否支持,不支持则注入兼容版
|
||||
if (!Array.prototype.findLastIndex) {
|
||||
Object.defineProperty(Array.prototype, 'findLastIndex', {
|
||||
value: function <T>(
|
||||
this: T[],
|
||||
callback: (value: T, index: number, array: T[]) => boolean,
|
||||
thisArg?: any
|
||||
): number {
|
||||
const arr = this;
|
||||
const len = arr.length >>> 0;
|
||||
for (let i = len - 1; i >= 0; i--) {
|
||||
if (i in arr && callback.call(thisArg, arr[i], i, arr)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
49
src/utils/printHelper.ts
Normal file
@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @file printHelper.ts 检查打印服务连接状态
|
||||
* @author: w
|
||||
* @since: 2026-01-26
|
||||
*/
|
||||
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { printcheck } from '@/api/checkCode/index'
|
||||
import Download from '@/plugins/download'
|
||||
|
||||
|
||||
export const checkPrintService = async (): Promise<boolean> => { //连接成功返回true,失败返回false
|
||||
try {
|
||||
const res = await printcheck()
|
||||
if (res.code == 0) {
|
||||
return true
|
||||
} else {
|
||||
await showPrintServiceError(res.msg)
|
||||
return false
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('打印服务检查失败:', error)
|
||||
await showPrintServiceError('打印服务连接异常')
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const showPrintServiceError = async (msg: string) => {
|
||||
// 挂载downExe方法到window,供提示框内的onclick调用
|
||||
if (!(window as any).downExe) {
|
||||
(window as any).downExe = () => {
|
||||
Download.name('lisprintsetup.exe', false)
|
||||
}
|
||||
}
|
||||
|
||||
await ElMessageBox.alert(
|
||||
`${msg}!<br>请确保目标服务器已<a style="color: #1f79db" onclick="downExe()">下载安装</a> 并运行打印服务!`,
|
||||
"客户端未连接",
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
//触发打印服务安装包下载
|
||||
export const downloadPrintSetup = () => {
|
||||
Download.name('lisprintsetup.exe', false)
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
|
||||
import FingerprintJS from '@fingerprintjs/fingerprintjs';
|
||||
|
||||
import { useCommonStore } from '@/store/modules/commonStore'
|
||||
const mbStore = useCommonStore();
|
||||
export function useFingerprint() {
|
||||
const fingerprint = ref('');
|
||||
const loading = ref(true);
|
||||
@ -23,7 +24,9 @@ export function useFingerprint() {
|
||||
|
||||
// 指纹标识符
|
||||
fingerprint.value = result.visitorId;
|
||||
|
||||
if (!mbStore.fingerprint) {
|
||||
mbStore.setFingerprint(result.visitorId)
|
||||
}
|
||||
// 可以获取更多详细信息
|
||||
console.log('指纹详细信息:', result);
|
||||
return result;
|
||||
|
||||
1164
src/views/index.vue
@ -1,99 +1,88 @@
|
||||
<template>
|
||||
<div class="labpat_box">
|
||||
<el-form :model="labPat" label-width="4.3rem" class="compact-form" label-position="right">
|
||||
<div :class="['sh_box', getColor(lastJgbz)]" v-if="lastJgbz != null && lastJgbz != 0 && lastJgbz != 'C'">
|
||||
<div class="text">{{ getLableType(lastJgbz) }}</div>
|
||||
<el-form :model="labPat" label-width="5rem" label-position="right" class="left-form">
|
||||
<div :class="['sh_box', getColor(newStatus)]" v-if="newStatus > 10">
|
||||
<div class="text">{{ getLableType(newStatus) }}</div>
|
||||
</div>
|
||||
<el-form-item label="病人来源">
|
||||
<el-col :span="16">
|
||||
<SelectTable v-model:data="labPat.brly" :fields="brlyFields" :table-data="dictData.PT" size="small"
|
||||
placeholder="" @getDataValue="handleFieldChange" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="16"> -->
|
||||
<SelectTable v-model:data="labPat.patType" :fields="brlyFields" :table-data="dictData.PT" placeholder=""
|
||||
@getDataValue="handleFieldChange" />
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="8">
|
||||
<el-checkbox v-model="labPat.jzbz" true-value="1" class="check_box"> 急诊 </el-checkbox>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="病人代号" required>
|
||||
<el-input v-model="labPat.brdh" @keyup.enter="brdhHandle" size="small" />
|
||||
<el-input v-model="labPat.patId" @change="brdhHandle" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓 名">
|
||||
<el-input v-model="labPat.brxm" @change="handleFieldChange" size="small" />
|
||||
<el-form-item label="姓 名" required>
|
||||
<el-input v-model="labPat.patName" @change="handleFieldChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性 别">
|
||||
<SelectTable v-model:data="labPat.brxb" :table-data="dictData.SX" size="small" placeholder=""
|
||||
<el-form-item label="性 别" required>
|
||||
<SelectTable v-model:data="labPat.patSex" :table-data="dictData.SX" placeholder=""
|
||||
@getDataValue="handleFieldChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄">
|
||||
<el-form-item label="年龄" required>
|
||||
<el-col :span="14">
|
||||
<el-input v-model="labPat.nl" @change="handleFieldChange" size="small" />
|
||||
<el-input v-model="labPat.patAge" @change="handleFieldChange" />
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<SelectTable v-model:data="labPat.nldw" :table-data="dictData.AU" size="small" placeholder=""
|
||||
<SelectTable v-model:data="labPat.ageUnit" :table-data="dictData.AU" placeholder=""
|
||||
@getDataValue="handleFieldChange" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="样本类型" required>
|
||||
<SelectTable v-model:data="labPat.yblx" :table-data="dictData.BT" size="small" placeholder=""
|
||||
<el-form-item label="生理周期" v-if="labPat.patSex == '2'">
|
||||
<SelectTable v-model:data="labPat.slzq" :table-data="dictData.SLZQ" placeholder=""
|
||||
@getDataValue="handleFieldChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="送检医生">
|
||||
<SelectTable v-model:data="labPat.yhdh" :fields="ysFields" :tableData="userList || []" label="nickName"
|
||||
value="userName" objKey="userName" :border="true" size="small" placeholder=""
|
||||
@getDataValue="handleFieldChange" />
|
||||
<SelectTable v-model:data="labPat.doctorCode" :tableData="dictData.DOCTOR" placeholder=""
|
||||
@getDataValue="doctorHandle" />
|
||||
</el-form-item>
|
||||
<el-form-item label="送检科室">
|
||||
<SelectTable v-model:data="labPat.ksdh" :table-data="dictData.DP" size="small" placeholder=""
|
||||
@getDataValue="handleFieldChange" />
|
||||
<SelectTable v-model:data="labPat.execDeptCode" :table-data="dictData.DEPT" placeholder=""
|
||||
@getDataValue="deptHandle" />
|
||||
</el-form-item>
|
||||
<el-form-item label="床 号">
|
||||
<el-input v-model="labPat.ch" @change="handleFieldChange" size="small" />
|
||||
<el-input v-model="labPat.patBed" @change="handleFieldChange" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="临床诊断">
|
||||
<el-input v-model="labPat.zd" @change="handleFieldChange" size="small" />
|
||||
<el-input v-model="labPat.diagnosisName" @change="handleFieldChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备 注">
|
||||
<el-input v-model="labPat.bz" @change="handleFieldChange" size="small" />
|
||||
<el-input v-model="labPat.bz" @change="handleFieldChange" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="登记人员">
|
||||
<SelectTable v-model:data="labPat.sjys" :table-data="dictData.SRD" size="small" placeholder=""
|
||||
:disabled="true" />
|
||||
<el-input v-model="labPat.userName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="登记时间">
|
||||
<el-date-picker v-model="labPat.djry" type="datetime" format="YYYY-MM-DD HH:mm:ss" :disabled="true"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" size="small" style="width: 100%;" />
|
||||
<el-date-picker v-model="labPat.orderTime" type="datetime" format="YYYY-MM-DD HH:mm:ss" :disabled="true"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="条 码 号">
|
||||
<el-input v-model="labPat.sqh" :disabled="true" size="small" />
|
||||
<el-form-item label="医疗机构">
|
||||
<el-input v-model="labPat.srcHospName" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="申请状态">
|
||||
<SelectTable v-model:data="labPat.zt" size="small" :table-data="lisReqs" placeholder="" :disabled="true" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="证件类型">
|
||||
<SelectTable v-model:data="labPat.zjlx" size="small" :table-data="dictData.ZJLX" placeholder=""
|
||||
<SelectTable v-model:data="labPat.zjlx" :table-data="dictData.ZJLX" placeholder=""
|
||||
@getDataValue="handleFieldChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="证件号码">
|
||||
<el-input v-model="labPat.sfzh" size="small" />
|
||||
<el-input v-model="labPat.patIdentity" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="labPat.phone" size="small" />
|
||||
<el-input v-model="labPat.phone" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { queryPatInfo } from '@/api/liswork/order'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { getDictData, formatDict, dictData } from '@/hooks'
|
||||
// @ts-ignore
|
||||
import { listUser } from '@/api/system/user.js'
|
||||
//@ts-ignore
|
||||
import { getDicts } from '@/api/system/dict/data'
|
||||
|
||||
const props = defineProps({
|
||||
labPat: {
|
||||
type: Object,
|
||||
@ -105,15 +94,13 @@ const props = defineProps({
|
||||
default: () => { }
|
||||
},
|
||||
});
|
||||
const lastJgbz = ref();
|
||||
watch(() => props.labPat, (newVal) => {
|
||||
lastValue.value = JSON.stringify(newVal);
|
||||
lastJgbz.value = newVal.zt;
|
||||
const newStatus = ref('');
|
||||
watch(() => props.labPat.status, (newVal: any) => {
|
||||
newStatus.value = newVal;
|
||||
})
|
||||
|
||||
|
||||
const emit = defineEmits(['update:labPat']);
|
||||
const lastValue = ref('');
|
||||
const emit = defineEmits(['update:labPat', 'getBrdh']);
|
||||
|
||||
const brlyFields = ref([
|
||||
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
|
||||
@ -124,49 +111,34 @@ const ysFields = ref([
|
||||
{ prop: 'userName', label: '用户代号', width: 80, enablePinyinSearch: true },
|
||||
{ prop: 'nickName', label: '用户姓名', width: 150, enablePinyinSearch: true },
|
||||
])
|
||||
/**
|
||||
* 通用字段变化处理(失焦、回车触发)
|
||||
*/
|
||||
const handleFieldChange = async () => {
|
||||
// // 将当前labPat转为字符串用于比较
|
||||
// const currentValue = JSON.stringify(props.labPat);
|
||||
// // 对比与上一次保存的值是否有变化
|
||||
// if (currentValue !== lastValue.value) {
|
||||
|
||||
// // 找出变化的字段
|
||||
// const oldObj = JSON.parse(lastValue.value);
|
||||
// const newObj = props.labPat;
|
||||
// const changedField = getChangedField(oldObj, newObj);
|
||||
// if (changedField) {
|
||||
// // 这里可以添加实际的更新逻辑,比如调用接口
|
||||
// try {
|
||||
// // saveLabPat(changedField)
|
||||
// } catch (error) {
|
||||
// console.error('更新失败:', error);
|
||||
// // 失败时可以恢复旧值
|
||||
// // emit('update:labPat', oldObj);
|
||||
// lastValue.value = JSON.stringify(oldObj);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
const doctorHandle = (data) => {
|
||||
props.labPat.doctorName = data.label
|
||||
}
|
||||
const deptHandle = (data) => {
|
||||
props.labPat.execDeptName = data.label
|
||||
}
|
||||
|
||||
const handleFieldChange = async () => {
|
||||
|
||||
};
|
||||
|
||||
const getLableType = (type: string) => {
|
||||
const item = lisReqs.value.find((p: any) => p.value === type);
|
||||
return item ? item.label : '开单';
|
||||
const item = dictData.value.ZT.find((p: any) => p.value === type);
|
||||
return item ? item.label : '';
|
||||
}
|
||||
|
||||
const getColor = (type: string) => {
|
||||
switch (type) {
|
||||
case '1':
|
||||
case '10':
|
||||
return 'cs_color';
|
||||
case '2':
|
||||
case '20':
|
||||
return 'sh_color';
|
||||
case '3':
|
||||
case '30':
|
||||
return 'cb_color';
|
||||
case '4':
|
||||
case '40':
|
||||
return 'eb_color';
|
||||
case '5':
|
||||
case '50':
|
||||
return 'sd_color';
|
||||
default:
|
||||
return 'default';
|
||||
@ -177,32 +149,12 @@ const getColor = (type: string) => {
|
||||
|
||||
// 病人代号查询病人信息的逻辑
|
||||
const brdhHandle = () => {
|
||||
queryPatInfo({ brdh: props.labPat.brdh }).then((res: any) => {
|
||||
if (res.data) {
|
||||
emit('update:labPat', { ...props.labPat, ...res.data })
|
||||
}
|
||||
})
|
||||
emit('getBrdh', props.labPat.patId)
|
||||
}
|
||||
|
||||
|
||||
|
||||
const lisReqs = ref([]);
|
||||
const userList = ref([]);
|
||||
onMounted(() => {
|
||||
const data = { status: '0', del_flag: '0', pageSize: 1000, pageNum: 1 }
|
||||
listUser(data).then((res: any) => {
|
||||
userList.value = res.rows;
|
||||
});
|
||||
|
||||
getDicts('lis_req_type').then((resp: any) => {
|
||||
lisReqs.value = resp.data.map((p: any) => ({
|
||||
label: p.dictLabel,
|
||||
value: p.dictValue,
|
||||
elTagType: p.listClass,
|
||||
elTagClass: p.cssClass
|
||||
}))
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
@ -275,26 +227,29 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
.compact-form {
|
||||
.left-form {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
|
||||
padding-top: 5px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
:deep(.el-form-item__label) {
|
||||
padding-bottom: 0px;
|
||||
color: #08355E;
|
||||
font-size: 12px;
|
||||
font-size: .875rem !important;
|
||||
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label:before) {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
:deep(.el-form-item--default .el-form-item__label) {
|
||||
height: 27px !important;
|
||||
line-height: 27px !important;
|
||||
|
||||
@ -1,192 +0,0 @@
|
||||
/**
|
||||
* @file setBilling.vue 开单项目设置
|
||||
* @author: w
|
||||
* @since: 2026-03-05
|
||||
*/
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="showDialog" title="开单项目设置" width="80%" @close="handleDialogClose">
|
||||
<el-row :gutter="10" class="table-toolbar">
|
||||
<el-col :span="10">
|
||||
<el-button type="primary" @click="cpHandle">存盘</el-button>
|
||||
<el-button type="primary" @click="firstHandle">首位</el-button>
|
||||
<el-button type="primary" @click="lastHadnle">末位</el-button>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
项目检索: <el-input v-model="searchKey" size="small" style="width: 200px;" @clear="filterDictData"
|
||||
@input="filterDictData" />
|
||||
<div class="tips">
|
||||
说明:从右边列表中双击某个项目可以直接加入到左边的列表中,代表这个项目为分支医疗机构开单项目
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="10">
|
||||
<CustomTable ref="tableRef" :data="CanReqListData" :columns="leftColumns" @row-dblclick="handleLeftDblclick"
|
||||
:config="{ border: true, height: '80vh', highlightCurrentRow: true, key: 'sfxmdh' }" :enableRowDrag="true"
|
||||
@row-drag-end="handleRowDragEnd" @row-click="handleRowClick">
|
||||
<!-- <template #dyxh="{ row }">
|
||||
<el-input v-model="row.dyxh" class="full-width-input" />
|
||||
</template> -->
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
<el-col :span="14" style="height:80vh">
|
||||
<CustomVxeTable :table-data="filterData" :columns="columns" @cell-dblclick="handleDblclick" size="small"
|
||||
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" ref="tableRef">
|
||||
</CustomVxeTable>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { queryCreateReqList, queryCanCreateReqList, saveCanCreaeReqList } from '@/api/liswork/order'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getFirstLetter } from '@/utils/pinyin';
|
||||
|
||||
|
||||
const emit = defineEmits(["update"]);
|
||||
const searchKey = ref('')
|
||||
const showDialog = ref(false)
|
||||
const selectedRow = ref(null)
|
||||
|
||||
const CanReqListData = ref([])
|
||||
const columns = [
|
||||
{ field: 'sflbmc', title: '类别', align: 'center', resizable: true },
|
||||
{ field: 'sfxmdh', title: '代号', align: 'center', resizable: true },
|
||||
{ field: 'sfxmmc', title: '简称', align: 'center', width: 200, resizable: true },
|
||||
{ field: 'dj', title: '单价', align: 'center', width: 80, resizable: true },
|
||||
{ field: 'yblx', title: '样本', align: 'center', resizable: true },
|
||||
{ field: 'bz', title: '采集说明', align: 'center', width: 200, resizable: true },
|
||||
]
|
||||
|
||||
const leftColumns = [
|
||||
{ prop: 'sfxmdh', label: '项目代号', visible: true, align: 'center' },
|
||||
{ prop: 'sfxmmc', label: '医疗机构可开展的诊疗项目', visible: true, align: 'center' },
|
||||
{ prop: 'xh', label: '排序', visible: true, align: 'center', },
|
||||
]
|
||||
const handleDblclick = ({ row }) => {
|
||||
const index = CanReqListData.value.findIndex(item => item.sfxmdh === row.sfxmdh)
|
||||
if (index === -1) {
|
||||
CanReqListData.value.push(row)
|
||||
resetSortNumber()
|
||||
} else {
|
||||
ElMessage.warning('已存在该项目')
|
||||
}
|
||||
}
|
||||
const filterData = ref([])
|
||||
const processedTableData = ref([])
|
||||
const filterDictData = () => {
|
||||
const key = searchKey.value.trim().toLowerCase();
|
||||
|
||||
if (!key) {
|
||||
// 空搜索时显示全部预处理数据
|
||||
filterData.value = [...processedTableData.value];
|
||||
return;
|
||||
}
|
||||
|
||||
filterData.value = processedTableData.value.filter((item) => {
|
||||
const matchLabel = item.pinyin?.toString().toLowerCase().includes(key);
|
||||
return matchLabel;
|
||||
});
|
||||
}
|
||||
const open = () => {
|
||||
queryCanCreateReqList().then(res => {
|
||||
CanReqListData.value = res.data.sort((a, b) => a.xh - b.xh)
|
||||
})
|
||||
queryCreateReqList().then(res => {
|
||||
processedTableData.value = processTableData(res.data)
|
||||
filterData.value = [...processedTableData.value];
|
||||
})
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
const processTableData = (data) => {
|
||||
return data.map((item) => {
|
||||
const pinyinMap = {};
|
||||
pinyinMap['pinyin'] = getFirstLetter(item.sfxmmc).toLowerCase();
|
||||
return { ...item, ...pinyinMap };
|
||||
});
|
||||
};
|
||||
const handleRowClick = (row) => {
|
||||
selectedRow.value = row
|
||||
}
|
||||
|
||||
const handleLeftDblclick = (row) => {
|
||||
const index = CanReqListData.value.findIndex(item => item.sfxmdh == row.sfxmdh)
|
||||
if (index !== -1) {
|
||||
CanReqListData.value.splice(index, 1)
|
||||
resetSortNumber()
|
||||
}
|
||||
}
|
||||
//退拽属性
|
||||
const handleRowDragEnd = (data) => {
|
||||
// 更新行顺序
|
||||
CanReqListData.value = data.list.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
xh: item.sort,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cpHandle = () => {
|
||||
saveCanCreaeReqList(CanReqListData.value).then((res) => {
|
||||
if (res.code == 0) {
|
||||
emit('update')
|
||||
showDialog.value = false
|
||||
ElMessage.success('保存成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
const firstHandle = () => {
|
||||
if (!selectedRow.value) return
|
||||
const currentIndex = CanReqListData.value.findIndex(item => item.sfxmdh === selectedRow.value.sfxmdh)
|
||||
if (currentIndex === 0) return
|
||||
const [movedRow] = CanReqListData.value.splice(currentIndex, 1)
|
||||
CanReqListData.value.unshift(movedRow)
|
||||
resetSortNumber()
|
||||
tableRef.value.setScrollTop(0)
|
||||
}
|
||||
|
||||
const lastHadnle = () => {
|
||||
if (!selectedRow.value) return
|
||||
const currentIndex = CanReqListData.value.findIndex(item => item.sfxmdh === selectedRow.value.sfxmdh)
|
||||
if (currentIndex === CanReqListData.value.length - 1) return
|
||||
const [movedRow] = CanReqListData.value.splice(currentIndex, 1)
|
||||
CanReqListData.value.push(movedRow)
|
||||
resetSortNumber()
|
||||
tableRef.value.setScrollTop(CanReqListData.value.length)
|
||||
}
|
||||
|
||||
const resetSortNumber = () => {
|
||||
CanReqListData.value.forEach((item, index) => {
|
||||
item.xh = index + 1
|
||||
})
|
||||
}
|
||||
|
||||
const handleDialogClose = () => {
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tips {
|
||||
color: #1f6dd3;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 可拖拽表格行样式提示 */
|
||||
:deep(.drag-table .el-table__row) {
|
||||
cursor: move;
|
||||
/* 鼠标移入行显示拖拽光标 */
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
</style>
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file index.vue 科内开单
|
||||
* @author: w
|
||||
* @since: 2026-03-02
|
||||
* @since: 2026-03-09
|
||||
*/
|
||||
|
||||
<template>
|
||||
@ -11,9 +11,10 @@
|
||||
<div class="box-shadow">
|
||||
<el-row class="top-box">
|
||||
<el-col :span="7">
|
||||
<el-button type="primary" size="small" @click="saveHandle">保存</el-button>
|
||||
<el-button type="primary" size="small" :loading="saveLoading" @click="saveHandle">保存</el-button>
|
||||
<el-button type="primary" size="small" @click="addHandle">新增</el-button>
|
||||
<el-button type="danger" size="small" @click="deleteHandle">删除</el-button>
|
||||
<el-button type="primary" size="small" @click="printHandle">打印</el-button>
|
||||
<el-button type="danger" size="small" @click="deleteHandle">作废</el-button>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<div class="tips">
|
||||
@ -24,28 +25,43 @@
|
||||
</el-row>
|
||||
<el-row :gutter="5" style="height: 100%;">
|
||||
<el-col :span="7">
|
||||
<Info v-model:labPat="labpat" />
|
||||
<Info v-model:labPat="labpat" @getBrdh="getBrdhHandle" />
|
||||
</el-col>
|
||||
<el-col :span="17" style="height: 100%;">
|
||||
<div class="xmBoxs">
|
||||
<!-- <template v-for="item in filterData" :key="item.sflbmc">
|
||||
<div class="title">{{ item.sflbmc }}</div>
|
||||
<el-checkbox-group v-model="checkboxs" @change="handleChecksChange">
|
||||
<el-row>
|
||||
<el-col :span="12" v-for="v in item.children" :key="v.sfxmdh">
|
||||
<el-checkbox :value="v.sfxmdh">
|
||||
{{ v.sfxmmc }}
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-checkbox-group>
|
||||
</template> -->
|
||||
<el-tabs v-model="activeName" type="card" class="tabs_box" @tab-click="handleTabClick">
|
||||
<el-tab-pane v-for="item in xmdlList" :key="item.dictCode" :label="item.dictName" :name="item.dictCode">
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div style="height: calc(60% - 1.875rem)" class="mb5">
|
||||
<CustomVxeTable :table-data="filterData" :columns="xmColumns" @cell-dblclick="dbRowclick"
|
||||
:cell-style="xmcellStyle" keyField='applyid'
|
||||
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style">
|
||||
<template #itemclass="{ row }">
|
||||
{{itemclassList.find((item) => item.itemclassCode == row.itemclass)?.itemclassName}}
|
||||
</template>
|
||||
</CustomVxeTable>
|
||||
</div>
|
||||
<div style="height: calc(40% - 30px)">
|
||||
<CustomVxeTable :table-data="sqXmList" :columns="sqXmColumns" @cell-dblclick="dbRowclick"
|
||||
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style">
|
||||
<template #zt="{ row }">
|
||||
申请
|
||||
<CustomVxeTable :table-data="sqxmCzList" :columns="sqXmColumns" keyField='uid' :cell-style="cellStyle"
|
||||
:config="tableConfig" :scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" ref="xmRef"
|
||||
@selection-change="selectionChange" class="mytable-style">
|
||||
<template #newitemclass="{ row }">
|
||||
{{itemclassList.find((item) => item.itemclassCode == row.newitemclass)?.itemclassName}}
|
||||
</template>
|
||||
<template #newbarcode="{ row }">
|
||||
条码号({{ barcodes }}条)
|
||||
</template>
|
||||
<template #itemclass_yblx="{ row }">
|
||||
<SelectTable v-model:data="row.itemclass_yblx" :tableData="dictData.BT" placeholder="请选择"
|
||||
:clearable="false" v-if="labpat.status < 20 || !labpat.status" value="label"
|
||||
@getDataValue="(data) => { getyblxData(data, row) }" class="full-width-input" />
|
||||
<span v-else> {{ formatDict(row.itemclass_yblx, 'BT') }}</span>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<span v-if="row.rowSeq == 1"> {{ formatDict(labpat.status, 'ZT') }}</span>
|
||||
</template>
|
||||
<template #action="{ row }" v-if="labpat.status < 20 || !labpat.status">
|
||||
<el-button type="danger" :text='true' size="small" @click="delItem(row)">删除</el-button>
|
||||
</template>
|
||||
</CustomVxeTable>
|
||||
</div>
|
||||
@ -56,17 +72,18 @@
|
||||
<el-col :span="8" style="height: 100%;">
|
||||
<div class="box-shadow">
|
||||
<el-form :model="searchForm" inline size="small">
|
||||
<el-form-item label="姓名:" prop="brxm">
|
||||
<el-input v-model="searchForm.brxm" clearable style="width: 9rem;" @change="handleQuery" />
|
||||
<el-form-item label="" prop="brxm">
|
||||
<el-input v-model="searchForm.brxm" clearable style="width: 9.5rem;" @change="handleQuery"
|
||||
placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="status">
|
||||
<SelectTable v-model:data="searchForm.status" :tableData="dictData.SQDZT" clearable style="width: 9.5rem;"
|
||||
placeholder="请选择状态" size="small" @getDataValue="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态:" prop="zt">
|
||||
<SelectTable v-model:data="searchForm.zt" :tableData="lis_req_type" clearable style="width: 9rem;"
|
||||
size="small" @getDataValue="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="begdate">
|
||||
<div class="radio_box">
|
||||
<el-radio-group v-model="searchForm.days" @change="handleQuery">
|
||||
<el-radio-group v-model="searchForm.days" @change="changeDays">
|
||||
<el-radio :value="3">近3天</el-radio>
|
||||
<el-radio :value="7">近7天</el-radio>
|
||||
<el-radio :value="0">此日
|
||||
@ -75,35 +92,23 @@
|
||||
</el-icon>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<el-date-picker v-model="searchForm.begdate" type="date" value-format="YYYY-MM-DD" style="width: 10rem;"
|
||||
@change="handleQuery" />
|
||||
<el-date-picker v-model="today" type="date" value-format="YYYY-MM-DD" style="width: 9rem;"
|
||||
@change="dateHandle" />
|
||||
<!-- <el-tooltip class="box-item" effect="dark" content="打印" placement="top">
|
||||
<el-button type="primary" circle size="small" icon="Memo" @click="printHandle"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="box-item" effect="dark" content="作废" placement="top">
|
||||
<el-button type="danger" circle size="small" icon="Delete" @click="deleteHandle"></el-button>
|
||||
</el-tooltip> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="table-box">
|
||||
<CustomVxeTable :table-data="labPatList" :loading="loading" :columns="tableColumns"
|
||||
@current-change="handleRowClick" size="small"
|
||||
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :row-style="rowStyle"
|
||||
:cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd">
|
||||
<template #brxb="{ row }">
|
||||
{{ formatDict(row.brxb, 'SX') }}
|
||||
</template>
|
||||
<template #nldw="{ row }">
|
||||
{{ formatDict(row.nldw, 'AU') }}
|
||||
</template>
|
||||
<template #yblx="{ row }">
|
||||
{{ formatDict(row.yblx, 'BT') }}
|
||||
</template>
|
||||
|
||||
<template #ksdh="{ row }">
|
||||
{{ formatDict(row.ksdh, 'DP') }}
|
||||
</template>
|
||||
<template #brly="{ row }">
|
||||
{{ formatDict(row.brly, 'PT') }}
|
||||
</template>
|
||||
<template #zt="{ row }">
|
||||
{{ formatDictzt(row.zt) }}
|
||||
@cell-click="handleRowClick" size="small" keyField='applyid' :cell-style="sqdcellStyle"
|
||||
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" ref="tableRef">
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, 'ZT') }}
|
||||
</template>
|
||||
</CustomVxeTable>
|
||||
</div>
|
||||
@ -114,106 +119,302 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup name="Issueorder">
|
||||
import Info from './components/info.vue'
|
||||
import { getDictData, formatDict, dictData } from '@/hooks'
|
||||
import { queryXmInfoList, saveReqInfo, queryPatList, queryPatDetail } from '@/api/liswork/order'
|
||||
import { getXmItemInfo, saveReqInfo, queryRegRequestInfo, queryReqDetail, reqPrint, cancelReq } from '@/api/liswork/order'
|
||||
import dayjs from 'dayjs'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getFirstLetter } from '@/utils/pinyin';
|
||||
|
||||
import { listregdict } from "@/api/regional/dict/regdict.ts";
|
||||
import { checkPrintService } from '@/utils/printHelper.ts';
|
||||
import { listitemclass } from "@/api/regional/dict/itemclass.ts";
|
||||
import { classCom } from '@/utils/classCom';
|
||||
import { useGroupTableData } from '@/utils/groupHelper'
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { lis_req_type } = proxy.useDict("lis_req_type");
|
||||
const labpat = ref({
|
||||
zt: '1'
|
||||
})
|
||||
const checkboxs = ref([])
|
||||
const labpat = ref({})
|
||||
const saveLoading = ref(false)
|
||||
const searchKey = ref('')
|
||||
const loading = ref(false)
|
||||
const tableRef = useTemplateRef('tableRef')
|
||||
const labPatList = ref([])
|
||||
const searchForm = ref({})
|
||||
const xmdlList = ref([])
|
||||
const activeName = ref('')
|
||||
|
||||
const today = ref(dayjs().format('YYYY-MM-DD'))
|
||||
|
||||
// 记录初始数据(用于对比是否有变化)
|
||||
const initialLabPat = ref({})
|
||||
const initialSqxmCzList = ref([])
|
||||
|
||||
const searchForm = ref({
|
||||
brxm: '',
|
||||
status: '',
|
||||
days: 3,
|
||||
begdate: '',
|
||||
enddate: '',
|
||||
})
|
||||
|
||||
const tableColumns = ref([
|
||||
{ field: 'brxm', title: '姓名', width: 40, align: 'center', resizable: true, },
|
||||
{ field: 'zt', title: '状态', width: 40, align: 'center', slotName: 'zt', resizable: true, },
|
||||
{ field: 'sqsj', title: '登记时间', width: 80, align: 'center', resizable: true },
|
||||
{ field: 'sqr', title: '登记人', width: 80, align: 'center', resizable: true },
|
||||
{ field: 'jymd', title: '项目', align: 'center', resizable: true },
|
||||
{ field: 'inputDate', title: '登记时间', width: 80, align: 'center', resizable: true },
|
||||
{ field: 'rowSeq', title: 'No', width: 40, align: 'center', resizable: true },
|
||||
{ field: 'patName', title: '姓名', width: 80, align: 'center', resizable: true, },
|
||||
{ field: 'status', title: '状态', width: 80, align: 'center', slotName: 'status', resizable: true, },
|
||||
{ field: 'userName', title: '登记人', width: 80, align: 'center', resizable: true },
|
||||
{ field: 'reqDetailName', title: '项目', width: 200, align: 'center', resizable: true },
|
||||
{ field: 'patId', title: '病人代号', align: 'center', width: 80, resizable: true },
|
||||
])
|
||||
|
||||
const rowStyle = ({ row }) => {
|
||||
const sqdcellStyle = ({ row, column }) => {
|
||||
if (column.title == "状态") {
|
||||
return {
|
||||
backgroundColor: getColor(row.status),
|
||||
// color: ,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const cellStyle = ({ row, column }) => {
|
||||
const getColor = (type) => {
|
||||
switch (type) {
|
||||
case '10':
|
||||
return '';
|
||||
case '20':
|
||||
return ' rgba(238, 8, 8, 0.25)';
|
||||
case '30':
|
||||
return 'rgba(0, 128, 0, 0.25)';
|
||||
case '40':
|
||||
return 'rgba(255, 165, 0, 0.25)';
|
||||
case '50':
|
||||
return 'rgba(255, 165, 0, 0.25)';
|
||||
default:
|
||||
return 'rgba(40, 189, 187, 0.25)';
|
||||
}
|
||||
}
|
||||
|
||||
const handleRowClick = (row) => {
|
||||
queryPatDetail({ sqh: row.sqh }).then(res => {
|
||||
labpat.value = res.data.labReqmain
|
||||
labpat.value.zt = labpat.value.zt.trim()
|
||||
sqXmList.value = res.data.reqInputLisWorkVOList
|
||||
checkboxs.value = res.data.reqInputLisWorkVOList.map(item => item.sfxmdh)
|
||||
|
||||
const deepClone = (data) => {
|
||||
return JSON.parse(JSON.stringify(data))
|
||||
}
|
||||
|
||||
// 更新初始数据(在新增/加载数据时调用)
|
||||
const updateInitialData = () => {
|
||||
initialLabPat.value = deepClone(labpat.value)
|
||||
initialSqxmCzList.value = deepClone(sqxmCzList.value)
|
||||
}
|
||||
|
||||
// 判断数据是否有变化
|
||||
const isDataChanged = () => {
|
||||
const labPatChanged = JSON.stringify(labpat.value) !== JSON.stringify(initialLabPat.value)
|
||||
const sqxmChanged = JSON.stringify(sqxmCzList.value) !== JSON.stringify(initialSqxmCzList.value)
|
||||
return labPatChanged || sqxmChanged
|
||||
}
|
||||
|
||||
const rowInfo = ref({})
|
||||
|
||||
const handleRowClick = ({ row }) => {
|
||||
rowInfo.value = row
|
||||
if (!row?.applyid) return
|
||||
queryReqDetail({ applyId: row.applyid }).then(res => {
|
||||
labpat.value = res.data.regApply
|
||||
sqXmList.value = res.data.regApplyDetailList.map(item => ({
|
||||
itemcode: item.orderItemCode,
|
||||
itemname: item.orderItemName,
|
||||
itemclass_yblx: item.sampleTypeName,
|
||||
amount: item.amount,
|
||||
applyid: item.applyid,
|
||||
uid: item.uid,
|
||||
classid: item.classid,
|
||||
barcode: item.barcode,
|
||||
itemclass: item.itemclass,
|
||||
itemclass_tips: item.itemclass_tips
|
||||
}))
|
||||
// 异步初始化数据
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
updateInitialData()
|
||||
}, 10);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
searchForm.value.begdate = dayjs(searchForm.value.begdate).format('YYYY-MM-DD') + ' 00:00:00'
|
||||
const changeDays = (val) => {
|
||||
if (val == 3) {
|
||||
searchForm.value.begdate = dayjs().subtract(3, 'day').format('YYYY-MM-DD') + ' 00:00:00'
|
||||
searchForm.value.enddate = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (val == 7) {
|
||||
searchForm.value.begdate = dayjs().subtract(7, 'day').format('YYYY-MM-DD') + ' 00:00:00'
|
||||
searchForm.value.enddate = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else {
|
||||
searchForm.value.begdate = dayjs(today.value).format('YYYY-MM-DD') + ' 00:00:00'
|
||||
searchForm.value.enddate = dayjs(searchForm.value.begdate).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
}
|
||||
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const dateHandle = (val) => {
|
||||
searchForm.value.begdate = dayjs(val).format('YYYY-MM-DD') + ' 00:00:00'
|
||||
searchForm.value.enddate = dayjs(searchForm.value.begdate).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
queryPatList(searchForm.value).then(res => {
|
||||
labPatList.value = res.data
|
||||
if (!res.data.length) {
|
||||
labpat.value = {
|
||||
zt: '1'
|
||||
}
|
||||
} else {
|
||||
handleRowClick(res.data[0])
|
||||
handleQuery()
|
||||
}
|
||||
const handleQuery = () => {
|
||||
rowInfo.value = {}
|
||||
queryRegRequestInfo(searchForm.value).then(res => {
|
||||
// 数据分组
|
||||
const { tableData } = useGroupTableData(
|
||||
res.data,
|
||||
'orderDate', // 分组字段
|
||||
['inputDate',], // 仅第一条显示的字段
|
||||
'orderDate', // 排序字段
|
||||
['orderDate'],//原数据赋值对应字段
|
||||
)
|
||||
|
||||
labPatList.value = tableData.value
|
||||
if (!labpat.value.status) {
|
||||
const item = res.data.find(item => item.patId == labpat.value.patId)
|
||||
|
||||
nextTick(() => {
|
||||
tableRef.value.setCurrentRow(item)
|
||||
handleRowClick({ row: item })
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取病人代号查询信息
|
||||
const getBrdhHandle = (val) => {
|
||||
console.log("🚀 ~ getBrdhHandle ~ val:", val)
|
||||
|
||||
|
||||
|
||||
}
|
||||
//保存
|
||||
const saveHandle = () => {
|
||||
if (!labpat.value.brdh) return ElMessage.warning('病人代号不能为空!')
|
||||
if (!labpat.value.yblx) return ElMessage.warning('样本类型不能为空!')
|
||||
if (!labpat.value.patId) return ElMessage.warning('病人代号不能为空!')
|
||||
if (!labpat.value.patName) return ElMessage.warning('病人姓名不能为空!')
|
||||
if (!labpat.value.patSex) return ElMessage.warning('病人性别不能为空!')
|
||||
if (!labpat.value.patAge && !labpat.value.ageUnit) return ElMessage.warning('病人年龄不能为空!')
|
||||
if (!sqXmList.value.length) return ElMessage.warning('请选择项目!')
|
||||
labpat.value.status = labpat.value.status ? labpat.value.status : ''
|
||||
const data = {
|
||||
labReqmain: labpat.value,
|
||||
reqInputLisWorkVOList: sqXmList.value
|
||||
regApply: labpat.value,
|
||||
regApplyDetailList: sqxmCzList.value.map(item => ({
|
||||
orderItemCode: item.itemcode,
|
||||
orderItemName: item.itemname,
|
||||
sampleTypeCode: item.itemclass_yblx,
|
||||
sampleTypeName: item.itemclass_yblx,
|
||||
amount: item.amount,
|
||||
applyid: labpat.value.applyid,
|
||||
uid: item.uid
|
||||
}))
|
||||
}
|
||||
saveLoading.value = true
|
||||
saveReqInfo(data).then(res => {
|
||||
handleQuery()
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('保存成功!')
|
||||
handleQuery()
|
||||
updateInitialData()
|
||||
}
|
||||
}).finally(() => {
|
||||
saveLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const addHandle = () => {
|
||||
labpat.value = {
|
||||
zt: '1'
|
||||
}
|
||||
labpat.value = {}
|
||||
sqXmList.value = []
|
||||
updateInitialData()
|
||||
}
|
||||
const deleteHandle = () => {
|
||||
if (!rowInfo.value.applyid) return ElMessage.warning('请选择要作废的申请单!')
|
||||
ElMessageBox.confirm('确定要作废此申请单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
cancelReq({ applyId: rowInfo.value.applyid }).then(res => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success(res.msg)
|
||||
handleQuery()
|
||||
}
|
||||
})
|
||||
}).catch(() => { })
|
||||
|
||||
}
|
||||
|
||||
// 更新列配置
|
||||
const handleColumnDragEnd = (data) => {
|
||||
const printHandle = () => {
|
||||
if (isDataChanged()) {
|
||||
ElMessageBox.confirm('数据已修改,请先保存后再打印!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
saveHandle()
|
||||
}).catch(() => { })
|
||||
return
|
||||
}
|
||||
const selectList = xmRef.value.allSelection()
|
||||
|
||||
tableColumns.value = [];
|
||||
let arr = selectList.map(item => {
|
||||
return {
|
||||
applyId: item.applyid,
|
||||
barcode: item.barcode,
|
||||
}
|
||||
})
|
||||
const uniqueData = [];
|
||||
const tempObj = {}; // 记录已出现的 barcode
|
||||
|
||||
nextTick(() => {
|
||||
tableColumns.value = [...data.columns];
|
||||
arr.forEach(item => {
|
||||
// 若 tempObj 中无该 barcode,则保留并记录
|
||||
if (!tempObj[item.barcode]) {
|
||||
tempObj[item.barcode] = true;
|
||||
uniqueData.push(item);
|
||||
}
|
||||
});
|
||||
if (labpat.value.status > 10) return ElMessage.warning('申请单已审核,不能打印条码!')
|
||||
if (!uniqueData.length) return ElMessage.warning('请选择要打印的条码!')
|
||||
checkPrintService().then((isConnected) => {
|
||||
if (!isConnected) return
|
||||
reqPrint(uniqueData).then(res => {
|
||||
if (res.code == 0) {
|
||||
handleRowClick({ row: rowInfo.value })
|
||||
ElMessage.success('正在打印中...')
|
||||
handleQuery()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
const filterData = ref([])
|
||||
const xmColumns = ref([
|
||||
{ field: 'sflbmc', title: '类别', align: 'center', resizable: true },
|
||||
{ field: 'sfxmdh', title: '代号', align: 'center', resizable: true },
|
||||
{ field: 'sfxmmc', title: '简称', align: 'center', width: 150, resizable: true },
|
||||
{ field: 'dj', title: '单价', align: 'center', resizable: true },
|
||||
{ field: 'spec', title: '规格', align: 'center', resizable: true },
|
||||
{ field: 'yblx', title: '样本', align: 'center', resizable: true },
|
||||
{ field: 'itemcode', title: '代号', align: 'center', resizable: true },
|
||||
{ field: 'itemname', title: '简称', align: 'center', width: 280, resizable: true },
|
||||
{ field: 'price', title: '单价', align: 'center', resizable: true },
|
||||
{ field: 'itemclass', title: '类别', align: 'center', slotName: 'itemclass', resizable: true },
|
||||
{ field: 'itemclass_tips', title: '采样提示', align: 'center', resizable: true },
|
||||
{ field: 'itemclass_yblx', title: '样本', align: 'center', resizable: true },
|
||||
])
|
||||
|
||||
const xmcellStyle = ({ row, column }) => {
|
||||
if (column.title == "类别") {
|
||||
const bkcolor = itemclassList.value.find((item) => item.itemclassCode == row.itemclass)?.itemclassBkcolor;
|
||||
const bgColor = classCom.decimalToHexColor(bkcolor);
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
return {
|
||||
backgroundColor: `${bgColor} !important`,
|
||||
color: textColor,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const searchList = ref([])
|
||||
|
||||
const handleTabClick = (tab) => {
|
||||
const currentTab = xmdlList.value.find(item => item.dictCode === tab.paneName)
|
||||
if (currentTab) {
|
||||
searchList.value = processedTableData.value.filter(item => item.classid === currentTab.dictCode)
|
||||
filterData.value = [...searchList.value]
|
||||
}
|
||||
}
|
||||
|
||||
const processedTableData = ref([])
|
||||
|
||||
@ -222,21 +423,21 @@ const filterDictData = () => {
|
||||
|
||||
if (!key) {
|
||||
// 空搜索时显示全部预处理数据
|
||||
filterData.value = resultList([...processedTableData.value])
|
||||
filterData.value = [...searchList.value]
|
||||
return;
|
||||
}
|
||||
|
||||
filterData.value = resultList(processedTableData.value.filter((item) => {
|
||||
filterData.value = searchList.value.filter((item) => {
|
||||
const matchName = item.itemname.toString().toLowerCase().includes(key);
|
||||
const matchLabel = item.pinyin.toString().toLowerCase().includes(key);
|
||||
return matchLabel;
|
||||
return matchLabel || matchName;
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
const processTableData = (data) => {
|
||||
return data.map((item) => {
|
||||
const pinyinMap = {};
|
||||
pinyinMap['pinyin'] = getFirstLetter(item.sfxmmc).toLowerCase();
|
||||
pinyinMap['pinyin'] = getFirstLetter(item.itemname).toLowerCase();
|
||||
return { ...item, ...pinyinMap };
|
||||
});
|
||||
};
|
||||
@ -244,71 +445,141 @@ const processTableData = (data) => {
|
||||
const sqXmList = ref([])
|
||||
|
||||
const sqXmColumns = ref([
|
||||
{ field: 'sflbmc', title: '类别', align: 'center', resizable: true },
|
||||
{ field: 'sfxmdh', title: '代号', align: 'center', resizable: true },
|
||||
{ field: 'sfxmmc', title: '简称', align: 'center', width: 150, resizable: true },
|
||||
{ field: 'dj', title: '单价', align: 'center', resizable: true },
|
||||
{ field: 'spec', title: '规格', align: 'center', resizable: true },
|
||||
{ field: 'yblx', title: '样本', align: 'center', resizable: true },
|
||||
{ field: 'zt', title: '状态', align: 'center', resizable: true, slotName: 'zt' },
|
||||
{ type: 'selection', field: '', title: '', resizable: true, align: 'center', width: 40 },
|
||||
{ field: 'newitemclass', title: '类别', align: 'center', width: 100, slotName: 'newitemclass', resizable: true },
|
||||
{ field: 'newitemclass_tips', title: '采样提示', align: 'center', width: 80, resizable: true },
|
||||
{ field: 'itemname', title: '简称', align: 'center', resizable: true },
|
||||
{ field: 'newbarcode', title: '条码号', align: 'center', width: 120, resizable: true, headerSlot: 'newbarcode' },
|
||||
{ field: 'amount', title: '单价', align: 'center', width: 60, resizable: true },
|
||||
{ field: 'itemclass_yblx', title: '样本', align: 'center', width: 80, slotName: 'itemclass_yblx', resizable: true },
|
||||
{ field: 'status', title: '状态', align: 'center', resizable: true, width: 80, slotName: 'status' },
|
||||
])
|
||||
|
||||
const handleChecksChange = (val) => {
|
||||
console.log('val==>', val);
|
||||
sqXmList.value = []
|
||||
val.forEach(item => {
|
||||
const existingItem = processedTableData.value.find((row) => row.sfxmdh == item)
|
||||
if (existingItem) {
|
||||
sqXmList.value.push(existingItem)
|
||||
const cellStyle = ({ row, column }) => {
|
||||
if (column.title == "类别" && row.newitemclass) {
|
||||
const bkcolor = itemclassList.value.find((item) => item.itemclassCode == row.itemclass)?.itemclassBkcolor;
|
||||
const bgColor = classCom.decimalToHexColor(bkcolor);
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
return {
|
||||
backgroundColor: `${bgColor} !important`,
|
||||
color: textColor,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const getyblxData = (data, row) => {
|
||||
sqXmList.value.forEach(item => {
|
||||
if (row.uid == item.uid) {
|
||||
item.itemclass_yblx = data.label
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
const dbRowclick = ({ row }) => {
|
||||
const index = sqXmList.value.findIndex((item) => item.sfxmdh == row.sfxmdh)
|
||||
if (index > -1) {
|
||||
|
||||
// 已申请的项目
|
||||
const sqxmCzList = computed(() => {
|
||||
// 数据分组
|
||||
const { tableData } = useGroupTableData(
|
||||
sqXmList.value,
|
||||
'itemclass',
|
||||
['newitemclass', 'newbarcode', 'newitemclass_tips'],
|
||||
'orderDate',
|
||||
['itemclass', 'barcode', 'itemclass_tips'],
|
||||
)
|
||||
|
||||
return tableData.value
|
||||
})
|
||||
|
||||
watch(
|
||||
sqxmCzList,
|
||||
() => {
|
||||
nextTick(() => {
|
||||
// 等待 DOM 渲染完成后执行勾选
|
||||
if (labpat.value.status < 20 && xmRef.value) {
|
||||
sqxmCzList.value.forEach(item => {
|
||||
xmRef.value.toggleRowSelection(item, true)
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
|
||||
const barcodes = computed(() => {
|
||||
return Array.from(new Set(sqxmCzList.value.map(item => item.barcode))).length
|
||||
})
|
||||
|
||||
|
||||
|
||||
const tableConfig = ref({
|
||||
actionWidth: 60,
|
||||
// 复选框配置
|
||||
checkboxConfig: {
|
||||
// 可选配置项
|
||||
checkField: 'checked', // 绑定数据中的字段(默认:checked)
|
||||
range: false, // 是否支持范围选择(按住 Shift 连续选择)
|
||||
disabled: false, // 是否禁用全部复选框
|
||||
reserve: false, // 是否保留勾选状态(分页/筛选时)
|
||||
highlight: false // 是否高亮选中行
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const xmRef = useTemplateRef('xmRef')
|
||||
|
||||
const selectionChange = (checked, row, selection) => {
|
||||
// console.log('==>', checked, row, selection);
|
||||
sqxmCzList.value.forEach(item => {
|
||||
if (row.barcode === item.barcode) {
|
||||
xmRef.value.toggleRowSelection(item, checked)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const delItem = (row) => {
|
||||
const index = sqXmList.value.findIndex(item => item.itemcode === row.itemcode)
|
||||
if (index !== -1) {
|
||||
sqXmList.value.splice(index, 1)
|
||||
}
|
||||
}
|
||||
|
||||
const dbRowclick = ({ row }) => {
|
||||
if (labpat.value.status > 10) return ElMessage.warning('申请单已审核,不能添加项目!')
|
||||
const index = sqXmList.value.findIndex(item => item.itemcode == row.itemcode)
|
||||
if (index > -1) {
|
||||
ElMessage.warning('已存在该项目')
|
||||
return
|
||||
}
|
||||
sqXmList.value.push({ ...row, amount: row.price })
|
||||
}
|
||||
|
||||
const getXmList = () => {
|
||||
queryXmInfoList().then(res => {
|
||||
getXmItemInfo().then(res => {
|
||||
processedTableData.value = processTableData(res.data);
|
||||
filterData.value = resultList([...processedTableData.value])
|
||||
filterData.value = [...processedTableData.value]
|
||||
})
|
||||
}
|
||||
|
||||
//数据分类
|
||||
const resultList = (arr) => {
|
||||
const categoryList = Array.from(new Set(arr.map(item => item.sflbmc))).map(v => {
|
||||
return {
|
||||
sflbmc: v,
|
||||
children: []
|
||||
}
|
||||
})
|
||||
const itemclassList = ref([]) // 容器类别
|
||||
|
||||
categoryList.forEach(item => {
|
||||
arr.forEach(v => {
|
||||
if (item.sflbmc == v.sflbmc) {
|
||||
item.children.push(v)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
return categoryList
|
||||
}
|
||||
|
||||
const formatDictzt = (value) => {
|
||||
const item = lis_req_type.value.find(i => i.value === value.trim());
|
||||
return item ? item.label : value;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
searchForm.value.begdate = dayjs().format('YYYY-MM-DD')
|
||||
changeDays(3)
|
||||
getXmList()
|
||||
getDictData('PT', 'SX', 'AU', 'BT', 'DP', 'SRD', 'ZJLX')
|
||||
})
|
||||
getDictData('PT', 'SX', 'AU', 'ZT', 'ZJLX', 'DEPT', 'DOCTOR', 'SLZQ', 'BT', 'SQDZT')
|
||||
listregdict({ dictType: 'CLASS' }).then(response => {
|
||||
xmdlList.value = response.rows;
|
||||
activeName.value = xmdlList.value.length > 0 ? xmdlList.value[0].dictCode : '';
|
||||
handleTabClick({ paneName: activeName.value });
|
||||
});
|
||||
listitemclass({ pageSize: 9999, pageNum: 1 }).then(response => {
|
||||
itemclassList.value = response.rows;
|
||||
})
|
||||
|
||||
// 初始化初始值
|
||||
updateInitialData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -347,7 +618,6 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.xmBoxs {
|
||||
:deep(.el-checkbox__label) {}
|
||||
|
||||
height: 60%;
|
||||
overflow-y: auto;
|
||||
|
||||
77
src/views/liswork/Issueorder/indexb.vue
Normal file
@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<div class="table-container">
|
||||
<!-- vxe-table 核心组件 -->
|
||||
<vxe-table border :data="tableData" :group-config="groupConfig" :expand-config="{ trigger: 'row', showIcon: true }"
|
||||
style="width: 100%;">
|
||||
<!-- 时间列:格式化显示 -->
|
||||
<vxe-column field="createTime" title="创建时间" width="220" :formatter="formatDate" />
|
||||
<!-- 业务列 -->
|
||||
<vxe-column field="name" title="订单名称" width="150" />
|
||||
<vxe-column field="amount" title="订单金额" width="120" />
|
||||
<vxe-column field="status" title="订单状态" width="120" />
|
||||
</vxe-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
|
||||
|
||||
// 2. 定义响应式表格数据(包含时间字段)
|
||||
const tableData = ref([
|
||||
{ id: 1, name: '订单1', amount: 100, status: '已支付', createTime: '2026-03-15 08:30:00' },
|
||||
{ id: 2, name: '订单2', amount: 200, status: '已支付', createTime: '2026-03-15 09:40:00' },
|
||||
{ id: 3, name: '订单3', amount: 150, status: '待支付', createTime: '2026-03-16 10:20:00' },
|
||||
{ id: 4, name: '订单4', amount: 300, status: '已取消', createTime: '2026-04-15 14:10:00' },
|
||||
{ id: 5, name: '订单5', amount: 250, status: '已支付', createTime: '2026-04-16 15:30:00' }
|
||||
])
|
||||
|
||||
// 3. 时间格式化方法
|
||||
const formatDate = ({ cellValue }) => {
|
||||
return cellValue
|
||||
// 格式化时间为:年-月-日 时:分:秒
|
||||
// return xeUtils.toDateString(cellValue, 'yyyy-MM-dd HH:mm:ss')
|
||||
}
|
||||
|
||||
// 4. 分组配置(核心:按时间分组)
|
||||
const groupConfig = reactive({
|
||||
// 分组字段配置
|
||||
fields: [
|
||||
{
|
||||
field: 'createTime', // 要分组的原始字段
|
||||
// 分组标题显示格式
|
||||
formatter: ({ cellValue }) => {
|
||||
// 分组行显示:xxxx年xx月xx日
|
||||
const date = xeUtils.toDate(cellValue)
|
||||
return `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日`
|
||||
},
|
||||
// 分组判断逻辑(核心:返回相同值则归为一组)
|
||||
getter: ({ cellValue }) => {
|
||||
// 👉 按需修改分组粒度:
|
||||
// 按【日】分组(默认):return xeUtils.toDateString(cellValue, 'yyyy-MM-dd')
|
||||
// 按【月】分组:return xeUtils.toDateString(cellValue, 'yyyy-MM')
|
||||
// 按【年】分组:return xeUtils.toDateString(cellValue, 'yyyy')
|
||||
return xeUtils.toDateString(cellValue, 'yyyy-MM-dd')
|
||||
}
|
||||
}
|
||||
],
|
||||
showGroup: true, // 显示分组汇总行
|
||||
showFooter: true, // 显示分组脚注
|
||||
expandAll: true, // 默认展开所有分组
|
||||
// 可选:分组汇总行的自定义内容
|
||||
groupMethod: ({ rows, field }) => {
|
||||
if (field === 'createTime') {
|
||||
// 计算当前分组的金额总和
|
||||
const total = rows.reduce((sum, item) => sum + item.amount, 0)
|
||||
return { amount: `合计:${total} 元` }
|
||||
}
|
||||
return ''
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
11
src/views/liswork/dict/data.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
404
src/views/liswork/dict/index.vue
Normal file
@ -0,0 +1,404 @@
|
||||
<script setup>
|
||||
import { computed, reactive, ref, onMounted, nextTick } from "vue";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { listregdict, addregdict, delregdict, getregdict, updateregdict } from "@/api/regional/dict/regdict.ts";
|
||||
import { getComDicts } from "@/api/liswork/dict/ComDict";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
dictName: undefined,
|
||||
dictType: '00',
|
||||
dictCode: undefined,
|
||||
yljg: '1'
|
||||
},
|
||||
|
||||
rules: {
|
||||
dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }],
|
||||
dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }]
|
||||
},
|
||||
});
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const loading = ref(true);
|
||||
const typeList = ref([])
|
||||
const typeDetail = ref([])
|
||||
const total = ref(0);
|
||||
const dictTypemc = ref('');
|
||||
const open = ref(false);
|
||||
const title = ref('');
|
||||
// const dictTypemcComputed = computed(() => {
|
||||
// return typeDetail.value.map(item => {
|
||||
// return item.dictCode+'('+item.dictName+')';
|
||||
// });
|
||||
// });
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/comdict/importData"
|
||||
});
|
||||
const treeRef = ref(null)
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'dictName',
|
||||
id: 'dictCode'
|
||||
}
|
||||
|
||||
const info = ref({})
|
||||
watch(dictTypemc, (val) => {
|
||||
console.log(ref(treeRef.value));
|
||||
|
||||
treeRef.value?.filter(val)
|
||||
})
|
||||
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true
|
||||
return data.dictName.includes(value)
|
||||
}
|
||||
|
||||
const nodeHandle = (data) => {
|
||||
queryParams.value.dictType = data.dictCode
|
||||
getList()
|
||||
}
|
||||
function resetData(dictType) {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
dictName: undefined,
|
||||
dictType: dictType,
|
||||
dictCode: undefined,
|
||||
yljg: '1'
|
||||
}
|
||||
}
|
||||
function getTypeList() {
|
||||
getComDicts({ dict_type: 'DTYPE' }).then(response => {
|
||||
typeList.value = response.data;
|
||||
queryParams.value.dictType = response.data[0].dictCode
|
||||
treeRef.value.setCurrentKey(response.data[0].dictCode)
|
||||
getList()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 查询字典明细列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listregdict(queryParams.value).then(response => {
|
||||
typeDetail.value = response.rows;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
//查询
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
dictType: '',
|
||||
dictName: '',
|
||||
dictCode: '',
|
||||
dictSort: 1,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("dictRef");
|
||||
}
|
||||
//重置
|
||||
function resetQuery() {
|
||||
queryParams.value.dictName = ''
|
||||
queryParams.value.dictCode = ''
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
//新增
|
||||
function handleAdd() {
|
||||
if (!queryParams.value.dictType) {
|
||||
proxy.$modal.msgWarning("请先选择字典大类");
|
||||
return;
|
||||
}
|
||||
reset();
|
||||
form.value.dictType = queryParams.value.dictType;
|
||||
open.value = true;
|
||||
title.value = '新增字典';
|
||||
}
|
||||
|
||||
//修改
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
form.value = row.dictType ? row : info.value
|
||||
open.value = true;
|
||||
}
|
||||
|
||||
//删除
|
||||
function handleDelete(row) {
|
||||
proxy.$modal.confirm('是否确认删除字典名称为"' + row.dictName + '"的数据项?').then(function () {
|
||||
return delregdict(row.dictId);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导入按钮操作 */
|
||||
function handleImport() {
|
||||
upload.title = "字典导入";
|
||||
upload.open = true;
|
||||
};
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("comdict/export", {
|
||||
...queryParams.value,
|
||||
}, `user_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download("comdict/importTemplate", {
|
||||
}, `user_template_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
proxy.$refs["uploadRef"].submit();
|
||||
};
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
proxy.$refs["uploadRef"].handleRemove(file);
|
||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
handleQuery()
|
||||
};
|
||||
|
||||
|
||||
//多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
info.value = selection[0]
|
||||
single.value = selection.length != 1;
|
||||
}
|
||||
|
||||
|
||||
function submitForm() {
|
||||
proxy.$refs["dictRef"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
if (form.value.dictId != undefined) {
|
||||
updateregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getTypeList()
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input v-model="dictTypemc" clearable placeholder="请输入字典名称" prefix-icon="Search"
|
||||
style="margin-bottom: 20px" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<div class="card-content">
|
||||
<el-tree ref="treeRef" class="filter-tree" :data="typeList" :props="defaultProps" default-expand-all
|
||||
node-key="dictCode" :filter-node-method="filterNode" @node-click="nodeHandle" highlight-current />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 字典明细-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<!-- 表单区域-->
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
|
||||
<el-form-item class="cus-el-form-item" label="名称" prop="dictName">
|
||||
<el-input v-model="queryParams.dictName" placeholder="请输入名称" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item class="cus-el-form-item" label="明细代号" prop="status">
|
||||
<el-input v-model="queryParams.dictCode" placeholder="请输入明细代号" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['system:dict:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:dict:remove']">删除</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport"
|
||||
v-hasPermi="['system:dict:import']">导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['system:dict:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 表格区域-->
|
||||
<el-table v-loading="loading" :data="typeDetail" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label='字典类型' align="center" prop="dictType" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="明细代号" align="center" prop="dictCode" />
|
||||
<el-table-column label="名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="备注" align="center" prop="bz" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(row)"
|
||||
v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(row)"
|
||||
v-hasPermi="['system:dict:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典类别" prop="dictType">
|
||||
<el-input v-model="form.dictType" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典代号" prop="dictCode">
|
||||
<el-input v-model="form.dictCode" placeholder="请输入字典代号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<div class="el-upload__tip">
|
||||
<el-checkbox v-model="upload.updateSupport" />是否覆盖已经存在的字典数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.card-content {
|
||||
.card-content {
|
||||
max-height: 450px;
|
||||
/* 设置最大高度 */
|
||||
overflow-y: auto;
|
||||
/* 超出高度时显示垂直滚动条 */
|
||||
padding: 16px;
|
||||
/* 保持与卡片默认一致的内边距 */
|
||||
}
|
||||
|
||||
.clickable:hover {
|
||||
cursor: pointer;
|
||||
/* 鼠标悬停时显示手型 */
|
||||
transition: all 0.3s;
|
||||
/* 平滑过渡效果 */
|
||||
color: blue;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.filter-tree {
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
441
src/views/liswork/xtwh/components/DynamicInput.vue
Normal file
@ -0,0 +1,441 @@
|
||||
<template>
|
||||
<div class="dynamic-input-container">
|
||||
<!-- 1. 开关组件(替代原单选框 type=0:是/否 → 开启/关闭) -->
|
||||
<el-switch
|
||||
class="custom-switch"
|
||||
v-if="type === '0'"
|
||||
v-model="innerValue"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="handleSwitchChange"
|
||||
/>
|
||||
|
||||
<!-- 2. 下拉框(1):直接绑定value -->
|
||||
<el-select
|
||||
v-else-if="type === '1'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
clearable
|
||||
@change="handleValueChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<!-- 3. 字典单选(2):绑定zddh(value),显示zdmc(label) -->
|
||||
<el-select
|
||||
v-else-if="type === '2'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
clearable
|
||||
@change="handleValueChange"
|
||||
v-loading="dictLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<!-- 4. 字典多选(3):数组↔逗号分隔字符串 → 修复核心:仅绑定multipleValue,移除冗余逻辑 -->
|
||||
<el-select
|
||||
v-else-if="type === '3'"
|
||||
v-model="multipleValue"
|
||||
size="small"
|
||||
multiple
|
||||
@change="handleMultipleChange"
|
||||
v-loading="dictLoading"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<!-- 5. 特殊(4) -->
|
||||
<el-input
|
||||
v-else-if="type === '4'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
disabled
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
|
||||
<!-- 6. 文本框(5) -->
|
||||
<el-input
|
||||
v-else-if="type === '5'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
|
||||
<!-- 7. 数字框(6):支持dictData定义小数位数,空值初始化 -->
|
||||
<el-input-number
|
||||
v-else-if="type === '6'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
:min="minNum"
|
||||
:precision="finalPrecision"
|
||||
controls-position="right"
|
||||
@change="handleValueChange"
|
||||
:placeholder="placeholder || '请输入数字'"
|
||||
/>
|
||||
|
||||
<!-- 8. 日期框(7):适配yyyy/mm/dd -->
|
||||
<el-date-picker
|
||||
v-else-if="type === '7'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
type="date"
|
||||
format="YYYY/MM/DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
|
||||
<!-- 9. 时间框(8):适配hh:mm(修复标签闭合问题) -->
|
||||
<el-time-picker
|
||||
v-else-if="type === '8'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm:ss"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
:picker-options="{ selectableRange: '00:00:00 - 23:59:59' }"
|
||||
/>
|
||||
|
||||
<!-- 兜底:默认文本框 -->
|
||||
<el-input
|
||||
v-else
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DynamicInput">
|
||||
import { ref, watch, defineProps, defineEmits, onMounted, computed } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { getoptionselect } from "@/api/liswork/xtwh/localconfigApi.ts";
|
||||
|
||||
// 字典缓存:key=字典类型,value=映射后的{label,value}列表
|
||||
const dictCache = ref({});
|
||||
|
||||
// Props定义
|
||||
const props = defineProps({
|
||||
modelValue: { // Vue3 规范:v-model 绑定 modelValue
|
||||
type: [String, Number, Boolean, null, undefined], // 新增null/undefined支持空值
|
||||
required: false, // 允许空值
|
||||
default: ""
|
||||
},
|
||||
type: { type: String, required: true, default: "5" },
|
||||
dictData: { type: [String, Number, Object, Array], default: "" }, // 支持Number类型(小数位数)
|
||||
placeholder: { type: String, default: "请输入值" },
|
||||
minNum: { type: Number, default: -Infinity }, // 数字框最小值改为无限制(空值场景)
|
||||
precisionNum: { type: Number, default: 0 } // 默认整数
|
||||
});
|
||||
|
||||
// Emits定义(统一触发 update:modelValue)
|
||||
const emit = defineEmits(["update:modelValue", "change"]);
|
||||
|
||||
// 内部状态
|
||||
const innerValue = ref(null); // 初始值改为null,适配空值
|
||||
const multipleValue = ref([]); // 多选值(仅type=3用)→ 核心:初始化为空数组,杜绝默认0
|
||||
const dictOptions = ref([]); // 下拉/字典选项列表
|
||||
const dictLoading = ref(false); // 字典加载状态
|
||||
|
||||
// ========== 核心:数字框小数位数计算 ==========
|
||||
const finalPrecision = computed(() => {
|
||||
if (props.type !== "6") return props.precisionNum;
|
||||
|
||||
// dictData为小数保留位数(优先级最高)
|
||||
if (props.dictData !== "" && props.dictData !== null && props.dictData !== undefined) {
|
||||
const precision = Number(props.dictData);
|
||||
return isNaN(precision) ? 0 : Math.max(0, precision); // 确保非负整数
|
||||
}
|
||||
|
||||
// dictData为空,默认整数(precisionNum=0)
|
||||
return 0;
|
||||
});
|
||||
|
||||
// ========== 核心修复:值初始化 + 格式适配 → 重点优化多选逻辑 ==========
|
||||
watch(() => props.modelValue, (newVal) => {
|
||||
const val = newVal; // 移除兜底空值,保留原始值
|
||||
switch (props.type) {
|
||||
// 开关组件(替代原单选框):后端1/0 → 前端"1"/"0"
|
||||
case "0":
|
||||
innerValue.value = (val === 1 || val === "1" || val === true) ? "1" : "0";
|
||||
break;
|
||||
|
||||
// 下拉框/字典单选:直接绑定value(zddh)
|
||||
case "1":
|
||||
case "2":
|
||||
innerValue.value = val === null || val === undefined ? "" : String(val);
|
||||
break;
|
||||
|
||||
// 字典多选:核心修复 → 严格过滤空值/无效值,杜绝默认0
|
||||
case "3":
|
||||
// 1. 空值/0/空字符串 → 空数组
|
||||
if (val === null || val === undefined || val === "" || val === 0) {
|
||||
multipleValue.value = [];
|
||||
}
|
||||
// 2. 有效字符串 → 分割为数组(过滤空项)
|
||||
else if (typeof val === "string") {
|
||||
multipleValue.value = val.split(",").filter(item => item.trim() !== "").map(item => String(item));
|
||||
}
|
||||
// 3. 数组类型(特殊场景)→ 直接赋值
|
||||
else if (Array.isArray(val)) {
|
||||
multipleValue.value = val.filter(item => item !== null && item !== undefined && item !== "").map(item => String(item));
|
||||
}
|
||||
// 4. 其他类型 → 空数组
|
||||
else {
|
||||
multipleValue.value = [];
|
||||
}
|
||||
// 移除innerValue同步(避免干扰多选)
|
||||
break;
|
||||
|
||||
// 数字框:空值处理,支持小数位数
|
||||
case "6":
|
||||
// 空值/非数字 → 空(null),否则转为数字
|
||||
if (val === null || val === undefined || val === "" || isNaN(Number(val))) {
|
||||
innerValue.value = null;
|
||||
} else {
|
||||
innerValue.value = Number(val);
|
||||
}
|
||||
break;
|
||||
|
||||
// 日期框:后端 yyyy/mm/dd → 前端 yyyy-MM-dd
|
||||
case "7":
|
||||
innerValue.value = typeof val === "string" && val.includes("/")
|
||||
? val.replace(/\//g, "-")
|
||||
: val || null;
|
||||
break;
|
||||
|
||||
// 时间框:后端 hh:mm → 前端 hh:mm:ss
|
||||
case "8":
|
||||
innerValue.value = typeof val === "string" && val.includes(":") && val.split(":").length === 2
|
||||
? `${val}:00`
|
||||
: val || null;
|
||||
break;
|
||||
|
||||
// 其他类型:保留原始值(空值则为null)
|
||||
default:
|
||||
innerValue.value = val === null || val === undefined ? "" : val;
|
||||
break;
|
||||
}
|
||||
}, { immediate: true, deep: true });
|
||||
|
||||
// ========== 修复:移除innerValue对多选的干扰 → 仅监听非多选类型 ==========
|
||||
watch(innerValue, (newVal) => {
|
||||
// 多选类型跳过innerValue监听
|
||||
if (props.type === "3") return;
|
||||
|
||||
let finalVal = newVal;
|
||||
|
||||
// 数字框:空值提交空字符串,非空则保留数字类型
|
||||
if (props.type === "6") {
|
||||
finalVal = newVal === null || newVal === undefined ? "" : Number(newVal);
|
||||
}
|
||||
// 日期框:前端 yyyy-MM-dd → 后端 yyyy/mm/dd
|
||||
else if (props.type === "7" && typeof newVal === "string" && newVal.includes("-")) {
|
||||
finalVal = newVal.replace(/-/g, "/");
|
||||
}
|
||||
// 时间框:前端 hh:mm:ss → 后端 hh:mm
|
||||
else if (props.type === "8" && typeof newVal === "string" && newVal.includes(":")) {
|
||||
finalVal = newVal.split(":").slice(0, 2).join(":");
|
||||
}
|
||||
|
||||
emit("update:modelValue", finalVal);
|
||||
emit("change", finalVal);
|
||||
}, { deep: true });
|
||||
|
||||
// ========== 字典加载逻辑 → 新增:字典加载后重新同步多选值 ==========
|
||||
watch([() => props.type, () => props.dictData], async () => {
|
||||
dictOptions.value = [];
|
||||
// 数字框(type=6)不需要加载字典
|
||||
if (props.type === "1") {
|
||||
await parseJsonDict();
|
||||
} else if (["2", "3"].includes(props.type)) {
|
||||
await loadApiDict();
|
||||
// 字典加载完成后,重新同步多选值(修复选不到值的问题)
|
||||
if (props.type === "3") {
|
||||
const val = props.modelValue;
|
||||
if (val === null || val === undefined || val === "" || val === 0) {
|
||||
multipleValue.value = [];
|
||||
} else if (typeof val === "string") {
|
||||
multipleValue.value = val.split(",").filter(item => item.trim() !== "").map(item => String(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
}, { immediate: true, deep: true });
|
||||
|
||||
// 解析下拉框JSON数组(type=1)
|
||||
async function parseJsonDict() {
|
||||
if (!props.dictData) return;
|
||||
try {
|
||||
let jsonStr = typeof props.dictData === "string" ? props.dictData : JSON.stringify(props.dictData);
|
||||
jsonStr = jsonStr.replace(/\s+/g, " ").replace(/[\n\t]/g, "");
|
||||
let jsonData = JSON.parse(jsonStr);
|
||||
if (!Array.isArray(jsonData)) jsonData = [jsonData];
|
||||
dictOptions.value = jsonData.map(item => ({
|
||||
label: item.label || item.zdmc || item.name || "",
|
||||
value: item.value || item.zddh || item.code || ""
|
||||
})).filter(item => item.label && item.value);
|
||||
} catch (error) {
|
||||
ElMessage.error(`下拉框数据解析失败:${error.message}`);
|
||||
console.error("JSON解析失败:", { raw: props.dictData, error });
|
||||
}
|
||||
}
|
||||
|
||||
// 加载字典API(type=2/3):zddh→value,zdmc→label
|
||||
async function loadApiDict() {
|
||||
const dictType = props.dictData;
|
||||
if (!dictType) return;
|
||||
if (dictCache.value[dictType]) {
|
||||
dictOptions.value = dictCache.value[dictType];
|
||||
return;
|
||||
}
|
||||
try {
|
||||
dictLoading.value = true;
|
||||
const res = await getoptionselect({ zdlb: dictType });
|
||||
if (res.code === 200 && Array.isArray(res.data)) {
|
||||
dictOptions.value = res.data.map(item => ({
|
||||
label: item.zdmc || item.label || "",
|
||||
value: item.zddh || item.value || ""
|
||||
})).filter(item => item.label && item.value);
|
||||
dictCache.value[dictType] = dictOptions.value;
|
||||
} else {
|
||||
ElMessage.warning(`字典${dictType}无有效数据`);
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error("字典请求失败");
|
||||
console.error("字典API异常:", { dictType, error });
|
||||
} finally {
|
||||
dictLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 开关组件专属变更处理(直接返回数字1/0) ==========
|
||||
function handleSwitchChange(val) {
|
||||
// val是字符串1/0,转为数字提交给后端
|
||||
const finalVal = Number(val);
|
||||
emit("update:modelValue", finalVal);
|
||||
emit("change", finalVal);
|
||||
}
|
||||
|
||||
// ========== 普通值变更处理(除开关/多选外) ==========
|
||||
function handleValueChange(val) {
|
||||
let finalVal = val;
|
||||
emit("update:modelValue", finalVal);
|
||||
emit("change", finalVal);
|
||||
}
|
||||
|
||||
// ========== 核心修复:多选值变更处理 → 简化逻辑,杜绝值覆盖 ==========
|
||||
function handleMultipleChange(val) {
|
||||
// 1. 过滤空值,避免提交无效数据
|
||||
const validVal = val.filter(item => item !== null && item !== undefined && item !== "");
|
||||
// 2. 转为逗号分隔字符串(后端格式)
|
||||
const strVal = validVal.join(",");
|
||||
// 3. 更新多选值(确保同步)
|
||||
multipleValue.value = validVal;
|
||||
// 4. 触发父组件更新
|
||||
emit("update:modelValue", strVal);
|
||||
emit("change", strVal);
|
||||
}
|
||||
|
||||
// ========== 初始化优化 → 移除多选冗余逻辑,杜绝默认0 ==========
|
||||
onMounted(() => {
|
||||
// 开关组件初始值兜底
|
||||
if (props.type === "0" && innerValue.value === null) {
|
||||
innerValue.value = "0"; // 默认关闭
|
||||
emit("update:modelValue", 0); // 后端默认值:0
|
||||
}
|
||||
// 多选初始化:仅处理有效值,杜绝空值/0转为["0"]
|
||||
if (props.type === "3") {
|
||||
const val = props.modelValue;
|
||||
if (val === null || val === undefined || val === "" || val === 0) {
|
||||
multipleValue.value = [];
|
||||
} else if (typeof val === "string") {
|
||||
multipleValue.value = val.split(",").filter(item => item.trim() !== "").map(item => String(item));
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dynamic-input-container {
|
||||
width: 100%;
|
||||
height: 100%; /* 关键:占满表格单元格高度 */
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中 */
|
||||
justify-content: center; /* 水平居中 */
|
||||
padding: 0 2px; /* 轻微内边距,避免贴边 */
|
||||
}
|
||||
|
||||
/* 开关组件样式优化 */
|
||||
:deep(.el-switch) {
|
||||
margin: 0 auto; /* 开关水平居中 */
|
||||
}
|
||||
|
||||
/* 深度选择器强制覆盖激活颜色 */
|
||||
:deep(.custom-switch .el-switch__core) {
|
||||
/* 开启状态背景色 */
|
||||
--el-switch-on-color: #13ce66 !important;
|
||||
/* 关闭状态背景色(可选) */
|
||||
--el-switch-off-color: #C3C3C3 !important;
|
||||
}
|
||||
|
||||
/* 兼容旧版Element Plus(可选) */
|
||||
:deep(.custom-switch .el-switch__core.is-checked) {
|
||||
background-color: #13ce66 !important;
|
||||
border-color: #13ce66 !important;
|
||||
}
|
||||
|
||||
:deep(.el-radio-group) {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.el-select--small),
|
||||
:deep(.el-input--small),
|
||||
:deep(.el-input-number--small),
|
||||
:deep(.el-date-picker--small),
|
||||
:deep(.el-time-picker--small) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 数字输入框空值样式优化 */
|
||||
:deep(.el-input-number--small) {
|
||||
.el-input__inner {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 空值时占位符样式 */
|
||||
.el-input__placeholder {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 多选下拉样式优化:避免高度溢出 */
|
||||
:deep(.el-select--multiple .el-select__tags) {
|
||||
flex-wrap: wrap;
|
||||
min-height: 32px; /* 匹配small尺寸高度 */
|
||||
}
|
||||
</style>
|
||||
365
src/views/liswork/xtwh/configdict/index.vue
Normal file
@ -0,0 +1,365 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item :label="menuname + '类别'" prop="configType">
|
||||
<el-select v-model="queryParams.configType" :placeholder="`请选择${menuname}类别`" clearable style="width: 200px"
|
||||
@change="handleQuery">
|
||||
<el-option v-for="item in configTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="menuname + '编码'" prop="configCode">
|
||||
<el-input v-model="queryParams.configCode" :placeholder="`请输入${menuname}编码`" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}名称`" prop="configName">
|
||||
<el-input v-model="queryParams.configName" :placeholder="`请输入${menuname}名称`" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<div class="table-container">
|
||||
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="config-table"
|
||||
height="100%">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="`${menuname}编号`" align="center" prop="configId" v-if="false" />
|
||||
<el-table-column :label="`${menuname}类别`" align="center" prop="configType" width="100" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span class="config-type-cell" :style="{
|
||||
backgroundColor: getConfigTypeColor(scope.row.configType),
|
||||
color: '#fff' // 文字白色,保证对比
|
||||
}">
|
||||
{{configTypeOptions.find(item => item.value === scope.row.configType)?.label || scope.row.configType}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="`${menuname}编码`" align="center" prop="configCode" width="150" show-overflow-tooltip />
|
||||
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip />
|
||||
<el-table-column label="选项类型" align="center" prop="configOptiontype" width="100">
|
||||
<template #default="scope">
|
||||
<span class="config-type-cell" :style="{
|
||||
backgroundColor: getconfigOptionTypeColor(scope.row.configOptiontype),
|
||||
color: '#fff' // 文字白色,保证对比
|
||||
}">
|
||||
{{configOptiontypeOptions.find(item => item.value === scope.row.configOptiontype)?.label ||
|
||||
scope.row.configOptiontype}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="默认值" align="center" prop="configDefvalue" width="200" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="值域规则" align="left" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="排序" align="center" prop="configSort" width="80" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="150" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<!-- 添加或修改字典对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px">
|
||||
<el-form ref="configdictRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item :label="`${menuname}类别`" prop="configType">
|
||||
<el-select v-model="form.configType" :placeholder="`请选择${menuname}类别`" style="width: 100%">
|
||||
<el-option v-for="item in configTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}编码`" prop="configCode">
|
||||
<el-input v-model="form.configCode" :placeholder="`请输入${menuname}编码`" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}名称`" prop="configName">
|
||||
<el-input v-model="form.configName" :placeholder="`请输入${menuname}名称`" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}选项类型`" prop="configOptiontype">
|
||||
<el-select v-model="form.configOptiontype" :placeholder="`请选择${menuname}选项类型`" style="width: 100%">
|
||||
<el-option v-for="item in configOptiontypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}默认值`" prop="configDefvalue">
|
||||
<el-input v-model="form.configDefvalue" :placeholder="`请输入${menuname}默认值`" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="顺序" prop="configSort">
|
||||
<el-input-number v-model="form.configSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="值域参数JSON" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="configdict">
|
||||
import { listData, } from "@/api/system/dict/data";
|
||||
import {
|
||||
addconfigdict, delconfigdict,
|
||||
getconfigdict,
|
||||
listconfigdict,
|
||||
updateconfigdict
|
||||
} from "@/api/liswork/xtwh/configdictApi.ts";
|
||||
import DynamicInput from "../components/DynamicInput.vue"
|
||||
// 1. 定义类别下拉选项(根据实际业务调整)
|
||||
|
||||
// 2. 定义获取类别对应颜色的方法
|
||||
function getConfigTypeColor(type) {
|
||||
// 匹配对应类别的颜色,无匹配时用默认色
|
||||
const item = configTypeOptions.value.find(item => item.value === type);
|
||||
return item?.elTagClass || "#909399"; // 默认灰色
|
||||
}
|
||||
// 2. 定义参数类别下拉选项(根据实际业务调整)
|
||||
const configOptiontypeOptions = ref([
|
||||
{ label: "单选框", value: "0", color: "#56BBBD" },
|
||||
{ label: "下拉框", value: "1", color: "#67C23A" },
|
||||
{ label: "字典单选", value: "2", color: "#FF443F" },
|
||||
{ label: "字典多选", value: "3", color: "#F08784" },
|
||||
{ label: "特殊", value: "4", color: "#909399" },
|
||||
{ label: "文本框", value: "5", color: "#3282F6" },
|
||||
{ label: "数字框", value: "6", color: "#507F80" },
|
||||
{ label: "日期框", value: "7", color: "#7E84F7" },
|
||||
{ label: "时间框", value: "8", color: "#377D22" },
|
||||
]);
|
||||
function getconfigOptionTypeColor(type) {
|
||||
// 匹配对应类别的颜色,无匹配时用默认色
|
||||
const item = configOptiontypeOptions.value.find(item => item.value === type);
|
||||
return item?.color || "#909399"; // 默认灰色
|
||||
}
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
const { lis_opt_type } = proxy.useDict("lis_opt_type"); //参数类别
|
||||
|
||||
const configTypeOptions = lis_opt_type
|
||||
const regdictList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const menuname = ref("参数");
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
configCode: undefined,
|
||||
configName: undefined,
|
||||
configType: undefined,
|
||||
status: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 30
|
||||
},
|
||||
rules: {
|
||||
configType: [{ required: true, message: menuname.value + "类别不能为空", trigger: "blur" }],
|
||||
configName: [{ required: true, message: menuname.value + "名称不能为空", trigger: "blur" }],
|
||||
configCode: [{ required: true, message: menuname.value + "编码不能为空", trigger: "blur" }],
|
||||
configSort: [{ required: true, message: menuname.value + "顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询字典列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listconfigdict(queryParams.value).then(response => {
|
||||
regdictList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
configId: undefined,
|
||||
configCode: undefined,
|
||||
configName: undefined,
|
||||
configType: configTypeOptions.value[0]?.value || "",
|
||||
configOptiontype: configOptiontypeOptions.value[0]?.value || "",
|
||||
configDefvalue: undefined,
|
||||
configSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("configdictRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.configId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加" + menuname.value;
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const configId = row.configId || ids.value;
|
||||
getconfigdict(configId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改" + menuname.value;
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["configdictRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.configId != undefined) {
|
||||
updateconfigdict(form.value).then(response => {
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addconfigdict(form.value).then(response => {
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const configIds = row.configId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + configIds + '"的数据项?').then(function () {
|
||||
return delconfigdict(configIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("delconfigdict/export", {
|
||||
...queryParams.value
|
||||
}, `dict_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
getList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.mb8 {
|
||||
height: 30px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
|
||||
.table-container {
|
||||
height: calc(100% - 150px);
|
||||
}
|
||||
|
||||
/* 1. 减小表格行高(核心) */
|
||||
:deep(.config-table .el-table__row) {
|
||||
height: 30px !important;
|
||||
/* 原默认行高约40px,按需调整(建议28-35px) */
|
||||
line-height: 30px !important;
|
||||
/* 行高与height一致,保证垂直居中 */
|
||||
}
|
||||
|
||||
/* 2. 减小单元格内边距(配合行高优化) */
|
||||
:deep(.config-table .el-table__cell) {
|
||||
padding: 2px 4px !important;
|
||||
height: 30px !important;
|
||||
/* 单元格高度与行高一致 */
|
||||
line-height: 1.2 !important;
|
||||
/* 文字行高适配矮行 */
|
||||
vertical-align: middle !important;
|
||||
/* 强制垂直居中 */
|
||||
}
|
||||
|
||||
/* 3. 类别单元格适配矮行高 */
|
||||
.config-type-cell {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 26px;
|
||||
/* 适配30px行高,略小一点 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 可选:优化操作列按钮大小,适配矮行 */
|
||||
:deep(.config-table .el-button--link) {
|
||||
padding: 0 4px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
</style>
|
||||
231
src/views/liswork/xtwh/localconfig/index.vue
Normal file
@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
|
||||
<!-- 操作按钮栏:改为保存/取消/还原默认 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleSave">保存</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Download" @click="handleRestoreDefault">还原默认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="5" class="table-container">
|
||||
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="config-table"
|
||||
height="100%">
|
||||
<el-table-column label="序号" align="center" prop="configSort" />
|
||||
<el-table-column :label="`${menuname}编码`" align="center" prop="configCode" show-overflow-tooltip />
|
||||
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip />
|
||||
<!-- 核心:默认值列改为持久化可编辑输入框 -->
|
||||
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="值码" align="center" prop="configDefvalue" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="localconfig">
|
||||
// 导入核心依赖
|
||||
import { ref, reactive, toRefs, getCurrentInstance } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import DynamicInput from "../components/DynamicInput.vue";
|
||||
import { listlocalconfig, savelocalconfig, getLocalConfigDefault } from "@/api/liswork/xtwh/localconfigApi.ts";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
// 表格数据(原始数据缓存,用于取消修改)
|
||||
const regdictList = ref([]);
|
||||
const originRegdictList = ref([]); // 缓存原始数据,用于取消修改
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const menuname = ref("本地选项");
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
configCode: undefined,
|
||||
configName: undefined,
|
||||
configType: undefined,
|
||||
status: undefined
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
/** 查询字典列表(缓存原始数据) */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listlocalconfig(queryParams.value).then(response => {
|
||||
// 存储表格展示数据
|
||||
regdictList.value = response.data.map(item => ({ ...item }));
|
||||
// 缓存原始数据(深拷贝,避免引用修改)
|
||||
originRegdictList.value = JSON.parse(JSON.stringify(response.data));
|
||||
total.value = response.data.length;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 表格行选中事件 */
|
||||
function handleSelectionChange(val) {
|
||||
ids.value = val.map(item => item.configId);
|
||||
single.value = val.length === 1;
|
||||
multiple.value = val.length > 1;
|
||||
}
|
||||
|
||||
/** 核心:保存整个表格数据(批量提交) */
|
||||
async function handleSave() {
|
||||
// 空值校验:检查所有行的默认值是否为空
|
||||
//const emptyRows = regdictList.value.filter(item => !item.configDefvalue?.trim());
|
||||
//if (emptyRows.length > 0) {
|
||||
// ElMessage.warning(`有${emptyRows.length}行默认值为空,请补充后再保存!`);
|
||||
// return;
|
||||
// }
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
// 调用批量保存接口,传入整个列表
|
||||
const res = await savelocalconfig(regdictList.value);
|
||||
if (res.code === 200) {
|
||||
ElMessage.success("批量保存成功!");
|
||||
// 保存后更新原始数据缓存
|
||||
originRegdictList.value = JSON.parse(JSON.stringify(regdictList.value));
|
||||
} else {
|
||||
ElMessage.error(res.msg || "批量保存失败,请重试!");
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error("保存失败,网络异常!");
|
||||
console.error("保存失败:", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** 取消修改:恢复原始数据 */
|
||||
function handleCancelEdit() {
|
||||
ElMessageBox.confirm(
|
||||
"是否确认取消所有修改,恢复到原始数据?",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
).then(() => {
|
||||
// 恢复原始数据
|
||||
regdictList.value = JSON.parse(JSON.stringify(originRegdictList.value));
|
||||
ElMessage.success("已取消所有修改,恢复原始数据!");
|
||||
});
|
||||
}
|
||||
|
||||
/** 还原默认值:调用接口获取默认值并刷新 */
|
||||
async function handleRestoreDefault() {
|
||||
ElMessageBox.confirm(
|
||||
"是否确认还原所有默认值?此操作会覆盖当前修改!",
|
||||
"警告",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "danger"
|
||||
}
|
||||
).then(async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
// 调用还原默认接口
|
||||
const res = await getLocalConfigDefault(queryParams.value);
|
||||
if (res.code === 200) {
|
||||
// 更新表格数据和原始缓存
|
||||
regdictList.value = res.data.map(item => ({ ...item }));
|
||||
originRegdictList.value = JSON.parse(JSON.stringify(res.data));
|
||||
ElMessage.success("已成功还原默认值!");
|
||||
} else {
|
||||
ElMessage.error(res.msg || "还原默认值失败,请重试!");
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error("还原失败,网络异常!");
|
||||
console.error("还原默认值失败:", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化加载数据
|
||||
getList();
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 90vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mb8 {
|
||||
height: 30px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 表格样式优化 */
|
||||
:deep(.config-table .el-table__row) {
|
||||
height: 30px !important;
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
:deep(.config-table .el-table__cell) {
|
||||
padding: 2px 4px !important;
|
||||
height: 30px !important;
|
||||
line-height: 1.2 !important;
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
/* 编辑输入框样式适配 */
|
||||
:deep(.config-table .edit-input) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.config-table .edit-input .el-input__inner) {
|
||||
padding: 0 5px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
:deep(.config-table .edit-input .el-input__inner:focus) {
|
||||
border-color: #409eff;
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
@ -18,11 +18,13 @@
|
||||
<!-- 工号登录 Tab -->
|
||||
<el-tab-pane label="账号密码登录" name="first">
|
||||
<el-form-item label="医疗机构:" prop="loginYLJG" class="custom-select">
|
||||
<el-select v-model="loginForm.loginParam.loginYLJG" placeholder="请选择医疗机构" style="width: 100%">
|
||||
<el-select v-model="loginForm.loginParam.loginYLJG" placeholder="请选择医疗机构" style="width: 100%"
|
||||
@change="handleChange">
|
||||
<template #prefix>
|
||||
<svg-icon icon-class="international" class="el-input__icon input-icon" />
|
||||
</template>
|
||||
<el-option v-for="item in selectOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
<el-option v-for="item in selectOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id.toString()"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@ -75,7 +77,7 @@
|
||||
<el-tab-pane label="扫码登录" name="second">
|
||||
<div class="tab-placeholder">
|
||||
<el-icon class="placeholder-icon">
|
||||
<Sms />
|
||||
<!-- <Sms /> -->
|
||||
</el-icon>
|
||||
<p>正在加载二维码...</p>
|
||||
<el-button type="success" icon="wechat" class="wechat-login-btn">刷新二维码</el-button>
|
||||
@ -85,7 +87,7 @@
|
||||
<el-tab-pane label="UKEY登录" name="third">
|
||||
<div class="tab-placeholder">
|
||||
<el-icon class="placeholder-icon">
|
||||
<Wechat />
|
||||
<!-- <Wechat /> -->
|
||||
</el-icon>
|
||||
<p>UKEY登录功能开发中...</p>
|
||||
</div>
|
||||
@ -129,9 +131,9 @@ const loginForm = ref({
|
||||
rememberMe: false,
|
||||
code: "",
|
||||
uuid: "",
|
||||
loginParam: { loginYLJG: "", localid: "" }
|
||||
loginParam: { loginYLJG: undefined, localid: undefined, loginYLJGName: undefined }
|
||||
});
|
||||
const selectOptions = ref([{ id: '1', name: '总院' }]);
|
||||
const selectOptions = ref([]);
|
||||
const loginRules = ref({ // 修复:改为ref响应式,方便动态修改
|
||||
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
|
||||
// password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
|
||||
@ -155,12 +157,19 @@ watch(
|
||||
{ immediate: true, deep: false }
|
||||
);
|
||||
|
||||
const handleChange = (value) => {
|
||||
const item = selectOptions.value.find(item => item.id == value);
|
||||
loginForm.value.loginParam.loginYLJG = value;
|
||||
loginForm.value.loginParam.loginYLJGName = item?.name || '';
|
||||
}
|
||||
|
||||
// 登录方法(修复proxy.$refs问题)
|
||||
const handleLogin = async () => {
|
||||
loginForm.value.loginParam.loginYLJG
|
||||
loading.value = true;
|
||||
Cookies.set("czlis_username", loginForm.value.username, { expires: 30 });
|
||||
Cookies.set("czlis_loginYLJG", loginForm.value.loginParam.loginYLJG, { expires: 30 });
|
||||
Cookies.set("czlis_loginYLJGName", loginForm.value.loginParam.loginYLJGName, { expires: 30 });
|
||||
// 调用action的登录方法
|
||||
userStore.login(loginForm.value).then(() => {
|
||||
const query = route.query;
|
||||
@ -204,14 +213,16 @@ const getCode = () => {
|
||||
const getCookie = () => {
|
||||
const cookieUsername = Cookies.get("czlis_username");
|
||||
const cookieloginYLJG = Cookies.get("czlis_loginYLJG");
|
||||
//console.log('cookieloginYLJG', cookieloginYLJG);
|
||||
if (cookieUsername !== undefined && cookieUsername !== null && cookieUsername !== "") {
|
||||
loginForm.value.username = cookieUsername;
|
||||
}
|
||||
if (cookieloginYLJG !== undefined && cookieloginYLJG !== null && cookieloginYLJG !== "") {
|
||||
loginForm.value.loginParam.loginYLJG = cookieloginYLJG;
|
||||
}
|
||||
//console.log('loginForm', loginForm);
|
||||
const cookieloginYLJGName = Cookies.get("czlis_loginYLJGName");
|
||||
if (cookieloginYLJGName !== undefined && cookieloginYLJGName !== null && cookieloginYLJGName !== "") {
|
||||
loginForm.value.loginParam.loginYLJGName = cookieloginYLJGName;
|
||||
}
|
||||
};
|
||||
|
||||
// 获取本地配置
|
||||
@ -220,21 +231,17 @@ const Localconfig = (localid) => {
|
||||
if (res) {
|
||||
const { localconfig, hosplist, oem: oemData } = res;
|
||||
mbStore.setDefaultConfig(localconfig)
|
||||
// 修复:赋值oem数据,显示动态标题
|
||||
if (oemData) oem.value = oemData;
|
||||
// console.log('oemData', oemData);
|
||||
// console.log('oem', oem.value);
|
||||
// 修复:判重后更新下拉选项,避免递归
|
||||
|
||||
if (JSON.stringify(selectOptions.value) !== JSON.stringify(hosplist)) {
|
||||
selectOptions.value = hosplist || [{ id: '1', name: '总院' }];
|
||||
selectOptions.value = hosplist || [];
|
||||
// 判重后赋值,避免重复修改触发更新
|
||||
if (!selectOptions.value.some(item => item.id === loginForm.value.hospid)) {
|
||||
loginForm.value.loginParam.loginYLJG = selectOptions.value[0]?.id || '1';
|
||||
loginForm.value.loginParam.loginYLJG = selectOptions.value[0]?.id || 1;
|
||||
loginForm.value.loginParam.loginYLJGName = selectOptions.value[0]?.name || '';
|
||||
}
|
||||
getCookie();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error("获取本地配置失败:", err);
|
||||
@ -256,7 +263,7 @@ const refreshFingerprint = async () => {
|
||||
|
||||
// Tab切换事件(移除activeName手动赋值,避免递归)
|
||||
const handleClick = (tab) => {
|
||||
console.log('当前Tab:', tab.name);
|
||||
// console.log('当前Tab:', tab.name);
|
||||
// 仅在切回账号密码登录时刷新验证码
|
||||
if (tab.name === 'first' && captchaEnabled.value) {
|
||||
getCode();
|
||||
|
||||
@ -1,287 +1,234 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input
|
||||
v-model="queryParams.jobName"
|
||||
placeholder="请输入任务名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务组名" prop="jobGroup">
|
||||
<el-select v-model="queryParams.jobGroup" placeholder="请选择任务组名" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_job_group"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_job_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input v-model="queryParams.jobName" placeholder="请输入任务名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务组名" prop="jobGroup">
|
||||
<el-select v-model="queryParams.jobGroup" placeholder="请选择任务组名" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_job_group" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_job_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['monitor:job:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['monitor:job:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['monitor:job:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['monitor:job:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Operation" @click="handleJobLog"
|
||||
v-hasPermi="['monitor:job:query']">日志</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务编号" width="100" align="center" prop="jobId" />
|
||||
<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="任务组名" align="center" prop="jobGroup">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_job_group" :value="scope.row.jobGroup" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="cron执行表达式" align="center" prop="cronExpression" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['monitor:job:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['monitor:job:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="执行一次" placement="top">
|
||||
<el-button link type="primary" icon="CaretRight" @click="handleRun(scope.row)"
|
||||
v-hasPermi="['monitor:job:changeStatus']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="任务详细" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)"
|
||||
v-hasPermi="['monitor:job:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="调度日志" placement="top">
|
||||
<el-button link type="primary" icon="Operation" @click="handleJobLog(scope.row)"
|
||||
v-hasPermi="['monitor:job:query']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改定时任务对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="820px" append-to-body>
|
||||
<el-form ref="jobRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input v-model="form.jobName" placeholder="请输入任务名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务分组" prop="jobGroup">
|
||||
<el-select v-model="form.jobGroup" placeholder="请选择">
|
||||
<el-option v-for="dict in sys_job_group" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="invokeTarget">
|
||||
<template #label>
|
||||
<span>
|
||||
调用方法
|
||||
<el-tooltip placement="top">
|
||||
<template #content>
|
||||
<div>
|
||||
Bean调用示例:ryTask.ryParams('ry')
|
||||
<br />Class类调用示例:com.ruoyi.quartz.task.RyTask.ryParams('ry')
|
||||
<br />参数说明:支持字符串,布尔类型,长整型,浮点型,整型
|
||||
</div>
|
||||
</template>
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.invokeTarget" placeholder="请输入调用目标字符串" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="cron表达式" prop="cronExpression">
|
||||
<el-input v-model="form.cronExpression" placeholder="请输入cron执行表达式">
|
||||
<template #append>
|
||||
<el-button type="primary" @click="handleShowCron">
|
||||
生成表达式
|
||||
<i class="el-icon-time el-icon--right"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.jobId !== undefined">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_job_status" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="执行策略" prop="misfirePolicy">
|
||||
<el-radio-group v-model="form.misfirePolicy">
|
||||
<el-radio-button value="1">立即执行</el-radio-button>
|
||||
<el-radio-button value="2">执行一次</el-radio-button>
|
||||
<el-radio-button value="3">放弃执行</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否并发" prop="concurrent">
|
||||
<el-radio-group v-model="form.concurrent">
|
||||
<el-radio-button value="0">允许</el-radio-button>
|
||||
<el-radio-button value="1">禁止</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['monitor:job:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['monitor:job:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['monitor:job:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['monitor:job:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Operation"
|
||||
@click="handleJobLog"
|
||||
v-hasPermi="['monitor:job:query']"
|
||||
>日志</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-dialog title="Cron表达式生成器" v-model="openCron" append-to-body destroy-on-close>
|
||||
<crontab ref="crontabRef" @hide="openCron = false" @fill="crontabFill" :expression="expression"></crontab>
|
||||
</el-dialog>
|
||||
|
||||
<el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务编号" width="100" align="center" prop="jobId" />
|
||||
<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="任务组名" align="center" prop="jobGroup">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_job_group" :value="scope.row.jobGroup" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="cron执行表达式" align="center" prop="cronExpression" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['monitor:job:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['monitor:job:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="执行一次" placement="top">
|
||||
<el-button link type="primary" icon="CaretRight" @click="handleRun(scope.row)" v-hasPermi="['monitor:job:changeStatus']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="任务详细" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['monitor:job:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="调度日志" placement="top">
|
||||
<el-button link type="primary" icon="Operation" @click="handleJobLog(scope.row)" v-hasPermi="['monitor:job:query']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改定时任务对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="820px" append-to-body>
|
||||
<el-form ref="jobRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input v-model="form.jobName" placeholder="请输入任务名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务分组" prop="jobGroup">
|
||||
<el-select v-model="form.jobGroup" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in sys_job_group"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="invokeTarget">
|
||||
<template #label>
|
||||
<span>
|
||||
调用方法
|
||||
<el-tooltip placement="top">
|
||||
<template #content>
|
||||
<div>
|
||||
Bean调用示例:ryTask.ryParams('ry')
|
||||
<br />Class类调用示例:com.ruoyi.quartz.task.RyTask.ryParams('ry')
|
||||
<br />参数说明:支持字符串,布尔类型,长整型,浮点型,整型
|
||||
</div>
|
||||
</template>
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.invokeTarget" placeholder="请输入调用目标字符串" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="cron表达式" prop="cronExpression">
|
||||
<el-input v-model="form.cronExpression" placeholder="请输入cron执行表达式">
|
||||
<template #append>
|
||||
<el-button type="primary" @click="handleShowCron">
|
||||
生成表达式
|
||||
<i class="el-icon-time el-icon--right"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.jobId !== undefined">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_job_status"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="执行策略" prop="misfirePolicy">
|
||||
<el-radio-group v-model="form.misfirePolicy">
|
||||
<el-radio-button value="1">立即执行</el-radio-button>
|
||||
<el-radio-button value="2">执行一次</el-radio-button>
|
||||
<el-radio-button value="3">放弃执行</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否并发" prop="concurrent">
|
||||
<el-radio-group v-model="form.concurrent">
|
||||
<el-radio-button value="0">允许</el-radio-button>
|
||||
<el-radio-button value="1">禁止</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="Cron表达式生成器" v-model="openCron" append-to-body destroy-on-close>
|
||||
<crontab ref="crontabRef" @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 任务日志详细 -->
|
||||
<el-dialog title="任务详细" v-model="openView" width="700px" append-to-body>
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务编号:">{{ form.jobId }}</el-form-item>
|
||||
<el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务分组:">{{ jobGroupFormat(form) }}</el-form-item>
|
||||
<el-form-item label="创建时间:">{{ form.createTime }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="cron表达式:">{{ form.cronExpression }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="下次执行时间:">{{ parseTime(form.nextValidTime) }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="调用目标方法:">{{ form.invokeTarget }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态:">
|
||||
<div v-if="form.status == 0">正常</div>
|
||||
<div v-else-if="form.status == 1">暂停</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否并发:">
|
||||
<div v-if="form.concurrent == 0">允许</div>
|
||||
<div v-else-if="form.concurrent == 1">禁止</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="执行策略:">
|
||||
<div v-if="form.misfirePolicy == 0">默认策略</div>
|
||||
<div v-else-if="form.misfirePolicy == 1">立即执行</div>
|
||||
<div v-else-if="form.misfirePolicy == 2">执行一次</div>
|
||||
<div v-else-if="form.misfirePolicy == 3">放弃执行</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="openView = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<!-- 任务日志详细 -->
|
||||
<el-dialog title="任务详细" v-model="openView" width="700px" append-to-body>
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务编号:">{{ form.jobId }}</el-form-item>
|
||||
<el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务分组:">{{ jobGroupFormat(form) }}</el-form-item>
|
||||
<el-form-item label="创建时间:">{{ form.createTime }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="cron表达式:">{{ form.cronExpression }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="下次执行时间:">{{ parseTime(form.nextValidTime) }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="调用目标方法:">{{ form.invokeTarget }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态:">
|
||||
<div v-if="form.status == 0">正常</div>
|
||||
<div v-else-if="form.status == 1">暂停</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否并发:">
|
||||
<div v-if="form.concurrent == 0">允许</div>
|
||||
<div v-else-if="form.concurrent == 1">禁止</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="执行策略:">
|
||||
<div v-if="form.misfirePolicy == 0">默认策略</div>
|
||||
<div v-else-if="form.misfirePolicy == 1">立即执行</div>
|
||||
<div v-else-if="form.misfirePolicy == 2">执行一次</div>
|
||||
<div v-else-if="form.misfirePolicy == 3">放弃执行</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="openView = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Job">
|
||||
@ -414,7 +361,7 @@ function handleRun(row: SysJob) {
|
||||
return runJob(row.jobId!, row.jobGroup!)
|
||||
}).then(() => {
|
||||
proxy.$modal.msgSuccess("执行成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 任务详细信息 */
|
||||
@ -489,7 +436,7 @@ function handleDelete(row?: SysJob) {
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@ -1,60 +1,48 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true">
|
||||
<el-form-item label="登录地址" prop="ipaddr">
|
||||
<el-input
|
||||
v-model="queryParams.ipaddr"
|
||||
placeholder="请输入登录地址"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="onlineList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column label="序号" width="50" type="index" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会话编号" align="center" prop="tokenId" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="主机" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作系统" align="center" prop="os" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录时间" align="center" prop="loginTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.loginTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Delete" @click="handleForceLogout(scope.row)" v-hasPermi="['monitor:online:forceLogout']">强退</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true">
|
||||
<el-form-item label="登录地址" prop="ipaddr">
|
||||
<el-input v-model="queryParams.ipaddr" placeholder="请输入登录地址" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="onlineList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||
style="width: 100%;" height="calc(100vh - 250px)">
|
||||
<el-table-column label="序号" width="50" type="index" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会话编号" align="center" prop="tokenId" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="主机" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作系统" align="center" prop="os" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录时间" align="center" prop="loginTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.loginTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Delete" @click="handleForceLogout(scope.row)"
|
||||
v-hasPermi="['monitor:online:forceLogout']">强退</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="pageNum" v-model:limit="pageSize" />
|
||||
</div>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="pageNum" v-model:limit="pageSize" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Online">
|
||||
@ -103,7 +91,7 @@ function handleForceLogout(row: SysUserOnline) {
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
276
src/views/regional/circulation/bbcx/index.vue
Normal file
@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="compact-form">
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="委托机构:" prop="srcHospName">
|
||||
<el-input v-model="queryParams.srcHospName" :size="aotuSize" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="检测医院:" prop="dstHospName">
|
||||
<SelectTable v-model:data="queryParams.dstHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="label" placeholder="请选择" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-form-item label="条码号:" prop="barcode">
|
||||
<el-input v-model="queryParams.barcode" placeholder="请输入条码号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="姓名:" prop="patName">
|
||||
<el-input v-model="queryParams.patName" placeholder="请输入姓名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="申请项目:" prop="checkPUR">
|
||||
<el-input v-model="queryParams.checkPUR" placeholder="请输入申请项目" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="标本状态:" prop="Status">
|
||||
<el-select v-model="queryParams.Status" placeholder="请选择" clearable>
|
||||
<el-option v-for="item in regdictList" :label="item.dictName" :value="item.dictCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="采样人:" prop="affirmUserName">
|
||||
<el-input v-model="queryParams.affirmUserName" placeholder="请输入采样人" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="签收人:" prop="signInUserName">
|
||||
<el-input v-model="queryParams.signInUserName" placeholder="请输入签收人" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="时间类型:" prop="dateType">
|
||||
<el-select v-model="queryParams.dateType" placeholder="请选择">
|
||||
<el-option label="登记时间" value="登记时间" />
|
||||
<el-option label="采样时间" value="采样时间" />
|
||||
<el-option label="送出时间" value="送出时间" />
|
||||
<el-option label="签收时间" value="签收时间" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="日期:" prop="times">
|
||||
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ formatDict(row.ageUnit, 'AU') }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDicts(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
<!-- 样本流程 -->
|
||||
<div class="time-line-box">
|
||||
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">
|
||||
<div v-if="i != 0" class="timeline-connector">
|
||||
<img class="timg" src="@/assets/images/yjt.png" alt="">
|
||||
</div>
|
||||
<div :class="['timeline-content', i > lastTimeIndex ? 'no_active' : '']">
|
||||
<div :class="['index', lastTimeIndex == i ? 'active' : '']">{{ Number(i) + 1 }}
|
||||
</div>
|
||||
<div class="timeline-title">{{ item.title }}</div>
|
||||
<div class="timeline-time">{{ item.time }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Bbcx">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { querySample } from '@/api/regional/index'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
import { listhospital } from "@/api/regional/dict/hospital";
|
||||
import { listregdict } from "@/api/regional/dict/regdict";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import dayjs from 'dayjs';
|
||||
import { getDictData, formatDict, dictData } from '@/hooks'
|
||||
const userStore = useUserStore()
|
||||
|
||||
|
||||
const queryParams = ref({
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
srcHospName: userStore.sysLoginParam.loginYLJGName,
|
||||
times: []
|
||||
})
|
||||
const tableData = ref([])
|
||||
const columns = ref([
|
||||
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 100 },
|
||||
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
|
||||
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
|
||||
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 250 },
|
||||
{ prop: 'sampleTypeName', label: '标本类型', align: 'center', visible: true, },
|
||||
{ prop: 'itemclass_tips', label: '采集容器', align: 'center', visible: true, },
|
||||
{ prop: 'status', label: '标本状态', align: 'center', visible: true, slot: "status" },
|
||||
{ prop: 'affirmUserName', label: '采样人', align: 'center', visible: true, },
|
||||
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'signInUserName', label: '签收人', align: 'center', visible: true, },
|
||||
{ prop: 'signInTime', label: '签收时间', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'dstHospName', label: '检测机构名称', align: 'center', visible: true, width: 150 },
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '65vh', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
|
||||
const pagination = ref({
|
||||
show: true,
|
||||
total: 0,
|
||||
pageSize: 50,
|
||||
currentPage: 1,
|
||||
})
|
||||
|
||||
const ksdhFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
{ prop: 'value', label: '代号', width: 120, enablePinyinSearch: true },
|
||||
])
|
||||
|
||||
// 时间线数据
|
||||
const timelineItems = ref(
|
||||
[
|
||||
{ title: '检验申请', time: '' },
|
||||
{ title: '标本采集', time: '' },
|
||||
{ title: '标本送检', time: '' },
|
||||
{ title: '标本签收', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '结果审核', time: '' },
|
||||
]
|
||||
);
|
||||
|
||||
// 计算最后一个有时间的节点索引
|
||||
const lastTimeIndex = computed(() => {
|
||||
|
||||
const lastIndex = timelineItems.value.findLastIndex(item => item.time);
|
||||
if (lastIndex === -1) {
|
||||
return -1
|
||||
} else {
|
||||
return lastIndex;
|
||||
}
|
||||
});
|
||||
|
||||
const handleQuery = () => {
|
||||
if (queryParams.value.times && queryParams.value.times.length > 0) {
|
||||
queryParams.value.dateStart = queryParams.value.times[0]
|
||||
queryParams.value.dateEnd = queryParams.value.times[1]
|
||||
} else {
|
||||
queryParams.value.dateStart = ''
|
||||
queryParams.value.dateEnd = ''
|
||||
}
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
|
||||
const resetHandle = () => {
|
||||
queryParams.value = {
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
}
|
||||
getDays()
|
||||
handleQuery()
|
||||
}
|
||||
const currentChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageNum = page.currentPage
|
||||
handleQuery()
|
||||
}
|
||||
const sizeChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageSize = page.pageSize
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const rowHandle = (row) => {
|
||||
timelineItems.value =
|
||||
[
|
||||
{ title: '检验申请', time: row.orderTime },
|
||||
{ title: '标本采集', time: row.affirmTime },
|
||||
{ title: '标本送检', time: row.sendPackTime },
|
||||
{ title: '标本签收', time: row.signInTime },
|
||||
{ title: '上机检验', time: row.sjsj },
|
||||
{ title: '结果审核', time: row.confirmtime },
|
||||
]
|
||||
}
|
||||
|
||||
const tableRefs = ref()
|
||||
const getList = () => {
|
||||
querySample(queryParams.value).then((res) => {
|
||||
tableData.value = res.rows
|
||||
pagination.value.total = res.total
|
||||
tableRefs.value.setCurrentRow(res.rows[0])
|
||||
rowHandle(res.rows[0])
|
||||
})
|
||||
}
|
||||
|
||||
const getDays = () => {
|
||||
const end = dayjs().format('YYYY-MM-DD');
|
||||
const start = dayjs().subtract(2, 'day').format('YYYY-MM-DD'); //add 时间往后
|
||||
queryParams.value.times = [start, end];
|
||||
}
|
||||
|
||||
const hosList = ref([])
|
||||
const regdictList = ref([])
|
||||
onMounted(() => {
|
||||
getDays()
|
||||
handleQuery()
|
||||
listhospital().then((res) => {
|
||||
hosList.value = res.rows.map((item) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res) => {
|
||||
regdictList.value = res.rows;
|
||||
})
|
||||
getDictData('AU')
|
||||
})
|
||||
|
||||
|
||||
const formatDicts = (v: string, arr: Array<any>) => {
|
||||
return arr.find((item) => item.dictCode == v)?.dictName || v;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
260
src/views/regional/circulation/bbqs/index.vue
Normal file
@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="compact-form">
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="委托机构:" prop="srcHospName">
|
||||
<el-input v-model="queryParams.srcHospName" :size="aotuSize" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="检测医院:" prop="dstHospName">
|
||||
<SelectTable v-model:data="queryParams.dstHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="label" placeholder="请选择" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="条码号:" prop="barcode">
|
||||
<el-input v-model="queryParams.barcode" placeholder="请输入条码号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名:" prop="patName">
|
||||
<el-input v-model="queryParams.patName" placeholder="请输入姓名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="申请项目:" prop="checkPUR">
|
||||
<el-input v-model="queryParams.checkPUR" placeholder="请输入申请项目" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="5">
|
||||
<el-form-item label="时间类型:" prop="dateType">
|
||||
<el-select v-model="queryParams.dateType" placeholder="请选择">
|
||||
<el-option label="登记时间" value="登记时间" />
|
||||
<el-option label="采样时间" value="采样时间" />
|
||||
<el-option label="送出时间" value="送出时间" />
|
||||
<el-option label="签收时间" value="签收时间" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="5">
|
||||
<el-form-item label="日期:" prop="times">
|
||||
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="mb10">
|
||||
<el-button type="primary" @click="qsHandle(50)">标本签收</el-button>
|
||||
<!-- <el-button type="primary" @click="qsHandle(110)">标本拒签</el-button> -->
|
||||
<el-button type="primary" plain @click="bbThHandle">标本退回</el-button>
|
||||
</div>
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ formatDict(row.ageUnit, 'AU') }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDicts(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Bbqs">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { querySampleSign, sampleSign } from '@/api/regional/index'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { listhospital } from "@/api/regional/dict/hospital";
|
||||
import { getDictData, formatDict, dictData } from '@/hooks'
|
||||
import { listregdict } from "@/api/regional/dict/regdict";
|
||||
import { classCom } from '@/utils/classCom';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import dayjs from 'dayjs';
|
||||
const userStore = useUserStore()
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
const queryParams = ref({
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
srcHospName: userStore.sysLoginParam.loginYLJGName,
|
||||
times: [],
|
||||
status: 50
|
||||
})
|
||||
const tableData = ref([])
|
||||
const columns = ref([
|
||||
{ type: 'selection', align: 'center', visible: true, width: 40 },
|
||||
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 250 },
|
||||
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 100 },
|
||||
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
|
||||
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
|
||||
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 300 },
|
||||
{ prop: 'sampleTypeName', label: '标本类型', align: 'center', visible: true, },
|
||||
{ prop: 'itemclass_tips', label: '采集容器', align: 'center', visible: true, },
|
||||
{ prop: 'status', label: '标本状态', align: 'center', visible: true, slot: "status" },
|
||||
{ prop: 'sendPackTime', label: '送检时间', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'sendUserName', label: '送检人', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'dstHospName', label: '检测机构名称', align: 'center', visible: true, width: 150 },
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
|
||||
const pagination = ref({
|
||||
show: true,
|
||||
total: 0,
|
||||
pageSize: 50,
|
||||
currentPage: 1,
|
||||
})
|
||||
|
||||
const ksdhFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
{ prop: 'value', label: '代号', width: 120, enablePinyinSearch: true },
|
||||
])
|
||||
const barcodes = ref([])
|
||||
const tableRefs = ref(null)
|
||||
const handleSelectionChange = (val) => {
|
||||
barcodes.value = val.map((item) => item.barcode)
|
||||
}
|
||||
const backReasons = ref('')
|
||||
const bbThHandle = () => {
|
||||
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
|
||||
ElMessageBox.prompt('请输入退回理由:', '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: '请输入退回理由',
|
||||
})
|
||||
.then(({ value }) => {
|
||||
backReasons.value = value
|
||||
qsHandle(100)
|
||||
}).catch(() => {
|
||||
backReasons.value = ''
|
||||
});
|
||||
}
|
||||
//标本签收
|
||||
const qsHandle = (val: number) => {
|
||||
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
|
||||
sampleSign({ status: val, barcode: barcodes.value, backReasons: backReasons.value }).then((res) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('操作成功!')
|
||||
backReasons.value = ''
|
||||
handleQuery()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const goThPage = () => {
|
||||
router.push('/regional/circulation/bbth')
|
||||
}
|
||||
|
||||
const resetHandle = () => {
|
||||
queryParams.value = {
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
}
|
||||
getDays()
|
||||
handleQuery()
|
||||
}
|
||||
const currentChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageNum = page.currentPage
|
||||
handleQuery()
|
||||
}
|
||||
const sizeChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageSize = page.pageSize
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
|
||||
const handleQuery = () => {
|
||||
if (queryParams.value.times && queryParams.value.times.length > 0) {
|
||||
queryParams.value.dateStart = queryParams.value.times[0]
|
||||
queryParams.value.dateEnd = queryParams.value.times[1]
|
||||
} else {
|
||||
queryParams.value.dateStart = ''
|
||||
queryParams.value.dateEnd = ''
|
||||
}
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
querySampleSign(queryParams.value).then((res) => {
|
||||
tableData.value = res.rows
|
||||
pagination.value.total = res.total
|
||||
})
|
||||
}
|
||||
const getDays = () => {
|
||||
const end = dayjs().format('YYYY-MM-DD');
|
||||
const start = dayjs().subtract(2, 'day').format('YYYY-MM-DD'); //add 时间往后
|
||||
queryParams.value.times = [start, end];
|
||||
}
|
||||
|
||||
const hosList = ref([])
|
||||
const regdictList = ref([])
|
||||
onMounted(() => {
|
||||
getDays()
|
||||
listhospital().then((res) => {
|
||||
hosList.value = res.rows.map((item) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res) => {
|
||||
regdictList.value = res.rows;
|
||||
})
|
||||
getDictData('AU')
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
|
||||
const formatDicts = (v: string, arr: Array<any>) => {
|
||||
return arr.find((item) => item.dictCode == v)?.dictName || v;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
|
||||
&>button {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
223
src/views/regional/circulation/bbth/index.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="compact-form">
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="委托机构:" prop="SrcHospName">
|
||||
<SelectTable v-model:data="queryParams.SrcHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="value" objKey="value" :border="true" placeholder="请选择委托机构" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="检测医院:" prop="DstHospName">
|
||||
<SelectTable v-model:data="queryParams.DstHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="label" objKey="label" :border="true" placeholder="请选择" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="条码号:" prop="Barcode">
|
||||
<el-input v-model="queryParams.Barcode" placeholder="请输入条码号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名:" prop="PatName">
|
||||
<el-input v-model="queryParams.PatName" placeholder="请输入姓名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="申请项目:" prop="checkPUR">
|
||||
<el-input v-model="queryParams.checkPUR" placeholder="请输入申请项目" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="时间类型:" prop="DateType">
|
||||
<el-select v-model="queryParams.DateType" placeholder="请选择">
|
||||
<el-option label="登记时间" value="登记时间" />
|
||||
<el-option label="采样时间" value="采样时间" />
|
||||
<el-option label="送出时间" value="送出时间" />
|
||||
<el-option label="签收时间" value="签收时间" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="日期:" prop="times">
|
||||
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="mb10">
|
||||
<el-button type="primary" @click="thHandle(20)">重新采集</el-button>
|
||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
|
||||
|
||||
</div>
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Bbth">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { querySampleSignBack, sampleSign } from '@/api/regional/index'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
// @ts-ignore
|
||||
import { listhospital } from "@/api/regional/dict/hospital.ts";
|
||||
// @ts-ignore
|
||||
import { listregdict } from "@/api/regional/dict/regdict.ts";
|
||||
import { ElMessage } from 'element-plus';
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
|
||||
const queryParams: any = ref({
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
})
|
||||
const tableData: any = ref([])
|
||||
const columns: any = ref([
|
||||
{ type: 'selection', align: 'center', visible: true, width: 40 },
|
||||
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, },
|
||||
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 60 },
|
||||
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
|
||||
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
|
||||
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'srcHospName', label: '检测机构', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'Status', label: '标本状态', align: 'center', visible: true, slot: "status" },
|
||||
{ prop: 'backReasons', label: '退回理由', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'backUserName', label: '操作人', align: 'center', visible: true, },
|
||||
{ prop: 'backTime', label: '操作时间', align: 'center', visible: true, width: 150 },
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
|
||||
const pagination = ref({
|
||||
show: true,
|
||||
total: 0,
|
||||
pageSize: 50,
|
||||
currentPage: 1,
|
||||
})
|
||||
|
||||
const ksdhFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
{ prop: 'value', label: '代号', width: 120, enablePinyinSearch: true },
|
||||
])
|
||||
const barcodes = ref([])
|
||||
const tableRefs = ref(null)
|
||||
|
||||
const thHandle = (val: number) => {
|
||||
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
|
||||
sampleSign({ status: val, barcode: barcodes.value }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('操作成功!')
|
||||
handleQuery()
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSelectionChange = (val: any) => {
|
||||
barcodes.value = val.map((item: any) => item.barcode)
|
||||
}
|
||||
const currentChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageNum = page.currentPage
|
||||
handleQuery()
|
||||
}
|
||||
const sizeChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageSize = page.pageSize
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
|
||||
const handleQuery = () => {
|
||||
if (queryParams.value.times && queryParams.value.times.length > 0) {
|
||||
queryParams.value.DateStart = queryParams.value.times[0]
|
||||
queryParams.value.DateEnd = queryParams.value.times[1]
|
||||
} else {
|
||||
queryParams.value.DateStart = ''
|
||||
queryParams.value.DateEnd = ''
|
||||
}
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetHandle = () => {
|
||||
queryParams.value = {
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
const getList = () => {
|
||||
querySampleSignBack(queryParams.value).then((res: any) => {
|
||||
tableData.value = res.rows
|
||||
pagination.value.total = res.total
|
||||
})
|
||||
}
|
||||
const hosList = ref([])
|
||||
const regdictList: any = ref([])
|
||||
onMounted(() => {
|
||||
getList()
|
||||
listhospital().then((res: any) => {
|
||||
hosList.value = res.rows.map((item: any) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res: any) => {
|
||||
regdictList.value = res.rows;
|
||||
})
|
||||
})
|
||||
|
||||
const formatDict = (v: string, arr: Array<any>) => {
|
||||
return arr.find((item: any) => item.dictCode == v)?.dictName || v;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
|
||||
&>button {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
168
src/views/regional/circulation/components/OutPatList.vue
Normal file
@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button @click="handleClick">查询病人</el-button>
|
||||
|
||||
<!-- 病人选择弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="props.dialogTitle" width="500px" @close="handleDialogClose">
|
||||
<el-input v-model="searchKey" placeholder="搜索(支持姓名、病人ID、简拼)..." class="mb-4" clearable @clear="filteredPatData"
|
||||
@input="filteredPatData" @keyup.down="navigateTable('down')" @keyup.up="navigateTable('up')"
|
||||
@keyup.enter="selectActiveItem" />
|
||||
|
||||
<el-table :data="filteredPatData" height="300px" border @row-click="selectItem" @row-dblclick="selectItem"
|
||||
class="compact-form my-table">
|
||||
<template #empty>
|
||||
<div v-if="isPatLoading">加载中...</div>
|
||||
<div v-else>没有匹配的病人数据</div>
|
||||
</template>
|
||||
|
||||
<el-table-column prop="pid" label="病人ID" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="name" label="姓名" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="xb" label="性别" width="80" show-overflow-tooltip />
|
||||
<el-table-column prop="nl" label="年龄" width="80" show-overflow-tooltip />
|
||||
<el-table-column prop="ks" label="科室" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="ch" label="床号" width="80" show-overflow-tooltip />
|
||||
<el-table-column prop="pinyin" label="简拼" width="150" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { queryPatList } from "@/api/mzcx/cydj.ts";
|
||||
import { getFirstLetter } from '@/utils/pinyin'; // 引入拼音处理工具
|
||||
// 组件参数
|
||||
const props = defineProps({
|
||||
pidValue: { type: [String, Number], default: '' },
|
||||
PatType: { type: String },
|
||||
placeholder: { type: String, default: '请输入或双击选择' },
|
||||
clearable: { type: Boolean, default: true },
|
||||
disabled: { type: Boolean, default: false },
|
||||
dialogTitle: { type: String, default: '选择病人' }
|
||||
});
|
||||
|
||||
// 组件事件
|
||||
const emit = defineEmits(['update:pidValue', 'select']);
|
||||
|
||||
// 内部状态
|
||||
const dialogVisible = ref(false);
|
||||
const searchKey = ref('');
|
||||
const PatData = ref([]); // 存储带简拼的病人数据
|
||||
const isPatLoading = ref(true);
|
||||
const activeRowIndex = ref(-1); // 键盘导航选中行索引
|
||||
|
||||
|
||||
// 加载病人数据
|
||||
const loadPatData = async () => {
|
||||
isPatLoading.value = true;
|
||||
queryPatList().then(response => {
|
||||
// console.log('response:', response.data);
|
||||
PatData.value = (response.data || []).map(item => ({
|
||||
...item,
|
||||
pinyin: getFirstLetter(item.name)
|
||||
}));
|
||||
}).catch(() => {
|
||||
console.error(`加载病人列表失败:`, error);
|
||||
PatData.value = [];
|
||||
}).finally(() => {
|
||||
isPatLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 过滤病人数据(使用 computed 提高性能)
|
||||
const filteredPatData = computed(() => {
|
||||
const key = searchKey.value.trim().toLowerCase();
|
||||
if (!key) return PatData.value;
|
||||
|
||||
return PatData.value.filter(item => {
|
||||
const matchName = item.name.toLowerCase().includes(key);
|
||||
const matchPid = String(item.pid).toLowerCase().includes(key);
|
||||
const matchPinyin = item.pinyin.toLowerCase().includes(key);
|
||||
|
||||
return matchName || matchPid || matchPinyin;
|
||||
});
|
||||
});
|
||||
|
||||
// 点击按钮事件处理
|
||||
const handleClick = () => {
|
||||
loadPatData();
|
||||
// if (!props.disabled && !isPatLoading.value) {
|
||||
dialogVisible.value = true;
|
||||
searchKey.value = '';
|
||||
activeRowIndex.value = -1;
|
||||
// }
|
||||
};
|
||||
|
||||
// 选择病人项
|
||||
const selectItem = (item) => {
|
||||
emit('update:pidValue', item.pid);
|
||||
emit('select', item.pid);
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
|
||||
// 键盘导航
|
||||
const navigateTable = (direction) => {
|
||||
if (!filteredPatData.value.length) return;
|
||||
|
||||
if (direction === 'down') {
|
||||
activeRowIndex.value = (activeRowIndex.value + 1) % filteredPatData.value.length;
|
||||
} else if (direction === 'up') {
|
||||
activeRowIndex.value = (activeRowIndex.value - 1 + filteredPatData.value.length) % filteredPatData.value.length;
|
||||
}
|
||||
};
|
||||
|
||||
// 选择当前活动行
|
||||
const selectActiveItem = () => {
|
||||
if (activeRowIndex.value >= 0 && activeRowIndex.value < filteredPatData.value.length) {
|
||||
selectItem(filteredPatData.value[activeRowIndex.value]);
|
||||
}
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const handleDialogClose = () => {
|
||||
dialogVisible.value = false;
|
||||
activeRowIndex.value = -1;
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 可选:添加活动行样式 */
|
||||
:deep(.el-table__row.active) {
|
||||
background-color: #e6f7ff !important;
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__row td {
|
||||
padding: 1px 0;
|
||||
/* 减小行高 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__header-wrapper th {
|
||||
padding: 6px 0;
|
||||
/* 表头内边距 */
|
||||
background-color: #b3d8ff !important;
|
||||
/* 表头背景色(保留之前的设置) */
|
||||
color: #333;
|
||||
/* 文字颜色加深,提升可读性 */
|
||||
font-weight: 500;
|
||||
/* 文字加粗 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__cell {
|
||||
padding: 0 2px;
|
||||
/* 减小列间距 */
|
||||
}
|
||||
|
||||
/* 可选:调整表格整体样式 */
|
||||
::v-deep .my-table {
|
||||
font-size: 13px;
|
||||
/* 适当减小字体 */
|
||||
}
|
||||
|
||||
::v-deep .my-table .el-table__cell,
|
||||
::v-deep .my-table .el-table__header-wrapper th {
|
||||
border-width: 1px;
|
||||
border-color: #ebeef5;
|
||||
}
|
||||
</style>
|
||||
543
src/views/regional/circulation/mzcy/index.vue
Normal file
@ -0,0 +1,543 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left">
|
||||
<el-row :gutter="5">
|
||||
<el-form-item label="" label-width="0px" prop="brdh">
|
||||
<el-col :span="6">
|
||||
<div> 就诊卡号/病历号/磁卡号: </div>
|
||||
<el-input v-model="queryParams.brdh" placeholder="就诊卡号/病历号/磁卡号" clearable @keyup.enter="handleQuery" />
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-radio-group v-model="queryParams.zt" size="default">
|
||||
<el-radio v-for="(item, index) in showconfirmOptions" :key="index" :value="item.value"
|
||||
:disabled="item.disabled">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<div> 申请获取期限: </div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
||||
<el-radio-group v-model="queryParams.subday" size="default">
|
||||
<el-radio v-for="(item, index) in subdayOptions" :key="index" :value="item.value"
|
||||
:disabled="item.disabled">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-select v-model="queryParams.cardtype" placeholder="卡类型" clearable :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in cardtypeOptions" :key="index" :label="item.label" :value="item.value"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="primary" icon="Search" @click="readCard">读卡</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<PatSearchDialog @select="handlePatientSelect" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row :gutter="5" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Search" @click="handleQuery">查询</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Printer" :disabled="single" @click="printAll">打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Printer" :disabled="single" @click="printSigne">单打条码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Printer" :disabled="freesingle" @click="printBack">单打回单</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Delete" @click="cancel">取消采样</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="5" class="table-container">
|
||||
<el-table ref="tableRef" :data="reqmainList" @selection-change="handleSelectionChange" @select="handleSelect"
|
||||
height="100%" :cell-style="tableCellStyle">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="sqxmmc" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="项目代码" align="center" prop="sqxmdh" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="项目类别" align="center" prop="cp_xmlb" />
|
||||
<el-table-column label="样本类型" align="center" prop="yblx" />
|
||||
<el-table-column label="条码号" align="center" prop="sqh" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" align="center" prop="sqsj" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.sqsj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="病人姓名" align="center" prop="brxm" show-overflow-tooltip />
|
||||
<el-table-column label="申请医生" align="center" prop="sqys" :formatter="formatDict('SRD')" show-overflow-tooltip />
|
||||
<el-table-column label="序号" align="center" prop="xh" show-overflow-tooltip />
|
||||
<el-table-column label="数量" align="center" prop="sl" show-overflow-tooltip />
|
||||
<el-table-column label="单价" align="center" prop="dj" show-overflow-tooltip />
|
||||
<el-table-column label="状态" align="center" prop="zt" show-overflow-tooltip />
|
||||
<el-table-column label="计价" align="center" prop="jjzt">
|
||||
<template #default="scope">
|
||||
<el-checkbox :model-value="scope.row.jjzt === '1'" disabled>
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="病人代号" align="center" prop="brdh" show-overflow-tooltip />
|
||||
<el-table-column label="备注1" align="center" prop="detailBZ1" show-overflow-tooltip />
|
||||
<el-table-column label="备注2" align="center" prop="detailBZ2" show-overflow-tooltip />
|
||||
<el-table-column label="颜色" align="center" prop="cp_color" v-if="false" show-overflow-tooltip />
|
||||
<el-table-column label="确认标识" align="center" prop="cp_cflag" v-if="false" show-overflow-tooltip />
|
||||
<el-table-column label="科室" align="center" prop="ksdh" :formatter="formatDict('DP')" show-overflow-tooltip />
|
||||
<el-table-column label="病人类型" align="center" prop="brly" :formatter="formatDict('PT')" show-overflow-tooltip />
|
||||
<el-table-column label="性别" align="center" prop="brxb" :formatter="formatDict('SX')" show-overflow-tooltip />
|
||||
<el-table-column label="生日" align="center" prop="brsr" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.brsr, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="床号" align="center" prop="ch" width="50" show-overflow-tooltip />
|
||||
<el-table-column label="诊断" align="center" prop="zd" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="条码类别" align="center" prop="bgddh" v-if="false" show-overflow-tooltip />
|
||||
<el-table-column label="年龄" align="center" prop="nl" show-overflow-tooltip />
|
||||
<el-table-column label="年龄单位" align="center" prop="nldw" :formatter="formatDict('AU')" show-overflow-tooltip />
|
||||
<el-table-column label="采样时间" align="center" prop="cysj" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.cysj, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!-- 汇总行 -->
|
||||
<div class="table-summary">
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">条码数:</span>
|
||||
<span class="summary-value">{{ idsnew.length }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">项目数:</span>
|
||||
<span class="summary-value">{{ totalRows }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">合计金额:</span>
|
||||
<span class="summary-value">{{ totalPrice.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Mzcy">
|
||||
import {
|
||||
querySQD,
|
||||
queryPatList,
|
||||
printBackpaper,
|
||||
printBarcodeall
|
||||
} from "@/api/mzcx/cydj.js";
|
||||
import { querySample } from '@/api/regional/index'
|
||||
import PatSearchDialog from '../components/OutPatList.vue'
|
||||
// import PatSearchDialog from './components/OutPatList.vue'
|
||||
import { classCom } from '@/utils/classCom';
|
||||
const comDict = inject('comDict');
|
||||
// 字典数据存储
|
||||
const dictData = ref({});
|
||||
const tableRef = ref(null);
|
||||
const { proxy } = getCurrentInstance();
|
||||
// 选中的行
|
||||
const selectedRows = ref([]);
|
||||
const reqmainList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
// 新增:计算属性,返回去重后的ids数组
|
||||
const idsnew = computed(() => {
|
||||
return [...new Set(ids.value)];
|
||||
});
|
||||
const single = ref(true);
|
||||
const freesingle = ref(true);
|
||||
const cardtypeOptions = ref([{ "label": "就诊卡", "value": 1 }, { "label": "医保卡", "value": 2 }, { "label": "电子医保卡", "value": 3 }, { "label": "身份证", "value": 4 }])
|
||||
const showconfirmOptions = ref([{ "label": "未打印", "value": 1 }, { "label": "已打印", "value": 11 }])
|
||||
const subdayOptions = ref([{ "label": "1天", "value": 1 }, { "label": "3天", "value": 3 }, { "label": "1周", "value": 7 }, { "label": "2周", "value": 14 }, { "label": "1月", "value": 30 }, { "label": "3月", "value": 90 }, { "label": "1年", "value": 365 }, { "label": "2年", "value": 730 }])
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
brdh: null,
|
||||
stime: null,
|
||||
etime: null,
|
||||
klx: null,
|
||||
zt: 1,
|
||||
subday: 3000,
|
||||
cardtype: null,
|
||||
Status: '10'
|
||||
},
|
||||
rules: {
|
||||
brdh: [
|
||||
{ required: true, message: "病人代码不能为空", trigger: "blur" }
|
||||
],
|
||||
subday: [],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
// 标志位:是否是程序自动勾选(避免循环触发事件)
|
||||
const isAutoSelect = ref(false);
|
||||
|
||||
/**
|
||||
* 监听单选勾选/取消事件
|
||||
* @param {Array} selection 目前已选中的行
|
||||
* @param {Object} row 当前操作的行数据
|
||||
* @param {Boolean} selected 是否勾选(true=勾选,false=取消)
|
||||
*/
|
||||
const handleSelect = (selection, row, selected) => {
|
||||
if (isAutoSelect.value) return;
|
||||
|
||||
const targetSqh = row.sqh;
|
||||
const targetxh = row.xh;
|
||||
if (!targetSqh) return;
|
||||
|
||||
// 先收集需要自动勾选的行(避免在循环中修改数据)
|
||||
const rowsToSelect = reqmainList.value.filter(
|
||||
item => item.sqh === targetSqh && item.xh !== targetxh
|
||||
);
|
||||
|
||||
// 如果有需要自动勾选的行,才开启标志位
|
||||
if (rowsToSelect.length > 0) {
|
||||
|
||||
rowsToSelect.forEach(item => {
|
||||
tableRef.value.toggleRowSelection(item, selected);
|
||||
isAutoSelect.value = true;
|
||||
});
|
||||
setTimeout(() => isAutoSelect.value = false, 0);
|
||||
}
|
||||
};
|
||||
// 字典格式化方法
|
||||
const formatDict = (dictType) => {
|
||||
return (row, column, value) => {
|
||||
// 从全局字典中获取映射值
|
||||
return dictData.value[dictType].find(item => String(item.value) === String(value).trim())?.label || value;
|
||||
};
|
||||
};
|
||||
// 定义“空数据”的判断函数
|
||||
const isEmptyData = (data) => {
|
||||
// 处理 null/undefined
|
||||
if (data === null || data === undefined) return true;
|
||||
// 处理空数组
|
||||
if (Array.isArray(data) && data.length === 0) return true;
|
||||
// 处理空对象(无任何属性)
|
||||
if (typeof data === 'object' && Object.keys(data).length === 0) return true;
|
||||
// 处理空字符串
|
||||
if (typeof data === 'string' && data.trim() === '') return true;
|
||||
return false;
|
||||
};
|
||||
/**
|
||||
* 获取指定天数偏移后的日期时间字符串
|
||||
* @param {number} days 偏移天数(正数表示未来,负数表示过去)
|
||||
* @returns {string} 格式化的日期时间字符串 'yyyy-mm-dd HH:MM:SS'
|
||||
*/
|
||||
function getDateOffset(days) {
|
||||
const now = new Date();
|
||||
const offsetTimestamp = now.getTime() + days * 24 * 60 * 60 * 1000;
|
||||
const targetDate = new Date(offsetTimestamp);
|
||||
|
||||
const year = targetDate.getFullYear();
|
||||
const month = String(targetDate.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(targetDate.getDate()).padStart(2, '0');
|
||||
// const hours = String(targetDate.getHours()).padStart(2, '0');
|
||||
// const minutes = String(targetDate.getMinutes()).padStart(2, '0');
|
||||
//const seconds = String(targetDate.getSeconds()).padStart(2, '0');
|
||||
// return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
return `${year}-${month}-${day} 00:00:00`;
|
||||
}
|
||||
function getSubday() {
|
||||
const days = 0 - queryParams.value.subday;
|
||||
queryParams.value.stime = getDateOffset(days);
|
||||
queryParams.value.etime = getDateOffset(1);
|
||||
}
|
||||
/** 查询采样登记列表 */
|
||||
function getList() {
|
||||
freesingle.value = true;
|
||||
if (isEmptyData(queryParams.value.brdh)) proxy.$modal.alert("请刷卡或输入门诊号!");
|
||||
else {
|
||||
loading.value = true;
|
||||
getSubday();
|
||||
querySample(queryParams.value).then(response => {
|
||||
if (isEmptyData(response.data)) proxy.$modal.alert("没有检索的数据!");
|
||||
reqmainList.value = response.data;
|
||||
// console.log('response:', response.data);
|
||||
loading.value = false;
|
||||
single.value = false;
|
||||
// 新增:数据加载完成后触发全选
|
||||
// 延迟执行(确保DOM已更新)
|
||||
setTimeout(() => {
|
||||
if (tableRef.value) {
|
||||
tableRef.value.toggleAllSelection(); // 调用全选方法
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
// open.value = false;
|
||||
// reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
sqh: null,
|
||||
xh: null,
|
||||
sqxmdh: null,
|
||||
sqxmmc: null,
|
||||
sl: null,
|
||||
dj: null,
|
||||
detailZT: null,
|
||||
detailJJZT: null,
|
||||
ksdh: null,
|
||||
sqys: null,
|
||||
sqsj: null,
|
||||
jsys: null,
|
||||
jssj: null,
|
||||
brly: null,
|
||||
brdh: null,
|
||||
brxm: null,
|
||||
zt: null,
|
||||
jjzt: null,
|
||||
brxb: null,
|
||||
brsr: null,
|
||||
jzbz: null,
|
||||
cp_xmlb: null,
|
||||
cp_color: null,
|
||||
cp_cflag: null,
|
||||
detailBZ1: null,
|
||||
ch: null,
|
||||
detailBZ2: null,
|
||||
bz1: null,
|
||||
bz2: null,
|
||||
bz3: null,
|
||||
yblx: null,
|
||||
zxys: null,
|
||||
zxsj: null,
|
||||
bgddh: null,
|
||||
nl: null,
|
||||
nldw: null,
|
||||
zd: null,
|
||||
cysj: null
|
||||
};
|
||||
freesingle.value = false;
|
||||
single.value = false;
|
||||
proxy.resetForm("reqmainRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
getList();
|
||||
}
|
||||
function readCard() {
|
||||
//getList();
|
||||
}
|
||||
|
||||
|
||||
// 处理病人选择事件
|
||||
const handlePatientSelect = (patient) => {
|
||||
// console.log('选中的病人:', patient);
|
||||
queryParams.value.brdh = patient
|
||||
// 处理选中的病人数据
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
if (isAutoSelect.value) return;
|
||||
selectedRows.value = selection;
|
||||
ids.value = selection.map(item => item.sqh);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 打印选择 */
|
||||
function printAll(row) {
|
||||
printSigne();
|
||||
printBack();
|
||||
}
|
||||
/** 单打条码*/
|
||||
function printSigne(row) {
|
||||
if (idsnew.value.length === 0) {
|
||||
return;
|
||||
}
|
||||
printBarcodeall(idsnew.value).then(response => {
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
open.value = false;
|
||||
freesingle.value = false;
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** 打印回单 */
|
||||
function printBack(row) {
|
||||
if (idsnew.value.length === 0) {
|
||||
return;
|
||||
}
|
||||
//console.log('idsnew:', idsnew.value)
|
||||
printBackpaper(idsnew.value).then(response => {
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
open.value = false;
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const totalRows = computed(() => {
|
||||
return reqmainList.value.length || 0;
|
||||
});
|
||||
|
||||
const totalPrice = computed(() => {
|
||||
return reqmainList.value.reduce((sum, row) => {
|
||||
const price = parseFloat(row.dj) || 0;
|
||||
return sum + price;
|
||||
}, 0);
|
||||
});
|
||||
|
||||
|
||||
// 组件挂载时加载字典
|
||||
onMounted(async () => {
|
||||
// 加载病人来源字典
|
||||
const dictRefs = await comDict('PT', 'DP', 'SRD', 'BT', 'SX', 'AU');
|
||||
// 从 ref 中获取实际数据
|
||||
dictData.value = {
|
||||
PT: toRaw(dictRefs.PT.value) || [],
|
||||
DP: toRaw(dictRefs.DP.value) || [],
|
||||
SRD: toRaw(dictRefs.SRD.value) || [],
|
||||
BT: toRaw(dictRefs.BT.value) || [],
|
||||
SX: toRaw(dictRefs.SX.value) || [],
|
||||
AU: toRaw(dictRefs.AU.value) || []
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 表格单元格样式(仅作用于“项目类别”列)
|
||||
const tableCellStyle = ({ row, column }) => {
|
||||
// 只对“项目类别”列生效
|
||||
if (column.label === '项目类别') {
|
||||
// 1. 转换颜色(十进制→十六进制)
|
||||
const bgColor = classCom.decimalToHexColor(row.cp_color);
|
||||
// 2. 自动计算文字颜色(确保和背景色对比度足够)
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
|
||||
return {
|
||||
backgroundColor: bgColor, // 背景色(转换后的值)
|
||||
color: textColor, // 文字色(自动适配)
|
||||
textAlign: 'center', // 文字居中
|
||||
fontWeight: '500' // 文字加粗(提升可读性)
|
||||
};
|
||||
}
|
||||
return {}; // 其他列保持默认样式
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 90vh;
|
||||
/* 容器高度等于窗口高度 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.compact-form {
|
||||
height: 75px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
|
||||
.mb8 {
|
||||
height: 30px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
|
||||
.table-summary {
|
||||
height: 10px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
|
||||
.table-container {
|
||||
flex: 1;
|
||||
/* 占满剩余高度 */
|
||||
overflow: hidden;
|
||||
/* 避免表格超出容器 */
|
||||
}
|
||||
|
||||
.compact-form .el-form-item {
|
||||
padding: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.compact-form .el-form-item__label {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.card-content {
|
||||
max-height: 450px;
|
||||
/* 设置最大高度 */
|
||||
overflow-y: auto;
|
||||
/* 超出高度时显示垂直滚动条 */
|
||||
padding: 5px;
|
||||
/* 保持与卡片默认一致的内边距 */
|
||||
}
|
||||
|
||||
.clickable:hover {
|
||||
cursor: pointer;
|
||||
/* 鼠标悬停时显示手型 */
|
||||
transition: all 0.3s;
|
||||
/* 平滑过渡效果 */
|
||||
color: blue;
|
||||
|
||||
}
|
||||
|
||||
/* 汇总行样式 */
|
||||
.table-summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
padding: 6px 16px;
|
||||
margin-top: 8px;
|
||||
background-color: #f5f7fa;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
font-weight: 500;
|
||||
line-height: 24px;
|
||||
|
||||
/* 汇总行文字行高 */
|
||||
.summary-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 24px;
|
||||
|
||||
.summary-label {
|
||||
color: #606266;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.summary-value {
|
||||
color: #303133;
|
||||
min-width: 40px;
|
||||
text-align: left;
|
||||
/* 核心:数值左对齐 */
|
||||
}
|
||||
|
||||
/* 单独设置"单价合计"的值为红色 */
|
||||
&:nth-child(3) .summary-value {
|
||||
color: #f56c6c;
|
||||
/* Element UI 红色主题色 */
|
||||
font-weight: 600;
|
||||
/* 可选:加粗字体 */
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
184
src/views/regional/circulation/sjdj/index.vue
Normal file
@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-input v-model="queryParams.barcode" placeholder="请输入条码号" clearable @keyup.enter.prevent="getList" />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" @click="getList">扫码</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="cz_box">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<SelectTable v-model:data="dstHospCode" :tableData="hosList" :size="aotuSize" :fields="ksdhFields"
|
||||
placeholder="请选择送检医院" @get-data-value="getValue" />
|
||||
</el-col>
|
||||
<el-col :span="1.5"> <el-button type="primary" :size="aotuSize" @click="sjHandle(30)">标本送检</el-button></el-col>
|
||||
<el-col :span="1.5"> <el-button type="primary" :size="aotuSize" @click="sjHandle(20)">取消送检</el-button></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div style="height: calc(100% - 80px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig"
|
||||
@selection-change="handleSelectionChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ formatDict(row.ageUnit, 'AU') }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDicts(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Sjdj">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { querySample, sampleSign, sampleCollect } from '@/api/regional/index'
|
||||
import { listhospital } from "@/api/regional/dict/hospital";
|
||||
import { listregdict } from "@/api/regional/dict/regdict";
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import dayjs from 'dayjs';
|
||||
import { getDictData, formatDict, dictData } from '@/hooks'
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
|
||||
const queryParams = ref({
|
||||
barcode: '',
|
||||
})
|
||||
const tableData = ref([])
|
||||
const columns = ref([
|
||||
{ type: 'selection', align: 'center', visible: true, width: 40 },
|
||||
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, },
|
||||
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 250 },
|
||||
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 100 },
|
||||
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
|
||||
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
|
||||
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 300 },
|
||||
{ prop: 'sampleTypeName', label: '标本类型', align: 'center', visible: true, },
|
||||
{ prop: 'status', label: '标本状态', align: 'center', visible: true, slot: "status" },
|
||||
{ prop: 'affirmUserName', label: '采样人', align: 'center', visible: true, },
|
||||
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 200 },
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
|
||||
|
||||
|
||||
const ksdhFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 200, enablePinyinSearch: true },
|
||||
{ prop: 'value', label: '代号', width: 200, enablePinyinSearch: true },
|
||||
])
|
||||
|
||||
const dstHospName = ref('')
|
||||
const dstHospCode = ref('')
|
||||
|
||||
const barcodes = ref([])
|
||||
const handleSelectionChange = (val) => {
|
||||
barcodes.value = val.map((item) => item.barcode)
|
||||
}
|
||||
const getValue = (val) => {
|
||||
dstHospName.value = val.label
|
||||
}
|
||||
const sjHandle = (val: number) => {
|
||||
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
|
||||
if (val == 30 && !dstHospCode.value) return ElMessage.warning('请选择送检医院!')
|
||||
const params = {
|
||||
barcode: barcodes.value,
|
||||
dstHospName: dstHospName.value,
|
||||
dstHospCode: dstHospCode.value,
|
||||
status: val
|
||||
}
|
||||
|
||||
sampleSign(params).then((res) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('操作成功!')
|
||||
dstHospCode.value = ''
|
||||
barcodes.value.forEach((item) => {
|
||||
tableData.value.forEach((element, index) => {
|
||||
if (item == element.barcode) {
|
||||
tableData.value.splice(index, 1)
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const getList = () => {
|
||||
const index = tableData.value.findIndex((item) => item.barcode == queryParams.value.barcode)
|
||||
if (index != -1) {
|
||||
ElMessage.warning('条码号已存在!')
|
||||
return
|
||||
}
|
||||
sampleCollect({ barcode: queryParams.value.barcode }).then((res) => {
|
||||
tableData.value.push(res.data)
|
||||
queryParams.value.barcode = ''
|
||||
})
|
||||
}
|
||||
|
||||
const hosList = ref([])
|
||||
const regdictList = ref([])
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
listhospital().then((res) => {
|
||||
hosList.value = res.rows.map((item) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res) => {
|
||||
regdictList.value = res.rows;
|
||||
})
|
||||
getDictData('AU')
|
||||
})
|
||||
|
||||
const formatDicts = (v: string, arr: Array<any>) => {
|
||||
return arr.find((item) => item.dictCode == v)?.dictName || v;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
|
||||
&>button {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.cz_box {
|
||||
padding: .3125rem 0;
|
||||
// border-top: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
804
src/views/regional/circulation/zycy/index.vue
Normal file
@ -0,0 +1,804 @@
|
||||
<template>
|
||||
<div class="app-container ">
|
||||
<div ref="compactForm">
|
||||
<el-row :gutter="10" class="compact-form" v-show="showSearch">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" :size="aotuSize" :rules="queryRules">
|
||||
<el-form-item label="日期:" prop="failed1">
|
||||
<el-date-picker v-model="queryParams.times" type="datetimerange" range-separator="-"
|
||||
start-placeholder="开始时间" end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" @change="handletime" style="width: 25rem;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="委托机构:" prop="srcHospName">
|
||||
<SelectTable v-model:data="queryParams.srcHospName" :fields="ksdhFields" :tableData="hosList" label="label"
|
||||
width="12.5rem" :size="aotuSize" value="label" objKey="label" :border="true" placeholder="请选择委托机构" />
|
||||
</el-form-item>
|
||||
<el-form-item label="条码状态:" prop="zt">
|
||||
<el-select v-model="queryParams.zt" placeholder="请选择" style="width: 6.25rem;">
|
||||
<el-option v-for="item in dictData.ST" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="failed4">
|
||||
<el-select v-model="queryParams.failed4" placeholder="请选择" style="width:8.75rem">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="failed5">
|
||||
<el-input v-model="queryParams.failed5" clearable placeholder="条件搜索" @keyup.enter="handleQuery"
|
||||
@clear="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="">
|
||||
<el-button icon="search" type="primary" @click="handleQuery" :size="aotuSize"> 搜索 </el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery" :size="aotuSize">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="16" class="right-table">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" :size="aotuSize" :loading="btnLoading" plain icon="Plus"
|
||||
@click="printHandle">生成条码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :size="aotuSize" plain icon="Edit" @click="selectStatusRows">选中所有未打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" :size="aotuSize" plain @click="printPdf">打印条码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" :size="aotuSize" plain icon="Upload" @click="openBlock('采样登记')">采样登记</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="openBlock('送检登记')">送检登记</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="goReport">报告查询</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="cancelHandle">条码作废</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="sendSampleHandle">清单打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="changePrinter">打印机设置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
||||
@row-click="rowHandle" @selection-change="selectionChange" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd">
|
||||
<template #dy="{ row }">
|
||||
<svg-icon v-if="row.zt != 1" icon-class="lvgou" />
|
||||
</template>
|
||||
<template #srcHospName="{ row }">
|
||||
武汉市汉阳区江堤街社区卫生服务中心
|
||||
</template>
|
||||
<template #jzbz="{ row }">
|
||||
{{ row.jzbz == '1' ? '急' : '' }}
|
||||
</template>
|
||||
<template #jjzt="{ row }">
|
||||
{{ row.jjzt == '1' ? '计价' : '无' }}
|
||||
</template>
|
||||
<template #brly="{ row }">
|
||||
{{ formatDict(row.brly, 'PT') }}
|
||||
</template>
|
||||
<template #zt="{ row }">
|
||||
{{ formatDict(row.zt.trim(), 'ST') }}
|
||||
</template>
|
||||
<template #yljg="{ row }">
|
||||
{{ formatDict(row.yljg, 'HOS') }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8" class="right-table">
|
||||
<!-- <div class="title"> 项目 </div> -->
|
||||
<el-button type="primary" plain class="mb8" :size="aotuSize">拆分选中项目</el-button>
|
||||
<CustomTable :data="rightTableData" :columns="rightColumns" :config="rightTableConfig">
|
||||
<template #jjzt="{ row }">
|
||||
{{ row.jjzt == '1' ? '计价' : '无' }}
|
||||
</template>
|
||||
<template #zt="{ row }">
|
||||
{{ formatDict(row.zt, 'ST') }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 样本流程 -->
|
||||
<div class="time-line-box">
|
||||
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">
|
||||
<div v-if="i != 0" class="timeline-connector">
|
||||
<img class="timg" src="@/assets/images/yjt.png" alt="">
|
||||
</div>
|
||||
<div :class="['timeline-content', i > lastTimeIndex ? 'no_active' : '']">
|
||||
<div :class="['index', lastTimeIndex == i ? 'active' : '']">{{ Number(i) + 1 }}</div>
|
||||
<div class="timeline-title">{{ item.title }}</div>
|
||||
<div class="timeline-time">{{ item.time }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 采样登记 -->
|
||||
<el-dialog v-model="dialogVisible" :title="title" draggable :close-on-click-modal="false" width="70vw"
|
||||
@close="closeDialog">
|
||||
<div class="flex-between">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-input v-model="sqhText" clearable placeholder="条形码" @keyup.enter="sqdQuery" @clear="sqdQuery" />
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" @click="sqdQuery" plain>读取</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete">删除选中行</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain>打印</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-button type="primary" plain>保存</el-button> -->
|
||||
</div>
|
||||
<CustomTable :data="cyTableData" :columns="cyColumns" :config="cyTableConfig">
|
||||
<template #zt="{ row }">
|
||||
{{ formatDict(row.zt, 'ST') }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="previewShow" title="预览" width="90vw" :close-on-click-modal="false">
|
||||
<iFrame v-if="pdfUrl" :src="pdfUrl" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Zycy">
|
||||
import { classCom } from '@/utils/classCom';
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { usePrintStore } from '@/store/modules/printStore'
|
||||
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain, printSendSample, printsetup } from '@/api/checkCode/index'
|
||||
import dayjs from 'dayjs';
|
||||
import { listhospital } from "@/api/regional/dict/hospital";
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { comDict } from '@/utils/dict'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import iFrame from "@/components/iFrame/index.vue";
|
||||
import { checkPrintService } from '@/utils/printHelper';
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const compactForm = ref<HTMLElement | null>(null);
|
||||
const heightForm = ref(90);
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('采样登记')
|
||||
const sqhText = ref('')
|
||||
const tableRef = ref()
|
||||
interface QueryParams {
|
||||
times: string[]; // 明确类型为字符串元组
|
||||
yljg: string;
|
||||
zt: string;
|
||||
failed4: string;
|
||||
failed5: string;
|
||||
srcHospName: string;
|
||||
userid: string;
|
||||
}
|
||||
// 提交表单数据
|
||||
const queryParams = reactive<QueryParams>({
|
||||
times: ['2025-07-18 00:00:00', '2025-07-18 23:59:59'],
|
||||
userid: '',
|
||||
yljg: '1',
|
||||
zt: '',
|
||||
srcHospName: userStore.sysLoginParam.loginYLJGName,
|
||||
failed4: '',
|
||||
failed5: '',
|
||||
});
|
||||
const showSearch = ref(true);
|
||||
const queryRef = ref()
|
||||
// 定义校验规则
|
||||
const queryRules = ref({
|
||||
// clientId: [
|
||||
// { required: true, message: '编号不能为空', trigger: 'blur' },
|
||||
|
||||
// ],
|
||||
|
||||
// failed3: [
|
||||
// { required: true, message: '条码状态不能为空', trigger: 'change' },
|
||||
// ],
|
||||
})
|
||||
const options = [
|
||||
{
|
||||
value: '1',
|
||||
label: '通过姓名搜索',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '通过病人号搜索',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '通过床号搜索',
|
||||
},
|
||||
]
|
||||
interface DictData {
|
||||
SX?: Array<any>;
|
||||
HOS?: Array<any>;
|
||||
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问
|
||||
}
|
||||
// 字典数据存储
|
||||
const dictData = ref<DictData>({});
|
||||
const handleQuery = async () => {
|
||||
const valid = await queryRef.value.validate().catch(() => { });
|
||||
if (!valid) return false;
|
||||
getList()
|
||||
}
|
||||
// 重置
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
queryParams.value.times = ['2025-07-18 00:00:00', '2025-07-18 23:59:59'];
|
||||
queryParams.value.srcHospName = userStore.sysLoginParam.loginYLJGName,
|
||||
getDays()
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
|
||||
|
||||
// 数据源
|
||||
const tableData = ref([])
|
||||
// 配置项
|
||||
const columns = ref([
|
||||
{ type: 'selection', visible: true, align: 'center', width: 40, label: '多选框' },
|
||||
{ prop: 'srcHospName', label: '委托机构', visible: true, align: 'center', width: 200, slot: 'srcHospName' },
|
||||
{ prop: 'zt', label: '打印', visible: true, align: 'center', slot: 'dy', width: 40 },
|
||||
{ prop: 'jzbz', label: '急', align: 'center', visible: true, slot: 'jzbz', width: 30 },
|
||||
{ prop: 'ch', label: '床号', visible: true, align: 'center', width: 40 },//sortable: true,
|
||||
{ prop: 'brxm', label: '姓名', align: 'center', visible: true, width: 50 },
|
||||
{ prop: 'brxbname', label: '性别', align: 'center', visible: true, width: 30 },
|
||||
{ prop: 'jymd', label: '项目名称', visible: true, width: 130 },
|
||||
{ prop: 'bgddhname', label: '类别', align: 'center', visible: true, width: 80 },
|
||||
{ prop: 'sampletips', label: '采样提示', align: 'center', visible: true, width: 60 },
|
||||
{ prop: 'yblx', label: '样本类型', align: 'center', visible: true, width: 60 },
|
||||
{ prop: 'brdh', label: '病人号', align: 'center', visible: true, width: 90 },
|
||||
{ prop: 'ksname', label: '科室名称', align: 'center', visible: true, width: 100 },
|
||||
{ prop: 'sqh', label: '申请号/条码', align: 'center', visible: true, width: 100 },
|
||||
{ prop: 'zt', label: '状态', align: 'center', visible: true, slot: 'zt', width: 40 },
|
||||
{ prop: 'brly', label: '病人来源', align: 'center', visible: true, slot: 'brly', width: 60 },
|
||||
{ prop: 'sqysname', label: '申请医生', align: 'center', visible: true, width: 60 },
|
||||
{ prop: 'sqsj', label: '申请时间', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'jjzt', label: '计价标志', align: 'center', visible: true, slot: 'jjzt', width: 60 },
|
||||
{ prop: 'zxysname', label: '执行医生', align: 'center', visible: true, width: 60 },
|
||||
{ prop: 'bbsjrname', label: '送检人', align: 'center', visible: true, width: 50 },
|
||||
{ prop: 'yljg', label: '检验机构', align: 'center', visible: true, slot: 'yljg', width: 150 },
|
||||
])
|
||||
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const sqhs = ref([]);
|
||||
// 单元格样式
|
||||
const cellStyleHd = ({ row, column, rowIndex, columnIndex }: {
|
||||
row: any;
|
||||
column: any;
|
||||
rowIndex: number;
|
||||
columnIndex: number;
|
||||
}) => {
|
||||
// console.log(row, column, rowIndex, columnIndex);
|
||||
if (column.label == "急" && row.jzbz == "1") {
|
||||
return { color: '#f00' };
|
||||
}
|
||||
|
||||
if (column.label == "类别") {
|
||||
const bgColor = classCom.decimalToHexColor(row.bkcolor);
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
return {
|
||||
backgroundColor: `${bgColor} !important`,
|
||||
color: textColor,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const ksdhFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
{ prop: 'value', label: '代号', width: 120, enablePinyinSearch: true },
|
||||
])
|
||||
|
||||
const rowClassNameHd = ({ row, rowIndex }: {
|
||||
row: any;
|
||||
rowIndex: number;
|
||||
}) => {
|
||||
return 'custom-row-class'; // 返回自定义类名
|
||||
};
|
||||
|
||||
// 时间线数据
|
||||
const timelineItems = ref(
|
||||
[
|
||||
{ title: '检验申请', time: '' },
|
||||
{ title: '标本采集', time: '' },
|
||||
{ title: '标本送检', time: '' },
|
||||
{ title: '标本签收', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '结果审核', time: '' },
|
||||
]
|
||||
);
|
||||
|
||||
// 计算最后一个有时间的节点索引
|
||||
const lastTimeIndex = computed(() => {
|
||||
|
||||
const lastIndex = timelineItems.value.findLastIndex(item => item.time);
|
||||
if (lastIndex === -1) {
|
||||
return -1
|
||||
} else {
|
||||
return lastIndex;
|
||||
}
|
||||
});
|
||||
|
||||
// 点击行
|
||||
const rowHandle = (row: any) => {
|
||||
timelineItems.value =
|
||||
[
|
||||
{ title: '检验申请', time: row.sqsj },
|
||||
{ title: '标本采集', time: row.cysj },
|
||||
{ title: '标本送检', time: row.bbsjsj },
|
||||
{ title: '标本签收', time: row.jssj },
|
||||
{ title: '上机检验', time: row.sjsj },
|
||||
{ title: '结果审核', time: row.confirmtime },
|
||||
]
|
||||
getRightTable(row)
|
||||
};
|
||||
|
||||
const selectionChange = (selection: any) => {
|
||||
sqhs.value = selection;
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
// 更新列配置
|
||||
columns.value = data.columns;
|
||||
// 可以在这里保存列顺序到本地存储等
|
||||
// localStorage.setItem('tableColumnOrder', JSON.stringify(data.columns));
|
||||
};
|
||||
|
||||
// 左侧表格配置
|
||||
const tableConfig = ref({
|
||||
// stripe: true, // 斑马纹
|
||||
border: true, // 边框
|
||||
index: true, // 序号
|
||||
height: '', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
cellStyle: cellStyleHd,
|
||||
rowClassName: rowClassNameHd,
|
||||
fit: true
|
||||
})
|
||||
// 右侧数据源
|
||||
const rightTableData = ref([])
|
||||
// 配置项
|
||||
const rightColumns = ref([
|
||||
{ prop: 'sqxmdh', label: '项目代号', visible: true, sortable: true, width: '110px' },
|
||||
{ prop: 'sqxmmc', label: '项目名称', visible: true, width: '120px' },
|
||||
{ prop: 'dj', label: '单价', align: 'center', visible: true, },
|
||||
{ prop: 'sl', label: '数量', align: 'center', visible: true, },
|
||||
{ prop: 'zt', label: '状态', align: 'center', visible: true, slot: 'zt', },
|
||||
{ prop: 'jjzt', label: '计价标志', align: 'center', visible: true, slot: 'jjzt', },
|
||||
|
||||
])
|
||||
// 表格配置
|
||||
const rightTableConfig = ref({
|
||||
// stripe: true, // 斑马纹
|
||||
border: true, // 边框
|
||||
height: '', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
})
|
||||
|
||||
// 采样数据源
|
||||
const cyTableData = ref([])
|
||||
// 配置项
|
||||
const cyColumns = ref([
|
||||
{ prop: 'sqh', label: '申请号/条形码', align: 'center', visible: true, sortable: true, width: 140 },
|
||||
{ prop: 'ksdh', label: '科室病区', align: 'center', visible: true, width: 120 },
|
||||
{ prop: 'ch', label: '床号', align: 'center', visible: true, sortable: true, },
|
||||
{ prop: 'brxm', label: '姓名', align: 'center', visible: true, },
|
||||
{ prop: 'brdh', label: '病人号', align: 'center', visible: true, },
|
||||
{ prop: 'brxb', label: '性别', align: 'center', visible: true, },
|
||||
{ prop: 'yblx', label: '样本类型', align: 'center', visible: true, },
|
||||
{ prop: 'zt', label: '状态', align: 'center', visible: true, slot: 'zt', },
|
||||
{ prop: 'jzbz', label: '急诊', align: 'center', visible: true, },
|
||||
{ prop: 'jjzt', label: '采样人', align: 'center', visible: true, },
|
||||
{ prop: 'cysj', label: '采样时间', align: 'center', visible: true, },
|
||||
{ prop: 'zxysname', label: '执行医生', align: 'center', visible: true, },
|
||||
{ prop: 'zxsj', label: '执行时间', align: 'center', visible: true, },
|
||||
])
|
||||
// 表格配置
|
||||
const cyTableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 采样登记
|
||||
const openBlock = (value: string) => {
|
||||
if (sqhs.value.length > 0) {
|
||||
ElMessageBox.confirm(`确定操作选中的数据吗?`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
beforeClose: async (action, instance, done) => {
|
||||
if (action === "confirm") {
|
||||
// 生成请求Promise数组
|
||||
const requests = sqhs.value.map((item: any) => { return item.sqh });
|
||||
fetchCodeExec({
|
||||
sqh: requests.join(','),
|
||||
userid: 'lis',
|
||||
status: value == '采样登记' ? 12 : 13,
|
||||
yljg: 1
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('调用成功');
|
||||
done();
|
||||
getList()
|
||||
} else {
|
||||
ElMessage.error('调用失败');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
}).catch(() => { });
|
||||
|
||||
} else {
|
||||
title.value = value
|
||||
dialogVisible.value = true
|
||||
}
|
||||
}
|
||||
// 采样读取
|
||||
const sqdQuery = () => {
|
||||
const index = cyTableData.value.findIndex((item: any) => item.sqh == sqhText.value)
|
||||
if (index !== -1) return ElMessage.warning('该申请单数据已存在!')
|
||||
|
||||
fetchCodeReqmain({ sqh: sqhText.value }).then((res: any) => {
|
||||
if (res.code == 0 && res.data.sqh) {
|
||||
fetchCodeExec({
|
||||
sqh: res.data.sqh,
|
||||
userid: 'lis',
|
||||
status: 12,
|
||||
yljg: 1
|
||||
})
|
||||
cyTableData.value = cyTableData.value.concat(res.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 关闭弹窗清空
|
||||
const closeDialog = () => {
|
||||
cyTableData.value = []
|
||||
sqhText.value = ''
|
||||
}
|
||||
|
||||
|
||||
interface ColumnItem {
|
||||
prop: string;
|
||||
label: string;
|
||||
visible: boolean;
|
||||
key: number;
|
||||
align: string;
|
||||
slot: string;
|
||||
width: string;
|
||||
}
|
||||
// 更新列
|
||||
// const updateColumns = (arr: Array<ColumnItem>) => {
|
||||
// columns.value = arr
|
||||
// };
|
||||
|
||||
const getRightTable = (row: any) => {
|
||||
fetchCodeDetail({ sqh: row.sqh }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
rightTableData.value = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const goReport = () => {
|
||||
// 跳转到报告查询页面
|
||||
router.push('/regional/inspectionReport/report?startdate=2025-08-19&endate=2025-08-19&deptcode=0210&userid=00910&brdh=')
|
||||
};
|
||||
|
||||
const cancelHandle = () => {
|
||||
if (sqhs.value.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
ElMessageBox.confirm(`确定作废选中的数据吗?`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
beforeClose: async (action, instance, done) => {
|
||||
if (action === "confirm") {
|
||||
const requests = sqhs.value.map((item: any) => { return item.sqh });
|
||||
fetchCodeExec({
|
||||
sqh: requests.join(','),
|
||||
userid: 'lis',
|
||||
status: 9,
|
||||
yljg: 1
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('调用成功');
|
||||
done();
|
||||
getList()
|
||||
} else {
|
||||
ElMessage.error('调用失败');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
const pdfUrl = ref('')
|
||||
const previewShow = ref(false)
|
||||
|
||||
const sendSampleHandle = () => {
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
const arr = selections.map((item: any) => { return item.sqh });
|
||||
printSendSample(arr).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
const url = res.data
|
||||
if (!url) return ElMessage.warning('未查询到文件')
|
||||
pdfUrl.value = `data:application/pdf;base64,${url}`
|
||||
previewShow.value = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const changePrinter = (value: string) => {
|
||||
checkPrintService().then((isConnected) => {
|
||||
if (isConnected) {
|
||||
printsetup()
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
const getDays = () => {
|
||||
const end = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
const start = dayjs().subtract(2, 'day').format('YYYY-MM-DD HH:mm:ss'); //add 时间往后
|
||||
queryParams.times = [start, end];
|
||||
}
|
||||
|
||||
const hosList = ref([])
|
||||
onMounted(async () => {
|
||||
// 初始化3天区间(今天-前两天)
|
||||
|
||||
// console.log(queryParams.times);
|
||||
getList()
|
||||
adjustTableHeight();
|
||||
// 加载病人来源字典
|
||||
const dictRefs = await comDict('PT', 'HOS', 'ST');
|
||||
|
||||
// 从 ref 中获取实际数据
|
||||
dictData.value = {
|
||||
PT: toRaw(dictRefs.PT.value) || [],
|
||||
HOS: toRaw(dictRefs.HOS.value) || [],
|
||||
ST: toRaw(dictRefs.ST.value) || [],
|
||||
};
|
||||
|
||||
|
||||
listhospital().then((res: any) => {
|
||||
hosList.value = res.rows.map((item: any) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
// 字典格式化方法
|
||||
const formatDict = (v: string, dictType: string) => {
|
||||
return dictData.value[dictType]?.find((item: any) => item.value == v)?.label || v;
|
||||
};
|
||||
|
||||
// 计算table高度
|
||||
watch(showSearch, () => {
|
||||
nextTick(() => {
|
||||
adjustTableHeight();
|
||||
})
|
||||
}, { immediate: true });
|
||||
|
||||
function adjustTableHeight() {
|
||||
if (compactForm.value) {
|
||||
// 获取高度
|
||||
heightForm.value = compactForm.value.offsetHeight;
|
||||
tableConfig.value.height = `calc(74vh - ${heightForm.value}px)`; // 设置表格容器的高度
|
||||
rightTableConfig.value.height = `calc(74vh - ${heightForm.value}px)`;
|
||||
}
|
||||
}
|
||||
|
||||
const handletime = (val: Array<string>) => {
|
||||
// console.log('时间', val);
|
||||
}
|
||||
|
||||
const btnLoading = ref(false);
|
||||
|
||||
// 生成条码
|
||||
const printHandle = () => {
|
||||
btnLoading.value = true;
|
||||
const data = {
|
||||
dept: '0235',
|
||||
userid: 'lis',
|
||||
st: '',
|
||||
et: '',
|
||||
yljg: queryParams.yljg
|
||||
}
|
||||
if (queryParams.times && queryParams.times.length) {
|
||||
data.st = queryParams.times[0]
|
||||
data.et = queryParams.times[1]
|
||||
}
|
||||
addObj(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
getList()
|
||||
}
|
||||
}).finally(() => {
|
||||
btnLoading.value = false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 查询申请单
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
const data = {
|
||||
dept: '0235',
|
||||
userid: 'lis',
|
||||
st: queryParams.times[0],
|
||||
et: queryParams.times[1],
|
||||
yljg: queryParams.yljg
|
||||
}
|
||||
fetchCodeList(data).then((response: any) => {
|
||||
if (response.code == 0) {
|
||||
loading.value = false;
|
||||
tableData.value = response.data
|
||||
if (tableData.value.length > 0) {
|
||||
rowHandle(response.data[0])
|
||||
getRightTable(response.data[0])
|
||||
tableRef.value.setCurrentRow(response.data[0])
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const selectStatusRows = () => {
|
||||
tableRef.value.clearSelection()
|
||||
tableData.value.forEach((item: any) => {
|
||||
if (item.zt == 1) {
|
||||
tableRef.value.toggleRowSelection(item, true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 打印pdf
|
||||
const printPdf = () => {
|
||||
checkPrintService().then((isConnected) => {
|
||||
if (!isConnected) return
|
||||
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
|
||||
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
beforeClose: async (action, instance, done) => {
|
||||
if (action === "confirm") {
|
||||
const requests = selections.map((item: any) => item.sqh)
|
||||
const res = await fetchCodeExec({
|
||||
sqh: requests.join(','),
|
||||
userid: queryParams.userid,
|
||||
status: 11,
|
||||
yljg: queryParams.yljg
|
||||
})
|
||||
if (res.code === 0) {
|
||||
done()
|
||||
getList()
|
||||
}
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
}).catch(() => { })
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-row-class {
|
||||
background-color: #c6c3ff !important;
|
||||
/* 设置行背景色 */
|
||||
}
|
||||
|
||||
.right-table {
|
||||
border: 1px solid #E1E9F7;
|
||||
padding-top: .3125rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
border-bottom: 1px solid #E1E9F7;
|
||||
margin-bottom: .625rem;
|
||||
padding: .625rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.time-line-box {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin-top: .35rem;
|
||||
background-color: #f0f3f8;
|
||||
padding: .3rem 2.5rem;
|
||||
}
|
||||
|
||||
.time-line-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
width: 16.6%;
|
||||
// padding: 0 30px;
|
||||
|
||||
.timeline-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.index {
|
||||
width: 1.875rem;
|
||||
height: 1.875rem;
|
||||
line-height: 1.875rem;
|
||||
background: #E1E9F7;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-weight: 500;
|
||||
font-size: 1.125rem;
|
||||
color: #4767A3;
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: #4096ff;
|
||||
box-shadow: 0 0 0 .25rem rgba(64, 150, 255, 0.2);
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.timeline-title {
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
color: #4767A3;
|
||||
}
|
||||
|
||||
.timeline-time {
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
font-size: .875rem;
|
||||
color: #4767A3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.timg {
|
||||
width: 3.125rem;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
229
src/views/regional/dict/diagnosis/index.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="诊断编码" prop="diagCode">
|
||||
<el-input v-model="queryParams.diagCode" placeholder="请输入诊断编码" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断名称" prop="diagName">
|
||||
<el-input v-model="queryParams.diagName" placeholder="请输入诊断名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="诊断状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="diagnosisList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="诊断编号" align="center" prop="diagId" />
|
||||
<el-table-column label="诊断编码" align="center" prop="diagCode" />
|
||||
<el-table-column label="诊断名称" align="center" prop="diagName" />
|
||||
<el-table-column label="诊断排序" align="center" prop="diagSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改诊断对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="diagnosisRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="诊断名称" prop="diagName">
|
||||
<el-input v-model="form.diagName" placeholder="请输入诊断名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断编码" prop="diagCode">
|
||||
<el-input v-model="form.diagCode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断顺序" prop="diagSort">
|
||||
<el-input-number v-model="form.diagSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="诊断状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="diagnosis">
|
||||
import { listdiagnosis, adddiagnosis, deldiagnosis, getdiagnosis, updatediagnosis } from "@/api/regional/dict/diagnosis";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const diagnosisList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
diagCode: undefined,
|
||||
diagName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
diagName: [{ required: true, message: "诊断名称不能为空", trigger: "blur" }],
|
||||
diagCode: [{ required: true, message: "诊断编码不能为空", trigger: "blur" }],
|
||||
diagSort: [{ required: true, message: "诊断顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询诊断列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listdiagnosis(queryParams.value).then(response => {
|
||||
diagnosisList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
diagId: undefined,
|
||||
diagCode: undefined,
|
||||
diagName: undefined,
|
||||
diagSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("diagnosisRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.diagId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加诊断";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const diagId = row.diagId || ids.value;
|
||||
getdiagnosis(diagId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改诊断";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["diagnosisRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.diagId != undefined) {
|
||||
updatediagnosis(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
adddiagnosis(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const diagIds = row.diagId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除诊断编号为"' + diagIds + '"的数据项?').then(function () {
|
||||
return deldiagnosis(diagIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/diagnosis/export", {
|
||||
...queryParams.value
|
||||
}, `diag_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
244
src/views/regional/dict/hospital/index.vue
Normal file
@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="医疗机构编码" prop="hospitalCode">
|
||||
<el-input v-model="queryParams.hospitalCode" placeholder="请输入医疗机构编码" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医疗机构名称" prop="hospitalName">
|
||||
<el-input v-model="queryParams.hospitalName" placeholder="请输入医疗机构名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="有效状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="hospitalId" />
|
||||
<el-table-column label="医疗机构编码" align="center" prop="hospitalCode" />
|
||||
<el-table-column label="医疗机构名称" align="center" prop="hospitalName" />
|
||||
<el-table-column label="级别" align="center" prop="hospital_type">
|
||||
<template #default="scope">
|
||||
{{yljbList.find(item => item.dictCode === scope.row.hospital_type)?.dictName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改医疗机构对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="35vw" append-to-body>
|
||||
<el-form ref="postRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item label="医疗机构名称" prop="hospitalName">
|
||||
<el-input v-model="form.hospitalName" placeholder="请输入医疗机构名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医疗机构编码" prop="hospitalCode">
|
||||
<el-input v-model="form.hospitalCode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医疗机构密钥" prop="hospitalUserinfo">
|
||||
<el-input v-model="form.hospitalUserinfo" placeholder="请输入编码密钥" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医疗机构级别" prop="hospital_type">
|
||||
<el-select v-model="form.hospital_type" placeholder="请选择医疗机构级别" clearable style="width: 100%">
|
||||
<el-option v-for="item in yljbList" :key="item.dictCode" :label="item.dictName" :value="item.dictCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="医疗机构状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="hospital">
|
||||
import { listhospital, addhospital, delhospital, gethospital, updatehospital } from "@/api/regional/dict/hospital.ts";
|
||||
import { getComDicts } from "@/api/liswork/dict/ComDict";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const postList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const yljbList = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
hospitalCode: undefined,
|
||||
hospitalName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
hospitalName: [{ required: true, message: "医疗机构名称不能为空", trigger: "blur" }],
|
||||
hospitalCode: [{ required: true, message: "医疗机构编码不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询医疗机构列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listhospital(queryParams.value).then(response => {
|
||||
postList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
hospitalId: undefined,
|
||||
hospitalCode: undefined,
|
||||
hospitalName: undefined,
|
||||
hospitalUserinfo: undefined,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("postRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.hospitalId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加医疗机构";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const hospitalId = row.hospitalId || ids.value;
|
||||
gethospital(hospitalId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改医疗机构";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["postRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.hospitalId != undefined) {
|
||||
updatehospital(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addhospital(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const hospitalIds = row.hospitalId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除医疗机构编号为"' + hospitalIds + '"的数据项?').then(function () {
|
||||
return delhospital(hospitalIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("transitdict/hospital/export", {
|
||||
...queryParams.value
|
||||
}, `hospital_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
getList();
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getComDicts({ dict_type: 'HTYPE' }).then(response => {
|
||||
yljbList.value = response.data;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
11
src/views/regional/dict/item/index.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
289
src/views/regional/dict/itemclass/index.vue
Normal file
@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="项目类别编码" prop="itemclassCode">
|
||||
<el-input v-model="queryParams.itemclassCode" placeholder="请输入项目类别编码" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类别名称" prop="itemclassName">
|
||||
<el-input v-model="queryParams.itemclassName" placeholder="请输入项目类别名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="有效状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"
|
||||
:cell-style="tableCellStyle" height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="itemclassId" />
|
||||
<el-table-column label="项目大类" align="center" prop="classid" />
|
||||
<el-table-column label="项目类别编码" align="center" prop="itemclassCode" />
|
||||
<el-table-column label="项目类别名称" align="center" prop="itemclassName" show-overflow-tooltip />
|
||||
<el-table-column label="试管名称" align="center" prop="itemclassTips" show-overflow-tooltip />
|
||||
<el-table-column label="试管颜色" align="center" prop="itemclassBkcolor" show-overflow-tooltip />
|
||||
<el-table-column label="默认样本类型" align="center" prop="itemclassYblx" show-overflow-tooltip />
|
||||
<el-table-column label="打印次数" align="center" prop="itemclassPrintcnt" />
|
||||
<el-table-column label="抗凝样本" width="80" align="center" prop="itemclassKn">
|
||||
<template #default="scope">
|
||||
<el-checkbox :checked="scope.row.itemclassKn === 1 || scope.row.itemclassKn === '1'" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="itemclassSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改项目类别对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="postRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="项目大类" prop="classid">
|
||||
<el-select v-model="form.classid" placeholder="请选择项目大类" clearable style="width: 100%">
|
||||
<el-option v-for="dict in xmdlList" :key="dict.dictCode" :label="dict.dictName" :value="dict.dictCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类别名称" prop="itemclassName">
|
||||
<el-input v-model="form.itemclassName" placeholder="请输入类别名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类别编码" prop="itemclassCode">
|
||||
<el-input v-model="form.itemclassCode" placeholder="请输入类别编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="试管名称" prop="itemclassTips">
|
||||
<el-input v-model="form.itemclassUserinfo" placeholder="请输入试管名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="试管颜色" prop="itemclassBkcolor">
|
||||
<el-input-number v-model="form.itemclassBkcolor" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="默认样本类型" prop="itemclassYblx">
|
||||
<el-input v-model="form.itemclassYblx" placeholder="请输入默认样本类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="打印次数" prop="itemclassPrintcnt">
|
||||
<el-input-number v-model="form.itemclassPrintcnt" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抗凝样本" prop="itemclassKn">
|
||||
<el-checkbox v-model="form.itemclassKn" true-label="1" false-label="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类别顺序" prop="itemclassSort">
|
||||
<el-input-number v-model="form.itemclassSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类别状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="itemclass">
|
||||
import { listitemclass, additemclass, delitemclass, getitemclass, updateitemclass } from "@/api/regional/dict/itemclass.ts";
|
||||
import { listregdict } from "@/api/regional/dict/regdict.ts";
|
||||
import { classCom } from '@/utils/classCom';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const xmdlList = ref([]);
|
||||
const postList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
itemclassCode: undefined,
|
||||
itemclassName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
classid: [{ required: true, message: "项目大类不能为空", trigger: "blur" }],
|
||||
itemclassName: [{ required: true, message: "项目类别名称不能为空", trigger: "blur" }],
|
||||
itemclassCode: [{ required: true, message: "项目类别编码不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询项目类别列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listitemclass(queryParams.value).then(response => {
|
||||
postList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
itemclassId: undefined,
|
||||
itemclassCode: undefined,
|
||||
itemclassName: undefined,
|
||||
itemclassUserinfo: undefined,
|
||||
itemclassTips: undefined,
|
||||
itemclassBkcolor: 255,
|
||||
itemclassYblx: undefined,
|
||||
itemclassPrintcnt: 1,
|
||||
itemclassKn: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("postRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.itemclassId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加项目类别";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const itemclassId = row.itemclassId || ids.value;
|
||||
getitemclass(itemclassId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改项目类别";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["postRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.itemclassId != undefined) {
|
||||
updateitemclass(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
additemclass(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const itemclassIds = row.itemclassId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除项目类别编号为"' + itemclassIds + '"的数据项?').then(function () {
|
||||
return delitemclass(itemclassIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("transitdict/itemclass/export", {
|
||||
...queryParams.value
|
||||
}, `itemclass_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
const tableCellStyle = ({ row, column }) => {
|
||||
// 只对“项目类别”列生效
|
||||
if (column.label === '试管颜色') {
|
||||
// 1. 转换颜色(十进制→十六进制)
|
||||
const bgColor = classCom.decimalToHexColor(row.itemclassBkcolor);
|
||||
// 2. 自动计算文字颜色(确保和背景色对比度足够)
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
|
||||
return {
|
||||
backgroundColor: bgColor, // 背景色(转换后的值)
|
||||
color: textColor, // 文字色(自动适配)
|
||||
textAlign: 'center', // 文字居中
|
||||
fontWeight: '500' // 文字加粗(提升可读性)
|
||||
};
|
||||
}
|
||||
return {}; // 其他列保持默认样式
|
||||
};
|
||||
|
||||
getList();
|
||||
|
||||
onMounted(() => {
|
||||
listregdict({ dictType: 'CLASS' }).then(response => {
|
||||
xmdlList.value = response.rows;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
215
src/views/regional/dict/itemvs/index.vue
Normal file
@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<div class="cate_container">
|
||||
<!-- 左侧表格 -->
|
||||
<div class="left_box">
|
||||
<el-input v-model="leftSearchValue" placeholder="请输入类别名称或代号" class="mb10" />
|
||||
<el-table :data="filteredLeftTableData" @row-click="handleLeftRowClick" highlight-current-row border
|
||||
:cell-style="cellStyle" height="80vh" style="width: 100%;">
|
||||
<el-table-column prop="itemclassCode" label="分单类别代号" width="110" />
|
||||
<el-table-column prop="itemclassName" label="类别名称" />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 中间表格 -->
|
||||
<div class="m_box">
|
||||
<el-input v-model="middleSearchValue" placeholder="请输入项目名称或代号" class="mb10" />
|
||||
<el-table :data="filteredMiddleTableData" @row-dblclick="handleMiddleRowDblClick" highlight-current-row
|
||||
style="width: 100%;" height="80vh" border>
|
||||
<el-table-column prop="itemcode" label="项目代号" width="100" />
|
||||
<el-table-column prop="itemname" label="当前类别包含门诊项目" />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 右侧表格 -->
|
||||
<div class="right_box">
|
||||
<el-row :gutter="20" class="mb10">
|
||||
<el-col :span="12">
|
||||
<el-input v-model="rightSearchValue" placeholder="请输入项目名称或代号" />
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="compareStatus" placeholder="请选择" style="width: 200px;" @change="handleSelectChange">
|
||||
<el-option label="未对照" value="1"></el-option>
|
||||
<el-option label="其他类别项目" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-table :data="filteredRightTableData" @row-dblclick="handleRightRowDblClick" highlight-current-row
|
||||
height="80vh" border style="width: 100%;">
|
||||
<el-table-column prop="itemclass" label="类别" width="100">
|
||||
<template #default="{ row }">
|
||||
{{leftTableData.find(item => item.itemclassCode === row.itemclass)?.itemclassName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="itemcode" label="门诊项目代号" width="100" />
|
||||
<el-table-column prop="itemname" label="门诊项目名称" />
|
||||
<!-- <el-table-column prop="zjf" label="助记符" /> -->
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { feeitemclassList, feeitemvsList, noCompareList, feeitemvAdd, feeitemvDel } from '@/api/mzcx/index';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getFirstLetter } from '@/utils/pinyin';
|
||||
|
||||
interface FeeItem {
|
||||
itemcode: string;
|
||||
itemname: string;
|
||||
zjf?: string;
|
||||
xh?: number;
|
||||
itemclassCode?: string;
|
||||
}
|
||||
|
||||
const leftSearchValue = ref('');
|
||||
const middleSearchValue = ref('');
|
||||
const rightSearchValue = ref('');
|
||||
const compareStatus = ref('1');
|
||||
const leftTableData = ref<Array<{ itemclassCode: string; itemclassName: string }>>([]);
|
||||
const middleTableData = ref<FeeItem[]>([]);
|
||||
const rightTableData = ref<FeeItem[]>([]);
|
||||
const itemclassCodeData = ref<{ itemclassCode?: string; itemclassName?: string }>({});
|
||||
|
||||
// 过滤后的数据
|
||||
const filteredLeftTableData = computed(() => {
|
||||
const searchVal = leftSearchValue.value.toLowerCase().trim();
|
||||
if (!searchVal) return leftTableData.value;
|
||||
|
||||
return leftTableData.value.filter(item =>
|
||||
item.itemclassCode.toLowerCase().includes(searchVal) ||
|
||||
item.itemclassName.toLowerCase().includes(searchVal) ||
|
||||
item.pinyin.toLowerCase().includes(searchVal)
|
||||
);
|
||||
});
|
||||
|
||||
const filteredMiddleTableData = computed(() => {
|
||||
const searchVal = middleSearchValue.value.toLowerCase().trim();
|
||||
if (!searchVal) return middleTableData.value;
|
||||
|
||||
return middleTableData.value.filter(item =>
|
||||
item.itemcode.toLowerCase().includes(searchVal) ||
|
||||
item.itemname.toLowerCase().includes(searchVal) ||
|
||||
item.pinyin.toLowerCase().includes(searchVal)
|
||||
);
|
||||
});
|
||||
|
||||
const filteredRightTableData = computed(() => {
|
||||
const searchVal = rightSearchValue.value.toLowerCase().trim();
|
||||
if (!searchVal) return rightTableData.value;
|
||||
|
||||
return rightTableData.value.filter(item =>
|
||||
item.itemcode.toLowerCase().includes(searchVal) ||
|
||||
item.itemname.toLowerCase().includes(searchVal) ||
|
||||
item.pinyin.toLowerCase().includes(searchVal)
|
||||
);
|
||||
});
|
||||
|
||||
const handleSelectChange = () => {
|
||||
noCompareList({ itemclass: itemclassCodeData.value.itemclassCode, compareStatus: compareStatus.value }).then((res: any) => {
|
||||
rightTableData.value = processTableData(res.data, 'itemname');
|
||||
}).catch((err: any) => {
|
||||
console.error('请求数据失败:', err);
|
||||
});
|
||||
};
|
||||
// 左侧表格行点击事件
|
||||
const handleLeftRowClick = (row: any) => {
|
||||
itemclassCodeData.value = row;
|
||||
feeitemvsList({ itemclass: itemclassCodeData.value.itemclassCode }).then((res: any) => {
|
||||
middleTableData.value = processTableData(res.data, 'itemname');
|
||||
}).catch((err: any) => {
|
||||
console.error('请求数据失败:', err);
|
||||
});
|
||||
noCompareList({ itemclass: itemclassCodeData.value.itemclassCode, compareStatus: compareStatus.value }).then((res: any) => {
|
||||
rightTableData.value = processTableData(res.data, 'itemname');
|
||||
}).catch((err: any) => {
|
||||
console.error('请求数据失败:', err);
|
||||
});
|
||||
};
|
||||
|
||||
// 中间表格行双击事件
|
||||
const handleMiddleRowDblClick = (row: any) => {
|
||||
feeitemvDel({ ...row, itemclass: '' }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success(res.msg)
|
||||
handleLeftRowClick(itemclassCodeData.value)
|
||||
}
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
// 右侧表格行双击事件
|
||||
const handleRightRowDblClick = (row: any) => {
|
||||
feeitemvDel({ ...row, itemclass: itemclassCodeData.value.itemclassCode }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success(res.msg)
|
||||
handleLeftRowClick(itemclassCodeData.value)
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
const getList = () => {
|
||||
feeitemclassList({ pageSize: 999, pageNum: 1 }).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
leftTableData.value = processTableData(res.rows, 'itemclassName')
|
||||
handleLeftRowClick(res.rows[0]);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const processTableData = (data, calss) => {
|
||||
return data.map((item) => {
|
||||
const pinyinMap = {};
|
||||
pinyinMap['pinyin'] = getFirstLetter(item[calss]).toLowerCase();
|
||||
return { ...item, ...pinyinMap };
|
||||
});
|
||||
};
|
||||
getList()
|
||||
|
||||
// 单元格样式
|
||||
const cellStyle = ({ row, column, rowIndex, columnIndex }: {
|
||||
row: any;
|
||||
column: any;
|
||||
rowIndex: number;
|
||||
columnIndex: number;
|
||||
}) => {
|
||||
if (column.label == "类别名称") {
|
||||
const bgColor = classCom.decimalToHexColor(row.itemclassBkcolor);
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
return {
|
||||
backgroundColor: `${bgColor}`,
|
||||
color: textColor,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cate_container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
|
||||
.left_box {
|
||||
width: 20%;
|
||||
padding: 10px;
|
||||
background-color: rgb(214, 240, 252);
|
||||
}
|
||||
|
||||
.m_box {
|
||||
width: 30%;
|
||||
padding: 10px;
|
||||
background-color: rgb(214, 240, 252);
|
||||
}
|
||||
|
||||
.right_box {
|
||||
width: 49%;
|
||||
padding: 10px;
|
||||
background-color: rgb(214, 240, 252);
|
||||
}
|
||||
</style>
|
||||
248
src/views/regional/dict/regdict/index.vue
Normal file
@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item :label="menuname + '编码'" prop="dictCode">
|
||||
<el-input v-model="queryParams.dictCode" :placeholder="`请输入${menuname}编码`" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}名称`" prop="dictName">
|
||||
<el-input v-model="queryParams.dictName" :placeholder="`请输入${menuname}名称`" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="`${menuname}编号`" align="center" prop="dictId" v-if="false" />
|
||||
<el-table-column :label="`${menuname}编码`" align="center" prop="dictCode" />
|
||||
<el-table-column :label="`${menuname}名称`" align="center" prop="dictName" />
|
||||
<el-table-column label="排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改字典对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
|
||||
<el-form ref="regdictRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item :label="`${menuname}编码`" prop="dictCode">
|
||||
<el-input v-model="form.dictCode" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}名称`" prop="dictName">
|
||||
<el-input v-model="form.dictName" :placeholder="`请输入${menuname}名称`" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="顺序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="regdict">
|
||||
import { listregdict, addregdict, delregdict, getregdict, updateregdict, getMaxDictCode } from "@/api/regional/dict/regdict.ts";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
const route = useRoute();
|
||||
const regdictList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const menuname = ref("字典");
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
dictCode: undefined,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
dictName: [{ required: true, message: menuname.value + "名称不能为空", trigger: "blur" }],
|
||||
dictCode: [{ required: true, message: menuname.value + "编码不能为空", trigger: "blur" }],
|
||||
dictSort: [{ required: true, message: menuname.value + "顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询字典列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listregdict(queryParams.value).then(response => {
|
||||
regdictList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
dictId: undefined,
|
||||
dictCode: undefined,
|
||||
dictName: undefined,
|
||||
dictType: queryParams.value.dictType,
|
||||
dictSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("regdictRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.dictId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
const getMaxCode = () => {
|
||||
getMaxDictCode({ dictType: queryParams.value.dictType }).then(response => {
|
||||
form.value.dictCode = response.data;
|
||||
});
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
getMaxCode()
|
||||
open.value = true;
|
||||
title.value = "添加" + menuname.value;
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const dictId = row.dictId || ids.value;
|
||||
getregdict(dictId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改" + menuname.value;
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["regdictRef"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
if (form.value.dictId != undefined) {
|
||||
updateregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const dictIds = row.dictId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除"' + menuname + '"编号为"' + dictIds + '"的数据项?').then(function () {
|
||||
return delregdict(dictIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/regdict/export", {
|
||||
...queryParams.value
|
||||
}, `dict_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
getTypes(route.query && route.query.dictType, route.query && route.query.typeName);
|
||||
/** 查询字典类型详细 */
|
||||
function getTypes(dictType, typeName) {
|
||||
queryParams.value.dictType = dictType;
|
||||
menuname.value = typeName;
|
||||
getList();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
252
src/views/regional/dict/regdictxm/index.vue
Normal file
@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="项目编码" prop="itemcode">
|
||||
<el-input v-model="queryParams.itemcode" placeholder="请输入项目编码" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="itemname">
|
||||
<el-input v-model="queryParams.itemname" placeholder="请输入项目名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="有效状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"
|
||||
:cell-style="tableCellStyle" height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="类别" align="center" prop="hospital_type" width="100">
|
||||
<template #default="{ row }">
|
||||
{{itemclassList.find((item) => item.itemclassCode == row.itemclass)?.itemclassName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目编码" align="center" prop="itemcode" />
|
||||
<el-table-column label="项目名称" align="center" prop="itemname" width="300" />
|
||||
<el-table-column label="默认单价" align="center" prop="dj" />
|
||||
<el-table-column label="一级单价" align="center" prop="dj1" />
|
||||
<el-table-column label="二级单价" align="center" prop="dj2" />
|
||||
<el-table-column label="三级单价" align="center" prop="dj3" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改项目对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="35vw" append-to-body>
|
||||
<el-form ref="postRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item label="项目名称" prop="itemname">
|
||||
<el-input v-model="form.itemname" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编码" prop="itemcode">
|
||||
<el-input v-model="form.itemcode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="默认单价" prop="dj">
|
||||
<el-input v-model="form.dj" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="一级单价" prop="dj">
|
||||
<el-input v-model="form.dj1" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二级单价" prop="dj">
|
||||
<el-input v-model="form.dj2" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="三级单价" prop="dj">
|
||||
<el-input v-model="form.dj3" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="项目级别" prop="hospital_type">
|
||||
<el-select v-model="form.hospital_type" placeholder="请选择项目级别" clearable style="width: 100%">
|
||||
<el-option v-for="item in yljbList" :key="item.dictCode" :label="item.dictName" :value="item.dictCode" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="项目状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="hospital">
|
||||
import { getXmList, addXmInfo, deleteXmInfo, updateXmInfo } from "@/api/regional/index.ts";
|
||||
import { getComDicts } from "@/api/liswork/dict/ComDict";
|
||||
import { listitemclass } from "@/api/regional/dict/itemclass.ts";
|
||||
import { classCom } from "@/utils/classCom.ts";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const postList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const yljbList = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
itemcode: undefined,
|
||||
itemname: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
itemname: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
|
||||
itemcode: [{ required: true, message: "项目编码不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const tableCellStyle = ({ row, column }) => {
|
||||
if (column.label == "类别") {
|
||||
const bkcolor = itemclassList.value.find((item) => item.itemclassCode == row.itemclass)?.itemclassBkcolor;
|
||||
const bgColor = classCom.decimalToHexColor(bkcolor);
|
||||
const textColor = classCom.getContrastTextColor(bgColor);
|
||||
return {
|
||||
backgroundColor: `${bgColor} !important`,
|
||||
color: textColor,
|
||||
};
|
||||
}
|
||||
}
|
||||
/** 查询项目列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
getXmList(queryParams.value).then(response => {
|
||||
postList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {};
|
||||
proxy.resetForm("postRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.hospitalId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加项目";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
form.value = JSON.parse(JSON.stringify(row));
|
||||
open.value = true;
|
||||
title.value = "修改项目";
|
||||
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["postRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (title.value == "修改项目") {
|
||||
updateXmInfo(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addXmInfo(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const hospitalIds = row.hospitalId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除项目编号为"' + hospitalIds + '"的数据项?').then(function () {
|
||||
return deleteXmInfo(hospitalIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
// proxy.download("transitdict/hospital/export", {
|
||||
// ...queryParams.value
|
||||
// }, `hospital_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
getList();
|
||||
|
||||
const itemclassList = ref([])
|
||||
onMounted(() => {
|
||||
listitemclass({ pageSize: 9999, pageNum: 1 }).then(response => {
|
||||
itemclassList.value = response.rows;
|
||||
})
|
||||
getComDicts({ dict_type: 'HTYPE' }).then(response => {
|
||||
yljbList.value = response.data;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
11
src/views/regional/dict/sampletype/index.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
1015
src/views/regional/inspectionReport/report/index.vue
Normal file
239
src/views/regional/regConfig/index.vue
Normal file
@ -0,0 +1,239 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="参数代号" prop="dictCode">
|
||||
<el-input v-model="queryParams.dictCode" placeholder="请输入" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数名称" prop="dictName">
|
||||
<el-input v-model="queryParams.dictName" placeholder="请输入" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="参数代号" align="center" prop="dictCode" />
|
||||
<el-table-column label="参数名称" align="center" prop="dictName" />
|
||||
<el-table-column label="参数值" align="center" prop="remark" />
|
||||
<el-table-column label="排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改字典对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
|
||||
<el-form ref="regdictRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item label="参数代号" prop="dictCode">
|
||||
<el-input v-model="form.dictCode" placeholder="请输入参数代号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数名称" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入参数名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="顺序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数值" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="regdict">
|
||||
import { listregdict, addregdict, delregdict, getregdict, updateregdict } from "@/api/regional/dict/regdict.ts";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
const route = useRoute();
|
||||
const regdictList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const menuname = ref("字典");
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
dictCode: undefined,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
dictName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
|
||||
dictCode: [{ required: true, message: "参数代号不能为空", trigger: "blur" }],
|
||||
dictSort: [{ required: true, message: "顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询字典列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listregdict(queryParams.value).then(response => {
|
||||
regdictList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
dictId: undefined,
|
||||
dictCode: undefined,
|
||||
dictName: undefined,
|
||||
dictType: queryParams.value.dictType,
|
||||
dictSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("regdictRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.dictId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加参数"
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const dictId = row.dictId || ids.value;
|
||||
getregdict(dictId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改参数"
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["regdictRef"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
if (form.value.dictId != undefined) {
|
||||
updateregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addregdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const dictIds = row.dictId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除参数编号为' + dictIds + '"的数据项?').then(function () {
|
||||
return delregdict(dictIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/regdict/export", {
|
||||
...queryParams.value
|
||||
}, `dict_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
getTypes(route.query && route.query.dictType, route.query && route.query.typeName);
|
||||
/** 查询字典类型详细 */
|
||||
function getTypes(dictType, typeName) {
|
||||
queryParams.value.dictType = dictType;
|
||||
menuname.value = typeName;
|
||||
getList();
|
||||
}
|
||||
</script>
|
||||
223
src/views/regional/statistics/bbtj/index.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="compact-form">
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="委托机构:" prop="SrcHospName">
|
||||
<SelectTable v-model:data="queryParams.SrcHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="value" objKey="value" :border="true" placeholder="请选择委托机构" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="检测医院:" prop="DstHospName">
|
||||
<SelectTable v-model:data="queryParams.DstHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="label" objKey="label" :border="true" placeholder="请选择" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="条码号:" prop="Barcode">
|
||||
<el-input v-model="queryParams.Barcode" placeholder="请输入条码号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名:" prop="PatName">
|
||||
<el-input v-model="queryParams.PatName" placeholder="请输入姓名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="申请项目:" prop="checkPUR">
|
||||
<el-input v-model="queryParams.checkPUR" placeholder="请输入申请项目" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="时间类型:" prop="DateType">
|
||||
<el-select v-model="queryParams.DateType" placeholder="请选择">
|
||||
<el-option label="登记时间" value="登记时间" />
|
||||
<el-option label="采样时间" value="采样时间" />
|
||||
<el-option label="送出时间" value="送出时间" />
|
||||
<el-option label="签收时间" value="签收时间" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="日期:" prop="times">
|
||||
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="mb10">
|
||||
<el-button type="primary" @click="thHandle(20)">重新采集</el-button>
|
||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
|
||||
|
||||
</div>
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { querySampleSignBack, sampleSign } from '@/api/regional/index'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
// @ts-ignore
|
||||
import { listhospital } from "@/api/regional/dict/hospital.ts";
|
||||
// @ts-ignore
|
||||
import { listregdict } from "@/api/regional/dict/regdict.ts";
|
||||
import { ElMessage } from 'element-plus';
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
|
||||
const queryParams: any = ref({
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
})
|
||||
const tableData: any = ref([])
|
||||
const columns: any = ref([
|
||||
{ type: 'selection', align: 'center', visible: true, width: 40 },
|
||||
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, },
|
||||
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 60 },
|
||||
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
|
||||
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
|
||||
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'srcHospName', label: '检测机构', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'Status', label: '标本状态', align: 'center', visible: true, slot: "status" },
|
||||
{ prop: 'backReasons', label: '退回理由', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'backUserName', label: '操作人', align: 'center', visible: true, },
|
||||
{ prop: 'backTime', label: '操作时间', align: 'center', visible: true, width: 150 },
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
|
||||
const pagination = ref({
|
||||
show: true,
|
||||
total: 0,
|
||||
pageSize: 50,
|
||||
currentPage: 1,
|
||||
})
|
||||
|
||||
const ksdhFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
{ prop: 'value', label: '代号', width: 120, enablePinyinSearch: true },
|
||||
])
|
||||
const barcodes = ref([])
|
||||
const tableRefs = ref(null)
|
||||
|
||||
const thHandle = (val: number) => {
|
||||
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
|
||||
sampleSign({ status: val, barcode: barcodes.value }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('操作成功!')
|
||||
handleQuery()
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSelectionChange = (val: any) => {
|
||||
barcodes.value = val.map((item: any) => item.barcode)
|
||||
}
|
||||
const currentChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageNum = page.currentPage
|
||||
handleQuery()
|
||||
}
|
||||
const sizeChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageSize = page.pageSize
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
|
||||
const handleQuery = () => {
|
||||
if (queryParams.value.times && queryParams.value.times.length > 0) {
|
||||
queryParams.value.DateStart = queryParams.value.times[0]
|
||||
queryParams.value.DateEnd = queryParams.value.times[1]
|
||||
} else {
|
||||
queryParams.value.DateStart = ''
|
||||
queryParams.value.DateEnd = ''
|
||||
}
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetHandle = () => {
|
||||
queryParams.value = {
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
const getList = () => {
|
||||
querySampleSignBack(queryParams.value).then((res: any) => {
|
||||
tableData.value = res.rows
|
||||
pagination.value.total = res.total
|
||||
})
|
||||
}
|
||||
const hosList = ref([])
|
||||
const regdictList: any = ref([])
|
||||
onMounted(() => {
|
||||
getList()
|
||||
listhospital().then((res: any) => {
|
||||
hosList.value = res.rows.map((item: any) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res: any) => {
|
||||
regdictList.value = res.rows;
|
||||
})
|
||||
})
|
||||
|
||||
const formatDict = (v: string, arr: Array<any>) => {
|
||||
return arr.find((item: any) => item.dictCode == v)?.dictName || v;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
|
||||
&>button {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
188
src/views/regional/statistics/fytj/index.vue
Normal file
@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="compact-form">
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="就诊医院:" prop="SrcHospName">
|
||||
<SelectTable v-model:data="queryParams.SrcHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="value" objKey="value" :border="true" placeholder="请选择委托机构" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="检测医院:" prop="DstHospName">
|
||||
<SelectTable v-model:data="queryParams.DstHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="label" objKey="label" :border="true" placeholder="请选择" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="5">
|
||||
<el-form-item label="日期:" prop="times">
|
||||
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-" start-placeholder="开始时间"
|
||||
end-placeholder="结束时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="mb10">
|
||||
<!-- <el-button type="primary" @click="thHandle(20)">重新采集</el-button>
|
||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
||||
</div>
|
||||
<div style="height: calc(100% - 100px);">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange">
|
||||
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { sampleitemCount, sampleSign } from '@/api/regional/index'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
// @ts-ignore
|
||||
import { listhospital } from "@/api/regional/dict/hospital.ts";
|
||||
// @ts-ignore
|
||||
import { listregdict } from "@/api/regional/dict/regdict.ts";
|
||||
import { ElMessage } from 'element-plus';
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
import dayjs from 'dayjs';
|
||||
const today = dayjs().format('YYYY-MM-DD');
|
||||
const queryParams: any = ref({
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
times: [today, today]
|
||||
})
|
||||
const tableData: any = ref([])
|
||||
const columns: any = ref([
|
||||
{ prop: 'SrcHospName', label: '就诊医院', align: 'center', visible: true, },
|
||||
{ prop: 'SrcOrderItemCode', label: '组合编码', align: 'center', visible: true, },
|
||||
{ prop: 'SrcOrderItemName', label: '组合名称', align: 'center', visible: true, },
|
||||
{ prop: 'sl', label: '数量(份)', align: 'center', visible: true, },
|
||||
{ prop: 'cost', label: '费用', align: 'center', visible: true, },
|
||||
{ prop: 'DstHospName', label: '检测医院', align: 'center', visible: true, },
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
summary: true,
|
||||
summaryField: ['sl', 'cost'],//计算列总和
|
||||
sumText: '合计'
|
||||
})
|
||||
|
||||
const pagination = ref({
|
||||
show: true,
|
||||
total: 0,
|
||||
pageSize: 50,
|
||||
currentPage: 1,
|
||||
})
|
||||
|
||||
const ksdhFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
{ prop: 'value', label: '代号', width: 120, enablePinyinSearch: true },
|
||||
])
|
||||
const barcodes = ref([])
|
||||
const tableRefs = ref(null)
|
||||
|
||||
const thHandle = (val: number) => {
|
||||
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
|
||||
sampleSign({ status: val, barcode: barcodes.value }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('操作成功!')
|
||||
handleQuery()
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSelectionChange = (val: any) => {
|
||||
barcodes.value = val.map((item: any) => item.barcode)
|
||||
}
|
||||
const currentChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageNum = page.currentPage
|
||||
handleQuery()
|
||||
}
|
||||
const sizeChange = (page: { currentPage: number, pageSize: number }) => {
|
||||
queryParams.value.pageSize = page.pageSize
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
|
||||
const handleQuery = () => {
|
||||
if (queryParams.value.times && queryParams.value.times.length > 0) {
|
||||
queryParams.value.DateStart = queryParams.value.times[0]
|
||||
queryParams.value.DateEnd = queryParams.value.times[1]
|
||||
} else {
|
||||
queryParams.value.DateStart = ''
|
||||
queryParams.value.DateEnd = ''
|
||||
}
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetHandle = () => {
|
||||
queryParams.value = {
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
times: [today, today]
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
const getList = () => {
|
||||
sampleitemCount(queryParams.value).then((res: any) => {
|
||||
tableData.value = res.rows
|
||||
pagination.value.total = res.total
|
||||
})
|
||||
}
|
||||
const hosList = ref([])
|
||||
const regdictList: any = ref([])
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
listhospital().then((res: any) => {
|
||||
hosList.value = res.rows.map((item: any) => {
|
||||
return {
|
||||
label: item.hospitalName,
|
||||
value: item.hospitalCode
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res: any) => {
|
||||
regdictList.value = res.rows;
|
||||
})
|
||||
})
|
||||
|
||||
const formatDict = (v: string, arr: Array<any>) => {
|
||||
return arr.find((item: any) => item.dictCode == v)?.dictName || v;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 2.5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
|
||||
&>button {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1225
src/views/regional/statistics/overview/css/icon.css
Normal file
510
src/views/regional/statistics/overview/css/index.css
Normal file
@ -0,0 +1,510 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
/* CSS Document */
|
||||
.bg {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
background: url(../images/bg2.jpg) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding-top: 0rem;
|
||||
padding: 0rem 3.125rem;
|
||||
|
||||
}
|
||||
|
||||
/*.conIn{
|
||||
display:flex;
|
||||
display: -webkit-flex;}*/
|
||||
.title {
|
||||
width: 100%;
|
||||
font-size: 1.875rem;
|
||||
line-height: 4.6875rem;
|
||||
color: rgba(14, 253, 255, 1);
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.border_bg_leftTop {
|
||||
position: absolute;
|
||||
left: -0.125rem;
|
||||
top: -0.625rem;
|
||||
width: 5.78125rem;
|
||||
height: 0.78125rem;
|
||||
display: block;
|
||||
background: #01279d url(../images/title_left_bg.png) no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.border_bg_rightTop {
|
||||
position: absolute;
|
||||
right: -0.15625rem;
|
||||
top: -0.15625rem;
|
||||
width: 1.5625rem;
|
||||
height: 1.5625rem;
|
||||
display: block;
|
||||
background: url(../images/border_bg.jpg) no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.border_bg_leftBottom {
|
||||
position: absolute;
|
||||
left: -0.125rem;
|
||||
bottom: -0.125rem;
|
||||
width: 1.5625rem;
|
||||
height: 1.5625rem;
|
||||
display: block;
|
||||
background: url(../images/border_bg.jpg) no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.border_bg_rightBottom {
|
||||
position: absolute;
|
||||
right: -0.15625rem;
|
||||
bottom: -0.15625rem;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
display: block;
|
||||
background: url(../images/title_right_bg.png) no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.leftMain {
|
||||
width: 75%;
|
||||
float: left;
|
||||
padding-right: 1.5625rem;
|
||||
padding-top: 1.5625rem;
|
||||
}
|
||||
|
||||
.rightMain {
|
||||
width: 25%;
|
||||
float: left;
|
||||
padding-top: 1.5625rem;
|
||||
}
|
||||
|
||||
.leftMain_top {
|
||||
width: 100%;
|
||||
padding-bottom: 1.5625rem;
|
||||
}
|
||||
|
||||
.leftMain_top ul {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
}
|
||||
|
||||
.leftMain_top ul li {
|
||||
float: left;
|
||||
width: 25%;
|
||||
padding-right: 1.5625rem;
|
||||
}
|
||||
|
||||
.leftMain_top ul li:last-child {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.leftMain_top ul li .liIn {
|
||||
border: 0.125rem solid rgba(14, 253, 255, 0.5);
|
||||
width: 100%;
|
||||
min-height: 3.75rem;
|
||||
position: relative;
|
||||
padding: .625rem 1.5625rem;
|
||||
}
|
||||
|
||||
.leftMain_top ul li .liIn h3 {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.leftMain_top ul li .liIn .shu {
|
||||
font-size: 1.875rem;
|
||||
color: rgba(14, 253, 255, 1);
|
||||
font-family: dig;
|
||||
margin-bottom: 0.3125rem;
|
||||
}
|
||||
|
||||
.leftMain_top ul li .liIn .shu i {
|
||||
font-size: 1rem;
|
||||
margin-left: 0.9375rem;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.leftMain_top ul li .liIn .zi {
|
||||
font-size: 0.625rem;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.leftMain_top ul li .liIn .zi .span1 {
|
||||
margin-right: 1.5625rem;
|
||||
}
|
||||
|
||||
|
||||
.leftMain_middle {
|
||||
width: 100%;
|
||||
padding-bottom: 1.5625rem;
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_left {
|
||||
width: 60%;
|
||||
padding-right: 1.5625rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_left .leftMain_middle_leftIn {
|
||||
border: 0.125rem solid rgba(14, 253, 255, 0.5);
|
||||
width: 100%;
|
||||
min-height: 3.75rem;
|
||||
position: relative;
|
||||
padding: .625rem;
|
||||
}
|
||||
|
||||
.leftMain_middle_leftIn_zhe {
|
||||
margin-top: 2vh;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_left .leftMain_middle_leftIn h3 {
|
||||
font-size: 1.25rem;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.78125rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_left .leftMain_middle_leftIn .biaoge {
|
||||
min-height: 12.5rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn {
|
||||
border: 0.125rem solid rgba(14, 253, 255, 0.5);
|
||||
width: 100%;
|
||||
min-height: 3.75rem;
|
||||
position: relative;
|
||||
padding: .625rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn h3 {
|
||||
font-size: 1.25rem;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.78125rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge {
|
||||
min-height: 12.5rem;
|
||||
}
|
||||
|
||||
/*左边中间部分排行榜*/
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai {
|
||||
width: 100%;
|
||||
height: 68vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* .leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul{
|
||||
height: 68vh;
|
||||
} */
|
||||
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
font-size: 0.9375rem;
|
||||
height: 2.8125rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn .liIn_left {
|
||||
width: 43%;
|
||||
position: relative;
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn .liIn_left .bot {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
background: #05d1fc;
|
||||
border-radius: 62.5rem;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0.3125rem;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn2 .liIn_left .bot {
|
||||
background: #e7feb8;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn3 .liIn_left .bot {
|
||||
background: #fdea8a;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn4 .liIn_left .bot {
|
||||
background: #8ff9f8;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn5 .liIn_left .bot {
|
||||
background: #d890fa;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn6 .liIn_left .bot {
|
||||
background: #05d1fc;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn .liIn_left zi {
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn .liIn_line {
|
||||
width: 40%;
|
||||
height: 1.25rem;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-radius: 125rem;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn .liIn_line .line_lineIn {
|
||||
width: 100%;
|
||||
height: 1.25rem;
|
||||
background: #05d1fc;
|
||||
border-radius: 125rem;
|
||||
-webkit-animation: widthMove1 2s ease-in-out;
|
||||
}
|
||||
|
||||
.line_lineIn .per {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn2 .liIn_line .line_lineIn {
|
||||
background: #e7feb8;
|
||||
-webkit-animation: widthMove2 2s ease-in-out;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn3 .liIn_line .line_lineIn {
|
||||
background: #fdea8a;
|
||||
-webkit-animation: widthMove3 2s ease-in-out;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn4 .liIn_line .line_lineIn {
|
||||
background: #8ff9f8;
|
||||
-webkit-animation: widthMove4 2s ease-in-out;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn5 .liIn_line .line_lineIn {
|
||||
background: #d890fa;
|
||||
-webkit-animation: widthMove5 2s ease-in-out;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn6 .liIn_line .line_lineIn {
|
||||
background: #05d1fc;
|
||||
-webkit-animation: widthMove6 2s ease-in-out;
|
||||
}
|
||||
|
||||
@-webkit-keyframes widthMove1 {
|
||||
0% {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
width: 98.5%;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes widthMove2 {
|
||||
0% {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
width: 88.5%;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes widthMove3 {
|
||||
0% {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
width: 68.5%;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes widthMove4 {
|
||||
0% {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
width: 40.5%;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes widthMove5 {
|
||||
0% {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
width: 22.5%;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes widthMove6 {
|
||||
0% {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
width: 10.5%;
|
||||
}
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_pai ul li .liIn .num {
|
||||
width: 18%;
|
||||
font-family: dig;
|
||||
padding-left: 0.3125rem;
|
||||
}
|
||||
|
||||
/*左边底部*/
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_bi ul {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_bi ul li {
|
||||
width: 33.3%;
|
||||
text-align: center;
|
||||
margin-bottom: 0.78125rem;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_bi ul li .shu {
|
||||
font-size: 2.1875rem;
|
||||
color: rgba(14, 253, 255, 1);
|
||||
font-family: dig;
|
||||
padding: 1.875rem 0 0.3125rem;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.leftMain_middle .leftMain_middle_right .leftMain_middle_rightIn .biaoge_bi ul li .zi {
|
||||
font-size: 0.9375rem;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/*右边部分*/
|
||||
.rightMain .rightMain_top {
|
||||
width: 100%;
|
||||
padding-bottom: 1.5625rem;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_topIn {
|
||||
border: 0.125rem solid rgba(14, 253, 255, 0.5);
|
||||
width: 100%;
|
||||
min-height: 3.75rem;
|
||||
position: relative;
|
||||
padding: .625rem;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_topIn h3 {
|
||||
font-size: 1.25rem;
|
||||
color: #fff;
|
||||
margin-bottom: 0.78125rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_topIn .biaoge {
|
||||
min-height: 12.5rem;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottom {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn {
|
||||
border: 0.125rem solid rgba(14, 253, 255, 0.5);
|
||||
width: 100%;
|
||||
min-height: 3.75rem;
|
||||
position: relative;
|
||||
padding: 1.25rem 0.78125rem;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn h3 {
|
||||
font-size: 1.25rem;
|
||||
color: #fff;
|
||||
margin-bottom: 0.78125rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/*右下角表格*/
|
||||
.rightMain .rightMain_bottomIn .biaoge {
|
||||
min-height: 12.5rem;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list .biaoge_listIn .ul_list {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list .biaoge_listIn .ul_listIn {
|
||||
-webkit-animation: 14s gundong linear infinite normal;
|
||||
animation: 14s gundong linear infinite normal;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@keyframes gundong {
|
||||
0% {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: translate3d(0, -30vh, 0);
|
||||
transform: translate3d(0, -30vh, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list ul {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list .ul_title {
|
||||
background: linear-gradient(left, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list .ul_con {
|
||||
border-bottom: 0.125rem solid rgba(14, 253, 255, 0.5);
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list ul li {
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 0.9375rem;
|
||||
height: 3.125rem;
|
||||
line-height: 3.125rem;
|
||||
}
|
||||
|
||||
.rightMain .rightMain_bottomIn .biaoge_list ul li:frist-child {
|
||||
text-align: left;
|
||||
}
|
||||
1063
src/views/regional/statistics/overview/css/public.css
Normal file
BIN
src/views/regional/statistics/overview/fonts/DIN-Bold.otf
Normal file
BIN
src/views/regional/statistics/overview/fonts/DIN-Light.otf
Normal file
BIN
src/views/regional/statistics/overview/fonts/DIN-Medium.otf
Normal file
BIN
src/views/regional/statistics/overview/images/bg2.jpg
Normal file
|
After Width: | Height: | Size: 206 KiB |
BIN
src/views/regional/statistics/overview/images/border_bg.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/views/regional/statistics/overview/images/title_left_bg.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/views/regional/statistics/overview/images/title_right_bg.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
524
src/views/regional/statistics/overview/index.vue
Normal file
@ -0,0 +1,524 @@
|
||||
<template>
|
||||
<div class="bg">
|
||||
<div class="title">区域检验数据中心</div>
|
||||
<div class="leftMain">
|
||||
<div class="leftMain_top">
|
||||
<div class="leftMain_topIn">
|
||||
<ul>
|
||||
<li v-for="item in source">
|
||||
<div class="liIn">
|
||||
<h3>{{ item.name }}</h3>
|
||||
<p class="shu"><span class="shu1">{{ item.num }}</span><i>{{ item.unit }}</i></p>
|
||||
<span class="border_bg_leftTop"></span>
|
||||
<span class="border_bg_rightTop"></span>
|
||||
<span class="border_bg_leftBottom"></span>
|
||||
<span class="border_bg_rightBottom"></span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="leftMain_middle">
|
||||
<div class="leftMain_middle_left">
|
||||
<div class="leftMain_middle_leftIn">
|
||||
<h3>委托机构当月送检标本数量</h3>
|
||||
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
|
||||
<div class="biaoge" style="width:100%; height:30vh" ref="chartmain" id="chartmain"></div>
|
||||
<span class="border_bg_leftTop"></span>
|
||||
<span class="border_bg_rightTop"></span>
|
||||
<span class="border_bg_leftBottom"></span>
|
||||
<span class="border_bg_rightBottom"></span>
|
||||
</div>
|
||||
<div class="leftMain_middle_leftIn leftMain_middle_leftIn_zhe">
|
||||
<h3>近一个月送检标本数量趋势图</h3>
|
||||
<div class="biaoge" style="width:100%; height:30vh" ref="chartmain_zhe" id="chartmain_zhe"></div>
|
||||
<span class="border_bg_leftTop"></span>
|
||||
<span class="border_bg_rightTop"></span>
|
||||
<span class="border_bg_leftBottom"></span>
|
||||
<span class="border_bg_rightBottom"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="leftMain_middle_right">
|
||||
<div class="leftMain_middle_rightIn">
|
||||
<h3>委托机构当月送检标本占比</h3>
|
||||
<div class="biaoge biaoge_pai">
|
||||
<div class="biaoge_paiIn">
|
||||
<ul>
|
||||
<!-- <Vue3SeamlessScroll :list="listData" :step="0.5 as any" :hover="true as any" :key="listData.length"
|
||||
:limitMoveNum="14"> -->
|
||||
<li v-for="(item, i) in listData">
|
||||
<div class="liIn">
|
||||
<div class="liIn_left"><span class="zi">{{ item.groupname }}</span></div>
|
||||
<div class="liIn_line">
|
||||
<div class="line_lineIn" :style="{ width: ` ${item.percentage}` }">
|
||||
<div class="per">{{ item.percentage }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="num">{{ item.groupsum }}</p>
|
||||
</div>
|
||||
</li>
|
||||
<!-- </Vue3SeamlessScroll> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span class="border_bg_leftTop"></span>
|
||||
<span class="border_bg_rightTop"></span>
|
||||
<span class="border_bg_leftBottom"></span>
|
||||
<span class="border_bg_rightBottom"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rightMain">
|
||||
<div class="rightMain_top">
|
||||
<div class="rightMain_topIn">
|
||||
<h3>当日送检样本情况</h3>
|
||||
<div class="biaoge" style="width:100%; height:35vh" ref="chartmain_bing" id="chartmain_bing"></div>
|
||||
<span class="border_bg_leftTop"></span>
|
||||
<span class="border_bg_rightTop"></span>
|
||||
<span class="border_bg_leftBottom"></span>
|
||||
<span class="border_bg_rightBottom"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rightMain_bottom">
|
||||
<div class="rightMain_bottomIn">
|
||||
<h3>送检项目分类占比</h3>
|
||||
<div class="biaoge biaoge_list" ref="sjRef" style="width:100%; height:34vh">
|
||||
|
||||
</div>
|
||||
<span class="border_bg_leftTop"></span>
|
||||
<span class="border_bg_rightTop"></span>
|
||||
<span class="border_bg_leftBottom"></span>
|
||||
<span class="border_bg_rightBottom"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import * as echarts from 'echarts';
|
||||
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll'
|
||||
import { getallcount } from '@/api/regional'
|
||||
|
||||
const source = ref([
|
||||
{ name: '区域机构', num: 0, unit: '家', pre: 'jgs' },
|
||||
{ name: '检验人数', num: 0, unit: '人', pre: 'rs' },
|
||||
{ name: '检验管数', num: 0, unit: '个', pre: 'gs' },
|
||||
{ name: '检验报告数', num: 0, unit: '份', pre: 'bgs' },
|
||||
{ name: '检验项目数', num: 0, unit: '个', pre: 'xms' },
|
||||
])
|
||||
|
||||
const listData: any = ref([])
|
||||
|
||||
|
||||
const chartmain = ref()
|
||||
const getEcharts1 = (data: any) => {
|
||||
const Intance = echarts.init(chartmain.value);
|
||||
var dataAxis = data.map((item: any) => item.daynum + '日')
|
||||
var data = data.map((item: any) => item.sl)
|
||||
const option = {
|
||||
title: {
|
||||
text: '',
|
||||
subtext: ''
|
||||
},
|
||||
grid: {
|
||||
x: 40,
|
||||
y: 40,
|
||||
x2: 20,
|
||||
y2: 50,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
xAxis: {
|
||||
data: dataAxis,
|
||||
axisLabel: {
|
||||
/*inside: true,*/
|
||||
interval: 0,
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow'],
|
||||
symbolOffset: 12,
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
},
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
z: 10
|
||||
},
|
||||
dataZoom: [{
|
||||
type: 'slider',
|
||||
show: true, //flase直接隐藏图形
|
||||
xAxisIndex: [0],
|
||||
textStyle: {
|
||||
color: '#0efdff', // 文字颜色(如白色,根据主题调整)
|
||||
fontSize: 12, // 文字大小
|
||||
fontWeight: 'normal' // 文字粗细
|
||||
},
|
||||
left: '9%', //滚动条靠左侧的百分比
|
||||
bottom: 0,
|
||||
start: 0,//滚动条的起始位置
|
||||
end: 70 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
|
||||
}],
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '单位:个',
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow'],
|
||||
symbolOffset: 12,
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
series: [
|
||||
{
|
||||
type: 'bar',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(
|
||||
0, 0, 0, 1,
|
||||
[
|
||||
{ offset: 0, color: '#0efdff' },
|
||||
{ offset: 0.5, color: '#188df0' },
|
||||
{ offset: 1, color: '#188df0' }
|
||||
]
|
||||
)
|
||||
},
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(
|
||||
0, 0, 0, 1,
|
||||
[
|
||||
{ offset: 0, color: '#2378f7' },
|
||||
{ offset: 0.7, color: '#2378f7' },
|
||||
{ offset: 1, color: '#0efdff' }
|
||||
]
|
||||
)
|
||||
}
|
||||
},
|
||||
data: data
|
||||
}
|
||||
]
|
||||
};
|
||||
Intance.setOption(option);
|
||||
}
|
||||
const chartmain_bing = ref()
|
||||
const getEcharts2 = (data: any) => {
|
||||
const names = data.map((item: any) => item.name)
|
||||
const Intance = echarts.init(chartmain_bing.value);
|
||||
const option = {
|
||||
title: {
|
||||
text: '数据情况统计',
|
||||
subtext: '',
|
||||
left: 'right',
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b} : {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
// orient: 'vertical',
|
||||
// top: 'middle',
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: 10,
|
||||
top: 40,
|
||||
bottom: 20,
|
||||
left: 'right',
|
||||
data: names,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
}
|
||||
|
||||
},
|
||||
grid: {
|
||||
x: '-10%',
|
||||
y: 40,
|
||||
x2: 20,
|
||||
y2: 20,
|
||||
},
|
||||
color: ['#09d0fb', '#f88cfb', '#95f8fe', '#f9f390', '#ecfeb7'],
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: '65%',
|
||||
center: ['45%', '50%'],
|
||||
selectedMode: 'single',
|
||||
data: data,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Intance.setOption(option);
|
||||
}
|
||||
|
||||
const chartmain_zhe = ref()
|
||||
const getEcharts3 = () => {
|
||||
const Intance = echarts.init(chartmain_zhe.value);
|
||||
const xData = listData.value[0].dayline.map((item: any) => item.daynum + '日')
|
||||
const tooltips = listData.value.map((item: any) => item.groupname)
|
||||
const colors = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0',
|
||||
'#1e90ff', '#ff6347', '#7b68ee', '#d0648a', '#ffd700', '#6b8e23', '#4ea397', '#3cb371', '#b8860b']
|
||||
const arr = listData.value.map((item: any, i: number) => {
|
||||
return {
|
||||
name: item.groupname,
|
||||
type: 'line',
|
||||
data: item.dayline.map((v: any) => v.sl),
|
||||
itemStyle: {
|
||||
color: colors[i],
|
||||
},
|
||||
lineStyle: {
|
||||
color: colors[i],
|
||||
width: 2,
|
||||
}
|
||||
}
|
||||
})
|
||||
const option = {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis', // 或 'item',根据图表类型选择
|
||||
},
|
||||
legend: {
|
||||
type: 'scroll', // 开启滚动
|
||||
textStyle: {
|
||||
color: '#fff', // 文字颜色(保持与你的主题一致)
|
||||
fontSize: 12
|
||||
},
|
||||
// 滚动箭头样式(兼容写法)
|
||||
pageIcon: 'circle', // 箭头形状(可选:'arrow'/'circle'等)
|
||||
pageIconColor: '#0efdff', // 箭头颜色(核心配置,替代pageButtonItemStyle)
|
||||
pageIconSize: 12, // 箭头大小
|
||||
pageIconInactiveColor: '#666666', // 首尾不可滚动时的箭头颜色
|
||||
pageTextStyle: {
|
||||
color: '#0efdff' // 分页文字颜色(若显示数字分页)
|
||||
},
|
||||
data: tooltips
|
||||
},
|
||||
grid: {
|
||||
x: 40,
|
||||
y: 40,
|
||||
x2: 20,
|
||||
y2: 50,
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
//saveAsImage: {}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
axisLabel: {
|
||||
/*inside: true,*/
|
||||
interval: 0,
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow'],
|
||||
symbolOffset: 12,
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
},
|
||||
data: xData
|
||||
},
|
||||
|
||||
dataZoom: [{
|
||||
type: 'slider',
|
||||
show: true, //flase直接隐藏图形
|
||||
xAxisIndex: [0],
|
||||
textStyle: {
|
||||
color: '#0efdff', // 文字颜色(如白色,根据主题调整)
|
||||
fontSize: 12, // 文字大小
|
||||
fontWeight: 'normal' // 文字粗细
|
||||
},
|
||||
left: '9%', //滚动条靠左侧的百分比
|
||||
bottom: 0,
|
||||
start: 0,//滚动条的起始位置
|
||||
end: 70 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
|
||||
}],
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow'],
|
||||
symbolOffset: 12,
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
|
||||
}
|
||||
},
|
||||
series: arr
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
Intance.setOption(option);
|
||||
}
|
||||
|
||||
const sjRef = ref()
|
||||
const getEcharts4 = (data: any) => {
|
||||
const names = data.map((item: any) => item.name)
|
||||
const Intance = echarts.init(sjRef.value);
|
||||
const option = {
|
||||
title: {
|
||||
text: '数据情况统计',
|
||||
subtext: '',
|
||||
left: 'right',
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b} : {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
// orient: 'vertical',
|
||||
// top: 'middle',
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: 10,
|
||||
top: 40,
|
||||
bottom: 20,
|
||||
left: 'right',
|
||||
data: names,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 12
|
||||
},
|
||||
// 滚动箭头样式(兼容写法)
|
||||
pageIcon: 'circle', // 箭头形状(可选:'arrow'/'circle'等)
|
||||
pageIconColor: '#0efdff', // 箭头颜色(核心配置,替代pageButtonItemStyle)
|
||||
pageIconSize: 12, // 箭头大小
|
||||
pageIconInactiveColor: '#666666', // 首尾不可滚动时的箭头颜色
|
||||
pageTextStyle: {
|
||||
color: '#0efdff' // 分页文字颜色(若显示数字分页)
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
x: '-10%',
|
||||
y: 40,
|
||||
x2: 20,
|
||||
y2: 20,
|
||||
},
|
||||
color: ['#09d0fb', '#f88cfb', '#95f8fe', '#f9f390', '#ecfeb7'],
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: '65%',
|
||||
center: ['45%', '50%'],
|
||||
selectedMode: 'single',
|
||||
data: data,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
Intance.setOption(option);
|
||||
}
|
||||
|
||||
|
||||
const getDataInfo = () => {
|
||||
getallcount().then((res: any) => {
|
||||
source.value.forEach(item => {
|
||||
item.num = res.data.regStatAll[item.pre]
|
||||
})
|
||||
|
||||
listData.value = res.data.regStatHospMonth
|
||||
// nextTick(() => {
|
||||
// // 数据更新后强制重绘
|
||||
// (document.querySelector('.Vue3SeamlessScroll') as any)?._init();
|
||||
// })
|
||||
const data2 = res.data.regStatStatus.map((item: any) => {
|
||||
return {
|
||||
name: item.dict_name,
|
||||
value: item.sl,
|
||||
}
|
||||
})
|
||||
const data4 = res.data.regStatSample.map((item: any) => {
|
||||
return {
|
||||
name: item.SampleTypeName,
|
||||
value: item.sl,
|
||||
}
|
||||
})
|
||||
getEcharts1(res.data.regStatMonth)
|
||||
getEcharts2(data2)
|
||||
getEcharts3()
|
||||
getEcharts4(data4)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDataInfo()
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import './css/icon.css';
|
||||
@import './css/index.css';
|
||||
@import './css/public.css';
|
||||
</style>
|
||||
@ -1,167 +1,112 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="参数名称" prop="configName">
|
||||
<el-input
|
||||
v-model="queryParams.configName"
|
||||
placeholder="请输入参数名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数键名" prop="configKey">
|
||||
<el-input
|
||||
v-model="queryParams.configKey"
|
||||
placeholder="请输入参数键名"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统内置" prop="configType">
|
||||
<el-select v-model="queryParams.configType" placeholder="系统内置" clearable style="width: 240px">
|
||||
<el-option
|
||||
v-for="dict in sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px;">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="参数名称" prop="configName">
|
||||
<el-input v-model="queryParams.configName" placeholder="请输入参数名称" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数键名" prop="configKey">
|
||||
<el-input v-model="queryParams.configKey" placeholder="请输入参数键名" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="系统内置" prop="configType">
|
||||
<el-select v-model="queryParams.configType" placeholder="系统内置" clearable style="width: 240px">
|
||||
<el-option v-for="dict in sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px;">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:config:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:config:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:config:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['system:config:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Refresh" @click="handleRefreshCache"
|
||||
v-hasPermi="['system:config:remove']">刷新缓存</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 280px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="参数主键" align="center" prop="configId" />
|
||||
<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="参数键值" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="系统内置" align="center" prop="configType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yes_no" :value="scope.row.configType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:config:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="configRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="参数名称" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入参数名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数键名" prop="configKey">
|
||||
<el-input v-model="form.configKey" placeholder="请输入参数键名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数键值" prop="configValue">
|
||||
<el-input v-model="form.configValue" type="textarea" placeholder="请输入参数键值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="系统内置" prop="configType">
|
||||
<el-radio-group v-model="form.configType">
|
||||
<el-radio v-for="dict in sys_yes_no" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:config:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:config:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:config:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Refresh"
|
||||
@click="handleRefreshCache"
|
||||
v-hasPermi="['system:config:remove']"
|
||||
>刷新缓存</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="参数主键" align="center" prop="configId" />
|
||||
<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="参数键值" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="系统内置" align="center" prop="configType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yes_no" :value="scope.row.configType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:config:edit']" >修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:config:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="configRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="参数名称" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入参数名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数键名" prop="configKey">
|
||||
<el-input v-model="form.configKey" placeholder="请输入参数键名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数键值" prop="configValue">
|
||||
<el-input v-model="form.configValue" type="textarea" placeholder="请输入参数键值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="系统内置" prop="configType">
|
||||
<el-radio-group v-model="form.configType">
|
||||
<el-radio
|
||||
v-for="dict in sys_yes_no"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Config">
|
||||
@ -296,7 +241,7 @@ function handleDelete(row: SysConfig) {
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@ -1,143 +1,112 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="部门名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="queryParams.deptName"
|
||||
placeholder="请输入部门名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="部门状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="部门名称" prop="deptName">
|
||||
<el-input v-model="queryParams.deptName" placeholder="请输入部门名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="部门状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:dept:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="deptId"
|
||||
:default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
||||
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dept:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)"
|
||||
v-hasPermi="['system:dept:add']">新增</el-button>
|
||||
<el-button v-if="scope.row.parentId != 0" link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dept:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改部门对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form ref="deptRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24" v-if="form.parentId !== 0">
|
||||
<el-form-item label="上级部门" prop="parentId">
|
||||
<el-tree-select v-model="form.parentId" :data="deptOptions"
|
||||
:props="{ value: 'deptId', label: 'deptName', children: 'children' }" value-key="deptId"
|
||||
placeholder="选择上级部门" check-strictly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门名称" prop="deptName">
|
||||
<el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="显示排序" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人" prop="leader">
|
||||
<el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:dept:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Sort"
|
||||
@click="toggleExpandAll"
|
||||
>展开/折叠</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-if="refreshTable"
|
||||
v-loading="loading"
|
||||
:data="deptList"
|
||||
row-key="deptId"
|
||||
:default-expand-all="isExpandAll"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
||||
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']">新增</el-button>
|
||||
<el-button v-if="scope.row.parentId != 0" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改部门对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form ref="deptRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24" v-if="form.parentId !== 0">
|
||||
<el-form-item label="上级部门" prop="parentId">
|
||||
<el-tree-select
|
||||
v-model="form.parentId"
|
||||
:data="deptOptions"
|
||||
:props="{ value: 'deptId', label: 'deptName', children: 'children' }"
|
||||
value-key="deptId"
|
||||
placeholder="选择上级部门"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门名称" prop="deptName">
|
||||
<el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="显示排序" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人" prop="leader">
|
||||
<el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Dept">
|
||||
@ -273,12 +242,12 @@ function submitForm() {
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row: SysDept) {
|
||||
proxy.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function () {
|
||||
return delDept(row.deptId!)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
@ -1,174 +1,115 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input
|
||||
v-model="queryParams.dictName"
|
||||
placeholder="请输入字典名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典类型" prop="dictType">
|
||||
<el-input
|
||||
v-model="queryParams.dictType"
|
||||
placeholder="请输入字典类型"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="字典状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input v-model="queryParams.dictName" placeholder="请输入字典名称" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典类型" prop="dictType">
|
||||
<el-input v-model="queryParams.dictType" placeholder="请输入字典类型" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="字典状态" clearable style="width: 240px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:dict:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['system:dict:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Refresh" @click="handleRefreshCache"
|
||||
v-hasPermi="['system:dict:remove']">刷新缓存</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 280px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编号" align="center" prop="dictId" />
|
||||
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
|
||||
<span>{{ scope.row.dictType }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典类型" prop="dictType">
|
||||
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:dict:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:dict:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:dict:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Refresh"
|
||||
@click="handleRefreshCache"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>刷新缓存</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编号" align="center" prop="dictId" />
|
||||
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
|
||||
<span>{{ scope.row.dictType }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典类型" prop="dictType">
|
||||
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Dict">
|
||||
@ -266,7 +207,7 @@ function handleSelectionChange(selection: SysDictType[]) {
|
||||
function handleUpdate(row?: SysDictType) {
|
||||
reset()
|
||||
const dictId = row?.dictId || ids.value[0]
|
||||
getType(dictId).then(response=> {
|
||||
getType(dictId).then(response => {
|
||||
form.value = response.data!
|
||||
open.value = true
|
||||
title.value = "修改字典类型"
|
||||
@ -297,12 +238,12 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row?: SysDictType) {
|
||||
const dictIds = row?.dictId || ids.value
|
||||
proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function () {
|
||||
return delType(dictIds)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@ -1,352 +1,295 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="菜单名称" prop="menuName">
|
||||
<el-input
|
||||
v-model="queryParams.menuName"
|
||||
placeholder="请输入菜单名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="菜单名称" prop="menuName">
|
||||
<el-input v-model="queryParams.menuName" placeholder="请输入菜单名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:menu:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-if="refreshTable" v-loading="loading" :data="menuList" row-key="menuId"
|
||||
:default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
height="calc(100vh - 200px)">
|
||||
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
|
||||
<el-table-column prop="icon" label="图标" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<svg-icon :icon-class="scope.row.icon" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
|
||||
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="210" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:menu:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)"
|
||||
v-hasPermi="['system:menu:add']">新增</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:menu:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改菜单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
||||
<el-form ref="menuRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上级菜单">
|
||||
<el-tree-select v-model="form.parentId" :data="menuOptions"
|
||||
:props="{ value: 'menuId', label: 'menuName', children: 'children' }" value-key="menuId"
|
||||
placeholder="选择上级菜单" check-strictly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="菜单类型" prop="menuType">
|
||||
<el-radio-group v-model="form.menuType">
|
||||
<el-radio value="M">目录</el-radio>
|
||||
<el-radio value="C">菜单</el-radio>
|
||||
<el-radio value="F">按钮</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.menuType != 'F'">
|
||||
<el-form-item label="菜单图标" prop="icon">
|
||||
<el-popover placement="bottom-start" :width="540" trigger="click">
|
||||
<template #reference>
|
||||
<el-input v-model="form.icon" placeholder="点击选择图标" @blur="showSelectIcon" readonly>
|
||||
<template #prefix>
|
||||
<svg-icon v-if="form.icon" :icon-class="form.icon" class="el-input__icon"
|
||||
style="height: 32px;width: 16px;" />
|
||||
<el-icon v-else style="height: 32px;width: 16px;">
|
||||
<search />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<icon-select ref="iconSelectRef" @selected="selected" :active-icon="form.icon" />
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜单名称" prop="menuName">
|
||||
<el-input v-model="form.menuName" placeholder="请输入菜单名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="显示排序" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>是否外链
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.isFrame">
|
||||
<el-radio value="0">是</el-radio>
|
||||
<el-radio value="1">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item prop="path">
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
路由地址
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.path" placeholder="请输入路由地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item prop="component">
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="访问的组件路径,如:`system/user/index`,默认在`views`目录下" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
组件路径
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.component" placeholder="请输入组件路径" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'M'">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
权限字符
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.query" placeholder="请输入路由参数" maxlength="255" />
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`' placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
路由参数
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
是否缓存
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.isCache">
|
||||
<el-radio value="0">缓存</el-radio>
|
||||
<el-radio value="1">不缓存</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
显示状态
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.visible">
|
||||
<el-radio v-for="dict in sys_show_hide" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择停用则路由将不会出现在侧边栏,也不能被访问" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
菜单状态
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:menu:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Sort"
|
||||
@click="toggleExpandAll"
|
||||
>展开/折叠</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-if="refreshTable"
|
||||
v-loading="loading"
|
||||
:data="menuList"
|
||||
row-key="menuId"
|
||||
:default-expand-all="isExpandAll"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
|
||||
<el-table-column prop="icon" label="图标" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<svg-icon :icon-class="scope.row.icon" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
|
||||
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="210" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:menu:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:menu:add']">新增</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:menu:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改菜单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
||||
<el-form ref="menuRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上级菜单">
|
||||
<el-tree-select
|
||||
v-model="form.parentId"
|
||||
:data="menuOptions"
|
||||
:props="{ value: 'menuId', label: 'menuName', children: 'children' }"
|
||||
value-key="menuId"
|
||||
placeholder="选择上级菜单"
|
||||
check-strictly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="菜单类型" prop="menuType">
|
||||
<el-radio-group v-model="form.menuType">
|
||||
<el-radio value="M">目录</el-radio>
|
||||
<el-radio value="C">菜单</el-radio>
|
||||
<el-radio value="F">按钮</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item label="菜单图标" prop="icon">
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
:width="540"
|
||||
trigger="click"
|
||||
>
|
||||
<template #reference>
|
||||
<el-input v-model="form.icon" placeholder="点击选择图标" @blur="showSelectIcon" readonly>
|
||||
<template #prefix>
|
||||
<svg-icon
|
||||
v-if="form.icon"
|
||||
:icon-class="form.icon"
|
||||
class="el-input__icon"
|
||||
style="height: 32px;width: 16px;"
|
||||
/>
|
||||
<el-icon v-else style="height: 32px;width: 16px;"><search /></el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<icon-select ref="iconSelectRef" @selected="selected" :active-icon="form.icon" />
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="显示排序" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜单名称" prop="menuName">
|
||||
<el-input v-model="form.menuName" placeholder="请输入菜单名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item prop="routeName">
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="默认不填则和路由地址相同:如地址为:`user`,则名称为`User`(注意:因为router会删除名称相同路由,为避免名字的冲突,特殊情况下请自定义,保证唯一性)" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
路由名称
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.routeName" placeholder="请输入路由名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>是否外链
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.isFrame">
|
||||
<el-radio value="0">是</el-radio>
|
||||
<el-radio value="1">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item prop="path">
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
路由地址
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.path" placeholder="请输入路由地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item prop="component">
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="访问的组件路径,如:`system/user/index`,默认在`views`目录下" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
组件路径
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.component" placeholder="请输入组件路径" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'M'">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
权限字符
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.query" placeholder="请输入路由参数" maxlength="255" />
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`' placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
路由参数
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
是否缓存
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.isCache">
|
||||
<el-radio value="0">缓存</el-radio>
|
||||
<el-radio value="1">不缓存</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
显示状态
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.visible">
|
||||
<el-radio
|
||||
v-for="dict in sys_show_hide"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="选择停用则路由将不会出现在侧边栏,也不能被访问" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
菜单状态
|
||||
</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Menu">
|
||||
import { addMenu, delMenu, getMenu, listMenu, updateMenu } from "@/api/system/menu"
|
||||
import SvgIcon from "@/components/SvgIcon/index.vue"
|
||||
import IconSelect from "@/components/IconSelect/index.vue"
|
||||
import type { SysMenu, MenuQueryParams } from '@/types/api/system/menu'
|
||||
<script setup name="Menu">
|
||||
import { addMenu, delMenu, getMenu, listMenu, updateMenu } from "@/api/system/menu";
|
||||
import SvgIcon from "@/components/SvgIcon";
|
||||
import IconSelect from "@/components/IconSelect";
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { sys_show_hide, sys_normal_disable } = proxy.useDict("sys_show_hide", "sys_normal_disable")
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_show_hide, sys_normal_disable } = proxy.useDict("sys_show_hide", "sys_normal_disable");
|
||||
|
||||
const menuList = ref<any[]>([])
|
||||
const open = ref<boolean>(false)
|
||||
const loading = ref<boolean>(true)
|
||||
const showSearch = ref<boolean>(true)
|
||||
const title = ref<string>("")
|
||||
const menuOptions = ref<any[]>([])
|
||||
const isExpandAll = ref<boolean>(false)
|
||||
const refreshTable = ref<boolean>(true)
|
||||
const iconSelectRef = ref<any | null>(null)
|
||||
const menuList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const title = ref("");
|
||||
const menuOptions = ref([]);
|
||||
const isExpandAll = ref(false);
|
||||
const refreshTable = ref(true);
|
||||
const iconSelectRef = ref(null);
|
||||
|
||||
const data = reactive({
|
||||
form: {} as SysMenu,
|
||||
form: {},
|
||||
queryParams: {
|
||||
menuName: undefined,
|
||||
visible: undefined
|
||||
} as MenuQueryParams,
|
||||
},
|
||||
rules: {
|
||||
menuName: [{ required: true, message: "菜单名称不能为空", trigger: "blur" }],
|
||||
orderNum: [{ required: true, message: "菜单顺序不能为空", trigger: "blur" }],
|
||||
path: [{ required: true, message: "路由地址不能为空", trigger: "blur" }]
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询菜单列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
loading.value = true;
|
||||
listMenu(queryParams.value).then(response => {
|
||||
menuList.value = proxy.handleTree(response.data, "menuId")
|
||||
loading.value = false
|
||||
})
|
||||
menuList.value = proxy.handleTree(response.data, "menuId");
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询菜单下拉树结构 */
|
||||
function getTreeselect() {
|
||||
menuOptions.value = []
|
||||
menuOptions.value = [];
|
||||
listMenu().then(response => {
|
||||
const menu = { menuId: 0, menuName: "主类目", children: [] }
|
||||
menu.children = proxy.handleTree(response.data, "menuId")
|
||||
menuOptions.value.push(menu)
|
||||
})
|
||||
const menu = { menuId: 0, menuName: "主类目", children: [] };
|
||||
menu.children = proxy.handleTree(response.data, "menuId");
|
||||
menuOptions.value.push(menu);
|
||||
});
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
@ -360,94 +303,85 @@ function reset() {
|
||||
isCache: "0",
|
||||
visible: "0",
|
||||
status: "0"
|
||||
}
|
||||
proxy.resetForm("menuRef")
|
||||
};
|
||||
proxy.resetForm("menuRef");
|
||||
}
|
||||
|
||||
/** 展示下拉图标 */
|
||||
function showSelectIcon() {
|
||||
iconSelectRef.value?.reset()
|
||||
iconSelectRef.value.reset();
|
||||
}
|
||||
|
||||
/** 选择图标 */
|
||||
function selected(name: string) {
|
||||
form.value.icon = name
|
||||
function selected(name) {
|
||||
form.value.icon = name;
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
getList()
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd(row?: SysMenu) {
|
||||
reset()
|
||||
getTreeselect()
|
||||
function handleAdd(row) {
|
||||
reset();
|
||||
getTreeselect();
|
||||
if (row != null && row.menuId) {
|
||||
form.value.parentId = row.menuId
|
||||
form.value.parentId = row.menuId;
|
||||
} else {
|
||||
form.value.parentId = 0
|
||||
form.value.parentId = 0;
|
||||
}
|
||||
open.value = true
|
||||
title.value = "添加菜单"
|
||||
open.value = true;
|
||||
title.value = "添加菜单";
|
||||
}
|
||||
|
||||
/** 展开/折叠操作 */
|
||||
function toggleExpandAll() {
|
||||
refreshTable.value = false
|
||||
isExpandAll.value = !isExpandAll.value
|
||||
refreshTable.value = false;
|
||||
isExpandAll.value = !isExpandAll.value;
|
||||
nextTick(() => {
|
||||
refreshTable.value = true
|
||||
})
|
||||
refreshTable.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
async function handleUpdate(row: SysMenu) {
|
||||
reset()
|
||||
await getTreeselect()
|
||||
getMenu(row.menuId!).then(response => {
|
||||
form.value = response.data!
|
||||
open.value = true
|
||||
title.value = "修改菜单"
|
||||
})
|
||||
async function handleUpdate(row) {
|
||||
reset();
|
||||
await getTreeselect();
|
||||
getMenu(row.menuId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改菜单";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["menuRef"].validate((valid: boolean) => {
|
||||
proxy.$refs["menuRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.menuId != undefined) {
|
||||
updateMenu(form.value).then(() => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
updateMenu(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addMenu(form.value).then(() => {
|
||||
proxy.$modal.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
addMenu(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row: SysMenu) {
|
||||
proxy.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
|
||||
return delMenu(row.menuId!)
|
||||
function handleDelete(row) {
|
||||
proxy.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function () {
|
||||
return delMenu(row.menuId);
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
getList()
|
||||
getList();
|
||||
</script>
|
||||
|
||||
@ -1,161 +1,114 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="公告标题" prop="noticeTitle">
|
||||
<el-input
|
||||
v-model="queryParams.noticeTitle"
|
||||
placeholder="请输入公告标题"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人员" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="请输入操作人员"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="noticeType">
|
||||
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_notice_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="公告标题" prop="noticeTitle">
|
||||
<el-input v-model="queryParams.noticeTitle" placeholder="请输入公告标题" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人员" prop="createBy">
|
||||
<el-input v-model="queryParams.createBy" placeholder="请输入操作人员" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="noticeType">
|
||||
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_notice_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:notice:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:notice:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:notice:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
|
||||
<el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_notice_type" :value="scope.row.noticeType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_notice_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:notice:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:notice:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="780px" append-to-body>
|
||||
<el-form ref="noticeRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公告标题" prop="noticeTitle">
|
||||
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公告类型" prop="noticeType">
|
||||
<el-select v-model="form.noticeType" placeholder="请选择">
|
||||
<el-option v-for="dict in sys_notice_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_notice_status" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="内容">
|
||||
<editor v-model="form.noticeContent" :min-height="192" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:notice:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
|
||||
<el-table-column
|
||||
label="公告标题"
|
||||
align="center"
|
||||
prop="noticeTitle"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_notice_type" :value="scope.row.noticeType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_notice_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice:remove']" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="780px" append-to-body>
|
||||
<el-form ref="noticeRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公告标题" prop="noticeTitle">
|
||||
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公告类型" prop="noticeType">
|
||||
<el-select v-model="form.noticeType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in sys_notice_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_notice_status"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="内容">
|
||||
<editor v-model="form.noticeContent" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Notice">
|
||||
@ -281,12 +234,12 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row?: SysNotice) {
|
||||
const noticeIds = row?.noticeId || ids.value
|
||||
proxy.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function () {
|
||||
return delNotice(noticeIds)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
@ -1,147 +1,104 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="岗位编码" prop="postCode">
|
||||
<el-input
|
||||
v-model="queryParams.postCode"
|
||||
placeholder="请输入岗位编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位名称" prop="postName">
|
||||
<el-input
|
||||
v-model="queryParams.postName"
|
||||
placeholder="请输入岗位名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="岗位编码" prop="postCode">
|
||||
<el-input v-model="queryParams.postCode" placeholder="请输入岗位编码" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位名称" prop="postName">
|
||||
<el-input v-model="queryParams.postName" placeholder="请输入岗位名称" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:post:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:post:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['system:post:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="岗位编号" align="center" prop="postId" />
|
||||
<el-table-column label="岗位编码" align="center" prop="postCode" />
|
||||
<el-table-column label="岗位名称" align="center" prop="postName" />
|
||||
<el-table-column label="岗位排序" align="center" prop="postSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:post:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:post:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改岗位对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="postRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="岗位名称" prop="postName">
|
||||
<el-input v-model="form.postName" placeholder="请输入岗位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位编码" prop="postCode">
|
||||
<el-input v-model="form.postCode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位顺序" prop="postSort">
|
||||
<el-input-number v-model="form.postSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:post:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:post:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:post:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:post:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="岗位编号" align="center" prop="postId" />
|
||||
<el-table-column label="岗位编码" align="center" prop="postCode" />
|
||||
<el-table-column label="岗位名称" align="center" prop="postName" />
|
||||
<el-table-column label="岗位排序" align="center" prop="postSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:post:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:post:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改岗位对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="postRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="岗位名称" prop="postName">
|
||||
<el-input v-model="form.postName" placeholder="请输入岗位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位编码" prop="postCode">
|
||||
<el-input v-model="form.postCode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位顺序" prop="postSort">
|
||||
<el-input-number v-model="form.postSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Post">
|
||||
@ -269,12 +226,12 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row?: SysPost) {
|
||||
const postIds = row?.postId || ids.value
|
||||
proxy.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function () {
|
||||
return delPost(postIds)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@ -1,244 +1,171 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="68px">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input
|
||||
v-model="queryParams.roleName"
|
||||
placeholder="请输入角色名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限字符" prop="roleKey">
|
||||
<el-input
|
||||
v-model="queryParams.roleKey"
|
||||
placeholder="请输入权限字符"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="角色状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="68px">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="queryParams.roleName" placeholder="请输入角色名称" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限字符" prop="roleKey">
|
||||
<el-input v-model="queryParams.roleKey" placeholder="请输入权限字符" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="角色状态" clearable style="width: 240px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:role:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:role:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:role:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['system:role:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 280px)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="角色编号" prop="roleId" width="120" />
|
||||
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
||||
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
|
||||
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
||||
<el-table-column label="状态" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:role:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:role:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="数据权限" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)"
|
||||
v-hasPermi="['system:role:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="User" @click="handleAuthUser(scope.row)"
|
||||
v-hasPermi="['system:role:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改角色配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="roleRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="roleKey">
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
权限字符
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.roleKey" placeholder="请输入权限字符" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色顺序" prop="roleSort">
|
||||
<el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单权限">
|
||||
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
|
||||
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
|
||||
<el-checkbox v-model="form.menuCheckStrictly"
|
||||
@change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
|
||||
<el-tree class="tree-border" :data="menuOptions" show-checkbox ref="menuRef" node-key="id"
|
||||
:check-strictly="!form.menuCheckStrictly" empty-text="加载中,请稍候"
|
||||
:props="{ label: 'label', children: 'children' }"></el-tree>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:role:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:role:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:role:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:role:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="角色编号" prop="roleId" width="120" />
|
||||
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
||||
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
|
||||
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
||||
<el-table-column label="状态" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="数据权限" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1">
|
||||
<el-button link type="primary" icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改角色配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="roleRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="roleKey">
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
权限字符
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.roleKey" placeholder="请输入权限字符" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色顺序" prop="roleSort">
|
||||
<el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单权限">
|
||||
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
|
||||
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
|
||||
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
|
||||
<el-tree
|
||||
class="tree-border"
|
||||
:data="menuOptions"
|
||||
show-checkbox
|
||||
ref="menuRef"
|
||||
node-key="id"
|
||||
:check-strictly="!form.menuCheckStrictly"
|
||||
empty-text="加载中,请稍候"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
></el-tree>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 分配角色数据权限对话框 -->
|
||||
<el-dialog :title="title" v-model="openDataScope" width="500px" append-to-body>
|
||||
<el-form :model="form" label-width="80px">
|
||||
<el-form-item label="角色名称">
|
||||
<el-input v-model="form.roleName" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限字符">
|
||||
<el-input v-model="form.roleKey" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限范围">
|
||||
<el-select v-model="form.dataScope" @change="dataScopeSelectChange">
|
||||
<el-option
|
||||
v-for="item in dataScopeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据权限" v-show="form.dataScope == 2">
|
||||
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
|
||||
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
|
||||
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
|
||||
<el-tree
|
||||
class="tree-border"
|
||||
:data="deptOptions"
|
||||
show-checkbox
|
||||
default-expand-all
|
||||
ref="deptRef"
|
||||
node-key="id"
|
||||
:check-strictly="!form.deptCheckStrictly"
|
||||
empty-text="加载中,请稍候"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
></el-tree>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitDataScope">确 定</el-button>
|
||||
<el-button @click="cancelDataScope">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<!-- 分配角色数据权限对话框 -->
|
||||
<el-dialog :title="title" v-model="openDataScope" width="500px" append-to-body>
|
||||
<el-form :model="form" label-width="80px">
|
||||
<el-form-item label="角色名称">
|
||||
<el-input v-model="form.roleName" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限字符">
|
||||
<el-input v-model="form.roleKey" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限范围">
|
||||
<el-select v-model="form.dataScope" @change="dataScopeSelectChange">
|
||||
<el-option v-for="item in dataScopeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据权限" v-show="form.dataScope == 2">
|
||||
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
|
||||
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
|
||||
<el-checkbox v-model="form.deptCheckStrictly"
|
||||
@change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
|
||||
<el-tree class="tree-border" :data="deptOptions" show-checkbox default-expand-all ref="deptRef" node-key="id"
|
||||
:check-strictly="!form.deptCheckStrictly" empty-text="加载中,请稍候"
|
||||
:props="{ label: 'label', children: 'children' }"></el-tree>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitDataScope">确 定</el-button>
|
||||
<el-button @click="cancelDataScope">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Role">
|
||||
@ -331,7 +258,7 @@ function handleDelete(row?: SysRole) {
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
@ -460,7 +387,8 @@ function getRoleMenuTreeselect(roleId: number): Promise<RoleMenuTreeselectResult
|
||||
}
|
||||
|
||||
/** 根据角色ID查询部门树结构 */
|
||||
function getDeptTree(roleId: number) { Promise<RoleDeptTreeResult>
|
||||
function getDeptTree(roleId: number) {
|
||||
Promise<RoleDeptTreeResult>
|
||||
return deptTreeSelect(roleId).then(response => {
|
||||
deptOptions.value = response.depts
|
||||
return response
|
||||
|
||||
@ -6,10 +6,13 @@
|
||||
<pane size="16">
|
||||
<el-col>
|
||||
<div class="head-container">
|
||||
<el-input v-model="deptName" placeholder="请输入部门名称" clearable prefix-icon="Search" style="margin-bottom: 20px" />
|
||||
<el-input v-model="deptName" placeholder="请输入部门名称" clearable prefix-icon="Search"
|
||||
style="margin-bottom: 20px" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree :data="deptOptions" :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode" ref="deptTreeRef" node-key="id" highlight-current default-expand-all @node-click="handleNodeClick" />
|
||||
<el-tree :data="deptOptions" :props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false" :filter-node-method="filterNode" ref="deptTreeRef" node-key="id"
|
||||
highlight-current default-expand-all @node-click="handleNodeClick" />
|
||||
</div>
|
||||
</el-col>
|
||||
</pane>
|
||||
@ -18,18 +21,22 @@
|
||||
<el-col>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
@ -39,41 +46,48 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['system:user:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:user:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:user:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:user:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport"
|
||||
v-hasPermi="['system:user:import']">导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['system:user:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 350px)">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns.userId.visible" />
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns.phonenumber.visible" width="120" />
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName"
|
||||
v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName"
|
||||
v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName"
|
||||
v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber"
|
||||
v-if="columns.phonenumber.visible" width="120" />
|
||||
<el-table-column label="状态" align="center" key="status" v-if="columns.status.visible">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
></el-switch>
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns.createTime.visible" width="160">
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns.createTime.visible"
|
||||
width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
@ -81,21 +95,26 @@
|
||||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:user:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']"></el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:user:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="重置密码" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Key" @click="handleResetPwd(scope.row)" v-hasPermi="['system:user:resetPwd']"></el-button>
|
||||
<el-button link type="primary" icon="Key" @click="handleResetPwd(scope.row)"
|
||||
v-hasPermi="['system:user:resetPwd']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配角色" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)" v-hasPermi="['system:user:edit']"></el-button>
|
||||
<el-button link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)"
|
||||
v-hasPermi="['system:user:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-col>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
@ -112,7 +131,9 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select v-model="form.deptId" :data="enabledDeptOptions" :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择归属部门" clearable check-strictly />
|
||||
<el-tree-select v-model="form.deptId" :data="enabledDeptOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择归属部门"
|
||||
clearable check-strictly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -144,14 +165,16 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-select v-model="form.sex" placeholder="请选择">
|
||||
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -160,14 +183,16 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位">
|
||||
<el-select v-model="form.postIds" multiple placeholder="请选择">
|
||||
<el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId" :disabled="item.status == 1"></el-option>
|
||||
<el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"
|
||||
:disabled="item.status == 1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
||||
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
|
||||
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId"
|
||||
:disabled="item.status == 1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -190,7 +215,10 @@
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-change="handleFileChange" :on-remove="handleFileRemove" :auto-upload="false" drag>
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-change="handleFileChange"
|
||||
:on-remove="handleFileRemove" :auto-upload="false" drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
@ -199,7 +227,8 @@
|
||||
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" underline="never" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
<el-link type="primary" underline="never" style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
@ -363,14 +392,14 @@ function handleDelete(row?: SysUser) {
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/user/export", {
|
||||
...queryParams.value,
|
||||
},`user_${new Date().getTime()}.xlsx`)
|
||||
}, `user_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
/** 用户状态修改 */
|
||||
@ -419,11 +448,11 @@ function handleResetPwd(row: SysUser) {
|
||||
}
|
||||
return true
|
||||
},
|
||||
}).then(({ value }: { value: string }) => {
|
||||
}).then(({ value }: { value: string }) => {
|
||||
resetUserPwd(row.userId!, value).then(() => {
|
||||
proxy.$modal.msgSuccess("修改成功,新密码是:" + value)
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
|
||||
@ -1,65 +1,70 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<template v-slot:header>
|
||||
<div class="clearfix">
|
||||
<span>个人信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<div class="text-center">
|
||||
<userAvatar />
|
||||
</div>
|
||||
<ul class="list-group list-group-striped">
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="user" />用户名称
|
||||
<div class="pull-right">{{ state.user.userName }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="phone" />手机号码
|
||||
<div class="pull-right">{{ state.user.phonenumber }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="email" />用户邮箱
|
||||
<div class="pull-right">{{ state.user.email }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="tree" />所属部门
|
||||
<div class="pull-right" v-if="state.user.dept">{{ state.user.dept.deptName }} / {{ state.postGroup }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="peoples" />所属角色
|
||||
<div class="pull-right">{{ state.roleGroup }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="date" />创建日期
|
||||
<div class="pull-right">{{ state.user.createTime }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="18" :xs="24">
|
||||
<el-card>
|
||||
<template v-slot:header>
|
||||
<div class="clearfix">
|
||||
<span>基本资料</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-tabs v-model="selectedTab">
|
||||
<el-tab-pane label="基本资料" name="userinfo">
|
||||
<userInfo :user="state.user" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="修改密码" name="resetPwd">
|
||||
<resetPwd />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<template v-slot:header>
|
||||
<div class="clearfix">
|
||||
<span>个人信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<div class="text-center">
|
||||
<userAvatar />
|
||||
</div>
|
||||
<ul class="list-group list-group-striped">
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="user" />用户名称
|
||||
<div class="pull-right">{{ state.user.userName }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="phone" />手机号码
|
||||
<div class="pull-right">{{ state.user.phonenumber }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="email" />用户邮箱
|
||||
<div class="pull-right">{{ state.user.email }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="tree" />所属部门
|
||||
<div class="pull-right" v-if="state.user.dept">{{ state.user.dept.deptName }} / {{ state.postGroup }}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="peoples" />所属角色
|
||||
<div class="pull-right">{{ state.roleGroup }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="date" />创建日期
|
||||
<div class="pull-right">{{ state.user.createTime }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="system" />浏览器ID
|
||||
<div class="pull-right">{{ mbStore.fingerprint }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="18" :xs="24">
|
||||
<el-card>
|
||||
<template v-slot:header>
|
||||
<div class="clearfix">
|
||||
<span>基本资料</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-tabs v-model="selectedTab">
|
||||
<el-tab-pane label="基本资料" name="userinfo">
|
||||
<userInfo :user="state.user" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="修改密码" name="resetPwd">
|
||||
<resetPwd />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Profile">
|
||||
@ -68,7 +73,9 @@ import userInfo from "./userInfo.vue"
|
||||
import resetPwd from "./resetPwd.vue"
|
||||
import { getUserProfile } from "@/api/system/user"
|
||||
import type { SysUser } from '@/types/api/system/user'
|
||||
import { useCommonStore } from '@/store/modules/commonStore'
|
||||
|
||||
const mbStore = useCommonStore();
|
||||
const route = useRoute()
|
||||
const selectedTab = ref<string>("userinfo")
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
||||
"noImplicitAny": false,
|
||||
// 模块和兼容性相关配置
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
@ -47,8 +47,8 @@ export default defineConfig(({ mode, command }) => {
|
||||
open: false,
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
"/dev-api": {
|
||||
target: "http://47.97.125.165:8904",
|
||||
'/dev-api': {
|
||||
target: 'http://47.97.125.165:8905',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||
},
|
||||
|
||||