|
@@ -59,9 +59,30 @@ Component({
|
|
|
this.subscribe = ref;
|
|
|
},
|
|
|
|
|
|
+ getTimeChange(startTime, endTime) {
|
|
|
+ if (!startTime || !endTime) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ const time1 = Date.parse(startTime);
|
|
|
+ const time2 = Date.parse(endTime);
|
|
|
+ const timeDiff = time2 - time1;
|
|
|
+ const duration = 15 * 24 * 60 * 60 * 1000;
|
|
|
+ return timeDiff < 0 || timeDiff > duration;
|
|
|
+ },
|
|
|
+
|
|
|
onService(page) {
|
|
|
- const { status } = this.filters || {};
|
|
|
+ const { status, startTime, endTime } = this.filters || {};
|
|
|
if (!this.hisPatientId) return;
|
|
|
+ if (status && status === "1") {
|
|
|
+ if (!startTime || this.getTimeChange(startTime, endTime)) {
|
|
|
+ my.showToast({
|
|
|
+ type: "fail",
|
|
|
+ content: "请选择15天以内的时间",
|
|
|
+ duration: 1500,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return payHistory({
|
|
|
...this.filters,
|
|
|
status: status || "0",
|