StatusOperationPanel.vue 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833
  1. <template>
  2. <div class="container-panel">
  3. <el-row class="info-panel">
  4. <div class="info-item">
  5. <span class="label">报告编号:</span>
  6. <span class="value">{{ selectedItem?.reportNo || '-' }}</span>
  7. </div>
  8. <div class="info-item" style="margin: 0 auto;" v-if="isShowRecordOrReportBtn">
  9. <!-- <el-switch-->
  10. <!-- v-model="isShowReportPdf"-->
  11. <!-- active-text="报告"-->
  12. <!-- inactive-text="记录"-->
  13. <!-- @change="handleChangeShowReportPdf"-->
  14. <!-- />-->
  15. <!-- <el-radio-group v-model="showReportPdfType" @change="handleChangeShowReportPdf">-->
  16. <!-- <el-radio-button label="record">记录</el-radio-button>-->
  17. <!-- <el-radio-button label="report">报告</el-radio-button>-->
  18. <!-- <el-radio-button label="result" v-if="selectedItem?.reportType === 100">结论报告</el-radio-button>-->
  19. <!-- </el-radio-group>-->
  20. <div class="capsule-tabs">
  21. <div
  22. class="tab-item"
  23. :class="{ active: showReportPdfType === 'record' }"
  24. @click="handleChangeShowReportPdf('record')"
  25. v-if="hasRecord"
  26. >
  27. <span>记录</span>
  28. </div>
  29. <div
  30. class="tab-item"
  31. :class="{ active: showReportPdfType === 'report' }"
  32. @click="handleChangeShowReportPdf('report')"
  33. >
  34. <span>报告</span>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="info-item" style="margin: 0 auto;">
  39. <span class="label">检验项目:</span>
  40. <span class="value" :title="selectedItem?.reportName || '-'">{{
  41. selectedItem?.reportName || '-'
  42. }}</span>
  43. </div>
  44. <div v-if="selectedItem?.reportType === 300">
  45. <span>{{ selectedItem.instructionId ? '已' : '未'}}关联操作指导书</span>
  46. <el-button
  47. type="primary"
  48. size="small"
  49. link
  50. class="edit-checker-btn"
  51. @click="handleShowAssociationOperationManual"
  52. >
  53. <Icon icon="ep:edit" />
  54. </el-button>
  55. </div>
  56. <div class="info-item" style="flex-basis: 300px; text-align: end;">
  57. <span class="label">{{ selectedItem?.reportType === 100 ? '主检人' : '检验员' }}:</span>
  58. <span
  59. class="value"
  60. :title="
  61. selectedItem?.reportType === 100
  62. ? taskOrderItem?.mainCheckerUser?.nickname || '-'
  63. : getCheckersName()
  64. "
  65. >{{
  66. selectedItem?.reportType === 100
  67. ? taskOrderItem?.mainCheckerUser?.nickname || '-'
  68. : getCheckersName()
  69. }}</span
  70. >
  71. <el-button
  72. v-if="!isAuditMode"
  73. type="primary"
  74. size="small"
  75. link
  76. class="edit-checker-btn"
  77. @click="
  78. () =>
  79. selectedItem?.reportType === 100 ? handleModifyMainChecker() : handleModifyChecker()
  80. "
  81. :disabled="(selectedItem?.reportType === 100)
  82. || (selectedItem?.checkUsers?.length > 0 && selectedItem?.checkUsers?.[0]?.id !== userStore?.user?.id && taskOrderItem?.mainCheckerUser?.id !== userStore?.user?.id)
  83. || isCompleteInput"
  84. >
  85. <!-- 主报告:登录用户为主检人的时,才可以修改主检人 -->
  86. <!-- 子报告:登录用户为检验员或主检人的时候,才可以修改检验员 -->
  87. <Icon icon="ep:edit" />
  88. </el-button>
  89. </div>
  90. </el-row>
  91. <el-row class="status-operation-panel">
  92. <!-- 未选择任何项目时的提示 -->
  93. <div v-if="!selectedItem" class="no-selection">
  94. <el-empty description="请选择一个检验项目查看详情" :image-size="100" />
  95. </div>
  96. <!-- 选择单个项目时显示详情操作 -->
  97. <div v-else class="single-item-panel">
  98. <!--
  99. 1、重大问题线索告知表
  100. 2、作业指导书
  101. 3、检验方案
  102. 以上报告类型不显示做进度栏目
  103. -->
  104. <InspectionItemProgress
  105. v-if="!onlyShowPdf"
  106. :selected-item="selectedItem"
  107. :task-info="taskInfo"
  108. :is-audit-mode="isAuditMode"
  109. @modify-checker="handleModifyChecker"
  110. />
  111. <!-- <div class="pdf-panel" :style="{ maxWidth: !onlyShowPdf ? '1200px' : 'unset' }"> -->
  112. <div ref="pdfPanelRef" class="pdf-panel" >
  113. <!-- PDF预览区域 -->
  114. <div class="!h-full" :style="{ width: pdfContentWidth + 'px'}">
  115. <SpreadViewer :initData="initData" ref="spreadRef" isFullscreen @saveSuccess="saveSuccess"/>
  116. </div>
  117. </div>
  118. <!--
  119. 1、重大问题线索告知表
  120. 2、作业指导书
  121. 3、检验方案
  122. 以上报告类型不显示右侧栏目
  123. -->
  124. <template v-if="showCheckBook && getReportStatusEnd">
  125. <div class="right-panel-container">
  126. <!-- 收缩展开按钮 -->
  127. <div class="toggle-btn" @click="togglePanel" :class="{ 'collapsed': !isExpanded }">
  128. <el-icon>
  129. <Back v-if="!isExpanded" />
  130. <Right v-else />
  131. </el-icon>
  132. </div>
  133. <div class="operation-panel" :class="{ 'expanded': isExpanded, 'collapsed': !isExpanded }">
  134. <div class="operation-inner custom-inner">
  135. <template v-if="checkBookDetail.rectificationStatus === 2">
  136. <div class="operation-item">
  137. <div class="item-header"> 回退原因 </div>
  138. <div class="item-content">
  139. <el-form
  140. ref="returnFormRef"
  141. :model="returnForm"
  142. :rules="returnFormRules"
  143. label-position="right"
  144. label-width="80px"
  145. >
  146. <el-form-item label="回退原因" prop="rejectionReason">
  147. <el-input
  148. v-model="returnForm.rejectionReason"
  149. type="textarea"
  150. :rows="5"
  151. maxlength="100"
  152. placeholder="请输入回退原因"
  153. />
  154. </el-form-item>
  155. </el-form>
  156. </div>
  157. </div>
  158. </template>
  159. <div class="operation-item1">
  160. <div class="item-header"> 处理人信息 </div>
  161. <div class="item-content">
  162. <div class="item-content-item">
  163. <span class="item-content-item-label">联系人姓名:</span>
  164. <span class="item-content-item-value">{{ checkBookDetail?.recipient || '-' }}</span>
  165. </div>
  166. <div class="item-content-item">
  167. <span class="item-content-item-label">联系人电话:</span>
  168. <span class="item-content-item-value">{{ checkBookDetail?.recipientPhone || '-'}}</span>
  169. </div>
  170. <div class="item-content-item">
  171. <span class="item-content-item-label">当前状态:</span>
  172. <span class="item-content-item-value">{{
  173. rectificationStatusMap[checkBookDetail?.rectificationStatus] || '-'
  174. }}</span>
  175. </div>
  176. </div>
  177. </div>
  178. <div class="operation-item1 videoAndImg">
  179. <div class="item-header"> 整改材料 </div>
  180. <div class="item-content1">
  181. <div class="item-content1-item">图片:</div>
  182. <div class="item-content1-img">
  183. <template
  184. v-for="(path, index) in checkBookDetail.rectificationImage?.split(',') || []"
  185. :key="index"
  186. >
  187. <div class="item-content1-img-item">
  188. <img class="img-item" :src="buildFileUrl(path)" alt="" @click="handlePreview(buildFileUrl(path), 'image')" />
  189. <div class="list-item-tool">
  190. <el-icon class="icon" @click="() => handlePreview(buildFileUrl(path), 'image')"><View /></el-icon>
  191. </div>
  192. </div>
  193. </template>
  194. </div>
  195. </div>
  196. <div class="item-content1">
  197. <div class="item-content1-item">视频:</div>
  198. <div class="item-content1-img">
  199. <template
  200. v-for="(path, index) in checkBookDetail.rectificationVideo?.split(',') || []"
  201. :key="index"
  202. >
  203. <div class="item-content1-img-item">
  204. <video class="img-item" :src="buildFileUrl(path)" alt="" @click="handlePreview(buildFileUrl(path), 'video')"></video>
  205. <!-- 视频播放按钮 -->
  206. <div class="list-item-tool">
  207. <el-icon class="icon" @click="() => handlePreview(buildFileUrl(path), 'video')"><View /></el-icon>
  208. </div>
  209. </div>
  210. </template>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </template>
  218. <template v-else>
  219. <div class="right-panel-container">
  220. <!-- 收缩展开按钮 -->
  221. <div class="toggle-btn" @click="togglePanel" :class="{ 'collapsed': !isExpanded }" v-if="!onlyShowPdf">
  222. <el-icon>
  223. <Back v-if="!isExpanded" />
  224. <Right v-else />
  225. </el-icon>
  226. </div>
  227. <div class="operation-panel" :class="{ 'expanded': isExpanded, 'collapsed': !isExpanded }" v-if="!onlyShowPdf">
  228. <div class="operation-inner">
  229. <!-- 流转记录 -->
  230. <div class="operation-item">
  231. <div class="item-header"> 流转记录 </div>
  232. <div class="item-content">
  233. <el-empty
  234. v-if="!recordList.length"
  235. description="暂无流转记录"
  236. :image-size="120"
  237. />
  238. <div class="record-item" v-for="record in recordList" :key="record.id">
  239. <div class="record-item-title">{{ PressureReportType['SUGGUESTION'] === props.selectedItem?.reportType ? record.processName : PressureCheckerMyTaskStatusMap[record.process]
  240. }}</div>
  241. <div class="record-item-inner">
  242. <div class="content">
  243. <span>{{ record.createUser.nickname }}</span>
  244. <el-button
  245. :type="
  246. OAApprovalResultType[record.result] ||
  247. (record.result === 100
  248. ? 'success'
  249. : record.result === 200
  250. ? 'danger'
  251. : 'default')
  252. "
  253. round
  254. size="small"
  255. >{{
  256. OAApprovalResultMap[record.result] ||
  257. (record.result === 100
  258. ? '通过'
  259. : record.result === 200
  260. ? '拒绝'
  261. : record.result || '-')
  262. }}</el-button
  263. >
  264. <span class="time">{{
  265. !record.createTime
  266. ? '-'
  267. : dayjs(record.createTime).format('YYYY-MM-DD HH:mm:ss')
  268. }}</span>
  269. </div>
  270. <p class="desc">
  271. <span>描述</span>
  272. {{ record.remark && record.remark.trim() !== '' ? record.remark : '-' }}
  273. </p>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. <!-- 智能纠错 -->
  279. <div class="operation-item">
  280. <div class="item-header"> 智能纠错 </div>
  281. <div class="item-content">
  282. <el-empty
  283. v-if="!checkInputList.length"
  284. description="暂无纠错内容"
  285. :image-size="120"
  286. />
  287. <div class="error-item" v-for="input in checkInputList" :key="input.code">
  288. <el-icon color="#E0534E" :size="20"><InfoFilled /></el-icon>
  289. {{ input.code }}:{{ input.name }}
  290. </div>
  291. </div>
  292. </div>
  293. <!-- 历史版本 -->
  294. <div class="operation-item">
  295. <div class="item-header"> 历史版本 </div>
  296. <div class="item-content" v-if="historyList.length">
  297. <!-- <template> -->
  298. <div class="history-item" v-for="item in historyList" :key="item.id">
  299. <div class="history-title">{{ item.versionNoStr || '-' }}号版本</div>
  300. <p
  301. >修改原因:<span>{{ item.modifiedReason || '人工修改' }}</span></p
  302. >
  303. <div class="history-footer">
  304. <span class="name">{{ item.creatorName || '-' }}</span>
  305. <span class="time"
  306. >修改于{{
  307. dayjs(item.updateTime).format('YYYY-MM-DD HH:mm:ss') || '-'
  308. }}</span
  309. >
  310. </div>
  311. <div class="my-2">
  312. <el-button type="primary" link @click="handleShowVersionInfo(item)"
  313. >查看详情</el-button
  314. >
  315. <el-button v-if="!checkerIsLoginUser" type="primary" link @click="restoreVersion(item)"
  316. >恢复版本</el-button
  317. >
  318. </div>
  319. </div>
  320. <!-- </template> -->
  321. </div>
  322. <template v-else>
  323. <el-empty description="暂无历史版本" :image-size="120" />
  324. </template>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. </template>
  330. </div>
  331. <!-- 审批人选择对话框 -->
  332. <AuditUserDialog
  333. v-if="isShowApprovalDialog"
  334. v-model="isShowApprovalDialog"
  335. :apiFn="getPipeRecheckUserList"
  336. title="请选择审批人"
  337. selectedAlertText="已选择审批人"
  338. width="700px"
  339. :columns="[
  340. {
  341. type: 'selection',
  342. fieldProps: {
  343. reserveSelection: true
  344. }
  345. },
  346. {
  347. label: '姓名',
  348. prop: 'nickname',
  349. search: {
  350. type: 'input',
  351. span: 12,
  352. prop: 'nickName'
  353. }
  354. },
  355. {
  356. label: '部门',
  357. prop: 'deptName',
  358. search: {
  359. type: 'input',
  360. span: 12
  361. }
  362. }
  363. ]"
  364. @confirm="handleApprovalSelectConfirm"
  365. />
  366. <Dialog
  367. v-model="isShowAuditDialog"
  368. width="400"
  369. :title="schemaFlag == 'proofread' ? '请选择校核人' : '请选择审核人'"
  370. >
  371. <CustomLargeListSelect
  372. v-model="form.recheckUser"
  373. :fetchFunc="getPipeRecheckUserList"
  374. label-key="nickname"
  375. value-key="id"
  376. searchKeyProp="nickName"
  377. @change="handleChangeEntrustUnit"
  378. />
  379. <template #footer>
  380. <el-button type="primary" @click="handleAuditSelectConfirm" :loading="submitting">保 存</el-button>
  381. <el-button @click="isShowAuditDialog = false">取 消</el-button>
  382. </template>
  383. </Dialog>
  384. <!-- 批量提交校核 -->
  385. <Dialog
  386. v-model="showBatchSubmitToRecheckDialog"
  387. width="400"
  388. title="批量提交校核"
  389. >
  390. <el-form ref="batchRecheckFormRef" :model="batchRecheckForm" :rules="batchRecheckFormRules" label-width="80px">
  391. <el-form-item label="提交记录" prop="reportIds">
  392. <el-select
  393. v-model="batchRecheckForm.reportIds"
  394. multiple
  395. clearable
  396. placeholder="请选择报告"
  397. >
  398. <el-option
  399. v-for="item in getCanSubmitRecheckReport"
  400. :key="item.id"
  401. :value="item.id"
  402. :label="item.reportName"
  403. />
  404. </el-select>
  405. </el-form-item>
  406. <el-form-item label="校核人" prop="recheckUser">
  407. <CustomLargeListSelect
  408. v-model="batchRecheckForm.recheckUser"
  409. :fetchFunc="getPipeRecheckUserList"
  410. label-key="nickname"
  411. value-key="id"
  412. searchKeyProp="nickName"
  413. @change="handleChangeEntrustUnit"
  414. placeholder="请选择校核人"
  415. />
  416. </el-form-item>
  417. <el-form-item label="">
  418. <span style="font-size: 13px; white-space: nowrap; margin-top: -16px; color: #999;">
  419. 您已完成{{getCanSubmitRecheckReport.length}}份记录录入,可以进行批量提交校核
  420. </span>
  421. </el-form-item>
  422. </el-form>
  423. <template #footer>
  424. <el-button type="primary" @click="handleBatchSubmitToRecheck">提 交</el-button>
  425. <el-button @click="showBatchSubmitToRecheckDialog = false">取 消</el-button>
  426. </template>
  427. </Dialog>
  428. <!-- 校核人选择对话框 暂时作废
  429. -->
  430. <!-- <AuditUserDialog
  431. v-if="isShowAuditDialog"
  432. v-model="isShowAuditDialog"
  433. :apiFn="getUserList"
  434. title="请选择校核人"
  435. selectedAlertText="已选择校核人"
  436. width="700px"
  437. :pageType="0"
  438. :columns="[
  439. {
  440. type: 'selection',
  441. fieldProps: {
  442. reserveSelection: true
  443. }
  444. },
  445. {
  446. label: '姓名',
  447. prop: 'nickname',
  448. search: {
  449. type: 'input',
  450. span: 12,
  451. prop: 'nickName'
  452. }
  453. },
  454. {
  455. label: '部门',
  456. prop: 'deptName',
  457. search: {
  458. type: 'input',
  459. span: 12
  460. }
  461. }
  462. ]"
  463. @confirm="handleAuditSelectConfirm"
  464. /> -->
  465. <!-- 报告审核人选择对话框 -->
  466. <AuditUserDialog
  467. v-if="isShowReportAuditDialog"
  468. v-model="isShowReportAuditDialog"
  469. :apiFn="getPipeRecheckUserList"
  470. title="请选择审核人"
  471. selectedAlertText="已选择审核人"
  472. width="700px"
  473. :columns="[
  474. {
  475. type: 'selection',
  476. fieldProps: {
  477. reserveSelection: true
  478. }
  479. },
  480. {
  481. label: '姓名',
  482. prop: 'nickname',
  483. search: {
  484. type: 'input',
  485. span: 12,
  486. prop: 'nickName'
  487. }
  488. },
  489. {
  490. label: '部门',
  491. prop: 'deptName',
  492. search: {
  493. type: 'input',
  494. span: 12
  495. }
  496. }
  497. ]"
  498. @confirm="handleReportAuditSelectConfirm"
  499. />
  500. </el-row>
  501. <!-- 检验结果录入-葡萄城模板 -->
  502. <InlineInspectionResultInput
  503. v-if="showInlineInspectionResultInput"
  504. v-model:visible="showInlineInspectionResultInput"
  505. :template-params="inspectionResultTemplateParams"
  506. @confirm="handleInspectionResultConfirm"
  507. @cancel="handleReturnToNormalMode"
  508. />
  509. <!-- 检验录入-模板 -->
  510. <!-- <InlineEditCheckRecord-->
  511. <!-- v-if="showInlineEditCheckRecord"-->
  512. <!-- :templateId="templateId"-->
  513. <!-- v-model:visible="showInlineEditCheckRecord"-->
  514. <!-- :report-list="reportList"-->
  515. <!-- :task-order-item="taskOrderItem"-->
  516. <!-- :template-params="templateParams"-->
  517. <!-- @confirm="handleTemplateConfirm"-->
  518. <!-- @cancel="handleRefresh"-->
  519. <!-- />-->
  520. <!-- 检验录入-模板 -->
  521. <CustomDialog v-model="showInlineEditCheckRecord" :show-footer="false" fullscreen :show-close="false">
  522. <SpreadViewer :initData="editData" ref="editSpreadRecordRef" @saveSuccess="saveSuccessRecord" @close="handleClose">
  523. <template #title>
  524. <div style="font-size: 20px; ">检测录入</div>
  525. </template>
  526. </SpreadViewer>
  527. </CustomDialog>
  528. <!-- 报告编制 - 模板 -->
  529. <!-- <InlineReportEdit-->
  530. <!-- v-if="showInlineReportEdit"-->
  531. <!-- v-model:visible="showInlineReportEdit"-->
  532. <!-- :template-params="templateParams"-->
  533. <!-- :report-list="reportList || []"-->
  534. <!-- :report-type="showReportPdfType"-->
  535. <!-- @confirm="handleTemplateConfirm"-->
  536. <!-- @cancel="handleRefresh"-->
  537. <!-- @refresh="()=>{refreshPdf = !refreshPdf}"-->
  538. <!-- />-->
  539. <!-- 报告编制 - 模板 -->
  540. <CustomDialog v-model="showInlineReportEdit" :show-footer="false" fullscreen :show-close="false">
  541. <SpreadViewer :initData="editData" ref="editSpreadReportRef" @saveSuccess="saveSuccessReport" @close="handleClose">
  542. <template #title>
  543. <div style="font-size: 20px; ">报告编制</div>
  544. </template>
  545. </SpreadViewer>
  546. </CustomDialog>
  547. <!-- 修改主检人弹窗 -->
  548. <UserSelectForm ref="userSelectFormRef" @confirm="handleUserSelect" :single="true" />
  549. <CustomDialog v-model="showReportDialog" :show-footer="false" width="1000px">
  550. <!-- <VuePdfEmbed
  551. v-loading="pdfLoading"
  552. :height="500"
  553. :width="968"
  554. :source="reportSource"
  555. @rendered="handlePdfRendered"
  556. />-->
  557. <SpreadViewer :initData="reportInitData" ref="reportSpreadRef" />
  558. </CustomDialog>
  559. <!-- 查看版本详情的弹窗 -->
  560. <CustomDialog v-model="showVersionDetail" title="查看详情" :show-footer="false" width="1000px">
  561. <SmartTable
  562. v-model:columns="versionColumns"
  563. :buttons="versionDetailButtons"
  564. :data="versionDataCompareList"
  565. :is-pagination="false"
  566. :show-refresh="false"
  567. />
  568. </CustomDialog>
  569. <!-- 图片预览对话框 -->
  570. <el-dialog
  571. v-model="previewVisible"
  572. class="preview-dialog"
  573. title="Warning"
  574. width="500"
  575. :show-footer="false"
  576. :show-close="false"
  577. align-center
  578. >
  579. <div class="preview-container">
  580. <video class="preview-video" v-if="previewType === 'video'" :src="previewUrl" auto-play controls></video>
  581. <img class="preview-image" v-else :src="previewUrl" />
  582. </div>
  583. </el-dialog>
  584. <dialog ref="previewDialogRef"></dialog >
  585. <ReportListUploadModal
  586. ref="reportListUploadModalRef"
  587. :selectedItem="selectedItem"
  588. :reportList="reportList"
  589. @confirm="handleRefresh"
  590. />
  591. </div>
  592. <!-- 新加 -->
  593. <Teleport v-if="teleportBtnRef" to=".teleport-btn">
  594. <div class="operation-btns">
  595. <!-- 报告办结后,这部分按钮不再显示 -->
  596. <template v-if="!getReportStatusEnd && selectedItem">
  597. <!-- 根据报告类型和配置显示相应按钮 -->
  598. <template
  599. v-if="
  600. selectedItem.reportType === PressureReportType.SINGLE &&
  601. 'PipeCheckerTaskDetail' === routeName
  602. "
  603. >
  604. <!-- 独审报告根据配置显示按钮 -->
  605. <el-button
  606. v-if="currentReportConfig?.isApproval && isCanSubmitToAudit"
  607. type="danger"
  608. @click="handleSubmitAudit"
  609. :disabled="checkerIsLoginUser"
  610. size="small"
  611. >
  612. 提交报告审核
  613. </el-button>
  614. <!-- 没有审核只有审批 -->
  615. <el-button
  616. v-if="
  617. currentReportConfig?.isRatify &&
  618. !currentReportConfig?.isApproval &&
  619. isCanSubmitToAudit
  620. "
  621. type="danger"
  622. @click="handleApprovalSelectConfirm"
  623. :disabled="checkerIsLoginUser"
  624. size="small"
  625. >
  626. 提交报告审批
  627. </el-button>
  628. </template>
  629. <!-- 非独审报告默认显示审核按钮 -->
  630. <el-button
  631. v-if="
  632. selectedItem.reportType !== PressureReportType.SUB &&
  633. selectedItem.reportType !== PressureReportType.SINGLE &&
  634. isCanSubmitToAudit &&
  635. 'PipeCheckerTaskDetail' === routeName
  636. "
  637. type="danger"
  638. @click="handleSubmitAudit"
  639. :disabled="checkerIsLoginUser"
  640. size="small"
  641. >
  642. {{ selectedItem.reportType === PressureReportType['SUGGUESTION'] ? '提交审核' : '提交报告审核' }}
  643. </el-button>
  644. <el-button
  645. v-if="selectedItem.reportType === PressureReportType.SUB && selectedItem.taskStatus == PressureCheckerMyTaskStatus.REPORT_INPUT "
  646. type="danger"
  647. @click="handleCompletion"
  648. :disabled="checkerIsLoginUser"
  649. size="small"
  650. >
  651. 报告办结
  652. </el-button>
  653. <el-button type="primary" size="small" plain v-if="isCanEditReport" @click="handleEditRreport" :disabled="checkerIsLoginUser"
  654. >编制报告</el-button>
  655. <el-button v-if="isCanSubmitRecheck" type="primary" @click="handleSelectVerfiyer" :disabled="checkerIsLoginUser" size="small"
  656. >提交校核</el-button>
  657. <el-button
  658. type="primary"
  659. v-if="isCanEditTestRecord"
  660. plain
  661. @click="handleEditSpreadRecord"
  662. :disabled="checkerIsLoginUser"
  663. size="small"
  664. >{{ selectedItem.reportType === PressureReportType['SUGGUESTION'] ? '编制意见书' : '填写记录' }}</el-button>
  665. <!-- 撤销流程:报告审核或审批阶段,有OA流程ID且当前用户是发起人时显示 -->
  666. <el-button
  667. v-if="isCanCancelFlow"
  668. type="warning"
  669. @click="handleCancelFlow"
  670. size="small"
  671. >撤销流程</el-button>
  672. <!-- OA审核:报告审核或审批阶段,有OA流程ID时显示 -->
  673. <el-button
  674. v-if="isCanOAAudit"
  675. type="success"
  676. @click="handleOpenOAAudit"
  677. size="small"
  678. >OA审核</el-button>
  679. <!-- <el-button v-if="isCanSyncReportData" type="primary" @click="handleSyncReportData" :disabled="checkerIsLoginUser" size="small"-->
  680. <!-- >同步报表</el-button>-->
  681. </template>
  682. </div>
  683. </Teleport>
  684. <AssociationOperationManual
  685. v-if="showAssociationOperationManual"
  686. :selectedItem="selectedItem"
  687. :reportList="reportList"
  688. :equipCode="props.taskOrderItem?.equipCode"
  689. @close="()=>{
  690. showAssociationOperationManual = false
  691. handleRefresh()
  692. }"
  693. />
  694. </template>
  695. <script setup lang="tsx">
  696. import SmartTable from '@/components/SmartTable/SmartTable'
  697. import {computed, defineAsyncComponent, nextTick, ref, watch} from 'vue'
  698. import {useRoute} from 'vue-router'
  699. import { InfoFilled, View, Back, Right, WarningFilled } from '@element-plus/icons-vue'
  700. import {dayjs, ElMessage, ElMessageBox} from 'element-plus'
  701. import * as UserApi from '@/api/system/user'
  702. import {
  703. PressureCheckerMyTaskStatus,
  704. PressureCheckerMyTaskStatusMap,
  705. PressureReportType,
  706. PressureTaskOrderTaskStatus,
  707. } from '@/utils/constants'
  708. import { OAApprovalResultMap, OAApprovalResultType } from '@/utils/pressure2/oaConstants'
  709. import type {
  710. PipeTaskOrderDetailVO,
  711. PipeTaskOrderOrderItemVO,
  712. ReportItemVO
  713. } from '@/api/pressure2/pipetaskorder'
  714. import {PipeTaskOrderApi} from '@/api/pressure2/pipetaskorder'
  715. import InspectionItemProgress from './InspectionItemProgress.vue'
  716. import InlineInspectionResultInput from './InlineInspectionResultInput.vue'
  717. import UserSelectForm from '@/components/UserSelectForm/index.vue'
  718. import {reportInfoApi} from '@/api/reportInfoService'
  719. import {buildFileUrl} from '@/utils'
  720. import {useUserStore} from '@/store/modules/user'
  721. import {is} from '@/utils/is'
  722. import _ from 'lodash'
  723. import {uploadFile} from '@/api/common/index'
  724. import ReportListUploadModal from './reportListUploadModal.vue'
  725. import AssociationOperationManual from './AssociationOperationManual.vue'
  726. import {SpreadViewer} from "@/components/DynamicReport";
  727. import {InitParams} from "@/components/DynamicReport/SpreadInterface";
  728. import { cloneDeep, debounce } from 'lodash-es'
  729. import {BoilerTaskOrderApi} from "@/api/pressure2/boilertaskorder";
  730. const CustomDialog = defineAsyncComponent(() => import('@/components/CustomDialog/index.vue'))
  731. const AuditUserDialog = defineAsyncComponent(
  732. () => import('@/views/Functional/components/AuditUserDialog.vue')
  733. )
  734. interface Props {
  735. selectedItem: ReportItemVO | null
  736. taskInfo: PipeTaskOrderDetailVO | null
  737. taskOrderItem: PipeTaskOrderOrderItemVO
  738. isAuditMode?: boolean
  739. reportId?: string | null
  740. reportList?: ReportItemVO[]
  741. taskId: string
  742. teleportBtnRef: Ref<HTMLDivElement | null>
  743. isFullscreen?: boolean
  744. }
  745. interface Emits {
  746. (e: 'refresh'): void
  747. (e: 'template-confirm', templateUrl?: string): void
  748. (e: 'modify-checker', item: ReportItemVO): void
  749. (e: 'submit-approval'): void
  750. (e: 'reject'): void
  751. (e: 'cancel'): void
  752. (e: 'submit-ratify'): void
  753. (e: 'update:selected-item', item: ReportItemVO): void
  754. (e: 'item-select', item: ReportItemVO): void
  755. }
  756. const props = defineProps<Props>()
  757. const emit = defineEmits<Emits>()
  758. const route = useRoute()
  759. const userStore = useUserStore()
  760. const schemaFlag = ref<string | null>(null) //等于proofread = 校核 audit=审核
  761. // 获取当前的路由Name
  762. const routeName = computed(() => route.name)
  763. const form = ref<Record<string, any>>({
  764. recheckUser: {}
  765. })
  766. const refreshPdf = ref(true)
  767. // 视图模式状态管理
  768. const viewMode = ref<'normal' | 'inspection-result'>('normal')
  769. // 批量提交的表单
  770. const batchRecheckForm = ref({
  771. reportIds: [],
  772. recheckUser: {}
  773. })
  774. const batchRecheckFormRules = {
  775. reportIds: [{required: true, message: '请选择提交记录', trigger: 'change'}],
  776. recheckUser: [{required: true, message: '请选择校核人', trigger: 'change'}]
  777. }
  778. // 格式化记录结果状态显示
  779. const formatRecordResult = (record) => {
  780. const resultMap = {
  781. 100: '通过',
  782. 200: '拒绝',
  783. 300: '已阅',
  784. 400: '同意',
  785. 500: '不同意'
  786. }
  787. return resultMap[record.result] || record.result || '-'
  788. }
  789. // 获取记录结果的按钮类型
  790. const getRecordResultButtonType = (record) => {
  791. if ([100, 300, 400].includes(record.result)) {
  792. return 'success'
  793. } else if ([200, 500].includes(record.result)) {
  794. return 'danger'
  795. } else {
  796. return 'default'
  797. }
  798. }
  799. const spreadRef=ref();
  800. const reportSpreadRef=ref();
  801. const initData=ref<InitParams>(
  802. {
  803. templateId: '',
  804. refId: '',
  805. refName:'',
  806. insId:'',
  807. opType: 0, // 0:excel,1: pdf
  808. manualUrl: '',
  809. });
  810. const reportInitData=ref<InitParams>(
  811. {
  812. templateId: '',
  813. refId: '',
  814. refName:'',
  815. insId:'',
  816. opType: 1, // 0:excel,1: pdf
  817. });
  818. const editSpreadRecordRef=ref();
  819. const editSpreadReportRef=ref();
  820. const editData=ref<InitParams>(
  821. {
  822. templateId: '',
  823. refId: '',
  824. refName:'',
  825. insId:'',
  826. opType: 0, // 0:excel,1: pdf
  827. });
  828. const batchRecheckFormRef = ref()
  829. // const isShowReportPdf = ref([PressureCheckerMyTaskStatus.REPORT_INPUT,PressureCheckerMyTaskStatus.REPORT_AUDIT,PressureCheckerMyTaskStatus.REPORT_APPROVE,PressureCheckerMyTaskStatus.REPORT_END].includes(props.selectedItem.taskStatus)
  830. // && ![400,500,600,700].includes(props.selectedItem.reportType))
  831. const showReportPdfType = ref('record')
  832. const refreshPdfFlag = ref(true)
  833. const hasRecord = ref(false)
  834. // 获取可以批量提交的报告
  835. const getCanSubmitRecheckReport = computed(() => {
  836. if(!props.reportList || !props.reportList.length) return []
  837. return props.reportList.filter((report: any) => {
  838. // 主报告、子报告、独审报告才有记录校核
  839. const reportTypes = [PressureReportType['SUB'], PressureReportType['SINGLE']]
  840. const status = PressureTaskOrderTaskStatus['RECORD_INPUT'] // 记录录入状态
  841. // report.reportUrl 已经录入数据
  842. // if(report.taskStatus !== status || !report.reportUrl) return false
  843. if(report.taskStatus !== status) return false
  844. else if(report.reportType === PressureReportType['MAIN'] && userStore.user.id === props.taskOrderItem?.mainCheckerUser?.id) return true
  845. else
  846. return reportTypes.includes(report.reportType) && (report.checkUsers?.[0]?.id === userStore.user.id || !report.checkUsers || !report.checkUsers.length)
  847. // 过滤掉主报告存在未办结检验意见通知书时
  848. }).filter((report: any) => {
  849. if(report.reportType !== PressureReportType['MAIN']){
  850. return true
  851. }
  852. const sugguestionReport = props.reportList?.find(x => x.reportType === PressureReportType['SUGGUESTION'])
  853. // 不存在检验意见通知书返回true
  854. if(!sugguestionReport) return true
  855. // 检验意见通知书已办结,返回true
  856. return sugguestionReport.taskStatus === PressureCheckerMyTaskStatus['REPORT_END'];
  857. })
  858. })
  859. // 当意见通知书未办结时,主报告不能流转到后续流程(提交校核)
  860. const canSubmitMainReportType = (tipsText: string)=>{
  861. // 不是主报告,直接返回true
  862. if(PressureReportType.MAIN !== props?.selectedItem?.reportType) return true
  863. // 判断检验意见通知书的状态
  864. const report = props.reportList?.find(x => x.reportType === PressureReportType['SUGGUESTION'])
  865. console.log('检验意见通知书', report)
  866. // 不存在检验意见通知书返回true
  867. if(!report) return true
  868. // 检验意见通知书已办结,返回true
  869. if(report.taskStatus === PressureCheckerMyTaskStatus['REPORT_END']) return true
  870. ElMessageBox.alert(tipsText, '提示', {
  871. showCancelButton: false,
  872. confirmButtonText: '确定',
  873. type: 'warning'
  874. })
  875. return false
  876. }
  877. // 校核人选择对话框状态
  878. const showBatchSubmitToRecheckDialog = ref(false)
  879. const isShowAuditDialog = ref(false)
  880. const handleSelectVerfiyer = async () => {
  881. try {
  882. await spreadRef.value?.handleSave()
  883. } catch (error) {
  884. console.error('保存数据失败:', error)
  885. ElMessage.error('保存数据失败,请重试')
  886. return
  887. }
  888. const canSubmit = canSubmitMainReportType('该报告存在未办结检验意见通知书,无法提交校核')
  889. if(!canSubmit) return
  890. // 获取审核人\校核人配置信息
  891. let res = await UserApi.getApprovalDetail({})
  892. // 如果存在多份待提交校核的报告,执行批量校核弹窗
  893. console.log('getCanSubmitRecheckReport', getCanSubmitRecheckReport,props.reportList,res)
  894. if(getCanSubmitRecheckReport.value.length > 1) {
  895. if(res && res.recheckUser) {
  896. batchRecheckForm.value.recheckUser = res.recheckUser
  897. }
  898. batchRecheckForm.value.reportIds = getCanSubmitRecheckReport.value.map(x => x?.id)
  899. showBatchSubmitToRecheckDialog.value = true
  900. return
  901. }
  902. // 只有一份待提交校核的报告,执行以下逻辑
  903. if(res && res.recheckUser) {
  904. form.value.recheckUser = res.recheckUser
  905. }
  906. schemaFlag.value = 'proofread'
  907. isShowAuditDialog.value = true
  908. }
  909. // 批量提交
  910. const handleBatchSubmitToRecheck = async () => {
  911. try {
  912. await batchRecheckFormRef.value.validate()
  913. } catch (err) {
  914. ElMessage.error('请完善表单数据!')
  915. return
  916. }
  917. if (_.isEmpty(batchRecheckForm.value.recheckUser)) {
  918. return ElMessage.error('请选择校核人')
  919. }
  920. // 待提交的数据
  921. const params = {
  922. reportList: getCanSubmitRecheckReport.value.filter((x: any) => batchRecheckForm.value.reportIds.includes(x?.id)).map((x: any) => ({
  923. id: x.id,
  924. reportUrl: x.reportUrl,
  925. dataJson: x?.prepareJson
  926. })),
  927. recheckId: batchRecheckForm.value.recheckUser?.id
  928. }
  929. const submitResult = await PipeTaskOrderApi.batchSubmitToRecheck(params)
  930. if (submitResult) {
  931. ElMessage.success('提交校核成功!')
  932. showBatchSubmitToRecheckDialog.value = false
  933. selectNextItem(getCanSubmitRecheckReport.value.filter((x: any) => batchRecheckForm.value.reportIds.includes(x?.id)))
  934. // 这里可以做页面刷新
  935. emit('template-confirm')
  936. }
  937. }
  938. const submitting = ref(false)
  939. const handleAuditSelectConfirm = async () => {
  940. if (_.isEmpty(form.value.recheckUser)) {
  941. return ElMessage.error(schemaFlag.value == 'proofread' ? '请选择校核人' : '请选择审核人')
  942. }
  943. // 审核
  944. if (schemaFlag.value === 'audit') {
  945. submitting.value = true
  946. const submitResult = await PipeTaskOrderApi.submitReportAudit({
  947. id: templateParams.value?.id,
  948. approveId: form.value?.recheckUser?.id
  949. })
  950. submitting.value = false
  951. if (submitResult) {
  952. ElMessage.success('提交审核成功!')
  953. isShowAuditDialog.value = false
  954. selectNextItem([props.selectedItem])
  955. // 这里可以做页面刷新
  956. emit('template-confirm')
  957. }
  958. } else if (schemaFlag.value === 'proofread') {
  959. // 校核
  960. const saveResult = await PipeTaskOrderApi.submitTaskReportTemplate({
  961. id: props?.selectedItem?.id,
  962. recheckId: form.value?.recheckUser?.id
  963. })
  964. if (saveResult) {
  965. ElMessage.success('提交校核成功!')
  966. isShowAuditDialog.value = false
  967. selectNextItem([props.selectedItem])
  968. // 这里可以做页面刷新
  969. emit('template-confirm')
  970. }
  971. }
  972. }
  973. /**
  974. * 项目切换
  975. */
  976. const selectNextItem = (items:ReportItemVO[]) => {
  977. // 找到其他在记录录入或者报告编制状态的第一项目
  978. const ids = items.map(item => item.id)
  979. const inputReportList= props.reportList.filter(
  980. item => {
  981. return !ids.includes(item.id)
  982. }
  983. ).filter(item =>{
  984. return item.taskStatus === PressureTaskOrderTaskStatus['RECORD_INPUT'] || item.taskStatus === PressureTaskOrderTaskStatus['REPORT_INPUT']
  985. })
  986. console.log(inputReportList)
  987. if (inputReportList.length > 0){
  988. emit('item-select', inputReportList[0])
  989. }
  990. }
  991. // 审批人选择对话框状态
  992. const isShowApprovalDialog = ref(false)
  993. // 监听项目切换,自动重置视图模式
  994. watch(
  995. () => props.selectedItem,
  996. (newItem, oldItem) => {
  997. if (newItem) {
  998. showReportPdfType.value = [PressureCheckerMyTaskStatus.REPORT_INPUT,PressureCheckerMyTaskStatus.REPORT_AUDIT,PressureCheckerMyTaskStatus.REPORT_APPROVE,PressureCheckerMyTaskStatus.REPORT_END].includes(props.selectedItem.taskStatus)
  999. && ![400,500,600,700].includes(props.selectedItem.reportType) ? 'report':'record'
  1000. handleRefreshData()
  1001. props.taskId && getReportAuditInfo()
  1002. console.log('切换项目', props.selectedItem)
  1003. hasRecord.value = props.selectedItem.templateId != null
  1004. if (props.selectedItem?.reportTemplateId == null){
  1005. showReportPdfType.value = 'record'
  1006. }
  1007. if (props.selectedItem?.templateId == null){
  1008. showReportPdfType.value = 'report'
  1009. }
  1010. }
  1011. // 当切换到不同的项目时,重置视图模式为normal
  1012. if (newItem?.id !== oldItem?.id) {
  1013. viewMode.value = 'normal'
  1014. }
  1015. },
  1016. { immediate: false }
  1017. )
  1018. const previewUrl = ref('')
  1019. const previewVisible = ref(false)
  1020. const previewType = ref('')
  1021. const handlePreview = (path: string, type: 'video' | 'image') => {
  1022. previewUrl.value = path;
  1023. previewType.value = type;
  1024. previewVisible.value = true;
  1025. }
  1026. /**
  1027. * 如果是"已经审核完的检验意见通知书,则查询相关的检验意见通知信息,显示在最右侧
  1028. */
  1029. const checkBookDetail = ref<Record<string, any>>({})
  1030. const showCheckBook = computed(() => {
  1031. const { reportType, taskStatus } = props.selectedItem || {}
  1032. // console.log(taskStatus, 'taskStatus', reportType)
  1033. // taskStatus: 800
  1034. return reportType === PressureReportType['SUGGUESTION']
  1035. })
  1036. const rectificationStatusMap = reactive({
  1037. 0: '待确认',
  1038. 1: '待整改',
  1039. 2: '已递交',
  1040. 3: '材料有误',
  1041. 4: '整改通过',
  1042. 5: '整改不通过'
  1043. })
  1044. const getReportAuditInfo = async () => {
  1045. if (props.selectedItem?.reportType === PressureReportType['SUGGUESTION']) {
  1046. const res = await reportInfoApi.exportCheckBookDetail({
  1047. id: props.taskId
  1048. })
  1049. console.log(res, '查询检验意见通知书详细信息')
  1050. if (res) {
  1051. checkBookDetail.value = res
  1052. }
  1053. }
  1054. }
  1055. const returnForm = ref({
  1056. rejectionReason: ''
  1057. })
  1058. const returnFormRules = ref({
  1059. rejectionReason: [{ required: true, message: '请输入回退原因', trigger: 'blur' }]
  1060. })
  1061. const returnFormRef = ref()
  1062. const isCompleteInput = computed(() => {
  1063. return props.selectedItem?.taskStatus >= PressureCheckerMyTaskStatus.RECORD_CHECK
  1064. })
  1065. const isShowRecordOrReportBtn = computed(() => {
  1066. return [PressureReportType.MAIN,PressureReportType.SUB,PressureReportType.SINGLE].includes(props.selectedItem?.reportType)
  1067. })
  1068. // 通过 退回
  1069. const handlePass = async (type) => {
  1070. const params: Record<string, any> = {
  1071. reportId: props.selectedItem?.id,
  1072. approvalType: type
  1073. }
  1074. if (type === 1) {
  1075. const valid = await returnFormRef.value.validate()
  1076. if (!valid) return
  1077. params.rejectionReason = returnForm.value.rejectionReason
  1078. }
  1079. const tipText = type === 1 ? '退回' : type === 2 ? '整改不通过' : '整改通过'
  1080. ElMessageBox.confirm(`确定${tipText}吗?`, '提示', {
  1081. confirmButtonText: '确定',
  1082. cancelButtonText: '取消',
  1083. type: 'warning'
  1084. }).then(() => {
  1085. PipeTaskOrderApi.inspectionApproval(params).then((res) => {
  1086. props.taskId && getReportAuditInfo()
  1087. emit('refresh')
  1088. }).catch(() => {
  1089. ElMessage.error('操作失败')
  1090. })
  1091. })
  1092. }
  1093. // 获取检验员名称
  1094. const getCheckersName = (): string => {
  1095. if (!props.selectedItem?.checkUsers || props.selectedItem.checkUsers.length === 0) {
  1096. return '未分配'
  1097. }
  1098. return props.selectedItem.checkUsers.map((user) => user.nickname).join('、')
  1099. }
  1100. // 切换主检人
  1101. const handleUserSelect = async (id, userList) => {
  1102. const result = await PipeTaskOrderApi.updateReportMainChecker({
  1103. id: props.taskOrderItem?.id,
  1104. mainChecker: userList[0]?.id
  1105. })
  1106. if (result) {
  1107. ElMessage.success('修改主检人成功!')
  1108. emit('refresh')
  1109. }
  1110. }
  1111. const userSelectFormRef = ref()
  1112. const handleModifyMainChecker = () => {
  1113. userSelectFormRef.value.open(props.taskOrderItem?.mainCheckerUser?.id)
  1114. }
  1115. // 判断当前检验员或主检人是否为登录用户,如果不是,则功能按钮disabled
  1116. const checkerIsLoginUser = computed(() => {
  1117. const checkerUserIds = props.selectedItem?.checkUsers.map(checker => checker?.id)
  1118. return !(checkerUserIds?.includes(userStore?.user?.id) || props.taskOrderItem?.mainCheckerUser?.id === userStore?.user?.id)
  1119. })
  1120. // 判断当前项目是否已经到报告办结阶段
  1121. const getReportStatusEnd = computed(
  1122. () =>{
  1123. return props.selectedItem && props.selectedItem.taskStatus >= PressureCheckerMyTaskStatus['REPORT_CONFIRMATION']
  1124. }
  1125. )
  1126. // 判断“提交校核”按钮是否显示
  1127. const isCanSubmitRecheck = computed(() => {
  1128. if (props.selectedItem?.reportType === PressureReportType['SUGGUESTION'])
  1129. return props.selectedItem?.isRecheck || false
  1130. else if (props.selectedItem?.reportType === PressureReportType['MAINQUESTION']) return false
  1131. else
  1132. return (
  1133. props.selectedItem &&
  1134. props.selectedItem.taskStatus === PressureCheckerMyTaskStatus['RECORD_INPUT']
  1135. // && props.selectedItem.reportUrl
  1136. )
  1137. })
  1138. // 判断“提交审核&提交审批”按钮是否显示
  1139. const isCanSubmitToAudit = computed(() => {
  1140. const { selectedItem } = props
  1141. if (selectedItem && selectedItem?.reportType === PressureReportType['SUBCONTRACT']){
  1142. return selectedItem.taskStatus === PressureCheckerMyTaskStatus['CONFIRMED']
  1143. }
  1144. if (props.selectedItem && props.selectedItem?.reportType === PressureReportType['SUGGUESTION'])
  1145. return (
  1146. props.selectedItem?.isApproval &&
  1147. props.selectedItem.taskStatus === PressureCheckerMyTaskStatus['RECORD_INPUT']
  1148. )
  1149. else if (
  1150. props.selectedItem &&
  1151. props.selectedItem?.reportType === PressureReportType['MAINQUESTION']
  1152. )
  1153. return (
  1154. props.selectedItem.taskStatus === PressureCheckerMyTaskStatus['RECORD_INPUT'] &&
  1155. props.selectedItem?.reportUrl
  1156. )
  1157. else
  1158. return (
  1159. props.selectedItem &&
  1160. props.selectedItem.taskStatus === PressureCheckerMyTaskStatus['REPORT_INPUT']
  1161. )
  1162. })
  1163. // 判断“填写记录”按钮是否显示
  1164. const isCanEditTestRecord = computed(
  1165. () =>
  1166. props.selectedItem &&
  1167. (props.selectedItem.taskStatus === PressureCheckerMyTaskStatus['RECORD_INPUT'] ||
  1168. props.selectedItem.taskStatus === PressureCheckerMyTaskStatus['CONFIRMED']) && props.selectedItem.reportType !== PressureReportType['SUBCONTRACT']
  1169. )
  1170. // 判断“编制报告”按钮是否显示
  1171. const isCanEditReport = computed(
  1172. () =>
  1173. props.selectedItem &&
  1174. props.selectedItem.taskStatus === PressureCheckerMyTaskStatus['REPORT_INPUT']
  1175. )
  1176. // 判断"撤销流程"按钮是否显示:报告审核或审批阶段,且有OA流程ID,且当前用户是发起人
  1177. const isCanCancelFlow = computed(() => {
  1178. if (!props.selectedItem) return false
  1179. const isAuditOrApprove = [
  1180. PressureCheckerMyTaskStatus['REPORT_AUDIT'],
  1181. PressureCheckerMyTaskStatus['REPORT_APPROVE']
  1182. ].includes(props.selectedItem.taskStatus)
  1183. if (!isAuditOrApprove) return false
  1184. if (!props.selectedItem.summaryId) return false
  1185. return !checkerIsLoginUser.value
  1186. })
  1187. // 撤销流程
  1188. const handleCancelFlow = async () => {
  1189. if (!props.selectedItem?.summaryId) {
  1190. ElMessage.warning('未找到OA流程ID,无法撤销')
  1191. return
  1192. }
  1193. ElMessageBox.confirm('确定要撤销该流程吗?撤销后报告将回到报告编制阶段,您可以重新发起。', '撤销流程', {
  1194. confirmButtonText: '确定',
  1195. cancelButtonText: '取消',
  1196. type: 'warning'
  1197. }).then(async () => {
  1198. try {
  1199. const result = await PipeTaskOrderApi.cancelOAFlow(props.selectedItem.summaryId)
  1200. if (result) {
  1201. ElMessage.success('流程已撤销')
  1202. handleRefresh()
  1203. }
  1204. } catch (error) {
  1205. console.error('撤销流程失败:', error)
  1206. ElMessage.error('撤销流程失败,请稍后重试')
  1207. }
  1208. }).catch(() => {})
  1209. }
  1210. // 判断"OA审核"按钮是否显示:报告审核或审批阶段,且有OA流程ID,且当前用户是对应阶段的审核人/审批人
  1211. const isCanOAAudit = computed(() => {
  1212. if (!props.selectedItem) return false
  1213. const { taskStatus, summaryId, approvalId, ratifyId } = props.selectedItem
  1214. const currentUserId = userStore?.user?.id
  1215. // 审核阶段:只有审核人才能点击
  1216. if (taskStatus === PressureCheckerMyTaskStatus['REPORT_AUDIT']) {
  1217. return !!summaryId && approvalId === currentUserId
  1218. }
  1219. // 审批阶段:只有审批人才能点击
  1220. if (taskStatus === PressureCheckerMyTaskStatus['REPORT_APPROVE']) {
  1221. return !!summaryId && ratifyId === currentUserId
  1222. }
  1223. return false
  1224. })
  1225. // OA审核:弹出独立窗口
  1226. const oaAuditTimer = ref<ReturnType<typeof setInterval> | null>(null)
  1227. const handleOpenOAAudit = async () => {
  1228. // 清除之前的定时器
  1229. if (oaAuditTimer.value) {
  1230. clearInterval(oaAuditTimer.value)
  1231. oaAuditTimer.value = null
  1232. }
  1233. // 先打开空白弹窗
  1234. const win = window.open('', 'OAAudit', 'width=1200,height=800,left=100,top=50,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes')
  1235. try {
  1236. const link = await PipeTaskOrderApi.getAffairLink(props.selectedItem.summaryId)
  1237. if (link && win) {
  1238. win.location.href = link
  1239. // 轮询监听窗口关闭,关闭后触发报告状态更新
  1240. oaAuditTimer.value = setInterval(() => {
  1241. if (win.closed) {
  1242. clearInterval(oaAuditTimer.value!)
  1243. oaAuditTimer.value = null
  1244. PipeTaskOrderApi.updateReportBySummaryId(props.selectedItem.summaryId).finally(() => handleRefresh())
  1245. }
  1246. }, 500)
  1247. } else if (!win) {
  1248. ElMessage.warning('浏览器拦截了弹窗,请允许弹窗后重试')
  1249. } else {
  1250. win.close()
  1251. ElMessage.warning('未找到对应的OA审批链接')
  1252. }
  1253. } catch (error) {
  1254. console.error('获取OA审批链接失败:', error)
  1255. win?.close()
  1256. ElMessage.error('获取OA审批链接失败,请稍后重试')
  1257. }
  1258. }
  1259. // 判断"填写结果"按钮是否显示
  1260. const isCanEditRecordResult = computed(() => {
  1261. // 非我的任务详情页面,不显示
  1262. if ('PipeCheckerTaskDetail' !== routeName.value) return false
  1263. if (!props.selectedItem?.isAutoAmount || props.selectedItem?.isAutoAmount === '0') return false
  1264. if (
  1265. (props.selectedItem?.reportType === 100 || props.selectedItem?.reportType === 300) &&
  1266. props.selectedItem.taskStatus !== PressureCheckerMyTaskStatus['REPORT_END']
  1267. ) {
  1268. // 独审报告&主报告--“填写结果”:报告办结之前都可以填写
  1269. return true
  1270. }
  1271. // 查找主报告
  1272. const mainReport = props.reportList?.find((item) => item.reportType === 100) || {
  1273. taskStatus: null
  1274. }
  1275. if (
  1276. props.selectedItem?.reportType !== 100 &&
  1277. props.selectedItem?.reportType !== 300 &&
  1278. mainReport?.taskStatus !== PressureCheckerMyTaskStatus['REPORT_END']
  1279. ) {
  1280. // 非主报告 & 非独审报告 -- “填写结果”:主报告办结之前都可以填写
  1281. return true
  1282. }
  1283. return false
  1284. })
  1285. // 1、重大问题线索告知表 2、作业指导书 3、检验方案 只显示pdf
  1286. const onlyShowPdf = computed(() => {
  1287. const reportTypes = [
  1288. PressureReportType.MAINQUESTION,
  1289. PressureReportType.INSPECTIONPLAN,
  1290. PressureReportType.WORKINSTRUCTION
  1291. ]
  1292. return !props.selectedItem?.reportType
  1293. ? false
  1294. : reportTypes.includes(props.selectedItem?.reportType)
  1295. })
  1296. // 模板参数
  1297. const templateParams = computed(() => {
  1298. if (!props.selectedItem) return {}
  1299. return {
  1300. ...props.selectedItem,
  1301. equipCode: props.taskOrderItem?.equipCode || '',
  1302. equipId: props.taskOrderItem?.id || ''
  1303. }
  1304. })
  1305. // 判断是否为独审报告且不需要审批
  1306. const isApprovalWithoutRatify = computed(() => {
  1307. if (!props.selectedItem) return false
  1308. const reportType = (props.selectedItem as any).reportType
  1309. const isApproval = (props.selectedItem as any).isApproval
  1310. const isRatify = (props.selectedItem as any).isRatify
  1311. return (
  1312. reportType === PressureReportType.SINGLE &&
  1313. isApproval === true &&
  1314. isRatify === false &&
  1315. props.reportId === props.selectedItem.id
  1316. )
  1317. })
  1318. /**** 葡萄城:记录录入的显示和隐藏 ****/
  1319. const showInlineEditCheckRecord = ref(false)
  1320. const templateId = ref('')
  1321. const handleEditSpreadRecord = () => {
  1322. // console.log('templateParams', templateParams.value)
  1323. // DynamicTbInsApi.getOrCreatePreviewData('dc8fbb6078b2a2f0eadc0f6aedbeafa0').then(res => {
  1324. // showInlineEditCheckRecord.value = true
  1325. // templateId.value = res.id
  1326. // })
  1327. editPreview('record')
  1328. showInlineEditCheckRecord.value = true
  1329. }
  1330. const handleTemplateConfirm = (templateUrl: string) => {
  1331. console.log('templateUrl', templateUrl)
  1332. emit('template-confirm', templateUrl)
  1333. }
  1334. const handleRefresh = () => {
  1335. emit('refresh')
  1336. }
  1337. /**** 葡萄城:记录录入的显示和隐藏 end****/
  1338. /**** 葡萄城:检验结果录入的显示和隐藏 ****/
  1339. const showInlineInspectionResultInput = ref(false)
  1340. const inspectionResultTemplateParams = ref({})
  1341. // 检验结果录入模板参数
  1342. const handleInputCheckConclusion = () => {
  1343. showInlineInspectionResultInput.value = true
  1344. if (!props.selectedItem) return {}
  1345. inspectionResultTemplateParams.value = {
  1346. ...props.selectedItem,
  1347. equipCode: props.taskOrderItem?.equipCode || ''
  1348. }
  1349. }
  1350. const handleInspectionResultConfirm = (resultUrl: string) => {
  1351. emit('template-confirm', resultUrl)
  1352. viewMode.value = 'normal'
  1353. }
  1354. const handleReturnToNormalMode = () => {
  1355. viewMode.value = 'normal'
  1356. }
  1357. /**** 葡萄城:检验结果录入的显示和隐藏 end ****/
  1358. /**** 葡萄城:报告编制的显示和隐藏 ****/
  1359. const showInlineReportEdit = ref(false)
  1360. const handleEditRreport = () => {
  1361. if (showReportPdfType.value !== 'report' && showReportPdfType.value !== 'result'){
  1362. ElMessage.warning('请切换报告后再进行报告编制!')
  1363. return
  1364. }
  1365. editPreview('report')
  1366. showInlineReportEdit.value = true
  1367. }
  1368. // 获取当前报告的配置信息
  1369. const currentReportConfig = computed(() => {
  1370. if (
  1371. !props.selectedItem ||
  1372. props.selectedItem.reportType !== PressureReportType.SINGLE ||
  1373. !props.reportList
  1374. ) {
  1375. return null
  1376. }
  1377. // 从reportList中找到当前报告的配置
  1378. const currentReport = props.reportList.find((report) => report.id === templateParams.value?.id)
  1379. return currentReport
  1380. ? {
  1381. isApproval: (currentReport as any).isApproval,
  1382. isRatify: (currentReport as any).isRatify
  1383. }
  1384. : null
  1385. })
  1386. // 选择报告审核人弹窗的显示和隐藏
  1387. const isShowReportAuditDialog = ref(false)
  1388. // 提交报告审核
  1389. const handleSubmitAudit = async () => {
  1390. try {
  1391. await spreadRef.value?.handleSave()
  1392. } catch (error) {
  1393. console.error('保存数据失败:', error)
  1394. ElMessage.error('保存数据失败,请重试')
  1395. return
  1396. }
  1397. if([PressureReportType.SUGGUESTION, PressureReportType.MAINQUESTION].includes(props?.selectedItem?.reportType) && !props?.selectedItem?.reportUrl) {
  1398. // 【重大问题线索告知表,检验意见通知书】必须先填写记录,才能提交审核
  1399. ElMessage.warning('请先“填写记录”!再提交审核!')
  1400. return
  1401. }
  1402. if(PressureReportType.SINGLE === props?.selectedItem?.reportType && !props?.selectedItem?.prepareUrl) {
  1403. // 独审报告:用户可以不走报告编制环节直接提交审核,需要调用handleUploadAPIReportPreviewBlob将reportPreview接口的文件流拿来提交一遍
  1404. return handleUploadAPIReportPreviewBlob(handleSubmitAudit)
  1405. }
  1406. // 检查检验意见通知书是否“报告完结”
  1407. const canSubmit = canSubmitMainReportType('该报告存在未办结检验意见通知书,无法提交审核、审批')
  1408. if(!canSubmit) return
  1409. // 检查其他报告状态
  1410. const checkResult = checkOtherReportsFinished()
  1411. if (!checkResult.canSubmit) {
  1412. try {
  1413. await ElMessageBox.alert(
  1414. checkResult.message || '请先办结其他报告再提交主报告审核',
  1415. '无法提交审核'
  1416. )
  1417. } catch (error) {
  1418. // 用户关闭对话框,不需要处理
  1419. }
  1420. return
  1421. }
  1422. // if(PressureReportType.MAIN === props?.selectedItem?.reportType && !props?.selectedItem?.prepareUrl) {
  1423. // // 主报告:用户可以不走报告编制环节直接提交审核,需要调用handleUploadAPIReportPreviewBlob将reportPreview接口的文件流拿来提交一遍
  1424. // return handleUploadAPIReportPreviewBlob(handleSubmitAudit)
  1425. // }
  1426. // 检验意见通知书 && 重大问题线索通知 不需要选择审核人
  1427. if (
  1428. [PressureReportType['SUGGUESTION'], PressureReportType['MAINQUESTION']].includes(
  1429. templateParams.value?.reportType
  1430. )
  1431. ) {
  1432. ElMessageBox.confirm(`确定提交【${templateParams.value?.reportName}】`, '提示', {
  1433. confirmButtonText: '确定',
  1434. cancelButtonText: '取消'
  1435. })
  1436. .then(async () => {
  1437. const submitResult = await PipeTaskOrderApi.submitOpinionNoticeApproval({
  1438. id: templateParams.value?.id
  1439. })
  1440. if (submitResult) {
  1441. // 这里可以做页面刷新
  1442. emit('template-confirm')
  1443. }
  1444. })
  1445. .catch(() => {
  1446. console.log('用户取消提交审核')
  1447. })
  1448. } else {
  1449. let res = await UserApi.getApprovalDetail({}) // 判断是否有审批信息
  1450. if (res && res.approveUser) {
  1451. form.value.recheckUser = res.approveUser
  1452. }
  1453. schemaFlag.value = 'audit'
  1454. isShowAuditDialog.value = true
  1455. // isShowReportAuditDialog.value = true
  1456. }
  1457. }
  1458. const handleCompletion = async () => {
  1459. await PipeTaskOrderApi.handleCompletion(props.selectedItem.id)
  1460. handleRefresh()
  1461. ElMessage.success('报告已办结')
  1462. }
  1463. // 上传主报告文件流
  1464. const handleUploadAPIReportPreviewBlob = async (submitApprovalFn) => {
  1465. if(!props.selectedItem || props.selectedItem.taskStatus !== PressureTaskOrderTaskStatus.REPORT_INPUT) return
  1466. // 获取文件流
  1467. const blob = await PipeTaskOrderApi.getReportPreview({
  1468. reportId: props.selectedItem?.id,
  1469. type: 300, // 报告模板
  1470. fileType: 100 // xlsx
  1471. })
  1472. if(blob) {
  1473. // 上传文件流
  1474. const formData = new FormData()
  1475. formData.append('file', blob)
  1476. const response = await uploadFile(formData)
  1477. // 保存报告编制的url
  1478. const saveResult = await PipeTaskOrderApi.saveReportPrepare({
  1479. id: props.selectedItem.id,
  1480. prepareUrl: response,
  1481. })
  1482. if(saveResult) {
  1483. await emit('update:selected-item', {...props.selectedItem, prepareUrl: response})
  1484. // 提交审核
  1485. await submitApprovalFn()
  1486. }
  1487. }
  1488. }
  1489. const handleChangeEntrustUnit = (unit: Record<string, any>) => {
  1490. form.value.recheckUser = unit
  1491. }
  1492. // 检查其他报告是否已办结
  1493. const checkOtherReportsFinished = (): { canSubmit: boolean; message?: string } => {
  1494. if (!props.selectedItem) return { canSubmit: false }
  1495. // 如果不是主报告,直接允许提交
  1496. if (props.selectedItem.reportType !== PressureReportType.MAIN) {
  1497. return { canSubmit: true }
  1498. }
  1499. // 主报告需要检查其他报告状态
  1500. const unfinishedReports = !props.reportList
  1501. ? []
  1502. : props.reportList.filter((report) => {
  1503. // 排除当前报告
  1504. if (report.id === templateParams.value?.id) {
  1505. return false
  1506. }
  1507. // 检查子报告和独审报告是否已办结
  1508. const isSubReport = report.reportType === PressureReportType.SUB
  1509. const isSingleReport = report.reportType === PressureReportType.SINGLE
  1510. const isSUGGUESTIONReport = report.reportType === PressureReportType.SUGGUESTION
  1511. if (isSubReport || isSingleReport || isSUGGUESTIONReport) {
  1512. return report.taskStatus !== PressureCheckerMyTaskStatus.REPORT_END
  1513. }
  1514. return false
  1515. })
  1516. if (unfinishedReports.length > 0) {
  1517. const unfinishedNames = unfinishedReports.map((report) => report.reportName).join('、')
  1518. return {
  1519. canSubmit: false,
  1520. message: `请先办结其他报告再提交主报告审核。未办结的报告:${unfinishedNames}`
  1521. }
  1522. }
  1523. // 检查是否确认费用
  1524. // const reportsWithoutConfirmFee: any[] = []
  1525. // 检查当前报告中是否存在应确认费用,但未确认的报错
  1526. const reportsWithoutConfirmFee: any[] = !props.reportList
  1527. ? []
  1528. : props.reportList.filter(
  1529. (report: any) => report.isAutoAmount === '1' && report.feeConfirm === false
  1530. )
  1531. // if (currentReport) {
  1532. // reportsWithoutConfirmFee.push(currentReport)
  1533. // }
  1534. // 检查子报告是否都已录入结果
  1535. // const subReports = !props.reportList ? [] : props.reportList.filter(report => {
  1536. // return report.id !== templateParams.value?.id &&
  1537. // report.reportType === PressureReportType.SUB
  1538. // })
  1539. // subReports.forEach(report => {
  1540. // if (!report.formulaJson) {
  1541. // reportsWithoutConfirmFee.push(report)
  1542. // }
  1543. // })
  1544. if (reportsWithoutConfirmFee.length > 0) {
  1545. const reportNames = reportsWithoutConfirmFee.map((report) => report.reportName).join('、')
  1546. return {
  1547. canSubmit: false,
  1548. message: `请先确认费用再提交主报告审核。未确认费用的报告:${reportNames}`
  1549. }
  1550. }
  1551. return { canSubmit: true }
  1552. }
  1553. // 报告审核人选择确认
  1554. const handleReportAuditSelectConfirm = async (res: any) => {
  1555. const approveId = res[0]
  1556. const submitResult = await PipeTaskOrderApi.submitReportAudit({
  1557. id: templateParams.value?.id,
  1558. approveId
  1559. })
  1560. if (submitResult) {
  1561. // 这里可以做页面刷新
  1562. emit('template-confirm')
  1563. }
  1564. isShowReportAuditDialog.value = false
  1565. }
  1566. /**** 葡萄城:报告编制的显示和隐藏 end ****/
  1567. const handleModifyChecker = () => {
  1568. if (props.selectedItem) {
  1569. emit('modify-checker', props.selectedItem)
  1570. }
  1571. }
  1572. // 审批人选择确认
  1573. const handleApprovalSelectConfirm = async (res: any) => {
  1574. if (!props.selectedItem || !res || res.length === 0) {
  1575. ElMessage.warning('请选择审批人')
  1576. return
  1577. }
  1578. const ratifyId = res[0] // 获取选中的审批人ID
  1579. try {
  1580. await PipeTaskOrderApi.submitReportApprove({
  1581. id: props.selectedItem.id,
  1582. ratifyId: ratifyId
  1583. })
  1584. ElMessage.success('提交审批成功')
  1585. isShowApprovalDialog.value = false
  1586. emit('submit-approval')
  1587. } catch (error: any) {
  1588. console.error('提交审批失败:', error)
  1589. ElMessage.error('提交审批失败,请稍后重试')
  1590. isShowApprovalDialog.value = false
  1591. }
  1592. }
  1593. // 加载流转记录列表
  1594. const recordList = ref<any[]>([])
  1595. const recordListLoading = ref(false)
  1596. const loadRecordList = async () => {
  1597. if (!props.selectedItem) return
  1598. try {
  1599. let response = null
  1600. // 检验意见通知书&重大问题线索
  1601. switch (props.selectedItem.reportType) {
  1602. case PressureReportType['SUGGUESTION']:
  1603. case PressureReportType['MAINQUESTION']:
  1604. response = await PipeTaskOrderApi.getOpinionNoticeApprovalRecordList({
  1605. id: props.selectedItem.id
  1606. })
  1607. break
  1608. default:
  1609. // 其他
  1610. response = await PipeTaskOrderApi.getTaskOrderItemReportRecordPage({
  1611. pageSize: 10,
  1612. pageNo: 1,
  1613. reportId: props.selectedItem.id
  1614. })
  1615. }
  1616. // 根据实际接口返回的数据结构获取数据
  1617. console.log("XXXX",recordList.value)
  1618. recordList.value = response?.data?.list || response?.list || response || []
  1619. } catch (error: any) {
  1620. console.error('获取流转记录失败:', error)
  1621. ElMessage.error('获取流转记录失败,请稍后重试')
  1622. recordList.value = []
  1623. } finally {
  1624. recordListLoading.value = false
  1625. }
  1626. }
  1627. // 获取报告字段纠错列表
  1628. const checkInputList = ref<any[]>([])
  1629. const handleGetCheckKeyInputs = async () => {
  1630. checkInputList.value = []
  1631. //if (!dataJson) return
  1632. if (!props.selectedItem?.id) return ElMessage.warning('字段纠错传参有误')
  1633. let reportId = props.selectedItem?.id
  1634. //const templateId = showReportPdfType.value === 'report'? props.selectedItem?.reportTemplateId : props.selectedItem?.templateId;
  1635. let templateId = showReportPdfType.value === 'report' ? props.selectedItem?.reportTemplateId :
  1636. showReportPdfType.value === 'result' ? props.selectedItem?.resultTemplateId : props.selectedItem?.templateId;
  1637. if (showReportPdfType.value === 'report'){
  1638. reportId = "report_" + reportId;
  1639. }else if (showReportPdfType.value === 'result'){
  1640. reportId = "result_" + reportId;
  1641. }
  1642. const response = await PipeTaskOrderApi.getCheckKeyIsInput(
  1643. { id: templateId,reportId: reportId },
  1644. JSON.parse("{}")
  1645. )
  1646. //console.log(JSON.parse(dataJson))
  1647. if (response) checkInputList.value = formatCheckInputList(response)
  1648. }
  1649. function formatCheckInputList(response, checkInputList = [] as any[]) {
  1650. if (!response) return []
  1651. for (let checkItem of response) {
  1652. if (!checkItem.child) {
  1653. checkInputList.push({ code: checkItem.code, name: checkItem.name })
  1654. }
  1655. if (is(checkItem.child, 'Array') && checkItem.type === 'object') {
  1656. formatCheckInputList(checkItem.child, checkInputList)
  1657. }
  1658. if (is(checkItem.child, 'Array') && checkItem.type === 'array') {
  1659. const childMapper = checkItem.child.map((item, i) => {
  1660. return {
  1661. code: `${checkItem.code}: ${item.code}`,
  1662. name: item.name
  1663. }
  1664. })
  1665. formatCheckInputList(childMapper, checkInputList)
  1666. }
  1667. }
  1668. return checkInputList
  1669. }
  1670. // 获取版本记录列表
  1671. const showVersionDetail = ref(false)
  1672. const historyList = ref<any[]>([])
  1673. async function getOrderHistoryVersion(id: string) {
  1674. try {
  1675. const response = await PipeTaskOrderApi.getSafetyCheckRecordVersionPage({
  1676. pageNo: 1,
  1677. pageSize: 100,
  1678. businessType: 0,
  1679. orderItemReportId: id
  1680. })
  1681. historyList.value = response.list || []
  1682. } catch (error) {
  1683. console.error('获取历史版本失败:', error)
  1684. ElMessage.error('获取历史版本失败')
  1685. }
  1686. }
  1687. const versionDataCompareList = ref([])
  1688. const versionColumns = ref([
  1689. {
  1690. label: '字段名',
  1691. prop: 'displayName'
  1692. },
  1693. {
  1694. label: '修改前',
  1695. prop: 'oldValue',
  1696. render: (row, value) => (
  1697. <el-text link type="default">
  1698. {value || '-'}
  1699. </el-text>
  1700. )
  1701. },
  1702. {
  1703. label: '修改后',
  1704. prop: 'newValue',
  1705. render: (row, value) => <el-text type="primary">{value || '-'}</el-text>
  1706. }
  1707. ])
  1708. const versionDetailButtons = ref([
  1709. {
  1710. render: () => (
  1711. <el-button type="success" onClick={() => handleShowReportPdf()}>
  1712. 查看原文件PDF
  1713. </el-button>
  1714. )
  1715. }
  1716. ])
  1717. const showReportDialog = ref(false)
  1718. const currentUrl = ref('')
  1719. const reportSource = ref<any | null>(null)
  1720. const pdfLoading = ref(false)
  1721. // 恢复版本
  1722. const restoreVersion = (item: any) => {
  1723. ElMessageBox.confirm('是否确定恢复到该版本?', '提示', {
  1724. confirmButtonText: '确定',
  1725. cancelButtonText: '取消',
  1726. type: 'info',
  1727. center: true
  1728. })
  1729. .then(async () => {
  1730. const result = await PipeTaskOrderApi.saveTaskReportTemplate({
  1731. id: props.selectedItem?.id,
  1732. reportUrl: item.oldReportUrl,
  1733. prepareJson: item.oldPrepareJson,
  1734. reportType: showReportPdfType.value,
  1735. modifiedReason: '恢复版本'
  1736. })
  1737. console.log('restoreVersion', result)
  1738. if (result) {
  1739. ElMessage({
  1740. type: 'success',
  1741. message: '操作成功'
  1742. })
  1743. handleRefresh()
  1744. } else {
  1745. ElMessage.warning('操作失败,请联系管理员!')
  1746. }
  1747. })
  1748. .catch(() => {})
  1749. }
  1750. // 查看版本详情的pdf
  1751. const handleShowReportPdf = async () => {
  1752. if (currentUrl.value) {
  1753. const reportId = props.selectedItem?.id;
  1754. reportInitData.value.refId = showReportPdfType.value === 'report' ? "report_" + reportId :
  1755. showReportPdfType.value === 'result' ? "result_" + reportId : reportId
  1756. reportInitData.value.templateId = showReportPdfType.value === 'report' ? templateParams.value.reportTemplateId :
  1757. showReportPdfType.value === 'result' ? templateParams.value.resultTemplateId : templateParams.value.templateId
  1758. reportInitData.value.dataSource = currentUrl.value.oldPrepareJson ? JSON.parse(currentUrl.value.oldPrepareJson) : {}
  1759. showReportDialog.value = true
  1760. setTimeout(()=> {
  1761. reportSpreadRef.value?.reloadView();
  1762. })
  1763. pdfLoading.value = false
  1764. } else {
  1765. ElMessage.warning('报告缺失,请联系管理员!')
  1766. }
  1767. }
  1768. const handlePdfRendered = () => {
  1769. pdfLoading.value = false
  1770. currentUrl.value = ''
  1771. }
  1772. // 查看详情
  1773. const handleShowVersionInfo = (item) => {
  1774. showVersionDetail.value = true
  1775. console.log(item)
  1776. currentUrl.value = item
  1777. versionDataCompareList.value = JSON.parse(item.modifiedObject)
  1778. }
  1779. // 检验项目添加上传附件功能
  1780. const reportListUploadModalRef = ref<InstanceType<typeof ReportListUploadModal>>()
  1781. const handleUploadItem = () => {
  1782. reportListUploadModalRef.value?.openModal(route.query.type === 'PipeMyTask')
  1783. }
  1784. //切换记录和报告的显示
  1785. const handleChangeShowReportPdf = (showType: string) => {
  1786. if (showType === 'report' || showType === 'result'){
  1787. if (![PressureCheckerMyTaskStatus.REPORT_INPUT,PressureCheckerMyTaskStatus.REPORT_AUDIT,PressureCheckerMyTaskStatus.REPORT_APPROVE,PressureCheckerMyTaskStatus.REPORT_END].includes(props.selectedItem.taskStatus)){
  1788. ElMessage.error('该检验项目暂未生成报告!')
  1789. showReportPdfType.value = 'record';
  1790. return;
  1791. }
  1792. }
  1793. if (showType === 'result'){
  1794. if (!props.selectedItem?.resultTemplateId){
  1795. ElMessage.error('该检验项目没有结论报告!')
  1796. showReportPdfType.value = 'record';
  1797. return;
  1798. }
  1799. }
  1800. showReportPdfType.value = showType;
  1801. handleRefreshData()
  1802. }
  1803. const isCanSyncReportData = computed(() => {
  1804. return true
  1805. //return [PressureCheckerMyTaskStatus.CONFIRMED,PressureCheckerMyTaskStatus.RECORD_INPUT].includes(props.selectedItem.taskStatus)
  1806. })
  1807. const handleSyncReportData = async () => {
  1808. try {
  1809. const response = await PipeTaskOrderApi.syncReportData({
  1810. refId: props.selectedItem.id,
  1811. reportType : showReportPdfType.value
  1812. })
  1813. if (response){
  1814. ElMessage.success('同步数据成功')
  1815. handleRefresh()
  1816. }else{
  1817. ElMessage.error('同步数据失败,请稍后重试')
  1818. }
  1819. } catch (error: any) {
  1820. console.error('同步数据失败:', error)
  1821. ElMessage.error('同步数据失败,请稍后重试')
  1822. }
  1823. }
  1824. const getPipeRecheckUserList = async (params) => {
  1825. params.orderId = props.taskInfo.id
  1826. return await PipeTaskOrderApi.getPipeRecheckUserList(params)
  1827. }
  1828. const showAssociationOperationManual = ref(false)
  1829. const handleShowAssociationOperationManual = () => {
  1830. showAssociationOperationManual.value = true
  1831. }
  1832. // onMounted(() => {
  1833. // console.log(props)
  1834. // //initPreview()
  1835. // })
  1836. const initPreview=()=>{
  1837. const reportId = props.selectedItem?.id;
  1838. const refId = showReportPdfType.value === 'report' ? "report_" + reportId :
  1839. showReportPdfType.value === 'result' ? "result_" + reportId : reportId
  1840. const templateId = showReportPdfType.value === 'report' ? templateParams.value.reportTemplateId :
  1841. showReportPdfType.value === 'result' ? templateParams.value.resultTemplateId : templateParams.value.templateId
  1842. initData.value.templateId = templateId;
  1843. initData.value.refId = refId;
  1844. initData.value.refName = props.selectedItem?.reportName;
  1845. initData.value.opType = (props.selectedItem.taskStatus == 510 || props.selectedItem.taskStatus >= 600 || (showReportPdfType.value === 'record' && props.selectedItem.taskStatus > 500) || props?.selectedItem?.checkUsers?.[0]?.id != userStore?.user?.id) ? 1 : 0;
  1846. if (props.selectedItem.reportType === PressureReportType['INSPECTIONPLAN'] && props.selectedItem.manualUrl){
  1847. initData.value.manualUrl = props.selectedItem.manualUrl;
  1848. }else{
  1849. initData.value.manualUrl = '';
  1850. }
  1851. //spreadRef.value?.reloadView();
  1852. setTimeout(()=>{
  1853. spreadRef.value?.reloadView();
  1854. },50)
  1855. console.log('initPreview', initData.value)
  1856. }
  1857. const editPreview=(reportType: string)=>{
  1858. const reportId = props.selectedItem?.id;
  1859. const refId = showReportPdfType.value === 'report' ? "report_" + reportId :
  1860. showReportPdfType.value === 'result' ? "result_" + reportId : reportId
  1861. const templateId = showReportPdfType.value === 'report' ? templateParams.value.reportTemplateId :
  1862. showReportPdfType.value === 'result' ? templateParams.value.resultTemplateId : templateParams.value.templateId
  1863. editData.value.templateId = templateId;
  1864. editData.value.refId = refId;
  1865. editData.value.opType = 0;
  1866. setTimeout(()=>{
  1867. if (reportType === 'record'){
  1868. editSpreadRecordRef.value?.reloadView();
  1869. }else if(reportType === 'report'){
  1870. editSpreadReportRef.value?.reloadView();
  1871. }
  1872. },50)
  1873. console.log('editDataPreview', editData.value)
  1874. }
  1875. const saveSuccess = async (data)=>{
  1876. if (props.selectedItem.taskStatus >= PressureCheckerMyTaskStatus.REPORT_INPUT){
  1877. saveSuccessReport(data)
  1878. }else {
  1879. saveSuccessRecord(data)
  1880. }
  1881. }
  1882. const saveSuccessRecord = async (data)=>{
  1883. const dataJson = !data.dataSource ? '' : JSON.stringify(data.dataSource)
  1884. const params = {
  1885. id: props.selectedItem?.id,
  1886. reportUrl: props.selectedItem?.id,
  1887. prepareJson: dataJson
  1888. }
  1889. const saveResult = await PipeTaskOrderApi.saveTaskReportTemplate(params)
  1890. if (saveResult) {
  1891. showInlineEditCheckRecord.value = false
  1892. handleRefresh()
  1893. }
  1894. }
  1895. const handleClose = () => {
  1896. ElMessageBox.confirm('是否关闭?', {
  1897. confirmButtonText: '确认',
  1898. cancelButtonText: '取消',
  1899. type: 'warning',
  1900. }).then(() => {
  1901. showInlineEditCheckRecord.value = false
  1902. showInlineReportEdit.value = false
  1903. handleRefresh()
  1904. })
  1905. }
  1906. const saveSuccessReport = async (data)=>{
  1907. const dataJson = !data.dataSource ? '' : JSON.stringify(data.dataSource)
  1908. const saveResult = PipeTaskOrderApi.saveReportPrepare({
  1909. id: props.selectedItem?.id,
  1910. prepareJson: dataJson,
  1911. })
  1912. if(saveResult) {
  1913. showInlineReportEdit.value = false
  1914. handleRefresh()
  1915. }
  1916. }
  1917. const handleRefreshData = () => {
  1918. loadRecordList()
  1919. initPreview()
  1920. handleGetCheckKeyInputs()
  1921. getOrderHistoryVersion(props.selectedItem?.id)
  1922. }
  1923. // 应用项目 - 使用模板数据填充当前记录
  1924. const handleApplyTemplate = (defaultJson: Recordable) => {
  1925. if (!isCanEditTestRecord.value) {
  1926. return ElMessage.warning('非可编辑状态,不能应用模板')
  1927. }
  1928. initData.value = {
  1929. ...initData.value,
  1930. dataSource: defaultJson
  1931. }
  1932. setTimeout(() => {
  1933. spreadRef.value?.reloadView()
  1934. }, 50)
  1935. }
  1936. // 更新模板 - 打开记录编辑器供用户更新模板
  1937. const handleUpdateTemplateUrl = (item: ReportItemVO) => {
  1938. handleEditSpreadRecord()
  1939. }
  1940. const getData = () => {
  1941. return spreadRef.value?.getData()
  1942. }
  1943. defineExpose({
  1944. handleShowAssociationOperationManual,
  1945. handleApplyTemplate,
  1946. handleUpdateTemplateUrl,
  1947. getData
  1948. })
  1949. //新加
  1950. // 添加控制展开/收缩状态的变量
  1951. const isExpanded = ref(false);
  1952. // 添加切换面板展开/收缩的方法
  1953. const togglePanel = () => {
  1954. isExpanded.value = !isExpanded.value;
  1955. setTimeout((() => {
  1956. nextTick(handleWindowResize)
  1957. }), 300);
  1958. };
  1959. // 获取PDF宽度
  1960. const pdfContentWidth = ref<number>(1030)
  1961. const pdfPanelRef = ref<HTMLDivElement>()
  1962. const handleWindowResize = debounce(async () => {
  1963. if(!pdfPanelRef.value) return
  1964. const width = pdfPanelRef.value?.clientWidth - 20
  1965. pdfContentWidth.value = props.isFullscreen ? width : (width > 1030 ? 1030 : width)
  1966. if (initData.value.opType == 1){
  1967. spreadRef.value?.reloadView();
  1968. }else {
  1969. spreadRef.value?.handleSave();
  1970. }
  1971. }, 100)
  1972. onMounted(() => {
  1973. handleWindowResize()
  1974. window.addEventListener('resize', handleWindowResize)
  1975. })
  1976. onUnmounted(() => {
  1977. window.removeEventListener('resize', handleWindowResize)
  1978. })
  1979. // 全屏切换时重新计算PDF区域宽度
  1980. watch(() => props.isFullscreen, () => {
  1981. nextTick(() => {
  1982. handleWindowResize()
  1983. })
  1984. })
  1985. </script>
  1986. <style lang="scss" scoped>
  1987. .capsule-tabs {
  1988. display: inline-flex;
  1989. align-items: center;
  1990. gap: 2px;
  1991. padding: 2px;
  1992. border-radius: 20px;
  1993. margin-right: 12px;
  1994. flex-shrink: 0;
  1995. .tab-item {
  1996. display: inline-flex;
  1997. align-items: center;
  1998. justify-content: center;
  1999. padding: 4px 12px;
  2000. font-size: 12px;
  2001. background: white;
  2002. border-radius: 16px;
  2003. cursor: pointer;
  2004. transition: all 0.3s ease;
  2005. color: #606266;
  2006. font-weight: 500;
  2007. border: 1px solid transparent;
  2008. user-select: none;
  2009. white-space: nowrap;
  2010. min-width: 50px;
  2011. span {
  2012. font-size: 12px !important;
  2013. }
  2014. &:hover {
  2015. color: #409eff;
  2016. border-color: #409eff;
  2017. }
  2018. &.active {
  2019. background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
  2020. color: white;
  2021. border-color: #409eff;
  2022. box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
  2023. }
  2024. }
  2025. }
  2026. .container-panel {
  2027. height: 100%;
  2028. border: 1px solid var(--el-border-color);
  2029. .info-panel {
  2030. display: flex;
  2031. height: 32px;
  2032. padding: 0 8px 0 22px;
  2033. font-size: 14px;
  2034. color: #41475c;
  2035. background-color: #effaff;
  2036. justify-content: space-between;
  2037. align-items: center;
  2038. }
  2039. .status-operation-panel {
  2040. height: calc(100% - 32px);
  2041. .single-item-panel {
  2042. display: flex;
  2043. align-items: stretch;
  2044. justify-content: space-between;
  2045. width: 100%;
  2046. height: 100%;
  2047. }
  2048. .pdf-panel {
  2049. height: 100%;
  2050. padding: 10px;
  2051. flex: 1;
  2052. overflow: hidden;
  2053. }
  2054. .right-panel-container {
  2055. display: flex;
  2056. position: relative;
  2057. // 收缩展开按钮样式
  2058. .toggle-btn {
  2059. position: absolute;
  2060. left: -30px;
  2061. top: 50%;
  2062. transform: translateY(-50%);
  2063. width: 30px;
  2064. height: 60px;
  2065. background-color: #fff;
  2066. border: 1px solid var(--el-border-color);
  2067. border-radius: 10px 0 0 10px;
  2068. display: flex;
  2069. align-items: center;
  2070. justify-content: center;
  2071. cursor: pointer;
  2072. z-index: 100;
  2073. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  2074. transition: all 0.3s ease;
  2075. &:hover {
  2076. background-color: #f5f5f5;
  2077. }
  2078. &.collapsed {
  2079. left: -18px;
  2080. // border-radius: 0 10px 10px 0;
  2081. }
  2082. }
  2083. }
  2084. .operation-panel {
  2085. flex-basis: 300px;
  2086. padding: 10px 10px 10px 0;
  2087. box-sizing: border-box;
  2088. transition: all 0.3s ease;
  2089. // 展开状态样式
  2090. &.expanded {
  2091. width: 300px;
  2092. }
  2093. // 收缩状态样式
  2094. &.collapsed {
  2095. width: 0;
  2096. padding: 0;
  2097. border: none;
  2098. .default-toolbar,
  2099. .operation-inner {
  2100. display: none;
  2101. }
  2102. }
  2103. .operation-btns {
  2104. display: flex;
  2105. flex-wrap: wrap;
  2106. gap: 12px;
  2107. .el-button {
  2108. margin-bottom: 10px;
  2109. margin-left: 0;
  2110. }
  2111. }
  2112. }
  2113. .operation-inner {
  2114. height: 100%;
  2115. padding: 7px 10px 20px;
  2116. background-color: #fff;
  2117. border: 1px solid var(--el-border-color);
  2118. box-sizing: border-box;
  2119. }
  2120. .custom-inner{
  2121. display: flex;
  2122. flex-direction: column;
  2123. overflow: hidden;
  2124. height: 100%;
  2125. padding: 7px 10px 20px;
  2126. background-color: #fff;
  2127. border: 1px solid var(--el-border-color);
  2128. box-sizing: border-box;
  2129. .operation-item1 {
  2130. position: relative;
  2131. margin-bottom: 10px;
  2132. overflow-y: auto;
  2133. .item-header {
  2134. position: sticky;
  2135. top: 0;
  2136. left: 0;
  2137. z-index: 1000;
  2138. width: 100%;
  2139. height: 28px;
  2140. padding-left: 20px;
  2141. font-size: 16px;
  2142. line-height: 28px;
  2143. color: #fff;
  2144. background: #fff url('@/assets/imgs/pressure/my-task-detail-operation-bg.png') no-repeat
  2145. left top;
  2146. background-size: 100% 28px;
  2147. }
  2148. .item-content1 {
  2149. display: flex;
  2150. margin-top: 10px;
  2151. &-item {
  2152. font-size: 14px;
  2153. }
  2154. &-img {
  2155. flex: 1;
  2156. display: grid;
  2157. grid-template-columns: repeat(3, 1fr);
  2158. grid-gap: 10px;
  2159. .item-content1-img-item{
  2160. width: 100px;
  2161. height: 100px;
  2162. position: relative;
  2163. .list-item-tool {
  2164. position: absolute;
  2165. top: 0;
  2166. left: 0;
  2167. width: 100%;
  2168. height: 100%;
  2169. z-index: 99;
  2170. border-radius: 8px;
  2171. transition: all 0.5s ease;
  2172. cursor: pointer;
  2173. display: flex;
  2174. justify-content: center;
  2175. align-items: center;
  2176. gap: 5px;
  2177. &:hover {
  2178. backdrop-filter: blur(2px);
  2179. background-color: #00000076;
  2180. z-index: 1;
  2181. .icon {
  2182. display: inline-block;
  2183. opacity: 1;
  2184. &:hover {
  2185. color: #ffffff;
  2186. transition: all 0.5s ease;
  2187. }
  2188. }
  2189. }
  2190. .icon {
  2191. color: #ffffff99;
  2192. opacity: 0;
  2193. transition: all 0.5s ease;
  2194. font-size: 16px;
  2195. }
  2196. }
  2197. }
  2198. .img-item {
  2199. width: 100px;
  2200. height: 100px;
  2201. }
  2202. }
  2203. }
  2204. .record-item {
  2205. margin-bottom: 10px;
  2206. background-color: #f5f5fa;
  2207. border-radius: 2px;
  2208. }
  2209. .item-content {
  2210. padding: 10px 0;
  2211. font-size: 14px;
  2212. .el-empty {
  2213. width: 100%;
  2214. height: 150px;
  2215. padding: 0;
  2216. box-sizing: border-box;
  2217. }
  2218. &-item {
  2219. height: 32px;
  2220. display: flex;
  2221. align-items: center;
  2222. gap: 8px;
  2223. }
  2224. }
  2225. .record-item-title {
  2226. height: 31px;
  2227. padding: 0 13px;
  2228. line-height: 31px;
  2229. background: linear-gradient(270deg, rgb(128 176 251 / 20%) 0%, rgb(73 120 246 / 20%) 100%);
  2230. border-radius: 2px;
  2231. }
  2232. .record-item-inner {
  2233. padding: 11px 13px 8px;
  2234. .content {
  2235. display: flex;
  2236. align-items: center;
  2237. .el-button {
  2238. margin-left: 8px;
  2239. }
  2240. :deep(.el-button--small.is-round) {
  2241. height: auto;
  2242. padding: 3px 11px;
  2243. }
  2244. .time {
  2245. color: rgb(31 31 31 / 88%);
  2246. text-align: right;
  2247. opacity: 0.5;
  2248. flex: 1;
  2249. }
  2250. }
  2251. .desc {
  2252. margin-top: 7px;
  2253. color: #41475c;
  2254. opacity: 0.8;
  2255. span {
  2256. opacity: 0.5;
  2257. }
  2258. }
  2259. }
  2260. .error-item {
  2261. display: flex;
  2262. padding: 7px 10px;
  2263. color: #41475c;
  2264. background-color: #f5f5fa;
  2265. border: 1px solid var(--el-border-color);
  2266. border-width: 1px 0;
  2267. align-items: center;
  2268. .el-icon {
  2269. margin-right: 6px;
  2270. }
  2271. &:nth-child(n + 1) {
  2272. margin-top: -1px;
  2273. }
  2274. &:nth-child(even) {
  2275. background-color: #fff;
  2276. }
  2277. }
  2278. .history-item {
  2279. padding: 7px 10px 10px;
  2280. margin-bottom: 13px;
  2281. color: #41475c;
  2282. background-color: #f5f5fa;
  2283. border-radius: 2px;
  2284. .history-title {
  2285. display: flex;
  2286. align-items: center;
  2287. margin-left: -10px;
  2288. font-weight: 600;
  2289. line-height: 20px;
  2290. &::before {
  2291. display: block;
  2292. width: 4px;
  2293. height: 15px;
  2294. margin-right: 7px;
  2295. background: #4978f6;
  2296. content: '';
  2297. }
  2298. }
  2299. p {
  2300. margin: 10px 0;
  2301. line-height: 20px;
  2302. }
  2303. .history-footer {
  2304. display: flex;
  2305. // align-items: center;
  2306. font-size: 12px;
  2307. .name {
  2308. color: #4978f6;
  2309. }
  2310. .time {
  2311. margin-left: 2px;
  2312. color: rgb(65 71 92 / 50%);
  2313. }
  2314. div {
  2315. flex: 1;
  2316. display: flex;
  2317. justify-content: flex-end;
  2318. .el-button span {
  2319. font-size: 12px;
  2320. }
  2321. }
  2322. }
  2323. }
  2324. }
  2325. .videoAndImg {
  2326. flex: 1;
  2327. width: 100%;
  2328. overflow-y: auto;
  2329. }
  2330. }
  2331. .operation-item {
  2332. position: relative;
  2333. max-height: calc(100% / 3 - 10px);
  2334. margin-bottom: 10px;
  2335. overflow-y: auto;
  2336. .item-header {
  2337. position: sticky;
  2338. top: 0;
  2339. left: 0;
  2340. z-index: 1000;
  2341. width: 100%;
  2342. height: 28px;
  2343. padding-left: 20px;
  2344. font-size: 16px;
  2345. line-height: 28px;
  2346. color: #fff;
  2347. background: #fff url('@/assets/imgs/pressure/my-task-detail-operation-bg.png') no-repeat
  2348. left top;
  2349. background-size: 100% 28px;
  2350. }
  2351. .item-content1 {
  2352. display: flex;
  2353. margin-top: 10px;
  2354. &-item {
  2355. font-size: 14px;
  2356. }
  2357. &-img {
  2358. flex: 1;
  2359. display: grid;
  2360. grid-template-columns: repeat(3, 1fr);
  2361. grid-gap: 10px;
  2362. .item-content1-img-item{
  2363. width: 100px;
  2364. height: 100px;
  2365. position: relative;
  2366. .list-item-tool {
  2367. position: absolute;
  2368. top: 0;
  2369. left: 0;
  2370. width: 100%;
  2371. height: 100%;
  2372. z-index: 99;
  2373. border-radius: 8px;
  2374. transition: all 0.5s ease;
  2375. cursor: pointer;
  2376. display: flex;
  2377. justify-content: center;
  2378. align-items: center;
  2379. gap: 5px;
  2380. &:hover {
  2381. backdrop-filter: blur(2px);
  2382. background-color: #00000076;
  2383. z-index: 1;
  2384. .icon {
  2385. display: inline-block;
  2386. opacity: 1;
  2387. &:hover {
  2388. color: #ffffff;
  2389. transition: all 0.5s ease;
  2390. }
  2391. }
  2392. }
  2393. .icon {
  2394. color: #ffffff99;
  2395. opacity: 0;
  2396. transition: all 0.5s ease;
  2397. font-size: 16px;
  2398. }
  2399. }
  2400. }
  2401. .img-item {
  2402. width: 100px;
  2403. height: 100px;
  2404. }
  2405. }
  2406. }
  2407. .record-item {
  2408. margin-bottom: 10px;
  2409. background-color: #f5f5fa;
  2410. border-radius: 2px;
  2411. }
  2412. .item-content {
  2413. padding: 10px 0;
  2414. font-size: 14px;
  2415. .el-empty {
  2416. width: 100%;
  2417. height: 150px;
  2418. padding: 0;
  2419. box-sizing: border-box;
  2420. }
  2421. &-item {
  2422. height: 32px;
  2423. display: flex;
  2424. align-items: center;
  2425. gap: 8px;
  2426. }
  2427. }
  2428. .record-item-title {
  2429. height: 31px;
  2430. padding: 0 13px;
  2431. line-height: 31px;
  2432. background: linear-gradient(270deg, rgb(128 176 251 / 20%) 0%, rgb(73 120 246 / 20%) 100%);
  2433. border-radius: 2px;
  2434. }
  2435. .record-item-inner {
  2436. padding: 11px 13px 8px;
  2437. .content {
  2438. display: flex;
  2439. align-items: center;
  2440. .el-button {
  2441. margin-left: 8px;
  2442. }
  2443. :deep(.el-button--small.is-round) {
  2444. height: auto;
  2445. padding: 3px 11px;
  2446. }
  2447. .time {
  2448. color: rgb(31 31 31 / 88%);
  2449. text-align: right;
  2450. opacity: 0.5;
  2451. flex: 1;
  2452. }
  2453. }
  2454. .desc {
  2455. margin-top: 7px;
  2456. color: #41475c;
  2457. opacity: 0.8;
  2458. span {
  2459. opacity: 0.5;
  2460. }
  2461. }
  2462. }
  2463. .error-item {
  2464. display: flex;
  2465. padding: 7px 10px;
  2466. color: #41475c;
  2467. background-color: #f5f5fa;
  2468. border: 1px solid var(--el-border-color);
  2469. border-width: 1px 0;
  2470. align-items: center;
  2471. .el-icon {
  2472. margin-right: 6px;
  2473. }
  2474. &:nth-child(n + 1) {
  2475. margin-top: -1px;
  2476. }
  2477. &:nth-child(even) {
  2478. background-color: #fff;
  2479. }
  2480. }
  2481. .history-item {
  2482. padding: 7px 10px 10px;
  2483. margin-bottom: 13px;
  2484. color: #41475c;
  2485. background-color: #f5f5fa;
  2486. border-radius: 2px;
  2487. .history-title {
  2488. display: flex;
  2489. align-items: center;
  2490. margin-left: -10px;
  2491. font-weight: 600;
  2492. line-height: 20px;
  2493. &::before {
  2494. display: block;
  2495. width: 4px;
  2496. height: 15px;
  2497. margin-right: 7px;
  2498. background: #4978f6;
  2499. content: '';
  2500. }
  2501. }
  2502. p {
  2503. margin: 10px 0;
  2504. line-height: 20px;
  2505. }
  2506. .history-footer {
  2507. display: flex;
  2508. // align-items: center;
  2509. font-size: 12px;
  2510. .name {
  2511. color: #4978f6;
  2512. }
  2513. .time {
  2514. margin-left: 2px;
  2515. color: rgb(65 71 92 / 50%);
  2516. }
  2517. div {
  2518. flex: 1;
  2519. display: flex;
  2520. justify-content: flex-end;
  2521. .el-button span {
  2522. font-size: 12px;
  2523. }
  2524. }
  2525. }
  2526. }
  2527. }
  2528. }
  2529. }
  2530. .default-toolbar {
  2531. display: flex;
  2532. justify-content: flex-end;
  2533. gap: 16px;
  2534. margin-bottom: 20px;
  2535. white-space: nowrap;
  2536. ::v-deep .el-button {
  2537. margin-left: 0;
  2538. }
  2539. }
  2540. // 退回对话框样式
  2541. .reject-dialog-content {
  2542. .form-item {
  2543. margin-bottom: 20px;
  2544. &:last-child {
  2545. margin-bottom: 0;
  2546. }
  2547. .form-label {
  2548. display: block;
  2549. margin-bottom: 8px;
  2550. font-size: 14px;
  2551. font-weight: 500;
  2552. color: #606266;
  2553. }
  2554. }
  2555. }
  2556. :deep(.preview-dialog) {
  2557. background-color: transparent !important;
  2558. width: auto !important;
  2559. padding: 0 !important;
  2560. .el-dialog__header {
  2561. display: none;
  2562. }
  2563. .el-dialog__body{
  2564. padding: 0;
  2565. .preview-container{
  2566. padding: 0;
  2567. position: relative;
  2568. }
  2569. .preview-image,.preview-video {
  2570. height: 65vh;
  2571. max-width: 100vw;
  2572. // object-fit: cover;
  2573. }
  2574. }
  2575. }
  2576. </style>