selectAccount.vue 7.9 KB

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