addDialog.vue 63 KB

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