index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <template>
  2. <view class="content">
  3. <!-- 标题栏 -->
  4. <view class="title-header-content">
  5. <!-- 右边放置一个时间 -->
  6. <view class="right-time">
  7. <text class="time-text">{{ currentTime }}</text>
  8. </view>
  9. <view class="header-section">
  10. <text class="header-title">检验信息屏</text>
  11. </view>
  12. <!-- 左边放一个设置按钮 -->
  13. <view class="left-config">
  14. <tui-icon name="setup" color="#0052a1" @click="openSetting"></tui-icon>
  15. <!-- 设置窗口 -->
  16. <tui-alert :show="showSetting" @click="showSetting=false;">
  17. <view>
  18. <tui-input placeholder="请输入显示人数" v-model="displayCount"></tui-input>
  19. </view>
  20. </tui-alert>
  21. </view>
  22. </view>
  23. <!-- 上半部分75vh - 已确认人员信息 -->
  24. <view class="top-section">
  25. <!-- 表头 -->
  26. <view class="section-header">
  27. <view class="row-heard"> 序号 </view>
  28. <view class="row-heard"> 体检号 </view>
  29. <view class="row-heard"> 姓名 </view>
  30. <view class="row-heard"> 性别 </view>
  31. <view class="row-heard"> 时间 </view>
  32. </view>
  33. <!-- 表身 -->
  34. <view class="table-body" v-for="(item, index) in displayCount">
  35. <view class="row-cloumn">{{ index + 1 }} </view>
  36. <view class="row-cloumn"> 12345678 </view>
  37. <view class="row-cloumn"> 吴二 </view>
  38. <view class="row-cloumn"> 男 </view>
  39. <view class="row-cloumn"> 2025-10-20 </view>
  40. </view>
  41. </view>
  42. <!-- 下半部分20vh - 未确认人员信息-->
  43. <view class="bottom-section">
  44. <view class="left-box">
  45. <view class="feces-box">
  46. <view class="feces-title-yes">
  47. 大便已确认:<text class="feces-count-yes">100</text>
  48. </view>
  49. <view class="feces-title-no">
  50. 大便未确认:<text class="feces-count-no">100</text>
  51. </view>
  52. </view>
  53. <view class="urination-box">
  54. <view class="urination-title-yes">
  55. 小便已确认:<text class="urination-count-yes">100</text>
  56. </view>
  57. <view class="urination-title-no">
  58. 小便未确认:<text class="urination-count-no">100</text>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 扫码框区域 -->
  63. <view class="right-box">
  64. <view class="input-box-right">
  65. <tui-input placeholder="请输入体检号" inputBorder="true" borderColor="#000" adjustPosition="false"
  66. isFillet="true" style="margin-top: 1vh;margin-left: 2vw;"></tui-input>
  67. <view class="sweep-box"><tui-icon name="sweep" style="margin-top: 1vh;" color="#0052A1"></tui-icon>
  68. </view>
  69. </view>
  70. <!-- 提示图 -->
  71. <view class="tip-box">
  72. <image src="/static/xjyj.png" style="width: 300px;height:250px" />
  73. <view class="tip-box-tipfont">
  74. 请扫描或输入您的体检号
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script setup>
  82. import {
  83. ref,
  84. computed,
  85. onMounted,
  86. onUnmounted
  87. } from "vue";
  88. // 显示数量控制
  89. const displayCount = ref(15);
  90. // 实时时间
  91. const currentTime = ref("");
  92. // 更新时间函数
  93. const updateTime = () => {
  94. const now = new Date();
  95. currentTime.value = now.toLocaleString("zh-CN", {
  96. year: "numeric",
  97. month: "2-digit",
  98. day: "2-digit",
  99. hour: "2-digit",
  100. minute: "2-digit",
  101. second: "2-digit",
  102. hour12: false,
  103. });
  104. };
  105. let timer = null;
  106. onMounted(() => {
  107. updateTime();
  108. timer = setInterval(updateTime, 1000);
  109. });
  110. onUnmounted(() => {
  111. if (timer) {
  112. clearInterval(timer);
  113. }
  114. });
  115. const showSetting = ref(false)
  116. // 打开设置窗口
  117. async function openSetting() {
  118. console.log('打开设置')
  119. showSetting.value = true
  120. }
  121. </script>
  122. <style>
  123. /* 主体容器 */
  124. .content {
  125. display: flex;
  126. flex-direction: column;
  127. height: 100vh;
  128. width: 100vw;
  129. background: #0086d0;
  130. }
  131. .title-header-content {
  132. width: 100vw;
  133. display: flex;
  134. height: 3vh;
  135. justify-content: space-between;
  136. align-items: center;
  137. margin-bottom: 30rpx;
  138. border-bottom: 1rpx solid #56c3ef;
  139. background: linear-gradient(180deg, #bdebfc 0%, #ffffff 100%);
  140. padding: 0 20rpx;
  141. }
  142. .left-config {
  143. display: flex;
  144. width: 10vw;
  145. align-items: center;
  146. margin-left: 15vw;
  147. justify-content: start;
  148. }
  149. .right-time {
  150. display: flex;
  151. width: 25vw;
  152. align-items: center;
  153. }
  154. .time-text {
  155. font-size: 24px;
  156. color: #333;
  157. font-weight: bold;
  158. }
  159. /* 标题栏 */
  160. .header-section {
  161. width: 35vw;
  162. height: 5vh;
  163. display: flex;
  164. margin-bottom: 50rpx;
  165. justify-content: center;
  166. align-items: center;
  167. text-align: center;
  168. background: #56c3ef;
  169. border-bottom-left-radius: 130rpx;
  170. border-bottom-right-radius: 130rpx;
  171. border-bottom: 1rpx solid #56c3ef;
  172. color: #fff;
  173. font-size: 30px;
  174. font-weight: bold;
  175. }
  176. .header-title {
  177. font-size: 30px;
  178. font-weight: bold;
  179. margin-top: 2vh;
  180. }
  181. /* 上半部分 - 75vh */
  182. .top-section {
  183. width: 98vw;
  184. height: 65vh;
  185. background: white;
  186. margin-top: 50rpx;
  187. margin: 20rpx;
  188. border-radius: 30rpx;
  189. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  190. }
  191. .section-header {
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: center;
  195. margin-bottom: 20rpx;
  196. height: 3vh;
  197. background: #76d9fa;
  198. padding-bottom: 10rpx;
  199. border-top-left-radius: 30rpx;
  200. border-top-right-radius: 30rpx;
  201. border-bottom: 1rpx solid #eee;
  202. }
  203. .section-title {
  204. font-size: 32rpx;
  205. font-weight: bold;
  206. color: #333;
  207. }
  208. .display-control {
  209. display: flex;
  210. align-items: center;
  211. gap: 10rpx;
  212. }
  213. .count-input {
  214. width: 80rpx;
  215. height: 40rpx;
  216. border: 1rpx solid #ddd;
  217. border-radius: 5rpx;
  218. text-align: center;
  219. font-size: 24rpx;
  220. }
  221. .person-list {
  222. height: calc(60vh - 100rpx);
  223. }
  224. .person-item {
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. padding: 20rpx;
  229. margin: 10rpx 0;
  230. background: #f8f9fa;
  231. border-radius: 8rpx;
  232. border-left: 4rpx solid #007bff;
  233. }
  234. .person-id {
  235. width: 120rpx;
  236. font-weight: bold;
  237. color: #007bff;
  238. }
  239. .person-name {
  240. width: 120rpx;
  241. color: #333;
  242. }
  243. .person-gender {
  244. width: 60rpx;
  245. color: #666;
  246. }
  247. .person-time {
  248. width: 200rpx;
  249. color: #999;
  250. font-size: 24rpx;
  251. }
  252. /* 下半部分 - 30vh */
  253. .bottom-section {
  254. height: 28vh;
  255. display: flex;
  256. padding: 10rpx;
  257. width: 97vw;
  258. margin-left: 1vw;
  259. border: 1px solid #eee;
  260. border-radius: 30rpx;
  261. background: #fff;
  262. }
  263. /* 左部分 - 60vw */
  264. .left-section {
  265. width: 60vw;
  266. display: flex;
  267. flex-direction: column;
  268. gap: 10rpx;
  269. padding-right: 10rpx;
  270. }
  271. .status-card {
  272. flex: 1;
  273. background: white;
  274. border-radius: 10rpx;
  275. padding: 20rpx;
  276. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  277. display: flex;
  278. flex-direction: column;
  279. justify-content: center;
  280. }
  281. .status-title {
  282. font-size: 28rpx;
  283. font-weight: bold;
  284. color: #333;
  285. margin-bottom: 15rpx;
  286. text-align: center;
  287. }
  288. .status-numbers {
  289. display: flex;
  290. justify-content: space-around;
  291. }
  292. .unconfirmed,
  293. .confirmed {
  294. font-size: 24rpx;
  295. padding: 8rpx 16rpx;
  296. border-radius: 20rpx;
  297. }
  298. .red {
  299. background: #ffebee;
  300. color: #d32f2f;
  301. border: 1rpx solid #ffcdd2;
  302. }
  303. .green {
  304. background: #e8f5e8;
  305. color: #388e3c;
  306. border: 1rpx solid #c8e6c9;
  307. }
  308. /* 右部分 - 40vw */
  309. .right-section {
  310. width: 40vw;
  311. padding-left: 10rpx;
  312. }
  313. .scan-section {
  314. height: 100%;
  315. background: white;
  316. border-radius: 10rpx;
  317. padding: 30rpx;
  318. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  319. display: flex;
  320. flex-direction: column;
  321. align-items: center;
  322. justify-content: center;
  323. gap: 20rpx;
  324. }
  325. .scan-title {
  326. font-size: 32rpx;
  327. font-weight: bold;
  328. color: #333;
  329. }
  330. .scan-btn {
  331. background: #007bff;
  332. color: white;
  333. border: none;
  334. border-radius: 50rpx;
  335. padding: 20rpx 40rpx;
  336. font-size: 28rpx;
  337. }
  338. .scan-btn:active {
  339. background: #0056b3;
  340. }
  341. .scan-tip {
  342. font-size: 24rpx;
  343. color: #666;
  344. text-align: center;
  345. }
  346. .row-heard {
  347. width: 18vw;
  348. color: #0052a1;
  349. font-size: 28px;
  350. margin-left: 10rpx;
  351. font-weight: bold;
  352. text-align: center;
  353. }
  354. .table-body {
  355. width: 100%;
  356. margin-top: 15rpx;
  357. display: flex;
  358. flex-direction: row;
  359. flex-wrap: wrap;
  360. }
  361. .row-cloumn {
  362. width: 18vw;
  363. color: #0052a1;
  364. font-size: 28px;
  365. height: 3vh;
  366. text-align: center;
  367. margin-left: 10rpx;
  368. background: #f8f9fa;
  369. border-radius: 10rpx;
  370. padding: 10rpx;
  371. }
  372. .left-box {
  373. width: 45vw;
  374. height: 16vh;
  375. /* border: 2px dashed #000; */
  376. margin-top: 1vh;
  377. margin-left: 2vw;
  378. border-radius: 30rpx;
  379. }
  380. .urination-box {
  381. width: 100%;
  382. height: 45%;
  383. border: 2px dashed rgb(189, 189, 189);
  384. border-radius: 20rpx;
  385. margin-top: 1vh;
  386. }
  387. .feces-box {
  388. width: 100%;
  389. height: 45%;
  390. border: 2px dashed rgb(189, 189, 189);
  391. border-radius: 20rpx;
  392. }
  393. .feces-title-yes {
  394. text-align: center;
  395. font-size: 28px;
  396. height: 50%;
  397. font-size: 28px;
  398. font-weight: bold;
  399. }
  400. .feces-title-no {
  401. text-align: center;
  402. height: 50%;
  403. font-size: 28px;
  404. font-weight: bold;
  405. }
  406. .urination-title-yes {
  407. text-align: center;
  408. height: 50%;
  409. font-size: 28px;
  410. font-weight: bold;
  411. }
  412. .urination-title-no {
  413. text-align: center;
  414. height: 50%;
  415. font-size: 28px;
  416. font-weight: bold;
  417. }
  418. .feces-count-yes {
  419. font-size: 35px;
  420. font-weight: bold;
  421. color: green;
  422. }
  423. .feces-count-no {
  424. font-size: 35px;
  425. font-weight: bold;
  426. color: red;
  427. }
  428. .urination-count-yes {
  429. font-size: 35px;
  430. font-weight: bold;
  431. color: green;
  432. }
  433. .urination-count-no {
  434. font-size: 35px;
  435. font-weight: bold;
  436. color: red;
  437. }
  438. .right-box {
  439. border: 2px dashed rgb(189, 189, 189);
  440. border-radius: 20rpx;
  441. width: 45vw;
  442. height: 16vh;
  443. margin-top: 1vh;
  444. margin-left: 2vw;
  445. }
  446. .input-box-right {
  447. width: 100%;
  448. display: flex;
  449. flex-direction: row;
  450. flex-wrap: wrap;
  451. }
  452. .sweep-box {
  453. width: 20%;
  454. display: flex;
  455. justify-content: center;
  456. align-items: center;
  457. }
  458. .tip-box {
  459. display: flex;
  460. flex-direction: row;
  461. }
  462. .tip-box-tipfont {
  463. display: flex;
  464. justify-content: center;
  465. align-items: center;
  466. font-size: 30px;
  467. font-weight: bold;
  468. text-align: center;
  469. }
  470. </style>