Przeglądaj źródła

fix: 报告详情添加额外字段

carver 2 lat temu
rodzic
commit
23d0663a52

+ 111 - 113
antbuilder/industry/hospitalV2/components/report-details-list/reportDetailsList.js

@@ -1,121 +1,119 @@
-import { getReportDetail } from './service';
-import history from '../../utils/history';
-import { reportApi } from '../../utils/cloudMonitorHelper';
+import { getReportDetail } from "./service";
+import history from "../../utils/history";
+import { reportApi } from "../../utils/cloudMonitorHelper";
 Component({
-  props: {},
-  data: {
-    details: null,
-    reportDetailsInfo: {},
-    recordId: ''
-  },
+	props: {},
+	data: {
+		details: null,
+		reportDetailsInfo: {},
+		recordId: "",
+	},
 
-  onInit() {},
+	onInit() {},
 
-  didMount() {
-    console.log('didMount');
-    const {
-      recordId = 1
-    } = this.$page.data.query || {};
-    getReportDetail({
-      recordId
-    }).then(res => {
-      const {
-        cardNum,
-        userName,
-        userSex,
-        userAge,
-        sampleType,
-        applyDate,
-        departmentName,
-        ...rest
-      } = res;
-      const essentialInformationList = [{
-        title: '就诊人',
-        value: `${userName},${userSex},${userAge}岁`
-      }, {
-        title: '就诊卡号',
-        value: cardNum
-      }, {
-        title: '标本种类',
-        value: sampleType
-      }, {
-        title: '就诊科室',
-        value: departmentName
-      }, {
-        title: '采样时间',
-        value: applyDate
-      }];
-      this.setData({
-        details: res,
-        reportDetailsInfo: { ...rest,
-          essentialInformationList
-        }
-      });
-    });
-    /* 服务办结,报告查询 */
+	didMount() {
+		const {
+			recordId = 1,
+			type = "检查报告",
+			cardNum,
+		} = this.$page.data.query || {};
+		getReportDetail({
+			recordId,
+			type,
+			cardNum,
+		}).then((res) => {
+			const {
+				cardNum,
+				userName,
+				userSex,
+				userAge,
+				sampleType,
+				applyDate,
+				departmentName,
+				...rest
+			} = res;
+			const essentialInformationList = [
+				{
+					title: "就诊人",
+					value: `${userName},${userSex},${userAge}岁`,
+				},
+				{
+					title: "就诊卡号",
+					value: cardNum,
+				},
+				{
+					title: "标本种类",
+					value: sampleType,
+				},
+				{
+					title: "就诊科室",
+					value: departmentName,
+				},
+				{
+					title: "采样时间",
+					value: applyDate,
+				},
+			];
+			this.setData({
+				details: res,
+				reportDetailsInfo: { ...rest, essentialInformationList },
+			});
+		});
+		/* 服务办结,报告查询 */
 
-    reportApi('报告查询');
-  },
+		reportApi("报告查询");
+	},
 
-  methods: {
-    /**
-     * 图片放大
-     */
-    previewImage(e) {
-      const {
-        currentTarget: {
-          dataset: {
-            item
-          }
-        }
-      } = e;
-      my.previewImage({
-        current: 0,
-        urls: [item]
-      });
-    },
+	methods: {
+		/**
+		 * 图片放大
+		 */
+		previewImage(e) {
+			const {
+				currentTarget: {
+					dataset: { item },
+				},
+			} = e;
+			my.previewImage({
+				current: 0,
+				urls: [item],
+			});
+		},
 
-    /**
-     * 纸质打印报告
-     */
-    paperPrintingBtn() {
-      history.toH5(this.data.reportDetailsInfo.navigationUrl);
-    },
+		/**
+		 * 纸质打印报告
+		 */
+		paperPrintingBtn() {
+			history.toH5(this.data.reportDetailsInfo.navigationUrl);
+		},
 
-    /**
-     * 复诊挂号
-     */
-    registrationBtn() {
-      const {
-        details
-      } = this.data;
-      const {
-        districtId,
-        departmentId,
-        districtName,
-        departmentName
-      } = details;
-      history.push({
-        query: {
-          departmentId
-        },
-        pageType: 'hospital-num-source',
-        title: `${departmentName}(${districtName})`,
-        componentData: {
-          /* 区域 */
-          area: {
-            name: districtName,
-            hospitalDistrictId: districtId
-          },
+		/**
+		 * 复诊挂号
+		 */
+		registrationBtn() {
+			const { details } = this.data;
+			const { districtId, departmentId, districtName, departmentName } =
+				details;
+			history.push({
+				query: {
+					departmentId,
+				},
+				pageType: "hospital-num-source",
+				title: `${departmentName}(${districtName})`,
+				componentData: {
+					/* 区域 */
+					area: {
+						name: districtName,
+						hospitalDistrictId: districtId,
+					},
 
-          /* 科室 */
-          department: {
-            departmentId,
-            name: departmentName
-          }
-        }
-      });
-    }
-
-  }
-});
+					/* 科室 */
+					department: {
+						departmentId,
+						name: departmentName,
+					},
+				},
+			});
+		},
+	},
+});

+ 4 - 1
antbuilder/industry/hospitalV2/components/report-list/index.js

@@ -47,7 +47,10 @@ Component({
 			if (!this.filters && patient) {
 				this.filters = {
 					type: "检查报告",
-					cardNum: patient.medicCards[0].cardNum,
+					cardNum:
+						patient.medicCards && patient.medicCards.length !== 0
+							? patient.medicCards[0].cardNum
+							: "",
 				};
 				this.flatRef.refresh();
 			}

+ 28 - 31
antbuilder/industry/hospitalV2/components/report-list/record-item/index.js

@@ -1,36 +1,33 @@
-import history from '../../../utils/history';
+import history from "../../../utils/history";
 Component({
-  props: {
-    item: {}
-  },
-  data: {},
+	props: {
+		item: {},
+	},
+	data: {},
 
-  didMount() {},
+	didMount() {},
 
-  methods: {
-    onTapItem() {
-      const {
-        recordId,
-        status
-      } = this.props.item;
-      console.log(this.props.item, 'this.props.item');
+	methods: {
+		onTapItem() {
+			const { recordId, status, type, cardNum } = this.props.item;
 
-      if (status === '未出报告') {
-        return my.showToast({
-          content: '未出报告 无法查看',
-          duration: 1000
-        });
-      }
+			if (status === "未出报告") {
+				return my.showToast({
+					content: "未出报告 无法查看",
+					duration: 1000,
+				});
+			}
 
-      history.push({
-        title: '报告详情',
-        header: 'none',
-        query: {
-          recordId
-        },
-        pageType: 'report-details-list'
-      });
-    }
-
-  }
-});
+			history.push({
+				title: "报告详情",
+				header: "none",
+				query: {
+					recordId,
+					type,
+					cardNum,
+				},
+				pageType: "report-details-list",
+			});
+		},
+	},
+});