|
@@ -47,8 +47,39 @@ Component({
|
|
|
|
|
|
methods: {
|
|
|
onFilterHandel(filters) {
|
|
|
+ const { status: prevStatus } = this.filters || {};
|
|
|
+ const { status: curStatus } = filters || {};
|
|
|
+ console.log("status ===>", prevStatus, curStatus);
|
|
|
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();
|
|
|
},
|
|
|
|
|
@@ -74,27 +105,6 @@ Component({
|
|
|
onService(page) {
|
|
|
const { status, startTime, endTime } = this.filters || {};
|
|
|
if (!this.hisPatientId) return;
|
|
|
-
|
|
|
- if (status && status === "1") {
|
|
|
- if (!startTime || this.getTimeChange(startTime, endTime, 15)) {
|
|
|
- my.showToast({
|
|
|
- type: "fail",
|
|
|
- content: "请选择15天以内的时间",
|
|
|
- duration: 1500,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!status || status === "0") {
|
|
|
- if (!startTime || this.getTimeChange(startTime, endTime, 3)) {
|
|
|
- my.showToast({
|
|
|
- type: "fail",
|
|
|
- content: "请选择3天以内的时间",
|
|
|
- duration: 1500,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
return payHistory({
|
|
|
...this.filters,
|
|
|
status: status || "0",
|