bigScreen.vue 5.7 KB

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