StatusOperationPanel.vue 109 KB

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