Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
lilin 2025-01-21 18:16:26 +08:00
commit 8b188c5223
84 changed files with 0 additions and 15995 deletions

View File

@ -1,54 +0,0 @@
import request from '@/utils/request';
//分页查询活动宣传
export function queryActivityPage(params:any){
return request({
url: '/vision_examine/activity/queryActivityPage' ,
method: 'get',
params: params
});
}
//新增活动宣传
export function addActivity(formData:any){
return request({
url:'/vision_examine/activity/addActivity' ,
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
});
}
//修改活动宣传
export function updateActivity(formData:any){
return request({
url:'/vision_examine/activity/updateActivity' ,
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
});
}
//删除活动宣传
export function delActivity(queryParams:any){
return request({
url:'/vision_examine/activity/delActivity' ,
method: 'post',
params: queryParams
});
}
//修改活动宣传状态
export function updateActivityStatus(data:any){
return request({
url:'/vision_examine/activity/updateActivityStatus' ,
method: 'post',
data: data,
});
}

View File

@ -1,91 +0,0 @@
import request from '@/utils/request';
//查询问答
export function queryAppQuestionAnswerPage(params:any){
return request({
url: '/app/question-answer/queryAppQuestionAnswerPage' ,
method: 'get',
params: params
});
}
//问答问题
export function updateAppQuestionAnswer(data:any){
return request({
url: '/app/question-answer/updateAppQuestionAnswer' ,
method: 'post',
data: data
});
}
//导出日志
export function exportUserLogData(params:any){
return request({
url: '/app/app-user-logs/exportUserLogData' ,
method: 'get',
params: params,
responseType: 'arraybuffer'
});
}
//查询日志
export function queryAppUserLogsPage(params:any){
return request({
url: '/app/app-user-logs/queryAppUserLogsPage' ,
method: 'get',
params: params
});
}
//查询日志
export function queryAppUserHistoryLogsPage(params:any){
return request({
url: '/app/app-user-logs/queryAppUserHistoryLogsPage' ,
method: 'get',
params: params
});
}
//查询资讯
export function queryAppNewsPage(params:any){
return request({
url: '/app/app-news/queryAppNewsPage' ,
method: 'get',
params: params
});
}
//添加资讯
export function addAppNews(formData:any){
return request({
url: '/app/app-news/addAppNews' ,
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
});
}
//修改资讯
export function updateAppNews(formData:any){
return request({
url: '/app/app-news/updateAppNews' ,
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
});
}
//修改资讯状态
export function updateAppNewsStatus(data:any){
return request({
url: '/app/app-news/updateAppNewsStatus' ,
method: 'post',
data: data
});
}
//删除资讯
export function delAppNews(queryParams:any){
return request({
url:'/app/app-news/delAppNews' ,
method: 'post',
params: queryParams
});
}

View File

@ -1,164 +0,0 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FileInfo } from './types';
//分页查询数据集列表
export function getModel(queryParams:any) {
return request({
url: '/modeltrain/model/getModel',
method: 'post',
params: queryParams
});
}
export function addModel(data:any) {
return request({
url: '/modeltrain/model/addModel',
method: 'post',
data: data
});
}
export function updateModel(data:any) {
return request({
url: '/modeltrain/model/updateModel',
method: 'post',
data: data
});
}
export function delModel(data:any) {
return request({
url: '/modeltrain/model/delModel',
method: 'post',
data: data
});
}
// 训练列表
export function getTrainRecord(queryParams:any) {
return request({
url: '/modeltrain/trainrecord/getTrainRecord',
method: 'post',
params: queryParams
});
}
// 训练列表-不分页
export function getTrainRecordList(queryParams:any) {
return request({
url: '/modeltrain/trainrecord/getTrainRecordList',
method: 'post',
params: queryParams
});
}
// 查看训练详情
export function getTrainRecordByName(queryParams:any) {
return request({
url: '/modeltrain/trainrecord/getTrainRecordByName',
method: 'post',
params: queryParams
});
}
export function addTrainRecord(data:any) {
return request({
url: '/modeltrain/trainrecord/addTrainRecord',
method: 'post',
data: data
});
}
export function updateTrainRecord(data:any) {
return request({
url: '/modeltrain/trainrecord/updateTrainRecord',
method: 'post',
data: data
});
}
export function delTrainRecord(data:any) {
return request({
url: '/modeltrain/trainrecord/delTrainRecord',
method: 'post',
data: data
});
}
export function copyTrainRecord(data:any) {
return request({
url: '/modeltrain/trainrecord/copyTrainRecord?id='+ data.id,
method: 'post',
data: data
});
}
//人机交互流程图
//查询流程图列表
export function getFlowChart(data:any) {
return request({
url: '/modeltrain/humancomputer-interaction/getFlowChart',
method: 'post',
data: data
});
}
// //新增流程图
// export function addFlowChart(data:any) {
// return request({
// url: '/modeltrain/humancomputer-interaction/addFlowChart',
// method: 'post',
// data: data
// });
// }
/**
*
*
* @param file
*/
export function addFlowChart(data: any): AxiosPromise<FileInfo> {
const formData = new FormData();
formData.append('file', data.file);
formData.append('name', data.name);
formData.append('pointdata', "");
return request({
url: '/modeltrain/humancomputer-interaction/addFlowChart',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
});
}
//修改流程图-添加点位
export function updateFlowChart(data:any) {
return request({
url: '/modeltrain/humancomputer-interaction/updateFlowChart',
method: 'post',
data: data
});
}
//删除流程图
export function delFlowChart(queryParams:any) {
return request({
url: '/modeltrain/humancomputer-interaction/delFlowChart',
method: 'post',
params: queryParams
});
}
/**
*
*
* @returns
*/
export function downloadModel(queryParams:any) {
return request({
url: '/modeltrain/trainrecord/downloadModel',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}

View File

@ -1,7 +0,0 @@
/**
* API类型声明
*/
export interface FileInfo {
name: string;
url: string;
}

View File

@ -1,629 +0,0 @@
import request from '@/utils/request';
// 查询筛查项目列表-不包含子集
export function queryVisionExamineItemList(params:any){
return request({
url: '/base/vision-examine-item/queryVisionExamineItemList' ,
method: 'get',
params: params
});
}
//查询视力筛查-检查计划分页
export function queryExaminePlanPage(params:any){
return request({
url: '/vision_examine/examine-plan/queryExaminePlanPage' ,
method: 'get',
params: params
});
}
//新增视力筛查-检查计划
export function addExaminePlan(data:any){
return request({
url:'/vision_examine/examine-plan/addExaminePlan' ,
method: 'post',
data: data
});
}
//修改视力筛查-检查计划
export function updateExaminePlan(data:any){
return request({
url:'/vision_examine/examine-plan/updateExaminePlan' ,
method: 'post',
data: data
});
}
//删除视力筛查-检查计划
export function delExaminePlan(queryParams:any){
return request({
url:'/vision_examine/examine-plan/delExaminePlan' ,
method: 'post',
params: queryParams
});
}
//获取计划学年个数
export function queryPlanNum(queryParams:any){
return request({
url:'/vision_examine/examine-plan/queryPlanNum' ,
method: 'get',
params: queryParams
});
}
//获取计划编号
export function getPlanCode(queryParams:any){
return request({
url:'/vision_examine/examine-plan/getPlanCode' ,
method: 'get',
params: queryParams
});
}
// 视力筛查-检查计划-关联学校
export function queryExamineSchoolPage(params:any){
return request({
url: '/vision_examine/examine-plan-school/queryExamineSchoolPage' ,
method: 'get',
params: params
});
}
//新增视力筛查-检查计划
export function addExamineSchool(data:any){
return request({
url:'/vision_examine/examine-plan-school/addExamineSchool' ,
method: 'post',
params: data
});
}
//添加普检计划已关联学校所有未关联的学生
export function addAllExamineStudent(data:any){
return request({
url:'/vision_examine/examine-plan-school/addAllExamineStudent' ,
method: 'post',
params: data
});
}
//抽检规则-添加检查计划-关联学校
export function addSpotCheckExamineSchool(data:any){
return request({
url:'/vision_examine/examine-plan-school/addSpotCheckExamineSchool' ,
method: 'post',
params: data
});
}
//删除视力筛查-检查计划
export function delExamineSchool(queryParams:any){
return request({
url:'/vision_examine/examine-plan-school/delExamineSchool' ,
method: 'post',
params: queryParams
});
}
// 查询检查计划关联学校区域结构树
export function queryExamineSchoolTree(params:any){
return request({
url: '/vision_examine/examine-plan-school/queryExamineSchoolTree' ,
method: 'get',
params: params
});
}
// 现状分析-普查区域学校班级结构树
export function queryExamineSchoolGradeTree(params:any){
return request({
url: '/vision_examine/examine-plan-school/queryExamineSchoolGradeTree' ,
method: 'get',
params: params
});
}
// 查询普检关联学生列表分页
export function queryExamineResultPage(params:any){
return request({
url: '/vision_examine/examine-result/queryExamineResultPage' ,
method: 'get',
params: params
});
}
// 检查进度学生完成率
export function queryCompletionRate(params:any){
return request({
url: '/vision_examine/examine-result/queryCompletionRate' ,
method: 'get',
params: params
});
}
// 近视统计
export function queryMyopiaStatistics(params:any){
return request({
url: '/vision_examine/examine-result/queryMyopiaStatistics' ,
method: 'get',
params: params
});
}
// 视力不良统计
export function queryAbnormalStatistics(params:any){
return request({
url: '/vision_examine/examine-result/queryAbnormalStatistics' ,
method: 'get',
params: params
});
}
// 远视储备率统计
export function queryFarSightednessStatistics(params:any){
return request({
url: '/vision_examine/examine-result/queryFarSightednessStatistics' ,
method: 'get',
params: params
});
}
// 抽检对比分析
export function querySamplingComparison(params:any){
return request({
url: '/vision_examine/examine-result/querySamplingComparison' ,
method: 'get',
params: params
});
}
// 查询普检报告年级列表分页
export function queryPlanGradePage(params:any){
return request({
url: '/vision_examine/examine-result/queryPlanGradePage' ,
method: 'get',
params: params
});
}
// 查询普检报告年级列表分页
export function queryStudentVisdataPage(params:any){
return request({
url: '/vision_examine/examine-result/queryStudentVisdataPage' ,
method: 'get',
params: params
});
}
// 查询普检报告年级列表分页
export function queryStudentVisdataList(params:any){
return request({
url: '/vision_examine/examine-result/queryStudentVisdataList' ,
method: 'get',
params: params
});
}
//学生视力数据档案列表
export function queryVisionChangeTrend(params:any){
return request({
url: 'vision_examine/examine-result/queryVisionChangeTrend' ,
method: 'get',
params: params
});
}
//报告导出
export function exportVisionForm(params: any) {
return request({
url: '/vision_examine/examine-result/exportVisionForm',
method: 'get',
params: params,
responseType: 'arraybuffer',
});
}
//批量报告导出
export function exportMultipleVisionForm(params: any) {
return request({
url: '/vision_examine/examine-result/exportMultipleVisionForm',
method: 'get',
params: params,
responseType: 'arraybuffer',
});
}
//导出生物报告600模版
export function exportStudentSwan(params: any) {
return request({
url: '/vision_examine/examine-result/exportStudentSwan',
method: 'get',
params: params,
responseType: 'arraybuffer',
});
}
// 通过学校id查找检查计划
export function querySchoolIdExamineList(params:any){
return request({
url: '/vision_examine/examine-plan-school/querySchoolIdExamineList' ,
method: 'get',
params: params
});
}
// 查询抽检规则学校列表
export function queryRulesSchoolList(params:any){
return request({
url: '/vision_examine/examine-plan-school/queryRulesSchoolList' ,
method: 'get',
params: params
});
}
// 查询抽检规则学校列表
export function studentQRCode(params:any){
return request({
url: '/vision_examine/examine-plan/studentQRCode' ,
method: 'post',
params: params
});
}
//导出预览二维码
export function downloadQRCode(queryParams: any) {
return request({
url: '/vision_examine/examine-plan/downloadQRCode',
method: 'get',
params: queryParams,
responseType: 'arraybuffer'
});
}
//导出预览二维码
export function examineResultStudentQRCode(queryParams: any) {
return request({
url: '/vision_examine/examine-result/examineResultStudentQRCode',
method: 'get',
params: queryParams,
responseType: 'arraybuffer'
});
}
//选择导出预览二维码
export function downloadSelectedQRCode(queryParams: any) {
return request({
url: '/vision_examine/examine-plan/downloadSelectedQRCode',
method: 'get',
params: queryParams,
responseType: 'arraybuffer'
});
}
//导出个人二维码
export function studentPersonQRCode(queryParams: any) {
return request({
url: '/vision_examine/examine-plan/studentPersonQRCode',
method: 'get',
params: queryParams,
responseType: 'arraybuffer'
});
}
//导出多人二维码
export function studentMultiplePersonQRCode(data: any) {
return request({
url: '/vision_examine/examine-plan/studentMultiplePersonQRCode',
method: 'post',
data: data,
responseType: 'arraybuffer'
});
}
//导出全部二维码
export function studentAllPersonQRCode(params: any) {
return request({
url: '/vision_examine/examine-plan/studentAllPersonQRCode',
method: 'get',
params: params,
responseType: 'arraybuffer'
});
}
//导出全部检查单
export function AllSchoolPersonQRCode(params: any) {
return request({
url: '/vision_examine/examine-plan/AllSchoolPersonQRCode',
method: 'get',
params: params,
responseType: 'arraybuffer'
});
}
//导出未检学生检查单
export function exportNotInspectedQRCode(params: any) {
return request({
url: '/vision_examine/examine-plan/exportNotInspectedQRCode',
method: 'get',
params: params,
responseType: 'arraybuffer'
});
}
//查询学校列表
export function queryRegionPlan(params:any){
return request({
url: '/vision_examine/examine-plan/queryRegionPlan' ,
method: 'get',
params: params
});
}
//根据id查询普检计划
export function queryExaminePlanById(params:any){
return request({
url: '/vision_examine/examine-plan/queryExaminePlanById' ,
method: 'get',
params: params
});
}
//根据普查id学校id查询检查学生信息
export function schoolIdsPlanIdQueryStudent(params:any){
return request({
url: '/vision_examine/examine-result/schoolIdsPlanIdQueryStudent' ,
method: 'get',
params: params
});
}
//下载检查学生信息模版
export function exportExamineResultStudent(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportExamineResultStudent',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//数据管理-查询普检关联学生列表分页
export function queryExamineResultDataPage(params:any){
return request({
url: '/vision_examine/examine-result/queryExamineResultDataPage' ,
method: 'get',
params: params
});
}
//通过普检id导出学生检查数据
export function exportExamineStudent(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportExamineStudent',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//通过普检id导出学生体质健康网模板
export function exportStudentHealthNetwork(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportStudentHealthNetwork',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//删除视力筛查-检查计划
export function delExamineStudentResult(queryParams:any){
return request({
url:'/vision_examine/examine-result/delExamineStudentResult' ,
method: 'post',
params: queryParams
});
}
//修改学生视力数据档案
export function updateExamineResult(data:any){
return request({
url:'/vision_examine/examine-result/updateExamineResult' ,
method: 'post',
data: data
});
}
//修改复查学生视力数据档案
export function updateRecheckExamineResult(data:any){
return request({
url:'/vision_examine/examine-result/updateRecheckExamineResult' ,
method: 'post',
data: data
});
}
//下载常态化-学生信息
export function exportStudentResult(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportStudentResult',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//下载常态化-学生信息
export function exportSchoolHealthNetwork(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportSchoolHealthNetwork',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//下载常态化-学生信息
export function exportStatistics(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportStatistics',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
// 根据学校ID获取学校视力筛查报告所需数据
export function getSchoolCheckReportData(params:any){
return request({
url: '/vision_examine/examine-plan/getSchoolCheckReportData' ,
method: 'get',
params: params
});
}
// 根据区域获取学校视力筛查报告所需数据
export function getRegionCheckReportData(params:any){
return request({
url: '/vision_examine/examine-plan/getRegionCheckReportData' ,
method: 'get',
params: params
});
}
// 通过检查计划Id查询未关联的学生
export function queryPlanStudentList(params:any){
return request({
url: '/vision_examine/examine-plan-school/queryPlanStudentList' ,
method: 'get',
params: params
});
}
// 通过检查计划Id查询未关联的学生
export function addExamineStudent(params:any){
return request({
url: '/vision_examine/examine-plan-school/addExamineStudent' ,
method: 'post',
data: params
});
}
//根据普查id学校id查询检查学生信息
export function recheckStudentList(params:any){
return request({
url: '/vision_examine/examine-result/recheckStudentList' ,
method: 'get',
params: params
});
}
//新增复查学生视力数据档案
export function addRecheckExamineResult(data:any){
return request({
url:'/vision_examine/examine-result/addRecheckExamineResult' ,
method: 'post',
data: data
});
}
//根据普查id学生id查询复查学生详情
export function recheckStudentInfo(params:any){
return request({
url: '/vision_examine/examine-result/recheckStudentInfo' ,
method: 'get',
params: params
});
}
//下载复查全部学生信息模版
export function exportRecheckTemplate(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportRecheckTemplate',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//下载复查全部学生信息模版
export function exportRecheckExamineResultStudent(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportRecheckExamineResultStudent',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//导出复查全部学生复查通知书
export function studentRecheckNotice(queryParams: any) {
return request({
url: '/vision_examine/examine-result/studentRecheckNotice',
method: 'post',
data: queryParams,
responseType: 'arraybuffer'
});
}
//导出复查全部学生复查通知书-大于1000
export function exportSchoolRecheckNotice(queryParams: any) {
return request({
url: '/vision_examine/examine-result/exportSchoolRecheckNotice',
method: 'post',
params: queryParams,
responseType: 'arraybuffer'
});
}
//生成队列
export function exportStudentQueueDataTemplate(params: any) {
return request({
url: '/vision_examine/examine-result/exportStudentQueueDataTemplate',
method: 'post',
params: params,
responseType: 'arraybuffer'
});
}
//删除视力筛查-检查计划
export function delExamineResult(queryParams:any){
return request({
url:'/vision_examine/examine-result/delExamineResult' ,
method: 'post',
params: queryParams
});
}
//修改学生视力数据档案的年级班级
export function updateGradeClassExamineResult(data:any){
return request({
url:'/vision_examine/examine-result/updateGradeClassExamineResult' ,
method: 'post',
data: data
});
}
// 查询筛查项目列表-不包含子集
export function uploadDataToBureau(params:any){
return request({
url: '/eyeapi/uploadDataToBureau' ,
method: 'post',
params: params
});
}

View File

@ -1,11 +0,0 @@
import request from '@/utils/request';
// 按年查询视力筛查-检查计划
export function queryExaminePlanYear(params:any){
return request({
url: '/vision_examine/examine-plan/queryExaminePlanYear' ,
method: 'get',
params: params
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 B

View File

@ -1,543 +0,0 @@
<script lang="ts">
export default {
name: 'activitymanage' //
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick } from "vue";
import { ElMessage, ElMessageBox, FormRules } from "element-plus";
import { queryActivityPage,addActivity,updateActivity,updateActivityStatus,delActivity } from "@/api/activity";
import Page from '@/components/Pagination/page.vue';
import Aactivityschool from './school.vue';
import Viewfile from "@/views/component/Viewfile.vue";
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
//
const activityname = ref('')
const activitytype = ref('')
const typeoptions:any = ref([{value:"01",label:"调查问卷"},{value:"02",label:"训练活动"},{value:"03",label:"科普宣传"}])
const tableData:any = ref([])
const multipleSelection = ref([])
const dialogFormVisible = ref(false)
const dialogtitle = ref('新增活动')
const form:any = ref({})
const planform = ref();
const rules = reactive<FormRules>({
activity_type: [{ required: true, message: "请输入活动类型", trigger: "blur" }],
activity_title: [{ required: true, message: "请输入活动名称", trigger: "blur" }]
});
function releaseClick(row:any){
ElMessageBox.confirm("确定发布此活动吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let params = {
id: row.id,
status:'02'
};
updateActivityStatus(params).then((res:any) => {
ElMessage({
message: "发布成功",
type: "success",
});
getData()
}).catch(()=>{
})
});
}
function delinfoStatus(row:any){
ElMessageBox.confirm("确定删除此活动吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let params = {
id: row.id,
status:'03'
};
updateActivityStatus(params).then((res:any) => {
ElMessage({
message: "删除成功",
type: "success",
});
getData()
}).catch(()=>{
})
});
}
function addinfo(){
dialogtitle.value = '新增活动'
schoolNames.value =''
form.value = {}
fileList.value = []
isSwitch.value = false
dialogFormVisible.value = true
}
function editinfo(row:any){
form.value = JSON.parse(JSON.stringify(row))
if(form.value.school_ids != null && form.value.school_ids != ""){
form.value.school_ids = JSON.parse(form.value.school_ids)
let temp = []
for(let i=0;i<form.value.school_ids.length;i++){
temp.push(form.value.school_ids[i].name)
}
schoolNames.value = temp.join(",")
}else{
form.value.school_ids = []
}
isSwitch.value = false
dialogtitle.value = '修改活动'
// res.data.records[i].activityNames.push(filespath[a])
// res.data.records[i].activityFiles.push(url + '/activity/' + filespath[a])
fileList.value = []
if (row.activityNames != '' && row.activityNames != null) {
for (let i = 0; i < row.activityNames.length; i++) {
fileList.value.push({
name: row.activityNames[i],
url: row.activityFiles[i],
})
}
}
dialogFormVisible.value = true
}
const isSwitch = ref(false)
function infosubmit(formEl: any){
console.log(fileList.value)
formEl.validate((valid: any) => {
if (valid) {
if(isSwitch.value == true){
return
}
isSwitch.value = true
if (form.value.id) {
const formData = new FormData();
let activityFiles:any = []
fileList.value.forEach((item: any) => {
if (item.raw != null) {
formData.append('multipartFile', item.raw)
}else {
activityFiles.push(item.name)
}
})
if(activityFiles.length == 0){
form.value.activity_files = ""
}else{
form.value.activity_files = activityFiles.join(",")
}
formData.append("activityFiles", form.value.activity_files);
if(form.value.id !=null) formData.append("id", form.value.id);
if(form.value.activity_code !=null) formData.append("activityCode", form.value.activity_code);
if(form.value.activity_title !=null) formData.append("activityTitle", form.value.activity_title);
if(form.value.activity_type !=null) formData.append("activityType", form.value.activity_type);
if(form.value.activity_desc !=null) formData.append("activityDesc", form.value.activity_desc);
if(form.value.activity_date !=null) formData.append("activityDate", form.value.activity_date);
if(form.value.school_ids !=null){
formData.append("schoolIds", JSON.stringify(form.value.school_ids));
}else{
form.value.school_ids = []
formData.append("schoolIds", JSON.stringify(form.value.school_ids));
}
if(form.value.publicOrg !=null) formData.append("publicOrg", form.value.public_org);
updateActivity(formData).then((item) => {
dialogFormVisible.value = false;
ElMessage({
message: "修改成功",
type: "success",
});
getData();
}).catch(()=>{
isSwitch.value = false
})
} else {
const formData = new FormData();
fileList.value.forEach((item: any) => {
if (item.raw != null) {
formData.append('multipartFile', item.raw)
}
})
if(form.value.activity_code !=null) formData.append("activityCode", form.value.activity_code);
if(form.value.activity_title !=null) formData.append("activityTitle", form.value.activity_title);
if(form.value.activity_type !=null) formData.append("activityType", form.value.activity_type);
if(form.value.activity_desc !=null) formData.append("activityDesc", form.value.activity_desc);
if(form.value.activity_date !=null) formData.append("activityDate", form.value.activity_date);
if(form.value.school_ids !=null){
formData.append("schoolIds", JSON.stringify(form.value.school_ids));
}else{
form.value.school_ids = []
formData.append("schoolIds", JSON.stringify(form.value.school_ids));
}
if(form.value.publicOrg !=null) formData.append("publicOrg", form.value.public_org);
addActivity(formData).then((item) => {
dialogFormVisible.value = false;
getData();
ElMessage({
message: "新增成功",
type: "success",
});
}).catch(()=>{
isSwitch.value = false
})
}
}
})
}
function handlefilechange(file:any){
console.log(file)
}
function delinfo(row: any) {
ElMessageBox.confirm("确定删除此活动吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let params = {
ids: row.id,
};
delActivity(params).then((res:any) => {
ElMessage({
message: "删除成功",
type: "success",
});
getData()
}).catch(()=>{
})
});
}
function delinfos() {
ElMessageBox.confirm("确定删除已选择的年级吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let id = [] as any[];
multipleSelection.value.forEach((item: any) => {
id.push(item.id)
})
let params = {
ids: id.join(','),
};
delActivity(params).then(() => {
getData();
ElMessage({
message: "删除成功",
type: "success",
});
});
});
}
const loading =ref(false)
function getData(){
loading.value = true
activityname.value = activityname.value.replace(/\s+/g, "");
let params = {
activityTitle: activityname.value,
activityType: activitytype.value,
current: queryInfo.value.current,
size:queryInfo.value.size
};
loading.value = true
queryActivityPage(params).then((res:any) => {
for (let i = 0; i < res.data.records.length; i++) {
if (res.data.records[i].activity_files != '' && res.data.records[i].activity_files != null) {
let filespath = res.data.records[i].activity_files.split(',')
res.data.records[i].activityNames = []
res.data.records[i].activityFiles = []
for (let a = 0; a < filespath.length; a++) {
res.data.records[i].activityNames.push(filespath[a])
res.data.records[i].activityFiles.push(url + '/activity/' + filespath[a])
}
}
}
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
});
}
function searchinfo(){
}
const handleSelectionChange = (val:any) => {
multipleSelection.value = val
}
function handleClose(){
if (planform.value != null) planform.value.resetFields();
dialogFormVisible.value = false
}
const isViewfile = ref(false)
const ViewfileUrl = ref("")
function viewpdf(name: any) {
ViewfileUrl.value = url + '/vision_examine/activity/viewActivityFile?fileName=' + name
setTimeout(()=>{
isViewfile.value = true
},200)
}
function CloseView() {
isViewfile.value = false
}
const isSchool = ref(false)
function schoolClick(){
isSchool.value = true
}
function returnClick(data:any){
if(data == false){
isSchool.value = false
}else{
let temp = []
let tempData = []
for(let i=0;i<data.length;i++){
temp.push(data[i].name)
tempData.push({
id:data[i].id,
name:data[i].name,
})
}
schoolNames.value = temp.join(",")
form.value.school_ids = tempData
isSchool.value = false
}
}
const schoolNames = ref("")
onMounted(() => {
getData();
});
const fileList:any = ref([
])
function dateFormat(row: any) { //
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
</script>
<template>
<div class="w-full">
<div class="activitymanage-box">
<div class="activitymanage-box-top">
<div class="flex">
<el-input v-model="activityname" placeholder="请输入活动名称" style="width:240px" clearable />
<el-select v-model="activitytype" class="ml-4" placeholder="请选择活动类型" style="width: 240px" clearable @change="getData">
<el-option v-for="item in typeoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" class="ml-[10px]" @click="getData">搜索</el-button>
</div>
<div>
<el-button type="primary" @click="addinfo"><img src="@/assets/visionscreening/jscz_xz.png" alt="" style="margin-right: 4px;" >新增</el-button>
<!-- <el-button @click="delinfos" :disabled="multipleSelection.length <= 0" :type="multipleSelection.length > 0 ? 'primary' : ''">
<el-icon><Delete /></el-icon> </el-button> -->
</div>
</div>
<div class="visionscreening-box-bottom">
<el-table :data="tableData" border style="width: 100%; height:calc(100vh - 280px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<el-table-column type="index" width="55" label="序号" />
<el-table-column prop="activity_code" label="活动编号" width="120" />
<el-table-column prop="activity_title" label="活动名称" min-width="140" />
<el-table-column prop="activity_type" label="活动类型" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.activity_type == '01'">调查问卷</span>
<span v-if="scope.row.activity_type == '02'">训练活动</span>
<span v-if="scope.row.activity_type == '03'">科普宣传</span>
</template>
</el-table-column>
<el-table-column prop="activity_date" label="活动开始日期" width="180" align="center"/>
<el-table-column prop="org_type" label="文件" width="80" align="center" >
<template #default="scope">
<div v-if="scope.row.activityFiles !== '' &&scope.row.activityFiles !== undefined" style="display:flex ;flex-wrap: wrap;">
<img v-for="(item,index) in scope.row.activityFiles" src="@/assets/visionscreening/pdficon.png" style="margin: 0 auto;cursor: pointer;" @click="viewpdf(scope.row.activityNames[index])" :title="scope.row.activityNames[index]">
</div>
<div v-else></div>
</template>
</el-table-column>
<el-table-column prop="status" label="活动状态" width="180" align="center">
<template #default="scope">
<span v-if="scope.row.status == '01'">初始创建</span>
<span v-if="scope.row.status == '02'">发布活动</span>
<span v-if="scope.row.status == '03'">活动关闭</span>
</template>
</el-table-column>
<el-table-column prop="public_org" label="发布单位" width="180" />
<el-table-column prop="creator" width="120" label="创建人" align="center"/>
<el-table-column prop="create_time" width="180" label="创建时间" align="center" >
<template #default="scope">
{{ dateFormat(scope.row.create_time) }}
</template>
</el-table-column>
<el-table-column prop="address" label="操作" width="100" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img v-if="scope.row.status =='01'" src="@/assets/MenuIcon/lbcz_xg.png" alt="" title="修改" @click="editinfo(scope.row)" style="cursor: pointer;">
<img v-if="scope.row.status =='01'" src="@/assets/MenuIcon/release.png" alt="" title="发布" @click="releaseClick(scope.row)" style="cursor: pointer;">
<img v-if="scope.row.status =='01'" src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delinfo(scope.row)" style="cursor: pointer;">
<img v-if="scope.row.status =='02'" src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delinfoStatus(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
</div>
<el-dialog v-model="dialogFormVisible" :close-on-click-modal="false" :title="dialogtitle" :before-close="handleClose" width="43%" draggable append-to-body>
<el-form ref="planform" :model="form" :rules="rules" label-width="90px">
<div class="flex justify-between ">
<el-form-item label="活动编码" style="width: 50%">
<el-input v-model="form.activity_code" placeholder="添加成功后自动生成编码" disabled/>
</el-form-item>
<el-form-item label="活动名称" prop="activity_title" style="width: 50%">
<el-input v-model="form.activity_title" autocomplete="off" placeholder="请输入计划编号" />
</el-form-item>
</div>
<div class="flex justify-between ">
<el-form-item label="开始时间" style="width: 50%">
<el-date-picker
style="width: 100%;"
v-model="form.activity_date"
type="date"
placeholder=""
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item label="活动类型" prop="activity_type" style="width: 50%">
<el-select v-model="form.activity_type" placeholder="请选择活动类型" >
<el-option v-for="item in typeoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</div>
<el-form-item label="关联学校">
<div class="flex w-full h-[32px]">
<el-input v-model="schoolNames" autocomplete="off" style="margin-right: 5px;" size="large" disabled placeholder="请选择关联的学校" />
<el-button type="primary" class="ml-[10px]" @click="schoolClick">选择</el-button>
</div>
</el-form-item>
<el-form-item label="发布单位">
<el-input v-model="form.public_org" placeholder="请输入发布单位"/>
</el-form-item>
<el-form-item label="活动描述">
<el-input v-model="form.activity_desc" :autosize="{ minRows: 4 }" type="textarea" placeholder="请输入活动描述"/>
</el-form-item>
<el-form-item label="活动文件">
<div style="width:100% ;">
<el-upload ref="upload" accept=".PDF,.pdf" class="upload-demo" action="" :on-change="handlefilechange" :auto-upload="false"
v-model:file-list="fileList">
<template #trigger>
<el-button type="primary">上传</el-button>
</template>
</el-upload>
</div>
</el-form-item>
</el-form>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="infosubmit(planform)">确定</el-button>
</span>
</el-dialog>
<Aactivityschool v-if="isSchool==true" @returnClick="returnClick" />
<Viewfile v-if="isViewfile" :showTime="true" :title="'查看活动'" :url="ViewfileUrl" :type="'pdf'" :clientHeight="600"
@update="CloseView" :onprint="'no'" />
</div>
</template>
<style scoped lang="scss">
.activitymanage-box {
height: calc(100vh - 130px);
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
padding: 20px;
.activitymanage-box-top{
width:100%;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}
}
.dialog-footer {
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
:deep(.el-tree-node__content){
height: 30px;
}
:deep(.el-input__inner){
height: 32px;
font-size:14px;
}
// :deep(.el-upload-list){
// display: none;
// }
.lefttitle {
min-width: 150px;
display: flex;
align-items: center;
padding: 10px 15px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
background: rgba(246, 247, 250, 1);
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.leftbox{
width: 250px;
height: calc(100vh - 200px);
border: 1px solid #e1e1e1;
border-radius: 4px;
}
</style>

View File

@ -1,158 +0,0 @@
<script lang="ts">
export default {
name: 'activity-school' //
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick } from "vue";
import { ElMessage, ElMessageBox, FormRules } from "element-plus";
import { querySchoolPage } from "@/api/regionmodule/school";
import { queryRegion } from "@/api/regionmodule/region";
import { publicTree } from '@/utils/validate';
const emit = defineEmits([ 'returnClick']);
const isSchool = ref(true)
function schoolClose(){
emit('returnClick', false);
}
const cascaderdata: any = ref([]);
const props1 = {
checkStrictly: true,
value:'id',
label:'name'
}
//
function getTree() {
const params = {
name: "",
status:'01'
};
queryRegion(params).then((res: any) => {
cascaderdata.value = publicTree(res.data,"");
})
.catch((error:any)=>{
})
}
//
function handleChange(value:any){
if(value != null && value.length != 0){
regionId.value = value[value.length -1]
for(let i=0;i<cascaderdata.value.length;i++){
if(regionId.value == cascaderdata.value[i].id){
regionType.value = cascaderdata.value[i].type
break
}
}
}else{
regionId.value = ""
regionType.value = ""
}
isCascader.value = false
setTimeout(()=>{
isCascader.value = true
},20)
getSchool()
}
function handleClick(data:any){
regionType.value = data.type
if(data.children == null){
isCascader.value = false
setTimeout(()=>{
isCascader.value = true
},20)
}
regionId.value = data.id
getSchool()
}
const queryInfo:any = ref({
name:""
}) //
const regionInfo:any = ref("")
const regionId:any = ref("")
const regionType:any = ref("")
const loading= ref(false)
const schoolData:any= ref([])
//
function getSchool() {
queryInfo.value.name = queryInfo.value.name.replace(/\s+/g, "");
let params = {
name: queryInfo.value.name,
regionId: regionId.value,
current: queryInfo.value.current,
size:queryInfo.value.size,
type:regionType.value
};
loading.value = true
querySchoolPage(params).then((res) => {
schoolData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
});
}
//
function bindingClick() {
ElMessageBox.confirm("确定关联已选择的学校吗?", "关联提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
emit('returnClick', multipleSelection.value);
});
}
const multipleSelection = ref([]);
function handleSelectionChange(val: any) {
multipleSelection.value = val;
}
getSchool()
onMounted(() => {
getTree()
getSchool()
});
const isCascader=ref(true)
</script>
<template>
<el-dialog v-model="isSchool" :before-close="schoolClose" :title="'选择关联学校'" draggable width="1000px">
<div style="padding:0 25px">
<el-row style="margin-bottom: 10px;width: calc(100%);">
<el-col :span="24" class="top-nav">
<div style="display: flex;">
<el-input v-model="queryInfo.name" placeholder="请输入学校名称" clearable style="width: 200px;margin-right: 10px;"
@keyup.enter="getSchool" />
<div style="width: 200px;height: 32px; margin: auto;">
<el-cascader v-if="isCascader" style="width: 200px; margin: auto;" placeholder="请输入行政区域" v-model="regionInfo" @change="handleChange" clearable="" :options="cascaderdata" :props="props1" :show-all-levels="false" filterable>
<template #default="{ node, data }">
<div @click.stop="handleClick(data)">{{ data.name }}</div>
</template>
</el-cascader>
</div>
<el-button type="primary" style="margin-left: 10px;" @click="getSchool">搜索</el-button>
</div>
<div class="left-nav">
<el-button type="primary" @click="bindingClick">确定</el-button>
</div>
</el-col>
</el-row>
<el-table v-loading="loading" :data="schoolData" style="width: 100%; height:calc(100vh - 245px);" row-key="id" border
default-expand-all :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="code" label="学校代码" width="140" align="center"></el-table-column>
<el-table-column prop="name" label="学校名称" width="160"></el-table-column>
<el-table-column prop="address" label="学校地址" min-width="120" align="center"></el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getSchool" />
</div>
</el-dialog>
</template>
<style scoped lang="scss">
.top-nav {
display: -webkit-flex;
display: flex;
justify-content: space-between;
-webkit-justify-content: space-between;
}
</style>

View File

@ -1,585 +0,0 @@
<script lang="ts">
export default {
name: 'infomation' ,//
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick,watch } from "vue";
import { ElMessage, ElMessageBox, FormRules } from "element-plus";
import Page from '@/components/Pagination/page.vue';
import { queryAppNewsPage,addAppNews,updateAppNews,delAppNews,updateAppNewsStatus } from '@/api/appmanage'
import { useDark } from '@vueuse/core'
import tinymce from 'tinymce/tinymce'
import 'tinymce/themes/silver'
import 'tinymce/models/dom/model'
import 'tinymce/icons/default/icons'
import "tinymce/themes/silver/theme.min.js";
import 'tinymce/plugins/image'//
import 'tinymce/plugins/media'//
import 'tinymce/plugins/table'//
import 'tinymce/plugins/lists'//
import 'tinymce/plugins/wordcount'//
import 'tinymce/plugins/advlist'//
import 'tinymce/plugins/autosave'//
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const produrl = ref('')
const initlist = ref( {
selector: 'textarea',
language_url: produrl.value + '/tinymce/langs/zh_CN.js',
language: 'zh_CN',
skin_url: produrl.value +'/tinymce/skins/ui/oxide',
content_css: produrl.value +'/tinymce/skins/content/default/content.css',
height:450, //
body_class: 'panel-body',
toolbar: 'fontfamily fontsize lineheight bold italic underline strikethrough forecolor | outdent indent alignleft aligncenter alignright alignjustify bullist numlist',
menubar: false,
plugins: 'advlist autosave lists table wordcount',
end_container_on_empty_block: true,
powerpaste_word_import: 'clean',
code_dialog_height: 450,
code_dialog_width: 1000,
advlist_bullet_styles: 'square',
advlist_number_styles: 'default',
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
default_link_target: '_blank',
link_title: false,
font_size_formats: '12px 14px 16px 18px 20px 24px 28px 30px 36px 40px 48px',
font_family_formats: '微软雅黑=微软雅黑;宋体=宋体;黑体=黑体;',
nonbreaking_force_tab: true,
convert_urls: false,
branding: false,
// images_upload_url: url + '/api/imageserver/upload',
// images_upload_base_path: url
})
let isDark:any = useDark().value == true? '1' : '2'
watch(useDark(), () => {
isDark = useDark().value == true? '1' : '2'
if (useDark().value == true) {
initlist.value.skin_url= produrl.value +'/tinymce/skins/ui/oxide-dark'
} else {
initlist.value.skin_url= produrl.value +'/tinymce/skins/ui/oxide'
}
})
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
//
const title = ref('')
const tableData:any = ref([])
const multipleSelection = ref([])
const dialogVisible = ref(false)
const dialogVisibles = ref(false)
const dialogtitle = ref('新增资讯')
const forms:any = ref({})
const form = ref();
const rules = reactive<FormRules>({
title: [{ required: true, message: "请输入资讯名称", trigger: "blur" }],
type: [{ required: true, message: "请选择资讯类型", trigger: "change" }]
});
const isSwitch = ref(false)
const typeoptions = ref([{label:'知识',value:'01'},{label:'新闻',value:'02'}])
const handleSelectionChange = (val:any) => {
multipleSelection.value = val
}
const content = ref('')
const coverimg:any = ref({})
const fileList:any = ref([])
const loading = ref(false)
watch(dialogVisible,()=>{
if(dialogVisible.value){
nextTick(()=>{
if (isDark === '1') {
initlist.value.skin_url= produrl.value +'/tinymce/skins/ui/oxide-dark'
} else {
initlist.value.skin_url= produrl.value +'/tinymce/skins/ui/oxide'
}
tinymce.init(initlist.value)
if(forms.value.content!==''){
if(tinymce.activeEditor) {
content.value = forms.value.content
tinymce.activeEditor.setContent(forms.value.content)
}
}
})
}else{
tinymce.remove()
}
})
onMounted(() => {
getData();
if(import.meta.env.VITE_USER_NODE_ENV !== 'development'){
produrl.value = '/web'
initlist.value.language_url = produrl.value + '/tinymce/langs/zh_CN.js'
initlist.value.content_css = produrl.value +'/tinymce/skins/content/default/content.css'
}else{
produrl.value = ''
initlist.value.language_url = produrl.value + '/tinymce/langs/zh_CN.js'
initlist.value.content_css = produrl.value +'/tinymce/skins/content/default/content.css'
}
});
//
function getData(){
const params = {
current: queryInfo.value.current,
size:queryInfo.value.size,
title:title.value
}
loading.value = true
queryAppNewsPage(params).then((res:any) => {
tableData.value = res.data.records
queryInfo.value.total = res.data.total
loading.value = false
})
}
function delinfos() {
ElMessageBox.confirm("确定删除此资讯吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
loading.value = true
let id = [] as any[];
multipleSelection.value.forEach((item: any) => {
id.push(item.id)
})
let params = {
ids: id.join(','),
};
delAppNews(params).then(() => {
getData();
ElMessage({
message: "删除成功",
type: "success",
});
loading.value = false
});
});
}
//
function editinfo(row:any){
isSwitch.value = false
dialogtitle.value = '修改资讯'
forms.value = JSON.parse(JSON.stringify(row))
if(row.news_files!==undefined && row.news_files!==''){
forms.value.coverimg = url+'/appnews/'+ row.news_files
}else{
forms.value.coverimg = ''
coverimg.value = {}
}
if(row.news_video!==undefined && row.news_video!==''){
fileList.value = [{name:row.news_video}]
}else{
fileList.value = []
}
dialogVisible.value = true
}
//
function releaseClick(row:any,statustype:any){
const status = statustype === '02'?'发布':'撤销'
ElMessageBox.confirm('确定'+ status +'此资讯吗?', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
loading.value = true
const params = {
id:row.id,
newsStatus:statustype
}
updateAppNewsStatus(params).then(() => {
getData();
ElMessage({
message: statustype === '02'?'发布成功':'撤销成功',
type: "success",
});
loading.value = false
})
})
}
function switchchange(index:any,e:any){
loading.value = true
if(e === '1'){
let num = 0
for(let i = 0;i<tableData.value.length;i++){
if(tableData.value[i].recommend === '1'){
num = num + 1
}
}
if (num <= 3) {
switchsubmit( tableData.value[index].id,'1')
} else {
ElMessage({
message: "推荐内容不能超过三条",
type: "warning",
});
tableData.value[index].recommend = '0'
loading.value = false
}
} else {
switchsubmit( tableData.value[index].id,'0')
}
}
function switchsubmit(id:any,status:any){
const params = {
id:id,
recommend:status
}
updateAppNews(params).then((res:any) => {
getData()
// ElMessage({
// message: '',
// type: "success",
// });
loading.value = false
})
}
function addinfo(){
content.value = ''
forms.value={}
fileList.value = []
isSwitch.value = false
dialogtitle.value = '新增资讯'
dialogVisible.value = true
if (form.value != null) form.value.resetFields();
}
//
function delinfo(row: any) {
ElMessageBox.confirm("确定删除此资讯吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
loading.value = true
let params = {
ids: row.id,
};
delAppNews(params).then(() => {
getData();
ElMessage({
message: "删除成功",
type: "success",
});
loading.value = false
});
});
}
function handleClose(){
if (form.value != null) form.value.resetFields();
dialogVisible.value = false
}
function infosubmit(formEl: any){
formEl.validate((valid: any) => {
if (valid) {
if(isSwitch.value == true){
return
}
loading.value = true
isSwitch.value = true
if(forms.value.id) {
const formData = new FormData();
if(coverimg.value !== ''&& coverimg.value.raw !== undefined){
formData.append("image",coverimg.value.raw)
}
if(fileList.value.length !== 0 && fileList.value[0].raw !== undefined){
formData.append("multipartFile",fileList.value[0].raw)
formData.append("newsVideo",'')
}
formData.append("newsVideo",forms.value.news_video)
formData.append("newsFiles",forms.value.news_files)
formData.append("id",forms.value.id)
formData.append("newsStatus",forms.value.news_status)
formData.append("title",forms.value.title)
formData.append("type",forms.value.type)
if(tinymce.activeEditor) {
content.value = tinymce.activeEditor.getContent()
}else{
formData.append("content",'')
}
if(content.value !== ''){
formData.append("content",content.value)
}else{
formData.append("content",'')
}
formData.append("recommend",forms.value.recommend)
updateAppNews(formData).then((res:any) => {
dialogVisible.value = false
getData();
ElMessage({
message: "修改成功",
type: "success",
})
isSwitch.value = false
loading.value = false
}).catch(()=>{
isSwitch.value = false
loading.value = false
})
} else {
const formData = new FormData();
if(coverimg.value !== '' && coverimg.value.raw !== undefined){
formData.append("image",coverimg.value.raw)
}
if(fileList.value.length !== 0 && fileList.value[0].raw !== undefined){
formData.append("multipartFile",fileList.value[0].raw)
}
formData.append("newsStatus",'01')
formData.append("title",forms.value.title)
formData.append("type",forms.value.type)
if(tinymce.activeEditor) {
content.value = tinymce.activeEditor.getContent()
}
if(content.value !== ''){
formData.append("content",content.value)
}
formData.append("recommend",'0')
addAppNews(formData).then((res:any) => {
dialogVisible.value = false
getData();
ElMessage({
message: "新增成功",
type: "success",
});
isSwitch.value = false
loading.value = false
}).catch(()=>{
isSwitch.value = false
loading.value = false
})
}
}
})
}
function uploadChange(file:any){
forms.value.coverimg = URL.createObjectURL(file.raw)
coverimg.value = file
}
function delcoverimg(){
coverimg.value = ''
forms.value.coverimg = ''
forms.value.news_files = ''
}
function handlefilechange(file:any){
fileList.value = []
fileList.value.push(file)
}
function handlefileremove(){
fileList.value = []
forms.value.news_video = ''
}
function lookmovie(){
dialogVisibles.value = true
}
function handleCloses(){
dialogVisibles.value = false
}
function dateFormat(row: any) { //
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
</script>
<template>
<div class="activitymanage-box">
<div class="activitymanage-box-top">
<div class="flex">
<el-input v-model="title" placeholder="请输入资讯标题" style="width:240px" clearable />
<el-button type="primary" class="ml-[10px]" @click="getData">搜索</el-button>
</div>
<div>
<el-button type="primary" @click="addinfo"><img src="@/assets/visionscreening/jscz_xz.png" alt="" style="margin-right: 4px;" >新增</el-button>
<el-button @click="delinfos" :disabled="multipleSelection.length <= 0" :type="multipleSelection.length > 0 ? 'primary' : ''">
<el-icon style="margin-right: 4px;" :color="multipleSelection.length <= 0?'#a8abb2':'#fff'"><Delete /></el-icon> </el-button>
</div>
</div>
<div v-loading="loading" class="visionscreening-box-bottom">
<el-table :data="tableData" border style="width: 100%; height:calc(100vh - 280px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<el-table-column prop="title" label="资讯标题" />
<el-table-column prop="type" label="资讯类型" width="100">
<template #default="scope">
<span v-if="scope.row.type === '01'">知识</span>
<span v-else-if="scope.row.type === '02'">新闻</span>
</template>
</el-table-column>
<el-table-column label="状态" width="100">
<template #default="scope">
<span v-if="scope.row.news_status === '01'" style="color: #4099ff;">初始创建</span>
<span v-else-if="scope.row.news_status === '02'" style="color: #009966;">已发布</span>
<span v-else-if="scope.row.news_status === '03'" style="color: #FF9900;">撤销</span>
</template>
</el-table-column>
<el-table-column prop="recommend" label="是否推荐" width="120">
<template #default="scope">
<el-switch v-model="scope.row.recommend" active-value="1" inactive-value="0" :active-text="scope.row.recommend === '1'?'推荐':'普通'" @change="switchchange(scope.$index,$event)"/>
</template>
</el-table-column>
<el-table-column prop="create_user" label="上传人" width="200" />
<el-table-column prop="create_time" label="登录时间" width="200">
<template #default="scope">
{{ dateFormat(scope.row.create_time) }}
</template>
</el-table-column>
<el-table-column label="操作" width="100" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img v-if="scope.row.news_status =='01' || scope.row.news_status =='03'" src="@/assets/appmanage/release.png" alt="" title="发布" @click="releaseClick(scope.row,'02')" style="cursor: pointer;">
<img v-if="scope.row.news_status =='02'" src="@/assets/appmanage/return.png" alt="" title="撤销" @click="releaseClick(scope.row,'03')" style="cursor: pointer;">
<img src="@/assets/MenuIcon/lbcz_xg.png" alt="" title="修改" @click="editinfo(scope.row)" style="cursor: pointer;">
<img src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delinfo(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
</div>
<el-dialog v-model="dialogVisible" :close-on-click-modal="false" :title="dialogtitle" :before-close="handleClose" width="50%" draggable append-to-body>
<el-form ref="form" :model="forms" :rules="rules" label-width="90px">
<div class="flex" >
<div style="width:calc(100% - 100px);margin-right:10px ;">
<el-form-item label="资讯名称" prop="title" style="width: 100%">
<el-input v-model="forms.title" autocomplete="off" placeholder="请输入咨询名称" />
</el-form-item>
<el-form-item label="上传视频" style="width: 100%;display: flex;">
<el-upload accept=".mp4" ref="upload" class="upload-demo" action="" :on-change="handlefilechange" :on-remove="handlefileremove" :auto-upload="false" :file-list="fileList" style="width: calc(100% - 70px);position:relative">
<template #trigger>
<el-button type="primary">点击上传</el-button>
</template>
</el-upload>
<div v-if="forms.news_video" class="videostyle" @click.stop="lookmovie">查看视频</div>
</el-form-item>
</div>
<div style="width:100px;">
<el-upload class="avatar-uploader" accept=".png, .jpg, .jpeg" action="" :show-file-list="false" :auto-upload="false" @change="uploadChange" >
<div style="width: 100px;height: 100px;position: relative;" v-if="forms.coverimg">
<img :src="forms.coverimg" class="avatar" />
<div style="position: absolute;top: 0px;left: 0px;z-index: 1;width: 100px;height: 100px;background: rgba(0,0,0,0.3);color: cornflowerblue;">
<el-icon style="position: absolute;top: 40px;left: 40px;z-index: 1;font-size: 20px;"
@click.stop="delcoverimg"><Delete /></el-icon>
</div>
</div>
<div v-else style="text-align: center;">
<el-icon class="newavatar-uploader-icon"><Plus /></el-icon>
<div class="newavatar-uploader-text">上传封面</div>
</div>
</el-upload>
</div>
</div>
<el-form-item label="资讯类型" prop="type" style="width: 100%">
<el-select v-model="forms.type" placeholder="请选择活动类型" >
<el-option v-for="item in typeoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="资讯内容">
<textarea v-model="content" :init="initlist" style="width: 100%;background: transparent;"></textarea>
</el-form-item>
</el-form>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="infosubmit(form)">确定</el-button>
</span>
</el-dialog>
<el-dialog v-model="dialogVisibles" :close-on-click-modal="false" title="查看视频" :before-close="handleCloses" width="60%" draggable append-to-body>
<video ref="videoRef" :src="url + '/app/app-news/viewAppNewsFile?fileName='+ forms.news_video" style="width:100%" height="400" autoplay controls></video>
<span class="dialog-footer mt-[20px]">
<el-button type="primary" @click="handleCloses">关闭</el-button>
</span>
</el-dialog>
</template>
<style scoped lang="scss">
.activitymanage-box {
height: calc(100vh - 130px);
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
padding: 20px;
.activitymanage-box-top{
width:100%;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}
}
.dialog-footer {
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
:deep(.el-tree-node__content){
height: 30px;
}
:deep(.el-input__inner){
height: 32px;
font-size:14px;
}
// :deep(.el-upload-list){
// display: none;
// }
.lefttitle {
min-width: 150px;
display: flex;
align-items: center;
padding: 10px 15px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
background: rgba(246, 247, 250, 1);
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.leftbox{
width: 250px;
height: calc(100vh - 200px);
border: 1px solid #e1e1e1;
border-radius: 4px;
}
.tox .tox-tbtn--bespoke+.tox-tbtn--bespoke{
width:100% !important;
}
.videostyle{
padding-top: 5px;
background: url('../../assets/appmanage/movie.png') no-repeat;
background-position: 0px 13px;
padding-left: 18px;
position: absolute;
right: 0px;
bottom: 6px;
}
.videostyle:hover{
color: #4099ff;
cursor: pointer;
}
</style>

View File

@ -1,279 +0,0 @@
<script lang="ts">
export default {
name: 'interaction' //
};
</script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import Page from '@/components/Pagination/page.vue';
import {queryAppQuestionAnswerPage,updateAppQuestionAnswer} from '@/api/appmanage'
import { ElMessage} from "element-plus";
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
const searchval = ref('')
const dialogVisible = ref(false)
const chooseinfo:any = ref({})
const textarea = ref('')
const contentdata:any = ref([])
const contentdatas:any = ref([])
const isSwitch = ref(false)
onMounted(() => {
getData();
getunData()
});
//
function getData(){
const params:any = {
current: queryInfo.value.current,
size:queryInfo.value.size,
status:'02',
name:searchval.value
}
if(userStore.institutionId !=null&&userStore.institutionId !=''){
params.institutionId = userStore.institutionId
}
queryAppQuestionAnswerPage(params).then((res:any) => {
contentdata.value = res.data.records
queryInfo.value.total = res.data.total
})
}
function getunData(){
const params:any = {
current: queryInfo.value.current,
size:9999,
status:'01',
}
if(userStore.institutionId !=null&&userStore.institutionId !=''){
params.institutionId = userStore.institutionId
}
queryAppQuestionAnswerPage(params).then((res:any) => {
contentdatas.value = res.data.records
queryInfo.value.total = res.data.total
})
}
//
function answerclick(val:any){
isSwitch.value = false
chooseinfo.value = val
dialogVisible.value = true
}
function handleClose(){
dialogVisible.value = false
}
//
function answersubmit(){
if(isSwitch.value == true){
return
}
isSwitch.value = true
const params = chooseinfo.value
params.answer = textarea.value
params.questionStatus = '02'
updateAppQuestionAnswer(params).then((res:any) => {
ElMessage({
message: "回答成功",
type: "success",
});
getData()
getunData()
dialogVisible.value = false
isSwitch.value = false
})
}
function dateFormat(row: any) { //
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
</script>
<template>
<div class="interaction-box">
<div class="interaction-box-left">
<div class="box-left-top">
<el-input v-model="searchval" placeholder="请输入关键字" style="width:240px" clearable />
<el-button type="primary" class="ml-[10px]" @click="getData">搜索</el-button>
</div>
<div class="box-left-bottom">
<div class="problem-box" v-for="(item,index) in contentdata" :key="index">
<div class="problem-text">{{ item.question }}</div>
<div class="answer-text">{{ item.answer }}</div>
<div class="flex">
<div class="tel-text">{{ item.mobile }}</div>
<div class="time-text">{{ dateFormat(item.answer_time) }}</div>
</div>
</div>
</div>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
<div class="interaction-box-right">
<div class="box-right-top">
<div class="unproblem-title">未解决问题</div>
<div class="unproblem-line"></div>
</div>
<div class="box-right-bottom">
<div class="problem-box mt-[18px]" v-for="(items,indexs) in contentdatas" :key="indexs">
<div class="problem-text">{{ items.question }}</div>
<div class="flex mt-[5px] items-center justify-between">
<div class="flex">
<div class="tel-text">{{ items.mobile }}</div>
<div class="time-text">{{ dateFormat(items.question_time) }}</div>
</div>
<div>
<div class="answer-button" @click="answerclick(items)">回答</div>
</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog v-model="dialogVisible" :close-on-click-modal="false" title="回答" :before-close="handleClose" width="40%" draggable append-to-body>
<div>
<div class="dialog-title">{{chooseinfo.question}}</div>
<el-input v-model="textarea" :autosize="{ minRows: 18 }" type="textarea" class="mb-[20px]"/>
</div>
<span class="dialog-footer flex justify-end">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="answersubmit">确定</el-button>
</span>
</el-dialog>
</template>
<style scoped lang="scss">
.interaction-box{
width: 100%;
display: flex;
height: calc(100vh - 130px);
.interaction-box-left{
width: 70%;
height: 100%;
background: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 0.498039215686275);
padding: 20px;
.box-left-top{
height: 50px;
}
.box-left-bottom{
height: calc(100vh - 270px);
overflow: auto;
}
}
.interaction-box-right{
width: 30%;
height: 100%;
margin-left: 15px;
background: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 0.498039215686275);
padding: 20px;
.box-right-top{
border-bottom: 1px solid #ececec;
position: relative;
.unproblem-title{
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
padding-bottom: 13px;
}
.unproblem-line{
height: 3px;
width: 84px;
background: #4099ff;
position: absolute;
bottom:-2px;
}
}
.box-right-bottom{
height: calc(100vh - 205px);
overflow: auto;
}
}
}
.problem-text{
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #363636;
line-height: 24px;
padding-bottom: 10px;
background: url('../../assets/appmanage/Q.png') no-repeat;
padding-left: 30px;
background-position: 2px 4px;
min-height: 20px;
}
.answer-text{
font-style: normal;
font-size: 14px;
color: #363636;
line-height: 24px;
padding-bottom: 10px;
background: url('../../assets/appmanage/A.png') no-repeat;
padding-left: 30px;
background-position: 2px 2px;
min-height: 30px;
}
.tel-text{
font-weight: 400;
font-style: normal;
font-size: 14px;
color: #949494;
background: url('../../assets/appmanage/tel.png') no-repeat;
padding-left: 25px;
background-position: 2px 3px;
}
.time-text{
font-weight: 400;
font-style: normal;
font-size: 14px;
color: #949494;
background: url('../../assets/appmanage/time.png') no-repeat;
padding-left: 25px;
background-position: 2px 3px;
margin-left: 35px;
}
.problem-box{
padding-bottom: 15px;
border-bottom: 1px solid #ececec;
margin-bottom: 20px;
}
.answer-button{
width: 50px;
height: 30px;
line-height: 30px;
background: inherit;
background-color: rgba(255, 153, 0, 1);
color: #fff;
border-radius: 5px;
font-size: 12px;
text-align: center;
cursor: pointer;
}
.dialog-title{
font-weight: 700;
font-style: normal;
font-size: 18px;
color: #363636;
line-height: 24px;
background: url('../../assets/appmanage/Q.png') no-repeat;
padding-left: 30px;
background-position: 2px 4px;
margin-bottom: 30px;
}
</style>

View File

@ -1,268 +0,0 @@
<script lang="ts">
export default {
name: 'loginlog' //
};
</script>
<script setup lang="ts">
import { onMounted,ref } from "vue";
import Page from '@/components/Pagination/page.vue';
import {queryAppUserLogsPage,queryAppUserHistoryLogsPage,exportUserLogData} from '@/api/appmanage'
import { downloadFile } from '@/utils/index'
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
//
const mobile = ref('')
const logintime = ref('')
const loading = ref(false)
const tableData:any = ref([])
onMounted(() => {
getData();
});
//
function getData(){
const params = {
current: queryInfo.value.current,
size:queryInfo.value.size,
mobile:mobile.value,
startVisionLeft:queryInfo.value.startVisionLeft,
endVisionLeft:queryInfo.value.endVisionLeft,
startVisionRight:queryInfo.value.startVisionRight,
endVisionRight:queryInfo.value.endVisionRight,
startDate:'',
endDate:''
}
loading.value = true
if( logintime.value !== null && logintime.value !== ''){
params.startDate =logintime.value[0]
params.endDate = logintime.value[1]
}
queryAppUserLogsPage(params).then((res:any) => {
tableData.value = res.data.records
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
})
}
//
function reset(){
logintime.value = ''
mobile.value = ''
const params = {
current: queryInfo.value.current,
size:queryInfo.value.size,
}
loading.value = true
queryAppUserLogsPage(params).then((res:any) => {
tableData.value = res.data.records
queryInfo.value.total = res.data.total
loading.value = false
})
}
function dateFormat(row: any) { //
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
const dialogLogVisible = ref(false)
const loginInfo:any =ref({
total:0,
size:10,
current:1,
mobile:""
})
function viewLoding(row:any){
loginInfo.value = {
total:0,
size:20,
current:1,
mobile:row.mobile
}
dialogLogVisible.value = true
getLoding()
}
const historyData:any = ref([])
function getLoding(){
const params = {
current: loginInfo.value.current,
size:loginInfo.value.size,
mobile:loginInfo.value.mobile
}
queryAppUserHistoryLogsPage(params).then((res:any) => {
historyData.value = res.data.records
loginInfo.value.total = res.data.total
}).catch(()=>{
})
}
function handleClose(){
dialogLogVisible.value =false
}
function exportOut(){
let params = {
mobile:mobile.value,
startVisionLeft:queryInfo.value.startVisionLeft,
endVisionLeft:queryInfo.value.endVisionLeft,
startVisionRight:queryInfo.value.startVisionRight,
endVisionRight:queryInfo.value.endVisionRight,
startDate:'',
endDate:''
};
if( logintime.value !== null && logintime.value !== ''){
params.startDate =logintime.value[0]
params.endDate = logintime.value[1]
}
exportUserLogData(params).then((response: any) => {
downloadFile(response, 'APP程序-学生信息查询记录', 'xlsx')
});
}
</script>
<template>
<div class="activitymanage-box">
<div class="activitymanage-box-top">
<div class="flex">
<el-input v-model="mobile" placeholder="请输入手机号" style="width:240px" clearable />
<el-date-picker v-model="logintime" style="margin-left: 10px;height: 34px;" type="daterange" start-placeholder="开始时间" end-placeholder="结束时间" value-format="YYYY-MM-DD"/>
<div style="display:flex;align-items: center;padding-left: 10px;">
<div style="color:#909399;font-size: 14px;padding-right: 10px;">左眼裸眼视力:</div>
<el-input v-model="queryInfo.startVisionLeft" placeholder="起始值" style="width: 90px;" clearable />
<span>&nbsp;-&nbsp;</span>
<el-input v-model="queryInfo.endVisionLeft" placeholder="结束值" style="width: 90px;" clearable />
</div>
<div style="display:flex;align-items: center;padding-left: 10px;">
<div style="color:#909399;font-size: 14px;padding-right: 10px;">右眼裸眼视力:</div>
<el-input v-model="queryInfo.startVisionRight" placeholder="起始值" style="width: 90px;" clearable />
<span>&nbsp;-&nbsp;</span>
<el-input v-model="queryInfo.endVisionRight" placeholder="结束值" style="width: 90px;" clearable />
</div>
<el-button type="primary" class="ml-[10px]" @click="getData">搜索</el-button>
<el-button @click="reset">重置</el-button>
<el-button type="primary" @click="exportOut">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div v-loading="loading" class="visionscreening-box-bottom">
<el-table :data="tableData" border style="width: 100%; height:calc(100vh - 280px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="mobile" label="手机号" min-width="200" />
<el-table-column prop="student_name" label="学生姓名" min-width="100" />
<el-table-column prop="log_time" label="操作时间" width="200">
<template #default="scope">
{{ dateFormat(scope.row.log_time) }}
</template>
</el-table-column>
<el-table-column label="操作" width="80" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/tableicon/u886.png" alt="" title="查看" @click="viewLoding(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
<el-dialog v-model="dialogLogVisible" :close-on-click-modal="false" title="查看记录" :before-close="handleClose" width="1280px" draggable append-to-body>
<el-table :data="historyData" border style="width: 100%; height:calc(100vh - 280px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="mobile" label="手机号" width="200" />
<el-table-column prop="student_name" label="学生姓名" width="100" />
<el-table-column label="裸眼视力" width="120" >
<template #default="scope">
<span>{{scope.row.vision_left}},{{scope.row.vision_right}}</span>
</template>
</el-table-column>
<el-table-column label="操作类型" width="100" >
<template #default="scope">
<span v-if="scope.row.opttype === '01'">登录</span>
<span v-else-if="scope.row.opttype === '02'">关联学生</span>
<span v-else-if="scope.row.opttype === '03'">查询视力</span>
</template>
</el-table-column>
<el-table-column prop="description" label="操作描述" />
<el-table-column prop="log_time" label="操作时间" width="200">
<template #default="scope">
{{ dateFormat(scope.row.log_time) }}
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="loginInfo.total" v-model:size="loginInfo.size" v-model:current="loginInfo.current"
@pagination="getLoding" />
</el-dialog>
</div>
</template>
<style scoped lang="scss">
.activitymanage-box {
height: calc(100vh - 130px);
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
padding: 20px;
.activitymanage-box-top{
width:100%;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}
}
.dialog-footer {
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
:deep(.el-tree-node__content){
height: 30px;
}
:deep(.el-input__inner){
height: 32px;
font-size:14px;
}
.lefttitle {
min-width: 150px;
display: flex;
align-items: center;
padding: 10px 15px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
background: rgba(246, 247, 250, 1);
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.leftbox{
width: 250px;
height: calc(100vh - 200px);
border: 1px solid #e1e1e1;
border-radius: 4px;
}
</style>

View File

@ -1,743 +0,0 @@
<script lang="ts">
export default {
name: 'datacontrast' //
};
</script>
<script setup lang="ts">
import { onMounted, ref, nextTick,watch } from "vue";
import { useDark } from '@vueuse/core'
import { ElMessage, ElMessageBox, ElTree,ElTable,TabsPaneContext} from "element-plus";
import * as echarts from 'echarts'
import { queryRegionSchool } from "@/api/regionmodule/school";
import { querySchoolIdExamineList } from "@/api/planscreening";
import { publicTree } from '@/utils/validate';
const planYearData:any =ref([{name:'2023-1'},{name:'2023-2'},{name:'2024-1'},{name:'2024-2'},{name:'2025-1'},{name:'2025-2'}])
const planYear:any = ref("")
function planYearChange(e:any){
getData()
}
const istabshow = ref(true)
const loading = ref(false)
const sortstatus = ref(0)
const option = ref({
title: {
text: '朝阳区2023年第一学期第一次普检',
left: 'center',
textStyle:{
color:'#000'
}
},
tooltip: {
trigger: 'item'
},
legend: {
orient: 'horizontal',
left: 'center',
bottom: '2%',
textStyle:{
fontSize :18,
color:'#787878'
},
icon: 'circle',
itemWidth: 10,
itemHeight: 10,
itemGap: 10,
padding: [0, 100]
},
color:['#6395fa','#f7c122','#63daab','#7666fa', '#8babd8','#75cbed'],
series: [
{
name: '',
type: 'pie',
radius: '60%',
top:'-10%',
data: [
{ value: 1048, name: '小学一年级'},
{ value: 735, name: '小学二年级' },
{ value: 580, name: '小学三年级' },
{ value: 484, name: '小学四年级' },
{ value: 300, name: '小学五年级' },
{ value: 300, name: '小学六年级' },
],
label: {
normal: {
color:'#000000',
formatter: '{c}',
},
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
borderColor:'#000',
borderWidth:0.5
}
}
}
]
})
const option2 = ref({
title: {
text: '朝阳区2023年第一学期第一次普检',
left: 'center',
textStyle:{
color:'#000'
}
},
tooltip: {
trigger: 'item'
},
legend: {
orient: 'horizontal',
left: 'center',
bottom: '2%',
textStyle:{
fontSize :18,
color:'#787878'
},
icon: 'circle',
itemWidth: 10,
itemHeight: 10,
itemGap: 10,
padding: [0, 100]
},
color:['#6395fa','#f7c122','#63daab','#7666fa', '#8babd8','#75cbed'],
series: [
{
name: '',
type: 'pie',
radius: '60%',
top:'-10%',
data: [
{ value: 1048, name: '小学一年级' },
{ value: 735, name: '小学二年级' },
{ value: 580, name: '小学三年级' },
{ value: 484, name: '小学四年级' },
{ value: 300, name: '小学五年级' },
{ value: 300, name: '小学六年级' },
],
label: {
normal: {
color:'#000000',
formatter: '{c}',
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
borderColor:'#000',
borderWidth:0.5
}
}
}
]
})
const option3 = ref({
title: {
text: '朝阳区2023年第一学期第一次普检',
left: 'center',
textStyle:{
color:'#000'
}
},
tooltip: {
trigger: 'item'
},
grid:{
top:'0%',
containLabel: true
},
legend: {
orient: 'horizontal',
left: 'center',
bottom: '2%',
textStyle:{
fontSize :18,
color:'#787878'
},
icon: 'circle',
itemWidth: 10,
itemHeight: 10,
itemGap: 10,
padding: [0, 100]
},
color:['#6395fa','#f7c122','#63daab','#7666fa', '#8babd8','#75cbed'],
series: [
{
name: '',
type: 'pie',
radius: '60%',
top:'-10%',
data: [
{ value: 1048, name: '小学一年级' },
{ value: 735, name: '小学二年级' },
{ value: 580, name: '小学三年级' },
{ value: 484, name: '小学四年级' },
{ value: 300, name: '小学五年级' },
{ value: 300, name: '小学六年级' },
],
label: {
normal: {
color:'#000000',
formatter: '{c}',
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
borderColor:'#000',
borderWidth:0.5
}
}
}
]
})
let isDark:any = useDark().value == true? '1' : '2'
watch(useDark(), () => {
isDark = useDark().value == true? '1' : '2'
if (useDark().value == true) {
facechange('1')
} else {
facechange('2')
}
})
const showecharts1= ref(false)
const showecharts2= ref(false)
const showecharts3= ref(false)
//
const treeData: any = ref([]);
const treeloading = ref(false)
const defaultProps = { label: "name" }
const treeRef = ref<InstanceType<typeof ElTree>>()
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
let activeName = ref('近视统计')
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
onMounted(() => {
getTree()
});
//tab
const handleClick = (tab: TabsPaneContext, event: Event) => {
sortstatus.value = 0
istabshow.value = true
loadecharts()
}
const schoolId = ref("")
//
const handleNodeClick = (data: Tree) => {
if(data.org_type == null){
nextTick(() => {
treeRef.value?.setCurrentKey(schoolId.value);
});
}else{
schoolId.value = data.id
treeRef.value?.setCurrentKey(data.id);
getData()
}
showecharts1.value = false
showecharts2.value = false
showecharts3.value = false
checkedCities.value = []
};
//
let myChart1:any = ref()
let myChart2:any = ref()
let myChart3:any = ref()
const checkdata:any = ref([])
//
function loadecharts(){
if (isDark === '1') {
facechange('1')
}else{
facechange('2')
}
loading.value = true
showecharts1.value = false
showecharts2.value = false
showecharts3.value = false
let nums = 0
checkdata.value = []
if (checkedCities.value.length === 1) {
showecharts1.value = true
showecharts2.value = false
showecharts3.value = false
setTimeout(()=>{
if (myChart1.value) {
myChart1.value.dispose()
}
const chartEle: HTMLElement = document.getElementById('echarts1') as HTMLElement;
myChart1.value = echarts.init(chartEle);
option.value.title.text = checkedCities.value[0]
myChart1.value.setOption(option.value)
window.onresize = function () {
myChart1.value.resize()
}
},100)
} else if (checkedCities.value.length === 2) {
showecharts1.value = true
showecharts2.value = true
showecharts3.value = false
setTimeout(()=>{
if (myChart1.value) {
myChart1.value.dispose()
}
if (myChart2.value) {
myChart2.value.dispose()
}
const chartEle: HTMLElement = document.getElementById('echarts1') as HTMLElement;
myChart1.value = echarts.init(chartEle);
const chartEle2: HTMLElement = document.getElementById('echarts2') as HTMLElement;
myChart2.value = echarts.init(chartEle2);
option.value.title.text = checkedCities.value[0]
option2.value.title.text = checkedCities.value[1]
myChart1.value.setOption(option.value)
myChart2.value.setOption(option2.value)
window.onresize = function () {
myChart1.value.resize()
myChart2.value.resize()
}
},100)
} else if(checkedCities.value.length === 3){
showecharts1.value = true
showecharts2.value = true
showecharts3.value = true
setTimeout(()=>{
if (myChart1.value) {
myChart1.value.dispose()
}
if (myChart2.value) {
myChart2.value.dispose()
}
if (myChart3.value) {
myChart3.value.dispose()
}
const chartEle: HTMLElement = document.getElementById('echarts1') as HTMLElement;
myChart1.value = echarts.init(chartEle);
const chartEle2: HTMLElement = document.getElementById('echarts2') as HTMLElement;
myChart2.value = echarts.init(chartEle2);
const chartEle3: HTMLElement = document.getElementById('echarts3') as HTMLElement;
myChart3.value = echarts.init(chartEle3);
option.value.title.text = checkedCities.value[0]
option2.value.title.text = checkedCities.value[1]
option3.value.title.text = checkedCities.value[2]
myChart1.value.setOption(option.value)
myChart2.value.setOption(option2.value)
myChart3.value.setOption(option3.value)
window.onresize = function () {
myChart1.value.resize()
myChart2.value.resize()
myChart3.value.resize()
}
},100)
}
loading.value = false
}
function facechange(type:any){
if (type === '1') {
option.value.title.textStyle.color="#ffffff"
option.value.legend.textStyle.color = '#ffffff'
option.value.series[0].label.normal.color = '#ffffff'
option2.value.title.textStyle.color="#ffffff"
option2.value.legend.textStyle.color = '#ffffff'
option2.value.series[0].label.normal.color = '#ffffff'
option3.value.title.textStyle.color="#ffffff"
option3.value.legend.textStyle.color = '#ffffff'
option3.value.series[0].label.normal.color = '#ffffff'
}else{
option.value.title.textStyle.color="#000"
option.value.legend.textStyle.color = '#000'
option.value.series[0].label.normal.color = '#000'
option2.value.title.textStyle.color="#000"
option2.value.legend.textStyle.color = '#000'
option2.value.series[0].label.normal.color = '#000'
option3.value.title.textStyle.color="#000"
option3.value.legend.textStyle.color = '#000'
option3.value.series[0].label.normal.color = '#000'
}
if (myChart1.value) {
myChart1.value.clear()
myChart1.value.setOption(option.value);
myChart1.value.resize()
}
if (myChart2.value) {
myChart2.value.clear()
myChart2.value.setOption(option2.value);
myChart2.value.resize()
}
if (myChart3.value) {
myChart3.value.clear()
myChart3.value.setOption(option3.value);
myChart3.value.resize()
}
}
const month:any = ref("")
function monthChange(e:any){
// getTableDate()
}
// function getCurrentMonthRange(date:any) {
// let startOfMonth = new Date(date);
// startOfMonth.setDate(1); // 1
// let endOfMonth = new Date();
// endOfMonth.setMonth(startOfMonth.getMonth() + 1); // 1
// endOfMonth.setDate(0); //
// return {
// start: dateFormat(startOfMonth),
// end: dateFormat(endOfMonth)
// };
// }
const treeLoading = ref(false)
const tempData:any = ref([])
function getTree(){
let params = {
status:'01',
name: "",
};
treeLoading.value = true
queryRegionSchool(params).then((res) => {
for(let i=0;i<res.data.length;i++){
if(res.data[i].org_type == "5"){
schoolId.value = res.data[i].id
break
}
}
tempData.value = JSON.parse(JSON.stringify(res.data))
treeData.value = publicTree(res.data,"")
if(schoolId.value != ""){
nextTick(() => {
treeRef.value?.setCurrentKey(schoolId.value);
getData();
});
}
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}
const planData:any = ref([])
const checkedCities:any = ref([]) //
function getData(){
let params = {
schoolId: schoolId.value,
planYear: planYear.value
};
querySchoolIdExamineList(params).then((res) => {
planData.value = res.data;
// treeLoading.value = false
}).catch(()=>{
// treeLoading.value = false
});
}
function planChange(e:any){
loadecharts()
}
</script>
<template>
<div class="contents-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div style="width:100%;padding: 5px 15px;">
<el-select v-model="planYear" placeholder="请选择计划年度" @change="planYearChange">
<el-option v-for="item in planYearData" :key="item.name" :label="item.name" :value="item.name"/>
</el-select>
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData" default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 260px); overflow: auto;margin-top: 10px;">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRights">
<div class="silderRight-top">
<div style="display: flex;flex-wrap:wrap;">
<el-checkbox-group
v-model="checkedCities"
@change="planChange"
>
<el-checkbox v-for="item in planData" :key="item.id" :label="item.id">{{
item.plan_name
}}</el-checkbox>
</el-checkbox-group>
<!-- <div v-for="(item,index) in checkinfo" :key="index" style="width:300px;height: 30px;">
<el-checkbox v-model="item.checked" @change="checkchange(index,$event)">{{item.plan_name}}</el-checkbox>
</div> -->
</div>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="height:calc(100vh - 325px);">
<el-tab-pane label="近视统计" name="近视统计">
<div v-loading="loading" class="tabcontent">
<div v-if="activeName === '近视统计'" class="tabcontent-box">
<div v-if="showecharts1" id="echarts1" style="width: 100%; height:100%;"></div>
</div>
<div v-if="activeName === '近视统计'" class="tabcontent-box">
<div v-if="showecharts2" id="echarts2" style="width: 100%; height:100%;"></div>
</div>
<div v-if="activeName === '近视统计'" class="tabcontent-box">
<div v-if="showecharts3" id="echarts3" style="width: 100%; height:100%;"></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="视力不良统计" name="视力不良统计">
<div v-loading="loading" class="tabcontent">
<div v-if="activeName === '视力不良统计'" class="tabcontent-box">
<div v-if="showecharts1" id="echarts1" style="width: 100%; height:100%;"></div>
</div>
<div v-if="activeName === '视力不良统计'" class="tabcontent-box">
<div v-if="showecharts2" id="echarts2" style="width: 100%; height:100%;"></div>
</div>
<div v-if="activeName === '视力不良统计'" class="tabcontent-box">
<div v-if="showecharts3" id="echarts3" style="width: 100%; height:100%;"></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="远视储备率统计" name="远视储备率统计">
<div v-loading="loading" class="tabcontent">
<div v-if="activeName === '远视储备率统计'" class="tabcontent-box">
<div v-if="showecharts1" id="echarts1" style="width: 100%; height:100%;"></div>
</div>
<div v-if="activeName === '远视储备率统计'" class="tabcontent-box">
<div v-if="showecharts2" id="echarts2" style="width: 100%; height:100%;"></div>
</div>
<div v-if="activeName === '远视储备率统计'" class="tabcontent-box">
<div v-if="showecharts3" id="echarts3" style="width: 100%; height:100%;"></div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<style scoped lang="scss">
.contents-box{
margin-top: 15px;
height: calc(100vh - 145px);
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
// :deep(){
// .el-input{
// height:40px;
// line-height: 40px;
// width: 240px;
// }
// .el-button{
// height:40px;
// }
// }
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRights {
flex: 1;
position: relative;
width: 100%;
// overflow: auto;
border-radius: 3px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
background: transparent;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(){
.el-button{
margin-left: 10px;
}
// .el-tree-node__content{
// height: 40px;
// padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
.el-tabs__item{
margin-right: 10px;
border: 1px solid #dfe4ee;
border-bottom: none;
padding: 0px 20px !important;
width: 130px;
height: 44px;
border-radius: 10px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
background-color: #e9ecf3;
font-size: 14px;
color: #606060;
}
.el-tabs__nav{
padding-left: 20px;
}
.el-tabs__active-bar{
display: none;
}
.el-tabs__item:hover{
color: #409eff;
}
.el-tabs__item.is-active{
color: #fff;
border: 1px solid #409eff;
background-color: #409eff;
}
.el-tabs__nav-wrap::after{
display: none;
}
.el-tabs__header{
margin: 0px;
}
}
.searchinfo{
display: flex;
align-items: center;
margin-bottom: 20px;
justify-content: space-between;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.tabcontent{
background-color: #fff;
height: calc(100vh - 384px);
border-radius: 5px;
padding: 20px;
width: 100%;
display: flex;
justify-content: space-between;
.tabcontent-box{
width: 33%;
}
}
.silderRight-top{
height: 180px;
background: #fff;
border-radius: 5px;
width:100%;
margin-bottom:15px;
padding: 15px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,394 +0,0 @@
<script lang="ts">
export default {
name: 'importdata' // -
};
</script>
<script setup lang="ts">
import { onMounted, ref, nextTick ,watch} from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable,ElTree} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import { schoolIdsPlanIdQueryStudent,exportExamineResultStudent,updateExamineResult } from "@/api/planscreening";
import { downloadFile } from '@/utils/index'
import { getToken } from '@/utils/auth'
import * as XLSX from 'xlsx';
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const tableRowClassName = ({
row,
rowIndex,
}: {
row: any
rowIndex: number
}) => {
if (row.is_sighted == 1) {
return 'is_sightedbg'
}
return ''
}
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const planSchoolInfo:any = ref({})
const checkList=ref([])
const tableData = ref([])
watch(
() => props.planInfo,
(newVal: any) => {
planSchoolInfo.value = newVal
checkList.value = []
tableData.value =[]
},
{ immediate: true }
);
const queryInfo :any = ref({
schoolId:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
})
const loading = ref(false)
//
onMounted(() => {
planSchoolInfo.value = props.planInfo
});
function download(){
let params = {
planId: planSchoolInfo.value.id,
schoolIds:checkList.value.join(',')
};
exportExamineResultStudent(params).then((response: any) => {
downloadFile(response,planSchoolInfo.value.plan_name+ '-学生基本信息', 'xlsx')
});
}
function checkchange(list:any){
let tempSchoolName = []
for(let i = 0;i<list.length;i++){
for(let j = 0;j<planSchoolInfo.value.schoolList.length;j++){
if(planSchoolInfo.value.schoolList[j].id == list[i]){
tempSchoolName.push(planSchoolInfo.value.schoolList[j].name)
}
}
}
schoolNames.value = tempSchoolName.join(",")
if(list.length != 0){
getData()
}else{
tableData.value =[]
}
}
function getData(){
let params = {
planId: planSchoolInfo.value.id,
schoolIds:checkList.value.join(','),
size:queryInfo.value.size,
current:queryInfo.value.current
}
schoolIdsPlanIdQueryStudent(params).then((res) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total;
}).catch(()=>{
});
}
function dateFormat(row: any) { //
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
const upload:any = ref(null)
const errorData:any = ref([])
const dialogTableVisible = ref(false)
function handlesSuccess(file: any) {
loading.value = false
if(file.code == "0"){
ElMessage({
message: "导入成功!",
type: "success",
});
getData()
}else{
errorData.value = []
let msg = file.msg.split("<br>")
msg.forEach(element => {
errorData.value.push({name:element})
});
dialogTableVisible.value = true
// ElMessage({
// message: file.msg,
// type: "error",
// });
}
upload.value.clearFiles()
}
const schoolNames:any = ref("")
function handleError(file: any){
loading.value = false
ElMessage({
message: "导入失败!",
type: "error",
});
upload.value.clearFiles()
}
function handlePreview(){
loadingtext.value = "正在导入数据,请耐心等待!"
loading.value = true
}
const loadingtext = ref("")
function exportToExcel() {
// DOM
const table = document.querySelector('.importdata_table_error');
// 使 html-to-xlsx
const ws = XLSX.utils.table_to_sheet(table);
//
const colWidths = [
{ wch: 5 },
{ wch: 70 },
];
ws['!cols'] = colWidths;
// 簿
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
// Excel
XLSX.writeFile(wb, '导入错误信息.xlsx');
};
</script>
<template>
<div class="importdata-box">
<div class="importdata-box-top">
<el-checkbox-group v-model="checkList" v-for="(item,index) in planSchoolInfo.schoolList" @change="checkchange">
<el-checkbox :value="item.id" :key="item.id" style="margin-right: 10px;">{{ item.name }}</el-checkbox>
</el-checkbox-group>
<!-- <div v-for="(item,index) in planSchoolInfo.schoolList" :key="index" style="margin-right: 10px;min-width: 150px;" >
<el-checkbox v-model="item.id" :label="item.name" />
</div> -->
</div>
<div class="importdata-box-bottom">
<div style="margin-bottom: 15px; display: flex;">
<el-button type="primary" @click="download" :disabled="checkList.length==0">
<img src="@/assets/tableicon/download.png" style="padding-right: 5px;" alt="">下载模板
</el-button>
<el-upload
:disabled="checkList.length==0"
ref="upload"
accept=".xlsx"
class="upload-demo"
:action=" url + '/vision_examine/examine-result/ImportExamineResultStudent/?planId=' + planSchoolInfo.id +'&schoolNames=' + schoolNames "
:headers="{ token: getToken() }"
:show-file-list="false"
:before-upload="handlePreview"
:on-success="handlesSuccess"
:on-error="handleError">
<el-button type="primary" :disabled="checkList.length==0" style="margin: 0 10px;"><img src="@/assets/MenuIcon/u455.png" alt="" style="margin-right: 5px;">导入数据</el-button>
</el-upload>
</div>
<el-table v-loading="loading" :element-loading-text="loadingtext" :data="tableData" border :row-class-name="tableRowClassName"
style="width: 100%; height:calc(100vh - 570px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column fixed type="index" width="55" label="序号" align="center" />
<el-table-column fixed prop="student_name" label="姓名" width="100" />
<el-table-column prop="gender" label="性别" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-if="scope.row.gender == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="birth_date" label="出生日期" width="120" align="center" />
<el-table-column prop="nation" label="民族" width="80" align="center" />
<el-table-column prop="study_code" label="学籍号" width="185" align="center" />
<el-table-column prop="school_name" label="所属学校" min-width="120" />
<el-table-column prop="grade_name" label="所属年级" min-width="120" />
<el-table-column prop="class_name" label="所属班级" min-width="100" />
<el-table-column prop="exam_status" label="状态" align="center">
<template #default="scope">
<span v-if="scope.row.exam_status == '00'">未检</span>
<span v-if="scope.row.exam_status == '01'">已检</span>
<span v-if="scope.row.exam_status == '02'">漏检</span>
</template>
</el-table-column>
<el-table-column prop="exam_time" label="检查时间" width="120" align="center">
<template #default="scope">
{{dateFormat(scope.row.exam_time)}}
</template>
</el-table-column>
<el-table-column prop="vision_left" label="左眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_left !=0 && scope.row.vision_left!=null"> {{scope.row.vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="vision_right" label="右眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_right !=0 && scope.row.vision_right!=null"> {{scope.row.vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="sph_left" label="左眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_left !=0 && scope.row.sph_left!=null">
<span v-if="scope.row.sph_left>0">+{{scope.row.sph_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="sph_right" label="右眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_right !=0 && scope.row.sph_right!=null">
<span v-if="scope.row.sph_right>0">+{{scope.row.sph_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_left" label="左眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_left !=0 && scope.row.cytdnder_left!=null">
<span v-if="scope.row.cytdnder_left>0">+{{scope.row.cytdnder_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_right" label="右眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_right !=0 && scope.row.cytdnder_right!=null">
<span v-if="scope.row.cytdnder_right>0">+{{scope.row.cytdnder_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="axies_left" label="左眼轴位" width="60" align="center"/>
<el-table-column prop="axies_right" label="右眼轴位" width="60" align="center"/>
<el-table-column prop="se_left" label="左眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_left !=0 && scope.row.se_left!=null">
<span v-if="scope.row.se_left>0">+{{scope.row.se_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="se_right" label="右眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_right !=0 && scope.row.se_right!=null">
<span v-if="scope.row.se_right>0">+{{scope.row.se_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_left" label="左眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_left !=0 && scope.row.rectify_vision_left!=null"> {{scope.row.rectify_vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_right" label="右眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_right !=0 && scope.row.rectify_vision_right!=null"> {{scope.row.rectify_vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="is_sighted" label="是否近视" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.is_sighted == '0'"></span>
<span v-if="scope.row.is_sighted == '1'"></span>
</template>
</el-table-column>
<el-table-column prop="is_hyperopia" label="远视储备是否充足" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.age >12">/</span>
<span v-else-if="scope.row.is_hyperopia == '1'"></span>
<span v-else-if="scope.row.is_hyperopia == '0'"></span>
</template>
</el-table-column>
<el-table-column prop="is_glasses" label="是否戴镜" width="100" align="center">
<template #default="scope">
<span v-if="scope.row.is_glasses == '0'||scope.row.is_glasses == ''||scope.row.is_glasses == null">未知</span>
<span v-if="scope.row.is_glasses == '4'">不带镜</span>
<span v-if="scope.row.is_glasses == '3'">角膜塑形镜</span>
<span v-if="scope.row.is_glasses == '2'">隐形眼镜</span>
<span v-if="scope.row.is_glasses == '1'">框架眼镜</span>
</template>
</el-table-column>
<el-table-column prop="id_code" label="身份证" width="180" align="center" />
<el-table-column prop="is_view" label="家长是否查看" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.is_view == '1'"></span>
<span v-else></span>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
<el-dialog v-model="dialogTableVisible" title="导入学生错误信息列表" width="800">
<el-button style="margin-bottom: 10px" type="primary" @click="exportToExcel">导出错误信息</el-button>
<el-table class="importdata_table_error" :data="errorData" style="height: calc(100vh - 200px);" border>
<el-table-column type="index" label="序号" width="90" />
<el-table-column prop="name" label="内容" />
</el-table>
</el-dialog>
</div>
</template>
<style scoped lang="scss">
.importdata-box{
height: calc(100vh - 285px);
width: 100%;
padding-top: 15px;
.importdata-box-top{
height: 125px;
width: 100%;
background: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 0.498039215686275);
margin-bottom: 15px;
display: flex;
padding: 10px;
flex-wrap: wrap;
align-content: flex-start;
overflow: auto;
}
.importdata-box-bottom{
width: 100%;
height: calc(100vh - 440px);
background: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 0.498039215686275);
padding: 15px;
}
}
.dialog-footer {
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
</style>

View File

@ -1,432 +0,0 @@
<script lang="ts">
export default {
name: 'printcode' //
};
</script>
<script setup lang="ts">
import { onMounted, ref, nextTick ,watch} from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable,ElTree} from "element-plus";
import { queryRegionPlan,queryExaminePlanById } from "@/api/planscreening";
import { querySchoolGradeList } from "@/api/regionmodule/schoolGrade";
import Page from '@/components/Pagination/page.vue';
import Importdata from './importdata.vue';
import Exportdata from './exportdata.vue';
import Reinspection from './reinspection.vue';
import { publicTree } from '@/utils/validate';
const queryInfo :any = ref({
schoolId:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
})
const menuname:any = ref(1)
const currentinfo:any = ref({})
//
const treeData: any = ref([]);
const treeloading = ref(false)
const defaultProps = { label: "name" }
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const treeRef = ref<InstanceType<typeof ElTree>>()
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
onMounted(() => {
getTree()
});
function planYearChange(e:any){
getTree()
}
const schoolId = ref("")
function checkId(tree:any){
for(let i=0; i<tree.length;i++){
if(tree[i].region_id==null && tree[i].children){
checkId(tree[i].children)
}else{
if(tree[i].region_id!=null){
schoolId.value = tree[i].id
return
}
}
}
}
const planId =ref("")
const handleNodeClick = (data: Tree) => {
// if(data.org_type == null){
// nextTick(() => {
// treeRef.value?.setCurrentKey(schoolId.value);
// });
// }else{
planId.value = data.id
schoolId.value = data.id
orgType.value = "5"
parentId.value = data.id
treeRef.value?.setCurrentKey(data.id);
queryInfo.value = {
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
}
gradeinData.value = []
classData.value = []
getGrade()
getPlanById()
// getData()
// }
};
function getPlanById(){
let params ={
id: planId.value
}
queryExaminePlanById(params).then((res:any) => {
if(res.data !=null){
let tempData = []
if(res.data.exam_items != null &&res.data.exam_items != ""){
let exam_items = JSON.parse(res.data.exam_items)
for(let i=0;i<exam_items.length;i++ )
tempData.push(exam_items[i].name)
}
res.data.examItems = tempData.join("、")
currentinfo.value = res.data;
}else{
currentinfo.value = {};
}
});
}
const orgType:any = ref("")
const parentId:any = ref("")
const regionName = ref("")
const tempData:any = ref([])
//
function getTree() {
const params = {
status:'01',
planYear:planYear.value
};
treeloading.value = true
queryRegionPlan(params).then((res: any) => {
// for(let i=0;i<res.data.length;i++){
// if(res.data[i].org_type == ""){
// schoolId.value = res.data[i].id
// break
// }
// }
tempData.value = JSON.parse(JSON.stringify(res.data))
treeData.value = publicTree(res.data,"")
gradeinData.value = []
classData.value = []
// checkId(res.data)
treeloading.value = false
if(schoolId.value != ""){
nextTick(() => {
// treeRef.value?.setCurrentKey(schoolId.value);
// getGrade()
// getData();
});
}
})
.catch((error:any)=>{
treeloading.value = false
})
}
const gradeinData:any = ref([])
const classData:any = ref([])
function getGrade(){
let params = {
schoolId: schoolId.value
}
classData.value = []
queryInfo.value.classId = ""
querySchoolGradeList(params).then((res) => {
gradeinData.value = res.data;
}).catch(()=>{
});
}
function searchInit(){
treeData.value = publicTree(tempData.value,regionName.value)
}
function menuswith(type:any){
menuname.value = type
if(type == 3){
getPlanById()
}
}
const planYearData:any =ref([{name:'2023-1'},{name:'2023-2'},{name:'2024-1'},{name:'2024-2'},{name:'2025-1'},{name:'2025-2'}])
const planYear:any = ref("")
</script>
<template>
<div class="printcode-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div style="width:100%;padding: 5px 15px;">
<el-select v-model="planYear" placeholder="请选择计划年度" @change="planYearChange">
<el-option v-for="item in planYearData" :key="item.name" :label="item.name" :value="item.name"/>
</el-select>
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData" default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 237px); overflow: auto;margin-top: 10px;">
<template #default="{ node, data }">
<span>
<span v-if="data.type== null" class="plancolor"> {{ data.name }}</span>
<span v-else > {{ data.name }}</span>
<span v-if="data.count !=0 &&data.count !=null" style="color:#409eff ;">({{data.count}})</span>
</span>
</template>
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="right-box-top">
<div class="box-top1">
<div class="box-top1-title">{{ currentinfo.plan_name }}</div>
</div>
<div class="box-top2">
<div style="width:160px;" class="box-top2-text">年度:<span class="box-top2-texts">{{ currentinfo.plan_year }}</span></div>
<div style="min-width:220px;" class="box-top2-text">组织机构:<span class="box-top2-texts">{{ currentinfo.org_name }}</span></div>
<div style="min-width:280px;" class="box-top2-text">筛选项目:<span class="box-top2-texts">{{ currentinfo.examItems }}</span></div>
<div style="width:220px;" class="box-top2-text">开始时间:<span class="box-top2-texts">{{currentinfo.plan_start_date}}</span></div>
<div style="width:150px;" class="box-top2-text">结束时间:<span class="box-top2-texts">{{ currentinfo.plan_end_date }}</span></div>
</div>
<div class="box-top3">
<div :class="[menuname == 1?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(1)">导入数据</div>
<div :class="[menuname == 2?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(2)">导出数据</div>
<div :class="[menuname == 3?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(3)">复查管理</div>
</div>
</div>
<Importdata v-if="menuname == 1" :planInfo="currentinfo" />
<Exportdata v-if="menuname == 2" :planInfo="currentinfo" />
<Reinspection v-if="menuname == 3" :planInfo="currentinfo" />
</div>
</div>
</template>
<style scoped lang="scss">
.printcode-box{
// margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 130px);
overflow: auto;
// background-color: rgba(255, 255, 255, 1);
// border-radius: 3px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
.right-box-top{
width: 100%;
height: 140px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
background-color: #fff;
padding: 15px 20px;
position: relative;
.box-top1{
display: flex;
justify-content: space-between;
.box-top1-title{
font-weight: 700;
font-style: normal;
color: #363636;
font-size:24px;
height: 36px;
}
:deep(){
.el-button{
width: 54px;
height: 26px;
padding: 0px;
}
.el-button:focus, .el-button:hover{
background-color: #ecf5ff;
color:#409eff;
}
}
}
.box-top2{
display: flex;
margin-top: 11px;
.box-top2-text{
font-size: 14px;
color:#949494;
margin-right: 20px;
}
.box-top2-texts{
font-size: 14px;
color:#363636;
padding-left: 11px;
}
}
.box-top3{
display: flex;
position: absolute;
bottom: 0px;
// margin-top: 16px;
.box-top3-info{
// height: 50px;
font-size: 14px;
margin-right: 40px;
padding-bottom: 12px;
// border-bottom: 3px solid #409eff;
color: #505050;
cursor: pointer;
}
.box-top3-info:hover{
color: #409eff;
}
.menucheckstyle{
border-bottom: 3px solid #409eff;
color: #409eff !important ;
}
}
}
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.searchinfo{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.QRbox{
height: calc(100vh - 200px);
text-align: center;
}
.plancolor{
color: #409eff ;
}
:deep(.el-tree-node.is-current > .el-tree-node__content){
.plancolor{
color: #fff ;
}
}
</style>

View File

@ -1,827 +0,0 @@
<script lang="ts">
export default {
name: 'reinspection' //
};
</script>
<script setup lang="ts">
import { onMounted, ref, nextTick ,watch,reactive} from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable,ElTree} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import { recheckStudentList,exportRecheckTemplate,exportRecheckExamineResultStudent,addRecheckExamineResult,
recheckStudentInfo,updateRecheckExamineResult,studentRecheckNotice,exportSchoolRecheckNotice } from "@/api/planscreening";
import { queryExaminePlanById } from "@/api/planscreening";
import { downloadFile } from '@/utils/index'
import { getToken } from '@/utils/auth'
import * as XLSX from 'xlsx';
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const isSort = ref('down');
const queryInfo :any = ref({
schoolId:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
})
const url = userStore.webApiBaseUrl;
const tableRowClassName = ({
row,
rowIndex,
}: {
row: any
rowIndex: number
}) => {
if (row.is_sighted == 1) {
return 'is_sightedbg'
}
return ''
}
const recheckStr =ref("")
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const planSchoolInfo:any = ref({})
const tempSchoolList:any =ref([])
const shcoolId=ref("")
const tableData = ref([])
function getSort(type){
isSort.value = type
if(type == "up"){
planSchoolInfo.value.schoolList.sort((a, b) => a.recheckrate - b.recheckrate);
}else if(type == "down"){
planSchoolInfo.value.schoolList.sort((a, b) => b.recheckrate - a.recheckrate);
}else if(type == "no"){
planSchoolInfo.value.schoolList =JSON.parse(JSON.stringify(tempSchoolList.value)) ;
}
}
watch(
() => props.planInfo,
(newVal: any) => {
planSchoolInfo.value = newVal
if(planSchoolInfo.value != null && planSchoolInfo.value.schoolList != null ){
planSchoolInfo.value.schoolList.forEach(element => {
if(element.total == 0){
element.recheckrate = 0
}else{
element.recheckrate = (element.recheck/element.total *100).toFixed(2)
}
});
tempSchoolList.value = JSON.parse(JSON.stringify(planSchoolInfo.value.schoolList))
isSort.value = 'no'
}
recheckStr.value = ""
queryInfo.value = {
schoolId:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
}
shcoolId.value = ""
tableData.value =[]
},
{ immediate: true }
);
const loading = ref(false)
//
onMounted(() => {
planSchoolInfo.value = props.planInfo
if(planSchoolInfo.value != null && planSchoolInfo.value.schoolList != null){
planSchoolInfo.value.schoolList.forEach(element => {
if(element.total == 0){
element.recheckrate = 0
}else{
element.recheckrate = (element.recheck/element.total *100).toFixed(2)
}
});
tempSchoolList.value = JSON.parse(JSON.stringify(planSchoolInfo.value.schoolList))
isSort.value = 'no'
recheckStr.value = ""
queryInfo.value = {
schoolId:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
}
}
});
function download(){
let params = {
planId: planSchoolInfo.value.id,
schoolIds:shcoolId.value
};
exportRecheckTemplate(params).then((response: any) => {
downloadFile(response,planSchoolInfo.value.plan_name+ '-复查学生基本信息', 'xlsx')
});
}
function exportRecheck(type){
let params = {
planId: planSchoolInfo.value.id,
schoolIds:shcoolId.value,
type:type
};
exportRecheckExamineResultStudent(params).then((response: any) => {
if(type == 'no'){
downloadFile(response,planSchoolInfo.value.plan_name+ '-未复查学生基本信息', 'xlsx')
}else{
downloadFile(response,planSchoolInfo.value.plan_name+ '-已复查学生基本信息', 'xlsx')
}
});
}
function exportRecheckNotice(){
let params = {
planId: planSchoolInfo.value.id,
schoolIds:shcoolId.value
};
loadingtext.value = "正在导出复查通知书,请耐心等待!"
loading.value = true
// if(queryInfo.value.total<1000){
// studentRecheckNotice(params).then((response: any) => {
// loadingtext.value = ""
// loading.value = false
// downloadFile(response,planSchoolInfo.value.plan_name+ '-', 'docx')
// }).catch(()=>{
// loadingtext.value = ""
// loading.value = false
// });
// }else{
exportSchoolRecheckNotice(params).then((response: any) => {
loadingtext.value = ""
loading.value = false
downloadFile(response,planSchoolInfo.value.plan_name+ '-复查通知书', 'zip')
}).catch(()=>{
loadingtext.value = ""
loading.value = false
});
// }
}
function checkchange(id:any){
schoolNames.value = ''
for(let j = 0;j<planSchoolInfo.value.schoolList.length;j++){
if(planSchoolInfo.value.schoolList[j].id == id){
schoolNames.value = planSchoolInfo.value.schoolList[j].name
}
}
if(id != '' && id !=null){
getData()
}else{
tableData.value =[]
}
}
function searchClick(){
queryInfo.value.current = 1
getData()
}
function getData(){
let params = {
planId: planSchoolInfo.value.id,
schoolIds:shcoolId.value,
size:queryInfo.value.size,
current:queryInfo.value.current,
recheckStr:recheckStr.value
}
recheckStudentList(params).then((res) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total;
}).catch(()=>{
});
}
function dateFormat(row: any) { //
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
const upload:any = ref(null)
const errorData:any = ref([])
const dialogTableVisible = ref(false)
function handlesSuccess(file: any) {
loading.value = false
if(file.code == "0"){
ElMessage({
message: "导入成功!",
type: "success",
});
getData()
refreshInfo()
}else{
errorData.value = []
let msg = file.msg.split("<br>")
msg.forEach(element => {
errorData.value.push({name:element})
});
dialogTableVisible.value = true
// ElMessage({
// message: file.msg,
// type: "error",
// });
}
upload.value.clearFiles()
}
const schoolNames:any = ref("")
function handleError(file: any){
loading.value = false
ElMessage({
message: "导入失败!",
type: "error",
});
upload.value.clearFiles()
}
function handlePreview(){
loadingtext.value = "正在导入数据,请耐心等待!"
loading.value = true
}
const dialogFrom = ref(false)
const studentInfo:any = ref({})
const studentTitle = ref("")
const recheckInfo:any = ref({
vision_left:null,
vision_right:null,
rectify_vision_left:null,
rectify_vision_right:null,
sph_left:null,
sph_right:null,
cytdnder_left:null,
cytdnder_right:null,
axies_left:null,
axies_right:null,
od_left:null,
od_right:null,
})
const recheckRules = reactive<FormRules>({
vision_left: [{ required: true, message: "请输入左眼视力", trigger: "blur" }],
vision_right: [{ required: true, message: "请输入右眼视力", trigger: "blur" }],
rectify_vision_left: [{ required: true, message: "请输入左眼矫正视力", trigger: "blur" }],
rectify_vision_right: [{ required: true, message: "请输入右眼矫正视力", trigger: "blur" }],
sph_left: [{ required: true, message: "请输入左眼球镜", trigger: "blur" }],
sph_right: [{ required: true, message: "请输入右眼球镜", trigger: "blur" }],
cytdnder_left: [{ required: true, message: "请输入左眼柱镜", trigger: "blur" }],
cytdnder_right: [{ required: true, message: "请输入右眼柱镜", trigger: "blur" }],
axies_left: [{ required: true, message: "请输入左眼轴位", trigger: "blur" }],
axies_right: [{ required: true, message: "请输入右眼轴位", trigger: "blur" }],
});
function addinfo(row:any){
isNum.value = false
studentInfo.value = JSON.parse(JSON.stringify(row))
recheckInfo.value = {
vision_left:null,
vision_right:null,
rectify_vision_left:null,
rectify_vision_right:null,
sph_left:null,
sph_right:null,
cytdnder_left:null,
cytdnder_right:null,
axies_left:null,
axies_right:null,
od_left:null,
od_right:null,
}
studentTitle.value = '录入'+studentInfo.value.student_name + '的复查数据'
dialogFrom.value = true
}
function editinfo(row:any){
isNum.value = false
let params = {
planId:row.plan_id,
studentId:row.student_id
}
recheckStudentInfo(params).then((res:any) => {
recheckInfo.value = res.data
studentTitle.value ='修改'+ recheckInfo.value.student_name + '的复查数据'
dialogFrom.value = true
})
}
function refreshInfo(){
let params ={
id: planSchoolInfo.value.id
}
queryExaminePlanById(params).then((res:any) => {
if(res.data !=null){
let schoolList = res.data.schoolList
for(let i =0;i<schoolList.length;i++){
for(let j =0;j<planSchoolInfo.value.schoolList.length;j++){
if(planSchoolInfo.value.schoolList[j].id ==schoolList[i].id){
if(schoolList[i].total == 0){
planSchoolInfo.value.schoolList[j].total = 0
}else{
planSchoolInfo.value.schoolList[j].recheckrate = (schoolList[i].recheck/schoolList[i].total *100).toFixed(2)
}
}
}
}
tempSchoolList.value = JSON.parse(JSON.stringify(planSchoolInfo.value.schoolList))
}
});
}
const isNum = ref(false)
function infoEditSubmit(formEl: any){
formEl.validate((valid: any) => {
if (valid) {
if(isNum.value == true){
return
}
isNum.value = true
let data = {
id:recheckInfo.value.id,
visionLeft:recheckInfo.value.vision_left,
visionRight:recheckInfo.value.vision_right,
rectifyVisionLeft:recheckInfo.value.rectify_vision_left,
rectifyVisionRight:recheckInfo.value.rectify_vision_right,
sphLeft:recheckInfo.value.sph_right,
sphRight:recheckInfo.value.sph_right,
cytdnderLeft:recheckInfo.value.cytdnder_left,
cytdnderRight:recheckInfo.value.cytdnder_right,
axiesLeft:recheckInfo.value.axies_left,
axiesRight:recheckInfo.value.axies_right,
odLeft:recheckInfo.value.od_left,
odRight:recheckInfo.value.od_right,
}
updateRecheckExamineResult(data).then((res:any) => {
if(res.code == '0'){
dialogFrom.value = false
ElMessage({
message: "修改成功!",
type: "success",
});
getData()
}else{
ElMessage({
message: "修改失败!",
type: "error",
});
isNum.value = false
}
}).catch(()=>{
isNum.value = false
});
}
})
}
function infoSubmit(formEl: any){
formEl.validate((valid: any) => {
if (valid) {
if(isNum.value == true){
return
}
isNum.value = true
let data = {
id:studentInfo.value.id,
visionLeft:recheckInfo.value.vision_left,
visionRight:recheckInfo.value.vision_right,
rectifyVisionLeft:recheckInfo.value.rectify_vision_left,
rectifyVisionRight:recheckInfo.value.rectify_vision_right,
sphLeft:recheckInfo.value.sph_right,
sphRight:recheckInfo.value.sph_right,
cytdnderLeft:recheckInfo.value.cytdnder_left,
cytdnderRight:recheckInfo.value.cytdnder_right,
axiesLeft:recheckInfo.value.axies_left,
axiesRight:recheckInfo.value.axies_right,
odLeft:recheckInfo.value.od_left,
odRight:recheckInfo.value.od_right,
}
addRecheckExamineResult(data).then((res:any) => {
if(res.code == '0'){
dialogFrom.value = false
ElMessage({
message: "录入成功!",
type: "success",
});
getData()
refreshInfo()
}else{
ElMessage({
message: "录入失败!",
type: "error",
});
isNum.value = false
}
}).catch(()=>{
isNum.value = false
});
}
})
}
const multipleSelection:any = ref([])
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function checkExportRecheckNotice(){
let id = [] as any[];
multipleSelection.value.forEach((item: any) => {
id.push(item.id)
})
let params ={
planId: planSchoolInfo.value.id,
schoolIds:shcoolId.value,
ids: id.join(',')
}
loadingtext.value = "正在导出复查通知书,请耐心等待!"
loading.value = true
studentRecheckNotice(params).then((response: any) => {
loadingtext.value = ""
loading.value = false
downloadFile(response,planSchoolInfo.value.plan_name+ '-复查通知书', 'docx')
}).catch(()=>{
loadingtext.value = ""
loading.value = false
});
}
const recheckForm = ref();
function handleClose(){
if (recheckForm.value != null) recheckForm.value.resetFields();
dialogFrom.value = false
}
const loadingtext = ref("")
function exportToExcel() {
// DOM
const table = document.querySelector('.reinspection_table_error');
// 使 html-to-xlsx
const ws = XLSX.utils.table_to_sheet(table);
//
const colWidths = [
{ wch: 5 },
{ wch: 70 },
];
ws['!cols'] = colWidths;
// 簿
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
// Excel
XLSX.writeFile(wb, '导入错误信息.xlsx');
};
</script>
<template>
<div class="importdata-box" v-loading="loading" :element-loading-text="loadingtext">
<div class="importdata-box-top">
<el-radio-group v-model="shcoolId" @change="checkchange">
<el-radio v-for="(item,index) in planSchoolInfo.schoolList" :value="item.id" :key="item.id">
{{ item.name }}
<span style="color: red;">({{ item.recheckrate }}%)</span>
</el-radio>
<el-button v-if="isSort == 'down'" type="primary" @click="getSort('no')">正常</el-button>
<el-button v-if="isSort == 'no'" type="primary" @click="getSort('up')">升序</el-button>
<el-button v-if="isSort == 'up'" type="primary" @click="getSort('down')">降序</el-button>
</el-radio-group>
</div>
<div class="importdata-box-bottom">
<div style="margin-bottom: 15px; display: flex;">
<el-button type="primary" @click="download" :disabled="shcoolId ==null || shcoolId ==''">
<img src="@/assets/tableicon/download.png" style="padding-right: 5px;" alt="">下载模板
</el-button>
<el-upload
:disabled="shcoolId ==null || shcoolId ==''"
ref="upload"
accept=".xlsx"
class="upload-demo"
:action=" url + '/vision_examine/examine-result/ImportRecheckExamineResultStudent/?planId=' + planSchoolInfo.id +'&schoolNames=' + schoolNames "
:headers="{ token: getToken() }"
:show-file-list="false"
:before-upload="handlePreview"
:on-success="handlesSuccess"
:on-error="handleError">
<el-button type="primary" :disabled="shcoolId ==null || shcoolId ==''" style="margin: 0 10px;"><img src="@/assets/MenuIcon/u455.png" alt="" style="margin-right: 5px;">导入数据</el-button>
</el-upload>
<el-button type="primary" @click="exportRecheck('yes')" :disabled="shcoolId ==null || shcoolId ==''">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出复查数据
</el-button>
<el-button type="primary" @click="exportRecheck('no')" :disabled="shcoolId ==null || shcoolId ==''">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出未复查数据
</el-button>
<el-button type="primary" @click="exportRecheckNotice" :disabled="shcoolId ==null || shcoolId ==''">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出复查通知书
</el-button>
<el-select v-model="recheckStr" :disabled="shcoolId ==null || shcoolId ==''" clearable style="width: 100px;margin: 0 10px;" placeholder="是否复查" @change="searchClick" >
<el-option :key="'1'" :label="'是'" :value="'1'" />
<el-option :key="'0'" :label="'否'" :value="'0'" />
</el-select>
<el-button type="primary" @click="checkExportRecheckNotice" :disabled="multipleSelection.length==0">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出勾选复查通知书
</el-button>
</div>
<el-table v-loading="loading" :element-loading-text="loadingtext" :data="tableData" border :row-class-name="tableRowClassName"
style="width: 100%; height:calc(100vh - 570px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}"
@selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="55" />
<el-table-column fixed type="index" width="55" label="序号" align="center" />
<el-table-column fixed prop="student_name" label="姓名" width="100">
<template #default="scope">
<div style="display: flex;align-items: center;">
<div v-if="scope.row.count>0"></div>
<div v-else class="circularbox" ></div>
<div>{{ scope.row.student_name }}</div>
</div>
</template>
</el-table-column>
<el-table-column prop="gender" label="性别" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-if="scope.row.gender == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="birth_date" label="出生日期" width="120" align="center" />
<el-table-column prop="nation" label="民族" width="80" align="center" />
<el-table-column prop="study_code" label="学籍号" width="185" align="center" />
<el-table-column prop="school_name" label="所属学校" min-width="120" />
<el-table-column prop="grade_name" label="所属年级" min-width="120" />
<el-table-column prop="class_name" label="所属班级" min-width="100" />
<el-table-column prop="exam_status" label="状态" align="center">
<template #default="scope">
<span v-if="scope.row.exam_status == '00'">未检</span>
<span v-if="scope.row.exam_status == '01'">已检</span>
<span v-if="scope.row.exam_status == '02'">漏检</span>
</template>
</el-table-column>
<el-table-column prop="exam_time" label="检查时间" width="120" align="center">
<template #default="scope">
{{dateFormat(scope.row.exam_time)}}
</template>
</el-table-column>
<el-table-column prop="vision_left" label="左眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_left !=0 && scope.row.vision_left!=null"> {{scope.row.vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="vision_right" label="右眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_right !=0 && scope.row.vision_right!=null"> {{scope.row.vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="sph_left" label="左眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_left !=0 && scope.row.sph_left!=null">
<span v-if="scope.row.sph_left>0">+{{scope.row.sph_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="sph_right" label="右眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_right !=0 && scope.row.sph_right!=null">
<span v-if="scope.row.sph_right>0">+{{scope.row.sph_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_left" label="左眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_left !=0 && scope.row.cytdnder_left!=null">
<span v-if="scope.row.cytdnder_left>0">+{{scope.row.cytdnder_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_right" label="右眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_right !=0 && scope.row.cytdnder_right!=null">
<span v-if="scope.row.cytdnder_right>0">+{{scope.row.cytdnder_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="axies_left" label="左眼轴位" width="60" align="center"/>
<el-table-column prop="axies_right" label="右眼轴位" width="60" align="center"/>
<el-table-column prop="se_left" label="左眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_left !=0 && scope.row.se_left!=null">
<span v-if="scope.row.se_left>0">+{{scope.row.se_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="se_right" label="右眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_right !=0 && scope.row.se_right!=null">
<span v-if="scope.row.se_right>0">+{{scope.row.se_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_left" label="左眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_left !=0 && scope.row.rectify_vision_left!=null"> {{scope.row.rectify_vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_right" label="右眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_right !=0 && scope.row.rectify_vision_right!=null"> {{scope.row.rectify_vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="is_sighted" label="是否近视" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.is_sighted == '0'"></span>
<span v-if="scope.row.is_sighted == '1'"></span>
</template>
</el-table-column>
<el-table-column prop="is_hyperopia" label="远视储备是否充足" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.age >12">/</span>
<span v-else-if="scope.row.is_hyperopia == '1'"></span>
<span v-else-if="scope.row.is_hyperopia == '0'"></span>
</template>
</el-table-column>
<el-table-column prop="is_glasses" label="是否戴镜" width="100" align="center">
<template #default="scope">
<span v-if="scope.row.is_glasses == '0'||scope.row.is_glasses == ''||scope.row.is_glasses == null">未知</span>
<span v-if="scope.row.is_glasses == '4'">不带镜</span>
<span v-if="scope.row.is_glasses == '3'">角膜塑形镜</span>
<span v-if="scope.row.is_glasses == '2'">隐形眼镜</span>
<span v-if="scope.row.is_glasses == '1'">框架眼镜</span>
</template>
</el-table-column>
<el-table-column prop="id_code" label="身份证" width="180" align="center" />
<el-table-column prop="is_view" label="家长是否查看" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.is_view == '1'"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="address" label="操作" width="60" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img v-if="scope.row.count == 0" src="@/assets/MenuIcon/lbcz_xg.png" alt="" title="录入复查" @click="addinfo(scope.row)" style="cursor: pointer;">
<img v-else src="@/assets/MenuIcon/lbcz_xg.png" alt="" title="修改" @click="editinfo(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
<el-dialog v-model="dialogTableVisible" title="导入学生错误信息列表" width="800">
<el-button style="margin-bottom: 10px" type="primary" @click="exportToExcel">导出错误信息</el-button>
<el-table class="reinspection_table_error" :data="errorData" style="height: calc(100vh - 200px);" border>
<el-table-column type="index" label="序号" width="90" />
<el-table-column prop="name" label="内容" />
</el-table>
</el-dialog>
<el-dialog v-model="dialogFrom" :title="studentTitle" width="800" :before-close="handleClose">
<el-form ref="recheckForm" :rules="recheckRules" :model="recheckInfo" label-width="150px">
<div style="width: 100%;display: flex;">
<el-form-item label="左眼视力" style="width: 50%;" prop="vision_left">
<el-input v-model="recheckInfo.vision_left" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="右眼视力" style="width: 50%;" prop="vision_right">
<el-input v-model="recheckInfo.vision_right" style="width: 100%" placeholder=""></el-input>
</el-form-item>
</div>
<div style="width: 100%;display: flex;">
<el-form-item label="左眼矫正视力" style="width: 50%;" prop="rectify_vision_left">
<el-input v-model="recheckInfo.rectify_vision_left" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="右眼矫正视力" style="width: 50%;" prop="rectify_vision_right">
<el-input v-model="recheckInfo.rectify_vision_right" style="width: 100%" placeholder=""></el-input>
</el-form-item>
</div>
<div style="width: 100%;display: flex;">
<el-form-item label="左眼球镜" style="width: 50%;" prop="sph_left">
<el-input v-model="recheckInfo.sph_left" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="右眼球镜" style="width: 50%;" prop="sph_right">
<el-input v-model="recheckInfo.sph_right" style="width: 100%" placeholder=""></el-input>
</el-form-item>
</div>
<div style="width: 100%;display: flex;">
<el-form-item label="左眼柱镜" style="width: 50%;" prop="cytdnder_left">
<el-input v-model="recheckInfo.cytdnder_left" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="右眼柱镜" style="width: 50%;" prop="cytdnder_right">
<el-input v-model="recheckInfo.cytdnder_right" style="width: 100%" placeholder=""></el-input>
</el-form-item>
</div>
<div style="width: 100%;display: flex;">
<el-form-item label="左眼轴位" style="width: 50%;" prop="axies_left">
<el-input v-model="recheckInfo.axies_left" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="右眼轴位" style="width: 50%;" prop="axies_right">
<el-input v-model="recheckInfo.axies_right" style="width: 100%" placeholder=""></el-input>
</el-form-item>
</div>
<div style="width: 100%;display: flex;">
<el-form-item label="左眼眼轴长度" style="width: 50%;">
<el-input v-model="recheckInfo.od_left" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="右眼眼轴长度" style="width: 50%;">
<el-input v-model="recheckInfo.od_right" style="width: 100%" placeholder=""></el-input>
</el-form-item>
</div>
<span class="dialog-footer" >
<el-button v-if="recheckInfo.exam_type == '04'" type="primary" @click="infoEditSubmit(recheckForm)">确定</el-button>
<el-button v-else type="primary" @click="infoSubmit(recheckForm)">确定</el-button>
<el-button @click="handleClose">关闭</el-button>
</span>
</el-form>
</el-dialog>
</div>
</template>
<style scoped lang="scss">
.importdata-box{
height: calc(100vh - 285px);
width: 100%;
padding-top: 15px;
.importdata-box-top{
height: 125px;
width: 100%;
background: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 0.498039215686275);
margin-bottom: 15px;
display: flex;
padding: 10px;
flex-wrap: wrap;
align-content: flex-start;
overflow: auto;
}
.importdata-box-bottom{
width: 100%;
height: calc(100vh - 440px);
background: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 0.498039215686275);
padding: 15px;
}
}
.dialog-footer {
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
.circularbox{
width: 10px;
height: 10px;
border-radius: 50%;
background: red;
margin-right: 5px;
}
</style>

View File

@ -1,556 +0,0 @@
<script lang="ts">
export default {
name: 'printcode' // -
};
</script>
<script setup lang="ts">
import { onMounted, ref, nextTick ,watch} from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable,ElTree} from "element-plus";
import { queryRegionSchool } from "@/api/regionmodule/school";
import { querySchoolGradeList } from "@/api/regionmodule/schoolGrade";
import { querySchoolClassList } from "@/api/regionmodule/schoolClass";
import { querySchoolStudentPage } from "@/api/regionmodule/schoolStudent";
import { studentQRCode,downloadQRCode,downloadSelectedQRCode,studentPersonQRCode} from "@/api/planscreening";
import { downloadFile } from '@/utils/index'
import Page from '@/components/Pagination/page.vue';
import { publicTree } from '@/utils/validate';
import Viewfile from "@/views/component/Viewfile.vue";
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const queryInfo :any = ref({
schoolId:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
})
const tableData = ref([])
const multipleSelection = ref([])
const dialogVisible = ref(false)
const genderoptions:any = ref([{label:'男',value:'1'},{label:'女',value:'2'}])
const loading = ref(false)
//
const treeData: any = ref([]);
const treeloading = ref(false)
const defaultProps = { label: "name" }
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const treeRef = ref<InstanceType<typeof ElTree>>()
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
onMounted(() => {
getTree()
});
const schoolId = ref("")
function checkId(tree:any){
for(let i=0; i<tree.length;i++){
if(tree[i].region_id==null && tree[i].children){
checkId(tree[i].children)
}else{
if(tree[i].region_id!=null){
schoolId.value = tree[i].id
return
}
}
}
}
const handleNodeClick = (data: Tree) => {
if(data.org_type == null){
nextTick(() => {
treeRef.value?.setCurrentKey(schoolId.value);
});
}else{
schoolId.value = data.id
orgType.value = "5"
parentId.value = data.id
treeRef.value?.setCurrentKey(data.id);
queryInfo.value = {
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
}
gradeinData.value = []
classData.value = []
getGrade()
getData()
}
};
//
function getData(){
let params = {
name:queryInfo.value.name,
schoolId:schoolId.value,
gradeId:queryInfo.value.gradeId,
classId:queryInfo.value.classId,
gender:queryInfo.value.gender,
current: queryInfo.value.current,
size:queryInfo.value.size
};
loading.value = true
querySchoolStudentPage(params).then((res:any) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
});
}
//
function printQRcode(){
title.value="打印预览"
onprint.value="no"
filetype.value="pdf"
let params = {
orgType: orgType.value,
parentId:parentId.value,
studentName:queryInfo.value.name,
gender:queryInfo.value.gender
}
ViewfileUrl.value = url + '/vision_examine/examine-plan/downloadQRCode?orgType=' + params.orgType +
"&parentId=" + params.parentId + "&studentName=" + params.studentName + "&gender=" + params.gender
isViewfile.value = true
}
function printSelectedQRcode(){
title.value="打印预览"
onprint.value="no"
filetype.value="pdf"
let ids = [] as any[];
multipleSelection.value.forEach((item: any) => {
ids.push(item.id)
})
ViewfileUrl.value = url + '/vision_examine/examine-plan/downloadSelectedQRCode?parentId=' + parentId.value +
"&ids=" + ids
isViewfile.value = true
}
const orgType:any = ref("")
const parentId:any = ref("")
const studentName:any = ref("")
//
function exportclick(type:any){
let params = {
orgType: orgType.value,
parentId:parentId.value,
studentName:queryInfo.value.studentName,
gender:queryInfo.value.gender
}
loading.value = true
downloadQRCode(params).then((response) => {
loading.value = false
downloadFile(response, parentId.value , 'pdf')
}).catch(()=>{
loading.value = false
})
}
//
function exportSelectedClick(){
let ids = [] as any[];
multipleSelection.value.forEach((item: any) => {
ids.push(item.id)
})
let params = {
ids: ids.join(","),
parentId:parentId.value,
}
loading.value = true
downloadSelectedQRCode(params).then((response) => {
loading.value = false
downloadFile(response, parentId.value , 'pdf')
}).catch(()=>{
loading.value = false
})
}
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function resetdata(){
queryInfo.value = {
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
}
getData()
}
const regionName = ref("")
const tempData:any = ref([])
//
function getTree() {
const params = {
status:'01'
};
treeloading.value = true
queryRegionSchool(params).then((res: any) => {
for(let i=0;i<res.data.length;i++){
if(res.data[i].org_type == "5"){
schoolId.value = res.data[i].id
break
}
}
tempData.value = JSON.parse(JSON.stringify(res.data))
treeData.value = publicTree(res.data,"")
gradeinData.value = []
classData.value = []
checkId(res.data)
treeloading.value = false
if(schoolId.value != ""){
nextTick(() => {
treeRef.value?.setCurrentKey(schoolId.value);
getGrade()
getData();
});
}
})
.catch((error:any)=>{
treeloading.value = false
})
}
const gradeinData:any = ref([])
const classData:any = ref([])
function getGrade(){
let params = {
schoolId: schoolId.value
}
classData.value = []
queryInfo.value.classId = ""
querySchoolGradeList(params).then((res) => {
gradeinData.value = res.data;
}).catch(()=>{
});
}
function getClass(id:any){
if(id == null){
queryInfo.value.gradeId = ''
}
let params = {
gradeId: id
}
if(id != "" && id != null){
orgType.value = "6"
parentId.value = id
}else{
orgType.value = "5"
parentId.value = schoolId.value
}
classData.value = []
queryInfo.value.classId = ""
if(id != null && id != '' ){
querySchoolClassList(params).then((res) => {
classData.value = res.data;
}).catch(()=>{
});
}
getData()
}
function getQueryClass(id:any){
if(id != "" && id != null){
orgType.value = "7"
parentId.value = id
}else {
orgType.value = "6"
parentId.value = queryInfo.value.gradeId
}
getData()
}
function searchInit(){
treeData.value = publicTree(tempData.value,regionName.value)
}
const isViewfile = ref(false)
function CloseView(){
isViewfile.value = false
}
//
function lookinfo(row:any){
title.value="打印预览"
onprint.value=""
filetype.value="docx"
ViewfileUrl.value = url + '/vision_examine/examine-plan/studentPersonQRCode?id=' + row.id
isViewfile.value = true
}
function exportStudentPerson(row:any){
let params = {
id: row.id,
}
loading.value = true
studentPersonQRCode(params).then((response:any) => {
loading.value = false
downloadFile(response, row.name + '个人筛查告知书' , 'docx')
}).catch(()=>{
loading.value = false
})
}
const ViewfileUrl = ref("")
const title= ref("")
const onprint= ref("no")
const filetype = ref("pdf")
</script>
<template>
<div class="printcode-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div style="width:100%;padding: 5px 15px;">
<el-input v-model="regionName" placeholder="请输入关键字" @input="searchInit" />
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData" default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 260px); overflow: auto;margin-top: 10px;">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="searchinfo">
<div>
<el-input v-model="queryInfo.name" placeholder="请输入学生姓名/学籍号/身份证号" style="width: 240px;" clearable />
<el-select v-model="queryInfo.gradeId" @change="getClass" class="ml-3" placeholder="请选择年级" clearable size="large" style="width: 150px;" :disabled="schoolId==''|| schoolId==null">
<el-option v-for="item in gradeinData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.classId" @change="getQueryClass" class="ml-3" placeholder="请选择班级" clearable size="large" style="width: 150px;" :disabled="queryInfo.gradeId==''|| queryInfo.gradeId==null">
<el-option v-for="item in classData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.gender" @change="getData" size="large" clearable style="width: 140px;margin-right: 10px;" class="ml-3" placeholder="请选择性别">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="getData">搜索</el-button>
<el-button @click="resetdata">重置</el-button>
</div>
<div>
<el-button type="primary" @click="printQRcode" :disabled="schoolId == ''">
<img src="@/assets/visionscreening/printallQR.png" style="padding-right: 5px;" alt="">打印全部
</el-button>
<el-button type="primary" @click="exportclick" :disabled="schoolId == ''" >
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出全部
</el-button>
<el-button type="primary" :disabled="multipleSelection.length <= 0" @click="printSelectedQRcode">
<img src="@/assets/visionscreening/printallQR.png" style="padding-right: 5px;" alt="">打印
</el-button>
<el-button type="primary" :disabled="multipleSelection.length <= 0" @click="exportSelectedClick">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div v-loading="loading">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 295px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<el-table-column prop="code" label="学生代码" width="140" />
<el-table-column prop="name" label="学生姓名" width="100" />
<el-table-column prop="gender" label="性别" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-else-if="scope.row.gender == '2'"></span>
<span v-else>不详</span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="birth_date" label="出生日期" width="110" align="center"/>
<el-table-column prop="nation" label="民族" width="80" align="center"/>
<el-table-column prop="study_code" label="学籍号" width="190" align="center"/>
<el-table-column prop="id_code" label="身份证" width="180" align="center"/>
<el-table-column prop="grade_name" label="所属年级" min-width="140"/>
<el-table-column prop="class_name" label="所属班级" min-width="140"/>
<!-- <el-table-column prop="address" label="操作" width="60" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<el-button type="primary" size="small" @click="exportStudentPerson(scope.row)">导出</el-button>
</div>
</template>
</el-table-column> -->
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
</div>
<Viewfile v-if="isViewfile" :url="ViewfileUrl" :showTime="true" :title="title" :onprint="onprint" :type="filetype" :clientHeight="600" @update="CloseView"/>
</div>
</template>
<style scoped lang="scss">
.printcode-box{
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
// :deep(){
// .el-input{
// height:40px;
// line-height: 40px;
// width: 240px;
// }
// .el-button{
// height:40px;
// }
// }
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 145px);
overflow: auto;
background-color: rgba(255, 255, 255, 1);
border-radius: 3px;
padding: 20px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
// :deep(){
// .el-button{
// margin-left: 10px;
// }
// .el-tree-node__content{
// height: 40px;
// padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
// }
.searchinfo{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.QRbox{
height: calc(100vh - 200px);
text-align: center;
}
</style>

View File

@ -1,549 +0,0 @@
<script lang="ts">
export default {
name: 'archive' // -
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick,watch } from "vue";
import { ElMessage, ElMessageBox, FormRules } from "element-plus";
import { queryStudentVisdataList,exportVisionForm,queryVisionChangeTrend } from "@/api/planscreening";
import { useDark } from '@vueuse/core'
import Viewfile from "@/views/component/Viewfile.vue";
import * as echarts from 'echarts';
import { downloadFile } from '@/utils/index'
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const emit = defineEmits([ 'returnStudent']);
const props:any = defineProps({
studentInfo: {
required: false,
type: Object,
default: {}
}
})
let isDark:any = useDark().value == true? '1' : '2'
watch(useDark(), () => {
isDark = useDark().value == true? '1' : '2'
if (useDark().value == true) {
facechange('1')
} else {
facechange('2')
}
})
function returnClick(){
emit('returnStudent', '1');
}
function getData(){
if(props.studentInfo.id == '' || props.studentInfo.id == null){
tableData.value = []
return
}
let params = {
studentId: props.studentInfo.student_id,
};
loading.value = true
queryStudentVisdataList(params).then((res) => {
tableData.value = res.data;
loading.value = false
}).catch(()=>{
loading.value = false
});
queryVisionChangeTrend(params).then((res) => {
let date = []
for(let i=0;i<res.data.exam_time.length;i++){
date.push(dateFormat(res.data.exam_time[i]))
}
option.value.xAxis.data = date
option.value.series[0].data = res.data.vision_left
option.value.series[1].data = res.data.vision_right
option2.value.xAxis.data = date
option2.value.series[0].data = res.data.se_left
option2.value.series[1].data = res.data.se_right
}).catch(()=>{
});
}
let myCanvas1:any = null
let myCanvas2:any = null
onMounted(() => {
activeName.value = '1'
getData();
window.onresize = ()=>{
if(myCanvas1 != null){
myCanvas1.resize()
}
if(myCanvas2 != null){
myCanvas2.resize()
}
}
});
function handleClick(tab:any, event:any){
if (isDark === '1') {
facechange('1')
}else{
facechange('2')
}
if(tab.props.name == '2'){
setTimeout(()=>{
myCanvas1 = echarts.init(document.getElementById('myEchart1'))
myCanvas1.clear()
myCanvas1.setOption(option.value)
},200)
}
if(tab.props.name == '3'){
setTimeout(()=>{
myCanvas2 = echarts.init(document.getElementById('myEchart2'))
myCanvas2.clear()
myCanvas2.setOption(option2.value)
},200)
}
}
function facechange(type:any){
if (type === '1') {
option.value.xAxis.axisLabel.color = '#ffffff'
option.value.yAxis.axisLabel.color = '#ffffff'
option.value.yAxis.splitLine.lineStyle.color = '#4c4d4f'
option.value.legend.textStyle.color = '#ffffff'
option2.value.xAxis.axisLabel.color = '#ffffff'
option2.value.yAxis.axisLabel.color = '#ffffff'
option2.value.yAxis.splitLine.lineStyle.color = '#4c4d4f'
option2.value.legend.textStyle.color = '#ffffff'
}else{
option.value.xAxis.axisLabel.color = '#787878'
option.value.yAxis.axisLabel.color = '#787878'
option.value.yAxis.splitLine.lineStyle.color = '#E0E6F1'
option.value.legend.textStyle.color = '#000000'
option2.value.xAxis.axisLabel.color = '#787878'
option2.value.yAxis.axisLabel.color = '#787878'
option2.value.yAxis.splitLine.lineStyle.color = '#E0E6F1'
option2.value.legend.textStyle.color = '#000000'
}
if (myCanvas1) {
myCanvas1.clear()
myCanvas1.setOption(option.value);
myCanvas1.resize()
}
if (myCanvas2) {
myCanvas2.clear()
myCanvas2.setOption(option2.value);
myCanvas2.resize()
}
}
const loading = ref(false)
const tableData:any = ref([])
const activeName = ref("1")
function dateFormat(row: any) {
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
//
return year + "-" + month + "-" + day ;
}
}
const option:any = ref({
tooltip: {
trigger: 'axis'
},
legend: {
data: ['左眼视力', '右眼视力'],
textStyle:{
color:'#000'
},
left:'left',
icon: 'rect',
itemWidth: 15,
itemHeight: 2,
itemGap: 40
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: [],
axisLabel:{
color:'#787878'
}
},
yAxis: {
type: 'value',
axisLabel:{
color:'#787878'
},
splitLine:{
lineStyle: {
color: '#E0E6F1'
}
}
},
series: [
{
name: '左眼视力',
type: 'line',
data: []
},
{
name: '右眼视力',
type: 'line',
data: []
}
]
})
const option2:any = ref({
tooltip: {
trigger: 'axis'
},
legend: {
data: ['左眼等效球镜', '右眼等效球镜'],
textStyle:{
color:'#000'
},
left:'left',
icon: 'rect',
itemWidth: 15,
itemHeight: 2,
itemGap: 40
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: [],
axisLabel:{
color:'#787878'
}
},
yAxis: {
type: 'value',
axisLabel:{
color:'#787878'
},
splitLine:{
lineStyle: {
color: '#E0E6F1'
}
}
},
series: [
{
name: '左眼等效球镜',
type: 'line',
data: []
},
{
name: '右眼等效球镜',
type: 'line',
data: []
}
]
})
//
function fileDown(row:any) {
const params = {
id: row.id
}
exportVisionForm(params).then((response: any) => {
downloadFile(response, row.student_name + '筛查结果记录表', 'docx')
}).catch(() => {
});
}
const isViewfile = ref(false)
const ViewfileUrl = ref("")
function viewReport(row: any) {
ViewfileUrl.value = url + '/vision_examine/examine-result/exportVisionForm?id=' + row.id
setTimeout(()=>{
isViewfile.value = true
},200)
}
function CloseView() {
isViewfile.value = false
}
</script>
<template>
<div class="schoolStudent-box">
<div class="schoolStudent-title">
<div class="class_order">学生视力档案</div>
<div class="return" @click="returnClick">
<img src="@/assets/tableicon/u549.png" alt="">
<div style="padding-left: 2px;padding-top: 2px;">返回</div>
</div>
</div>
<div class="schoolStudent-line"></div>
<div style="display: flex;align-items: center;padding: 20px 0;">
<img v-if="(props.studentInfo.photo=='' || props.studentInfo.photo==null) && props.studentInfo.gender == '1'" src="@/assets/student/man.png" alt="" style="width:100px;height:100px;">
<img v-if="(props.studentInfo.photo=='' || props.studentInfo.photo==null) && props.studentInfo.gender == '2'" src="@/assets/student/woman.png" alt="" style="width:100px;height:100px;">
<img v-if="props.studentInfo.photo!='' && props.studentInfo.photo!=null" :src="props.studentInfo.photo" alt="" style="width:100px;height:100px;">
<div style="margin-left: 15px;">
<div class="basicname">
<span style="padding-right:20px">{{ props.studentInfo.name }}</span>
<span style="padding-right:20px">|</span>
<span v-if="props.studentInfo.gender == '1'"></span>
<span v-if="props.studentInfo.gender == '2'"></span>
<span style="padding-left:20px;padding-right:20px">|</span>
<span>{{ props.studentInfo.age }}</span>
</div>
<div class="basicinfo">
<span>所属学校</span>
<span class="valuetext">{{ props.studentInfo.school_name }}</span>
<span>所属年级</span>
<span class="valuetext">{{ props.studentInfo.grade_name }}</span>
<span>所属班级</span>
<span class="valuetext">{{ props.studentInfo.class_name }}</span>
</div>
</div>
</div>
<el-tabs class="tstab" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="检查记录" name="1"></el-tab-pane>
<el-tab-pane label="视力变化趋势" name="2"></el-tab-pane>
<el-tab-pane label="屈光度变化趋势" name="3"></el-tab-pane>
</el-tabs>
<el-table v-if="activeName == '1'" v-loading="loading" :data="tableData" style="width: 100%; height:calc(100vh - 380px)" row-key="id" border
default-expand-all :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}" >
<el-table-column type="index" width="60" label="序号"></el-table-column>
<el-table-column prop="exam_time" label="检查时间" min-width="140" align="center">
<template #default="scope">
{{dateFormat(scope.row.exam_time)}}
</template>
</el-table-column>
<el-table-column prop="vision_left" label="左眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_left !=0 && scope.row.vision_left!=null"> {{scope.row.vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="vision_right" label="右眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_right !=0 && scope.row.vision_right!=null"> {{scope.row.vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="sph_left" label="左眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_left !=0 && scope.row.sph_left!=null">
<span v-if="scope.row.sph_left>0">+{{scope.row.sph_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="sph_right" label="右眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_right !=0 && scope.row.sph_right!=null">
<span v-if="scope.row.sph_right>0">+{{scope.row.sph_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_left" label="左眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_left !=0 && scope.row.cytdnder_left!=null">
<span v-if="scope.row.cytdnder_left>0">+{{scope.row.cytdnder_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_right" label="右眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_right !=0 && scope.row.cytdnder_right!=null">
<span v-if="scope.row.cytdnder_right>0">+{{scope.row.cytdnder_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="axies_left" label="左眼轴位" width="60" align="center"/>
<el-table-column prop="axies_right" label="右眼轴位" width="60" align="center"/>
<el-table-column prop="se_left" label="左眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_left !=0 && scope.row.se_left!=null">
<span v-if="scope.row.se_left>0">+{{scope.row.se_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="se_right" label="右眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_right !=0 && scope.row.se_right!=null">
<span v-if="scope.row.se_right>0">+{{scope.row.se_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_left" label="左眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_left !=0 && scope.row.rectify_vision_left!=null"> {{scope.row.rectify_vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_right" label="右眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_right !=0 && scope.row.rectify_vision_right!=null"> {{scope.row.rectify_vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="is_sighted" label="是否近视" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.is_sighted == '0'"></span>
<span v-if="scope.row.is_sighted == '1'"></span>
</template>
</el-table-column>
<el-table-column prop="is_hyperopia" label="远视储备是否充足" width="90" align="center">
<template #default="scope">
<span v-if="props.studentInfo.age >12">/</span>
<span v-else-if="scope.row.is_hyperopia == '1'"></span>
<span v-else-if="scope.row.is_hyperopia == '0'"></span>
</template>
</el-table-column>
<el-table-column prop="is_glasses" label="是否戴镜" width="100" align="center">
<template #default="scope">
<span v-if="scope.row.is_glasses == '4'">不带镜</span>
<span v-if="scope.row.is_glasses == '3'">角膜塑形镜</span>
<span v-if="scope.row.is_glasses == '2'">隐形眼镜</span>
<span v-if="scope.row.is_glasses == '1'">框架眼镜</span>
<span v-if="scope.row.is_glasses == '0'||scope.row.is_glasses == ''||scope.row.is_glasses == null">未知</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="100" align="center">
<template #default="scope">
<span style="display: flex;display: -webkit-flex;justify-content: space-around; -webkit-justify-content: space-around; ">
<img src="@/assets/tableicon/u886.png" @click="viewReport(scope.row)" title="查看结果登记表" style="cursor: pointer;"
>
<img src="@/assets/tableicon/u889.png" @click="fileDown(scope.row)" title="导出" style="cursor: pointer;"
>
<!-- <img src="@/assets/tableicon/u884.png" title="打印" style="cursor: pointer;"> -->
</span>
</template>
</el-table-column>
</el-table>
<div v-if="activeName == '2'" id="myEchart1" style="width: 100%;height:calc(100vh - 380px)"></div>
<div v-if="activeName == '3'" id="myEchart2" style="width: 100%;height:calc(100vh - 380px)"></div>
<Viewfile v-if="isViewfile" :showTime="true" :title="'查看学生体检报告'" :url="ViewfileUrl" :type="'docx'" :clientHeight="600"
@update="CloseView" />
</div>
</template>
<style scoped lang="scss">
.schoolStudent-title{
display: flex;
justify-content: space-between;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 18px;
color: #282828;
.class_order{
padding-bottom: 5px;
border-bottom:3px solid #409eff;
}
.return{
display: flex;
align-items: center;
justify-content: center;
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #409EFF;
width: 50px;
height: 26px;
border: 1px solid #C6E2FF;
background: rgb(236, 245, 255);
border-radius:4px;
cursor: pointer;
}
}
.schoolStudent-line{
width: 100%;
height: 1px;
background: rgb(220, 223, 230);
margin-top: -1px;
}
.basicname{
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #333333;
text-align: left;
padding-bottom: 15px;
}
.basicinfo{
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 14px;
color: #787878;
text-align: left;
}
.valuetext{
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 14px;
color: #363636;
padding-right: 50px;
padding-left: 10px;
}
.schoolStudent-box{
width: 100%;
height: calc(100vh - 130px);
overflow: auto;
background-color: rgb(255, 255, 255);
border: none;
border-radius: 3px;
padding: 10px 15px 10px;
box-sizing: border-box;
.schoolStudent-title{
display: flex;
justify-content: space-between;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 18px;
color: #282828;
.class_order{
padding-bottom: 5px;
border-bottom:3px solid #409eff;
}
.return{
display: flex;
align-items: center;
justify-content: center;
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #409EFF;
width: 50px;
height: 26px;
border: 1px solid #C6E2FF;
background: rgb(236, 245, 255);
border-radius:4px;
cursor: pointer;
}
}
.schoolStudent-line{
width: 100%;
height: 1px;
background: rgb(220, 223, 230);
margin-top: -1px;
}
}
</style>

View File

@ -1,712 +0,0 @@
<script lang="ts">
export default {
name: 'screeningresults' // -
};
</script>
<script setup lang="ts">
import { onMounted, ref, nextTick ,watch} from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable,ElTree} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import Viewfile from "@/views/component/Viewfile.vue";
import Archive from './archive.vue'
import { queryRegionSchool } from "@/api/regionmodule/school";
import { querySchoolGradeList } from "@/api/regionmodule/schoolGrade";
import { querySchoolClassList } from "@/api/regionmodule/schoolClass";
import { queryStudentVisdataPage,exportStudentResult,exportSchoolHealthNetwork } from "@/api/planscreening";
import { downloadFile } from '@/utils/index'
import { publicTree } from '@/utils/validate';
import { getToken } from '@/utils/auth'
import * as XLSX from 'xlsx';
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const queryInfo :any = ref({
idCode:"",
studyCode:"",
isSighted:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
})
const searchlist:any = ref({})
const tableData = ref([])
const multipleSelection = ref([])
const defaultcontent = ref(true)
const genderoptions:any = ref([{label:'男',value:'1'},{label:'女',value:'2'}])
const sightedData:any = ref([{label:'是',value:'1'},{label:'否',value:'0'}])
const loading = ref(false)
const isViewfile = ref(false)
const studentInfo = ref({})
//
const treeData: any = ref([]);
const treeloading = ref(false)
const defaultProps = { label: "name" }
const checktreelist:any = ref({})
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const treeRef = ref<InstanceType<typeof ElTree>>()
const filterNode = (value: string, data: Tree) => {
if (!value) return true
return data.name.includes(value)
}
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
onMounted(() => {
getTree()
});
//
const schoolId = ref("")
const handleNodeClick = (data: Tree) => {
if(data.org_type == null){
nextTick(() => {
treeRef.value?.setCurrentKey(schoolId.value);
});
}else{
schoolId.value = data.id
schoolName.value = data.name
treeRef.value?.setCurrentKey(data.id);
queryInfo.value = {
idCode:"",
studyCode:"",
isSighted:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
}
gradeinData.value = []
classData.value = []
getGrade()
getData()
}
};
//
function getData(){
let params = {
studentName:queryInfo.value.name,
idCode:queryInfo.value.idCode,
studyCode:queryInfo.value.studyCode,
isSighted:queryInfo.value.isSighted,
schoolId:schoolId.value,
gradeId:queryInfo.value.gradeId,
classId:queryInfo.value.classId,
gender:queryInfo.value.gender,
current: queryInfo.value.current,
size:queryInfo.value.size,
type:'2'
};
console.log(queryInfo.value)
loading.value = true
queryStudentVisdataPage(params).then((res:any) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
});
}
//
function exportclick(){
let params = {
studentName:queryInfo.value.name,
idCode:queryInfo.value.idCode,
studyCode:queryInfo.value.studyCode,
isSighted:queryInfo.value.isSighted,
schoolId:schoolId.value,
gradeId:queryInfo.value.gradeId,
classId:queryInfo.value.classId,
gender:queryInfo.value.gender
};
if(radioStr.value == "1"){
loading.value = true
exportStudentResult(params).then((response: any) => {
isExportVisible.value = false
downloadFile(response,schoolName.value+ '-学生筛查结果', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(radioStr.value == "2"){
loading.value = true
exportSchoolHealthNetwork(params).then((response: any) => {
isExportVisible.value = false
downloadFile(response,schoolName.value+ '-学生体质健康网模板', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}
}
//
function viewreportclick(row:any){
ViewfileUrl.value = url + '/vision_examine/examine-result/exportVisionForm?id=' + row.id
isViewfile.value = true
}
function CloseView(){
isViewfile.value = false
}
//
function archiveclick(row:any){
studentInfo.value = row
defaultcontent.value = false
}
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function resetdata(){
queryInfo.value = {
idCode:"",
studyCode:"",
isSighted:"",
gradeId:"",
classId:"",
gender:"",
name:"",
current:1,
size:10,
total:0
}
getData()
}
function returnClick(){
defaultcontent.value = true
}
const regionName = ref("")
function searchInit(){
treeData.value = publicTree(tempData.value,regionName.value)
}
function checkId(tree:any){
for(let i=0; i<tree.length;i++){
if(tree[i].region_id==null && tree[i].children){
checkId(tree[i].children)
}else{
if(tree[i].region_id!=null){
schoolId.value = tree[i].id
schoolName.value = tree[i].name
return
}
}
}
}
const tempData:any = ref([])
//
function getTree() {
const params = {
status:'01',
name: regionName.value,
};
treeloading.value = true
queryRegionSchool(params).then((res: any) => {
for(let i=0;i<res.data.length;i++){
if(res.data[i].org_type == "5"){
schoolId.value = res.data[i].id
schoolName.value =res.data[i].name
break
}
}
tempData.value = JSON.parse(JSON.stringify(res.data))
treeData.value = publicTree(res.data,"")
gradeinData.value = []
classData.value = []
checkId(res.data)
treeloading.value = false
if(schoolId.value != ""){
nextTick(() => {
treeRef.value?.setCurrentKey(schoolId.value);
getGrade()
getData();
});
}
})
.catch((error:any)=>{
treeloading.value = false
})
}
const gradeinData:any = ref([])
const classData:any = ref([])
function getGrade(){
let params = {
schoolId: schoolId.value
}
classData.value = []
queryInfo.value.classId = ""
querySchoolGradeList(params).then((res) => {
gradeinData.value = res.data;
}).catch(()=>{
});
}
function getClass(id:any){
let params = {
gradeId: id
}
classData.value = []
queryInfo.value.classId = ""
if(id != null && id != '' ){
querySchoolClassList(params).then((res) => {
classData.value = res.data;
}).catch(()=>{
});
}
getData()
}
function dateFormat(row: any) {
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
//
return year + "-" + month + "-" + day ;
}
}
const ViewfileUrl = ref("")
const errorData:any = ref([])
const dialogTableVisible = ref(false)
function handlesSuccess(file: any) {
loading.value = false
if(file.code == "0"){
ElMessage({
message: "导入成功!",
type: "success",
});
getData()
}else{
errorData.value = []
let msg = file.msg.split("<br>")
msg.forEach(element => {
errorData.value.push({name:element})
});
dialogTableVisible.value = true
// ElMessage({
// message: file.msg,
// type: "error",
// });
}
upload.value.clearFiles()
}
const upload:any = ref(null)
const schoolName:any = ref("")
function handleError(file: any){
loading.value = false
ElMessage({
message: "导入失败!",
type: "error",
});
upload.value.clearFiles()
}
function handlePreview(){
loading.value = true
}
const isExportVisible = ref(false)
const radioStr = ref("1")
function exportVisibleClick(){
radioStr.value = "1"
isExportVisible.value = true
}
function exportToExcel() {
// DOM
const table = document.querySelector('.screeningresults_table_error');
// 使 html-to-xlsx
const ws = XLSX.utils.table_to_sheet(table);
//
const colWidths = [
{ wch: 5 },
{ wch: 70 },
];
ws['!cols'] = colWidths;
// 簿
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
// Excel
XLSX.writeFile(wb, '导入错误信息.xlsx');
};
</script>
<template>
<div v-if="defaultcontent" class="printcode-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div style="width:100%;padding: 5px 15px;">
<el-input v-model="regionName" placeholder="请输入关键字" @input="searchInit" />
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData" default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 260px); overflow: auto;margin-top: 10px;">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="searchinfo">
<el-input v-model="queryInfo.name" placeholder="请输入学生姓名" style="width: 16%;" clearable />
<el-select v-model="queryInfo.gender" @change="getData" clearable style="width: 16%;" class="ml-3" placeholder="请选择性别">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-input v-model="queryInfo.studyCode" class="ml-3" placeholder="请输入学籍号" style="width: 24%;" clearable />
<el-input v-model="queryInfo.idCode" class="ml-3" placeholder="请输入身份证号" style="width: 24%;" clearable />
<el-select v-model="queryInfo.isSighted" class="ml-3" placeholder="是否近视" style="width: 16%" @change="getData" clearable >
<el-option v-for="item in sightedData" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</div>
<div class="searchinfo">
<div style="width:50%" class="flex">
<el-select v-model="queryInfo.gradeId" @change="getClass" placeholder="请选择年级" clearable style="width: 33%;" :disabled="schoolId==''|| schoolId==null">
<el-option v-for="item in gradeinData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.classId" @change="getData" class="ml-3" placeholder="请选择班级" clearable style="width: 33%;" :disabled="queryInfo.gradeId==''|| queryInfo.gradeId==null">
<el-option v-for="item in classData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<div style="width: 34%">
<el-button type="primary" @click="getData">搜索</el-button>
<el-button @click="resetdata">重置</el-button>
</div>
</div>
<div style="width:50%;text-align: right; display: flex;justify-content: end;">
<el-button type="primary" @click="exportVisibleClick">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div v-loading="loading">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 340px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" fixed />
<el-table-column fixed prop="student_name" label="姓名" width="100" />
<el-table-column prop="gender" label="性别" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-if="scope.row.gender == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="birth_date" label="出生日期" width="120" align="center" />
<el-table-column prop="nation" label="民族" width="80" align="center" />
<el-table-column prop="study_code" label="学籍号" width="190" align="center" />
<el-table-column prop="id_code" label="身份证" width="180" align="center" />
<el-table-column prop="grade_name" label="所属年级" min-width="90" />
<el-table-column prop="class_name" label="所属班级" min-width="90" />
<el-table-column prop="exam_time" label="检查时间" width="140" align="center">
<template #default="scope">
{{dateFormat(scope.row.exam_time)}}
</template>
</el-table-column>
<el-table-column prop="vision_left" label="左眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_left !=0 && scope.row.vision_left!=null"> {{scope.row.vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="vision_right" label="右眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_right !=0 && scope.row.vision_right!=null"> {{scope.row.vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="sph_left" label="左眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_left !=0 && scope.row.sph_left!=null">
<span v-if="scope.row.sph_left>0">+{{scope.row.sph_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="sph_right" label="右眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_right !=0 && scope.row.sph_right!=null">
<span v-if="scope.row.sph_right>0">+{{scope.row.sph_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_left" label="左眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_left !=0 && scope.row.cytdnder_left!=null">
<span v-if="scope.row.cytdnder_left>0">+{{scope.row.cytdnder_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_right" label="右眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_right !=0 && scope.row.cytdnder_right!=null">
<span v-if="scope.row.cytdnder_right>0">+{{scope.row.cytdnder_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="axies_left" label="左眼轴位" width="60" align="center"/>
<el-table-column prop="axies_right" label="右眼轴位" width="60" align="center"/>
<el-table-column prop="se_left" label="左眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_left !=0 && scope.row.se_left!=null">
<span v-if="scope.row.se_left>0">+{{scope.row.se_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="se_right" label="右眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_right !=0 && scope.row.se_right!=null">
<span v-if="scope.row.se_right>0">+{{scope.row.se_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_left" label="左眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_left !=0 && scope.row.rectify_vision_left!=null"> {{scope.row.rectify_vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_right" label="右眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_right !=0 && scope.row.rectify_vision_right!=null"> {{scope.row.rectify_vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="is_sighted" label="是否近视" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.is_sighted == '0'"></span>
<span v-if="scope.row.is_sighted == '1'"></span>
</template>
</el-table-column>
<el-table-column prop="is_hyperopia" label="远视储备是否充足" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.age >12">/</span>
<span v-else-if="scope.row.is_hyperopia == '1'"></span>
<span v-else-if="scope.row.is_hyperopia == '0'"></span>
</template>
</el-table-column>
<el-table-column prop="is_glasses" label="是否戴镜" width="100" align="center">
<template #default="scope">
<span v-if="scope.row.is_glasses == '0'||scope.row.is_glasses == ''||scope.row.is_glasses == null">未知</span>
<span v-if="scope.row.is_glasses == '4'">不带镜</span>
<span v-if="scope.row.is_glasses == '3'">角膜塑形镜</span>
<span v-if="scope.row.is_glasses == '2'">隐形眼镜</span>
<span v-if="scope.row.is_glasses == '1'">框架眼镜</span>
</template>
</el-table-column>
<el-table-column prop="address" label="操作" width="80" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/visionscreening/viewreport.png" alt="" title="查看结果记录表" @click="viewreportclick(scope.row)" style="cursor: pointer;">
<img src="@/assets/visionscreening/archive.png" alt="" title="历史档案" @click="archiveclick(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
</div>
<Viewfile v-if="isViewfile" :showTime="true" :title="'查看结果记录表'" :type="'docx'" :clientHeight="600" @update="CloseView"/>
<Viewfile v-if="isViewfile" :url="ViewfileUrl" :showTime="true" :title="'查看结果记录表'" :type="'docx'" :clientHeight="600" @update="CloseView"/>
</div>
<Archive v-if="!defaultcontent" :studentInfo="studentInfo" @returnStudent="returnClick" />
<el-dialog v-model="dialogTableVisible" title="导入学生错误信息列表" width="800">
<el-button style="margin-bottom: 10px" type="primary" @click="exportToExcel">导出错误信息</el-button>
<el-table class="screeningresults_table_error" :data="errorData" style="height: calc(100vh - 200px);" border>
<el-table-column type="index" width="90" />
<el-table-column prop="name" label="内容" />
</el-table>
</el-dialog>
<el-dialog v-model="isExportVisible" title="导出数据" width="350">
<div v-loading="loading">
<div>
<el-radio label="1" size="large" v-model="radioStr">系统模版数据导出</el-radio>
</div>
<div>
<el-radio label="2" size="large" v-model="radioStr">体质健康网模版数据最近导出</el-radio>
</div>
<!-- <el-radio label="3" size="large" v-model="radioStr">体质健康网模版数据最优导出</el-radio> -->
<div style="display: flex;justify-content: end;margin-top: 10px;">
<el-button type="primary" @click="exportclick" style="padding:5px;width: 60px;">确定</el-button>
</div>
</div>
</el-dialog>
</template>
<style scoped lang="scss">
.printcode-box{
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
:deep(){
.el-input{
width: 240px;
}
}
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 145px);
overflow: auto;
background-color: rgba(255, 255, 255, 1);
border-radius: 3px;
padding: 20px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(){
.el-button{
margin-left: 10px;
}
// .el-tree-node__content{
// height: 40px;
// padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
}
.searchinfo{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.QRbox{
height: calc(100vh - 200px);
text-align: center;
}
</style>

View File

@ -1,408 +0,0 @@
<script lang="ts">
export default {
name: 'associztionschool' //
};
</script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import { queryPlanSchoolPage } from "@/api/regionmodule/school";
import { queryRegionById } from "@/api/regionmodule/region";
import { queryExamineSchoolPage,addExamineSchool,delExamineSchool } from "@/api/planscreening";
import { publicTree } from '@/utils/validate';
import { getDict } from '@/api/dict'
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
defineExpose({
init
})
const queryInfo :any = ref({
current:1,
size:10,
total:0,
name:''
})
const queryInfos :any = ref({
name:'',
current:1,
size:10,
total:0
})
const searchval = ref('')
const tableData = ref([])
const multipleSelection = ref([])
const dialogFormVisible = ref(false)
const multipleSelections = ref([])
const loading = ref(false)
const schoolloading = ref(false)
const loadingtext = ref('')
const examineLoading = ref(false)
onMounted(() => {
regionId.value = props.planInfo.org_id
regionType.value = props.planInfo.org_type
init()
getDict({ dictcode: 'schoolType' }).then((res) => {
schoolTypeList.value = res.data
})
})
const planId = ref("")
//
function init(){
searchval.value = searchval.value.replace(/\s+/g, "");
let params = {
name: searchval.value,
planId: props.planInfo.id,
current: queryInfos.value.current,
size:queryInfos.value.size
};
examineLoading.value = true
queryExamineSchoolPage(params).then((res) => {
tableData.value = res.data.records;
queryInfos.value.total = res.data.total
examineLoading.value = false
}).catch(()=>{
examineLoading.value = false
});
}
function addinfo(){
getSchool()
if(props.planInfo.org_type != "5"){
getRegionTree()
}
multipleSelections.value = []
dialogFormVisible.value = true
}
const dialogtable = ref<InstanceType<typeof ElTable>>()
function infosubmit(){
ElMessageBox.confirm("确定关联已选择的学校吗?", "关联提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let id = [] as any[];
multipleSelections.value.forEach((item: any) => {
id.push(item.id)
})
let params = {
ids: id.join(','),
planId: props.planInfo.id
};
schoolloading.value = true
loadingtext.value = '正在关联学校普检学生,请耐心等待!!'
addExamineSchool(params).then(() => {
schoolloading.value = false
loadingtext.value = ''
dialogtable.value!.clearSelection()
dialogFormVisible.value = false
init()
ElMessage({
message: "关联成功",
type: "success",
});
}).catch(()=>{
loadingtext.value = ''
schoolloading.value = false
})
});
}
function delinfo(row: any) {
ElMessageBox.confirm("确定删除此学校吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let params = {
ids: row.id,
};
delExamineSchool(params).then(() => {
init();
ElMessage({
message: "解除关联学校",
type: "success",
});
});
});
}
function delinfos() {
ElMessageBox.confirm("确定删除此学校吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let id = [] as any[];
multipleSelection.value.forEach((item: any) => {
id.push(item.id)
})
let params = {
ids: id.join(','),
};
delExamineSchool(params).then(() => {
init();
ElMessage({
message: "解除关联学校",
type: "success",
});
});
});
}
//
function getData(){
console.log(11)
}
//
function getDatas(){
console.log(11)
}
//
function searchclick(){
init()
}
function handleClose(){
dialogtable.value!.clearSelection()
dialogFormVisible.value = false
}
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function handleSelectionChanges(val:any){
multipleSelections.value = val
}
function resetdata(){
}
//
function getRegionTree() {
const params = {
regionId: props.planInfo.org_id,
regionType: props.planInfo.org_type,
};
queryRegionById(params).then((res: any) => {
regiondata.value = res.data
cascaderdata.value = publicTree(res.data,"");
})
.catch((error:any)=>{
})
}
//
const props1 = {
checkStrictly: true,
value:'id',
label:'name'
}
const cascaderdata: any = ref([]);
const regiondata: any = ref([]);
const schoolData = ref([])
//
const regionId = ref("")
const regionType = ref("")
function handleChange(value:any){
if(value.length != 0){
regionId.value = value[value.length -1]
for(let i=0;i<regiondata.value.length;i++){
if(regionId.value == regiondata.value[i].id){
regionType.value = regiondata.value[i].type
break
}
}
}
isCascader.value = false
setTimeout(()=>{
isCascader.value = true
},20)
getSchool()
}
function handleClick(data:any){
if(data.children == null){
isCascader.value = false
setTimeout(()=>{
isCascader.value = true
},20)
}
regionId.value = data.id
regionType.value = data.type
getSchool()
}
//
function getSchool() {
queryInfo.value.name = queryInfo.value.name.replace(/\s+/g, "");
let params = {}
if(props.planInfo.org_type != '5'){
params = {
name: queryInfo.value.name,
regionId: regionId.value,
current: queryInfo.value.current,
size:queryInfo.value.size,
type:regionType.value
};
} else {
params = {
name: queryInfo.value.name,
schoolId:props.planInfo.org_id,
current: queryInfo.value.current,
size:queryInfo.value.size,
type:props.planInfo.org_type
};
}
schoolloading.value = true
queryPlanSchoolPage(params).then((res) => {
schoolData.value = res.data.records;
queryInfo.value.total = res.data.total
schoolloading.value = false
}).catch(()=>{
schoolloading.value = false
});
}
const isCascader=ref(true)
const schoolTypeList:any = ref([])
function currency(list: any, itemcode: any) {
let dictname = ''
list.forEach((element: any) => {
if (element.itemcode == itemcode) {
dictname = element.dictname
}
})
return dictname
}
</script>
<template>
<div class="content-box">
<div class="box-search">
<div class="flex">
<el-input v-model="searchval" placeholder="请输入学校名称" clearable style="width:200px" />
<el-button type="primary" class="ml-[10px]" @click="searchclick">搜索</el-button>
</div>
<div>
<el-button type="primary" @click="addinfo"><img src="@/assets/visionscreening/jscz_xz.png" alt="" style="margin-right: 4px;" >添加</el-button>
<el-button @click="delinfos" :disabled="multipleSelection.length <= 0" :type="multipleSelection.length > 0 ? 'primary' : ''">
<el-icon><Delete /></el-icon> </el-button>
</div>
</div>
<div v-loading="examineLoading">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 430px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<!-- <el-table-column prop="code" label="学校代码" width="100" /> -->
<el-table-column prop="name" label="学校名称" min-width="120" />
<!-- <el-table-column prop="education_code" label="教育机构代码" min-width="100" /> -->
<el-table-column prop="teach_type" label="办学类型" width="170">
<template #default="scope">{{ currency(schoolTypeList, scope.row.teach_type) }}</template>
</el-table-column>
<el-table-column prop="custom1" label="学校类型" width="140">
<template #default="scope">
<span v-if="scope.row.custom1 !=null && scope.row.custom1 !=''">
{{ scope.row.custom1.split("-")[1] }}
</span>
</template>
</el-table-column>
<el-table-column prop="region_name" label="所属区域" />
<!-- <el-table-column prop="teacher_name" label="校长姓名" width="100" /> -->
<el-table-column label="操作" width="80" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delinfo(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfos.total" v-model:size="queryInfos.size" v-model:current="queryInfos.current"
@pagination="init" />
</div>
<el-dialog v-model="dialogFormVisible" :close-on-click-modal="false" title="选择筛选学校" :before-close="handleClose" width="880px" draggable append-to-body>
<div v-loading="schoolloading"
:element-loading-text="loadingtext">
<div class="dialogsearch">
<div style="display: flex;">
<el-input v-model="queryInfo.name" placeholder="请输入学校名称" style="width: 150px;margin-right: 10px;" clearable />
<div style="width: 200px; margin-right: 10px;">
<el-cascader v-if="planInfo.org_type != '5' && isCascader == true" style="width: 200px;" placeholder="请输入行政区域" v-model="regionId" @change="handleChange"
:options="cascaderdata" :props="props1" :show-all-levels="false" filterable>
<template #default="{ node, data }">
<div @click.stop="handleClick(data)">{{ data.name }}</div>
</template>
</el-cascader>
</div>
<el-button type="primary" @click="getSchool">搜索</el-button>
<el-button @click="resetdata">重置</el-button>
</div>
<div>
<el-button type="primary" @click="infosubmit">确定</el-button>
</div>
</div>
<el-table ref="dialogtable" :data="schoolData" border style="width: 100%; height:calc(100vh - 445px)" @selection-change="handleSelectionChanges" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<el-table-column prop="region_name" label="所属区域" width="200" />
<el-table-column prop="custom1" label="学校类型" width="140">
<template #default="scope">
<span v-if="scope.row.custom1 !=null && scope.row.custom1 !=''">
{{ scope.row.custom1.split("-")[1] }}
</span>
</template>
</el-table-column>
<el-table-column prop="name" label="学校名称" min-width="150" />
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getSchool" />
</div>
</el-dialog>
</div>
</template>
<style scoped lang="scss">
.content-box{
margin-top: 15px;
width: 100%;
height: 100%;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
background-color: #fff;
padding: 20px;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
// :deep(){
// .el-input{
// height:40px;
// line-height: 40px;
// width: 240px;
// }
// .el-button{
// height:40px;
// }
// }
}
}
// :deep(){
// .el-input{
// height: 40px;
// line-height: 40px;
// }
// .el-button{
// height:40px;
// margin-left: 10px;
// }
// }
.dialogsearch{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
</style>

View File

@ -1,653 +0,0 @@
<script lang="ts">
export default {
name: 'checkprogresss' // -
};
</script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import Viewfile from "@/views/component/Viewfile.vue";
import { queryExamineSchoolTree,queryExamineResultPage,queryCompletionRate,queryRulesSchoolList
,exportNotInspectedQRCode } from "@/api/planscreening";
import { exportStudentSwan,uploadDataToBureau } from "@/api/planscreening";
import { downloadFile } from '@/utils/index'
import { querySchoolGradeList } from "@/api/regionmodule/schoolGrade";
import { querySchoolClassList } from "@/api/regionmodule/schoolClass";
import { getMap } from "echarts";
import { publicTree } from '@/utils/validate';
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const isItutionIds = ref(false)
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const queryInfo :any = ref({
current:1,
size:10,
total:0,
name:"",
})
const examStatusData = ref([{label:'未检',value:'00'},{label:'已检',value:'01'},{label:'漏检',value:'02'}])
const isSightedData = ref([{label:'否',value:'0'},{label:'是',value:'1'}])
const tableData = ref([])
const multipleSelection = ref([])
const genderoptions:any = ref([{label:'男',value:'1'},{label:'女',value:'2'}])
const loading = ref(false)
//
const treeloading = ref(false)
const defaultProps = { label: "name" }
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const isViewfile = ref(false)
onMounted(() => {
getTree()
init()
if(window.webConfig !=null && window.webConfig.ItutionIds !=null){
isItutionIds.value = window.webConfig.ItutionIds.includes(props.planInfo.institution_id)
}
})
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
//
function searchclick(){
init()
}
//
function lookinfo(row:any){
ViewfileUrl.value = url + '/vision_examine/examine-result/exportVisionForm?id=' + row.id
isViewfile.value = true
}
function CloseView(){
isViewfile.value = false
}
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function resetdata(){
queryInfo.value = {
current:1,
size:10,
total:0,
studentName:"",
}
init()
}
const treeLoading = ref(false)
const treeData:any = ref([])
function getTree(){
if(props.planInfo.exam_type == '01'){
let params = {
planId: props.planInfo.id,
orgId: props.planInfo.org_id,
orgType: props.planInfo.org_type,
};
treeLoading.value = true
queryExamineSchoolTree(params).then((res) => {
treeData.value = publicTree(res.data,"")
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}else{
//
let params = {
planId:props.planInfo.id
}
treeLoading.value = true
queryRulesSchoolList(params).then((res) => {
treeData.value = res.data;
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}
}
//
function init(){
let params:any = {
studentName:queryInfo.value.studentName,
planId: props.planInfo.id,
examType: props.planInfo.exam_type,
gender: queryInfo.value.gender,
regionId: queryInfo.value.regionId,
schoolId: queryInfo.value.schoolId,
gradeId: queryInfo.value.gradeId,
classId: queryInfo.value.classId,
idCode: queryInfo.value.idCode,
studyCode: queryInfo.value.studyCode,
examStatus: queryInfo.value.examStatus,
isSighted: queryInfo.value.isSighted,
startSphLeft: queryInfo.value.startSphLeft,
endSphLeft: queryInfo.value.endSphLeft,
startSphRight: queryInfo.value.startSphRight,
endSphRight: queryInfo.value.endSphRight,
current:queryInfo.value.current,
size:queryInfo.value.size
};
if(nodeData.value.org_type =='5'){
params.schoolId = nodeData.value.id
params.regionId = ""
}else{
params.regionId = nodeData.value.id
params.schoolId = ""
}
loading.value = true
queryExamineResultPage(params).then((res) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
getMap(params)
}
const ViewfileUrl = ref("")
const nodeData:any = ref({})
const schoolId = ref("")
const schoolName = ref("")
const orgType = ref("")
const handleNodeClick = (data: Tree) => {
nodeData.value = data
if(data.org_type == "5"){
orgType.value = "5"
schoolId.value = data.id
schoolName.value = data.name
}else{
schoolId.value = ""
schoolName.value = ""
}
gradeinData.value = []
classData.value = []
queryInfo.value.gradeId = ""
queryInfo.value.classId = ""
getGrade()
init()
};
const resultInfo:any =ref({})
function getMap(params:any){
queryCompletionRate(params).then((res) => {
resultInfo.value = res.data;
}).catch(()=>{
});
}
const gradeinData:any = ref([])
const classData:any = ref([])
function getGrade(){
let params:any = {}
if(schoolId.value == ""){
gradeinData.value = []
return
}else{
params.schoolId = schoolId.value
}
classData.value = []
queryInfo.value.classId = ""
querySchoolGradeList(params).then((res) => {
gradeinData.value = res.data;
}).catch(()=>{
});
}
function getClass(id:any){
let params = {
gradeId: id
}
classData.value = []
queryInfo.value.classId = ""
if(id != null && id != '' ){
querySchoolClassList(params).then((res) => {
classData.value = res.data;
}).catch(()=>{
});
}
init()
}
function dateFormat(row: any) { //
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
function fileSwanDown(row:any) {
const params = {
id: row.id
}
exportStudentSwan(params).then((response: any) => {
downloadFile(response, row.student_name + '生物报告600模版', 'docx')
}).catch(() => {
});
}
const exportText =ref("")
function uploadNetwork(){
ElMessageBox.confirm('请先检查学生视力数据中的“身份证号,左右眼戴镜视力、”数据项是否完整,数据不完整将无法上传到教育局!您确定将“'+ schoolName.value +'”的学生视力筛查数据上传到教育局吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
planid: props.planInfo.id,
schoolid:schoolId.value
}
uploadDataToBureau(params).then((response:any) => {
}).catch(()=>{
})
});
}
</script>
<template>
<div class="contents-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData"
default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 350px); overflow: auto">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="searchinfo">
<el-input v-model="queryInfo.studentName" placeholder="请输入学生姓名" style="width: 20%;" clearable />
<el-select v-model="queryInfo.gradeId" @change="getClass" class="ml-4" placeholder="请选择年级" clearable size="large" style="width: 20%" :disabled="schoolId==''|| schoolId==null">
<el-option v-for="item in gradeinData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.classId" @change="init" class="ml-4" placeholder="请选择班级" clearable size="large" style="width: 20%" :disabled="queryInfo.gradeId==''|| queryInfo.gradeId==null">
<el-option v-for="item in classData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.gender" class="ml-4" placeholder="请选择性别" size="large" style="width: 20%" clearable @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-input v-model="queryInfo.studyCode" class="ml-4" placeholder="请输入学籍号" style="width: 20%;" clearable />
<el-input v-model="queryInfo.idCode" class="ml-4" placeholder="请输入身份证号" style="width: 20%;" clearable />
</div>
<div class="searchinfos">
<div class="flex items-center" style="width: 90%;">
<el-select v-model="queryInfo.examStatus" placeholder="请选择状态" style="width: 160px" clearable @change="init">
<el-option v-for="item in examStatusData" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-select v-model="queryInfo.isSighted" class="ml-4" placeholder="是否近视" style="width: 160px" clearable @change="init">
<el-option v-for="item in isSightedData" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-input v-model="queryInfo.startSphLeft" class="ml-4" placeholder="左眼球镜起始值" style="width: 140px" clearable />
<div class="ml-1">-</div>
<el-input v-model="queryInfo.endSphLeft" class="ml-4" placeholder="左眼球镜结束值" style="width: 140px" clearable />
<el-input v-model="queryInfo.startSphRight" class="ml-4" placeholder="右眼球镜起始值" style="width: 140px" clearable />
<div class="ml-1">-</div>
<el-input v-model="queryInfo.endSphRight" class="ml-4" placeholder="右眼球镜结束值" style="width: 140px" clearable />
<el-button type="primary" @click="searchclick" style="margin-left: 10px;">搜索</el-button>
<el-button @click="resetdata">重置</el-button>
<el-button v-if="isItutionIds == true" :disabled="schoolId ==''|| schoolId ==null" type="primary" @click="uploadNetwork">上传教育局</el-button>
</div>
</div>
<div class="text-[14px] flex mb-[10px]">
<div class="statistics-text">共有学生<span class="text-[#409EFF] font-bold pl-[3px]">{{ resultInfo.total }}</span></div>
<div class="statistics-text">已检<span class="text-[#009933] font-bold pl-[3px]">{{ resultInfo.checked }}</span></div>
<div class="statistics-text">未检<span class="text-[#FF9900] font-bold pl-[3px]">{{ resultInfo.unchecked }}</span></div>
<div class="statistics-text">漏检学生<span class="text-[#FF3300] font-bold pl-[3px]">{{ resultInfo.missing }}</span></div>
<div v-if="isItutionIds == true" class="statistics-text">上传教育局人数<span class="text-[#009933] font-bold pl-[3px]">{{ resultInfo.uploadnum }}</span></div>
<div class="statistics-text">完成率<span class="text-[#409EFF] font-bold pl-[3px]">{{ resultInfo.completionRate }}</span></div>
</div>
<div v-loading="loading" :element-loading-text="exportText">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 515px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column fixed type="selection" width="55" />
<el-table-column fixed type="index" width="55" label="序号" align="center" />
<el-table-column fixed prop="student_name" label="姓名" width="100" />
<el-table-column prop="gender" label="性别" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-if="scope.row.gender == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="birth_date" label="出生日期" width="120" align="center" />
<el-table-column prop="nation" label="民族" width="80" align="center" />
<el-table-column prop="study_code" label="学籍号" width="190" align="center" />
<el-table-column prop="grade_name" label="所属年级" min-width="120" />
<el-table-column prop="class_name" label="所属班级" min-width="120" />
<el-table-column prop="exam_status" label="状态" align="center">
<template #default="scope">
<span v-if="scope.row.exam_status == '00'">未检</span>
<span v-if="scope.row.exam_status == '01'">已检</span>
<span v-if="scope.row.exam_status == '02'">漏检</span>
</template>
</el-table-column>
<!-- <el-table-column prop="exam_time" label="检查时间" width="120" align="center"/> -->
<el-table-column prop="exam_time" label="检查时间" width="120" align="center">
<template #default="scope">
{{dateFormat(scope.row.exam_time)}}
</template>
</el-table-column>
<el-table-column prop="vision_left" label="左眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_left !=0 && scope.row.vision_left!=null"> {{scope.row.vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="vision_right" label="右眼视力" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.vision_right !=0 && scope.row.vision_right!=null"> {{scope.row.vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="sph_left" label="左眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_left !=0 && scope.row.sph_left!=null">
<span v-if="scope.row.sph_left>0">+{{scope.row.sph_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="sph_right" label="右眼球镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.sph_right !=0 && scope.row.sph_right!=null">
<span v-if="scope.row.sph_right>0">+{{scope.row.sph_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.sph_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_left" label="左眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_left !=0 && scope.row.cytdnder_left!=null">
<span v-if="scope.row.cytdnder_left>0">+{{scope.row.cytdnder_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="cytdnder_right" label="右眼柱镜" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.cytdnder_right !=0 && scope.row.cytdnder_right!=null">
<span v-if="scope.row.cytdnder_right>0">+{{scope.row.cytdnder_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.cytdnder_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="axies_left" label="左眼轴位" width="60" align="center"/>
<el-table-column prop="axies_right" label="右眼轴位" width="60" align="center"/>
<el-table-column prop="se_left" label="左眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_left !=0 && scope.row.se_left!=null">
<span v-if="scope.row.se_left>0">+{{scope.row.se_left.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_left.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="se_right" label="右眼等效球镜" width="120" align="center">
<template #default="scope">
<span v-if="scope.row.se_right !=0 && scope.row.se_right!=null">
<span v-if="scope.row.se_right>0">+{{scope.row.se_right.toFixed(2)}}D</span>
<span v-else>{{scope.row.se_right.toFixed(2)}}D</span>
</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_left" label="左眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_left !=0 && scope.row.rectify_vision_left!=null"> {{scope.row.rectify_vision_left.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="rectify_vision_right" label="右眼矫正视力" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.rectify_vision_right !=0 && scope.row.rectify_vision_right!=null"> {{scope.row.rectify_vision_right.toFixed(1)}}</span>
</template>
</el-table-column>
<el-table-column prop="id_code" label="身份证" width="180" align="center" />
<el-table-column prop="is_sighted" label="是否近视" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.is_sighted == '0'"></span>
<span v-if="scope.row.is_sighted == '1'"></span>
</template>
</el-table-column>
<el-table-column prop="is_hyperopia" label="远视储备是否充足" width="90" align="center">
<template #default="scope">
<span v-if="scope.row.age >12">/</span>
<span v-else-if="scope.row.is_hyperopia == '1'"></span>
<span v-else-if="scope.row.is_hyperopia == '0'"></span>
</template>
</el-table-column>
<el-table-column prop="is_glasses" label="是否戴镜" width="100" align="center">
<template #default="scope">
<span v-if="scope.row.is_glasses == '0'||scope.row.is_glasses == ''||scope.row.is_glasses == null">未知</span>
<span v-if="scope.row.is_glasses == '4'">不带镜</span>
<span v-if="scope.row.is_glasses == '3'">角膜塑形镜</span>
<span v-if="scope.row.is_glasses == '2'">隐形眼镜</span>
<span v-if="scope.row.is_glasses == '1'">框架眼镜</span>
</template>
</el-table-column>
<el-table-column prop="upload_uuid" label="是否已传" width="100" align="center" v-if="isItutionIds == true">
<template #default="scope">
<span v-if="scope.row.upload_uuid !=null && scope.row.upload_uuid !=''"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="address" label="操作" width="80" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/visionscreening/lookdetails.png" alt="" title="查看" @click="lookinfo(scope.row)" style="cursor: pointer;">
<img v-if="scope.row.exam_result1 !='' && scope.row.exam_result1 !=null " src="@/assets/tableicon/u889.png" title="导出生物报告" @click="fileSwanDown(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
<Viewfile v-if="isViewfile" :url="ViewfileUrl" :showTime="true" :title="'筛查结果报告'" :type="'docx'" :clientHeight="600" @update="CloseView"/>
</div>
</template>
<style scoped lang="scss">
.contents-box{
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
:deep(){
.el-input{
width: 240px;
}
}
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 285px);
overflow: auto;
background-color: rgba(255, 255, 255, 1);
border-radius: 3px;
padding: 20px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(){
// .el-input{
// height: 40px;
// line-height: 40px;
// }
// .el-button{
// height:40px;
// margin-left: 10px;
// }
.el-tree-node__content{
height: 40px;
padding-left: 12px !important;
color: #505050;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
color: #409eff;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
color: #409eff;
background-color: #ecf5ff;
}
.el-tree-node__content:hover{
color: #409eff;
background-color: transparent;
// #ecf5ff
}
.el-tree-node__expand-icon{
color: #333333;
}
}
.searchinfo{
display: flex;
align-items: center;
margin-bottom: 20px;
justify-content: space-around;
}
.searchinfos{
display: flex;
align-items: center;
margin-bottom: 20px;
justify-content:space-between
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.QRbox{
height: calc(100vh - 200px);
text-align: center;
}
.statistics-text{
color:#949494;
margin-right:35px;
}
</style>

View File

@ -1,880 +0,0 @@
<script lang="ts">
export default {
name: 'dataanalysis' //
};
</script>
<script setup lang="ts">
import { onMounted, ref,nextTick } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTree,ElTable,TabsPaneContext} from "element-plus";
import { queryExamineSchoolGradeTree,queryMyopiaStatistics,queryAbnormalStatistics,queryFarSightednessStatistics,
querySamplingComparison,exportStatistics } from "@/api/planscreening";
import Page from '@/components/Pagination/page.vue';
import { publicTree } from '@/utils/validate';
import { getDict } from '@/api/dict'
import { downloadFile } from '@/utils/index'
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const treeLoading = ref(false)
const treeData:any = ref([])
const treeRef = ref<InstanceType<typeof ElTree>>()
function getTree(){
let params = {
planId: props.planInfo.id,
orgId: props.planInfo.org_id,
orgType: props.planInfo.org_type,
};
treeLoading.value = true
queryExamineSchoolGradeTree(params).then((res) => {
treeData.value = publicTree(res.data,"")
if( treeData.value.length != 0){
nodeData.value = treeData.value[0]
nextTick(() => {
treeRef.value?.setCurrentKey(nodeData.value.id);
init()
});
}
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}
const tableData = ref([])
const tableData2 = ref([])
const tableData3 = ref([])
const tableData4 = ref([])
const genderoptions:any = ref([{label:'男',value:1},{label:'女',value:2}])
const loading = ref(false)
const sortstatus = ref(0)
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
//
const treedata: any = ref([]);
const treeloading = ref(false)
const defaultProps = { label: "name" }
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const activeName = ref('近视统计')
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
//
function init(){
let params:any = {
gender: queryInfo.value.gender,
planId:props.planInfo.id,
range: queryInfo.value.range,
schoolType: queryInfo.value.schoolType,
examType:props.planInfo.exam_type,
orgId:nodeData.value.id,
orgType:nodeData.value.org_type,
sort: queryInfo.value.sort,
current:queryInfo.value.current,
size:queryInfo.value.size,
};
loading.value = true
if(activeName.value == '近视统计'){
queryMyopiaStatistics(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].myopiaRate = ((res.data.records[i].myopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].premyopiaRate = ((res.data.records[i].premyopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].moderateRate = ((res.data.records[i].moderate / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].severeRate = ((res.data.records[i].severe / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].newRate = ((res.data.records[i].is_new_nearsighted / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].goodRate = ((res.data.records[i].is_tobe_good / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].myopiaRate = 0
res.data.records[i].premyopiaRate = 0
res.data.records[i].moderateRate = 0
res.data.records[i].severeRate =0
res.data.records[i].newRate = 0
res.data.records[i].goodRate = 0
}
}
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '视力不良统计'){
queryAbnormalStatistics(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].myopiaRate = ((res.data.records[i].myopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].premyopiaRate = ((res.data.records[i].premyopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].moderateRate = ((res.data.records[i].moderate / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].severeRate = ((res.data.records[i].severe / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].newRate = ((res.data.records[i].new / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].goodRate = ((res.data.records[i].good / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].myopiaRate = 0
res.data.records[i].premyopiaRate = 0
res.data.records[i].moderateRate = 0
res.data.records[i].severeRate =0
res.data.records[i].newRate = 0
res.data.records[i].goodRate = 0
}
}
tableData2.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '远视储备率统计'){
queryFarSightednessStatistics(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].sufficientRate = ((res.data.records[i].sufficient / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].insufficientRate = ((res.data.records[i].insufficient / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].sufficientRate = 0
res.data.records[i].insufficientRate = 0
}
}
tableData3.value = res.data.records;
loading.value = false
queryInfo.value.total = res.data.total
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '抽检对比分析'){
querySamplingComparison(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].spotCheckRate = ((res.data.records[i].spotCheck / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].spotCheckRate = '0.00'
}
if(res.data.records[i].inspect ==0){
res.data.records[i].inspectMyopiaRate = '0.00'
}else{
res.data.records[i].inspectMyopiaRate = ((res.data.records[i].inspectMyopia / res.data.records[i].inspect)* 100).toFixed(2)
}
if(res.data.records[i].spotCheck ==0){
res.data.records[i].spotCheckMyopiaRate = '0.00'
}else{
res.data.records[i].spotCheckMyopiaRate = ((res.data.records[i].spotCheckMyopia / res.data.records[i].spotCheck)* 100).toFixed(2)
}
}
tableData4.value = res.data.records;
loading.value = false
queryInfo.value.total = res.data.total
}).catch(()=>{
loading.value = false
});
}
}
const handleClick = (tab: TabsPaneContext, event: Event) => {
queryInfo.value.current = 1
queryInfo.value.total = 0
setTimeout(()=>{
init()
},200)
}
const nodeData:any = ref({})
const handleNodeClick = (data: Tree) => {
nodeData.value = data
queryInfo.value.current = 1
queryInfo.value.total = 0
queryInfo.value.gender = ""
queryInfo.value.range = ""
queryInfo.value.schoolType = ""
init()
};
//
function resetdata(type:any){
queryInfo.value = {
current:1,
size:10,
total:0
}
init()
}
//
function exportinfo(type:any){
let params:any = {
gender: queryInfo.value.gender,
planId:props.planInfo.id,
range: queryInfo.value.range,
schoolType: queryInfo.value.schoolType,
examType:props.planInfo.exam_type,
orgId:nodeData.value.id,
orgType:nodeData.value.org_type,
sort: queryInfo.value.sort,
current:1,
size:999,
};
loading.value = true
if(activeName.value == '近视统计'){
params.type = "1"
exportStatistics(params).then((response) => {
downloadFile(response,'近视统计', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '视力不良统计'){
params.type = "2"
exportStatistics(params).then((response) => {
downloadFile(response,'视力不良统计', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '远视储备率统计'){
params.type = "3"
exportStatistics(params).then((response) => {
downloadFile(response,'远视储备率统计', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '抽检对比分析'){
params.type = "4"
exportStatistics(params).then((response) => {
downloadFile(response,'抽检对比分析', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}
}
//
function sortinfo(type:any){
if(sortstatus.value === 0) {
sortstatus.value = 1
queryInfo.value.sort = 'up'
} else if(sortstatus.value === 1) {
sortstatus.value = 2
queryInfo.value.sort = 'down'
} else {
sortstatus.value = 0
queryInfo.value.sort = null
}
init()
}
onMounted(() => {
getTree()
getDict({ dictcode: 'schoolType' }).then((res) => {
schoolTypeData.value = res.data
})
});
const rangeData:any = ref([{name:'按地区统计',code:'1'},{name:'按年级统计',code:'2'}])
const schoolTypeData:any = ref([])
</script>
<template>
<div class="contents-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData"
default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 340px); overflow: auto">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRights">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="height:calc(100vh - 325px);">
<el-tab-pane label="近视统计" name="近视统计">
<div class="tabcontent">
<div class="searchinfo">
<div>
<!-- <el-select v-model="queryInfo.range" clearable placeholder="请选择统计范围" size="large" style="width: 200px">
<el-option v-for="item in rangeData" :key="item.code" :label="item.name" :value="item.code"/>
</el-select>
<el-select v-model="queryInfo.schoolType" clearable class="ml-4" placeholder="请选择学校类型" size="large" style="width: 200px">
<el-option v-for="item in schoolTypeData" :key="item.itemcode" :label="item.dictname" :value="item.itemcode"/>
</el-select> -->
<el-select v-model="queryInfo.gender" clearable class="ml-4" placeholder="请选择性别" size="large" style="width: 200px" @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="init">统计</el-button>
<el-button @click="resetdata('1')">重置</el-button>
</div>
<div>
<el-button type="primary" @click="sortinfo('1')">
<img v-if="sortstatus==0" src="@/assets/visionscreening/myopiarate.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==1" src="@/assets/visionscreening/ascsort.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==2" src="@/assets/visionscreening/descsort.png" style="padding-right: 5px;" alt="">
近视率
</el-button>
<el-button type="primary" @click="exportinfo('1')">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div>
<el-table v-loading="loading" element-loading-text="正在加载数据,请耐心等待......" ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 475px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="name" label="统计范围" />
<el-table-column prop="total" label="总人数" align="center" width="120">
<template #default="scope">
<span>{{scope.row.total}}</span>
</template>
</el-table-column>
<el-table-column prop="inspect" label="已检人数" align="center" width="100">
<template #default="scope">
<span>{{scope.row.inspect}}</span>
</template>
</el-table-column>
<el-table-column prop="myopia" label="近视人数" align="center" width="100">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.myopia}}</span>
</template>
</el-table-column>
<el-table-column prop="myopiaRate" label="近视率" align="center" width="80">
<template #default="scope">
<span class=" text-[#4099ff] font-bold">{{scope.row.myopiaRate}}%</span>
</template>
</el-table-column>
<el-table-column label="近视前期" align="center">
<el-table-column prop="premyopia" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.premyopia}}</span>
</template>
</el-table-column>
<el-table-column prop="premyopiaRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.premyopiaRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="低度近视" align="center">
<el-table-column prop="moderate" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.moderate}}</span>
</template>
</el-table-column>
<el-table-column prop="moderateRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.moderateRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="高度近视" align="center">
<el-table-column prop="severe" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.severe}}</span>
</template>
</el-table-column>
<el-table-column prop="severeRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.severeRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="新发现" align="center">
<el-table-column prop="is_new_nearsighted" align="center" label="人数" width="80" >
<template #default="scope">
<span>{{scope.row.is_new_nearsighted}}</span>
</template>
</el-table-column>
<el-table-column prop="newRate" align="center" label="比例" width="80" >
<template #default="scope">
<span>{{scope.row.newRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="好转" align="center">
<el-table-column prop="is_tobe_good" align="center" label="人数" width="80" >
<template #default="scope">
<span>{{scope.row.is_tobe_good}}</span>
</template>
</el-table-column>
<el-table-column prop="goodRate" align="center" label="比例" width="80" >
<template #default="scope">
<span>{{scope.row.goodRate}}%</span>
</template>
</el-table-column>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
</el-tab-pane>
<el-tab-pane label="视力不良统计" name="视力不良统计">
<div class="tabcontent">
<div class="searchinfo">
<div>
<!-- <el-select v-model="queryInfo.range" clearable placeholder="请选择统计范围" size="large" style="width: 200px">
<el-option v-for="item in rangeData" :key="item.code" :label="item.name" :value="item.code"/>
</el-select>
<el-select v-model="queryInfo.schoolType" clearable class="ml-4" placeholder="请选择学校类型" size="large" style="width: 200px">
<el-option v-for="item in schoolTypeData" :key="item.itemcode" :label="item.dictname" :value="item.itemcode"/>
</el-select> -->
<el-select v-model="queryInfo.gender" clearable class="ml-4" placeholder="请选择性别" size="large" style="width: 200px" @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="init">统计</el-button>
<el-button @click="resetdata('2')">重置</el-button>
</div>
<div>
<el-button type="primary" @click="sortinfo('2')">
<img v-if="sortstatus==0" src="@/assets/visionscreening/myopiarate.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==1" src="@/assets/visionscreening/ascsort.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==2" src="@/assets/visionscreening/descsort.png" style="padding-right: 5px;" alt="">
视力不良占比
</el-button>
<el-button type="primary" @click="exportinfo('2')">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div>
<el-table ref="multipleTableRef" v-loading="loading" element-loading-text="正在加载数据,请耐心等待......" :data="tableData2" border style="width: 100%; height:calc(100vh - 475px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="name" label="统计范围" />
<el-table-column prop="total" label="总人数" align="center" width="120">
<template #default="scope">
<span>{{scope.row.total}}</span>
</template>
</el-table-column>
<el-table-column prop="inspect" label="已检人数" align="center" width="100">
<template #default="scope">
<span>{{scope.row.inspect}}</span>
</template>
</el-table-column>
<el-table-column prop="myopia" label="视力不良人数" align="center" width="100">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.myopia}}</span>
</template>
</el-table-column>
<el-table-column prop="myopiaRate" label="视力不良占比" align="center" width="80" >
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.myopiaRate}}</span>%
</template>
</el-table-column>
<el-table-column label="轻度视力不良" align="center">
<el-table-column prop="premyopia" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.premyopia}}</span>
</template>
</el-table-column>
<el-table-column prop="premyopiaRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.premyopiaRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="中度视力不良" align="center">
<el-table-column prop="moderate" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.moderate}}</span>
</template>
</el-table-column>
<el-table-column prop="moderateRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.moderateRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="重度视力不良" align="center">
<el-table-column prop="severe" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.severe}}</span>
</template>
</el-table-column>
<el-table-column prop="severeRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.severeRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="新发现" align="center">
<el-table-column prop="new" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.new}}</span>
</template>
</el-table-column>
<el-table-column prop="newRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.newRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="好转" align="center">
<el-table-column prop="good" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.good}}</span>
</template>
</el-table-column>
<el-table-column prop="goodRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.goodRate}}%</span>
</template>
</el-table-column>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
</el-tab-pane>
<el-tab-pane label="远视储备率统计" name="远视储备率统计">
<div class="tabcontent">
<div class="searchinfo">
<div>
<!-- <el-select v-model="queryInfo.range" clearable placeholder="请选择统计范围" size="large" style="width: 200px">
<el-option v-for="item in rangeData" :key="item.code" :label="item.name" :value="item.code"/>
</el-select>
<el-select v-model="queryInfo.schoolType" clearable class="ml-4" placeholder="请选择学校类型" size="large" style="width: 200px">
<el-option v-for="item in schoolTypeData" :key="item.itemcode" :label="item.dictname" :value="item.itemcode"/>
</el-select> -->
<el-select v-model="queryInfo.gender" clearable class="ml-4" placeholder="请选择性别" size="large" style="width: 200px" @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="init">统计</el-button>
<el-button @click="resetdata('3')">重置</el-button>
</div>
<div>
<el-button type="primary" @click="sortinfo('3')">
<img v-if="sortstatus==0" src="@/assets/visionscreening/myopiarate.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==1" src="@/assets/visionscreening/ascsort.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==2" src="@/assets/visionscreening/descsort.png" style="padding-right: 5px;" alt="">
远视储备不足比例
</el-button>
<el-button type="primary" @click="exportinfo('3')">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div>
<el-table ref="multipleTableRef" v-loading="loading" element-loading-text="正在加载数据,请耐心等待......" :data="tableData3" border style="width: 100%; height:calc(100vh - 475px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="name" label="统计范围" />
<el-table-column prop="total" label="总人数" align="center">
<template #default="scope">
<span>{{scope.row.total}}</span>
</template>
</el-table-column>
<el-table-column prop="inspect" label="已检人数" align="center">
<template #default="scope">
<span>{{scope.row.inspect}}</span>
</template>
</el-table-column>
<el-table-column prop="sufficient" label="远视储备充足人数" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.sufficient}}</span>
</template>
</el-table-column>
<el-table-column prop="sufficientRate" label="远视储备充足比例" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.sufficientRate}}</span>%
</template>
</el-table-column>
<el-table-column prop="insufficient" label="远视储备不足人数" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.insufficient}}</span>
</template>
</el-table-column>
<el-table-column prop="insufficientRate" label="远视储备不足比例" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.insufficientRate}}</span>%
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
</el-tab-pane>
<el-tab-pane label="抽检对比分析" name="抽检对比分析">
<div class="tabcontent">
<div class="searchinfo">
<div>
<!-- <el-select v-model="queryInfo.range" clearable placeholder="请选择统计范围" size="large" style="width: 200px">
<el-option v-for="item in rangeData" :key="item.code" :label="item.name" :value="item.code"/>
</el-select>
<el-select v-model="queryInfo.schoolType" clearable class="ml-4" placeholder="请选择学校类型" size="large" style="width: 200px">
<el-option v-for="item in schoolTypeData" :key="item.itemcode" :label="item.dictname" :value="item.itemcode"/>
</el-select> -->
<el-select v-model="queryInfo.gender" clearable class="ml-4" placeholder="请选择性别" size="large" style="width: 200px" @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="init">统计</el-button>
<el-button @click="resetdata('4')">重置</el-button>
</div>
<div>
<el-button type="primary" @click="sortinfo('4')">
<img v-if="sortstatus==0" src="@/assets/visionscreening/myopiarate.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==1" src="@/assets/visionscreening/ascsort.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==2" src="@/assets/visionscreening/descsort.png" style="padding-right: 5px;" alt="">
抽查近视率
</el-button>
<el-button type="primary" @click="exportinfo('4')">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div>
<el-table ref="multipleTableRef" v-loading="loading" element-loading-text="正在加载数据,请耐心等待......" :data="tableData4" border style="width: 100%; height:calc(100vh - 475px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="name" label="统计范围" />
<el-table-column prop="inspect" label="普检人数" align="center">
<template #default="scope">
<span>{{scope.row.inspect}}</span>
</template>
</el-table-column>
<el-table-column prop="spotCheck" label="抽检人数" align="center">
<template #default="scope">
<span>{{scope.row.spotCheck}}</span>
</template>
</el-table-column>
<el-table-column prop="spotCheckRate" label="抽检比例" align="center">
<template #default="scope">
<span>{{scope.row.spotCheckRate}}%</span>
</template>
</el-table-column>
<el-table-column prop="inspectMyopia" label="普检近视人数" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.inspectMyopia}}</span>
</template>
</el-table-column>
<el-table-column prop="inspectMyopiaRate" label="普检近视率" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.inspectMyopiaRate}}</span>%
</template>
</el-table-column>
<el-table-column prop="spotCheckMyopia" label="抽检近视人数" align="center">
<template #default="scope">
<span class="text-[#FF9900] font-bold">{{scope.row.spotCheckMyopia}}</span>
</template>
</el-table-column>
<el-table-column prop="spotCheckMyopiaRate" label="抽检近视率" align="center">
<template #default="scope">
<span class="text-[#FF9900] font-bold">{{scope.row.spotCheckMyopiaRate}}</span>%
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<style scoped lang="scss">
.contents-box{
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
:deep(){
.el-input{
width: 240px;
}
}
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRights {
flex: 1;
position: relative;
width: 100%;
// overflow: auto;
border-radius: 3px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
background: transparent !important;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(){
.el-button{
margin-left: 10px;
}
// .el-tree-node__content{
// height: 40px;
// padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
.el-tabs__item{
margin-right: 10px;
border: 1px solid #dfe4ee;
padding: 0px 20px !important;
width: 130px;
height: 44px;
border-radius: 10px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
background-color: #e9ecf3;
font-size: 14px;
color: #606060;
}
.el-tabs__nav{
padding-left: 20px;
}
.el-tabs__active-bar{
display: none;
}
.el-tabs__item:hover{
color: #409eff;
}
.el-tabs__item.is-active{
color: #fff;
border: 1px solid #409eff;
background-color: #409eff;
}
.el-tabs__nav-wrap::after{
display: none;
}
.el-tabs__header{
margin: 0px;
}
}
.searchinfo{
display: flex;
align-items: center;
margin-bottom: 20px;
justify-content: space-between;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.tabcontent{
background-color: #fff;
height: calc(100vh - 329px);
border-radius: 5px;
padding: 20px;
}
</style>

View File

@ -1,827 +0,0 @@
<script lang="ts">
export default {
name: 'dataanalysiss' // -
};
</script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable,TabsPaneContext} from "element-plus";
import { queryExamineSchoolTree,queryMyopiaStatistics,queryAbnormalStatistics,queryFarSightednessStatistics,
querySamplingComparison,queryRulesSchoolList,exportStatistics } from "@/api/planscreening";
import Page from '@/components/Pagination/page.vue';
import { publicTree } from '@/utils/validate';
import { getDict } from '@/api/dict'
import { downloadFile } from '@/utils/index'
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const treeLoading = ref(false)
const treeData:any = ref([])
function getTree(){
if(props.planInfo.exam_type == '01'){
let params = {
planId: props.planInfo.id,
orgId: props.planInfo.org_id,
orgType: props.planInfo.org_type,
};
treeLoading.value = true
queryExamineSchoolTree(params).then((res) => {
treeData.value = publicTree(res.data,"")
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}else{
//
let params = {
planId:props.planInfo.id
}
treeLoading.value = true
queryRulesSchoolList(params).then((res) => {
treeData.value = res.data;
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}
}
const tableData = ref([])
const tableData2 = ref([])
const tableData3 = ref([])
const tableData4 = ref([])
const genderoptions:any = ref([{label:'男',value:0},{label:'女',value:1}])
const loading = ref(false)
const sortstatus = ref(0)
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
//
const treedata: any = ref([]);
const treeloading = ref(false)
const defaultProps = { label: "name" }
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const activeName = ref('近视统计')
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
//
function init(){
// let params:any = {
// gender: queryInfo.value.gender,
// planId:props.planInfo.id,
// range: queryInfo.value.range,
// schoolType: queryInfo.value.schoolType,
// };
// if(nodeData.value.org_type =='5'){
// params.schoolId = nodeData.value.id
// params.regionId = ""
// }else{
// params.regionId = nodeData.value.id
// params.schoolId = ""
// }
let params:any = {
gender: queryInfo.value.gender,
planId:props.planInfo.id,
range: queryInfo.value.range,
schoolType: queryInfo.value.schoolType,
examType:props.planInfo.exam_type,
orgId:nodeData.value.id,
orgType:nodeData.value.org_type,
sort: queryInfo.value.sort,
current:queryInfo.value.current,
size:queryInfo.value.size,
};
loading.value = true
if(activeName.value == '近视统计'){
queryMyopiaStatistics(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].myopiaRate = ((res.data.records[i].myopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].premyopiaRate = ((res.data.records[i].premyopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].moderateRate = ((res.data.records[i].moderate / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].severeRate = ((res.data.records[i].severe / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].new = res.data.records[i].is_new_nearsighted
res.data.records[i].good = res.data.records[i].is_tobe_good
res.data.records[i].newRate = ((res.data.records[i].new / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].goodRate = ((res.data.records[i].good / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].myopiaRate = 0
res.data.records[i].premyopiaRate = 0
res.data.records[i].moderateRate = 0
res.data.records[i].severeRate =0
res.data.records[i].new = 0
res.data.records[i].good = 0
res.data.records[i].newRate = 0
res.data.records[i].goodRate = 0
}
}
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '视力不良统计'){
queryAbnormalStatistics(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].myopiaRate = ((res.data.records[i].myopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].premyopiaRate = ((res.data.records[i].premyopia / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].moderateRate = ((res.data.records[i].moderate / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].severeRate = ((res.data.records[i].severe / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].newRate = ((res.data.records[i].new / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].goodRate = ((res.data.records[i].good / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].myopiaRate = 0
res.data.records[i].premyopiaRate = 0
res.data.records[i].moderateRate = 0
res.data.records[i].severeRate =0
res.data.records[i].newRate = 0
res.data.records[i].goodRate = 0
}
}
tableData2.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '远视储备率统计'){
queryFarSightednessStatistics(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].sufficientRate = ((res.data.records[i].sufficient / res.data.records[i].inspect)* 100).toFixed(2)
res.data.records[i].insufficientRate = ((res.data.records[i].insufficient / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].sufficientRate = 0
res.data.records[i].insufficientRate = 0
}
}
tableData3.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '抽检对比分析'){
querySamplingComparison(params).then((res) => {
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].inspect>0){
res.data.records[i].spotCheckRate = ((res.data.records[i].spotCheck / res.data.records[i].inspect)* 100).toFixed(2)
}else{
res.data.records[i].spotCheckRate = '0.00'
}
if(res.data.records[i].inspect ==0){
res.data.records[i].inspectMyopiaRate = '0.00'
}else{
res.data.records[i].inspectMyopiaRate = ((res.data.records[i].inspectMyopia / res.data.records[i].inspect)* 100).toFixed(2)
}
if(res.data.records[i].spotCheck ==0){
res.data.records[i].spotCheckMyopiaRate = '0.00'
}else{
res.data.records[i].spotCheckMyopiaRate = ((res.data.records[i].spotCheckMyopia / res.data.records[i].spotCheck)* 100).toFixed(2)
}
}
tableData4.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}
}
const handleClick = (tab: TabsPaneContext, event: Event) => {
sortstatus.value = 0
queryInfo.value = {
current:1,
size:10,
total:0
}
setTimeout(()=>{
init()
},200)
}
const nodeData:any = ref({})
const handleNodeClick = (data: Tree) => {
nodeData.value = data
queryInfo.value = {
current:1,
size:10,
total:0
}
init()
};
//
function resetdata(type:any){
queryInfo.value = {
current:1,
size:10,
total:0
}
init()
}
//
function exportinfo(type:any){
let params:any = {
gender: queryInfo.value.gender,
planId:props.planInfo.id,
range: queryInfo.value.range,
schoolType: queryInfo.value.schoolType,
examType:props.planInfo.exam_type,
orgId:nodeData.value.id,
orgType:nodeData.value.org_type,
sort: queryInfo.value.sort,
current:1,
size:999,
};
loading.value = true
if(activeName.value == '近视统计'){
params.type = "1"
exportStatistics(params).then((response) => {
downloadFile(response,'近视统计', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '视力不良统计'){
params.type = "2"
exportStatistics(params).then((response) => {
downloadFile(response,'视力不良统计', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}else if(activeName.value == '远视储备率统计'){
params.type = "3"
exportStatistics(params).then((response) => {
downloadFile(response,'远视储备率统计', 'xlsx')
loading.value = false
}).catch(()=>{
loading.value = false
});
}
}
//
function sortinfo(type:any){
//
if(sortstatus.value === 0) {
sortstatus.value = 1
queryInfo.value.sort = 'up'
} else if(sortstatus.value === 1) {
sortstatus.value = 2
queryInfo.value.sort = 'down'
} else {
sortstatus.value = 0
queryInfo.value.sort = null
}
init()
}
onMounted(() => {
getTree()
init()
getDict({ dictcode: 'schoolType' }).then((res) => {
schoolTypeData.value = res.data
})
});
const rangeData:any = ref([{name:'按地区统计',code:'1'},{name:'按年级统计',code:'2'}])
const schoolTypeData:any = ref([])
</script>
<template>
<div class="contents-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData"
default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 340px); overflow: auto">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRights">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="height:calc(100vh - 325px);">
<el-tab-pane label="近视统计" name="近视统计">
<div class="tabcontent">
<div class="searchinfo">
<div>
<!-- <el-select v-model="queryInfo.range" clearable placeholder="请选择统计范围" size="large" style="width: 200px">
<el-option v-for="item in rangeData" :key="item.code" :label="item.name" :value="item.code"/>
</el-select>
<el-select v-model="queryInfo.schoolType" clearable class="ml-4" placeholder="请选择学校类型" size="large" style="width: 200px">
<el-option v-for="item in schoolTypeData" :key="item.itemcode" :label="item.dictname" :value="item.itemcode"/>
</el-select> -->
<el-select v-model="queryInfo.gender" clearable class="ml-4" placeholder="请选择性别" size="large" style="width: 200px" @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="init">统计</el-button>
<el-button @click="resetdata('1')">重置</el-button>
</div>
<div>
<el-button type="primary" @click="sortinfo('1')">
<img v-if="sortstatus==0" src="@/assets/visionscreening/myopiarate.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==1" src="@/assets/visionscreening/ascsort.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==2" src="@/assets/visionscreening/descsort.png" style="padding-right: 5px;" alt="">
近视率
</el-button>
<el-button type="primary" @click="exportinfo('1')">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div>
<el-table ref="multipleTableRef" v-loading="loading" element-loading-text="正在加载数据,请耐心等待......" :data="tableData" border style="width: 100%; height:calc(100vh - 475px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="name" label="统计范围" />
<el-table-column prop="total" label="总人数" align="center" width="120">
<template #default="scope">
<span>{{scope.row.total}}</span>
</template>
</el-table-column>
<el-table-column prop="inspect" label="已检人数" align="center" width="100">
<template #default="scope">
<span>{{scope.row.inspect}}</span>
</template>
</el-table-column>
<el-table-column prop="myopia" label="近视人数" align="center" width="100">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.myopia}}</span>
</template>
</el-table-column>
<el-table-column prop="myopiaRate" label="近视率" align="center" width="80">
<template #default="scope">
<span class=" text-[#4099ff] font-bold">{{scope.row.myopiaRate}}%</span>
</template>
</el-table-column>
<el-table-column label="近视前期" align="center">
<el-table-column prop="premyopia" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.premyopia}}</span>
</template>
</el-table-column>
<el-table-column prop="premyopiaRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.premyopiaRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="低度近视" align="center">
<el-table-column prop="moderate" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.moderate}}</span>
</template>
</el-table-column>
<el-table-column prop="moderateRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.moderateRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="高度近视" align="center">
<el-table-column prop="severe" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.severe}}</span>
</template>
</el-table-column>
<el-table-column prop="severeRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.severeRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="新发现" align="center">
<el-table-column prop="new" align="center" label="人数" width="80" >
<template #default="scope">
<span>{{scope.row.new}}</span>
</template>
</el-table-column>
<el-table-column prop="newRate" align="center" label="比例" width="80" >
<template #default="scope">
<span>{{scope.row.newRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="好转" align="center">
<el-table-column prop="good" align="center" label="人数" width="80" >
<template #default="scope">
<span>{{scope.row.good}}</span>
</template>
</el-table-column>
<el-table-column prop="goodRate" align="center" label="比例" width="80" >
<template #default="scope">
<span>{{scope.row.goodRate}}%</span>
</template>
</el-table-column>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
</el-tab-pane>
<el-tab-pane label="视力不良统计" name="视力不良统计">
<div class="tabcontent">
<div class="searchinfo">
<div>
<!-- <el-select v-model="queryInfo.range" clearable placeholder="请选择统计范围" size="large" style="width: 200px">
<el-option v-for="item in rangeData" :key="item.code" :label="item.name" :value="item.code"/>
</el-select>
<el-select v-model="queryInfo.schoolType" clearable class="ml-4" placeholder="请选择学校类型" size="large" style="width: 200px">
<el-option v-for="item in schoolTypeData" :key="item.itemcode" :label="item.dictname" :value="item.itemcode"/>
</el-select> -->
<el-select v-model="queryInfo.gender" clearable class="ml-4" placeholder="请选择性别" size="large" style="width: 200px" @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="init">统计</el-button>
<el-button @click="resetdata('2')">重置</el-button>
</div>
<div>
<el-button type="primary" @click="sortinfo('2')">
<img v-if="sortstatus==0" src="@/assets/visionscreening/myopiarate.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==1" src="@/assets/visionscreening/ascsort.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==2" src="@/assets/visionscreening/descsort.png" style="padding-right: 5px;" alt="">
视力不良占比
</el-button>
<el-button type="primary" @click="exportinfo('2')">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div>
<el-table ref="multipleTableRef" v-loading="loading" element-loading-text="正在加载数据,请耐心等待......" :data="tableData2" border style="width: 100%; height:calc(100vh - 475px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="name" label="统计范围" />
<el-table-column prop="total" label="总人数" align="center" width="120">
<template #default="scope">
<span>{{scope.row.total}}</span>
</template>
</el-table-column>
<el-table-column prop="inspect" label="已检人数" align="center" width="100">
<template #default="scope">
<span>{{scope.row.inspect}}</span>
</template>
</el-table-column>
<el-table-column prop="myopia" label="视力不良人数" align="center" width="100">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.myopia}}</span>
</template>
</el-table-column>
<el-table-column prop="myopiaRate" label="视力不良占比" align="center" width="80" >
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.myopiaRate}}</span>%
</template>
</el-table-column>
<el-table-column label="轻度视力不良" align="center">
<el-table-column prop="premyopia" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.premyopia}}</span>
</template>
</el-table-column>
<el-table-column prop="premyopiaRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.premyopiaRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="中度视力不良" align="center">
<el-table-column prop="moderate" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.moderate}}</span>
</template>
</el-table-column>
<el-table-column prop="moderateRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.moderateRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="重度视力不良" align="center">
<el-table-column prop="severe" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.severe}}</span>
</template>
</el-table-column>
<el-table-column prop="severeRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.severeRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="新发现" align="center">
<el-table-column prop="new" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.new}}</span>
</template>
</el-table-column>
<el-table-column prop="newRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.newRate}}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="好转" align="center">
<el-table-column prop="good" align="center" label="人数" width="80">
<template #default="scope">
<span>{{scope.row.good}}</span>
</template>
</el-table-column>
<el-table-column prop="goodRate" align="center" label="比例" width="80">
<template #default="scope">
<span>{{scope.row.goodRate}}%</span>
</template>
</el-table-column>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
</el-tab-pane>
<el-tab-pane label="远视储备率统计" name="远视储备率统计">
<div class="tabcontent">
<div class="searchinfo">
<div>
<!-- <el-select v-model="queryInfo.range" clearable placeholder="请选择统计范围" size="large" style="width: 200px">
<el-option v-for="item in rangeData" :key="item.code" :label="item.name" :value="item.code"/>
</el-select>
<el-select v-model="queryInfo.schoolType" clearable class="ml-4" placeholder="请选择学校类型" size="large" style="width: 200px">
<el-option v-for="item in schoolTypeData" :key="item.itemcode" :label="item.dictname" :value="item.itemcode"/>
</el-select> -->
<el-select v-model="queryInfo.gender" clearable class="ml-4" placeholder="请选择性别" size="large" style="width: 200px" @change="init">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-button type="primary" @click="init">统计</el-button>
<el-button @click="resetdata('3')">重置</el-button>
</div>
<div>
<el-button type="primary" @click="sortinfo('3')">
<img v-if="sortstatus==0" src="@/assets/visionscreening/myopiarate.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==1" src="@/assets/visionscreening/ascsort.png" style="padding-right: 5px;" alt="">
<img v-if="sortstatus==2" src="@/assets/visionscreening/descsort.png" style="padding-right: 5px;" alt="">
远视储备不足比例
</el-button>
<el-button type="primary" @click="exportinfo('3')">
<img src="@/assets/visionscreening/exports.png" style="padding-right: 5px;" alt="">导出
</el-button>
</div>
</div>
<div>
<el-table ref="multipleTableRef" v-loading="loading" element-loading-text="正在加载数据,请耐心等待......" :data="tableData3" border style="width: 100%; height:calc(100vh - 475px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="name" label="统计范围" />
<el-table-column prop="total" label="总人数" align="center">
<template #default="scope">
<span>{{scope.row.total}}</span>
</template>
</el-table-column>
<el-table-column prop="inspect" label="已检人数" align="center">
<template #default="scope">
<span>{{scope.row.inspect}}</span>
</template>
</el-table-column>
<el-table-column prop="sufficient" label="远视储备充足人数" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.sufficient}}</span>
</template>
</el-table-column>
<el-table-column prop="sufficientRate" label="远视储备充足比例" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.sufficientRate}}</span>%
</template>
</el-table-column>
<el-table-column prop="insufficient" label="远视储备不足人数" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.insufficient}}</span>%
</template>
</el-table-column>
<el-table-column prop="insufficientRate" label="远视储备不足比例" align="center">
<template #default="scope">
<span class="text-[#4099ff] font-bold">{{scope.row.insufficientRate}}</span>%
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<style scoped lang="scss">
.contents-box{
:deep(.el-tree-node.is-current > .el-tree-node__content) {
background-color: #409eff !important;
color: #fff !important;
}
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
:deep(){
.el-input{
width: 240px;
}
}
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRights {
flex: 1;
position: relative;
width: 100%;
// overflow: auto;
border-radius: 3px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
background: transparent;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(){
.el-button{
margin-left: 10px;
}
// .el-tree-node__content{
// height: 40px;
// padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
.el-tabs__item{
margin-right: 10px;
border: 1px solid #dfe4ee;
padding: 0px 20px !important;
width: 130px;
height: 44px;
border-radius: 10px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
background-color: #e9ecf3;
font-size: 14px;
color: #606060;
}
.el-tabs__nav{
padding-left: 20px;
}
.el-tabs__active-bar{
display: none;
}
.el-tabs__item:hover{
color: #409eff;
}
.el-tabs__item.is-active{
color: #fff;
border: 1px solid #409eff;
background-color: #409eff;
}
.el-tabs__nav-wrap::after{
display: none;
}
.el-tabs__header{
margin: 0px;
}
}
.searchinfo{
display: flex;
align-items: center;
margin-bottom: 20px;
justify-content: space-between;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.tabcontent{
background-color: #fff;
height: calc(100vh - 329px);
border-radius: 5px;
padding: 20px;
}
</style>

View File

@ -1,348 +0,0 @@
<script lang="ts">
export default {
name: 'inspectreport' //
};
</script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import { queryExamineSchoolTree,queryPlanGradePage } from "@/api/planscreening";
import { publicTree } from '@/utils/validate';
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
const tableData:any = ref([])
const multipleSelection = ref([])
const dialogVisible = ref(false)
const loading = ref(false)
//
const treeLoading = ref(false)
const defaultProps = { label: "name" }
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
function dateFormat(row: any) {
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
const nodeData:any = ref({})
//
function init(){
loading.value = true
let params:any = {
planId:props.planInfo.id,
examType:'01',
current:queryInfo.value.current,
size:queryInfo.value.size,
}
if(nodeData.value.org_type =='5'){
params.schoolId = nodeData.value.id
params.regionId = ""
}else{
params.regionId = nodeData.value.id
params.schoolId = ""
}
queryPlanGradePage(params).then((res) => {
tableData.value = []
if(res.data != null){
for (const key in res.data) {
let temp:any = key.split(",")
tableData.value.push({
plan_name:props.planInfo.plan_name,
grade_id:temp[1],
grade_name:temp[2],
exam_time:temp[3]
})
}
}
loading.value = false
}).catch(()=>{
loading.value = false
});
}
const handleNodeClick = (data: Tree) => {
nodeData.value = data
queryInfo.value = {
current:1,
size:10,
total:0
}
init()
};
//
function exportdata(){
}
function handleClose(){
dialogVisible.value = false
}
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function viewclick(row:any){
ElMessage({
message: "查看报告功能正在开发中!",
type: "warning",
});
}
const treeData:any = ref([])
function getTree(){
let params = {
planId: props.planInfo.id,
orgId: props.planInfo.org_id,
orgType: props.planInfo.org_type,
};
treeLoading.value = true
queryExamineSchoolTree(params).then((res) => {
treeData.value = publicTree(res.data,"")
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}
onMounted(() => {
getTree()
init()
});
function exportinfo(){
ElMessage({
message: "导出报告功能正在开发中!",
type: "warning",
});
}
</script>
<template>
<div class="contents-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div>
<el-tree v-loading="treeLoading" ref="treeRef" node-key="id" :data="treeData"
default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 350px); overflow: auto">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="searchinfo">
<el-button type="primary" @click="exportinfo">
<img src="@/assets/visionscreening/exports.png" alt="">导出
</el-button>
</div>
<div v-loading="loading">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 435px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<el-table-column prop="plan_name" label="检查名称" />
<el-table-column prop="grade_name" label="年级" />
<el-table-column prop="exam_time" label="生成时间" width="196">
<template #default="scope">
<span v-if="scope.row.exam_time !='null'">{{ dateFormat(scope.row.exam_time) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="address" label="操作" width="100" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/visionscreening/viewreport.png" alt="" title="查看结果记录表" @click="viewclick(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
<el-dialog v-model="dialogVisible" :show-close="false" :before-close="handleClose" :close-on-click-modal="false" title="视力筛查报告" width="60%" draggable append-to-body>
</el-dialog>
</div>
</template>
<style scoped lang="scss">
.contents-box{
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
:deep(){
.el-input{
width: 240px;
}
}
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 285px);
overflow: auto;
background-color: rgba(255, 255, 255, 1);
border-radius: 3px;
padding: 20px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(){
.el-tree-node__content{
height: 40px;
padding-left: 12px !important;
color: #505050;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
color: #409eff;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
color: #409eff;
background-color: #ecf5ff;
}
.el-tree-node__content:hover{
color: #409eff;
background-color: transparent;
// #ecf5ff
}
.el-tree-node__expand-icon{
color: #333333;
}
}
.searchinfo{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.QRbox{
height: calc(100vh - 200px);
text-align: center;
}
</style>

View File

@ -1,571 +0,0 @@
<script lang="ts">
export default {
name: 'personalreports' //
};
</script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import Viewfile from "@/views/component/Viewfile.vue";
import Generalreport from "@/views/component/Generalreport.vue";
import { queryExamineSchoolTree,queryExamineResultPage,queryCompletionRate,exportVisionForm,exportMultipleVisionForm } from "@/api/planscreening";
import { querySchoolGradeList } from "@/api/regionmodule/schoolGrade";
import { querySchoolClassList } from "@/api/regionmodule/schoolClass";
import { publicTree } from '@/utils/validate';
import { downloadFile } from '@/utils/index'
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const iframeurl = userStore.webApiBaseHttp;
const reporLoading = ref(false)
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
const searchval = ref('')
const tableData = ref([])
const multipleSelection = ref([])
const genderoptions:any = ref([{label:'男',value:0},{label:'女',value:1}])
const loading = ref(false)
const dialogVisible = ref(false)
//
const treeloading = ref(false)
const defaultProps = { label: "name" }
const planreportlist:any = ref({})
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const reportiframe = ref<HTMLIFrameElement | null>(null);
const iframeWindow = ref<Window | null>(null);
const isViewfile = ref(false)
//
const isGeneralreport = ref(false)
const reportsrc:any = ref({})
onMounted(() => {
getTree()
init()
window.addEventListener('message', (event) => {
// console.log('Method in parent has been called');
if (event.data.action === 'parentMethodCalled') {
// iframe
// console.log('Method in parent has been called');
}
});
});
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
//
function lookinfo(row:any){
ViewfileUrl.value = url + '/vision_examine/examine-result/exportVisionForm?id=' + row.id
isViewfile.value = true
}
//
function fileDown(row:any) {
const params = {
id: row.id
}
exportVisionForm(params).then((response: any) => {
downloadFile(response, row.student_name + '筛查结果记录表', 'docx')
}).catch(() => {
});
}
function exportinfo(){
let params:any = {
};
if(multipleSelection.value.length>0){
let id = [] as any[];
let name = [] as any[];
multipleSelection.value.forEach((item: any) => {
id.push(item.id)
name.push(item.id)
})
params = {
type:"0",
planId:props.planInfo.id,
id: id.join(','),
};
}else if(queryInfo.value.classId != '' && queryInfo.value.classId != null){
params = {
type:'1',
planId:props.planInfo.id,
id:queryInfo.value.classId
}
}else if(queryInfo.value.gradeId != '' && queryInfo.value.gradeId != null){
params = {
type:'2',
planId:props.planInfo.id,
id:queryInfo.value.gradeId
}
}
else if(schoolId.value != '' && schoolId.value != null){
params = {
type:'3',
planId:props.planInfo.id,
id:schoolId.value
}
}
reporLoading.value = true
exportMultipleVisionForm(params).then((response: any) => {
downloadFile(response, '筛查结果记录表', 'docx')
reporLoading.value = false
}).catch(() => {
reporLoading.value = false
});
}
function CloseView(){
isViewfile.value = false
}
function CloseViews(){
isGeneralreport.value = false
}
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function resetdata(){
queryInfo.value = {
current:1,
size:10,
total:0
}
init()
}
const schoolId = ref("")
const treeLoading = ref(false)
const treeData:any = ref([])
function getTree(){
let params = {
planId: props.planInfo.id,
orgId: props.planInfo.org_id,
orgType: props.planInfo.org_type,
};
treeLoading.value = true
queryExamineSchoolTree(params).then((res) => {
treeData.value = publicTree(res.data,"")
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}
//
function init(){
let params:any = {
studentName:queryInfo.value.studentName,
planId: props.planInfo.id,
gradeId: queryInfo.value.gradeId,
classId: queryInfo.value.classId,
examType: props.planInfo.exam_type,
gender: queryInfo.value.gender,
studyCode: queryInfo.value.studyCode,
idCode: queryInfo.value.idCode,
examStatus:'01',
current:queryInfo.value.current,
size:queryInfo.value.size
};
if(nodeData.value.org_type =='5'){
params.schoolId = nodeData.value.id
params.regionId = ""
}else{
params.regionId = nodeData.value.id
params.schoolId = ""
}
loading.value = true
queryExamineResultPage(params).then((res) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}
const ViewfileUrl = ref("")
const nodeData:any = ref({})
const handleNodeClick = (data: Tree) => {
nodeData.value = data
queryInfo.value.classId = ""
gradeinData.value = []
classData.value = []
queryInfo.value.gradeId = ""
schoolId.value = ""
if(nodeData.value.org_type =='5'){
schoolId.value = nodeData.value.id
getGrade()
}
queryInfo.value.current = 1
queryInfo.value.size = 10
init()
};
function getGrade(){
let params = {
schoolId: schoolId.value
}
classData.value = []
queryInfo.value.classId = ""
querySchoolGradeList(params).then((res) => {
gradeinData.value = res.data;
}).catch(()=>{
});
}
function getClass(id:any){
let params = {
gradeId: id
}
classData.value = []
queryInfo.value.classId = ""
if(id != null && id != '' ){
querySchoolClassList(params).then((res) => {
classData.value = res.data;
}).catch(()=>{
});
}
init()
}
const gradeinData:any = ref([])
const classData:any = ref([])
function viewreport(data:any){
console.log(data)
planreportlist.value = data
dialogVisible.value = true
const params = {
planId:props.planInfo.id,
schoolId:'',
shcoolName:''
}
const paramss = {
planId:props.planInfo.id,
regionCode:data.code
}
let publicparams = {}
if(planreportlist.value.org_type === '5'){
params.schoolId = planreportlist.value.id
params.shcoolName = planreportlist.value.name
reportsrc.value = iframeurl + '/#/Generalreport/?planId=' + props.planInfo.id +
'&schoolId='+ data.id + '&shcoolName=' + data.name
publicparams = params
} else {
reportsrc.value = iframeurl + '/#/Generalreports?planId='+ props.planInfo.id +
'&regionCode='+ data.code
publicparams = paramss
}
setTimeout(()=>{
// frame
if (reportiframe.value) {
iframeWindow.value = reportiframe.value.contentWindow;
}
if (iframeWindow.value) {
iframeWindow.value.postMessage(publicparams, '*');
}
},2500)
}
function handleClose(){
dialogVisible.value = false
}
function exportclick(){
// frame
if (reportiframe.value) {
iframeWindow.value = reportiframe.value.contentWindow;
}
if (iframeWindow.value) {
iframeWindow.value.postMessage({
action: 'exportpdf',
payload: '',
}, '*');
}
}
</script>
<template>
<div class="contents-box" v-loading="reporLoading" element-loading-text="正在下载报告,文件较大,请耐心等待...">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData"
default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 350px); overflow: auto">
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>{{ node.label }}</span>
<span>
<img v-if="data.id !== nodeData.id" src="@/assets/visionscreening/lookdetails.png" style="width: 14px;height:14px;" alt="" @click.stop="viewreport(data)">
<img v-else-if="data.id === nodeData.id" src="@/assets/visionscreening/lookdetailss.png" style="width: 14px;height:14px;" alt="" @click.stop="viewreport(data)">
</span>
</span>
</template>
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="searchinfo">
<div class="flex items-center">
<el-input v-model="queryInfo.studentName" placeholder="请输入学生姓名" style="width: 150px;" clearable />
<el-select v-model="queryInfo.gradeId" @change="getClass" class="ml-3" placeholder="请选择年级" clearable style="width: 150px;" :disabled="schoolId==''|| schoolId==null">
<el-option v-for="item in gradeinData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.classId" @change="init" class="ml-3" placeholder="请选择班级" clearable style="width: 150px;" :disabled="queryInfo.gradeId==''|| queryInfo.gradeId==null">
<el-option v-for="item in classData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.gender" @change="init" style="width: 130px;" class="ml-3" placeholder="请选择性别">
<el-option v-for="item in genderoptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<el-input v-model="queryInfo.studyCode" class="ml-3" placeholder="请输入学籍号" style="width: 150px;" clearable />
<el-input v-model="queryInfo.idCode" class="ml-3" placeholder="请输入身份证号" style="width: 150px;margin-right: 10px;" clearable />
<el-button type="primary" @click="init">搜索</el-button>
<el-button @click="resetdata">重置</el-button>
</div>
<div>
<el-button :disabled="schoolId==''&& multipleSelection.length == 0" type="primary" @click="exportinfo"><img src="@/assets/visionscreening/exports.png" alt="" style="margin-right: 4px;" >导出</el-button>
</div>
</div>
<div v-loading="loading">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 425px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column fixed type="selection" width="55" />
<el-table-column fixed type="index" width="55" label="序号" align="center" />
<el-table-column fixed prop="student_name" label="姓名" width="100" />
<el-table-column prop="gender" label="性别" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-if="scope.row.gender == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="birth_date" label="出生日期" width="120" align="center" />
<el-table-column prop="nation" label="民族" width="80" align="center" />
<el-table-column prop="study_code" label="学籍号" width="190" align="center" />
<el-table-column prop="id_code" label="身份证" width="180" align="center" />
<el-table-column prop="grade_name" label="所属年级" min-width="90" />
<el-table-column prop="class_name" label="所属班级" min-width="90" />
<el-table-column prop="address" label="操作" width="60" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/visionscreening/lookdetails.png" alt="" title="" @click="lookinfo(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
<Viewfile v-if="isViewfile" :url="ViewfileUrl" :showTime="true" :title="'筛查结果报告'" :type="'docx'" :clientHeight="600" @update="CloseView"/>
</div>
<el-dialog
width="41%"
class="viewItemFileDialog"
title="普查分析报告"
v-model='dialogVisible'
:before-close="handleClose"
:close-on-click-modal="false"
:close-on-press-escape="false"
draggable>
<iframe v-if="dialogVisible" id="reportid" ref="reportiframe" :src="reportsrc" frameborder="0" name="text" height="700px" width="100%"></iframe>
<button style="cursor: pointer;position: absolute;top: 22px;right: 50px;">
<img src="@/assets/tableicon/u884.png" title="导出pdf" @click="exportclick">
</button>
</el-dialog>
</template>
<style scoped lang="scss">
.contents-box{
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
:deep(){
// .el-input{
// width: 240px;
// }
}
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 285px);
overflow: auto;
background-color: rgba(255, 255, 255, 1);
border-radius: 3px;
padding: 20px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(){
.el-select--large .el-select__wrapper{
min-height: 0px;
}
}
// :deep(){
// .el-input{
// height: 40px;
// line-height: 40px;
// }
// .el-button{
// height:40px;
// margin-left: 10px;
// }
// .el-tree-node__content{
// height: 40px;
// padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
// }
.searchinfo{
display: flex;
align-items: center;
margin-bottom: 20px;
justify-content:space-between;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.QRbox{
height: calc(100vh - 200px);
text-align: center;
}
.statistics-text{
color:#949494;
margin-right:35px;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
:deep(){
.custom-tree-node, .treedelicon, .treeediticon{
font-size: 14px !important;
}
}
</style>

View File

@ -1,932 +0,0 @@
<script lang="ts">
export default {
name: 'printcode' //
};
</script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTable} from "element-plus";
import Page from '@/components/Pagination/page.vue';
import { querySchoolGradeList } from "@/api/regionmodule/schoolGrade";
import { querySchoolClassList } from "@/api/regionmodule/schoolClass";
import { queryExamineSchoolTree,queryExamineResultPage,queryRulesSchoolList,
studentPersonQRCode,studentMultiplePersonQRCode,studentAllPersonQRCode,
AllSchoolPersonQRCode,queryPlanStudentList,addExamineStudent,exportStudentQueueDataTemplate,
delExamineResult,updateGradeClassExamineResult,addAllExamineStudent } from "@/api/planscreening";
import { downloadFile } from '@/utils/index'
import { publicTree } from '@/utils/validate';
import Viewfile from "@/views/component/Viewfile.vue";
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const url = userStore.webApiBaseUrl;
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const schoolName =ref("")
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
const exportText = ref("")
const tableData = ref([])
const multipleSelection = ref([])
const genderoptions:any = ref([{label:'男',value:'1'},{label:'女',value:'2'}])
const loading = ref(false)
//
const treeloading = ref(false)
const defaultProps = { label: "name" }
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
const treeLoading = ref(false)
const treeData:any = ref([])
function getTree(){
if(props.planInfo.exam_type == '01'){
let params = {
planId: props.planInfo.id,
orgId: props.planInfo.org_id,
orgType: props.planInfo.org_type,
};
treeLoading.value = true
queryExamineSchoolTree(params).then((res) => {
treeData.value = publicTree(res.data,"")
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}else{
//
let params = {
planId:props.planInfo.id
}
treeLoading.value = true
queryRulesSchoolList(params).then((res) => {
treeData.value = res.data;
treeLoading.value = false
}).catch(()=>{
treeLoading.value = false
});
}
}
//
function init(){
let params:any = {
studentName:queryInfo.value.studentName,
planId: props.planInfo.id,
gradeId: queryInfo.value.gradeId,
classId: queryInfo.value.classId,
examType: props.planInfo.exam_type,
examStatus: queryInfo.value.examStatus,
current:queryInfo.value.current,
size:queryInfo.value.size,
custom3:queryInfo.value.custom3,
};
if(nodeData.value.org_type =='5'){
params.schoolId = nodeData.value.id
params.regionId = ""
}else{
params.regionId = nodeData.value.id
params.schoolId = ""
}
loading.value = true
queryExamineResultPage(params).then((res) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
}).catch(()=>{
loading.value = false
});
}
const nodeData:any = ref({})
const handleNodeClick = (data: Tree) => {
queryInfo.value = {
current:1,
size:10,
total:0,
studentName:"",
gender:"",
custom3:""
}
nodeData.value = data
if(data.org_type == "5"){
parentId.value = data.id
orgType.value = "5"
schoolId.value = data.id
schoolName.value = data.name
}else{
parentId.value = ""
schoolId.value = ""
schoolName.value = ""
}
gradeinData.value = []
classData.value = []
getGrade()
init()
};
const ViewfileUrl = ref("")
const title= ref("")
const onprint= ref("no")
const filetype = ref("pdf")
const orgType:any = ref("")
const schoolId:any = ref("")
const parentId:any = ref("")
const isViewfile = ref(false)
function CloseView(){
isViewfile.value = false
}
//
function exportStudentPerson(row:any){
let params = {
id: row.student_id,
planId: row.plan_id,
}
loading.value = true
studentPersonQRCode(params).then((response:any) => {
loading.value = false
downloadFile(response, row.student_name + '筛查告知书' , 'docx')
}).catch(()=>{
loading.value = false
})
}
function studentMultiplePerson(row:any){
let ids = [] as any[];
multipleSelection.value.forEach((item: any) => {
ids.push(item.student_id)
})
let params = {
ids: ids.join(","),
planId:props.planInfo.id
}
loading.value = true
studentMultiplePersonQRCode(params).then((response:any) => {
loading.value = false
downloadFile(response, schoolName.value +'-多人筛查告知书' , 'docx')
}).catch(()=>{
loading.value = false
})
}
function exportStudentQueueData(){
let params = {
planId:props.planInfo.id,
schoolId:schoolId.value,
gradeId:queryInfo.value.gradeId,
classId:queryInfo.value.classId,
}
loading.value = true
exportText.value = "正在生成队列,请耐心等待"
exportStudentQueueDataTemplate(params).then((response:any) => {
loading.value = false
exportText.value = ''
downloadFile(response, schoolName.value + '-队列清单' , 'xls')
}).catch(()=>{
exportText.value = ''
loading.value = false
})
}
//
function printQRcode(){
title.value="打印预览"
onprint.value="no"
filetype.value="pdf"
let params = {
orgType: orgType.value,
parentId:parentId.value,
studentName:queryInfo.value.studentName,
examStatus:queryInfo.value.examStatus,
planId:props.planInfo.id,
}
if(queryInfo.value.examStatus == undefined || queryInfo.value.examStatus == undefined){
ViewfileUrl.value = url + '/vision_examine/examine-result/examineResultStudentQRCode?orgType=' + params.orgType +
"&planId=" + params.planId + "&parentId=" + params.parentId + "&studentName=" + params.studentName
}else{
ViewfileUrl.value = url + '/vision_examine/examine-result/examineResultStudentQRCode?orgType=' + params.orgType +
"&planId=" + params.planId + "&parentId=" + params.parentId + "&studentName=" + params.studentName + "&examStatus=" + params.examStatus
}
isViewfile.value = true
}
function exportQRcode(){
let params = {
orgType: orgType.value,
parentId:parentId.value,
studentName:queryInfo.value.studentName,
gender:queryInfo.value.gender,
planId:props.planInfo.id,
schoolid:parentId.value,
examStatus:queryInfo.value.examStatus
}
loading.value = true
exportText.value = "正在导出,由于内容较大,请耐心等待"
if(queryInfo.value.examStatus != "" &&queryInfo.value.examStatus != undefined && queryInfo.value.total<1000){ // 未检漏检
studentAllPersonQRCode(params).then((response:any) => {
loading.value = false
exportText.value = ''
downloadFile(response, schoolName.value + '-多人筛查告知书' , 'docx')
}).catch(()=>{
exportText.value = ''
loading.value = false
})
} else if(orgType.value == "5" && queryInfo.value.studentName == "" && queryInfo.value.gender == ""){
AllSchoolPersonQRCode(params).then((response:any) => {
loading.value = false
exportText.value = ''
downloadFile(response, schoolName.value + '-多人筛查告知书' , 'zip')
}).catch(()=>{
exportText.value = ''
loading.value = false
})
}else{
studentAllPersonQRCode(params).then((response:any) => {
loading.value = false
exportText.value = ''
downloadFile(response, schoolName.value + '-多人筛查告知书' , 'docx')
}).catch(()=>{
exportText.value = ''
loading.value = false
})
}
// ViewfileUrl.value = url + '/vision_examine/examine-result/examineResultStudentQRCode?orgType=' + params.orgType +
// "&planId=" + params.planId + "&parentId=" + params.parentId + "&studentName=" + params.studentName + "&gender=" + params.gender
// isViewfile.value = true
}
//
function printSelectedQRcode(){
title.value="打印预览"
onprint.value="no"
filetype.value="pdf"
let ids = [] as any[];
multipleSelection.value.forEach((item: any) => {
ids.push(item.student_id)
})
ViewfileUrl.value = url + '/vision_examine/examine-result/downloadSelectedQRCode?parentId=' + parentId.value +
"&planId=" + props.planInfo.id +
"&ids=" + ids
isViewfile.value = true
}
function handleSelectionChange(val:any){
multipleSelection.value = val
}
function resetdata(){
queryInfo.value = {
current:1,
size:10,
total:0,
studentName:"",
gender:"",
custom3:""
}
init()
}
onMounted(() => {
getTree()
init()
});
const gradeinData:any = ref([])
const classData:any = ref([])
function getGrade(){
let params:any = {}
params.schoolId = schoolId.value
classData.value = []
queryInfo.value.classId = ""
querySchoolGradeList(params).then((res) => {
gradeinData.value = res.data;
}).catch(()=>{
});
}
function getClass(id:any){
let params = {
gradeId: id
}
if(id != "" && id != null){
orgType.value = "6"
parentId.value = id
}else{
orgType.value = "5"
parentId.value = schoolId.value
}
classData.value = []
queryInfo.value.classId = ""
if(id != null && id != '' ){
querySchoolClassList(params).then((res) => {
classData.value = res.data;
}).catch(()=>{
});
}
init()
}
function getQueryClass(id:any){
if(id != ""&& id != null){
orgType.value = "7"
parentId.value = id
}else {
orgType.value = "6"
parentId.value = queryInfo.value.gradeId
}
init()
}
const studentList = ref([])
const studentVisible = ref(false)
const studentload =ref(false)
const queryStudentInfo:any = ref({})
function addStudent(){
studentVisible.value = true
queryStudentInfo.value = {
current:1,
size:20,
total:0,
name:"",
gender:""
}
studentInfo()
}
function searchInit(){
queryStudentInfo.value.current = 1
studentInfo()
}
const studentText = ref('')
function studentInfo(){
let params = {
planId: props.planInfo.id,
name:queryStudentInfo.value.name,
current:queryStudentInfo.value.current,
size:queryStudentInfo.value.size,
}
studentText.value = '正在加载学生信息,请耐心等待...'
studentload.value = true
studentList.value = []
queryPlanStudentList(params).then((res) => {
studentList.value = res.data.records;
queryStudentInfo.value.total = res.data.total
studentload.value = false
}).catch(()=>{
studentload.value = false
});
}
const studentSelection:any = ref([])
function studentSelectionChange(val:any){
studentSelection.value = val
}
function confirm(){
let ids = [] as any[];
studentSelection.value.forEach((item: any) => {
ids.push(item.id)
})
let params = {
planId: props.planInfo.id,
ids:ids.join(",")
}
studentText.value = '正在关联学生信息,请耐心等待...'
studentload.value = true
addExamineStudent(params).then((res:any) => {
if(res.code == '0'){
queryInfo.value.current= 1
init()
ElMessage({
message: "添加成功",
type: "success",
});
}else{
ElMessage({
message: "添加失败",
type: "error",
});
}
studentVisible.value = false
studentload.value = false
}).catch(()=>{
studentload.value = false
});
}
function confirmAll(){
ElMessageBox.confirm('确定添加全部学生信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
planId: props.planInfo.id,
}
studentText.value = '正在关联学生信息,请耐心等待...'
studentload.value = true
addAllExamineStudent(params).then((res:any) => {
if(res.code == '0'){
queryInfo.value.current= 1
init()
ElMessage({
message: "添加成功",
type: "success",
});
}else{
ElMessage({
message: "添加失败",
type: "error",
});
}
studentVisible.value = false
studentload.value = false
}).catch(()=>{
studentload.value = false
});
});
}
const studentForm:any = ref({})
function delStudent(row:any){
ElMessageBox.confirm('确定删除' +row.student_name + '的视力筛查信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delExamineResult({id:row.id}).then((res:any) => {
if(res.code =='0'){
ElMessage({
message: "删除成功",
type: "success",
});
init()
}else{
ElMessage({
message: "删除失败",
type: "error",
});
}
}).catch(()=>{
})
});
}
const gradeinAdjustData:any =ref([])
const classAdjustData:any =ref([])
const studentAdjustVisible:any =ref(false)
function editStudent(row:any){
studentForm.value ={
id:row.id,
studentName:row.student_name,
gradeId:'',
gradeCode:'',
gradeName:'',
classId:'',
classCode:'',
className:''
}
studentAdjustVisible.value= true
getAdjustGrade(row.school_id)
}
function getAdjustGrade(id){
let params:any = {
schoolId: id
}
studentForm.value.classId = ""
studentForm.value.gradeId = ""
gradeinAdjustData.value = []
classAdjustData.value = []
querySchoolGradeList(params).then((res) => {
gradeinAdjustData.value = res.data;
}).catch(()=>{
});
}
function getAdjustClass(id:any){
let params = {
gradeId: id
}
for(let i = 0;i<gradeinAdjustData.value.length;i++){
if(gradeinAdjustData.value[i].id == id){
studentForm.value.gradeCode = gradeinAdjustData.value[i].code
studentForm.value.gradeName = gradeinAdjustData.value[i].name
}
}
classAdjustData.value = []
studentForm.value.classId = ""
querySchoolClassList(params).then((res) => {
classAdjustData.value = res.data;
}).catch(()=>{
});
}
function getAdjustClassName(id){
for(let i = 0;i<classAdjustData.value.length;i++){
if(classAdjustData.value[i].id == id){
studentForm.value.classCode = classAdjustData.value[i].code
studentForm.value.className = classAdjustData.value[i].name
}
}
debugger
}
function handleClose(){
studentAdjustVisible.value= false
}
function confirmClick(){
if(studentForm.value.gradeId =='' || studentForm.value.gradeId == null){
ElMessage({
message: "请选择年级",
type: "warning",
});
return
}
if(studentForm.value.classId =='' || studentForm.value.classId == null){
ElMessage({
message: "请选择班级",
type: "warning",
});
return
}
updateGradeClassExamineResult(studentForm.value).then((res:any) => {
if(res.code =='0'){
studentAdjustVisible.value= false
ElMessage({
message: "调班成功",
type: "success",
});
init()
}else{
ElMessage({
message: "调班失败",
type: "success",
});
}
}).catch(()=>{
});
}
</script>
<template>
<div class="printcode-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">数据列表</div>
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treeData"
default-expand-all
:highlight-current="true" :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 350px); overflow: auto">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="searchinfo">
<div>
<el-input v-model="queryInfo.studentName" placeholder="学生姓名" style="width: 90px;" clearable />
<el-select v-model="queryInfo.gradeId" @change="getClass" class="ml-4" placeholder="选择年级" clearable size="large" style="width: 120px"
:disabled="schoolId == ''">
<el-option v-for="item in gradeinData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.classId" @change="getQueryClass" class="ml-4" placeholder="选择班级" clearable size="large" style="width: 120px"
:disabled="queryInfo.gradeId==''|| queryInfo.gradeId==null">
<el-option v-for="item in classData" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<el-select v-model="queryInfo.examStatus" class="ml-4" placeholder="筛查状态" size="large" style="width: 120px" clearable @change="init">
<el-option :key="'00'" :label="'未检'" :value="'00'"/>
<el-option :key="'01'" :label="'已检'" :value="'01'"/>
<el-option :key="'02'" :label="'漏检'" :value="'02'"/>
</el-select>
<el-select v-model="queryInfo.custom3" class="ml-4" placeholder="是否新增学生" size="large" style="width: 140px" clearable @change="init">
<el-option :label="'是'" :value="'1'"/>
<el-option :label="'否'" :value="'2'"/>
</el-select>
<el-button type="primary" @click="init" style="margin-left:10px ;">搜索</el-button>
<el-button @click="resetdata">重置</el-button>
<el-button type="primary" @click="addStudent" style="margin-left:10px ;">添加学生</el-button>
<el-button type="primary" @click="exportStudentQueueData" :disabled="schoolId==''" style="margin-left:10px ;">生成队列</el-button>
<el-button type="primary" @click="printQRcode" :disabled="schoolId==''">
<img src="@/assets/visionscreening/printallQR.png" style="padding-right: 5px;" alt="">打印全部
</el-button>
<el-button type="primary" :disabled="schoolId==''" @click="exportQRcode">
导出全部
</el-button>
<el-button :disabled="multipleSelection.length <= 0" :type="multipleSelection.length > 0 ? 'primary' : ''" @click="printSelectedQRcode">
<img v-if="multipleSelection.length == 0" src="@/assets/visionscreening/disabledprintQR.png" style="padding-right: 5px;" alt="">
<img v-if="multipleSelection.length != 0" src="@/assets/visionscreening/printallQR.png" style="padding-right: 5px;" alt="">
打印
</el-button>
<el-button @click="studentMultiplePerson" :disabled="multipleSelection.length <= 0" :type="multipleSelection.length > 0 ? 'primary' : ''">
导出
</el-button>
</div>
</div>
<div v-loading="loading" :element-loading-text="exportText">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 445px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<!-- <el-table-column prop="student_code" label="学生代码" width="100" /> -->
<el-table-column prop="student_name" label="学生姓名" width="120" />
<el-table-column prop="gender" label="性别" width="80" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-if="scope.row.gender == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="80" />
<el-table-column prop="birth_date" label="出生日期" width="120" align="center"/>
<el-table-column prop="nation" label="民族" width="80" align="center"/>
<el-table-column prop="study_code" label="学籍号" width="190" align="center"/>
<el-table-column prop="grade_name" label="所属年级" width="120"/>
<el-table-column prop="class_name" label="所属班级" />
<el-table-column prop="id_code" label="身份证" width="180" align="center"/>
<el-table-column prop="address" label="操作" width="120" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-between;-webkit-justify-content: space-around; ">
<img src="@/assets/visionscreening/spotcheck.png" title="修改"
style="cursor: pointer;" alt="" @click="editStudent(scope.row)">
<img src="@/assets/tableicon/u186.png" title="删除"
style="cursor: pointer;" alt="" @click="delStudent(scope.row)">
<img src="@/assets/visionscreening/exportts.png" title="导出"
style="cursor: pointer;" alt="" @click="exportStudentPerson(scope.row)">
<!-- <el-button type="primary" size="small" @click="exportStudentPerson(scope.row)">导出</el-button> -->
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="init" />
</div>
</div>
<Viewfile v-if="isViewfile" :url="ViewfileUrl" :showTime="true" :title="title" :onprint="onprint" :type="filetype" :clientHeight="600" @update="CloseView"/>
<el-dialog v-model="studentVisible" title="普检未关联学生信息列表" draggable width="1280">
<div style="margin-bottom: 10px;display:flex ; justify-content: space-between;">
<div>
<el-input v-model="queryStudentInfo.name" placeholder="请输入学生姓名" style="width: 200px;" clearable />
<el-button type="primary" @click="searchInit" style="margin-left:10px ;">搜索</el-button>
</div>
<div>
<el-button type="primary" @click="confirmAll" style="margin-left:10px ;" :disabled="studentload">关联所有未关联学生</el-button>
<el-button type="primary" @click="confirm" style="margin-left:10px ;" :disabled="studentload">确定关联</el-button>
</div>
</div>
<el-table v-loading="studentload" :element-loading-text="studentText"
ref="multipleTableRefs" :data="studentList" border style="width: 100%; height:calc(100vh - 445px)"
@selection-change="studentSelectionChange"
:header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column type="selection" width="55" />
<!-- <el-table-column prop="student_code" label="学生代码" width="100" /> -->
<el-table-column prop="name" label="学生姓名" width="100" />
<el-table-column prop="gender" label="性别" width="60" align="center">
<template #default="scope">
<span v-if="scope.row.gender == '1'"></span>
<span v-if="scope.row.gender == '2'"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="60" />
<el-table-column prop="birth_date" label="出生日期" width="120" align="center"/>
<el-table-column prop="study_code" label="学籍号" width="190" align="center"/>
<el-table-column prop="school_name" label="所属学校" min-width="130"/>
<el-table-column prop="grade_name" label="所属年级" width="130"/>
<el-table-column prop="class_name" label="所属班级" width="120"/>
<el-table-column prop="id_code" label="身份证" width="180" align="center"/>
</el-table>
<Page class="mt-[20px]" :total="queryStudentInfo.total" v-model:size="queryStudentInfo.size" v-model:current="queryStudentInfo.current"
@pagination="studentInfo" />
</el-dialog>
<el-dialog v-model="studentAdjustVisible" title="调整班级" draggable width="600">
<el-form ref="infoForm" :model="studentForm" label-width="100px">
<el-form-item label="学生姓名">
<span>{{ studentForm.studentName }}</span>
</el-form-item>
<el-form-item label="调整年级">
<el-select v-model="studentForm.gradeId" class="!w-full" placeholder="请选择年级"
@change="getAdjustClass">
<el-option v-for="(i, index) in gradeinAdjustData" :key="i.id" :label="i.name"
:value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="调整班级">
<el-select v-model="studentForm.classId" class="!w-full" placeholder="请选择班级" @change="getAdjustClassName">
<el-option v-for="(i, index) in classAdjustData" :key="i.id" :label="i.name"
:value="i.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer">
<el-button style="padding: 10px 15px" @click="handleClose"> </el-button>
<el-button type="primary" style="padding: 10px 15px" @click="confirmClick">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<style scoped lang="scss">
.printcode-box{
margin-top: 15px;
height: 100%;
display: -webkit-flex;
display: flex;
.box-search{
display: flex;
display: -webkit-flex;
justify-content: space-between;
margin-bottom: 20px;
// :deep(){
// .el-input{
// height:40px;
// line-height: 40px;
// width: 240px;
// }
// .el-button{
// height:40px;
// }
// }
}
}
#silderLeft {
width: 242px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 285px);
overflow: auto;
background-color: rgba(255, 255, 255, 1);
border-radius: 3px;
padding: 20px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
:deep(.el-select--large .el-select__wrapper){
min-height: 0px;
}
// :deep(){
// .el-input{
// height: 40px;
// line-height: 40px;
// }
// .el-button{
// height:40px;
// margin-left: 10px;
// }
// .el-tree-node__content{
// height: 40px;
// padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
// }
.searchinfo{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.my-header{
display: flex;
justify-content: space-between;
align-items: center;
.icontext{
font-size: 12px;
color: #787878;
width: 25px;
text-align: center;
cursor: pointer;
img{
padding-left: 4px;
}
}
}
.QRbox{
height: calc(100vh - 200px);
text-align: center;
}
</style>

View File

@ -1,625 +0,0 @@
<script lang="ts">
export default {
name: 'visionScreening' //
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick } from "vue";
import { ElMessage, ElMessageBox, FormRules } from "element-plus";
import Page from '@/components/Pagination/page.vue';
import { queryRegion } from "@/api/regionmodule/region";
import { queryVisionExamineItemList,queryExaminePlanPage,addExaminePlan,updateExaminePlan,delExaminePlan,queryPlanNum,getPlanCode } from "@/api/planscreening";
import { querySchoolList } from "@/api/regionmodule/school";
import Planmanage from "./planmanage.vue";
import Viewreport from "./viewreport.vue";
import { publicTree } from '@/utils/validate';
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
const planName = ref('')
const org_name = ref('')
const tableData = ref([])
const dialogFormVisible = ref(false)
const dialogtitle = ref('新增普查计划')
const form:any = ref({})
const planform = ref();
const moduleinfo1 = ref(true);
const moduleinfo2 = ref(false);
const moduleinfo3 = ref(false);
const moduleinfo4 = ref(false);
const rules = reactive<FormRules>({
plan_code: [{ required: true, message: "请输入计划代码", trigger: "blur" }],
plan_name: [{ required: true, message: "请输入计划名称", trigger: "blur" }]
});
const planYear:any = ref()
const planCode = ref("")
const tempName = ref("")
//
function getYear(){
var date = new Date();
var year = date.getFullYear();
var month:any = date.getMonth() + 1;
if(month >= 3 && month < 9){
planYear.value = (year - 1)+'-' + '2'
planCode.value = (year - 1) + '02'
tempName.value = (year - 1) + '年第二学期'
}else{
planYear.value = year + '-'+ '1'
planCode.value = year + '01'
tempName.value = year + '年第一学期'
}
//
}
const org_id =ref("")
function addinfo(){
getYear()
dialogtitle.value = '新增计划'
form.value = {}
isSwitch.value = false
dialogFormVisible.value = true
}
function editinfo(row:any){
form.value = JSON.parse(JSON.stringify(row))
examItemsData.value = []
if(form.value.exam_items != ""){
let examItemsArr = JSON.parse(form.value.exam_items)
for(let j=0;j<examItemsArr.length;j++){
examItemsData.value.push(examItemsArr[j].code +',' + examItemsArr[j].name)
}
}
isSwitch.value = false
dialogtitle.value = '修改普查计划'
dialogFormVisible.value = true
}
const isSwitch = ref(false)
function infosubmit(formEl: any){
formEl.validate((valid: any) => {
if (valid) {
if(examItemsData.value.length ==0){
ElMessage({
message: "请选择筛查项目!",
type: "warning",
});
return
}
if(form.value.org_name =='' || form.value.org_name ==null ){
ElMessage({
message: "请选择组织机构!",
type: "warning",
});
return
}
if(isSwitch.value == true){
return
}
isSwitch.value = true
let tempData:any = []
for(let i=0;i<examItemsData.value.length;i++){
tempData.push({
code:examItemsData.value[i].split(',')[0],
name:examItemsData.value[i].split(',')[1]
})
}
if (form.value.id) {
const data:any = {
id:form.value.id,
orgId: form.value.org_id,
orgName: form.value.org_name,
orgType: form.value.org_type,
planCode: form.value.plan_code,
planName: form.value.plan_name,
planYear: form.value.plan_year,
examType: "01", //
visInstIds:"",
examItems:JSON.stringify(tempData),
planStartDate:form.value.plan_start_date,
planEndDate:form.value.plan_end_date,
};
updateExaminePlan(data).then((item) => {
dialogFormVisible.value = false;
ElMessage({
message: "修改成功",
type: "success",
});
getData();
}).catch(()=>{
isSwitch.value = false
})
} else {
const data:any = {
orgId: form.value.org_id,
orgName: form.value.org_name,
orgType: form.value.org_type,
planCode: form.value.plan_code,
planName: form.value.plan_name,
planYear: form.value.plan_year,
examType: "01", // 5-
visInstIds:"",
examItems:JSON.stringify(tempData),
};
addExaminePlan(data).then((item) => {
dialogFormVisible.value = false;
getData();
ElMessage({
message: "新增成功",
type: "success",
});
}).catch(()=>{
isSwitch.value = false
})
}
}
})
}
function delinfo(row: any) {
ElMessageBox.confirm("确定删除此普查计划吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let params = {
ids: row.id,
};
delExaminePlan(params).then((res:any) => {
if( res.code == '0'){
getData();
ElMessage({
message: "删除成功",
type: "success",
});
}
});
});
}
const loading =ref(false)
function getData(){
let params = {
planName: planName.value,
orgName: org_name.value,
examType:'01',
current: queryInfo.value.current,
size:queryInfo.value.size
};
params.planName = planName.value.replace(/\s+/g, "");
params.orgName = org_name.value.replace(/\s+/g, "");
loading.value = true
queryExaminePlanPage(params).then((res:any) => {
tableData.value = res.data.records;
for(let i=0;i<res.data.records.length;i++){
if(res.data.records[i].exam_items != null && res.data.records[i].exam_items != ''){
let examItemsArr = JSON.parse(res.data.records[i].exam_items)
let examItemsTemp = []
for(let j=0;j<examItemsArr.length;j++){
examItemsTemp.push(examItemsArr[j].name)
}
res.data.records[i].examItems = examItemsTemp.join("、")
}
}
queryInfo.value.total = res.data.total
loading.value = false
});
}
function planclick(row:any){
form.value = row
moduleinfo1.value = false
moduleinfo2.value = true
moduleinfo3.value = false
}
function viewreportclick(row:any){
form.value = row
moduleinfo1.value = false
moduleinfo2.value = false
moduleinfo3.value = true
}
function handleClose(){
if (planform.value != null) planform.value.resetFields();
dialogFormVisible.value = false
}
function returnClick(){
moduleinfo1.value = true
moduleinfo2.value = false
moduleinfo3.value = false
}
function reportreturnClick(){
moduleinfo1.value = true
moduleinfo2.value = false
moduleinfo3.value = false
}
const VisionExamineItemList:any = ref([])
const examItemsData:any =ref([])
function cityChange(e:any){
}
onMounted(() => {
queryVisionExamineItemList({}).then((res) => {
VisionExamineItemList.value = res.data;
for(let i=0;i<res.data.length;i++){
if(i<2){
examItemsData.value.push(res.data[i].item_code +',' + res.data[i].item_name)
}
}
});
getData();
});
const dialogVisible = ref(false)
function viewOrg(){
SchoolData.value = []
getTree()
dialogVisible.value = true
}
function regionClose(){
dialogVisible.value = false
}
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
//
const regionName = ref("");
const orgId = ref("")
const orgName = ref("")
const orgType = ref("")
//
const treedata: any = ref([]);
const defaultProps = { label: "name" };
const handleNodeClick = (data: Tree) => {
orgId.value = data.id;
orgName.value = data.custom1
orgType.value = data.type
getSchoolData()
// getData();
};
const schoolClick = (data: Tree) => {
orgId.value = data.id;
orgName.value = data.name
orgType.value = '5'
};
function confirmsubmit(){
queryPlanNum({planYear:planYear.value,examType:"01",orgid:orgId.value}).then((res:any) => {
if(res.code == 0){
if(res.data>8){
planCode.value = planCode.value + (res.data+1)
}else{
planCode.value = planCode.value +"0" +""+ (res.data+1)
}
tempName.value = tempName.value + '第'+(res.data+1) +'次视力筛查'
form.value.plan_name = tempName.value
// form.value.plan_code = planCode.value
form.value.org_id = orgId.value
form.value.org_name = orgName.value
form.value.org_type= orgType.value
if(orgName.value != null){
form.value.plan_name = orgName.value.replace(/\s*/g,"")+'-' + tempName.value
}else{
form.value.plan_name = tempName.value
}
}
})
getPlanCode({planYear:planYear.value,examType:"01"}).then((res:any) => {
form.value.plan_code = res.data
})
form.value.plan_year = planYear.value
dialogVisible.value = false
}
const treeloading =ref(false)
const tempData = ref([])
//
function getTree() {
const params = {
name: regionName.value,
status:'01'
};
treeloading.value = true
queryRegion(params).then((res: any) => {
orgName.value = ""
orgId.value = ""
orgType.value = ""
tempData.value = JSON.parse(JSON.stringify(res.data))
treedata.value = publicTree(res.data,"")
treeloading.value = false
})
.catch((error:any)=>{
treeloading.value = false
})
}
const SchoolData = ref([])
const schoolloading =ref(false)
//
function getSchoolData() {
if(orgId.value == ''){
SchoolData.value = []
return
}
schoolName.value = schoolName.value.replace(/\s+/g, "");
let params = {
name: schoolName.value,
regionId: orgId.value,
type:orgType.value
};
schoolloading.value = true
querySchoolList(params).then((res) => {
SchoolData.value = res.data;
schoolloading.value = false
}).catch(()=>{
schoolloading.value = false
});
}
function searchInit(){
treedata.value = publicTree(tempData.value,regionName.value)
}
const schoolName = ref("")
function searchSchoolInit(){
getSchoolData()
}
</script>
<template>
<div v-show="moduleinfo1" class="w-full">
<div v-show="moduleinfo1" class="visionscreening-box">
<div class="visionscreening-box-top">
<div class="flex">
<el-input v-model="planName" style="width:200px" placeholder="请输入计划名称" clearable />
<el-input v-model="org_name" style="width:200px;margin-left:10px" placeholder="请输入组织机构名称" clearable />
<el-button type="primary" class="ml-[10px]" @click="getData">搜索</el-button>
</div>
<el-button type="primary" @click="addinfo"><img src="@/assets/visionscreening/jscz_xz.png" alt="" style="margin-right: 4px;" >新增普检计划</el-button>
</div>
<div class="visionscreening-box-bottom">
<el-table :data="tableData" border style="width: 100%; height:calc(100vh - 290px)" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="plan_code" label="计划编号" width="120" />
<el-table-column prop="plan_name" label="计划名称" width="180">
<template #default="scope">
<div v-if="scope.row.display ==true" style="display: flex;align-items: center;">
<div style="margin-right:10px ;">{{ scope.row.plan_name }}</div>
<img src="@/assets/tableicon/u4891.svg" alt="" >
</div>
<span v-else>{{ scope.row.plan_name }}</span>
</template>
</el-table-column>
<el-table-column prop="plan_year" label="计划学年" width="100" />
<el-table-column prop="examItems" label="筛查项目" />
<el-table-column prop="org_name" label="组织机构" width="120"/>
<el-table-column prop="org_type" label="机构类型" width="120" align="center" >
<template #default="scope">
<span v-if="scope.row.org_type =='2'">/直辖市</span>
<span v-if="scope.row.org_type =='3'">/自治州</span>
<span v-if="scope.row.org_type =='4'">//县级市</span>
<span v-if="scope.row.org_type =='5'">学校</span>
</template>
</el-table-column>
<el-table-column prop="plan_start_date" width="120" label="开始日期" align="center"/>
<el-table-column prop="plan_end_date" width="120" label="结束日期" align="center"/>
<el-table-column prop="status" width="100" label="状态" align="center">
<template #default="scope">
<span v-if="scope.row.status === '01'" style="color:#409EFF">初始创建</span>
<!-- <span v-else-if="scope.row.status === 1" style="color:#FF9900">筛查中</span> -->
<span v-else style="color:#009966">筛查完成</span>
</template>
</el-table-column>
<el-table-column prop="address" width="120" label="完成日期" />
<el-table-column prop="address" label="操作" width="140" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/MenuIcon/lbcz_xg.png" alt="" title="修改" @click="editinfo(scope.row)" style="cursor: pointer;">
<img src="@/assets/visionscreening/bg-jhgl.png" alt="" title="计划管理" @click="planclick(scope.row)" style="cursor: pointer;">
<img src="@/assets/visionscreening/bg-ckbg.png" alt="" title="查看报告" @click="viewreportclick(scope.row)" style="cursor: pointer;">
<img src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delinfo(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getData" />
</div>
</div>
<el-dialog v-model="dialogFormVisible" :close-on-click-modal="false" :title="dialogtitle" :before-close="handleClose" width="620px" draggable append-to-body>
<el-form ref="planform" :model="form" :rules="rules" label-width="90px">
<el-form-item label="组织机构">
<el-input v-if="form.id==null" v-model="form.org_name" autocomplete="off" placeholder="请输入组织机构" disabled style="width: 390px;" />
<el-button v-if="form.id==null" type="primary" class="ml-[5px]" @click="viewOrg">选择</el-button>
<el-input v-if="form.id!=null" v-model="form.org_name" autocomplete="off" placeholder="请输入组织机构" disabled style="width: 100%;" />
</el-form-item>
<el-form-item label="计划学年">
<el-input v-model="form.plan_year" autocomplete="off" placeholder="请输入计划学年" disabled/>
</el-form-item>
<el-form-item label="计划名称" prop="plan_name">
<el-input v-model="form.plan_name" autocomplete="off" placeholder="请输入计划名称" />
</el-form-item>
<el-form-item label="筛查项目">
<el-checkbox-group v-model="examItemsData" @change="cityChange">
<el-checkbox v-for="city in VisionExamineItemList" :label="city.item_code +',' + city.item_name" :key="city.item_code">
{{ city.item_name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="机构类型">
<el-radio-group v-model="form.org_type" disabled>
<el-radio :label="'2'" size="large">/直辖市</el-radio>
<el-radio :label="'3'" size="large">/自治州</el-radio>
<el-radio :label="'4'" size="large">//县级市</el-radio>
<el-radio :label="'5'" size="large">学校</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="开始日期">
<el-date-picker v-model="form.plan_start_date" type="date" style="width:100%" placeholder="请输入开始日期"/>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker v-model="form.plan_end_date" type="date" style="width:100%" placeholder="请输入结束日期"/>
</el-form-item>
</el-form>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="infosubmit(planform)">确定</el-button>
</span>
</el-dialog>
<el-dialog v-model="dialogVisible" :close-on-click-modal="false" :title="'查看组织机构'"
:before-close="regionClose" width="620px" draggable append-to-body>
<div class="tscheck" style="display: flex;justify-content: space-between;">
<div class="leftbox" style="width: 100%;">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">行政区域</div>
</div>
<el-input v-model="regionName" placeholder="请输入行政区域" clearable style="width: 500px;margin-left: 10px;margin-bottom: 10px;"
@input="searchInit" />
<el-tree v-loading="treeloading"
ref="treeRef" node-key="id" :data="treedata" :props="defaultProps"
:expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 320px); overflow: auto;margin-left: 10px;">
<template #default="{ node, data }">
<span class="custom-tree-node">
<el-radio v-model="orgId" :label="data.id">{{ node.label }}</el-radio>
</span>
</template>
</el-tree>
</div>
<!-- <div class="leftbox" style="margin-left: 20px;width: 300px;">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">学校</div>
</div>
<el-input v-model="schoolName" placeholder="请输入学校名称" clearable style="width: 230px;margin-left: 10px;margin-bottom: 10px;"
@keyup.enter="searchSchoolInit" />
<el-tree v-loading="schoolloading" default-expand-all
node-key="id" :data="SchoolData" :props="defaultProps"
:expand-on-click-node="false"
@node-click="schoolClick" style="height: calc(100vh - 320px); overflow: auto;margin-left: 10px;">
<template #default="{ node, data }">
<span class="custom-tree-node">
<el-radio v-model="orgId" :label="data.id">{{ node.label }}</el-radio>
</span>
</template>
</el-tree>
</div> -->
</div>
<div>
</div>
<span class="dialog-footer" style="margin-top:10px ;margin-right:10px">
<el-button @click="regionClose">取消</el-button>
<el-button type="primary" @click="confirmsubmit">确定</el-button>
</span>
</el-dialog>
</div>
<Planmanage v-if="moduleinfo2" :planInfo="form" @returnClick="returnClick" />
<Viewreport v-if="moduleinfo3" :planInfo="form" @reportreturnClick="reportreturnClick" />
</template>
<style scoped lang="scss">
.visionscreening-box {
height: calc(100vh - 130px);
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
padding: 20px;
.visionscreening-box-top{
width:100%;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
// :deep(){
// .el-input{
// height:40px;
// line-height: 40px;
// width: 240px;
// }
// .el-button{
// height:40px;
// }
// }
}
}
.dialog-footer {
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
// :deep(){
// .el-input{
// height: 40px;
// line-height: 40px;
// }
// .el-form-item--default .el-form-item__label{
// height: 40px;
// line-height: 40px;
// }
// }
:deep(.el-tree-node__content){
height: 30px;
}
// :deep(.el-tree-node.is-current > .el-tree-node__content){
// background-color: transparent !important;
// }
.lefttitle {
min-width: 150px;
display: flex;
align-items: center;
padding: 10px 15px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
background: rgba(246, 247, 250, 1);
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line{
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.leftbox{
width: 250px;
height: calc(100vh - 200px);
border: 1px solid #e1e1e1;
border-radius: 4px;
}
.tscheck {
:deep(){
.el-radio__input.is-checked+.el-radio__label{
color: #fff !important;
}
.el-radio__input.is-checked .el-radio__inner{
border: 1px solid #fff;
}
}
}
</style>

View File

@ -1,183 +0,0 @@
<script lang="ts">
export default {
name: 'planmanage' //
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick } from "vue";
import Associztionschool from './components/associationschool.vue';
import Printcode from "./components/printcode.vue";
import Checkprogress from "./components/checkprogress.vue";
import Dataanalysis from "./components/dataanalysis.vue";
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const Associztionschooldiv = ref()
const Printcodediv = ref()
const Checkprogressdiv = ref()
const Dataanalysisdiv = ref()
const examItems = ref('')
const menulist:any = ref({menuname1:true,menuname2:false,menuname3:false,menuname4:false})
onMounted(() => {
let tempData = []
if(props.planInfo.exam_items != null &&props.planInfo.exam_items != ""){
let exam_items = JSON.parse(props.planInfo.exam_items)
for(let i=0;i<exam_items.length;i++ )
tempData.push(exam_items[i].name)
}
examItems.value = tempData.join("、")
});
function init(){
}
function menuswith(type:any){
if(type === 1){
menulist.value.menuname1 = true
menulist.value.menuname2 = false
menulist.value.menuname3 = false
menulist.value.menuname4 = false
}else if(type === 2){
menulist.value.menuname1 = false
menulist.value.menuname2 = true
menulist.value.menuname3 = false
menulist.value.menuname4 = false
} else if(type === 3){
menulist.value.menuname1 = false
menulist.value.menuname2 = false
menulist.value.menuname3 = true
menulist.value.menuname4 = false
} else {
menulist.value.menuname1 = false
menulist.value.menuname2 = false
menulist.value.menuname3 = false
menulist.value.menuname4 = true
}
}
//
const emit = defineEmits(['returnClick'])
function returnClick(){
menulist.value = {menuname1:true,menuname2:false,menuname3:false,menuname4:false}
emit('returnClick')
}
</script>
<template>
<div class="planmanage-box">
<div class="planmanage-box-top">
<div class="box-top1">
<div class="box-top1-title">{{ planInfo.plan_name }}</div>
<div class="return" @click="returnClick">
<img src="@/assets/tableicon/u549.png" alt="">
<div style="padding-left: 2px;padding-top: 2px;">返回</div>
</div>
</div>
<div class="box-top2">
<div style="width:160px;" class="box-top2-text">年度:<span class="box-top2-texts">{{ planInfo.plan_year }}</span></div>
<div style="min-width:220px;" class="box-top2-text">组织机构:<span class="box-top2-texts">{{ planInfo.org_name }}</span></div>
<div style="min-width:280px;" class="box-top2-text">筛选项目:<span class="box-top2-texts">{{ examItems }}</span></div>
<div style="width:220px;" class="box-top2-text">开始时间:<span class="box-top2-texts">{{planInfo.plan_start_date}}</span></div>
<div style="width:150px;" class="box-top2-text">结束时间:<span class="box-top2-texts">{{ planInfo.plan_end_date }}</span></div>
</div>
<div class="box-top3">
<div :class="[menulist.menuname1?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(1)">关联学校</div>
<div :class="[menulist.menuname2?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(2)">打印二维码</div>
<div :class="[menulist.menuname3?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(3)">检查进度</div>
<div :class="[menulist.menuname4?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(4)">数据分析</div>
</div>
</div>
<Associztionschool ref="Associztionschooldiv" :planInfo="planInfo" v-if="menulist.menuname1" />
<Printcode ref="Printcodediv" v-if="menulist.menuname2" :planInfo="planInfo"/>
<Checkprogress ref="Checkprogressdiv" v-if="menulist.menuname3" :planInfo="planInfo"/>
<Dataanalysis ref="Dataanalysisdiv" v-if="menulist.menuname4" :planInfo="planInfo"/>
</div>
</template>
<style scoped lang="scss">
.planmanage-box{
width: 100%;
.planmanage-box-top{
width: 100%;
height: 140px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
background-color: #fff;
padding: 20px;
.box-top1{
display: flex;
justify-content: space-between;
.box-top1-title{
font-weight: 700;
font-style: normal;
color: #363636;
font-size:24px;
}
:deep(){
.el-button{
width: 54px;
height: 26px;
padding: 0px;
}
.el-button:focus, .el-button:hover{
background-color: #ecf5ff;
color:#409eff;
}
}
}
.box-top2{
display: flex;
margin-top: 11px;
.box-top2-text{
font-size: 14px;
color:#949494;
margin-right: 20px;
}
.box-top2-texts{
font-size: 14px;
color:#363636;
padding-left: 11px;
}
}
.box-top3{
display: flex;
margin-top: 16px;
.box-top3-info{
// height: 50px;
font-size: 14px;
margin-right: 40px;
padding-bottom: 12px;
// border-bottom: 3px solid #409eff;
color: #505050;
cursor: pointer;
}
.box-top3-info:hover{
color: #409eff;
}
.menucheckstyle{
border-bottom: 3px solid #409eff;
color: #409eff;
}
}
}
}
.return{
display: flex;
align-items: center;
justify-content: center;
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #409EFF;
width: 50px;
height: 26px;
border: 1px solid #C6E2FF;
background: rgb(236, 245, 255);
border-radius:4px;
cursor: pointer;
}
</style>

View File

@ -1,172 +0,0 @@
<script lang="ts">
export default {
name: 'planmanages' // -
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick } from "vue";
import Printcode from "./components/printcode.vue";
import Checkprogress from "./components/checkprogress.vue";
import Dataanalysiss from "./components/dataanalysiss.vue";
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const Printcodediv = ref()
const Checkprogressdiv = ref()
const Dataanalysissdiv = ref()
const menulist:any = ref({menuname1:true,menuname2:false,menuname3:false})
const examItems = ref('')
onMounted(() => {
let tempData = []
if(props.planInfo.exam_items != null &&props.planInfo.exam_items != ""){
let exam_items = JSON.parse(props.planInfo.exam_items)
for(let i=0;i<exam_items.length;i++ )
tempData.push(exam_items[i].name)
}
examItems.value = tempData.join("、")
});
function init(){
}
function menuswith(type:any){
if(type === 1){
menulist.value.menuname1 = true
menulist.value.menuname2 = false
menulist.value.menuname3 = false
}else if(type === 2){
menulist.value.menuname1 = false
menulist.value.menuname2 = true
menulist.value.menuname3 = false
} else if(type === 3){
menulist.value.menuname1 = false
menulist.value.menuname2 = false
menulist.value.menuname3 = true
}
}
//
const emit = defineEmits(['returnClick'])
function returnClick(){
menulist.value = {menuname1:true,menuname2:false,menuname3:false}
emit('returnClick')
}
</script>
<template>
<div class="planmanage-box">
<div class="planmanage-box-top">
<div class="box-top1">
<div class="box-top1-title">{{ planInfo.plan_name }}</div>
<div class="return" @click="returnClick">
<img src="@/assets/tableicon/u549.png" alt="">
<div style="padding-left: 2px;padding-top: 2px;">返回</div>
</div>
</div>
<div class="box-top2">
<div style="width:160px;" class="box-top2-text">年度:<span class="box-top2-texts">{{ planInfo.plan_year }}</span></div>
<div style="min-width:220px;" class="box-top2-text">组织机构:<span class="box-top2-texts">{{ planInfo.org_name }}</span></div>
<div style="min-width:280px;" class="box-top2-text">筛选项目:<span class="box-top2-texts">{{ examItems }}</span></div>
<div style="width:220px;" class="box-top2-text">开始时间:<span class="box-top2-texts">{{planInfo.plan_start_date}}</span></div>
<div style="width:150px;" class="box-top2-text">结束时间:<span class="box-top2-texts">{{ planInfo.plan_end_date }}</span></div>
</div>
<div class="box-top3">
<div :class="[menulist.menuname1?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(1)">打印二维码</div>
<div :class="[menulist.menuname2?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(2)">检查进度</div>
<div :class="[menulist.menuname3?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(3)">数据分析</div>
</div>
</div>
<Printcode ref="Printcodediv" v-if="menulist.menuname1" :planInfo="planInfo" />
<Checkprogress ref="Checkprogressdiv" v-if="menulist.menuname2" :planInfo="planInfo"/>
<Dataanalysiss ref="Dataanalysissdiv" v-if="menulist.menuname3" :planInfo="planInfo"/>
</div>
</template>
<style scoped lang="scss">
.planmanage-box{
width: 100%;
.planmanage-box-top{
width: 100%;
height: 140px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
background-color: #fff;
padding: 20px;
.box-top1{
display: flex;
justify-content: space-between;
.box-top1-title{
font-weight: 700;
font-style: normal;
color: #363636;
font-size:24px;
}
:deep(){
.el-button{
width: 54px;
height: 26px;
padding: 0px;
}
.el-button:focus, .el-button:hover{
background-color: #ecf5ff;
color:#409eff;
}
}
}
.box-top2{
display: flex;
margin-top: 11px;
.box-top2-text{
font-size: 14px;
color:#949494;
margin-right: 20px;
}
.box-top2-texts{
font-size: 14px;
color:#363636;
padding-left: 11px;
}
}
.box-top3{
display: flex;
margin-top: 16px;
.box-top3-info{
// height: 50px;
font-size: 14px;
margin-right: 40px;
padding-bottom: 12px;
// border-bottom: 3px solid #409eff;
color: #505050;
cursor: pointer;
}
.box-top3-info:hover{
color: #409eff;
}
.menucheckstyle{
border-bottom: 3px solid #409eff;
color: #409eff;
}
}
}
}
.return{
display: flex;
align-items: center;
justify-content: center;
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #409EFF;
width: 50px;
height: 26px;
border: 1px solid #C6E2FF;
background: rgb(236, 245, 255);
border-radius:4px;
cursor: pointer;
}
</style>

View File

@ -1,160 +0,0 @@
<script lang="ts">
export default {
name: 'viewreport' //
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick } from "vue";
import Inspectreport from './components/inspectreport.vue';
import Personalreports from './components/personalreports.vue';
const props:any = defineProps({
planInfo: {
required: false,
type: Object,
default: {}
}
})
const Inspectreportdiv = ref()
const Personalreportsdiv = ref()
const menulist:any = ref({menuname1:true,menuname2:false})
const examItems = ref('')
onMounted(() => {
let tempData = []
if(props.planInfo.exam_items != null &&props.planInfo.exam_items != ""){
let exam_items = JSON.parse(props.planInfo.exam_items)
for(let i=0;i<exam_items.length;i++ )
tempData.push(exam_items[i].name)
}
examItems.value = tempData.join("、")
});
function menuswith(type:any){
if(type === 1){
menulist.value.menuname1 = true
menulist.value.menuname2 = false
}else{
menulist.value.menuname1 = false
menulist.value.menuname2 = true
}
}
//
const emit = defineEmits(['reportreturnClick'])
function reportreturnClick(){
menulist.value = {menuname1:true,menuname2:false}
emit('reportreturnClick')
}
</script>
<template>
<div class="contents-box">
<div class="content-box-top">
<div class="box-top1">
<div class="box-top1-title">{{ planInfo.plan_name }}</div>
<div class="return" @click="reportreturnClick">
<img src="@/assets/tableicon/u549.png" alt="">
<div style="padding-left: 2px;padding-top: 2px;">返回</div>
</div>
</div>
<div class="box-top2">
<div style="width:160px;" class="box-top2-text">年度:<span class="box-top2-texts">{{ planInfo.plan_year }}</span></div>
<div style="min-width:220px;" class="box-top2-text">组织机构:<span class="box-top2-texts">{{ planInfo.org_name }}</span></div>
<div style="min-width:280px;" class="box-top2-text">筛选项目:<span class="box-top2-texts">{{ examItems }}</span></div>
<div style="width:220px;" class="box-top2-text">开始时间:<span class="box-top2-texts">{{planInfo.plan_start_date}}</span></div>
<div style="width:150px;" class="box-top2-text">结束时间:<span class="box-top2-texts">{{ planInfo.plan_end_date }}</span></div>
</div>
<!-- <div class="box-top3">
<div :class="[menulist.menuname1?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(1)">普检报告</div>
<div :class="[menulist.menuname2?'menucheckstyle':'']" class="box-top3-info" @click="menuswith(2)">个人报告</div>
</div> -->
</div>
<!-- <Inspectreport ref="Inspectreportdiv" v-if="menulist.menuname1" :planInfo="planInfo"/> -->
<Personalreports ref="Personalreportsdiv" :planInfo="planInfo"/>
</div>
</template>
<style scoped lang="scss">
.contents-box{
width: 100%;
.content-box-top{
width: 100%;
height: 140px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);
background-color: #fff;
padding: 20px;
.box-top1{
display: flex;
justify-content: space-between;
.box-top1-title{
font-weight: 700;
font-style: normal;
color: #363636;
font-size:24px;
}
:deep(){
.el-button{
width: 54px;
height: 26px;
padding: 0px;
}
.el-button:focus, .el-button:hover{
background-color: #ecf5ff;
color:#409eff;
}
}
}
.box-top2{
display: flex;
margin-top: 11px;
.box-top2-text{
font-size: 14px;
color:#949494;
margin-right: 20px;
}
.box-top2-texts{
font-size: 14px;
color:#363636;
padding-left: 11px;
}
}
.box-top3{
display: flex;
margin-top: 16px;
.box-top3-info{
// height: 50px;
font-size: 14px;
margin-right: 40px;
padding-bottom: 12px;
// border-bottom: 3px solid #409eff;
color: #505050;
cursor: pointer;
}
.box-top3-info:hover{
color: #409eff;
}
.menucheckstyle{
border-bottom: 3px solid #409eff;
color: #409eff;
}
}
}
}
.return{
display: flex;
align-items: center;
justify-content: center;
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #409EFF;
width: 50px;
height: 26px;
border: 1px solid #C6E2FF;
background: rgb(236, 245, 255);
border-radius:4px;
cursor: pointer;
}
</style>

View File

@ -1,853 +0,0 @@
<script lang="ts">
export default {
name: 'visualinspection' //
};
</script>
<script setup lang="ts">
import { onMounted, reactive, ref, nextTick,watch } from "vue";
import { ElMessage, ElMessageBox, FormRules,ElTree } from "element-plus";
import { queryExaminePlanYear } from "@/api/planscreening/visualinspection";
import { addExaminePlan,queryExaminePlanPage,updateExaminePlan,delExaminePlan,addSpotCheckExamineSchool,queryRulesSchoolList,queryPlanNum,getPlanCode} from "@/api/planscreening";
import Page from '@/components/Pagination/page.vue';
import Planmanages from "./planmanages.vue";
import { queryRegionById } from "@/api/regionmodule/region";
import { querySchoolList } from "@/api/regionmodule/school";
import { queryByIdsSchoolGradeList } from "@/api/regionmodule/schoolGrade";
import { queryByIdsSchoolClassList } from "@/api/regionmodule/schoolClass";
const queryInfo :any = ref({
current:1,
size:10,
total:0
})
const searchval = ref('')
const planname = ref('')
const tableData = ref([])
const dialogFormVisible = ref(false)
const dialogtitle = ref('新增抽检计划')
const dialogVisible = ref(false)
const form:any = ref({})
const planform = ref();
const moduleinfo1 = ref(true);
const moduleinfo2 = ref(false);
const allchecked = ref(false)
const institutiondata = ref([])
const allgradechecked = ref(false)
const allclasschecked = ref(false)
const genderradio = ref('0')
const checkratio = ref('')
const loading = ref(false)
const treedata: any = ref([]);
const treeloading = ref(false)
const defaultProps = { label: "plan_name" }
const checktreeform:any = ref({})
const filterText = ref('')
const isCreateInspect =ref(false)
//
interface Tree {
[x: string]: any;
label: string;
children?: Tree[];
}
const treeRef = ref<InstanceType<typeof ElTree>>()
watch(filterText, (val:any) => {
treeRef.value!.filter(val)
})
const filterNode = (value: string, data: Tree) => {
if (!value) return true
return data.plan_name.includes(value)
}
const vMove = {
mounted(el: any) {
el.onmousedown = function (e: any) {
var init = e.clientX;
var parent: any = document.getElementById("silderLeft");
const initWidth: any = parent.offsetWidth;
document.onmousemove = function (e) {
var end = e.clientX;
var newWidth = end - init + initWidth;
parent.style.width = newWidth + "px";
};
document.onmouseup = function () {
document.onmousemove = document.onmouseup = null;
};
};
}
}
const handleNodeClick = (data: Tree) => {
checktreeform.value = data
getTableDate()
};
const rules = reactive<FormRules>({
plan_code: [{ required: true, message: "请输入计划代码", trigger: "blur" }],
plan_name: [{ required: true, message: "请输入计划名称", trigger: "blur" }]
});
onMounted(() => {
getData()
});
const planCode = ref("")
const tempName = ref("")
function getYear(){
let year = checktreeform.value.plan_year.split("-")[0]
let date = checktreeform.value.plan_year.split("-")[1]
if(date == "1"){
planCode.value = year + '01'
tempName.value = year + '年第一学期'
}else{
planCode.value = year + '02'
tempName.value = year + '年第二学期'
}
queryPlanNum({planYear:checktreeform.value.plan_year,examType:"02",orgid:checktreeform.value.org_id}).then((res:any) => {
if(res.code == 0){
if(res.data>8){
planCode.value = planCode.value + (res.data+1)
}else{
planCode.value = planCode.value +"0" +""+ (res.data+1)
}
tempName.value = checktreeform.value.org_name + tempName.value + '第'+(res.data+1) +'次视力抽检'
form.value.plan_name = tempName.value
// form.value.plan_code = planCode.value
}
})
getPlanCode({planYear:checktreeform.value.plan_year,examType:"02",orgid:form.value.org_id}).then((res:any) => {
form.value.plan_code = res.data
})
}
function addinfo(){
if (checktreeform.value.id === undefined) {
ElMessage({
message: "请选择普查计划!",
type: "warning",
});
return
}
dialogtitle.value = '新增抽检计划'
const forminfo = {
plan_code:'',
plan_name:'',
exam_type:'02',
plan_start_date:'',
plan_end_date:'',
status:'01',
org_name:checktreeform.value.org_name,
org_id:checktreeform.value.org_id,
org_type:checktreeform.value.org_type,
exam_items:checktreeform.value.exam_items,
general_plan_id:checktreeform.value.id,
plan_year:checktreeform.value.plan_year,
}
form.value = forminfo
getYear()
dialogFormVisible.value = true
}
function editinfo(row:any){
form.value = JSON.parse(JSON.stringify(row))
dialogtitle.value = '修改抽检计划'
dialogFormVisible.value = true
}
function infosubmit(formEl: any){
formEl.validate((valid: any) => {
if (valid) {
console.log(form.value.id)
if(form.value.id){
const data:any = {
id:form.value.id,
orgId: form.value.org_id,
orgName: form.value.org_name,
orgType: form.value.org_type,
planCode: form.value.plan_code,
planName: form.value.plan_name,
planYear: form.value.plan_year,
examType: "02",
visInstIds:"",
examItems:form.value.exam_items,
planStartDate:form.value.plan_start_date,
planEndDate:form.value.plan_end_date,
generalPlanId:form.value.general_plan_id
};
updateExaminePlan(data).then((item) => {
dialogFormVisible.value = false;
ElMessage({
message: "修改成功",
type: "success",
});
getTableDate()
}).catch(()=>{
})
}else{
const data:any = {
id:form.value.id,
orgId: form.value.org_id,
orgName: form.value.org_name,
orgType: form.value.org_type,
planCode:form.value.plan_code,
planName: form.value.plan_name,
planYear: form.value.plan_year,
examType: "02", //
visInstIds:"",
examItems:form.value.exam_items,
planStartDate:form.value.plan_start_date,
planEndDate:form.value.plan_end_date,
generalPlanId:form.value.general_plan_id
};
addExaminePlan(data).then((res:any) => {
ElMessage({
message: "新增成功",
type: "success",
});
dialogFormVisible.value = false
getTableDate()
})
}
}
})
}
const isSwitch = ref(false) //
function rulessubmit(){
let params = {
planId:form.value.id,
gender:genderradio.value,
schoolIds:schoolIds.value.join(","),
gradeIds:gradeIds.value.join(","),
classIds:classIds.value.join(","),
ratio:checkratio.value //
}
if(isSwitch.value == true){
return
}
isSwitch.value = true
isCreateInspect.value = true
addSpotCheckExamineSchool(params).then(() => {
isCreateInspect.value = false
dialogVisible.value = false
ElMessage({
message: "添加成功",
type: "success",
});
isSwitch.value = false
}).catch(()=>{
isCreateInspect.value = false
isSwitch.value = false
});
}
function delinfo(row: any) {
ElMessageBox.confirm("确定删除此普查计划吗?", "删除提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let params = {
ids: row.id,
};
delExaminePlan(params).then((res:any) => {
if( res.code == '0'){
getTableDate()
ElMessage({
message: "删除成功",
type: "success",
});
}
});
});
}
function searchclick(){
getTableDate()
}
function getData(){
let params = {
planName: planname.value,
examType:'01'
};
treeloading.value = true
queryExaminePlanYear(params).then((res:any) => {
treeloading.value = false
treedata.value = res.data
if(res.data.length> 0){
checktreeform.value = res.data[0]
getTableDate()
nextTick(() => {
treeRef.value?.setCurrentKey(checktreeform.value.id);
});
}
})
}
function getTableDate() {
let params = {
planName:searchval.value,
generalPlanId:checktreeform.value.id,
examType:'02',
current: queryInfo.value.current,
size:queryInfo.value.size
};
loading.value = true
queryExaminePlanPage(params).then((res:any) => {
tableData.value = res.data.records;
queryInfo.value.total = res.data.total
loading.value = false
});
}
function handleSelectionChange(){
}
function rulesclick(row:any){
form.value = row
allchecked.value = false
allgradechecked.value = false
allclasschecked.value = false
genderradio.value = '0'
checkratio.value = ''
schoolIds.value = []
gradeIds.value = []
gradeData.value = []
classIds.value = []
classData.value = []
getSchool()
// if(row.org_type != '5'){
// regionId.value = row.org_id
// getRegionTree()
// getSchool()
// }else{
// getSchool()
// }
dialogVisible.value = true
}
function planclick(row:any){
form.value = row
moduleinfo1.value = false
moduleinfo2.value = true
}
const gradeData:any = ref([])
const classData:any = ref([])
function allcheckchange(e:any,type:any){
if (type === '1') {
if(e == true){
schoolIds.value = []
for(let i =0;i<schoolData.value.length;i++) {
schoolIds.value.push(schoolData.value[i].id)
}
getGradesList()
}else{
schoolIds.value = []
gradeIds.value = []
gradeData.value = []
classIds.value = []
classData.value = []
}
} else if (type === '2') {
if(e == true){
gradeIds.value = []
for(let i =0;i<gradeData.value.length;i++) {
gradeIds.value.push(gradeData.value[i].id)
}
getClassList()
}else{
gradeIds.value = []
classIds.value = []
classData.value = []
}
} else {
if(e == true){
classIds.value = []
for(let i =0;i<classData.value.length;i++) {
classIds.value.push(classData.value[i].id)
}
getClassList()
}else{
classIds.value = []
}
}
}
//
function schoolChange(e:any){
gradeIds.value = []
classIds.value = []
getGradesList()
}
//
function gradesChange(e:any){
classIds.value = []
getClassList()
}
function handleClose(){
if (planform.value != null) planform.value.resetFields();
dialogFormVisible.value = false
}
function handleCloses(){
allchecked.value = false
institutiondata.value = []
allgradechecked.value = false
gradeData.value = []
allclasschecked.value = false
classData.value = []
dialogVisible.value = false
}
function returnClick(){
moduleinfo1.value = true
moduleinfo2.value = false
}
function dateFormat(row: any) {
const daterc = row;
if (daterc != null) {
var date = new Date(daterc);
var year = date.getFullYear();
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
}
/**
* 抽检方法
*/
const cascaderdata: any = ref([]);
//
const props1 = {
checkStrictly: true,
value:'id',
label:'name'
}
const regionId = ref("")
//
function getRegionTree() {
const params = {
regionId: form.value.org_id,
};
queryRegionById(params).then((res: any) => {
cascaderdata.value = res.data;
})
.catch((error:any)=>{
})
}
// function handleChange(value:any){
// if(value.length != 0){
// regionId.value = value[value.length -1]
// }
// getSchool()
// }
const schoolData:any = ref([])
const schoolLoading = ref(false)
const gradeLoading = ref(false)
const classLoading = ref(false)
//
function getSchool() {
let params = {
planId:checktreeform.value.id
}
// if(form.value.org_type != '5'){
// params = {
// regionId: regionId.value,
// current: queryInfo.value.current,
// size:queryInfo.value.size
// };
// } else {
// params = {
// SchoolId:form.value.org_id,
// current: queryInfo.value.current,
// size:queryInfo.value.size
// };
// }
schoolLoading.value = true
queryRulesSchoolList(params).then((res) => {
schoolData.value = res.data;
schoolLoading.value = false
}).catch(()=>{
schoolLoading.value = false
});
}
const schoolIds:any = ref([])
const gradeIds:any = ref([])
const classIds:any = ref([])
function getGradesList(){
let params = {
schoolIds: schoolIds.value.join(",")
}
gradeLoading.value = true
queryByIdsSchoolGradeList(params).then((res) => {
gradeData.value = res.data;
gradeLoading.value = false
}).catch(()=>{
gradeLoading.value = false
});
}
function getClassList(){
let params = {
gradeIds: gradeIds.value.join(",")
}
classLoading.value = true
queryByIdsSchoolClassList(params).then((res) => {
classData.value = res.data;
classLoading.value = false
}).catch(()=>{
classLoading.value = false
});
}
</script>
<template>
<div v-if="moduleinfo1" class="w-full">
<div v-show="moduleinfo1" class="contents-box">
<aside id="silderLeft">
<div class="lefttitle">
<div class="line"></div>
<div class="treetitle">普检计划列表</div>
</div>
<div style="width:100%;padding: 5px 15px;">
<el-input v-model="filterText" placeholder="请输入普检计划名称" clearable />
</div>
<div>
<el-tree v-loading="treeloading" ref="treeRef" node-key="id" :data="treedata" :filter-node-method="filterNode"
:highlight-current="true" default-expand-all :props="defaultProps" :expand-on-click-node="false"
@node-click="handleNodeClick" style="height: calc(100vh - 240px); overflow: auto">
</el-tree>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line" v-move></div>
</div>
</aside>
<div class="silderRight">
<div class="searchinfo">
<div class="flex">
<el-input v-model="searchval" style="width:240px;" placeholder="请输入计划名称" clearable />
<el-button type="primary" class="ml-[10px]" @click="searchclick">搜索</el-button>
</div>
<el-button type="primary" @click="addinfo"><img src="@/assets/visionscreening/jscz_xz.png" alt="" style="margin-right: 4px;" >新增抽检计划</el-button>
</div>
<div v-loading="loading">
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%; height:calc(100vh - 280px)" @selection-change="handleSelectionChange" :header-cell-style="{background:'rgb(250 250 250)',height:'50px'}">
<el-table-column prop="plan_code" label="计划编号" width="110" />
<el-table-column prop="plan_name" label="计划名称" min-width="110"/>
<el-table-column prop="org_name" label="组织机构" />
<el-table-column prop="org_type" label="机构类型" width="100">
<template #default="scope">
<span v-if="scope.row.org_type =='2'">/直辖市</span>
<span v-if="scope.row.org_type == '3'">/自治州</span>
<span v-else-if="scope.row.status == '4'">//县级市</span>
<span v-else-if="scope.row.status == '5'">学校</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="plan_start_date" width="110" label="开始日期" />
<el-table-column prop="plan_end_date" width="110" label="结束日期" />
<el-table-column prop="status" width="100" label="状态">
<template #default="scope">
<span v-if="scope.row.status === '01'" style="color:#409EFF">初始创建</span>
<span v-else-if="scope.row.status === '02'" style="color:#009966">筛查完成</span>
<span v-else ></span>
</template>
</el-table-column>
<el-table-column prop="Complete_date" width="100" label="完成日期" />
<el-table-column prop="creator" width="100" label="创建人" />
<el-table-column prop="create_time" label="创建日期" width="196">
<template #default="scope">
{{ dateFormat(scope.row.create_time) }}
</template>
</el-table-column>
<el-table-column label="操作" width="140" fixed="right" align="center">
<template #default="scope">
<div style="display: -webkit-flex;display: flex; justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/MenuIcon/lbcz_xg.png" alt="" title="修改" @click="editinfo(scope.row)" style="cursor: pointer;">
<img src="@/assets/visionscreening/spotcheck.png" alt="" title="抽检规则" @click="rulesclick(scope.row)" style="cursor: pointer;">
<img src="@/assets/visionscreening/bg-jhgl.png" alt="" title="计划管理" @click="planclick(scope.row)" style="cursor: pointer;">
<img src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delinfo(scope.row)" style="cursor: pointer;">
</div>
</template>
</el-table-column>
</el-table>
<Page class="mt-[20px]" :total="queryInfo.total" v-model:size="queryInfo.size" v-model:current="queryInfo.current"
@pagination="getTableDate" />
</div>
</div>
</div>
<el-dialog v-model="dialogFormVisible" :close-on-click-modal="false" :title="dialogtitle" :before-close="handleClose" width="620px" draggable append-to-body>
<el-form ref="planform" :model="form" :rules="rules" label-width="90px">
<el-form-item label="计划编号" prop="plan_code">
<el-input v-model="form.plan_code" autocomplete="off" placeholder="请输入计划编号" />
</el-form-item>
<el-form-item label="计划名称" prop="plan_name">
<el-input v-model="form.plan_name" autocomplete="off" placeholder="请输入计划名称" />
</el-form-item>
<el-form-item label="组织机构">
<el-input v-model="form.org_name" autocomplete="off" disabled placeholder="请输入组织机构" />
</el-form-item>
<el-form-item label="机构类型">
<el-radio-group v-model="form.org_type" disabled>
<el-radio :label="'3'">/自治州</el-radio>
<el-radio :label="'4'">//县级市</el-radio>
<el-radio :label="'5'">学校</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="开始日期">
<el-date-picker v-model="form.plan_start_date" type="date" style="width:100%" placeholder="请输入开始日期"/>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker v-model="form.plan_end_date" type="date" style="width:100%" placeholder="请输入结束日期"/>
</el-form-item>
</el-form>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="infosubmit(planform)">确定</el-button>
</span>
</el-dialog>
<el-dialog v-model="dialogVisible" :close-on-click-modal="false" title="抽检规则" :before-close="handleCloses" width="860px" draggable append-to-body>
<div v-loading="isCreateInspect" element-loading-text="正在生成抽检学生信息!">
<div class="flex">
<div class="rules-box mr-[20px]" v-loading="schoolLoading">
<div class="rules-box-top">
<el-checkbox v-model="allchecked" @change="allcheckchange($event,'1')" />
<span class="ml-[10px]">选择学校</span>
</div>
<div class="rules-box-bottom h-[345px]">
<el-checkbox-group
v-model="schoolIds"
@change="schoolChange"
>
<div v-for="(item,index) in schoolData">
<el-checkbox :key="item.id" :label="item.id">
{{ item.name }}
</el-checkbox>
</div>
</el-checkbox-group>
</div>
</div>
<div class="rules-box mr-[20px]">
<div class="rules-box-top">
<el-checkbox v-model="allgradechecked" @change="allcheckchange($event,'2')"/>
<span class="ml-[10px]">选择年级</span>
</div>
<div class="rules-box-bottom h-[400px]">
<el-checkbox-group
v-model="gradeIds"
@change="gradesChange"
>
<div v-for="(item,index) in gradeData">
<el-checkbox :key="item.id" :label="item.id">
{{ item.name }}
</el-checkbox>
</div>
</el-checkbox-group>
</div>
</div>
<div class="rules-box">
<div class="rules-box-top">
<el-checkbox v-model="allclasschecked" @change="allcheckchange($event,'3')" />
<span class="ml-[10px]">选择班级</span>
</div>
<div class="rules-box-bottom h-[400px]">
<el-checkbox-group
v-model="classIds"
>
<div v-for="(item,index) in classData">
<el-checkbox :key="item.id" :label="item.id">
{{ item.name }}
</el-checkbox>
</div>
</el-checkbox-group>
<!-- <div v-for="(itemss,indexss) in classData" :key="indexss">
<el-checkbox v-model="itemss.checked" :label="itemss.name" @change="checkchange($event,indexss,'3')" />
</div> -->
</div>
</div>
</div>
<div class="my-[20px] flex w-full">
<div class="flex items-center" style="width:40%;" >
<div class="mr-[20px]">性别</div>
<el-radio-group v-model="genderradio">
<el-radio :label="'0'" size="large">不限</el-radio>
<el-radio :label="'1'" size="large"></el-radio>
<el-radio :label="'2'" size="large"></el-radio>
</el-radio-group>
</div>
<div style="width:60%;">
<div class="flex items-center" >
<div class="mr-[10px] w-[70px]">抽检比例</div>
<el-input v-model.number="checkratio" oninput ="value=value.replace(/[^\d]/g,'')" placeholder="请输入抽检比例" clearable><template #suffix>%</template></el-input>
</div>
</div>
</div>
<span class="dialog-footer">
<el-button @click="handleCloses">取消</el-button>
<el-button type="primary" @click="rulessubmit">确定</el-button>
</span>
</div>
</el-dialog>
</div>
<Planmanages v-if="moduleinfo2" @returnClick="returnClick" :planInfo="form" />
</template>
<style scoped lang="scss">
:deep() {
.el-select--large .el-select__wrapper {
min-height: 0px;
}
}
.contents-box {
height: calc(100vh - 130px);
display: flex;
width: 100%;
#silderLeft {
width: 280px;
box-sizing: border-box;
background: #fff;
border-radius: 3px;
position: relative;
&:hover {
.moveBtn {
opacity: 1;
}
}
// .el-tree-node__content{
// height: 40px;
// // padding-left: 12px !important;
// color: #505050;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
// color: #409eff;
// }
// .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content:hover{
// color: #409eff;
// background-color: #ecf5ff;
// }
// .el-tree-node__content:hover{
// color: #409eff;
// background-color: transparent;
// // #ecf5ff
// }
// .el-tree-node__expand-icon{
// color: #333333;
// }
}
/* 拖动条 */
.moveBtn {
height: 100%;
width: 15px;
padding: 0 6px;
opacity: 0;
position: absolute;
right: -15px;
top: 0;
}
.moveBtn-line {
width: 100%;
height: 100%;
cursor: col-resize;
user-select: none;
background-color: #60bfff;
}
.silderRight {
flex: 1;
position: relative;
width: 100%;
height: calc(100vh - 130px);
overflow: auto;
background-color: rgba(255, 255, 255, 1);
border-radius: 3px;
padding: 20px;
padding-bottom: 0px;
margin-left: 15px;
box-sizing: border-box;
}
}
.lefttitle {
min-width: 130px;
display: flex;
align-items: center;
padding: 10px 20px;
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700;
font-style: normal;
font-size: 16px;
color: #1B1B1B;
border-bottom: 1px var(--el-border-color) var(--el-border-style);
margin-bottom: 10px;
.line {
border-width: 0px;
width: 5px;
height: 14px;
margin-right: 7px;
background: inherit;
background-color: rgba(64, 158, 255, 1);
border: none;
border-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.dialog-footer {
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
:deep() {
.el-input-group__append {
background-color: transparent;
border: none;
padding: 0px 5px;
}
}
.searchinfo {
display: flex;
align-items: center;
margin-bottom: 20px;
justify-content: space-between;
}
.rules-box {
width: 260px;
height: 450px;
border-radius: 4px;
border: 1px solid #e6e8ec;
.rules-box-top {
height: 45px;
border-bottom: 1px solid #e6e8ec;
background-color: #f6f7fa;
line-height: 45px;
font-size: 16px;
color: #606266;
padding-left: 20px;
}
.rules-box-bottom {
padding: 5px 20px;
overflow: auto;
}
}</style>

File diff suppressed because it is too large Load Diff