index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <view class="index">
  3. <view class="arc_edge"></view>
  4. <view class="index_container">
  5. <!-- 头部搜索 -->
  6. <view class="search">
  7. <view class="search_wrap">
  8. <input focus placeholder="请输入标本编码/检查单号/请…" :placeholder-style="placeholderStyle" confirm-type="search" />
  9. <view class="searchBtn">
  10. 搜索
  11. </view>
  12. </view>
  13. <view class="icon-saoma">
  14. <text class="pda pda-saoma"></text>
  15. </view>
  16. </view>
  17. <!-- 通告栏 -->
  18. <uni-notice-bar :speed="20" scrollable single showIcon :text="updateTipsForNurses" background-color="#fff"
  19. color="#666">
  20. </uni-notice-bar>
  21. <!-- 一键收标本 -->
  22. <view class="collect_specimens">
  23. <view class="collect_icon">
  24. </view>
  25. <view class="collect_specimensNum">
  26. <view class="urgent collect_row">
  27. 急标数量<text class="collect_num">{{urgentNum | specimenNum}}</text>
  28. </view>
  29. <view class="ordinary collect_row">
  30. 普标数量<text class="collect_num">{{ordinaryNum | specimenNum}}</text>
  31. </view>
  32. </view>
  33. <button class="collect_btn" type="default" @click="collectSpecimens">{{specimenButton}}</button>
  34. </view>
  35. <!-- 最新工单 -->
  36. <view class="newOrders">
  37. <view class="newOrders_header">
  38. <text class="newOrders_header_title">最新工单</text>
  39. <text class="newOrders_header_more">更多&gt;&gt;</text>
  40. </view>
  41. <view class="newOrders_item" v-for="newOrder in newOrderList" :key="newOrder.id">
  42. <view class="newOrders_item_time">{{newOrder.showCreateTime}}</view>
  43. <text
  44. class="newOrders_item_taskType">{{newOrder.isHalfInspect === 1 ? "半程陪检" : (newOrder.taskType&&newOrder.taskType.taskName)}}</text>
  45. <text class="newOrders_item_patientName">{{newOrder.patient&&newOrder.patient.patientName}}</text>
  46. <text class="newOrders_item_status"
  47. :class="newOrder.stateTextClass">{{newOrder.gdState&&newOrder.gdState.name}}</text>
  48. </view>
  49. </view>
  50. <!-- 快捷工单 -->
  51. <view class="quick_other">
  52. <view class="quick_other_header">
  53. <text class="quick_other_header_title">快捷工单</text>
  54. </view>
  55. <view class="quick_other_container">
  56. <view class="quick_other_container_item" v-for="quickOther in quickOtherList" :key="quickOther.id">
  57. <view class="quick_other_container_item_text" @click="quickOrderOther(quickOther)">
  58. {{quickOther.taskName}}
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <seiminFooterNav></seiminFooterNav>
  65. <seiminModel ref="seiminModel"></seiminModel>
  66. </view>
  67. </template>
  68. <script>
  69. import {
  70. mapState,
  71. mapMutations
  72. } from 'vuex';
  73. import {
  74. reqSpecimenWorkOrderMsg,
  75. reqDeptTaskType,
  76. reqFetchDataList
  77. } from '../../request/api.js';
  78. import {
  79. GDSTATE
  80. } from '../../utils/enum.gdstate.js';
  81. import {
  82. ASSOCIATION_TYPES
  83. } from '../../utils/enum.association_types.js';
  84. export default {
  85. data() {
  86. return {
  87. placeholderStyle: 'color:#999;font-size:30rpx;',
  88. urgentNum: 0, //急标数量
  89. ordinaryNum: 0, //普标数量
  90. newOrderList: [], //最新工单列表
  91. quickOtherList: [], //快捷工单列表
  92. };
  93. },
  94. computed: {
  95. ...mapState('user', ['loginInfo', 'loginInfoUserDeptId']),
  96. ...mapState(['isShowSeiminModel', 'deptDisplay', 'specimenButton', 'updateTipsForNurses']),
  97. },
  98. methods: {
  99. ...mapMutations(['changeSeiminModel', 'changeQucikCreateOrderType', 'changeDeptDisplay',
  100. 'changeUpdateTipsForNurses', 'changeSpecimenButton', 'changeNurseDeptSwitchTip'
  101. ]),
  102. // 获取页面数据
  103. init() {
  104. Promise.all([
  105. this.querySpecimenNumRequest(), //查询急标和普标数量
  106. this.queryWorkOrdersRequest(), //查询最新工单列表
  107. this.queryDeptTaskTypeRequest(), //查询快捷工单(其他临床服务任务类型)
  108. this.queryDeptDisplayRequest(), //护士端科室显示选择(名称还是别名)
  109. this.queryUpdateTipsForNursesRequest(), //护士端更新提示
  110. this.querySpecimenButtonRequest(), //标本按钮文字
  111. this.queryNurseDeptSwitchTipRequest(), //护士科室切换提示自动关闭设置
  112. ]).then(values => {
  113. uni.hideLoading();
  114. uni.stopPullDownRefresh();
  115. this.querySpecimenNumResponse(values[0]);
  116. this.queryWorkOrdersResponse(values[1]);
  117. this.queryDeptTaskTypeResponse(values[2]);
  118. this.queryDeptDisplayResponse(values[3]);
  119. this.queryUpdateTipsForNursesResponse(values[4]);
  120. this.querySpecimenButtonResponse(values[5]);
  121. this.queryNurseDeptSwitchTipResponse(values[6]);
  122. if (this.isShowSeiminModel) {
  123. this.showDeptModel();
  124. this.changeSeiminModel(false);
  125. }
  126. });
  127. },
  128. // 查询急标和普标数量
  129. querySpecimenNumRequest() {
  130. return reqSpecimenWorkOrderMsg({
  131. deptId: this.loginInfoUserDeptId
  132. })
  133. },
  134. // 查询急标和普标数量
  135. querySpecimenNumResponse(res) {
  136. if (res.status == 200) {
  137. if (res.specimenCount) {
  138. this.urgentNum = res.specimenCount.urgent;
  139. }
  140. if (res.specimenCount) {
  141. this.ordinaryNum = res.specimenCount.noUrgent;
  142. }
  143. }
  144. },
  145. // 查询最新工单列表
  146. queryWorkOrdersRequest() {
  147. return reqFetchDataList('nurse', 'workOrder', {
  148. "workOrder": {
  149. "createDept": this.loginInfoUserDeptId,
  150. "platform": 2,
  151. "searchDays": 2,
  152. },
  153. "idx": 0,
  154. "sum": 5
  155. })
  156. },
  157. // 查询最新工单列表
  158. queryWorkOrdersResponse(res) {
  159. if (res.status == 200) {
  160. this.newOrderList = res.list.map(v => {
  161. if (v.gdState) {
  162. if (v.gdState.value == GDSTATE['待接单'] || v.gdState.value == GDSTATE['待抢单']) {
  163. v.stateTextClass = 'red';
  164. } else if (v.gdState.value == GDSTATE['待评价'] || v.gdState.value == GDSTATE['已完成']) {
  165. v.stateTextClass = 'green';
  166. } else {
  167. v.stateTextClass = 'yellow';
  168. }
  169. }
  170. return v;
  171. });
  172. }
  173. },
  174. // 查询快捷工单(其他临床服务任务类型)
  175. queryDeptTaskTypeRequest() {
  176. return reqDeptTaskType({
  177. deptId: this.loginInfoUserDeptId
  178. })
  179. },
  180. // 查询快捷工单(其他临床服务任务类型)
  181. queryDeptTaskTypeResponse(res) {
  182. if (res.status == 200) {
  183. this.quickOtherList = res.data.allTaskTypes.filter(v => v.associationType.value == ASSOCIATION_TYPES[
  184. '其他临床服务']);
  185. let specimenTaskType = res.data.allTaskTypes.find(v => v.associationType.value == ASSOCIATION_TYPES[
  186. '临时标本业务']);
  187. this.specimenTaskTypeId = specimenTaskType && specimenTaskType.id;
  188. }
  189. },
  190. // 护士端科室显示选择(名称还是别名)
  191. queryDeptDisplayRequest() {
  192. return reqFetchDataList('simple/data', 'systemConfiguration', {
  193. "idx": 0,
  194. "sum": 1,
  195. "systemConfiguration": {
  196. "keyconfig": "deptDisplay"
  197. }
  198. })
  199. },
  200. // 护士端科室显示选择(名称还是别名)
  201. queryDeptDisplayResponse(res) {
  202. if (res.status == 200) {
  203. this.changeDeptDisplay(res.list[0].valueconfig);
  204. }
  205. },
  206. // 护士端更新提示
  207. queryUpdateTipsForNursesRequest() {
  208. return reqFetchDataList('simple/data', 'systemConfiguration', {
  209. "idx": 0,
  210. "sum": 1,
  211. "systemConfiguration": {
  212. "keyconfig": "updateTipsForNurses"
  213. }
  214. })
  215. },
  216. // 护士端更新提示
  217. queryUpdateTipsForNursesResponse(res) {
  218. if (res.status == 200) {
  219. this.changeUpdateTipsForNurses(res.list[0].valueconfig);
  220. }
  221. },
  222. // 标本按钮文字
  223. querySpecimenButtonRequest() {
  224. return reqFetchDataList('simple/data', 'systemConfiguration', {
  225. "idx": 0,
  226. "sum": 1,
  227. "systemConfiguration": {
  228. "keyconfig": "specimenButton"
  229. }
  230. })
  231. },
  232. // 标本按钮文字
  233. querySpecimenButtonResponse(res) {
  234. if (res.status == 200) {
  235. this.changeSpecimenButton(res.list[0].valueconfig);
  236. }
  237. },
  238. // 护士科室切换提示自动关闭设置
  239. queryNurseDeptSwitchTipRequest() {
  240. return reqFetchDataList('simple/data', 'systemConfiguration', {
  241. "idx": 0,
  242. "sum": 1,
  243. "systemConfiguration": {
  244. "keyconfig": "nurseDeptSwitchTip"
  245. }
  246. })
  247. },
  248. // 护士科室切换提示自动关闭设置
  249. queryNurseDeptSwitchTipResponse(res) {
  250. if (res.status == 200) {
  251. this.changeNurseDeptSwitchTip(res.list[0].valueconfig);
  252. }
  253. },
  254. // 一键收取标本
  255. collectSpecimens() {
  256. uni.navigateTo({
  257. url: '/pages/quickCreateOrder/quickCreateOrder'
  258. })
  259. this.changeQucikCreateOrderType({
  260. type: 'specimen',
  261. taskTypeId: this.specimenTaskTypeId
  262. });
  263. },
  264. //其他临床服务快捷建单
  265. quickOrderOther(quickOther){
  266. uni.navigateTo({
  267. url: '/pages/quickCreateOrder/quickCreateOrder'
  268. })
  269. this.changeQucikCreateOrderType({
  270. type: 'other',
  271. taskTypeId: quickOther.id
  272. });
  273. },
  274. // 切换科室弹窗
  275. showDeptModel() {
  276. const {
  277. user //当前登录用户
  278. } = this.loginInfo;
  279. const userDept = (user && user.dept) ? (this.deptDisplay == 1 ? user.dept.dept : user.dept.deptalias) : '';
  280. this.$refs.seiminModel.showChangeDept({
  281. content: `您当前所属科室为<text class="green">${userDept}</text>,如与您实际科室不符点击<text class="red">切换科室</text>。`,
  282. btns: [{
  283. name: "知道了",
  284. textColor: "#49B856",
  285. flex: 2,
  286. },
  287. {
  288. name: "前往切换科室",
  289. textColor: "#666",
  290. flex: 3,
  291. click: (e) => {
  292. console.log('切换科室');
  293. }
  294. },
  295. ]
  296. });
  297. },
  298. },
  299. mounted() {
  300. uni.showLoading({
  301. title: '加载中',
  302. mask: true
  303. })
  304. this.init();
  305. },
  306. onPullDownRefresh() {
  307. this.init();
  308. }
  309. };
  310. </script>
  311. <style lang="scss" scoped>
  312. .index {
  313. padding-bottom: 108rpx;
  314. // 弧形背景
  315. .arc_edge {
  316. @include arc_edge;
  317. }
  318. .index_container {
  319. padding: 0 24rpx;
  320. position: relative;
  321. z-index: 2;
  322. // 搜素框
  323. .search {
  324. height: 66rpx;
  325. margin-top: -200rpx;
  326. @include flex(space-between, center);
  327. .search_wrap {
  328. width: 600rpx;
  329. height: 100%;
  330. border-radius: 33rpx;
  331. background-color: #fff;
  332. position: relative;
  333. input {
  334. height: 100%;
  335. padding-left: 33rpx;
  336. padding-right: 147rpx;
  337. }
  338. .searchBtn {
  339. position: absolute;
  340. right: 0;
  341. top: 50%;
  342. transform: translateY(-50%);
  343. line-height: 1em;
  344. color: #666;
  345. font-size: 32rpx;
  346. width: 110rpx;
  347. text-align: center;
  348. border-left: 2rpx solid #E5E9ED;
  349. padding: 6rpx 0;
  350. }
  351. }
  352. .icon-saoma {
  353. width: 66rpx;
  354. height: 66rpx;
  355. background-color: #BEE1A7;
  356. border-radius: 50%;
  357. color: $defaultColor;
  358. @include flex(center, center);
  359. }
  360. }
  361. // 通告栏
  362. .uni-noticebar {
  363. height: 88rpx;
  364. margin-top: 24rpx;
  365. margin-bottom: 0;
  366. border: 1px solid #E5E9ED;
  367. }
  368. // 一键收标本
  369. .collect_specimens {
  370. width: 702rpx;
  371. height: 176rpx;
  372. background-color: #fff;
  373. margin-top: 8rpx;
  374. border-radius: 8rpx;
  375. // box-shadow: 0 0 7rpx 0 rgba(73, 184, 86, 0.09);
  376. border: 1px solid #E5E9ED;
  377. position: relative;
  378. @include flex(center, center);
  379. @include semicircle(#f9fafb);
  380. .collect_icon {
  381. width: 48rpx;
  382. height: 48rpx;
  383. border-radius: 50%;
  384. background-color: rgba(57, 177, 153, 0.3);
  385. border: 1px solid #39B199;
  386. font-size: 24rpx;
  387. color: #39B199;
  388. @include flex(center, center);
  389. }
  390. .collect_specimensNum {
  391. margin: 0 35rpx;
  392. width: 277rpx;
  393. font-size: 34rpx;
  394. color: #666;
  395. .collect_num {
  396. font-size: 46rpx;
  397. font-weight: 600;
  398. color: #333;
  399. margin-left: 16rpx;
  400. }
  401. .collect_row {
  402. height: 88rpx;
  403. @include flex(flex-start, center);
  404. border-bottom: 1px dashed #E5E9ED;
  405. &:last-of-type {
  406. border-bottom: none;
  407. }
  408. }
  409. }
  410. .collect_btn {
  411. margin: 0;
  412. width: 224rpx;
  413. height: 88rpx;
  414. background: linear-gradient(90deg, #74C271 0%, #39B199 100%);
  415. border-radius: 56rpx;
  416. color: #fff;
  417. font-size: 32rpx;
  418. line-height: 88rpx;
  419. }
  420. }
  421. // 最新工单
  422. .newOrders {
  423. width: 702rpx;
  424. min-height: 530rpx;
  425. background-color: #fff;
  426. margin-top: 8rpx;
  427. border-radius: 8rpx;
  428. // box-shadow: 0 0 7rpx 0 rgba(73, 184, 86, 0.09);
  429. border: 1px solid #E5E9ED;
  430. position: relative;
  431. padding: 0 15rpx;
  432. font-size: 32rpx;
  433. @include semicircle(#f9fafb, 70rpx);
  434. .newOrders_header {
  435. height: 87rpx;
  436. padding: 0 27rpx;
  437. border-bottom: 1px dashed #E5E9ED;
  438. @include flex(space-between, center);
  439. .newOrders_header_title {
  440. color: #333;
  441. }
  442. .newOrders_header_more {
  443. color: #666;
  444. }
  445. }
  446. .newOrders_item {
  447. height: 88rpx;
  448. padding: 0 27rpx;
  449. border-bottom: 1px solid #E5E9ED;
  450. color: #333;
  451. font-size: 30rpx;
  452. @include flex(center, center);
  453. &:last-of-type {
  454. border-bottom: none;
  455. }
  456. .newOrders_item_time {
  457. width: 140rpx;
  458. }
  459. .newOrders_item_taskType {
  460. flex: 1;
  461. margin-left: 16rpx;
  462. @include clamp(1);
  463. }
  464. .newOrders_item_patientName {
  465. margin-left: 16rpx;
  466. margin-right: 16rpx;
  467. width: 148rpx;
  468. @include clamp(1);
  469. }
  470. .newOrders_item_status {}
  471. }
  472. }
  473. // 快捷工单
  474. .quick_other {
  475. width: 702rpx;
  476. background-color: #fff;
  477. margin-top: 8rpx;
  478. border-radius: 8rpx;
  479. // box-shadow: 0 0 7rpx 0 rgba(73, 184, 86, 0.09);
  480. border: 1px solid #E5E9ED;
  481. position: relative;
  482. padding: 0 15rpx;
  483. font-size: 32rpx;
  484. @include semicircle(#f9fafb, 70rpx);
  485. .quick_other_header {
  486. height: 87rpx;
  487. padding: 0 27rpx;
  488. border-bottom: 1px dashed #E5E9ED;
  489. @include flex(space-between, center);
  490. .quick_other_header_title {
  491. color: #333;
  492. }
  493. }
  494. .quick_other_container {
  495. min-height: 288rpx;
  496. @include flex(flex-start, center);
  497. flex-wrap: wrap;
  498. font-size: 28rpx;
  499. .quick_other_container_item {
  500. width: 96rpx;
  501. height: 96rpx;
  502. border-radius: 8rpx;
  503. margin: 16rpx 35rpx;
  504. color: #fff;
  505. text-align: center;
  506. @include flex(center, center) .quick_other_container_item_text {
  507. @include clamp(2);
  508. }
  509. &:nth-of-type(8n+1) {
  510. background-color: #A4C4C1;
  511. }
  512. &:nth-of-type(8n+2) {
  513. background-color: #56BAB6;
  514. }
  515. &:nth-of-type(8n+3) {
  516. background-color: #39B199;
  517. }
  518. &:nth-of-type(8n+4) {
  519. background-color: #48717F;
  520. }
  521. &:nth-of-type(8n+5) {
  522. background-color: #56BAB6;
  523. }
  524. &:nth-of-type(8n+6) {
  525. background-color: #A4C4C1;
  526. }
  527. &:nth-of-type(8n+7) {
  528. background-color: #48717F;
  529. }
  530. &:nth-of-type(8n+8) {
  531. background-color: #8E9D9E;
  532. }
  533. }
  534. }
  535. }
  536. }
  537. }
  538. </style>