addDialog.vue 63 KB

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