This commit is contained in:
2024-07-10 17:47:18 +08:00
parent b721229862
commit 136400f95b
10 changed files with 195 additions and 83 deletions

View File

@ -73,7 +73,7 @@ export default {
name: "DepartmentList",
data() {
return {
vmodal: false,
vmodal: true,
roleKey: localStorage.getItem('roleKey'),
open: false,
switchvalue: true,
@ -106,6 +106,7 @@ export default {
},
created() {
this.querydepartmen.hospitalAgencyId = JSON.parse(localStorage.getItem('user')).hospitalAgencyId
this.vmodal = this.modal
this.Departmentlist();
},
methods: {

View File

@ -6,7 +6,7 @@
<el-dialog title="专病管理路径选择" :visible.sync="classificationOpen" width="70%" :before-close="classificationOpenfalse">
<el-row :gutter="20">
<el-col :span="6" :xs="24">
<DepartmentList ref="DepartmentList" :modal="true" @clickdepartment="clickdepartment"
<DepartmentList ref="DepartmentList" :modal="false" @clickdepartment="clickdepartment"
:servicePackageId="servicePackageId" :methods="'selectDiseaseCounttwo'">
</DepartmentList>
</el-col>

View File

@ -44,14 +44,30 @@
<div class="questionnairedetails">
<div>
<div class="questionnaire-title">
科室名称:
</div>
<el-select v-model="list.departmentId" placeholder=" " clearable class="title-input"
style="padding:0" @clear="cleardepartment" @change="changedepartment">
<el-option v-for="item in departmentlist" :key="item.id" :label="item.departmentName"
:value="item.id" />
</el-select>
<div class="questionnaire-title" style="margin-top:30px">
病种名称:
</div>
<el-select v-model="list.diseaseTypeId" placeholder=" " clearable class="title-input"
style="padding:0" @change="changediseaseType">
<el-option v-for="item in diseaselist" :key="item.id" :label="item.diseaseTypeName"
:value="item.id" />
</el-select>
<div class="questionnaire-title" style="margin-top:30px">
问卷标题:
</div>
<input type="text" class="title-input" v-model="list.questionnaireName">
<div class="questionnaire-title" style="margin-top:30px">
问卷说明:
</div>
<el-input type="textarea" class="editor" :rows="6" placeholder="请输入内容"
:autosize="{ minRows: 6, maxRows: 10 }" v-model="list.questionnaireDescription">
<el-input type="textarea" class="editor" :rows="6" :autosize="{ minRows: 6, maxRows: 10 }"
v-model="list.questionnaireDescription">
</el-input>
</div>
<div class="addArea" v-if="questionlist.length == 0">
@ -454,7 +470,7 @@
</template>
<script>
import { getQuestion, addQuestion, updateQuestion } from "@/api/system/question";
import { getQuestion, addQuestion, updateQuestion, selectUserDepartment, diseaseList } from "@/api/system/question";
import draggable from 'vuedraggable'
export default {
name: "addQuestionnaire",
@ -528,6 +544,10 @@ export default {
questionnaireTotalScore: 0, //
questionSubjectList: [],
questionType: undefined,
diseaseTypeId: undefined,
diseaseTypeName: undefined,
departmentId: undefined,
departmentName: undefined,
},
//arr
questionlist: [],
@ -552,6 +572,10 @@ export default {
disabled: true,
index: -1,
},
//
departmentlist: [],
//
diseaselist: [],
};
},
watch: {
@ -560,6 +584,15 @@ export default {
if (this.$route.query.id) {
this.info();
}
let queryparam = {
hospitalAgencyId: this.$route.query.hospitalAgencyId
}
selectUserDepartment(queryparam).then(res => {
this.departmentlist = res.data
})
if (this.$route.query.departmentId) {
this.changedepartment(this.$route.query.departmentId)
}
},
computed: {
questionnaireTotalScore: function () {
@ -610,6 +643,26 @@ export default {
},
},
methods: {
changediseaseType(e) {
this.list.diseaseTypeName = this.diseaselist?.find(el => el.id == e)?.diseaseTypeName
},
cleardepartment() {
this.list.diseaseTypeId = ''
this.list.diseaseTypeName = ''
this.list.departmentId = ''
this.list.departmentName = ''
},
changedepartment(e) {
this.list.departmentName = this.departmentlist?.find(el => el.id == e)?.departmentName
let query = {
departmentId: e
}
diseaseList(query).then(res => {
this.diseaselist = res.data
this.list.diseaseTypeId = ''
this.list.diseaseTypeName = ''
})
},
addquestion(item) {
this.id++
if (this.questionlist.length > 0) {
@ -1022,81 +1075,112 @@ export default {
},
//
upload() {
if (!this.list.questionType) {
this.$message.error('请选择问卷类型!');
return
}
this.list.questionSubjectList = []
this.questionlist.forEach((e, eindex) => {
e.questionNumber = eindex + 1
if (e.questionType == 'COMBINATION_RADIO_SUBJECT' || e.questionType == 'COMBINATION_MULTIPLE_SUBJECT' || e.questionType == 'COMBINATION_BLANKS_SUBJECT' || e.questionType == 'COMBINATION_SCORING_SUBJECT') {
e.list.forEach((el, elindex) => {
el.questionDescription = e.questionDescription
el.questionNumber = (eindex + 1) + '.' + (elindex + 1)
if (e.questionType != 'COMBINATION_BLANKS_SUBJECT') {
el.questionSubjectOptionList.forEach(ele => {
ele.optionAnswer = ele.optionName
ele.questionName = el.questionName
ele.questionNumber = el.questionNumber
this.$confirm('保存此问卷, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(() => {
if (!this.list.questionType) {
this.$message.error('请选择问卷类型!');
return
}
if (!this.list.departmentId) {
this.$message.error('请选择科室!');
return
}
if (!this.list.diseaseTypeId) {
this.$message.error('请选择病种!');
return
}
const loading = this.$loading({
lock: true,
text: '保存中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.7)'
});
this.list.questionSubjectList = []
this.questionlist.forEach((e, eindex) => {
e.questionNumber = eindex + 1
if (e.questionType == 'COMBINATION_RADIO_SUBJECT' || e.questionType == 'COMBINATION_MULTIPLE_SUBJECT' || e.questionType == 'COMBINATION_BLANKS_SUBJECT' || e.questionType == 'COMBINATION_SCORING_SUBJECT') {
e.list.forEach((el, elindex) => {
el.questionDescription = e.questionDescription
el.questionNumber = (eindex + 1) + '.' + (elindex + 1)
if (e.questionType != 'COMBINATION_BLANKS_SUBJECT') {
el.questionSubjectOptionList.forEach(ele => {
ele.optionAnswer = ele.optionName
ele.questionName = el.questionName
ele.questionNumber = el.questionNumber
})
}
this.list.questionSubjectList.push(el)
})
} else {
if (e.questionType != 'DATE_BLANKS_SUBJECT' && e.questionType != 'TIME_BLANKS_SUBJECT' && e.questionType != 'FILL_IN_THE_BLANKS') {
e.questionSubjectOptionList.forEach(el => {
el.optionAnswer = el.optionName
el.questionName = e.questionName
el.questionNumber = e.questionNumber
})
}
this.list.questionSubjectList.push(el)
this.list.questionSubjectList.push(e)
}
})
this.list.questionSubjectList?.forEach(e => {
e.questionNumber = Number(e.questionNumber)
e.questionSubjectOptionList?.forEach(el => {
el.questionNumber = Number(el.questionNumber)
})
})
this.list.questionCount = this.questionlist.length
if (this.$route.query.id) {
updateQuestion(this.list).then(res => {
loading.close();
this.$confirm('编辑保存成功, 是否返回上一页?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({
path: "/knowledge/question",
});
})
}).catch(() => {
this.$modal.msgSuccess("编辑保存成功");
});
}).catch(() => {
loading.close();
})
} else {
if (e.questionType != 'DATE_BLANKS_SUBJECT' && e.questionType != 'TIME_BLANKS_SUBJECT' && e.questionType != 'FILL_IN_THE_BLANKS') {
e.questionSubjectOptionList.forEach(el => {
el.optionAnswer = el.optionName
el.questionName = e.questionName
el.questionNumber = e.questionNumber
})
}
this.list.questionSubjectList.push(e)
addQuestion(this.list).then(res => {
loading.close();
this.$confirm('新增保存成功, 是否返回上一页?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({
path: "/knowledge/question",
});
})
}).catch(() => {
this.$modal.msgSuccess("新增保存成功");
});
}).catch(() => {
loading.close();
})
}
})
this.list.questionSubjectList?.forEach(e => {
e.questionNumber = Number(e.questionNumber)
e.questionSubjectOptionList?.forEach(el => {
el.questionNumber = Number(el.questionNumber)
})
})
this.list.questionCount = this.questionlist.length
if (this.$route.query.id) {
updateQuestion(this.list).then(res => {
this.$confirm('编辑保存成功, 是否返回上一页?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({
path: "/knowledge/question",
});
})
}).catch(() => {
this.$modal.msgSuccess("编辑保存成功");
});
})
} else {
addQuestion(this.list).then(res => {
this.$confirm('新增保存成功, 是否返回上一页?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({
path: "/knowledge/question",
});
})
}).catch(() => {
this.$modal.msgSuccess("新增保存成功");
});
})
}
},
//
releaseupload() { },
info() {
const loading = this.$loading({
lock: true,
text: '加载中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.7)'
});
getQuestion(this.$route.query.id).then(res => {
this.list = res.data
res.data.questionSubjectList.forEach(e => {
@ -1145,6 +1229,9 @@ export default {
}
}
this.questionlist = [...this.questionlist, ...echararr]
loading.close();
}).catch(() => {
loading.close();
})
},
goback() {
@ -1159,10 +1246,24 @@ export default {
</script>
<style lang="scss" scoped>
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #C0C0C0;
}
::-webkit-scrollbar-track {
width: 5px;
}
.app-container {
padding: 14px 0 0;
padding: 10px 0 0;
background-color: #F2F3F5 !important;
width: 100%;
height: calc(100vh - 84px);
.header {
background-color: #fff;
@ -1173,8 +1274,8 @@ export default {
.bottomheader {
width: 98%;
background-color: #F2F3F5 !important;
margin: 14px auto;
padding: 30px 0;
margin: 10px auto;
padding: 20px 0;
display: flex;
.questionlist {
@ -1279,7 +1380,7 @@ export default {
.totalScore {
width: 20%;
margin-left: 20px;
height: 790px;
height: calc(100vh - 214px);
background: #FFFFFF;
overflow: scroll;
overflow-x: hidden !important;
@ -1340,7 +1441,7 @@ export default {
width: calc(60% - 30px);
overflow: scroll;
overflow-x: hidden !important;
height: 790px;
height: calc(100vh - 214px);
.editor {
background-color: #fff;
@ -1372,6 +1473,12 @@ export default {
border: none;
box-shadow: 0px 2px 4px 0px rgba(162, 162, 162, 0.5);
border-radius: 4px;
::v-deep .el-input__inner {
border: none !important;
height: 40px;
line-height: 40px;
}
}
.questionnaire-title {
@ -1384,8 +1491,9 @@ export default {
.questiontypes {
width: calc(20% - 30px);
margin: 0 0 0 30px;
height: 790px;
height: calc(100vh - 214px);
background: #FFFFFF;
overflow-y: auto;
.texts:hover {
box-shadow: 2px 3px 3px 2px rgba(162, 162, 162, 0.5);

View File

@ -13,7 +13,7 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24">
<DepartmentList ref="DepartmentList" :modal="true" @clickdepartment="clickdepartment"
<DepartmentList ref="DepartmentList" :modal="false" @clickdepartment="clickdepartment"
:methods="'listMessageNumtwo'">
</DepartmentList>
</el-col>

View File

@ -13,7 +13,7 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24">
<DepartmentList ref="DepartmentList" :modal="true" @clickdepartment="clickdepartment"
<DepartmentList ref="DepartmentList" :modal="false" @clickdepartment="clickdepartment"
:methods="'listWechatTemplateNumthree'">
</DepartmentList>
</el-col>

View File

@ -9,7 +9,7 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24">
<DepartmentList ref="DepartmentList" :modal="true" @clickdepartment="clickdepartment"
<DepartmentList ref="DepartmentList" :modal="false" @clickdepartment="clickdepartment"
:methods="'listWechatTemplateNumtwo'">
</DepartmentList>
</el-col>

View File

@ -13,7 +13,7 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24">
<DepartmentList ref="DepartmentList" :modal="true" @clickdepartment="clickdepartment"
<DepartmentList ref="DepartmentList" :modal="false" @clickdepartment="clickdepartment"
:methods="'selectNumByDepttwo'">
</DepartmentList>
</el-col>

View File

@ -14,7 +14,7 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24">
<DepartmentList ref="DepartmentList" :modal="true" @clickdepartment="clickdepartment"
<DepartmentList ref="DepartmentList" :modal="false" @clickdepartment="clickdepartment"
:methods="'getDepartmentListtwo'">
</DepartmentList>
</el-col>

View File

@ -13,7 +13,7 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24">
<DepartmentList ref="DepartmentList" :modal="true" @clickdepartment="clickdepartment"
<DepartmentList ref="DepartmentList" :modal="false" @clickdepartment="clickdepartment"
:methods="'listScriptNumtwo'">
</DepartmentList>
</el-col>

View File

@ -278,7 +278,7 @@ export default {
resetQuery() {
this.$refs.DepartmentList.resetQuery()
this.resetForm("queryForm");
this.handleQuery();
// this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
@ -287,6 +287,7 @@ export default {
path: "/knowledge/addQuestionnaire",
query: {
path: "/knowledge/question",
hospitalAgencyId: this.queryParams.hospitalAgencyId,
},
});
// })
@ -299,6 +300,8 @@ export default {
query: {
path: "/knowledge/question",
id: row.id,
hospitalAgencyId: this.queryParams.hospitalAgencyId,
departmentId: row.departmentId,
},
});
// })