detail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. <view class="Scanning_top_icon">{{drugsBag.packid}}</view>
  5. </view>
  6. <view class="Scanning_top_tips">
  7. <view class="info">申请:{{drugsBag.target ? drugsBag.target.dept : ''}}</view>
  8. <view class="info">发药:{{drugsBag.launch ? drugsBag.launch.dept : ''}}</view>
  9. </view>
  10. <view class="Scanning_cont">
  11. <view class="column head">
  12. <view class="value2" v-if="queryObj.showPatientInfo==1">患者信息</view>
  13. <view class="value1">药品名称+规格<text class="red">({{drugsList.length}})</text></view>
  14. <view class="value2">数量</view>
  15. </view>
  16. <scroll-view scroll-y class="scrollContent">
  17. <view class="column" v-for="item in drugsList" :key="item.id">
  18. <view class="value2" v-if="queryObj.showPatientInfo==1">
  19. <view>
  20. {{item.patientName }}<text v-if="item.bedNum">({{item.bedNum}})</text>
  21. <view>{{item.residenceNo ? item.residenceNo : ''}}</view>
  22. </view>
  23. </view>
  24. <view class="value1">{{item.drugsInfo}} {{item.model}}</view>
  25. <view class="value2">{{item.drugsNum}}</view>
  26. </view>
  27. </scroll-view>
  28. </view>
  29. <view class="foot_btn_spe">
  30. <view class="column">
  31. <view class="btn" @click="goBack()">返回</view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. get,
  39. post,
  40. SM,
  41. webHandle
  42. } from "@/http/http.js";
  43. export default {
  44. data() {
  45. return {
  46. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  47. drugsList: [], //药品列表
  48. queryObj: {}, //路由传递过来的数据
  49. drugsBag: {}, //药包信息
  50. config: {}, //配置
  51. };
  52. },
  53. methods: {
  54. // 返回
  55. goBack(){
  56. uni.navigateBack()
  57. },
  58. // 根据药包id查询药品
  59. getDrugsByDrugsBugId(drugsBagId){
  60. post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'drugsInfo', drugsBagId}).then(res => {
  61. uni.hideLoading();
  62. if(res.state == 200){
  63. if(res.data){
  64. this.drugsList = res.data.drugsList || [];
  65. this.drugsBag = res.data.drugsBag || {};
  66. }
  67. }else{
  68. uni.showToast({
  69. icon: "none",
  70. title: res.msg || "接口获取数据失败!",
  71. });
  72. }
  73. })
  74. },
  75. //获取页面信息
  76. getInfo(){
  77. uni.showLoading({
  78. title: "加载中",
  79. mask: true,
  80. });
  81. if(this.queryObj.drugsBagId){
  82. // 根据药包id查询药品
  83. this.getDrugsByDrugsBugId(this.queryObj.drugsBagId);
  84. }else if(this.queryObj.orderId){
  85. // 根据工单id查询药包,此时必是一单一码,即只有一个药包码
  86. post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'orderInfo', orderId: +this.queryObj.orderId}).then(res => {
  87. if(res.state == 200){
  88. if(res.data){
  89. let drugsBagList = res.data.drugsBagList || [];
  90. let drugsBag = drugsBagList[0] || {};
  91. if(drugsBag.id){
  92. this.getDrugsByDrugsBugId(drugsBag.id);
  93. }else{
  94. uni.hideLoading();
  95. uni.showToast({
  96. icon: "none",
  97. title: "未查询到药品!",
  98. });
  99. }
  100. }else{
  101. uni.hideLoading();
  102. }
  103. }else{
  104. uni.hideLoading();
  105. uni.showToast({
  106. icon: "none",
  107. title: res.msg || "接口获取数据失败!",
  108. });
  109. }
  110. })
  111. }
  112. },
  113. },
  114. onLoad(options) {
  115. console.log(options, "options");
  116. this.queryObj = options;
  117. this.getInfo();
  118. // #ifdef APP-PLUS
  119. webHandle("no", "app");
  120. // #endif
  121. // #ifdef H5
  122. webHandle("no", "wx");
  123. // #endif
  124. },
  125. };
  126. </script>
  127. <style lang="less" scoped>
  128. .Scanning_Result {
  129. background: #FAFBFD;
  130. padding: 0 24rpx;
  131. display: flex;
  132. flex-direction: column;
  133. height: 100vh;
  134. .Scanning_top {
  135. margin: 32rpx auto;
  136. .Scanning_top_icon {
  137. font-size: 30rpx;
  138. font-weight: bold;
  139. .newicon{
  140. margin: 0 32rpx;
  141. }
  142. }
  143. }
  144. .Scanning_top_tips{
  145. display: flex;
  146. align-items: center;
  147. justify-content: center;
  148. font-size: 28rpx;
  149. margin-bottom: 32rpx;
  150. gap: 64rpx;
  151. }
  152. .Scanning_cont {
  153. flex: 1;
  154. min-height: 0;
  155. display: flex;
  156. flex-direction: column;
  157. .scrollContent{
  158. flex: 1;
  159. min-height: 0;
  160. }
  161. .column{
  162. display: flex;
  163. justify-content: center;
  164. align-items: center;
  165. font-size: 28rpx;
  166. padding: 32rpx 24rpx;
  167. color: #565656;
  168. border-bottom: 1rpx solid #D9D9D9;
  169. gap: 8rpx;
  170. &.head{
  171. font-size: 30rpx;
  172. color: #000000;
  173. border: 1rpx solid #D9D9D9;
  174. box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(0,0,0,0.16);
  175. background: #FBFCFE;
  176. }
  177. .value1{
  178. flex: 2;
  179. text-align: left;
  180. word-break: break-all;
  181. flex-shrink: 0;
  182. text-align: center;
  183. }
  184. .value2,.value3{
  185. flex: 1;
  186. text-align: center;
  187. word-break: break-all;
  188. flex-shrink: 0;
  189. }
  190. }
  191. }
  192. .foot_btn_spe {
  193. margin: 24rpx 0;
  194. display: flex;
  195. flex-direction: column;
  196. align-items: center;
  197. gap: 24rpx;
  198. font-weight: bold;
  199. .column{
  200. width: 100%;
  201. height: 78rpx;
  202. display: flex;
  203. align-items: center;
  204. justify-content: space-between;
  205. gap: 24rpx;
  206. .btn {
  207. height: 100%;
  208. flex: 1;
  209. background: linear-gradient( 90deg, #6FC073 0%, #3DB197 100%);
  210. color: #fff;
  211. border-radius: 4rpx;
  212. font-size: 30rpx;
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. }
  217. }
  218. }
  219. }
  220. </style>