departmentListPage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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. </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. },
  150. dateRange:[],
  151. tableList:[],
  152. total:0,
  153. }
  154. },
  155. created(){},
  156. mounted(){
  157. this.getList();
  158. },
  159. methods:{
  160. //开关详情页面
  161. addDialogOpen(type,data){
  162. if(this.infoDialogType != type){
  163. if(type){
  164. let obj = {
  165. id:data.id
  166. }
  167. this.$set(this,'propsInfoDialogData',obj);
  168. this.$set(this,'infoDialogType',type);
  169. }else{
  170. this.getList();
  171. this.$set(this,'infoDialogType',type);
  172. }
  173. }
  174. },
  175. //页面切换
  176. goPage(type){
  177. if(this.minPageType != type){
  178. if(type == 1){
  179. //返回
  180. this.$set(this,'minPageType',type);
  181. }else if(type == 2){
  182. //批量审核
  183. this.$set(this,'propsBatchAuditData',{hazardType:2,});
  184. this.$set(this,'minPageType',type);
  185. }else if(type == 3){
  186. //返回并刷新
  187. this.getList();
  188. this.$set(this,'minPageType',1);
  189. }
  190. }
  191. },
  192. //范围选择
  193. topLeftClickType(type){
  194. if(this.queryParams.rectifyStatus != type){
  195. this.$set(this.queryParams,'rectifyStatus',type);
  196. this.handleQuery();
  197. }
  198. },
  199. //时间排序方法
  200. sortChange(val){
  201. if(val.prop == 'checkTime'){
  202. this.$set(this.queryParams,'checkTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  203. this.$set(this.queryParams,'zgTimeOrder','');
  204. this.$set(this.queryParams,'zgTermOrder','');
  205. this.handleQuery();
  206. }else if(val.prop == 'rectifyTime'){
  207. this.$set(this.queryParams,'zgTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  208. this.$set(this.queryParams,'checkTimeOrder','');
  209. this.$set(this.queryParams,'zgTermOrder','');
  210. this.handleQuery();
  211. }else if(val.prop == 'rectifyDeadline'){
  212. this.$set(this.queryParams,'zgTermOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  213. this.$set(this.queryParams,'checkTimeOrder','');
  214. this.$set(this.queryParams,'zgTimeOrder','');
  215. this.handleQuery();
  216. }
  217. },
  218. //获取数据列表
  219. getList(){
  220. let obj = JSON.parse(JSON.stringify(this.queryParams))
  221. if(this.dateRange[0]){
  222. obj.beginTime = this.dateRange[0];
  223. }else{
  224. obj.beginTime = "";
  225. }
  226. if(this.dateRange[1]){
  227. obj.endTime = this.dateRange[1];
  228. }else{
  229. obj.endTime = "";
  230. }
  231. if(this.queryParams.rectifyStatus == 2){
  232. rectifyList(obj).then(response => {
  233. this.total = response.data.total;
  234. this.tableList = response.data.records;
  235. });
  236. } else if (this.queryParams.rectifyStatus == 3){
  237. recheckList(obj).then(response => {
  238. this.total = response.data.total;
  239. this.tableList = response.data.records;
  240. });
  241. } else if (this.queryParams.rectifyStatus == 1){
  242. overList(obj).then(response => {
  243. this.total = response.data.total;
  244. this.tableList = response.data.records;
  245. });
  246. }
  247. },
  248. /** 搜索按钮操作 */
  249. handleQuery() {
  250. this.$set(this.queryParams,'pageNum',1);
  251. this.getList();
  252. },
  253. /** 重置按钮操作 */
  254. resetQuery() {
  255. this.$set(this,'dateRange',[]);
  256. this.$set(this,'queryParams',{
  257. pageNum:1,
  258. pageSize:20,
  259. hazardType:2,
  260. rectifyStatus:"2",
  261. examineResult:"",
  262. searchValue:"",
  263. checkTimeOrder:"",
  264. zgTimeOrder:"",
  265. zgTermOrder:""
  266. });
  267. this.handleQuery();
  268. },
  269. },
  270. }
  271. </script>
  272. <style scoped lang="scss">
  273. .departmentListPage{
  274. flex: 1;
  275. display: flex !important;
  276. flex-direction: column;
  277. overflow: hidden;
  278. .departmentListPage-page{
  279. flex: 1;
  280. display: flex !important;
  281. flex-direction: column;
  282. overflow: hidden;
  283. .title-box{
  284. padding-top:20px;
  285. .form-button-max-big-box{
  286. display: inline-block;
  287. .form-button-big-box{
  288. display: flex;
  289. div{
  290. position: relative;
  291. height:40px;
  292. width:80px;
  293. line-height: 40px;
  294. text-align: center;
  295. color:#999;
  296. font-size:14px;
  297. border:1px solid #999;
  298. border-radius:4px;
  299. margin-left:10px;
  300. font-weight:500;
  301. cursor: pointer;
  302. .icon-p{
  303. width:15px;
  304. height:15px;
  305. line-height:15px;
  306. text-align: center;
  307. position: absolute;
  308. right:0;
  309. bottom:0;
  310. color:#fff;
  311. background: #0183fa;
  312. border-top-left-radius:4px;
  313. }
  314. }
  315. .checkDiv{
  316. color:#0183FA;
  317. border:1px solid #0183FA;
  318. }
  319. }
  320. }
  321. }
  322. .content-box{
  323. flex: 1;
  324. display: flex;
  325. flex-direction: column;
  326. padding:0 20px 20px;
  327. overflow: hidden;
  328. .rectifyStatusColorA{
  329. color:#23B303;
  330. }
  331. .rectifyStatusColorB{
  332. color:#0183FA;
  333. }
  334. .rectifyStatusColorC{
  335. color:#EE0606;
  336. }
  337. }
  338. }
  339. }
  340. </style>