宣教、问卷

This commit is contained in:
shidongli 2024-07-10 18:01:01 +08:00
parent c08db47108
commit 20303f7cee
3 changed files with 495 additions and 45 deletions

View File

@ -0,0 +1,210 @@
<template>
<div>
<div ref="table">
<el-form
ref="queryForm"
:model="informationqueryParams"
label-width="80px"
:inline="true"
>
<el-form-item label="问卷标题" prop="questionnaireName">
<el-input
v-model="informationqueryParams.questionnaireName"
placeholder="请输入问卷标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="病种名称" prop="diseaseTypeName">
<el-input
v-model="informationqueryParams.diseaseTypeName"
placeholder="请输入病种名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="informationInfoinfo"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="addresetQuerylist"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
ref="multipleTable"
v-loading="loading"
:data="infolist"
@selection-change="handleSelectionChange"
:row-key="getRowKey"
@cell-dblclick="handleRowDbClick"
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
/>
<el-table-column label="序号" type="index" width="55" align="center" />
<!-- <el-table-column
label="问卷模板名称"
align="center"
prop="questionnaireName"
/> -->
<el-table-column label="问题个数" align="center" prop="questionCount" />
<el-table-column
label="问卷模板ID"
align="center"
prop="questionnaireId"
/>
<el-table-column label="问卷类型" align="center" prop="questionType">
<template slot-scope="scope">
<div v-if="scope.row.questionType == 'REGULAR_QUESTIONNAIRE'">
普通问卷
</div>
<div v-if="scope.row.questionType == 'SATISFACTION_QUESTIONNAIRE'">
满意度问卷
</div>
</template>
</el-table-column>
<el-table-column
label="问卷状态"
align="center"
prop="questionnaireStatus"
>
<template slot-scope="scope">
<el-tag
type="success"
v-if="scope.row.questionnaireStatus == 'PUBLISHED'"
>已发布</el-tag
>
<el-tag type="warning" v-else>未发布</el-tag>
</template>
</el-table-column>
<el-table-column
label="病种名称"
align="center"
prop="diseaseTypeName"
/>
</el-table>
<div class="bottom">
<myPagination
v-show="totaldepartment > 0"
:total="totaldepartment"
:pageSize="informationqueryParams.pageSize"
:indexFromWrap="informationqueryParams.pageNum"
@updateCPage="updateCPagetwo"
></myPagination>
</div>
</div>
</div>
</template>
<script>
import { getBaseList } from "@/api/system/exportinfo";
export default {
data() {
return {
//
ids: [],
//
single: true,
//
multiple: true,
infolist: [],
loading: false,
datalist: [],
informationqueryParams: {
pageNum: 1,
pageSize: 10,
type: 'QUESTION',
questionnaireStatus:'PUBLISHED',
hospitalAgencyId: 46,
questionnaireName: null,
diseaseTypeName: null,
},
totaldepartment: 0,
}
},
watch: {
datalist(val) {
this.$emit('submit', val);
},
},
created() {
this.informationInfoinfo()
},
methods: {
resetTable() {
this.$refs.multipleTable.clearSelection();
},
//
informationInfoinfo() {
getBaseList(this.informationqueryParams).then((response) => {
this.infolist = response.rows;
this.totaldepartment = response.total;
this.loading = false;
});
},
getRowKey(row) {
return row.id
},
//
handleSelectionChange(selection) {
// this.datalist = selection
this.datalist = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleRowDbClick(row, column, event) {//
const index = this.datalist.indexOf(row);
console.log(index, '0000000000')
if (index !== -1) {
this.datalist.splice(index, 1);
} else {
this.datalist.push(row);
}
// `toggleRowSelection`
this.$refs.multipleTable.toggleRowSelection(row, index === -1);
},
//
addresetQuerylist() {
this.informationqueryParams = {
pageNum: 1,
pageSize: 10,
type: 'QUESTION',
questionnaireStatus:'PUBLISHED',
hospitalAgencyId: 46,
};
this.informationInfoinfo();
},
//
updateCPagetwo(index, size) {
this.informationqueryParams.pageNum = index
this.informationqueryParams.pageSize = size
this.informationInfoinfo();
},
},
mounted() {
},
}
</script>
<style lang="scss" scoped>
.bottom {
.pagination {
bottom: 62px !important;
}
}
</style>

View File

@ -430,10 +430,12 @@
</el-form-item>
<el-form-item label="正文内容" prop="propagandaContent">
<editor
id="id"
ref="myTextarea"
v-model="form.propagandaContent"
:min-height="192"
style="width: 800px"
@paste.native.prevent="handlePaste"
/>
<!-- <editor
v-model="form.propagandaContent"
@ -1063,7 +1065,36 @@ export default {
}
this.$forceUpdate()
},
// checkContentLength() {
//
handlePaste(event) {
console.log(event, 'event')
const clipboardData = event.clipboardData || window.clipboardData;
const pastedText = clipboardData.getData('text');
const types = clipboardData.types || [];
console.log('粘贴的文本:', pastedText);
console.log('粘贴的leixing:', types);
if (types[0] == 'Files') {
console.log('00000000000000000000000')
event.preventDefault();
this.$message({
type: "error",
message: "禁止粘贴图片,请正确上传图片"
});
}
else {
event.preventDefault();
//
event.target.outerText += pastedText;
//
const dom = document.getElementById('id')
dom && dom.focus()
// document.execCommand('selectAll', false, null);
// document.getSelection().collapseToEnd();
console.log(event, '222222222222222')
}
},
// checkContentLength(event) {
// console.log(event,'event')
// const regex = /^.{0,20000}$/; // 2
// if (!regex.test(this.form.propagandaContent)) {
// this.$message({
@ -1429,7 +1460,7 @@ export default {
// if (this.form.propagandaContent.length - 7 > this.maxLength) {
this.$message({
type: "error",
message: "已达到最大输入长度"
message: "正文内容已达到最大输入长度"
});
// }
} else {

View File

@ -3,111 +3,283 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="5" :xs="24">
<DepartmentList ref="DepartmentList" @clickdepartment="clickdepartment" :methods="'getDepartmentList'">
<DepartmentList
ref="DepartmentList"
@clickdepartment="clickdepartment"
:methods="'getDepartmentList'"
>
</DepartmentList>
</el-col>
<!--用户数据-->
<el-col :span="19" :xs="24">
<div ref="topform" class="form">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="70px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="70px"
>
<el-form-item label="问卷标题" prop="questionnaireName">
<el-input v-model="queryParams.questionnaireName" placeholder="请输入问卷标题" clearable
@keyup.enter.native="handleQuery" />
<el-input
v-model="queryParams.questionnaireName"
placeholder="请输入问卷标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="病种名称" prop="diseaseTypeName">
<el-input v-model="queryParams.diseaseTypeName" placeholder="请输入病种名称" clearable
@keyup.enter.native="handleQuery" />
<el-input
v-model="queryParams.diseaseTypeName"
placeholder="请输入病种名称"
clearable
@keyup.enter.native="handleQuery"
/>
</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-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>
</div>
<div ref="mb8" class="mb8">
<el-row :gutter="10" class="">
<el-col :span="1.5">
<el-button type="primary" size="mini" @click="handleAdd"
v-hasPermi="['system:question:add']">新增问卷模板</el-button>
<el-button
type="primary"
size="mini"
@click="handleAdd"
v-hasPermi="['system:question:add']"
>新增问卷模板</el-button
>
<el-button
type="warning"
plain
icon="el-icon-upload2"
size="mini"
@click="handleUpload"
>导入</el-button
>
</el-col>
</el-row>
</div>
<div ref="table">
<el-table :max-height="maxTableHeight" v-loading="loading" :data="questionList">
<el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column label="问卷模板名称" align="center" prop="questionnaireName" />
<el-table-column label="问题个数" align="center" prop="questionCount" />
<el-table-column label="问卷模板ID" align="center" prop="questionnaireId" />
<el-table-column label="问卷类型" align="center" prop="questionType">
<el-table
:max-height="maxTableHeight"
v-loading="loading"
:data="questionList"
>
<el-table-column
label="序号"
type="index"
width="55"
align="center"
/>
<el-table-column
label="问卷模板名称"
align="center"
prop="questionnaireName"
/>
<el-table-column
label="问题个数"
align="center"
prop="questionCount"
/>
<el-table-column
label="问卷模板ID"
align="center"
prop="questionnaireId"
/>
<el-table-column
label="问卷类型"
align="center"
prop="questionType"
>
<template slot-scope="scope">
<div v-if="scope.row.questionType == 'REGULAR_QUESTIONNAIRE'">普通问卷</div>
<div v-if="scope.row.questionType == 'SATISFACTION_QUESTIONNAIRE'">满意度问卷</div>
<div v-if="scope.row.questionType == 'REGULAR_QUESTIONNAIRE'">
普通问卷
</div>
<div
v-if="scope.row.questionType == 'SATISFACTION_QUESTIONNAIRE'"
>
满意度问卷
</div>
</template>
</el-table-column>
<el-table-column label="问卷状态" align="center" prop="questionnaireStatus">
<el-table-column
label="问卷状态"
align="center"
prop="questionnaireStatus"
>
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.questionnaireStatus == 'PUBLISHED'">已发布</el-tag>
<el-tag
type="success"
v-if="scope.row.questionnaireStatus == 'PUBLISHED'"
>已发布</el-tag
>
<el-tag type="warning" v-else>未发布</el-tag>
</template>
</el-table-column>
<el-table-column label="病种名称" align="center" prop="diseaseTypeName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="病种名称"
align="center"
prop="diseaseTypeName"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<!-- <el-switch v-model="scope.row.questionnaireStatus" active-color="#13ce66" inactive-color="#ff4949"
active-value="PUBLISHED" inactive-value="UNPUBLISHED" @change="switchstatus($event, scope.row)">
</el-switch> -->
<el-button size="mini" type="text" @click="switchstatus('UNPUBLISHED', scope.row)"
v-if="scope.row.questionnaireStatus == 'PUBLISHED'">取消发布</el-button>
<el-button size="mini" type="text" @click="switchstatus('PUBLISHED', scope.row)" v-else>发布</el-button>
<el-button size="mini" type="text" @click="handleClassification(scope.row)"
v-hasPermi="['system:question:edit']">分类管理</el-button>
<el-button size="mini" type="text" @click="handleUpdate(scope.row)"
v-hasPermi="['system:question:edit']">编辑</el-button>
<el-button size="mini" type="text" @click="handleDelete(scope.row)"
v-hasPermi="['system:question:remove']">删除</el-button>
<el-button
size="mini"
type="text"
@click="switchstatus('UNPUBLISHED', scope.row)"
v-if="scope.row.questionnaireStatus == 'PUBLISHED'"
>取消发布</el-button
>
<el-button
size="mini"
type="text"
@click="switchstatus('PUBLISHED', scope.row)"
v-else
>发布</el-button
>
<el-button
size="mini"
type="text"
@click="handleClassification(scope.row)"
v-hasPermi="['system:question:edit']"
>分类管理</el-button
>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:question:edit']"
>编辑</el-button
>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['system:question:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" /> -->
<myPagination v-show="total > 0" :total="total" :pageSize="queryParams.pageSize"
:indexFromWrap="queryParams.pageNum" @updateCPage="updateCPage"></myPagination>
<myPagination
v-show="total > 0"
:total="total"
:pageSize="queryParams.pageSize"
:indexFromWrap="queryParams.pageNum"
@updateCPage="updateCPage"
></myPagination>
</el-col>
</el-row>
<el-dialog title="提示" :visible.sync="classificationOpen" width="30%" :before-close="classificationOpenfalse">
<el-form ref="form" :model="classificationform" label-width="80px" :rules="rules">
<el-dialog
title="提示"
:visible.sync="classificationOpen"
width="30%"
:before-close="classificationOpenfalse"
>
<el-form
ref="form"
:model="classificationform"
label-width="80px"
:rules="rules"
>
<el-form-item label="科室名称" prop="departmentId">
<el-select v-model="classificationform.departmentId" placeholder="请选择科室" clearable style="width:300px"
@clear="cleardepartment" @change="changedepartment">
<el-option v-for="item in departmentlist" :key="item.id" :label="item.departmentName" :value="item.id" />
<el-select
v-model="classificationform.departmentId"
placeholder="请选择科室"
clearable
style="width: 300px"
@clear="cleardepartment"
@change="changedepartment"
>
<el-option
v-for="item in departmentlist"
:key="item.id"
:label="item.departmentName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="病种名称">
<el-select v-model="classificationform.diseaseTypeId" placeholder="请选择病种" clearable style="width:300px"
@change="changediseaseType">
<el-option v-for="item in diseaselist" :key="item.id" :label="item.diseaseTypeName" :value="item.id" />
<el-select
v-model="classificationform.diseaseTypeId"
placeholder="请选择病种"
clearable
style="width: 300px"
@change="changediseaseType"
>
<el-option
v-for="item in diseaselist"
:key="item.id"
:label="item.diseaseTypeName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="classificationupload"> </el-button>
<el-button type="primary" @click="classificationupload"
> </el-button
>
<el-button @click="classificationOpenfalse"> </el-button>
</div>
</el-dialog>
<!-- 导入弹框 -->
<el-dialog
title=""
:visible.sync="innerexport"
width="1000px"
append-to-body
:before-close="exportcancel"
>
<questionexport @submit="submit" ref="childComponent"></questionexport>
<div slot="footer" class="dialog-footer footerlist">
<el-button type="primary" @click="submitexport"> </el-button>
<el-button @click="innerexport = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listQuestion, getQuestion, delQuestion, addQuestion, updateQuestion, getDepartmentList, selectUserDepartment, diseaseList, updateclassification } from "@/api/system/question";
import DepartmentList from '../../components/DepartmentList.vue'
import { copyBaselnfo } from "@/api/system/exportinfo";
import questionexport from "@/views/manage/components/questionexport.vue"
export default {
components: {
DepartmentList,
questionexport
},
name: "Question",
data() {
return {
//
innerexport: false,
exportlist: [],
maxTableHeight: undefined,
classificationOpen: false,
classificationform: {},
@ -152,6 +324,40 @@ export default {
this.screenChange()
},
methods: {
submit(e) {
this.exportlist = e
},
//
submitexport() {
var obj = {
departmentId: this.queryParams.departmentId,
departmentName: this.departmentName,
type: 'QUESTION',
sourceTemplateIds: this.exportlist,
}
copyBaselnfo(obj).then(response => {
this.$modal.msgSuccess("导入成功");
this.innerexport = false
this.$refs.DepartmentList.Departmentlist()
this.getList();
});
},
//
handleUpload() {
if (this.queryParams.departmentId) {
this.innerexport = true
if (this.exportlist.length > 0) {
this.$refs.childComponent.resetTable();
}
} else {
this.$modal.msgError("请先选择左侧科室");
}
},
//
exportcancel() {
this.innerexport = false
},
//
clickdepartment(item) {
this.queryParams.hospitalAgencyId = item.hospitalAgencyId
@ -400,7 +606,10 @@ export default {
.app-container {
padding: 20px 0 0 20px !important;
}
::v-deep .el-dialog__footer{
padding-top: 33px !important;
}
::v-deep .el-row {
height: 100% !important;
}