针灸质控中心平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

546 lines
15 KiB

<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="name">
<el-input
v-model="queryParams.param.name"
placeholder="请输入"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="组织" prop="tenantId">
<el-select
v-model="queryParams.param.tenantId"
placeholder="请选择"
clearable
filterable
>
<el-option
v-for="(item, index) in tenantsListData"
:label="item.name"
:value="item.id"
:key="index"
/>
</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"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="listDat"
@selection-change="handleSelectionChange"
max-height="600"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="队列名称"
align="center"
prop="name"
min-width="130"
fixed
/>
<el-table-column
label="随访方式"
align="center"
prop="followupMethod"
show-overflow-tooltip
min-width="100"
>
<template slot-scope="scope">
<span v-if="scope.row.followupMethod == 0">电话随访</span>
<span v-if="scope.row.followupMethod == 1">入户随访</span>
<span v-if="scope.row.followupMethod == 2">到院随访</span>
</template>
</el-table-column>
<el-table-column
label="随访类型"
align="center"
show-overflow-tooltip
min-width="150"
>
<template slot-scope="scope">
<span v-if="scope.row.followupType == 0">单次</span>
<span v-if="scope.row.followupType == 1">周期</span>
</template>
</el-table-column>
<el-table-column
label="随访频次"
align="center"
prop="frequency"
show-overflow-tooltip
min-width="100"
/>
<el-table-column
label="总月数"
align="center"
prop="followupMonth"
show-overflow-tooltip
min-width="100"
/>
<el-table-column
label="临近提醒时间(天)"
align="center"
prop="remindTime"
show-overflow-tooltip
min-width="130"
/>
<el-table-column
label="窗口期"
align="center"
prop="followWindowAdys"
show-overflow-tooltip
min-width="100"
/>
<el-table-column
fixed="right"
label="组织"
align="center"
show-overflow-tooltip
min-width="130"
>
<template slot-scope="scope">
<span v-if="scope.row.type == 0">公共队列</span>
<span v-else-if="scope.row.type == 1">{{
scope.row.tenantName
}}</span>
</template>
</el-table-column>
<el-table-column
label="状态"
align="center"
prop="status"
show-overflow-tooltip
min-width="80"
fixed="right"
>
<template slot-scope="scope">
<span v-if="scope.row.status == 0" style="color: #f56c6c">禁用</span>
<span v-else style="color: #67c23a">启用</span>
</template>
</el-table-column>
<el-table-column label="创建人/创建时间" align="center" min-width="140">
<template slot-scope="scope">
<div>{{ scope.row.createBy }}</div>
<span>{{
parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}")
}}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
:disabled="scope.row.type != 0"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
:disabled="scope.row.type != 0"
>删除</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
class="popup"
:title="title"
:visible.sync="open"
width="780px"
append-to-body
>
<el-form
class="formStep"
ref="form"
:model="form"
:rules="rules"
label-width="130px"
>
<el-form-item label="队列名称" prop="name">
<el-input v-model="form.name" placeholder="请输入" />
</el-form-item>
<el-form-item label="随访方式" prop="followupMethod">
<el-select v-model="form.followupMethod" placeholder="请选择">
<el-option label="电话随访" :value="0"> </el-option>
<el-option label="入户随访" :value="1"> </el-option>
<el-option label="到院随访" :value="2"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="随访类型" prop="followupType">
<el-radio-group v-model="form.followupType">
<el-radio :label="0">单次</el-radio>
<el-radio :label="1">周期</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="随访频次" prop="followupType">
<el-input v-model="form.frequency" placeholder="请输入cron执行表达式">
<template slot="append">
<el-button
style="width: 110px"
type="primary"
@click="handleShowCron"
>
生成表达式
<i class="el-icon-time el-icon--right"></i>
</el-button>
</template>
</el-input>
</el-form-item>
<el-form-item label="总月数" prop="followupMonth">
<el-input v-model="form.followupMonth" placeholder="请输入" />
</el-form-item>
<el-form-item label="临近提醒时间(天)" prop="remindTime">
<el-input v-model="form.remindTime" placeholder="请输入" />
</el-form-item>
<el-form-item label="窗口期" prop="followWindowAdys">
<el-input v-model="form.followWindowAdys" placeholder="请输入" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">禁用</el-radio>
</el-radio-group>
</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="Cron表达式生成器"
:visible.sync="openCron"
append-to-body
destroy-on-close
class="scrollbar"
>
<crontab
@hide="openCron = false"
@fill="crontabFill"
:expression="expression"
></crontab>
</el-dialog>
</div>
</template>
<script>
import Crontab from "@/components/Crontab";
import {
followupQuery,
followupAdd,
followupUpd,
followupDel,
commonQueue,
} from "@/api/followupFile";
import { tenantsList } from "@/api/member";
export default {
name: "Notice",
components: { Crontab },
data() {
return {
tenantsListData: [], // 组织列表
// 是否显示Cron表达式弹出层
openCron: false,
// 传入的表达式
expression: "",
idCardType: [
{
label: "身份证",
value: 0,
},
{
label: "护照或外国人永居证",
value: 1,
},
{
label: "港澳居民来往内地通行",
value: 2,
},
{
label: "台湾居民来往大陆通行证",
value: 3,
},
{
label: "其他",
value: 4,
},
],
idCardTypeValue: {
0: "身份证",
1: "护照或外国人永居证",
2: "港澳居民来往内地通行",
3: "台湾居民来往大陆通行证",
4: "其他",
},
loading: false, // 遮罩层
ids: [], // 选中数组
single: true, // 非单个禁用
multiple: true, // 非多个禁用
showSearch: true, // 显示搜索条件
total: 0, // 总条数
listDat: [{}], // 公告表格数据
title: "", // 弹出层标题
open: false, // 是否显示弹出层
importOpen: false, // 导入弹窗
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
param: {
tenantId: "", // 组织id
name: "", //关键字
},
},
formDisabled: false,
importform: {},
// 表单参数
form: {},
// 表单校验
rules: {
name: [
{ required: true, message: "队列名称不能为空", trigger: "blur" },
],
followupMethod: [
{ required: true, message: "随访方式不能为空", trigger: "change" },
],
followupType: [
{ required: true, message: "随访类型不能为空", trigger: "blur" },
],
frequency: [
{ required: true, message: "随访频次不能为空", trigger: "blur" },
],
followupMonth: [
{ required: true, message: "总月数不能为空", trigger: "blur" },
],
followWindowAdys: [
{ required: true, message: "窗口期不能为空", trigger: "blur" },
],
remindTime: [
{ required: true, message: "临近提醒时间不能为空", trigger: "blur" },
],
frequency: [
{ required: true, message: "随访频次不能为空", trigger: "blur" },
],
status: [{ required: true, message: "状态不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
this.getTenantsList(); // 组织列表
},
methods: {
// 组织列表
getTenantsList() {
tenantsList({
pageNum: -1,
param: {},
}).then((res) => {
this.tenantsListData = res.data.list;
});
},
/** cron表达式按钮操作 */
handleShowCron() {
this.expression = this.form.cronExpression;
this.openCron = true;
},
/** 确定后回传值 */
crontabFill(value) {
this.form.frequency = value;
},
/** 查询公告列表 */
getList() {
this.loading = true;
followupQuery(this.queryParams).then((res) => {
this.listDat = res.data.list;
this.total = res.data.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
name: "", // 姓名
followupMethod: 0, // 随访方式
followupType: 0, // 随访类型
frequency: "", // cron执行表达式
followupMonth: "",
status: 1, // 状态
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
param: {
name: "",
tenantId: "",
},
};
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增随访队列";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.open = true;
this.title = "修改随访队列";
this.form = JSON.parse(JSON.stringify(row));
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
followupUpd(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
followupAdd(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const idList = row.id ? [row.id] : this.ids;
this.$modal
.confirm("是否确认删除当前选择的数据?")
.then(function () {
return followupDel({ idList: idList });
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/user/export",
{
...this.queryParams.params,
},
`患者档案.xlsx`
);
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
},
};
</script>
<style scoped src="@/assets/styles/common.css"></style>
<style scoped>
.form-item-age {
display: flex;
align-items: center;
}
.form-item-age span {
margin: 0 10px;
}
.form-item-age >>> .el-input {
width: 100px;
}
</style>
<!-- >>> .el-input__inner {
padding: 0 15px !important;
} -->