<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="optioncontent">
|
<el-input v-model="queryParams.optioncontent" placeholder="请输入 选项内容 " clearable
|
@keyup.enter.native="handleQuery" />
|
</el-form-item>
|
<el-form-item label=" 归宿机构 " prop="orgid">
|
<el-input v-model="queryParams.orgid" placeholder="请输入 机构ID " 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-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="['smartor:svytopicoption:add']">新增</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
v-hasPermi="['smartor:svytopicoption:edit']">修改</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
v-hasPermi="['smartor:svytopicoption:remove']">删除</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
v-hasPermi="['smartor:svytopicoption:export']">导出</el-button>
|
</el-col>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
</el-row>
|
|
<el-table v-loading="loading" :data="svytopicoptionList" @selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column label=" 适用题目类型 " width="150" align="center" prop="topictype">
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.svy_topictype" :value="scope.row.topictype" />
|
</template></el-table-column>
|
<el-table-column label=" 选项内容 " width="200" align="center" prop="optioncontent" />
|
<el-table-column label=" 提示 " width="200" align="center" prop="prompt" />
|
<el-table-column label=" 分数 " width="55" align="center" prop="score" />
|
<el-table-column label=" 验证规则 " width="250" align="center" prop="verifyrule" />
|
<el-table-column label=" 是否存在明细 " width="150" align="center" prop="isexistdetail" />
|
<el-table-column label=" 所属院区 " width="200" align="center" prop="orgid">
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.sys_patientfrom" :value="scope.row.orgid" />
|
</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" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
v-hasPermi="['smartor:svytopicoption:edit']">修改</el-button>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
v-hasPermi="['smartor:svytopicoption: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-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-row>
|
<el-col :span="6"><el-form-item label=" 选项编码 " prop="optioncode">
|
<el-input v-model="form.optioncode" placeholder="请输入 选项编码 " />
|
</el-form-item></el-col><el-col :span="6"><el-form-item label=" 适用题目类型 " prop="topictype">
|
<el-select v-model="form.topictype" placeholder="请选择 适用题目类型 ">
|
<el-option v-for="dict in dict.type.svy_topictype" :key="dict.value" :label="dict.label"
|
:value="dict.value"></el-option>
|
</el-select>
|
</el-form-item></el-col>
|
<el-col :span="12"><el-form-item label=" 所属院区 " prop="orgid">
|
<el-select v-model="form.orgid" placeholder="请选择 机构ID ">
|
<el-option v-for="dict in dict.type.sys_patientfrom" :key="dict.value" :label="dict.label"
|
:value="dict.value"></el-option>
|
</el-select>
|
</el-form-item></el-col>
|
</el-row>
|
<el-row>
|
<el-form-item label=" 选项内容 ">
|
<el-input v-model="form.optioncontent" placeholder="请输入 选项的内容 " />
|
</el-form-item>
|
</el-row>
|
<el-row>
|
<el-form-item label=" 选项提示 " prop="prompt">
|
<el-input v-model="form.prompt" placeholder="请输入 选项提示信息 " />
|
</el-form-item></el-row>
|
<el-row> <el-col :span="6"><el-form-item label=" 选项序号 " prop="sort">
|
<el-input v-model="form.sort" placeholder="请输入 选项序号 " />
|
</el-form-item></el-col><el-col :span="6">
|
<el-form-item label=" 分数 " prop="score">
|
<el-input v-model="form.score" placeholder="请输入 分数 " />
|
</el-form-item></el-col><el-col :span="12"><el-form-item label=" 验证规则 " prop="verifyrule">
|
<el-input v-model="form.verifyrule" placeholder="请输入 验证规则 " />
|
</el-form-item></el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6"><el-form-item label=" 是否存在明细 " prop="isexistdetail">
|
<el-input v-model="form.isexistdetail" placeholder="请输入 是否存在明细 " />
|
</el-form-item></el-col>
|
<el-col :span="6"><el-form-item label=" 明细是否必填 " prop="detailismandatory">
|
<el-input v-model="form.detailismandatory" placeholder="请输入 明细是否必填 " />
|
</el-form-item></el-col>
|
<el-col :span="6"><el-form-item label=" 父选项ID " prop="parentoptionid">
|
<el-input v-model="form.parentoptionid" placeholder="请输入 父选项ID " />
|
</el-form-item></el-col><el-col :span="6"><el-form-item label=" 跳转 " prop="jump">
|
<el-input v-model="form.jump" placeholder="请输入 跳转 " />
|
</el-form-item></el-col>
|
</el-row>
|
<el-row> <el-col :span="6"><el-form-item label=" 是否异常项目 " prop="isexceptionitem">
|
<el-input v-model="form.isexceptionitem" placeholder="请输入 是否异常项目 " />
|
</el-form-item></el-col>
|
<el-col :span="6"><el-form-item label=" 是否跟进 " prop="istrack">
|
<el-input v-model="form.istrack" placeholder="请输入 是否跟进 " />
|
</el-form-item></el-col>
|
<el-col :span="6"><el-form-item label=" 是否互斥 " prop="ismutex">
|
<el-input v-model="form.ismutex" placeholder="请输入 是否互斥 " />
|
</el-form-item></el-col>
|
</el-row>
|
<el-row><el-col :span="6"><el-form-item label=" 是否限制范围 " prop="isrange">
|
<el-input v-model="form.isrange" placeholder="请输入 是否限制范围 " />
|
</el-form-item></el-col>
|
<el-col :span="6"><el-form-item label=" 最小范围 " prop="minrange">
|
<el-input v-model="form.minrange" placeholder="请输入 最小范围 " />
|
</el-form-item></el-col>
|
<el-col :span="6"><el-form-item label=" 范围长度;用于小数保留位数 " prop="rangelength">
|
<el-input v-model="form.rangelength" placeholder="请输入 范围长度;用于小数保留位数 " />
|
</el-form-item></el-col>
|
<el-col :span="6"><el-form-item label=" 范围长度;用于小数保留位数 " prop="rangelength">
|
<el-input v-model="form.rangelength" placeholder="请输入 范围长度;用于小数保留位数 " />
|
</el-form-item></el-col>
|
</el-row>
|
</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>
|
</div>
|
</template>
|
|
<script>
|
import { listSvytopicoption, getSvytopicoption, delSvytopicoption, addSvytopicoption, updateSvytopicoption } from "@/api/smartor/svytopicoption";
|
|
export default {
|
name: "Svytopicoption",
|
dicts: ['svy_topictype'],
|
data() {
|
return {
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 问卷问题选项表格数据
|
svytopicoptionList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
topicid: null,
|
svyid: null,
|
topictype: null,
|
optioncode: null,
|
optioncontent: null,
|
isexistdetail: null,
|
detailismandatory: null,
|
isexceptionitem: null,
|
istrack: null,
|
score: null,
|
prompt: null,
|
jump: null,
|
parentoptionid: null,
|
ismutex: null,
|
verifyrule: null,
|
sort: null,
|
verificationtype: null,
|
isrange: null,
|
minrange: null,
|
maxrange: null,
|
rangelength: null,
|
orgid: null,
|
oldid: null,
|
isupload: null,
|
uploadTime: null
|
},
|
// 表单参数
|
form: {},
|
// 表单校验
|
rules: {
|
delFlag: [
|
{ required: true, message: " 删除标记 不能为空", trigger: "blur" }
|
],
|
isupload: [
|
{ required: true, message: " 上传标记 不能为空", trigger: "blur" }
|
],
|
}
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询问卷问题选项列表 */
|
getList() {
|
this.loading = true;
|
listSvytopicoption(this.queryParams).then(response => {
|
this.svytopicoptionList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
optionid: null,
|
topicid: null,
|
svyid: null,
|
topictype: null,
|
optioncode: null,
|
optioncontent: null,
|
isexistdetail: null,
|
detailismandatory: null,
|
isexceptionitem: null,
|
istrack: null,
|
score: null,
|
prompt: null,
|
jump: null,
|
parentoptionid: null,
|
ismutex: null,
|
verifyrule: null,
|
sort: null,
|
verificationtype: null,
|
isrange: null,
|
minrange: null,
|
maxrange: null,
|
rangelength: null,
|
orgid: null,
|
oldid: null,
|
delFlag: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null,
|
isupload: null,
|
uploadTime: null
|
};
|
this.resetForm("form");
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.optionid)
|
this.single = selection.length !== 1
|
this.multiple = !selection.length
|
},
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.open = true;
|
this.title = "添加问卷问题选项";
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
this.reset();
|
const optionid = row.optionid || this.ids
|
getSvytopicoption(optionid).then(response => {
|
this.form = response.data;
|
this.open = true;
|
this.title = "修改问卷问题选项";
|
});
|
},
|
/** 提交按钮 */
|
submitForm() {
|
this.$refs["form"].validate(valid => {
|
if (valid) {
|
if (this.form.optionid != null) {
|
updateSvytopicoption(this.form).then(response => {
|
this.$modal.msgSuccess("修改成功");
|
this.open = false;
|
this.getList();
|
});
|
} else {
|
addSvytopicoption(this.form).then(response => {
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
this.getList();
|
});
|
}
|
}
|
});
|
},
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const optionids = row.optionid || this.ids;
|
this.$modal.confirm('是否确认删除问卷问题选项编号为"' + optionids + '"的数据项?').then(function () {
|
return delSvytopicoption(optionids);
|
}).then(() => {
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
}).catch(() => { });
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
this.download('smartor/svytopicoption/export', {
|
...this.queryParams
|
}, `svytopicoption_${new Date().getTime()}.xlsx`)
|
}
|
}
|
};
|
</script>
|