<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="tjNum">
|
<el-input
|
ref="inputName"
|
v-model="queryParams.tjNum"
|
placeholder="请输入体检号"
|
clearable
|
@keyup.enter.native="handleQuery"
|
@blur="hb"
|
/>
|
</el-form-item>
|
<el-form-item label="接收号码" prop="number">
|
<el-input
|
v-model="queryParams.number"
|
placeholder="请输入接收号码"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="标题" prop="subject">
|
<el-input
|
v-model="queryParams.subject"
|
placeholder="请输入标题"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="发送时间" prop="sendTime">
|
<el-date-picker
|
clearable
|
v-model="queryParams.sendTime"
|
type="date"
|
value-format="yyyy-MM-dd"
|
placeholder="请选择发送时间"
|
>
|
</el-date-picker>
|
</el-form-item>
|
<!-- <el-form-item label="删除标记" prop="deleted">
|
<el-input
|
v-model="queryParams.deleted"
|
placeholder="请输入删除标记"
|
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="['system:record: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="['system:record: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="['system:record: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="['system:record:export']"
|
>导出
|
</el-button>
|
</el-col>
|
<right-toolbar
|
:showSearch.sync="showSearch"
|
@queryTable="getList"
|
></right-toolbar>
|
</el-row> -->
|
|
<el-table
|
border
|
style="margin-top: 20px"
|
v-loading="loading"
|
:data="recordList"
|
@selection-change="handleSelectionChange"
|
>
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
<el-table-column label="序号" align="center" prop="newID" :show-overflow-tooltip="true" width="55px" />
|
<el-table-column label="体检号" align="center" prop="tjNumber" :show-overflow-tooltip="true" width="170px" />
|
<el-table-column label="接收号码" align="center" prop="number" :show-overflow-tooltip="true" width="110px" />
|
<el-table-column label="发送类型" align="center" prop="type" :show-overflow-tooltip="true" width="110px" >
|
<template slot-scope="scope">
|
<span v-if="scope.row.type == '1'">邮件</span>
|
<span v-if="scope.row.type == '2'">短信</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="是否成功"
|
align="center"
|
prop="sendStatus" :show-overflow-tooltip="true" width="70px"
|
>
|
<template slot-scope="scope">
|
<span v-if="scope.row.sendStatus == '0'">失败</span>
|
<span v-if="scope.row.sendStatus == '1'">成功</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="标题" align="center" prop="subject" :show-overflow-tooltip="true" width="130px" />
|
<el-table-column label="内容" align="center" prop="content" :show-overflow-tooltip="true" />
|
<el-table-column
|
label="发送时间"
|
align="center"
|
prop="sendTime"
|
width="130px" :show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.sendTime, "{y}-{m}-{d}") }}</span>
|
</template>
|
</el-table-column>
|
<!-- <el-table-column label="删除标记" align="center" prop="deleted" :show-overflow-tooltip="true" width="55px" /> -->
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" width="150px" />
|
<!-- <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="['system:record:edit']"
|
>修改
|
</el-button>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-delete"
|
@click="handleDelete(scope.row)"
|
v-hasPermi="['system:record:remove']"
|
>删除
|
</el-button>
|
</template>
|
</el-table-column> -->
|
</el-table>
|
|
<div class="pag">
|
<div class="pag1">
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</div>
|
</div>
|
|
|
<!-- 添加或修改邮件短信发送记录对话框 -->
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form-item label="体检号" prop="tjNumber">
|
<el-input v-model="form.tjNumber" placeholder="请输入体检号" />
|
</el-form-item>
|
<el-form-item label="接收号码" prop="number">
|
<el-input v-model="form.number" placeholder="请输入接收号码" />
|
</el-form-item>
|
<el-form-item label="标题" prop="subject">
|
<el-input v-model="form.subject" placeholder="请输入标题" />
|
</el-form-item>
|
<el-form-item label="内容">
|
<editor v-model="form.content" :min-height="192" />
|
</el-form-item>
|
<el-form-item label="发送时间" prop="sendTime">
|
<el-date-picker
|
clearable
|
v-model="form.sendTime"
|
type="date"
|
value-format="yyyy-MM-dd"
|
placeholder="请选择发送时间"
|
>
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item label="删除标记" prop="deleted">
|
<el-input v-model="form.deleted" placeholder="请输入删除标记" />
|
</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>
|
</div>
|
</template>
|
|
<script>
|
import {
|
listRecord,
|
getRecord,
|
delRecord,
|
addRecord,
|
updateRecord,
|
} from "@/api/system/record";
|
|
export default {
|
name: "Record",
|
data() {
|
let checkPhoneNum = (rule, value, callback) => {
|
let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
|
if (value == "" && value == undefined && !value) {
|
return callback('');
|
} else if(value != undefined && value != ""){
|
return callback();
|
}else if (!patter.test(value)) {
|
return callback('');
|
}
|
};
|
return {
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 邮件短信发送记录表格数据
|
recordList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
tjNum: null,
|
number: null,
|
type: null,
|
sendStatus: null,
|
subject: null,
|
content: null,
|
sendTime: null,
|
deleted: null,
|
},
|
// 表单参数
|
form: {},
|
// 表单校验
|
rules: {
|
createTime: [
|
{
|
required: true,
|
validator: checkPhoneNum,
|
trigger: "blur",
|
},
|
],
|
deleted: [
|
{
|
required: true,
|
validator: checkPhoneNum,
|
trigger: "blur",
|
},
|
],
|
},
|
};
|
},
|
created() {
|
this.getList();
|
},
|
mounted() {
|
this.$nextTick(() => {
|
this.$refs.inputName.focus();
|
});
|
},
|
methods: {
|
/** 查询邮件短信发送记录列表 */
|
getList() {
|
this.$nextTick(() => {
|
this.$refs.inputName.focus();
|
});
|
this.loading = true;
|
listRecord(this.queryParams).then((response) => {
|
this.recordList = response.data.data;
|
response.data.data.forEach((item, index) =>
|
{item.newID =(this.queryParams.pageNum - 1) * this.queryParams.pageSize +index +1;
|
});
|
this.total = response.data.total;
|
this.loading = false;
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
id: null,
|
tjNum: null,
|
number: null,
|
type: null,
|
sendStatus: "0",
|
subject: null,
|
content: null,
|
sendTime: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null,
|
deleted: null,
|
};
|
this.resetForm("form");
|
},
|
hb() {
|
if (this.queryParams.tjNum != null) {
|
this.handleQuery();
|
}
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
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.reset();
|
// const id = row.id || this.ids;
|
// getRecord(id).then((response) => {
|
// this.form = response.data;
|
// this.open = true;
|
// this.title = "修改邮件短信发送记录";
|
// });
|
// },
|
/** 提交按钮 */
|
// submitForm() {
|
// this.$]]
|
// #refs["form"].validate(valid => {
|
// if (valid) {
|
// #foreach($column in $columns)
|
// #if($column.htmlType == "checkbox")
|
// this.form.$column.javaField = this.form.$
|
// {
|
// column.javaField
|
// }
|
// .
|
// join(",");
|
// #end
|
// #end
|
// #if($table.sub)
|
// this.form.$
|
// {
|
// subclassName
|
// }
|
// List = this.$
|
// {
|
// subclassName
|
// }
|
// List;
|
// #end
|
// if (this.form.${
|
// pkColumn.javaField
|
// }
|
// !=
|
// null
|
// )
|
// {
|
// update$
|
// {
|
// BusinessName
|
// }
|
// (this.form).then(response => {
|
// this.#[[$modal]]
|
// #.msgSuccess("修改成功");
|
// this.open = false;
|
// this.getList();
|
// });
|
// }
|
// else
|
// {
|
// add$
|
// {
|
// BusinessName
|
// }
|
// (this.form).then(response => {
|
// this.#[[$modal]]
|
// #.msgSuccess("新增成功");
|
// this.open = false;
|
// this.getList();
|
// });
|
// }
|
// }
|
// });
|
// },
|
/** 删除按钮操作 */
|
// handleDelete(row) {
|
// const ${pkColumn.javaField}s = row.$
|
// {
|
// pkColumn.javaField
|
// }
|
// ||
|
// this.ids;
|
// this.#[[$modal]]
|
// #.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function () {
|
// return del$
|
// {
|
// BusinessName
|
// }
|
// (${pkColumn.javaField}s);
|
// }).then(() => {
|
// this.getList();
|
// this.#[[$modal]]
|
// #.msgSuccess("删除成功");
|
// }).catch(() => {
|
// });
|
// },
|
// #if($table.sub)
|
// /** ${subTable.functionName}序号 */
|
// row$
|
// {
|
// subClassName
|
// }
|
// Index({row, rowIndex})
|
// {
|
// row.index = rowIndex + 1;
|
// }
|
// ,
|
// /** ${subTable.functionName}添加按钮操作 */
|
// handleAdd$
|
// {
|
// subClassName
|
// }
|
// ()
|
// {
|
// let obj = {};
|
// #foreach($column in $subTable.columns)
|
// #if($column.pk || $column.javaField == ${subTableFkclassName})
|
// #elseif($column.list && "" != $javaField)
|
// obj.$column.javaField = "";
|
// #end
|
// #end
|
// this.$
|
// {
|
// subclassName
|
// }
|
// List.push(obj);
|
// },
|
/** ${subTable.functionName}删除按钮操作 */
|
// handleDelete$
|
// {
|
// subClassName
|
// }
|
// ()
|
// {
|
// if (this.checked${
|
// subClassName
|
// }
|
// .
|
// length == 0
|
// )
|
// {
|
// this.#[[$modal]]
|
// #.msgError("请先选择要删除的${subTable.functionName}数据");
|
// }
|
// else
|
// {
|
// const ${subclassName}List = this.$
|
// {
|
// subclassName
|
// }
|
// List;
|
// const checked$
|
// {
|
// subClassName
|
// }
|
// = this.checked$
|
// {
|
// subClassName
|
// }
|
// ;
|
// this.$
|
// {
|
// subclassName
|
// }
|
// List = ${subclassName}List.filter(function (item) {
|
// return checked$
|
// {
|
// subClassName
|
// }
|
// .
|
// indexOf(item.index) == -1
|
// });
|
// }
|
// }
|
// ,
|
// /** 复选框选中数据 */
|
// handle$
|
// {
|
// subClassName
|
// }
|
// SelectionChange(selection)
|
// {
|
// this.checked$
|
// {
|
// subClassName
|
// }
|
// = selection.map(item => item.index)
|
// }
|
// ,
|
// #end
|
// /** 导出按钮操作 */
|
// handleExport()
|
// {
|
// this.download('${moduleName}/${businessName}/export', {
|
// ...this.queryParams
|
// }, `${businessName}_#[[${new Date().getTime()}.xlsx`)
|
// }
|
},
|
};
|
</script>
|
<style scoped>
|
.pag {
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
}
|
.pag1{
|
width: 30%;
|
}
|
</style>
|