StatusOperationPanel.vue 101 KB

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