BoilerItem.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <wd-collapse v-model="collapseValue" accordion class="item-collapse">
  3. <wd-collapse-item :name="item.orderNo">
  4. <template #title="{ expanded }">
  5. <view class="item-box">
  6. <view class="item-top">
  7. <view class="item-top-left">
  8. <view class="row">
  9. <text class="item-top-text">
  10. 任务单号:{{ item.orderNo }}
  11. <text>
  12. <text :style="{ color: checkTypeColor }">{{ checkType }}</text>
  13. </text>
  14. </text>
  15. <text v-if="item.equipNum" class="item-top-num-box">{{ item.equipNum }}台</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="item-center">
  20. <view class="row-center">
  21. <text class="title">
  22. 检测时间:
  23. <text class="text">{{ checkDate }}</text>
  24. </text>
  25. <text class="title">
  26. 设备注册代码:
  27. <text class="text">{{ item.equipCode }}</text>
  28. </text>
  29. </view>
  30. <text class="title">
  31. 使用单位:
  32. <text class="text">{{ item.unitName }}</text>
  33. </text>
  34. <view class="row-center">
  35. <text class="title">
  36. 项目负责人:
  37. <text class="text">{{ item?.manager?.nickname }}</text>
  38. </text>
  39. <text class="title">
  40. 主检人:
  41. <text class="text">{{ item?.mainCheckerUser?.nickname }}</text>
  42. </text>
  43. </view>
  44. <text class="title">
  45. 检验员:
  46. <text class="text">{{ checkUsersText }}</text>
  47. </text>
  48. </view>
  49. <view class="btn-group">
  50. <button v-show="item.recheckStatus == '100'" class="main-btn" @click.stop="handleOperation">
  51. <text class="main-btn-text">{{ operateText }}</text>
  52. </button>
  53. </view>
  54. <view class="collapse-arrow">
  55. <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': expanded }" />
  56. </view>
  57. </view>
  58. </template>
  59. <view class="recheck-list">
  60. <view v-if="item.recheckReportList?.length" v-for="report in item.recheckReportList" :key="report.reportId" class="recheck-item">
  61. <text class="recheck-report-name">{{ report.reportName }}</text>
  62. <view v-if="statusFilter === '100'" class="recheck-btn" @click.stop="handleOperation(item, report)">
  63. <text class="recheck-btn-text">校核</text>
  64. </view>
  65. </view>
  66. <view v-else class="recheck-empty">暂无校核项</view>
  67. </view>
  68. </wd-collapse-item>
  69. </wd-collapse>
  70. </template>
  71. <script lang="ts" setup>
  72. import { computed, ref } from 'vue'
  73. import iconMap from '@/utils/imagesMap'
  74. import { BoilerPressureCheckTypeMap } from '@/utils/dictMap'
  75. import { PressureCheckerMyTaskStatusMap } from '@/utils/dictMap'
  76. interface Props {
  77. item: any
  78. reportDOList: any[]
  79. operateText: string
  80. statusFilter: string
  81. }
  82. const props = defineProps<Props>()
  83. const emit = defineEmits<{
  84. handleOperation: [item: any, reportDOList: any]
  85. handleRecheck: [item: any, report: any]
  86. }>()
  87. const collapseValue = ref<string>('')
  88. const checkType = computed(() => {
  89. return BoilerPressureCheckTypeMap[props.item.checkType] || ''
  90. })
  91. const checkTypeColor = computed(() => {
  92. switch (props.item.checkType) {
  93. case 200:
  94. return 'rgb(251,127,55)'
  95. case 300:
  96. return '#ff4d4f'
  97. default:
  98. return '#2F8EFF'
  99. }
  100. })
  101. const checkDate = computed(() => {
  102. return props.item.checkDate ? props.item.checkDate.join('-') : ''
  103. })
  104. const checkUsersText = computed(() => {
  105. const checkUsers = props.item?.checkUsers?.map((check: any) => check.nickname)
  106. return checkUsers?.length > 0 ? checkUsers.join(',') : ''
  107. })
  108. const reportText = computed(() => {
  109. return props.reportDOList?.map((item) => item.reportName)?.join('、') || ''
  110. })
  111. const taskStatusText = computed(() => {
  112. return PressureCheckerMyTaskStatusMap[props.item.taskStatus] || ''
  113. })
  114. const handleOperation = (taskOrder, recheckItem) => {
  115. emit('handleOperation', taskOrder, recheckItem)
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .item-box {
  120. background-color: #fff;
  121. border-radius: 5px;
  122. position: relative;
  123. }
  124. .row {
  125. display: flex;
  126. flex-direction: row;
  127. align-items: center;
  128. }
  129. .item-top {
  130. display: flex;
  131. flex-direction: row;
  132. flex-wrap: wrap;
  133. align-items: center;
  134. border-bottom: 1px solid rgb(244, 244, 244);
  135. padding-bottom: 10px;
  136. margin-bottom: 10px;
  137. }
  138. .item-top-left {
  139. flex: 1;
  140. display: flex;
  141. flex-direction: row;
  142. flex-wrap: wrap;
  143. align-items: center;
  144. justify-content: space-between;
  145. }
  146. .item-top-text {
  147. font-size: 17px;
  148. color: rgb(51, 51, 51);
  149. font-weight: bold;
  150. }
  151. .item-top-num-box {
  152. border-radius: 2px;
  153. background-color: rgb(255, 227, 210);
  154. padding: 3px;
  155. min-width: 46px;
  156. text-align: center;
  157. font-size: 12px;
  158. color: rgb(251, 127, 55);
  159. }
  160. .main-btn {
  161. width: 82px;
  162. height: 29px;
  163. border-radius: 3px;
  164. display: flex;
  165. justify-content: center;
  166. align-items: center;
  167. background-color: rgb(47, 142, 255);
  168. margin: 0;
  169. border: none;
  170. padding: 0;
  171. }
  172. .main-btn-text {
  173. color: rgb(222, 238, 255);
  174. font-size: 15px;
  175. }
  176. .item-center {
  177. display: flex;
  178. flex-direction: column;
  179. padding: 8px 12px;
  180. background-color: rgb(244, 244, 244);
  181. border-radius: 5px;
  182. }
  183. .row-center {
  184. display: flex;
  185. flex-direction: row;
  186. flex-wrap: wrap;
  187. justify-content: space-between;
  188. align-items: center;
  189. }
  190. .title {
  191. color: rgb(108, 108, 108);
  192. font-size: 12px;
  193. line-height: 25px;
  194. margin-right: 5px;
  195. }
  196. .text {
  197. color: rgb(51, 51, 51);
  198. font-size: 12px;
  199. line-height: 25px;
  200. }
  201. .status-badge {
  202. height: 25px;
  203. padding: 0 5px;
  204. display: flex;
  205. justify-content: center;
  206. align-items: center;
  207. background-color: #ffe3d2;
  208. border-radius: 3px;
  209. }
  210. .status-text {
  211. color: rgb(251, 127, 55);
  212. font-size: 12px;
  213. }
  214. .btn-group {
  215. display: flex;
  216. flex-direction: row;
  217. align-items: center;
  218. justify-content: flex-end;
  219. margin-top: 10px;
  220. }
  221. .collapse-arrow {
  222. display: flex;
  223. justify-content: center;
  224. align-items: center;
  225. padding-top: 8px;
  226. }
  227. .arrow-icon {
  228. width: 24px;
  229. height: 14px;
  230. transition: transform 0.3s;
  231. }
  232. .arrow-rotate {
  233. transform: rotate(180deg);
  234. }
  235. /* collapse 外层覆盖 */
  236. .item-collapse {
  237. :deep(.wd-collapse-item__title) {
  238. padding: 0;
  239. }
  240. :deep(.wd-collapse-item__title-wrapper) {
  241. background-color: transparent;
  242. }
  243. :deep(.wd-collapse-item__arrow) {
  244. display: none;
  245. }
  246. :deep(.wd-collapse-item__content) {
  247. padding: 0 13px 13px;
  248. }
  249. }
  250. /* recheck 列表 */
  251. .recheck-list {
  252. background-color: #fff;
  253. border-radius: 5px;
  254. }
  255. .recheck-item {
  256. display: flex;
  257. flex-direction: row;
  258. align-items: center;
  259. justify-content: space-between;
  260. padding: 10px 13px;
  261. border-bottom: 1px solid rgb(244, 244, 244);
  262. &:last-child {
  263. border-bottom: none;
  264. }
  265. }
  266. .recheck-report-name {
  267. font-size: 14px;
  268. color: #333;
  269. }
  270. .recheck-btn {
  271. padding: 4px 12px;
  272. border-radius: 3px;
  273. background-color: #fff;
  274. border: 1px solid rgb(47, 142, 255);
  275. }
  276. .recheck-btn-text {
  277. font-size: 13px;
  278. color: rgb(47, 142, 255);
  279. }
  280. .recheck-empty {
  281. padding: 20px 0;
  282. text-align: center;
  283. font-size: 13px;
  284. color: #999;
  285. }
  286. </style>