TaskItemInfo.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="task-center" @click="handleClick">
  3. <view class="row-center">
  4. <text class="title">检验时间:<text class="text">{{ item.checkDate }}</text></text>
  5. <text class="title">联系人:<text class="text">{{ item.unitContact }}</text></text>
  6. <text class="title">联系电话:<text class="text">{{ item.unitPhone }}</text></text>
  7. </view>
  8. <text class="title block">使用单位:<text class="text">{{ item.unitName }}</text></text>
  9. <text class="title block">单位地址:<text class="text">{{ item.unitAddress }}</text></text>
  10. <view class="row-center">
  11. <text class="title flex-1">项目负责人:<text class="text">{{ item.manager?.nickname }}</text></text>
  12. </view>
  13. <view class="row-center">
  14. <text class="title flex-1">检验人:<text class="text">{{ item?.appoinmentUser?.map((v: any) => v.nickname)?.join('、') || '' }}</text></text>
  15. </view>
  16. <text v-if="item.remark" class="title block">备注:<text class="text">{{ item.remark }}</text></text>
  17. <view class="row-center actions-row">
  18. <view class="title action-item" @click.stop="handleSecurityCheck">
  19. <text>安全检查记录:</text>
  20. <text class="status-badge bg-blue">{{ item.securityCheckCount || 0 }}</text>
  21. </view>
  22. <view class="title action-item" @click.stop="pdfClickFun(200)">
  23. <text>告知单:</text>
  24. <text class="status-badge bg-green">{{ resultStatusText }}</text>
  25. </view>
  26. <view class="title action-item" @click.stop="pdfClickFun(100)">
  27. <text>服务单/受理单:</text>
  28. <text class="status-badge bg-orange">{{ serviceOrderStatusText }}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script lang="ts" setup>
  34. import { computed } from 'vue'
  35. interface Props {
  36. item: any
  37. }
  38. const props = defineProps<Props>()
  39. const emit = defineEmits<{
  40. click: []
  41. securityCheck: []
  42. pdfDetail: [businessType: number, signFilePdf: string]
  43. }>()
  44. // 服务单/受理单状态
  45. const serviceOrderStatus = computed(() => {
  46. const list = props.item.signFileList || []
  47. return list.find((v: any) => v.businessType === 100)
  48. })
  49. const serviceOrderStatusText = computed(() => {
  50. if (serviceOrderStatus.value) {
  51. return serviceOrderStatus.value.isSignature === '1' ? '已签名' : '未签名'
  52. }
  53. return '未添加'
  54. })
  55. // 检验结果状态
  56. const resultStatus = computed(() => {
  57. const list = props.item.signFileList || []
  58. return list.find((v: any) => v.businessType === 200)
  59. })
  60. const resultStatusText = computed(() => {
  61. if (resultStatus.value) {
  62. return resultStatus.value.isSignature === '1' ? '已签名' : '未签名'
  63. }
  64. return '未添加'
  65. })
  66. // PDF 点击事件
  67. const pdfClickFun = (businessType: number) => {
  68. if (businessType === 100) {
  69. if (serviceOrderStatus.value) {
  70. emit('pdfDetail', businessType, serviceOrderStatus.value.signFilePdf || '')
  71. } else {
  72. uni.showToast({ title: '请先添加服务单/受理单', icon: 'none' })
  73. }
  74. } else if (businessType === 200) {
  75. if (resultStatus.value) {
  76. emit('pdfDetail', businessType, resultStatus.value.signFilePdf || '')
  77. } else {
  78. uni.showToast({ title: '请先添加检验结果', icon: 'none' })
  79. }
  80. }
  81. }
  82. // 点击卡片
  83. const handleClick = () => {
  84. emit('click')
  85. }
  86. // 点击安全检查记录
  87. const handleSecurityCheck = () => {
  88. emit('securityCheck')
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .task-center {
  93. display: flex;
  94. flex-direction: column;
  95. padding: 8px 12px;
  96. background-color: rgb(244, 244, 244);
  97. border-radius: 5px;
  98. }
  99. .row-center {
  100. display: flex;
  101. flex-direction: row;
  102. flex-wrap: wrap;
  103. justify-content: space-between;
  104. align-items: center;
  105. width: 100%;
  106. }
  107. .title {
  108. color: rgb(108, 108, 108);
  109. font-size: 12px;
  110. line-height: 25px;
  111. margin-right: 5px;
  112. }
  113. .block {
  114. display: block;
  115. }
  116. .flex-1 {
  117. flex: 1;
  118. }
  119. .text {
  120. color: rgb(51, 51, 51);
  121. font-size: 12px;
  122. line-height: 25px;
  123. }
  124. .actions-row {
  125. margin-top: 5px;
  126. justify-content: flex-start;
  127. gap: 10px;
  128. }
  129. .action-item {
  130. display: flex;
  131. flex-direction: row;
  132. align-items: center;
  133. margin-right: 10px;
  134. }
  135. .status-badge {
  136. border-radius: 2px;
  137. padding: 3px;
  138. min-width: 46px;
  139. text-align: center;
  140. font-size: 12px;
  141. color: white;
  142. }
  143. .bg-blue {
  144. background-color: rgba(47, 141, 255, 1);
  145. }
  146. .bg-green {
  147. background-color: rgba(103, 194, 58, 1);
  148. }
  149. .bg-orange {
  150. background-color: rgba(230, 162, 60, 1);
  151. }
  152. </style>