scanning_blood_process.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top" v-if="status == 200">
  4. <view class="Scanning_top_icon">
  5. <view>
  6. <view class="red fweight speNum"> {{ speNum }} </view>
  7. </view>
  8. </view>
  9. <view class="Scanning_top_text">
  10. <view class="text1"> 操作成功 </view>
  11. </view>
  12. </view>
  13. <view class="Scanning_top" v-if="status != 200">
  14. <view class="Scanning_top_icon">
  15. <text class="cubeic-close icon_transport transport-shibai"></text>
  16. </view>
  17. <view class="Scanning_top_text">
  18. <view class="text1"> 操作失败 </view>
  19. <view class="text1 f30" v-if="queryObj.qrcode"> 扫描内容:{{queryObj.qrcode}} </view>
  20. </view>
  21. </view>
  22. <view class="Scanning_cont" v-if="status == 200">
  23. <view>{{bloodDTO.type ? bloodDTO.type.name : "无"}}<text v-if="bloodDTO.type">({{bloodDTO.bloodCode||'无'}}) {{ bloodDTO.volume?bloodDTO.volume+'ML':'无' }}</text></view>
  24. <view>采血日期:<text v-if="bloodDTO.printDate">{{bloodDTO.printDate | formatDate('yyyy-MM-dd hh:mm')}}</text><text v-else>无</text></view>
  25. <view>有效期至:<text v-if="bloodDTO.overDate">{{bloodDTO.overDate | formatDate('yyyy-MM-dd hh:mm')}}</text><text v-else>无</text></view>
  26. <view>
  27. 血型:{{ bloodDTO.aboType||'无' }}
  28. &emsp;&emsp;
  29. RH(D):<text>{{bloodDTO.rhType || '无'}}</text>
  30. </view>
  31. <view>患者:<text>{{ bloodDTO.patientName }}<text v-if="bloodDTO.hosNum">({{ bloodDTO.hosNum }})</text></text></view>
  32. <view>申请科室:{{ bloodDTO.applyDeptDTO?bloodDTO.applyDeptDTO.dept:'无' }}</view>
  33. </view>
  34. <view class="foot_btn_spe">
  35. <view class="btn1" @click="Scanning_again()"> 继续扫描 </view>
  36. <view class="btn3" @click="hand_again()">手动录入</view>
  37. <view class="btn2" style="width: 98%;" @click="countAndCheck()"> 清点核对 </view>
  38. </view>
  39. <!-- 手动查询弹窗 -->
  40. <handViewBlood v-if="speModels.disjunctor" :title="speModels.title" :disjunctor="speModels.disjunctor"
  41. @ok="speOk" @cancel="speCancel">
  42. </handViewBlood>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. get,
  48. post,
  49. SM,
  50. webHandle
  51. } from "../../http/http.js";
  52. export default {
  53. data() {
  54. return {
  55. bloodDTO:{},
  56. status: 200,
  57. speNum: 0,
  58. // 手动查询弹窗model
  59. speModels: {
  60. disjunctor: false,
  61. },
  62. SMFlag: true,
  63. queryObj: {}, //路由传递过来的数据
  64. };
  65. },
  66. methods: {
  67. // 手动查询-确认
  68. speOk(data) {
  69. console.log(data);
  70. if (!data.id) {
  71. //没有查询到
  72. uni.showModal({
  73. title: '提示',
  74. content: "没有查询到血袋!",
  75. showCancel: false,
  76. success: function(res) {
  77. if (res.confirm) {
  78. console.log('用户点击确定');
  79. } else if (res.cancel) {
  80. console.log('用户点击取消');
  81. }
  82. }
  83. });
  84. return;
  85. }
  86. this.speModels.disjunctor = false;
  87. this.hand_scanning_common(data.bloodCode, 'hand');
  88. },
  89. // 手动查询-取消
  90. speCancel() {
  91. this.speModels.disjunctor = false;
  92. },
  93. // 手动查询弹窗
  94. showHandViewSpecimen() {
  95. this.speModels = {
  96. title: '填写血袋号',
  97. disjunctor: true,
  98. }
  99. },
  100. // 手动录入
  101. hand_again() {
  102. this.showHandViewSpecimen();
  103. },
  104. // 手动输入和扫码公共方法
  105. hand_scanning_common(ress1, type) {
  106. // ----------------
  107. uni.showLoading({
  108. title: "加载中",
  109. mask: true,
  110. });
  111. //检验二维码的有效性
  112. post("/dept/scanning", {
  113. content: ress1,
  114. }).then((result) => {
  115. this.SMFlag = true;
  116. if (result.state == 200 || result.state == 201) {
  117. let codes = result.code;
  118. if (codes) {
  119. // 判断是否有多个血袋号 start
  120. post("/transflow/scanCheckList", {
  121. type: 'blood',
  122. code: codes,
  123. }).then((res) => {
  124. if (res.state == 200) {
  125. res.data = res.data || [];
  126. if(res.data.length > 1){
  127. uni.navigateTo({
  128. url: `/pages/bloodSelect/bloodSelect?qrcode=${codes}&navigateTo=scanning_blood_process&orderId=${this.queryObj.orderId}&scanOrHand=${type}`,
  129. });
  130. }else{
  131. post("/transflow/scanBind", {type: 'blood',orderId: this.queryObj.orderId, code: ress1}).then((ress) => {
  132. uni.hideLoading();
  133. if (ress.state == 200 && ress.data.state != 400) {
  134. //扫描标本后会自动调用摄像头,继续扫描,直到status不是200
  135. setTimeout(()=>{
  136. if (type === 'scan') {
  137. this.Scanning_again();
  138. }
  139. },500)
  140. //todo
  141. uni.redirectTo({
  142. url: `../scanning_blood_process/scanning_blood_process?orderId=${this.queryObj.orderId}&bloodDTO=${encodeURIComponent(JSON.stringify(ress.data.dto))}&scanCount=${ress.data.scanCount}&status=200&scanOrHand=${type}`,
  143. });
  144. } else {
  145. uni.redirectTo({
  146. url: `../scanning_blood_process/scanning_blood_process?orderId=${this.queryObj.orderId}&status=500&scanOrHand=${type}&qrcode=${ress1}`,
  147. });
  148. }
  149. });
  150. }
  151. } else {
  152. uni.hideLoading();
  153. uni.showToast({
  154. icon: "none",
  155. title: "请求失败!",
  156. });
  157. }
  158. });
  159. // 判断是否有多个血袋号 end
  160. } else {
  161. uni.hideLoading();
  162. }
  163. } else {
  164. uni.hideLoading();
  165. uni.showToast({
  166. icon: "none",
  167. title: "请求失败!",
  168. });
  169. }
  170. });
  171. // ------------------------------
  172. },
  173. // 继续扫描
  174. Scanning_again() {
  175. if (!this.SMFlag) {
  176. return;
  177. }
  178. this.SMFlag = false;
  179. SM().then((ress1) => {
  180. this.hand_scanning_common(ress1, 'scan');
  181. }).catch(err => {
  182. this.SMFlag = true;
  183. });
  184. },
  185. // 清点核对
  186. countAndCheck() {
  187. uni.navigateTo({
  188. url: `../check_blood/check_blood?orderId=${this.queryObj.orderId}`,
  189. });
  190. },
  191. },
  192. onShow() {
  193. this.SMFlag = true;
  194. },
  195. onLoad(options) {
  196. console.log(options, "result");
  197. if (options.status == 200 && options.scanOrHand === 'hand') {
  198. this.hand_again();
  199. }
  200. if (options.status == 200 && options.scanOrHand === 'scan' && options.isSelect == 1) {
  201. //扫描标本后会自动调用摄像头,继续扫描,直到status不是200
  202. // isSelect是多血袋选择后自动调用
  203. setTimeout(()=>{
  204. this.Scanning_again();
  205. },500)
  206. }
  207. this.queryObj = options;
  208. if (options.bloodDTO) {
  209. this.bloodDTO = JSON.parse(options.bloodDTO);
  210. }
  211. this.status = options.status;
  212. this.speNum = options.scanCount;
  213. // #ifdef APP-PLUS
  214. webHandle("no", "app");
  215. // #endif
  216. // #ifdef H5
  217. webHandle("no", "wx");
  218. // #endif
  219. },
  220. };
  221. </script>
  222. <style lang="less">
  223. .Scanning_Result {
  224. padding: 0 20rpx;
  225. .Scanning_top {
  226. .Scanning_top_icon {
  227. width: 140rpx;
  228. height: 140rpx;
  229. margin: 0 auto;
  230. border-radius: 50%;
  231. line-height: 140rpx;
  232. .speNum{
  233. text-align: center;
  234. font-size: 140rpx;
  235. }
  236. .cubeic-ok {
  237. font-size: 140rpx;
  238. color: #35b34a;
  239. }
  240. .cubeic-close {
  241. font-size: 140rpx;
  242. color: #ff3b53;
  243. }
  244. }
  245. .Scanning_top_text {
  246. .text1 {
  247. font-size: 48rpx;
  248. text-align: center;
  249. }
  250. .success_tips {
  251. color: red;
  252. font-size: 30rpx;
  253. }
  254. }
  255. }
  256. .Scanning_cont {
  257. font-size: 32rpx;
  258. text-align: center;
  259. view {
  260. margin-bottom: 16rpx;
  261. }
  262. .Scanning_cont_center {
  263. text-align: center;
  264. }
  265. .text {
  266. margin-top: 24rpx;
  267. color: #35b34a;
  268. }
  269. .text1 {
  270. margin-top: 24rpx;
  271. color: #ff3b53;
  272. }
  273. }
  274. .foot_btn {
  275. line-height: 88rpx;
  276. height: 100rpx;
  277. margin-top: 40rpx;
  278. display: flex;
  279. justify-content: center;
  280. .btn1,
  281. .btn2,
  282. .btn3 {
  283. height: 88rpx;
  284. flex: 1;
  285. margin: 0 1%;
  286. background-image: linear-gradient(to right, #72c172, #3bb197);
  287. color: #fff;
  288. border-radius: 8rpx;
  289. font-size: 32rpx;
  290. margin-top: 16rpx;
  291. text-align: center;
  292. }
  293. }
  294. .foot_btn_spe {
  295. line-height: 88rpx;
  296. height: 100rpx;
  297. margin-top: 40rpx;
  298. text-align: center;
  299. display: flex;
  300. justify-content: space-between;
  301. flex-wrap: wrap;
  302. &::after {
  303. content: '';
  304. flex: 1;
  305. }
  306. view {
  307. height: 88rpx;
  308. width: 48%;
  309. margin: 0 1%;
  310. background-image: linear-gradient(to right, #72c172, #3bb197);
  311. color: #fff;
  312. border-radius: 8rpx;
  313. font-size: 32rpx;
  314. margin-top: 16rpx;
  315. }
  316. }
  317. }
  318. </style>