departmentListPage.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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. rectifyStatus:"2",
  178. examineResult:"",
  179. searchValue:"",
  180. checkTimeOrder:"",
  181. zgTimeOrder:"",
  182. zgTermOrder:"",
  183. myRelated:1,
  184. }).then(response => {
  185. this.$set(this,'correlationNum',response.data.total>999?' 999+':(response.data.total<1?'':' '+response.data.total));
  186. });
  187. },
  188. //与我相关按钮
  189. topRightClickType(){
  190. this.$set(this.queryParams,'myRelated',this.queryParams.myRelated==1?0:1);
  191. this.handleQuery();
  192. },
  193. //开关详情页面
  194. addDialogOpen(type,data){
  195. if(this.infoDialogType != type){
  196. if(type){
  197. let obj = {
  198. id:data.id
  199. }
  200. this.$set(this,'propsInfoDialogData',obj);
  201. this.$set(this,'infoDialogType',type);
  202. }else{
  203. this.getList();
  204. this.$set(this,'infoDialogType',type);
  205. }
  206. }
  207. },
  208. //页面切换
  209. goPage(type){
  210. if(this.minPageType != type){
  211. if(type == 1){
  212. //返回
  213. this.$set(this,'minPageType',type);
  214. }else if(type == 2){
  215. //批量审核
  216. this.$set(this,'propsBatchAuditData',{hazardType:2,});
  217. this.$set(this,'minPageType',type);
  218. }else if(type == 3){
  219. //返回并刷新
  220. this.getList();
  221. this.$set(this,'minPageType',1);
  222. }
  223. }
  224. },
  225. //范围选择
  226. topLeftClickType(type){
  227. if(this.queryParams.rectifyStatus != type){
  228. this.$set(this.queryParams,'rectifyStatus',type);
  229. this.handleQuery();
  230. }
  231. },
  232. //时间排序方法
  233. sortChange(val){
  234. if(val.prop == 'checkTime'){
  235. this.$set(this.queryParams,'checkTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  236. this.$set(this.queryParams,'zgTimeOrder','');
  237. this.$set(this.queryParams,'zgTermOrder','');
  238. this.handleQuery();
  239. }else if(val.prop == 'rectifyTime'){
  240. this.$set(this.queryParams,'zgTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  241. this.$set(this.queryParams,'checkTimeOrder','');
  242. this.$set(this.queryParams,'zgTermOrder','');
  243. this.handleQuery();
  244. }else if(val.prop == 'rectifyDeadline'){
  245. this.$set(this.queryParams,'zgTermOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  246. this.$set(this.queryParams,'checkTimeOrder','');
  247. this.$set(this.queryParams,'zgTimeOrder','');
  248. this.handleQuery();
  249. }
  250. },
  251. //获取数据列表
  252. getList(){
  253. let obj = JSON.parse(JSON.stringify(this.queryParams))
  254. if(this.dateRange[0]){
  255. obj.beginTime = this.dateRange[0];
  256. }else{
  257. obj.beginTime = "";
  258. }
  259. if(this.dateRange[1]){
  260. obj.endTime = this.dateRange[1];
  261. }else{
  262. obj.endTime = "";
  263. }
  264. this.getCorrelationNum();
  265. if(this.queryParams.rectifyStatus == 2){
  266. rectifyList(obj).then(response => {
  267. this.total = response.data.total;
  268. this.tableList = response.data.records;
  269. });
  270. } else if (this.queryParams.rectifyStatus == 3){
  271. recheckList(obj).then(response => {
  272. this.total = response.data.total;
  273. this.tableList = response.data.records;
  274. });
  275. } else if (this.queryParams.rectifyStatus == 1){
  276. overList(obj).then(response => {
  277. this.total = response.data.total;
  278. this.tableList = response.data.records;
  279. });
  280. }
  281. },
  282. /** 搜索按钮操作 */
  283. handleQuery() {
  284. this.$set(this.queryParams,'pageNum',1);
  285. this.getList();
  286. },
  287. /** 重置按钮操作 */
  288. resetQuery() {
  289. this.$set(this,'dateRange',[]);
  290. this.$set(this,'queryParams',{
  291. pageNum:1,
  292. pageSize:20,
  293. hazardType:2,
  294. rectifyStatus:"2",
  295. examineResult:"",
  296. searchValue:"",
  297. checkTimeOrder:"",
  298. zgTimeOrder:"",
  299. zgTermOrder:"",
  300. myRelated:1,
  301. });
  302. this.handleQuery();
  303. },
  304. },
  305. }
  306. </script>
  307. <style scoped lang="scss">
  308. .departmentListPage{
  309. flex: 1;
  310. display: flex !important;
  311. flex-direction: column;
  312. overflow: hidden;
  313. .departmentListPage-page{
  314. flex: 1;
  315. display: flex !important;
  316. flex-direction: column;
  317. overflow: hidden;
  318. .title-box{
  319. padding-top:20px;
  320. .form-button-max-big-box{
  321. display: inline-block;
  322. .form-button-big-box{
  323. display: flex;
  324. div{
  325. position: relative;
  326. height:40px;
  327. width:80px;
  328. line-height: 40px;
  329. text-align: center;
  330. color:#999;
  331. font-size:14px;
  332. border:1px solid #999;
  333. border-radius:4px;
  334. margin-left:10px;
  335. font-weight:500;
  336. cursor: pointer;
  337. .icon-p{
  338. width:15px;
  339. height:15px;
  340. line-height:15px;
  341. text-align: center;
  342. position: absolute;
  343. right:0;
  344. bottom:0;
  345. color:#fff;
  346. background: #0183fa;
  347. border-top-left-radius:4px;
  348. }
  349. }
  350. .checkDiv{
  351. color:#0183FA;
  352. border:1px solid #0183FA;
  353. }
  354. }
  355. }
  356. .form-button-max-big-box-me{
  357. display: inline-block;
  358. .form-button-big-box-me{
  359. display: flex;
  360. div{
  361. position: relative;
  362. height:40px;
  363. width:130px;
  364. line-height: 40px;
  365. text-align: center;
  366. color:#999;
  367. font-size:14px;
  368. border:1px solid #999;
  369. border-radius:4px;
  370. margin-left:10px;
  371. font-weight:500;
  372. cursor: pointer;
  373. .icon-p-me{
  374. width:15px;
  375. height:15px;
  376. line-height:15px;
  377. text-align: center;
  378. position: absolute;
  379. right:0;
  380. bottom:0;
  381. color:#fff;
  382. background: #0183fa;
  383. border-top-left-radius:4px;
  384. }
  385. }
  386. .checkDiv-me{
  387. color:#0183FA!important;
  388. border:1px solid #0183FA!important;
  389. }
  390. }
  391. }
  392. }
  393. .content-box{
  394. flex: 1;
  395. display: flex;
  396. flex-direction: column;
  397. padding:0 20px 20px;
  398. overflow: hidden;
  399. .rectifyStatusColorA{
  400. color:#23B303;
  401. }
  402. .rectifyStatusColorB{
  403. color:#0183FA;
  404. }
  405. .rectifyStatusColorC{
  406. color:#EE0606;
  407. }
  408. }
  409. }
  410. }
  411. </style>