addDialog.vue 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153
  1. <template>
  2. <el-dialog class="inspectionPlan-dialog-box"
  3. :close-on-click-modal="false"
  4. v-loading="loading"
  5. :title="addDialogTitle" :visible.sync="addDialogType" v-if="addDialogType"
  6. @close="addDialogAllOff" width="1303px" append-to-body>
  7. <div class="inspectionPlan-dialog-add-box" v-show="addDialogBoxType==1">
  8. <div class="left-max-box" v-if="!lookInfoType">
  9. <div class="left-max-title-box">
  10. <img src="@/assets/ZDimages/safetyCheck/icon_jhbt.png">
  11. <p>计划标题快选</p>
  12. </div>
  13. <div class="left-max-list-box scrollbar-box">
  14. <div v-for="(item,index) in quickSelectionList" :key="index" @click="checkTitle(item)">
  15. <p class="left-max-list-for-p">{{item.title}}</p>
  16. <p v-if="item.type" class="el-icon-error left-max-list-for-icon" @click="delTitleObj(item)"></p>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="right-max-box scrollbar-box">
  21. <el-form ref="addDialogForm" :model="dialogForm" :rules="rules" label-width="140px">
  22. <el-form-item label="计划标题:" prop="title">
  23. <el-input :disabled="lookInfoType" v-model="dialogForm.title" placeholder="请输入计划标题" maxLength="30" style="width:450px;"/>
  24. </el-form-item>
  25. <el-form-item label="检查组织:">
  26. <p style="width:450px;background:#f5f5f5;border-radius:4px;padding:0 15px;">实验室自查</p>
  27. </el-form-item>
  28. <el-form-item label="任务周期:" prop="dateRange">
  29. <div class="date-range-box">
  30. <div class="date-range-left-box">
  31. <el-date-picker
  32. :disabled="lookInfoType"
  33. :clearable="false"
  34. v-model="dialogForm.dateRange"
  35. style="width:450px;"
  36. value-format="yyyy-MM-dd"
  37. type="daterange"
  38. range-separator="-"
  39. :picker-options="pickerOptions"
  40. start-placeholder="开始日期"
  41. end-placeholder="结束日期"
  42. ></el-date-picker>
  43. </div>
  44. <div class="date-range-right-box" v-if="!lookInfoType">
  45. <p @click="checkTime(1)">本月</p>
  46. <p @click="checkTime(2)">本季度</p>
  47. <p @click="checkTime(3)">全年</p>
  48. </div>
  49. </div>
  50. </el-form-item>
  51. <el-form-item label="检查范围:" prop="checkRange">
  52. <div class="dialog-range-max-box">
  53. <div class="dialog-range-select-box">
  54. <el-select :disabled="lookInfoType" @change="rangeChange"
  55. v-model="dialogForm.checkRange" placeholder="请选择检查范围" style="width:450px;">
  56. <el-option
  57. v-for="item in dialogRangeOptions"
  58. :key="item.value"
  59. :label="item.label"
  60. :value="item.value">
  61. </el-option>
  62. </el-select>
  63. </div>
  64. <div class="dialog-range-text-box">
  65. <p class="page-submit-common-style-button button-p" :style="lookInfoType?'background:#0183FA;border:1px solid #0183FA;':''" v-if="dialogForm.checkRange == 2" @click="dialogClickType(2)">{{lookInfoType?'查看':'选择学院'}}</p>
  66. <p class="page-submit-common-style-button button-p" :style="lookInfoType?'background:#0183FA;border:1px solid #0183FA;':''" v-if="dialogForm.checkRange == 3" @click="dialogClickType(3)">{{lookInfoType?'查看':'选择实验室'}}</p>
  67. <p class="text-p" v-if="dialogForm.checkRange ==1 && dialogForm.schoolSubCheckNum>0">已选择{{dialogForm.schoolSubCheckNum}}间实验室</p>
  68. <p class="text-p" v-if="dialogForm.checkRange == 2 && dialogForm.collegeNum>0">已选择{{dialogForm.collegeNum}}个学院,共{{dialogForm.collegeSubNum}}间实验室</p>
  69. <p class="text-p" v-if="dialogForm.checkRange ==3 && dialogForm.subCheckNum>0">已选择{{dialogForm.subCheckNum}}间实验室</p>
  70. </div>
  71. </div>
  72. </el-form-item>
  73. <el-form-item label="检查类型:" prop="inspectCategory">
  74. <div class="dialog-range-max-box">
  75. <div class="dialog-range-select-box">
  76. <el-select :disabled="lookInfoType" @change="inspectCategoryChange"
  77. v-model="dialogForm.checkCategory" placeholder="请选择检查类型" style="width:450px;">
  78. <el-option
  79. v-for="item in inspectCategoryList"
  80. :key="item.id"
  81. :label="item.name"
  82. :value="item.id">
  83. </el-option>
  84. </el-select>
  85. </div>
  86. <div class="dialog-range-text-box" v-if="dialogForm.checkCategory==2">
  87. <p class="page-submit-common-style-button button-p" @click="dialogClickType(6)">选择检查内容</p>
  88. <p class="text-p">已选择{{dialogForm.hazardNum}}种</p>
  89. </div>
  90. </div>
  91. </el-form-item>
  92. <el-form-item label="检查要求:" prop="checkDemand">
  93. <el-input
  94. :disabled="lookInfoType"
  95. type="textarea"
  96. :autosize="{ minRows: 4, maxRows: 4}"
  97. :placeholder="lookInfoType?'未输入':'请输入检查要求'"
  98. v-model="dialogForm.checkDemand"
  99. maxlength="100"
  100. resize="none"
  101. show-word-limit
  102. :style="!lookInfoType?'width:450px;':'width:1040px;'">
  103. </el-input>
  104. </el-form-item>
  105. <el-form-item label="材料附件:">
  106. <div class="dialog-material-max-box">
  107. <div class="dialog-material-button-box" v-if="!lookInfoType&&dialogForm.uploadDtoList.length<10">
  108. <el-upload
  109. class="avatar-uploader"
  110. :action="uploadImgUrl"
  111. :show-file-list="false"
  112. :on-success="(res)=>handleAvatarSuccess(res)"
  113. :headers="headers"
  114. :before-upload="beforeAvatarUpload">
  115. <p class="page-add-common-style-button">+ 选择文件</p>
  116. </el-upload>
  117. <p class="dialog-material-text">支持docx/xlsx/pdf格式文件</p>
  118. </div>
  119. <div class="dialog-material-list-box">
  120. <div v-for="(item,index) in dialogForm.uploadDtoList" :key="index">
  121. <img src="@/assets/ZDimages/safetyCheck/icon_dr_wj.png">
  122. <p>{{item.fileName}}</p>
  123. <p @click="dialogClickType(5,item)">查看</p>
  124. <p @click="delUpData(index)" v-if="!lookInfoType">删除</p>
  125. <p v-if="lookInfoType" @click="downloadButton(item)">下载</p>
  126. </div>
  127. <p class="dialog-material-list-null" v-if="!dialogForm.uploadDtoList[0]">未上传</p>
  128. </div>
  129. </div>
  130. </el-form-item>
  131. </el-form>
  132. </div>
  133. </div>
  134. <div class="inspectionPlan-dialog-dept-box" v-show="addDialogBoxType==2">
  135. <div class="left-max-box">
  136. <div class="dept-table-title-box">
  137. <p>已选学院</p>
  138. <p v-if="!lookInfoType">{{deptNumLeft}}/{{deptTotalLeft}}</p>
  139. <p v-if="lookInfoType">{{deptNumLeft}}</p>
  140. </div>
  141. <div class="dept-table-max-box">
  142. <el-form :model="deptQueryParamsLeft" class="form-box" ref="queryForm" :inline="true" label-width="50px">
  143. <el-form-item label="" prop="searchValue" class="form-index">
  144. <el-input
  145. maxLength="30"
  146. v-model="deptQueryParamsLeft.searchValue"
  147. placeholder="搜索学院"
  148. clearable
  149. style="width: 240px">
  150. <p v-if="!lookInfoType" class="el-icon-search" slot="append" @click="deptGetListLeft"></p>
  151. <p v-if="lookInfoType" class="el-icon-search" slot="append" @click="lookDeptLeftSearch"></p>
  152. </el-input>
  153. </el-form-item>
  154. <el-form-item style="margin-right:0;">
  155. <p v-if="!lookInfoType" class="page-submit-common-style-button" @click="deptResetQueryLeft" style="width:60px;margin-right:0;">重置</p>
  156. <p v-if="lookInfoType" class="page-submit-common-style-button" @click="lookDeptLeftReset" style="width:60px;margin-right:0;">重置</p>
  157. </el-form-item>
  158. </el-form>
  159. <el-table class="table-box" ref="leftDeptTable" border :data="deptTableListLeft" @select-all="deptChange" @select="deptChange" :row-key="getDeptRowKeys">
  160. <el-table-column v-if="!lookInfoType" type="selection" width="50" :reserve-selection="true" align="center"/>
  161. <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip>
  162. <template slot-scope="scope">
  163. <div style="display: flex;">
  164. <p style="flex:1;">{{scope.row.deptName}}</p>
  165. <p style="width:80px;text-align: center">共{{scope.row.subNum}}间</p>
  166. </div>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. </div>
  171. </div>
  172. <div class="right-max-box">
  173. <div class="dept-table-title-box">
  174. <p>已选实验室{{deptCheckData.subNum}}间</p>
  175. <p></p>
  176. </div>
  177. <div class="dept-table-max-box">
  178. <el-form :model="deptQueryParamsRight" class="form-box" ref="queryForm" :inline="true" label-width="50px">
  179. <el-form-item label="" prop="typeId">
  180. <el-select v-model="deptQueryParamsRight.typeId" clearable placeholder="选择分类" style="width: 120px">
  181. <el-option
  182. v-for="item in classTypeList"
  183. :key="item.typeId"
  184. :label="item.typeName"
  185. :value="item.typeId">
  186. </el-option>
  187. </el-select>
  188. </el-form-item>
  189. <el-form-item label="" prop="levelId">
  190. <el-select v-model="deptQueryParamsRight.levelId" clearable placeholder="选择分级" style="width: 120px">
  191. <el-option
  192. v-for="item in classifiedList"
  193. :key="item.levelId"
  194. :label="item.levelName"
  195. :value="item.levelId">
  196. </el-option>
  197. </el-select>
  198. </el-form-item>
  199. <el-form-item label="" prop="deptId">
  200. <el-select v-model="deptQueryParamsRight.deptId" clearable placeholder="选择学院" style="width: 120px">
  201. <el-option
  202. v-for="item in changeDeptSelectList"
  203. :key="item.deptId"
  204. :label="item.deptName"
  205. :value="item.deptId">
  206. </el-option>
  207. </el-select>
  208. </el-form-item>
  209. <el-form-item label="" prop="searchValue" class="form-index">
  210. <el-input
  211. maxLength="30"
  212. v-model="deptQueryParamsRight.searchValue"
  213. placeholder="实验室/房间号"
  214. clearable
  215. style="width: 190px">
  216. <p v-if="!lookInfoType" class="el-icon-search" slot="append" @click="deptHandleQueryRight"></p>
  217. <p v-if="lookInfoType" class="el-icon-search" slot="append" @click="lookDeptRightSearch"></p>
  218. </el-input>
  219. </el-form-item>
  220. <el-form-item style="margin-right:0;">
  221. <p v-if="!lookInfoType" class="page-submit-common-style-button" @click="deptResetQueryRight" style="width:60px;margin-right:0;">重置</p>
  222. <p v-if="lookInfoType" class="page-submit-common-style-button" @click="lookDeptRightReset" style="width:60px;margin-right:0;">重置</p>
  223. </el-form-item>
  224. </el-form>
  225. <el-table class="table-box" border :data="deptTableListRight">
  226. <el-table-column label="序号" align="center" type="index" width="60"/>
  227. <el-table-column label="实验室" align="center" prop="subName" show-overflow-tooltip>
  228. <template slot-scope="scope">{{scope.row.roomNum?scope.row.subName+'-'+scope.row.roomNum:scope.row.subName}}</template>
  229. </el-table-column>
  230. <el-table-column label="楼栋楼层" align="center" prop="buildName" show-overflow-tooltip width="150">
  231. <template slot-scope="scope">{{scope.row.buildName}}{{scope.row.floorName}}</template>
  232. </el-table-column>
  233. <el-table-column label="分类分级" align="center" prop="deptName" show-overflow-tooltip width="150">
  234. <template slot-scope="scope">
  235. <span>{{scope.row.classTypeNames}}</span>
  236. <span>-</span>
  237. <span :style="'color:'+scope.row.classLevelColor+';'">{{scope.row.classLevelName}}</span>
  238. </template>
  239. </el-table-column>
  240. <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip width="140"/>
  241. </el-table>
  242. <pagination layout="total, prev, pager, next, jumper"
  243. v-show="deptTotalRight>0"
  244. :total="deptTotalRight"
  245. :page.sync="deptQueryParamsRight.page"
  246. :limit.sync="deptQueryParamsRight.pageSize"
  247. @pagination="deptGetListRight"
  248. />
  249. </div>
  250. </div>
  251. </div>
  252. <div class="inspectionPlan-dialog-sub-box" v-show="addDialogBoxType==3">
  253. <div v-if="!lookInfoType" class="left-max-box">
  254. <div class="dept-table-title-box">
  255. <p>待选实验室</p>
  256. <p>{{subNumLeft}}/{{subTotalLeft}}</p>
  257. </div>
  258. <div class="dept-table-max-box">
  259. <el-form :model="subQueryParamsLeft" class="form-box" ref="queryForm" :inline="true" label-width="50px">
  260. <el-form-item label="" prop="typeId">
  261. <el-select v-model="subQueryParamsLeft.typeId" clearable placeholder="选择分类" style="width: 110px">
  262. <el-option
  263. v-for="item in classTypeList"
  264. :key="item.typeId"
  265. :label="item.typeName"
  266. :value="item.typeId">
  267. </el-option>
  268. </el-select>
  269. </el-form-item>
  270. <el-form-item label="" prop="levelId">
  271. <el-select v-model="subQueryParamsLeft.levelId" clearable placeholder="选择分级" style="width: 110px">
  272. <el-option
  273. v-for="item in classifiedList"
  274. :key="item.levelId"
  275. :label="item.levelName"
  276. :value="item.levelId">
  277. </el-option>
  278. </el-select>
  279. </el-form-item>
  280. <el-form-item label="" prop="deptId">
  281. <el-select v-model="subQueryParamsLeft.deptId" clearable placeholder="学院" style="width: 80px">
  282. <el-option
  283. v-for="item in deptSelectList"
  284. :key="item.deptId"
  285. :label="item.deptName"
  286. :value="item.deptId">
  287. </el-option>
  288. </el-select>
  289. </el-form-item>
  290. <el-form-item label="" prop="searchValue" class="form-index">
  291. <el-input
  292. maxLength="30"
  293. v-model="subQueryParamsLeft.searchValue"
  294. placeholder="实验室/房间号"
  295. clearable
  296. style="width: 140px">
  297. <p class="el-icon-search" slot="append" @click="subHandleQueryLeft"></p>
  298. </el-input>
  299. </el-form-item>
  300. <el-form-item style="margin-right:0;">
  301. <p class="page-submit-common-style-button" @click="subResetQueryLeft" style="width:60px;margin-right:0;">重置</p>
  302. </el-form-item>
  303. </el-form>
  304. <el-table class="table-box" ref="leftSubTable" border :data="subTableListLeft" @selection-change="subChangeLeft" :row-key="getSubRowKeys">
  305. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  306. <el-table-column label="实验室" align="center" prop="subName" show-overflow-tooltip>
  307. <template slot-scope="scope">{{scope.row.roomNum?scope.row.subName+'-'+scope.row.roomNum:scope.row.subName}}</template>
  308. </el-table-column>
  309. <el-table-column label="分类分级" align="center" prop="deptName" show-overflow-tooltip width="140">
  310. <template slot-scope="scope">
  311. <span>{{scope.row.classTypeNames}}</span>
  312. <span>-</span>
  313. <span :style="'color:'+scope.row.classLevelColor+';'">{{scope.row.classLevelName}}</span>
  314. </template>
  315. </el-table-column>
  316. <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip width="150"/>
  317. </el-table>
  318. <pagination layout="total, prev, pager, next, jumper"
  319. v-show="subTotalLeft>0"
  320. :total="subTotalLeft"
  321. :page.sync="subQueryParamsLeft.page"
  322. :limit.sync="subQueryParamsLeft.pageSize"
  323. @pagination="subGetListLeft"/>
  324. </div>
  325. </div>
  326. <div v-if="!lookInfoType" class="center-box">
  327. <p class="el-icon-arrow-left" @click="subArrowButton(1)"></p>
  328. <p class="el-icon-arrow-right" @click="subArrowButton(2)"></p>
  329. </div>
  330. <div class="right-max-box">
  331. <div class="dept-table-title-box">
  332. <p>已选实验室</p>
  333. <p v-if="!lookInfoType">{{subNumRight}}/{{subTotalRight}}</p>
  334. <p v-if="lookInfoType">{{subTotalRight}}</p>
  335. </div>
  336. <div class="dept-table-max-box">
  337. <el-form :model="subQueryParamsRight" class="form-box" ref="queryForm" :inline="true" label-width="50px">
  338. <el-form-item label="" prop="typeId">
  339. <el-select v-model="subQueryParamsRight.typeId" clearable placeholder="选择分类" style="width: 110px">
  340. <el-option
  341. v-for="item in classTypeList"
  342. :key="item.typeId"
  343. :label="item.typeName"
  344. :value="item.typeId">
  345. </el-option>
  346. </el-select>
  347. </el-form-item>
  348. <el-form-item label="" prop="levelId">
  349. <el-select v-model="subQueryParamsRight.levelId" clearable placeholder="选择分级" style="width: 110px">
  350. <el-option
  351. v-for="item in classifiedList"
  352. :key="item.levelId"
  353. :label="item.levelName"
  354. :value="item.levelId">
  355. </el-option>
  356. </el-select>
  357. </el-form-item>
  358. <el-form-item label="" prop="deptId">
  359. <el-select v-model="subQueryParamsRight.deptId" clearable placeholder="学院" style="width: 80px">
  360. <el-option
  361. v-for="item in deptSelectList"
  362. :key="item.deptId"
  363. :label="item.deptName"
  364. :value="item.deptId">
  365. </el-option>
  366. </el-select>
  367. </el-form-item>
  368. <el-form-item label="" prop="searchValue" class="form-index">
  369. <el-input
  370. maxLength="30"
  371. v-model="subQueryParamsRight.searchValue"
  372. placeholder="实验室/房间号"
  373. clearable
  374. style="width: 140px">
  375. <p class="el-icon-search" slot="append" @click="subHandleQueryRight"></p>
  376. </el-input>
  377. </el-form-item>
  378. <el-form-item style="margin-right:0;">
  379. <p class="page-submit-common-style-button" @click="subResetQueryRight" style="width:60px;margin-right:0;">重置</p>
  380. </el-form-item>
  381. </el-form>
  382. <el-table class="table-box" ref="rightSubTable" border :data="subTableListRight" @selection-change="subChangeRight" :row-key="getSubRowKeys">
  383. <el-table-column v-if="!lookInfoType" type="selection" width="50" :reserve-selection="true" align="center"/>
  384. <el-table-column label="实验室" align="center" prop="subName" show-overflow-tooltip>
  385. <template slot-scope="scope">{{scope.row.roomNum?scope.row.subName+'-'+scope.row.roomNum:scope.row.subName}}</template>
  386. </el-table-column>
  387. <el-table-column label="分类分级" align="center" prop="deptName" show-overflow-tooltip width="140">
  388. <template slot-scope="scope">
  389. <span>{{scope.row.classTypeNames}}</span>
  390. <span>-</span>
  391. <span :style="'color:'+scope.row.classLevelColor+';'">{{scope.row.classLevelName}}</span>
  392. </template>
  393. </el-table-column>
  394. <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip width="150"/>
  395. </el-table>
  396. <pagination layout="total, prev, pager, next, jumper"
  397. v-show="subTotalRight>0"
  398. :total="subTotalRight"
  399. :page.sync="subQueryParamsRight.page"
  400. :limit.sync="subQueryParamsRight.pageSize"
  401. @pagination="subGetListRight"/>
  402. </div>
  403. </div>
  404. </div>
  405. <div class="inspectionPlan-dialog-look-box" v-if="addDialogBoxType==5">
  406. <iframe
  407. class="iframe-box"
  408. :src="iframeSrc" scrolling="auto" frameborder="0">
  409. </iframe>
  410. </div>
  411. <div class="inspectionPlan-dialog-user-box" v-show="addDialogBoxType==6">
  412. <div class="left-max-box">
  413. <div class="dept-table-title-box">
  414. <p>待选</p>
  415. <p>{{deviceNumLeft}}/{{deviceTotalLeft}}</p>
  416. </div>
  417. <div class="dept-table-max-box">
  418. <el-form :model="deviceQueryParamsLeft" class="form-box" ref="queryForm" :inline="true" label-width="50px">
  419. <el-form-item label="" prop="deptId">
  420. <el-select v-model="deviceQueryParamsLeft.hazardTypeMode" clearable placeholder="选择类型" style="width: 110px">
  421. <el-option
  422. v-for="item in dangerArr"
  423. :key="item.dictValue"
  424. :label="item.dictLabel"
  425. :value="item.dictValue">
  426. </el-option>
  427. </el-select>
  428. </el-form-item>
  429. <el-form-item label="" prop="searchValue" class="form-index">
  430. <el-input
  431. maxLength="20"
  432. v-model="deviceQueryParamsLeft.searchValue"
  433. placeholder="搜索设备名称"
  434. clearable
  435. style="width: 240px">
  436. <p class="el-icon-search" slot="append" @click="deviceHandleQueryLeft"></p>
  437. </el-input>
  438. </el-form-item>
  439. <el-form-item style="margin-right:0;">
  440. <p class="page-submit-common-style-button" @click="deviceResetQueryLeft" style="width:60px;">重置</p>
  441. </el-form-item>
  442. </el-form>
  443. <el-table class="table-box" ref="leftDeviceTable" border :data="deviceTableListLeft" @selection-change="deviceChangeLeft" :row-key="getDeviceRowKeys">
  444. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  445. <el-table-column label="名称" align="center" prop="chName" show-overflow-tooltip/>
  446. <el-table-column label="型号" align="center" prop="code" show-overflow-tooltip width="150"/>
  447. <el-table-column label="类型" align="center" prop="hazardTypeModeName" show-overflow-tooltip width="168"/>
  448. </el-table>
  449. <pagination layout="total, prev, pager, next, jumper"
  450. v-show="deviceTotalLeft>0"
  451. :total="deviceTotalLeft"
  452. :pager-count="5"
  453. :page.sync="deviceQueryParamsLeft.page"
  454. :limit.sync="deviceQueryParamsLeft.pageSize"
  455. @pagination="deviceGetListLeft"/>
  456. </div>
  457. </div>
  458. <div class="center-box">
  459. <p class="el-icon-arrow-left" @click="deviceArrowButton(1)"></p>
  460. <p class="el-icon-arrow-right" @click="deviceArrowButton(2)"></p>
  461. </div>
  462. <div class="right-max-box">
  463. <div class="dept-table-title-box">
  464. <p>已选</p>
  465. <p>{{deviceNumRight}}/{{deviceTotalRight}}</p>
  466. </div>
  467. <div class="dept-table-max-box">
  468. <el-form :model="deviceQueryParamsRight" class="form-box" ref="queryForm" :inline="true" label-width="50px">
  469. <el-form-item label="" prop="deptId">
  470. <el-select v-model="deviceQueryParamsRight.hazardTypeMode" clearable placeholder="选择类型" style="width: 110px">
  471. <el-option
  472. v-for="item in dangerArr"
  473. :key="item.dictValue"
  474. :label="item.dictLabel"
  475. :value="item.dictValue">
  476. </el-option>
  477. </el-select>
  478. </el-form-item>
  479. <el-form-item label="" prop="searchValue" class="form-index">
  480. <el-input
  481. maxLength="20"
  482. v-model="deviceQueryParamsRight.searchValue"
  483. placeholder="搜索设备名称"
  484. clearable
  485. style="width: 240px">
  486. <p class="el-icon-search" slot="append" @click="deviceHandleQueryRight"></p>
  487. </el-input>
  488. </el-form-item>
  489. <el-form-item style="margin-right:0;">
  490. <p class="page-submit-common-style-button" @click="deviceResetQueryRight" style="width:60px;">重置</p>
  491. </el-form-item>
  492. </el-form>
  493. <el-table class="table-box" ref="rightDeviceTable" border :data="deviceTableListRight" @selection-change="deviceChangeRight" :row-key="getDeviceRowKeys">
  494. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  495. <el-table-column label="名称" align="center" prop="chName" show-overflow-tooltip/>
  496. <el-table-column label="型号" align="center" prop="code" show-overflow-tooltip width="150"/>
  497. <el-table-column label="类型" align="center" prop="hazardTypeModeName" show-overflow-tooltip width="168"/>
  498. </el-table>
  499. <pagination layout="total, prev, pager, next, jumper"
  500. v-show="deviceTotalRight>0"
  501. :total="deviceTotalRight"
  502. :pager-count="5"
  503. :page.sync="deviceQueryParamsRight.page"
  504. :limit.sync="deviceQueryParamsRight.pageSize"
  505. @pagination="deviceGetListRight"/>
  506. </div>
  507. </div>
  508. </div>
  509. <div slot="footer" class="dialog-footer dialog-footer-box" style="display: flex">
  510. <p class="dialog-footer-button-null"></p>
  511. <p class="dialog-footer-button-info" @click="addDialogOff">{{addDialogBoxType==1?'取消':'返回'}}</p>
  512. <p class="dialog-footer-button-primary" v-if="!lookInfoType && addDialogBoxType!=5" @click="addUserButton">确定</p>
  513. <p class="dialog-footer-button-null"></p>
  514. </div>
  515. <fullScreenFileLook ref="fullScreenFileLook"></fullScreenFileLook>
  516. </el-dialog>
  517. </template>
  518. <script>
  519. // V3
  520. import fullScreenFileLook from "@/components/fullScreenFileLook/fullScreenFileLook.vue";
  521. import { getToken } from "@/utils/auth";
  522. import {
  523. getDeptDropList,
  524. laboratoryClassTypeGetList,
  525. laboratoryClassLevelGetList,
  526. } from '@/api/commonality/permission'
  527. import { getDicts } from '@/api/commonality/noPermission'
  528. import {
  529. laboratorySubRelInfoGetAllSubNum,
  530. laboratorySubRelInfoConditionCollegeInfo,
  531. getHistoryPlanTitles,isSCollege,
  532. laboratorySubRelInfoGetRelListByCondition,
  533. laboratorySubRelInfoConditionSubjectInfo,
  534. laboratoryHazardQueryHazardList,
  535. checkPlanAdd,findCheckPlan,
  536. checkPlanUpdate, hideHistoryPlanTitle,
  537. haveHazardInSub,
  538. } from '@/api/safetyCheck/indexTow'
  539. export default {
  540. name: 'addDialog',
  541. props:{
  542. addDialogData:{},
  543. },
  544. components: {
  545. fullScreenFileLook,
  546. },
  547. data(){
  548. return{
  549. loading:false,
  550. uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
  551. headers: {
  552. Authorization: getToken(),
  553. },
  554. addDialogTitle:"",
  555. addDialogType:true,
  556. //弹窗内容状态
  557. addDialogBoxType:1,
  558. // 设置只能选择当前日期及之后的日期
  559. pickerOptions: {
  560. disabledDate(time) {
  561. return time.getTime() < Date.now() - 8.64e7;//如果没有后面的-8.64e7就是不可以选择今天的
  562. }
  563. },
  564. //标题快选数据
  565. quickSelectionList:[],
  566. //上传文件名称暂存
  567. upDataName:"",
  568. //巡查范围列表
  569. dialogRangeOptions:[],
  570. //学院数量
  571. collegeNum:0,
  572. //学院实验室数量
  573. collegeSubNum:0,
  574. //学院选择页面已选数据
  575. deptCheckData:{
  576. deptIds:[],
  577. deptNum:0,
  578. subNum:0
  579. },
  580. //实验室选择页面已选数据
  581. subCheckData:{
  582. subIds:[]
  583. },
  584. //巡查院系列表
  585. deptList:[],
  586. //巡查实验室列表
  587. subList:[],
  588. //提交数据
  589. dialogForm:{
  590. title:"",//奥体
  591. checkType:"2",//检查组织
  592. dateRange:[],//时间
  593. checkCategory:'1',//检查类型
  594. hazardIds:'',//危险源ids
  595. hazardNum:'0',// 危险源数量
  596. checkRange:"",//检查范围
  597. checkDemand:"",//检查要点
  598. schoolSubCheckNum:0,//学校实验室数量
  599. collegeNum:0,//学院数量
  600. collegeSubNum:0,//学院实验室数量
  601. subCheckNum:0,//实验室数量
  602. subjectNum:0,
  603. collegeIds:[],
  604. uploadDtoList:[],
  605. },
  606. // 表单校验
  607. rules: {
  608. title: [
  609. { required: true, message: "请输入计划标题", trigger: "change" },
  610. { required: true, message: "请输入计划标题", validator: this.spaceJudgment, trigger: "change" },
  611. ],
  612. checkCategory: [
  613. { required: true, message: "请选择检查类型", trigger: "change" },
  614. ],
  615. dateRange: [
  616. { required: true, message: "请选择任务周期", trigger: "change" },
  617. ],
  618. checkRange: [
  619. { required: true, message: "请选择检查范围", trigger: "change" },
  620. ],
  621. },
  622. classTypeList:[],
  623. classifiedList:[],
  624. deptSelectList:[],
  625. //查看状态
  626. lookInfoType:false,
  627. /*===================================学院选择相关===================================*/
  628. changeDeptSelectList:[],
  629. deptQueryParamsLeft:{
  630. searchValue:"",
  631. },
  632. deptTableListLeft:[],
  633. deptTotalLeft:0,
  634. deptNumLeft:0,
  635. deptIdsLeft:[],
  636. deptQueryParamsRight:{
  637. page:1,
  638. pageSize:20,
  639. searchValue:"",
  640. deptId:"",
  641. deptIds:"",
  642. levelId:"",
  643. typeId:"",
  644. },
  645. deptTableListRight:[],
  646. deptTotalRight:0,
  647. /*===================================实验室选择相关===================================*/
  648. subQueryParamsLeft:{
  649. page:1,
  650. pageSize:20,
  651. typeId:"",
  652. levelId:"",
  653. deptId:"",
  654. searchValue:"",
  655. filtType:1
  656. },
  657. subTableListLeft:[],
  658. subTotalLeft:0,
  659. subNumLeft:0,
  660. subIdsLeft:[],
  661. subQueryParamsRight:{
  662. page:1,
  663. pageSize:20,
  664. typeId:"",
  665. levelId:"",
  666. deptId:"",
  667. searchValue:"",
  668. filtType:2
  669. },
  670. subTableListRight:[],
  671. subTotalRight:0,
  672. subNumRight:0,
  673. subIdsRight:[],
  674. dialogTableSubList:[],
  675. dialogTableSubDataList:[],
  676. /*===================================设备相关===================================*/
  677. //检查类型
  678. inspectCategoryList:[{id:'1',name:'综合检查'},{id:'2',name:'专项检查'}],
  679. deviceQueryParamsLeft:{
  680. page: 1,
  681. pageSize: 20,
  682. searchValue:"",
  683. hazardTypeMode:"",
  684. filtType:1//1是过滤,2是不过滤
  685. },
  686. deviceTableListLeft:[],
  687. deviceTotalLeft:0,
  688. deviceNumLeft:0,
  689. deviceIdsLeft:[],
  690. deviceQueryParamsRight:{
  691. page: 1,
  692. pageSize: 20,
  693. searchValue:"",
  694. hazardTypeMode:"",
  695. filtType:2
  696. },
  697. deviceTableListRight:[],
  698. deviceTotalRight:0,
  699. deviceNumRight:0,
  700. deviceIdsRight:[],
  701. deviceDialogTableDataList:[],
  702. deviceDialogList:[],//存储所有的设备
  703. dangerArr:[],
  704. deviceIsEmpty:false,//如果是专项检查-判断是否选择检查范围和检查内容
  705. /*===================================文档预览===================================*/
  706. iframeSrc:"",
  707. /*===================================弹窗相关结束===================================*/
  708. }
  709. },
  710. created(){
  711. this.$set(this,'addDialogTitle',this.addDialogData.title);
  712. this.$set(this,'lookInfoType',this.addDialogData.lookInfoType);
  713. },
  714. mounted(){
  715. this.initializationInterface();
  716. this.dangerList();
  717. this.deviceGetList();//查询所有设备
  718. },
  719. methods:{
  720. //初始化接口
  721. initializationInterface(){
  722. //获取历史标题
  723. this.getHistoryPlanTitles();
  724. //获取学院列表
  725. getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
  726. this.$set(this, 'deptSelectList', response.data)
  727. })
  728. /**获取分级*/
  729. laboratoryClassLevelGetList({}).then(response => {
  730. this.$set(this, 'classifiedList', response.data)
  731. })
  732. /**获取分类*/
  733. laboratoryClassTypeGetList({}).then(response => {
  734. this.$set(this, 'classTypeList', response.data)
  735. })
  736. //查询当前用户是否是院级
  737. isSCollege().then(response=>{
  738. if(response.data.userFlg){
  739. // 院级
  740. this.$set(this,'dialogRangeOptions',[{label:"学院",value:2},{label:"实验室",value:3}]);
  741. }else{
  742. // 校级
  743. this.$set(this,'dialogRangeOptions',[{label:"全校",value:1},{label:"学院",value:2},{label:"实验室",value:3}]);
  744. }
  745. });
  746. if(!this.addDialogData.addType){
  747. //编辑-详情查询
  748. findCheckPlan({id:this.addDialogData.id}).then(response => {
  749. //处理基础数据
  750. let obj = {
  751. id:response.data.id,
  752. title:response.data.title,
  753. checkType:response.data.checkType,
  754. checkCategory:response.data.checkCategory+'',
  755. hazardIds:response.data.hazardIds,
  756. hazardNum:response.data.hazardNum,
  757. dateRange:[response.data.cycleStartTime,response.data.cycleEndTime],
  758. checkRange:response.data.checkRange,
  759. schoolSubCheckNum:response.data.checkRange == 1?response.data.subjectNum:0,
  760. collegeSubNum:response.data.checkRange == 2?response.data.subjectNum:0,
  761. collegeNum:response.data.checkRange == 2?response.data.collegeNum:0,
  762. subCheckNum:response.data.checkRange == 3?response.data.subjectNum:0,
  763. collegeIds:response.data.collegeIds?response.data.collegeIds.split(','):[],
  764. checkDemand:response.data.checkDemand,
  765. uploadDtoList:response.data.uploadDtoList,
  766. }
  767. this.$set(this,'dialogForm',obj);
  768. //处理实验室数据
  769. let subList = response.data.subIds?response.data.subIds.split(','):[];
  770. let subDataList = [];
  771. for(let i=0;i<subList.length;i++){
  772. let obj = {
  773. subId:subList[i],
  774. }
  775. subDataList.push(obj);
  776. }
  777. this.$set(this,'dialogTableSubList',subDataList);
  778. this.$set(this.subCheckData,'subIds',subList);
  779. });
  780. }
  781. },
  782. //选中检查类型
  783. inspectCategoryChange(val){
  784. },
  785. //选中检查范围
  786. rangeChange(val){
  787. if(val == 1){
  788. //全校
  789. laboratorySubRelInfoGetAllSubNum().then(response => {
  790. this.$set(this.dialogForm,'schoolSubCheckNum',response.data.subCount);
  791. })
  792. }
  793. },
  794. //确定按钮
  795. addUserButton(){
  796. let self = this;
  797. if(this.addDialogBoxType == 1){
  798. //提交
  799. this.$refs["addDialogForm"].validate(valid => {
  800. if (valid) {
  801. //检查范围内是否选择实验室获学院
  802. if(this.dialogForm.checkRange == 2){
  803. if(!this.dialogForm.collegeIds[0]){
  804. this.msgError('请选择学院')
  805. return
  806. }
  807. if(this.dialogForm.collegeSubNum<1){
  808. this.msgError('所选学院下实验室数量不足')
  809. return
  810. }
  811. }else if(this.dialogForm.checkRange == 3){
  812. if(!this.subCheckData.subIds[0]){
  813. this.msgError('请选择实验室')
  814. return
  815. }
  816. }
  817. if(this.dialogForm.checkCategory==2){
  818. if(this.dialogForm.hazardNum==0){
  819. this.msgError('请选择检查内容')
  820. return
  821. }
  822. }
  823. let obj = {
  824. title:this.dialogForm.title,
  825. checkType:this.dialogForm.checkType,
  826. cycleStartTime:this.dialogForm.dateRange[0],
  827. cycleEndTime:this.dialogForm.dateRange[1],
  828. checkCategory:this.dialogForm.checkCategory,//检查类型
  829. hazardIds:this.dialogForm.hazardIds,//危险源ids
  830. hazardNum:this.dialogForm.hazardNum,// 危险源数量
  831. checkRange:this.dialogForm.checkRange,//检查范围
  832. subjectNum:this.dialogForm.checkRange == 1?this.dialogForm.schoolSubCheckNum:(
  833. this.dialogForm.checkRange == 2?this.dialogForm.collegeSubNum:(
  834. this.dialogForm.checkRange == 3?this.dialogForm.subCheckNum:0)),//实验室数量
  835. collegeIds:this.dialogForm.checkRange==2?this.dialogForm.collegeIds+'':'',//学院ID转换字符串
  836. collegeNum:this.dialogForm.checkRange==2?this.dialogForm.collegeNum:0,//学院数量
  837. subIds:this.dialogForm.checkRange == 3?this.subCheckData.subIds+'':'',//实验室ID
  838. checkDemand:this.dialogForm.checkDemand,//检查要求
  839. uploadDtoList:this.dialogForm.uploadDtoList,//检查要求
  840. };
  841. if(this.addDialogData.id){
  842. //编辑
  843. for(let i=0;i<obj.uploadDtoList.length;i++){
  844. obj.uploadDtoList[i].keyId = this.addDialogData.id;
  845. }
  846. obj.id = this.addDialogData.id;
  847. checkPlanUpdate(obj).then(response => {
  848. this.msgSuccess(response.message)
  849. this.$parent.addDialogOpen(5)
  850. })
  851. }else{
  852. //新增
  853. checkPlanAdd(obj).then(response => {
  854. this.msgSuccess(response.message)
  855. this.$parent.addDialogOpen(5)
  856. })
  857. }
  858. }
  859. })
  860. }else if(this.addDialogBoxType == 2){
  861. // 学院选择页面确定
  862. this.$set(this.dialogForm,'collegeNum',this.deptCheckData.deptNum);
  863. this.$set(this.dialogForm,'collegeSubNum',this.deptCheckData.subNum);
  864. this.$set(this.dialogForm,'collegeIds',this.deptCheckData.deptIds);
  865. this.dialogClickType(1);
  866. }else if(this.addDialogBoxType == 3){
  867. //实验室选择页面确定
  868. let list = [];
  869. let ids = [];
  870. for(let o=0;o<self.dialogTableSubDataList.length;o++){
  871. ids.push(self.dialogTableSubDataList[o].subId)
  872. let obj = {
  873. subId:self.dialogTableSubDataList[o].subId,
  874. subjectName:self.dialogTableSubDataList[o].subjectName,
  875. typeId:self.dialogTableSubDataList[o].typeId,
  876. levelId:self.dialogTableSubDataList[o].levelId,
  877. collegeName:self.dialogTableSubDataList[o].collegeName,
  878. };
  879. list.push(obj)
  880. }
  881. this.$set(this.subCheckData,'subIds',ids);
  882. this.$set(this.dialogForm,'subCheckNum',list.length);
  883. this.$set(this,'dialogTableSubList',list);
  884. this.dialogClickType(1);
  885. }else if(this.addDialogBoxType == 6){
  886. let list=[]
  887. for(let i=0;i<self.deviceDialogTableDataList.length;i++){
  888. list.push(self.deviceDialogTableDataList[i].hazardId)
  889. }
  890. this.$set(this.dialogForm,'hazardIds',list.join(','));
  891. this.$set(this.dialogForm,'hazardNum',list.length);
  892. //实验室是否有当前设备
  893. let obj={
  894. "checkRange":this.dialogForm.checkRange,
  895. "collegeIds":this.dialogForm.checkRange==2?this.dialogForm.collegeIds+'':'',//学院ID转换字符串
  896. "subIds":this.dialogForm.checkRange == 3?this.subCheckData.subIds+'':'',//实验室ID
  897. "hazardIds":this.dialogForm.hazardIds,
  898. }
  899. haveHazardInSub(obj).then(response => {
  900. if(response.code==200){
  901. this.dialogClickType(1);
  902. }else{
  903. this.$set(this.dialogForm,'hazardIds','');
  904. this.$set(this.dialogForm,'hazardNum',0);
  905. }
  906. });
  907. }
  908. },
  909. /*===================================弹窗相关===================================*/
  910. //弹窗关闭
  911. addDialogAllOff(){
  912. this.$parent.addDialogOpen(4)
  913. },
  914. addDialogOff(){
  915. if(this.addDialogBoxType == 1){
  916. this.$parent.addDialogOpen(4)
  917. }else{
  918. this.dialogClickType(1);
  919. }
  920. },
  921. //弹窗状态切换
  922. dialogClickType(type,item){
  923. let self = this;
  924. if(type == 5){
  925. //判断类型
  926. let type = '';
  927. if(item.fileUrl.split('.')[1] == 'docx'){
  928. type = 'docx'
  929. }else if(item.fileUrl.split('.')[1] == 'xlsx'){
  930. type = 'excel'
  931. }else if(item.fileUrl.split('.')[1] == 'pdf'){
  932. type = 'pdf'
  933. }
  934. let url = localStorage.getItem('fileBrowseEnvironment')+item.fileUrl;
  935. this.$refs['fullScreenFileLook'].initialize(item.fileName,url,type);
  936. }else if(type == 6){//检查设备
  937. if(!this.dialogForm.checkRange){
  938. this.msgError('请选择检查范围')
  939. return
  940. }
  941. if(this.dialogForm.checkRange == 1){
  942. if(this.dialogForm.schoolSubCheckNum<1){
  943. this.msgError('该校区没有实验室')
  944. return
  945. }
  946. }
  947. if(this.dialogForm.checkRange == 2){
  948. if(this.dialogForm.collegeSubNum<1){
  949. this.msgError('未检测到学院下的实验室')
  950. return
  951. }
  952. }
  953. if(this.dialogForm.checkRange == 3 ){
  954. if(this.dialogForm.subCheckNum<1){
  955. this.msgError('请选择实验室实验室')
  956. return
  957. }
  958. }
  959. //设备
  960. let list=[];
  961. let list2=[];
  962. if(this.dialogForm.hazardIds){
  963. list=this.dialogForm.hazardIds.split(',')
  964. for(let i=0;i<this.deviceDialogList.length;i++){
  965. for(let b=0;b<list.length;b++){
  966. if(list[b]==this.deviceDialogList[i].hazardId){
  967. list2.push(this.deviceDialogList[i])
  968. }
  969. }
  970. }
  971. }
  972. this.$set(self,'deviceDialogTableDataList',list2);
  973. this.deviceResetQueryLeft();
  974. this.deviceResetQueryRight();
  975. this.$set(this,'addDialogBoxType',type);
  976. }else if(type == 2){
  977. //选择学院
  978. this.$set(this,'addDialogBoxType',type);
  979. this.deptResetQueryLeft();
  980. if(this.dialogForm.collegeIds[0]){
  981. this.$nextTick(() => {
  982. laboratorySubRelInfoConditionCollegeInfo(self.deptQueryParamsLeft).then(response => {
  983. if(this.lookInfoType){
  984. //查看时
  985. let list = [];
  986. for(let i=0;i<response.data.length;i++){
  987. let num = 0;
  988. for(let o=0;o<self.dialogForm.collegeIds.length;o++){
  989. if(response.data[i].deptId == self.dialogForm.collegeIds[o]){
  990. num++
  991. }
  992. }
  993. if(num == 0){
  994. response.data.splice(i,1);
  995. i--
  996. }
  997. }
  998. self.$set(self,'deptTableListLeft',response.data);
  999. self.$set(self,'deptTotalLeft',response.data.length);
  1000. self.$set(self,'changeDeptSelectList',response.data);
  1001. this.$set(this,'deptQueryParamsRight',{
  1002. page:1,
  1003. pageSize:20,
  1004. searchValue:"",
  1005. deptId:"",
  1006. levelId:"",
  1007. typeId:"",
  1008. });
  1009. let obj = JSON.parse(JSON.stringify(this.deptQueryParamsRight));
  1010. obj.deptIds = self.dialogForm.collegeIds;
  1011. laboratorySubRelInfoGetRelListByCondition(obj).then(response => {
  1012. this.deptTotalRight = response.data.total;
  1013. this.deptTableListRight = response.data.records;
  1014. this.$set(this.deptCheckData,'subNum',response.data.total);
  1015. this.$set(this,'deptNumLeft',self.dialogForm.collegeIds.length);
  1016. });
  1017. }else{
  1018. //新增-编辑时
  1019. self.$set(self,'deptTableListLeft',response.data);
  1020. self.$set(self,'deptTotalLeft',response.data.length);
  1021. let list = [];
  1022. for(let i=0;i<self.dialogForm.collegeIds.length;i++){
  1023. for(let o=0;o<self.deptTableListLeft.length;o++){
  1024. if(self.dialogForm.collegeIds[i] == self.deptTableListLeft[o].deptId){
  1025. list.push(self.deptTableListLeft[o])
  1026. self.$refs.leftDeptTable.toggleRowSelection(self.deptTableListLeft[o]);
  1027. }
  1028. }
  1029. }
  1030. self.deptChange(list);
  1031. }
  1032. })
  1033. })
  1034. }
  1035. }else if(type == 3){
  1036. //选择实验室
  1037. this.$set(self,'dialogTableSubDataList',JSON.parse(JSON.stringify(this.dialogTableSubList)));
  1038. this.subResetQueryLeft();
  1039. this.subResetQueryRight();
  1040. this.$set(this,'addDialogBoxType',type);
  1041. }else{
  1042. this.$set(this,'addDialogBoxType',type);
  1043. }
  1044. },
  1045. //选中对应周期
  1046. checkTime(type){
  1047. let myDate = new Date();
  1048. let year = myDate.getFullYear();
  1049. let month = myDate.getMonth()+1;
  1050. let day = myDate.getDate();
  1051. let minTime = year + '-' + month + '-' + day
  1052. let maxTime = '';
  1053. if(type==1){
  1054. maxTime = this.getMonthFinalDay(year,month);
  1055. }else if(type==2){
  1056. if(month>0 && month<4){
  1057. maxTime = this.getMonthFinalDay(year,3);
  1058. }else if(month>3 && month<7){
  1059. maxTime = this.getMonthFinalDay(year,6);
  1060. }else if(month>6 && month<10){
  1061. maxTime = this.getMonthFinalDay(year,9);
  1062. }else if(month>9 && month<13){
  1063. maxTime = this.getMonthFinalDay(year,12);
  1064. }
  1065. }else if(type==3){
  1066. maxTime = this.getMonthFinalDay(year,12);
  1067. }
  1068. let timeListA = minTime.split('-')
  1069. minTime = timeListA[0]+'-'+(timeListA[1]<10?'0'+timeListA[1]:timeListA[1])+'-'+(timeListA[2]<10?'0'+timeListA[2]:timeListA[2])
  1070. let timeListB = maxTime.split('-')
  1071. maxTime = timeListB[0]+'-'+(timeListB[1]<10?'0'+timeListB[1]:timeListB[1])+'-'+(timeListB[2]<10?'0'+timeListB[2]:timeListB[2])
  1072. this.$set(this.dialogForm,'dateRange',[minTime,maxTime]);
  1073. },
  1074. //返回指定月份最后一天
  1075. getMonthFinalDay(year,month){
  1076. var day='';
  1077. if(year==null || year==undefined || year==''){
  1078. year = new Date().getFullYear();
  1079. }
  1080. if(month==null || month==undefined || month==''){
  1081. month = new Date().getMonth()+1;
  1082. }
  1083. day = new Date(new Date(year,month).setDate(0)).getDate();
  1084. return year+"-"+month+"-"+day;
  1085. },
  1086. //删除弹窗上传文件
  1087. delUpData(index){
  1088. this.dialogForm.uploadDtoList.splice(index,1)
  1089. },
  1090. //快捷选中标题
  1091. checkTitle(item){
  1092. this.$set(this.dialogForm,'title',item.title);
  1093. },
  1094. /*===================================学院选择相关===================================*/
  1095. //重置
  1096. deptResetQueryLeft(){
  1097. this.$set(this,'deptQueryParamsLeft',{ searchValue:"", });
  1098. this.$set(this,'deptNumLeft',0);
  1099. this.$set(this,'deptIdsLeft',[]);
  1100. this.$refs.leftDeptTable.clearSelection();
  1101. this.deptGetListLeft();
  1102. },
  1103. //查询接口
  1104. deptGetListLeft(){
  1105. laboratorySubRelInfoConditionCollegeInfo(this.deptQueryParamsLeft).then(response => {
  1106. this.$set(this,'deptTableListLeft',response.data);
  1107. this.$set(this,'deptTotalLeft',response.data.length);
  1108. })
  1109. },
  1110. //查询
  1111. deptHandleQueryRight(){
  1112. this.deptGetListRight();
  1113. },
  1114. //重置
  1115. deptResetQueryRight(){
  1116. this.$set(this,'deptQueryParamsRight',{
  1117. page:1,
  1118. pageSize:20,
  1119. searchValue:"",
  1120. deptId:"",
  1121. deptIds:"",
  1122. levelId:"",
  1123. typeId:"",
  1124. });
  1125. this.deptHandleQueryRight();
  1126. },
  1127. //查询接口
  1128. deptGetListRight(){
  1129. let obj = JSON.parse(JSON.stringify(this.deptQueryParamsRight));
  1130. if(this.lookInfoType){
  1131. obj.deptIds = this.dialogForm.collegeIds;
  1132. }else{
  1133. obj.deptIds = this.deptIdsLeft;
  1134. }
  1135. laboratorySubRelInfoGetRelListByCondition(obj).then(response => {
  1136. this.deptTotalRight = response.data.total;
  1137. this.deptTableListRight = response.data.records;
  1138. });
  1139. },
  1140. /*===================================实验室选择相关===================================*/
  1141. //查询
  1142. subHandleQueryLeft(){
  1143. this.$set(this.subQueryParamsLeft,'page',1);
  1144. this.subGetListLeft();
  1145. },
  1146. //重置
  1147. subResetQueryLeft(){
  1148. this.$set(this,'subQueryParamsLeft',{
  1149. page:1,
  1150. pageSize:20,
  1151. typeId:"",
  1152. levelId:"",
  1153. deptId:"",
  1154. searchValue:"",
  1155. filtType:1
  1156. });
  1157. this.subHandleQueryLeft();
  1158. },
  1159. //查询接口
  1160. subGetListLeft(){
  1161. let self = this;
  1162. let leftObj = JSON.parse(JSON.stringify(this.subQueryParamsLeft));
  1163. leftObj.selectedSubIds = [];
  1164. for(let i=0;i<self.dialogTableSubDataList.length;i++){
  1165. leftObj.selectedSubIds.push(self.dialogTableSubDataList[i].subId);
  1166. }
  1167. laboratorySubRelInfoConditionSubjectInfo(leftObj).then(response => {
  1168. this.subTotalLeft = response.data.total;
  1169. this.subTableListLeft = response.data.records;
  1170. });
  1171. },
  1172. //查询
  1173. subHandleQueryRight(){
  1174. this.$set(this.subQueryParamsRight,'page',1);
  1175. this.subGetListRight();
  1176. },
  1177. //重置
  1178. subResetQueryRight(){
  1179. this.$set(this,'subQueryParamsRight',{
  1180. page:1,
  1181. pageSize:20,
  1182. typeId:"",
  1183. levelId:"",
  1184. deptId:"",
  1185. searchValue:"",
  1186. filtType:2
  1187. });
  1188. this.subHandleQueryRight();
  1189. },
  1190. //查询接口
  1191. subGetListRight(){
  1192. let self = this;
  1193. let rightObj = JSON.parse(JSON.stringify(this.subQueryParamsRight));
  1194. rightObj.subIds = [];
  1195. for(let i=0;i<self.dialogTableSubDataList.length;i++){
  1196. rightObj.subIds.push(self.dialogTableSubDataList[i].subId);
  1197. }
  1198. laboratorySubRelInfoConditionSubjectInfo(rightObj).then(response => {
  1199. this.subTotalRight = response.data.total;
  1200. this.subTableListRight = response.data.records;
  1201. });
  1202. },
  1203. //实验室穿梭按钮
  1204. subArrowButton(type){
  1205. if(type == 1){
  1206. if(this.$refs.rightSubTable.selection[0]){
  1207. let list = JSON.parse(JSON.stringify(this.dialogTableSubDataList));
  1208. let subIdsRight = JSON.parse(JSON.stringify(this.$refs.rightSubTable.selection))
  1209. for(let i=0;i<subIdsRight.length;i++){
  1210. for(let s=0;s<list.length;s++){
  1211. if(subIdsRight[i].subId == list[s].subId){
  1212. list.splice(s,1);
  1213. s--
  1214. }
  1215. }
  1216. }
  1217. this.$set(this,'dialogTableSubDataList',list);
  1218. this.$refs.rightSubTable.clearSelection();
  1219. this.subHandleQueryLeft();
  1220. this.subHandleQueryRight();
  1221. }else{
  1222. this.msgError('请先勾选右侧列表')
  1223. }
  1224. }else if(type == 2){
  1225. if(this.$refs.leftSubTable.selection[0]){
  1226. let list = JSON.parse(JSON.stringify(this.dialogTableSubDataList));
  1227. let subIdsLeft = JSON.parse(JSON.stringify(this.$refs.leftSubTable.selection))
  1228. for(let i=0;i<subIdsLeft.length;i++){
  1229. let obj = {
  1230. subId:subIdsLeft[i].subId,
  1231. subjectName:subIdsLeft[i].subName,
  1232. typeId:subIdsLeft[i].typeId,
  1233. levelId:subIdsLeft[i].levelId,
  1234. collegeName:subIdsLeft[i].deptName,
  1235. }
  1236. list.push(obj);
  1237. }
  1238. this.$set(this,'dialogTableSubDataList',list);
  1239. this.$refs.leftSubTable.clearSelection();
  1240. this.subHandleQueryLeft();
  1241. this.subHandleQueryRight();
  1242. }else{
  1243. this.msgError('请先勾选左侧列表')
  1244. }
  1245. }
  1246. },
  1247. /*===================================设备相关相关===================================*/
  1248. //获取危险源类型
  1249. dangerList(){
  1250. getDicts('classify_dictionaries_all').then(response => {
  1251. let list = response.data;
  1252. getDicts('level_dictionaries_all').then(response => {
  1253. list = list.concat(response.data)
  1254. this.$set(this,'dangerArr',list);
  1255. });
  1256. });
  1257. },
  1258. //查询
  1259. deviceHandleQueryLeft(){
  1260. this.$set(this.deviceQueryParamsLeft,'page',1);
  1261. this.$set(this,'deviceNumLeft',0);
  1262. this.$set(this,'deviceIdsLeft',[]);
  1263. this.$refs.leftDeviceTable.clearSelection();
  1264. this.deviceGetListLeft();
  1265. },
  1266. //重置
  1267. deviceResetQueryLeft(){
  1268. this.$set(this,'deviceQueryParamsLeft',{
  1269. page: 1,
  1270. pageSize: 20,
  1271. hazardTypeMode:"",
  1272. searchValue:"",
  1273. filtType:1
  1274. });
  1275. this.deviceHandleQueryLeft();
  1276. },
  1277. //查询接口
  1278. deviceGetListLeft(){
  1279. let self = this;
  1280. let leftObj = JSON.parse(JSON.stringify(this.deviceQueryParamsLeft));
  1281. leftObj.selectedHazardIds = [];
  1282. for(let i=0;i<self.deviceDialogTableDataList.length;i++){
  1283. leftObj.selectedHazardIds.push(self.deviceDialogTableDataList[i].hazardId);
  1284. }
  1285. laboratoryHazardQueryHazardList(leftObj).then(response => {
  1286. this.deviceTotalLeft = response.data.total;
  1287. this.deviceTableListLeft = response.data.records;
  1288. });
  1289. },
  1290. //查询
  1291. deviceHandleQueryRight(){
  1292. this.$set(this.deviceQueryParamsRight,'page',1);
  1293. this.$set(this,'deviceNumRight',0);
  1294. this.$set(this,'deviceIdsRight',[]);
  1295. this.$refs.rightDeviceTable.clearSelection();
  1296. this.deviceGetListRight();
  1297. },
  1298. //重置
  1299. deviceResetQueryRight(){
  1300. this.$set(this,'deviceQueryParamsRight',{
  1301. page: 1,
  1302. pageSize: 20,
  1303. hazardTypeMode:"",
  1304. searchValue:"",
  1305. filtType:2
  1306. });
  1307. this.deviceHandleQueryRight();
  1308. },
  1309. //查询所有的设备
  1310. deviceGetList(){
  1311. let obj={
  1312. page: 1,
  1313. pageSize: 200,
  1314. hazardTypeMode:"",
  1315. searchValue:"",
  1316. filtType:""
  1317. }
  1318. laboratoryHazardQueryHazardList(obj).then(response => {
  1319. this.deviceDialogList=response.data.records
  1320. });
  1321. },
  1322. //查询接口
  1323. deviceGetListRight(){
  1324. let self = this;
  1325. let rightObj = JSON.parse(JSON.stringify(this.deviceQueryParamsRight));
  1326. rightObj.hazardIds = [];
  1327. for(let i=0;i<self.deviceDialogTableDataList.length;i++){
  1328. rightObj.hazardIds.push(self.deviceDialogTableDataList[i].hazardId);
  1329. }
  1330. laboratoryHazardQueryHazardList(rightObj).then(response => {
  1331. this.deviceTotalRight = response.data.total;
  1332. this.deviceTableListRight = response.data.records;
  1333. });
  1334. },
  1335. //设备穿梭按钮
  1336. deviceArrowButton(type){
  1337. let self = this;
  1338. if(type == 1){
  1339. //右至左
  1340. if(this.$refs.rightDeviceTable.selection[0]){
  1341. let list = JSON.parse(JSON.stringify(this.deviceDialogTableDataList));
  1342. let deviceIdsRight = JSON.parse(JSON.stringify(this.$refs.rightDeviceTable.selection))
  1343. for(let i=0;i<deviceIdsRight.length;i++){
  1344. for(let s=0;s<list.length;s++){
  1345. if(deviceIdsRight[i].hazardId == list[s].hazardId){
  1346. list.splice(s,1);
  1347. s--
  1348. }
  1349. }
  1350. }
  1351. this.$set(this,'deviceDialogTableDataList',list);
  1352. this.$refs.rightDeviceTable.clearSelection();
  1353. this.deviceHandleQueryLeft();
  1354. this.deviceHandleQueryRight();
  1355. }else{
  1356. this.msgError('请先勾选右侧列表')
  1357. }
  1358. }else if(type == 2){
  1359. //左至右
  1360. if(this.deviceIdsLeft[0]){
  1361. let list = JSON.parse(JSON.stringify(this.deviceDialogTableDataList));
  1362. let deviceIdsLeft = JSON.parse(JSON.stringify(this.$refs.leftDeviceTable.selection))
  1363. for(let i=0;i<deviceIdsLeft.length;i++){
  1364. let obj = {
  1365. chName:deviceIdsLeft[i].chName,
  1366. code:deviceIdsLeft[i].hazardCode,
  1367. bigTypeValue:deviceIdsLeft[i].bigTypeValue,
  1368. hazardId:deviceIdsLeft[i].hazardId,
  1369. }
  1370. list.push(obj);
  1371. }
  1372. this.$set(this,'deviceDialogTableDataList',list);
  1373. this.$refs.leftDeviceTable.clearSelection();
  1374. this.deviceHandleQueryLeft();
  1375. this.deviceHandleQueryRight();
  1376. }else{
  1377. this.msgError('请先勾选左侧列表')
  1378. }
  1379. }
  1380. },
  1381. /*===================================弹窗相关结束===================================*/
  1382. // 单个下载按钮
  1383. downloadButton(item){
  1384. this.downloadUrl(item.fileUrl,item.fileName);
  1385. },
  1386. /*==========上传相关==========*/
  1387. handleAvatarSuccess(res) {
  1388. this.$set(this,'loading',false);
  1389. if(this.dialogForm.uploadDtoList.length>9){
  1390. this.msgError('已到达上传数量上限')
  1391. return
  1392. }
  1393. let suffixName= this.upDataName.split('.')[this.upDataName.split('.').length - 2]
  1394. //判断文件名中是否有逗号和分号
  1395. if(suffixName.indexOf(',')==-1 && suffixName.indexOf(';')==-1){
  1396. }else{
  1397. this.msgError('文件名里包含逗号或分号,请修改后重新上传!')
  1398. return
  1399. }
  1400. let obj ={
  1401. fileName:this.upDataName,
  1402. fileUrl:res.data.url,
  1403. fileType:1,
  1404. source:1,
  1405. };
  1406. this.dialogForm.uploadDtoList.push(obj);
  1407. this.$forceUpdate()
  1408. },
  1409. beforeAvatarUpload(file) {
  1410. let type = false;
  1411. let num = 0;
  1412. for(let i=0;i<file.name.length;i++){
  1413. if(file.name[i] == '.'){
  1414. num++
  1415. }
  1416. }
  1417. if(num != 1){
  1418. this.msgError('文件名称不能包含 " . "')
  1419. return false
  1420. }
  1421. if (file.type == 'application/pdf' || file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
  1422. if(file.size> 5250000){
  1423. this.msgError('上传大小不能超过5M')
  1424. return false
  1425. }
  1426. this.$set(this,'loading',true);
  1427. this.upDataName = file.name;
  1428. type = true;
  1429. }else{
  1430. this.msgError('只能上传docx/xlsx/pdf格式');
  1431. type = false;
  1432. }
  1433. return type;
  1434. },
  1435. /*===记录勾选数据===
  1436. 需要再el-table 添加 :row-key="getRowKeys"
  1437. 需要在selection 添加 :reserve-selection="true"
  1438. */
  1439. getRowKeys(row) {
  1440. return row.userId
  1441. },
  1442. getDeptRowKeys(row) {
  1443. return row.deptId
  1444. },
  1445. getSubRowKeys(row) {
  1446. return row.subId
  1447. },
  1448. getDeviceRowKeys(row) {
  1449. return row.hazardId
  1450. },
  1451. deptChange(selection){
  1452. let self = this;
  1453. this.deptNumLeft = selection.length;
  1454. this.deptIdsLeft = selection.map(item => item.deptId);
  1455. let num = 0;
  1456. let list = [];
  1457. for(let i=0;i<self.deptIdsLeft.length;i++){
  1458. for(let o=0;o<self.deptTableListLeft.length;o++){
  1459. if(self.deptIdsLeft[i] == self.deptTableListLeft[o].deptId){
  1460. num = self.accAdd(num,self.deptTableListLeft[o].subNum)
  1461. let obj = {
  1462. deptId:self.deptTableListLeft[o].deptId,
  1463. deptName:self.deptTableListLeft[o].deptName,
  1464. }
  1465. list.push(obj)
  1466. }
  1467. }
  1468. }
  1469. this.$set(this,'changeDeptSelectList',list);
  1470. this.$set(this.subQueryParamsRight,'deptId','');
  1471. let obj = {
  1472. deptIds:this.deptIdsLeft,
  1473. deptNum:this.deptNumLeft,
  1474. subNum:num
  1475. }
  1476. this.$set(this,'deptCheckData',JSON.parse(JSON.stringify(obj)));
  1477. this.deptResetQueryRight();
  1478. },
  1479. subChangeLeft(selection){
  1480. this.subNumLeft = selection.length;
  1481. this.subIdsLeft = selection.map(item => item.subId);
  1482. },
  1483. subChangeRight(selection){
  1484. this.subNumRight = selection.length;
  1485. this.subIdsRight = selection.map(item => item.subId);
  1486. },
  1487. deviceChangeLeft(selection){
  1488. this.deviceNumLeft = selection.length;
  1489. this.deviceIdsLeft = selection.map(item => item.hazardId);
  1490. },
  1491. deviceChangeRight(selection){
  1492. this.deviceNumRight = selection.length;
  1493. this.deviceIdsRight = selection.map(item => item.hazardId);
  1494. },
  1495. //加法
  1496. accAdd(arg1,arg2){
  1497. var r1,r2,m;
  1498. try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}
  1499. try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}
  1500. m=Math.pow(10,Math.max(r1,r2))
  1501. return ((arg1*m+arg2*m)/m).toFixed(0);
  1502. },
  1503. //获取历史标题
  1504. getHistoryPlanTitles(){
  1505. getHistoryPlanTitles().then(response => {
  1506. let list = [
  1507. {title:"校院春季开学检查",type:false,},
  1508. {title:"校院秋季开学检查",type:false,},
  1509. {title:"日常安全检查",type:false,},
  1510. {title:"年度安全检查",type:false,},
  1511. {title:"季度安全检查",type:false,},
  1512. {title:"月度安全检查",type:false,},
  1513. {title:"专项检查",type:false,},
  1514. ];
  1515. for(let i=0;i<response.data.length;i++){
  1516. list.push({title:response.data[i].title,type:true,id:response.data[i].id});
  1517. }
  1518. this.$set(this,'quickSelectionList',list);
  1519. });
  1520. },
  1521. //删除历史标题
  1522. delTitleObj(item){
  1523. let self = this;
  1524. this.$confirm('是否确认删除?', "警告", {
  1525. confirmButtonText: "确定",
  1526. cancelButtonText: "取消",
  1527. type: "warning"
  1528. }).then(function() {
  1529. hideHistoryPlanTitle({checkPlanId:item.id}).then(response => {
  1530. self.msgSuccess(response.message)
  1531. self.getHistoryPlanTitles();
  1532. });
  1533. }).then(() => {
  1534. }).catch(() => {});
  1535. },
  1536. //查看时学院左侧搜索
  1537. lookDeptLeftSearch(){
  1538. let self = this;
  1539. laboratorySubRelInfoConditionCollegeInfo(self.deptQueryParamsLeft).then(response => {
  1540. let list = [];
  1541. for(let i=0;i<response.data.length;i++){
  1542. for(let o=0;o<self.dialogForm.collegeIds.length;o++){
  1543. if(response.data[i].deptId == self.dialogForm.collegeIds[o] && response.data[i].deptName.indexOf(this.deptQueryParamsLeft.searchValue)!= -1){
  1544. list.push(response.data[i]);
  1545. }
  1546. }
  1547. }
  1548. self.$set(self,'deptTableListLeft',list);
  1549. self.$set(self,'deptTotalLeft',list.length);
  1550. self.$set(self,'changeDeptSelectList',list);
  1551. this.$set(this,'deptQueryParamsRight',{
  1552. page:1,
  1553. pageSize:20,
  1554. searchValue:"",
  1555. deptId:"",
  1556. levelId:"",
  1557. typeId:"",
  1558. });
  1559. let obj = JSON.parse(JSON.stringify(this.deptQueryParamsRight));
  1560. let ids = [];
  1561. for(let o=0;o<list.length;o++){
  1562. ids.push(list[o].deptId)
  1563. }
  1564. obj.deptIds = ids;
  1565. laboratorySubRelInfoGetRelListByCondition(obj).then(response => {
  1566. this.deptTotalRight = response.data.total;
  1567. this.deptTableListRight = response.data.records;
  1568. this.$set(this.deptCheckData,'subNum',response.data.total);
  1569. this.$set(this,'deptNumLeft',self.dialogForm.collegeIds.length);
  1570. });
  1571. })
  1572. },
  1573. //查看时学院左侧重置
  1574. lookDeptLeftReset(){
  1575. let self = this;
  1576. this.$set(this,'deptQueryParamsLeft',{ searchValue:"", });
  1577. laboratorySubRelInfoConditionCollegeInfo(self.deptQueryParamsLeft).then(response => {
  1578. //查看时
  1579. for(let i=0;i<response.data.length;i++){
  1580. let num = 0;
  1581. for(let o=0;o<self.dialogForm.collegeIds.length;o++){
  1582. if(response.data[i].deptId == self.dialogForm.collegeIds[o]){
  1583. num++
  1584. }
  1585. }
  1586. if(num == 0){
  1587. response.data.splice(i,1);
  1588. i--
  1589. }
  1590. }
  1591. self.$set(self,'deptTableListLeft',response.data);
  1592. self.$set(self,'deptTotalLeft',response.data.length);
  1593. self.$set(self,'changeDeptSelectList',response.data);
  1594. this.$set(this,'deptQueryParamsRight',{
  1595. page:1,
  1596. pageSize:20,
  1597. searchValue:"",
  1598. deptId:"",
  1599. levelId:"",
  1600. typeId:"",
  1601. });
  1602. let obj = JSON.parse(JSON.stringify(this.deptQueryParamsRight));
  1603. obj.deptIds = self.dialogForm.collegeIds;
  1604. laboratorySubRelInfoGetRelListByCondition(obj).then(response => {
  1605. this.deptTotalRight = response.data.total;
  1606. this.deptTableListRight = response.data.records;
  1607. this.$set(this.deptCheckData,'subNum',response.data.total);
  1608. this.$set(this,'deptNumLeft',self.dialogForm.collegeIds.length);
  1609. });
  1610. })
  1611. },
  1612. //查看时学院右侧搜索
  1613. lookDeptRightSearch(){
  1614. let self = this;
  1615. let obj = JSON.parse(JSON.stringify(this.deptQueryParamsRight));
  1616. let ids = [];
  1617. for(let o=0;o<self.deptTableListLeft.length;o++){
  1618. ids.push(self.deptTableListLeft[o].deptId)
  1619. }
  1620. obj.deptIds = ids;
  1621. laboratorySubRelInfoGetRelListByCondition(obj).then(response => {
  1622. this.deptTotalRight = response.data.total;
  1623. this.deptTableListRight = response.data.records;
  1624. });
  1625. },
  1626. //查看时学院右侧重置
  1627. lookDeptRightReset(){
  1628. let self = this;
  1629. this.$set(this,'deptQueryParamsRight',{
  1630. page:1,
  1631. pageSize:20,
  1632. searchValue:"",
  1633. deptId:"",
  1634. levelId:"",
  1635. typeId:"",
  1636. });
  1637. let obj = JSON.parse(JSON.stringify(this.deptQueryParamsRight));
  1638. let ids = [];
  1639. for(let o=0;o<self.deptTableListLeft.length;o++){
  1640. ids.push(self.deptTableListLeft[o].deptId)
  1641. }
  1642. obj.deptIds = ids;
  1643. laboratorySubRelInfoGetRelListByCondition(obj).then(response => {
  1644. this.deptTotalRight = response.data.total;
  1645. this.deptTableListRight = response.data.records;
  1646. });
  1647. },
  1648. }
  1649. }
  1650. </script>
  1651. <style lang="scss">
  1652. .inspectionPlan-dialog-box{
  1653. .el-dialog__body{
  1654. padding:20px 0 20px 30px;
  1655. }
  1656. .is-disabled{
  1657. background-color: #f5f5f5;
  1658. color: #333;
  1659. border-color: #f5f5f5;
  1660. cursor:auto;
  1661. border-radius: 4px;
  1662. .el-input__icon{
  1663. display: none;
  1664. }
  1665. .el-input__inner{
  1666. background-color: #f5f5f5;
  1667. color: #333;
  1668. border-color: #f5f5f5;
  1669. cursor:auto!important;
  1670. border-radius: 4px;
  1671. }
  1672. .el-range-input{
  1673. background-color: #f5f5f5;
  1674. color: #333;
  1675. border-color: #f5f5f5;
  1676. cursor:auto;
  1677. border-radius: 4px;
  1678. }
  1679. .el-textarea__inner{
  1680. background-color: #f5f5f5;
  1681. color: #333;
  1682. border-color: #f5f5f5;
  1683. cursor:auto;
  1684. border-radius: 4px;
  1685. }
  1686. }
  1687. .inspectionPlan-dialog-add-box{
  1688. display: flex;
  1689. overflow: hidden;
  1690. height:610px;
  1691. .el-table__empty-text{
  1692. background-size: 20%!important;
  1693. }
  1694. .left-max-box{
  1695. width:270px;
  1696. border-right:1px dashed #D8D8D8;
  1697. display: flex;
  1698. flex-direction: column;
  1699. .left-max-title-box{
  1700. width:230px;
  1701. display: flex;
  1702. border-bottom:1px solid #E0E0E0;
  1703. img{
  1704. width:14px;
  1705. height:11px;
  1706. margin:33px 18px 33px 0;
  1707. }
  1708. p{
  1709. line-height:78px;
  1710. color:#0183FA;
  1711. font-size:16px;
  1712. }
  1713. }
  1714. .left-max-list-box{
  1715. flex:1;
  1716. width:230px;
  1717. overflow-x: hidden;
  1718. div{
  1719. width:230px;
  1720. height:40px;
  1721. line-height:40px;
  1722. padding:0 10px;
  1723. margin-top: 10px;
  1724. cursor: pointer;
  1725. font-size:16px;
  1726. color:#333333;
  1727. overflow:hidden;
  1728. display: flex;
  1729. .left-max-list-for-p{
  1730. flex:1;
  1731. display:block;
  1732. overflow:hidden;
  1733. text-overflow:ellipsis;
  1734. white-space:nowrap;
  1735. }
  1736. .left-max-list-for-icon{
  1737. color:#999;
  1738. width:32px;
  1739. line-height: 40px;
  1740. text-align: center;
  1741. font-size:16px;
  1742. }
  1743. }
  1744. div:hover{
  1745. background: rgba(1,131,250,0.2);
  1746. color:#0183FA;
  1747. .left-max-list-for-icon{
  1748. color:#0183FA!important;
  1749. }
  1750. }
  1751. }
  1752. }
  1753. .right-max-box{
  1754. flex:1;
  1755. padding-right:10px;
  1756. .date-range-box{
  1757. display: flex;
  1758. .date-range-left-box{
  1759. margin-right:15px;
  1760. }
  1761. .date-range-right-box{
  1762. display: flex;
  1763. border-radius:4px;
  1764. overflow: hidden;
  1765. border:1px solid #E0E0E0;
  1766. p{
  1767. width: 70px;
  1768. height:34px;
  1769. line-height:34px;
  1770. color:#333;
  1771. font-size:14px;
  1772. text-align: center;
  1773. cursor: pointer;
  1774. }
  1775. p:hover{
  1776. color:#fff;
  1777. background: #0045AF;
  1778. }
  1779. p:nth-child(2){
  1780. border-left:1px solid #E0E0E0;
  1781. border-right:1px solid #E0E0E0;
  1782. }
  1783. }
  1784. }
  1785. .dialog-range-max-box{
  1786. display: flex;
  1787. .dialog-range-select-box{
  1788. }
  1789. .dialog-range-text-box{
  1790. display: flex;
  1791. .button-p{
  1792. margin-left:15px;
  1793. width:100px;
  1794. margin-right:0;
  1795. }
  1796. .text-p{
  1797. line-height:40px;
  1798. color:#0183FA;
  1799. font-size:14px;
  1800. margin-left:15px;
  1801. }
  1802. }
  1803. }
  1804. .dialog-material-max-box{
  1805. .dialog-material-button-box{
  1806. display: flex;
  1807. .dialog-material-text{
  1808. margin-left:20px;
  1809. color:#333333;
  1810. font-size:14px;
  1811. line-height:40px;
  1812. }
  1813. }
  1814. .dialog-material-list-box:nth-child(1){
  1815. margin-top:0;
  1816. }
  1817. .dialog-material-list-box{
  1818. margin-top:20px;
  1819. div{
  1820. height:40px;
  1821. width:550px;
  1822. display: flex;
  1823. img{
  1824. width:16px;
  1825. height:14px;
  1826. margin:11px 23px 13px 0;
  1827. }
  1828. p:nth-child(2){
  1829. flex:1;
  1830. display:block;
  1831. overflow:hidden;
  1832. text-overflow:ellipsis;
  1833. white-space:nowrap;
  1834. }
  1835. p:nth-child(3){
  1836. color:#0183FA;
  1837. font-size:14px;
  1838. cursor: pointer;
  1839. margin-left:40px;
  1840. }
  1841. p:nth-child(4){
  1842. color:#0183FA;
  1843. font-size:14px;
  1844. cursor: pointer;
  1845. margin-left:40px;
  1846. }
  1847. }
  1848. .dialog-material-list-null{
  1849. width:450px;
  1850. text-align: center;
  1851. color:#999;
  1852. font-size:14px;
  1853. }
  1854. }
  1855. }
  1856. .dialog-table-max-box{
  1857. width:747px;
  1858. height:357px;
  1859. display: flex;
  1860. flex-direction: column;
  1861. flex:1;
  1862. /*background: #A11DDF;*/
  1863. overflow: hidden;
  1864. .dialog-table-box{
  1865. margin-top:20px;
  1866. display: flex;
  1867. flex-direction: column;
  1868. flex:1;
  1869. overflow: hidden;
  1870. .dialog-table-title-box{
  1871. display: flex;
  1872. border:1px solid #e0e0e0;
  1873. border-bottom:none;
  1874. img{
  1875. width:14px;
  1876. height:14px;
  1877. margin:18px 12px 18px 12px;
  1878. }
  1879. .dialog-table-title-p{
  1880. line-height:50px;
  1881. flex:1;
  1882. font-size:16px;
  1883. }
  1884. .dialog-table-title-button{
  1885. width:70px;
  1886. height:30px;
  1887. line-height:28px;
  1888. margin:10px 26px;
  1889. }
  1890. }
  1891. }
  1892. }
  1893. }
  1894. }
  1895. .inspectionPlan-dialog-dept-box{
  1896. display: flex;
  1897. overflow: hidden;
  1898. height:610px;
  1899. margin-right:30px;
  1900. .el-table__empty-text{
  1901. background-size: 24%!important;
  1902. }
  1903. .dept-table-title-box{
  1904. display: flex;
  1905. padding:0 20px;
  1906. background: rgba(1,131,250,0.1);
  1907. p{
  1908. flex:1;
  1909. color:#0183FA;
  1910. font-size:16px;
  1911. line-height:40px;
  1912. }
  1913. p:nth-child(1){
  1914. text-align: left;
  1915. }
  1916. p:nth-child(2){
  1917. text-align: right;
  1918. }
  1919. }
  1920. .dept-table-max-box{
  1921. border: 1px solid #e0e0e0;
  1922. flex:1;
  1923. display: flex;
  1924. flex-direction: column;
  1925. overflow: hidden;
  1926. padding:20px;
  1927. .form-index{
  1928. .el-input__inner{
  1929. border-right:none;
  1930. padding-right:0;
  1931. }
  1932. .el-input-group__append{
  1933. background: #fff;
  1934. cursor: pointer;
  1935. padding:0 10px;
  1936. }
  1937. }
  1938. input{
  1939. border: 1px solid #DCDFE6;
  1940. }
  1941. }
  1942. .left-max-box{
  1943. height:610px;
  1944. display: flex;
  1945. flex-direction: column;
  1946. overflow: hidden;
  1947. width:475px;
  1948. margin-right:20px;
  1949. }
  1950. .right-max-box{
  1951. height:610px;
  1952. display: flex;
  1953. flex-direction: column;
  1954. overflow: hidden;
  1955. width:755px;
  1956. }
  1957. }
  1958. .inspectionPlan-dialog-sub-box{
  1959. display: flex;
  1960. overflow: hidden;
  1961. height:610px;
  1962. margin-right:30px;
  1963. .el-table__empty-text{
  1964. background-size: 30%!important;
  1965. }
  1966. .dept-table-title-box{
  1967. display: flex;
  1968. padding:0 20px;
  1969. background: rgba(1,131,250,0.1);
  1970. p{
  1971. flex:1;
  1972. color:#0183FA;
  1973. font-size:16px;
  1974. line-height:40px;
  1975. }
  1976. p:nth-child(1){
  1977. text-align: left;
  1978. }
  1979. p:nth-child(2){
  1980. text-align: right;
  1981. }
  1982. }
  1983. .dept-table-max-box{
  1984. border: 1px solid #e0e0e0;
  1985. flex:1;
  1986. display: flex;
  1987. flex-direction: column;
  1988. overflow: hidden;
  1989. padding:20px;
  1990. .form-index{
  1991. .el-input__inner{
  1992. border-right:none;
  1993. padding-right:0;
  1994. }
  1995. .el-input-group__append{
  1996. background: #fff;
  1997. cursor: pointer;
  1998. padding:0 10px;
  1999. }
  2000. }
  2001. input{
  2002. border: 1px solid #DCDFE6;
  2003. }
  2004. }
  2005. .left-max-box{
  2006. height:610px;
  2007. display: flex;
  2008. flex-direction: column;
  2009. overflow: hidden;
  2010. width:588px;
  2011. }
  2012. .right-max-box{
  2013. height:610px;
  2014. display: flex;
  2015. flex-direction: column;
  2016. overflow: hidden;
  2017. width:588px;
  2018. flex:1;
  2019. }
  2020. .center-box{
  2021. width:68px;
  2022. p{
  2023. display: block;
  2024. border-radius:50%;
  2025. width:30px;
  2026. height:30px;
  2027. line-height:30px;
  2028. text-align: center;
  2029. background: rgba(245,245,245,1);
  2030. color:rgba(62,62,62,1);
  2031. cursor: pointer;
  2032. font-size:16px;
  2033. }
  2034. p:nth-child(1){
  2035. margin:270px 19px 0;
  2036. }
  2037. p:nth-child(2){
  2038. margin:14px 19px 0;
  2039. }
  2040. p:hover{
  2041. color:#fff;
  2042. background: #0183fa;
  2043. }
  2044. }
  2045. }
  2046. .inspectionPlan-dialog-user-box{
  2047. display: flex;
  2048. overflow: hidden;
  2049. height:610px;
  2050. margin-right:30px;
  2051. .el-table__empty-text{
  2052. background-size: 30%!important;
  2053. }
  2054. .dept-table-title-box{
  2055. display: flex;
  2056. padding:0 20px;
  2057. background: rgba(1,131,250,0.1);
  2058. p{
  2059. flex:1;
  2060. color:#0183FA;
  2061. font-size:16px;
  2062. line-height:40px;
  2063. }
  2064. p:nth-child(1){
  2065. text-align: left;
  2066. }
  2067. p:nth-child(2){
  2068. text-align: right;
  2069. }
  2070. }
  2071. .dept-table-max-box{
  2072. border: 1px solid #e0e0e0;
  2073. flex:1;
  2074. display: flex;
  2075. flex-direction: column;
  2076. overflow: hidden;
  2077. padding:20px;
  2078. .form-index{
  2079. .el-input__inner{
  2080. border-right:none;
  2081. padding-right:0;
  2082. }
  2083. .el-input-group__append{
  2084. background: #fff;
  2085. cursor: pointer;
  2086. padding:0 10px;
  2087. }
  2088. }
  2089. input{
  2090. border: 1px solid #DCDFE6;
  2091. }
  2092. }
  2093. .left-max-box{
  2094. height:610px;
  2095. display: flex;
  2096. flex-direction: column;
  2097. overflow: hidden;
  2098. width:588px;
  2099. }
  2100. .right-max-box{
  2101. height:610px;
  2102. display: flex;
  2103. flex-direction: column;
  2104. overflow: hidden;
  2105. width:588px;
  2106. flex:1;
  2107. }
  2108. .center-box{
  2109. width:68px;
  2110. p{
  2111. display: block;
  2112. border-radius:50%;
  2113. width:30px;
  2114. height:30px;
  2115. line-height:30px;
  2116. text-align: center;
  2117. background: rgba(245,245,245,1);
  2118. color:rgba(62,62,62,1);
  2119. cursor: pointer;
  2120. font-size:16px;
  2121. }
  2122. p:nth-child(1){
  2123. margin:270px 19px 0;
  2124. }
  2125. p:nth-child(2){
  2126. margin:14px 19px 0;
  2127. }
  2128. p:hover{
  2129. color:#fff;
  2130. background: #0183fa;
  2131. }
  2132. }
  2133. }
  2134. .inspectionPlan-dialog-look-box{
  2135. display: flex;
  2136. overflow: hidden;
  2137. height:610px;
  2138. margin-right:30px;
  2139. .iframe-box{
  2140. flex:1;
  2141. }
  2142. }
  2143. }
  2144. </style>