Browse Source

Merge branch 'dev' of http://gogs.ywtinfo.com/chenjunkun/th_net_hospital_ali_mp into dev

liweimin 2 years ago
parent
commit
482977bac3
26 changed files with 535 additions and 394 deletions
  1. 10 0
      antbuilder/core/utils/ywtService.js
  2. 35 13
      antbuilder/industry/hospitalV2/components/components/order-session/index.js
  3. 3 3
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/filter-content/index.axml
  4. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/filter-content/index.js
  5. 3 1
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/index.axml
  6. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/index.js
  7. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/mask-option/index.axml
  8. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/filters/mask-option/index.js
  9. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/index.axml
  10. 3 1
      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. 1 0
      antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/main/index.js
  13. 1 1
      antbuilder/industry/hospitalV2/components/deposit/index.axml
  14. 2 1
      antbuilder/industry/hospitalV2/components/deposit/index.js
  15. 42 2
      antbuilder/industry/hospitalV2/components/hospital-num-source/num-item/index.js
  16. 18 17
      antbuilder/industry/hospitalV2/components/hospital-num-source/service.js
  17. 65 70
      antbuilder/industry/hospitalV2/components/hospital-num-source/time-range/index.js
  18. 3 0
      antbuilder/industry/hospitalV2/components/hospital-payment/index.axml
  19. 119 118
      antbuilder/industry/hospitalV2/components/hospital-payment/index.js
  20. 0 1
      antbuilder/industry/hospitalV2/components/inpatient-tabs/index.js
  21. 1 1
      antbuilder/industry/hospitalV2/components/inventory-day/index.axml
  22. 145 124
      antbuilder/industry/hospitalV2/components/order-pay/index.js
  23. 2 2
      antbuilder/industry/hospitalV2/components/report-details-list/reportDetailsList.axml
  24. 3 0
      antbuilder/industry/hospitalV2/components/report-list/index.js
  25. 7 1
      antbuilder/industry/hospitalV2/components/select-department/index.js
  26. 66 38
      antbuilder/industry/hospitalV2/utils/index.js

+ 10 - 0
antbuilder/core/utils/ywtService.js

@@ -9,3 +9,13 @@ export async function ywtAuth(data) {
 	if (err || !res) return [err, null];
 	return [null, res];
 }
+
+export async function doctorSchedule(data) {
+	const [err, res] = await ywtRequest({
+		url: "/register/doctorSchedule",
+		method: "post",
+		data,
+	});
+	if (err || !res) return [err, null];
+	return [null, res];
+}

+ 35 - 13
antbuilder/industry/hospitalV2/components/components/order-session/index.js

@@ -31,19 +31,15 @@ Component({
 		filterItems(items, list) {
 			list.forEach((order) => {
 				/* 时间段以开始时间为准 */
-				let { endTime, startTime, serviceDate } = order;
-				endTime = restDate(endTime);
-				startTime = restDate(startTime);
-				const { time: eTime } = utils.cuttingDate(endTime);
-				const { type, time: sTime } = utils.cuttingDate(startTime);
+				let { serviceDate, datePeriod } = order;
+				const type = utils.selectDate(datePeriod);
 				const row = items[type];
 
 				if (!row.date) {
 					row.week = utils.getWeek(serviceDate);
 					row.date = serviceDate;
 				}
-
-				row.list.push({ ...order, sTime, eTime });
+				row.list.push({ ...order });
 			});
 			return items;
 		},
@@ -56,17 +52,23 @@ Component({
 					am: getTimeItem("上午"),
 					pm: getTimeItem("下午"),
 					mm: getTimeItem("午间"),
+					nm: getTimeItem("夜间"),
+					mnm: getTimeItem("下半夜"),
 				},
 				orderSources
 			);
 			const { length: amLength } = items.am.list;
 			const { length: pmLength } = items.pm.list;
 			const { length: mmLength } = items.mm.list;
+			const { length: nmLength } = items.nm.list;
+			const { length: mnmLength } = items.mnm.list;
 			/* 获取上午或者下午的最小价格 */
 
 			items.am.min = this.getMinCost(items.am.list);
 			items.pm.min = this.getMinCost(items.pm.list);
 			items.mm.min = this.getMinCost(items.mm.list);
+			items.nm.min = this.getMinCost(items.nm.list);
+			items.mnm.min = this.getMinCost(items.mnm.list);
 
 			if (amLength <= 0) {
 				delete items.am;
@@ -88,24 +90,44 @@ Component({
 				/* 获取下午的剩余挂号数 */
 				items.mm.remain = this.countRemain(items.mm.list);
 			}
+
+			if (nmLength <= 0) {
+				delete items.nm;
+			} else {
+				/* 获取下午的剩余挂号数 */
+				items.nm.remain = this.countRemain(items.nm.list);
+			}
+
+			if (mnmLength <= 0) {
+				delete items.mnm;
+			} else {
+				/* 获取下午的剩余挂号数 */
+				items.mnm.remain = this.countRemain(items.mnm.list);
+			}
 			/* 同时存在上午和下午 */
-			if (items.am && items.pm && items.mm) {
-				const { am, pm, mm } = items;
+			if (items.am && items.pm && items.mm && items.nm && items.mnm) {
+				const { am, pm, mm, nm, mnm } = items;
 				/* 如果上午跟下午的最小价格相等,那么就为全天 */
 
-				if ((am.min === pm.min) === mm.min) {
+				if ((((am.min === pm.min) === mm.min) === nm.min) === mnm.min) {
 					items.all = {
 						...am,
 						name: "全天",
-						remain: items.am.remain + items.pm.remain + items.mm.remain,
-						list: [...am.list, ...pm.list, ...mm.list],
+						remain:
+							items.am.remain +
+							items.pm.remain +
+							items.mm.remain +
+							items.nm.remain +
+							items.mnm.remain,
+						list: [...am.list, ...pm.list, ...mm.list, ...nm.list, ...mnm.list],
 					};
 					delete items.am;
 					delete items.pm;
 					delete items.mm;
+					delete items.nm;
+					delete items.mnm;
 				}
 			}
-
 			return Object.values(items);
 		},
 

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

@@ -1,18 +1,18 @@
 <import-sjs name="utils" from="./index.sjs"/>
 <view class="filter-items">
-  <view a:if="{{ showTimeSelector }}" class="filter-item{{ showTime ? ' open' : ''}}" onTap="onTimeTapHandel">
+  <view  class="filter-item{{ showTime ? ' open' : ''}}" onTap="onTimeTapHandel" a:if="{{ showTimeSelector }}">
     <view class="filter-value">
       {{ utils.getTime(timeStart.replace(/-/g, '.'), timeEnd.replace(/-/g, '.'))}}
     </view>
   </view>
-  <view class="filter-item{{ showOption ? ' open' : ''}}" onTap="onTypeTapHandel">
+  <view  class="filter-item{{ showOption ? ' open' : ''}}" onTap="onTypeTapHandel" a:if="{{ items.length }}">
     <view class="filter-value">
       {{ utils.getTypeName(items, type, defaultName) }}
     </view>
   </view>
   <view class="filter-item{{ showStatus ? ' open' : ''}}" onTap="onStatusTapHandel" a:if="{{ statusItems.length }}">
      <view class="filter-value">
-       {{ utils.getTypeName(statusItems, status, '全部状态') }}
+       {{ utils.getTypeName(statusItems, status, defaultStatus || '全部状态') }}
      </view>
   </view>
   <view class="filter-item{{ showCard ? ' open' : ' '}} {{ cardNum ? '' : ' hide'}}" onTap="onCardTapHandel">

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

@@ -11,6 +11,7 @@ Component({
 		onCardTap: () => null,
 		onStatusTap: () => null,
 		statusItems: [],
+		defaultStatus: "",
 		defaultName: "",
 		showTimeSelector: true,
 	},

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

@@ -17,6 +17,7 @@
     showStatus="{{ showStatus }}"
     defaultName="{{ defaultName }}"
     showTimeSelector="{{ showTimeSelector }}"
+    defaultStatus="{{ defaultStatus }}"
   />
   <time-option
     onCancel="onCancelTime"
@@ -44,7 +45,7 @@
     value="{{ status }}"
     type="{{ type }}"
     status="{{ status }}"
-    defaultLabel="全部状态"
+    defaultLabel="{{ defaultLabel || '全部状态'}}"
     onClose="onCloseStatusMask"
     options="{{ options }}"
     showStatus="{{ showStatus }}"
@@ -54,6 +55,7 @@
     cardNum="{{ filters.cardNum }}"
     statusItems="{{ statusList }}"
     showTimeSelector="{{ showTimeSelector }}"
+    defaultStatus="{{ defaultStatus }}"
   />
   <select-card
     show="{{ showCard || false }}"

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

@@ -16,6 +16,7 @@ Component({
 		statusList: [],
 		defaultName: "",
 		defaultLabel: "",
+		defaultStatus: "",
 		showTimeSelector: true,
 	},
 	data: {},

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

@@ -16,6 +16,7 @@
       statusItems="{{ statusItems }}"
       defaultName="{{ defaultName }}"
       showTimeSelector="{{ showTimeSelector }}"
+      defaultStatus="{{ defaultStatus }}"
     />
     <view class="options">
       <!-- 屏蔽全部类型,暂时根据 showTimeSelector 进行判断,后续可以细分 -->

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

@@ -14,6 +14,7 @@ Component({
 		showStatus: false,
 		defaultLabel: "",
 		defaultName: "",
+		defaultStatus: "",
 		showTimeSelector: true,
 	},
 	data: {

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

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

+ 3 - 1
antbuilder/industry/hospitalV2/components/components/patient-tabs-pro/index.js

@@ -25,10 +25,12 @@ Component({
 		patientId: "",
 		statusOptions: [],
 		defaultName: "全部类型",
+		defaultStatus: "",
 	},
 	data: {
 		filters: {
-			type: "检查报告",
+			// type: "检查报告",
+			type: "",
 			cardNum: "",
 			endTime: "",
 			startTime: "",

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

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

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

@@ -16,6 +16,7 @@ Component({
 		statusItems: [],
 		defaultName: "",
 		defaultLabel: "",
+		defaultStatus: "",
 		showTimeSelector: true,
 	},
 	data: {

+ 1 - 1
antbuilder/industry/hospitalV2/components/deposit/index.axml

@@ -4,7 +4,7 @@
     <view>
       <view class="person-name">{{jsonData.Inpatient.inpatientName}}</view>
       <view class="person-info" a:if="{{jsonData.Inpatient}}">
-        {{jsonData.Inpatient.sex ? jsonData.Inpatient.sex + ',' : ''}}{{jsonData.Inpatient.inpatientAge ? jsonData.Inpatient.inpatientAge + ',' : ''}}{{jsonData.Inpatient.inpatientId ? jsonData.Inpatient.inpatientId : ''}}
+        {{jsonData.Inpatient.sex ? jsonData.Inpatient.sex + ',' : ''}}{{jsonData.Inpatient.inpatientAge ? jsonData.Inpatient.inpatientAge + ',' : ''}}{{jsonData.Inpatient.inpatientId ? jsonData.Inpatient.inpatientId : ''}}
       </view>
       <view class="person-balance" a:if="{{jsonData.Inpatient.depositBalance}}">
         押金余额:¥{{jsonData.Inpatient.depositBalance}}

+ 2 - 1
antbuilder/industry/hospitalV2/components/deposit/index.js

@@ -232,7 +232,6 @@ Component({
 		// 支付弹窗
 		async setTrade() {
 			const { money, inpatientId, jsonData } = this.data;
-			console.log("this.data", this.data);
 			try {
 				if (money) {
 					const {
@@ -275,6 +274,8 @@ Component({
 											color: "#000",
 											backBtnColor: "#000",
 											background: "#fff",
+											inpatientId,
+											hisPatientId: inpatientId,
 										},
 										title: "押金缴纳详情",
 										pageType: "pay-result",

+ 42 - 2
antbuilder/industry/hospitalV2/components/hospital-num-source/num-item/index.js

@@ -1,7 +1,15 @@
 import { connect } from "herculex";
 import history from "../../../utils/history";
+import { doctorSchedule } from "../../../../../core/utils/ywtService";
 /* 默认头像 */
-
+const datePeriodMap = {
+	全天: 1,
+	上午: 2,
+	下午: 3,
+	夜间: 4,
+	下半夜: 5,
+	午间: 6,
+};
 const defaultUrl =
 	"https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*TuMaTaHOpyUAAAAAAAAAAAAAARQnAQ";
 Component(
@@ -27,6 +35,11 @@ Component(
 		didMount() {},
 
 		methods: {
+			getQuery() {
+				const { $routeConfig } = this.$page;
+				return $routeConfig.query;
+			},
+
 			onPopupClose() {
 				this.props.onClose();
 			},
@@ -64,9 +77,11 @@ Component(
 				});
 			},
 
+			// 点击预约进行弹窗时间段选择
 			async onItemFollow({ target }) {
 				const { item } = target.dataset;
-				console.log("onItemFollow ===>", item);
+				const cost = item.list[0].cost || "0";
+				const { hospitalId } = this.getQuery();
 				if (!this.checkRemain(item)) return;
 				const { rangeItem } = this.data;
 				const { componentData } = this.props;
@@ -76,6 +91,8 @@ Component(
 					doctorId,
 					onlinePay = false,
 					name: doctorName,
+					doctorCode,
+					deptCode,
 				} = this.props.item;
 				const { area, department } = params;
 				const { name: districtName } = area;
@@ -93,6 +110,29 @@ Component(
 					title: "挂号确认",
 					pageType: "order-pay",
 				};
+				let newList = [];
+				let finalList = [];
+				const [result] = await doctorSchedule({
+					hospitalId: Number(hospitalId),
+					deptCode,
+					doctorCode,
+					serviceDate: item.date,
+					period: datePeriodMap[item.name],
+				});
+				if (result && result.data) {
+					newList = result.data[0].schedule || [];
+					finalList = newList.map((items) => {
+						const { startTime, endTime, availableLeftNum } = items;
+						return Object.assign(items, {
+							sTime: startTime,
+							eTime: endTime,
+							remain: availableLeftNum,
+							cost,
+							serviceDate: item.date,
+						});
+					});
+				}
+				item.list = finalList;
 				this.setData({
 					showRange: true,
 					rangeItem: item,

+ 18 - 17
antbuilder/industry/hospitalV2/components/hospital-num-source/service.js

@@ -1,22 +1,23 @@
-import request from '../../service/request';
+import request from "../../service/request";
+
 /*
-* 获取科室下面的号码列表
-* @param depId string 科室id
-* */
+ * 获取科室下面的号码列表
+ * @param depId string 科室id
+ * */
 
-export const getDepOrderSourceRemain = params => {
-  const url = '/isvRequest.order.depOrderSourceRemain';
-  return request.post(url, params);
+export const getDepOrderSourceRemain = (params) => {
+	const url = "/isvRequest.order.depOrderSourceRemain";
+	return request.post(url, params);
 };
 /*
-* 获取医生列表
-* @param depId String 科室id
-* @param date String查询日期
-* @param pageIndex页码
-* @param pageSize 页条数
-* */
+ * 获取医生列表
+ * @param depId String 科室id
+ * @param date String查询日期
+ * @param pageIndex页码
+ * @param pageSize 页条数
+ * */
 
-export const getDepDoctorList = params => {
-  const url = '/isvRequest.order.depDoctorList';
-  return request.post(url, params);
-};
+export const getDepDoctorList = (params) => {
+	const url = "/isvRequest.order.depDoctorList";
+	return request.post(url, params);
+};

+ 65 - 70
antbuilder/industry/hospitalV2/components/hospital-num-source/time-range/index.js

@@ -1,77 +1,72 @@
-import history from '../../../utils/history';
-import { getPatientList } from '../../../service/common';
+import history from "../../../utils/history";
+import { getPatientList } from "../../../service/common";
 Component({
-  props: {
-    params: {},
-    rangeItem: {},
-    show: false,
-    onClose: () => null,
-    onItemChange: () => null
-  },
-  data: {},
-  methods: {
-    onPopupClose() {
-      this.props.onClose();
-    },
+	props: {
+		params: {},
+		rangeItem: {},
+		show: false,
+		onClose: () => null,
+		onItemChange: () => null,
+	},
+	data: {},
+	methods: {
+		onPopupClose() {
+			this.props.onClose();
+		},
 
-    async onItemTap({
-      target
-    }) {
-      const {
-        params
-      } = this.props;
-      const {
-        item
-      } = target.dataset;
-      const {
-        cost,
-        orderNo,
-        startTime,
-        orderSourceId,
-        onlinePay
-      } = item;
-      const routeState = { ...params,
-        query: { ...params.query,
-          onlinePay,
-          startTime,
-          orderSourceId,
-          amount: cost,
-          queueNum: orderNo
-        }
-      };
-      this.onPopupClose(); // this.props.onItemChange(dataset.item);
+		async onItemTap({ target }) {
+			const { params } = this.props;
+			const { item } = target.dataset;
+			const {
+				cost,
+				orderNo,
+				startTime,
+				orderSourceId,
+				scheduleItemCode,
+				onlinePay,
+				serviceDate,
+			} = item;
+			const routeState = {
+				...params,
+				query: {
+					...params.query,
+					onlinePay,
+					startTime: serviceDate + " " + startTime,
+					orderSourceId: scheduleItemCode,
+					amount: cost,
+					queueNum: orderNo,
+				},
+			};
+			// return;
+			this.onPopupClose(); // this.props.onItemChange(dataset.item);
+			/* 检查是不是有就诊人,没有就诊人跳转添加就诊人页面 */
 
-      /* 检查是不是有就诊人,没有就诊人跳转添加就诊人页面 */
+			const hasPatient = await this.checkPerson(routeState);
+			if (!hasPatient) return;
+			history.push(routeState);
+		},
 
-      const hasPatient = await this.checkPerson(routeState);
-      if (!hasPatient) return;
-      history.push(routeState);
-    },
+		/* 检查是否有就诊人 */
+		async checkPerson(routeState) {
+			const patientList = await getPatientList();
+			/* 如果没有就诊人, 去添加就诊人 */
 
-    /* 检查是否有就诊人 */
-    async checkPerson(routeState) {
-      const patientList = await getPatientList();
-      /* 如果没有就诊人, 去添加就诊人 */
+			if (!patientList.length) {
+				return this.toPatient(routeState);
+			}
 
-      if (!patientList.length) {
-        return this.toPatient(routeState);
-      }
+			return true;
+		},
 
-      return true;
-    },
-
-    toPatient(routeState) {
-      history.push({
-        title: '添加就诊人',
-        pageType: 'edit-patient',
-        componentData: {
-          routeState: { ...routeState,
-            routeType: 'replace'
-          }
-        }
-      });
-      return false;
-    }
-
-  }
-});
+		toPatient(routeState) {
+			history.push({
+				title: "添加就诊人",
+				pageType: "edit-patient",
+				componentData: {
+					routeState: { ...routeState, routeType: "replace" },
+				},
+			});
+			return false;
+		},
+	},
+});

+ 3 - 0
antbuilder/industry/hospitalV2/components/hospital-payment/index.axml

@@ -3,6 +3,9 @@
   onFilter="onFilterHandel"
   typeOptions="{{ typeOptions}}"
   statusOptions="{{ statusOptions }}"
+  showAll="{{ showAll }}"
+  showTimeSelector="{{ showTimeSelector }}"
+  defaultStatus="{{ defaultStatus }}"
 >
   <scroll-fetch
     ref="saveRef"

+ 119 - 118
antbuilder/industry/hospitalV2/components/hospital-payment/index.js

@@ -1,131 +1,132 @@
-import { payHistory } from './service';
-import history from '../../utils/history';
-import { tradePay } from '../../utils/tradePay';
-import { reportCmPV_YL } from '../../utils/cloudMonitorHelper';
+import { payHistory } from "./service";
+import history from "../../utils/history";
+import { tradePay } from "../../utils/tradePay";
+import { reportCmPV_YL } from "../../utils/cloudMonitorHelper";
 Component({
-  props: {},
-  data: {
-    empty: true,
-    clinicCard: {},
-    filterParams: {
-      type: '9',
-      cardNum: '',
-      endTime: '',
-      startTime: '',
-      medicCards: []
-    },
+	props: {},
+	data: {
+		empty: true,
+		clinicCard: {},
+		filterParams: {
+			type: "9",
+			cardNum: "",
+			endTime: "",
+			startTime: "",
+			medicCards: [],
+		},
 
-    /* 赛选项目 */
-    typeOptions: [{
-      value: '1',
-      label: '挂号订单'
-    }, {
-      value: '2',
-      label: '充值订单'
-    }, {
-      value: '3',
-      label: '诊间订单'
-    }],
-    statusOptions: [{
-      value: '0',
-      label: '待支付'
-    }, {
-      value: '1',
-      label: '已支付'
-    }, {
-      value: '9',
-      label: '已取消'
-    }]
-  },
+		/* 赛选项目 */
+		typeOptions: [],
+		statusOptions: [
+			{
+				value: "0",
+				label: "待支付",
+			},
+			{
+				value: "1",
+				label: "已支付",
+			},
+		],
+		showAll: false,
+		showTimeSelector: false,
+		defaultLabel: "待支付",
+		defaultName: "待支付",
+		defaultStatus: "待支付",
+	},
 
-  didMount() {
-    /* 服务预警,缴费记录查询 */
-    reportCmPV_YL({
-      title: '缴费记录查询'
-    });
-  },
+	didMount() {
+		/* 服务预警,缴费记录查询 */
+		reportCmPV_YL({
+			title: "缴费记录查询",
+		});
+	},
 
-  methods: {
-    onFilterHandel(filters) {
-      this.filters = filters;
-      this.scrollRef.refresh();
-    },
+	methods: {
+		onFilterHandel(filters) {
+			this.filters = filters;
+			this.scrollRef.refresh();
+		},
 
-    saveRef(ref) {
-      this.scrollRef = ref;
-    },
+		saveRef(ref) {
+			this.scrollRef = ref;
+		},
 
-    saveSubscribe(ref) {
-      this.subscribe = ref;
-    },
+		saveSubscribe(ref) {
+			this.subscribe = ref;
+		},
 
-    onService(page) {
-      const {
-        type
-      } = this.filters || {};
-      return payHistory({ ...this.filters,
-        type: type || '9',
-        ...page
-      });
-    },
+		onService(page) {
+			const { type, status } = this.filters || {};
 
-    // 进入详情
-    toDetail(e) {
-      history.push({
-        title: '缴费详情',
-        query: e.target.dataset,
-        pageType: 'hospital-payment-detail'
-      });
-    },
+			return payHistory({
+				...this.filters,
+				type: type || "9",
+				status: status || "0",
+				...page,
+			});
+		},
 
-    // 付款
-    async onPayment(e) {
-      const {
-        medicareBinded = false,
-        item
-      } = e.target.dataset; // 同意订阅消息后发起支付
-      // 挂号
+		// 进入详情
+		toDetail(e) {
+			history.push({
+				title: "缴费详情",
+				query: e.target.dataset,
+				pageType: "hospital-payment-detail",
+			});
+		},
 
-      if (item.type === 1) {
-        await tradePay({
-          type: item.type,
-          idNum: item.outTradeNo,
-          depName: item.depName
-        }, {
-          tradeType: 'Appointment'
-        });
-      } else if (item.type === 2) {
-        // 充值
-        await tradePay({
-          type: item.type,
-          idNum: item.outTradeNo,
-          amount: item.amount
-        }, {
-          tradeType: 'Appointment'
-        });
-      } else {
-        // 门诊订单
-        await tradePay({
-          useBalance: !medicareBinded,
-          useMedicare: medicareBinded,
-          outTradeNo: item.outTradeNo
-        }, {
-          tradeType: 'Outpatient'
-        });
-      } // 支付成功去订单详情页
+		// 付款
+		async onPayment(e) {
+			const { medicareBinded = false, item } = e.target.dataset; // 同意订阅消息后发起支付
+			// 挂号
 
+			if (item.type === 1) {
+				await tradePay(
+					{
+						type: item.type,
+						idNum: item.outTradeNo,
+						depName: item.depName,
+					},
+					{
+						tradeType: "Appointment",
+					}
+				);
+			} else if (item.type === 2) {
+				// 充值
+				await tradePay(
+					{
+						type: item.type,
+						idNum: item.outTradeNo,
+						amount: item.amount,
+					},
+					{
+						tradeType: "Appointment",
+					}
+				);
+			} else {
+				// 门诊订单
+				await tradePay(
+					{
+						useBalance: !medicareBinded,
+						useMedicare: medicareBinded,
+						outTradeNo: item.outTradeNo,
+					},
+					{
+						tradeType: "Outpatient",
+					}
+				);
+			} // 支付成功去订单详情页
 
-      this.toDetail({
-        target: {
-          dataset: {
-            outTradeNo: item.outTradeNo,
-            type: item.type
-          }
-        }
-      }); // 发起消息订阅
+			this.toDetail({
+				target: {
+					dataset: {
+						outTradeNo: item.outTradeNo,
+						type: item.type,
+					},
+				},
+			}); // 发起消息订阅
 
-      this.subscribe.subscribeMessage();
-    }
-
-  }
-});
+			this.subscribe.subscribeMessage();
+		},
+	},
+});

+ 0 - 1
antbuilder/industry/hospitalV2/components/inpatient-tabs/index.js

@@ -106,7 +106,6 @@ Component({
 		// 跳转日清单查询
 		toDailyBill(e) {
 			const { inpatientId, checkInDate } = e.target.dataset.item;
-			console.log("inpatientId,checkInDate", inpatientId, checkInDate);
 			history.push({
 				query: {
 					inpatientId,

+ 1 - 1
antbuilder/industry/hospitalV2/components/inventory-day/index.axml

@@ -8,7 +8,7 @@
       <view class="person-change" onTap="onAdmissionRegistration">切换住院人</view>
     </view>
     <view class="person-info" a:if="{{jsonData.Inpatient}}">
-      {{jsonData.Inpatient.sex ? jsonData.Inpatient.sex + ',' : ''}}{{jsonData.Inpatient.inpatientAge ? jsonData.Inpatient.inpatientAge + ',' : ''}}{{jsonData.Inpatient.patientId ? jsonData.Inpatient.patientId : ''}}
+      {{jsonData.Inpatient.sex ? jsonData.Inpatient.sex + ',' : ''}}{{jsonData.Inpatient.inpatientAge ? jsonData.Inpatient.inpatientAge + ',' : ''}}{{jsonData.Inpatient.patientId ? jsonData.Inpatient.patientId : ''}}
     </view>
   </view>
   <!-- 时间切换 -->

+ 145 - 124
antbuilder/industry/hospitalV2/components/order-pay/index.js

@@ -1,133 +1,154 @@
-import { connect } from 'herculex';
-import { makeAppointment } from './service';
-import { cuttingDate } from '../../utils';
-import { tradePay } from '../../utils/tradePay';
-import history from '../../utils/history';
-Component(connect({
-  mapStateToProps: {
-    userInfo: state => state.$global.userInfo
-  }
-})({
-  props: {
-    componentData: {}
-  },
-  data: {
-    onlinePay: false,
-    // 无需支付
-    order: {},
-    orderList: [{
-      key: 'depName',
-      label: '就诊科室'
-    }, {
-      key: 'doctorName',
-      label: '预约医生'
-    }, {
-      key: 'timeRange',
-      label: '就诊日期'
-    }, {
-      key: 'startTime',
-      label: '就诊时间'
-    }, {
-      key: 'districtName',
-      label: '就诊医院'
-    }],
-    checkedPatient: {},
-    inProgress: false,
-    // 预约中
-    showPatient: false
-  },
+import { connect } from "herculex";
+import { makeAppointment } from "./service";
+import { cuttingDate } from "../../utils";
+import { tradePay } from "../../utils/tradePay";
+import history from "../../utils/history";
+Component(
+	connect({
+		mapStateToProps: {
+			userInfo: (state) => state.$global.userInfo,
+		},
+	})({
+		props: {
+			componentData: {},
+		},
+		data: {
+			onlinePay: false,
+			// 无需支付
+			order: {},
+			orderList: [
+				{
+					key: "depName",
+					label: "就诊科室",
+				},
+				{
+					key: "doctorName",
+					label: "预约医生",
+				},
+				{
+					key: "timeRange",
+					label: "就诊日期",
+				},
+				{
+					key: "startTime",
+					label: "就诊时间",
+				},
+				{
+					key: "districtName",
+					label: "就诊医院",
+				},
+			],
+			checkedPatient: {},
+			inProgress: false,
+			// 预约中
+			showPatient: false,
+		},
 
-  didMount() {
-    this.orderDetail(Object.assign({
-      depName: '',
-      doctorName: '',
-      doctorId: '',
-      orderSourceId: '',
-      bindCardNum: '',
-      startTime: '',
-      queueNum: 0,
-      amount: 0,
-      payType: '就诊时支付',
-      level: '',
-      districtName: '',
-      onlinePay: true
-    }, this.$page.data.query));
-  },
+		didMount() {
+			console.log("this.$page.data.query", this.$page.data.query);
+			this.orderDetail(
+				Object.assign(
+					{
+						depName: "",
+						doctorName: "",
+						doctorId: "",
+						orderSourceId: "",
+						bindCardNum: "",
+						startTime: "",
+						queueNum: 0,
+						amount: 0,
+						payType: "就诊时支付",
+						level: "",
+						districtName: "",
+						onlinePay: true,
+					},
+					this.$page.data.query
+				)
+			);
+		},
 
-  methods: {
-    saveRef(ref) {
-      this.subscribe = ref;
-    },
+		methods: {
+			saveRef(ref) {
+				this.subscribe = ref;
+			},
 
-    // 默认选中就诊人
-    onChange(checkedPatient) {
-      this.setData({
-        checkedPatient
-      });
-    },
+			// 默认选中就诊人
+			onChange(checkedPatient) {
+				this.setData({
+					checkedPatient,
+				});
+			},
 
-    // 打开就诊人列表
-    choosePatient() {
-      this.setData({
-        showPatient: true
-      });
-    },
+			// 打开就诊人列表
+			choosePatient() {
+				this.setData({
+					showPatient: true,
+				});
+			},
 
-    // 关闭就诊人列表
-    onClose() {
-      this.setData({
-        showPatient: false
-      });
-    },
+			// 关闭就诊人列表
+			onClose() {
+				this.setData({
+					showPatient: false,
+				});
+			},
 
-    // 确认预约
-    async onSubmit() {
-      if (this.data.checkedPatient.name) {
-        makeAppointment({
-          doctorId: this.data.order.doctorId,
-          orderSourceId: this.data.order.orderSourceId,
-          cardNum: this.data.checkedPatient.bindCardNum
-        }).then(data => {
-          if (this.data.onlinePay) {
-            tradePay({
-              type: 1,
-              idNum: data.orderId,
-              depName: this.data.order.depName
-            }, {
-              tradeType: 'Appointment'
-            }).then(() => {
-              this.toDetail(data.orderId); // 支付成功以后,唤起消息订阅
+			// 确认预约
+			async onSubmit() {
+				if (this.data.checkedPatient.name) {
+					makeAppointment({
+						doctorId: this.data.order.doctorId,
+						orderSourceId: this.data.order.orderSourceId,
+						cardNum: this.data.checkedPatient.bindCardNum,
+					}).then((data) => {
+						if (this.data.onlinePay) {
+							tradePay(
+								{
+									type: 1,
+									idNum: data.orderId,
+									depName: this.data.order.depName,
+								},
+								{
+									tradeType: "Appointment",
+								}
+							).then(() => {
+								this.toDetail(data.orderId); // 支付成功以后,唤起消息订阅
 
-              this.subscribe.subscribeMessage();
-            });
-          } else {
-            this.toDetail(data.orderId);
-          }
-        });
-      } else {
-        this.choosePatient();
-      }
-    },
+								this.subscribe.subscribeMessage();
+							});
+						} else {
+							this.toDetail(data.orderId);
+						}
+					});
+				} else {
+					this.choosePatient();
+				}
+			},
 
-    // 配置预约单详情
-    orderDetail(data) {
-      this.setData({
-        order: Object.assign(data, cuttingDate(data.startTime)),
-        onlinePay: data.onlinePay === 'true'
-      });
-    },
+			// 配置预约单详情
+			orderDetail(data) {
+				// date: d.toLocaleDateString().replace(/\//g, "-"),
+				// day: getWeek(d),
+				// am: hours < 12 ? "上午" : "下午",
+				// type: hours < 12 ? "am" : "pm",
+				// time: `${`0${hours}`.slice(-2)}:${`0${d.getMinutes()}`.slice(-2)}`,
+				this.setData({
+					order: Object.assign(data, cuttingDate(data.startTime)),
+					onlinePay: data.onlinePay === "true",
+				});
+			},
 
-    // 跳转到预约详情
-    toDetail(orderId) {
-      history.push({
-        title: '预约详情',
-        query: {
-          orderId,
-          where: 'order-pay'
-        },
-        pageType: 'appointment-result'
-      });
-    }
-
-  }
-}));
+			// 跳转到预约详情
+			toDetail(orderId) {
+				history.push({
+					title: "预约详情",
+					query: {
+						orderId,
+						where: "order-pay",
+					},
+					pageType: "appointment-result",
+				});
+			},
+		},
+	})
+);

+ 2 - 2
antbuilder/industry/hospitalV2/components/report-details-list/reportDetailsList.axml

@@ -71,9 +71,9 @@
                 </view>
             </view>
             <!-- 复诊挂号 -->
-            <view class="registration">
+            <!-- <view class="registration">
                 <view class="registration-btn" onTap="registrationBtn">复诊挂号</view>
-            </view>
+            </view> -->
         </view>
     </view>
 </wrapper>

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

@@ -30,6 +30,9 @@ Component({
 	methods: {
 		onFilterHandel(filters) {
 			this.filters = filters;
+			if (!filters.type) {
+				this.filters.type = "检查报告";
+			}
 			this.flatRef.refresh();
 		},
 

+ 7 - 1
antbuilder/industry/hospitalV2/components/select-department/index.js

@@ -145,11 +145,17 @@ Component({
 			const query = this.getQuery();
 			const { name: areaName } = query;
 			const { componentData } = this.props;
-			const { departmentId, name: dpName, departmentCode: depCode } = item;
+			const {
+				departmentId,
+				name: dpName,
+				departmentCode: depCode,
+				hospitalId,
+			} = item;
 			history.push({
 				query: {
 					departmentId,
 					depCode,
+					hospitalId,
 				},
 				title: `${dpName}(${areaName})`,
 				pageType: "hospital-num-source",

+ 66 - 38
antbuilder/industry/hospitalV2/utils/index.js

@@ -1,25 +1,40 @@
-const {
-  windowHeight,
-  titleBarHeight,
-  statusBarHeight
-} = my.getSystemInfoSync();
+const { windowHeight, titleBarHeight, statusBarHeight } =
+	my.getSystemInfoSync();
 /**
  * 时间搓分开返回日期、时间、星期
  * @param time
  * @returns {{date: string, time: string, am: (string), day: string}}
  */
 
-export function cuttingDate(time = '') {
-  const d = time ? new Date(time.replace(/-/g, '/')) : new Date();
-  const hours = d.getHours();
-  return {
-    date: d.toLocaleDateString().replace(/\//g, '-'),
-    day: getWeek(d),
-    am: hours < 12 ? '上午' : '下午',
-    type: hours < 12 ? 'am' : 'pm',
-    time: `${`0${hours}`.slice(-2)}:${`0${d.getMinutes()}`.slice(-2)}`
-  };
+export function cuttingDate(time = "") {
+	const d = time ? new Date(time.replace(/-/g, "/")) : new Date();
+	const hours = d.getHours();
+	return {
+		date: d.toLocaleDateString().replace(/\//g, "-"),
+		day: getWeek(d),
+		am: hours < 12 ? "上午" : "下午",
+		type: hours < 12 ? "am" : "pm",
+		time: `${`0${hours}`.slice(-2)}:${`0${d.getMinutes()}`.slice(-2)}`,
+	};
 }
+
+export function selectDate(content = "") {
+	switch (content) {
+		case 2:
+			return "am";
+		case 3:
+			return "pm";
+		case 6:
+			return "mm";
+		case 4:
+			return "nm";
+		case 5:
+			return "mnm";
+		default:
+			return "";
+	}
+}
+
 /**
  * 返回星期
  * @param date
@@ -27,43 +42,56 @@ export function cuttingDate(time = '') {
  */
 
 export function getWeek(date) {
-  const d = Object.prototype.toString.call(date) === '[object Date]' ? date : new Date(date);
-  return ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][d.getDay()];
+	const d =
+		Object.prototype.toString.call(date) === "[object Date]"
+			? date
+			: new Date(date);
+	return ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][d.getDay()];
 }
 
-const excludeEmptyValue = data => {
-  const obj = {};
-  Object.keys(data).forEach(key => {
-    const value = data[key];
-    if (value !== undefined) obj[key] = value;
-  });
-  return obj;
+const excludeEmptyValue = (data) => {
+	const obj = {};
+	Object.keys(data).forEach((key) => {
+		const value = data[key];
+		if (value !== undefined) obj[key] = value;
+	});
+	return obj;
 };
 
-export const queryToUrl = query => Object.keys(excludeEmptyValue(query)).reduce((sum, item) => `${sum}&${item}=${query[item]}`, '');
+export const queryToUrl = (query) =>
+	Object.keys(excludeEmptyValue(query)).reduce(
+		(sum, item) => `${sum}&${item}=${query[item]}`,
+		""
+	);
 export const getHeaderHeight = () => titleBarHeight + statusBarHeight;
 export const getContentHeight = () => windowHeight - getHeaderHeight();
-export const ID_CARD_18 = /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
-export const ID_CARD_15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
+export const ID_CARD_18 =
+	/^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
+export const ID_CARD_15 =
+	/^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
 export const PHONE_CHECK = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
 /* 校验身份证 */
 
 export function checkIdCard(idCardNo) {
-  return ID_CARD_18.test(idCardNo) || ID_CARD_15.test(idCardNo) || idCardNo.indexOf('*') > -1;
+	return (
+		ID_CARD_18.test(idCardNo) ||
+		ID_CARD_15.test(idCardNo) ||
+		idCardNo.indexOf("*") > -1
+	);
 }
 /* 校验手机 */
 
 export function checkPhone(phoneNumber) {
-  return PHONE_CHECK.test(phoneNumber) || phoneNumber.indexOf('*') > -1;
+	return PHONE_CHECK.test(phoneNumber) || phoneNumber.indexOf("*") > -1;
 } // 防抖函数
 
 export function debounce(fn, delay = 0) {
-  let timer;
-  return function _(...args) {
-    clearTimeout(timer);
-    const context = this;
-    timer = setTimeout(() => {
-      fn.apply(context, [...args, context]);
-    }, delay);
-  };
-}
+	let timer;
+	return function _(...args) {
+		clearTimeout(timer);
+		const context = this;
+		timer = setTimeout(() => {
+			fn.apply(context, [...args, context]);
+		}, delay);
+	};
+}