detail.vue 8.4 KB

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