page2.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view>
  3. <view class="info-dot">护理申请</view>
  4. <view class="info-list">
  5. <view class="info-item" v-for="(item, index) in itemHandle" :key="index">
  6. <text class="info-item-label">{{item.name}}</text>
  7. <text class="info-item-content text-overflow">{{item.value??'-'}}</text>
  8. </view>
  9. </view>
  10. <view class="info-dot">护理需求</view>
  11. <view class="info-list">
  12. <view class="info-item flex-column" style="align-items: flex-start;">
  13. <view class="info-item-label">护理需求</view>
  14. <view class="info-item-content info-item-content2">
  15. <up-textarea v-model="item.careNeeds" disabled placeholder="-" count />
  16. </view>
  17. </view>
  18. <view class="info-item flex-column" style="align-items: flex-start;">
  19. <view class="info-item-label">备注</view>
  20. <view class="info-item-content info-item-content2">
  21. <up-textarea v-model="item.remark" disabled placeholder="-" count />
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script setup>
  28. import {
  29. computed,
  30. reactive,
  31. ref
  32. } from 'vue';
  33. import {
  34. getDict
  35. } from '@/common/status/index.js'
  36. const props = defineProps({
  37. item: {
  38. type: Object,
  39. default () {
  40. return {}
  41. }
  42. }
  43. })
  44. const objKeyValue = reactive([{
  45. name: '姓名',
  46. key: 'personName'
  47. },
  48. {
  49. name: '首选性别',
  50. key: 'nurseGender'
  51. },
  52. {
  53. name: '所在医院',
  54. key: 'hospital'
  55. },
  56. {
  57. name: '详细地址',
  58. key: 'address'
  59. },
  60. {
  61. name: '预计天数',
  62. key: 'careDays'
  63. },
  64. {
  65. name: '申请日期',
  66. key: 'applyDate'
  67. },
  68. ])
  69. //中间层 - item和objKeyValue
  70. const itemHandle = computed(()=>{
  71. let itemArray = uni.$u.deepClone(objKeyValue);
  72. itemArray.map(keyObj=>{
  73. if(props.item.hasOwnProperty(keyObj.key)){
  74. let value = props.item[keyObj.key];
  75. if(keyObj.key === 'nurseGender'){
  76. value = getDict('sys_user_sex', {dictValue: value}).dictLabel??'-';
  77. }
  78. keyObj.value = value;
  79. }
  80. })
  81. return itemArray;
  82. })
  83. </script>
  84. <style lang="scss" scoped>
  85. .info-dot{
  86. position: relative;
  87. margin: 20rpx;
  88. padding-left: 20rpx;
  89. font-size: 36rpx;
  90. color: #0B0B0B;
  91. }
  92. .info-dot::before{
  93. content: '';
  94. position: absolute;
  95. width: 12rpx;
  96. height: 12rpx;
  97. border-radius: 50%;
  98. top: calc(50% - 6rpx);
  99. left: 0;
  100. background: #4794FF;
  101. }
  102. .info-list {
  103. margin: 24rpx !important;
  104. padding: 30rpx;
  105. border-radius: 10rpx;
  106. background-color: #fff;
  107. }
  108. .info-item {
  109. display: flex;
  110. align-items: center;
  111. &-label {
  112. font-size: 28rpx;
  113. color: #716D89;
  114. width: 160rpx;
  115. padding: 20rpx 0;
  116. }
  117. &-content {
  118. width: 590rpx;
  119. font-size: 28rpx;
  120. color: #333333;
  121. border-bottom: 1px solid rgba(136, 136, 136, 0.10);
  122. padding: 20rpx 0;
  123. }
  124. &-content2 {
  125. padding-top: 0 !important;
  126. width: 650rpx;
  127. border: none;
  128. }
  129. }
  130. .info-item:last-child {
  131. &-content {
  132. border-bottom: none;
  133. }
  134. }
  135. </style>