Browse Source

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

liweimin 2 years ago
parent
commit
01f727675d

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

@@ -208,8 +208,13 @@ export async function getTicket() {
 export async function setTicket() {
 	const app = getApp();
 	const { expiresTime } = app.globalData.ticketData;
+	console.log("expiresTime", expiresTime);
 	// 如果当前其他请求更新了ticket,则不用重新请求
-	if (expiresTime && checkTimeExpire(expiresTime)) {
+	if (expiresTime && (await checkTimeExpire(expiresTime))) {
+		console.log(
+			"checkTimeExpire(expiresTime)",
+			await checkTimeExpire(expiresTime)
+		);
 		return;
 	}
 	// 如果没有ticket正在请求,则在gloabl上增加setTicket

+ 73 - 89
antbuilder/industry/hospital/components/hospital-registration/choose-a-doctor/index.js

@@ -1,99 +1,83 @@
-import { getDepOrderSourceRemain, getDoctors } from '../../utils/service';
-import { history } from '../../utils';
+import { getDepOrderSourceRemain, getDoctors } from "../../utils/service";
+import { history } from "../../utils";
 Component({
-  props: {
-    data: {
-      bookInfo: {}
-    }
-  },
-  data: {
-    timeRange: [],
-    doctorList: [],
-    date: undefined,
-    currentIndex: 0
-  },
+	props: {
+		data: {
+			bookInfo: {},
+		},
+	},
+	data: {
+		timeRange: [],
+		doctorList: [],
+		date: undefined,
+		currentIndex: 0,
+	},
 
-  didMount() {
-    my.setNavigationBar({
-      title: '选择医生'
-    });
-    this.getSourceDate();
-  },
+	didMount() {
+		my.setNavigationBar({
+			title: "选择医生",
+		});
+		this.getSourceDate();
+	},
 
-  methods: {
-    saveRef(ref) {
-      this.scrollFetch = ref;
-    },
+	methods: {
+		saveRef(ref) {
+			this.scrollFetch = ref;
+		},
 
-    async getCurSelectTime({
-      id,
-      currentIndex
-    }) {
-      if (!id) {
-        return;
-      }
+		async getCurSelectTime({ id, currentIndex }) {
+			if (!id) {
+				return;
+			}
 
-      await this.setData({
-        date: id,
-        currentIndex
-      });
-      this.scrollFetch && this.scrollFetch.fetchList({
-        pageIndex: 1,
-        date: id
-      }, true, true);
-    },
+			await this.setData({
+				date: id,
+				currentIndex,
+			});
+			this.scrollFetch &&
+				this.scrollFetch.fetchList(
+					{
+						pageIndex: 1,
+						date: id,
+					},
+					true,
+					true
+				);
+		},
 
-    toDoctorInfo(e) {
-      const {
-        doctor
-      } = e.target.dataset;
-      const {
-        timeRange,
-        currentIndex
-      } = this.data;
-      const {
-        bookInfo
-      } = this.props.data;
-      history.openPage({
-        pageType: 'select-number-source',
-        data: {
-          timeRange,
-          bookInfo: { ...doctor,
-            ...bookInfo,
-            currentIndex
-          }
-        }
-      });
-    },
+		toDoctorInfo(e) {
+			const { doctor } = e.target.dataset;
+			const { timeRange, currentIndex } = this.data;
+			const { bookInfo } = this.props.data;
+			history.openPage({
+				pageType: "select-number-source",
+				data: {
+					timeRange,
+					bookInfo: { ...doctor, ...bookInfo, currentIndex },
+				},
+			});
+		},
 
-    // 查询号源日历
-    async getSourceDate() {
-      const [, res] = await getDepOrderSourceRemain({
-        depId: this.props.data.bookInfo.depId
-      });
-      this.setData({
-        timeRange: res || []
-      });
-    },
+		// 查询号源日历
+		async getSourceDate() {
+			const [, res] = await getDepOrderSourceRemain({
+				depId: this.props.data.bookInfo.depId,
+			});
+			this.setData({
+				timeRange: res || [],
+			});
+		},
 
-    // 获取医生列表
-    getDoctors(params) {
-      const {
-        date
-      } = this.data;
-      const {
-        depId
-      } = this.props.data.bookInfo;
+		// 获取医生列表
+		getDoctors(params) {
+			const { date } = this.data;
+			const { depId } = this.props.data.bookInfo;
 
-      if (!date) {
-        return [new Error('没有日期')];
-      }
+			if (!date) {
+				return [new Error("没有日期")];
+			}
 
-      return getDoctors({ ...params,
-        depId,
-        date
-      });
-    }
-
-  }
-});
+			return getDoctors({ ...params, depId, date });
+		},
+	},
+});

+ 137 - 151
antbuilder/industry/hospitalV2/components/components/order-session/index.js

@@ -1,155 +1,141 @@
-import * as utils from '../../../utils';
-
-const getTimeItem = name => ({
-  name,
-  min: 0,
-  remain: 0,
-  list: [],
-  date: '',
-  week: ''
+import * as utils from "../../../utils";
+
+const getTimeItem = (name) => ({
+	name,
+	min: 0,
+	remain: 0,
+	list: [],
+	date: "",
+	week: "",
 });
 
-const restDate = date => date.replace(/-/g, '/');
+const restDate = (date) => date.replace(/-/g, "/");
 
 Component({
-  props: {
-    item: {}
-  },
-  data: {
-    rows: []
-  },
-
-  didMount() {
-    const {
-      item
-    } = this.props;
-    this.setData({
-      rows: this.formatTimeRange(item)
-    });
-  },
-
-  methods: {
-    /* 筛选数据 */
-    filterItems(items, list) {
-      list.forEach(order => {
-        /* 时间段以开始时间为准 */
-        let {
-          endTime,
-          startTime
-        } = order;
-        endTime = restDate(endTime);
-        startTime = restDate(startTime);
-        const {
-          time: eTime
-        } = utils.cuttingDate(endTime);
-        const {
-          type,
-          time: sTime
-        } = utils.cuttingDate(startTime);
-        const row = items[type];
-
-        if (!row.date) {
-          row.week = utils.getWeek(startTime);
-          row.date = this.getOrderDate(startTime);
-        }
-
-        row.list.push({ ...order,
-          sTime,
-          eTime
-        });
-      });
-      return items;
-    },
-
-    /* 处理时间段 */
-    formatTimeRange(item) {
-      const {
-        orderSources = []
-      } = item;
-      const items = this.filterItems({
-        am: getTimeItem('上午'),
-        pm: getTimeItem('下午')
-      }, orderSources);
-      const {
-        length: amLength
-      } = items.am.list;
-      const {
-        length: pmLength
-      } = items.pm.list;
-      /* 获取上午或者下午的最小价格 */
-
-      items.am.min = this.getMinCost(items.am.list);
-      items.pm.min = this.getMinCost(items.pm.list);
-
-      if (amLength <= 0) {
-        delete items.am;
-      } else {
-        /* 获取上午的剩余挂号数 */
-        items.am.remain = this.countRemain(items.am.list);
-      }
-
-      if (pmLength <= 0) {
-        delete items.pm;
-      } else {
-        /* 获取下午的剩余挂号数 */
-        items.pm.remain = this.countRemain(items.pm.list);
-      }
-      /* 同时存在上午和下午 */
-
-
-      if (items.am && items.pm) {
-        const {
-          am,
-          pm
-        } = items;
-        /* 如果上午跟下午的最小价格相等,那么就为全天 */
-
-        if (am.min === pm.min) {
-          items.all = { ...am,
-            name: '全天',
-            remain: items.am.remain + items.pm.remain,
-            list: [...am.list, ...pm.list]
-          };
-          delete items.am;
-          delete items.pm;
-        }
-      }
-
-      return Object.values(items);
-    },
-
-    /* 计算总的余号量 */
-    countRemain(list) {
-      return list.map(({
-        remain
-      }) => remain).reduce((pre, cur) => pre + cur);
-    },
-
-    /* 获取价格的最小值 */
-    getMinCost(items) {
-      const costs = [...new Set(items)].map(({
-        cost
-      }) => cost);
-      return costs.length > 0 ? Math.min(...costs) : 0;
-    },
-
-    /* 获取日期 */
-    getOrderDate(time) {
-      const date = new Date(time);
-      const year = date.getFullYear();
-      const month = date.getMonth() + 1;
-      const day = date.getDate();
-      return [year, this.checkDate(month), this.checkDate(day)].join('-');
-    },
-
-    checkDate(v) {
-      return `${v}`.length < 2 ? `0${v}` : v;
-    },
-
-    /* 根据日期获取时间 */
-    getTimeByDate(date) {
-      return utils.cuttingDate(date).time;
-    }
-
-  }
-});
+	props: {
+		item: {},
+	},
+	data: {
+		rows: [],
+	},
+
+	didMount() {
+		const { item } = this.props;
+		this.setData({
+			rows: this.formatTimeRange(item),
+		});
+	},
+
+	methods: {
+		/* 筛选数据 */
+		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);
+				const row = items[type];
+
+				if (!row.date) {
+					row.week = utils.getWeek(serviceDate);
+					row.date = serviceDate;
+				}
+
+				row.list.push({ ...order, sTime, eTime });
+			});
+			return items;
+		},
+
+		/* 处理时间段 */
+		formatTimeRange(item) {
+			const { orderSources = [] } = item;
+			const items = this.filterItems(
+				{
+					am: getTimeItem("上午"),
+					pm: getTimeItem("下午"),
+					mm: getTimeItem("午间"),
+				},
+				orderSources
+			);
+			const { length: amLength } = items.am.list;
+			const { length: pmLength } = items.pm.list;
+			const { length: mmLength } = items.mm.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);
+
+			if (amLength <= 0) {
+				delete items.am;
+			} else {
+				/* 获取上午的剩余挂号数 */
+				items.am.remain = this.countRemain(items.am.list);
+			}
+
+			if (pmLength <= 0) {
+				delete items.pm;
+			} else {
+				/* 获取下午的剩余挂号数 */
+				items.pm.remain = this.countRemain(items.pm.list);
+			}
+
+			if (mmLength <= 0) {
+				delete items.mm;
+			} else {
+				/* 获取下午的剩余挂号数 */
+				items.mm.remain = this.countRemain(items.mm.list);
+			}
+			/* 同时存在上午和下午 */
+			if (items.am && items.pm && items.mm) {
+				const { am, pm, mm } = items;
+				/* 如果上午跟下午的最小价格相等,那么就为全天 */
+
+				if ((am.min === pm.min) === mm.min) {
+					items.all = {
+						...am,
+						name: "全天",
+						remain: items.am.remain + items.pm.remain + items.mm.remain,
+						list: [...am.list, ...pm.list, ...mm.list],
+					};
+					delete items.am;
+					delete items.pm;
+					delete items.mm;
+				}
+			}
+
+			return Object.values(items);
+		},
+
+		/* 计算总的余号量 */
+		countRemain(list) {
+			return list.map(({ remain }) => remain).reduce((pre, cur) => pre + cur);
+		},
+
+		/* 获取价格的最小值 */
+		getMinCost(items) {
+			const costs = [...new Set(items)].map(({ cost }) => cost);
+			return costs.length > 0 ? Math.min(...costs) : 0;
+		},
+
+		/* 获取日期 */
+		getOrderDate(time) {
+			const date = new Date(time);
+			const year = date.getFullYear();
+			const month = date.getMonth() + 1;
+			const day = date.getDate();
+			return [year, this.checkDate(month), this.checkDate(day)].join("-");
+		},
+
+		checkDate(v) {
+			return `${v}`.length < 2 ? `0${v}` : v;
+		},
+
+		/* 根据日期获取时间 */
+		getTimeByDate(date) {
+			return utils.cuttingDate(date).time;
+		},
+	},
+});

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

@@ -39,12 +39,13 @@ Component({
 		},
 
 		goToDetail(e) {
-			const { depositId } = e.target.dataset.item;
+			const { depositId, hisPatientId } = e.target.dataset.item;
 			const { requestDetail } = this.data;
 			history.push({
 				query: {
 					depositId,
-					inpatientId: requestDetail.requestDetail,
+					inpatientId: requestDetail.inpatientId,
+					hisPatientId,
 				},
 				title: "押金缴纳详情",
 				pageType: "pay-result",

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

@@ -20,8 +20,7 @@
               <view class="patient-item-line-two">
                 {{ item.sex ? item.sex + ',' : '' }}
                 {{ item.inpatientAge ? item.inpatientAge + '岁' + ',' : '' }}
-                {{ item.area ? item.area + ',' : '' }}
-                {{ item.bedspace ? item.bedspace : ''  }}
+                {{ item.inpatientId ? item.inpatientId : '' }}
               </view>
             </view>
             <view a:if="{{ index !== selectIndex }}" class="patient-item-right">

+ 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.area ? jsonData.Inpatient.area + ',' : ''}}{{jsonData.Inpatient.bedspace}}
+        {{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}}

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

@@ -231,7 +231,8 @@ Component({
 
 		// 支付弹窗
 		async setTrade() {
-			const { money, inpatientId } = this.data;
+			const { money, inpatientId, jsonData } = this.data;
+			console.log("this.data", this.data);
 			try {
 				if (money) {
 					const {
@@ -241,6 +242,7 @@ Component({
 					} = await settradePayRe({
 						amount: money,
 						inpatientId,
+						admNo: jsonData.Inpatient.admNo || "",
 					});
 					my.tradePay({
 						tradeNO,

+ 173 - 199
antbuilder/industry/hospitalV2/components/hospital-num-source/index.js

@@ -1,211 +1,185 @@
-import { createSubscribe } from 'applet-page-component';
-import * as utils from './../../utils';
-import { getDepDoctorList, getDepOrderSourceRemain } from './service';
+import { createSubscribe } from "applet-page-component";
+import * as utils from "./../../utils";
+import { getDepDoctorList, getDepOrderSourceRemain } from "./service";
 /* 判断日期是不是今天 */
 
-const isToday = date => {
-  const _date = new Date();
+const isToday = (date) => {
+	const _date = new Date();
 
-  const year = _date.getFullYear();
+	const year = _date.getFullYear();
 
-  const month = _date.getMonth() + 1;
+	const month = _date.getMonth() + 1;
 
-  const day = _date.getDate();
+	const day = _date.getDate();
 
-  const check = val => `${val}`.length <= 1 ? `0${val}` : val;
+	const check = (val) => (`${val}`.length <= 1 ? `0${val}` : val);
 
-  return date === [year, check(month), check(day)].join('/');
+	return date === [year, check(month), check(day)].join("/");
 };
 
-const copy = obj => JSON.parse(JSON.stringify(obj));
+const copy = (obj) => JSON.parse(JSON.stringify(obj));
 
 const defaultSource = {
-  normal: {
-    items: [],
-    type: 'normal',
-    name: '普通号'
-  },
-  expert: {
-    items: [],
-    name: '专家号',
-    type: 'expert'
-  }
+	normal: {
+		items: [],
+		type: "normal",
+		name: "普通号",
+	},
+	expert: {
+		items: [],
+		name: "专家号",
+		type: "expert",
+	},
 };
-Component(createSubscribe({
-  /* 分页逻辑 */
-  async onReachBottom() {
-    const {
-      loading,
-      isLastPage
-    } = this.data;
-    if (loading || isLastPage) return;
-    this.pageIndex = this.pageIndex + 1;
-    await this.updateData({
-      loading: true
-    });
-    await this.onSplitPage();
-  }
-
-})({
-  props: {
-    componentData: {}
-  },
-  data: {
-    date: '',
-    loading: true,
-    dateList: [],
-
-    /* 原始的列表 */
-    nativeList: [],
-
-    /* 是否为最后一页 */
-    isLastPage: false,
-    dataSource: copy(defaultSource),
-    headerHeight: utils.getHeaderHeight()
-  },
-
-  async didMount() {
-    await this.onRefresh();
-    await this.fetchDateRemainList();
-  },
-
-  methods: {
-    getQuery() {
-      const {
-        $routeConfig
-      } = this.$page;
-      return $routeConfig.query;
-    },
-
-    updateData(data) {
-      return new Promise(resolve => this.setData(data, resolve));
-    },
-
-    async onChange(date) {
-      await this.onRefresh(date);
-    },
-
-    /* 获取日期列表 */
-    async fetchDateRemainList() {
-      /* 获取日期列表 */
-      const {
-        departmentId
-      } = this.getQuery();
-      const list = await getDepOrderSourceRemain({
-        depId: departmentId
-      });
-      /* 处理数据 */
-
-      const dateList = list.map(item => {
-        const {
-          date
-        } = item;
-
-        const _date = date.replace(/-/g, '/');
-
-        const today = isToday(_date);
-        const day = new Date(_date).getDate();
-        const week = utils.getWeek(_date);
-        return { ...item,
-          date: _date,
-          showDay: day,
-          today,
-          week
-        };
-      });
-      await this.updateData({
-        dateList
-      });
-    },
-
-    /* 数据处理 */
-    formatData(list = []) {
-      const {
-        dataSource
-      } = this.data;
-      list.forEach(item => {
-        const {
-          items
-        } = dataSource[item.type];
-        if (items) items.push(item);
-      });
-      return { ...dataSource
-      };
-    },
-
-    /* 分页显示医生列表 */
-    async onSplitPage() {
-      let total = 0;
-      let dataList = [];
-      let success = true;
-      const {
-        date,
-        isLastPage
-      } = this.data;
-      let {
-        date: curDate = ''
-      } = date || {};
-
-      if (curDate) {
-        const reg = new RegExp('/', 'gm');
-        curDate = curDate.replace(reg, '-');
-      }
-
-      const {
-        departmentId
-      } = this.getQuery();
-      const params = {
-        date: curDate,
-        pageSize: 10,
-        depId: departmentId,
-        pageIndex: this.pageIndex
-      };
-
-      if (!isLastPage) {
-        try {
-          const {
-            list = [],
-            pagination = {}
-          } = await getDepDoctorList(params);
-          dataList = list;
-          total = pagination.total || 0;
-        } catch (e) {
-          success = false;
-        }
-      }
-
-      let state = {
-        loading: false
-      };
-
-      if (success) {
-        const {
-          nativeList
-        } = this.data;
-        const _list = [...nativeList, ...dataList];
-        state = { ...state,
-          nativeList: _list,
-          isLastPage: _list.length >= total,
-          dataSource: this.formatData(dataList)
-        };
-      }
-
-      await this.updateData(state);
-    },
-
-    /* 刷新数据 */
-    async onRefresh(curDate = '') {
-      /* 初始化数据 */
-      this.pageIndex = 1;
-      await this.updateData({
-        date: curDate,
-        loading: true,
-        nativeList: [],
-        isLastPage: false,
-        dataSource: copy(defaultSource)
-      });
-      await this.onSplitPage();
-    }
-
-  }
-}));
+Component(
+	createSubscribe({
+		/* 分页逻辑 */
+		async onReachBottom() {
+			const { loading, isLastPage } = this.data;
+			if (loading || isLastPage) return;
+			this.pageIndex = this.pageIndex + 1;
+			await this.updateData({
+				loading: true,
+			});
+			await this.onSplitPage();
+		},
+	})({
+		props: {
+			componentData: {},
+		},
+		data: {
+			date: "",
+			loading: true,
+			dateList: [],
+
+			/* 原始的列表 */
+			nativeList: [],
+
+			/* 是否为最后一页 */
+			isLastPage: false,
+			dataSource: copy(defaultSource),
+			headerHeight: utils.getHeaderHeight(),
+		},
+
+		async didMount() {
+			await this.onRefresh();
+			await this.fetchDateRemainList();
+		},
+
+		methods: {
+			getQuery() {
+				const { $routeConfig } = this.$page;
+				return $routeConfig.query;
+			},
+
+			updateData(data) {
+				return new Promise((resolve) => this.setData(data, resolve));
+			},
+
+			async onChange(date) {
+				await this.onRefresh(date);
+			},
+
+			/* 获取日期列表 */
+			async fetchDateRemainList() {
+				/* 获取日期列表 */
+				const { departmentId, depCode } = this.getQuery();
+				const list = await getDepOrderSourceRemain({
+					depId: departmentId,
+					depCode,
+				});
+				/* 处理数据 */
+
+				const dateList = list.map((item) => {
+					const { date } = item;
+
+					const _date = date.replace(/-/g, "/");
+
+					const today = isToday(_date);
+					const day = new Date(_date).getDate();
+					const week = utils.getWeek(_date);
+					return { ...item, date: _date, showDay: day, today, week };
+				});
+				await this.updateData({
+					dateList,
+				});
+			},
+
+			/* 数据处理 */
+			formatData(list = []) {
+				const { dataSource } = this.data;
+				list.forEach((item) => {
+					const { items } = dataSource[item.type];
+					if (items) items.push(item);
+				});
+				return { ...dataSource };
+			},
+
+			/* 分页显示医生列表 */
+			async onSplitPage() {
+				let total = 0;
+				let dataList = [];
+				let success = true;
+				const { date, isLastPage } = this.data;
+				let { date: curDate = "" } = date || {};
+
+				if (curDate) {
+					const reg = new RegExp("/", "gm");
+					curDate = curDate.replace(reg, "-");
+				}
+
+				const { departmentId, depCode } = this.getQuery();
+				const params = {
+					date: curDate,
+					pageSize: 10,
+					depId: departmentId,
+					depCode,
+					pageIndex: this.pageIndex,
+				};
+
+				if (!isLastPage) {
+					try {
+						const { list = [], pagination = {} } = await getDepDoctorList(
+							params
+						);
+						dataList = list;
+						total = pagination.total || 0;
+					} catch (e) {
+						success = false;
+					}
+				}
+
+				let state = {
+					loading: false,
+				};
+
+				if (success) {
+					const { nativeList } = this.data;
+					const _list = [...nativeList, ...dataList];
+					state = {
+						...state,
+						nativeList: _list,
+						isLastPage: _list.length >= total,
+						dataSource: this.formatData(dataList),
+					};
+				}
+
+				await this.updateData(state);
+			},
+
+			/* 刷新数据 */
+			async onRefresh(curDate = "") {
+				/* 初始化数据 */
+				this.pageIndex = 1;
+				await this.updateData({
+					date: curDate,
+					loading: true,
+					nativeList: [],
+					isLastPage: false,
+					dataSource: copy(defaultSource),
+				});
+				await this.onSplitPage();
+			},
+		},
+	})
+);

+ 110 - 139
antbuilder/industry/hospitalV2/components/hospital-num-source/num-item/index.js

@@ -1,151 +1,122 @@
-import { connect } from 'herculex';
-import history from '../../../utils/history';
+import { connect } from "herculex";
+import history from "../../../utils/history";
 /* 默认头像 */
 
-const defaultUrl = 'https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*TuMaTaHOpyUAAAAAAAAAAAAAARQnAQ';
-Component(connect({
-  mapStateToProps: {
-    isLogin: ({
-      $global
-    }) => $global.userInfo.isLogin
-  }
-})({
-  props: {
-    item: {},
-    isFlex: true,
-    isRange: false,
-    componentData: {}
-  },
-  data: {
-    defaultUrl,
-    rangeItem: {},
-    routeState: {},
-    showRange: false,
-    showDoctor: false
-  },
+const defaultUrl =
+	"https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*TuMaTaHOpyUAAAAAAAAAAAAAARQnAQ";
+Component(
+	connect({
+		mapStateToProps: {
+			isLogin: ({ $global }) => $global.userInfo.isLogin,
+		},
+	})({
+		props: {
+			item: {},
+			isFlex: true,
+			isRange: false,
+			componentData: {},
+		},
+		data: {
+			defaultUrl,
+			rangeItem: {},
+			routeState: {},
+			showRange: false,
+			showDoctor: false,
+		},
 
-  didMount() {},
+		didMount() {},
 
-  methods: {
-    onPopupClose() {
-      this.props.onClose();
-    },
+		methods: {
+			onPopupClose() {
+				this.props.onClose();
+			},
 
-    /* 检查剩余 */
-    checkRemain(item) {
-      const {
-        remain = 0
-      } = item;
-      const disabled = remain < 1;
+			/* 检查剩余 */
+			checkRemain(item) {
+				const { remain = 0 } = item;
+				const disabled = remain < 1;
 
-      if (disabled) {
-        my.showToast({
-          content: '该医生当前已约满,无法预约!'
-        });
-      }
+				if (disabled) {
+					my.showToast({
+						content: "该医生当前已约满,无法预约!",
+					});
+				}
 
-      return !disabled;
-    },
+				return !disabled;
+			},
 
-    async toDoctorPage({
-      target
-    }) {
-      const {
-        item
-      } = target.dataset;
-      const {
-        doctorId
-      } = item;
-      const {
-        componentData
-      } = this.props;
-      if (!this.checkRemain(item)) return;
-      const {
-        department: {
-          departmentId
-        }
-      } = componentData;
-      history.push({
-        query: {
-          doctorId,
-          // 医生唯一识别号
-          depId: departmentId // 科室id
+			async toDoctorPage({ target }) {
+				const { item } = target.dataset;
+				const { doctorId } = item;
+				const { componentData } = this.props;
+				if (!this.checkRemain(item)) return;
+				const {
+					department: { departmentId },
+				} = componentData;
+				history.push({
+					query: {
+						doctorId,
+						// 医生唯一识别号
+						depId: departmentId, // 科室id
+					},
+					title: "医生主页",
+					pageType: "doctor-page",
+				});
+			},
 
-        },
-        title: '医生主页',
-        pageType: 'doctor-page'
-      });
-    },
+			async onItemFollow({ target }) {
+				const { item } = target.dataset;
+				console.log("onItemFollow ===>", item);
+				if (!this.checkRemain(item)) return;
+				const { rangeItem } = this.data;
+				const { componentData } = this.props;
+				const params = { ...rangeItem, ...componentData };
+				const {
+					level,
+					doctorId,
+					onlinePay = false,
+					name: doctorName,
+				} = this.props.item;
+				const { area, department } = params;
+				const { name: districtName } = area;
+				const { name: depName } = department;
+				const routeState = {
+					query: {
+						level,
+						depName,
+						doctorId,
+						doctorName,
+						onlinePay,
+						districtName,
+						payType: "就诊时支付",
+					},
+					title: "挂号确认",
+					pageType: "order-pay",
+				};
+				this.setData({
+					showRange: true,
+					rangeItem: item,
+					routeState,
+				});
+			},
 
-    async onItemFollow({
-      target
-    }) {
-      const {
-        item
-      } = target.dataset;
-      if (!this.checkRemain(item)) return;
-      const {
-        rangeItem
-      } = this.data;
-      const {
-        componentData
-      } = this.props;
-      const params = { ...rangeItem,
-        ...componentData
-      };
-      const {
-        level,
-        doctorId,
-        onlinePay = false,
-        name: doctorName
-      } = this.props.item;
-      const {
-        area,
-        department
-      } = params;
-      const {
-        name: districtName
-      } = area;
-      const {
-        name: depName
-      } = department;
-      const routeState = {
-        query: {
-          level,
-          depName,
-          doctorId,
-          doctorName,
-          onlinePay,
-          districtName,
-          payType: '就诊时支付'
-        },
-        title: '挂号确认',
-        pageType: 'order-pay'
-      };
-      this.setData({
-        showRange: true,
-        rangeItem: item,
-        routeState
-      });
-    },
+			onTimeRangeClose() {
+				this.setData({
+					showRange: false,
+				});
+			},
 
-    onTimeRangeClose() {
-      this.setData({
-        showRange: false
-      });
-    },
+			onClosedDoctor() {
+				this.setData({
+					showDoctor: false,
+				});
+			},
 
-    onClosedDoctor() {
-      this.setData({
-        showDoctor: false
-      });
-    },
-
-    onShowDoctor() {
-      this.setData({
-        showDoctor: true
-      });
-    }
-
-  }
-}));
+			onShowDoctor() {
+				this.setData({
+					showDoctor: true,
+				});
+			},
+		},
+	})
+);

+ 113 - 126
antbuilder/industry/hospitalV2/components/inpatient-tabs/index.js

@@ -1,136 +1,123 @@
-import history from '../../utils/history';
-import { getHospitalRecordList } from '../admission-record/service';
-import { getDailyBill } from './service';
+import history from "../../utils/history";
+import { getHospitalRecordList } from "../admission-record/service";
+import { getDailyBill } from "./service";
 Component({
-  data: {
-    hospitalRecordList: [],
-    dailyBillList: [],
-    tabs: [],
-    activeIndex: 0
-  },
-  props: {
-    componentData: {}
-  },
+	data: {
+		hospitalRecordList: [],
+		dailyBillList: [],
+		tabs: [],
+		activeIndex: 0,
+	},
+	props: {
+		componentData: {},
+	},
 
-  didMount() {
-    this.getHospitalRecordLists();
-    this.getDailyBillData();
-    const {
-      inpatientIndexTab
-    } = this.props.componentData.componentExtInfo;
-    this.setData({
-      tabs: inpatientIndexTab ? JSON.parse(inpatientIndexTab) : []
-    });
-  },
+	didMount() {
+		this.getHospitalRecordLists();
+		this.getDailyBillData();
+		const { inpatientIndexTab } = this.props.componentData.componentExtInfo;
+		this.setData({
+			tabs: inpatientIndexTab ? JSON.parse(inpatientIndexTab) : [],
+		});
+	},
 
-  methods: {
-    handleTabClick({
-      index,
-      tabsName
-    }) {
-      this.setData({
-        [tabsName]: index,
-        activeIndex: index
-      });
-    },
+	methods: {
+		handleTabClick({ index, tabsName }) {
+			this.setData({
+				[tabsName]: index,
+				activeIndex: index,
+			});
+		},
 
-    // 获取首页日清列表
-    async getDailyBillData() {
-      const dailyBillList = await getDailyBill();
-      this.setData({
-        dailyBillList
-      });
-    },
+		// 获取首页日清列表
+		async getDailyBillData() {
+			const dailyBillList = await getDailyBill();
+			this.setData({
+				dailyBillList,
+			});
+		},
 
-    // 获取住院人列表
-    async getHospitalRecordLists() {
-      // 调用接口 - 获取就住院人列表
-      const hospitalRecordList = await getHospitalRecordList();
-      this.setData({
-        hospitalRecordList: hospitalRecordList || []
-      });
-    },
+		// 获取住院人列表
+		async getHospitalRecordLists() {
+			// 调用接口 - 获取就住院人列表
+			const hospitalRecordList = await getHospitalRecordList();
+			this.setData({
+				hospitalRecordList: hospitalRecordList || [],
+			});
+		},
 
-    // 功能选项点击
-    onClickFunction(e) {
-      // 获取当前选中项类型
-      const {
-        hospitalRecordList
-      } = this.data;
-      const {
-        itemName,
-        pagePath
-      } = e.target.dataset.item; // eslint-disable-next-line default-case
+		// 功能选项点击
+		onClickFunction(e) {
+			// 获取当前选中项类型
+			const { hospitalRecordList } = this.data;
+			const { itemName, pagePath } = e.target.dataset.item; // eslint-disable-next-line default-case
 
-      switch (pagePath) {
-        // 入院登记
-        case 'admission-record':
-          history.push({
-            title: itemName,
-            pageType: pagePath,
-            query: {
-              color: '#000',
-              backBtnColor: '#000',
-              background: '#fff'
-            }
-          });
-          break;
-        // 押金缴纳 || 日清单查询 || 出院结算
+			switch (pagePath) {
+				// 入院登记
+				case "admission-record":
+					history.push({
+						title: itemName,
+						pageType: pagePath,
+						query: {
+							color: "#000",
+							backBtnColor: "#000",
+							background: "#fff",
+						},
+					});
+					break;
+				// 押金缴纳 || 日清单查询 || 出院结算
 
-        case 'deposit':
-        case 'inventory-day':
-        case 'settlement':
-          // 无住院人数据,跳转至住院人页
-          if (!(hospitalRecordList && hospitalRecordList.length > 0)) {
-            my.showToast({
-              content: '请先进行入院登记',
-              duration: 1500,
-              success: () => {
-                history.push({
-                  title: itemName,
-                  pageType: 'admission-record',
-                  query: {
-                    color: '#000',
-                    backBtnColor: '#000',
-                    background: '#fff'
-                  }
-                });
-              }
-            });
-          } else {
-            history.push({
-              title: itemName,
-              pageType: pagePath,
-              query: {
-                color: '#000',
-                backBtnColor: '#000',
-                background: '#fff'
-              }
-            });
-          }
+				case "deposit":
+				case "inventory-day":
+				case "settlement":
+					// 无住院人数据,跳转至住院人页
+					if (!(hospitalRecordList && hospitalRecordList.length > 0)) {
+						my.showToast({
+							content: "请先进行入院登记",
+							duration: 1500,
+							success: () => {
+								history.push({
+									title: itemName,
+									pageType: "admission-record",
+									query: {
+										color: "#000",
+										backBtnColor: "#000",
+										background: "#fff",
+									},
+								});
+							},
+						});
+					} else {
+						history.push({
+							title: itemName,
+							pageType: pagePath,
+							query: {
+								color: "#000",
+								backBtnColor: "#000",
+								background: "#fff",
+							},
+						});
+					}
 
-          break;
-      }
-    },
+					break;
+			}
+		},
 
-    // 跳转日清单查询
-    toDailyBill(e) {
-      const {
-        inpatientId,
-        checkInDate
-      } = e.target.dataset.item;
-      history.push({
-        query: {
-          inpatientId,
-          billDate: checkInDate.slice(0, 11),
-          color: '#000',
-          backBtnColor: '#000',
-          background: '#fff'
-        },
-        title: '日清单查询',
-        pageType: 'inventory-day'
-      });
-    }
-
-  }
-});
+		// 跳转日清单查询
+		toDailyBill(e) {
+			const { inpatientId, checkInDate } = e.target.dataset.item;
+			console.log("inpatientId,checkInDate", inpatientId, checkInDate);
+			history.push({
+				query: {
+					inpatientId,
+					billDate: checkInDate.slice(0, 11),
+					color: "#000",
+					backBtnColor: "#000",
+					background: "#fff",
+				},
+				title: "日清单查询",
+				pageType: "inventory-day",
+			});
+		},
+	},
+});

+ 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.area ? jsonData.Inpatient.area + ',' : ''}}{{jsonData.Inpatient.bedspace}}
+      {{jsonData.Inpatient.sex ? jsonData.Inpatient.sex + ',' : ''}}{{jsonData.Inpatient.inpatientAge ? jsonData.Inpatient.inpatientAge + ',' : ''}}{{jsonData.Inpatient.patientId ? jsonData.Inpatient.patientId : ''}}
     </view>
   </view>
   <!-- 时间切换 -->

+ 222 - 232
antbuilder/industry/hospitalV2/components/inventory-day/index.js

@@ -1,234 +1,224 @@
-import { getMedicineInfo, getDischargeSettlementDetails } from './service'; // import history from '../../utils/history';
+import { getMedicineInfo, getDischargeSettlementDetails } from "./service"; // import history from '../../utils/history';
 
-import { reportCmPV_YL, reportApi } from '../../utils/cloudMonitorHelper';
+import { reportCmPV_YL, reportApi } from "../../utils/cloudMonitorHelper";
 Component({
-  data: {
-    jsonData: {
-      Inpatient: {},
-      // 住院人详情
-      details: [] // 日清单
-
-    },
-    selectedDateStr: '',
-    // 日清单的时间
-    calendarShow: false,
-    // 是否显示时间
-    selectedDate: null,
-    // 选择的时间
-    isError: false,
-    // 显示没有数据的情况
-    inpatientId: '',
-    // 住院人id
-    selectIndex: 0,
-    // 回显选中住院人
-    attention: ''
-  },
-
-  didMount() {
-    const {
-      inpatientId,
-      billDate,
-      attention
-    } = this.$page.data.query || {};
-    const toDay = new Date();
-    this.setData({
-      selectedDate: toDay,
-      selectedDateStr: billDate || `${toDay.getFullYear()}-${this.changeMonth(toDay.getMonth())}-${this.changeDate(toDay.getDate())}`,
-      inpatientId,
-      attention
-    });
-    /* 服务预警,日清单查询 */
-
-    reportCmPV_YL({
-      title: '日清单查询'
-    });
-    /* 服务办结,日清单查询 */
-
-    reportApi('日清单查询');
-  },
-
-  methods: {
-    // 获取日清单详情
-    async getDeails() {
-      try {
-        const {
-          inpatientId,
-          selectedDateStr,
-          jsonData
-        } = this.data;
-        const details = await getMedicineInfo({
-          inpatientId,
-          billDate: selectedDateStr
-        });
-        const payItemList = details.payItemList ? details.payItemList.length : 0;
-        this.setData({
-          jsonData: { ...jsonData,
-            details
-          },
-          isError: payItemList === 0
-        });
-      } catch (error) {
-        console.log(error, 'error');
-      }
-    },
-
-    popOverClose() {
-      // 关闭弹出框
-      this.$page.$popModal.hidePopover();
-    },
-
-    onAdmissionRegistration() {
-      this.$page.$popModal.showPopover({
-        title: '选择就诊人',
-        popupPosition: 'bottom',
-        onButtonClose: () => this.popOverClose(),
-        // 弹出框关闭
-        onChoosePatient: info => this.choosePatient(info) // 选择就诊人
-
-      });
-    },
-
-    choosePatient(info) {
-      const {
-        jsonData
-      } = this.data;
-      const {
-        hospitalizationRecordList
-      } = this.$page.$popModal.data;
-      const selectIndex = hospitalizationRecordList.findIndex(item => info.inpatientId === item.inpatientId); // 获取用户id
-
-      this.setData({
-        jsonData: { ...jsonData,
-          Inpatient: info
-        },
-        inpatientId: info.inpatientId,
-        selectIndex
-      });
-      this.getDeails();
-      this.$page.$popModal.hidePopover();
-    },
-
-    async getJsonData(info) {
-      const {
-        inpatientId
-      } = this.data;
-
-      try {
-        // 分为两种情况,第一种当从住院人列表跳转过来的时候,有住院人id,第二种是从首页跳转过来,无住院人id
-        if (!inpatientId) {
-          const infoDetail = info && info.length > 0;
-          const {
-            jsonData
-          } = this.data;
-          this.setData({
-            jsonData: { ...jsonData,
-              Inpatient: infoDetail ? info[0] : {}
-            },
-            inpatientId: infoDetail ? info[0].inpatientId : ''
-          });
-        } else {
-          const res = await getDischargeSettlementDetails({
-            inpatientId
-          });
-          this.choosePatient(res);
-        }
-      } catch (error) {
-        console.log(error, 'error');
-      }
-
-      this.getDeails();
-    },
-
-    getJsonDataFn(info) {
-      if (!info || info.length === 0) {
-        my.alert({
-          content: this.data.attention || '请绑定住院人',
-          success: () => {
-            my.navigateBack();
-          }
-        });
-        return false;
-      }
-
-      this.getJsonData(info);
-    },
-
-    handleSelect(date) {
-      if (date[0].getTime() > new Date().getTime()) {
-        my.showToast({
-          type: 'none',
-          content: '不能选未来的日子',
-          duration: 2000
-        });
-        this.setData({
-          calendarShow: false
-        });
-        return;
-      }
-
-      this.setData({
-        selectedDate: date[0],
-        selectedDateStr: `${date[0].getFullYear()}-${this.changeMonth(date[0].getMonth())}-${this.changeDate(date[0].getDate())}`,
-        calendarShow: false
-      });
-      this.getDeails();
-    },
-
-    selectDate() {
-      this.setData({
-        calendarShow: true
-      });
-    },
-
-    closeCalendar() {
-      this.setData({
-        calendarShow: false
-      });
-    },
-
-    changeMonth(month) {
-      return month + 1 >= 10 ? month + 1 : `0${month + 1}`;
-    },
-
-    changeDate(date) {
-      return date >= 10 ? date : `0${date}`;
-    },
-
-    // 获取前一天的日清单详情
-    queryPreDay() {
-      if (this.data.selectedDate) {
-        const preDay = this.data.selectedDate.getTime() - 24 * 60 * 60 * 1000;
-        const preDayDate = new Date(preDay);
-        this.setData({
-          selectedDate: preDayDate,
-          selectedDateStr: `${preDayDate.getFullYear()}-${this.changeMonth(preDayDate.getMonth())}-${this.changeDate(preDayDate.getDate())}`
-        });
-        this.getDeails();
-      }
-    },
-
-    // 获取下一天的日清单日详情
-    queryNextDay() {
-      if (this.data.selectedDate) {
-        const nextDay = this.data.selectedDate.getTime() + 24 * 60 * 60 * 1000;
-
-        if (nextDay > new Date().getTime()) {
-          my.showToast({
-            type: 'none',
-            content: '不能选未来的日子',
-            duration: 2000
-          });
-          return;
-        }
-
-        const nextDayDate = new Date(nextDay);
-        this.setData({
-          selectedDate: nextDayDate,
-          selectedDateStr: `${nextDayDate.getFullYear()}-${this.changeMonth(nextDayDate.getMonth())}-${this.changeDate(nextDayDate.getDate())}`
-        });
-        this.getDeails();
-      }
-    }
-
-  }
-});
+	data: {
+		jsonData: {
+			Inpatient: {},
+			// 住院人详情
+			details: [], // 日清单
+		},
+		selectedDateStr: "",
+		// 日清单的时间
+		calendarShow: false,
+		// 是否显示时间
+		selectedDate: null,
+		// 选择的时间
+		isError: false,
+		// 显示没有数据的情况
+		inpatientId: "",
+		// 住院人id
+		selectIndex: 0,
+		// 回显选中住院人
+		attention: "",
+	},
+
+	didMount() {
+		const { inpatientId, billDate, attention } = this.$page.data.query || {};
+		const toDay = new Date();
+		this.setData({
+			selectedDate: toDay,
+			selectedDateStr:
+				billDate ||
+				`${toDay.getFullYear()}-${this.changeMonth(
+					toDay.getMonth()
+				)}-${this.changeDate(toDay.getDate())}`,
+			inpatientId,
+			attention,
+		});
+		/* 服务预警,日清单查询 */
+
+		reportCmPV_YL({
+			title: "日清单查询",
+		});
+		/* 服务办结,日清单查询 */
+
+		reportApi("日清单查询");
+	},
+
+	methods: {
+		// 获取日清单详情
+		async getDeails() {
+			try {
+				const { inpatientId, selectedDateStr, jsonData } = this.data;
+				const details = await getMedicineInfo({
+					inpatientId,
+					hisPatientId: inpatientId,
+					billDate: selectedDateStr,
+				});
+				const payItemList = details.payItemList
+					? details.payItemList.length
+					: 0;
+				this.setData({
+					jsonData: { ...jsonData, details },
+					isError: payItemList === 0,
+				});
+			} catch (error) {
+				console.log(error, "error");
+			}
+		},
+
+		popOverClose() {
+			// 关闭弹出框
+			this.$page.$popModal.hidePopover();
+		},
+
+		onAdmissionRegistration() {
+			this.$page.$popModal.showPopover({
+				title: "选择就诊人",
+				popupPosition: "bottom",
+				onButtonClose: () => this.popOverClose(),
+				// 弹出框关闭
+				onChoosePatient: (info) => this.choosePatient(info), // 选择就诊人
+			});
+		},
+
+		choosePatient(info) {
+			const { jsonData } = this.data;
+			const { hospitalizationRecordList } = this.$page.$popModal.data;
+			const selectIndex = hospitalizationRecordList.findIndex(
+				(item) => info.inpatientId === item.inpatientId
+			); // 获取用户id
+
+			this.setData({
+				jsonData: { ...jsonData, Inpatient: info },
+				inpatientId: info.inpatientId,
+				selectIndex,
+			});
+			this.getDeails();
+			this.$page.$popModal.hidePopover();
+		},
+
+		async getJsonData(info) {
+			const { inpatientId } = this.data;
+
+			try {
+				// 分为两种情况,第一种当从住院人列表跳转过来的时候,有住院人id,第二种是从首页跳转过来,无住院人id
+				if (!inpatientId) {
+					const infoDetail = info && info.length > 0;
+					const { jsonData } = this.data;
+					this.setData({
+						jsonData: { ...jsonData, Inpatient: infoDetail ? info[0] : {} },
+						inpatientId: infoDetail ? info[0].inpatientId : "",
+					});
+				} else {
+					const res = await getDischargeSettlementDetails({
+						inpatientId,
+					});
+					this.choosePatient(res);
+				}
+			} catch (error) {
+				console.log(error, "error");
+			}
+
+			this.getDeails();
+		},
+
+		getJsonDataFn(info) {
+			if (!info || info.length === 0) {
+				my.alert({
+					content: this.data.attention || "请绑定住院人",
+					success: () => {
+						my.navigateBack();
+					},
+				});
+				return false;
+			}
+
+			this.getJsonData(info);
+		},
+
+		handleSelect(date) {
+			if (date[0].getTime() > new Date().getTime()) {
+				my.showToast({
+					type: "none",
+					content: "不能选未来的日子",
+					duration: 2000,
+				});
+				this.setData({
+					calendarShow: false,
+				});
+				return;
+			}
+
+			this.setData({
+				selectedDate: date[0],
+				selectedDateStr: `${date[0].getFullYear()}-${this.changeMonth(
+					date[0].getMonth()
+				)}-${this.changeDate(date[0].getDate())}`,
+				calendarShow: false,
+			});
+			this.getDeails();
+		},
+
+		selectDate() {
+			this.setData({
+				calendarShow: true,
+			});
+		},
+
+		closeCalendar() {
+			this.setData({
+				calendarShow: false,
+			});
+		},
+
+		changeMonth(month) {
+			return month + 1 >= 10 ? month + 1 : `0${month + 1}`;
+		},
+
+		changeDate(date) {
+			return date >= 10 ? date : `0${date}`;
+		},
+
+		// 获取前一天的日清单详情
+		queryPreDay() {
+			if (this.data.selectedDate) {
+				const preDay = this.data.selectedDate.getTime() - 24 * 60 * 60 * 1000;
+				const preDayDate = new Date(preDay);
+				this.setData({
+					selectedDate: preDayDate,
+					selectedDateStr: `${preDayDate.getFullYear()}-${this.changeMonth(
+						preDayDate.getMonth()
+					)}-${this.changeDate(preDayDate.getDate())}`,
+				});
+				this.getDeails();
+			}
+		},
+
+		// 获取下一天的日清单日详情
+		queryNextDay() {
+			if (this.data.selectedDate) {
+				const nextDay = this.data.selectedDate.getTime() + 24 * 60 * 60 * 1000;
+
+				if (nextDay > new Date().getTime()) {
+					my.showToast({
+						type: "none",
+						content: "不能选未来的日子",
+						duration: 2000,
+					});
+					return;
+				}
+
+				const nextDayDate = new Date(nextDay);
+				this.setData({
+					selectedDate: nextDayDate,
+					selectedDateStr: `${nextDayDate.getFullYear()}-${this.changeMonth(
+						nextDayDate.getMonth()
+					)}-${this.changeDate(nextDayDate.getDate())}`,
+				});
+				this.getDeails();
+			}
+		},
+	},
+});

+ 4 - 0
antbuilder/industry/hospitalV2/components/patient-detail-edit/index.js

@@ -23,6 +23,10 @@ Component({
 	didMount() {
 		this.querySingle();
 		this.onEventChange();
+		// this.$page.updatePatient = this;
+		// const page = getCurrentPages();
+		// console.log("page", this.$page);
+		// console.log("page ===>", page);
 	},
 
 	didUnmount() {

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

@@ -5,7 +5,6 @@
       <view class="patient-name">请输入新手机号</view>
       <view class="patient-flex">
         <input class="input" placeholder-class="patient-place" type="number" value="{{ phone }}" onInput="onInput" placeholder="请输入手机号" />
-        <image class="patient-icon" mode="aspectFit" src="https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*EEyRS4pqNQwAAAAAAAAAAAAAARQnAQ" />
       </view>
     </view>
 

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

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

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

@@ -16,11 +16,13 @@ Component({
 			recordId = 1,
 			type = "检查报告",
 			cardNum,
+			hisPatientId,
 		} = this.$page.data.query || {};
 		getReportDetail({
 			recordId,
 			type,
 			cardNum,
+			hisPatientId,
 		}).then((res) => {
 			const {
 				cardNum,

+ 2 - 1
antbuilder/industry/hospitalV2/components/report-list/record-item/index.js

@@ -9,7 +9,7 @@ Component({
 
 	methods: {
 		onTapItem() {
-			const { recordId, status, type, cardNum } = this.props.item;
+			const { recordId, status, type, cardNum, hisPatientId } = this.props.item;
 
 			if (status === "未出报告") {
 				return my.showToast({
@@ -25,6 +25,7 @@ Component({
 					recordId,
 					type,
 					cardNum,
+					hisPatientId,
 				},
 				pageType: "report-details-list",
 			});

+ 159 - 193
antbuilder/industry/hospitalV2/components/select-department/index.js

@@ -1,194 +1,160 @@
-import history from './../../utils/history';
-import { getContentHeight } from '../../utils';
-import { getDepartmentList } from './service';
-import { queryServiceByCode } from '../../service/common';
-import { reportCmPV_YL } from '../../utils/cloudMonitorHelper';
+import history from "./../../utils/history";
+import { getContentHeight } from "../../utils";
+import { getDepartmentList } from "./service";
+import { queryServiceByCode } from "../../service/common";
+import { reportCmPV_YL } from "../../utils/cloudMonitorHelper";
 Component({
-  props: {
-    componentData: {}
-  },
-  data: {
-    index: 0,
-    show: false,
-    menus: [],
-    cache: {},
-    lastCache: {},
-    loading: true,
-    serviceItem: null,
-    contentHeight: getContentHeight()
-  },
-
-  async didMount() {
-    /* 服务预警, 预约挂号 */
-    reportCmPV_YL({
-      title: '预约挂号'
-    });
-    const {
-      hospitalDistrictId
-    } = this.getQuery();
-
-    try {
-      await this.getServiceDetail(); // eslint-disable-next-line no-empty
-    } catch (e) {}
-
-    await this.fetchMenus(hospitalDistrictId);
-  },
-
-  methods: {
-    updateData(data) {
-      return new Promise(resolve => this.setData(data, resolve));
-    },
-
-    async getServiceDetail() {
-      const code = 'hospital_service_code';
-      const {
-        link,
-        uuid,
-        title,
-        linkType,
-        accessMode,
-        serviceDesc
-      } = await queryServiceByCode(code);
-      const serviceItem = {
-        url: link,
-        accessMode,
-        name: title,
-        serviceDesc,
-        urlType: linkType,
-        serviceUUID: uuid
-      };
-      await this.updateData({
-        serviceItem
-      });
-    },
-
-    getQuery() {
-      const {
-        $routeConfig
-      } = this.$page;
-      return $routeConfig.query;
-    },
-
-    async fetchProxy(func, ...arg) {
-      my.showLoading();
-      await func(...arg).finally(my.hideLoading);
-    },
-
-    /* 检测缓存 */
-    hasCache() {
-      const {
-        index,
-        cache
-      } = this.data;
-      return (cache[index] || []).length > 0;
-    },
-
-    /* 设置缓存 */
-    setCache(list) {
-      const {
-        index: i,
-        cache: _cache
-      } = this.data;
-      const cache = { ..._cache
-      };
-      cache[i] = list;
-      return this.updateData({
-        cache
-      });
-    },
-
-    /* 获取一级列表数据 */
-    async fetchMenus(hospitalDistrictId) {
-      const params = {
-        hospitalDistrictId
-      };
-      const list = await getDepartmentList(params);
-      await this.updateData({
-        menus: list,
-        loading: false
-      });
-      /* 获取一级列表下面的第一项的第一个 */
-
-      const departmentId = this.getDepartmentId(0);
-      await this.fetchDepartments(departmentId, list[0]);
-    },
-
-    /* 获取二级列表 */
-    async fetchDepartments(departmentId, item) {
-      if (this.hasCache()) return;
-      const list = !departmentId ? [item] : await getDepartmentList({
-        parentId: departmentId
-      });
-      this.setCache(list);
-    },
-
-    /* 获取科室id */
-    getDepartmentId(index) {
-      const {
-        menus = []
-      } = this.data;
-      const {
-        hasChildren,
-        departmentId
-      } = menus[index] || {};
-      if (hasChildren) return departmentId;
-    },
-
-    /* 切换科室 */
-    async onTapMenu(i) {
-      const item = this.data.menus[i];
-      await this.updateData({
-        index: i
-      });
-      const departmentId = this.getDepartmentId(i);
-      await this.fetchDepartments(departmentId, item);
-    },
-
-    /* 获取三级列表数据 */
-    async onTapOpenLast(item) {
-      const {
-        departmentId
-      } = item;
-      const {
-        lastCache
-      } = this.data;
-      const cacheList = lastCache[departmentId] || [];
-      if (cacheList.length > 0) return cacheList;
-      my.showLoading();
-      const list = await getDepartmentList({
-        parentId: departmentId
-      }).finally(my.hideLoading);
-      lastCache[departmentId] = list;
-      await this.updateData({
-        lastCache: { ...lastCache
-        }
-      });
-      return list;
-    },
-
-    onTapItem(item) {
-      const query = this.getQuery();
-      const {
-        name: areaName
-      } = query;
-      const {
-        componentData
-      } = this.props;
-      const {
-        departmentId,
-        name: dpName
-      } = item;
-      history.push({
-        query: {
-          departmentId
-        },
-        title: `${dpName}(${areaName})`,
-        pageType: 'hospital-num-source',
-        componentData: { ...componentData,
-          department: item
-        }
-      });
-    }
-
-  }
-});
+	props: {
+		componentData: {},
+	},
+	data: {
+		index: 0,
+		show: false,
+		menus: [],
+		cache: {},
+		lastCache: {},
+		loading: true,
+		serviceItem: null,
+		contentHeight: getContentHeight(),
+	},
+
+	async didMount() {
+		/* 服务预警, 预约挂号 */
+		reportCmPV_YL({
+			title: "预约挂号",
+		});
+		const { hospitalDistrictId } = this.getQuery();
+
+		try {
+			await this.getServiceDetail(); // eslint-disable-next-line no-empty
+		} catch (e) {}
+
+		await this.fetchMenus(hospitalDistrictId);
+	},
+
+	methods: {
+		updateData(data) {
+			return new Promise((resolve) => this.setData(data, resolve));
+		},
+
+		async getServiceDetail() {
+			const code = "hospital_service_code";
+			const { link, uuid, title, linkType, accessMode, serviceDesc } =
+				await queryServiceByCode(code);
+			const serviceItem = {
+				url: link,
+				accessMode,
+				name: title,
+				serviceDesc,
+				urlType: linkType,
+				serviceUUID: uuid,
+			};
+			await this.updateData({
+				serviceItem,
+			});
+		},
+
+		getQuery() {
+			const { $routeConfig } = this.$page;
+			return $routeConfig.query;
+		},
+
+		async fetchProxy(func, ...arg) {
+			my.showLoading();
+			await func(...arg).finally(my.hideLoading);
+		},
+
+		/* 检测缓存 */
+		hasCache() {
+			const { index, cache } = this.data;
+			return (cache[index] || []).length > 0;
+		},
+
+		/* 设置缓存 */
+		setCache(list) {
+			const { index: i, cache: _cache } = this.data;
+			const cache = { ..._cache };
+			cache[i] = list;
+			return this.updateData({
+				cache,
+			});
+		},
+
+		/* 获取一级列表数据 */
+		async fetchMenus(hospitalDistrictId) {
+			const params = {
+				hospitalDistrictId,
+			};
+			const list = await getDepartmentList(params);
+			await this.updateData({
+				menus: list,
+				loading: false,
+			});
+			/* 获取一级列表下面的第一项的第一个 */
+
+			const departmentId = this.getDepartmentId(0);
+			await this.fetchDepartments(departmentId, list[0]);
+		},
+
+		/* 获取二级列表 */
+		async fetchDepartments(departmentId, item) {
+			if (this.hasCache()) return;
+			const list = !departmentId
+				? [item]
+				: await getDepartmentList({
+						parentId: departmentId,
+				  });
+			this.setCache(list);
+		},
+
+		/* 获取科室id */
+		getDepartmentId(index) {
+			const { menus = [] } = this.data;
+			const { hasChildren, departmentId } = menus[index] || {};
+			if (hasChildren) return departmentId;
+		},
+
+		/* 切换科室 */
+		async onTapMenu(i) {
+			const item = this.data.menus[i];
+			await this.updateData({
+				index: i,
+			});
+			const departmentId = this.getDepartmentId(i);
+			await this.fetchDepartments(departmentId, item);
+		},
+
+		/* 获取三级列表数据 */
+		async onTapOpenLast(item) {
+			const { departmentId } = item;
+			const { lastCache } = this.data;
+			const cacheList = lastCache[departmentId] || [];
+			if (cacheList.length > 0) return cacheList;
+			my.showLoading();
+			const list = await getDepartmentList({
+				parentId: departmentId,
+			}).finally(my.hideLoading);
+			lastCache[departmentId] = list;
+			await this.updateData({
+				lastCache: { ...lastCache },
+			});
+			return list;
+		},
+
+		onTapItem(item) {
+			const query = this.getQuery();
+			const { name: areaName } = query;
+			const { componentData } = this.props;
+			const { departmentId, name: dpName, departmentCode: depCode } = item;
+			history.push({
+				query: {
+					departmentId,
+					depCode,
+				},
+				title: `${dpName}(${areaName})`,
+				pageType: "hospital-num-source",
+				componentData: { ...componentData, department: item },
+			});
+		},
+	},
+});