Browse Source

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

liweimin 2 years ago
parent
commit
8b507c3881

+ 2 - 2
antbuilder/industry/hospitalV2/components/deposit-list/index.axml

@@ -8,7 +8,7 @@
     showTimeSelector="{{ showTimeSelector }}"
     showAll="{{ showAll }}"
   />
-  <view class="container">
+  <view class="container" a:if="{{ hospitalList.length !== 0 }}">
     <view class="subscribe-container" data-item="{{ item }}" a:for="{{hospitalList}}" a:key="index">
       <view class="subscribe-title">{{ item.month }}</view>
       <view class="subscribe-item" a:for="{{item.value}}" a:for-item="detail" data-item="{{ detail }}" onTap="goToDetail">
@@ -18,7 +18,7 @@
          </view>
          <view class="money">
           <text class="first">{{ detail.payTime }}</text>
-          <text class="second">余额:¥{{ detail.depositBalance }}</text>
+          <!-- <text class="second">余额:¥{{ detail.depositBalance }}</text> -->
         </view>
       </view>
     </view>

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

@@ -46,6 +46,7 @@ Component({
 					depositId,
 					inpatientId: requestDetail.inpatientId,
 					hisPatientId,
+					name: requestDetail.name,
 				},
 				title: "押金缴纳详情",
 				pageType: "pay-result",
@@ -72,6 +73,7 @@ Component({
 							: "全部住院人",
 					requestDetail: {
 						inpatientId: typeOptions[0].value,
+						name: typeOptions[0].label,
 					},
 				});
 			} catch (error) {
@@ -110,8 +112,8 @@ Component({
 						value: monthArray[res],
 					});
 				});
-
 				if (hospitalListDetail && hospitalListDetail.length > 0) {
+					this.data.hospitalList;
 					this.setData({
 						hospitalList: hospitalListDetail,
 					});

+ 16 - 5
antbuilder/industry/hospitalV2/components/deposit/index.js

@@ -268,17 +268,28 @@ Component({
 								});
 
 								if (payRes.status === "TRADE_SUCCESS") {
+									// history.push({
+									// 	query: {
+									// 		depositId,
+									// 		color: "#000",
+									// 		backBtnColor: "#000",
+									// 		background: "#fff",
+									// 		inpatientId,
+									// 		hisPatientId: inpatientId,
+									// 	},
+									// 	title: "押金缴纳详情",
+									// 	pageType: "pay-result",
+									// });
+									//  因为押金缴纳完成后,不能获取到收据No,所以需要跳转到押金缴纳记录
 									history.push({
 										query: {
-											depositId,
+											inpatientId,
 											color: "#000",
 											backBtnColor: "#000",
 											background: "#fff",
-											inpatientId,
-											hisPatientId: inpatientId,
 										},
-										title: "押金缴纳详情",
-										pageType: "pay-result",
+										title: "押金缴纳记录",
+										pageType: "deposit-list",
 									});
 								} else {
 									my.showToast({

+ 165 - 129
antbuilder/industry/hospitalV2/components/doctor-page/index.js

@@ -1,137 +1,173 @@
-import { doctorInfo, doctorOrderSourceList } from './service';
-import * as utils from '../../utils';
+import { doctorInfo, doctorOrderSourceList, getDepDoctorList } from "./service";
+import { doctorSchedule } from "../../../../core/utils/ywtService";
+import * as utils from "../../utils";
+const datePeriodMap = {
+	全天: 1,
+	上午: 2,
+	下午: 3,
+	夜间: 4,
+	下半夜: 5,
+	午间: 6,
+};
 Component({
-  props: {},
-  data: {
-    doctor: {
-      doctorId: '',
-      name: '',
-      picUrl: '',
-      level: '',
-      description: '',
-      specialty: '',
-      departments: []
-    },
-    days: [],
-    startTime: '',
-    endTime: '',
-    showIntro: false,
-    showRange: false,
-    rangeItem: {},
-    routeState: {}
-  },
+	props: {},
+	data: {
+		doctor: {
+			doctorId: "",
+			name: "",
+			picUrl: "",
+			level: "",
+			description: "",
+			specialty: "",
+			departments: [],
+		},
+		days: [],
+		startTime: "",
+		endTime: "",
+		showIntro: false,
+		showRange: false,
+		rangeItem: {},
+		routeState: {},
+	},
 
-  didMount() {
-    const d = new Date();
-    const startTime = d.toLocaleDateString().replace(/\//g, '-');
-    d.setDate(d.getDate() + 7);
-    const endTime = d.toLocaleDateString().replace(/\//g, '-');
-    this.setData({
-      startTime,
-      endTime
-    });
-    const {
-      query = {
-        depId: '',
-        doctorId: ''
-      }
-    } = this.$page.data;
-    this.init(query);
-  },
+	didMount() {
+		const d = new Date();
+		const startTime = d.toLocaleDateString().replace(/\//g, "-");
+		d.setDate(d.getDate() + 7);
+		const endTime = d.toLocaleDateString().replace(/\//g, "-");
+		this.setData({
+			startTime,
+			endTime,
+		});
+		const {
+			query = {
+				depId: "",
+				doctorId: "",
+			},
+		} = this.$page.data;
+		this.init(query);
+	},
 
-  methods: {
-    init(query) {
-      my.showLoading();
-      Promise.all([doctorInfo({
-        doctorId: query.doctorId
-      }).then(res => {
-        this.setData({
-          doctor: res
-        });
-      }), doctorOrderSourceList({
-        depId: query.depId,
-        doctorId: query.doctorId,
-        startTime: this.data.startTime,
-        endTime: this.data.endTime
-      }).then(res => {
-        const days = [];
-        res.forEach(item => {
-          const {
-            date
-          } = utils.cuttingDate(item.startTime);
-          const temp = days.find(m => m.date === date);
+	methods: {
+		init(query) {
+			my.showLoading();
+			Promise.all([
+				doctorInfo({
+					doctorId: query.doctorId,
+				}).then((res) => {
+					this.setData({
+						doctor: res,
+					});
+				}),
+				getDepDoctorList({
+					depId: query.depId,
+					depCode: query.depCode,
+					doctorCode: query.doctorCode,
+				}).then((result) => {
+					const list = result.list[0].orderSources || [];
+					const days = [];
+					list.forEach((item) => {
+						const date = item.serviceDate;
+						const temp = days.find((m) => m.date === date);
+						if (temp) {
+							temp.orderSources.push(item);
+						} else {
+							days.push({
+								date,
+								today: date === utils.cuttingDate().date,
+								orderSources: [item],
+							});
+						}
+					});
+					this.setData({
+						days,
+					});
+				}),
+			]).then(() => {
+				my.hideLoading();
+			});
+		},
 
-          if (temp) {
-            temp.orderSources.push(item);
-          } else {
-            days.push({
-              date,
-              today: date === utils.cuttingDate().date,
-              orderSources: [item]
-            });
-          }
-        });
-        this.setData({
-          days
-        });
-      })]).then(() => {
-        my.hideLoading();
-      });
-    },
+		// 查看更多
+		showIntro() {
+			this.setData({
+				showIntro: true,
+			});
+		},
 
-    // 查看更多
-    showIntro() {
-      this.setData({
-        showIntro: true
-      });
-    },
+		onClose() {
+			this.setData({
+				showIntro: false,
+			});
+		},
 
-    onClose() {
-      this.setData({
-        showIntro: false
-      });
-    },
+		getQuery() {
+			const { $routeConfig } = this.$page;
+			return $routeConfig.query;
+		},
 
-    // 跳转预约
-    onAppointment({
-      target
-    }) {
-      const {
-        query = {
-          depId: ''
-        }
-      } = this.$page.data;
-      const {
-        doctor
-      } = this.data;
-      const depName = (doctor.departments.find(m => m.departmentId === query.depId) || {
-        name: ''
-      }).name;
-      const routeState = {
-        query: {
-          level: doctor.level,
-          depName,
-          doctorId: doctor.doctorId,
-          doctorName: doctor.name,
-          queueNum: '',
-          payType: '就诊时支付',
-          districtName: doctor.districtName
-        },
-        title: '挂号确认',
-        pageType: 'order-pay'
-      };
-      this.setData({
-        showRange: true,
-        rangeItem: target.dataset.row,
-        routeState
-      });
-    },
+		// 跳转预约
+		async onAppointment({ target }) {
+			const cost = target.dataset.row.list[0].cost || "0";
+			const {
+				query = {
+					depId: "",
+				},
+			} = this.$page.data;
+			const { doctor } = this.data;
+			const depName = (
+				doctor.departments.find((m) => m.departmentId === query.depId) || {
+					name: "",
+				}
+			).name;
+			const routeState = {
+				query: {
+					level: doctor.level,
+					depName,
+					doctorId: doctor.doctorId,
+					doctorName: doctor.name,
+					queueNum: "",
+					payType: "就诊时支付",
+					districtName: doctor.districtName,
+				},
+				title: "挂号确认",
+				pageType: "order-pay",
+			};
+			const { hospitalId, depCode, doctorCode } = this.getQuery();
+			let newList = [];
+			let finalList = [];
+			const [result] = await doctorSchedule({
+				hospitalId: Number(hospitalId),
+				deptCode: depCode,
+				doctorCode,
+				serviceDate: target.dataset.row.date,
+				period: datePeriodMap[target.dataset.row.name],
+			});
+			if (result && result.data) {
+				newList = result.data.length > 0 ? 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: target.dataset.row.date,
+					});
+				});
+			}
+			target.dataset.row.list = finalList;
+			this.setData({
+				showRange: true,
+				rangeItem: target.dataset.row,
+				routeState,
+			});
+		},
 
-    onTimeRangeClose() {
-      this.setData({
-        showRange: false
-      });
-    }
-
-  }
-});
+		onTimeRangeClose() {
+			this.setData({
+				showRange: false,
+			});
+		},
+	},
+});

+ 12 - 7
antbuilder/industry/hospitalV2/components/doctor-page/service.js

@@ -1,15 +1,20 @@
-import request from '../../service/request'; // 医生简介查询
+import request from "../../service/request"; // 医生简介查询
 
 function doctorInfo(data) {
-  return request.post('/isvRequest.doctor.doctorInfo', data);
+	return request.post("/isvRequest.doctor.doctorInfo", data);
 } // 医生号源查询
 
-
 function doctorOrderSourceList(data) {
-  return request.post('/isvRequest.order.doctorOrderSourceList', data);
+	return request.post("/isvRequest.order.doctorOrderSourceList", data);
+}
+
+function getDepDoctorList(params) {
+	const url = "/isvRequest.order.depDoctorList";
+	return request.post(url, params);
 }
 
 export default {
-  doctorInfo,
-  doctorOrderSourceList
-};
+	doctorInfo,
+	doctorOrderSourceList,
+	getDepDoctorList,
+};

+ 0 - 12
antbuilder/industry/hospitalV2/components/edit-patient/index.axml

@@ -45,12 +45,6 @@
           placeholder-class="placeholder"
           disabled="{{ isAuthSuccess && !editForm.id }}"
         />
-        <image
-          class="icon-ca"
-          src="{{ caIcon }}"
-          onTap="onLaunchOcr"
-          a:if="{{ !isAuthSuccess }}"
-        />
       </view>
     </form-row>
     <form-row title="手机号码">
@@ -63,12 +57,6 @@
           placeholder="用于就诊人接收就诊短信通知"
           disabled="{{ isAuthSuccess && !editForm.id }}"
         />
-        <image
-          class="icon-book"
-          src="{{ bookIcon }}"
-          onTap="choosePhoneContact"
-          a:if="{{ !isAuthSuccess }}"
-        />
       </view>
     </form-row>
     <view class="footer">

+ 5 - 1
antbuilder/industry/hospitalV2/components/hospital-num-source/num-item/index.js

@@ -60,7 +60,8 @@ Component(
 
 			async toDoctorPage({ target }) {
 				const { item } = target.dataset;
-				const { doctorId } = item;
+				const { doctorId, doctorCode } = item;
+				const { depCode, hospitalId } = this.getQuery();
 				const { componentData } = this.props;
 				if (!this.checkRemain(item)) return;
 				const {
@@ -71,6 +72,9 @@ Component(
 						doctorId,
 						// 医生唯一识别号
 						depId: departmentId, // 科室id
+						depCode,
+						doctorCode,
+						hospitalId,
 					},
 					title: "医生主页",
 					pageType: "doctor-page",

+ 65 - 83
antbuilder/industry/hospitalV2/components/patient-detail-edit/index.js

@@ -1,96 +1,78 @@
 import { querySingle, patientUpdate } from "../patient-detail/service";
+import { createSubscribe } from "applet-page-component";
 import history from "../../utils/history";
-import EventHub from "../../../abMall/utils/eventEmitter";
+Component(
+	createSubscribe({
+		async onShow() {
+			await this.querySingle();
+		},
+	})({
+		props: {},
+		data: {
+			patient: {
+				balance: 0,
+				id: "",
+				name: "",
+				age: "",
+				sex: "",
+				phoneNumber: "",
+				birthDay: "",
+				idCardNo: "",
+				relationShip: "",
+				bindCardNum: "",
+				medicCards: [],
+			},
+		},
 
-Component({
-	props: {},
-	data: {
-		patient: {
-			balance: 0,
-			id: "",
-			name: "",
-			age: "",
-			sex: "",
-			phoneNumber: "",
-			birthDay: "",
-			idCardNo: "",
-			relationShip: "",
-			bindCardNum: "",
-			medicCards: [],
+		didMount() {
+			this.querySingle();
 		},
-	},
 
-	didMount() {
-		this.querySingle();
-		this.onEventChange();
-		// this.$page.updatePatient = this;
-		// const page = getCurrentPages();
-		// console.log("page", this.$page);
-		// console.log("page ===>", page);
-	},
+		didUnmount() {},
 
-	didUnmount() {
-		this.onEventRemove();
-	},
+		methods: {
+			querySingle() {
+				const {
+					query = {
+						id: "",
+					},
+				} = this.$page.data;
+				my.showLoading();
+				querySingle({
+					id: query.id,
+				}).then((data) => {
+					this.setData({
+						patient: data,
+					});
+					my.hideLoading();
+				});
+			},
 
-	methods: {
-		onEventChange() {
-			const _this = this;
-			EventHub.addEventListener("onPatienDetailUpdate", (payload) => {
-				if (payload) {
-					_this.querySingle();
-				}
-			});
-		},
-		onEventRemove() {
-			const _this = this;
-			EventHub.removeEventListener("onPatienDetailUpdate", (payload) => {
-				if (payload) {
-					_this.querySingle();
-				}
-			});
-		},
-		querySingle() {
-			const {
-				query = {
-					id: "",
-				},
-			} = this.$page.data;
-			my.showLoading();
-			querySingle({
-				id: query.id,
-			}).then((data) => {
+			// 修改关系
+			onChange(e) {
 				this.setData({
-					patient: data,
+					"patient.relationShip": e.name,
 				});
-				my.hideLoading();
-			});
-		},
+			},
 
-		// 修改关系
-		onChange(e) {
-			this.setData({
-				"patient.relationShip": e.name,
-			});
-		},
+			onChangePhone() {
+				history.push({
+					query: {
+						id: this.data.patient.id,
+						relationShip: this.data.patient.relationShip,
+					},
+					title: "修改手机号",
+					pageType: "patient-detail-phone",
+				});
+			},
 
-		onChangePhone() {
-			history.push({
-				query: {
+			onSubmit() {
+				patientUpdate({
 					id: this.data.patient.id,
-          relationShip: this.data.patient.relationShip,
-				},
-				title: "修改手机号",
-				pageType: "patient-detail-phone",
-			});
-		},
-
-		onSubmit() {
-			patientUpdate({
-				id: this.data.patient.id,
-				name: this.data.patient.name,
-				relationShip: this.data.patient.relationShip,
-			}).then(my.navigateBack);
+					name: this.data.patient.name,
+					relationShip: this.data.patient.relationShip,
+				}).then(my.navigateBack);
+			},
 		},
-	},
-});
+	})
+);

+ 14 - 4
antbuilder/industry/hospitalV2/components/patient-detail-phone/index.js

@@ -1,6 +1,5 @@
 import { patientUpdate } from "../patient-detail/service";
 import getEncryptStr from "../../utils/getEncryptStr";
-import EventHub from "../../../abMall/utils/eventEmitter";
 Component({
 	props: {},
 	data: {
@@ -16,10 +15,22 @@ Component({
 			});
 		},
 
+		choosePhoneContact() {
+			my.choosePhoneContact({
+				success: (result) => {
+					const { mobile } = result;
+					this.setData({
+						phone: mobile.replace(/(\s|-|\+)/g, ""),
+					});
+				},
+			});
+		},
+
 		async onSave() {
 			const {
 				query = {
-					id: "", relationShip: "",
+					id: "",
+					relationShip: "",
 				},
 			} = this.$page.data;
 			const phoneNumber = this.data.phone;
@@ -27,10 +38,9 @@ Component({
 			if (/^[1]([3-9])[0-9]{9}$/.test(phoneNumber)) {
 				patientUpdate({
 					id: query.id,
-          // relationShip: query.relationShip,
+					// relationShip: query.relationShip,
 					phoneNumber: await getEncryptStr(this.data.phone),
 				}).then(() => {
-					EventHub.dispatchEvent("onPatienDetailUpdate", true);
 					my.navigateBack();
 				});
 			} else {

+ 4 - 3
antbuilder/industry/hospitalV2/components/pay-result/index.js

@@ -10,9 +10,9 @@ Component({
 	},
 
 	didMount() {
-		const { depositId, inpatientId, hisPatientId } =
+		const { depositId, inpatientId, hisPatientId, name } =
 			this.$page.data.query || {};
-		this.getDepositDetailsFn(depositId, inpatientId, hisPatientId);
+		this.getDepositDetailsFn(depositId, inpatientId, hisPatientId, name);
 		// this.subscribeMsg();
 		/* 服务办结,押金缴纳完成 */
 
@@ -66,12 +66,13 @@ Component({
 		},
 
 		// 获取支付详情
-		async getDepositDetailsFn(depositId, inpatientId, hisPatientId) {
+		async getDepositDetailsFn(depositId, inpatientId, hisPatientId, name) {
 			try {
 				const detail = await getDepositDetails({
 					depositId,
 					hisPatientId: hisPatientId,
 					receiptNo: depositId,
+					name,
 				});
 				this.setData({
 					detail,