index.vue 16 KB

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