bigScreen.vue 5.0 KB

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