bigScreen.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="toolbar" @click="Scanning()" hover-class="seimin-btn-hover">
  3. <text class="toolbar-icon icon_transport transport-saoma"></text>
  4. <text class="toolbar-sao">扫一扫</text>
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. post,
  10. SM
  11. } from "../../http/http.js";
  12. export default {
  13. data() {
  14. return {
  15. SMFlag: true,
  16. }
  17. },
  18. methods: {
  19. // 底部扫描
  20. Scanning() {
  21. if (!this.SMFlag) {
  22. return;
  23. }
  24. this.SMFlag = false;
  25. SM().then((content) => {
  26. uni.showLoading({
  27. title: "加载中",
  28. mask: true,
  29. });
  30. //检验二维码的有效性(扫码前必须验证)
  31. post("/dept/scanning", {
  32. content,
  33. })
  34. .then((result) => {
  35. this.SMFlag = true;
  36. // 200检测通过,201没有有效期也通过。
  37. if (result.state == 200 || result.state == 201) {
  38. let data = {
  39. code: result.code, //二维码
  40. };
  41. //微信—大扫描(科室码,患者码,标本码,快捷建单码,药包码)
  42. post("/workerOrder/scanCode", data)
  43. .then((res) => {
  44. uni.hideLoading();
  45. if (res.status == 200) {
  46. // 扫描标本码
  47. if (res.type == "specimen") {
  48. let infoDATA = {
  49. stype: res.data.stype,
  50. scode: res.data.scode,
  51. patientName: res.data.patientName,
  52. sickRoom: res.data.sickRoom ?
  53. res.data.sickRoom.dept : "-",
  54. checkDept: res.data.checkDept ?
  55. res.data.checkDept.dept : "-",
  56. bedNum: res.data.bedNum,
  57. };
  58. uni.navigateTo({
  59. url: `../scanning_B/scanning_B?res=${encodeURIComponent(
  60. JSON.stringify(res)
  61. )}&infoDATA=${encodeURIComponent(
  62. JSON.stringify(infoDATA)
  63. )}`,
  64. });
  65. } else if (res.type == "patient") {
  66. //如果是患者腕带码
  67. // code: data.code //二维码
  68. res.workOrder = res.workOrder ? res.workOrder : []; //liao
  69. uni.navigateTo({
  70. url: `../scanning_ins/scanning_ins?code=${
  71. data.code
  72. }&infoDATA=${encodeURIComponent(
  73. JSON.stringify(res.data)
  74. )}&workData=${encodeURIComponent(
  75. JSON.stringify(res.workOrder)
  76. )}&patientOrders=${encodeURIComponent(
  77. JSON.stringify(res.patientOrders)
  78. )}`,
  79. });
  80. } else if (res.type == "quickOrder") {
  81. //快捷建单
  82. uni.navigateTo({
  83. url: `../shortcutbuildOrders/shortcutbuildOrders?infoDATA=${encodeURIComponent(
  84. JSON.stringify(res.data)
  85. )}`,
  86. });
  87. } else if (res.type == "dept") {
  88. // 扫描科室码
  89. // code: data.code //二维码
  90. let infoDATA = res.data;
  91. uni.navigateTo({
  92. url: `../scanning_all/scanning_all?infoDATA=${encodeURIComponent(
  93. JSON.stringify(infoDATA)
  94. )}&code=${data.code}`,
  95. });
  96. } else if (res.type == 'drugsBag') {
  97. //扫药包码
  98. uni.navigateTo({
  99. url: `/pages/scanning_drug/scanning_drug?drugsBagId=${res.drugsBagId}`,
  100. });
  101. }
  102. } else {
  103. uni.navigateTo({
  104. url: `../scanning_Result/scanning_Result?status=${res.status}&msg=${res.msg}`,
  105. });
  106. }
  107. });
  108. } else {
  109. uni.hideLoading();
  110. uni.showToast({
  111. icon: "none",
  112. title: '请求失败',
  113. });
  114. }
  115. })
  116. }).catch(err => {
  117. this.SMFlag = true;
  118. });
  119. },
  120. },
  121. onShow() {
  122. this.SMFlag = true;
  123. }
  124. };
  125. </script>
  126. <style lang="less">
  127. // 底部扫一扫
  128. .toolbar {
  129. position: fixed;
  130. left: 0;
  131. right: 0;
  132. bottom: 0;
  133. z-index: 999;
  134. height: 88rpx;
  135. display: flex;
  136. justify-content: center;
  137. align-items: center;
  138. box-sizing: border-box;
  139. border-radius: 4rpx;
  140. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.24);
  141. background-color: #e5e9ed;
  142. .toolbar-icon {
  143. font-size: 52rpx;
  144. margin-right: 16rpx;
  145. color: #07863c;
  146. }
  147. .toolbar-sao {
  148. font-size: 36rpx;
  149. color: #333;
  150. }
  151. }
  152. </style>