index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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" />
  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="230">
  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-if="scope.row.manageStatus==2" @click="goAddPage(3,scope.row.id)">详情</p>
  103. <p class="table-button-p" v-if="scope.row.manageStatus==1" @click="goAddPage(2,scope.row.id)">编辑</p>
  104. <p class="table-button-p" v-if="scope.row.manageStatus==0" @click="goAddPage(2,scope.row.id)">开始检查</p>
  105. <p class="table-button-p" v-if="scope.row.manageStatus==2" @click="lookDocumentButton(1,scope.row)">整改报告</p>
  106. <p class="table-button-p" v-if="scope.row.isAttachment == 1" @click="lookDocumentListButton(1,scope.row)">查看附件</p>
  107. <p class="table-button-null"></p>
  108. </div>
  109. </template>
  110. </el-table-column>
  111. </el-table>
  112. <pagination :page-sizes="[20, 30, 40, 50]"
  113. v-show="total>0"
  114. :total="total"
  115. :page.sync="queryParams.pageNum"
  116. :limit.sync="queryParams.pageSize"
  117. @pagination="getList"
  118. />
  119. </div>
  120. </div>
  121. <addPage v-if="pageType==2" :propsAddData="propsAddData"></addPage>
  122. <infoPage v-if="pageType==3" :propsInfoData="propsInfoData"></infoPage>
  123. <lookDocumentDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDialog>
  124. <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  125. </div>
  126. </template>
  127. <script>
  128. import { listDepartments } from "@/api/system/dept";
  129. import { checkManageList } from '@/api/safetyCheck/index'
  130. import addPage from '@/views/safetyCheck/components/addPage/addPage.vue'
  131. import infoPage from '@/views/safetyCheck/components/infoPage/infoPage.vue'
  132. import lookDocumentDialog from '@/components/lookDocumentDialog/lookDocumentDialog.vue'
  133. import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  134. export default {
  135. name: 'index',
  136. components: {
  137. addPage,
  138. infoPage,
  139. lookDocumentDialog,
  140. lookDocumentListDialog
  141. },
  142. data(){
  143. return{
  144. //子组件数据
  145. lookDocumentType:false,
  146. propsLookDocumentData:{},
  147. lookDocumentListType:false,
  148. propsLookDocumentListData:{},
  149. propsAddData:{},
  150. propsInfoData:{},
  151. //学院列表
  152. deptSelectList:[],
  153. pageType:1,
  154. queryParams:{
  155. pageNum:1,
  156. pageSize:20,
  157. checkType:2,
  158. manageStatus:'-1',
  159. checkTimeSort:0,
  160. searchValue:"",
  161. deptId:"",
  162. isSelf:0,
  163. },
  164. dateRange:[],
  165. tableList:[],
  166. total:0,
  167. }
  168. },
  169. created(){
  170. },
  171. mounted(){
  172. this.listDepartments();
  173. this.getList();
  174. },
  175. methods:{
  176. //开始检查
  177. goAddPage(type,id){
  178. if(this.pageType != type){
  179. if(type == 1){
  180. //返回
  181. this.$set(this,'pageType',type);
  182. }else if(type == 2){
  183. //开始检查/编辑
  184. this.$set(this,'propsAddData',{
  185. id:id,
  186. title:'实验室自查',
  187. });
  188. this.$set(this,'pageType',type);
  189. }else if(type == 3){
  190. //详情
  191. this.$set(this,'propsInfoData',{id:id});
  192. this.$set(this,'pageType',type);
  193. }else if(type == 4){
  194. //返回并刷新
  195. this.getList();
  196. this.$set(this,'pageType',1);
  197. }
  198. }
  199. },
  200. //时间排序方法
  201. sortChange(val){
  202. //ascending 上 descending 下 null 无
  203. console.log('val',val.order)
  204. this.$set(this.queryParams,'timeType',val.order=='ascending'?1:(val.order=='descending'?2:''));
  205. },
  206. //范围选择
  207. topLeftClickType(type){
  208. if(this.queryParams.manageStatus != type){
  209. this.$set(this.queryParams,'manageStatus',type);
  210. this.getList();
  211. }
  212. },
  213. topRightClickType(){
  214. this.$set(this.queryParams,'isSelf',this.queryParams.isSelf==1?0:1);
  215. this.getList();
  216. },
  217. //获取数据列表
  218. getList(){
  219. let obj = JSON.parse(JSON.stringify(this.queryParams))
  220. if(this.dateRange[0]){
  221. obj.startTime = this.dateRange[0];
  222. }else{
  223. obj.startTime = "";
  224. }
  225. if(this.dateRange[1]){
  226. obj.endTime = this.dateRange[1];
  227. }else{
  228. obj.endTime = "";
  229. }
  230. checkManageList(obj).then(response => {
  231. this.total = response.data.total;
  232. this.tableList = response.data.records;
  233. });
  234. },
  235. /** 搜索按钮操作 */
  236. handleQuery() {
  237. this.$set(this.queryParams,'pageNum',1);
  238. this.getList();
  239. },
  240. /** 重置按钮操作 */
  241. resetQuery() {
  242. this.$set(this,'dateRange',[]);
  243. this.$set(this,'queryParams',{
  244. pageNum:1,
  245. pageSize:20,
  246. checkType:2,
  247. manageStatus:'-1',
  248. checkTimeSort:0,
  249. searchValue:"",
  250. deptId:"",
  251. isSelf:0,
  252. });
  253. this.handleQuery();
  254. },
  255. //查看单个文档
  256. lookDocumentButton(type,row){
  257. if(type==1){
  258. this.$set(this,'propsLookDocumentData',{
  259. title:"整改报告",
  260. name:row.name,
  261. url:row.url
  262. });
  263. this.$set(this,'lookDocumentType',true);
  264. }else{
  265. this.$set(this,'lookDocumentType',false);
  266. }
  267. },
  268. //查看多个文档
  269. lookDocumentListButton(type,row){
  270. if(type==1){
  271. this.$set(this,'propsLookDocumentListData',{
  272. title:"查看附件",
  273. list:row.list
  274. });
  275. this.$set(this,'lookDocumentListType',true);
  276. }else{
  277. this.$set(this,'lookDocumentListType',false);
  278. }
  279. },
  280. //获取学院列表
  281. listDepartments(){
  282. listDepartments().then(response => {
  283. this.deptSelectList = response.data;
  284. });
  285. },
  286. },
  287. }
  288. </script>
  289. <style scoped lang="scss">
  290. .selfInspectionManagement{
  291. flex: 1;
  292. display: flex !important;
  293. flex-direction: column;
  294. overflow: hidden;
  295. .selfInspectionManagement-page{
  296. flex: 1;
  297. display: flex !important;
  298. flex-direction: column;
  299. overflow: hidden;
  300. .title-box{
  301. padding-top:20px;
  302. border-bottom:1px solid #dedede;
  303. .form-button-max-big-box{
  304. display: inline-block;
  305. .form-button-big-box{
  306. display: flex;
  307. div{
  308. position: relative;
  309. height:40px;
  310. width:80px;
  311. line-height: 40px;
  312. text-align: center;
  313. color:#999;
  314. font-size:14px;
  315. border:1px solid #999;
  316. border-radius:4px;
  317. margin-left:10px;
  318. font-weight:500;
  319. cursor: pointer;
  320. .icon-p{
  321. width:15px;
  322. height:15px;
  323. line-height:15px;
  324. text-align: center;
  325. position: absolute;
  326. right:0;
  327. bottom:0;
  328. color:#fff;
  329. background: #0183fa;
  330. border-top-left-radius:4px;
  331. }
  332. }
  333. .checkDiv{
  334. color:#0183FA;
  335. border:1px solid #0183FA;
  336. }
  337. }
  338. }
  339. }
  340. .content-box{
  341. flex: 1;
  342. display: flex;
  343. flex-direction: column;
  344. padding:20px;
  345. overflow: hidden;
  346. }
  347. }
  348. }
  349. </style>