handViewSpecimen.vue 9.8 KB

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