index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <!--巡查管理-->-
  2. <template>
  3. <div class="app-container inspectionManagement">
  4. <div class="inspectionManagement-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. <div class="form-button-max-big-box">
  64. <div class="form-button-big-box">
  65. <div :class="queryParams.isSelf==1?'checkDiv':''" style="width:100px;" @click="topRightClickType">
  66. <p class="text-p">本人发起</p>
  67. <p class="el-icon-check icon-p" v-if="queryParams.isSelf==1"></p>
  68. </div>
  69. </div>
  70. </div>
  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 width="250"/>
  77. <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="220"/>
  78. <el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip width="150"/>
  79. <el-table-column label="检查状态" align="center" prop="manageStatus" show-overflow-tooltip width="90">
  80. <template slot-scope="scope">
  81. <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>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="检查者" align="center" prop="checkUser" show-overflow-tooltip width="100"/>
  85. <el-table-column label="检查结果" align="center" prop="checkResult" show-overflow-tooltip width="80">
  86. <template slot-scope="scope">
  87. <p>{{scope.row.checkResult==0?'不符合':(scope.row.checkResult==1?'符合':'')}}</p>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="隐患数" align="center" prop="dangerNum" show-overflow-tooltip width="80"/>
  91. <el-table-column label="整改进度" align="center" prop="rectifySchedule" show-overflow-tooltip width="200"/>
  92. <el-table-column label="计划周期" align="center" prop="startTime" show-overflow-tooltip width="270">
  93. <template slot-scope="scope">
  94. <p>{{scope.row.cycleStartTime}} 至 {{scope.row.cycleEndTime}}<span style="color:#EE0606;margin-left:15px;" v-if="scope.row.isOverdue==1">已逾期</span></p>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="检查时间" sortable="custom" align="center" prop="checkTime" show-overflow-tooltip width="157"/>
  98. <el-table-column label="操作" align="center" prop="deptName" width="280">
  99. <template slot-scope="scope">
  100. <div class="table-button-box">
  101. <p class="table-button-null"></p>
  102. <p class="table-button-p" v-hasPermi="['safety:checkManage:query']"
  103. v-if="scope.row.manageStatus==0||scope.row.manageStatus==2" @click="goAddPage(3,scope.row.id)">详情</p>
  104. <p class="table-button-p" v-hasPermiAnd="['safety:checkManage:query','safety:checkManage:edit']"
  105. v-if="scope.row.manageStatus==1 && scope.row.isCheck==1" @click="goAddPage(2,scope.row.id)">编辑</p>
  106. <p class="table-button-p" v-hasPermiAnd="['safety:checkManage:query','safety:checkManage:edit']"
  107. v-if="scope.row.manageStatus==0 && scope.row.isCheck==1" @click="goAddPage(2,scope.row.id)">开始检查</p>
  108. <p class="table-button-p" v-hasPermiAnd="['safety:checkManage:query','safety:checkManage:edit']"
  109. style="color:#999" v-if="scope.row.manageStatus==0 && scope.row.isCheck==0">开始检查</p>
  110. <p class="table-button-p" v-if="scope.row.manageStatus==2" @click="lookDocumentButton(1,scope.row)">整改报告</p>
  111. <p class="table-button-p" v-if="scope.row.isAttachment == 1" @click="lookDocumentListButton(1,scope.row)">查看附件</p>
  112. <p class="table-button-null"></p>
  113. </div>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <pagination :page-sizes="[20, 30, 40, 50]"
  118. v-show="total>0"
  119. :total="total"
  120. :page.sync="queryParams.pageNum"
  121. :limit.sync="queryParams.pageSize"
  122. @pagination="getList"
  123. />
  124. </div>
  125. </div>
  126. <addPage v-if="pageType==2" :propsAddData="propsAddData"></addPage>
  127. <infoPage v-if="pageType==3" :propsInfoData="propsInfoData"></infoPage>
  128. <lookDocumentDataDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDataDialog>
  129. <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  130. </div>
  131. </template>
  132. <script>
  133. import { listDepartments } from "@/api/system/dept";
  134. import { checkManageList,getFindByCheckPlanId } from '@/api/safetyCheck/index'
  135. import addPage from '@/views/safetyCheck/components/addPage/addPage.vue'
  136. import infoPage from '@/views/safetyCheck/components/infoPage/infoPage.vue'
  137. import lookDocumentDataDialog from '@/components/lookDocumentDialog/lookDocumentDataDialog.vue'
  138. import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  139. export default {
  140. name: 'index',
  141. components: {
  142. addPage,
  143. infoPage,
  144. lookDocumentDataDialog,
  145. lookDocumentListDialog
  146. },
  147. data(){
  148. return{
  149. //子组件数据
  150. lookDocumentType:false,
  151. propsLookDocumentData:{},
  152. lookDocumentListType:false,
  153. propsLookDocumentListData:{},
  154. propsAddData:{},
  155. propsInfoData:{},
  156. //学院列表
  157. deptSelectList:[],
  158. pageType:1,
  159. queryParams:{
  160. pageNum:1,
  161. pageSize:20,
  162. checkType:1,
  163. manageStatus:'-1',
  164. checkTimeSort:0,
  165. searchValue:"",
  166. deptId:"",
  167. isSelf:0,
  168. },
  169. dateRange:[],
  170. tableList:[],
  171. total:0,
  172. }
  173. },
  174. created(){
  175. if(this.$route.query.id){
  176. this.goAddPage(2,this.$route.query.id);
  177. }
  178. },
  179. mounted(){
  180. this.listDepartments();
  181. this.getList();
  182. },
  183. methods:{
  184. //开始检查
  185. goAddPage(type,id){
  186. if(this.pageType != type){
  187. if(type == 1){
  188. //返回
  189. this.$set(this,'pageType',type);
  190. }else if(type == 2){
  191. //开始检查/编辑
  192. this.$set(this,'propsAddData',{
  193. id:id,
  194. title:'校院巡查',
  195. });
  196. this.$set(this,'pageType',type);
  197. }else if(type == 3){
  198. //详情
  199. this.$set(this,'propsInfoData',{id:id});
  200. this.$set(this,'pageType',type);
  201. }else if(type == 4){
  202. //返回并刷新
  203. this.getList();
  204. this.$set(this,'pageType',1);
  205. }
  206. }
  207. },
  208. //时间排序方法
  209. sortChange(val){
  210. if(val.prop == 'checkTime'){
  211. this.$set(this.queryParams,'checkTimeSort',val.order=='ascending'?'1':(val.order=='descending'?'2':"0"));
  212. this.handleQuery();
  213. }
  214. },
  215. //范围选择
  216. topLeftClickType(type){
  217. if(this.queryParams.manageStatus != type){
  218. this.$set(this.queryParams,'manageStatus',type);
  219. this.handleQuery();
  220. }
  221. },
  222. topRightClickType(){
  223. this.$set(this.queryParams,'isSelf',this.queryParams.isSelf==1?0:1);
  224. this.handleQuery();
  225. },
  226. //获取数据列表
  227. getList(){
  228. let obj = JSON.parse(JSON.stringify(this.queryParams))
  229. if(this.dateRange[0]){
  230. obj.startTime = this.dateRange[0];
  231. }else{
  232. obj.startTime = "";
  233. }
  234. if(this.dateRange[1]){
  235. obj.endTime = this.dateRange[1];
  236. }else{
  237. obj.endTime = "";
  238. }
  239. checkManageList(obj).then(response => {
  240. this.total = response.data.total;
  241. this.tableList = response.data.records;
  242. });
  243. },
  244. /** 搜索按钮操作 */
  245. handleQuery() {
  246. this.$set(this.queryParams,'pageNum',1);
  247. this.getList();
  248. },
  249. /** 重置按钮操作 */
  250. resetQuery() {
  251. this.$set(this,'dateRange',[]);
  252. this.$set(this,'queryParams',{
  253. pageNum:1,
  254. pageSize:20,
  255. checkType:1,
  256. manageStatus:'-1',
  257. checkTimeSort:0,
  258. searchValue:"",
  259. deptId:"",
  260. isSelf:0,
  261. });
  262. this.handleQuery();
  263. },
  264. //查看单个文档
  265. lookDocumentButton(type,row){
  266. if(type==1){
  267. this.$set(this,'propsLookDocumentData',{
  268. title:"整改报告",
  269. name:row.name,
  270. url:row.url
  271. });
  272. this.$set(this,'lookDocumentType',true);
  273. }else{
  274. this.$set(this,'lookDocumentType',false);
  275. }
  276. },
  277. //查看多个文档
  278. lookDocumentListButton(type,row){
  279. if(type==1){
  280. getFindByCheckPlanId({checkPlanId:row.id}).then(response => {
  281. let list = [];
  282. for(let i=0;i<response.data.length;i++){
  283. let obj = {
  284. name:response.data[i].fileName,
  285. url:response.data[i].fileUrl,
  286. }
  287. list.push(obj);
  288. }
  289. this.$set(this,'propsLookDocumentListData',{
  290. title:"查看附件",
  291. list:list
  292. });
  293. this.$set(this,'lookDocumentListType',true);
  294. });
  295. }else{
  296. this.$set(this,'lookDocumentListType',false);
  297. }
  298. },
  299. //获取学院列表
  300. listDepartments(){
  301. listDepartments().then(response => {
  302. this.deptSelectList = response.data;
  303. });
  304. },
  305. }
  306. }
  307. </script>
  308. <style scoped lang="scss">
  309. .inspectionManagement{
  310. flex: 1;
  311. display: flex !important;
  312. flex-direction: column;
  313. overflow: hidden;
  314. .inspectionManagement-page{
  315. flex: 1;
  316. display: flex !important;
  317. flex-direction: column;
  318. overflow: hidden;
  319. .title-box{
  320. padding-top:20px;
  321. border-bottom:1px solid #dedede;
  322. .form-button-max-big-box{
  323. display: inline-block;
  324. .form-button-big-box{
  325. display: flex;
  326. div{
  327. position: relative;
  328. height:40px;
  329. width:80px;
  330. line-height: 40px;
  331. text-align: center;
  332. color:#999;
  333. font-size:14px;
  334. border:1px solid #999;
  335. border-radius:4px;
  336. margin-left:10px;
  337. font-weight:500;
  338. cursor: pointer;
  339. .icon-p{
  340. width:15px;
  341. height:15px;
  342. line-height:15px;
  343. text-align: center;
  344. position: absolute;
  345. right:0;
  346. bottom:0;
  347. color:#fff;
  348. background: #0183fa;
  349. border-top-left-radius:4px;
  350. }
  351. }
  352. .checkDiv{
  353. color:#0183FA;
  354. border:1px solid #0183FA;
  355. }
  356. }
  357. }
  358. }
  359. .content-box{
  360. flex: 1;
  361. display: flex;
  362. flex-direction: column;
  363. padding:20px;
  364. overflow: hidden;
  365. }
  366. }
  367. }
  368. </style>