detail.vue 6.8 KB

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