departmentListPage.vue 15 KB

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