bigScreen.vue 4.5 KB

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