修改问卷任务统计

This commit is contained in:
shidongli 2024-12-23 17:56:27 +08:00
parent 5089f3ee60
commit 7482733836
5 changed files with 1794 additions and 1268 deletions

View File

@ -17,4 +17,12 @@ export function selectQuestionInfoList(query) {
params: query params: query
}) })
} }
// 问卷详情列表
export function questionnaireTaskOptionList(query) {
return request({
url: '/system/statistics/questionnaireTaskOptionList',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 问卷任务统计右侧列表
export function questionnaireTaskStatistics(query) {
return request({
url: '/system/statistics/questionnaireTaskStatistics',
method: 'get',
params: query
})
}
// 问卷任务统计左侧列表
export function selectQuestionInfoList(query) {
return request({
url: '/system/question/selectQuestionInfoList',
method: 'get',
params: query
})
}
// 问卷分页
export function list(query) {
return request({
url: '/system/question/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,427 @@
<template>
<div class="app-containers">
<el-button
size="small"
@click="classificationOpen = true"
style="
width: 220px;
font-size: 14px;
text-align: left;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
"
:style="handleselectId ? 'color:black' : 'color:#C0C4CC'"
>{{ questionnaireName ? questionnaireName : "请选择模板名称" }}</el-button
>
<el-dialog
title="模版名称选择"
:visible.sync="classificationOpen"
width="70%"
:before-close="classificationOpenfalse"
>
<el-row :gutter="20">
<!--用户数据-->
<el-col :span="24" :xs="24">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item
label="模板名称"
prop="questionnaireName"
label-width="120px"
>
<el-input
v-model="queryParams.questionnaireName"
placeholder="请输入模板名称"
clearable
@keyup.enter.native="handleQuery"
style="width: 220px"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="PatientInfoImportBatchlist"
@row-dblclick="handleselect"
>
<el-table-column
label="序号"
type="index"
width="48"
align="center"
/>
<el-table-column
label="模板名称"
align="center"
prop="questionnaireName"
width="150"
/>
<el-table-column label="操作人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{
parseTime(scope.row.createTime, "{y}-{m}-{d}")
}}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleselect(scope.row)"
v-if="handleselectId != scope.row.id"
>选择</el-button
>
<el-button
size="mini"
type="text"
@click="nohandleselect(scope.row)"
v-if="handleselectId == scope.row.id"
>取消选择</el-button
>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getlist"
/>
</el-dialog>
</div>
</template>
<script>
import { list } from '@/api/system/TaskStatistics'
import { selectAgencyList, getAgencyList } from "@/api/manage/selectAgencyList";
export default {
props: ["templateId", 'query'],
name: "Script",
data() {
return {
createTime: "",
//list
hospitalAgencylist: [],
// list
campusAgencylist: [],
//
PatientInfoImportBatchlist: [],
lookshow: false,
phoneNodeContent: {
scriptInfoId: null,
flowScheme: null,
nodes: [],
edges: [],
},
handleselectId: "",
questionnaireName: '',
classificationOpen: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
questionnaireName: null,
},
};
},
created() {
this.getlist();
this.selectAgencyinfo();
},
mounted() {
console.log(this.query, 'query')
console.log(this.templateId, 'templateId')
if (this.templateId) {
this.handleselectId = this.templateId;
} else {
this.questionnaireName = '';
this.handleselectId = '';
}
if (this.query == true) {
this.questionnaireName = '';
this.handleselectId = '';
}
},
watch: {
query: {
handler(val) {
if(val>1){
this.questionnaireName = '';
this.handleselectId = '';
}
},
deep: true,
immediate: true,
},
templateId: {
handler(val) {
if (val) {
this.handleselectId = val;
} else {
this.questionnaireName = '';
this.handleselectId = '';
}
},
deep: true,
immediate: true,
},
},
methods: {
//list
selectAgencyinfo() {
let query = {
agencyStatus: 'ON',
nodeType: 'HOSPITAL',
}
selectAgencyList(query).then(res => {
this.hospitalAgencylist = res.data
})
},
//
getAgencyListinfo(nodeType, id, type) {
let query = {
nodeType: nodeType,
}
if (nodeType == 'HOSPITAL') {
query.hospitalId = id
} else if (nodeType == 'CAMPUS') {
query.campusId = id
}
getAgencyList(query).then(res => {
// if (type)
console.log(nodeType);
console.log(res.data.campusList);
{
if (nodeType == 'HOSPITAL') {
this.campusAgencylist = res.data.campusList;
}
}
})
},
//
changehospitalAgency(id, type, typetwo) {
this.getAgencyListinfo('HOSPITAL', id, type)
// let query = {
// agencyStatus: 'ON',
// nodeType: 'CAMPUS',
// parentId: id,
// }
// selectAgencyList(query).then(res => {
if (type) {
if (!typetwo) {
this.form.campusAgencyId = null
}
} else {
this.queryParams.campusAgencyId = null
}
// })
},
//
changecampusAgency(id, type, typetwo) {
this.getAgencyListinfo('CAMPUS', id, type)
},
//
clearhospitalAgency(type) {
if (type) {
this.form.campusAgencyId = null
this.form.departmentId = null
this.form.wardId = null
} else {
this.queryParams.campusAgencyId = null
this.queryParams.departmentId = null
this.queryParams.wardId = null
}
},
//
clearcampusAgency(type) {
if (type) {
this.form.departmentId = null
this.form.wardId = null
this.getAgencyListinfo('HOSPITAL', this.form.hospitalAgencyId, type)
} else {
this.queryParams.departmentId = null
this.queryParams.wardId = null
this.getAgencyListinfo('HOSPITAL', this.queryParams.hospitalAgencyId)
}
},
//
nohandleselect() {
this.handleselectId = "";
this.questionnaireName = "";
this.$emit("on-template", {
id: '',
});
},
//
handleselect(item) {
console.log(item, '0000000000');
this.handleselectId = item.id;
this.questionnaireName = item.questionnaireName
this.$emit("on-template", {
questionInfoId: item.id,
questionnaireName: item.questionnaireName,
});
this.classificationOpen = false;
},
classificationOpenfalse() {
this.classificationOpen = false;
},
/** 查询话术信息列表 */
getlist() {
this.loading = true;
list(this.queryParams).then(response => {
this.PatientInfoImportBatchlist = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
if (this.createTime?.length > 0) {
this.queryParams.importTimeStart = this.createTime[0];
this.queryParams.importTimeEnd = this.createTime[1];
} else {
this.queryParams.importTimeStart = null;
this.queryParams.importTimeEnd = null;
}
this.getlist();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10
}
this.createTime = '';
this.handleQuery();
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .el-dialog__body {
padding-bottom: 60px;
}
.app-containers {
display: inline-block;
padding: 0 !important;
// background: red;
height: 42px;
}
::v-deep .el-textarea__inner {
width: 206px;
}
.leftscript {
// width: 30%;
height: 650px;
overflow: auto;
.name {
font-weight: 700;
margin-bottom: 10px;
}
.listitem {
width: 100%;
height: 50px;
border-bottom: 1px solid #dcdfe6;
position: relative;
.count {
display: inline-block;
position: absolute;
left: 210px;
color: #a4a6aa;
top: 10px;
font-size: 13px;
}
.all {
height: 50px;
line-height: 50px;
padding-left: 13px;
}
.allactive {
background: #e8f4ff;
height: 50px;
line-height: 50px;
padding-left: 13px;
border-left: 3px solid #4d9de7;
}
}
}
.button {
display: inline-block;
position: relative;
left: 20px;
top: -11px;
}
</style>

View File

@ -2,14 +2,8 @@
<div class="app-container home" ref="layout"> <div class="app-container home" ref="layout">
<!-- 搜索条件 --> <!-- 搜索条件 -->
<div ref="topform" class="form"> <div ref="topform" class="form">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
:model="queryParams" <el-form-item label="任务时间" prop="taskStartTime" label-width="90px">
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item label="任务时间" prop="startTime">
<el-date-picker <el-date-picker
v-model="dischargeTime" v-model="dischargeTime"
type="daterange" type="daterange"
@ -22,25 +16,29 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="模板名称" prop="patientPhone"> <el-form-item label="模板名称" prop="questionInfoId">
<el-input <span>
v-model="queryParams.patientPhone" <TemplateName
placeholder="请输入模板名称" @on-template="messageontemplateword"
clearable :templateId="questionInfoId"
@keyup.enter.native="handleQuery" :query="questionInfoIdname"
style="width: 200px" ></TemplateName>
/> </span>
</el-form-item> </el-form-item>
<el-form-item label="出院/就诊时间" prop="startTime">
<el-form-item
label="出院/就诊时间"
prop="visitStartTime"
label-width="120px"
>
<el-date-picker <el-date-picker
v-model="dischargeTime" v-model="dischargeTimevisit"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
style="width: 220px" style="width: 220px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
end-placeholder="结束日期" end-placeholder="结束日期"
@change="changeTime"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -67,100 +65,90 @@
> >
<!-- 左侧 --> <!-- 左侧 -->
<div class="left"> <div class="left">
<div> <!-- <div> -->
<div
v-for="(item, index) in NameList"
:key="index"
class="itemlist"
:class="itemid == item.id ? 'allactive' : 'all'"
@click="itemdata(item)"
>
<div <div
v-for="(item, index) in NameList" style="width: 88%; margin: 0 auto; border-bottom: 1px solid #dcdfe6"
:key="index"
class="itemlist"
:class="itemid == item.id ? 'allactive' : 'all'"
@click="itemdata(item)"
> >
<div class="title">{{ item.name }}</div> <!-- <el-popover
<div class="times">时间:{{ item.date }}</div> placement="top"
<div class="times">填写率:{{ item.totle }}%</div> trigger="hover"
:content="item.questionnaireName"
>
<div class="title" slot="reference">
{{ item.questionnaireName }}
</div>
</el-popover> -->
<div class="title" slot="reference">
{{ item.questionnaireName }}
</div>
<div class="progress">时间:{{ item.createTime }}</div>
<!-- <div class="times">填写率:{{ item.totle }}%</div>
<div class="progress"> <div class="progress">
<el-progress :percentage="50" :show-text="false"></el-progress> <el-progress :percentage="50" :show-text="false"></el-progress>
<span>12/45</span> <span>12/45</span>
</div> </div> -->
</div> </div>
</div> </div>
<!-- </div> -->
</div> </div>
<!-- 右侧 --> <!-- 右侧 -->
<div class="right"> <div class="right">
<div class="righttitle">{{newname}} {{time}} </div> <div class="righttitle">{{ newname }} {{ time }}</div>
<div class="tabledata"> <div class="tabledata" v-for="(item, index) in tableData" :key="index">
<div class="toptitle">第1题:请问您吸烟吗?单选题</div> <div class="toptitle">
<div ref="table" class="tables"> {{ index + 1 }}:{{ item.questionName }}
<el-table
:max-height="maxTableHeight" <span v-if="item.questionType == 'MULTIPLE_CHOICE'"
v-loading="loading" >单选题</span
:data="tableData" >
<span v-if="item.questionType == 'MULTIPLE_CHOICE_QUESTIONS'"
>多选题</span
>
<span v-if="item.questionType == 'COMBINATION_RADIO_SUBJECT'"
>组合单选题</span
>
<span v-if="item.questionType == 'COMBINATION_MULTIPLE_SUBJECT'"
>组合多选题</span
> >
<el-table-column label="选项" align="center" prop="name" />
<el-table-column label="人数" align="center" prop="date" />
<el-table-column label="比例" align="center" prop="date">
<span> <el-progress :percentage="50"></el-progress></span>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
</div> </div>
</div>
<div class="tabledata">
<div class="toptitle">第1题:请问您吸烟吗?单选题</div>
<div ref="table" class="tables"> <div ref="table" class="tables">
<el-table <el-table
:max-height="maxTableHeight" :max-height="maxTableHeight"
v-loading="loading" v-loading="loading"
:data="tableData" :data="item.questionnaireTaskOptionStatisticsVos"
> >
<el-table-column label="选项" align="center" prop="name" /> <el-table-column label="选项" align="center" prop="optionName" />
<el-table-column label="人数" align="center" prop="date" />
<el-table-column label="比例" align="center" prop="date">
<span> <el-progress :percentage="50"></el-progress></span>
</el-table-column>
<el-table-column <el-table-column
label="操作" label="人数"
align="center" align="center"
class-name="small-padding fixed-width" prop="choiceNumber"
/>
<el-table-column
label="比例"
align="center"
prop="choiceProportion"
> >
<template slot-scope="scope"> <template slot-scope="scope"
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>查看</el-button
> >
<el-progress
:percentage="
scope.row.choiceProportion
? scope.row.choiceProportion
: 0
"
></el-progress>
</template> </template>
</el-table-column> </el-table-column>
</el-table>
</div>
</div>
<div class="tabledata">
<div class="toptitle">第1题:请问您吸烟吗?单选题</div>
<div ref="table" class="tables">
<el-table
:max-height="maxTableHeight"
v-loading="loading"
:data="tableData"
>
<el-table-column label="选项" align="center" prop="name" />
<el-table-column label="人数" align="center" prop="date" />
<el-table-column label="比例" align="center" prop="date">
<span> <el-progress :percentage="50"></el-progress></span>
</el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
@ -184,82 +172,117 @@
</template> </template>
<script> <script>
import { questionnaireTaskStatistics, selectQuestionInfoList } from '@/api/system/TaskStatistics'
import TemplateName from "@/views/manage/components/TemplateName";
export default { export default {
name: "TaskStatistics", name: "TaskStatistics",
components: { TemplateName },
data() { data() {
return { return {
show: false,
maxTableHeight: undefined, maxTableHeight: undefined,
// //
dischargeTime: [], dischargeTime: [],
// /
dischargeTimevisit: [],
loading: false, loading: false,
newname:'',// newname: '',//
time:'',// time: '',//
NameList: [ NameList: [],
{
name: '预估病情',
date: '2016-05-02',
totle: 6,
id: 1,
}, {
name: '烟草依赖评估量表',
date: '2016-05-02',
totle: 7,
id: 2,
},
{
name: '疾病恢复情况随访问卷',
date: '2016-05-02',
totle: 8,
id: 3,
}
],
// //
tableData: [{ tableData: [],
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}],
itemid: "", itemid: "",
id: 1, questionInfoId: '',
questionInfoIdname:0,
queryParams: { queryParams: {
taskStartTime: null,
taskEndTime: null,
visitstartTime: null,
visitEndTime: null,
questionInfoId: null,
}, },
} }
}, },
created() { created() {
// this.getDefaultDateRange()
// this.getlist()
this.getlistleft()
}, },
mounted() { mounted() {
this.getMaxTableHeight() this.getMaxTableHeight()
this.screenChange() this.screenChange()
}, },
methods: { methods: {
hidePopover() {
this.showPopover = false;
},
//
getlist() {
questionnaireTaskStatistics(this.queryParams).then(res => {
this.tableData = res.data.data
console.log(res)
})
},
//
getlistleft() {
selectQuestionInfoList().then(res => {
this.NameList = res
this.queryParams.questionInfoId = this.NameList[0].id
this.itemid = this.NameList[0].id
this.newname = this.NameList[0].questionnaireName
this.time = this.NameList[0].createTime
this.getlist()
})
},
changeTime(e) {
this.show = false;
},
//
messageontemplateword(item) {
this.queryParams.questionInfoId = item.questionInfoId;
this.itemid=item.questionInfoId
// var obj = {
// questionInfoId: this.itemid
// }
// questionnaireTaskStatistics(obj).then(res => {
// this.tableData = res.data.data
// })
},
//
getDefaultDateRange() {
this.show = true;
const endDate = new Date(); //
const startDate = new Date();
startDate.setDate(endDate.getDate() - 6); // 退
console.log(startDate, endDate);
this.dischargeTime[0] = startDate;
this.dischargeTime[1] = endDate;
this.queryParams.taskStartTime = this.formatDate(this.dischargeTime[0]);
this.queryParams.taskEndTime = this.formatDate(this.dischargeTime[1]);
},
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 01
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
// //
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ this.$router.push({
path: "/statisticalAnalysis/datialdata", path: "/statisticalAnalysis/datialdata",
query: { query: {
path: "/statisticalAnalysis/TaskStatistics", path: "/statisticalAnalysis/TaskStatistics",
// sn: 11111, questionInfoId: row.questionInfoId ? row.questionInfoId : '',
// patientName: row.patientName ? row.patientName : '', questionSubjectOptionId: row.questionSubjectOptionId ? row.questionSubjectOptionId : '',
// departmentId: row.departmentId ? row.departmentId : '', optionChooseSign: row.optionChooseSign ? row.optionChooseSign : '',
// departmentName: row.departmentName ? row.departmentName : '',
}, },
}); });
@ -268,11 +291,56 @@ export default {
itemdata(item) { itemdata(item) {
console.log(item, '9999') console.log(item, '9999')
this.itemid = item.id this.itemid = item.id
this.newname=item.name this.newname = item.questionnaireName
this.time=item.date this.time = item.createTime
var obj = {
questionInfoId: item.id
}
questionnaireTaskStatistics(obj).then(res => {
this.tableData = res.data.data
})
},
//
resetQuery() {
this.queryParams.questionInfoId=null,
this.questionInfoId = null,
this.dischargeTime = [];
this.dischargeTimevisit = [];
this.queryParams.taskStartTime = "";
this.queryParams.taskEndTime = "";
this.resetForm("queryForm");
this.questionInfoIdname += 1;
console.log(this.queryParams,'queryParams0000000000');
this.getlistleft();
},
//
handleQuery() {
if (this.dischargeTime?.length > 0) {
if (this.show == true) {
this.queryParams.taskStartTime = this.formatDate(this.dischargeTime[0]);
this.queryParams.taskEndTime = this.formatDate(this.dischargeTime[1]);
} else if (this.show == false) {
this.queryParams.taskStartTime = this.dischargeTime[0];
this.queryParams.taskEndTime = this.dischargeTime[1];
}
}
else {
this.queryParams.taskStartTime = null;
this.queryParams.taskEndTime = null;
}
if (this.dischargeTimevisit?.length > 0) {
this.queryParams.visitStartTime = this.dischargeTimevisit[0];
this.queryParams.visitEndTime = this.dischargeTimevisit[1];
} else {
this.queryParams.visitStartTime = this.dischargeTimevisit[0];
this.queryParams.visitEndTime = this.dischargeTimevisit[1];
}
this.getlist();
}, },
resetQuery() { },
handleQuery() { },
changeTime() { }, changeTime() { },
// //
getMaxTableHeight() { getMaxTableHeight() {
@ -298,6 +366,18 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #c0c0c0;
}
::-webkit-scrollbar-track {
width: 5px;
}
::v-deep .el-progress { ::v-deep .el-progress {
width: 64%; width: 64%;
display: inline-block; display: inline-block;
@ -316,6 +396,9 @@ export default {
margin: 10px auto; margin: 10px auto;
padding: 13px 0 0 0; padding: 13px 0 0 0;
background-color: #fff !important; background-color: #fff !important;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
margin: 10px auto 5px;
} }
.bottomsstics { .bottomsstics {
width: 98%; width: 98%;
@ -336,29 +419,30 @@ export default {
.all { .all {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
height: 170px; // height: 99px;
border-bottom: 1px solid #dcdfe6;
} }
.itemlist { .itemlist {
// width: 94%; // width: 94%;
margin: 0 auto; margin: 0 auto;
height: 170px; // height: 99px;
border-bottom: 1px solid #dcdfe6;
.title { .title {
font-size: 19px; font-size: 19px;
font-weight: 600; font-weight: 600;
color: black; color: black;
padding: 20px 0 10px 30px; // overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// padding: 8px 0 10px 0px;
padding: 23px 0 10px 0px;
} }
.times { .times {
padding: 0px 0 10px 30px; padding: 0px 0 10px 0px;
font-size: 16px; font-size: 16px;
color: #aaacb2; color: #aaacb2;
} }
.progress { .progress {
// width: 70%; padding: 0px 0 23px 0px;
padding: 0px 0 10px 30px;
} }
span { span {
margin-left: 17px; margin-left: 17px;
@ -379,6 +463,7 @@ export default {
padding: 20px 0 10px 30px; padding: 20px 0 10px 30px;
} }
.tabledata { .tabledata {
margin-bottom: 13px;
.tables { .tables {
margin: 0 auto; margin: 0 auto;
width: 97%; width: 97%;
@ -392,20 +477,6 @@ export default {
} }
} }
} }
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eee;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eee;
}
.col-item { .col-item {
margin-bottom: 20px; margin-bottom: 20px;
} }

File diff suppressed because it is too large Load Diff