queueItem.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <template>
  2. <view class="initial signInfo">
  3. <view class='content'>
  4. <view class='publicInfo'>
  5. <view class="publicInfo_item displayFlexLeft">
  6. <view class="publicInfo_tit">就诊科室</view>
  7. <view class="publicInfo_val">{{queueInfo.DeptName}}</view>
  8. </view>
  9. <view class="publicInfo_item displayFlexLeft">
  10. <view class="publicInfo_tit">就诊医生</view>
  11. <view class="publicInfo_val">{{queueInfo.DoctorName}}</view>
  12. </view>
  13. <view class="publicInfo_item displayFlexLeft">
  14. <view class="publicInfo_tit">就诊人</view>
  15. <view class="publicInfo_val">{{queueInfo.PatientName}}</view>
  16. </view>
  17. <view class="publicInfo_item displayFlexLeft">
  18. <view class="publicInfo_tit">就诊卡号</view>
  19. <view class="publicInfo_val">{{queueInfo.CardNo}}</view>
  20. </view>
  21. <view class="publicInfo_item displayFlexLeft" v-if="queueInfo.SourceType!='006' && queueInfo.Location">
  22. <view class="publicInfo_tit">就诊位置</view>
  23. <view class="publicInfo_val">{{queueInfo.SourceType=='006'?'互联网科室': queueInfo.Location || "--"}}</view>
  24. </view>
  25. <view class="publicInfo_item displayFlexLeft">
  26. <view class="publicInfo_tit">候诊号序</view>
  27. <view class="publicInfo_val">
  28. 第<text class='num'>{{queueInfo.No}}</text> 号
  29. <block v-if="queueInfo.NextNo != '-1'">
  30. 还需等待<text style='color:#FF3434'>{{queueInfo.WaitNum}}</text>人
  31. </block>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 智能提醒 -->
  37. <view class="wait_open border_top" v-if="isShowInte">
  38. <view class="open_top displayFlexRow">
  39. <view class="tips_box displayFlexCol">
  40. <text class="tips_title">智能提醒</text>
  41. <view class="tips_box" v-if="switchType">
  42. <text>当就诊号序到第</text>
  43. <text class="red">{{queueInfo.No-queueInfo.ReMindNo}}</text>
  44. <text>号时,进行提醒</text>
  45. </view>
  46. </view>
  47. <view style='float:right'>
  48. <switch :checked="switchType" color="var(--dominantColor)" @change="switchChange"></switch>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 候诊智能提醒 -->
  54. <view class="public_dialog" v-if="showModel">
  55. <view class="dialog_inner">
  56. <view class="dialog_tit">智能提醒</view>
  57. <view class="dialog_subtit">请选择需要提早几号进行提醒</view>
  58. <view class="number_list">
  59. <view class="num_item" :class="{'backgroundCustom': index+1==showIndex}" v-for="(item, index) in (queueInfo.No>=8?8:queueInfo.No)" :key="index" @click="numberClick(index)">
  60. <input class="number_input" disabled :value="index+1" maxlength="1" type="number"></input>
  61. </view>
  62. </view>
  63. <view class="public_tip">友情提示:医生看诊一个患者平均花费 5 分钟,建议 提早 5 号进行提醒</view>
  64. <view class="btn_list border_top">
  65. <view class="btn_item border_right flexCenter" @click="btnClick()">取消</view>
  66. <view class="btn_item colorCustom flexCenter" @click="btnClick('confirm')">确定</view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script setup lang="ts">
  72. import { ref, defineProps, watch, onMounted } from 'vue';
  73. import common from '@/utils/common';
  74. import icon from '@/utils/icon';
  75. import * as queue from '@/pagesPatient/service/queue/index';
  76. const props = defineProps({
  77. ifGetQueueInfo: {
  78. type: Boolean,
  79. default: false
  80. },
  81. orderInfo: {
  82. type: Object,
  83. default: () => ({})
  84. },
  85. currentUser: {
  86. type: Object,
  87. default: () => ({})
  88. },
  89. isShowInte: {
  90. type: Boolean,
  91. default: true
  92. },
  93. });
  94. const iconUrl = ref(icon)
  95. const queueInfo = ref<any>({});
  96. const showIndex = ref(1);
  97. const switchType = ref(false);
  98. const showModel = ref(false);
  99. watch(() => props.orderInfo, (newVal) => {
  100. let bool = newVal.IfMsg == '1' ? true : false;
  101. queueInfo.value = newVal;
  102. switchType.value = bool;
  103. }, { deep: true });
  104. onMounted(() => {
  105. if (props.ifGetQueueInfo) {
  106. getQueueInfo();
  107. } else {
  108. let bool = props.orderInfo.IfMsg == '1' ? true : false;
  109. queueInfo.value = props.orderInfo;
  110. switchType.value = bool;
  111. }
  112. });
  113. const getQueueInfo = async () => {
  114. let app = getApp();
  115. let data = {
  116. HosId: app.globalData.districtId || app.globalData.hosId,
  117. HisOrderId: props.orderInfo.HisOrderId,
  118. QueryId: props.orderInfo.QueryId || '',
  119. };
  120. let res = await queue.getQueueInfo(data);
  121. if (common.isNotEmpty(res)) {
  122. let bool = res[0].IfMsg == '1' ? true : false;
  123. queueInfo.value = res[0];
  124. switchType.value = bool;
  125. }
  126. };
  127. const switchChange = async (e: any) => {
  128. showModel.value = e.detail.value;
  129. switchType.value = e.detail.value;
  130. if (!e.detail.value && queueInfo.value.IfMsg == 1) {
  131. /**关闭 */
  132. let resp = await setReMindNo('0');
  133. if (!common.isEmpty(resp)) {
  134. common.showModal('已关闭智能提醒');
  135. }
  136. }
  137. };
  138. const numberClick = (index: number) => {
  139. showIndex.value = index + 1;
  140. };
  141. const btnClick = async (type?: string) => {
  142. if (type == 'confirm') {
  143. /**确定 */
  144. let resp = await setReMindNo('1');
  145. if (!common.isEmpty(resp)) {
  146. showModel.value = false;
  147. common.showModal('智能提醒已开启', () => {
  148. getQueueInfo();
  149. });
  150. }
  151. } else {
  152. /**取消 */
  153. showModel.value = false;
  154. switchType.value = false;
  155. }
  156. };
  157. const setReMindNo = async (ifMsg: string) => {
  158. let currentUser = props.currentUser;
  159. let queryData = {
  160. ...queueInfo.value,
  161. ReMindNo: showIndex.value,
  162. IfMsg: ifMsg,
  163. PatientName: currentUser.memberName,
  164. Store: {
  165. cardEncryptionStore: currentUser.encryptionStore || '',
  166. baseMemberEncryptionStore: currentUser.baseMemberEncryptionStore
  167. },
  168. };
  169. let resp = await queue.setReMindNo(queryData);
  170. return resp;
  171. };
  172. </script>
  173. <style lang="scss" scoped>
  174. /* 标准 */
  175. .initial .publicInfo {
  176. border-radius: 10upx;
  177. overflow: hidden;
  178. background: white;
  179. font-size: 32upx;
  180. color: #333;
  181. }
  182. .initial .publicInfo_item {
  183. margin-bottom: 28upx;
  184. }
  185. .initial .publicInfo_tit {
  186. color: #999;
  187. width: 150upx;
  188. white-space: nowrap;
  189. }
  190. .initial .publicInfo_val{
  191. margin-left: 64upx;
  192. }
  193. .initial .num {
  194. color: #c9595b;
  195. }
  196. /* 智能提醒 */
  197. .initial .wait_open {
  198. background: #fff;
  199. border-top-width: 1px;
  200. border-bottom-width: 1px;
  201. }
  202. .initial .wait_open .open_top {
  203. padding-top: 30upx;
  204. font-size: 32upx;
  205. justify-content: space-between;
  206. }
  207. .initial .tips_box {
  208. margin-top: 10upx;
  209. justify-content: flex-start !important;
  210. align-items: flex-start !important;
  211. }
  212. .initial .tips_box .tips_title {
  213. font-size: 30upx;
  214. color: #333;
  215. font-weight: bold;
  216. }
  217. .initial .tips_box text {
  218. font-size: 24upx;
  219. color: #999;
  220. }
  221. /* 签到弹框 */
  222. .dialog_inner {
  223. width: 600upx;
  224. background: rgba(255, 255, 255, 1);
  225. border-radius: 24upx;
  226. }
  227. .dialog_tit {
  228. font-size: 36upx;
  229. font-weight: 500;
  230. color: rgba(0, 0, 0, 1);
  231. padding: 50upx 30upx;
  232. text-align: center;
  233. }
  234. .dialog_subtit {
  235. font-size: 30upx;
  236. padding: 0 30upx;
  237. line-height: 44upx;
  238. }
  239. .font_color {
  240. color: #fa4844;
  241. }
  242. .number_list {
  243. display: inline-flex;
  244. width: 100%;
  245. flex-wrap: wrap;
  246. }
  247. .num_item {
  248. width: 100upx;
  249. height: 120upx;
  250. line-height: 120upx;
  251. display: flex;
  252. align-items: center;
  253. justify-content: center;
  254. border: 1px solid #ccc;
  255. border-radius: 4upx;
  256. margin-top: 40upx;
  257. margin-left: 40upx;
  258. }
  259. .number_list .backgroundCustom .number_input{
  260. color: #fff;
  261. }
  262. .number_input {
  263. font-size: 60upx;
  264. font-family: Arial;
  265. font-weight: 400;
  266. color: rgba(0, 0, 0, 1);
  267. text-align: center;
  268. width: 100%;
  269. height: 100%;
  270. }
  271. .btn_list {
  272. height: 96upx;
  273. display: flex;
  274. align-items: center;
  275. }
  276. .btn_item {
  277. width: 50%;
  278. font-size: 32upx;
  279. font-family: Source Han Sans CN;
  280. font-weight: 500;
  281. color: rgba(85, 85, 85, 1);
  282. height: 100%;
  283. }
  284. /* Helper classes assumed from global or context */
  285. .displayFlexLeft {
  286. display: flex;
  287. justify-content: flex-start;
  288. align-items: center;
  289. }
  290. .displayFlexRow {
  291. display: flex;
  292. flex-direction: row;
  293. align-items: center;
  294. }
  295. .displayFlexCol {
  296. display: flex;
  297. flex-direction: column;
  298. }
  299. .flexCenter {
  300. display: flex;
  301. justify-content: center;
  302. align-items: center;
  303. }
  304. .border_top {
  305. border-top: 1upx solid #e5e5e5;
  306. }
  307. .border_bottom {
  308. border-bottom: 1upx solid #e5e5e5;
  309. }
  310. .border_right {
  311. border-right: 1upx solid #e5e5e5;
  312. }
  313. .public_dialog {
  314. position: fixed;
  315. top: 0;
  316. left: 0;
  317. right: 0;
  318. bottom: 0;
  319. background: rgba(0,0,0,0.5);
  320. display: flex;
  321. justify-content: center;
  322. align-items: center;
  323. z-index: 999;
  324. }
  325. .public_tip {
  326. font-size: 24upx;
  327. color: #999;
  328. padding: 20upx 30upx;
  329. }
  330. </style>