bloodSelect.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. <template>
  2. <view class="patientInformationList">
  3. <view class="page_tab">
  4. <view class="page_tab_bar active">
  5. <view class="tab_dept">血制品选择页面</view>
  6. </view>
  7. </view>
  8. <view v-if="zxzData.length == 0" class="zwsj">
  9. <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
  10. <view class="zwsj-txt">暂无数据</view>
  11. </view>
  12. <view v-if="zxzData.length" class="page_items">
  13. <scroll-view class="page_items_scroll" scroll-y :refresher-enabled="scroll_refresher_enabled"
  14. :refresher-triggered="triggered" @refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore"
  15. @scrolltolower="scrolltolower" :scroll-top="scroll_top" @refresherabort="refresherabort" @scroll="scroll"
  16. refresher-background="transport">
  17. <view class="page_item_wrap" v-for="(item, index) of zxzData" :key="index" @click="itemInfo(item)">
  18. <view class="page_item">
  19. <view class="L"></view>
  20. <view class="R"></view>
  21. <view class="page_item_top">
  22. <view class="page_item_top_L">
  23. <text>{{ item.bloodCode }}<text v-if="item.productCode">({{ item.productCode }})</text></text>
  24. </view>
  25. <view class="send_wrap"></view>
  26. </view>
  27. <view class="page_item_cont">
  28. <view class="page_item_conts">
  29. <view>{{ item.patientName }}({{ item.patientNo }})</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="L-l"></view>
  34. <view class="R-l"></view>
  35. </view>
  36. </scroll-view>
  37. </view>
  38. <!-- 弹窗 -->
  39. <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content"
  40. :operate="models1.operate" @ok="ok1" @cancel="cancel1"></showModel>
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. get,
  46. post,
  47. SM,
  48. deleteIt,
  49. webHandle
  50. } from "../../http/http.js";
  51. export default {
  52. data() {
  53. return {
  54. SMFlag:true,
  55. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  56. // 选中的患者项
  57. currentItem: {},
  58. // 弹窗model
  59. models1: {
  60. disjunctor: false,
  61. },
  62. scrollYY: 0, //滚动条滚动的距离
  63. options: {},
  64. //列表数据
  65. zxzData: [],
  66. //分页页码
  67. idx: 0,
  68. // 列表项总数
  69. totalNum: -1,
  70. triggered: false, //下拉刷新状态
  71. freshing: false, //上拉加载开关
  72. scroll_top: 0, //距离顶部的距离
  73. scroll_refresher_enabled: true, //是否开启自定义下拉刷新
  74. };
  75. },
  76. methods: {
  77. ok1() {
  78. this.models1.disjunctor = false;
  79. if(this.options.navigateTo === 'scanning_blood_process'){
  80. uni.showLoading({
  81. title: "加载中",
  82. mask: true,
  83. });
  84. post("/transflow/scanBind", {type: 'blood',orderId: this.options.orderId, id: this.currentItem.id}).then((ress) => {
  85. uni.hideLoading();
  86. if (ress.state == 200 && ress.data.state != 400) {
  87. //todo
  88. uni.redirectTo({
  89. url: `../scanning_blood_process/scanning_blood_process?orderId=${this.options.orderId}&bloodDTO=${encodeURIComponent(JSON.stringify(ress.data.dto))}&scanCount=${ress.data.scanCount}&status=200&scanOrHand=${this.options.scanOrHand}&isSelect=1`,
  90. });
  91. } else {
  92. uni.redirectTo({
  93. url: `../scanning_blood_process/scanning_blood_process?orderId=${this.options.orderId}&status=500&scanOrHand=${this.options.scanOrHand}&qrcode=${this.options.qrcode}`,
  94. });
  95. }
  96. });
  97. }else{
  98. uni.navigateTo({
  99. url: `../${this.options.navigateTo}/${this.options.navigateTo}?id=${this.currentItem.id}`,
  100. });
  101. }
  102. },
  103. cancel1() {
  104. this.models1.disjunctor = false;
  105. },
  106. // 进入详情页
  107. itemInfo(item) {
  108. // #ifdef H5
  109. document.body.removeEventListener("touchmove", this.stop, {
  110. passive: false,
  111. });
  112. // #endif
  113. console.log(item)
  114. this.currentItem = item;
  115. this.models1 = {
  116. disjunctor: true,
  117. title: "提示",
  118. content: `您确认是此血袋号【${item.bloodCode}】;产品码【${item.productCode}】;患者【${item.patientName}】吗?`,
  119. icon: "warn",
  120. operate: {
  121. ok: "确认",
  122. cancel: "取消",
  123. },
  124. };
  125. },
  126. //血制品列表数据获取
  127. waitingOrders(idx) {
  128. if (this.zxzData.length == this.totalNum) {
  129. uni.showToast({
  130. icon: "none",
  131. title: "没有更多数据了!",
  132. });
  133. this.freshing = true;
  134. return;
  135. }
  136. uni.showLoading({
  137. title: "加载中",
  138. mask: true,
  139. });
  140. // 请求列表数据
  141. post("/transflow/scanCheckList", {
  142. type: 'blood',
  143. code: this.options.qrcode,
  144. }).then((res) => {
  145. uni.hideLoading();
  146. if (res.state == 200) {
  147. this.triggered = false;
  148. this.freshing = true;
  149. this.totalNum = res.data ? res.data.length : 0;
  150. if (idx === 0) {
  151. this.zxzData = res.data;
  152. } else {
  153. this.zxzData.push(...res.data);
  154. }
  155. } else {
  156. uni.showToast({
  157. icon: "none",
  158. title: "请求失败!",
  159. });
  160. }
  161. });
  162. },
  163. //刷新
  164. refresherrefresh() {
  165. if (this.triggered) {
  166. return;
  167. }
  168. console.log("下拉刷新");
  169. this.triggered = true;
  170. this.idx = 0;
  171. this.totalNum = -1;
  172. this.waitingOrders(0);
  173. },
  174. // 下拉刷新复位
  175. refresherrestore() {
  176. this.triggered = false;
  177. console.log("下拉刷新复位");
  178. },
  179. //下拉刷新中止
  180. refresherabort() {
  181. this.triggered = false;
  182. console.log("下拉刷新中止");
  183. },
  184. //分页,上拉加载
  185. scrolltolower() {
  186. if (this.freshing) {
  187. console.log("上拉加载");
  188. this.freshing = false;
  189. // this.waitingOrders(++this.idx);
  190. }
  191. },
  192. // 滚动
  193. scroll(e) {
  194. this.scrollYY = e.detail.scrollTop;
  195. if (e.detail.scrollTop < 20) {
  196. this.scroll_refresher_enabled = true;
  197. } else {
  198. this.scroll_refresher_enabled = false;
  199. }
  200. },
  201. // 阻止浏览器滑动
  202. stop(e) {
  203. e.preventDefault();
  204. },
  205. },
  206. onLoad(options) {
  207. console.log(options);
  208. this.options = options;
  209. //滚动条位置设置
  210. if (options.scrollYY !== undefined) {
  211. this.scroll_top = options.scrollYY;
  212. }
  213. this.waitingOrders(0);
  214. // #ifdef APP-PLUS
  215. webHandle("no", "app");
  216. // #endif
  217. // #ifdef H5
  218. webHandle("no", "wx");
  219. // #endif
  220. },
  221. onShow() {
  222. this.SMFlag = true;
  223. // #ifdef H5
  224. document.body.addEventListener("touchmove", this.stop, {
  225. passive: false,
  226. });
  227. // #endif
  228. },
  229. onHide() {
  230. // #ifdef H5
  231. document.body.removeEventListener("touchmove", this.stop, {
  232. passive: false,
  233. });
  234. // #endif
  235. },
  236. };
  237. </script>
  238. <style lang="less">
  239. .patientInformationList {
  240. width: 100%;
  241. height: 100%;
  242. position: relative;
  243. .icon_transport {
  244. color: #49b856;
  245. font-size: 50rpx;
  246. &.colorRed {
  247. color: red;
  248. font-size: 40rpx;
  249. }
  250. }
  251. .page_tab {
  252. width: 100%;
  253. height: 96rpx;
  254. display: flex;
  255. position: fixed;
  256. left: 0;
  257. top: 0;
  258. z-index: 999;
  259. .page_tab_bar {
  260. flex: 1;
  261. font-size: 36rpx;
  262. background: #fff;
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. position: relative;
  267. &:after {
  268. content: "";
  269. position: absolute;
  270. left: 0;
  271. bottom: 0;
  272. height: 2rpx;
  273. width: 100%;
  274. background-color: transparent;
  275. }
  276. .tab_dept {
  277. position: relative;
  278. .changeDept {
  279. white-space: nowrap;
  280. margin: 0;
  281. position: absolute;
  282. right: 0;
  283. top: 50%;
  284. transform: translate(105%, -50%);
  285. padding: 0 0.5em;
  286. line-height: 2;
  287. }
  288. }
  289. &.active {
  290. color: #49b856;
  291. &:after {
  292. background-color: #49b856;
  293. }
  294. }
  295. }
  296. }
  297. .zwsj {
  298. position: absolute;
  299. left: 50%;
  300. top: 180rpx;
  301. transform: translateX(-50%);
  302. .zwsj-img {
  303. width: 560rpx;
  304. }
  305. .zwsj-txt {
  306. font-size: 36rpx;
  307. font-weight: 700;
  308. margin-top: 20rpx;
  309. text-align: center;
  310. }
  311. }
  312. .page_items {
  313. // height: calc(100vh - 184rpx);
  314. height: calc(100vh - 96rpx);
  315. padding: 0 20rpx;
  316. padding-top: 96rpx;
  317. .page_items_scroll {
  318. height: 100%;
  319. .page_item_wrap {
  320. position: relative;
  321. margin-bottom: 32rpx;
  322. .page_item {
  323. margin-bottom: 16rpx;
  324. // height: 276rpx;
  325. height: 200rpx;
  326. background: #fff;
  327. border-radius: 8rpx;
  328. overflow: hidden;
  329. border: 2rpx solid #e5e9ed;
  330. display: flex;
  331. flex-direction: column;
  332. justify-content: space-between;
  333. .L {
  334. width: 40rpx;
  335. height: 40rpx;
  336. border-radius: 50%;
  337. background: #f9fafb;
  338. position: absolute;
  339. left: -24rpx;
  340. top: 68rpx;
  341. border: 2rpx solid #e5e9ed;
  342. }
  343. .R {
  344. width: 40rpx;
  345. height: 40rpx;
  346. border-radius: 50%;
  347. background: #f9fafb;
  348. position: absolute;
  349. float: right;
  350. right: -24rpx;
  351. top: 68rpx;
  352. border: 2rpx solid #e5e9ed;
  353. }
  354. .page_item_top {
  355. height: 86rpx;
  356. border-bottom: 2rpx dashed #e5e9ed;
  357. padding: 0 16rpx;
  358. display: flex;
  359. align-items: center;
  360. justify-content: space-between;
  361. .send_wrap {
  362. display: flex;
  363. justify-content: space-between;
  364. align-items: center;
  365. }
  366. .sendBack {
  367. button {
  368. font-size: 28rpx;
  369. height: 52rpx;
  370. line-height: 52rpx;
  371. margin: 0;
  372. color: rgb(7, 134, 60);
  373. }
  374. }
  375. .page_item_top_L {
  376. height: 100%;
  377. float: left;
  378. display: flex;
  379. align-items: center;
  380. line-height: 88rpx;
  381. .L_time {
  382. color: #6cc076;
  383. font-size: 32rpx;
  384. }
  385. }
  386. .page_item_top_R {
  387. height: 40rpx;
  388. float: right;
  389. line-height: 40rpx;
  390. font-size: 24rpx;
  391. padding: 0 8rpx;
  392. background-color: red;
  393. color: #fff;
  394. }
  395. }
  396. .page_item_cont {
  397. min-height: 100rpx;
  398. max-height: 344rpx;
  399. padding: 0 16rpx;
  400. text-align: left;
  401. position: relative;
  402. .page_item_conts {
  403. color: rgb(102, 102, 102);
  404. font-size: 28rpx;
  405. display: flex;
  406. align-items: center;
  407. min-height: 100rpx;
  408. max-height: 344rpx;
  409. view {
  410. margin-bottom: 10rpx;
  411. margin-left: 40rpx;
  412. &:first-of-type {
  413. margin-left: 0;
  414. }
  415. }
  416. text {
  417. color: #49b856;
  418. }
  419. .num {
  420. float: right;
  421. }
  422. }
  423. }
  424. .page_item_btn {
  425. height: 88rpx;
  426. background-image: linear-gradient(to right, #72c172, #3bb197);
  427. border-radius: 8rpx;
  428. line-height: 88rpx;
  429. color: #fff;
  430. font-size: 36rpx;
  431. font-weight: 700;
  432. text-align: center;
  433. }
  434. }
  435. .L-l {
  436. width: 2rpx;
  437. height: 40rpx;
  438. background: #f9fafb;
  439. position: absolute;
  440. left: 20rpx;
  441. top: 72rpx;
  442. display: none;
  443. }
  444. .R-l {
  445. width: 2rpx;
  446. height: 40rpx;
  447. background: #f9fafb;
  448. position: absolute;
  449. right: 20rpx;
  450. top: 72rpx;
  451. display: none;
  452. }
  453. }
  454. }
  455. }
  456. }
  457. </style>