<template> <view class="changeHospital" v-show="disjunctor"> <view class="changeHospital__wrap"> <view class="changeHospital__header"> 提示 </view> <view class="changeHospital__article"> <view class="uni-list-cell content" v-show="content"> {{content}} </view> <view class="uni-list-cell content red" v-show="tips"> {{tips}} </view> <view class="uni-list-cell"> <view class="uni-list-cell-left"> <text class="red">*</text>取消原因: </view> <view class="uni-list-cell-db"> <picker @change="changeCancelReason" :value="cancelReasonIndex" :range="cancelReason" range-key="name"> <view class="uni-input">{{cancelReason[cancelReasonIndex].name}}</view> </picker> </view> </view> <view class="uni-list-cell"> <view class="uni-list-cell-left"> <text class="red" v-if="cancelBloodHandover == 1">*</text>输入工号: </view> <view class="uni-list-cell-db"> <input class="uni-input" focus placeholder="请输入工号" v-model="account" @input="bindPickerChange($event)" /> </view> </view> <view class="uni-list-cell"> <view class="uni-list-cell-left"> 人员工号: </view> <view class="uni-list-cell-db-text"> <text v-show="!loading">{{ accountName ? account : "无" }}</text> <view class="sk-circle" v-show="loading"> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> </view> </view> </view> <view class="uni-list-cell"> <view class="uni-list-cell-left"> 人员姓名: </view> <view class="uni-list-cell-db-text"> <text v-show="!loading">{{ accountName || "无" }}</text> <view class="sk-circle" v-show="loading"> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> <view class="sk-circle-dot"></view> </view> </view> </view> </view> <view class="changeHospital__footer"> <view v-if="operate.ok" class="changeHospital__ok" @click="ok" hover-class="seimin-btn-hover"> {{ operate.ok || "" }} </view> <view v-if="operate.cancel" class="changeHospital__cancel" @click="cancel" hover-class="seimin-btn-hover"> {{ operate.cancel || "" }} </view> </view> </view> </view> </template> <script> import { post } from "../../http/http.js"; export default { data() { return { cValue: '', //当前输入的标本编码 loading: false, userData: null, hosId: null, timer: null, account: '', //交接人工号 accountName: '', //交接人姓名 accountId: '' ,//交接人ID cancelReasonIndex: 0, cancelReason: [{id: 1, name: '输血科取消'}, {id: 2, name: '临时取消'}], }; }, watch: { disjunctor(newValue) { if (newValue && this.operate.know == "知道了") { this.time = 5; this.timer = setInterval(() => { this.time--; if (this.time <= 0) { clearInterval(this.timer); this.know(); } }, 1000); } }, }, props: { // 显示隐藏 disjunctor: { type: Boolean, default: false, }, // 提示内容 content: { type: String, default: "", }, // 提示内容-标红 tips: { type: String, default: "", }, // 交接人是否必填 cancelBloodHandover: { type: Number, default: 0, }, // 操作按钮文字 operate: { type: Object, default: () => { return { ok: "确定", cancel: "取消", }; }, }, }, methods: { // 修改取消原因 changeCancelReason(e){ this.cancelReasonIndex = e.detail.value; }, //修改picker的值 bindPickerChange(e) { this.accountName = ''; this.accountId = ''; this.loading = true; this.cValue = e.target.value; clearTimeout(this.timer); this.timer = setTimeout(() => { let account = e.target.value; post("/data/isRepeat", { // hospital: { // id: this.hosId // }, account }).then(result => { if (result.status == 200) { if (this.cValue === account) { this.accountName = result.userName; this.account = account; this.accountId = result.userId; this.loading = false; } } else { this.accountName = ''; this.accountId = ''; this.loading = false; } }) }, 500) }, // 确定 ok() { let e = {}; if (this.accountName) { e.accountName = this.accountName; } if (this.account) { e.account = this.account; } if (this.accountId) { e.accountId = this.accountId; } if (this.cancelReason[this.cancelReasonIndex]) { e.cancelReason = this.cancelReason[this.cancelReasonIndex]; } this.$emit("ok", e); }, // 取消 cancel() { this.$emit("cancel"); }, }, created() { this.hosId = uni.getStorageSync('userData').user.currentHospital.id; } }; </script> <style lang="less" scoped> .changeHospital { position: fixed; left: 0; right: 0; top: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.2); z-index: 999; .uni-list-cell { width: 90%; display: flex; flex-direction: row; justify-content: space-evenly; align-items: center; text-align: center; margin-top: 32rpx; &.content{ justify-content: center; color: #000; margin-top: 0; font-weight: bold; } .uni-list-cell-left { flex: 3; font-size: 32rpx; color: #666; } .uni-list-cell-db { border: 1px solid #e5e9ed; background-color: #fff; padding: 16rpx 0; flex: 5; } .uni-list-cell-db-text { flex: 5; text-align: left; } } .changeHospital__wrap { width: 90vw; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background-color: #fff; border-radius: 12rpx; color: #666; .changeHospital__header { font-size: 36rpx; color: #000; height: 84rpx; display: flex; justify-content: center; align-items: center; } .changeHospital__article { width: 90%; margin: 0 auto 25rpx; padding: 48rpx 0; background-color: rgb(249, 250, 251); border: 2rpx solid rgb(229, 233, 237); border-radius: 12rpx; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; align-items: center; &.p0 { padding: 0; } .changeHospital__icon { font-size: 138rpx; margin-bottom: 32rpx; &.changeHospital__icon--success { color: rgb(52, 179, 73); } &.changeHospital__icon--warn { color: rgb(245, 165, 35); } &.changeHospital__icon--error { color: rgb(255, 58, 82); } } .changeHospital__content { font-size: 36rpx; } .changeHospital__info { font-size: 32rpx; color: rgb(102, 102, 102); } .specialCloseFlag { width: 90%; height: 100%; padding: 16rpx; } .radio-wrap { .radio-item { margin-top: 16rpx; /deep/ .uni-radio-input-checked { background-color: #49b856 !important; border-color: #49b856 !important; } } } } .changeHospital__footer { box-sizing: border-box; height: 100rpx; border-top: 2rpx solid rgb(229, 233, 237); display: flex; align-items: center; view { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36rpx; color: rgb(102, 102, 102); position: relative; &:nth-of-type(2)::before { content: ""; position: absolute; left: 0; bottom: 0; width: 2rpx; height: 87rpx; background-color: rgb(229, 233, 237); } } .changeHospital__ok { flex: 1; color: rgb(73, 184, 86); } .changeHospital__cancel { flex: 1; } .changeHospital__know { flex: 1; color: rgb(73, 184, 86); } } } } </style>