handViewDrugsBag.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <view class="changeHospital" v-show="disjunctor">
  3. <view class="changeHospital__wrap">
  4. <view class="changeHospital__header" v-if="title">
  5. {{ title }}
  6. </view>
  7. <view class="changeHospital__article">
  8. <view class="uni-list-cell">
  9. <view class="uni-list-cell-left">
  10. {{name}}:
  11. </view>
  12. <view class="uni-list-cell-db">
  13. <input class="uni-input" auto-focus="true" :placeholder="'请填写'+name" v-model="account"
  14. @input="bindPickerChange($event)" />
  15. </view>
  16. </view>
  17. <view class="uni-list-cell">
  18. <view class="uni-list-cell-left">
  19. 发药单号:
  20. </view>
  21. <view class="uni-list-cell-db-text">
  22. <text v-show="!loading">{{drugsBag.packid||'无'}}</text>
  23. <view class="sk-circle" v-show="loading">
  24. <view class="sk-circle-dot"></view>
  25. <view class="sk-circle-dot"></view>
  26. <view class="sk-circle-dot"></view>
  27. <view class="sk-circle-dot"></view>
  28. <view class="sk-circle-dot"></view>
  29. <view class="sk-circle-dot"></view>
  30. <view class="sk-circle-dot"></view>
  31. <view class="sk-circle-dot"></view>
  32. <view class="sk-circle-dot"></view>
  33. <view class="sk-circle-dot"></view>
  34. <view class="sk-circle-dot"></view>
  35. <view class="sk-circle-dot"></view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="uni-list-cell">
  40. <view class="uni-list-cell-left">
  41. 申请科室:
  42. </view>
  43. <view class="uni-list-cell-db-text">
  44. <text v-show="!loading">{{ drugsBag.target ? drugsBag.target.dept : "无" }}</text>
  45. <view class="sk-circle" v-show="loading">
  46. <view class="sk-circle-dot"></view>
  47. <view class="sk-circle-dot"></view>
  48. <view class="sk-circle-dot"></view>
  49. <view class="sk-circle-dot"></view>
  50. <view class="sk-circle-dot"></view>
  51. <view class="sk-circle-dot"></view>
  52. <view class="sk-circle-dot"></view>
  53. <view class="sk-circle-dot"></view>
  54. <view class="sk-circle-dot"></view>
  55. <view class="sk-circle-dot"></view>
  56. <view class="sk-circle-dot"></view>
  57. <view class="sk-circle-dot"></view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="changeHospital__footer">
  63. <view v-if="operate.ok" class="changeHospital__ok" @click="ok" hover-class="seimin-btn-hover">
  64. {{ operate.ok || "" }}
  65. </view>
  66. <view v-if="operate.cancel" class="changeHospital__cancel" @click="cancel" hover-class="seimin-btn-hover">
  67. {{ operate.cancel || "" }}
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import {
  75. post
  76. } from "../../http/http.js";
  77. export default {
  78. data() {
  79. return {
  80. cValue: '', //当前输入的标本编码
  81. loading: false,
  82. userData: null,
  83. hosId: null,
  84. timer: null,
  85. drugsBag: {}, //发药单对象
  86. account: '',
  87. };
  88. },
  89. watch: {
  90. disjunctor(newValue) {
  91. if (newValue && this.operate.know == "知道了") {
  92. this.time = 5;
  93. this.timer = setInterval(() => {
  94. this.time--;
  95. if (this.time <= 0) {
  96. clearInterval(this.timer);
  97. this.know();
  98. }
  99. }, 1000);
  100. }
  101. },
  102. },
  103. props: {
  104. // 显示隐藏
  105. disjunctor: {
  106. type: Boolean,
  107. default: false,
  108. },
  109. // 标题
  110. title: {
  111. type: String,
  112. default: "提示",
  113. },
  114. // 操作按钮文字
  115. operate: {
  116. type: Object,
  117. default: () => {
  118. return {
  119. ok: "确认",
  120. cancel: "取消",
  121. };
  122. },
  123. },
  124. name: {
  125. type: String,
  126. default: '发药单号'
  127. }
  128. },
  129. methods: {
  130. //修改picker的值
  131. bindPickerChange(e) {
  132. this.drugsBag = {};
  133. this.loading = true;
  134. this.cValue = e.target.value;
  135. clearTimeout(this.timer);
  136. if (this.cValue.length <= 4) {
  137. this.drugsBag = {};
  138. this.loading = false;
  139. return;
  140. }
  141. this.timer = setTimeout(() => {
  142. let nAccount = e.target.value;
  143. post("/drugsBag/fetchDataList/drugsBag", {
  144. "idx": 0,
  145. "sum": 1,
  146. "drugsBag": {
  147. "hosId": this.hosId,
  148. "packid": e.target.value,
  149. }
  150. }).then(result => {
  151. if (result.status == 200) {
  152. if (this.cValue === nAccount) {
  153. if (result.list && result.list.length) {
  154. //有值
  155. this.drugsBag = result.list[0];
  156. } else {
  157. // 没值
  158. this.drugsBag = {};
  159. }
  160. this.loading = false;
  161. }
  162. } else {
  163. this.loading = false;
  164. }
  165. })
  166. }, 500)
  167. },
  168. // 确定
  169. ok() {
  170. this.$emit("ok", this.drugsBag);
  171. },
  172. // 取消
  173. cancel() {
  174. this.$emit("cancel");
  175. },
  176. },
  177. created() {
  178. this.hosId = uni.getStorageSync('userData').user.currentHospital.id;
  179. }
  180. };
  181. </script>
  182. <style lang="less" scoped>
  183. .changeHospital {
  184. position: fixed;
  185. left: 0;
  186. right: 0;
  187. top: 0;
  188. bottom: 0;
  189. background-color: rgba(0, 0, 0, 0.2);
  190. z-index: 999;
  191. .uni-list-cell {
  192. width: 90%;
  193. display: flex;
  194. flex-direction: row;
  195. justify-content: space-evenly;
  196. align-items: center;
  197. text-align: center;
  198. margin-top: 32rpx;
  199. .uni-list-cell-left {
  200. flex: 3;
  201. font-size: 32rpx;
  202. color: #666;
  203. }
  204. .uni-list-cell-db {
  205. border: 1px solid #e5e9ed;
  206. background-color: #fff;
  207. padding: 16rpx 0;
  208. flex: 5;
  209. }
  210. .uni-list-cell-db-text {
  211. flex: 5;
  212. text-align: left;
  213. }
  214. }
  215. .changeHospital__wrap {
  216. width: 90vw;
  217. position: absolute;
  218. left: 50%;
  219. top: 50%;
  220. transform: translate(-50%, -50%);
  221. background-color: #fff;
  222. border-radius: 12rpx;
  223. color: #666;
  224. .changeHospital__header {
  225. font-size: 36rpx;
  226. color: #000;
  227. height: 84rpx;
  228. display: flex;
  229. justify-content: center;
  230. align-items: center;
  231. }
  232. .changeHospital__article {
  233. width: 90%;
  234. margin: 0 auto 25rpx;
  235. padding: 48rpx 0;
  236. background-color: rgb(249, 250, 251);
  237. border: 2rpx solid rgb(229, 233, 237);
  238. border-radius: 12rpx;
  239. box-sizing: border-box;
  240. display: flex;
  241. flex-direction: column;
  242. justify-content: center;
  243. align-items: center;
  244. &.p0 {
  245. padding: 0;
  246. }
  247. .changeHospital__icon {
  248. font-size: 138rpx;
  249. margin-bottom: 32rpx;
  250. &.changeHospital__icon--success {
  251. color: rgb(52, 179, 73);
  252. }
  253. &.changeHospital__icon--warn {
  254. color: rgb(245, 165, 35);
  255. }
  256. &.changeHospital__icon--error {
  257. color: rgb(255, 58, 82);
  258. }
  259. }
  260. .changeHospital__content {
  261. font-size: 36rpx;
  262. }
  263. .changeHospital__info {
  264. font-size: 32rpx;
  265. color: rgb(102, 102, 102);
  266. }
  267. .specialCloseFlag {
  268. width: 90%;
  269. height: 100%;
  270. padding: 16rpx;
  271. }
  272. .radio-wrap {
  273. .radio-item {
  274. margin-top: 16rpx;
  275. /deep/ .uni-radio-input-checked {
  276. background-color: #49b856 !important;
  277. border-color: #49b856 !important;
  278. }
  279. }
  280. }
  281. }
  282. .changeHospital__footer {
  283. box-sizing: border-box;
  284. height: 100rpx;
  285. border-top: 2rpx solid rgb(229, 233, 237);
  286. display: flex;
  287. align-items: center;
  288. view {
  289. height: 100%;
  290. display: flex;
  291. align-items: center;
  292. justify-content: center;
  293. font-size: 36rpx;
  294. color: rgb(102, 102, 102);
  295. position: relative;
  296. &:nth-of-type(2)::before {
  297. content: "";
  298. position: absolute;
  299. left: 0;
  300. bottom: 0;
  301. width: 2rpx;
  302. height: 87rpx;
  303. background-color: rgb(229, 233, 237);
  304. }
  305. }
  306. .changeHospital__ok {
  307. flex: 1;
  308. color: rgb(73, 184, 86);
  309. }
  310. .changeHospital__cancel {
  311. flex: 1;
  312. }
  313. .changeHospital__know {
  314. flex: 1;
  315. color: rgb(73, 184, 86);
  316. }
  317. }
  318. }
  319. }
  320. </style>