departmentListPage.vue 15 KB

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