outpatientCosts.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view class="container">
  3. <view class="userInfoTopFixe">
  4. <userInfo :userInfo="currentUser"></userInfo>
  5. <screening
  6. :screen="screen"
  7. @setScreenData="setScreenData"
  8. @queryRecords="queryRecords"
  9. @resetScreen="resetScreen"
  10. @changeStartDate="changeStartDate"
  11. @changeEndDate="changeEndDate"
  12. ></screening>
  13. </view>
  14. <view class="recordList" :class="{ 'hideBox': recordList.length == 0 }">
  15. <view class="noData" v-if="recordList.length == 0">
  16. <noData :value="noDataValue"></noData>
  17. </view>
  18. <view
  19. class="recordItem border_bottom"
  20. v-if="recordList.length > 0"
  21. v-for="(item, index) in recordList"
  22. :key="index"
  23. @click="itemClick(item)"
  24. >
  25. <view class="recordTitle">
  26. <text>{{ item.Date }}</text>
  27. <!-- <text>{{item.name}}</text> -->
  28. </view>
  29. <view>
  30. <text class="pricerColor">¥{{ item.Fee / 100 }}</text>
  31. <image class="public_right_img public_right_img30" :src="iconUrl.icon_right"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script setup lang="ts">
  38. import { ref } from 'vue';
  39. import { useOnLoad } from '@dcloudio/uni-app';
  40. import { queryOutpatientCostType } from '@/pagesPatient/service/costDetailedList';
  41. import common from '@/utils/common';
  42. import icon from '@/utils/icon';
  43. import userInfo from '@/pagesPersonal/st1/components/userInfo/userInfo.vue';
  44. import noData from '@/pages/st1/components/noData/noData.vue';
  45. import screening from '@/pagesPatient/st1/components/screening/screening.vue';
  46. const iconUrl = icon;
  47. const currentUser = ref<any>({});
  48. const queryData = ref({
  49. Page: {
  50. PIndex: 0,
  51. PSize: 10
  52. }
  53. });
  54. // 筛选组件参数
  55. const screen = ref({
  56. screenKey: 'screen',
  57. btnName: '',
  58. startDate: common.dateFormat(new Date(Date.now() - (30 * 24 * 60 * 60 * 1000))).formatYear, // 开始时间
  59. endDate: common.newDay(), // 结束时间
  60. state: [],
  61. sourceType: [],
  62. memberId: [],
  63. screenTime: [
  64. { label: "近一个月", value: "30", check: true },
  65. { label: "近三个月", value: "90", check: false },
  66. { label: "近半年", value: "180", check: false },
  67. ],
  68. columns: []
  69. });
  70. const recordList = ref<any[]>([]);
  71. const showNoData = ref(false);
  72. const noDataValue = ref('暂无门诊清单');
  73. useOnLoad((options) => {
  74. currentUser.value = getApp().globalData.currentUser;
  75. getOutpatientCostType();
  76. });
  77. const refresh = () => {
  78. getOutpatientCostType();
  79. };
  80. /**
  81. * 获取门诊清单分类
  82. */
  83. const getOutpatientCostType = async (pIndex = 0) => {
  84. let obj = {
  85. BeginDate: screen.value.startDate,
  86. EndDate: screen.value.endDate,
  87. MemberId: currentUser.value.memberId,
  88. CardType: currentUser.value.cardType,
  89. Store: {
  90. cardEncryptionStore: currentUser.value.encryptionStore || '',
  91. baseMemberEncryptionStore: currentUser.value.baseMemberEncryptionStore
  92. },
  93. };
  94. // Merge obj into a new object with queryData.Page
  95. let reqData = {
  96. ...obj,
  97. Page: {
  98. ...queryData.value.Page,
  99. PIndex: pIndex
  100. }
  101. };
  102. let list: any[] = [];
  103. let isNoData = true;
  104. // 遵循规范:必须解构返回值
  105. let { resp } = await queryOutpatientCostType(reqData);
  106. if (!common.isEmpty(resp)) {
  107. list = resp;
  108. isNoData = false;
  109. }
  110. recordList.value = list;
  111. showNoData.value = isNoData;
  112. };
  113. /**
  114. * 监听筛选组件时间变化
  115. */
  116. const dateChange = (e: any) => {
  117. let detail = e.detail || e; // Handle both event types if necessary
  118. // In Vue, custom events usually pass the value directly or in an object.
  119. // Assuming the child component emits { type: '...', value: '...' }
  120. if (detail.type) {
  121. (screen.value as any)[detail.type] = detail.value;
  122. }
  123. getOutpatientCostType();
  124. };
  125. /**
  126. * 清单列表点击
  127. */
  128. const itemClick = (item: any) => {
  129. let qBean = JSON.stringify(item);
  130. common.goToUrl(`/pagesPatient/st1/business/costDetailedList/costListingDetails/costListingDetails?queryBean=${qBean}&pageType=outpatient`);
  131. };
  132. // 设置筛选数据
  133. const setScreenData = (e: any) => {
  134. // e is likely the payload from $emit
  135. // Original: this.setData(e.detail)
  136. // We need to merge e into screen.value
  137. Object.assign(screen.value, e);
  138. };
  139. // 选择结束时间
  140. const changeEndDate = (e: any) => {
  141. Object.assign(screen.value, e);
  142. recordList.value = [];
  143. queryData.value.Page.PIndex = 0;
  144. getOutpatientCostType();
  145. };
  146. // 选择开始时间
  147. const changeStartDate = (e: any) => {
  148. Object.assign(screen.value, e);
  149. recordList.value = [];
  150. queryData.value.Page.PIndex = 0;
  151. getOutpatientCostType();
  152. };
  153. // 查询
  154. const queryRecords = (e: any) => {
  155. queryData.value.Page.PIndex = 0;
  156. recordList.value = [];
  157. getOutpatientCostType();
  158. };
  159. // 重置
  160. const resetScreen = (e: any) => {
  161. // Assuming e is the new screen state
  162. // Original: let screen = common.deepCopy(e.detail)
  163. // this.setData({ screen: screen ... })
  164. screen.value = common.deepCopy(e);
  165. recordList.value = [];
  166. queryData.value.Page.PIndex = 0;
  167. getOutpatientCostType();
  168. };
  169. </script>
  170. <style lang="scss" scoped>
  171. .noData {
  172. width: 100%;
  173. padding-top: 0 !important;
  174. position: absolute;
  175. top: 50%;
  176. margin-top: -250upx;
  177. margin-left: -30upx;
  178. }
  179. .topMenu {
  180. background: white;
  181. border-radius: 0 0 24upx 24upx;
  182. overflow: hidden;
  183. }
  184. .screenBox {
  185. width: 100%;
  186. padding: 0 30upx 30upx 30upx;
  187. box-sizing: border-box;
  188. display: flex;
  189. flex-direction: row;
  190. justify-content: space-between;
  191. align-items: center;
  192. }
  193. .dataBox {
  194. width: 80%;
  195. display: flex;
  196. flex-direction: row;
  197. justify-content: flex-start;
  198. align-items: center;
  199. }
  200. .picker {
  201. font-size: 30upx;
  202. color: #666;
  203. }
  204. .textTag {
  205. padding: 0 30upx;
  206. font-size: 28upx;
  207. color: #666;
  208. }
  209. .screenBtn {
  210. width: 20%;
  211. display: flex;
  212. flex-direction: row;
  213. justify-content: flex-end;
  214. align-items: center;
  215. }
  216. .screenBtn text {
  217. font-size: 30upx;
  218. color: #666;
  219. padding-right: 16upx;
  220. }
  221. .recordList {
  222. width: 100%;
  223. position: fixed;
  224. top: 320upx;
  225. bottom: 0;
  226. margin-top: 20upx;
  227. background: white;
  228. padding-left: 30upx;
  229. box-sizing: border-box;
  230. overflow: auto;
  231. }
  232. .hideBox {
  233. top: 335upx;
  234. background: #f1f1f6;
  235. }
  236. .recordItem {
  237. padding: 35upx 30upx 35upx 0;
  238. display: flex;
  239. flex-direction: row;
  240. justify-content: space-between;
  241. align-items: center;
  242. }
  243. .border-bottom:last-child::after {
  244. border-top: 0px;
  245. }
  246. .recordTitle {
  247. display: flex;
  248. flex-direction: column;
  249. justify-content: center;
  250. align-items: flex-start;
  251. }
  252. .recordTitle text:nth-child(1) {
  253. font-size: 32upx;
  254. color: #333;
  255. margin-bottom: 8upx;
  256. }
  257. .recordTitle text:nth-child(2) {
  258. font-size: 26upx;
  259. color: #999;
  260. }
  261. .pricerColor {
  262. color: #ff3434 !important;
  263. margin-right: 23upx;
  264. }
  265. </style>