StatusOperationPanel.vue 105 KB

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