postdischarge-ui/src/views/system/components/message.vue

441 lines
11 KiB
Vue
Raw Normal View History

2024-04-03 13:38:24 +08:00
<template>
<div class="app-container">
2024-07-01 10:21:01 +08:00
<el-button
size="small"
@click="classificationOpen = true"
style="
width: 200px;
font-size: 14px;
text-align: left;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
"
:style="handleselectName ? 'color:black' : 'color:#C0C4CC'"
>{{ handleselectName ? handleselectName : "选择短信模板" }}</el-button
>
<el-dialog
title="短信库模板选择"
:visible.sync="classificationOpen"
width="70%"
:before-close="classificationOpenfalse"
>
2024-04-03 13:38:24 +08:00
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="6" :xs="24">
<div class="leftmessage" ref="box">
<div class="name">科室名称</div>
<div>
2024-07-01 10:21:01 +08:00
<el-input
v-model="name"
placeholder="请输入科室名称"
clearable
@keyup.enter.native="handleQuery"
/>
2024-04-03 13:38:24 +08:00
</div>
<div class="listitem">
2024-07-01 10:21:01 +08:00
<div
:class="itemname == null ? 'allactive' : 'all'"
@click="itemdata()"
>
2024-04-03 13:38:24 +08:00
全部
</div>
<span class="count">{{ count }}</span>
</div>
2024-07-01 10:21:01 +08:00
<div
class="listitem"
v-for="(item, index) in DepartmentoList"
:key="index"
@click="itemdata(item)"
>
2024-04-03 13:38:24 +08:00
<div :class="itemname == item.id ? 'allactive' : 'all'">
{{ item.departmentName }}
</div>
<span class="count">{{ item.countNum }}</span>
</div>
</div>
</el-col>
<!--用户数据-->
<el-col :span="18" :xs="24">
2024-07-01 10:21:01 +08:00
<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"
/>
2024-04-03 13:38:24 +08:00
</el-form-item>
<el-form-item label="模板ID" prop="textMessageId">
2024-07-01 10:21:01 +08:00
<el-input
v-model="queryParams.textMessageId"
placeholder="请输入模板ID"
clearable
@keyup.enter.native="handleQuery"
/>
2024-04-03 13:38:24 +08:00
</el-form-item>
<el-form-item>
2024-07-01 10:21:01 +08:00
<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
>
2024-04-03 13:38:24 +08:00
</el-form-item>
</el-form>
2024-07-01 10:21:01 +08:00
<el-table
v-loading="loading"
:data="templateList"
@row-dblclick="handleselect"
>
<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
:show-overflow-tooltip="true"
label="适用任务类型"
align="center"
prop="suitTaskTypeName"
>
2024-04-03 13:38:24 +08:00
<template slot-scope="scope">
2024-07-01 10:21:01 +08:00
{{
scope.row.suitTaskTypeName != "null"
? scope.row.suitTaskTypeName
: ""
}}
2024-04-03 13:38:24 +08:00
</template>
</el-table-column>
2024-07-01 10:21:01 +08:00
<el-table-column
label="短信通道"
align="center"
prop="textMessageChannel"
>
2024-04-03 13:38:24 +08:00
<template slot-scope="scope">
2024-07-01 10:21:01 +08:00
{{
scope.row.textMessageChannel == "WATER_DROPLET_PLATFORM"
? "水滴平台"
: ""
}}
2024-04-03 13:38:24 +08:00
</template>
</el-table-column>
2024-07-01 10:21:01 +08:00
<el-table-column
label="病种名称"
align="center"
prop="diseaseTypeName"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
2024-04-03 13:38:24 +08:00
<template slot-scope="scope">
2024-07-01 10:21:01 +08:00
<el-button
size="mini"
type="text"
@click="handleselect(scope.row)"
v-if="handleselectId != scope.row.id"
>选择</el-button
>
<el-button
size="mini"
type="text"
@click="nohandleselect(scope.row)"
v-if="handleselectId == scope.row.id"
>取消选择</el-button
>
2024-04-03 13:38:24 +08:00
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
2024-07-01 10:21:01 +08:00
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
2024-04-03 13:38:24 +08:00
</el-dialog>
</div>
</template>
<script>
2024-07-01 10:21:01 +08:00
import {
listMessage,
getMessage,
delMessage,
addMessage,
updateMessage,
listMessageNum,
} from "@/api/manage/message";
2024-04-03 13:38:24 +08:00
import { typelist } from "@/api/manage/template";
import { department, listDisease } from "@/api/manage/script";
export default {
2024-07-01 10:21:01 +08:00
props: ["templateId", "templateName"],
2024-04-03 13:38:24 +08:00
name: "Template",
data() {
return {
2024-07-01 10:21:01 +08:00
handleselectName: "",
handleselectId: "",
2024-04-03 13:38:24 +08:00
classificationOpen: false,
itemname: null,
departmentName: null,
diseaseTypeName: null,
2024-07-01 10:21:01 +08:00
name: "",
2024-04-03 13:38:24 +08:00
departmentId: null,
2024-07-01 10:21:01 +08:00
count: "", //全部
DepartmentoList: [], //左侧数组
2024-04-03 13:38:24 +08:00
// 左侧传值
querydepartmen: {
departmentName: "",
// pageNum: 1,
// pageSize: 10,
},
2024-07-01 10:21:01 +08:00
options: [
{
value: "WATER_DROPLET_PLATFORM",
label: "水滴平台",
},
],
2024-04-03 13:38:24 +08:00
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 微信模板信息表格数据
templateList: [],
// 查询参数
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: {},
};
},
watch: {
name(val) {
2024-07-01 10:21:01 +08:00
this.querydepartmen.departmentName = val;
2024-04-08 11:08:38 +08:00
},
templateId(newValue, oldValue) {
2024-04-19 10:58:35 +08:00
this.handleselectId = newValue;
2024-04-08 11:08:38 +08:00
},
templateName(newValue, oldValue) {
2024-04-19 10:58:35 +08:00
this.handleselectName = newValue;
2024-07-01 10:21:01 +08:00
},
2024-04-03 13:38:24 +08:00
},
2024-04-08 11:08:38 +08:00
mounted() {
this.handleselectId = this.templateId;
this.handleselectName = this.templateName;
},
2024-04-03 13:38:24 +08:00
created() {
this.getList();
},
methods: {
nohandleselect() {
2024-07-01 10:21:01 +08:00
this.handleselectId = "";
this.handleselectName = "";
this.$emit("on-template", {
templateId: "",
templateName: "",
templateContent: "",
});
2024-04-03 13:38:24 +08:00
},
handleselect(item) {
2024-07-01 10:21:01 +08:00
console.log(item.id, "id");
this.handleselectId = item.id;
this.handleselectName = item.textMessageName;
this.$emit("on-template", {
templateId: item.id,
templateName: item.textMessageName,
templateContent: item.templateContent,
});
this.classificationOpen = false;
2024-04-03 13:38:24 +08:00
},
classificationOpenfalse() {
2024-07-01 10:21:01 +08:00
this.classificationOpen = false;
2024-04-03 13:38:24 +08:00
},
/** 查询微信模板信息列表 */
getList() {
this.loading = true;
2024-07-01 10:21:01 +08:00
this.queryParams.textMessageStatus = "GROUNDING";
listMessage(this.queryParams).then((response) => {
2024-04-03 13:38:24 +08:00
this.templateList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 左侧科室列表
Departmentlist() {
this.loading = true;
2024-07-01 10:21:01 +08:00
this.querydepartmen.textMessageStatus = "GROUNDING";
listMessageNum(this.querydepartmen).then((response) => {
2024-04-03 13:38:24 +08:00
this.DepartmentoList = response.data;
let sum = 0;
this.DepartmentoList.forEach((item) => {
if (item.countNum != null) {
sum += item.countNum;
}
this.count = sum;
});
this.loading = false;
});
},
// 左侧科室
itemdata(item) {
if (item) {
2024-07-01 10:21:01 +08:00
this.itemname = item.id;
this.departmentName = item.departmentName;
2024-04-03 13:38:24 +08:00
this.loading = true;
2024-07-01 10:21:01 +08:00
this.queryParams.departmentId = item.id;
this.getList();
2024-04-03 13:38:24 +08:00
} else {
2024-07-01 10:21:01 +08:00
this.queryParams.departmentId = "";
this.itemname = null;
this.getList();
2024-04-03 13:38:24 +08:00
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.departmentId = null;
this.itemname = null;
this.resetForm("queryForm");
this.handleQuery();
},
2024-07-01 10:21:01 +08:00
},
2024-04-03 13:38:24 +08:00
};
</script>
<style lang="scss" scoped>
2024-07-03 10:21:31 +08:00
2024-04-03 13:38:24 +08:00
.app-container {
display: inline-block;
padding: 0 !important;
2024-07-01 10:21:01 +08:00
height: 42px;
2024-04-03 13:38:24 +08:00
}
2024-06-28 15:30:19 +08:00
::v-deep .el-dialog__body {
padding-bottom: 60px;
}
2024-04-03 13:38:24 +08:00
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
.leftmessage {
height: 600px;
overflow: auto;
.name {
font-weight: 700;
margin-bottom: 10px;
}
.listitem {
width: 100%;
height: 50px;
border-bottom: 1px solid #dcdfe6;
2024-04-03 14:17:19 +08:00
position: relative;
2024-04-03 13:38:24 +08:00
.count {
display: inline-block;
2024-04-03 14:17:19 +08:00
position: absolute;
2024-04-03 13:38:24 +08:00
left: 210px;
color: #a4a6aa;
2024-04-03 14:17:19 +08:00
top: 10px;
2024-04-03 13:38:24 +08:00
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: 25px;
}
</style>