addDialog.vue 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  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" v-if="dialogForm.checkRange == 2" @click="dialogClickType(2)">{{lookInfoType?'查看':'选择学院'}}</p>
  65. <p class="inquire-button-one button-p" 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="width:450px;">
  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. .left-max-box{
  1270. width:270px;
  1271. border-right:1px dashed #D8D8D8;
  1272. display: flex;
  1273. flex-direction: column;
  1274. .left-max-title-box{
  1275. width:230px;
  1276. display: flex;
  1277. border-bottom:1px solid #E0E0E0;
  1278. img{
  1279. width:14px;
  1280. height:11px;
  1281. margin:33px 18px 33px 0;
  1282. }
  1283. p{
  1284. line-height:78px;
  1285. color:#0183FA;
  1286. font-size:16px;
  1287. }
  1288. }
  1289. .left-max-list-box{
  1290. flex:1;
  1291. width:230px;
  1292. overflow-x: hidden;
  1293. div{
  1294. width:230px;
  1295. height:40px;
  1296. line-height:40px;
  1297. padding:0 10px;
  1298. margin-top: 10px;
  1299. cursor: pointer;
  1300. font-size:16px;
  1301. color:#333333;
  1302. overflow:hidden;
  1303. display: flex;
  1304. .left-max-list-for-p{
  1305. flex:1;
  1306. display:block;
  1307. overflow:hidden;
  1308. text-overflow:ellipsis;
  1309. white-space:nowrap;
  1310. }
  1311. .left-max-list-for-icon{
  1312. color:#999;
  1313. width:32px;
  1314. line-height: 40px;
  1315. text-align: center;
  1316. font-size:16px;
  1317. }
  1318. }
  1319. div:hover{
  1320. background: rgba(1,131,250,0.2);
  1321. color:#0183FA;
  1322. .left-max-list-for-icon{
  1323. color:#0183FA!important;
  1324. }
  1325. }
  1326. }
  1327. }
  1328. .right-max-box{
  1329. flex:1;
  1330. padding-right:10px;
  1331. .date-range-box{
  1332. display: flex;
  1333. .date-range-left-box{
  1334. margin-right:15px;
  1335. }
  1336. .date-range-right-box{
  1337. display: flex;
  1338. border-radius:4px;
  1339. overflow: hidden;
  1340. border:1px solid #E0E0E0;
  1341. p{
  1342. width: 70px;
  1343. height:34px;
  1344. line-height:34px;
  1345. color:#333;
  1346. font-size:14px;
  1347. text-align: center;
  1348. cursor: pointer;
  1349. }
  1350. p:hover{
  1351. color:#fff;
  1352. background: #0045AF;
  1353. }
  1354. p:nth-child(2){
  1355. border-left:1px solid #E0E0E0;
  1356. border-right:1px solid #E0E0E0;
  1357. }
  1358. }
  1359. }
  1360. .dialog-range-max-box{
  1361. display: flex;
  1362. .dialog-range-select-box{
  1363. }
  1364. .dialog-range-text-box{
  1365. display: flex;
  1366. .button-p{
  1367. margin-left:15px;
  1368. width:100px;
  1369. margin-right:0;
  1370. }
  1371. .text-p{
  1372. line-height:40px;
  1373. color:#0183FA;
  1374. font-size:14px;
  1375. margin-left:15px;
  1376. }
  1377. }
  1378. }
  1379. .dialog-material-max-box{
  1380. .dialog-material-button-box{
  1381. display: flex;
  1382. .dialog-material-text{
  1383. margin-left:20px;
  1384. color:#333333;
  1385. font-size:14px;
  1386. line-height:40px;
  1387. }
  1388. }
  1389. .dialog-material-list-box:nth-child(1){
  1390. margin-top:0;
  1391. }
  1392. .dialog-material-list-box{
  1393. margin-top:20px;
  1394. div{
  1395. height:40px;
  1396. width:550px;
  1397. display: flex;
  1398. img{
  1399. width:16px;
  1400. height:14px;
  1401. margin:11px 23px 13px 0;
  1402. }
  1403. p:nth-child(2){
  1404. flex:1;
  1405. display:block;
  1406. overflow:hidden;
  1407. text-overflow:ellipsis;
  1408. white-space:nowrap;
  1409. }
  1410. p:nth-child(3){
  1411. color:#0183FA;
  1412. font-size:14px;
  1413. cursor: pointer;
  1414. margin-left:40px;
  1415. }
  1416. p:nth-child(4){
  1417. color:#0183FA;
  1418. font-size:14px;
  1419. cursor: pointer;
  1420. margin-left:40px;
  1421. }
  1422. }
  1423. .dialog-material-list-null{
  1424. text-align: center;
  1425. color:#999;
  1426. font-size:14px;
  1427. }
  1428. }
  1429. }
  1430. .dialog-table-max-box{
  1431. width:747px;
  1432. height:357px;
  1433. display: flex;
  1434. flex-direction: column;
  1435. flex:1;
  1436. /*background: #A11DDF;*/
  1437. overflow: hidden;
  1438. .dialog-table-box{
  1439. margin-top:20px;
  1440. display: flex;
  1441. flex-direction: column;
  1442. flex:1;
  1443. overflow: hidden;
  1444. .dialog-table-title-box{
  1445. display: flex;
  1446. border:1px solid #e0e0e0;
  1447. border-bottom:none;
  1448. img{
  1449. width:14px;
  1450. height:14px;
  1451. margin:18px 12px 18px 12px;
  1452. }
  1453. .dialog-table-title-p{
  1454. line-height:50px;
  1455. flex:1;
  1456. font-size:16px;
  1457. }
  1458. .dialog-table-title-button{
  1459. width:70px;
  1460. height:30px;
  1461. line-height:28px;
  1462. margin:10px 26px;
  1463. }
  1464. }
  1465. }
  1466. }
  1467. }
  1468. }
  1469. .inspectionPlan-dialog-dept-box{
  1470. display: flex;
  1471. overflow: hidden;
  1472. height:610px;
  1473. margin-right:30px;
  1474. .dept-table-title-box{
  1475. display: flex;
  1476. padding:0 20px;
  1477. background: rgba(1,131,250,0.1);
  1478. p{
  1479. flex:1;
  1480. color:#0183FA;
  1481. font-size:16px;
  1482. line-height:40px;
  1483. }
  1484. p:nth-child(1){
  1485. text-align: left;
  1486. }
  1487. p:nth-child(2){
  1488. text-align: right;
  1489. }
  1490. }
  1491. .dept-table-max-box{
  1492. border: 1px solid #e0e0e0;
  1493. flex:1;
  1494. display: flex;
  1495. flex-direction: column;
  1496. overflow: hidden;
  1497. padding:20px;
  1498. .form-index{
  1499. .el-input__inner{
  1500. border-right:none;
  1501. padding-right:0;
  1502. }
  1503. .el-input-group__append{
  1504. background: #fff;
  1505. cursor: pointer;
  1506. padding:0 10px;
  1507. }
  1508. }
  1509. input{
  1510. border: 1px solid #DCDFE6;
  1511. }
  1512. }
  1513. .left-max-box{
  1514. height:610px;
  1515. display: flex;
  1516. flex-direction: column;
  1517. overflow: hidden;
  1518. width:475px;
  1519. margin-right:20px;
  1520. }
  1521. .right-max-box{
  1522. height:610px;
  1523. display: flex;
  1524. flex-direction: column;
  1525. overflow: hidden;
  1526. width:755px;
  1527. }
  1528. }
  1529. .inspectionPlan-dialog-sub-box{
  1530. display: flex;
  1531. overflow: hidden;
  1532. height:610px;
  1533. margin-right:30px;
  1534. .dept-table-title-box{
  1535. display: flex;
  1536. padding:0 20px;
  1537. background: rgba(1,131,250,0.1);
  1538. p{
  1539. flex:1;
  1540. color:#0183FA;
  1541. font-size:16px;
  1542. line-height:40px;
  1543. }
  1544. p:nth-child(1){
  1545. text-align: left;
  1546. }
  1547. p:nth-child(2){
  1548. text-align: right;
  1549. }
  1550. }
  1551. .dept-table-max-box{
  1552. border: 1px solid #e0e0e0;
  1553. flex:1;
  1554. display: flex;
  1555. flex-direction: column;
  1556. overflow: hidden;
  1557. padding:20px;
  1558. .form-index{
  1559. .el-input__inner{
  1560. border-right:none;
  1561. padding-right:0;
  1562. }
  1563. .el-input-group__append{
  1564. background: #fff;
  1565. cursor: pointer;
  1566. padding:0 10px;
  1567. }
  1568. }
  1569. input{
  1570. border: 1px solid #DCDFE6;
  1571. }
  1572. }
  1573. .left-max-box{
  1574. height:610px;
  1575. display: flex;
  1576. flex-direction: column;
  1577. overflow: hidden;
  1578. width:588px;
  1579. }
  1580. .right-max-box{
  1581. height:610px;
  1582. display: flex;
  1583. flex-direction: column;
  1584. overflow: hidden;
  1585. width:588px;
  1586. flex:1;
  1587. }
  1588. .center-box{
  1589. width:68px;
  1590. p{
  1591. display: block;
  1592. border-radius:50%;
  1593. width:30px;
  1594. height:30px;
  1595. line-height:30px;
  1596. text-align: center;
  1597. background: rgba(245,245,245,1);
  1598. color:rgba(62,62,62,1);
  1599. cursor: pointer;
  1600. font-size:16px;
  1601. }
  1602. p:nth-child(1){
  1603. margin:270px 19px 0;
  1604. }
  1605. p:nth-child(2){
  1606. margin:14px 19px 0;
  1607. }
  1608. p:hover{
  1609. color:#fff;
  1610. background: #0183fa;
  1611. }
  1612. }
  1613. }
  1614. .inspectionPlan-dialog-user-box{
  1615. display: flex;
  1616. overflow: hidden;
  1617. height:610px;
  1618. margin-right:30px;
  1619. .dept-table-title-box{
  1620. display: flex;
  1621. padding:0 20px;
  1622. background: rgba(1,131,250,0.1);
  1623. p{
  1624. flex:1;
  1625. color:#0183FA;
  1626. font-size:16px;
  1627. line-height:40px;
  1628. }
  1629. p:nth-child(1){
  1630. text-align: left;
  1631. }
  1632. p:nth-child(2){
  1633. text-align: right;
  1634. }
  1635. }
  1636. .dept-table-max-box{
  1637. border: 1px solid #e0e0e0;
  1638. flex:1;
  1639. display: flex;
  1640. flex-direction: column;
  1641. overflow: hidden;
  1642. padding:20px;
  1643. .form-index{
  1644. .el-input__inner{
  1645. border-right:none;
  1646. padding-right:0;
  1647. }
  1648. .el-input-group__append{
  1649. background: #fff;
  1650. cursor: pointer;
  1651. padding:0 10px;
  1652. }
  1653. }
  1654. input{
  1655. border: 1px solid #DCDFE6;
  1656. }
  1657. }
  1658. .left-max-box{
  1659. height:610px;
  1660. display: flex;
  1661. flex-direction: column;
  1662. overflow: hidden;
  1663. width:588px;
  1664. }
  1665. .right-max-box{
  1666. height:610px;
  1667. display: flex;
  1668. flex-direction: column;
  1669. overflow: hidden;
  1670. width:588px;
  1671. flex:1;
  1672. }
  1673. .center-box{
  1674. width:68px;
  1675. p{
  1676. display: block;
  1677. border-radius:50%;
  1678. width:30px;
  1679. height:30px;
  1680. line-height:30px;
  1681. text-align: center;
  1682. background: rgba(245,245,245,1);
  1683. color:rgba(62,62,62,1);
  1684. cursor: pointer;
  1685. font-size:16px;
  1686. }
  1687. p:nth-child(1){
  1688. margin:270px 19px 0;
  1689. }
  1690. p:nth-child(2){
  1691. margin:14px 19px 0;
  1692. }
  1693. p:hover{
  1694. color:#fff;
  1695. background: #0183fa;
  1696. }
  1697. }
  1698. }
  1699. .inspectionPlan-dialog-look-box{
  1700. display: flex;
  1701. overflow: hidden;
  1702. height:610px;
  1703. margin-right:30px;
  1704. .iframe-box{
  1705. flex:1;
  1706. }
  1707. }
  1708. }
  1709. </style>