瀏覽代碼

fix: 报告查询中,移除全部选项、时间选项,修改默认传递参数

carver 2 年之前
父節點
當前提交
a97c7e37ab
共有 18 個文件被更改,包括 521 次插入520 次删除
  1. 0 1
      antbuilder/core/utils/request.js
  2. 1 1
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/filter-content/index.axml
  3. 32 32
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/filter-content/index.js
  4. 3 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/index.axml
  5. 136 133
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/index.js
  6. 3 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/mask-option/index.axml
  7. 33 37
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/mask-option/index.js
  8. 34 35
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/time-option/index.js
  9. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/index.axml
  10. 60 64
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/index.js
  11. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/main/index.axml
  12. 73 86
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/main/index.js
  13. 73 73
      antbuilder/industry/hospitalV2/components/components/patient-tabs/index.js
  14. 1 7
      antbuilder/industry/hospitalV2/components/edit-patient/index.js
  15. 2 1
      antbuilder/industry/hospitalV2/components/patient-detail/index.axml
  16. 4 0
      antbuilder/industry/hospitalV2/components/report-list/index.axml
  17. 14 0
      antbuilder/industry/hospitalV2/components/report-list/index.js
  18. 50 50
      antbuilder/industry/hospitalV2/service/common.js

+ 0 - 1
antbuilder/core/utils/request.js

@@ -238,7 +238,6 @@ export default async function request(options) {
 		await setTicket();
 	}
 	const [err, res] = await _request(options);
-	console.log("[err, res] ===>", err, res);
 	if (err) return [err, null];
 	const code = +getIn(res, ["code"], "");
 	if (code === 20001 || code === 20002 || code === 20008) {

+ 1 - 1
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/filter-content/index.axml

@@ -1,6 +1,6 @@
 <import-sjs name="utils" from="./index.sjs"/>
 <view class="filter-items">
-  <view class="filter-item{{ showTime ? ' open' : ''}}" onTap="onTimeTapHandel">
+  <view a:if="{{ showTimeSelector }}" class="filter-item{{ showTime ? ' open' : ''}}" onTap="onTimeTapHandel">
     <view class="filter-value">
       {{ utils.getTime(timeStart.replace(/-/g, '.'), timeEnd.replace(/-/g, '.'))}}
     </view>

+ 32 - 32
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/filter-content/index.js

@@ -1,38 +1,38 @@
 Component({
-  props: {
-    type: '',
-    items: [],
-    timeStart: '',
-    timeEnd: '',
-    status: '',
-    showStatus: false,
-    onTypeTap: () => null,
-    onTimeTap: () => null,
-    onCardTap: () => null,
-    onStatusTap: () => null,
-    statusItems: [],
-    defaultName: ''
-  },
-  data: {},
+	props: {
+		type: "",
+		items: [],
+		timeStart: "",
+		timeEnd: "",
+		status: "",
+		showStatus: false,
+		onTypeTap: () => null,
+		onTimeTap: () => null,
+		onCardTap: () => null,
+		onStatusTap: () => null,
+		statusItems: [],
+		defaultName: "",
+		showTimeSelector: true,
+	},
+	data: {},
 
-  didMount() {},
+	didMount() {},
 
-  methods: {
-    onTypeTapHandel() {
-      this.props.onTypeTap();
-    },
+	methods: {
+		onTypeTapHandel() {
+			this.props.onTypeTap();
+		},
 
-    onTimeTapHandel() {
-      this.props.onTimeTap();
-    },
+		onTimeTapHandel() {
+			this.props.onTimeTap();
+		},
 
-    onCardTapHandel() {
-      this.props.onCardTap();
-    },
+		onCardTapHandel() {
+			this.props.onCardTap();
+		},
 
-    onStatusTapHandel() {
-      this.props.onStatusTap();
-    }
-
-  }
-});
+		onStatusTapHandel() {
+			this.props.onStatusTap();
+		},
+	},
+});

+ 3 - 0
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/index.axml

@@ -16,6 +16,7 @@
     statusItems="{{ statusList }}"
     showStatus="{{ showStatus }}"
     defaultName="{{ defaultName }}"
+    showTimeSelector="{{ showTimeSelector }}"
   />
   <time-option
     onCancel="onCancelTime"
@@ -37,6 +38,7 @@
     statusItems="{{ statusList }}"
     defaultLabel="{{ defaultLabel }}"
     defaultName="{{ defaultName }}"
+    showTimeSelector="{{ showTimeSelector }}"
   />
   <mask-option
     value="{{ status }}"
@@ -51,6 +53,7 @@
     timeEnd="{{ filters.endTime }}"
     cardNum="{{ filters.cardNum }}"
     statusItems="{{ statusList }}"
+    showTimeSelector="{{ showTimeSelector }}"
   />
   <select-card
     show="{{ showCard || false }}"

+ 136 - 133
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/index.js

@@ -1,134 +1,137 @@
 Component({
-  props: {
-    /*
-    * 数据结构为 [{ value: 'normal', label:'普通号' }]
-    * */
-    options: [],
-
-    /* 挂号类型 */
-    type: '',
-    status: '',
-
-    /* 时间 */
-    otherOption: '',
-    medicCards: [],
-    onChange: () => {},
-    statusList: [],
-    defaultName: '',
-    defaultLabel: ''
-  },
-  data: {},
-
-  didMount() {},
-
-  methods: {
-    onShowMask() {
-      this.setData({
-        showOptions: true
-      });
-    },
-
-    onShowStatusMask() {
-      this.setData({
-        showStatus: true
-      });
-    },
-
-    onCloseMask() {
-      this.setData({
-        showOptions: false
-      });
-    },
-
-    onCloseStatusMask() {
-      this.setData({
-        showStatus: false
-      });
-    },
-
-    onTypeChange(value) {
-      this.props.onChange({
-        type: value
-      });
-    },
-
-    onStatusChange(value) {
-      this.props.onChange({
-        status: value
-      });
-    },
-
-    onShowTime() {
-      this.setData({
-        showTime: true
-      }, () => {
-        console.log(my.createSelectorQuery().select('.range-item'));
-      });
-    },
-
-    onResetTime() {
-      this.props.onChange({
-        startTime: '',
-        endTime: ''
-      });
-      this.setData({
-        showTime: false
-      });
-    },
-
-    onCancelTime() {
-      this.setData({
-        showTime: false
-      });
-    },
-
-    onConfirmTime(date) {
-      const [start = '', end = ''] = this.judgeDate(date);
-      this.props.onChange({
-        startTime: start,
-        endTime: end
-      });
-      this.setData({
-        showTime: false
-      });
-    },
-
-    judgeDate(date) {
-      const [start = '', end = ''] = date;
-      const toDateStart = start ? new Date(start) : '';
-      const toDateEnd = end ? new Date(end) : '';
-
-      if (toDateStart && toDateEnd) {
-        if (toDateStart > toDateEnd) {
-          return [end, start];
-        }
-
-        return [start, end];
-      }
-
-      return ['', ''];
-    },
-
-    onCardTap() {
-      this.setData({
-        showCard: true
-      });
-    },
-
-    onClosePopup() {
-      this.setData({
-        showCard: false
-      });
-    },
-
-    onCardChange(item) {
-      this.setData({
-        showCard: false
-      });
-      this.props.onChange({
-        cardNum: item.cardNum
-      });
-    }
-
-  }
-});
+	props: {
+		/*
+		 * 数据结构为 [{ value: 'normal', label:'普通号' }]
+		 * */
+		options: [],
+
+		/* 挂号类型 */
+		type: "",
+		status: "",
+
+		/* 时间 */
+		otherOption: "",
+		medicCards: [],
+		onChange: () => {},
+		statusList: [],
+		defaultName: "",
+		defaultLabel: "",
+		showTimeSelector: true,
+	},
+	data: {},
+
+	didMount() {},
+
+	methods: {
+		onShowMask() {
+			this.setData({
+				showOptions: true,
+			});
+		},
+
+		onShowStatusMask() {
+			this.setData({
+				showStatus: true,
+			});
+		},
+
+		onCloseMask() {
+			this.setData({
+				showOptions: false,
+			});
+		},
+
+		onCloseStatusMask() {
+			this.setData({
+				showStatus: false,
+			});
+		},
+
+		onTypeChange(value) {
+			this.props.onChange({
+				type: value,
+			});
+		},
+
+		onStatusChange(value) {
+			this.props.onChange({
+				status: value,
+			});
+		},
+
+		onShowTime() {
+			this.setData(
+				{
+					showTime: true,
+				},
+				() => {
+					console.log(my.createSelectorQuery().select(".range-item"));
+				}
+			);
+		},
+
+		onResetTime() {
+			this.props.onChange({
+				startTime: "",
+				endTime: "",
+			});
+			this.setData({
+				showTime: false,
+			});
+		},
+
+		onCancelTime() {
+			this.setData({
+				showTime: false,
+			});
+		},
+
+		onConfirmTime(date) {
+			const [start = "", end = ""] = this.judgeDate(date);
+			this.props.onChange({
+				startTime: start,
+				endTime: end,
+			});
+			this.setData({
+				showTime: false,
+			});
+		},
+
+		judgeDate(date) {
+			const [start = "", end = ""] = date;
+			const toDateStart = start ? new Date(start) : "";
+			const toDateEnd = end ? new Date(end) : "";
+
+			if (toDateStart && toDateEnd) {
+				if (toDateStart > toDateEnd) {
+					return [end, start];
+				}
+
+				return [start, end];
+			}
+
+			return ["", ""];
+		},
+
+		onCardTap() {
+			this.setData({
+				showCard: true,
+			});
+		},
+
+		onClosePopup() {
+			this.setData({
+				showCard: false,
+			});
+		},
+
+		onCardChange(item) {
+			this.setData({
+				showCard: false,
+			});
+			this.props.onChange({
+				cardNum: item.cardNum,
+			});
+		},
+	},
+});

+ 3 - 0
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/mask-option/index.axml

@@ -15,11 +15,14 @@
       showStatus="{{ showStatus }}"
       statusItems="{{ statusItems }}"
       defaultName="{{ defaultName }}"
+      showTimeSelector="{{ showTimeSelector }}"
     />
     <view class="options">
+      <!-- 屏蔽全部类型,暂时根据 showTimeSelector 进行判断,后续可以细分 -->
       <view
         onTap="onTapItem"
         class="option {{ !value ? 'active' : '' }}"
+        a:if="{{ showTimeSelector }}" 
       >
         {{ defaultLabel || '全部类型' }}
       </view>

+ 33 - 37
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/mask-option/index.js

@@ -1,41 +1,37 @@
-import { getHeaderHeight } from '../../../../../utils';
+import { getHeaderHeight } from "../../../../../utils";
 Component({
-  props: {
-    value: '',
-    status: '',
-    type: '',
-    show: false,
-    options: [],
-    timeStart: '',
-    timeEnd: '',
-    onClose: () => null,
-    onChange: () => null,
-    statusItems: [],
-    showStatus: false,
-    defaultLabel: '',
-    defaultName: ''
-  },
-  data: {
-    headerHeight: getHeaderHeight()
-  },
+	props: {
+		value: "",
+		status: "",
+		type: "",
+		show: false,
+		options: [],
+		timeStart: "",
+		timeEnd: "",
+		onClose: () => null,
+		onChange: () => null,
+		statusItems: [],
+		showStatus: false,
+		defaultLabel: "",
+		defaultName: "",
+		showTimeSelector: true,
+	},
+	data: {
+		headerHeight: getHeaderHeight(),
+	},
 
-  didMount() {},
+	didMount() {},
 
-  methods: {
-    onCloseMsk() {
-      this.props.onClose();
-    },
+	methods: {
+		onCloseMsk() {
+			this.props.onClose();
+		},
 
-    onTapItem(e) {
-      const {
-        dataset
-      } = e.target;
-      const {
-        item = {}
-      } = dataset;
-      this.onCloseMsk();
-      this.props.onChange(item.value || '');
-    }
-
-  }
-});
+		onTapItem(e) {
+			const { dataset } = e.target;
+			const { item = {} } = dataset;
+			this.onCloseMsk();
+			this.props.onChange(item.value || "");
+		},
+	},
+});

+ 34 - 35
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/time-option/index.js

@@ -1,39 +1,38 @@
 Component({
-  props: {
-    timeShow: false,
-    onCancel: () => null,
-    onConfirm: () => null,
-    onReset: () => null
-  },
-  data: {
-    maxDate: '',
-    minDate: ''
-  },
+	props: {
+		timeShow: false,
+		onCancel: () => null,
+		onConfirm: () => null,
+		onReset: () => null,
+	},
+	data: {
+		maxDate: "",
+		minDate: "",
+	},
 
-  didMount() {
-    const nowDate = new Date();
-    const startTime = new Date(nowDate.getFullYear() - 1, 1, 1);
-    const endTime = new Date(nowDate.getFullYear() + 1, 11, 31);
-    this.setData({
-      minDate: startTime,
-      maxDate: endTime
-    });
-  },
+	didMount() {
+		const nowDate = new Date();
+		const startTime = new Date(nowDate.getFullYear() - 1, 1, 1);
+		const endTime = new Date(nowDate.getFullYear() + 1, 11, 31);
+		this.setData({
+			minDate: startTime,
+			maxDate: endTime,
+		});
+	},
 
-  methods: {
-    onOperateTime(event) {
-      const operate = {
-        cancel: () => this.props.onCancel(),
-        rest: () => this.props.onReset()
-      };
-      return operate[event.type]();
-    },
+	methods: {
+		onOperateTime(event) {
+			const operate = {
+				cancel: () => this.props.onCancel(),
+				rest: () => this.props.onReset(),
+			};
+			return operate[event.type]();
+		},
 
-    onConfirmTime(tempDate) {
-      const date = tempDate.map(item => item.replace(' :', ''));
-      this.props.onConfirm(date);
-      this.props.onCancel();
-    }
-
-  }
-});
+		onConfirmTime(tempDate) {
+			const date = tempDate.map((item) => item.replace(" :", ""));
+			this.props.onConfirm(date);
+			this.props.onCancel();
+		},
+	},
+});

+ 1 - 0
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/index.axml

@@ -18,6 +18,7 @@
       statusItems="{{ statusOptions }}"
       defaultName="{{ defaultName }}"
       defaultLabel="{{ defaultLabel }}"
+      showTimeSelector="{{ showTimeSelector }}"
     >
       <slot contentHeight="{{ contentHeight }}" />
     </entry-main>

+ 60 - 64
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/index.js

@@ -1,70 +1,66 @@
-import { getContentHeight } from '../../../utils';
+import { getContentHeight } from "../../../utils";
 const tabHeight = 44;
-const filterH = '88rpx';
+const filterH = "88rpx";
 Component({
-  props: {
-    className: '',
-    showAll: true,
-    hasFilter: true,
-    onFilter: () => null,
-    onAutoFilter: () => null,
-    showInpatient: true,
-    typeOptions: [{
-      value: 'normal',
-      label: '普通号'
-    }, {
-      value: 'expert',
-      label: '专家号'
-    }],
+	props: {
+		className: "",
+		showAll: true,
+		hasFilter: true,
+		onFilter: () => null,
+		onAutoFilter: () => null,
+		showInpatient: true,
+		showTimeSelector: true,
+		typeOptions: [
+			{
+				value: "normal",
+				label: "普通号",
+			},
+			{
+				value: "expert",
+				label: "专家号",
+			},
+		],
 
-    /* 就诊人Id */
-    patientId: '',
-    statusOptions: [],
-    defaultName: '全部类型'
-  },
-  data: {
-    filters: {
-      type: '',
-      cardNum: '',
-      endTime: '',
-      startTime: ''
-    },
-    contentHeight: `calc(${getContentHeight() - tabHeight}px - ${filterH})`
-  },
+		/* 就诊人Id */
+		patientId: "",
+		statusOptions: [],
+		defaultName: "全部类型",
+	},
+	data: {
+		filters: {
+			type: "检查报告",
+			cardNum: "",
+			endTime: "",
+			startTime: "",
+		},
+		contentHeight: `calc(${getContentHeight() - tabHeight}px - ${filterH})`,
+	},
 
-  didMount() {
-    if (!this.props.hasFilter) {
-      this.setData({
-        contentHeight: `${getContentHeight() - tabHeight}px`
-      });
-    }
-  },
+	didMount() {
+		if (!this.props.hasFilter) {
+			this.setData({
+				contentHeight: `${getContentHeight() - tabHeight}px`,
+			});
+		}
+	},
 
-  methods: {
-    onFilterChange(item) {
-      const {
-        filters
-      } = this.data;
-      const _filters = { ...filters,
-        ...item
-      };
-      this.props.onFilter(_filters);
-      this.setData({
-        filters: _filters
-      });
-    },
+	methods: {
+		onFilterChange(item) {
+			const { filters } = this.data;
+			const _filters = { ...filters, ...item };
+			this.props.onFilter(_filters);
+			this.setData({
+				filters: _filters,
+			});
+		},
 
-    onAutoFilterHandel(res) {
-      const {
-        bindCardNum = '',
-        medicCards = []
-      } = res;
-      this.setData({
-        'filters.cardNum': bindCardNum,
-        medicCards
-      });
-      this.props.onAutoFilter(res);
-    }
-
-  }
-});
+		onAutoFilterHandel(res) {
+			const { bindCardNum = "", medicCards = [] } = res;
+			this.setData({
+				"filters.cardNum": bindCardNum,
+				medicCards,
+			});
+			this.props.onAutoFilter(res);
+		},
+	},
+});

+ 1 - 0
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/main/index.axml

@@ -20,6 +20,7 @@
         statusList="{{ statusItems }}"
         defaultName="{{ defaultName }}"
         defaultLabel="{{ defaultLabel }}"
+        showTimeSelector="{{ showTimeSelector }}"
       />
     </view>
   </adc-tab>

+ 73 - 86
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/main/index.js

@@ -1,98 +1,85 @@
-import history from '../../../../utils/history';
+import history from "../../../../utils/history";
 
-const isEqual = (oldVal, curVal) => JSON.stringify(oldVal) === JSON.stringify(curVal);
+const isEqual = (oldVal, curVal) =>
+	JSON.stringify(oldVal) === JSON.stringify(curVal);
 
 Component({
-  props: {
-    filters: {},
-    patients: [],
-    patientId: '',
-    typeOptions: [],
-    hasFilter: true,
-    medicCards: [],
-    onChange: () => null,
-    onAutoFilter: () => null,
-    statusItems: [],
-    defaultName: '',
-    defaultLabel: ''
-  },
-  data: {
-    activeTab: 0
-  },
+	props: {
+		filters: {},
+		patients: [],
+		patientId: "",
+		typeOptions: [],
+		hasFilter: true,
+		medicCards: [],
+		onChange: () => null,
+		onAutoFilter: () => null,
+		statusItems: [],
+		defaultName: "",
+		defaultLabel: "",
+		showTimeSelector: true,
+	},
+	data: {
+		activeTab: 0,
+	},
 
-  didMount() {
-    this.autoActiveTab();
-  },
+	didMount() {
+		this.autoActiveTab();
+	},
 
-  didUpdate(preProps) {
-    /* 监听patientId */
-    const hasDiff = !isEqual(preProps.patients, this.props.patients);
+	didUpdate(preProps) {
+		/* 监听patientId */
+		const hasDiff = !isEqual(preProps.patients, this.props.patients);
 
-    if (preProps.patientId !== this.props.patientId || hasDiff) {
-      this.autoActiveTab();
-    }
-  },
+		if (preProps.patientId !== this.props.patientId || hasDiff) {
+			this.autoActiveTab();
+		}
+	},
 
-  methods: {
-    autoActiveTab() {
-      const {
-        patients,
-        patientId,
-        onAutoFilter
-      } = this.props;
+	methods: {
+		autoActiveTab() {
+			const { patients, patientId, onAutoFilter } = this.props;
+			if (patients.length > 0) {
+				const activeTab = patients.findIndex(
+					({ extData }) => extData.id === patientId
+				);
+				if (activeTab > -1)
+					this.setData({
+						activeTab,
+					});
+				const { extData } = patients[activeTab > -1 ? activeTab : 0];
+				onAutoFilter(extData);
+			}
+		},
 
-      if (patients.length > 0) {
-        const activeTab = patients.findIndex(({
-          extData
-        }) => extData.id === patientId);
-        if (activeTab > -1) this.setData({
-          activeTab
-        });
-        const {
-          extData
-        } = patients[activeTab > -1 ? activeTab : 0];
-        onAutoFilter(extData);
-      }
-    },
+		/* 切换就诊人 */
+		handleTabClick({ index, tabsName }) {
+			const activeTab = this.data[tabsName];
+			/* 这里防止重复点击 */
 
-    /* 切换就诊人 */
-    handleTabClick({
-      index,
-      tabsName
-    }) {
-      const activeTab = this.data[tabsName];
-      /* 这里防止重复点击 */
+			if (activeTab === index) return;
+			const { patients } = this.props;
+			const patient = patients[index];
+			const { extData, id } = patient;
+			this.props.onAutoFilter(extData); // const { medicCards = [] } = extData;
 
-      if (activeTab === index) return;
-      const {
-        patients
-      } = this.props;
-      const patient = patients[index];
-      const {
-        extData,
-        id
-      } = patient;
-      this.props.onAutoFilter(extData); // const { medicCards = [] } = extData;
+			this.props.onChange({
+				cardNum: id,
+			});
+			this.setData({
+				[tabsName]: index,
+			});
+		},
 
-      this.props.onChange({
-        cardNum: id
-      });
-      this.setData({
-        [tabsName]: index
-      });
-    },
+		/* 切换筛选项 */
+		onFilterChange(filter) {
+			this.props.onChange(filter);
+		},
 
-    /* 切换筛选项 */
-    onFilterChange(filter) {
-      this.props.onChange(filter);
-    },
-
-    handlePlusClick() {
-      history.push({
-        title: '添加就诊人',
-        pageType: 'edit-patient'
-      });
-    }
-
-  }
-});
+		handlePlusClick() {
+			history.push({
+				title: "添加就诊人",
+				pageType: "edit-patient",
+			});
+		},
+	},
+});

+ 73 - 73
antbuilder/industry/hospitalV2/components/components/patient-tabs/index.js

@@ -1,82 +1,82 @@
-import { getPatientList } from '../../../service/common';
-import history from '../../../utils/history';
+import { getPatientList } from "../../../service/common";
+import history from "../../../utils/history";
 Component({
-  props: {
-    onChange() {},
+	props: {
+		onChange() {},
 
-    showAll: false
-  },
-  data: {
-    checkIndex: 0,
-    patientList: []
-  },
+		showAll: false,
+	},
+	data: {
+		checkIndex: 0,
+		patientList: [],
+	},
 
-  didMount() {
-    this.getPatientList();
-  },
+	didMount() {
+		this.getPatientList();
+	},
 
-  methods: {
-    // getPatientList
-    getPatientList() {
-      getPatientList({
-        type: 9,
-        authCode: 9
-      }).then(list => {
-        let {
-          checkIndex
-        } = this.data;
+	methods: {
+		// getPatientList
+		getPatientList() {
+			getPatientList({
+				type: 9,
+				authCode: 9,
+			}).then((list) => {
+				let { checkIndex } = this.data;
+				if (list.length === 1) {
+					checkIndex = 0;
+				} else if (this.props.showAll) {
+					checkIndex = -1;
+				}
 
-        if (list.length === 1) {
-          checkIndex = 0;
-        } else if (this.props.showAll) {
-          checkIndex = -1;
-        }
+				this.setData({
+					checkIndex,
+					patientList: list,
+				});
+				this.onSelected(
+					{
+						target: {
+							dataset: {
+								index: checkIndex,
+								type: checkIndex === -1 ? "all" : "",
+							},
+						},
+					},
+					"init"
+				);
+			});
+		},
 
-        this.setData({
-          checkIndex,
-          patientList: list
-        });
-        this.onSelected({
-          target: {
-            dataset: {
-              index: checkIndex,
-              type: checkIndex === -1 ? 'all' : ''
-            }
-          }
-        }, 'init');
-      });
-    },
+		// 添加就诊人
+		addPatient() {
+			history.push({
+				title: "添加就诊人",
+				pageType: "edit-patient",
+			});
+		},
 
-    // 添加就诊人
-    addPatient() {
-      history.push({
-        title: '添加就诊人',
-        pageType: 'edit-patient'
-      });
-    },
+		// 选中就诊人
+		onSelected(e, mode = "change") {
+			const { index, type } = e.target.dataset;
 
-    // 选中就诊人
-    onSelected(e, mode = 'change') {
-      const {
-        index,
-        type
-      } = e.target.dataset;
+			if (type === "all") {
+				this.setData({
+					checkIndex: index,
+				});
+				this.props.onChange(this.data.patientList, mode);
+				return;
+			}
 
-      if (type === 'all') {
-        this.setData({
-          checkIndex: index
-        });
-        this.props.onChange(this.data.patientList, mode);
-        return;
-      }
-
-      if (index > -1) {
-        this.setData({
-          checkIndex: index
-        });
-        typeof this.props.onChange === 'function' && this.props.onChange(this.data.patientList.slice(index, index + 1), mode);
-      }
-    }
-
-  }
-});
+			if (index > -1) {
+				this.setData({
+					checkIndex: index,
+				});
+				typeof this.props.onChange === "function" &&
+					this.props.onChange(
+						this.data.patientList.slice(index, index + 1),
+						mode
+					);
+			}
+		},
+	},
+});

+ 1 - 7
antbuilder/industry/hospitalV2/components/edit-patient/index.js

@@ -297,11 +297,9 @@ Component(
 
 				const form = this.restForm(editForm);
 				/* 不是编辑的情况,才需要选择就诊卡 */
-
 				if (!editForm.id && !this.isEditCard()) {
 					form.bindCardNum = await this.onCheckCard(form);
 				}
-
 				await this.onSubmit(this.initData(form));
 			},
 
@@ -321,8 +319,6 @@ Component(
 					my.showLoading();
 					const isEditCard = this.isEditCard();
 					/* 如果有id 或者绑定的卡id为编辑 */
-					console.log("isEditCard ===>", isEditCard);
-					console.log("11111 ===>", form.id, form.cardNum);
 					if (form.id || form.cardNum) {
 						if (isEditCard) {
 							msg = "就诊卡编辑成功";
@@ -338,14 +334,11 @@ Component(
 						msg = "就诊人添加成功";
 						await createPatient(form);
 					}
-					console.log("22222 ===>");
-
 					this.goNav(routeState);
 					this.showSuccess(msg);
 				} catch (e) {
 					this.showError(e.msg);
 				}
-
 				my.hideLoading();
 			},
 
@@ -379,6 +372,7 @@ Component(
 
 					my.hideLoading();
 					this.resolveFn = resolve;
+					console.log("medicCardsList ===>", medicCardsList);
 					this.setData({
 						show: true,
 						medicCardsList,

+ 2 - 1
antbuilder/industry/hospitalV2/components/patient-detail/index.axml

@@ -24,7 +24,8 @@
         </view>
         <view class="patient-d-flex">
           <view>{{ item.cardNum }}</view>
-          <view class="patient-d-btn" onTap="onPayment" data-id="{{ patient.id }}" data-cardNum="{{ item.cardNum }}">充值</view>
+          <!-- 隐藏充值 -->
+          <!-- <view class="patient-d-btn" onTap="onPayment" data-id="{{ patient.id }}" data-cardNum="{{ item.cardNum }}">充值</view> -->
         </view>
       </view>
 

+ 4 - 0
antbuilder/industry/hospitalV2/components/report-list/index.axml

@@ -1,6 +1,10 @@
 <patient-tabs-pro
   onFilter="onFilterHandel"
   typeOptions="{{ typeOptions }}"
+  defaultName="{{ defaultName }}"
+  showAll="{{ showAll }}"
+  onAutoFilter="onAutoFilter"
+  showTimeSelector="{{ showTimeSelector }}"
 >
   <scroll-fetch
     ref="saveRef"

+ 14 - 0
antbuilder/industry/hospitalV2/components/report-list/index.js

@@ -15,6 +15,9 @@ Component({
 				label: "检验报告",
 			},
 		],
+		defaultName: "检查报告",
+		showAll: false,
+		showTimeSelector: false,
 	},
 
 	didMount() {
@@ -36,7 +39,18 @@ Component({
 
 		/* 分页逻辑 */
 		async onService(params) {
+			if (!this.filters) return;
 			return services.getReportList({ ...this.filters, ...params });
 		},
+
+		onAutoFilter(patient) {
+			if (!this.filters && patient) {
+				this.filters = {
+					type: "检查报告",
+					cardNum: patient.medicCards[0].cardNum,
+				};
+				this.flatRef.refresh();
+			}
+		},
 	},
 });

+ 50 - 50
antbuilder/industry/hospitalV2/service/common.js

@@ -2,90 +2,90 @@
  * @author Jacker
  * @date 2021-07-20 17:50
  */
-import request from './request';
+import request from "./request";
 /* 获取就诊卡列表 */
 
-export const getCardList = params => {
-  const url = '/isvRequest.medicCard.queryList';
-  return request.post(url, params);
+export const getCardList = (params) => {
+	const url = "/isvRequest.medicCard.queryList";
+	return request.post(url, params);
 }; // 预约详情
 
 export function getBookingDetail(params) {
-  const url = '/getBookingDetail';
-  return request.post(url, params);
+	const url = "/getBookingDetail";
+	return request.post(url, params);
 }
 /* 获取就诊人列表 */
 
-export const getPatientList = params => {
-  const url = '/isvRequest.patient.queryList';
-  return request.post(url, params);
+export const getPatientList = (params) => {
+	const url = "/isvRequest.patient.queryList";
+	return request.post(url, params);
 };
 /* 获取支付订单号, 挂号、充值类 */
 
-export const tradeNoQuery = params => {
-  const url = '/miniProRequest.pay.tradeNoQuery';
-  return request.post(url, params);
+export const tradeNoQuery = (params) => {
+	const url = "/miniProRequest.pay.tradeNoQuery";
+	return request.post(url, params);
 };
 /* 检查时间列表 */
 
-export const getTestTimeList = params => {
-  const url = '/isvRequest.nucleic.testTimeList';
-  return request.post(url, params);
+export const getTestTimeList = (params) => {
+	const url = "/isvRequest.nucleic.testTimeList";
+	return request.post(url, params);
 };
 /* 检查时间列表 */
 
-export const getQuestionnaire = params => {
-  const url = '/isvRequest.nucleic.questionnaire';
-  return request.post(url, params);
+export const getQuestionnaire = (params) => {
+	const url = "/isvRequest.nucleic.questionnaire";
+	return request.post(url, params);
 };
 /* 检查时间列表 */
 
-export const getItemList = params => {
-  const url = '/isvRequest.nucleic.itemList';
-  return request.post(url, params);
+export const getItemList = (params) => {
+	const url = "/isvRequest.nucleic.itemList";
+	return request.post(url, params);
 };
 /* 检查时间列表 */
 
-export const nucleicOrderConfirm = params => {
-  const url = '/isvRequest.nucleic.orderConfirm';
-  return request.post(url, params);
+export const nucleicOrderConfirm = (params) => {
+	const url = "/isvRequest.nucleic.orderConfirm";
+	return request.post(url, params);
 };
-export const questionnaireResult = params => {
-  const url = '/isvRequest.nucleic.questionnaireResult';
-  return request.post(url, params);
+export const questionnaireResult = (params) => {
+	const url = "/isvRequest.nucleic.questionnaireResult";
+	return request.post(url, params);
 };
 /*
-* 通过服务码查询服务信息
-* @para code string
-* */
+ * 通过服务码查询服务信息
+ * @para code string
+ * */
 
-export const queryServiceByCode = code => {
-  const url = '/api/v1/service/queryByCode';
-  return request.get(url, {
-    code
-  });
+export const queryServiceByCode = (code) => {
+	const url = "/api/v1/service/queryByCode";
+	return request.get(url, {
+		code,
+	});
 };
 /*
-* 消息通知授权
-* */
+ * 消息通知授权
+ * */
 
 export const noticeAuth = () => {
-  const url = '/isvRequest.other.noticeAuth';
-  return request.post(url);
+	const url = "/isvRequest.other.noticeAuth";
+	return request.post(url);
 };
 /*
-* 商家支付订单号获取
-* */
+ * 商家支付订单号获取
+ * */
 
-export const tradeNoForOrder = data => {
-  const url = '/miniProRequest.pay.tradeNoForOrder';
-  return request.post(url, data);
+export const tradeNoForOrder = (data) => {
+	const url = "/miniProRequest.pay.tradeNoForOrder";
+	return request.post(url, data);
 };
 /*
-* 支付结果通知
-* */
+ * 支付结果通知
+ * */
 
-export const tradeResult = data => {
-  const url = '/miniProRequest.pay.tradeResult';
-  return request.post(url, data);
-};
+export const tradeResult = (data) => {
+	const url = "/miniProRequest.pay.tradeResult";
+	return request.post(url, data);
+};