修改
This commit is contained in:
parent
ea31a1fb4d
commit
3eee8509b8
@ -43,16 +43,20 @@
|
||||
<el-table-column label="问卷模板ID" align="center" prop="questionnaireId" />
|
||||
<el-table-column label="问卷状态" align="center" prop="questionnaireStatus">
|
||||
<template slot-scope="scope">
|
||||
<!-- active-text="已发布" inactive-text="未发布" -->
|
||||
<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-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">
|
||||
|
||||
<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('PUBLISHED', scope.row)"
|
||||
v-if="scope.row.questionnaireStatus == 'UNPUBLISHED'">发布</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="handleClassification(scope.row)"
|
||||
v-hasPermi="['system:question:edit']">分类管理</el-button>
|
||||
<el-button size="mini" type="text" @click="handleUpdate(scope.row)"
|
||||
@ -172,7 +176,7 @@ export default {
|
||||
},
|
||||
//分类管理
|
||||
handleClassification(row) {
|
||||
this.classificationform = row
|
||||
this.classificationform = JSON.parse(JSON.stringify(row))
|
||||
if (this.classificationform.departmentId) {
|
||||
let query = {
|
||||
departmentId: this.classificationform.departmentId
|
||||
@ -199,6 +203,8 @@ export default {
|
||||
}
|
||||
diseaseList(query).then(res => {
|
||||
this.diseaselist = res.data
|
||||
this.classificationform.diseaseTypeId = ''
|
||||
this.classificationform.diseaseTypeName = ''
|
||||
})
|
||||
},
|
||||
changediseaseType(e) {
|
||||
@ -207,22 +213,32 @@ export default {
|
||||
//切换发布状态
|
||||
switchstatus(e, item) {
|
||||
if (!item.departmentId && !this.diseaseTypeId) {
|
||||
this.$message.error('请选择问卷所属的科室以及科室病种后发布!');
|
||||
this.getList();
|
||||
this.$message.error('请选择问卷所属的科室以及科室病种后发布 / 取消发布!');
|
||||
return
|
||||
}
|
||||
let query = {
|
||||
id: item.id,
|
||||
questionnaireStatus: e
|
||||
let text
|
||||
if (e == 'PUBLISHED') {
|
||||
text = '是否发布此问卷模板?'
|
||||
} else {
|
||||
text = '是否取消发布此问卷模板?'
|
||||
}
|
||||
updateclassification(query).then(res => {
|
||||
if (e == 'PUBLISHED') {
|
||||
this.$modal.msgSuccess("修改为已发布");
|
||||
} else if (e == 'UNPUBLISHED') {
|
||||
this.$modal.msgSuccess("修改为未发布");
|
||||
this.$confirm(`${text}`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
}).then(() => {
|
||||
let query = {
|
||||
id: item.id,
|
||||
questionnaireStatus: e
|
||||
}
|
||||
updateclassification(query).then(res => {
|
||||
if (e == 'PUBLISHED') {
|
||||
this.$modal.msgSuccess("修改为已发布");
|
||||
} else if (e == 'UNPUBLISHED') {
|
||||
this.$modal.msgSuccess("修改为未发布");
|
||||
}
|
||||
this.getList();
|
||||
})
|
||||
})
|
||||
this.getList();
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user