index.vue 15 KB

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