listPage.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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. <el-table-column label="安全责任人" align="center" prop="safetyPeople" show-overflow-tooltip width="120"/>
  78. <el-table-column label="上报人" align="center" prop="createName" show-overflow-tooltip width="90"/>
  79. <el-table-column label="上报时间" sortable="custom" align="center" prop="createTime" show-overflow-tooltip width="157"/>
  80. <el-table-column label="隐患描述" align="center" prop="hazardDescribe" show-overflow-tooltip width="280"/>
  81. <el-table-column label="整改人" align="center" prop="rectifyPeople" show-overflow-tooltip width="100"/>
  82. <el-table-column label="整改时间" sortable="custom" align="center" prop="rectifyTime" show-overflow-tooltip width="157"/>
  83. <el-table-column label="整改状态" align="center" prop="rectifyStatus" show-overflow-tooltip width="120">
  84. <template slot-scope="scope">
  85. {{scope.row.rectifyStatus==0?'待整改':(scope.row.rectifyStatus==1?'已整改':(scope.row.rectifyStatus==2?'暂无法整改':''))}}
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="操作" align="center" prop="deptName" width="70">
  89. <template slot-scope="scope">
  90. <div class="table-button-box">
  91. <p class="table-button-null"></p>
  92. <p class="table-button-p" @click="goPage(3,scope.row)" v-hasPermi="['safety:rectifyClap:query']">详情</p>
  93. <p class="table-button-null"></p>
  94. </div>
  95. </template>
  96. </el-table-column>
  97. </el-table>
  98. <pagination :page-sizes="[20, 30, 40, 50]"
  99. v-show="total>0"
  100. :total="total"
  101. :page.sync="queryParams.pageNum"
  102. :limit.sync="queryParams.pageSize"
  103. @pagination="getList"
  104. />
  105. </div>
  106. </div>
  107. <infoPage v-if="infoPageType == 3" :infoPropsData="infoPropsData"></infoPage>
  108. </div>
  109. </template>
  110. <script>
  111. import { listDepartments } from "@/api/system/dept";
  112. import { checkClapMylist } from '@/api/safetyCheck/index'
  113. import infoPage from './infoPage.vue'
  114. export default {
  115. name: 'listPage',
  116. components: {
  117. infoPage
  118. },
  119. data(){
  120. return{
  121. infoPageType:1,
  122. deptSelectList:[],
  123. queryParams:{
  124. pageNum:1,
  125. pageSize:20,
  126. deptId:'',
  127. searchValue:'',
  128. rectifyStatus:'',
  129. upTimeOrder:"",
  130. zgTimeOrder:"",
  131. },
  132. dateRange:[],
  133. tableList:[{}],
  134. total:0,
  135. //详情
  136. infoPropsData:{}
  137. }
  138. },
  139. created(){
  140. },
  141. mounted(){
  142. this.listDepartments();
  143. this.getList();
  144. },
  145. methods:{
  146. //详情按钮
  147. goPage(type,data){
  148. if(this.infoPageType != type){
  149. if (type==1){
  150. this.$set(this,'infoPageType',type);
  151. } else if(type==2){
  152. this.$set(this,'infoPageType',type);
  153. } else if(type==3){
  154. this.$set(this,'infoPropsData',data);
  155. this.$set(this,'infoPageType',type);
  156. } else if(type==4){
  157. this.$set(this,'infoPageType',1);
  158. this.getList();
  159. }
  160. }
  161. },
  162. //返回按钮
  163. outButton(){
  164. this.$parent.goPage(1);
  165. },
  166. //范围选择
  167. topLeftClickType(type){
  168. if(this.queryParams.rectifyStatus !== type){
  169. this.$set(this.queryParams,'rectifyStatus',type);
  170. this.getList();
  171. }
  172. },
  173. //时间排序方法
  174. sortChange(val){
  175. if(val.prop == 'rectifyTime'){
  176. this.$set(this.queryParams,'zgTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  177. this.$set(this.queryParams,'upTimeOrder','');
  178. this.handleQuery();
  179. }else if(val.prop == 'createTime'){
  180. this.$set(this.queryParams,'upTimeOrder',val.order=='ascending'?'1':(val.order=='descending'?'2':''));
  181. this.$set(this.queryParams,'zgTimeOrder','');
  182. this.handleQuery();
  183. }
  184. },
  185. //获取数据列表
  186. getList(){
  187. let obj = JSON.parse(JSON.stringify(this.queryParams))
  188. if(this.dateRange[0]){
  189. obj.beginTime = this.dateRange[0]
  190. }else{
  191. obj.beginTime = ""
  192. }
  193. if(this.dateRange[1]){
  194. obj.endTime = this.dateRange[1]
  195. }else{
  196. obj.endTime = ""
  197. }
  198. checkClapMylist(obj).then(response => {
  199. this.total = response.data.total;
  200. this.tableList = response.data.records;
  201. });
  202. },
  203. /** 搜索按钮操作 */
  204. handleQuery() {
  205. this.$set(this.queryParams,'pageNum',1);
  206. this.getList();
  207. },
  208. /** 重置按钮操作 */
  209. resetQuery() {
  210. this.$set(this,'dateRange',[]);
  211. this.$set(this,'queryParams',{
  212. pageNum:1,
  213. pageSize:20,
  214. deptId:'',
  215. searchValue:'',
  216. rectifyStatus:'',
  217. upTimeOrder:"",
  218. zgTimeOrder:"",
  219. });
  220. this.handleQuery();
  221. },
  222. //获取学院列表
  223. listDepartments(){
  224. listDepartments().then(response => {
  225. this.deptSelectList = response.data;
  226. });
  227. },
  228. }
  229. }
  230. </script>
  231. <style scoped lang="scss">
  232. .snapshotManagement-listPage{
  233. flex: 1;
  234. display: flex !important;
  235. flex-direction: column;
  236. overflow: hidden;
  237. .snapshotManagement-listPage-min{
  238. flex: 1;
  239. display: flex !important;
  240. flex-direction: column;
  241. overflow: hidden;
  242. .title-box{
  243. padding-top:20px;
  244. border-bottom:1px solid #dedede;
  245. .form-button-max-big-box{
  246. display: inline-block;
  247. .form-button-big-box{
  248. display: flex;
  249. div{
  250. position: relative;
  251. height:40px;
  252. width:80px;
  253. line-height: 40px;
  254. text-align: center;
  255. color:#999;
  256. font-size:14px;
  257. border:1px solid #999;
  258. border-radius:4px;
  259. margin-left:10px;
  260. font-weight:500;
  261. cursor: pointer;
  262. .icon-p{
  263. width:15px;
  264. height:15px;
  265. line-height:15px;
  266. text-align: center;
  267. position: absolute;
  268. right:0;
  269. bottom:0;
  270. color:#fff;
  271. background: #0183fa;
  272. border-top-left-radius:4px;
  273. }
  274. }
  275. .checkDiv{
  276. color:#0183FA;
  277. border:1px solid #0183FA;
  278. }
  279. }
  280. }
  281. }
  282. .content-box{
  283. flex: 1;
  284. display: flex;
  285. flex-direction: column;
  286. padding:20px;
  287. overflow: hidden;
  288. }
  289. }
  290. }
  291. </style>