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

This commit is contained in:
闫晓茹 2024-03-01 11:06:04 +08:00
commit c768eaed8b
6 changed files with 1786 additions and 110 deletions

52
src/api/manage/message.js Normal file
View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询短信模板信息列表
export function listMessage(query) {
return request({
url: '/manage/message/list',
method: 'get',
params: query
})
}
// 查询短信模板信息详细
export function getMessage(id) {
return request({
url: '/manage/message/' + id,
method: 'get'
})
}
// 新增短信模板信息
export function addMessage(data) {
return request({
url: '/manage/message/add',
method: 'post',
data: data
})
}
// 修改短信模板信息
export function updateMessage(data) {
return request({
url: '/manage/message/edit',
method: 'put',
data: data
})
}
// 删除短信模板信息
export function delMessage(id) {
return request({
url: '/manage/message/remove/' + id,
method: 'delete'
})
}
// 查询科室信息列表及包含短信库数量
export function listMessageNum(query) {
return request({
url: '/system/department/listMessageNum',
method: 'get',
params: query
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,981 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item
label="短信模板名称"
prop="textMessageName"
label-width="100px"
>
<el-input
v-model="queryParams.textMessageName"
placeholder="请输入微信模版名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="模板ID" prop="textMessageId">
<el-input
v-model="queryParams.textMessageId"
placeholder="请输入模板ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="短信状态" prop="textMessageStatus">
<el-select
v-model="queryParams.textMessageStatus"
placeholder="请选择短信通道"
>
<el-option
v-for="item in optionstext"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['manage:template:add']"
>新增短信模版</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="left" ref="box">
<div class="name">科室名称</div>
<div>
<el-input
v-model="name"
placeholder="请输入科室名称"
clearable
@keyup.enter.native="handleQuery"
/>
</div>
<div class="listitem">
<div
:class="itemname == null ? 'allactive' : 'all'"
@click="itemdata()"
>
全部
</div>
<span class="count">{{ count }}</span>
</div>
<div
class="listitem"
v-for="(item, index) in DepartmentoList"
:key="index"
@click="itemdata(item)"
>
<div :class="itemname == item.id ? 'allactive' : 'all'">
{{ item.departmentName }}
</div>
<span class="count">{{ item.countNum }}</span>
</div>
</div>
</el-col>
<el-col :span="19">
<el-table
v-loading="loading"
:data="templateList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="index"
width="55"
align="center"
label="序号"
/>
<el-table-column
label="短信模板名称"
align="center"
prop="textMessageName"
:show-overflow-tooltip="true"
/>
<el-table-column label="短信ID" align="center" prop="textMessageId" />
<el-table-column
label="短信内容"
align="center"
prop="textMessageContent"
:show-overflow-tooltip="true"
/>
<el-table-column
label="适用任务类型"
align="center"
prop="suitTaskTypeName"
/>
<el-table-column
label="短信通道"
align="center"
prop="textMessageChannel"
>
<template slot-scope="scope">
{{
scope.row.textMessageChannel == "WATER_DROPLET_PLATFORM"
? "水滴平台"
: ""
}}
</template>
</el-table-column>
<el-table-column
label="短信状态"
align="center"
prop="textMessageStatus"
>
<!-- <template slot-scope="scope">
{{ scope.row.textMessageStatus == "GROUNDING" ? "上架" : "" }}
{{ scope.row.textMessageStatus == "OFF_SHELF" ? "下架" : "" }}
</template> -->
<template slot-scope="scope" >
<span slot="reference" v-if="scope.row.textMessageStatus == 'GROUNDING'">
<i class="dotClass" style="background-color: springgreen"></i>上架
</span>
<span slot="reference" v-if="scope.row.textMessageStatus == 'OFF_SHELF'" >
<i class="dotClass" style="background-color: red"></i>下架
</span>
</template>
</el-table-column>
<el-table-column
label="病种名称"
align="center"
prop="diseaseTypeName"
/>
<!-- <el-table-column
label="短信排序"
align="center"
prop="textMessageSort"
/> -->
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['manage:template:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['manage:template:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改短信模板信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="短信模板名称" prop="textMessageName">
<el-input
v-model="form.textMessageName"
placeholder="请输入短信模板名称"
/>
</el-form-item>
<el-form-item label="短信ID" prop="textMessageId">
<el-input v-model="form.textMessageId" placeholder="请输入短信ID" />
</el-form-item>
<el-form-item label="短信内容" prop="textMessageContent">
<el-input
v-model="form.textMessageContent"
placeholder="请输入短信内容"
type="textarea"
/>
</el-form-item>
<el-form-item label="适用任务类型" prop="suitTaskTypeIds">
<el-select
v-model="form.suitTaskTypeIds"
placeholder="请选择适用任务类型"
style="width: 380px"
multiple
>
<el-option
v-for="item in type"
:key="item.id"
:label="item.dictLabel"
:value="item.dictCode"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="短信通道" prop="textMessageChannel">
<el-select
v-model="form.textMessageChannel"
placeholder="请选择短信通道"
style="width: 380px"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="短信状态" prop="textMessageStatus">
<el-select
v-model="form.textMessageStatus"
placeholder="请选择短信状态"
style="width: 380px"
>
<el-option
v-for="item in optionstext"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="科室名称" prop="departmentId">
<el-button
type=""
v-if="departmentName == '请选择科室'"
@click="clickinnerVisible()"
style="
width: 379px;
text-align: left;
height: 36px;
color: #c0c4cc;
overflow: hidden;
"
>{{ departmentName }}</el-button
>
<el-button
@click="clickinnerVisible()"
type=""
v-else
style="
width: 379px;
text-align: left;
height: 36px;
padding-left: -10px;
overflow: hidden;
"
>{{ departmentName }}</el-button
>
</el-form-item>
<el-form-item label="病种名称" prop="diseaseTypeName">
<el-button
type=""
v-if="diseaseTypeName == '请选择病种'"
@click="clickdisease()"
style="
width: 379px;
text-align: left;
height: 36px;
color: #c0c4cc;
overflow: hidden;
"
>{{ diseaseTypeName }}</el-button
>
<el-button
@click="clickdisease()"
type=""
v-else
style="
width: 379px;
text-align: left;
height: 36px;
padding-left: -10px;
overflow: hidden;
"
>{{ diseaseTypeName }}</el-button
>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 科室弹框 -->
<el-dialog
title=""
:visible.sync="innerVisibleshow"
width="1000px"
append-to-body
:before-close="innerVisiblecancel"
>
<el-form
ref="queryForm"
:model="informationqueryParams"
:rules="rules"
label-width="80px"
:inline="true"
>
<el-form-item label="科室名称" prop="departmentName" label-width="120">
<el-input
v-model="informationqueryParams.departmentName"
placeholder="请输入科室名称"
clearable
/>
</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
:data="infolist"
@cell-dblclick="nurseclick"
v-loading="loading"
>
<el-table-column label="请选择" width="100" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="form.departmentId == scope.row.departmentCode"
circle
@click="nurseclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="nurseclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="departmentName"
label="科室名称"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<pagination
v-show="totaldepartment > 0"
:total="totaldepartment"
:page.sync="informationqueryParams.pageNum"
:limit.sync="informationqueryParams.pageSize"
@pagination="informationInfoinfo"
/>
</el-dialog>
<!-- 病种弹框 -->
<el-dialog
title=""
:visible.sync="diseaseshowst"
width="1000px"
append-to-body
:before-close="canceldiseases"
>
<el-form
ref="queryForm"
:model="querydisease"
:rules="rules"
label-width="80px"
:inline="true"
>
<el-form-item label="病种名称" prop="departmentName" label-width="120">
<el-input
v-model="querydisease.departmentName"
placeholder="请输入病种名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="infodisease"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetdisease"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
:data="listdisease"
@cell-dblclick="nurseclickdisease"
v-loading="loading"
>
<el-table-column label="请选择" width="100" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="form.diseaseTypeId == scope.row.diseaseTypeCode"
circle
@click="nurseclickdisease(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="nurseclickdisease(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="diseaseTypeName"
label="病种名称"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<pagination
v-show="diseasetotal > 0"
:total="diseasetotal"
:page.sync="querydisease.pageNum"
:limit.sync="querydisease.pageSize"
@pagination="infodisease"
/>
</el-dialog>
</div>
</template>
<script>
import { listMessage, getMessage, delMessage, addMessage, updateMessage,listMessageNum } from "@/api/manage/message";
import { typelist } from "@/api/manage/template";
import { department, listDisease } from "@/api/manage/script";
export default {
name: "Template",
data() {
return {
itemname: null,
departmentName: null,
diseaseTypeName: null,
name: '',
departmentId: null,
count: '',//
DepartmentoList: [],//
//
querydepartmen: {
departmentName: "",
// pageNum: 1,
// pageSize: 10,
},
optionstext: [{
value: 'GROUNDING',
label: '上架'
},
{
value: 'OFF_SHELF',
label: '下架'
}],
options: [{
value: 'WATER_DROPLET_PLATFORM',
label: '水滴平台'
},],
type: [],//
innerVisibleshow: false, //
//
informationqueryParams: {
pageNum: 1,
pageSize: 10,
departmentName: null,
},
infolist: [],
totaldepartment: 0,
diseaseshowst: false,//
querydisease: {
pageNum: 1,
pageSize: 10,
},
listdisease: [],
diseasetotal: 0,
optionsDisease: [],
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
templateList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
textMessageId:null,
departmentId: null,
departmentName: null,
diseaseTypeId: null,
diseaseTypeName: null,
textMessageName: null,
textMessageContent: null,
textMessageChannel: null,
textMessageStatus: null,
textMessageSort: null,
textMessageRemark: null,
},
//
form: {},
//
rules: {
textMessageName: [
{ required: true, message: "短信模板名称不能为空", trigger: "blur" }
],
textMessageId: [
{ required: true, message: "短信ID不能为空", trigger: "blur" }
],
textMessageContent: [
{ required: true, message: "短信内容不能为空", trigger: "blur" }
],
textMessageChannel: [
{ required: true, message: "短信通道不能为空", trigger: "blur" }
],
textMessageStatus: [
{ required: true, message: "短信状态不能为空", trigger: "blur" }
],
departmentId: [
{ required: true, message: "所属科室名称不能为空", trigger: "blur" }
],
}
};
},
watch: {
name(val) {
this.querydepartmen.departmentName = val
this.Departmentlist();
}
},
created() {
this.getList();
this.Departmentlist();
this.typelistdata();
listMessage(this.queryParams).then(response => {
this.count = response.total;
});
},
methods: {
/** 查询微信模板信息列表 */
getList() {
this.loading = true;
listMessage(this.queryParams).then(response => {
this.templateList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
typelistdata() {
var dictType = "suit_task_type"
typelist(dictType).then(response => {
this.type = response.data
})
},
//
change(e) {
// this.form.suitTaskTypeName = this.type.find(f => f.dictCode == e).dictLabel
},
//
Departmentlist() {
this.loading = true;
listMessageNum(this.querydepartmen).then(response => {
this.DepartmentoList = response.data;
// this.count=this.DepartmentoList.length
console.log(this.DepartmentoList)
// this.total = response.total;
this.loading = false;
});
},
//
itemdata(item) {
if (item) {
console.log(item, '9999')
this.itemname = item.id
this.departmentName = item.departmentName
this.loading = true;
this.queryParams.departmentId = item.id
this.getList()
} else {
this.queryParams.departmentId = ''
this.itemname = null
this.getList()
}
},
//
clickinnerVisible() {
this.innerVisibleshow = true;
if (this.itemname) {
this.informationqueryParams.departmentId = this.itemname
} else {
this.informationqueryParams.departmentId = null
}
this.informationInfoinfo();
},
//
informationInfoinfo() {
department(this.informationqueryParams).then((response) => {
this.infolist = response.rows;
this.totaldepartment = response.total;
this.loading = false;
});
// this.informationqueryParams.page = 1;
},
//
addresetQuerylist() {
this.informationqueryParams = {
pageNum: 1,
pageSize: 10,
};
this.informationInfoinfo();
},
innerVisiblecancel() {
this.innerVisibleshow = false;
},
//
nurseclick(row) {
this.form.departmentId = row.departmentCode;
this.departmentName = row.departmentName;
console.log(this.departmentName, '0000')
this.innerVisibleshow = false;
},
//
infodisease() {
listDisease(this.querydisease).then((response) => {
this.listdisease = response.rows;
this.diseasetotal = response.total;
this.loading = false;
});
},
//
clickdisease() {
console.log(this.form)
if (this.departmentName == '请选择科室') {
this.$modal.msgError("请先选择科室");
} else {
console.log(this.departmentName, '00000')
this.diseaseshowst = true;
this.querydisease.departmentId = this.form.departmentId
this.infodisease()
}
},
//
nurseclickdisease(row) {
this.form.diseaseTypeId = row.diseaseTypeCode;
this.diseaseTypeName = row.diseaseTypeName;
this.diseaseshowst = false;
console.log(this.diseaseTypeName, '1121000')
},
//
resetdisease() {
querydisease = {
pageNum: 1,
pageSize: 10,
};
this.infodisease()
},
canceldiseases() {
this.diseaseshowst = false;
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
departmentId: null,
departmentName: null,
diseaseTypeId: null,
diseaseTypeName: null,
textMessageName: null,
textMessageId: null,
textMessageContent: null,
textMessageChannel: null,
textMessageStatus: null,
textMessageSort: null,
textMessageRemark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
suitTaskTypeIds:[],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.departmentId = null;
this.itemname = null;
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
console.log(this.form)
if (this.itemname) {
this.form.departmentName = this.departmentName
this.form.departmentId = this.itemname
} else if (this.itemname == null) {
this.departmentName = "请选择科室"
}
else {
this.departmentName = "请选择科室"
}
this.diseaseTypeName = "请选择病种"
this.open = true;
this.title = "新增短信模版";
},
/** 修改按钮操作 */
handleUpdate(row) {
if (!this.itemname) {
this.$modal.msgError("请先选择科室");
} else {
// this.reset();
const id = row.id || this.ids
// this.getDisease();
getMessage(id).then(response => {
this.form = response.data;
this.diseaseTypeName = response.data.diseaseTypeName
this.departmentName = response.data.departmentName
this.form.suitTaskTypeIds = response.data.suitTaskTypeIds
this.open = true;
this.title = "修改短信模板信息";
});
}
},
/** 提交按钮 */
submitForm() {
console.log(this.form)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
this.form.departmentName = this.departmentName
this.form.diseaseTypeName = this.diseaseTypeName
updateMessage(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
if (this.diseaseTypeName == "请选择病种") {
this.form.diseaseTypeName == null
} else {
this.form.diseaseTypeName = this.diseaseTypeName
}
if (this.itemname) {
this.form.departmentName = this.departmentName
this.form.departmentId = this.itemname
} else {
this.form.departmentName = this.departmentName
}
addMessage(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
this.Departmentlist();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除短信模板信息?').then(function () {
return delMessage(ids);
}).then(() => {
this.getList();
var quer = {
pageNum: 1,
pageSize: 10,
}
listMessage(quer).then(response => {
this.count = response.total;
});
this.Departmentlist();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('manage/template/export', {
...this.queryParams
}, `template_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style lang="scss">
.left {
height: 530px;
overflow: auto;
.name {
font-weight: 700;
margin-bottom: 10px;
}
.listitem {
width: 100%;
height: 50px;
border-bottom: 1px solid #dcdfe6;
.count {
display: inline-block;
position: relative;
// right: -172px;
left: 210px;
color: #a4a6aa;
top: -35px;
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;
}
.dotClass {
width:10px;
height:10px;
border-radius: 50%;
display: block;
// margin-left: 10px; //
position: relative;
top: 16px;
left: 12px;
}
</style>

View File

@ -806,7 +806,6 @@ export default {
nurseclick(row) {
this.form.departmentId = row.departmentCode;
this.departmentName = row.departmentName;
console.log(this.departmentName, '0000')
this.innerVisibleshow = false;
},
@ -821,12 +820,10 @@ export default {
},
//
clickdisease() {
console.log(this.form)
if (this.departmentName == '请选择科室') {
this.$modal.msgError("请先选择科室");
} else {
console.log(this.departmentName, '00000')
this.diseaseshowst = true;
this.querydisease.departmentId = this.form.departmentId
this.infodisease()
@ -838,8 +835,6 @@ export default {
this.form.diseaseTypeId = row.diseaseTypeCode;
this.diseaseTypeName = row.diseaseTypeName;
this.diseaseshowst = false;
console.log(this.diseaseTypeName, '1121000')
},
//
resetdisease() {
@ -869,7 +864,6 @@ export default {
//
itemdata(item) {
if (item) {
console.log(item, '9999')
this.itemname = item.id
// this.form.departmentId = item.id
this.departmentName = item.departmentName
@ -965,7 +959,6 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
console.log(this.form)
if (this.itemname) {
this.form.departmentName = this.departmentName
this.form.departmentId=this.itemname
@ -981,7 +974,7 @@ export default {
this.title = "添加话术信息";
this.getDisease();
// this.getDisease();
// }
},
@ -1011,8 +1004,6 @@ export default {
},
/** 提交按钮 */
submitForm() {
console.log(this.form)
console.log(this.diseaseTypeName)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {

View File

@ -102,7 +102,12 @@
:data="templateList"
@selection-change="handleSelectionChange"
>
<el-table-column type="index" width="55" align="center" label="序号"/>
<el-table-column
type="index"
width="55"
align="center"
label="序号"
/>
>
<el-table-column
label="微信模版名称"
@ -116,11 +121,7 @@
prop="templateSource"
>
<template slot-scope="scope">
{{
scope.row.templateSource == "WE_CHAT_APPLET"
? "小程序"
: ""
}}
{{ scope.row.templateSource == "WE_CHAT_APPLET" ? "小程序" : "" }}
{{
scope.row.templateSource == "WE_CHAT_OFFICIAL_ACCOUNT"
? "公众号"
@ -178,20 +179,30 @@
<!-- 添加或修改微信模板信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="微信模板名称" prop="wechatTemplateName">
<el-input v-model="form.wechatTemplateName" placeholder="请输入微信模板名称" />
<el-input
v-model="form.wechatTemplateName"
placeholder="请输入微信模板名称"
/>
</el-form-item>
<el-form-item label="模板ID" prop="templateId">
<el-input v-model="form.templateId" placeholder="请输入模板ID" />
</el-form-item>
<el-form-item label="模板内容" prop="templateContent">
<el-input v-model="form.templateContent" placeholder="请输入模板内容" type="textarea" />
<el-input
v-model="form.templateContent"
placeholder="请输入模板内容"
type="textarea"
/>
<!-- <editor v-model="form.templateContent" :min-height="192"/> -->
</el-form-item>
<el-form-item label="模板来源" prop="templateSource">
<el-select v-model="form.templateSource" placeholder="请选择" style="width:380px">
<el-select
v-model="form.templateSource"
placeholder="请选择"
style="width: 380px"
>
<el-option
v-for="item in options"
:key="item.value"
@ -199,14 +210,18 @@
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="适用数据类型" prop="suitTaskTypeId">
<el-select v-model="form.suitTaskTypeId " placeholder="请选择" style="width:380px" @change="change">
<el-select
v-model="form.suitTaskTypeIds"
placeholder="请选择"
style="width: 380px"
multiple
>
<el-option
v-for="item in type"
:key="item.id"
:key="item.dictCode"
:label="item.dictLabel"
:value="item.dictCode"
>
@ -269,15 +284,14 @@
>{{ diseaseTypeName }}</el-button
>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 科室弹框 -->
<el-dialog
<!-- 科室弹框 -->
<el-dialog
title=""
:visible.sync="innerVisibleshow"
width="1000px"
@ -345,7 +359,6 @@
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<pagination
v-show="totaldepartment > 0"
@ -355,8 +368,8 @@
@pagination="informationInfoinfo"
/>
</el-dialog>
<!-- 病种弹框 -->
<el-dialog
<!-- 病种弹框 -->
<el-dialog
title=""
:visible.sync="diseaseshowst"
width="1000px"
@ -430,13 +443,12 @@
@pagination="infodisease"
/>
</el-dialog>
</div>
</template>
<script>
import { listTemplate, getTemplate, delTemplate, addTemplate, updateTemplate, listWechatTemplateNum ,typelist} from "@/api/manage/template";
import {department, listDisease } from "@/api/manage/script";
import { listTemplate, getTemplate, delTemplate, addTemplate, updateTemplate, listWechatTemplateNum, typelist } from "@/api/manage/template";
import { department, listDisease } from "@/api/manage/script";
export default {
name: "Template",
@ -447,7 +459,7 @@ export default {
diseaseTypeName: null,
name: '',
departmentId: null,
count:'',//
count: '',//
DepartmentoList: [],//
//
querydepartmen: {
@ -463,7 +475,7 @@ export default {
value: 'WE_CHAT_OFFICIAL_ACCOUNT',
label: '公众号'
},],
type:[],//
type: [],//
innerVisibleshow: false, //
@ -510,7 +522,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
wechatTemplateName:null,
wechatTemplateName: null,
departmentId: null,
departmentName: null,
diseaseTypeId: null,
@ -540,7 +552,7 @@ export default {
departmentId: [
{ required: true, message: "所属科室名称不能为空", trigger: "blur" }
],
}
};
},
@ -555,8 +567,8 @@ export default {
this.Departmentlist();
this.typelistdata();
listTemplate(this.queryParams).then(response => {
this.count = response.total;
});
this.count = response.total;
});
},
methods: {
/** 查询微信模板信息列表 */
@ -569,16 +581,16 @@ export default {
});
},
//
typelistdata(){
var dictType="suit_task_type"
typelist(dictType).then(response=>{
this.type=response.data
typelistdata() {
var dictType = "suit_task_type"
typelist(dictType).then(response => {
this.type = response.data
})
},
//
change(e){
this.form.suitTaskTypeName=this.type.find(f=> f.dictCode==e).dictLabel
change(e) {
// this.form.suitTaskTypeName=this.type.find(f=> f.dictCode==e).dictLabel
},
//
@ -605,14 +617,18 @@ export default {
this.getList()
} else {
this.queryParams.departmentId = ''
this.itemname = null
this.getList()
listTemplate(this.queryParams).then(response => {
this.count = response.total;
});
}
},
//
clickinnerVisible() {
//
clickinnerVisible() {
this.innerVisibleshow = true;
if (this.itemname) {
this.informationqueryParams.departmentId = this.itemname
@ -651,8 +667,8 @@ export default {
//
infodisease() {
//
infodisease() {
listDisease(this.querydisease).then((response) => {
this.listdisease = response.rows;
this.diseasetotal = response.total;
@ -699,7 +715,7 @@ export default {
this.form = {
id: null,
departmentId: null,
dictCode:null,
dictCode: null,
departmentName: null,
diseaseTypeId: null,
diseaseTypeName: null,
@ -711,8 +727,10 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
suitTaskTypeIds: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
@ -738,9 +756,9 @@ export default {
this.reset();
if (this.itemname) {
this.form.departmentName = this.departmentName
this.form.departmentId=this.itemname
} else if(this.itemname == null){
this.departmentName = "请选择科室"
this.form.departmentId = this.itemname
} else if (this.itemname == null) {
this.departmentName = "请选择科室"
}
else {
this.departmentName = "请选择科室"
@ -750,57 +768,60 @@ export default {
this.open = true;
this.title = "新增微信模板";
},
/** 修改按钮操作 */
handleUpdate(row) {
/** 修改按钮操作 */
handleUpdate(row) {
if (!this.itemname) {
this.$modal.msgError("请先选择科室");
} else {
// this.reset();
const id = row.id || this.ids
// this.getDisease();
this.typelistdata();
getTemplate(id).then(response => {
this.form = response.data;
this.form.suitTaskTypeIds = response.data.suitTaskTypeIds
this.diseaseTypeName = response.data.diseaseTypeName
this.departmentName = response.data.departmentName
this.open = true;
this.title = "修改话术信息";
this.title = "修改信息";
});
}
},
/** 提交按钮 */
submitForm() {
/** 提交按钮 */
submitForm() {
console.log(this.form)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
this.form.departmentName = this.departmentName
this.form.diseaseTypeName = this.diseaseTypeName
updateTemplate(this.form).then(response => {
this.form.diseaseTypeName = this.diseaseTypeName
updateTemplate(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
if(this.diseaseTypeName == "请选择病种"){
this.form.diseaseTypeName==null
}else{
this.form.diseaseTypeName = this.diseaseTypeName
}
if(this.itemname){
this.form.departmentName = this.departmentName
this.form.departmentId=this.itemname
if (this.diseaseTypeName == "请选择病种") {
this.form.diseaseTypeName == null
} else {
this.form.diseaseTypeName = this.diseaseTypeName
}
if (this.itemname) {
}else{
this.form.departmentName = this.departmentName
this.form.departmentName = this.departmentName
this.form.departmentId = this.itemname
}
addTemplate(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} else {
this.form.departmentName = this.departmentName
}
addTemplate(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
@ -811,14 +832,14 @@ export default {
return delTemplate(ids);
}).then(() => {
this.getList();
var quer={
var quer = {
pageNum: 1,
pageSize: 10,
pageSize: 10,
}
listTemplate(quer).then(response => {
this.count = response.total;
});
this.count = response.total;
});
this.Departmentlist();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });

View File

@ -4,7 +4,7 @@
<div class="topheader">
<el-button size="medium">返回</el-button>
<el-button size="medium" type="primary" plain>预览问卷</el-button>
<el-button size="medium" type="primary">保存</el-button>
<el-button size="medium" type="primary" @click="upload">保存</el-button>
<el-button size="medium" type="primary">保存并发布</el-button>
</div>
<div class="bottomheader">
@ -51,16 +51,17 @@
<draggable v-model="questionlist">
<transition-group>
<div class="questionitem" v-for="(item, index) in questionlist" :key="item.id">
<div v-if="item.questionname == '单选题'" class="item">
<div v-if="item.questionname == '单选题'" class="item"
@click.stop="selectquestion(item, index)">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click="delquestion(item, index)">
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入内容" v-model="item.title" clearable>
<el-input placeholder="请输入题目" v-model="item.title" clearable>
</el-input>
</div>
<div class="options">
@ -72,25 +73,26 @@
</el-input>
<el-button icon="el-icon-close" type="text"
style="color:red;margin-left:10px"
@click="deloption(item, uitem, index, uindex)"></el-button>
@click.stop="deloption(item, uitem, index, uindex)"></el-button>
</div>
</div>
</div>
<div class="more">
<el-button size="medium" icon="el-icon-plus" type="text"
@click="addoption(item)">添加选项</el-button>
@click.stop="addoption(item)">添加选项</el-button>
</div>
</div>
<div v-if="item.questionname == '多选题'" class="item">
<div v-if="item.questionname == '多选题'" class="item"
@click.stop="selectquestion(item, index)">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click="delquestion(item, index)">
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入内容" v-model="item.title" clearable>
<el-input placeholder="请输入题目" v-model="item.title" clearable>
</el-input>
</div>
<div class="options">
@ -102,25 +104,26 @@
</el-input>
<el-button icon="el-icon-close" type="text"
style="color:red;margin-left:10px"
@click="deloption(item, uitem, index, uindex)"></el-button>
@click.stop="deloption(item, uitem, index, uindex)"></el-button>
</div>
</div>
</div>
<div class="more">
<el-button size="medium" icon="el-icon-plus" type="text"
@click="addoption(item)">添加选项</el-button>
@click.stop="addoption(item)">添加选项</el-button>
</div>
</div>
<div v-if="item.questionname == '填空题'" class="item">
<div v-if="item.questionname == '填空题'" class="item"
@click.stop="selectquestion(item, index)">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click="delquestion(item, index)">
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入内容" v-model="item.title" clearable>
<el-input placeholder="请输入题目" v-model="item.title" clearable>
</el-input>
</div>
<div class="options" style="align-items:center">
@ -131,6 +134,241 @@
<div class="more">
</div>
</div>
<div v-if="item.questionname == '打分题'" class="item"
@click.stop="selectquestion(item, index)">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入题目" v-model="item.title" clearable>
</el-input>
</div>
<div class="options">
<span>选项 </span>
<div>
<el-select v-model="item.optionNumber" placeholder="请选择"
@change="selectchange($event, item)" style="padding-left:10px">
<el-option v-for="item in optionlist" :key="item.value"
:label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="more">
<el-radio-group>
<el-radio :label="1" disabled v-if="optionNumber > 0">1</el-radio>
<el-radio :label="2" disabled v-if="optionNumber > 1">2</el-radio>
<el-radio :label="3" disabled v-if="optionNumber > 2">3</el-radio>
<el-radio :label="4" disabled v-if="optionNumber > 3">4</el-radio>
<el-radio :label="5" disabled v-if="optionNumber > 4">5</el-radio>
</el-radio-group>
</div>
</div>
<div v-if="item.questionname == '组合单选题'" class="item">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title" style="width:85%">
<span>标题 </span>
<el-input placeholder="请输入标题" v-model="item.title" clearable>
</el-input>
</div>
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
@click.stop="selectquestion(aitem, index, item, aindex)">
<div class="questionname" style="padding-top:0">
{{ aindex + 1 }}. {{ aitem.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
</el-input>
</div>
<div class="options">
<span>选项 </span>
<div>
<div v-for="(uitem, uindex) in aitem.options" :key="uindex"
style="display:flex">
<el-input placeholder="请输入内容" v-model="uitem.optionname" clearable>
</el-input>
<el-button icon="el-icon-close" type="text"
style="color:red;margin-left:10px"
@click.stop="deloption(aitem, uitem, aindex, uindex)"></el-button>
</div>
</div>
</div>
<div class="more">
<el-button size="medium" icon="el-icon-plus" type="text"
@click.stop="addoption(aitem)">添加选项</el-button>
</div>
</div>
</div>
<div v-if="item.questionname == '组合多选题'" class="item">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title" style="width:85%">
<span>标题 </span>
<el-input placeholder="请输入标题" v-model="item.title" clearable>
</el-input>
</div>
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
@click.stop="selectquestion(aitem, index, item, aindex)">
<div class="questionname" style="padding-top:0">
{{ aindex + 1 }}. {{ aitem.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
</el-input>
</div>
<div class="options">
<span>选项 </span>
<div>
<div v-for="(uitem, uindex) in aitem.options" :key="uindex"
style="display:flex">
<el-input placeholder="请输入内容" v-model="uitem.optionname" clearable>
</el-input>
<el-button icon="el-icon-close" type="text"
style="color:red;margin-left:10px"
@click.stop="deloption(aitem, uitem, aindex, uindex)"></el-button>
</div>
</div>
</div>
<div class="more">
<el-button size="medium" icon="el-icon-plus" type="text"
@click.stop="addoption(aitem)">添加选项</el-button>
</div>
</div>
</div>
<div v-if="item.questionname == '组合填空题'" class="item">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title" style="width:85%">
<span>标题 </span>
<el-input placeholder="请输入标题" v-model="item.title" clearable>
</el-input>
</div>
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
@click.stop="selectquestion(aitem, index, item, aindex)">
<div class="questionname" style="padding-top:0">
{{ aindex + 1 }}. {{ aitem.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
</el-input>
</div>
<div class="options" style="align-items:center">
<span>回答 </span>
<el-input style="margin:0;width:300px" v-model="aitem.option" disabled
placeholder="填写问卷时,用户需要在此输入答案" />
</div>
<div class="more">
<el-button size="medium" icon="el-icon-plus" type="text"
@click.stop="addoption(aitem)">添加选项</el-button>
</div>
</div>
</div>
<div v-if="item.questionname == '组合打分题'" class="item">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title" style="width:85%">
<span>标题 </span>
<el-input placeholder="请输入标题" v-model="item.title" clearable>
</el-input>
</div>
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
@click.stop="selectquestion(aitem, index, item, aindex)">
<div class="questionname" style="padding-top:0">
{{ aindex + 1 }}. {{ aitem.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
</el-input>
</div>
<div class="options">
<span>选项 </span>
<div>
<el-select v-model="aitem.optionNumber" placeholder="请选择"
@change="selectchange($event, aitem)" style="padding-left:10px">
<el-option v-for="yitem in optionlist" :key="yitem.value"
:label="yitem.label" :value="yitem.value">
</el-option>
</el-select>
</div>
</div>
<div class="more">
<el-radio-group>
<el-radio :label="1" disabled v-if="aitem.optionNumber > 0">1</el-radio>
<el-radio :label="2" disabled v-if="aitem.optionNumber > 1">2</el-radio>
<el-radio :label="3" disabled v-if="aitem.optionNumber > 2">3</el-radio>
<el-radio :label="4" disabled v-if="aitem.optionNumber > 3">4</el-radio>
<el-radio :label="5" disabled v-if="aitem.optionNumber > 4">5</el-radio>
</el-radio-group>
</div>
</div>
</div>
<div v-if="item.questionname == '日期填空题'" class="item"
@click.stop="selectquestion(item, index)">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入题目" v-model="item.title" clearable>
</el-input>
</div>
<div class="options" style="align-items:center">
<span>回答 </span>
<el-input style="" v-model="item.option" disabled prefix-icon="el-icon-date"
placeholder="填写问卷时,用户在此选择日期" />
</div>
<div class="more">
</div>
</div>
<div v-if="item.questionname == '时间填空题'" class="item"
@click.stop="selectquestion(item, index)">
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
<img src="@/assets/system/gb.png" alt="" class="delicon"
@click.stop="delquestion(item, index)">
<div class="questionname">
{{ index + 1 }}. {{ item.questionname }}
</div>
<div class="title">
<span>题目 </span>
<el-input placeholder="请输入题目" v-model="item.title" clearable>
</el-input>
</div>
<div class="options" style="align-items:center">
<span>回答 </span>
<el-input style="" v-model="item.option" disabled prefix-icon="el-icon-time"
placeholder="填写问卷时,用户在此选择时间" />
</div>
<div class="more">
</div>
</div>
</div>
</transition-group>
</draggable>
@ -140,23 +378,71 @@
<div class="totalscore-title">
总分0
</div>
<div class="text">计分方式</div>
<div class="introduce">根据多少道题平均分数</div>
<div class="totalscore-title" style="font-size:14px">
Q{{ questionitem.index + 1 }}
<span
v-if="questionitem.type == 'danxuans' || questionitem.type == 'duoxuans' || questionitem.type == 'tiankongs' || questionitem.type == 'duoxuans' || questionitem.type == 'dafens'">
- {{ questionitem.aindex + 1 }}
</span>: 整题分值设置
</div>
<div class="text">是否计分
<el-switch v-model="questionitem.whetherScore" :disabled="questionitem.disabled"
@change="changeswitch">
</el-switch>
</div>
<div class="text" style="border:none">计分方式</div>
<div class="introduce">
<el-select v-model="questionitem.scoringMethod" placeholder="请选择计分方式" clearable style="width:200px"
disabled>
<el-option v-for="dict in dict.type.scoring_method" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</div>
<div v-if="questionitem.scoringMethod == 'NOT_UNIQUE_ANSWER' && questionitem.whetherScore">
<div class="text" style="border:none">各选项分值
</div>
<div v-for="item in questionitem.options" :key="item.optionid" class="optionitem">
<div class="optionname">
{{ item.optionname }}
</div>
<el-input-number v-model="item.optionScore" :min="0" :max="100"
:controls="false"></el-input-number>
<span style="padding-left:10px">
</span>
</div>
</div>
<div v-if="questionitem.scoringMethod == 'UNIQUE_ANSWER' && questionitem.whetherScore">
<div class="text" style="border:none">本题答案及答案分值
</div>
<div v-for="item in questionitem.options" :key="item.optionid" class="optionitem">
<div class="optionname">
<el-checkbox v-model="item.checked" :label="item.optionname"></el-checkbox>
</div>
<el-input-number v-model="item.optionScore" :min="0" :max="100" :controls="false"
:disabled="!item.checked"></el-input-number>
<span style="padding-left:10px">
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import draggable from 'vuedraggable'
export default {
name: "addQuestionnaire",
dicts: ['scoring_method'],
components: {
draggable
},
data() {
return {
id: 99999999999,
optionid: 99,
otherQuestiontypes: [
{
id: 'riqi',
@ -213,8 +499,29 @@ export default {
src: require('@/assets/system/dafen.png')
},
],
//arr
questionlist: [],
id: 99999999999,
//
optionlist: [{
value: 2,
label: '2'
}, {
value: 3,
label: '3'
}, {
value: 4,
label: '4'
}, {
value: 5,
label: '5'
}],
//list
questionitem: {
scoringMethod: '',
whetherScore: false,
disabled: true,
index: -1,
},
};
},
watch: {
@ -223,12 +530,12 @@ export default {
},
methods: {
addquestion(item) {
this.id++
if (this.questionlist.length > 0) {
if (this.questionlist[this.questionlist.length - 1].title == '') {
return this.$message.error('请填写完在继续添加');
}
}
this.id++
if (item.id == 'danxuan') {
this.questionlist.push({
type: 'danxuan',
@ -236,10 +543,19 @@ export default {
questionname: '单选题',
title: '',
options: [{
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
}, {
optionid: ++this.optionid,
optionname: '',
}]
optionScore: 0,
}],
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
})
} else if (item.id == 'duoxuan') {
this.questionlist.push({
@ -248,10 +564,21 @@ export default {
questionname: '多选题',
title: '',
options: [{
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
checked: false,
}, {
optionid: ++this.optionid,
optionScore: 0,
optionname: '',
}]
checked: false,
}],
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
})
} else if (item.id == 'tiankong') {
this.questionlist.push({
@ -260,17 +587,258 @@ export default {
questionname: '填空题',
title: '',
option: '',
//
whetherScore: false,
disabled: true,
})
} else if (item.id == 'dafen') {
this.questionlist.push({
type: 'dafen',
optionNumber: undefined,
id: this.id,
questionname: '打分题',
title: '',
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
options: [],
})
} else if (item.id == 'danxuans') {
this.questionlist.push({
title: '',
questionname: '组合单选题',
type: 'danxuans',
id: this.id++,
list: [
{
type: 'danxuans',
id: this.id++,
questionname: '单选题',
title: '',
options: [{
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
}, {
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
}],
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
}, {
type: 'danxuans',
id: this.id++,
questionname: '单选题',
title: '',
options: [{
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
}, {
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
}],
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
},
],
})
} else if (item.id == 'duoxuans') {
this.questionlist.push({
title: '',
questionname: '组合多选题',
type: 'duoxuans',
id: this.id++,
list: [
{
type: 'duoxuans',
id: this.id++,
questionname: '多选题',
title: '',
options: [{
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
checked: false,
}, {
optionid: ++this.optionid,
optionScore: 0,
optionname: '',
checked: false,
}],
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
}, {
type: 'duoxuans',
id: this.id++,
questionname: '多选题',
title: '',
options: [{
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
checked: false,
}, {
optionid: ++this.optionid,
optionScore: 0,
optionname: '',
checked: false,
}],
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
},
],
})
} else if (item.id == 'tiankongs') {
this.questionlist.push({
title: '',
questionname: '组合填空题',
type: 'tiankongs',
id: this.id++,
list: [
{
type: 'tiankongs',
id: this.id++,
questionname: '填空题',
title: '',
option: '',
//
whetherScore: false,
disabled: true,
}, {
type: 'tiankongs',
id: this.id++,
questionname: '填空题',
title: '',
option: '',
//
whetherScore: false,
disabled: true,
},
],
})
} else if (item.id == 'dafens') {
this.questionlist.push({
title: '',
questionname: '组合打分题',
type: 'dafens',
id: this.id++,
list: [
{
type: 'dafens',
id: this.id++,
questionname: '打分题',
optionNumber: undefined,
title: '',
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
options: [],
}, {
type: 'dafens',
id: this.id++,
optionNumber: undefined,
questionname: '打分题',
title: '',
//
whetherScore: false,
disabled: false,
//
scoringMethod: '',
options: [],
},
],
})
} else if (item.id == 'riqi') {
this.questionlist.push({
type: 'riqi',
id: this.id++,
questionname: '日期填空题',
title: '',
option: '',
//
whetherScore: false,
disabled: true,
})
} else if (item.id == 'shijian') {
this.questionlist.push({
type: 'shijian',
id: this.id++,
questionname: '时间填空题',
title: '',
option: '',
//
whetherScore: false,
disabled: true,
})
}
if (this.questionlist.length == 1) {
this.questionitem = this.questionlist[0]
this.questionitem.index = 0
if (item.id == 'danxuans' || item.id == 'duoxuans' || item.id == 'tiankongs' || item.id == 'dafens') {
this.questionitem = this.questionlist[0].list[0]
this.questionitem.index = 0
this.questionitem.aindex = 0
}
}
},
selectquestion(item, index, topitem, aindex) {
this.questionitem = item
this.questionitem.index = index
if (this.questionitem.type == 'danxuans' || this.questionitem.type == 'duoxuans' || this.questionitem.type == 'tiankongs' || this.questionitem.type == 'dafens') {
this.questionitem.aindex = aindex
}
},
delquestion(item, index) {
if (this.questionlist.length == 1) {
this.$message.error('请保留一条题目!');
return
}
if (this.questionitem.id == this.questionlist[index].id) {
this.questionlist.splice(index, 1)
let index = 0
this.questionlist.forEach(e => {
e.index = index++
})
this.questionitem = this.questionlist[0]
this.questionitem.index = 0
} else {
this.questionlist.splice(index, 1)
let index = 0
this.questionlist.forEach(e => {
e.index = index++
})
}
},
addoption(item) {
if (item.options.length == 6) {
return this.$message.error('多选最多为六个选项!');
}
item.options.push({
optionid: ++this.optionid,
optionname: '',
optionScore: 0,
checked: false,
})
},
delquestion(item, index) {
this.questionlist.splice(index, 1)
},
deloption(item, uitem, index, uindex) {
if (item.options.length > 2) {
item.options.splice(uindex, 1)
@ -278,6 +846,32 @@ export default {
this.$message.error('最少保留两条选项!');
}
},
changeswitch(e) {
if (e) {
if (this.questionitem.type == 'danxuan' || this.questionitem.type == 'dafen' || this.questionitem.type == 'dafens' || this.questionitem.type == 'danxuans') {
this.questionitem.scoringMethod = 'NOT_UNIQUE_ANSWER'
} else if (this.questionitem.type == 'duoxuan' || this.questionitem.type == 'duoxuans') {
this.questionitem.scoringMethod = 'UNIQUE_ANSWER'
}
} else {
this.questionitem.scoringMethod = ''
}
},
selectchange(e, item) {
item.options = []
for (var i = 0; i < e; i++) {
item.options.push({
optionid: ++this.optionid,
optionname: i + 1,
optionScore: 0,
checked: false,
})
}
},
//
upload() {
console.log(this.questionlist)
},
}
};
</script>
@ -321,6 +915,7 @@ export default {
}
.questionitem {
padding-bottom: 1px;
border-radius: 5px;
margin: 40px auto;
background-color: #fff;
@ -328,6 +923,14 @@ export default {
width: 100%;
margin: 20px auto;
.combination {
border-radius: 5px;
padding-top: 25px;
width: 90%;
margin: 30px auto;
box-shadow: 0 0px 6px 3px rgba(162, 162, 162, 0.5);
}
.more {
display: flex;
border-radius: 5px;
@ -348,17 +951,19 @@ export default {
span {
display: inline-block;
width: 60px;
line-height: 35px;
}
.el-input {
padding-left: 10px;
margin-left: 10px !important;
display: block;
border: none;
border-radius: 5px;
width: 400px;
height: 30px;
line-height: 30px;
margin-bottom: 14px;
margin: 0;
width: 300px
}
}
@ -388,10 +993,33 @@ export default {
}
.totalScore {
width: calc(20% - 30px);
margin-left: 30px;
width: 20%;
margin-left: 20px;
height: 790px;
background: #FFFFFF;
overflow: scroll;
overflow-x: hidden !important;
.optionitem {
width: 80%;
height: 36px;
margin: 20px auto;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
.optionname {
width: 50%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
::v-deep .el-input-number {
width: 56px;
}
}
.text {
font-size: 16px;
@ -399,6 +1027,8 @@ export default {
line-height: 30px;
width: calc(100% - 60px);
margin: 20px auto 0;
padding-bottom: 10px;
border-bottom: 1px solid #E2E2E2;
}
.introduce {
@ -407,6 +1037,7 @@ export default {
font-size: 14px;
color: #999999;
line-height: 30px;
padding-bottom: 10px;
text-align: left;
border-bottom: 1px solid #E2E2E2;
}
@ -421,7 +1052,7 @@ export default {
}
.questionnairedetails {
padding-left: 60px;
padding-left: 30px;
width: calc(60% - 30px);
overflow: scroll;
overflow-x: hidden !important;