dischargeMedication.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <view class="userInfoTopFixe">
  5. <UserInfo :user-info="currentUser" type="hospital"></UserInfo>
  6. <Screening
  7. :screen="screen"
  8. @setScreenData="setScreenData"
  9. @queryRecords="queryRecords"
  10. @resetScreen="resetScreen"
  11. @changeStartDate="changeStartDate"
  12. @changeEndDate="changeEndDate"
  13. ></Screening>
  14. </view>
  15. <view class="recordBox">
  16. <view v-if="recordList.length == 0" class="noData">
  17. <NoData :value="noDataValue"></NoData>
  18. </view>
  19. <view class="recordBox_list">
  20. <view
  21. class="record_item border_bottom displayFlexBetween"
  22. v-if="recordList.length > 0"
  23. v-for="(item, index) in recordList"
  24. :key="index"
  25. @click="jumpDetail(item)"
  26. >
  27. <view class="record_left">
  28. <view class="name">{{item.DeptName}}</view>
  29. <view class="text">{{item.DischargeTime}} {{item.CompetentDoctor}}</view>
  30. </view>
  31. <image class="public_right_img public_right_img30" :src="iconUrl.icon_right"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script setup lang="ts">
  39. import { ref, getCurrentInstance } from 'vue';
  40. import { useOnLoad } from '@dcloudio/uni-app';
  41. import { common } from '@/utils';
  42. import icon from '@/utils/icon';
  43. import { queryInpatientList } from '@/pagesPatient/service/record';
  44. import UserInfo from '@/pagesPersonal/st1/components/userInfo/userInfo.vue';
  45. import Screening from '@/pagesPatient/st1/components/screening/screening.vue';
  46. import NoData from '@/pages/st1/components/noData/noData.vue';
  47. const { proxy } = getCurrentInstance() as any;
  48. const app = getApp();
  49. const iconUrl = ref(icon);
  50. const currentUser = ref<any>({});
  51. const noDataValue = ref("暂无数据");
  52. const recordList = ref<any[]>([]);
  53. const screen = ref({
  54. screenKey: 'screen',
  55. btnName: '',
  56. startDate: common.dateFormat(new Date(Date.now() - (30 * 24 * 60 * 60 * 1000))).formatYear, //开始时间 yyyy-mm-dd
  57. endDate: common.dateFormat(new Date(Date.now() + (1 * 24 * 60 * 60 * 1000))).formatYear, //结束时间 yyyy-mm-dd
  58. state: [],
  59. sourceType: [],
  60. memberId: [],
  61. screenTime: [
  62. { label: "近一个月", value: "30", check: true },
  63. { label: "近三个月", value: "90", check: false },
  64. { label: "近半年", value: "180", check: false },
  65. ],
  66. columns: []
  67. });
  68. useOnLoad((options: any) => {
  69. try {
  70. let user = options.userInfo ? JSON.parse(options.userInfo) : app.globalData.currentUser;
  71. currentUser.value = user;
  72. QueryInpatientList();
  73. } catch (e) {
  74. console.error('Error parsing userInfo:', e);
  75. }
  76. });
  77. const refresh = () => {
  78. QueryInpatientList();
  79. };
  80. const updateScreen = (data: any) => {
  81. if (data && data.screen) {
  82. screen.value = data.screen;
  83. }
  84. };
  85. // 设置筛选数据
  86. const setScreenData = (val: any) => {
  87. updateScreen(val);
  88. };
  89. // 选择结束时间
  90. const changeEndDate = (val: any) => {
  91. updateScreen(val);
  92. recordList.value = [];
  93. QueryInpatientList();
  94. };
  95. // 获取选中的筛选时间
  96. const changeStartDate = (val: any) => {
  97. updateScreen(val);
  98. recordList.value = [];
  99. QueryInpatientList();
  100. };
  101. // 查询
  102. const queryRecords = () => {
  103. recordList.value = [];
  104. QueryInpatientList();
  105. };
  106. // 重置
  107. const resetScreen = (val: any) => {
  108. let screenData = common.deepCopy(val);
  109. if (screenData.screen) {
  110. screen.value = screenData.screen;
  111. } else {
  112. // If val IS screen object
  113. // But original logic: this.setData({ screen: screen })
  114. // We assume val contains screen key if it matches original structure
  115. // If val is just the screen object, assign directly?
  116. // Let's stick to updateScreen logic which checks for .screen
  117. // If resetScreen returns the whole data object including screen:
  118. updateScreen(screenData);
  119. }
  120. recordList.value = [];
  121. QueryInpatientList();
  122. };
  123. const QueryInpatientList = async () => {
  124. let reqData = {
  125. HosId: app.globalData.districtId || app.globalData.hosId,
  126. StartDate: screen.value.startDate,
  127. EndDate: screen.value.endDate,
  128. IgnoreHosId: true,
  129. MemberId: currentUser.value.memberId,
  130. CardType: currentUser.value.cardType,
  131. CardNo: currentUser.value.cardNo,
  132. Store: {
  133. cardEncryptionStore: currentUser.value.encryptionStore || '',
  134. baseMemberEncryptionStore: currentUser.value.baseMemberEncryptionStore
  135. }
  136. };
  137. let { resp, resData } = await queryInpatientList(reqData);
  138. if (resData.RespCode == "10000") {
  139. if (common.isNotEmpty(resData.Data)) {
  140. recordList.value = resp;
  141. }
  142. }
  143. };
  144. // 跳转详情页面
  145. const jumpDetail = (item: any) => {
  146. let url = `/pagesPatient/st1/business/prescriptionManagement/dischargeMedicationDetails/dischargeMedicationDetails?queryBean=${JSON.stringify(item)}`;
  147. common.goToUrl(url);
  148. };
  149. </script>
  150. <style lang="scss">
  151. .noData {
  152. width: 100%;
  153. padding-top: 0 !important;
  154. position: absolute;
  155. top: 50%;
  156. margin-top: -200upx;
  157. }
  158. .recordBox {
  159. padding: 328upx 30upx 30upx;
  160. }
  161. .recordBox_list {
  162. background: #fff;
  163. border-radius: 24upx;
  164. padding-left: 30upx;
  165. }
  166. .record_item {
  167. position: relative;
  168. padding: 32upx 0;
  169. }
  170. .name {
  171. font-size: 32upx;
  172. color: #333;
  173. margin-bottom: 18upx;
  174. font-weight: 600;
  175. }
  176. .text {
  177. font-size: 26upx;
  178. color: #999;
  179. }
  180. </style>