startOrderSignBloodDetail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. <view class="title1">{{queryObj.deptName}}</view>
  5. <view>{{dataList.patientTotalCount}}人</view>
  6. <view>{{dataList.bloodTotalCount}}袋</view>
  7. </view>
  8. <view class="Scanning_cont">
  9. <view class="list" v-for="(v2, i2) of dataList.children" :key="i2">
  10. <view class="list_top">
  11. <text class="newicon newicon-a-ziyuan7"></text>
  12. <view class="title1 ellipsis">
  13. <cancelBlood :data="v2" :index="i2" :delivery="delivery" :cancelBlood="cancelBlood" :cancelBloodHandover="cancelBloodHandover" :dataList="dataList" type="start"></cancelBlood>
  14. </view>
  15. <view>
  16. <text>{{v2.count}}袋</text>
  17. </view>
  18. </view>
  19. <view class="list_bottom_wrap" v-for="(v3, i3) of v2.children" :key="i3" @click="v3.checked = !v3.checked">
  20. <view class="list_bottom">
  21. <view class="title1 ellipsis">
  22. <text class="ellipsis">{{v3.bloodCode}}</text>
  23. <text>{{v3.volume}}{{v3.unit}}</text>
  24. </view>
  25. <view class="title2">
  26. <text>{{v3.count}}袋</text>
  27. <text class="newicon newicon-a-ziyuan3" :class="{active: v3.checked}"></text>
  28. </view>
  29. </view>
  30. <view class="list_detail" v-if="v3.checked">
  31. <view class="list_detail_item" v-for="(v4, i4) of v3.children" :key="i4">
  32. <view class="list_detail_item_title">
  33. <text>{{v4.bloodCode}}{{v4.productCode ? '+' + v4.productCode : ''}}</text>
  34. <text class="blue serialNumber">{{i4 + 1}}</text>
  35. </view>
  36. <view class="list_detail_item_content">
  37. <view>
  38. <text>血型:{{v4.aboType}}</text>
  39. <text class="ml16">RH(D):{{v4.rhType}}</text>
  40. </view>
  41. <view>
  42. <text>失效时间:{{v4.overDate | formatDate('yyyy-MM-dd hh:mm')}}</text>
  43. <!-- <text class="zhi">至</text> -->
  44. <!-- <text></text> -->
  45. </view>
  46. <view class="list_detail_item_content_status">
  47. <text class="blue">{{v4.state ? v4.state.name : ''}}</text>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="foot_btn_spe">
  56. <view class="btn3" @click="goBack()">返回</view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. get,
  63. post,
  64. SM,
  65. webHandle
  66. } from "@/http/http.js";
  67. export default {
  68. data() {
  69. return {
  70. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  71. dataList: {},
  72. queryObj: {}, //路由传递过来的数据
  73. delivery: 0,
  74. cancelBlood: 0,
  75. cancelBloodHandover: 0,
  76. };
  77. },
  78. methods: {
  79. // 获取血制品页面控制开关
  80. getTaskBloodConfig(){
  81. return post("/simple/data/fetchDataList/taskTypeConfig", {
  82. "idx": 0,
  83. "sum": 10,
  84. "taskTypeConfig": {
  85. "taskTypeDTO": {
  86. "hosId": {
  87. "id": this.hosId
  88. },
  89. "ordinaryField": {
  90. "key": "ordinary_field",
  91. "value": "blood"
  92. }
  93. }
  94. }
  95. });
  96. },
  97. // 获取血制品页面控制开关
  98. async getBloodPageConfig(){
  99. let result = await this.getTaskBloodConfig();
  100. if (result.status == 200) {
  101. if(result.list && result.list[0]){
  102. this.delivery = result.list[0].delivery;
  103. this.cancelBlood = result.list[0].cancelBlood;
  104. this.cancelBloodHandover = result.list[0].cancelBloodHandover;
  105. }else{
  106. this.delivery = 0;
  107. this.cancelBlood = 0;
  108. this.cancelBloodHandover = 0;
  109. }
  110. } else {
  111. this.delivery = 0;
  112. this.cancelBlood = 0;
  113. this.cancelBloodHandover = 0;
  114. }
  115. },
  116. // 返回
  117. goBack() {
  118. uni.navigateBack();
  119. },
  120. //获取页面信息
  121. getInfo(){
  122. uni.showLoading({
  123. title: "加载中",
  124. mask: true,
  125. });
  126. post('/transflow/scanInfo', {
  127. "code": "nb",
  128. "id": 0,
  129. "type": "bloodTake",
  130. "deptOrderDetails": true,
  131. "bloodIds": this.queryObj.bloodIds,
  132. }).then(res => {
  133. uni.hideLoading();
  134. if(res.state == 200){
  135. let dataList = res.data.data || {};
  136. // 第一层
  137. let dataNewList = {
  138. bloodTotalCount: 0,
  139. patientTotalCount: 0,
  140. children: [],
  141. };
  142. for (let key2 in dataList) {
  143. let value2 = dataList[key2];
  144. console.log(value2);
  145. // 第三层,第四层
  146. let array3 = [];
  147. for (let key3 in value2) {
  148. let value3 = value2[key3];
  149. console.log(dataNewList);
  150. array3.push({
  151. checked: false,
  152. bloodCode: key3.split('|')[0],
  153. volume: key3.split('|')[1],
  154. unit: key3.split('|')[2],
  155. count: value3.length,
  156. children: value3,
  157. });
  158. }
  159. // 第二层
  160. dataNewList.children.push({
  161. patientName: key2.split('|')[0],
  162. hosNum: key2.split('|')[1],
  163. count: array3.reduce((pre, current) => pre + current.count, 0),
  164. children: array3,
  165. });
  166. }
  167. // 计算第一层血袋数量
  168. dataNewList.bloodTotalCount = dataNewList.children.reduce((pre, current) => pre + current.count, 0);
  169. // 计算第一层患者数量
  170. dataNewList.patientTotalCount = Object.keys(dataList).length;
  171. console.log(dataNewList)
  172. // 赋值
  173. this.dataList = dataNewList;
  174. }else{
  175. uni.showToast({
  176. icon: "none",
  177. title: res.msg || "接口获取数据失败!",
  178. });
  179. }
  180. })
  181. },
  182. },
  183. onLoad(options) {
  184. console.log(options, "result");
  185. this.queryObj = options;
  186. this.getInfo();
  187. this.getBloodPageConfig();
  188. // #ifdef APP-PLUS
  189. webHandle("no", "app");
  190. // #endif
  191. // #ifdef H5
  192. webHandle("no", "wx");
  193. // #endif
  194. },
  195. };
  196. </script>
  197. <style lang="less" scoped>
  198. .Scanning_Result {
  199. padding: 16rpx;
  200. display: flex;
  201. flex-direction: column;
  202. height: 100vh;
  203. background-color: #f5f7fb;
  204. .ml16{
  205. margin-left: 16rpx;
  206. }
  207. .blue{
  208. color: #49b856!important;
  209. }
  210. .ellipsis{
  211. white-space: nowrap;
  212. overflow: hidden;
  213. text-overflow: ellipsis;
  214. }
  215. .Scanning_top {
  216. margin-top: 16rpx;
  217. background-color: #fff;
  218. color: #49b856;
  219. font-weight: bold;
  220. font-size: 30rpx;
  221. display: flex;
  222. align-items: center;
  223. line-height: 1.1;
  224. view{
  225. padding: 16rpx 20rpx;
  226. flex: 1;
  227. &.title1{
  228. flex: 4;
  229. word-break: break-all;
  230. }
  231. }
  232. }
  233. .Scanning_cont {
  234. flex: 1;
  235. display: flex;
  236. flex-direction: column;
  237. overflow-y: auto;
  238. .list{
  239. background-color: #fff;
  240. margin-top: 16rpx;
  241. line-height: 1;
  242. .list_top{
  243. display: flex;
  244. font-weight: bold;
  245. color: #000;
  246. font-size: 30rpx;
  247. position: relative;
  248. padding-bottom: 16rpx;
  249. .newicon-a-ziyuan7{
  250. position: absolute;
  251. left: 12rpx;
  252. top: 14rpx;
  253. font-size: 32rpx;
  254. color: #49b856;
  255. }
  256. view{
  257. padding: 16rpx 20rpx 0 0;
  258. flex: 1;
  259. &.title1{
  260. padding: 16rpx 20rpx 0 54rpx;
  261. flex: 5;
  262. text:first-of-type{
  263. margin-right: 16rpx;
  264. }
  265. }
  266. }
  267. }
  268. .list_bottom{
  269. display: flex;
  270. font-size: 25rpx;
  271. color: #767676;
  272. view{
  273. padding: 0 20rpx 16rpx 5rpx;
  274. flex: 1;
  275. &.title1{
  276. padding: 0 20rpx 16rpx 54rpx;
  277. flex: 5;
  278. display: flex;
  279. }
  280. &.title2{
  281. display: flex;
  282. align-items: center;
  283. }
  284. .newicon-a-ziyuan3{
  285. color: #cdcdcd;
  286. font-size: 12rpx;
  287. margin-left: 20rpx;
  288. transform: rotate(180deg);
  289. transition: all 0.5s;
  290. &.active{
  291. transform: rotate(0deg);
  292. }
  293. }
  294. }
  295. }
  296. .list_detail{
  297. border: 2rpx solid #C6C6C6;
  298. padding: 22rpx 30rpx 0;
  299. font-size: 26rpx;
  300. .list_detail_item{
  301. margin-bottom: 22rpx;
  302. padding: 10rpx 0;
  303. background-color: #F3FAF7;
  304. .list_detail_item_title{
  305. padding: 0 17rpx 6rpx;
  306. border-bottom: 2rpx solid #C3C3C3;
  307. display: flex;
  308. align-items: center;
  309. justify-content: space-between;
  310. .serialNumber{
  311. font-size: 38rpx;
  312. }
  313. }
  314. .list_detail_item_content{
  315. padding: 0 17rpx;
  316. view{
  317. line-height: 35rpx;
  318. margin-top: 17rpx;
  319. &:first-of-type{
  320. margin-top: 9rpx;
  321. }
  322. }
  323. .zhi{
  324. margin-left: 60rpx;
  325. margin-right: 60rpx;
  326. }
  327. .list_detail_item_content_status{
  328. display: flex;
  329. justify-content: flex-end;
  330. text{
  331. font-weight: bold;
  332. }
  333. }
  334. }
  335. }
  336. }
  337. }
  338. }
  339. .foot_btn_spe {
  340. line-height: 64rpx;
  341. height: 64rpx;
  342. margin-bottom: 40rpx;
  343. text-align: center;
  344. display: flex;
  345. justify-content: space-between;
  346. view {
  347. height: 64rpx;
  348. flex: 1;
  349. margin: 0 1%;
  350. background-image: linear-gradient(to right, #72c172, #3bb197);
  351. color: #fff;
  352. border-radius: 8rpx;
  353. font-size: 26rpx;
  354. }
  355. }
  356. }
  357. </style>