StatusOperationPanel.vue 110 KB

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