index.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391
  1. <template>
  2. <div class="app-container startInspection" v-loading.fullscreen.lock="loading">
  3. <div class="title-max-box">
  4. <p class="title-p">开展检查</p>
  5. </div>
  6. <div class="content-max-box scrollbar-box">
  7. <el-form ref="addForm" :model="addForm" :rules="rules" label-width="82px">
  8. <div class="top-form-box">
  9. <div class="top-form-left-box">
  10. <el-form-item label="实验室" prop="subId">
  11. <el-select placeholder="搜索实验室或房间号" filterable remote reserve-keyword style="width: 500px"
  12. v-model="addForm.subId" @change="subChange" :remote-method="getSubList">
  13. <el-option
  14. v-for="item in subSelectList"
  15. :key="item.id"
  16. :label="item.name"
  17. :value="item.id">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="楼栋" prop="buildId">
  22. <el-select disabled v-model="addForm.buildId" placeholder="请选择学院"
  23. @change="buildingsChange" style="width: 500px">
  24. <el-option
  25. v-for="item in buildingsSelectList"
  26. :key="item.id"
  27. :label="item.name"
  28. :value="item.id">
  29. </el-option>
  30. </el-select>
  31. </el-form-item>
  32. <div style="display: flex" v-if="planType == 1">
  33. <el-form-item label="计划标题" prop="title">
  34. <el-input v-model="addForm.title" placeholder="请输入计划标题" maxLength="30" style="width: 500px"/>
  35. </el-form-item>
  36. <p class="inquire-button-one" @click="planButton(2)"
  37. style="font-size:14px;margin-left:20px;width:100px;" v-if="planList[0]">选择计划</p>
  38. </div>
  39. <el-form-item label="检查类型" prop="checkCategory">
  40. <el-select :disabled="planType==2" v-model="addForm.checkCategory" placeholder="请选择检查类型"
  41. style="width: 500px;height: 40px;">
  42. <el-option
  43. v-for="item in inspectCategoryList"
  44. :key="item.id"
  45. :label="item.name"
  46. :value="item.id">
  47. </el-option>
  48. </el-select>
  49. </el-form-item>
  50. <div style="display: flex" v-if="planType == 2">
  51. <el-form-item label="计划" prop="id">
  52. <el-select v-model="addForm.id" placeholder="请选择计划"
  53. @change="planChange" style="width: 500px">
  54. <el-option
  55. v-for="item in planList"
  56. :key="item.id"
  57. :label="item.title"
  58. :value="item.id">
  59. </el-option>
  60. </el-select>
  61. </el-form-item>
  62. <p class="inquire-button-one" @click="planButton(1)"
  63. style="font-size:14px;margin-left:20px;width:100px;">自定义输入</p>
  64. </div>
  65. <el-form-item label="整改期限" prop="rectifyDeadline" v-if="addForm.checkResult === 0 || addForm.checkCategory==2">
  66. <el-date-picker
  67. style="width: 500px"
  68. v-model="addForm.rectifyDeadline"
  69. type="date"
  70. value-format="yyyy-MM-dd"
  71. :picker-options="pickerOptions"
  72. :clearable="false"
  73. placeholder="请选择整改期限">
  74. </el-date-picker>
  75. </el-form-item>
  76. </div>
  77. <div class="top-form-right-box">
  78. <el-form-item label="学院" prop="deptId">
  79. <el-select disabled v-model="addForm.deptId" placeholder="请选择学院"
  80. @change="deptChange" style="width: 500px">
  81. <el-option
  82. v-for="item in deptSelectList"
  83. :key="item.deptId"
  84. :label="item.deptName"
  85. :value="item.deptId">
  86. </el-option>
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item label="检查组织" prop="checkType">
  90. <el-select v-model="addForm.checkType" placeholder="请选择检查组织"
  91. disabled style="width: 500px">
  92. <el-option
  93. v-for="item in checkTypeList"
  94. :key="item.key"
  95. :label="item.label"
  96. :value="item.key">
  97. </el-option>
  98. </el-select>
  99. </el-form-item>
  100. <el-form-item label="计划周期" prop="dateRange">
  101. <el-date-picker
  102. :disabled="planType == 2"
  103. :clearable="false"
  104. v-model="addForm.dateRange"
  105. size="small"
  106. style="width: 500px"
  107. value-format="yyyy-MM-dd"
  108. type="daterange"
  109. :picker-options="pickerOptions"
  110. range-separator="至"
  111. start-placeholder="开始日期"
  112. end-placeholder="结束日期"
  113. ></el-date-picker>
  114. </el-form-item>
  115. <el-form-item label="检查结果" prop="checkResult" v-if="addForm.checkCategory==1">
  116. <el-select v-model="addForm.checkResult" @change="checkResultChange" placeholder="请选择检查结果" style="width: 500px">
  117. <el-option :key="0" label="不符合" :value="0"></el-option>
  118. <el-option :key="1" label="符合" :value="1"></el-option>
  119. </el-select>
  120. </el-form-item>
  121. <el-form-item label="整改通知" prop="rectifyNotice" v-if="addForm.checkResult === 0 || addForm.checkCategory==2">
  122. <el-radio-group v-model="addForm.rectifyNotice" style="margin-top:5px;">
  123. <el-radio :label="1">整改告知书</el-radio>
  124. <el-radio :label="2">整改通知书</el-radio>
  125. </el-radio-group>
  126. </el-form-item>
  127. </div>
  128. </div>
  129. <!--综合检查-->
  130. <div class="bottom-form-box" v-if="addForm.checkResult === 0 && addForm.checkCategory==1">
  131. <div class="bottom-form-title-box">
  132. <p>不符合项</p>
  133. <p>隐患数:{{addForm.checkHazardDtoList.length}}</p>
  134. </div>
  135. <div class="for-max-big-box" v-for="(item,index) in addForm.checkHazardDtoList" :key="index">
  136. <div class="for-title-box">
  137. <p class="for-title-p">第{{index+1}}隐患项</p>
  138. <div class="for-del-box">
  139. <p class="el-icon-delete"></p>
  140. <p @click="delCheckHazardDtoList(index,'')">删除此项</p>
  141. </div>
  142. <div class="for-button-box" @click="dataLookButton(item)">
  143. <p :class="item.lookType?'el-icon-arrow-up':'el-icon-arrow-down'"></p>
  144. <p>{{item.lookType?'收起':'展开'}}</p>
  145. </div>
  146. </div>
  147. <div class="for-big-box" v-if="item.lookType">
  148. <el-form-item label="隐患等级" :prop="'checkHazardDtoList.'+index+'.hazardLevel'" :rules="rules.hazardLevel" label-width="123px">
  149. <el-select v-model="item.hazardLevel" clearable placeholder="请选择隐患等级" style="width: 408px">
  150. <el-option :key="2" label="一般隐患" :value="2"></el-option>
  151. <el-option :key="1" label="重大隐患" :value="1"></el-option>
  152. <el-option :key="3" label="管理问题" :value="3"></el-option>
  153. </el-select>
  154. </el-form-item>
  155. <el-form-item label="检查项目" :prop="'checkHazardDtoList.'+index+'.hazardCheckPro'" :rules="rules.hazardCheckPro" label-width="123px">
  156. <el-cascader
  157. @change="(val)=>cascaderChange(val,'',index)"
  158. v-model="item.hazardCheckPro"
  159. style="width: 898px"
  160. placeholder="请选择检查项"
  161. :options="options"
  162. :props="{ checkStrictly: false, value: 'id', label: 'labelName',emitPath:false }"
  163. filterable>
  164. <template slot-scope="{data}">
  165. <el-tooltip :content="data.labelName" v-if="data.labelName.length>22">
  166. <p style="max-width:300px;overflow: hidden;text-overflow:ellipsis;white-space:nowrap;">{{data.labelName}}</p>
  167. </el-tooltip>
  168. <p v-else style="max-width:300px;overflow: hidden;text-overflow:ellipsis;white-space:nowrap;">{{data.labelName}}</p>
  169. </template>
  170. </el-cascader>
  171. <p class="hazard-check-count-p" v-if="hazardCheckCount>0">此检查项在当前实验室累计出现 <span>{{hazardCheckCount}}</span> 次隐患</p>
  172. </el-form-item>
  173. <el-form-item label="检查要点" label-width="123px">
  174. <el-input
  175. style="width: 898px"
  176. type="textarea"
  177. :autosize="{ minRows: 6, maxRows: 6}"
  178. placeholder="未查到此项检查要点,可在此输入添加"
  179. resize="none"
  180. maxlength="300"
  181. show-word-limit
  182. v-model="item.hazardCheckPoint">
  183. </el-input>
  184. </el-form-item>
  185. <el-form-item label="隐患描述" :prop="'checkHazardDtoList.'+index+'.hazardDescribe'" :rules="rules.hazardDescribe" label-width="123px">
  186. <el-input
  187. style="width: 898px"
  188. type="textarea"
  189. :autosize="{ minRows: 4, maxRows: 4}"
  190. placeholder="请输入隐患描述"
  191. resize="none"
  192. maxlength="100"
  193. show-word-limit
  194. v-model="item.hazardDescribe">
  195. </el-input>
  196. </el-form-item>
  197. <el-form-item label="隐患照片" :prop="'checkHazardDtoList.'+index+'.uploadDtoList'" :rules="rules.uploadDtoList" label-width="123px">
  198. <div class="for-img-box" v-for="(img,imgIndex) in item.uploadDtoList" :key="imgIndex">
  199. <img class="for-img" :src="img.fileUrl" @click="lookImg(item.uploadDtoList,imgIndex)">
  200. <p class="for-del-button el-icon-circle-close" @click="delImg(index,imgIndex)"></p>
  201. </div>
  202. <el-upload
  203. v-if="item.uploadDtoList.length<5"
  204. style="display: inline-block;overflow: hidden"
  205. class="avatar-uploader"
  206. :action="uploadImgUrl"
  207. :show-file-list="false"
  208. :on-success="(res)=>handleAvatarSuccess(res,item)"
  209. :headers="headers"
  210. :before-upload="(res)=>beforeAvatarUpload(res,item)">
  211. <p class="el-icon-plus up-img-p" style="display: inline-block"></p>
  212. </el-upload>
  213. </el-form-item>
  214. <el-form-item label="" label-width="123px" style="margin-bottom:40px;color:#999;">
  215. <p>支持jpg/png/bmp/gif格式,且不超过2M,最多上传5张</p>
  216. </el-form-item>
  217. </div>
  218. </div>
  219. <p class="add-bottom-button" @click="addObject">+新增隐患检查项</p>
  220. </div>
  221. <!--专项检查-->
  222. <div class="bottom-form-box" v-if="addForm.checkCategory==2 && pageType==1">
  223. <div class="bottom-form-title-box">
  224. <p>检查项</p>
  225. <p>检查项:{{addForm.checkHazardInfoVoList.length}}</p>
  226. </div>
  227. <div class="dept-table-max-box">
  228. <div class="device-tip">请选择以下实验室内设备开始检查</div>
  229. <el-table border :data="deviceTableList" @selection-change="deviceChange" :row-key="getRowKeys" height="350">
  230. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  231. <el-table-column label="名称" align="center" prop="chName" show-overflow-tooltip/>
  232. <el-table-column label="数量" align="center" prop="hazardNum" show-overflow-tooltip/>
  233. <el-table-column label="型号" align="center" prop="code" show-overflow-tooltip />
  234. <el-table-column label="类型" align="center" prop="hazardTypeMode" show-overflow-tooltip/>
  235. </el-table>
  236. </div>
  237. <div class="start_btn" @click="handleClick('startBtn')">开始检查</div>
  238. </div>
  239. <!--专项检查项-->
  240. <div class="bottom-form-box" v-if="addForm.checkCategory==2 && pageType==2">
  241. <div class="bottom-form-title-box">
  242. <p>检查项</p>
  243. <p>检查项:{{addForm.checkHazardInfoVoList.length}}</p>
  244. </div>
  245. <div class="for-max-big-box for-max-big-box-special" v-for="(item,index) in addForm.checkHazardInfoVoList" :key="index">
  246. <div class="for-title-box">
  247. <p class="for-title-p">{{index+1}}、【{{item.hazardName}}】专项检查</p>
  248. <div class="for-del-box">
  249. <p class="el-icon-delete"></p>
  250. <p @click="delCheckHazardDtoList(index,'')">删除此项</p>
  251. </div>
  252. <div class="for-button-box" @click="dataLookButton(item)">
  253. <p :class="item.lookType?'el-icon-arrow-up':'el-icon-arrow-down'"></p>
  254. <p>{{item.lookType?'收起':'展开'}}</p>
  255. </div>
  256. </div>
  257. <div class="for-big-box-special" v-for="(item2,index2) in item.checkHazardDtoList">
  258. <div class="for-big-box-special-l">{{index+1}}.{{index2+1}}</div>
  259. <div class="for-big-box for-big-box-special-r">
  260. <el-form-item label="检查项目" :prop="'checkHazardInfoVoList.'+index+'.checkHazardDtoList.'+index2+'.hazardCheckPro'" :rules="rules.hazardCheckPro" label-width="123px">
  261. <el-radio-group v-model="item2.checkFlag" style="margin-right: 20px;">
  262. <el-radio :label="1">符合</el-radio>
  263. <el-radio :label="0">不符合</el-radio>
  264. </el-radio-group>
  265. <el-cascader
  266. @change="(val)=>cascaderChange(val,item2,index2)"
  267. v-model="item2.hazardCheckPro"
  268. style="width: 730px"
  269. placeholder="请选择检查项"
  270. :options="options"
  271. :props="{ checkStrictly: false, value: 'id', label: 'labelName',emitPath:false }"
  272. filterable>
  273. <template slot-scope="{data}">
  274. <el-tooltip :content="data.labelName" v-if="data.labelName.length>22">
  275. <p style="max-width:300px;overflow: hidden;text-overflow:ellipsis;white-space:nowrap;">{{data.labelName}}</p>
  276. </el-tooltip>
  277. <p v-else style="max-width:300px;overflow: hidden;text-overflow:ellipsis;white-space:nowrap;">{{data.labelName}}</p>
  278. </template>
  279. </el-cascader>
  280. <i class="el-icon-delete" @click="delCheckHazardDtoList(index,index2)" style="color: #0183FA;margin-left: 20px;cursor: pointer;"></i>
  281. <p class="hazard-check-count-p" v-if="hazardCheckCount>0">此检查项在当前实验室累计出现 <span>{{hazardCheckCount}}</span> 次隐患</p>
  282. </el-form-item>
  283. <el-form-item v-if="item2.checkFlag==0" label="隐患等级" :prop="'checkHazardInfoVoList.'+index+'.checkHazardDtoList.'+index2+'.hazardLevel'" :rules="rules.hazardLevel" label-width="123px">
  284. <el-select v-model="item2.hazardLevel" clearable placeholder="请选择隐患等级" style="width: 408px">
  285. <el-option :key="2" label="一般隐患" :value="2"></el-option>
  286. <el-option :key="1" label="重大隐患" :value="1"></el-option>
  287. <el-option :key="3" label="管理问题" :value="3"></el-option>
  288. </el-select>
  289. </el-form-item>
  290. <el-form-item v-if="item2.checkFlag==0" label="隐患描述" :prop="'checkHazardInfoVoList.'+index+'.checkHazardDtoList.'+index2+'.hazardDescribe'" :rules="rules.hazardDescribe" label-width="123px">
  291. <el-input
  292. style="width: 898px"
  293. type="textarea"
  294. :autosize="{ minRows: 4, maxRows: 4}"
  295. placeholder="请输入隐患描述"
  296. resize="none"
  297. maxlength="100"
  298. show-word-limit
  299. v-model="item2.hazardDescribe">
  300. </el-input>
  301. </el-form-item>
  302. <el-form-item v-if="item2.checkFlag==0" label="隐患照片" :prop="'checkHazardInfoVoList.'+index+'.checkHazardDtoList.'+index2+'.uploadDtoList'" :rules="rules.uploadDtoList" label-width="123px">
  303. <div class="for-img-box" v-for="(img,imgIndex) in item2.uploadDtoList" :key="imgIndex">
  304. <img class="for-img" :src="img.fileUrl" @click="lookImg(item2.uploadDtoList,imgIndex)">
  305. <p class="for-del-button el-icon-circle-close" @click="delImg(index,imgIndex)"></p>
  306. </div>
  307. <el-upload
  308. v-if="item2.uploadDtoList.length<5"
  309. style="display: inline-block;overflow: hidden"
  310. class="avatar-uploader"
  311. :action="uploadImgUrl"
  312. :show-file-list="false"
  313. :on-success="(res)=>handleAvatarSuccess(res,item2)"
  314. :headers="headers"
  315. :before-upload="(res)=>beforeAvatarUpload(res,item2)">
  316. <p class="el-icon-plus up-img-p" style="display: inline-block"></p>
  317. </el-upload>
  318. </el-form-item>
  319. <el-form-item v-if="item2.checkFlag==0" label="" label-width="123px" style="margin-bottom:40px;color:#999;">
  320. <p>支持jpg/png/bmp/gif格式,且不超过2M,最多上传5张</p>
  321. </el-form-item>
  322. </div>
  323. </div>
  324. <p class="add-bottom-button" v-if="planType == 1" @click="addObjectTow(item)">+新增隐患检查项</p>
  325. </div>
  326. <p class="add-bottom-button" v-if="planType == 1" @click="addObjectDevice()">+新增检查项</p>
  327. </div>
  328. </el-form>
  329. </div>
  330. <div class="bottom-button-max-box" v-hasPermi="['safety:checkManage_4:edit']">
  331. <p class="null-p"></p>
  332. <p class="add-button-two-90" @click="upDataButton(1)">保存</p>
  333. <p class="inquire-button-one" @click="upDataButton(2)">提交</p>
  334. <p class="null-p"></p>
  335. </div>
  336. <lookImgDialog ref="lookImgDialog"></lookImgDialog>
  337. <!--设备弹窗-->
  338. <el-dialog title="检查项" v-if="dialogVisible" :visible.sync="dialogVisible" width="730px" :append-to-body="false" :modal-append-to-body="false" :close-on-click-modal="false">
  339. <div style="margin-bottom:20px ">请选择以下实验室内设备开始检查</div>
  340. <el-table ref="deviceTable" border :data="deviceTableList" @selection-change="deviceChange" :row-key="getRowKeys" height="350">
  341. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  342. <el-table-column label="名称" align="center" prop="chName" show-overflow-tooltip/>
  343. <el-table-column label="数量" align="center" prop="hazardNum" show-overflow-tooltip/>
  344. <el-table-column label="型号" align="center" prop="code" show-overflow-tooltip />
  345. <el-table-column label="类型" align="center" prop="hazardTypeMode" show-overflow-tooltip/>
  346. </el-table>
  347. <div slot="footer" class="dialog-footer">
  348. <el-button @click="cancel">取 消</el-button>
  349. <el-button type="primary" @click="handleClick('startBtn')">确 定</el-button>
  350. </div>
  351. </el-dialog>
  352. </div>
  353. </template>
  354. <script>
  355. import { getToken } from "@/utils/auth";
  356. import lookImgDialog from '@/components/lookImgDialog/lookImgDialog.vue'
  357. import { listDepartments } from "@/api/system/dept";
  358. import { buildFloorGetlist } from "@/api/laboratory/building";
  359. import {
  360. buildBySubList, getCheckPlanBySubId, findCheckManage, checkOptionList,
  361. checkManageUpdate, checkManageAdd, countHazardNum, getGentle, getHazardListBySub, getHazardInfo
  362. } from '@/api/safetyCheck/index'
  363. export default {
  364. name: 'index',
  365. components: {
  366. lookImgDialog,
  367. },
  368. data(){
  369. return{
  370. loading:false,
  371. uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
  372. headers: {
  373. Authorization: "Bearer " + getToken(),
  374. },
  375. //期限时间
  376. pickerOptions: {
  377. disabledDate(time) {
  378. return time.getTime() < Date.now() - 8.64e7;//如果没有后面的-8.64e7就是不可以选择今天的
  379. }
  380. },
  381. //检查组织
  382. checkTypeList:[{ key:1, label:"校院巡查", },{ key:2, label:"实验室自查", }],
  383. //学院列表
  384. deptSelectList:[],
  385. //楼栋列表
  386. buildingsSelectList:[],
  387. //实验室列表
  388. subSelectList:[],
  389. //楼栋列表
  390. options:[],
  391. addForm:{
  392. checkRange:3,
  393. id:"",
  394. subId:"",
  395. buildId:"",
  396. deptId:"",
  397. title:"",
  398. checkResult:"",
  399. rectifyNotice:"",
  400. checkCategory:'1',
  401. checkType:2,
  402. dateRange:[],
  403. rectifyDeadline:"",
  404. //综合检查
  405. checkHazardDtoList:[],
  406. //专项检查
  407. checkHazardInfoVoList:[],
  408. },
  409. //检查项出现次数
  410. hazardCheckCount:0,
  411. //上传用名称保存
  412. upDataName:"",
  413. deviceTableList:[],
  414. //检查类型
  415. inspectCategoryList:[{id:'1',name:'综合检查'},{id:'2',name:'专项检查'}],
  416. // 表单校验
  417. rules: {
  418. subId: [
  419. { required: true, message: "请选择实验室", trigger: "blur" },
  420. ],
  421. buildId: [
  422. { required: true, message: "请选择楼栋", trigger: "blur" },
  423. ],
  424. deptId: [
  425. { required: true, message: "请选择学院", trigger: "blur" },
  426. ],
  427. checkType: [
  428. { required: true, message: "请选择检查组织", trigger: "blur" },
  429. ],
  430. checkCategory: [
  431. { required: true, message: "请选择检查类型", trigger: "blur" },
  432. ],
  433. dateRange: [
  434. { required: true, message: "请选择计划周期", trigger: "blur" },
  435. ],
  436. title: [
  437. { required: true, message: "请输入计划标题", trigger: "blur" },
  438. { required: true, message: "请输入计划标题", validator: this.spaceJudgment, trigger: "blur" },
  439. ],
  440. id: [
  441. { required: true, message: "请选择计划", trigger: "blur" },
  442. ],
  443. checkResult: [
  444. { required: true, message: "请选择检查结果", trigger: "blur" },
  445. ],
  446. rectifyNotice: [
  447. { required: true, message: "请选择整改通知", trigger: "blur" },
  448. ],
  449. rectifyDeadline: [
  450. { required: true, message: "请选择整改期限", trigger: "blur" },
  451. ],
  452. hazardLevel: [
  453. { required: true, message: "请选择隐患等级", trigger: "blur" },
  454. ],
  455. hazardCheckPro: [
  456. { required: true, message: "请选择检查项目", trigger: "blur" },
  457. ],
  458. hazardDescribe: [
  459. { required: true, message: "请输入隐患描述", trigger: "blur" },
  460. { required: true, message: "请输入隐患描述", validator: this.spaceJudgment, trigger: "blur" },
  461. ],
  462. uploadDtoList: [
  463. { required: true, message: "请上传隐患照片", trigger: "blur" },
  464. ],
  465. },
  466. //自主输入与列表选择相关数据
  467. planList:[],
  468. planType:1,//1手动 2选择
  469. //权限范围
  470. adminGentle:false,
  471. applyGentle:false,
  472. myApplyGentle:false,
  473. /* ==专项检查== */
  474. dialogVisible:false,
  475. pageType:0,
  476. multipleSelection:[],
  477. }
  478. },
  479. created(){
  480. },
  481. mounted(){
  482. this.checkOptionList();
  483. this.listDepartments();
  484. this.getGentle();
  485. this.buildFloorGetlist();
  486. },
  487. methods:{
  488. getRowKeys(row) {
  489. return row.id
  490. },
  491. //选中设备
  492. deviceChange(val){
  493. console.log('1',val)
  494. let deviceList=val
  495. let list=[];
  496. if(deviceList[0]){
  497. for(let i=0;i<deviceList.length;i++){
  498. list.push(deviceList[i].id)
  499. }
  500. this.multipleSelection=list
  501. }
  502. },
  503. handleClick(doType){
  504. let self=this;
  505. if(doType=='startBtn'){//开始检查
  506. let hazardIds='';
  507. if(this.multipleSelection[0]){
  508. this.pageType=2;
  509. this.checkOptionList();
  510. this.dialogVisible=false;
  511. hazardIds=this.multipleSelection.join(',')
  512. this.getHazardInfo(this.addForm.subId,hazardIds)
  513. }else{
  514. this.msgError('请先选择实验室内设备!')
  515. }
  516. }
  517. },
  518. // 取消按钮
  519. cancel() {
  520. this.dialogVisible = false;
  521. },
  522. //获取权限范围
  523. getGentle(){
  524. getGentle().then(response => {
  525. this.$set(this,'adminGentle',response.data.adminGentle);
  526. this.$set(this,'applyGentle',response.data.applyGentle);
  527. this.$set(this,'myApplyGentle',response.data.myApplyGentle);
  528. });
  529. },
  530. //提交按钮
  531. upDataButton(type){
  532. this.$refs["addForm"].validate(valid => {
  533. if (valid) {
  534. let startTime = Date.parse(new Date(this.addForm.dateRange[0]));
  535. let currentTime = Date.parse(new Date);
  536. if(currentTime<startTime){
  537. this.msgError('当前时间不在计划周期内')
  538. return
  539. }
  540. if(this.planType == 1){
  541. //新计划
  542. let obj = JSON.parse(JSON.stringify(this.addForm));
  543. obj.manageStatus = type
  544. obj.cycleStartTime = obj.dateRange[0]
  545. obj.cycleEndTime = obj.dateRange[1]
  546. obj.subIds = obj.subId;
  547. delete obj.subId;
  548. delete obj.dateRange
  549. if(this.addForm.checkCategory==1){//综合检查
  550. if(obj.checkResult === 0){
  551. if(!obj.checkHazardDtoList[0]){
  552. this.msgError('请添加隐患检查项')
  553. return
  554. }
  555. for(let i=0;i<obj.checkHazardDtoList.length;i++){
  556. obj.checkHazardDtoList[i].checkCategory=this.addForm.checkCategory;
  557. delete obj.checkHazardDtoList[i].lookType
  558. }
  559. obj.dangerNum = obj.checkHazardDtoList.length
  560. }else{
  561. obj.checkHazardDtoList = [];
  562. }
  563. }else if(this.addForm.checkCategory==2){//专项检查
  564. let list=[]
  565. let checkFlagList=[];
  566. for(let i=0;i<this.addForm.checkHazardInfoVoList.length;i++){
  567. for(let b=0;b<this.addForm.checkHazardInfoVoList[i].checkHazardDtoList.length;b++){
  568. checkFlagList.push(this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag)
  569. let obj={
  570. checkFlag:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag,
  571. checkCategory:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkCategory,
  572. hazardCheckCode:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckCode,
  573. hazardCheckName:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckName,
  574. hazardCheckPro:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckPro,
  575. hazardDescribe:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardDescribe,
  576. hazardLevel:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardLevel,
  577. uploadDtoList:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].uploadDtoList,
  578. code:this.addForm.checkHazardInfoVoList[i].code,
  579. hazardId:this.addForm.checkHazardInfoVoList[i].hazardId,
  580. hazardName:this.addForm.checkHazardInfoVoList[i].hazardName,
  581. hazardTypeMode:this.addForm.checkHazardInfoVoList[i].hazardTypeMode,
  582. hazardTypeModeName:this.addForm.checkHazardInfoVoList[i].hazardTypeModeName,
  583. joinHazardId:this.addForm.checkHazardInfoVoList[i].joinHazardId,
  584. }
  585. list.push(obj)
  586. }
  587. }
  588. if(this.multipleSelection[0]){
  589. obj.hazardIds=this.multipleSelection.join(',')
  590. }
  591. if(checkFlagList.every(item=>{return item==1})){//符合
  592. obj.checkResult=1;
  593. }else{//不符合
  594. obj.checkResult=0;
  595. }
  596. obj.checkHazardDtoList=list;
  597. }
  598. checkManageAdd(obj).then(response => {
  599. this.msgSuccess(response.msg);
  600. this.initializationAddData();
  601. });
  602. }if(this.planType == 2){
  603. //已有计划修改
  604. let obj = JSON.parse(JSON.stringify(this.addForm));
  605. obj.manageStatus = type
  606. obj.cycleStartTime = obj.dateRange[0]
  607. obj.cycleEndTime = obj.dateRange[1]
  608. delete obj.dateRange
  609. if(this.addForm.checkCategory==1){//综合检查
  610. if(obj.checkResult === 0){
  611. if(!obj.checkHazardDtoList[0]){
  612. this.msgError('请添加隐患检查项')
  613. return
  614. }
  615. for(let i=0;i<obj.checkHazardDtoList.length;i++){
  616. delete obj.checkHazardDtoList[i].lookType
  617. }
  618. obj.dangerNum = obj.checkHazardDtoList.length
  619. }else{
  620. obj.checkHazardDtoList = [];
  621. }
  622. }else if(this.addForm.checkCategory==2){//专项检查
  623. let list=[]
  624. let checkFlagList=[];
  625. for(let i=0;i<this.addForm.checkHazardInfoVoList.length;i++){
  626. for(let b=0;b<this.addForm.checkHazardInfoVoList[i].checkHazardDtoList.length;b++){
  627. checkFlagList.push(this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag)
  628. let obj={
  629. checkFlag:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag,
  630. checkCategory:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkCategory,
  631. hazardCheckCode:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckCode,
  632. hazardCheckName:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckName,
  633. hazardCheckPro:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckPro,
  634. hazardDescribe:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardDescribe,
  635. hazardLevel:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardLevel,
  636. uploadDtoList:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].uploadDtoList,
  637. code:this.addForm.checkHazardInfoVoList[i].code,
  638. hazardId:this.addForm.checkHazardInfoVoList[i].hazardId,
  639. hazardName:this.addForm.checkHazardInfoVoList[i].hazardName,
  640. hazardTypeMode:this.addForm.checkHazardInfoVoList[i].hazardTypeMode,
  641. hazardTypeModeName:this.addForm.checkHazardInfoVoList[i].hazardTypeModeName,
  642. joinHazardId:this.addForm.checkHazardInfoVoList[i].joinHazardId,
  643. }
  644. list.push(obj)
  645. }
  646. }
  647. if(checkFlagList.every(item=>{return item==1})){//符合
  648. obj.checkResult=1;
  649. }else{//不符合
  650. obj.checkResult=0;
  651. }
  652. obj.checkHazardDtoList=list;
  653. }
  654. checkManageUpdate(obj).then(response => {
  655. this.msgSuccess(response.msg);
  656. this.initializationAddData();
  657. });
  658. }
  659. }
  660. })
  661. },
  662. // 删除图片
  663. delImg(index,imgIndex){
  664. this.addForm.checkHazardDtoList[index].uploadDtoList.splice(imgIndex,1);
  665. },
  666. //收起/展开
  667. dataLookButton(item){
  668. item.lookType = !item.lookType
  669. },
  670. //检查结果选中
  671. checkResultChange(val){
  672. if(val == 0){
  673. //不符合时如果没有检查项则写入一条
  674. if(!this.addForm.checkHazardDtoList[0]){
  675. this.addObject();
  676. }
  677. }
  678. },
  679. //新增检查
  680. addObject(){
  681. if(this.addForm.checkHazardDtoList.length<10){
  682. let obj = {
  683. hazardCheckCode:'',
  684. hazardCheckName:'',
  685. hazardCheckPoint:'',
  686. hazardCheckPro:'',
  687. hazardDescribe:'',
  688. hazardLevel:'',
  689. lookType:true,
  690. uploadDtoList:[],
  691. };
  692. this.addForm.checkHazardDtoList.push(obj);
  693. }
  694. },
  695. //新增隐患项
  696. addObjectTow(item){
  697. if(item.checkHazardDtoList.length<10){
  698. let obj = {
  699. checkFlag:0,
  700. hazardCheckCode:'',
  701. hazardCheckName:'',
  702. hazardCheckPoint:'',
  703. hazardCheckPro:'',
  704. hazardDescribe:'',
  705. hazardLevel:'',
  706. lookType:true,
  707. uploadDtoList:[],
  708. };
  709. item.checkHazardDtoList.push(obj);
  710. }
  711. },
  712. //新增检查项
  713. addObjectDevice(item){
  714. let self=this;
  715. this.dialogVisible=true;
  716. let list=JSON.parse(JSON.stringify(self.multipleSelection))
  717. setTimeout(function(){
  718. self.$refs.deviceTable.clearSelection();
  719. if(list[0]){
  720. self.deviceTableList.forEach(row => {
  721. list.forEach(function(item) {
  722. if(row.id==item){
  723. self.$refs.deviceTable.toggleRowSelection(row,true);
  724. }
  725. })
  726. });
  727. }else{
  728. if(self.$refs.deviceTable){
  729. self.$refs.deviceTable.clearSelection();
  730. }
  731. }
  732. },100);
  733. },
  734. //查看图片
  735. lookImg(list,index){
  736. for(let i=0;i<list.length;i++){
  737. list[i].name = list[i].fileName;
  738. list[i].url = list[i].fileUrl;
  739. }
  740. this.$refs.lookImgDialog.lookImgDialogOpen(1,list,index);
  741. },
  742. /*==========上传相关==========*/
  743. handleAvatarSuccess(res,item) {
  744. this.$set(this,'loading',false);
  745. if(item.uploadDtoList.length>4){
  746. this.msgError('最多只可上传5张')
  747. return
  748. }
  749. let suffixName= this.upDataName.split('.')[this.upDataName.split('.').length - 2]
  750. //判断文件名中是否有逗号和分号
  751. if(suffixName.indexOf(',')==-1 && suffixName.indexOf(';')==-1){
  752. }else{
  753. this.msgError('文件名里包含逗号或分号,请修改后重新上传!')
  754. return
  755. }
  756. let obj ={
  757. fileName:this.upDataName,
  758. fileUrl:res.data.url,
  759. fileType:2,
  760. source:2,
  761. };
  762. item.uploadDtoList.push(obj);
  763. this.$forceUpdate()
  764. },
  765. beforeAvatarUpload(file,item) {
  766. if(item.uploadDtoList.length>4){
  767. this.msgError('最多只可上传5张')
  768. return false
  769. }
  770. let type = false;
  771. if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif' || file.type == 'image/bmp') {
  772. if(file.size> 2100000){
  773. this.msgError('上传图片大小不能超过2M')
  774. return false
  775. }
  776. this.$set(this,'loading',true);
  777. this.upDataName = file.name;
  778. type = true;
  779. }else{
  780. this.msgError('仅支持jpg/png/bmp/gif格式')
  781. type = false;
  782. }
  783. return type;
  784. },
  785. //获取检查项
  786. checkOptionList(){
  787. checkOptionList().then( response => {
  788. this.$set(this,'options',response.data);
  789. this.getCascaderData(this.options);
  790. })
  791. },
  792. //联级选择器数据处理
  793. getCascaderData(list){
  794. let self = this;
  795. if(this.addForm.checkCategory==1){//综合检查
  796. for(let i=0;i<list.length;i++){
  797. list[i].labelName = list[i].code? list[i].code +' '+ list[i].name:list[i].name
  798. if(list[i].level == 0 || list[i].level == 1 || list[i].level == 2){
  799. if(list[i].children){
  800. if(list[i].children[0]){
  801. self.getCascaderData(list[i].children)
  802. if(list[i].children){
  803. if(!list[i].children[0]){
  804. list.splice(i,1)
  805. i--
  806. }
  807. }else{
  808. list.splice(i,1)
  809. i--
  810. }
  811. }else{
  812. list.splice(i,1)
  813. i--
  814. }
  815. }else{
  816. list.splice(i,1)
  817. i--
  818. }
  819. }else{
  820. delete list[i].children
  821. }
  822. }
  823. }else if(this.addForm.checkCategory==2){//专项检查
  824. for(let i=0;i<list.length;i++){
  825. list[i].labelName = list[i].code? list[i].code +' '+ list[i].name:list[i].name
  826. if(list[i].level == 0 || list[i].level == 1 || list[i].level == 2 || list[i].level == 3){
  827. if(list[i].children){
  828. if(list[i].children[0]){
  829. self.getCascaderData(list[i].children)
  830. if(list[i].children){
  831. if(!list[i].children[0]){
  832. list.splice(i,1)
  833. i--
  834. }
  835. }else{
  836. list.splice(i,1)
  837. i--
  838. }
  839. }else{
  840. list.splice(i,1)
  841. i--
  842. }
  843. }else{
  844. list.splice(i,1)
  845. i--
  846. }
  847. }else{
  848. delete list[i].children
  849. }
  850. }
  851. }
  852. },
  853. //获取学院列表
  854. listDepartments(){
  855. listDepartments().then(response => {
  856. this.deptSelectList = response.data;
  857. });
  858. },
  859. //根据学院id查询楼栋列表
  860. buildFloorGetlist(){
  861. buildFloorGetlist({type:2}).then(response => {
  862. this.buildingsSelectList = response.rows;
  863. });
  864. },
  865. //根据楼栋id查询实验室列表
  866. buildBySubList(data,type){
  867. let obj = type == 1?{buildId:data}:{searchValue:data}
  868. buildBySubList(obj).then(response => {
  869. this.subSelectList = response.data;
  870. });
  871. },
  872. //选择学院触发
  873. deptChange(val){
  874. this.$set(this.addForm,'buildId','');
  875. this.$set(this.addForm,'subId','');
  876. this.$set(this,'subSelectList',[]);
  877. this.initializationAddFormData();
  878. this.$set(this,'planType',1);
  879. this.$set(this,'planList',[]);
  880. },
  881. //选择楼栋触发
  882. buildingsChange(val){
  883. this.$set(this,'subId','');
  884. this.$set(this.addForm,'subId','');
  885. this.initializationAddFormData();
  886. this.$set(this,'planType',1);
  887. this.$set(this,'planList',[]);
  888. this.buildBySubList(val,1);
  889. },
  890. //选择实验室触发
  891. subChange(val){
  892. let self = this;
  893. for(let i=0;i<self.subSelectList.length;i++){
  894. if(self.subSelectList[i].id == val){
  895. this.$set(this.addForm,'deptId',self.subSelectList[i].deptId);
  896. this.$set(this.addForm,'buildId',self.subSelectList[i].buildId);
  897. this.getCheckPlanBySubId(val);
  898. this.getHazardListBySub(val);
  899. return
  900. }
  901. }
  902. },
  903. //实验室搜索
  904. getSubList(val){
  905. this.$set(this.addForm,'deptId','');
  906. this.$set(this.addForm,'buildId','');
  907. this.$set(this.addForm,'subId','');
  908. this.$set(this,'subSelectList',[]);
  909. this.initializationAddFormData();
  910. this.$set(this,'planType',1);
  911. this.$set(this,'planList',[]);
  912. this.buildBySubList(val,2);
  913. },
  914. //根据实验室ID查询计划任务
  915. getCheckPlanBySubId(id){
  916. getCheckPlanBySubId({subId:id}).then(response => {
  917. this.initializationAddFormData();
  918. let list = [];
  919. for(let i=0;i<response.data.length;i++){
  920. if(response.data[i].isSelfData == 1){
  921. list.push(response.data[i]);
  922. }
  923. }
  924. this.$set(this,'planType',list[0]?2:1);
  925. this.$set(this,'planList',list);
  926. });
  927. },
  928. //根据实验室ID查询实验室设备
  929. getHazardListBySub(id){
  930. getHazardListBySub({subId:id}).then(response => {
  931. this.deviceTableList=response.data;
  932. });
  933. },
  934. //根据设备id生成检查项
  935. getHazardInfo(id,hazardIds){
  936. getHazardInfo({subId:id,hazardIds:hazardIds}).then(response => {
  937. if(response.data[0]){
  938. response.data.forEach(function(item) {
  939. item.checkHazardDtoList.forEach(function(item2) {
  940. item2.hazardCheckCode=item2.code
  941. })
  942. })
  943. }
  944. this.addForm.checkHazardInfoVoList=response.data
  945. });
  946. },
  947. //计划列表选中
  948. planChange(val){
  949. let self = this;
  950. for(let i=0;i<self.planList.length;i++){
  951. if(self.planList[i].id == val){
  952. self.findCheckManage(self.planList[i].id);
  953. return
  954. }
  955. }
  956. },
  957. //状态切换按钮
  958. planButton(type){
  959. this.initializationAddFormData();
  960. this.$set(this,'planType',type);
  961. if(type == 1){
  962. this.$set(this.addForm,'checkType',2);
  963. this.$set(this,'checkTypeList',[{
  964. key:2,
  965. label:"实验室自查",
  966. }]);
  967. this.pageType=1;
  968. }else if(type == 2){
  969. this.pageType=0;
  970. this.$set(this.addForm,'checkType',null);
  971. this.$set(this,'checkTypeList',[{ key:1, label:"校院巡查", },{ key:2, label:"实验室自查", }]);
  972. }
  973. },
  974. //查询详情
  975. findCheckManage(id){
  976. findCheckManage({id:id}).then(response => {
  977. if(response.data.checkCategory==1){//综合检查
  978. response.data.checkResult = response.data.checkResult === 0 || response.data.checkResult === 1?response.data.checkResult:"";
  979. response.data.rectifyNotice = response.data.rectifyNotice?response.data.rectifyNotice:"";
  980. response.data.rectifyDeadline = response.data.rectifyDeadline?response.data.rectifyDeadline:"";
  981. response.data.dateRange = [response.data.cycleStartTime,response.data.cycleEndTime];
  982. for(let i=0;i<response.data.checkHazardDtoList.length;i++){
  983. response.data.checkHazardDtoList[i].lookType = true;
  984. }
  985. }else if(response.data.checkCategory==2){//专项检查
  986. response.data.rectifyNotice = response.data.rectifyNotice?response.data.rectifyNotice:"";
  987. response.data.rectifyDeadline = response.data.rectifyDeadline?response.data.rectifyDeadline:"";
  988. response.data.dateRange = [response.data.cycleStartTime,response.data.cycleEndTime];
  989. if(response.data.checkHazardInfoVoList[0]){
  990. response.data.checkHazardInfoVoList.forEach(function(item) {
  991. item.checkHazardDtoList.forEach(function(item2) {
  992. item2.hazardCheckCode=item2.code
  993. })
  994. })
  995. }
  996. this.pageType=2
  997. }
  998. this.buildBySubList(response.data.buildId,1);
  999. this.$set(this,'addForm',{
  1000. id:response.data.id,
  1001. checkPlanId:response.data.checkPlanId,
  1002. title:response.data.title,
  1003. subId:response.data.subId,
  1004. buildId:response.data.buildId,
  1005. checkResult:response.data.checkResult,
  1006. rectifyNotice:response.data.rectifyNotice,
  1007. deptId:response.data.deptId,
  1008. checkType:response.data.checkType,
  1009. checkCategory:response.data.checkCategory+'',
  1010. dateRange:response.data.dateRange,
  1011. rectifyDeadline:response.data.rectifyDeadline,
  1012. checkHazardDtoList:response.data.checkHazardDtoList,
  1013. checkHazardInfoVoList:response.data.checkHazardInfoVoList,
  1014. });
  1015. this.checkOptionList();//获取检查项
  1016. });
  1017. },
  1018. //初始化数据
  1019. initializationAddFormData(){
  1020. this.$set(this.addForm,'id','');
  1021. this.$set(this.addForm,'checkPlanId','');
  1022. this.$set(this.addForm,'title','');
  1023. this.$set(this.addForm,'checkRange',3);
  1024. this.$set(this.addForm,'checkType',2);
  1025. this.$set(this.addForm,'dateRange',[]);
  1026. this.$set(this.addForm,'checkResult','');
  1027. this.$set(this.addForm,'rectifyNotice','');
  1028. this.$set(this.addForm,'rectifyDeadline','');
  1029. this.$set(this.addForm,'checkHazardDtoList',[]);
  1030. },
  1031. initializationAddData(){
  1032. this.$set(this,'addForm',{
  1033. checkRange:3,
  1034. id:"",
  1035. checkPlanId:"",
  1036. subId:"",
  1037. buildId:"",
  1038. deptId:"",
  1039. title:"",
  1040. checkResult:"",
  1041. rectifyNotice:"",
  1042. checkType:2,
  1043. dateRange:[],
  1044. rectifyDeadline:"",
  1045. checkHazardDtoList:[],
  1046. });
  1047. this.$set(this,'planType',1);
  1048. this.$set(this,'planList',[]);
  1049. },
  1050. //删除检查项
  1051. delCheckHazardDtoList(index,index2){
  1052. console.log(index)
  1053. console.log(index2)
  1054. let self = this;
  1055. this.$confirm('是否确认删除?', "警告", {
  1056. confirmButtonText: "确定",
  1057. cancelButtonText: "取消",
  1058. type: "warning"
  1059. }).then(function() {
  1060. if(self.addForm.checkCategory==1){//综合检查
  1061. self.addForm.checkHazardDtoList.splice(index,1);
  1062. }else if(self.addForm.checkCategory==2){//专项检查
  1063. if(index2){//小检查项
  1064. self.addForm.checkHazardInfoVoList[index].checkHazardDtoList.splice(index2,1);
  1065. }else{//检查设备
  1066. self.addForm.checkHazardInfoVoList.splice(index,1);
  1067. }
  1068. }
  1069. }).then(() => {
  1070. }).catch(() => {});
  1071. },
  1072. //检查项选中
  1073. cascaderChange(val,item,index){
  1074. let obj = this.getCascaderDataQuery(val,this.options);
  1075. if(this.addForm.checkCategory==1){//综合检查
  1076. if(!obj){
  1077. this.$set(this.addForm.checkHazardDtoList[index],'hazardCheckPro','');
  1078. this.msgError('未找到相关项目')
  1079. return
  1080. }
  1081. this.$set(this.addForm.checkHazardDtoList[index],'hazardCheckCode',obj.code);
  1082. this.$set(this.addForm.checkHazardDtoList[index],'hazardCheckName',obj.name);
  1083. this.$set(this.addForm.checkHazardDtoList[index],'hazardCheckPoint',obj.mainPoint);
  1084. countHazardNum({subId:this.addForm.subId, hazardCheckPro:val}).then( response => {
  1085. this.$set(this,'hazardCheckCount',response.data);
  1086. })
  1087. }else if(this.addForm.checkCategory==2){//专项检查
  1088. if(!obj){
  1089. this.$set(this.addForm.checkHazardInfoVoList[index],'hazardCheckPro','');
  1090. this.msgError('未找到相关项目')
  1091. return
  1092. }
  1093. console.log(obj)
  1094. item.hazardCheckCode=obj.code;
  1095. item.hazardCheckName=obj.name;
  1096. countHazardNum({subId:this.addForm.subId, hazardCheckPro:val}).then( response => {
  1097. this.$set(this,'hazardCheckCount',response.data);
  1098. })
  1099. }
  1100. },
  1101. /*==========专项检查==========*/
  1102. //联级选择器数据查询
  1103. getCascaderDataQuery(text,list){
  1104. let self = this;
  1105. for(let i=0;i<list.length;i++){
  1106. if(list[i].id == text){
  1107. return list[i]
  1108. }else{
  1109. if(list[i].children){
  1110. let obj = self.getCascaderDataQuery(text,list[i].children)
  1111. if(obj){
  1112. return obj
  1113. }
  1114. }
  1115. }
  1116. }
  1117. },
  1118. }
  1119. }
  1120. </script>
  1121. <style scoped lang="scss">
  1122. .startInspection{
  1123. flex: 1;
  1124. display: flex !important;
  1125. flex-direction: column;
  1126. overflow: hidden;
  1127. *{
  1128. font-weight:500;
  1129. }
  1130. img{
  1131. user-drag: none;
  1132. }
  1133. ::v-deep .el-range-editor--small .el-range-separator{
  1134. line-height:32px;
  1135. }
  1136. .dept-table-max-box{
  1137. padding: 0 20px;
  1138. box-sizing: border-box;
  1139. .device-tip{
  1140. font-size: 16px;
  1141. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  1142. font-weight: 400;
  1143. color: #333333;
  1144. line-height: 16px;
  1145. margin-bottom: 20px;
  1146. }
  1147. }
  1148. .start_btn{
  1149. font-size: 16px;
  1150. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  1151. font-weight: 400;
  1152. color: #0183FA;
  1153. line-height: 40px;
  1154. text-align: center;
  1155. width: 500px;
  1156. height: 40px;
  1157. border-radius: 4px 4px 4px 4px;
  1158. opacity: 1;
  1159. border: 1px dotted #0183FA;
  1160. margin:40px auto;
  1161. }
  1162. .title-max-box{
  1163. position: relative;
  1164. height:90px;
  1165. display: flex;
  1166. border-bottom:1px solid #dedede;
  1167. .title-p{
  1168. flex:1;
  1169. color:#0045AF;
  1170. margin-left:64px;
  1171. line-height:90px;
  1172. font-size:16px;
  1173. }
  1174. .title-button{
  1175. width:70px;
  1176. margin:24px 31px;
  1177. }
  1178. .position-img{
  1179. width:80px;
  1180. height:80px;
  1181. position: absolute;
  1182. top:0;
  1183. left:0;
  1184. }
  1185. }
  1186. .content-max-box{
  1187. flex:1;
  1188. display: flex;
  1189. flex-direction: column;
  1190. .top-form-box{
  1191. padding:40px 85px 20px;
  1192. display: flex;
  1193. .top-form-left-box{
  1194. flex:1;
  1195. height:310px;
  1196. }
  1197. .top-form-right-box{
  1198. height:310px;
  1199. }
  1200. }
  1201. .bottom-form-box{
  1202. .bottom-form-title-box{
  1203. background: #F5F5F5;
  1204. display: flex;
  1205. margin-bottom:31px;
  1206. p{
  1207. font-size:16px;
  1208. line-height:50px;
  1209. }
  1210. p:nth-child(1){
  1211. color:#333;
  1212. margin-left:30px;
  1213. flex:1;
  1214. }
  1215. p:nth-child(2){
  1216. color:#0183FA;
  1217. margin-right:37px;
  1218. }
  1219. }
  1220. .add-bottom-button{
  1221. cursor: pointer;
  1222. color:#0183FA;
  1223. border-radius:4px;
  1224. border:1px dashed #0183FA;
  1225. width:800px;
  1226. line-height:40px;
  1227. text-align: center;
  1228. font-size:14px;
  1229. margin: 20px auto;
  1230. }
  1231. }
  1232. }
  1233. .for-max-big-box{
  1234. border:1px solid #dedede;
  1235. overflow: hidden;
  1236. margin:0 81px;
  1237. .for-title-box{
  1238. display: flex;
  1239. background: #F5F5F5;
  1240. border-bottom:1px solid #dedede;
  1241. line-height:50px;
  1242. .for-title-p{
  1243. color:#333333;
  1244. font-size:16px;
  1245. margin-left: 30px;
  1246. flex:1;
  1247. }
  1248. .for-del-box{
  1249. color:#0183FA;
  1250. margin-left:46px;
  1251. cursor: pointer;
  1252. display: flex;
  1253. p{
  1254. font-size:14px;
  1255. line-height:50px;
  1256. margin-right:8px;
  1257. }
  1258. }
  1259. .for-button-box{
  1260. color:#0183FA;
  1261. margin-left:46px;
  1262. margin-right:43px;
  1263. cursor: pointer;
  1264. display: flex;
  1265. p{
  1266. font-size:14px;
  1267. line-height:50px;
  1268. margin-right:8px;
  1269. }
  1270. }
  1271. }
  1272. .for-big-box{
  1273. padding-top:27px;
  1274. .up-img-p{
  1275. height:80px;
  1276. width:80px;
  1277. line-height:80px;
  1278. text-align: center;
  1279. font-size:16px;
  1280. border-radius:4px;
  1281. border:1px dashed #E0E0E0;
  1282. }
  1283. .for-img-box{
  1284. width:80px;
  1285. height:80px;
  1286. border-radius:4px;
  1287. display: inline-block;
  1288. overflow: hidden;
  1289. margin-right:20px;
  1290. position: relative;
  1291. .for-img{
  1292. width:80px;
  1293. height:80px;
  1294. display: inline-block;
  1295. overflow: hidden;
  1296. }
  1297. .for-del-button{
  1298. background: rgba(0,0,0,0.7);
  1299. width:20px;
  1300. height:20px;
  1301. line-height: 20px;
  1302. text-align: center;
  1303. color:#fff;
  1304. border-bottom-left-radius:4px;
  1305. cursor: pointer;
  1306. position: absolute;
  1307. top:0;
  1308. right:0;
  1309. }
  1310. }
  1311. .hazard-check-count-p{
  1312. display: inline-block;
  1313. margin-left: 20px;
  1314. font-size: 14px;
  1315. line-height: 40px;
  1316. span{
  1317. color:#FF0000;
  1318. }
  1319. }
  1320. }
  1321. }
  1322. /*专项检查*/
  1323. .for-max-big-box-special{
  1324. margin-bottom: 20px;
  1325. .for-big-box-special{
  1326. border-bottom: 1px dotted #D8D8D8;
  1327. margin:30px;
  1328. display: flex;
  1329. justify-content: flex-start;
  1330. .for-big-box-special-l{
  1331. width: 30px;
  1332. height: 30px;
  1333. background: #0183FA;
  1334. border-radius: 6px 6px 6px 6px;
  1335. font-size: 16px;
  1336. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  1337. font-weight: 400;
  1338. color: #FFFFFF;
  1339. line-height: 30px;
  1340. text-align: center;
  1341. }
  1342. .for-big-box-special-r{}
  1343. }
  1344. .for-big-box-special:last-of-type{
  1345. border-bottom: none;
  1346. }
  1347. }
  1348. .bottom-button-max-box{
  1349. height:80px;
  1350. display: flex;
  1351. border-top:1px solid #dedede;
  1352. p{
  1353. margin-top:20px;
  1354. }
  1355. .null-p{
  1356. flex:1;
  1357. }
  1358. p:nth-child(2){
  1359. width:90px;
  1360. margin-right:20px;
  1361. }
  1362. p:nth-child(3){
  1363. width:90px;
  1364. margin-right:20px;
  1365. }
  1366. p:nth-child(4){
  1367. width:90px;
  1368. margin-right:20px;
  1369. }
  1370. }
  1371. }
  1372. </style>