Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9c2cb41296
@ -47,8 +47,35 @@ export function delQuestion(id) {
|
||||
//科室接口
|
||||
export function getDepartmentList(query) {
|
||||
return request({
|
||||
url: 'system/department/getDepartmentList',
|
||||
url: '/system/department/getDepartmentList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//科室
|
||||
export function selectUserDepartment() {
|
||||
return request({
|
||||
url: '/system/department/selectUserDepartment',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//病种
|
||||
export function diseaseList(query) {
|
||||
return request({
|
||||
url: '/system/departmentDisease/diseaseList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//分类管理确定
|
||||
export function updateclassification(data) {
|
||||
return request({
|
||||
url: '/system/question/updateQuestion',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -2,10 +2,10 @@
|
||||
<div class="app-container">
|
||||
<div class="header">
|
||||
<div class="topheader">
|
||||
<el-button size="medium">返回</el-button>
|
||||
<el-button size="medium" type="primary" plain>预览问卷</el-button>
|
||||
<el-button size="medium" @click="goback">返回</el-button>
|
||||
<!-- <el-button size="medium" type="primary" plain>预览问卷</el-button> -->
|
||||
<el-button size="medium" type="primary" @click="upload">保存</el-button>
|
||||
<el-button size="medium" type="primary">保存并发布</el-button>
|
||||
<!-- <el-button size="medium" type="primary" @click="releaseupload">保存并发布</el-button> -->
|
||||
</div>
|
||||
<div class="bottomheader">
|
||||
<div class="questiontypes">
|
||||
@ -1028,12 +1028,33 @@ export default {
|
||||
this.list.questionCount = this.questionlist.length
|
||||
if (this.$route.query.id) {
|
||||
updateQuestion(this.list).then(res => {
|
||||
|
||||
this.$confirm('编辑保存成功, 是否返回上一页?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
this.$router.go(-1);
|
||||
}).catch(() => {
|
||||
this.$modal.msgSuccess("编辑保存成功");
|
||||
});
|
||||
})
|
||||
} else {
|
||||
addQuestion(this.list).then(res => {
|
||||
this.$confirm('新增保存成功, 是否返回上一页?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
this.$router.go(-1);
|
||||
}).catch(() => {
|
||||
this.$modal.msgSuccess("新增保存成功");
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
//保存并发布
|
||||
releaseupload() {
|
||||
|
||||
},
|
||||
info() {
|
||||
getQuestion(this.$route.query.id).then(res => {
|
||||
@ -1067,7 +1088,7 @@ export default {
|
||||
e.title = '打分题'
|
||||
}
|
||||
})
|
||||
var data = res.data.questionSubjectList
|
||||
var data = res.data.questionSubjectList.filter(e => e.questionType == 'COMBINATION_RADIO_SUBJECT' || e.questionType == 'COMBINATION_MULTIPLE_SUBJECT' || e.questionType == 'COMBINATION_BLANKS_SUBJECT' || e.questionType == 'COMBINATION_BLANKS_SUBJECT')
|
||||
var echararr = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var arrindex = echararr.findIndex((item, index, arr) => { return item.questionDescription === data[i].questionDescription })//获取下标
|
||||
@ -1086,6 +1107,9 @@ export default {
|
||||
this.questionlist = [...this.questionlist, ...echararr]
|
||||
})
|
||||
},
|
||||
goback() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -1185,6 +1209,7 @@ export default {
|
||||
.title {
|
||||
width: 80%;
|
||||
margin: 20px auto 30px;
|
||||
text-align: left;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
|
||||
@ -40,17 +40,21 @@
|
||||
<el-table-column label="问卷模板ID" align="center" prop="questionnaireId" />
|
||||
<el-table-column label="问卷状态" align="center" prop="questionnaireStatus">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" v-if="scope.row.questionnaireStatus == 'PUBLISHED'">已发布</el-button>
|
||||
<el-button size="mini" type="info" v-if="scope.row.questionnaireStatus == 'UNPUBLISHED'">未发布</el-button>
|
||||
<el-switch v-model="scope.row.questionnaireStatus" active-color="#13ce66" inactive-color="#ff4949"
|
||||
active-value="PUBLISHED" inactive-value="UNPUBLISHED" active-text="已发布" inactive-text="未发布"
|
||||
@change="switchstatus($event, scope.row)">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
<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" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
<el-button size="mini" type="text" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:question:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -59,16 +63,38 @@
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</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-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>
|
||||
</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>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="classificationupload">确 定</el-button>
|
||||
<el-button @click="classificationOpenfalse">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listQuestion, getQuestion, delQuestion, addQuestion, updateQuestion, getDepartmentList } from "@/api/system/question";
|
||||
import { listQuestion, getQuestion, delQuestion, addQuestion, updateQuestion, getDepartmentList, selectUserDepartment, diseaseList, updateclassification } from "@/api/system/question";
|
||||
|
||||
export default {
|
||||
name: "Question",
|
||||
data() {
|
||||
return {
|
||||
classificationOpen: false,
|
||||
classificationform: {},
|
||||
//科室名称
|
||||
departmentName: '',
|
||||
defaultProps: {
|
||||
@ -83,6 +109,8 @@ export default {
|
||||
total: 0,
|
||||
// 问卷基本信息表格数据
|
||||
questionList: [],
|
||||
departmentlist: [],
|
||||
diseaselist: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -101,6 +129,11 @@ export default {
|
||||
questionnaireSort: null,
|
||||
questionnaireRemark: null,
|
||||
},
|
||||
rules: {
|
||||
departmentId: [
|
||||
{ required: true, message: '请选择科室', trigger: 'change' }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -114,6 +147,57 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
classificationupload() {
|
||||
let query = {
|
||||
id: this.classificationform.id,
|
||||
diseaseTypeId: this.classificationform.diseaseTypeId,
|
||||
diseaseTypeName: this.classificationform.diseaseTypeName,
|
||||
departmentId: this.classificationform.departmentId,
|
||||
departmentName: this.classificationform.departmentName,
|
||||
}
|
||||
updateclassification(query).then(res => {
|
||||
this.classificationform = {}
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
this.classificationOpen = false
|
||||
})
|
||||
},
|
||||
//分类管理
|
||||
handleClassification(row) {
|
||||
this.classificationform = row
|
||||
if (this.classificationform.departmentId) {
|
||||
let query = {
|
||||
departmentId: this.classificationform.departmentId
|
||||
}
|
||||
diseaseList(query).then(res => {
|
||||
this.diseaselist = res.data
|
||||
})
|
||||
}
|
||||
this.classificationOpen = true
|
||||
},
|
||||
classificationOpenfalse() {
|
||||
this.classificationOpen = false
|
||||
this.classificationform = {}
|
||||
},
|
||||
cleardepartment() {
|
||||
this.classificationform.diseaseTypeId = ''
|
||||
},
|
||||
changedepartment(e) {
|
||||
this.classificationform.departmentName = this.departmentlist.find(el => el.id == e).departmentName
|
||||
let query = {
|
||||
departmentId: e
|
||||
}
|
||||
diseaseList(query).then(res => {
|
||||
this.diseaselist = res.data
|
||||
})
|
||||
},
|
||||
changediseaseType(e) {
|
||||
this.classificationform.diseaseTypeName = this.diseaselist.find(el => el.id == e).diseaseTypeName
|
||||
},
|
||||
//切换发布状态
|
||||
switchstatus(e, item) {
|
||||
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.queryParams.departmentId = data.id;
|
||||
@ -132,6 +216,9 @@ export default {
|
||||
})
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
selectUserDepartment().then(res => {
|
||||
this.departmentlist = res.data
|
||||
})
|
||||
},
|
||||
/** 查询问卷基本信息列表 */
|
||||
getList() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user