addDialog.vue 63 KB

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