infoDialog.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. <!--
  2. <infoDialog v-if="infoDialogType" :propsInfoDialogData="propsInfoDialogData"></infoDialog>
  3. import infoDialog from '@/views/safetyCheck/components/infoDialog/infoDialog.vue'
  4. components: {
  5. infoDialog,
  6. },
  7. infoDialogType:false,
  8. propsInfoDialogData:{},
  9. //开关详情页面
  10. addDialogOpen(type,data){
  11. if(this.infoDialogType != type){
  12. if(type){
  13. let obj = {
  14. id:data.id
  15. }
  16. this.$set(this,'propsInfoDialogData',obj);
  17. this.$set(this,'infoDialogType',type);
  18. }else{
  19. this.getList();
  20. this.$set(this,'infoDialogType',type);
  21. }
  22. }
  23. },
  24. -->
  25. <template>
  26. <el-dialog class="safetyHazard-info-dialog-box" @close="outDialog"
  27. v-loading="loading"
  28. :title="infoDialogData.checkHazardApplyDto.rectifyStatus==1?'已完成':(infoDialogData.checkHazardApplyDto.rectifyStatus==2?'待整改':(infoDialogData.checkHazardApplyDto.rectifyStatus==3?'待复核':(infoDialogData.checkHazardApplyDto.rectifyStatus==4?'暂无法整改':'')))"
  29. :visible.sync="infoDialogType" v-if="infoDialogType"
  30. width="1184px" append-to-body>
  31. <div class="info-dialog-title-box scrollbar-box">
  32. <div class="info-dialog-for-title-box" @click="checkTitleButton('info')" :class="infoDialogCheckIndex == 'info'?'info-dialog-for-check':''">
  33. <p>隐患检查</p>
  34. <p></p>
  35. </div>
  36. <div class="info-dialog-for-title-box" :class="infoDialogCheckIndex == index?'info-dialog-for-check':''"
  37. @click="checkTitleButton(index)" v-for="(item,index) in infoDialogData.checkRectifyApplyList" :key="index">
  38. <!--<p>{{item.applyFlag==1?'隐患整改':(item.applyFlag==2?'整改复核':'')}}</p>-->
  39. <p>{{item.titleName}}</p>
  40. <p></p>
  41. </div>
  42. <div class="info-dialog-for-title-box" v-if="addFormType == 1 || addFormType == 2" @click="checkTitleButton('add')" :class="infoDialogCheckIndex == 'add'?'info-dialog-for-check':''">
  43. <p>{{addFormTitle}}</p>
  44. <p></p>
  45. </div>
  46. </div>
  47. <div class="info-dialog-content-box scrollbar-box">
  48. <div class="info-dialog-content-info" v-if="infoDialogCheckIndex == 'info' && imgDocumentType == 0">
  49. <div class="text-box-box">
  50. <p>计划标题</p>
  51. <p>{{infoDialogData.title}}</p>
  52. </div>
  53. <div class="text-box-two-box">
  54. <div>
  55. <p>检查类型</p>
  56. <p>{{infoDialogData.checkType==1?'校园巡查':(infoDialogData.checkType==2?'实验室自查':'')}}</p>
  57. </div>
  58. <div>
  59. <p>{{infoDialogData.checkType==1?'计划周期':(infoDialogData.checkType==2?'任务周期':'')}}</p>
  60. <p>{{infoDialogData.cycleStartTime}} 至 {{infoDialogData.cycleEndTime}}</p>
  61. </div>
  62. </div>
  63. <div class="text-box-two-box">
  64. <div>
  65. <p>学院</p>
  66. <p>{{infoDialogData.collegeName}}</p>
  67. </div>
  68. <div>
  69. <p>实验室</p>
  70. <p>{{infoDialogData.subjectName}} - {{infoDialogData.roomNumber}}</p>
  71. </div>
  72. </div>
  73. <div class="text-box-two-box">
  74. <div>
  75. <p>楼栋</p>
  76. <p>{{infoDialogData.buildName}}</p>
  77. </div>
  78. </div>
  79. <div class="text-box-box">
  80. <p>检查要求</p>
  81. <p>{{infoDialogData.checkDemand}}</p>
  82. </div>
  83. <div class="text-box-two-box">
  84. <div>
  85. <p>检查结果</p>
  86. <p>{{infoDialogData.checkResult==0?'不符合':(infoDialogData.checkResult==1?'符合':'')}}</p>
  87. </div>
  88. <div>
  89. <p>整改期限</p>
  90. <p>{{infoDialogData.rectifyDeadline}}</p>
  91. </div>
  92. </div>
  93. <div class="button-box">
  94. <p>{{infoDialogData.rectifyNotice == 1?'整改告知书':(infoDialogData.rectifyNotice == 2?'整改通知书':'')}}</p>
  95. <p class="inquire-button-one" @click="lookDocument(1,infoDialogData.data18)">查看</p>
  96. <p class="add-button-one-90">下载</p>
  97. </div>
  98. <div class="text-box-two-box">
  99. <div>
  100. <p>检查者</p>
  101. <p>{{infoDialogData.checkUser}}</p>
  102. </div>
  103. <div>
  104. <p>检查时间</p>
  105. <p>{{infoDialogData.checkTime}}</p>
  106. </div>
  107. </div>
  108. <div class="table-box">
  109. <p class="table-title-p">隐患项</p>
  110. <div class="table-min">
  111. <div class="left-box">
  112. <p></p>
  113. <p>检查项目</p>
  114. <p></p>
  115. </div>
  116. <div class="right-box text-two-box">
  117. <p></p>
  118. <p>{{infoDialogData.checkHazardApplyDto.hazardCheckProStr}}</p>
  119. <p></p>
  120. <p v-if="infoDialogData.checkHazardApplyDto.hazardCheckCount>0">此检查项在当前实验室累计出现 <span>{{infoDialogData.checkHazardApplyDto.hazardCheckCount}}</span> 次隐患</p>
  121. <p></p>
  122. </div>
  123. </div>
  124. <div class="table-min">
  125. <div class="left-box">
  126. <p></p>
  127. <p>隐患描述</p>
  128. <p></p>
  129. </div>
  130. <div class="right-box text-box">
  131. <p></p>
  132. <p>{{infoDialogData.checkHazardApplyDto.hazardDescribe}}</p>
  133. <p></p>
  134. </div>
  135. </div>
  136. <div class="table-min">
  137. <div class="left-box">
  138. <p></p>
  139. <p>隐患等级</p>
  140. <p></p>
  141. </div>
  142. <div class="right-box text-box">
  143. <p></p>
  144. <p>{{infoDialogData.checkHazardApplyDto.hazardLevel==2?'一般隐患':(infoDialogData.checkHazardApplyDto.hazardLevel==1?'重大隐患':(infoDialogData.checkHazardApplyDto.hazardLevel==3?'管理问题':''))}}</p>
  145. <p></p>
  146. </div>
  147. </div>
  148. <div class="table-min">
  149. <div class="left-box">
  150. <p></p>
  151. <p>检查要点</p>
  152. <p></p>
  153. </div>
  154. <div class="right-box text-box">
  155. <p></p>
  156. <p>{{infoDialogData.checkHazardApplyDto.hazardCheckPoint}}</p>
  157. <p></p>
  158. </div>
  159. </div>
  160. <div class="table-min">
  161. <div class="left-box">
  162. <p></p>
  163. <p>隐患照片</p>
  164. <p></p>
  165. </div>
  166. <div class="right-box img-box">
  167. <img :src="imgItem.fileUrl" v-for="(imgItem,index) in infoDialogData.checkHazardApplyDto.uploadDtoList"
  168. :key="index" @click="lookImg(infoDialogData.checkHazardApplyDto.uploadDtoList,index)">
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div class="info-dialog-content-type" v-if="infoDialogCheckIndex == index && imgDocumentType == 0"
  174. v-for="(item,index) in infoDialogData.checkRectifyApplyList" :key="index">
  175. <!--已整改-->
  176. <div class="has-rectification" v-if="item.applyFlag == 1">
  177. <div class="button-box">
  178. <p>整改结果</p>
  179. <p>{{item.rectifyResult == 1?'已整改':(item.rectifyResult == 0?'暂无法整改':'')}}</p>
  180. </div>
  181. <div class="text-box">
  182. <p>整改措施</p>
  183. <p>{{item.rectifyMeasure}}</p>
  184. </div>
  185. <div class="img-box">
  186. <p>整改照片</p>
  187. <div>
  188. <img :src="imgItem.fileUrl" @click="lookImg(item.uploadDtoList,imgIndex)"
  189. v-for="(imgItem,imgIndex) in item.uploadDtoList" :key="imgIndex">
  190. </div>
  191. </div>
  192. <div class="text-box-two">
  193. <div>
  194. <p>整改人</p>
  195. <p>{{item.createName}}</p>
  196. </div>
  197. <div style="margin-left:26px;">
  198. <p>整改时间</p>
  199. <p>{{item.createTime}}</p>
  200. </div>
  201. </div>
  202. </div>
  203. <!--已审核-->
  204. <div class="has-inspection" v-if="item.applyFlag == 2">
  205. <div class="type-box">
  206. <p>审核结果</p>
  207. <img v-if="item.examineResult == 0" src="@/assets/ZDimages/safetyCheck/icon_zcgl_sb.png">
  208. <img v-if="item.examineResult == 1" src="@/assets/ZDimages/safetyCheck/icon_zcgl_cg.png">
  209. </div>
  210. <div class="text-box">
  211. <p>审核意见</p>
  212. <p>{{item.examineOpinion}}</p>
  213. </div>
  214. <div class="text-box-two">
  215. <div>
  216. <p>审核人</p>
  217. <p>{{item.reviewedName}}</p>
  218. </div>
  219. <div style="margin-left:26px;">
  220. <p>审核时间</p>
  221. <p>{{item.reviewedTime}}</p>
  222. </div>
  223. </div>
  224. <div class="button-box" v-if="item.examineResult == 1">
  225. <p>整改报告书</p>
  226. <p class="inquire-button-one" @click="lookDocument(2,item.dataL)">查看</p>
  227. <p class="add-button-one-90">下载</p>
  228. </div>
  229. </div>
  230. </div>
  231. <div class="info-dialog-content-add" v-if="infoDialogCheckIndex == 'add' && imgDocumentType == 0">
  232. <el-form ref="addForm" :model="addForm" :rules="rules" label-width="90px">
  233. <!--待整改-->
  234. <div class="stay-rectification" v-if="addFormType == 1">
  235. <el-form-item label="整改结果" prop="rectifyResult">
  236. <el-radio-group v-model="addForm.rectifyResult">
  237. <el-radio :label="1">已整改</el-radio>
  238. <el-radio :label="0">暂无法整改</el-radio>
  239. </el-radio-group>
  240. </el-form-item>
  241. <el-form-item :label="addForm.rectifyResult==1?'整改措施':'原因描述'" prop="rectifyMeasure">
  242. <el-input
  243. type="textarea"
  244. :autosize="{ minRows: 4, maxRows: 4}"
  245. :placeholder="addForm.rectifyResult==1?'请输入整改措施':'请输入原因描述'"
  246. resize="none"
  247. maxlength="100"
  248. show-word-limit
  249. v-model="addForm.rectifyMeasure">
  250. </el-input>
  251. </el-form-item>
  252. <el-form-item label="上传照片" prop="uploadDtoList">
  253. <div class="for-img-box" v-for="(img,imgIndex) in addForm.uploadDtoList" :key="imgIndex">
  254. <img class="for-img" :src="img.fileUrl" @click="lookImg(addForm.uploadDtoList,imgIndex)">
  255. <p class="for-del-button el-icon-circle-close" @click="delImg(imgIndex)"></p>
  256. </div>
  257. <el-upload
  258. v-if="addForm.uploadDtoList.length<5"
  259. style="display: inline-block;overflow: hidden"
  260. class="avatar-uploader"
  261. :action="uploadImgUrl"
  262. :show-file-list="false"
  263. :on-success="(res)=>handleAvatarSuccess(res,addForm)"
  264. :headers="headers"
  265. :before-upload="(res)=>beforeAvatarUpload(res,addForm)">
  266. <p class="el-icon-plus up-img-p" style="display: inline-block"></p>
  267. </el-upload>
  268. </el-form-item>
  269. <p style="margin-left:80px;">支持jpg/png/bmp/gif格式,且不超过2M,最多上传5张</p>
  270. </div>
  271. <!--待审核-->
  272. <div class="stay-inspection" v-if="addFormType == 2">
  273. <el-form-item label="审核意见" prop="examineOpinion">
  274. <el-input
  275. type="textarea"
  276. :autosize="{ minRows: 4, maxRows: 4}"
  277. placeholder="请输入审核意见"
  278. resize="none"
  279. maxlength="100"
  280. show-word-limit
  281. v-model="addForm.examineOpinion">
  282. </el-input>
  283. </el-form-item>
  284. <div class="quick-selection-box">
  285. <p class="quick-selection-title">快捷输入</p>
  286. <p class="quick-selection-for" @click="stayInspectionClick(item)"
  287. v-for="(item,index) in quickSelection" :key="index">{{item}}</p>
  288. </div>
  289. </div>
  290. </el-form>
  291. </div>
  292. <div class="info-dialog-content-img" v-if="imgDocumentType == 1">
  293. <img :src="imgList[imgIndex].fileUrl">
  294. <p class="el-icon-arrow-left left-button-p" @click="infoLeftButton"></p>
  295. <p class="el-icon-arrow-right right-button-p" @click="infoRightButton"></p>
  296. <p class="bottom-num-text">{{imgIndex+1}} / {{imgList.length}}</p>
  297. <p class="out-button" @click="outLook">返回</p>
  298. </div>
  299. <div class="info-dialog-content-document" v-if="imgDocumentType == 2">
  300. <iframe
  301. class="iframe"
  302. :src="iframeSrc" scrolling="auto" frameborder="0">
  303. </iframe>
  304. <p class="out-button" @click="outLook">返回</p>
  305. </div>
  306. <div class="info-dialog-content-document-list" v-if="imgDocumentType == 3">
  307. <div class="left-box">
  308. <div class="left-title-box">
  309. <img src="@/assets/ZDimages/safetyCheck/icon_dr_wj.png">
  310. <p>材料附件</p>
  311. </div>
  312. <div class="left-for-box scrollbar-box">
  313. <p class="left-for-p" v-for="(iframeItem,iframeIndex) in iframeSrcList" :key="iframeIndex"
  314. @click="lookDocumentListCheck(iframeIndex)"
  315. :class="iframeSrcIndex == iframeIndex?'check-p':''">{{iframeItem.name}}</p>
  316. </div>
  317. </div>
  318. <div class="center-border"></div>
  319. <div class="right-box">
  320. <iframe
  321. class="iframe"
  322. :src="iframeSrc" scrolling="auto" frameborder="0">
  323. </iframe>
  324. </div>
  325. <p class="out-button" @click="outLook">返回</p>
  326. </div>
  327. </div>
  328. <div class="bottom-button-box dialog-footer-box" v-if="infoDialogCheckIndex == 'add'">
  329. <p class="dialog-footer-button-null"></p>
  330. <p class="dialog-footer-button-info" @click="outDialog">取消</p>
  331. <p class="dialog-footer-button-primary" v-if="addFormType==1" @click="upDataButton(1)">提交</p>
  332. <p class="dialog-footer-button-border" v-if="addFormType==2" @click="upDataButton(2)">驳回</p>
  333. <p class="dialog-footer-button-primary" v-if="addFormType==2" @click="upDataButton(3)">通过</p>
  334. <p class="dialog-footer-button-null"></p>
  335. </div>
  336. </el-dialog>
  337. </template>
  338. <script>
  339. import { getHazardById,addOrApprove } from '@/api/safetyCheck/index'
  340. import { getToken } from "@/utils/auth";
  341. export default {
  342. name: 'infoDialog',
  343. props:{
  344. propsInfoDialogData:{},
  345. },
  346. data(){
  347. return{
  348. loading:false,
  349. upDataName:"",
  350. uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
  351. headers: {
  352. Authorization: "Bearer " + getToken(),
  353. },
  354. infoDialogType:false,
  355. //img 与 document 展示状态
  356. imgDocumentType:0,
  357. infoDialogCheckIndex:'info',
  358. infoDialogData:{},
  359. //图片
  360. imgList:[],
  361. imgIndex:0,
  362. saveIndex:0,
  363. //文档地址
  364. iframeSrc:"",
  365. iframeSrcIndex:0,
  366. iframeSrcList:[],
  367. // 提交数据
  368. addFormType:null,//1整改 2审核 默认NULL 回调数据内判定当前状态
  369. addFormTitle:null,
  370. addForm:{
  371. rectifyResult:'',
  372. rectifyMeasure:'',
  373. uploadDtoList:[],
  374. examineOpinion:'',
  375. },
  376. rules: {
  377. rectifyResult: [
  378. { required: true, message: "请选择整改结果", trigger: "change" },
  379. ],
  380. uploadDtoList: [
  381. { required: true, message: "请选择上传图片", trigger: "change" },
  382. ],
  383. rectifyMeasure: [
  384. { required: true, message: '请输入内容', trigger: "change" },
  385. { required: true, message: '请输入内容', validator: this.spaceJudgment, trigger: "change" },
  386. ],
  387. examineOpinion: [
  388. { required: true, message: "请输入内容", trigger: "change" },
  389. ],
  390. },
  391. //快速选择
  392. quickSelection:['复核驳回','未解决','驳回再整改','请补充材料','请补充描述',],
  393. }
  394. },
  395. created(){
  396. },
  397. mounted(){
  398. this.getHazardById();
  399. },
  400. methods:{
  401. //提交
  402. upDataButton(type){
  403. this.$refs["addForm"].validate(valid => {
  404. if (valid) {
  405. let obj = JSON.parse(JSON.stringify(this.addForm));
  406. if(type == 1){
  407. //整改
  408. obj.checkHazardId = this.infoDialogData.checkHazardApplyDto.id
  409. delete obj.examineOpinion
  410. }else if(type != 1){
  411. //审核
  412. obj.id = this.infoDialogData.checkRectifyApplyList[this.infoDialogData.checkRectifyApplyList.length-1].id;
  413. obj.examineResult = type==2?0:(type==3?1:'');
  414. delete obj.rectifyResult
  415. delete obj.rectifyMeasure
  416. delete obj.uploadDtoList
  417. }
  418. addOrApprove(obj).then(response => {
  419. this.msgSuccess(response.msg);
  420. this.$parent.addDialogOpen(false);
  421. })
  422. }
  423. })
  424. },
  425. //获取详情
  426. getHazardById(){
  427. getHazardById({id:this.propsInfoDialogData.id}).then(response => {
  428. console.log('response.data.checkRectifyApplyList[0]',response.data.checkRectifyApplyList)
  429. if(response.data.checkRectifyApplyList[0]){
  430. if(response.data.checkRectifyApplyList[response.data.checkRectifyApplyList.length-1].applyFlag == 1){
  431. if(response.data.checkHazardApplyDto.applyGentle){
  432. //已整改
  433. if(response.data.checkHazardApplyDto.rectifyStatus != 4){
  434. this.$set(this,'addFormType',2)
  435. if(response.data.checkRectifyApplyList.length>2){
  436. this.$set(this,'addFormTitle',this.frequencyCalculation(response.data.checkRectifyApplyList.length,2)+'复核')
  437. }else{
  438. this.$set(this,'addFormTitle','整改复核')
  439. }
  440. }
  441. }
  442. }else if(response.data.checkRectifyApplyList[response.data.checkRectifyApplyList.length-1].applyFlag == 2){
  443. if(response.data.checkHazardApplyDto.rectifyGentle){
  444. //已复核
  445. if(response.data.checkRectifyApplyList[response.data.checkRectifyApplyList.length-1].examineResult == 0){
  446. //复核驳回
  447. this.$set(this,'addFormType',1)
  448. if(response.data.checkRectifyApplyList.length>1){
  449. this.$set(this,'addFormTitle',this.frequencyCalculation(response.data.checkRectifyApplyList.length,1)+'整改')
  450. }else{
  451. this.$set(this,'addFormTitle','隐患整改')
  452. }
  453. }
  454. }
  455. }
  456. }else{
  457. if(response.data.checkHazardApplyDto.rectifyGentle){
  458. //初次整改
  459. this.$set(this,'addFormType',1)
  460. this.$set(this,'addFormTitle','隐患整改')
  461. }
  462. }
  463. for(let i=0;i<response.data.checkRectifyApplyList.length;i++){
  464. console.log("i=",i);
  465. if(i == 0){
  466. response.data.checkRectifyApplyList[i].titleName = '隐患整改'
  467. }else if(i == 1){
  468. response.data.checkRectifyApplyList[i].titleName = '整改复核'
  469. }else{
  470. let nameLeft = this.frequencyCalculation(i,response.data.checkRectifyApplyList[i].applyFlag);
  471. let nameRight = response.data.checkRectifyApplyList[i].applyFlag == 1?'整改':'复核';
  472. response.data.checkRectifyApplyList[i].titleName = nameLeft+nameRight;
  473. }
  474. }
  475. this.$set(this,'infoDialogData',response.data);
  476. this.$set(this,'infoDialogType',true);
  477. });
  478. },
  479. //标签切换
  480. checkTitleButton(index){
  481. if(this.infoDialogCheckIndex != index){
  482. this.$set(this,'imgDocumentType',0);
  483. this.$set(this,'infoDialogCheckIndex',index);
  484. }
  485. },
  486. //快速选择内容
  487. stayInspectionClick(val){
  488. this.$set(this.addForm,'examineOpinion',val);
  489. },
  490. //点击查看文档
  491. lookDocument(type,data){
  492. if(type == 1){
  493. this.$set(this,'iframeSrcIndex',0);
  494. this.$set(this,'iframeSrcList',data);
  495. this.$set(this,'iframeSrc',this.urlJudge(data[0].url));
  496. this.$set(this,'imgDocumentType',3);
  497. }else if(type == 2){
  498. this.$set(this,'iframeSrc',this.urlJudge(data));
  499. this.$set(this,'imgDocumentType',2);
  500. }
  501. },
  502. lookDocumentListCheck(val){
  503. this.$set(this,'iframeSrcIndex',val);
  504. this.$set(this,'iframeSrc',this.urlJudge(this.iframeSrcList[val].url));
  505. },
  506. //点击查看图片
  507. lookImg(list,index){
  508. this.$set(this,'imgList',list)
  509. this.$set(this,'imgIndex',index)
  510. this.$set(this,'imgDocumentType',1);
  511. },
  512. outLook(){
  513. this.$set(this,'imgDocumentType',0);
  514. },
  515. //图片左右按键
  516. infoLeftButton(){
  517. if (this.imgIndex == 0){
  518. this.msgError('当前是第一张')
  519. }else{
  520. this.imgIndex--
  521. }
  522. },
  523. infoRightButton(){
  524. if (this.imgIndex == this.imgList.length-1){
  525. this.msgError('当前是最后一张')
  526. }else{
  527. this.imgIndex++
  528. }
  529. },
  530. /*==========上传相关==========*/
  531. handleAvatarSuccess(res,item) {
  532. this.$set(this,'loading',false);
  533. if(item.uploadDtoList.length>4){
  534. this.msgError('最多只可上传5张')
  535. return
  536. }
  537. let suffixName= this.upDataName.split('.')[this.upDataName.split('.').length - 2]
  538. //判断文件名中是否有逗号和分号
  539. if(suffixName.indexOf(',')==-1 && suffixName.indexOf(';')==-1){
  540. }else{
  541. this.msgError('文件名里包含逗号或分号,请修改后重新上传!')
  542. return
  543. }
  544. let obj ={
  545. fileName:this.upDataName,
  546. fileUrl:res.data.url,
  547. fileType:2,
  548. };
  549. item.uploadDtoList.push(obj);
  550. this.$forceUpdate()
  551. },
  552. beforeAvatarUpload(file,item) {
  553. console.log('file',file)
  554. if(item.uploadDtoList.length>4){
  555. this.msgError('最多只可上传5张')
  556. return false
  557. }
  558. let type = false;
  559. if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif' || file.type == 'image/bmp') {
  560. if(file.size> 2100000){
  561. this.msgError('上传图片大小不能超过2M')
  562. return false
  563. }
  564. this.$set(this,'loading',true);
  565. this.upDataName = file.name;
  566. type = true;
  567. }else{
  568. this.msgError('仅支持jpg/png/bmp/gif格式')
  569. type = false;
  570. }
  571. return type;
  572. },
  573. // 删除图片
  574. delImg(imgIndex){
  575. this.addForm.uploadDtoList.splice(imgIndex,1);
  576. },
  577. //退出
  578. outDialog(){
  579. this.$parent.addDialogOpen(false);
  580. },
  581. //多次名称匹配
  582. frequencyCalculation(length,type){
  583. let textList = [
  584. {value:'二次',key:'2'},{value:'三次',key:'3'},{value:'四次',key:'4'},{value:'五次',key:'5'}, {value:'六次',key:'6'},
  585. {value:'七次',key:'7'},{value:'八次',key:'8'},{value:'九次',key:'9'},{value:'十次',key:'10'}
  586. ]
  587. let num = type === 2?Math.ceil(length/2):Math.floor(length/2)
  588. if(type == 1){
  589. num++
  590. }
  591. if (num > 10){
  592. return '再次'
  593. } else{
  594. for(let i=0;i<textList.length;i++){
  595. if(num == textList[i].key){
  596. return textList[i].value
  597. }
  598. }
  599. }
  600. },
  601. },
  602. }
  603. </script>
  604. <style scoped lang="scss">
  605. .safetyHazard-info-dialog-box{
  606. ::v-deep .el-dialog__body{
  607. padding:0 0 30px 0;
  608. }
  609. ::v-deep .el-form-item__label{
  610. font-size:16px;
  611. }
  612. .info-dialog-title-box{
  613. border-bottom:1px solid #E0E0E0;
  614. padding:0 30px;
  615. overflow-x: scroll;
  616. overflow-y: hidden;
  617. height:80px;
  618. white-space: nowrap;
  619. .info-dialog-for-title-box{
  620. height:80px;
  621. width: 80px;
  622. margin-right:44px;
  623. overflow: hidden;
  624. display: inline-block;
  625. p:nth-child(1){
  626. height:44px;
  627. line-height:44px;
  628. margin-top:18px;
  629. text-align: center;
  630. color:#333;
  631. font-size:16px;
  632. cursor: pointer;
  633. }
  634. p:nth-child(2){
  635. height:4px;
  636. width:40px;
  637. margin:0 auto;
  638. border-radius:4px;
  639. }
  640. }
  641. .info-dialog-for-check{
  642. p:nth-child(1){
  643. font-size:16px;
  644. color:#0045AF;
  645. }
  646. p:nth-child(2){
  647. background-color: #0045AF;
  648. }
  649. }
  650. }
  651. .info-dialog-content-box{
  652. padding:30px 70px 0;
  653. height:600px;
  654. .info-dialog-content-info{
  655. .text-box-box{
  656. display: flex;
  657. margin-top:20px;
  658. p{
  659. font-size:16px;
  660. color:#333;
  661. line-height:40px;
  662. }
  663. p:nth-child(1){
  664. width:95px;
  665. text-align: right;
  666. margin-right:16px;
  667. font-size:16px;
  668. }
  669. p:nth-child(2){
  670. width:928px;
  671. padding:10px 20px;
  672. overflow: hidden;
  673. background: #F5F5F5;
  674. border-radius:4px;
  675. font-size:14px;
  676. line-height:20px;
  677. }
  678. }
  679. .text-box-two-box{
  680. display: flex;
  681. margin-top:20px;
  682. div{
  683. display: flex;
  684. p{
  685. font-size:16px;
  686. color:#333;
  687. line-height:40px;
  688. }
  689. p:nth-child(1){
  690. text-align: right;
  691. margin-right:16px;
  692. font-size:16px;
  693. }
  694. p:nth-child(2){
  695. padding:0 20px;
  696. overflow: hidden;
  697. background: #F5F5F5;
  698. border-radius:4px;
  699. font-size:14px;
  700. }
  701. }
  702. div:nth-child(1){
  703. p:nth-child(1){
  704. width:95px;
  705. }
  706. p:nth-child(2){
  707. width:400px;
  708. }
  709. }
  710. div:nth-child(2){
  711. p:nth-child(1){
  712. width:117px;
  713. }
  714. p:nth-child(2){
  715. width:400px;
  716. }
  717. }
  718. }
  719. .button-box{
  720. display: flex;
  721. margin-top:20px;
  722. p{
  723. font-size:16px;
  724. line-height:40px;
  725. }
  726. p:nth-child(1){
  727. color:#333;
  728. width:95px;
  729. text-align: right;
  730. margin-right:16px;
  731. }
  732. p:nth-child(2){
  733. width:70px;
  734. height:30px;
  735. line-height:30px;
  736. margin-top:5px;
  737. margin-right:12px;
  738. font-size:14px;
  739. }
  740. p:nth-child(3){
  741. width:70px;
  742. height:30px;
  743. line-height:30px;
  744. margin-top:5px;
  745. font-size:14px;
  746. }
  747. }
  748. .table-box{
  749. margin-left:16px;
  750. margin-top:20px;
  751. border:1px solid #e0e0e0;
  752. border-bottom:none;
  753. .table-title-p{
  754. background-color: #F5F5F5;
  755. line-height:50px;
  756. padding-left:30px;
  757. border-bottom:1px solid #e0e0e0;
  758. }
  759. .table-min{
  760. display: flex;
  761. overflow: hidden;
  762. border-bottom:1px solid #e0e0e0;
  763. .left-box{
  764. width:120px;
  765. display: flex;
  766. flex-direction: column;
  767. overflow: hidden;
  768. background-color: #F5F5F5;
  769. border-right:1px solid #e0e0e0;
  770. p:nth-child(1){
  771. flex:1;
  772. }
  773. p:nth-child(2){
  774. text-align: center;
  775. height:14px;
  776. line-height:14px;
  777. }
  778. p:nth-child(3){
  779. flex:1;
  780. }
  781. }
  782. .right-box{
  783. flex:1;
  784. overflow: hidden;
  785. min-height:60px;
  786. font-size:14px;
  787. padding:0 16px;
  788. line-height:20px;
  789. }
  790. .text-box{
  791. display: flex;
  792. flex-direction: column;
  793. p:nth-child(1){
  794. flex:1;
  795. min-height:12px;
  796. }
  797. p:nth-child(2){
  798. }
  799. p:nth-child(3){
  800. flex:1;
  801. min-height:12px;
  802. }
  803. }
  804. .text-two-box{
  805. p:nth-child(1){
  806. flex:1;
  807. min-height:12px;
  808. }
  809. p:nth-child(2){
  810. }
  811. p:nth-child(3){
  812. flex:1;
  813. min-height:12px;
  814. }
  815. p:nth-child(4){
  816. span{
  817. color:#FF0000;
  818. }
  819. }
  820. p:nth-child(5){
  821. flex:1;
  822. min-height:12px;
  823. }
  824. }
  825. .img-box{
  826. padding:20px;
  827. img{
  828. cursor: pointer;
  829. height:80px;
  830. width:80px;
  831. margin-right:10px;
  832. border-radius:4px;
  833. }
  834. }
  835. }
  836. }
  837. }
  838. .info-dialog-content-type{
  839. .has-rectification{
  840. .button-box{
  841. display: flex;
  842. p:nth-child(1){
  843. height:40px;
  844. line-height:40px;
  845. width:80px;
  846. font-size:16px;
  847. color:#333;
  848. text-align: right;
  849. margin-right:15px;
  850. }
  851. p:nth-child(2){
  852. text-align: center;
  853. width:80px;
  854. height:30px;
  855. margin-top:5px;
  856. line-height:30px;
  857. font-size:14px;
  858. color:#0183FA;
  859. }
  860. }
  861. .text-box{
  862. margin-top:20px;
  863. display: flex;
  864. p:nth-child(1){
  865. height:40px;
  866. line-height:40px;
  867. width:80px;
  868. font-size:16px;
  869. color:#333;
  870. text-align: right;
  871. margin-right:15px;
  872. }
  873. p:nth-child(2){
  874. font-size:14px;
  875. line-height:20px;
  876. min-height: 70px;
  877. padding:15px 20px;
  878. flex:1;
  879. background-color: #F5F5F5;
  880. border-radius:4px;
  881. }
  882. }
  883. .img-box{
  884. margin-top:20px;
  885. display: flex;
  886. p{
  887. height:40px;
  888. line-height:40px;
  889. width:80px;
  890. font-size:16px;
  891. color:#333;
  892. text-align: right;
  893. margin-right:15px;
  894. }
  895. img{
  896. cursor: pointer;
  897. width:80px;
  898. height:80px;
  899. margin-right:10px;
  900. border-radius:4px;
  901. }
  902. }
  903. .text-box-two{
  904. margin-top:20px;
  905. display: flex;
  906. div{
  907. display: flex;
  908. p:nth-child(1){
  909. height:40px;
  910. line-height:40px;
  911. width:80px;
  912. font-size:16px;
  913. color:#333;
  914. text-align: right;
  915. margin-right:15px;
  916. }
  917. p:nth-child(2){
  918. width:412px;
  919. height:40px;
  920. font-size:14px;
  921. line-height:40px;
  922. padding:0 20px;
  923. background-color: #F5F5F5;
  924. border-radius:4px;
  925. }
  926. }
  927. }
  928. }
  929. .has-inspection{
  930. .type-box{
  931. display: flex;
  932. p:nth-child(1){
  933. height:40px;
  934. line-height:40px;
  935. width:80px;
  936. font-size:16px;
  937. color:#333;
  938. text-align: right;
  939. margin-right:15px;
  940. }
  941. img{
  942. width:60px;
  943. height:52px;
  944. }
  945. }
  946. .text-box{
  947. margin-top:20px;
  948. display: flex;
  949. p:nth-child(1){
  950. height:40px;
  951. line-height:40px;
  952. width:80px;
  953. font-size:16px;
  954. color:#333;
  955. text-align: right;
  956. margin-right:15px;
  957. }
  958. p:nth-child(2){
  959. font-size:14px;
  960. line-height:20px;
  961. min-height: 70px;
  962. padding:15px 20px;
  963. flex:1;
  964. background-color: #F5F5F5;
  965. border-radius:4px;
  966. }
  967. }
  968. .text-box-two{
  969. margin-top:20px;
  970. display: flex;
  971. div{
  972. display: flex;
  973. p:nth-child(1){
  974. height:40px;
  975. line-height:40px;
  976. width:80px;
  977. font-size:16px;
  978. color:#333;
  979. text-align: right;
  980. margin-right:15px;
  981. }
  982. p:nth-child(2){
  983. width:412px;
  984. height:40px;
  985. font-size:14px;
  986. line-height:40px;
  987. padding:0 20px;
  988. background-color: #F5F5F5;
  989. border-radius:4px;
  990. overflow: hidden;
  991. }
  992. }
  993. }
  994. .button-box{
  995. margin-top:20px;
  996. display: flex;
  997. p:nth-child(1){
  998. height:40px;
  999. line-height:40px;
  1000. width:80px;
  1001. font-size:16px;
  1002. color:#333;
  1003. text-align: right;
  1004. margin-right:15px;
  1005. }
  1006. p:nth-child(2){
  1007. width:70px;
  1008. height:30px;
  1009. line-height:30px;
  1010. margin-top:5px;
  1011. }
  1012. p:nth-child(3){
  1013. width:70px;
  1014. height:30px;
  1015. line-height:30px;
  1016. margin-top:5px;
  1017. }
  1018. }
  1019. }
  1020. }
  1021. .info-dialog-content-add{
  1022. .stay-rectification{
  1023. .up-img-p{
  1024. height:80px;
  1025. width:80px;
  1026. line-height:80px;
  1027. text-align: center;
  1028. font-size:16px;
  1029. border-radius:4px;
  1030. border:1px dashed #E0E0E0;
  1031. }
  1032. .for-img-box{
  1033. width:80px;
  1034. height:80px;
  1035. border-radius:4px;
  1036. display: inline-block;
  1037. overflow: hidden;
  1038. margin-right:20px;
  1039. position: relative;
  1040. .for-img{
  1041. width:80px;
  1042. height:80px;
  1043. display: inline-block;
  1044. overflow: hidden;
  1045. }
  1046. .for-del-button{
  1047. background: rgba(0,0,0,0.7);
  1048. width:20px;
  1049. height:20px;
  1050. line-height: 20px;
  1051. text-align: center;
  1052. color:#fff;
  1053. border-bottom-left-radius:4px;
  1054. cursor: pointer;
  1055. position: absolute;
  1056. top:0;
  1057. right:0;
  1058. }
  1059. }
  1060. }
  1061. .stay-inspection{
  1062. .quick-selection-box{
  1063. display: flex;
  1064. margin-top:20px;
  1065. .quick-selection-title{
  1066. margin-left:90px;
  1067. height:40px;
  1068. line-height:40px;
  1069. font-size:14px;
  1070. margin-right:23px;
  1071. }
  1072. .quick-selection-for{
  1073. width:100px;
  1074. height:40px;
  1075. font-size:14px;
  1076. text-align: center;
  1077. line-height:40px;
  1078. margin-right:10px;
  1079. color:#333;
  1080. background-color: #F5F5F5;
  1081. border-radius:4px;
  1082. cursor: pointer;
  1083. }
  1084. .quick-selection-for:hover{
  1085. background: rgba(1,131,250,0.2);
  1086. color:#0183FA ;
  1087. }
  1088. }
  1089. }
  1090. }
  1091. .info-dialog-content-img{
  1092. img{
  1093. width:1040px;
  1094. }
  1095. .left-button-p{
  1096. cursor: pointer;
  1097. text-align: center;
  1098. line-height:30px;
  1099. color:#fff;
  1100. font-size:16px;
  1101. top:440px;
  1102. left:20px;
  1103. position: absolute;
  1104. width:30px;
  1105. height:30px;
  1106. background-color: #0045AF;
  1107. border-radius:50%;
  1108. }
  1109. .right-button-p{
  1110. cursor: pointer;
  1111. text-align: center;
  1112. line-height:30px;
  1113. color:#fff;
  1114. font-size:16px;
  1115. position: absolute;
  1116. top:440px;
  1117. right:20px;
  1118. width:30px;
  1119. height:30px;
  1120. background-color: #0045AF;
  1121. border-radius:50%;
  1122. }
  1123. .left-button-p:hover{
  1124. background-color: #0183fa;
  1125. }
  1126. .right-button-p:hover{
  1127. background-color: #0183fa;
  1128. }
  1129. .bottom-num-text{
  1130. text-align: center;
  1131. line-height: 30px;
  1132. font-size:16px;
  1133. position: absolute;
  1134. bottom:0;
  1135. width:1026px;
  1136. }
  1137. .out-button{
  1138. width:60px;
  1139. line-height:30px;
  1140. color:#999;
  1141. background-color: #dedede;
  1142. border-radius:4px;
  1143. text-align: center;
  1144. cursor: pointer;
  1145. position: absolute;
  1146. top:17px;
  1147. right:17px;
  1148. z-index:99999;
  1149. }
  1150. }
  1151. .info-dialog-content-document{
  1152. display: flex;
  1153. flex:1;
  1154. height:570px;
  1155. .iframe{
  1156. flex:1;
  1157. }
  1158. .out-button{
  1159. width:60px;
  1160. line-height:30px;
  1161. color:#999;
  1162. background-color: #dedede;
  1163. border-radius:4px;
  1164. text-align: center;
  1165. cursor: pointer;
  1166. position: absolute;
  1167. top:17px;
  1168. right:17px;
  1169. z-index:99999;
  1170. }
  1171. }
  1172. .info-dialog-content-document-list{
  1173. display: flex;
  1174. flex:1;
  1175. height:570px;
  1176. overflow: hidden;
  1177. .left-box{
  1178. display: flex;
  1179. flex-direction: column;
  1180. overflow: hidden;
  1181. width:265px;
  1182. .left-title-box{
  1183. padding-bottom:20px;
  1184. display: flex;
  1185. width:230px;
  1186. border-bottom:1px dashed #D8D8D8;
  1187. img{
  1188. width:16px;
  1189. height:13px;
  1190. margin:13px 15px 13px 0;
  1191. }
  1192. p{
  1193. line-height:40px;
  1194. width:230px;
  1195. font-size:16px;
  1196. color:#0183FA;
  1197. }
  1198. }
  1199. .left-for-box{
  1200. flex:1;
  1201. .left-for-p{
  1202. padding:0 10px;
  1203. width:230px;
  1204. line-height:40px;
  1205. margin-top:10px;
  1206. font-size:16px;
  1207. color:#333;
  1208. display:block;
  1209. overflow:hidden;
  1210. text-overflow:ellipsis;
  1211. white-space:nowrap;
  1212. cursor: pointer;
  1213. }
  1214. .check-p{
  1215. background-color:rgba(1,131,250,0.2);
  1216. color:#0183FA;
  1217. }
  1218. }
  1219. }
  1220. .center-border{
  1221. border-right:1px dashed #D8D8D8;
  1222. }
  1223. .right-box{
  1224. flex:1;
  1225. display: flex;
  1226. margin-left:57px;
  1227. .iframe{
  1228. flex:1;
  1229. }
  1230. }
  1231. .out-button{
  1232. width:60px;
  1233. line-height:30px;
  1234. color:#999;
  1235. background-color: #dedede;
  1236. border-radius:4px;
  1237. text-align: center;
  1238. cursor: pointer;
  1239. position: absolute;
  1240. top:17px;
  1241. right:17px;
  1242. z-index:99999;
  1243. }
  1244. }
  1245. }
  1246. .bottom-button-box{
  1247. height:60px;
  1248. width:1184px;
  1249. position: absolute;
  1250. bottom:0;
  1251. padding-top:15px;
  1252. border-top:1px solid #D8D8D8;
  1253. display: flex;
  1254. }
  1255. }
  1256. </style>