pharmacyDetails.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <template>
  2. <view class="pharmacyDetails">
  3. <view class="pharmacyDetails_title">请领信息</view>
  4. <view class="page_item_wrap">
  5. <view class="page_item">
  6. <view class="page_item_top">
  7. <view class="page_item_top-inner">
  8. <view class="page_item_top_L">
  9. <text class="L_text">请领单:{{ infoDATA.packid }}</text>
  10. </view>
  11. <view class="page_item_top_R">
  12. <text class="L_iocn">{{
  13. infoDATA.drugsState && infoDATA.drugsState.name
  14. }}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="page_item_cont">
  19. <!-- <view class="page_item_cont_T">
  20. <view class="page_item_cont_title">
  21. <text>批次号</text>
  22. <text class="text_big">{{ infoDATA.batchNo }}</text>
  23. </view>
  24. </view> -->
  25. <view class="page_item_cont_B">
  26. <view class="page_item_cont_title">
  27. <text>记账时间</text>
  28. <text class="text_big">
  29. <text>{{ infoDATA.creatTime }}</text>
  30. </text>
  31. </view>
  32. </view>
  33. <view class="page_item_cont_C">
  34. <view class="page_item_cont_title_C">
  35. <text>请领科室</text>
  36. <text class="text_big">
  37. <text>{{ infoDATA.target && infoDATA.target.dept }}</text>
  38. </text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="L"></view>
  43. <view class="R"></view>
  44. </view>
  45. <view class="L-l"></view>
  46. <view class="R-l"></view>
  47. </view>
  48. <button
  49. class="cube-toolbar-item"
  50. :loading="isLoading"
  51. :disabled="isLoading"
  52. @click="dispensing(1)"
  53. v-if="infoDATA.drugsState && infoDATA.drugsState.name == '待配药'"
  54. >
  55. 开始配药
  56. </button>
  57. <button
  58. class="cube-toolbar-item"
  59. :loading="isLoading"
  60. :disabled="isLoading"
  61. @click="dispensing(2)"
  62. v-if="infoDATA.drugsState && infoDATA.drugsState.name == '配药中'"
  63. >
  64. 完成配药
  65. </button>
  66. </view>
  67. </template>
  68. <script>
  69. import { get, post, SM, webHandle } from "../../http/http.js";
  70. export default {
  71. data() {
  72. return {
  73. infoDATA: [],
  74. isLoading: false,
  75. };
  76. },
  77. methods: {
  78. // 开始配药,完成配药,,,1是待配药,2是配药中
  79. dispensing(type) {
  80. this.isLoading = true;
  81. uni.showLoading({
  82. title: "加载中",
  83. mask: true,
  84. });
  85. if (type == 1) {
  86. post("/drugsBag/changeToIng", {
  87. id: this.infoDATA.id,
  88. }).then((result) => {
  89. this.isLoading = false;
  90. uni.hideLoading();
  91. if (result.state == 200) {
  92. uni.showToast({
  93. title: result.info || "开始配药成功!",
  94. duration: 5000,
  95. success() {
  96. uni.navigateTo({
  97. url: "../pharmacy/pharmacy",
  98. });
  99. },
  100. });
  101. // let data = {
  102. // launchId: this.infoDATA.launch.id,
  103. // drugsBagId: this.infoDATA.id,
  104. // };
  105. // post("/drugsBag/autoDrugsBags", data).then((result1) => {
  106. // this.isLoading = false;
  107. // if (result1.status == 200) {
  108. // uni.showToast({
  109. // title: "操作成功!",
  110. // success() {
  111. // uni.navigateTo({
  112. // url: "../pharmacy/pharmacy",
  113. // });
  114. // },
  115. // });
  116. // }else if(result1.status == 501){
  117. // uni.showToast({
  118. // icon: "none",
  119. // title: result1.error,
  120. // });
  121. // }else {
  122. // uni.showToast({
  123. // icon: "none",
  124. // title: "请求失败!",
  125. // });
  126. // }
  127. // });
  128. // } else if(result.state == 503){//未建单
  129. // uni.showToast({
  130. // icon: "none",
  131. // title: result.error,
  132. // });
  133. } else {
  134. // this.isLoading = false;
  135. uni.showToast({
  136. icon: "none",
  137. title: "请求失败!",
  138. });
  139. }
  140. });
  141. } else if (type == 2) {
  142. post("/drugsBag/changeToCheck", {
  143. id: this.infoDATA.id,
  144. }).then((result) => {
  145. this.isLoading = false;
  146. uni.hideLoading();
  147. if (result.state == 200) {
  148. uni.showToast({
  149. title: result.info || "完成配药成功!",
  150. duration: 5000,
  151. success() {
  152. uni.navigateTo({
  153. url: "../pharmacy/pharmacy",
  154. });
  155. },
  156. });
  157. } else {
  158. uni.showToast({
  159. icon: "none",
  160. title: "请求失败!",
  161. });
  162. }
  163. });
  164. }
  165. },
  166. },
  167. onLoad(options) {
  168. // #ifdef APP-PLUS
  169. webHandle("no", "app");
  170. // #endif
  171. // #ifdef H5
  172. webHandle("no", "wx");
  173. // #endif
  174. //扫码进入详情
  175. let qrcode = options.qrcode;
  176. if (qrcode) {
  177. uni.showLoading({
  178. title: "加载中",
  179. mask: true,
  180. });
  181. post("/drugsBag/getDrugsBagByQr", {
  182. qrcode,
  183. }).then((result) => {
  184. uni.hideLoading();
  185. if (result.state == 200) {
  186. this.infoDATA = result.result;
  187. } else {
  188. uni.showToast({
  189. icon: "none",
  190. title: "请求失败!",
  191. });
  192. }
  193. });
  194. }
  195. // 点击列表进入详情
  196. let id = options.id;
  197. if (id) {
  198. uni.showLoading({
  199. title: "加载中",
  200. mask: true,
  201. });
  202. get("/api/fetchData/drugsBag/" + id).then((res) => {
  203. uni.hideLoading();
  204. if (res.status == 200) {
  205. this.infoDATA = res.data;
  206. } else {
  207. uni.showToast({
  208. icon: "none",
  209. title: "请求失败!",
  210. });
  211. }
  212. });
  213. }
  214. },
  215. };
  216. </script>
  217. <style lang="less">
  218. .pharmacyDetails {
  219. background-color: rgb(249, 250, 251);
  220. padding-top: 10%;
  221. .pharmacyDetails_title {
  222. font-size: 46rpx;
  223. font-weight: 550;
  224. text-align: center;
  225. }
  226. .page_item_wrap {
  227. position: relative;
  228. margin-top: 32rpx;
  229. .page_item {
  230. margin-top: 16rpx;
  231. margin-bottom: 124rpx;
  232. background: #fff;
  233. border-radius: 8rpx;
  234. margin: 0 20rpx;
  235. border: 2rpx solid #e5e9ed;
  236. position: relative;
  237. overflow: hidden;
  238. padding: 0 16rpx;
  239. .L {
  240. width: 40rpx;
  241. height: 40rpx;
  242. border-radius: 50%;
  243. background: #f9fafb;
  244. position: absolute;
  245. left: -20rpx;
  246. top: 68rpx;
  247. border: 2rpx solid #e5e9ed;
  248. }
  249. .R {
  250. width: 40rpx;
  251. height: 40rpx;
  252. border-radius: 50%;
  253. background: #f9fafb;
  254. position: absolute;
  255. float: right;
  256. right: -20rpx;
  257. top: 68rpx;
  258. border: 2rpx solid #e5e9ed;
  259. }
  260. .page_item_top {
  261. height: 88rpx;
  262. border-bottom: 2rpx dashed #e5e9ed;
  263. padding: 0 16rpx;
  264. .page_item_top-inner {
  265. display: flex;
  266. justify-content: space-between;
  267. align-items: center;
  268. height: 100%;
  269. .page_item_top_L {
  270. .L_text {
  271. font-size: 32rpx;
  272. font-weight: 700;
  273. }
  274. }
  275. .page_item_top_R {
  276. font-size: 32rpx;
  277. .L_iocn {
  278. color: rgb(7, 134, 60);
  279. font-size: 36rpx;
  280. font-weight: 700;
  281. }
  282. }
  283. }
  284. }
  285. .page_item_cont {
  286. min-height: 180rpx;
  287. max-height: 424rpx;
  288. padding: 0 16rpx;
  289. text-align: left;
  290. position: relative;
  291. .text_big {
  292. font-size: 32rpx;
  293. font-weight: 700;
  294. text {
  295. font-weight: 700;
  296. line-height: 1.5;
  297. }
  298. }
  299. .line {
  300. height: 20rpx;
  301. width: 2rpx;
  302. border-left: 2rpx solid #e5e9ed;
  303. position: absolute;
  304. top: 82rpx;
  305. left: 40rpx;
  306. }
  307. .page_item_cont_T {
  308. padding-top: 28rpx;
  309. font-size: 28rpx;
  310. .page_item_cont_title {
  311. height: 100%;
  312. font-size: 32rpx;
  313. display: flex;
  314. justify-content: space-between;
  315. }
  316. }
  317. .page_item_cont_B {
  318. padding-top: 28rpx;
  319. margin-bottom: 28rpx;
  320. .page_item_cont_title {
  321. font-size: 32rpx;
  322. display: flex;
  323. justify-content: space-between;
  324. align-items: center;
  325. }
  326. }
  327. .page_item_cont_C {
  328. margin-bottom: 28rpx;
  329. .page_item_cont_title_C {
  330. font-size: 32rpx;
  331. display: flex;
  332. justify-content: space-between;
  333. align-items: center;
  334. }
  335. }
  336. #infos {
  337. display: none;
  338. }
  339. }
  340. }
  341. .L-l {
  342. width: 2rpx;
  343. height: 40rpx;
  344. background: #f9fafb;
  345. position: absolute;
  346. left: 20rpx;
  347. top: 72rpx;
  348. }
  349. .R-l {
  350. width: 2rpx;
  351. height: 40rpx;
  352. background: #f9fafb;
  353. position: absolute;
  354. right: 20rpx;
  355. top: 72rpx;
  356. }
  357. }
  358. .cube-toolbar-item {
  359. width: 710rpx;
  360. height: 68rpx;
  361. line-height: 68rpx;
  362. position: fixed;
  363. left: 20rpx;
  364. bottom: 160rpx;
  365. border-radius: 8rpx;
  366. background: linear-gradient(to right, #72c172, #3bb197);
  367. font-size: 36rpx;
  368. color: #fff;
  369. text-align: center;
  370. }
  371. }
  372. </style>