index.uvue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. <template>
  2. <view class="detail-page">
  3. <scroll-view class="detail-content" :scroll-y="true">
  4. <!-- 工单信息 -->
  5. <view class="info-section">
  6. <view class="section-title">
  7. <text class="section-title-text">工单信息</text>
  8. </view>
  9. <view class="info-card">
  10. <view class="info-item">
  11. <text class="info-label">工单编码</text>
  12. <text class="info-value">{{ detailData.workOrderProjectNo ?? '' }}</text>
  13. </view>
  14. <view class="info-item">
  15. <text class="info-label">工单类型</text>
  16. <text class="info-value">{{ detailData.orderType == 1 ? '维修工单' : '维保工单' }}</text>
  17. </view>
  18. <view class="info-item">
  19. <text class="info-label">风机编号</text>
  20. <text class="info-value">{{ detailData.pcsDeviceName ?? '' }}</text>
  21. </view>
  22. <view class="info-item">
  23. <text class="info-label">场站</text>
  24. <text class="info-value">{{ detailData.pcsStationName ?? '' }}</text>
  25. </view>
  26. <view class="info-item">
  27. <text class="info-label">工作负责人</text>
  28. <text class="info-value">{{ detailData.teamLeaderName ?? '' }}</text>
  29. </view>
  30. <view class="info-item">
  31. <text class="info-label">工作结束时间</text>
  32. <text class="info-value">{{ detailData.realEndTime ?? '' }}</text>
  33. </view>
  34. <view class="info-item">
  35. <text class="info-label">状态</text>
  36. <text class="info-value">{{ getScoringStatusText(detailData.scoringStatus) }}</text>
  37. </view>
  38. <view class="info-item" v-if="detailData.orderType == 1 && detailData.maintenanceType != null && detailData.maintenanceType != ''">
  39. <text class="info-label">检修类型</text>
  40. <text class="info-value">{{ getMaintenanceTypeText(detailData.maintenanceType) }}</text>
  41. </view>
  42. <view class="info-item" v-if="detailData.orderType == 2 && detailData.inspectionType != null && detailData.inspectionType != ''">
  43. <text class="info-label">维保类型</text>
  44. <text class="info-value">{{ getInspectionTypeText(detailData.inspectionType) }}</text>
  45. </view>
  46. <!-- <view class="info-item" v-if="detailData.workSummary != null && detailData.workSummary != ''">
  47. <text class="info-label">{{ detailData.orderType == 1 ? '维修总结' : '维保总结' }}</text>
  48. <text class="info-value">{{ detailData.workSummary ?? '' }}</text>
  49. </view> -->
  50. <view class="info-item" v-if="detailData.orderType == 1">
  51. <text class="info-label">故障代码</text>
  52. <text class="info-value">{{ detailData.faultCode ?? '' }}</text>
  53. </view>
  54. <view class="info-item" v-if="detailData.orderType == 1">
  55. <text class="info-label">故障条文</text>
  56. <text class="info-value">{{ detailData.faultBarcode ?? '' }}</text>
  57. </view>
  58. <view class="info-item" v-if="detailData.orderType == 1">
  59. <text class="info-label">故障描述</text>
  60. <text class="info-value">{{ detailData.faultDesc ?? '' }}</text>
  61. </view>
  62. <view class="info-item" v-if="detailData.orderType == 2">
  63. <text class="info-label">分项完成系数</text>
  64. <text class="info-value">{{ detailData.itemCompletionFactor ?? '' }}</text>
  65. </view>
  66. <view class="info-item" v-if="detailData.orderType == 2">
  67. <text class="info-label">分项完成系数和</text>
  68. <text class="info-value">{{ detailData.itemCompletionFactorSum ?? '' }}</text>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 工作总结 -->
  73. <view class="info-section" v-if="detailData.workSummary != null && detailData.workSummary != ''">
  74. <view class="section-title">
  75. <text class="section-title-text">{{ detailData.orderType == 1 ? '维修总结' : '维保总结' }}</text>
  76. </view>
  77. <view class="info-card">
  78. <view class="summary-content">
  79. <text class="summary-text">{{ detailData.workSummary ?? '' }}</text>
  80. </view>
  81. </view>
  82. </view>
  83. <!-- 额外工作总结 -->
  84. <view class="info-section" v-if="detailData.orderType == 1 && detailData.extraWork != null && detailData.extraWork != ''">
  85. <view class="section-title">
  86. <text class="section-title-text">额外工作总结</text>
  87. </view>
  88. <view class="info-card">
  89. <view class="summary-content">
  90. <text class="summary-text">{{ detailData.extraWork ?? '' }}</text>
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 退回理由 -->
  95. <view class="info-section" v-if="detailData.orderType == 1 && detailData.scoringStatus == 'returned'">
  96. <view class="section-title">
  97. <text class="section-title-text">退回理由</text>
  98. </view>
  99. <view class="info-card">
  100. <view class="summary-content">
  101. <text class="summary-text">{{ detailData.scoreReturnReason ?? '' }}</text>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- 修改理由 -->
  106. <view class="info-section" v-if="detailData.modifyReason != null && detailData.modifyReason != ''">
  107. <view class="section-title">
  108. <text class="section-title-text">修改理由</text>
  109. </view>
  110. <view class="info-card">
  111. <view class="summary-content">
  112. <text class="summary-text">{{ detailData.modifyReason ?? '' }}</text>
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 得分明细 -->
  117. <view class="info-section">
  118. <view class="section-title">
  119. <text class="section-title-text">得分明细</text>
  120. </view>
  121. <view class="info-card">
  122. <!-- 表格头部 -->
  123. <view class="table-header">
  124. <text class="table-cell score-col">工作班成员</text>
  125. <text class="table-cell score-col">自评得分</text>
  126. <text class="table-cell score-col">复评得分</text>
  127. <!-- <text class="table-cell score-col">终评得分</text> -->
  128. <text class="table-cell score-col" v-if="detailData.orderType == 1 && detailData.extraWork != null && detailData.extraWork != ''">额外工分</text>
  129. <text class="table-cell score-col" v-if="detailData.orderType == 1 && detailData.extraWork != null && detailData.extraWork != ''">工单得分</text>
  130. <text class="table-cell score-col" v-if="detailData.orderType == 2 && hasOtherOrQitaInspectionType()">额外工分</text>
  131. <text class="table-cell score-col" v-if="detailData.orderType == 2 && hasOtherOrQitaInspectionType()">工单得分</text>
  132. <!-- 如果是重启时间不为空且不为undefined,则显示奖励得分列 -->
  133. <text class="table-cell score-col" v-if="detailData.restartTime !== null">奖励得分</text>
  134. <text class="table-cell score-col" v-if="hasStopScore()">停运扣分</text>
  135. <!-- <text class="table-cell score-col">确认状态</text> -->
  136. </view>
  137. <!-- 表格行数据 -->
  138. <view class="table-row" v-for="(person, index) in detailData.scorePersonList" :key="index">
  139. <text class="table-cell score-col">
  140. {{ person.nickName }}
  141. <text class="table-cell score-col" v-if="person.isLeader == 1">(负责人)</text>
  142. </text>
  143. <text class="table-cell score-col">{{ person.selfScore !== null ? formatNumber(person.selfScore) : '-' }}</text>
  144. <text class="table-cell score-col">{{ person.reviewScore !== null ? formatNumber(person.reviewScore) : '-' }}</text>
  145. <!-- <text class="table-cell score-col">{{ person.finalScore !== null ? formatNumber(person.finalScore) : '-' }}</text> -->
  146. <text class="table-cell score-col" v-if="detailData.orderType == 1 && detailData.extraWork != null && detailData.extraWork != ''">{{ person.extraScore !== null ? formatNumber(person.extraScore) : '-' }}</text>
  147. <text class="table-cell score-col" v-if="detailData.orderType == 1 && detailData.extraWork != null && detailData.extraWork != ''">{{ person.totalScore !== null ? formatNumber(person.totalScore) : '-' }}</text>
  148. <text class="table-cell score-col" v-if="detailData.orderType == 2 && hasOtherOrQitaInspectionType()">{{ person.extraScore !== null ? formatNumber(person.extraScore) : '-' }}</text>
  149. <text class="table-cell score-col" v-if="detailData.orderType == 2 && hasOtherOrQitaInspectionType()">{{ person.totalScore !== null ? formatNumber(person.totalScore) : '-' }}</text>
  150. <!-- 显示奖励得分 -->
  151. <text class="table-cell score-col" v-if="detailData.restartTime !== null">{{ person.runScore !== null ? formatNumber(person.runScore) : '-' }}</text>
  152. <!-- 显示扣分-->
  153. <text class="table-cell score-col" v-if="hasStopScore()">{{ person.stopScore !== null ? formatNumber(person.stopScore) : '-' }}</text>
  154. <!-- <text class="table-cell score-col">{{ person.confirmStatus !== null ? getConfirmStatusText(person.confirmStatus) : '-' }}</text> -->
  155. </view>
  156. </view>
  157. </view>
  158. </scroll-view>
  159. <!-- 加载中状态 -->
  160. <view v-if="loading" class="loading-mask">
  161. <text class="loading-text">加载中...</text>
  162. </view>
  163. </view>
  164. </template>
  165. <script setup lang="uts">
  166. import { ref, reactive } from 'vue'
  167. import { getOrderScoreDetail } from '../../../api/score/index'
  168. import { getDictDataByType } from '@/api/dict/index'
  169. import type { SysDictData } from '@/types/dict'
  170. // 人员得分对象
  171. type ScorePersonItem = {
  172. nickName: string | null
  173. selfScore: number | null
  174. reviewScore: number | null
  175. finalScore: number | null
  176. confirmStatus: number | null
  177. isLeader: number | null
  178. extraScore: number | null
  179. totalScore: number | null
  180. runScore: number | null // 添加奖励得分字段
  181. stopScore: number | null
  182. }
  183. // 详情数据
  184. type DetailDataType = {
  185. orderType: Number
  186. id: Number
  187. workOrderProjectNo: string | null
  188. pcsDeviceName: string | null
  189. pcsStationName: string | null
  190. teamLeaderName: string | null
  191. realEndTime: string | null
  192. scoringStatus: string | null
  193. workSummary: string | null
  194. maintenanceType: string | null
  195. inspectionType: string | null
  196. itemCompletionFactor: number | null
  197. itemCompletionFactorSum: number | null
  198. extraWork: string | null
  199. scoreReturnReason: string | null
  200. restartTime: string | null // 添加重启时间字段,用于控制奖励得分列显示
  201. scorePersonList: ScorePersonItem[]
  202. faultCode: string | null
  203. faultBarcode: string | null
  204. faultDesc: string | null
  205. modifyReason: string | null // 修改理由
  206. }
  207. const detailData = reactive<DetailDataType>({
  208. orderType: 0 as Number,
  209. id: 0 as Number,
  210. workOrderProjectNo: null,
  211. pcsDeviceName: null,
  212. pcsStationName: null,
  213. teamLeaderName: null,
  214. realEndTime: null,
  215. scoringStatus: null,
  216. workSummary: null,
  217. maintenanceType: null,
  218. inspectionType: null,
  219. itemCompletionFactor: null,
  220. itemCompletionFactorSum: null,
  221. extraWork: null,
  222. scoreReturnReason: null,
  223. restartTime: null, // 添加重启时间字段
  224. scorePersonList: [],
  225. faultCode: null,
  226. faultBarcode: null,
  227. faultDesc: null,
  228. modifyReason: null // 修改理由
  229. })
  230. const loading = ref<boolean>(false)
  231. // 字典数据
  232. const scoringStatusDictList = ref<SysDictData[]>([])
  233. const maintenanceTypeDictList = ref<SysDictData[]>([])
  234. const inspectionTypeDictList = ref<SysDictData[]>([])
  235. // 获取工单评分状态字典
  236. const loadScoringStatusDictList = async (): Promise<void> => {
  237. try {
  238. const result = await getDictDataByType('gxt_scoring_status')
  239. const resultObj = result as UTSJSONObject
  240. if (resultObj['code'] == 200) {
  241. const data = resultObj['data'] as any[]
  242. const dictData: SysDictData[] = []
  243. if (data != null && data.length > 0) {
  244. for (let i = 0; i < data.length; i++) {
  245. const item = data[i] as UTSJSONObject
  246. const dictItem: SysDictData = {
  247. dictValue: item['dictValue'] as string | null,
  248. dictLabel: item['dictLabel'] as string | null,
  249. dictCode: null,
  250. dictSort: null,
  251. dictType: null,
  252. cssClass: null,
  253. listClass: null,
  254. isDefault: null,
  255. status: null,
  256. default: null,
  257. createTime: null,
  258. remark: null
  259. }
  260. dictData.push(dictItem)
  261. }
  262. }
  263. scoringStatusDictList.value = dictData
  264. }
  265. } catch (e: any) {
  266. console.error('获取工单评分状态字典失败:', e.message)
  267. }
  268. }
  269. // 获取检修类型字典
  270. const loadMaintenanceTypeDictList = async (): Promise<void> => {
  271. try {
  272. const result = await getDictDataByType('gxt_maintenance_type')
  273. const resultObj = result as UTSJSONObject
  274. if (resultObj['code'] == 200) {
  275. const data = resultObj['data'] as any[]
  276. const dictData: SysDictData[] = []
  277. if (data != null && data.length > 0) {
  278. for (let i = 0; i < data.length; i++) {
  279. const item = data[i] as UTSJSONObject
  280. const dictItem: SysDictData = {
  281. dictValue: item['dictValue'] as string | null,
  282. dictLabel: item['dictLabel'] as string | null,
  283. dictCode: null,
  284. dictSort: null,
  285. dictType: null,
  286. cssClass: null,
  287. listClass: null,
  288. isDefault: null,
  289. status: null,
  290. default: null,
  291. createTime: null,
  292. remark: null
  293. }
  294. dictData.push(dictItem)
  295. }
  296. }
  297. maintenanceTypeDictList.value = dictData
  298. }
  299. } catch (e: any) {
  300. console.error('获取检修类型字典失败:', e.message)
  301. }
  302. }
  303. // 获取维保类型字典
  304. const loadInspectionTypeDictList = async (): Promise<void> => {
  305. try {
  306. const result = await getDictDataByType('gxt_inspection_type')
  307. const resultObj = result as UTSJSONObject
  308. if (resultObj['code'] == 200) {
  309. const data = resultObj['data'] as any[]
  310. const dictData: SysDictData[] = []
  311. if (data != null && data.length > 0) {
  312. for (let i = 0; i < data.length; i++) {
  313. const item = data[i] as UTSJSONObject
  314. const dictItem: SysDictData = {
  315. dictValue: item['dictValue'] as string | null,
  316. dictLabel: item['dictLabel'] as string | null,
  317. dictCode: null,
  318. dictSort: null,
  319. dictType: null,
  320. cssClass: null,
  321. listClass: null,
  322. isDefault: null,
  323. status: null,
  324. default: null,
  325. createTime: null,
  326. remark: null
  327. }
  328. dictData.push(dictItem)
  329. }
  330. }
  331. inspectionTypeDictList.value = dictData
  332. }
  333. } catch (e: any) {
  334. console.error('获取维保类型字典失败:', e.message)
  335. }
  336. }
  337. // 获取工单评分状态文本
  338. const getScoringStatusText = (status: string | null): string => {
  339. if (status == null || status == '') return ''
  340. const dictItem = scoringStatusDictList.value.find(dict => dict.dictValue == status)
  341. return dictItem != null ? (dictItem.dictLabel ?? status) : status
  342. }
  343. // 获取检修类型文本
  344. const getMaintenanceTypeText = (type: string | null): string => {
  345. if (type == null || type == '') return ''
  346. const dictItem = maintenanceTypeDictList.value.find(dict => dict.dictValue == type)
  347. return dictItem != null ? (dictItem.dictLabel ?? type) : type
  348. }
  349. // 获取维保类型文本(处理逗号分隔的多个类型)
  350. const getInspectionTypeText = (type: string | null): string => {
  351. if (type == null || type == '') return ''
  352. // 如果是逗号分隔的多个类型,将其分割并转换为标签
  353. if (type.includes(',')) {
  354. const typeIds = type.split(',')
  355. const labels: string[] = []
  356. for (const typeId of typeIds) {
  357. const dictItem = inspectionTypeDictList.value.find(dict => dict.dictValue == typeId.trim())
  358. labels.push(dictItem != null ? (dictItem.dictLabel ?? typeId) : typeId)
  359. }
  360. return labels.join(', ')
  361. } else {
  362. // 单个类型的情况
  363. const dictItem = inspectionTypeDictList.value.find(dict => dict.dictValue == type)
  364. return dictItem != null ? (dictItem.dictLabel ?? type) : type
  365. }
  366. }
  367. // 获取确认状态文本
  368. const getConfirmStatusText = (status: number | null): string => {
  369. if (status == null) return '未知'
  370. switch (status) {
  371. case 0: return '未确认'
  372. case 1: return '已确认'
  373. case 2: return '已反馈'
  374. default: return '未知状态'
  375. }
  376. }
  377. // Format number to fixed 2 decimal places
  378. const formatNumber = (value: number | string | null): string => {
  379. if (value == null) return '0.00'
  380. // Convert value to string properly to avoid ClassCastException
  381. const stringValue = value.toString()
  382. const num = parseFloat(stringValue)
  383. if (isNaN(num)) return '0.00'
  384. return num.toFixed(2)
  385. }
  386. // 检查维保类型是否包含'其他'或'其它'选项
  387. const hasOtherOrQitaInspectionType = (): boolean => {
  388. // 如果是维保工单且inspectionType不为空
  389. if (detailData.orderType == 2 && detailData.inspectionType != null) {
  390. let inspectionTypes: string[] = [];
  391. // 检查inspectionType是字符串还是数组
  392. if (typeof detailData.inspectionType === 'string') {
  393. if (detailData.inspectionType !== '') {
  394. inspectionTypes = detailData.inspectionType.split(',');
  395. }
  396. } else if (Array.isArray(detailData.inspectionType)) {
  397. // 如果是数组,直接使用
  398. inspectionTypes = detailData.inspectionType as string[];
  399. }
  400. // 遍历维保类型字典,检查是否包含'其他'或'其它'
  401. for (const typeId of inspectionTypes) {
  402. const dictItem = inspectionTypeDictList.value.find(item => item.dictValue == typeId);
  403. if (dictItem != null && dictItem.dictLabel != null) {
  404. const labelName = dictItem.dictLabel.trim();
  405. if (labelName == '其他' || labelName == '其它') {
  406. return true;
  407. }
  408. }
  409. }
  410. }
  411. return false;
  412. }
  413. /** 检查是否存在停运扣分 */
  414. const hasStopScore = (): boolean => {
  415. // 检查当前查看的工单是否存在停运扣分
  416. if (detailData.scorePersonList != null) {
  417. return detailData.scorePersonList.some(person =>
  418. person.stopScore !== null
  419. );
  420. }
  421. return false;
  422. }
  423. // 加载详情数据
  424. const loadDetail = async (id: string, orderType: string): Promise<void> => {
  425. try {
  426. loading.value = true
  427. const result = await getOrderScoreDetail(orderType, id)
  428. // 提取响应数据
  429. const resultObj = result as UTSJSONObject
  430. const code = resultObj.get('code') as number
  431. const data = resultObj.get('data') as UTSJSONObject | null
  432. if (code == 200 && data != null) {
  433. // 填充基本数据
  434. const orderTypeValue = data.get('orderType')
  435. detailData.orderType = (orderTypeValue != null ? (orderTypeValue as number) : 0) as Number
  436. const idValue = data.get('id')
  437. detailData.id = (idValue != null ? (idValue as number) : 0) as Number
  438. detailData.workOrderProjectNo = data.get('workOrderProjectNo') as string | null
  439. detailData.pcsDeviceName = data.get('pcsDeviceName') as string | null
  440. detailData.pcsStationName = data.get('pcsStationName') as string | null
  441. detailData.teamLeaderName = data.get('teamLeaderName') as string | null
  442. detailData.realEndTime = data.get('realEndTime') as string | null
  443. detailData.scoringStatus = data.get('scoringStatus') as string | null
  444. // 根据工单类型设置总结内容
  445. detailData.workSummary = (detailData.orderType == 1 ?
  446. data.get('content') :
  447. data.get('realContent')) as string | null
  448. // 类型信息
  449. detailData.maintenanceType = data.get('maintenanceType') as string | null
  450. detailData.inspectionType = data.get('inspectionType') as string | null
  451. const itemCompletionFactorValue = data.get('itemCompletionFactor')
  452. detailData.itemCompletionFactor = itemCompletionFactorValue != null ?
  453. (itemCompletionFactorValue as number) : null
  454. const itemCompletionFactorSumValue = data.get('itemCompletionFactorSum')
  455. detailData.itemCompletionFactorSum = itemCompletionFactorSumValue != null ?
  456. (itemCompletionFactorSumValue as number) : null
  457. // 根据工单类型设置总结内容
  458. detailData.extraWork = (detailData.orderType == 1 ?
  459. data.get('extraWork') :
  460. null) as string | null
  461. detailData.scoreReturnReason = (detailData.orderType == 1 ?
  462. data.get('scoreReturnReason') :
  463. null) as string | null
  464. // 添加重启时间字段
  465. detailData.restartTime = data.get('restartTime') as string | null
  466. // 人员得分列表
  467. const scorePersonList = (detailData.orderType == 1 ?
  468. data.get('repairOrderPersonList') :
  469. data.get('workOrderPersonList')) as UTSJSONObject[] | null
  470. detailData.faultCode = data.get('faultCode') as string | null
  471. detailData.faultBarcode = data.get('faultBarcode') as string | null
  472. detailData.faultDesc = data.get('faultDesc') as string | null
  473. detailData.modifyReason = data.get('modifyReason') as string | null
  474. if (scorePersonList != null) {
  475. const processedList: ScorePersonItem[] = []
  476. for (let i = 0; i < scorePersonList.length; i++) {
  477. const person = scorePersonList[i]
  478. const item: ScorePersonItem = {
  479. nickName: person.get('nickName') as string | null,
  480. selfScore: (person.get('selfScore') != null ? person.get('selfScore') as number : null),
  481. reviewScore: (person.get('reviewScore') != null ? person.get('reviewScore') as number : null),
  482. finalScore: (person.get('finalScore') != null ? person.get('finalScore') as number : null),
  483. extraScore: (person.get('extraScore') != null ? person.get('extraScore') as number : null),
  484. totalScore: (person.get('totalScore') != null ? person.get('totalScore') as number : null),
  485. // 添加奖励得分字段
  486. runScore: (person.get('runScore') != null ? person.get('runScore') as number : null),
  487. stopScore: (person.get('stopScore') != null ? person.get('stopScore') as number : null),
  488. confirmStatus: (person.get('confirmStatus') != null ? person.get('confirmStatus') as number : null),
  489. isLeader: (person.get('isLeader') != null ? person.get('isLeader') as number : null)
  490. }
  491. processedList.push(item)
  492. }
  493. detailData.scorePersonList = processedList
  494. } else {
  495. detailData.scorePersonList = []
  496. }
  497. } else {
  498. const msg = (resultObj.get('msg') as string | null) ?? '加载失败'
  499. uni.showToast({
  500. title: msg,
  501. icon: 'none'
  502. })
  503. }
  504. } catch (e: any) {
  505. uni.showToast({
  506. title: e.message ?? '加载失败',
  507. icon: 'none'
  508. })
  509. } finally {
  510. loading.value = false
  511. }
  512. }
  513. // 页面加载
  514. onLoad((options: any) => {
  515. const params = options as UTSJSONObject
  516. const id = params.get('id') as string | null
  517. const orderType = params.get('orderType') as string | null
  518. if (id != null && orderType != null) {
  519. loadScoringStatusDictList()
  520. loadMaintenanceTypeDictList()
  521. loadInspectionTypeDictList()
  522. loadDetail(id, orderType)
  523. }
  524. })
  525. </script>
  526. <style lang="scss">
  527. .detail-page {
  528. flex: 1;
  529. background-color: #e8f0f9;
  530. }
  531. .detail-content {
  532. flex: 1;
  533. padding: 20rpx 0;
  534. }
  535. .info-section {
  536. margin: 0 30rpx 24rpx;
  537. .section-title {
  538. position: relative;
  539. padding-left: 20rpx;
  540. margin-bottom: 20rpx;
  541. &::before {
  542. position: absolute;
  543. left: 0;
  544. top: 50%;
  545. transform: translateY(-50%);
  546. width: 8rpx;
  547. height: 32rpx;
  548. background-color: #007aff;
  549. border-radius: 4rpx;
  550. }
  551. &-text {
  552. font-size: 32rpx;
  553. font-weight: bold;
  554. color: #333333;
  555. }
  556. }
  557. .info-card {
  558. background-color: #ffffff;
  559. border-radius: 16rpx;
  560. padding: 30rpx;
  561. .info-item {
  562. flex-direction: row;
  563. padding: 20rpx 0;
  564. border-bottom: 1rpx solid #f0f0f0;
  565. &:last-child {
  566. border-bottom: none;
  567. }
  568. .info-label {
  569. width: 240rpx;
  570. font-size: 28rpx;
  571. color: #666666;
  572. white-space: nowrap;
  573. }
  574. .info-value {
  575. flex: 1;
  576. font-size: 28rpx;
  577. color: #333333;
  578. text-align: right;
  579. }
  580. }
  581. .summary-content {
  582. .summary-text {
  583. font-size: 28rpx;
  584. color: #333333;
  585. line-height: 44rpx;
  586. }
  587. }
  588. /* 表格样式 */
  589. .table-header, .table-row {
  590. flex-direction: row;
  591. padding: 20rpx 0;
  592. border-bottom: 1rpx solid #f0f0f0;
  593. &:last-child {
  594. border-bottom: none;
  595. }
  596. }
  597. .table-header {
  598. background-color: #f8f8f8;
  599. font-weight: bold;
  600. }
  601. .table-cell {
  602. font-size: 26rpx;
  603. color: #333;
  604. text-align: center;
  605. &.name-col {
  606. flex: 2;
  607. text-align: left;
  608. }
  609. &.score-col {
  610. flex: 1;
  611. }
  612. &.status-col {
  613. flex: 1;
  614. }
  615. }
  616. }
  617. }
  618. .loading-mask {
  619. position: absolute;
  620. top: 0;
  621. left: 0;
  622. right: 0;
  623. bottom: 0;
  624. justify-content: center;
  625. align-items: center;
  626. background-color: rgba(0, 0, 0, 0.3);
  627. .loading-text {
  628. padding: 30rpx 60rpx;
  629. background-color: rgba(0, 0, 0, 0.7);
  630. color: #ffffff;
  631. font-size: 28rpx;
  632. border-radius: 12rpx;
  633. }
  634. }
  635. </style>