endOrderSignBlood.vue 21 KB

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