pharmacyDetails.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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. if (type == 1) {
  82. post("/drugsBag/changeToIng", {
  83. id: this.infoDATA.id,
  84. }).then((result) => {
  85. this.isLoading = false;
  86. if (result.status == 200) {
  87. uni.showToast({
  88. title: "开始配药成功!",
  89. success() {
  90. uni.navigateTo({
  91. url: "../pharmacy/pharmacy",
  92. });
  93. },
  94. });
  95. // let data = {
  96. // launchId: this.infoDATA.launch.id,
  97. // drugsBagId: this.infoDATA.id,
  98. // };
  99. // post("/drugsBag/autoDrugsBags", data).then((result1) => {
  100. // this.isLoading = false;
  101. // if (result1.status == 200) {
  102. // uni.showToast({
  103. // title: "操作成功!",
  104. // success() {
  105. // uni.navigateTo({
  106. // url: "../pharmacy/pharmacy",
  107. // });
  108. // },
  109. // });
  110. // }else if(result1.status == 501){
  111. // uni.showToast({
  112. // icon: "none",
  113. // title: result1.error,
  114. // });
  115. // }else {
  116. // uni.showToast({
  117. // icon: "none",
  118. // title: "请求失败!",
  119. // });
  120. // }
  121. // });
  122. } else if(result.status == 503){//未建单
  123. uni.showToast({
  124. icon: "none",
  125. title: result.error,
  126. });
  127. } else {
  128. // this.isLoading = false;
  129. uni.showToast({
  130. icon: "none",
  131. title: "请求失败!",
  132. });
  133. }
  134. });
  135. } else if (type == 2) {
  136. post("/drugsBag/changeToCheck", {
  137. id: this.infoDATA.id,
  138. }).then((result) => {
  139. this.isLoading = false;
  140. if (result.status == 200) {
  141. uni.showToast({
  142. title: "完成配药成功!",
  143. success() {
  144. uni.navigateTo({
  145. url: "../pharmacy/pharmacy",
  146. });
  147. },
  148. });
  149. } else {
  150. uni.showToast({
  151. icon: "none",
  152. title: "请求失败!",
  153. });
  154. }
  155. });
  156. }
  157. },
  158. },
  159. onLoad(options) {
  160. // #ifdef APP-PLUS
  161. webHandle("no", "app");
  162. // #endif
  163. // #ifdef H5
  164. webHandle("no", "wx");
  165. // #endif
  166. //扫码进入详情
  167. let qrcode = options.qrcode;
  168. if (qrcode) {
  169. uni.showLoading({
  170. title: "加载中",
  171. mask: true,
  172. });
  173. post("/drugsBag/getDrugsBagByQr", {
  174. qrcode,
  175. }).then((result) => {
  176. uni.hideLoading();
  177. if (result.state == 200) {
  178. this.infoDATA = result.result;
  179. } else {
  180. uni.showToast({
  181. icon: "none",
  182. title: "请求失败!",
  183. });
  184. }
  185. });
  186. }
  187. // 点击列表进入详情
  188. let id = options.id;
  189. if (id) {
  190. uni.showLoading({
  191. title: "加载中",
  192. mask: true,
  193. });
  194. get("/api/fetchData/drugsBag/" + id).then((res) => {
  195. uni.hideLoading();
  196. if (res.status == 200) {
  197. this.infoDATA = res.data;
  198. } else {
  199. uni.showToast({
  200. icon: "none",
  201. title: "请求失败!",
  202. });
  203. }
  204. });
  205. }
  206. },
  207. };
  208. </script>
  209. <style lang="less">
  210. .pharmacyDetails {
  211. background-color: rgb(249, 250, 251);
  212. padding-top: 10%;
  213. .pharmacyDetails_title {
  214. font-size: 46rpx;
  215. font-weight: 550;
  216. text-align: center;
  217. }
  218. .page_item_wrap {
  219. position: relative;
  220. margin-top: 32rpx;
  221. .page_item {
  222. margin-top: 16rpx;
  223. margin-bottom: 124rpx;
  224. background: #fff;
  225. border-radius: 8rpx;
  226. margin: 0 20rpx;
  227. border: 2rpx solid #e5e9ed;
  228. position: relative;
  229. overflow: hidden;
  230. padding: 0 16rpx;
  231. .L {
  232. width: 40rpx;
  233. height: 40rpx;
  234. border-radius: 50%;
  235. background: #f9fafb;
  236. position: absolute;
  237. left: -20rpx;
  238. top: 68rpx;
  239. border: 2rpx solid #e5e9ed;
  240. }
  241. .R {
  242. width: 40rpx;
  243. height: 40rpx;
  244. border-radius: 50%;
  245. background: #f9fafb;
  246. position: absolute;
  247. float: right;
  248. right: -20rpx;
  249. top: 68rpx;
  250. border: 2rpx solid #e5e9ed;
  251. }
  252. .page_item_top {
  253. height: 88rpx;
  254. border-bottom: 2rpx dashed #e5e9ed;
  255. padding: 0 16rpx;
  256. .page_item_top-inner {
  257. display: flex;
  258. justify-content: space-between;
  259. align-items: center;
  260. height: 100%;
  261. .page_item_top_L {
  262. .L_text {
  263. font-size: 32rpx;
  264. font-weight: 700;
  265. }
  266. }
  267. .page_item_top_R {
  268. font-size: 32rpx;
  269. .L_iocn {
  270. color: rgb(7, 134, 60);
  271. font-size: 36rpx;
  272. font-weight: 700;
  273. }
  274. }
  275. }
  276. }
  277. .page_item_cont {
  278. min-height: 180rpx;
  279. max-height: 424rpx;
  280. padding: 0 16rpx;
  281. text-align: left;
  282. position: relative;
  283. .text_big {
  284. font-size: 32rpx;
  285. font-weight: 700;
  286. text {
  287. font-weight: 700;
  288. line-height: 1.5;
  289. }
  290. }
  291. .line {
  292. height: 20rpx;
  293. width: 2rpx;
  294. border-left: 2rpx solid #e5e9ed;
  295. position: absolute;
  296. top: 82rpx;
  297. left: 40rpx;
  298. }
  299. .page_item_cont_T {
  300. padding-top: 28rpx;
  301. font-size: 28rpx;
  302. .page_item_cont_title {
  303. height: 100%;
  304. font-size: 32rpx;
  305. display: flex;
  306. justify-content: space-between;
  307. }
  308. }
  309. .page_item_cont_B {
  310. padding-top: 28rpx;
  311. margin-bottom: 28rpx;
  312. .page_item_cont_title {
  313. font-size: 32rpx;
  314. display: flex;
  315. justify-content: space-between;
  316. align-items: center;
  317. }
  318. }
  319. .page_item_cont_C {
  320. margin-bottom: 28rpx;
  321. .page_item_cont_title_C {
  322. font-size: 32rpx;
  323. display: flex;
  324. justify-content: space-between;
  325. align-items: center;
  326. }
  327. }
  328. #infos {
  329. display: none;
  330. }
  331. }
  332. }
  333. .L-l {
  334. width: 2rpx;
  335. height: 40rpx;
  336. background: #f9fafb;
  337. position: absolute;
  338. left: 20rpx;
  339. top: 72rpx;
  340. }
  341. .R-l {
  342. width: 2rpx;
  343. height: 40rpx;
  344. background: #f9fafb;
  345. position: absolute;
  346. right: 20rpx;
  347. top: 72rpx;
  348. }
  349. }
  350. .cube-toolbar-item {
  351. width: 710rpx;
  352. height: 68rpx;
  353. line-height: 68rpx;
  354. position: fixed;
  355. left: 20rpx;
  356. bottom: 32rpx;
  357. border-radius: 8rpx;
  358. background: linear-gradient(to right, #72c172, #3bb197);
  359. font-size: 36rpx;
  360. color: #fff;
  361. text-align: center;
  362. }
  363. }
  364. </style>