detail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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" @click="viewName(item)">{{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. <!-- 查看患者 -->
  35. <view class="showModel" v-if="infoModel">
  36. <view class="showModel__wrap">
  37. <view class="showModel__header">
  38. 患者信息
  39. </view>
  40. <view class="content">
  41. <view>{{itemData.patientNames}}</view>
  42. </view>
  43. <view class="bottom">
  44. <button class="bottom-btn confirm-btn" @click="infoModel = false">知道了</button>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. get,
  53. post,
  54. SM,
  55. webHandle
  56. } from "@/http/http.js";
  57. export default {
  58. data() {
  59. return {
  60. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  61. drugsList: [], //药品列表
  62. queryObj: {}, //路由传递过来的数据
  63. drugsBag: {}, //药包信息
  64. config: {}, //配置
  65. infoModel:false,
  66. itemData:{}
  67. };
  68. },
  69. methods: {
  70. // 查看患者
  71. viewName(item){
  72. console.log(222,this.queryObj)
  73. if(this.queryObj.showPatientInfo==1){
  74. this.itemData = item
  75. this.infoModel = true
  76. }
  77. },
  78. // 返回
  79. goBack(){
  80. uni.navigateBack()
  81. },
  82. // 根据药包id查询药品
  83. getDrugsByDrugsBugId(drugsBagId){
  84. post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'drugsInfo', drugsBagId}).then(res => {
  85. uni.hideLoading();
  86. if(res.state == 200){
  87. if(res.data){
  88. this.drugsList = res.data.drugsList || [];
  89. this.drugsBag = res.data.drugsBag || {};
  90. }
  91. }else{
  92. uni.showToast({
  93. icon: "none",
  94. title: res.msg || "接口获取数据失败!",
  95. });
  96. }
  97. })
  98. },
  99. //获取页面信息
  100. getInfo(){
  101. uni.showLoading({
  102. title: "加载中",
  103. mask: true,
  104. });
  105. if(this.queryObj.drugsBagId){
  106. // 根据药包id查询药品
  107. this.getDrugsByDrugsBugId(this.queryObj.drugsBagId);
  108. }else if(this.queryObj.orderId){
  109. // 根据工单id查询药包,此时必是一单一码,即只有一个药包码
  110. post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'orderInfo', orderId: +this.queryObj.orderId}).then(res => {
  111. if(res.state == 200){
  112. if(res.data){
  113. let drugsBagList = res.data.drugsBagList || [];
  114. let drugsBag = drugsBagList[0] || {};
  115. if(drugsBag.id){
  116. this.getDrugsByDrugsBugId(drugsBag.id);
  117. }else{
  118. uni.hideLoading();
  119. uni.showToast({
  120. icon: "none",
  121. title: "未查询到药品!",
  122. });
  123. }
  124. }else{
  125. uni.hideLoading();
  126. }
  127. }else{
  128. uni.hideLoading();
  129. uni.showToast({
  130. icon: "none",
  131. title: res.msg || "接口获取数据失败!",
  132. });
  133. }
  134. })
  135. }
  136. },
  137. },
  138. onLoad(options) {
  139. console.log(options, "options");
  140. this.queryObj = options;
  141. this.getInfo();
  142. // #ifdef APP-PLUS
  143. webHandle("no", "app");
  144. // #endif
  145. // #ifdef H5
  146. webHandle("no", "wx");
  147. // #endif
  148. },
  149. };
  150. </script>
  151. <style lang="less" scoped>
  152. .Scanning_Result {
  153. background: #FAFBFD;
  154. padding: 0 24rpx;
  155. display: flex;
  156. flex-direction: column;
  157. height: 100vh;
  158. .Scanning_top {
  159. margin: 32rpx auto;
  160. .Scanning_top_icon {
  161. font-size: 30rpx;
  162. font-weight: bold;
  163. .newicon{
  164. margin: 0 32rpx;
  165. }
  166. }
  167. }
  168. .Scanning_top_tips{
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. font-size: 28rpx;
  173. margin-bottom: 32rpx;
  174. gap: 64rpx;
  175. }
  176. .Scanning_cont {
  177. flex: 1;
  178. min-height: 0;
  179. display: flex;
  180. flex-direction: column;
  181. .scrollContent{
  182. flex: 1;
  183. min-height: 0;
  184. }
  185. .column{
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. font-size: 28rpx;
  190. padding: 32rpx 24rpx;
  191. color: #565656;
  192. border-bottom: 1rpx solid #D9D9D9;
  193. gap: 8rpx;
  194. &.head{
  195. font-size: 30rpx;
  196. color: #000000;
  197. border: 1rpx solid #D9D9D9;
  198. box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(0,0,0,0.16);
  199. background: #FBFCFE;
  200. }
  201. .value1{
  202. flex: 2;
  203. text-align: left;
  204. word-break: break-all;
  205. flex-shrink: 0;
  206. text-align: center;
  207. }
  208. .value2,.value3{
  209. flex: 1;
  210. text-align: center;
  211. word-break: break-all;
  212. flex-shrink: 0;
  213. }
  214. }
  215. }
  216. .foot_btn_spe {
  217. margin: 24rpx 0;
  218. display: flex;
  219. flex-direction: column;
  220. align-items: center;
  221. gap: 24rpx;
  222. font-weight: bold;
  223. .column{
  224. width: 100%;
  225. height: 78rpx;
  226. display: flex;
  227. align-items: center;
  228. justify-content: space-between;
  229. gap: 24rpx;
  230. .btn {
  231. height: 100%;
  232. flex: 1;
  233. background: linear-gradient( 90deg, #6FC073 0%, #3DB197 100%);
  234. color: #fff;
  235. border-radius: 4rpx;
  236. font-size: 30rpx;
  237. display: flex;
  238. justify-content: center;
  239. align-items: center;
  240. }
  241. }
  242. }
  243. }
  244. .showModel {
  245. position: fixed;
  246. left: 0;
  247. right: 0;
  248. top: 0;
  249. bottom: 0;
  250. background-color: rgba(0, 0, 0, 0.2);
  251. z-index: 99;
  252. .showModel__wrap {
  253. width: 90%;
  254. position: absolute;
  255. left: 50%;
  256. top: 50%;
  257. transform: translate(-50%, -50%);
  258. background-color: #fff;
  259. border-radius: 12rpx;
  260. .showModel__header {
  261. font-size: 36rpx;
  262. color: #000;
  263. font-weight: bold;
  264. height: 84rpx;
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. }
  269. .content{
  270. background: #fff;
  271. text-align: center;
  272. padding: 20rpx 0;
  273. }
  274. .bottom{
  275. border-top: 1px solid #ccc;
  276. display: flex;
  277. uni-button{
  278. background: #fff !important;
  279. }
  280. uni-button:after{
  281. border: none !important;
  282. }
  283. .bottom-btn{
  284. color: #A8A8A8;
  285. font-size: 30rpx;
  286. padding: 10rpx 0;
  287. width: 100%;
  288. display: flex;
  289. align-items: center;
  290. justify-content: center;
  291. }
  292. .confirm-btn{
  293. color: #5DAC6B;
  294. }
  295. }
  296. }
  297. }
  298. </style>