inspectStatistics.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. <!--检查明细--->
  2. <template>
  3. <div class="page-container checkItem">
  4. <div class="page-container checkItem" v-if="pageType == 1">
  5. <div class="page-top-title-box">
  6. <p class="page-top-title-name-p">{{propsData.title}}</p>
  7. <p class="page-top-title-out-p" @click="backPage">返回</p>
  8. </div>
  9. <div class="content-box scrollbar-box">
  10. <div class="page-form-title-box" style="border:none;">
  11. <el-form :model="queryParams" class="form-box" ref="queryForm"
  12. :inline="true" style="width:100%;">
  13. <div class="table-school-college-toggle-box" v-if="!propsData.deptId&&!propsData.subId">
  14. <p :class="checkStatus==null?'p-check':''" @click="tableCheck(null)">全部</p>
  15. <p :class="checkStatus==0?'p-check':''" @click="tableCheck(0)">待检查</p>
  16. <p :class="checkStatus==1?'p-check':''" @click="tableCheck(1)">已检查</p>
  17. </div>
  18. <el-form-item label="" prop="hazardCheckName">
  19. <el-input
  20. maxLength="30"
  21. v-model="queryParams.hazardCheckName"
  22. placeholder="模糊搜索检查项"
  23. style="width: 140px"
  24. />
  25. </el-form-item>
  26. <el-form-item label="" prop="deptId" v-if="!propsData.deptId&&!propsData.subId">
  27. <el-select v-model="queryParams.deptId" placeholder="学院单位" style="width: 120px">
  28. <el-option
  29. v-for="dict in deptOption"
  30. :key="dict.deptId"
  31. :label="dict.deptName"
  32. :value="dict.deptId"
  33. />
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="" prop="subName">
  37. <el-input
  38. maxLength="30"
  39. v-model="queryParams.subName"
  40. placeholder="实验室/房间号"
  41. style="width: 120px"
  42. />
  43. </el-form-item>
  44. <el-form-item label="" prop="checkUserName">
  45. <el-input
  46. maxLength="30"
  47. v-model="queryParams.checkUserName"
  48. placeholder="检查人/整改人"
  49. style="width: 120px"
  50. />
  51. </el-form-item>
  52. <el-form-item label="" prop="checkName">
  53. <el-input
  54. maxLength="30"
  55. v-model="queryParams.checkName"
  56. placeholder="检查名称"
  57. style="width: 150px"
  58. />
  59. </el-form-item>
  60. <el-form-item label="" prop="checkFlag">
  61. <el-select v-model="queryParams.checkFlag" placeholder="检查结果" style="width: 120px">
  62. <el-option
  63. v-for="dict in optionList"
  64. :key="dict.value"
  65. :label="dict.label"
  66. :value="dict.value"
  67. />
  68. </el-select>
  69. </el-form-item>
  70. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  71. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  72. <el-form-item style="float: right;">
  73. <export-component :exportConfig="exportConfig"></export-component>
  74. </el-form-item>
  75. </el-form>
  76. </div>
  77. <div class="page-content-box" style="padding-top:0;">
  78. <el-table class="table-box" ref="table-box" v-loading="loading" border :data="dataList"
  79. @selection-change="handleSelectionChange" :row-key="getRowKeys" @sort-change="sortChange">
  80. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  81. <el-table-column label="序号" type="index" width="60"/>
  82. <el-table-column label="检查名称" prop="checkName" width="200" show-overflow-tooltip/>
  83. <el-table-column label="实验室" prop="subName" width="200" show-overflow-tooltip>
  84. <template slot-scope="scope">
  85. <span>{{scope.row.subName}}{{scope.row.roomNum}}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="检查项" prop="content" width="280" show-overflow-tooltip>
  89. <template slot-scope="scope">
  90. <span>{{scope.row.hazardCheckCode}}{{scope.row.hazardCheckName}}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="检查状态" prop="checkStatus" width="100" show-overflow-tooltip>
  94. <template slot-scope="scope">
  95. <span>{{scope.row.checkStatus==0?'待检查':'已检查'}}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="检查人" prop="checkUserName" width="80" show-overflow-tooltip/>
  99. <el-table-column label="检查结果" prop="checkFlag" width="100" show-overflow-tooltip>
  100. <template slot-scope="scope">
  101. <span v-if="scope.row.checkStatus!=0">{{scope.row.checkFlag?'符合':'不符合'}}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="检查时间" sortable="custom" prop="checkTime" width="150" show-overflow-tooltip>
  105. <template slot-scope="scope">
  106. <span>{{ parseTime(scope.row.checkTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="整改状态" prop="rectifyStatus" width="100" show-overflow-tooltip>
  110. <template slot-scope="scope">
  111. <span v-if="scope.row.checkStatus!=0&&!scope.row.checkFlag">{{scope.row.rectifyStatus==1?'已完成':(scope.row.rectifyStatus==2?'待整改':(scope.row.rectifyStatus==4?'暂无法整改':''))}}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="整改人" prop="rectifyName" width="90" show-overflow-tooltip/>
  115. <el-table-column label="整改时间" sortable="custom" prop="rectifyTime" width="150" show-overflow-tooltip>
  116. <template slot-scope="scope">
  117. <span>{{ parseTime(scope.row.rectifyTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="复查状态" prop="reviewStatus" width="80" show-overflow-tooltip>
  121. <template slot-scope="scope">
  122. <span v-if="scope.row.checkStatus!=0&&!scope.row.checkFlag&&scope.row.rectifyStatus!=2">{{scope.row.reviewStatus==1?'已复查':(scope.row.reviewStatus==0?'待复查':'')}}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="复查人" prop="reviewName" width="80" show-overflow-tooltip/>
  126. <el-table-column label="复查结果" prop="examineResult" width="100" show-overflow-tooltip>
  127. <template slot-scope="scope">
  128. <span>{{scope.row.examineResult==1?'复查完毕':(scope.row.examineResult==0?'退回整改':'')}}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="操作" width="100" show-overflow-tooltip >
  132. <template slot-scope="scope">
  133. <div class="table-button-box">
  134. <p class="table-button-null"></p>
  135. <p class="table-button-p"
  136. @click="tableButton(2,scope.row)"
  137. >详情</p>
  138. <p class="table-button-null"></p>
  139. </div>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. <pagination :page-sizes="[20, 30, 40, 50]"
  144. v-show="total>0"
  145. :total="total"
  146. :page.sync="queryParams.page"
  147. :limit.sync="queryParams.pageSize"
  148. @pagination="getList"
  149. />
  150. </div>
  151. </div>
  152. </div>
  153. <initiateInspect v-if="pageType == 2" :initiateInspectData="initiateInspectData"></initiateInspect>
  154. </div>
  155. </template>
  156. <script>
  157. import {
  158. getDeptDropList,
  159. } from '@/api/commonality/permission'
  160. import {
  161. securityCheckDetailsCheckList
  162. } from "@/api/safetyCheck/index";
  163. import initiateInspect from "@/views/safetyCheck/components/initiateInspect/initiateInspect.vue";
  164. import exportComponent from "@/views/safetyCheck/components/exportComponent/exportComponent.vue";
  165. export default {
  166. name: 'checkItem',
  167. components: {
  168. initiateInspect,
  169. exportComponent,
  170. },
  171. props:{
  172. propsData:{},
  173. },
  174. data(){
  175. return{
  176. //导出配置
  177. exportConfig:{
  178. api:'/security/checkDetails/export ', //导出接口地址
  179. ids:'', //勾选导出,勾选的IDS
  180. fileName:'检查明细信息', //导出文件的命名
  181. screenData:{},
  182. },
  183. //页面状态
  184. pageType:1,
  185. //状态选项卡
  186. checkStatus:null,
  187. //页面遮罩
  188. loading:false,
  189. //下拉列表数据
  190. deptOption:[],
  191. optionList:[{value:1,label:'符合'},{value:0,label:'不符合'}],
  192. //查询条件
  193. queryParams:{
  194. page:1,
  195. pageSize:20,
  196. hazardCheckName:"",
  197. deptId :null,
  198. subName :"",
  199. checkUserName :"",
  200. checkName :"",
  201. checkFlag :null,
  202. columnName :"",
  203. sort :"",
  204. },
  205. //列表数据
  206. dataList:[],
  207. //数据数量
  208. total:0,
  209. //子组件数据
  210. initiateInspectData:{},
  211. }
  212. },
  213. created(){
  214. if(this.propsData.deptId||this.propsData.subId){
  215. this.$set(this,'checkStatus',1);
  216. }
  217. this.getDeptDropList();
  218. },
  219. mounted(){
  220. this.getList();
  221. },
  222. methods:{
  223. //选项卡切换
  224. tableCheck(type){
  225. if (this.checkStatus !== type){
  226. this.$set(this,'checkStatus',type);
  227. this.resetQuery();
  228. }
  229. },
  230. // 返回按钮
  231. backPage(){
  232. this.$parent.tableButton(6);
  233. },
  234. //查询按钮
  235. handleQuery(){
  236. this.$set(this.queryParams,'page',1);
  237. this.getList();
  238. },
  239. //重置按钮
  240. resetQuery(){
  241. this.$refs['table-box'].clearSelection();
  242. this.$set(this.exportConfig,'ids','');
  243. this.$set(this,'queryParams',{
  244. page:1,
  245. pageSize:20,
  246. hazardCheckName:"",
  247. deptId :null,
  248. subName :"",
  249. checkUserName :"",
  250. checkName :"",
  251. checkFlag :null,
  252. columnName :"",
  253. sort :"",
  254. });
  255. this.getList();
  256. },
  257. getRowKeys(row) {
  258. return row.setOptionId
  259. },
  260. // 多选框选中数据
  261. handleSelectionChange(selection) {
  262. this.$set(this.exportConfig,'ids',selection.map(item => item.setOptionId));
  263. },
  264. //时间排序方法
  265. sortChange(val){
  266. this.$set(this.queryParams,'columnName',val.prop);
  267. this.$set(this.queryParams,'sort',val.order=='ascending'?'asc':(val.order=='descending'?'desc':''));
  268. this.handleQuery();
  269. },
  270. //获取数据列表
  271. getList(){
  272. this.$set(this,'loading',true);
  273. let obj = JSON.parse(JSON.stringify(this.queryParams))
  274. if(this.propsData.planId){
  275. obj.planId = this.propsData.planId
  276. this.$set(this.exportConfig,'customKey','planId');
  277. this.$set(this.exportConfig,'customValue',obj.planId);
  278. }else if(this.propsData.deptId){
  279. obj.deptId = this.propsData.deptId
  280. obj.planId = this.propsData.deptPlanId
  281. this.$set(this.exportConfig,'customKey','deptId');
  282. this.$set(this.exportConfig,'customValue',obj.deptId);
  283. }else if(this.propsData.subId){
  284. obj.subId = this.propsData.subId
  285. obj.planId = this.propsData.subPlanId
  286. this.$set(this.exportConfig,'customKey','subId');
  287. this.$set(this.exportConfig,'customValue',obj.subId);
  288. }
  289. obj.checkStatus = this.checkStatus
  290. this.$set(this.exportConfig,'screenData',obj);
  291. securityCheckDetailsCheckList(obj).then(response => {
  292. this.$set(this,'loading',false);
  293. this.$set(this,'dataList',response.data.records);
  294. this.$set(this,'total',response.data.total);
  295. });
  296. },
  297. //操作按钮
  298. tableButton(type,row){
  299. let self = this;
  300. if(type == 2){
  301. //详情
  302. this.$set(this,'pageType',2);
  303. let obj = JSON.parse(JSON.stringify(row))
  304. obj.planId = this.propsData.planId;
  305. obj.showType = true;
  306. obj.orderTitle = '检查详情';
  307. obj.orderType = '2';
  308. this.$set(this,'initiateInspectData',obj);
  309. }else if(type == 6){
  310. //返回并刷新
  311. this.$set(this,'pageType',1);
  312. this.getList();
  313. }
  314. },
  315. //学院列表
  316. getDeptDropList() {
  317. getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
  318. this.$set(this, 'deptOption', response.data)
  319. })
  320. },
  321. },
  322. }
  323. </script>
  324. <style scoped lang="scss">
  325. .checkItem{
  326. .content-box{
  327. flex:1;
  328. display: flex;
  329. flex-direction: column;
  330. overflow: hidden;
  331. .table-school-college-toggle-box{
  332. overflow: hidden;
  333. display: inline-block;
  334. margin-right:10px;
  335. p{
  336. display: inline-block;
  337. text-align: center;
  338. width:80px;
  339. line-height:40px;
  340. height:40px;
  341. color:#333;
  342. background-color: #fff;
  343. border:1px solid #E0E0E0;
  344. font-size:14px;
  345. cursor: pointer;
  346. }
  347. p:nth-child(1){
  348. border-top-left-radius: 4px;
  349. border-bottom-left-radius: 4px;
  350. /*border-right:none;*/
  351. }
  352. p:nth-child(4){
  353. border-top-right-radius: 4px;
  354. border-bottom-right-radius: 4px;
  355. /*border-left:none;*/
  356. }
  357. .p-check{
  358. border:1px solid #0183FA;
  359. background-color: #0183FA;
  360. color:#fff;
  361. }
  362. }
  363. .form-button-max-big-box-me{
  364. display: inline-block;
  365. overflow: hidden;
  366. margin-right:10px;
  367. .form-button-big-box-me{
  368. display: flex;
  369. div{
  370. position: relative;
  371. height:40px;
  372. width:100px;
  373. line-height: 40px;
  374. text-align: center;
  375. color:#999;
  376. font-size:14px;
  377. border:1px solid #999;
  378. border-radius:4px;
  379. font-weight:500;
  380. cursor: pointer;
  381. .icon-p-me{
  382. width:15px;
  383. height:15px;
  384. line-height:15px;
  385. text-align: center;
  386. position: absolute;
  387. right:0;
  388. bottom:0;
  389. color:#fff;
  390. background: #0183fa;
  391. border-top-left-radius:4px;
  392. }
  393. }
  394. .checkDiv-me{
  395. color:#0183FA!important;
  396. border:1px solid #0183FA!important;
  397. }
  398. }
  399. }
  400. }
  401. }
  402. .num-data-box{
  403. background: rgba(1,131,250,0.2);
  404. color:#0183FA;
  405. font-size:14px;
  406. line-height:40px;
  407. padding:0 20px;
  408. border-radius:4px;
  409. margin:0px 20px 20px 20px;
  410. width: 330px;
  411. }
  412. </style>