departmentListPage.vue 12 KB

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