endOrderSignBlood.vue 21 KB

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