<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.name"
|
placeholder="请输入客户姓名"
|
clearable
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="体检号" prop="tjNum">
|
<el-input
|
v-model="queryParams.tjNum"
|
placeholder="请输入体检号"
|
clearable
|
@keyup.enter.native="handleQuery"
|
ref="inputName"
|
@blur="hb"
|
/>
|
</el-form-item>
|
<el-form-item label="登记时间">
|
<el-date-picker
|
clearable
|
v-model="createTimeList"
|
:default-time="['00:00:00', '23:00:00']"
|
format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
type="daterange"
|
range-separator="-"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
:picker-options="pickerOptions"
|
></el-date-picker>
|
</el-form-item>
|
<el-form-item label="延期时间">
|
<el-date-picker
|
clearable
|
v-model="finishTimeList"
|
type="daterange"
|
range-separator="-"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
:picker-options="pickerOptions"
|
:default-time="['00:00:00', '23:00:00']"
|
format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
placeholder="请选择体检完成时间"
|
>
|
</el-date-picker>
|
</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"
|
size="mini"
|
@click="transmittext"
|
:disabled="multiple"
|
style="margin: 0 15px;"
|
>批量发送短信</el-button
|
>
|
<el-button
|
type="primary"
|
size="mini"
|
@click="transmit"
|
:disabled="multiple"
|
>批量发送邮件</el-button
|
>
|
</el-col>
|
<right-toolbar
|
:showSearch.sync="showSearch"
|
@queryTable="getList"
|
></right-toolbar>
|
</el-row>
|
|
<template>
|
<el-table
|
border
|
style="margin: 14px; width: 97%"
|
v-loading="loading"
|
:data="extensionList"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column
|
type="selection"
|
width="55"
|
align="center"
|
height="10px"
|
fixed="left"
|
/>
|
<el-table-column
|
label="序号"
|
align="center"
|
prop="newID"
|
width="50px"
|
fixed="left"
|
height="10px"
|
/>
|
<el-table-column
|
label="姓名"
|
align="center"
|
prop="cusName"
|
height="10px"
|
/>
|
<el-table-column
|
label="性别"
|
align="center"
|
prop="sex"
|
width="55px"
|
height="10px"
|
>
|
<template slot-scope="scope">
|
<span v-if="scope.row.sex == '0'">男</span>
|
<span v-if="scope.row.sex == '1'">女</span>
|
<span v-if="scope.row.sex == '2'">未知</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="年龄" align="center" prop="age" height="10px" />
|
<el-table-column
|
label="电话"
|
align="center"
|
prop="phone"
|
:show-overflow-tooltip="true"
|
height="10px"
|
/>
|
<!-- <el-table-column label="团队/个人" align="center" prop="tjType" height="10px">
|
<template slot-scope="scope">
|
<span v-if="scope.row.tjType == '1'">个人</span>
|
<span v-if="scope.row.tjType == '2'">团队</span>
|
</template>
|
</el-table-column> -->
|
<el-table-column
|
label="延期项目"
|
align="center"
|
prop="names"
|
height="10px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="创建时间"
|
align="center"
|
prop="updateTime"
|
width="155px"
|
height="10px"
|
>
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="延期时间"
|
align="center"
|
prop="yqTime"
|
width="155px"
|
height="10px"
|
>
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.yqTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="短信发送状态"
|
align="center"
|
prop="msgSend"
|
height="10px"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span v-if="scope.row.msgSend == '1'">已发送</span>
|
<span v-if="scope.row.msgSend == '0'">未发送</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="邮件发送状态"
|
align="center"
|
prop="emilSend"
|
height="10px"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<span v-if="scope.row.emilSend == '1'">已发送</span>
|
<span v-if="scope.row.emilSend == '0'">未发送</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</template>
|
|
<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-drawer :title="title" :visible.sync="drawer" size="60%">
|
<el-form
|
:model="querytempType"
|
ref="queryForm"
|
size="small"
|
:inline="true"
|
label-width="68px"
|
style="margin: 0 20px"
|
>
|
<el-form-item label="模板类型" prop="tempType">
|
<el-select
|
v-model="querytempType.tempType"
|
filterable
|
placeholder="请选择模板类型"
|
clearable
|
>
|
<el-option
|
v-for="dict in dict.type.tj_send_type"
|
:key="dict.value"
|
:label="dict.label"
|
:value="dict.value"
|
/>
|
</el-select>
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
type="primary"
|
icon="el-icon-search"
|
size="mini"
|
@click="handleTempType"
|
>搜索</el-button
|
>
|
</el-form-item>
|
</el-form>
|
|
<el-table
|
v-loading="loading"
|
ref="tb"
|
:data="sendTemplateList"
|
@selection-change="handleChange"
|
border
|
style="margin: 0 20px; width: 94%"
|
>
|
<el-table-column type="selection" width="45" align="center" />
|
<el-table-column label="编号" align="center" prop="id" width="60" />
|
<el-table-column
|
label="模板标题"
|
align="center"
|
prop="tempTitle"
|
width="100"
|
/>
|
<el-table-column label="模板内容" align="center" prop="tempContent" />
|
<el-table-column
|
label="模板类型"
|
align="center"
|
prop="tempType"
|
width="100"
|
>
|
<template slot-scope="scope">
|
<dict-tag
|
:options="dict.type.tj_send_type"
|
:value="scope.row.tempType"
|
/>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="pag">
|
<div class="pag1">
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="querytempType.pageNum"
|
:limit.sync="querytempType.pageSize"
|
@pagination="handleTempType"
|
/>
|
</div>
|
</div>
|
|
<div style="margin-left: 89%">
|
<el-button type="primary" v-if="mail == true" @click="sendingmail"
|
>发 送</el-button
|
>
|
<el-button type="primary" v-if="mail == false" @click="sendingtext"
|
>发 送</el-button
|
>
|
</div>
|
</el-drawer>
|
</div>
|
</template>
|
|
<script>
|
import { getextensionlist, sendMessageOrEmail } from "@/api/hosp/extension";
|
import { listSendTemplate } from "@/api/hosp/sendTemplate";
|
import ViewPdf from "@/components/ViewPdf";
|
import { queryCompany } from "@/api/team/tuanti";
|
import { getNewDateList } from "@/api/hosp/order";
|
import moment from "moment";
|
export default {
|
components: {
|
ViewPdf,
|
},
|
name: "Order",
|
dicts: ["tj_send_type", "sys_normal_disable"],
|
data() {
|
return {
|
mail: true,
|
gation: {},
|
drawer: false,
|
value: "",
|
// 弹出层标题
|
title: "",
|
tempId: null,
|
proIds: [],
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
userId: "",
|
// 总条数
|
total: 0,
|
// 体检记录表格数据
|
extensionList: [],
|
sendTemplateList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
CompanyList: [],
|
createTimeList: null,
|
finishTimeList: null,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
name: null,
|
tjNum: null,
|
djbeginTime: null,
|
djendTime: null,
|
yqbeginTime: null,
|
yqendTime: null,
|
},
|
querytempType: {
|
tempType: null,
|
pageNum: 1,
|
pageSize: 10,
|
},
|
// 表单参数
|
form: {
|
tjType: 2,
|
},
|
// 表单校验
|
rules: {},
|
pickerOptions: {
|
shortcuts: [
|
{
|
text: "最近一周",
|
onClick(picker) {
|
const end = new Date();
|
const start = new Date();
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
picker.$emit("pick", [start, end]);
|
},
|
},
|
{
|
text: "最近一个月",
|
onClick(picker) {
|
const end = new Date();
|
const start = new Date();
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
picker.$emit("pick", [start, end]);
|
},
|
},
|
{
|
text: "最近三个月",
|
onClick(picker) {
|
const end = new Date();
|
const start = new Date();
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
picker.$emit("pick", [start, end]);
|
},
|
},
|
],
|
},
|
};
|
},
|
created() {
|
// this.getNowTime();
|
|
this.getdate();
|
},
|
mounted() {
|
this.$nextTick(() => {
|
this.$refs.inputName.focus();
|
});
|
},
|
methods: {
|
getdate() {
|
getNewDateList().then((res) => {
|
this.finishTimeList = [
|
moment(res.data).format("YYYY-MM-DD 00:00:00"),
|
moment(res.data).format("YYYY-MM-DD 23:59:00"),
|
];
|
this.getList();
|
});
|
},
|
dialogVisibles() {
|
this.$message.error("请连接拨号器!");
|
},
|
handleClick(tab, event) {},
|
//处理默认选中当前日期
|
getNowTime() {
|
var curDate = new Date().getTime();
|
var dayNum = 3 * 24 * 3600 * 1000;
|
var threeDays = curDate - dayNum;
|
var sDay = this.getLocalTime(threeDays);
|
var end = this.getLocalTime(curDate);
|
this.finishTimeList = [sDay, end];
|
},
|
add0(m) {
|
return m < 10 ? "0" + m : m;
|
},
|
getLocalTime(nS) {
|
var time = new Date(nS);
|
var y = time.getFullYear();
|
var m = time.getMonth() + 1;
|
var d = time.getDate();
|
return y + "-" + this.add0(m) + "-" + this.add0(d);
|
},
|
onSubmit() {},
|
|
/** 查询体检记录列表 */
|
getList() {
|
this.loading = true;
|
if (this.createTimeList) {
|
this.queryParams.djbeginTime = this.createTimeList[0];
|
this.queryParams.djendTime = this.createTimeList[1];
|
} else {
|
this.queryParams.djbeginTime = null;
|
this.queryParams.djendTime = null;
|
}
|
if (this.finishTimeList) {
|
this.queryParams.yqbeginTime = this.finishTimeList[0];
|
this.queryParams.yqendTime = this.finishTimeList[1];
|
} else {
|
this.queryParams.yqbeginTime = null;
|
this.queryParams.yqendTime = null;
|
}
|
|
getextensionlist(this.queryParams).then((response) => {
|
response.data.list.forEach((item, index) => {
|
item.newID =
|
(this.queryParams.pageNum - 1) * this.queryParams.pageSize +
|
index +
|
1;
|
});
|
this.extensionList = response.data.list;
|
this.total = response.data.total;
|
this.loading = false;
|
});
|
},
|
|
// 搜索
|
getRemoteData(query) {
|
if (query) {
|
let compName = query;
|
queryCompany(compName).then((response) => {
|
this.CompanyList = response.data;
|
this.CompanyList.forEach((item) => {
|
this.queryParams = item;
|
});
|
});
|
}
|
},
|
// 搜索
|
handleTempType() {
|
this.loading = true;
|
this.transmit();
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
orderId: null,
|
userId: null,
|
tjType: null,
|
tjNumber: null,
|
tjSerialNumber: null,
|
pacId: null,
|
createTime: null,
|
finishTime: null,
|
updateTime: null,
|
reportTime: null,
|
createBy: null,
|
updateBy: null,
|
deleted: null,
|
firmId: null,
|
firmDeptName: null,
|
firmWorkId: null,
|
photo: null,
|
};
|
this.resetForm("form");
|
},
|
hb() {
|
if (this.queryParams.tjNum != null) {
|
this.handleQuery();
|
}
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.finishTimeList=[]
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map((item) => item.id);
|
this.single = selection.length !== 1;
|
this.multiple = !selection.length;
|
},
|
handleChange(selection) {
|
selection.forEach((item) => {
|
this.tempId = item.id;
|
});
|
|
if (selection.length > 1) {
|
let del_row = selection.shift();
|
this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
|
}
|
},
|
|
// 出现邮件弹框
|
transmit() {
|
this.drawer = true;
|
this.mail = true;
|
this.title = "选择邮件发送模板";
|
this.loading = true;
|
listSendTemplate(this.querytempType).then((response) => {
|
this.sendTemplateList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
// let orderIds = this.ids;
|
// sendEmail(orderIds).then((response) => {
|
// if (msg === "操作成功") {
|
// this.$modal.msgSuccess("发送成功!");
|
// }
|
// if (code === 500) {
|
// this.$error.msgSuccess("发送失败!");
|
// }
|
// });
|
// this.$tab.refreshPage();
|
},
|
// 出现短信弹框
|
transmittext() {
|
this.drawer = true;
|
this.mail = false;
|
this.title = "选择短信发送模板";
|
this.loading = true;
|
listSendTemplate(this.querytempType).then((response) => {
|
this.sendTemplateList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
|
// 发送邮件
|
sendingmail() {
|
if (this.tempId) {
|
let data = {
|
yqorderIds: this.ids,
|
tempId: this.tempId,
|
type: 1,
|
};
|
sendMessageOrEmail(data).then((res) => {
|
if (res.code === 200) {
|
this.$modal.msgSuccess("发送成功");
|
this.getList();
|
}
|
});
|
this.drawer = false;
|
} else {
|
this.$modal.msgError("请选择邮件模板");
|
}
|
},
|
// 发送短信
|
sendingtext() {
|
if (this.tempId) {
|
let data = {
|
yqorderIds: this.ids,
|
tempId: this.tempId,
|
type: 2,
|
};
|
sendMessageOrEmail(data).then((res) => {
|
if (res.code === 200) {
|
this.$modal.msgSuccess("发送成功");
|
this.getList();
|
}
|
});
|
this.drawer = false;
|
} else {
|
this.$modal.msgError("请选择短信模板");
|
}
|
},
|
},
|
};
|
</script>
|
<style lang="scss">
|
.pag {
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
}
|
|
.pag1 {
|
width: 30%;
|
}
|
|
.el-table__header-wrapper .el-checkbox {
|
display: none;
|
}
|
|
.main {
|
height: 700px;
|
overflow: hidden;
|
}
|
|
#printIframe::-webkit-scrollbar {
|
width: 6px;
|
}
|
|
/* 修改 滚动条的 下面 的 样式 */
|
#printIframe::-webkit-scrollbar-track {
|
background-color: white;
|
-webkit-border-radius: 2em;
|
-moz-border-radius: 2em;
|
border-radius: 2em;
|
}
|
|
/* 修改 滑块 */
|
#printIframe::-webkit-scrollbar-thumb {
|
background-color: #dcdfe6;
|
-webkit-border-radius: 2em;
|
-moz-border-radius: 2em;
|
border-radius: 2em;
|
}
|
|
.tab1 {
|
width: 700px;
|
display: flex;
|
margin-top: 8px;
|
}
|
|
.drawer1 {
|
display: flex;
|
flex-direction: row;
|
justify-content: space-evenly;
|
align-items: flex-start;
|
}
|
|
.drawer2 {
|
height: 100px;
|
display: flex;
|
justify-content: space-evenly;
|
align-items: flex-start;
|
flex-direction: column;
|
margin-top: 20px;
|
font-size: 16px;
|
margin-bottom: 20px;
|
}
|
|
.a {
|
font-size: 14px;
|
color: #409eff;
|
}
|
|
.drawer3 {
|
min-height: 400px;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-evenly;
|
align-items: flex-start;
|
font-size: 14px;
|
}
|
|
.drawer4 {
|
width: 100%;
|
height: 20px;
|
display: flex;
|
justify-content: center;
|
margin-top: 10px;
|
}
|
|
.drawer4 {
|
display: flex;
|
justify-content: center;
|
}
|
|
.ap {
|
font-size: 14px;
|
color: #606266;
|
font-weight: 600;
|
}
|
</style>
|