schoolListPage.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <!--校院巡查隐患-->
  2. <template>
  3. <div class="schoolListPage">
  4. <div class="schoolListPage-page" v-if="minPageType == 1">
  5. <div class="title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true" label-width="80px">
  7. <div class="form-button-max-big-box">
  8. <div class="form-button-big-box" style="margin-left:10px;">
  9. <p class="text-p" :class="queryParams.rectifyStatus=='2'?'checkDiv':''" @click="topLeftClickType('2')">待整改</p>
  10. <p class="text-p" :class="queryParams.rectifyStatus=='3'?'checkDiv':''" @click="topLeftClickType('3')">待复核</p>
  11. <p class="text-p" :class="queryParams.rectifyStatus=='1'?'checkDiv':''" @click="topLeftClickType('1')">已完成</p>
  12. </div>
  13. </div>
  14. <!--与我相关-->
  15. <div class="form-button-max-big-box-me">
  16. <div class="form-button-big-box-me">
  17. <div :class="queryParams.myRelated==1?'checkDiv-me':''" @click="topRightClickType">
  18. <p class="text-p-me">与我有关{{correlationNum}}</p>
  19. <p class="el-icon-check icon-p-me" v-if="queryParams.myRelated==1"></p>
  20. </div>
  21. </div>
  22. </div>
  23. <el-form-item label="关键字" prop="searchValue">
  24. <el-input
  25. maxLength="30"
  26. v-model="queryParams.searchValue"
  27. placeholder="计划标题/实验室/房间号"
  28. clearable
  29. style="width: 200px"
  30. />
  31. </el-form-item>
  32. <el-form-item label="整改时间" prop="dateRange" style="margin-left:10px;" label-width="70px">
  33. <el-date-picker
  34. :clearable="false"
  35. v-model="dateRange"
  36. size="small"
  37. style="width: 240px"
  38. value-format="yyyy-MM-dd"
  39. type="daterange"
  40. range-separator="-"
  41. start-placeholder="开始日期"
  42. end-placeholder="结束日期"
  43. ></el-date-picker>
  44. </el-form-item>
  45. <el-form-item label="审核状态" prop="examineResult">
  46. <el-select v-model="queryParams.examineResult" placeholder="请选择" style="width: 160px">
  47. <el-option
  48. v-for="item in options"
  49. :key="item.value"
  50. :label="item.label"
  51. :value="item.value">
  52. </el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item>
  56. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  57. <p class="reset-button-one" @click="resetQuery">重置</p>
  58. </el-form-item>
  59. <el-form-item style="float: right;" v-hasPermi="['safety:rectifyHazard:approve']">
  60. <el-col :span="1.5">
  61. <p class="inquire-button-one"
  62. style="width:90px;"
  63. @click="goPage(2)"
  64. >批量审核</p>
  65. </el-col>
  66. </el-form-item>
  67. </el-form>
  68. </div>
  69. <div class="content-box">
  70. <el-table border :data="tableList" ref="multipleTable" @sort-change="sortChange">
  71. <el-table-column label="序号" align="center" type="index" width="60" />
  72. <el-table-column label="计划标题" align="center" prop="title" show-overflow-tooltip/>
  73. <el-table-column label="隐患描述" align="center" prop="hazardDescribe" show-overflow-tooltip width="220"/>
  74. <el-table-column label="实验室" align="center" prop="subRoom" show-overflow-tooltip width="170"/>
  75. <el-table-column label="检查类型" align="center" prop="checkRange" show-overflow-tooltip width="120">
  76. <template slot-scope="scope">
  77. <p>{{scope.row.checkCategory==1?'综合检查':(scope.row.checkCategory==2?'专项检查':'-')}}</p>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="检查内容" align="center" prop="checkRange" show-overflow-tooltip width="120">
  81. <template slot-scope="scope">
  82. <p>{{scope.row.hazardName?scope.row.hazardName:'-'}}</p>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="检查时间" sortable="custom" align="center" prop="checkTime" show-overflow-tooltip width="160"/>
  86. <el-table-column label="整改人" align="center" prop="rectifyName" show-overflow-tooltip width="90"/>
  87. <el-table-column label="整改期限" sortable="custom" align="center" prop="rectifyDeadline" show-overflow-tooltip width="180">
  88. <template slot-scope="scope">
  89. <p>{{scope.row.rectifyDeadline}}<span v-if="scope.row.overdueStatus==1" style="margin-left:10px;color:#EE0606;">已逾期</span></p>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="整改状态" align="center" prop="rectifyStatus" show-overflow-tooltip width="110">
  93. <template slot-scope="scope">
  94. <p :class="scope.row.rectifyStatus==1?'rectifyStatusColorA':(scope.row.rectifyStatus==2||scope.row.rectifyStatus==3?'rectifyStatusColorB':'')">{{scope.row.rectifyStatus==1?'已完成':(scope.row.rectifyStatus==2?'待整改':(scope.row.rectifyStatus==3?'待复核':''))}}</p>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="整改时间" sortable="custom" align="center" prop="rectifyTime" show-overflow-tooltip width="170"/>
  98. <el-table-column label="审核状态" align="center" prop="examineResult" show-overflow-tooltip width="80">
  99. <template slot-scope="scope">
  100. {{scope.row.examineResult == 1?'已通过':(scope.row.examineResult == 0?'已驳回':(scope.row.examineResult == 2?'待审核':''))}}
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="操作" align="center" width="80">
  104. <template slot-scope="scope">
  105. <div class="table-button-box">
  106. <p class="table-button-null"></p>
  107. <p class="table-button-p" v-hasPermi="['safety:rectifyHazard:query']"
  108. @click="addDialogOpen(true,scope.row)">详情</p>
  109. <p class="table-button-null"></p>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <pagination :page-sizes="[20, 30, 40, 50]"
  115. v-show="total>0"
  116. :total="total"
  117. :page.sync="queryParams.pageNum"
  118. :limit.sync="queryParams.pageSize"
  119. @pagination="getList"
  120. />
  121. </div>
  122. </div>
  123. <batchAudit v-if="minPageType == 2" :propsBatchAuditData="propsBatchAuditData"></batchAudit>
  124. <infoDialog v-if="infoDialogType" :propsInfoDialogData="propsInfoDialogData"></infoDialog>
  125. </div>
  126. </template>
  127. <script>
  128. import { rectifyList, recheckList, overList } from '@/api/safetyCheck/index'
  129. import batchAudit from './batchAudit.vue'
  130. import infoDialog from '@/views/safetyCheck/components/infoDialog/infoDialog.vue'
  131. export default {
  132. name: 'schoolListPage',
  133. components: {
  134. batchAudit,
  135. infoDialog
  136. },
  137. data(){
  138. return{
  139. //子组件参数
  140. propsBatchAuditData:{},
  141. propsInfoDialogData:{},
  142. minPageType:1,
  143. infoDialogType:false,
  144. options:[
  145. {value:"2",label:"待审核"},
  146. {value:"1",label:"已通过"},
  147. {value:"0",label:"已驳回"},
  148. ],
  149. queryParams:{
  150. pageNum:1,
  151. pageSize:20,
  152. hazardType:1,
  153. rectifyStatus:"2",
  154. examineResult:"",
  155. searchValue:"",
  156. checkTimeOrder:"",
  157. zgTimeOrder:"",
  158. zgTermOrder:"",
  159. myRelated:1,
  160. },
  161. dateRange:[],
  162. tableList:[],
  163. total:0,
  164. correlationNum:'',
  165. }
  166. },
  167. created(){},
  168. mounted(){
  169. this.getList();
  170. },
  171. methods:{
  172. //获取相关数量
  173. getCorrelationNum(){
  174. rectifyList({
  175. pageNum:1,
  176. pageSize:20,
  177. hazardType:1,
  178. checkTimeOrder:"",
  179. zgTimeOrder:"",
  180. zgTermOrder:"",
  181. myRelated:1,
  182. rectifyStatus:this.queryParams.rectifyStatus,
  183. examineResult:this.queryParams.examineResult,
  184. searchValue:this.queryParams.searchValue,
  185. beginTime:this.dateRange[0]?this.dateRange[0]:'',
  186. endTime:this.dateRange[1]?this.dateRange[1]:'',
  187. }).then(response => {
  188. this.$set(this,'correlationNum',response.data.total>999?' 999+':(response.data.total<1?'':' '+response.data.total));
  189. });
  190. },
  191. //与我相关按钮
  192. topRightClickType(){
  193. this.$set(this.queryParams,'myRelated',this.queryParams.myRelated==1?0:1);
  194. this.handleQuery();
  195. },
  196. //开关详情页面
  197. addDialogOpen(type,data){
  198. if(this.infoDialogType != type){
  199. if(type){
  200. let obj = {
  201. id:data.id
  202. }
  203. this.$set(this,'propsInfoDialogData',obj);
  204. this.$set(this,'infoDialogType',type);
  205. }else{
  206. this.getList();
  207. this.$set(this,'infoDialogType',type);
  208. }
  209. }
  210. },
  211. //页面切换
  212. goPage(type){
  213. if(this.minPageType != type){
  214. if(type == 1){
  215. //返回
  216. this.$set(this,'minPageType',type);
  217. }else if(type == 2){
  218. //批量审核
  219. this.$set(this,'propsBatchAuditData',{hazardType:1,});
  220. this.$set(this,'minPageType',type);
  221. }else if(type == 3){
  222. //返回并刷新
  223. this.getList();
  224. this.$set(this,'minPageType',1);
  225. }
  226. }
  227. },
  228. //范围选择
  229. topLeftClickType(type){
  230. if(this.queryParams.rectifyStatus != type){
  231. this.$set(this.queryParams,'rectifyStatus',type);
  232. this.handleQuery();
  233. }
  234. },
  235. //时间排序方法
  236. sortChange(val){
  237. if(val.prop == 'checkTime'){
  238. this.$set(this.queryParams,'checkTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  239. this.$set(this.queryParams,'zgTimeOrder','');
  240. this.$set(this.queryParams,'zgTermOrder','');
  241. this.handleQuery();
  242. }else if(val.prop == 'rectifyTime'){
  243. this.$set(this.queryParams,'zgTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  244. this.$set(this.queryParams,'checkTimeOrder','');
  245. this.$set(this.queryParams,'zgTermOrder','');
  246. this.handleQuery();
  247. }else if(val.prop == 'rectifyDeadline'){
  248. this.$set(this.queryParams,'zgTermOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  249. this.$set(this.queryParams,'checkTimeOrder','');
  250. this.$set(this.queryParams,'zgTimeOrder','');
  251. this.handleQuery();
  252. }
  253. },
  254. //获取数据列表
  255. getList(){
  256. let obj = JSON.parse(JSON.stringify(this.queryParams))
  257. if(this.dateRange[0]){
  258. obj.beginTime = this.dateRange[0];
  259. }else{
  260. obj.beginTime = "";
  261. }
  262. if(this.dateRange[1]){
  263. obj.endTime = this.dateRange[1];
  264. }else{
  265. obj.endTime = "";
  266. }
  267. let self = this;
  268. setTimeout(function(){
  269. self.getCorrelationNum();
  270. },500);
  271. if(this.queryParams.rectifyStatus == 2){
  272. rectifyList(obj).then(response => {
  273. this.total = response.data.total;
  274. this.tableList = response.data.records;
  275. });
  276. } else if (this.queryParams.rectifyStatus == 3){
  277. recheckList(obj).then(response => {
  278. this.total = response.data.total;
  279. this.tableList = response.data.records;
  280. });
  281. } else if (this.queryParams.rectifyStatus == 1){
  282. overList(obj).then(response => {
  283. this.total = response.data.total;
  284. this.tableList = response.data.records;
  285. });
  286. }
  287. },
  288. /** 搜索按钮操作 */
  289. handleQuery() {
  290. this.$set(this.queryParams,'pageNum',1);
  291. this.getList();
  292. },
  293. /** 重置按钮操作 */
  294. resetQuery() {
  295. this.$set(this,'dateRange',[]);
  296. this.$set(this,'queryParams',{
  297. pageNum:1,
  298. pageSize:20,
  299. hazardType:1,
  300. rectifyStatus:"2",
  301. examineResult:"",
  302. searchValue:"",
  303. checkTimeOrder:"",
  304. zgTimeOrder:"",
  305. zgTermOrder:"",
  306. myRelated:1,
  307. });
  308. this.handleQuery();
  309. },
  310. },
  311. }
  312. </script>
  313. <style scoped lang="scss">
  314. .schoolListPage{
  315. flex: 1;
  316. display: flex !important;
  317. flex-direction: column;
  318. overflow: hidden;
  319. .schoolListPage-page{
  320. flex: 1;
  321. display: flex !important;
  322. flex-direction: column;
  323. overflow: hidden;
  324. .title-box{
  325. padding-top:20px;
  326. .form-button-max-big-box{
  327. display: inline-block;
  328. margin-left:10px;
  329. .form-button-big-box{
  330. display: flex;
  331. p:nth-child(1){
  332. border-top-left-radius: 4px;
  333. border-bottom-left-radius: 4px;
  334. border-top:1px solid #E0E0E0;
  335. border-bottom:1px solid #E0E0E0;
  336. }
  337. p:nth-child(2){
  338. border-top:1px solid #E0E0E0;
  339. border-bottom:1px solid #E0E0E0;
  340. }
  341. p:nth-child(3){
  342. border-top-right-radius: 4px;
  343. border-bottom-right-radius: 4px;
  344. border-top:1px solid #E0E0E0;
  345. border-bottom:1px solid #E0E0E0;
  346. border-right:1px solid #E0E0E0;
  347. }
  348. p{
  349. height:40px;
  350. width:80px;
  351. line-height: 40px;
  352. text-align: center;
  353. color:#666666;
  354. font-size:14px;
  355. font-weight:500;
  356. cursor: pointer;
  357. border-left:1px solid #E0E0E0;
  358. }
  359. .checkDiv{
  360. color:#fff!important;
  361. border:1px solid #0183FA!important;
  362. background-color: #0183FA;
  363. }
  364. }
  365. }
  366. .form-button-max-big-box-me{
  367. display: inline-block;
  368. .form-button-big-box-me{
  369. display: flex;
  370. div{
  371. position: relative;
  372. height:40px;
  373. width:130px;
  374. line-height: 40px;
  375. text-align: center;
  376. color:#999;
  377. font-size:14px;
  378. border:1px solid #999;
  379. border-radius:4px;
  380. margin-left:10px;
  381. font-weight:500;
  382. cursor: pointer;
  383. .icon-p-me{
  384. width:15px;
  385. height:15px;
  386. line-height:15px;
  387. text-align: center;
  388. position: absolute;
  389. right:0;
  390. bottom:0;
  391. color:#fff;
  392. background: #0183fa;
  393. border-top-left-radius:4px;
  394. }
  395. }
  396. .checkDiv-me{
  397. color:#0183FA!important;
  398. border:1px solid #0183FA!important;
  399. }
  400. }
  401. }
  402. }
  403. .content-box{
  404. flex: 1;
  405. display: flex;
  406. flex-direction: column;
  407. padding:0 20px 20px;
  408. overflow: hidden;
  409. .rectifyStatusColorA{
  410. color:#23B303;
  411. }
  412. .rectifyStatusColorB{
  413. color:#0183FA;
  414. }
  415. .rectifyStatusColorC{
  416. color:#EE0606;
  417. }
  418. }
  419. }
  420. }
  421. </style>