page2.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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 v-if="'no_check,disagree'.includes(item.status)">
  26. <view class="btn-box-place"></view>
  27. <view class="btn-box flex-row" :class="{'btn-box-disagree': item.status == 'disagree'}">
  28. <view class="u-flex flex-column align-center justify-center" style="width: 120rpx;" @tap="editTap">
  29. <u-icon name="file-text-fill" color="#909399" size="24" />
  30. <view style="font-size: 28rpx;color: 909399;">编辑</view>
  31. </view>
  32. <view class="u-flex flex-column align-center justify-center" style="width: 120rpx;margin-left: 20rpx;"
  33. @tap="delTap">
  34. <u-icon name="trash-fill" color="#909399" size="24" />
  35. <view style="font-size: 28rpx;color: 909399;">删除</view>
  36. </view>
  37. <view style="width: 20rpx;"></view>
  38. <up-button class="up-button" type="primary" @tap="applyTap">提交审核</up-button>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script setup>
  44. import {
  45. computed,
  46. reactive,
  47. ref
  48. } from 'vue';
  49. import {
  50. getDict
  51. } from '@/common/status/index.js'
  52. import {delCareApp, postCareStart} from '@/common/config/application-api.js'
  53. const props = defineProps({
  54. item: {
  55. type: Object,
  56. default () {
  57. return {}
  58. }
  59. }
  60. })
  61. const objKeyValue = reactive([{
  62. name: '姓名',
  63. key: 'personName'
  64. },
  65. {
  66. name: '首选性别',
  67. key: 'nurseGender'
  68. },
  69. {
  70. name: '所在医院',
  71. key: 'hospital'
  72. },
  73. {
  74. name: '详细地址',
  75. key: 'address'
  76. },
  77. {
  78. name: '预计天数',
  79. key: 'careDays'
  80. },
  81. {
  82. name: '申请日期',
  83. key: 'applyDate'
  84. },
  85. ])
  86. //中间层 - item和objKeyValue
  87. const itemHandle = computed(() => {
  88. let itemArray = uni.$u.deepClone(objKeyValue);
  89. itemArray.map(keyObj => {
  90. if (props.item.hasOwnProperty(keyObj.key)) {
  91. let value = props.item[keyObj.key];
  92. if (keyObj.key === 'nurseGender') {
  93. value = getDict({
  94. dictValue: value,
  95. dictType: 'sys_user_sex'
  96. }).dictLabel ?? '-';
  97. }
  98. keyObj.value = value;
  99. }
  100. })
  101. return itemArray;
  102. })
  103. //编辑按钮
  104. function editTap() {
  105. uni.$u.route('/pages/subpack/pages/apply/apply', {
  106. id: props.item.applyId
  107. })
  108. }
  109. //删除按钮
  110. function delTap() {
  111. uni.showModal({
  112. title: '提示',
  113. content: '您确定删除吗?',
  114. success(res) {
  115. if (res.confirm) {
  116. delCareApp({id: props.item.applyId}).then(res=>{
  117. uni.$u.toast('删除成功');
  118. uni.$emit('renderApplyList');
  119. setTimeout(()=>{
  120. uni.$u.route({
  121. type: 'back'
  122. })
  123. }, 1000)
  124. })
  125. }
  126. }
  127. })
  128. }
  129. //审核按钮
  130. function applyTap() {
  131. uni.showModal({
  132. title: '提示',
  133. content: '您确定提交审核吗?',
  134. success(res) {
  135. if (res.confirm) {
  136. postCareStart({...props.item}).then(res=>{
  137. uni.$u.toast('送审成功');
  138. uni.$emit('renderApplyList');
  139. setTimeout(()=>{
  140. uni.$u.route({
  141. type: 'back'
  142. })
  143. }, 1000)
  144. })
  145. }
  146. }
  147. })
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. :deep(.u-button--normal) {
  152. font-size: 28rpx !important;
  153. }
  154. .info-dot {
  155. position: relative;
  156. margin: 20rpx;
  157. padding-left: 20rpx;
  158. font-size: 36rpx;
  159. color: #0B0B0B;
  160. }
  161. .info-dot::before {
  162. content: '';
  163. position: absolute;
  164. width: 12rpx;
  165. height: 12rpx;
  166. border-radius: 50%;
  167. top: calc(50% - 6rpx);
  168. left: 0;
  169. background: #4794FF;
  170. }
  171. .info-list {
  172. margin: 24rpx !important;
  173. padding: 30rpx;
  174. border-radius: 10rpx;
  175. background-color: #fff;
  176. }
  177. .info-item {
  178. display: flex;
  179. align-items: center;
  180. &-label {
  181. font-size: 28rpx;
  182. color: #716D89;
  183. width: 160rpx;
  184. padding: 20rpx 0;
  185. }
  186. &-content {
  187. width: 590rpx;
  188. font-size: 28rpx;
  189. color: #333333;
  190. border-bottom: 1px solid rgba(136, 136, 136, 0.10);
  191. padding: 20rpx 0;
  192. }
  193. &-content2 {
  194. padding-top: 0 !important;
  195. width: 650rpx;
  196. border: none;
  197. }
  198. }
  199. .info-item:last-child {
  200. &-content {
  201. border-bottom: none;
  202. }
  203. }
  204. .btn-box-place {
  205. height: 130rpx;
  206. }
  207. .btn-box {
  208. padding: 20rpx 36rpx;
  209. background-color: #fff;
  210. position: fixed;
  211. height: 120rpx;
  212. display: flex;
  213. align-items: center;
  214. bottom: 0;
  215. width: 690rpx;
  216. z-index: 999999;
  217. }
  218. .btn-box-disagree{
  219. bottom: calc(50px + var(--status-bar-height));
  220. }
  221. </style>