123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- import { payHistory } from "./service";
- import history from "../../utils/history";
- import { tradePay } from "../../utils/tradePay";
- import { reportCmPV_YL } from "../../utils/cloudMonitorHelper";
- import { getSubscribeAuth } from "../../../../core/utils/ywtService";
- import { createSubscribe } from "applet-page-component";
- Component(
- createSubscribe({
- async onShow() {
- this.scrollRef.refresh();
- },
- })({
- props: {},
- data: {
- empty: true,
- clinicCard: {},
- filterParams: {
- type: "9",
- cardNum: "",
- endTime: "",
- startTime: "",
- medicCards: [],
- timeShow: false,
- },
- /* 赛选项目 */
- typeOptions: [],
- statusOptions: [
- {
- value: "0",
- label: "待支付",
- },
- {
- value: "1",
- label: "已支付",
- },
- ],
- showAll: false,
- showTimeSelector: false,
- showCardSelector: false,
- defaultLabel: "待支付",
- defaultName: "待支付",
- defaultStatus: "待支付",
- alertTitle: "",
- },
- didMount() {
- /* 服务预警,缴费记录查询 */
- reportCmPV_YL({
- title: "门诊缴费",
- });
- },
- onInit() {},
- methods: {
- onFilterHandel(filters) {
- const { status: prevStatus } = this.filters || {};
- const { status: curStatus } = filters || {};
- if (!this.hisPatientId) return;
- this.filters = filters;
- const { status, startTime, endTime } = this.filters || {};
- // 当状态未改变时,做时间筛选校验,拦截请求;当状态被改变时,做时间校验的同时,不拦截请求
- // 状态:已支付
- // if (status && status === "1") {
- // if (!startTime || this.getTimeChange(startTime, endTime, 15)) {
- // my.showToast({
- // type: "fail",
- // content: "请选择15天以内的时间",
- // duration: 1500,
- // });
- // if (prevStatus === curStatus) return;
- // }
- // }
- // 状态:未支付
- // if (!status || status === "0") {
- // if (!startTime || this.getTimeChange(startTime, endTime, 3)) {
- // my.showToast({
- // type: "fail",
- // content: "请选择3天以内的时间",
- // duration: 1500,
- // });
- // if (prevStatus === curStatus) return;
- // }
- // }
- this.scrollRef.refresh();
- },
- saveRef(ref) {
- this.scrollRef = ref;
- },
- saveSubscribe(ref) {
- this.subscribe = ref;
- },
- getTimeChange(startTime, endTime, len) {
- if (!startTime || !endTime) {
- return true;
- }
- const time1 = Date.parse(startTime);
- const time2 = Date.parse(endTime);
- const timeDiff = time2 - time1;
- const duration = len * 24 * 60 * 60 * 1000;
- return timeDiff < 0 || timeDiff > duration;
- },
- onService(page) {
- const { status, startTime, endTime } = this.filters || {};
- if (!this.hisPatientId) return;
- return payHistory({
- ...this.filters,
- status: status || "0",
- ...page,
- hisPatientId: this.hisPatientId,
- });
- },
- onAutoFilter(patient) {
- if (patient) {
- this.hisPatientId = patient.hisPatientId;
- this.scrollRef.refresh();
- }
- },
- // 进入详情
- toDetail(e) {
- const {
- item: {
- type,
- outTradeNo,
- status,
- tradeNo,
- invoiceNo,
- hisPatientId,
- date,
- depName,
- amount,
- name,
- age,
- sex,
- prescribeDate,
- hisOrderNo,
- doctorName,
- doctorCode,
- total,
- hisClinicCode,
- deptName,
- orderItems,
- orderInsType,
- medInsFee,
- selfFee,
- payName,
- patName,
- },
- } = e.target.dataset;
- history.push({
- title: "缴费详情",
- query: {
- type: type || 0,
- outTradeNo,
- status,
- tradeNo,
- invoiceNo,
- hisPatientId,
- date,
- depName,
- amount,
- name,
- age,
- sex,
- prescribeDate,
- hisOrderNo,
- doctorName,
- doctorCode,
- total,
- hisClinicCode,
- deptName,
- orderInsType,
- orderItems: encodeURIComponent(JSON.stringify(orderItems || "")),
- medInsFee,
- selfFee,
- payName,
- patName,
- },
- pageType: "hospital-payment-detail",
- });
- },
- // 付款
- async onPayment(e) {
- this.toDetail(e);
- },
- },
- })
- );
|