selectAccount2.vue 10 KB

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