pharmacyDetails.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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 class="cube-toolbar-item" :loading="isLoading" :disabled="isLoading" @click="dispensing(1)"
  49. v-if="infoDATA.drugsState && infoDATA.drugsState.name == '待配药'&&infoDATA.launch.id==loginUser.dept.id">
  50. 开始配药
  51. </button>
  52. <view v-if="infoDATA.drugsState && infoDATA.drugsState.name == '配药中'&&infoDATA.launch.id==loginUser.dept.id" class="btn-wrap">
  53. <button class="cube-toolbar-item1" :loading="isLoading" :disabled="isLoading" @click="dispensing(2)">
  54. 进行核对
  55. </button>
  56. <button class="cube-toolbar-item1" :loading="isTLoading" :disabled="isTLoading" @click="replaceOperator()">
  57. 替换配药人
  58. </button>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. get,
  65. post,
  66. SM,
  67. webHandle
  68. } from "../../http/http.js";
  69. export default {
  70. data() {
  71. return {
  72. infoDATA: [],
  73. isLoading: false,
  74. isTLoading: false,
  75. loginUser: {} //当前登录用户
  76. };
  77. },
  78. methods: {
  79. // 替换配药人
  80. replaceOperator() {
  81. this.isTLoading = true;
  82. uni.showLoading({
  83. title: "加载中",
  84. mask: true,
  85. });
  86. post("/drugsBag/replaceOperator", {
  87. packId: this.infoDATA.packid,
  88. }).then((result) => {
  89. this.isTLoading = false;
  90. uni.hideLoading();
  91. if (result.state == 200) {
  92. uni.showModal({
  93. title: '提示',
  94. content: result.info,
  95. showCancel: false,
  96. success: function(res) {
  97. if (res.confirm) {
  98. console.log('用户点击确定');
  99. } else if (res.cancel) {
  100. console.log('用户点击取消');
  101. }
  102. }
  103. });
  104. } else {
  105. uni.showModal({
  106. title: '提示',
  107. content: "请求失败!",
  108. showCancel: false,
  109. success: function(res) {
  110. if (res.confirm) {
  111. console.log('用户点击确定');
  112. } else if (res.cancel) {
  113. console.log('用户点击取消');
  114. }
  115. }
  116. });
  117. }
  118. })
  119. },
  120. // 开始配药,进行核对,,,1是待配药,2是配药中
  121. dispensing(type) {
  122. this.isLoading = true;
  123. uni.showLoading({
  124. title: "加载中",
  125. mask: true,
  126. });
  127. if (type == 1) {
  128. post("/drugsBag/changeToIng", {
  129. id: this.infoDATA.id,
  130. }).then((result) => {
  131. this.isLoading = false;
  132. uni.hideLoading();
  133. if (result.state == 200) {
  134. uni.showModal({
  135. title: '提示',
  136. content: result.info || "开始配药成功!",
  137. showCancel: false,
  138. success: function(res) {
  139. if (res.confirm) {
  140. uni.navigateTo({
  141. url: "../pharmacy/pharmacy",
  142. });
  143. } else if (res.cancel) {
  144. console.log('用户点击取消');
  145. }
  146. }
  147. });
  148. // let data = {
  149. // launchId: this.infoDATA.launch.id,
  150. // drugsBagId: this.infoDATA.id,
  151. // };
  152. // post("/drugsBag/autoDrugsBags", data).then((result1) => {
  153. // this.isLoading = false;
  154. // if (result1.status == 200) {
  155. // uni.showToast({
  156. // title: "操作成功!",
  157. // success() {
  158. // uni.navigateTo({
  159. // url: "../pharmacy/pharmacy",
  160. // });
  161. // },
  162. // });
  163. // }else if(result1.status == 501){
  164. // uni.showToast({
  165. // icon: "none",
  166. // title: result1.error,
  167. // });
  168. // }else {
  169. // uni.showToast({
  170. // icon: "none",
  171. // title: "请求失败!",
  172. // });
  173. // }
  174. // });
  175. // } else if(result.state == 503){//未建单
  176. // uni.showToast({
  177. // icon: "none",
  178. // title: result.error,
  179. // });
  180. } else {
  181. // this.isLoading = false;
  182. uni.showModal({
  183. title: '提示',
  184. content: "请求失败!",
  185. showCancel: false,
  186. success: function(res) {
  187. if (res.confirm) {
  188. console.log('用户点击确定');
  189. } else if (res.cancel) {
  190. console.log('用户点击取消');
  191. }
  192. }
  193. });
  194. }
  195. });
  196. } else if (type == 2) {
  197. post("/drugsBag/changeToCheck", {
  198. id: this.infoDATA.id,
  199. }).then((result) => {
  200. this.isLoading = false;
  201. uni.hideLoading();
  202. if (result.state == 200) {
  203. uni.showModal({
  204. title: '提示',
  205. content: result.info || "进行核对成功!",
  206. showCancel: false,
  207. success: function(res) {
  208. if (res.confirm) {
  209. uni.navigateTo({
  210. url: "../pharmacy/pharmacy",
  211. });
  212. } else if (res.cancel) {
  213. console.log('用户点击取消');
  214. }
  215. }
  216. });
  217. } else {
  218. uni.showModal({
  219. title: '提示',
  220. content: "请求失败!",
  221. showCancel: false,
  222. success: function(res) {
  223. if (res.confirm) {
  224. console.log('用户点击确定');
  225. } else if (res.cancel) {
  226. console.log('用户点击取消');
  227. }
  228. }
  229. });
  230. }
  231. });
  232. }
  233. },
  234. },
  235. onLoad(options) {
  236. this.loginUser = uni.getStorageSync("userData").user;
  237. console.log(this.loginUser,'loginUserloginUser')
  238. // #ifdef APP-PLUS
  239. webHandle("no", "app");
  240. // #endif
  241. // #ifdef H5
  242. webHandle("no", "wx");
  243. // #endif
  244. //扫码进入详情
  245. let qrcode = options.qrcode;
  246. if (qrcode) {
  247. uni.showLoading({
  248. title: "加载中",
  249. mask: true,
  250. });
  251. post("/drugsBag/getDrugsBagByQr", {
  252. qrcode,
  253. }).then((result) => {
  254. uni.hideLoading();
  255. if (result.state == 200) {
  256. this.infoDATA = result.result;
  257. if(this.loginUser.dept.id != this.infoDATA.launch.id){
  258. uni.showModal({
  259. title: '提示',
  260. content: "您现在所在的科室是【"+this.loginUser.dept.dept+"】,药包所在的科室是【"+this.infoDATA.launch.dept+"】,您不能进行操作",
  261. showCancel: false,
  262. success: function(res) {
  263. if (res.confirm) {
  264. console.log('用户点击确定');
  265. } else if (res.cancel) {
  266. console.log('用户点击取消');
  267. }
  268. }
  269. });
  270. }
  271. } else {
  272. uni.showToast({
  273. icon: "none",
  274. title: "请求失败!",
  275. });
  276. }
  277. });
  278. }
  279. // 点击列表进入详情
  280. let id = options.id;
  281. if (id) {
  282. uni.showLoading({
  283. title: "加载中",
  284. mask: true,
  285. });
  286. get("/api/fetchData/drugsBag/" + id).then((res) => {
  287. uni.hideLoading();
  288. if (res.status == 200) {
  289. this.infoDATA = res.data;
  290. if(this.loginUser.dept.id != this.infoDATA.launch.id){
  291. uni.showModal({
  292. title: '提示',
  293. content: "您现在所在的科室是【"+this.loginUser.dept.dept+"】,药包所在的科室是【"+this.infoDATA.launch.dept+"】,您不能进行操作",
  294. showCancel: false,
  295. success: function(res) {
  296. if (res.confirm) {
  297. console.log('用户点击确定');
  298. } else if (res.cancel) {
  299. console.log('用户点击取消');
  300. }
  301. }
  302. });
  303. }
  304. } else {
  305. uni.showToast({
  306. icon: "none",
  307. title: "请求失败!",
  308. });
  309. }
  310. });
  311. }
  312. },
  313. };
  314. </script>
  315. <style lang="less">
  316. .pharmacyDetails {
  317. background-color: rgb(249, 250, 251);
  318. padding-top: 10%;
  319. .pharmacyDetails_title {
  320. font-size: 46rpx;
  321. font-weight: 550;
  322. text-align: center;
  323. }
  324. .page_item_wrap {
  325. position: relative;
  326. margin-top: 32rpx;
  327. .page_item {
  328. margin-top: 16rpx;
  329. margin-bottom: 124rpx;
  330. background: #fff;
  331. border-radius: 8rpx;
  332. margin: 0 20rpx;
  333. border: 2rpx solid #e5e9ed;
  334. position: relative;
  335. overflow: hidden;
  336. padding: 0 16rpx;
  337. .L {
  338. width: 40rpx;
  339. height: 40rpx;
  340. border-radius: 50%;
  341. background: #f9fafb;
  342. position: absolute;
  343. left: -20rpx;
  344. top: 68rpx;
  345. border: 2rpx solid #e5e9ed;
  346. }
  347. .R {
  348. width: 40rpx;
  349. height: 40rpx;
  350. border-radius: 50%;
  351. background: #f9fafb;
  352. position: absolute;
  353. float: right;
  354. right: -20rpx;
  355. top: 68rpx;
  356. border: 2rpx solid #e5e9ed;
  357. }
  358. .page_item_top {
  359. height: 88rpx;
  360. border-bottom: 2rpx dashed #e5e9ed;
  361. padding: 0 16rpx;
  362. .page_item_top-inner {
  363. display: flex;
  364. justify-content: space-between;
  365. align-items: center;
  366. height: 100%;
  367. .page_item_top_L {
  368. .L_text {
  369. font-size: 32rpx;
  370. font-weight: 700;
  371. }
  372. }
  373. .page_item_top_R {
  374. font-size: 32rpx;
  375. .L_iocn {
  376. color: rgb(7, 134, 60);
  377. font-size: 36rpx;
  378. font-weight: 700;
  379. }
  380. }
  381. }
  382. }
  383. .page_item_cont {
  384. min-height: 180rpx;
  385. max-height: 424rpx;
  386. padding: 0 16rpx;
  387. text-align: left;
  388. position: relative;
  389. .text_big {
  390. font-size: 32rpx;
  391. font-weight: 700;
  392. text {
  393. font-weight: 700;
  394. line-height: 1.5;
  395. }
  396. }
  397. .line {
  398. height: 20rpx;
  399. width: 2rpx;
  400. border-left: 2rpx solid #e5e9ed;
  401. position: absolute;
  402. top: 82rpx;
  403. left: 40rpx;
  404. }
  405. .page_item_cont_T {
  406. padding-top: 28rpx;
  407. font-size: 28rpx;
  408. .page_item_cont_title {
  409. height: 100%;
  410. font-size: 32rpx;
  411. display: flex;
  412. justify-content: space-between;
  413. }
  414. }
  415. .page_item_cont_B {
  416. padding-top: 28rpx;
  417. margin-bottom: 28rpx;
  418. .page_item_cont_title {
  419. font-size: 32rpx;
  420. display: flex;
  421. justify-content: space-between;
  422. align-items: center;
  423. }
  424. }
  425. .page_item_cont_C {
  426. margin-bottom: 28rpx;
  427. .page_item_cont_title_C {
  428. font-size: 32rpx;
  429. display: flex;
  430. justify-content: space-between;
  431. align-items: center;
  432. }
  433. }
  434. #infos {
  435. display: none;
  436. }
  437. }
  438. }
  439. .L-l {
  440. width: 2rpx;
  441. height: 40rpx;
  442. background: #f9fafb;
  443. position: absolute;
  444. left: 20rpx;
  445. top: 72rpx;
  446. }
  447. .R-l {
  448. width: 2rpx;
  449. height: 40rpx;
  450. background: #f9fafb;
  451. position: absolute;
  452. right: 20rpx;
  453. top: 72rpx;
  454. }
  455. }
  456. .cube-toolbar-item {
  457. width: 710rpx;
  458. height: 68rpx;
  459. line-height: 68rpx;
  460. position: fixed;
  461. left: 20rpx;
  462. bottom: 160rpx;
  463. border-radius: 8rpx;
  464. background: linear-gradient(to right, #72c172, #3bb197);
  465. font-size: 36rpx;
  466. color: #fff;
  467. text-align: center;
  468. }
  469. .btn-wrap {
  470. display: flex;
  471. justify-content: space-between;
  472. position: fixed;
  473. left: 20rpx;
  474. bottom: 160rpx;
  475. }
  476. .cube-toolbar-item1 {
  477. width: 350rpx;
  478. height: 68rpx;
  479. line-height: 68rpx;
  480. border-radius: 8rpx;
  481. margin: 0 5rpx;
  482. background: linear-gradient(to right, #72c172, #3bb197);
  483. font-size: 36rpx;
  484. color: #fff;
  485. text-align: center;
  486. }
  487. }
  488. </style>