listPage.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <div class="snapshotManagement-listPage">
  3. <div class="snapshotManagement-listPage-min" v-if="infoPageType == 1">
  4. <div class="title-box">
  5. <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true" label-width="80px">
  6. <div class="form-button-max-big-box">
  7. <div class="form-button-big-box" style="margin-left:10px;">
  8. <div :class="queryParams.rectifyStatus===''?'checkDiv':''" @click="topLeftClickType('')">
  9. <p class="text-p">全部</p>
  10. <p class="el-icon-check icon-p" v-if="queryParams.rectifyStatus===''"></p>
  11. </div>
  12. <div :class="queryParams.rectifyStatus===0?'checkDiv':''" @click="topLeftClickType(0)">
  13. <p class="text-p">待整改</p>
  14. <p class="el-icon-check icon-p" v-if="queryParams.rectifyStatus===0"></p>
  15. </div>
  16. <div :class="queryParams.rectifyStatus===1?'checkDiv':''" @click="topLeftClickType(1)">
  17. <p class="text-p">已整改</p>
  18. <p class="el-icon-check icon-p" v-if="queryParams.rectifyStatus===1"></p>
  19. </div>
  20. <div :class="queryParams.rectifyStatus===2?'checkDiv':''" @click="topLeftClickType(2)">
  21. <p class="text-p">暂无法整改</p>
  22. <p class="el-icon-check icon-p" v-if="queryParams.rectifyStatus===2"></p>
  23. </div>
  24. </div>
  25. </div>
  26. <el-form-item label="关键字" prop="searchValue">
  27. <el-input
  28. maxLength="30"
  29. v-model="queryParams.searchValue"
  30. placeholder="实验室/房间号/上报人"
  31. clearable
  32. style="width: 180px"
  33. />
  34. </el-form-item>
  35. <el-form-item label="学院" prop="deptId" label-width="50px">
  36. <el-select v-model="queryParams.deptId" clearable placeholder="学院" style="width: 150px">
  37. <el-option
  38. v-for="item in deptSelectList"
  39. :key="item.deptId"
  40. :label="item.deptName"
  41. :value="item.deptId">
  42. </el-option>
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item label="上报时间" prop="dateRange" style="margin-left:10px;" label-width="70px">
  46. <el-date-picker
  47. :clearable="false"
  48. v-model="dateRange"
  49. size="small"
  50. style="width: 220px"
  51. value-format="yyyy-MM-dd"
  52. type="daterange"
  53. range-separator="-"
  54. start-placeholder="开始日期"
  55. end-placeholder="结束日期"
  56. ></el-date-picker>
  57. </el-form-item>
  58. <el-form-item>
  59. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  60. <p class="reset-button-one" @click="resetQuery">重置</p>
  61. </el-form-item>
  62. <el-form-item style="float: right;">
  63. <el-col :span="1.5">
  64. <p class="add-button-one-90"
  65. style="width:100px;font-weight:500;"
  66. @click="outButton"
  67. >返回</p>
  68. </el-col>
  69. </el-form-item>
  70. </el-form>
  71. </div>
  72. <div class="content-box">
  73. <el-table border :data="tableList" ref="multipleTable" @sort-change="sortChange">
  74. <el-table-column label="序号" align="center" type="index" width="60" />
  75. <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip/>
  76. <el-table-column label="实验室" align="center" prop="subName" show-overflow-tooltip width="220">
  77. <template slot-scope="scope">{{scope.row.roomNum?scope.row.subName+'-'+scope.row.roomNum:scope.row.subName}}</template>
  78. </el-table-column>
  79. <el-table-column label="安全责任人" align="center" prop="safetyPeople" show-overflow-tooltip width="120"/>
  80. <el-table-column label="上报人" align="center" prop="createName" show-overflow-tooltip width="90"/>
  81. <el-table-column label="上报时间" sortable="custom" align="center" prop="createTime" show-overflow-tooltip width="157"/>
  82. <el-table-column label="隐患描述" align="center" prop="hazardDescribe" show-overflow-tooltip width="280"/>
  83. <el-table-column label="整改人" align="center" prop="rectifyPeople" show-overflow-tooltip width="100"/>
  84. <el-table-column label="整改时间" sortable="custom" align="center" prop="rectifyTime" show-overflow-tooltip width="157"/>
  85. <el-table-column label="整改状态" align="center" prop="rectifyStatus" show-overflow-tooltip width="120">
  86. <template slot-scope="scope">
  87. {{scope.row.rectifyStatus==0?'待整改':(scope.row.rectifyStatus==1?'已整改':(scope.row.rectifyStatus==2?'暂无法整改':''))}}
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="操作" align="center" prop="deptName" width="70">
  91. <template slot-scope="scope">
  92. <div class="table-button-box">
  93. <p class="table-button-null"></p>
  94. <p class="table-button-p" @click="goPage(3,scope.row)" v-hasPermi="['safety:rectifyClap:query']">详情</p>
  95. <p class="table-button-null"></p>
  96. </div>
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. <pagination :page-sizes="[20, 30, 40, 50]"
  101. v-show="total>0"
  102. :total="total"
  103. :page.sync="queryParams.pageNum"
  104. :limit.sync="queryParams.pageSize"
  105. @pagination="getList"
  106. />
  107. </div>
  108. </div>
  109. <infoPage v-if="infoPageType == 3" :infoPropsData="infoPropsData"></infoPage>
  110. </div>
  111. </template>
  112. <script>
  113. import { listDepartments } from "@/api/system/dept";
  114. import { checkClapMylist } from '@/api/safetyCheck/index'
  115. import infoPage from './infoPage.vue'
  116. export default {
  117. name: 'listPage',
  118. components: {
  119. infoPage
  120. },
  121. data(){
  122. return{
  123. infoPageType:1,
  124. deptSelectList:[],
  125. queryParams:{
  126. pageNum:1,
  127. pageSize:20,
  128. deptId:'',
  129. searchValue:'',
  130. rectifyStatus:'',
  131. upTimeOrder:"",
  132. zgTimeOrder:"",
  133. },
  134. dateRange:[],
  135. tableList:[],
  136. total:0,
  137. //详情
  138. infoPropsData:{}
  139. }
  140. },
  141. created(){
  142. },
  143. mounted(){
  144. this.listDepartments();
  145. this.getList();
  146. },
  147. methods:{
  148. //详情按钮
  149. goPage(type,data){
  150. if(this.infoPageType != type){
  151. if (type==1){
  152. this.$set(this,'infoPageType',type);
  153. } else if(type==2){
  154. this.$set(this,'infoPageType',type);
  155. } else if(type==3){
  156. this.$set(this,'infoPropsData',data);
  157. this.$set(this,'infoPageType',type);
  158. } else if(type==4){
  159. this.$set(this,'infoPageType',1);
  160. this.getList();
  161. }
  162. }
  163. },
  164. //返回按钮
  165. outButton(){
  166. this.$parent.goPage(1);
  167. },
  168. //范围选择
  169. topLeftClickType(type){
  170. if(this.queryParams.rectifyStatus !== type){
  171. this.$set(this.queryParams,'rectifyStatus',type);
  172. this.handleQuery();
  173. }
  174. },
  175. //时间排序方法
  176. sortChange(val){
  177. if(val.prop == 'rectifyTime'){
  178. this.$set(this.queryParams,'zgTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  179. this.$set(this.queryParams,'upTimeOrder','');
  180. this.handleQuery();
  181. }else if(val.prop == 'createTime'){
  182. this.$set(this.queryParams,'upTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  183. this.$set(this.queryParams,'zgTimeOrder','');
  184. this.handleQuery();
  185. }
  186. },
  187. //获取数据列表
  188. getList(){
  189. let obj = JSON.parse(JSON.stringify(this.queryParams))
  190. if(this.dateRange[0]){
  191. obj.beginTime = this.dateRange[0]
  192. }else{
  193. obj.beginTime = ""
  194. }
  195. if(this.dateRange[1]){
  196. obj.endTime = this.dateRange[1]
  197. }else{
  198. obj.endTime = ""
  199. }
  200. checkClapMylist(obj).then(response => {
  201. this.total = response.data.total;
  202. this.tableList = response.data.records;
  203. });
  204. },
  205. /** 搜索按钮操作 */
  206. handleQuery() {
  207. this.$set(this.queryParams,'pageNum',1);
  208. this.getList();
  209. },
  210. /** 重置按钮操作 */
  211. resetQuery() {
  212. this.$set(this,'dateRange',[]);
  213. this.$set(this,'queryParams',{
  214. pageNum:1,
  215. pageSize:20,
  216. deptId:'',
  217. searchValue:'',
  218. rectifyStatus:'',
  219. upTimeOrder:"",
  220. zgTimeOrder:"",
  221. });
  222. this.handleQuery();
  223. },
  224. //获取学院列表
  225. listDepartments(){
  226. listDepartments().then(response => {
  227. this.deptSelectList = response.data;
  228. });
  229. },
  230. }
  231. }
  232. </script>
  233. <style scoped lang="scss">
  234. .snapshotManagement-listPage{
  235. flex: 1;
  236. display: flex !important;
  237. flex-direction: column;
  238. overflow: hidden;
  239. .snapshotManagement-listPage-min{
  240. flex: 1;
  241. display: flex !important;
  242. flex-direction: column;
  243. overflow: hidden;
  244. .title-box{
  245. padding-top:20px;
  246. border-bottom:1px solid #dedede;
  247. .form-button-max-big-box{
  248. display: inline-block;
  249. .form-button-big-box{
  250. display: flex;
  251. div{
  252. position: relative;
  253. height:40px;
  254. width:80px;
  255. line-height: 40px;
  256. text-align: center;
  257. color:#999;
  258. font-size:14px;
  259. border:1px solid #999;
  260. border-radius:4px;
  261. margin-left:10px;
  262. font-weight:500;
  263. cursor: pointer;
  264. .icon-p{
  265. width:15px;
  266. height:15px;
  267. line-height:15px;
  268. text-align: center;
  269. position: absolute;
  270. right:0;
  271. bottom:0;
  272. color:#fff;
  273. background: #0183fa;
  274. border-top-left-radius:4px;
  275. }
  276. }
  277. .checkDiv{
  278. color:#0183FA;
  279. border:1px solid #0183FA;
  280. }
  281. }
  282. }
  283. }
  284. .content-box{
  285. flex: 1;
  286. display: flex;
  287. flex-direction: column;
  288. padding:20px;
  289. overflow: hidden;
  290. }
  291. }
  292. }
  293. </style>