TaskItemInfo.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. emit('pdfDetail', businessType, serviceOrderStatus.value?.signFilePdf || '')
  70. } else if (businessType === 200) {
  71. emit('pdfDetail', businessType, resultStatus.value?.signFilePdf || '')
  72. }
  73. }
  74. // 点击卡片
  75. const handleClick = () => {
  76. emit('click')
  77. }
  78. // 点击安全检查记录
  79. const handleSecurityCheck = () => {
  80. emit('securityCheck')
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .task-center {
  85. display: flex;
  86. flex-direction: column;
  87. padding: 8px 12px;
  88. background-color: rgb(244, 244, 244);
  89. border-radius: 5px;
  90. }
  91. .row-center {
  92. display: flex;
  93. flex-direction: row;
  94. flex-wrap: wrap;
  95. justify-content: space-between;
  96. align-items: center;
  97. width: 100%;
  98. }
  99. .title {
  100. color: rgb(108, 108, 108);
  101. font-size: 12px;
  102. line-height: 25px;
  103. margin-right: 5px;
  104. }
  105. .block {
  106. display: block;
  107. }
  108. .flex-1 {
  109. flex: 1;
  110. }
  111. .text {
  112. color: rgb(51, 51, 51);
  113. font-size: 12px;
  114. line-height: 25px;
  115. }
  116. .actions-row {
  117. margin-top: 5px;
  118. justify-content: flex-start;
  119. gap: 10px;
  120. }
  121. .action-item {
  122. display: flex;
  123. flex-direction: row;
  124. align-items: center;
  125. margin-right: 10px;
  126. }
  127. .status-badge {
  128. border-radius: 2px;
  129. padding: 3px;
  130. min-width: 46px;
  131. text-align: center;
  132. font-size: 12px;
  133. color: white;
  134. }
  135. .bg-blue {
  136. background-color: rgba(47, 141, 255, 1);
  137. }
  138. .bg-green {
  139. background-color: rgba(103, 194, 58, 1);
  140. }
  141. .bg-orange {
  142. background-color: rgba(230, 162, 60, 1);
  143. }
  144. </style>