listPage.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <!--巡查子项管理-->
  2. <template>
  3. <div class="selfInspectionManagement">
  4. <div class="selfInspectionManagement-page" v-if="pageType == 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.manageStatus=='-1'?'checkDiv':''" @click="topLeftClickType('-1')">
  10. <p class="text-p">全部</p>
  11. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus=='-1'"></p>
  12. </div>
  13. <div :class="queryParams.manageStatus==0?'checkDiv':''" @click="topLeftClickType(0)">
  14. <p class="text-p">待检查</p>
  15. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus==0"></p>
  16. </div>
  17. <div :class="queryParams.manageStatus==1?'checkDiv':''" @click="topLeftClickType(1)">
  18. <p class="text-p">检查中</p>
  19. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus==1"></p>
  20. </div>
  21. <div :class="queryParams.manageStatus==2?'checkDiv':''" @click="topLeftClickType(2)">
  22. <p class="text-p">已检查</p>
  23. <p class="el-icon-check icon-p" v-if="queryParams.manageStatus==2"></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: 250px"
  34. />
  35. </el-form-item>
  36. <el-form-item label="学院" prop="deptId" label-width="50px">
  37. <el-select v-model="queryParams.deptId" clearable placeholder="请选择学院" style="width: 150px">
  38. <el-option
  39. v-for="item in deptSelectList"
  40. :key="item.deptId"
  41. :label="item.deptName"
  42. :value="item.deptId">
  43. </el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item label="检查时间" prop="dateRange" style="margin-left:10px;" label-width="70px">
  47. <el-date-picker
  48. :clearable="false"
  49. v-model="dateRange"
  50. size="small"
  51. style="width: 240px"
  52. value-format="yyyy-MM-dd"
  53. type="daterange"
  54. range-separator="-"
  55. start-placeholder="开始日期"
  56. end-placeholder="结束日期"
  57. ></el-date-picker>
  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">
  64. <p class="add-button-one-90" style="width:80px;" @click="outButton">返回</p>
  65. </el-form-item>
  66. </el-form>
  67. </div>
  68. <div class="content-box">
  69. <el-table border :data="tableList" ref="multipleTable" @sort-change="sortChange">
  70. <el-table-column label="序号" align="center" type="index" width="60" />
  71. <el-table-column label="计划标题" align="center" prop="title" show-overflow-tooltip width="250"/>
  72. <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="220"/>
  73. <el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip width="150"/>
  74. <el-table-column label="检查状态" align="center" prop="manageStatus" show-overflow-tooltip width="90">
  75. <template slot-scope="scope">
  76. <p :class="scope.row.manageStatus==0?'manageStatus-color-1':(scope.row.manageStatus==1?'manageStatus-color-2':(scope.row.manageStatus==2?'manageStatus-color-3':''))">{{scope.row.manageStatus==0?'待检查':(scope.row.manageStatus==1?'检查中':(scope.row.manageStatus==2?'已检查':''))}}</p>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="检查者" align="center" prop="checkUser" show-overflow-tooltip width="100"/>
  80. <el-table-column label="检查结果" align="center" prop="checkResult" show-overflow-tooltip width="80">
  81. <template slot-scope="scope">
  82. <p>{{scope.row.checkResult==0?'不符合':(scope.row.checkResult==1?'符合':'')}}</p>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="隐患数" align="center" prop="dangerNum" show-overflow-tooltip width="80"/>
  86. <el-table-column label="整改进度" align="center" prop="rectifySchedule" show-overflow-tooltip width="200"/>
  87. <el-table-column label="计划周期" align="center" prop="startTime" show-overflow-tooltip width="270">
  88. <template slot-scope="scope">
  89. <p>{{scope.row.cycleStartTime}}至{{scope.row.cycleEndTime}}<span style="color:#EE0606;margin-left:15px;" v-if="scope.row.isOverdue==1">已逾期</span></p>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="检查时间" sortable="custom" align="center" prop="checkTime" show-overflow-tooltip width="157"/>
  93. <el-table-column label="操作" align="center" prop="deptName" width="230">
  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-if="scope.row.manageStatus==0||scope.row.manageStatus==2" @click="goAddPage(3,scope.row.id)">详情</p>
  98. <p class="table-button-p" v-if="scope.row.manageStatus==1 && scope.row.isCheck==1" @click="goAddPage(2,scope.row.id)">编辑</p>
  99. <p class="table-button-p" v-if="scope.row.manageStatus==0 && scope.row.isCheck==1" @click="goAddPage(2,scope.row.id)">开始检查</p>
  100. <p class="table-button-p" style="color:#999" v-if="scope.row.manageStatus==0 && scope.row.isCheck==0">开始检查</p>
  101. <p class="table-button-p" v-if="scope.row.manageStatus==2" @click="lookDocumentButton(1,scope.row)">整改报告</p>
  102. <p class="table-button-p" v-if="scope.row.isAttachment == 1" @click="lookDocumentListButton(1,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. <addPage v-if="pageType==2" :propsAddData="propsAddData"></addPage>
  118. <infoPage v-if="pageType==3" :propsInfoData="propsInfoData"></infoPage>
  119. <lookDocumentDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDialog>
  120. <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  121. </div>
  122. </template>
  123. <script>
  124. import { listDepartments } from "@/api/system/dept";
  125. import { findByCheckPlanId } from '@/api/safetyCheck/index'
  126. import addPage from '@/views/safetyCheck/components/addPage/addPage.vue'
  127. import infoPage from '@/views/safetyCheck/components/infoPage/infoPage.vue'
  128. import lookDocumentDialog from '@/components/lookDocumentDialog/lookDocumentDialog.vue'
  129. import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  130. export default {
  131. name: 'index',
  132. props:{
  133. propsListPageData:{},
  134. },
  135. components: {
  136. addPage,
  137. infoPage,
  138. lookDocumentDialog,
  139. lookDocumentListDialog
  140. },
  141. data(){
  142. return{
  143. //子组件数据
  144. lookDocumentType:false,
  145. propsLookDocumentData:{},
  146. lookDocumentListType:false,
  147. propsLookDocumentListData:{},
  148. propsAddData:{},
  149. propsInfoData:{},
  150. //学院列表
  151. deptSelectList:[],
  152. pageType:1,
  153. queryParams:{
  154. pageNum:1,
  155. pageSize:20,
  156. manageStatus:'-1',
  157. checkTimeSort:0,
  158. searchValue:"",
  159. deptId:""
  160. },
  161. dateRange:[],
  162. tableList:[],
  163. total:0,
  164. }
  165. },
  166. created(){
  167. },
  168. mounted(){
  169. this.listDepartments();
  170. this.getList();
  171. },
  172. methods:{
  173. //返回按钮
  174. outButton(){
  175. this.$parent.goPage(1);
  176. },
  177. //开始检查
  178. goAddPage(type,id){
  179. if(this.pageType != type){
  180. if(type == 1){
  181. //返回
  182. this.$set(this,'pageType',type);
  183. }else if(type == 2){
  184. //开始检查/编辑
  185. this.$set(this,'propsAddData',{
  186. id:id,
  187. title:'校院巡查',
  188. });
  189. this.$set(this,'pageType',type);
  190. }else if(type == 3){
  191. //详情
  192. this.$set(this,'propsInfoData',{id:id});
  193. this.$set(this,'pageType',type);
  194. }else if(type == 4){
  195. //返回并刷新
  196. this.getList();
  197. this.$set(this,'pageType',1);
  198. }
  199. }
  200. },
  201. //时间排序方法
  202. sortChange(val){
  203. if(val.prop == 'checkTime'){
  204. this.$set(this.queryParams,'checkTimeSort',val.order=='ascending'?'1':(val.order=='descending'?'2':"0"));
  205. this.handleQuery();
  206. }
  207. },
  208. //范围选择
  209. topLeftClickType(type){
  210. if(this.queryParams.manageStatus != type){
  211. this.$set(this.queryParams,'manageStatus',type);
  212. this.handleQuery();
  213. }
  214. },
  215. //获取数据列表
  216. getList(){
  217. let obj = JSON.parse(JSON.stringify(this.queryParams))
  218. obj.checkPlanId = this.propsListPageData.id;
  219. if(this.dateRange[0]){
  220. obj.startTime = this.dateRange[0];
  221. }else{
  222. obj.startTime = "";
  223. }
  224. if(this.dateRange[1]){
  225. obj.endTime = this.dateRange[1];
  226. }else{
  227. obj.endTime = "";
  228. }
  229. findByCheckPlanId(obj).then(response => {
  230. this.total = response.data.total;
  231. this.tableList = response.data.records;
  232. });
  233. },
  234. /** 搜索按钮操作 */
  235. handleQuery() {
  236. this.$set(this.queryParams,'pageNum',1);
  237. this.getList();
  238. },
  239. /** 重置按钮操作 */
  240. resetQuery() {
  241. this.$set(this,'dateRange',[]);
  242. this.$set(this,'queryParams',{
  243. pageNum:1,
  244. pageSize:20,
  245. manageStatus:'-1',
  246. checkTimeSort:0,
  247. searchValue:"",
  248. deptId:""
  249. });
  250. this.handleQuery();
  251. },
  252. //查看单个文档
  253. lookDocumentButton(type,row){
  254. if(type==1){
  255. this.$set(this,'propsLookDocumentData',{
  256. title:"整改报告",
  257. name:row.name,
  258. url:row.url
  259. });
  260. this.$set(this,'lookDocumentType',true);
  261. }else{
  262. this.$set(this,'lookDocumentType',false);
  263. }
  264. },
  265. //查看多个文档
  266. lookDocumentListButton(type,row){
  267. if(type==1){
  268. this.$set(this,'propsLookDocumentListData',{
  269. title:"查看附件",
  270. list:row.list
  271. });
  272. this.$set(this,'lookDocumentListType',true);
  273. }else{
  274. this.$set(this,'lookDocumentListType',false);
  275. }
  276. },
  277. //获取学院列表
  278. listDepartments(){
  279. listDepartments().then(response => {
  280. this.deptSelectList = response.data;
  281. });
  282. },
  283. },
  284. }
  285. </script>
  286. <style scoped lang="scss">
  287. .selfInspectionManagement{
  288. flex: 1;
  289. display: flex !important;
  290. flex-direction: column;
  291. overflow: hidden;
  292. .selfInspectionManagement-page{
  293. flex: 1;
  294. display: flex !important;
  295. flex-direction: column;
  296. overflow: hidden;
  297. .title-box{
  298. padding-top:20px;
  299. border-bottom:1px solid #dedede;
  300. .form-button-max-big-box{
  301. display: inline-block;
  302. .form-button-big-box{
  303. display: flex;
  304. div{
  305. position: relative;
  306. height:40px;
  307. width:80px;
  308. line-height: 40px;
  309. text-align: center;
  310. color:#999;
  311. font-size:14px;
  312. border:1px solid #999;
  313. border-radius:4px;
  314. margin-left:10px;
  315. font-weight:500;
  316. cursor: pointer;
  317. .icon-p{
  318. width:15px;
  319. height:15px;
  320. line-height:15px;
  321. text-align: center;
  322. position: absolute;
  323. right:0;
  324. bottom:0;
  325. color:#fff;
  326. background: #0183fa;
  327. border-top-left-radius:4px;
  328. }
  329. }
  330. .checkDiv{
  331. color:#0183FA;
  332. border:1px solid #0183FA;
  333. }
  334. }
  335. }
  336. }
  337. .content-box{
  338. flex: 1;
  339. display: flex;
  340. flex-direction: column;
  341. padding:20px;
  342. overflow: hidden;
  343. .manageStatus-color-1{
  344. color:#0183FA;
  345. }
  346. .manageStatus-color-2{
  347. color:#EE0606;
  348. }
  349. .manageStatus-color-3{
  350. color:#23B303;
  351. }
  352. }
  353. }
  354. }
  355. </style>