endOrderSignBlood.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top_top">
  4. <view class="Scanning_top_icon">
  5. <text class="cubeic-ok icon_transport transport-duigou"></text>
  6. </view>
  7. <view class="Scanning_top_text">
  8. <view class="text1"> 签到成功 </view>
  9. </view>
  10. </view>
  11. <view class="Scanning_cont_cont">
  12. <view>您已到达{{queryObj.deptName}},请选择血制品进行交接</view>
  13. </view>
  14. <view class="Scanning_top">
  15. <view class="title1">{{queryObj.deptName}}</view>
  16. <view>{{dataList.patientTotalCount}}人</view>
  17. <view>{{dataList.bloodTotalCount}}袋</view>
  18. </view>
  19. <view class="Scanning_cont">
  20. <view class="list" v-for="(v2, i2) of dataList.children" :key="i2">
  21. <view class="list_top" :class="{disabled: v2.state.value == 5}">
  22. <checkbox-group @change="changeCheckbox(v2)" style="width: 100%;">
  23. <label style="display: flex;position: relative;">
  24. <checkbox class="checkbox" :checked="v2.checked" :disabled="v2.state.value == 5" />
  25. <text class="newicon newicon-a-ziyuan7"></text>
  26. <view class="title1 ellipsis">
  27. <text>{{v2.patientName}}</text><text>{{v2.hosNum}}</text>
  28. </view>
  29. <view style="display: flex;align-items: center;justify-content: space-between;">
  30. <text>{{v2.count}}袋</text>
  31. <text class="state">{{v2.state ? v2.state.name : ''}}</text>
  32. </view>
  33. </label>
  34. </checkbox-group>
  35. </view>
  36. <view class="list_bottom_wrap" v-for="(v3, i3) of v2.children" :key="i3" @click="v3.checked = !v3.checked">
  37. <view class="list_bottom">
  38. <view class="title1 ellipsis">
  39. <text class="ellipsis">{{v3.bloodCode}}</text>
  40. <text>{{v3.volume}}{{v3.unit}}</text>
  41. </view>
  42. <view class="title2">
  43. <text>{{v3.count}}袋</text>
  44. <text class="newicon newicon-a-ziyuan3" :class="{active: v3.checked}"></text>
  45. </view>
  46. </view>
  47. <view class="list_detail" v-if="v3.checked">
  48. <view class="list_detail_item" v-for="(v4, i4) of v3.children" :key="i4">
  49. <view class="list_detail_item_title">
  50. <text>{{v4.bloodCode}}{{v4.productCode ? '+' + v4.productCode : ''}}</text>
  51. <text class="blue serialNumber">{{i4 + 1}}</text>
  52. </view>
  53. <view class="list_detail_item_content">
  54. <view>
  55. <text>血型:{{v4.aboType}}</text>
  56. <text class="ml16">RH(D):{{v4.rhType}}</text>
  57. </view>
  58. <view>
  59. <text>失效时间:{{v4.overDate | formatDate('yyyy-MM-dd hh:mm')}}</text>
  60. <!-- <text class="zhi">至</text> -->
  61. <!-- <text></text> -->
  62. </view>
  63. <view class="list_detail_item_content_status">
  64. <text class="blue">{{v4.state ? v4.state.name : ''}}</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="foot_btn_spe">
  73. <view class="btn1" @click="complete()" v-if="dataList.bloodTotalCount">{{isComplete ? '核对完成-完成工单' : '核对完成'}}</view>
  74. <view class="btn3" @click="goBack()">返回</view>
  75. </view>
  76. <!-- 填写交接人工号弹窗 -->
  77. <selectAccount @click.stop.native v-if="hosModels.disjunctor" :content="hosModels.content" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  78. @cancel="hosCancel">
  79. </selectAccount>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. get,
  85. post,
  86. SM,
  87. webHandle
  88. } from "../../http/http.js";
  89. export default {
  90. data() {
  91. return {
  92. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  93. // 填写交接人工号弹窗model
  94. hosModels: {
  95. disjunctor: false,
  96. },
  97. dataList: {},
  98. queryObj: {}, //路由传递过来的数据
  99. isComplete: false,
  100. };
  101. },
  102. methods: {
  103. // arrayToObject(dataList){
  104. // let bloodList = [];
  105. // dataList.forEach(item1 => {
  106. // item1.children.forEach(item2 => {
  107. // bloodList = bloodList.concat(item2.children);
  108. // })
  109. // })
  110. // let obj = {};
  111. // bloodList.forEach(v => {
  112. // if(obj[v.gdid]){
  113. // obj[v.gdid].push(v)
  114. // }else{
  115. // obj[v.gdid] = [];
  116. // }
  117. // })
  118. // return obj;
  119. // },
  120. changeCheckbox(data){
  121. data.checked = !data.checked;
  122. // console.log(this.dataList.children);
  123. // let dataResList = this.dataList.children.filter(v => v.state.value == 4);
  124. // let bloodResObj = this.arrayToObject(dataResList);
  125. // let dataCheckedList = this.dataList.children.filter(v => v.checked && v.state.value == 4);
  126. // let bloodCheckedObj = this.arrayToObject(dataCheckedList);
  127. // let isComplete = false;
  128. // for(let key in bloodResObj){
  129. // if(bloodCheckedObj[key] && bloodCheckedObj[key].length === bloodResObj[key].length){
  130. // isComplete = true;
  131. // break;
  132. // }
  133. // }
  134. // this.isComplete = isComplete;
  135. let allData = this.dataList.children.filter(v => v.state.value == 4);
  136. let allDataChecked = this.dataList.children.filter(v => v.checked && v.state.value == 4);
  137. this.isComplete = allData.length === allDataChecked.length;
  138. },
  139. // 核对完成
  140. complete(){
  141. console.log(this.dataList.children);
  142. uni.showLoading({
  143. title: "加载中",
  144. mask: true,
  145. });
  146. post('/simple/data/fetchDataList/taskTypeConfig', {
  147. idx: 0,
  148. sum: 1,
  149. taskTypeConfig: {
  150. "taskTypeDTO": {
  151. "hosId": {
  152. "id": this.hosId
  153. },
  154. "ordinaryField": {
  155. "key": "ordinary_field",
  156. "value": "blood"
  157. }
  158. }
  159. },
  160. }).then(res => {
  161. uni.hideLoading();
  162. if(res.status == 200){
  163. let list = res.list || [];
  164. if(list.length > 0){
  165. let signTypeList = list[0].signTypeList || [];
  166. let signType = signTypeList.find( v => v.value == 6 );
  167. if(signType){
  168. this.showSelectAccount();
  169. }else{
  170. this.checkComplete();
  171. }
  172. }else{
  173. uni.showToast({
  174. icon: "none",
  175. title: "请配置血制品任务类型!",
  176. });
  177. }
  178. }else{
  179. uni.showToast({
  180. icon: "none",
  181. title: res.msg || "接口获取数据失败!",
  182. });
  183. }
  184. })
  185. },
  186. // 填写交接人工号-确认
  187. hosOk(data) {
  188. console.log(data);
  189. const {
  190. accountName,
  191. account,
  192. accountId
  193. } = data;
  194. if (!accountName && !account) {
  195. //没有填写交接人
  196. uni.showModal({
  197. title: "提示",
  198. content: "请填写交接人工号!",
  199. showCancel: false,
  200. success: function(res) {
  201. if (res.confirm) {
  202. console.log("用户点击确定");
  203. } else if (res.cancel) {
  204. console.log("用户点击取消");
  205. }
  206. },
  207. });
  208. return;
  209. } else if ((!accountName && account) || (accountName && !account)) {
  210. //没有填写交接人
  211. uni.showModal({
  212. title: "提示",
  213. content: "请填写正确的交接人工号!",
  214. showCancel: false,
  215. success: function(res) {
  216. if (res.confirm) {
  217. console.log("用户点击确定");
  218. } else if (res.cancel) {
  219. console.log("用户点击取消");
  220. }
  221. },
  222. });
  223. return;
  224. }
  225. this.hosModels.disjunctor = false;
  226. this.checkComplete(data);
  227. },
  228. // 填写交接人工号-取消
  229. hosCancel() {
  230. this.hosModels.disjunctor = false;
  231. this.flag = true;
  232. },
  233. // 填写交接人工号弹窗
  234. showSelectAccount() {
  235. console.log(this.dataList.children);
  236. let dataList = this.dataList.children.filter(v => v.checked && v.state.value == 4);
  237. let bloodNum = dataList.reduce((pre,current) => pre + current.count, 0);
  238. let patientNum = dataList.length;
  239. this.hosModels = {
  240. content: `已选择${patientNum}名患者共${bloodNum}袋血制品,确定核对完成,请输入交接人员工号!`,
  241. disjunctor: true,
  242. };
  243. },
  244. checkComplete(accountObj){
  245. console.log(this.dataList.children);
  246. let dataList = this.dataList.children.filter(v => v.checked && v.state.value == 4);
  247. let bloodList = [];
  248. dataList.forEach(item1 => {
  249. item1.children.forEach(item2 => {
  250. bloodList = bloodList.concat(item2.children);
  251. })
  252. })
  253. console.log(bloodList);
  254. uni.showLoading({
  255. title: "加载中",
  256. mask: true,
  257. });
  258. let postData = {
  259. "type": "bloodTake",
  260. "orderId": 0,
  261. delivery: this.queryObj.type === 'delivery' ? true : undefined,
  262. // "orderIds": this.queryObj.orderIds || undefined,
  263. bloodIds: bloodList.map(v => v.id).toString(),
  264. };
  265. if (accountObj) {
  266. postData.handoverUser = accountObj.accountId;
  267. }
  268. post('/transflow/checkComplete', postData).then(res => {
  269. uni.hideLoading();
  270. if(res.state == 200){
  271. uni.navigateTo({
  272. url: `../receiptpage/receiptpage`,
  273. });
  274. }else{
  275. uni.showToast({
  276. icon: "none",
  277. title: res.msg || "接口获取数据失败!",
  278. });
  279. }
  280. })
  281. },
  282. // 返回
  283. goBack() {
  284. uni.navigateBack();
  285. },
  286. //获取页面信息
  287. getInfo(){
  288. uni.showLoading({
  289. title: "加载中",
  290. mask: true,
  291. });
  292. post('/transflow/scanInfo', {
  293. "code": "nb",
  294. "id": 0,
  295. "type": "bloodTake",
  296. "deptOrderDetails": true,
  297. "orderIds": this.queryObj.orderIds,
  298. "deptId": this.queryObj.deptId,
  299. }).then(res => {
  300. uni.hideLoading();
  301. if(res.state == 200){
  302. let dataList = res.data.data || {};
  303. // 第一层
  304. let dataNewList = {
  305. bloodTotalCount: 0,
  306. patientTotalCount: 0,
  307. children: [],
  308. };
  309. for (let key2 in dataList) {
  310. let value2 = dataList[key2];
  311. console.log(value2);
  312. // 第三层,第四层
  313. let array3 = [];
  314. for (let key3 in value2) {
  315. let value3 = value2[key3];
  316. console.log(dataNewList);
  317. array3.push({
  318. checked: false,
  319. bloodCode: key3.split('|')[0],
  320. volume: key3.split('|')[1],
  321. unit: key3.split('|')[2],
  322. count: value3.length,
  323. children: value3,
  324. });
  325. }
  326. // 第二层
  327. dataNewList.children.push({
  328. patientName: key2.split('|')[0],
  329. hosNum: key2.split('|')[1],
  330. state: array3[0].children[0].state,
  331. count: array3.reduce((pre, current) => pre + current.count, 0),
  332. children: array3,
  333. });
  334. }
  335. // 计算第一层血袋数量
  336. dataNewList.bloodTotalCount = dataNewList.children.reduce((pre, current) => pre + current.count, 0);
  337. // 计算第一层患者数量
  338. dataNewList.patientTotalCount = Object.keys(dataList).length;
  339. console.log(dataNewList)
  340. // 赋值
  341. this.dataList = dataNewList;
  342. }else{
  343. uni.showToast({
  344. icon: "none",
  345. title: res.msg || "接口获取数据失败!",
  346. });
  347. }
  348. })
  349. },
  350. },
  351. onLoad(options) {
  352. console.log(options, "result");
  353. this.queryObj = options;
  354. this.getInfo();
  355. // #ifdef APP-PLUS
  356. webHandle("no", "app");
  357. // #endif
  358. // #ifdef H5
  359. webHandle("no", "wx");
  360. // #endif
  361. },
  362. };
  363. </script>
  364. <style lang="less" scoped>
  365. .Scanning_Result {
  366. padding: 16rpx;
  367. display: flex;
  368. flex-direction: column;
  369. height: 100vh;
  370. background-color: #f5f7fb;
  371. .ml16{
  372. margin-left: 16rpx;
  373. }
  374. .blue{
  375. color: #49b856!important;
  376. }
  377. .ellipsis{
  378. white-space: nowrap;
  379. overflow: hidden;
  380. text-overflow: ellipsis;
  381. }
  382. .Scanning_top_top {
  383. .Scanning_top_icon {
  384. width: 140rpx;
  385. height: 140rpx;
  386. margin: 50rpx auto 40rpx;
  387. border-radius: 50%;
  388. .speNum{
  389. text-align: center;
  390. font-size: 140rpx;
  391. }
  392. .cubeic-ok {
  393. font-size: 140rpx;
  394. color: #35b34a;
  395. }
  396. .cubeic-close {
  397. font-size: 140rpx;
  398. color: #ff3b53;
  399. }
  400. }
  401. .Scanning_top_text {
  402. .text1 {
  403. font-size: 48rpx;
  404. text-align: center;
  405. }
  406. .success_tips {
  407. color: red;
  408. font-size: 30rpx;
  409. }
  410. }
  411. }
  412. .Scanning_cont_cont {
  413. padding-bottom: 50rpx;
  414. text-align: center;
  415. display: flex;
  416. flex-direction: column;
  417. .fz58{
  418. font-size: 58rpx;
  419. }
  420. .table_bodys{
  421. overflow-y: auto;
  422. flex: 1;
  423. }
  424. .table_head{
  425. display: flex;
  426. margin-top: 50rpx;
  427. .ml16{
  428. margin-left: 16rpx;
  429. }
  430. view {
  431. height: 110rpx;
  432. line-height: 1;
  433. flex: 1;
  434. font-weight: bold;
  435. color: #000;
  436. font-size: 38rpx;
  437. display: flex;
  438. justify-content: center;
  439. align-items: center;
  440. }
  441. }
  442. .table_body{
  443. background: #F3FAF7;
  444. border-radius: 8px;
  445. border: 1px solid #E9E9E9;
  446. display: flex;
  447. margin-bottom: 20rpx;
  448. padding: 30rpx 20rpx;
  449. view {
  450. line-height: 1;
  451. flex: 1;
  452. color: #555;
  453. font-size: 38rpx;
  454. display: flex;
  455. justify-content: center;
  456. align-items: center;
  457. word-break: break-all;
  458. }
  459. }
  460. }
  461. .Scanning_top {
  462. margin-top: 16rpx;
  463. background-color: #fff;
  464. color: #49b856;
  465. font-weight: bold;
  466. font-size: 30rpx;
  467. display: flex;
  468. align-items: center;
  469. line-height: 1.1;
  470. view{
  471. padding: 16rpx 20rpx;
  472. flex: 1;
  473. &.title1{
  474. flex: 2;
  475. word-break: break-all;
  476. }
  477. }
  478. }
  479. .Scanning_cont {
  480. flex: 1;
  481. display: flex;
  482. flex-direction: column;
  483. overflow-y: auto;
  484. .list{
  485. background-color: #fff;
  486. margin-top: 16rpx;
  487. line-height: 1;
  488. .list_top{
  489. display: flex;
  490. font-weight: bold;
  491. color: #000;
  492. font-size: 30rpx;
  493. position: relative;
  494. padding-bottom: 16rpx;
  495. &.disabled{
  496. color: #767676!important;
  497. .newicon-a-ziyuan7,
  498. .state{
  499. color: #767676!important;
  500. }
  501. }
  502. .checkbox{
  503. position: absolute;
  504. left: 16rpx;
  505. top: 14rpx;
  506. /deep/ .uni-checkbox-input{
  507. width: 28rpx!important;
  508. height: 28rpx!important;
  509. }
  510. /deep/ .uni-checkbox-input.uni-checkbox-input-checked:before{
  511. font-size: 28rpx!important;
  512. }
  513. /deep/ .uni-checkbox-input.uni-checkbox-input-checked{
  514. color: #42b983!important;
  515. }
  516. }
  517. /deep/ .checkbox:not([disabled]) .uni-checkbox-input:hover {
  518. border-color: #42b983 !important;
  519. color: #42b983 !important;
  520. }
  521. .newicon-a-ziyuan7{
  522. position: absolute;
  523. left: 54rpx;
  524. top: 14rpx;
  525. font-size: 32rpx;
  526. color: #49b856;
  527. }
  528. .state{
  529. font-size: 22rpx;
  530. font-weight: bold;
  531. color: #49b856;
  532. }
  533. view{
  534. padding: 16rpx 20rpx 0 0;
  535. flex: 1;
  536. &.title1{
  537. padding: 16rpx 20rpx 0 94rpx;
  538. flex: 3;
  539. text:first-of-type{
  540. margin-right: 16rpx;
  541. }
  542. }
  543. }
  544. }
  545. .list_bottom{
  546. display: flex;
  547. font-size: 25rpx;
  548. color: #767676;
  549. view{
  550. padding: 0 20rpx 16rpx 5rpx;
  551. flex: 1;
  552. &.title1{
  553. padding: 0 60rpx 16rpx 54rpx;
  554. flex: 3;
  555. display: flex;
  556. }
  557. &.title2{
  558. display: flex;
  559. align-items: center;
  560. }
  561. .newicon-a-ziyuan3{
  562. color: #cdcdcd;
  563. font-size: 12rpx;
  564. margin-left: 20rpx;
  565. transform: rotate(180deg);
  566. transition: all 0.5s;
  567. &.active{
  568. transform: rotate(0deg);
  569. }
  570. }
  571. }
  572. }
  573. .list_detail{
  574. border: 2rpx solid #C6C6C6;
  575. padding: 22rpx 30rpx 0;
  576. font-size: 26rpx;
  577. .list_detail_item{
  578. margin-bottom: 22rpx;
  579. padding: 10rpx 0;
  580. background-color: #F3FAF7;
  581. .list_detail_item_title{
  582. padding: 0 17rpx 6rpx;
  583. border-bottom: 2rpx solid #C3C3C3;
  584. display: flex;
  585. align-items: center;
  586. justify-content: space-between;
  587. .serialNumber{
  588. font-size: 38rpx;
  589. }
  590. }
  591. .list_detail_item_content{
  592. padding: 0 17rpx;
  593. view{
  594. line-height: 35rpx;
  595. margin-top: 17rpx;
  596. &:first-of-type{
  597. margin-top: 9rpx;
  598. }
  599. }
  600. .zhi{
  601. margin-left: 60rpx;
  602. margin-right: 60rpx;
  603. }
  604. .list_detail_item_content_status{
  605. display: flex;
  606. justify-content: flex-end;
  607. text{
  608. font-weight: bold;
  609. }
  610. }
  611. }
  612. }
  613. }
  614. }
  615. }
  616. .foot_btn_spe {
  617. line-height: 64rpx;
  618. height: 64rpx;
  619. margin-bottom: 40rpx;
  620. text-align: center;
  621. display: flex;
  622. justify-content: space-between;
  623. view {
  624. height: 64rpx;
  625. flex: 1;
  626. margin: 0 1%;
  627. background-image: linear-gradient(to right, #72c172, #3bb197);
  628. color: #fff;
  629. border-radius: 8rpx;
  630. font-size: 26rpx;
  631. }
  632. }
  633. }
  634. </style>