<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="tjNumber">
|
<el-input v-model="queryParams.tjNumber" placeholder="请输入体检号" clearable @keyup.enter.native="handleQuery" />
|
</el-form-item> -->
|
<el-form-item label="登记时间" prop="createTimeList">
|
<el-date-picker clearable v-model="createTimeList" :default-time="['00:00:00', '23:59:00']"
|
format="yyyy-MM-dd HH:mm"
|
value-format="yyyy-MM-dd HH:mm"
|
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
:picker-options="pickerOptions"></el-date-picker>
|
</el-form-item>
|
<!-- <el-form-item label="登记时间" prop="createTime">
|
<el-date-picker clearable
|
v-model="queryParams.createTime"
|
type="date"
|
value-format="yyyy-MM-dd"
|
placeholder="请选择登记时间">
|
</el-date-picker>
|
</el-form-item> -->
|
<el-form-item label="预约时间" prop="finishTimeList">
|
<el-date-picker clearable v-model="queryParams.finishTimeList" type="daterange" range-separator="-"
|
start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd"
|
placeholder="请选择体检完成时间" style="width: 240px">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item label="单位名称" prop="firmId">
|
<el-select :remote-method="getRemoteData" v-model="queryParams.firmId" value-key="drugManufacturerId" remote
|
filterable placeholder="请选择单位名称" clearable @change="searchSelect">
|
<el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName"
|
:value="dict.drugManufacturerId" />
|
</el-select>
|
</el-form-item>
|
<!-- <el-form-item label="报告时间" prop="reportTimeList">
|
<el-date-picker clearable v-model="queryParams.reportTimeList" type="daterange" range-separator="-"
|
start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" value-format="yyyy-MM-dd"
|
placeholder="请选择出报告时间" style="width: 240px">
|
</el-date-picker>
|
</el-form-item> -->
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" style="margin: 0 15px;">搜索</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" icon="el-icon-download" size="mini" @click="handleExport"
|
v-hasPermi="['hosp:order:export']" :disabled="multiple">导出</el-button> -->
|
<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="orderList"
|
@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="tjCustomerName" height="10px" />
|
<el-table-column label="性别" align="center" prop="tjCustomerSex" width="55px" height="10px">
|
<template slot-scope="scope">
|
<span v-if="scope.row.tjCustomerSex == '0'">男</span>
|
<span v-if="scope.row.tjCustomerSex == '1'">女</span>
|
<span v-if="scope.row.tjCustomerSex == '2'">未知</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="年龄" align="center" prop="tjCustomerAge" height="10px" />
|
<el-table-column label="电话" align="center" prop="tjCustomerPhone" :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="pacName" height="10px" :show-overflow-tooltip="true" />
|
<el-table-column label="创建时间" align="center" prop="createTime" width="155px" height="10px">
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="预约时间" align="center" prop="finishTime" width="155px" height="10px">
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.finishTime) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="短信发送状态" align="center" prop="sendMessage" height="10px" :show-overflow-tooltip="true">
|
<template slot-scope="scope">
|
<span v-if="scope.row.sendMessage == '1'">已发送</span>
|
<span v-if="scope.row.sendMessage == '0'">未发送</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="邮件发送状态" align="center" prop="sendEmail" height="10px" :show-overflow-tooltip="true">
|
<template slot-scope="scope">
|
<span v-if="scope.row.sendEmail == '1'">已发送</span>
|
<span v-if="scope.row.sendEmail == '0'">未发送</span>
|
</template>
|
</el-table-column>
|
<!-- <el-table-column
|
fixed="right"
|
label="操作"
|
align="center"
|
class-name="small-padding fixed-width"
|
height="10px"
|
width="55px"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-document"
|
@click="investigation(scope.row)"
|
v-hasPermi="['hosp:order:edit']"
|
title="详情"
|
style="margin-right: 15px"
|
></el-button>
|
</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 { listOrder, getPdf, getTjNumber, sendEmail, getsendEmail, getsendMessage, getNewDateList } from "@/api/hosp/order";
|
import { listSendTemplate, } from "@/api/hosp/sendTemplate";
|
import ViewPdf from "@/components/ViewPdf";
|
import { listEmer } from "@/api/system/emer";
|
import { getCompany, queryCompany } from "@/api/team/tuanti";
|
import moment from "moment";
|
export default {
|
components: {
|
ViewPdf,
|
},
|
name: "Order",
|
dicts: ['tj_send_type', 'sys_normal_disable'],
|
data() {
|
return {
|
activeNames: "first",
|
textarea1: "",
|
textarea: "",
|
emerc: false,
|
mail: true,
|
// 知识库表格数据
|
emerList: [],
|
gation: {},
|
drawer: false,
|
options: [
|
{
|
value: "选项3",
|
label: "连接成功",
|
},
|
{
|
value: "选项1",
|
label: "无人接听",
|
},
|
{
|
value: "选项2",
|
label: "关机",
|
},
|
{
|
value: "选项3",
|
label: "空号",
|
},
|
],
|
value: "",
|
// 弹出层标题
|
title: "",
|
dialogVisible: false,
|
daoZhenDan: false,
|
Projectopen: false,
|
src: "",
|
url: "",
|
flag: true,
|
tempId: null,
|
createTimeList:[],
|
bill: null,
|
Treedata: [],
|
defaultProps: {
|
children: "tjProjectList",
|
label: "proName",
|
},
|
discount: 100,
|
DataList: [],
|
// 套餐提交按钮
|
confirm: false,
|
list1: true,
|
activeName: "1",
|
proIds: [],
|
TotalPrice1: 0,
|
numberList: [],
|
tjOrderList: [],
|
dialogVisible: false,
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
userId: "",
|
// 总条数
|
total: 0,
|
textarea: "",
|
// 体检记录表格数据
|
orderList: [],
|
ordersList: [],
|
sendTemplateList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
CompanyList: [],
|
// 日期范围
|
datetimerange: [],
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
tjType: null,
|
tjNumber: null,
|
createTime: null,
|
finishTime: null,
|
reportTime: null,
|
firmId: null,
|
departmentId: undefined,
|
},
|
querytempType: {
|
tempType: null,
|
pageNum: 1,
|
pageSize: 10,
|
},
|
queryParam: {
|
emertitle: null,
|
emertype: null,
|
},
|
// 表单参数
|
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.getListEmer();
|
this.getdate();
|
},
|
methods: {
|
getdate() {
|
getNewDateList().then((res) => {
|
this.createTimeList = [
|
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 = 7 * 24 * 3600 * 1000;
|
var threeDays = curDate - dayNum;
|
var sDay = this.getLocalTime(threeDays);
|
var end = this.getLocalTime(curDate);
|
this.createTimeList = [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.createTime = this.createTimeList[0];
|
this.queryParams.finishTime = this.createTimeList[1];
|
} else {
|
this.queryParams.createTime = null;
|
this.queryParams.finishTime = null;
|
}
|
listOrder(this.queryParams).then((response) => {
|
this.orderList = response.rows;
|
response.rows.forEach((item, index) => {
|
item.newID = (this.queryParams.pageNum - 1) * 10 + index + 1;
|
});
|
this.total = response.total;
|
this.loading = false;
|
});
|
|
// 获取单位信息集合
|
getCompany(this.queryParams).then((response) => {
|
this.CompanyList = response.data;
|
this.loading = false;
|
});
|
},
|
|
/** 查询知识库列表 */
|
getListEmer() {
|
listEmer(this.queryParam).then((response) => {
|
this.emerList = response.rows;
|
});
|
},
|
|
// 选框数据
|
searchSelect(val) { },
|
|
// 搜索
|
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()
|
},
|
|
// 获取单位信息集合
|
getCompanyList() {
|
this.loading = true;
|
getCompany().then((response) => {
|
this.CompanyList = response.data;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
|
// 最近一次体检报告
|
viewReport1() {
|
const tjNumber = this.gation.tjNumber;
|
const flag = true;
|
getPdf(tjNumber, flag).then((response) => {
|
if (response.size === 0) {
|
this.$message.error("该用户体检报告暂未完成!");
|
this.dialogVisible = false;
|
} else {
|
this.dialogVisible = true;
|
this.url = window.webkitURL.createObjectURL(response); //将后端返回的blob文件读取出url
|
}
|
});
|
},
|
// 取消按钮
|
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");
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
handleQuerys() {
|
this.emerc = true;
|
this.queryParam.pageNum = 1;
|
this.getListEmer();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.createTimeList =[]
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map((item) => item.orderId);
|
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 = {
|
orderIds: this.ids,
|
tempId: this.tempId
|
}
|
getsendEmail(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 = {
|
orderIds: this.ids,
|
tempId: this.tempId
|
}
|
getsendMessage(data).then((res) => {
|
if (res.code === 200) {
|
this.$modal.msgSuccess("发送成功");
|
this.getList()
|
}
|
})
|
this.drawer = false
|
}else{
|
this.$modal.msgError("请选择短信模板");
|
}
|
},
|
// 点击详情
|
investigation(row) {
|
this.gation = row;
|
this.drawer = true;
|
},
|
|
/** 导出按钮操作 */
|
handleExport() {
|
this.download(
|
"hosp/order/export",
|
{
|
...this.queryParams,
|
},
|
`order_${new Date().getTime()}.xlsx`
|
);
|
},
|
},
|
};
|
</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;
|
}
|
|
// .el-dialog {
|
// width: 1000px;
|
// min-height: 800px;
|
// }
|
|
// .el-dialog__header {
|
// display: flex;
|
// justify-content: space-between;
|
// align-items: center;
|
// }
|
|
// .el-dialog__body {
|
// padding: 0;
|
// }
|
|
.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>
|