<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="收费员" prop="tollCollectorName" style="display: flex;">
|
<el-input v-model="queryParams.tollCollectorName" placeholder="请输入收费员" clearable @keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="15">
|
<el-form-item label="结账时间" prop="tollCollectorName" style="display: flex;">
|
<el-date-picker v-model="value1" type="datetimerange" start-placeholder="起止日期" end-placeholder="终止日期" :default-time="['00:00:00', '23:00:00']"
|
format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
@change="dateChangebirthday1">
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleUpdate">统计</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="primary" icon="el-icon-check" size="mini" @click="handlesettle"
|
:disabled="discode === 200 ? true : false">结账</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="primary" size="mini" @click="handleabout">日结查询</el-button>
|
</el-col>
|
</el-row>
|
|
<el-table :data="dataList" border style="width: 75%">
|
<el-table-column label="姓名" align="center" prop="cusName" width="91px" />
|
<el-table-column label="订单流水号" align="center" prop="waterId" width="186px" />
|
<el-table-column label="应收金额" align="center" prop="copeWith" width="90px" />
|
<el-table-column label="折扣" align="center" prop="discount" width="90px" />
|
<el-table-column label="实收金额" align="center" prop="paidIn" width="90px" />
|
<el-table-column label="付款状态" align="center" prop="payStasus" width="100px" />
|
<el-table-column label="付款方式" align="center" prop="payType" width="100px" />
|
<el-table-column label="收费员" align="center" prop="updateBy" width="140px" />
|
<el-table-column label="收费时间" align="center" prop="updateTime" width="180px" />
|
<el-table-column label="退费时间" align="center" prop="refundTime" width="200px" />
|
</el-table>
|
|
<div class="pag">
|
<div class="pag1">
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
@pagination="handleUpdate" />
|
</div>
|
</div>
|
|
<el-table border :data="allList" style="margin-top: 30px; width: 75%" :summary-method="getSummaries" show-summary>
|
<el-table-column label="付款方式" align="center" prop="paytpe" />
|
<el-table-column label="收费金额" align="center" prop="vo.shoukuan">
|
</el-table-column>
|
<el-table-column label="退费金额" align="center" prop="vo.tuikuan" />
|
<el-table-column label="应交款" align="center" prop="vo.yingjiao" />
|
</el-table>
|
</div>
|
</template>
|
|
<script>
|
import { getLastTime, getList, collector, getNewDate } from "@/api/hosp/water";
|
import { getInfo } from "@/api/login";
|
import moment from "moment";
|
|
export default {
|
name: "Water",
|
data() {
|
return {
|
// 遮罩层
|
loading: true,
|
value1: [],
|
allList: [],
|
dataList: [],
|
tjTollCollectorDetailList: [],
|
disabled: true,
|
discode: "",
|
// 选中数组
|
time: "",
|
ids: [],
|
// 非单个禁用
|
single: true,
|
closeList: 0,
|
machiningTimeList: 0,
|
debugTimeList: 0,
|
// 非多个禁用
|
multiple: true,
|
waterId: [],
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
userId: "",
|
// 体检流水表格数据
|
tableData: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
tollCollectorName: null,
|
payStasus: null,
|
payType: null,
|
deleted: null,
|
customer: {
|
cusName: null,
|
},
|
},
|
// 表单参数
|
form: {},
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询体检流水列表 */
|
getList() {
|
this.loading = true;
|
getInfo().then((response) => {
|
this.userId = response.user.userId;
|
this.queryParams.tollCollectorName = response.user.nickName;
|
});
|
getLastTime().then((response) => {
|
if (response.code === 200) {
|
this.time = response.data;
|
getNewDate().then((response) => {
|
if (response.code === 200) {
|
this.value1 = [
|
moment(this.time).format("YYYY-MM-DD HH:mm:ss"),
|
moment(response.data).format("YYYY-MM-DD HH:mm:ss")
|
];
|
}
|
});
|
}
|
});
|
|
},
|
// 时间
|
dateChangebirthday1(val) {
|
this.value1 = val;
|
},
|
|
/** 统计 */
|
handleUpdate() {
|
this.loading = true;
|
|
let data = {
|
pageNum: this.queryParams.pageNum,
|
pageSize: this.queryParams.pageSize,
|
userId: this.userId.toString(),
|
beginTime: this.value1[0],
|
endTime: this.value1[1]
|
};
|
getList(data).then((res) => {
|
this.dataList = res.data.list;
|
this.dataList.forEach((item) => {
|
this.waterId.push(item.tjSerialNumber);
|
if (item.payStasus == "0") {
|
item.payStasus = "未付款";
|
} else if (item.payStasus == "1") {
|
item.payStasus = "已付款";
|
} else if (item.payStasus == "2") {
|
item.payStasus = "退费";
|
} else if (item.payStasus == "3") {
|
item.payStasus = "预交款";
|
} else if (item.payStasus == "4") {
|
item.payStasus = "首付款";
|
} else if (item.payStasus == "5") {
|
item.payStasus = "尾款";
|
}
|
if (item.payType == "0") {
|
item.payType = "现金";
|
} else if (item.payType == "1") {
|
item.payType = "刷卡";
|
} else if (item.payType == "2") {
|
item.payType = "支付宝";
|
} else if (item.payType == "3") {
|
item.payType = "微信";
|
} else {
|
item.payType = "云闪付";
|
}
|
});
|
this.allList = res.data.all;
|
this.closeList = res.data.zshoukuan;
|
this.machiningTimeList = res.data.ztuikuan;
|
this.debugTimeList = res.data.zyingjiao;
|
this.allList.forEach((item) => {
|
if (item.paytpe == "0") {
|
item.paytpe = "现金";
|
} else if (item.paytpe == "1") {
|
item.paytpe = "刷卡";
|
} else if (item.paytpe == "2") {
|
item.paytpe = "支付宝";
|
} else if (item.paytpe == "3") {
|
item.paytpe = "微信";
|
} else {
|
item.paytpe = "云闪付";
|
}
|
|
this.tjTollCollectorDetailList.push({
|
payType: item.paytpe,
|
amountReceived: item.vo.shoukuan,
|
refundAmount: item.vo.tuikuan,
|
payable: item.vo.yingjiao,
|
});
|
});
|
this.disabled = false;
|
this.loading = false;
|
this.total = res.data.total;
|
});
|
},
|
|
// 合计
|
getSummaries(param) {
|
const { columns, data } = param;
|
const sums = [];
|
columns.forEach((column, index) => {
|
if (index === 0) {
|
sums[index] = "总计";
|
return;
|
}
|
|
switch (column.property) {
|
case "vo.shoukuan":
|
sums[index] = this.closeList;
|
break;
|
case "vo.tuikuan":
|
sums[index] = this.machiningTimeList;
|
break;
|
|
case "vo.yingjiao":
|
sums[index] = this.debugTimeList;
|
break;
|
default:
|
break;
|
}
|
});
|
return sums;
|
},
|
|
// 日结查询
|
handleabout() {
|
this.$router.push({ path: "/system/about" });
|
},
|
|
// 点击结账
|
handlesettle() {
|
if (this.dataList.length != 0) {
|
let data = {
|
ids: this.waterId,
|
accountBeginTime: moment(this.time).format("YYYY-MM-DD HH:mm:ss"),
|
accountEndTime: new Date(new Date().getTime() + 8 * 3600 * 1000)
|
.toJSON()
|
.substr(0, 19)
|
.replace("T", " "),
|
tollCollector: this.queryParams.tollCollectorName,
|
tollCollectorId: this.userId,
|
amountReceived: this.closeList,
|
payable: this.debugTimeList,
|
refundAmount: this.machiningTimeList,
|
tjTollCollectorDetailList: this.tjTollCollectorDetailList,
|
};
|
collector(data).then((res) => {
|
if (res.code === 200) {
|
this.discode = res.code;
|
this.$message({
|
showClose: true,
|
message: "结账成功",
|
type: "success",
|
});
|
this.$forceUpdate();
|
this.getList();
|
const accountId = res.msg;
|
const viewNum = "809743614817824768";
|
const params = { viewNum, accountId };
|
this.$tab.openPage("结账单", "/report/settlement", params);
|
}
|
});
|
} else {
|
this.$message({
|
type: "warning ",
|
message: "请先查询收费员统计!",
|
});
|
}
|
},
|
},
|
};
|
</script>
|
<style scoped>
|
.pag {
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
}
|
|
.pag1 {
|
width: 30%;
|
}
|
</style>
|