listPage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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.buttonType==1?'checkDiv':''" @click="topLeftClickType(1)">
  10. <p class="text-p">全部</p>
  11. <p class="el-icon-check icon-p" v-if="queryParams.buttonType==1"></p>
  12. </div>
  13. <div :class="queryParams.buttonType==2?'checkDiv':''" @click="topLeftClickType(2)">
  14. <p class="text-p">待检查</p>
  15. <p class="el-icon-check icon-p" v-if="queryParams.buttonType==2"></p>
  16. </div>
  17. <div :class="queryParams.buttonType==3?'checkDiv':''" @click="topLeftClickType(3)">
  18. <p class="text-p">检查中</p>
  19. <p class="el-icon-check icon-p" v-if="queryParams.buttonType==3"></p>
  20. </div>
  21. <div :class="queryParams.buttonType==4?'checkDiv':''" @click="topLeftClickType(4)">
  22. <p class="text-p">已检查</p>
  23. <p class="el-icon-check icon-p" v-if="queryParams.buttonType==4"></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="data1" label-width="50px">
  37. <el-select v-model="queryParams.data1" clearable placeholder="请选择学院" style="width: 150px">
  38. <el-option
  39. v-for="item in optionsOne"
  40. :key="item.key"
  41. :label="item.label"
  42. :value="item.key">
  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="hardwareNum" show-overflow-tooltip width="250"/>
  72. <el-table-column label="实验室" align="center" prop="deptName" show-overflow-tooltip width="220"/>
  73. <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip width="150"/>
  74. <el-table-column label="检查状态" align="center" prop="deptName" show-overflow-tooltip width="90"/>
  75. <el-table-column label="检查者" align="center" prop="deptName" show-overflow-tooltip width="100"/>
  76. <el-table-column label="检查结果" align="center" prop="deptName" show-overflow-tooltip width="80"/>
  77. <el-table-column label="隐患数" align="center" prop="deptName" show-overflow-tooltip width="80"/>
  78. <el-table-column label="整改进度" align="center" prop="deptName" show-overflow-tooltip width="200"/>
  79. <el-table-column label="任务周期" align="center" prop="deptName" show-overflow-tooltip width="270"/>
  80. <el-table-column label="检查时间" sortable align="center" prop="deptName" show-overflow-tooltip width="157"/>
  81. <el-table-column label="操作" align="center" prop="deptName" width="230">
  82. <template slot-scope="scope">
  83. <div class="table-button-box">
  84. <p class="table-button-p" @click="goAddPage(3)">详情</p>
  85. <p class="table-button-p" @click="goAddPage(2)">开始检查</p>
  86. <p class="table-button-p">编辑</p>
  87. <p class="table-button-p" @click="lookDocumentButton(1,scope.row)">整改报告</p>
  88. <p class="table-button-p" @click="lookDocumentListButton(1,scope.row)">查看附件</p>
  89. </div>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <pagination :page-sizes="[20, 30, 40, 50]"
  94. v-show="total>0"
  95. :total="total"
  96. :page.sync="queryParams.pageNum"
  97. :limit.sync="queryParams.pageSize"
  98. @pagination="getList"
  99. />
  100. </div>
  101. </div>
  102. <addPage v-if="pageType==2"></addPage>
  103. <infoPage v-if="pageType==3"></infoPage>
  104. <lookDocumentDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDialog>
  105. <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  106. </div>
  107. </template>
  108. <script>
  109. import addPage from './addPage.vue'
  110. import infoPage from '@/views/safetyCheck/components/infoPage/infoPage.vue'
  111. import lookDocumentDialog from '@/components/lookDocumentDialog/lookDocumentDialog.vue'
  112. import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  113. export default {
  114. name: 'index',
  115. components: {
  116. addPage,
  117. infoPage,
  118. lookDocumentDialog,
  119. lookDocumentListDialog
  120. },
  121. data(){
  122. return{
  123. //子组件数据
  124. lookDocumentType:false,
  125. propsLookDocumentData:{},
  126. lookDocumentListType:false,
  127. propsLookDocumentListData:{},
  128. pageType:1,
  129. queryParams:{
  130. pageNum:1,
  131. pageSize:20,
  132. buttonType:1,
  133. myType:0,
  134. timeType:0,
  135. searchValue:"",
  136. data1:""
  137. },
  138. dateRange:[],
  139. tableList:[{}],
  140. total:0,
  141. optionsOne:[{key:1,label:"校级"},{key:2,label:"院级"}],
  142. optionsTwo:[{key:1,label:"启用"},{key:0,label:"停用"}],
  143. }
  144. },
  145. created(){
  146. },
  147. mounted(){
  148. },
  149. methods:{
  150. //返回按钮
  151. outButton(){
  152. this.$parent.goPage(1);
  153. },
  154. //开始检查
  155. goAddPage(type){
  156. this.$set(this,'pageType',type);
  157. },
  158. //时间排序方法
  159. sortChange(val){
  160. //ascending 上 descending 下 null 无
  161. console.log('val',val.order)
  162. this.$set(this.queryParams,'timeType',val.order=='ascending'?1:(val.order=='descending'?2:''));
  163. },
  164. //范围选择
  165. topLeftClickType(type){
  166. if(this.queryParams.buttonType != type){
  167. this.$set(this.queryParams,'buttonType',type);
  168. this.getList();
  169. }
  170. },
  171. //获取数据列表
  172. getList(){
  173. // this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  174. // this.queryParamsData.type = 'RFID_RECOGNIZER';
  175. // listHardware(this.queryParamsData).then(response => {
  176. // this.total = response.total;
  177. // this.tableList = response.rows;
  178. // });
  179. },
  180. /** 搜索按钮操作 */
  181. handleQuery() {
  182. this.$set(this.queryParams,'pageNum',1);
  183. this.getList();
  184. },
  185. /** 重置按钮操作 */
  186. resetQuery() {
  187. this.$set(this,'dateRange',[]);
  188. this.$set(this,'queryParams',{
  189. pageNum:1,
  190. pageSize:20,
  191. buttonType:1,
  192. timeType:0,
  193. myType:0,
  194. searchValue:"",
  195. data1:""
  196. });
  197. this.handleQuery();
  198. },
  199. //查看单个文档
  200. lookDocumentButton(type,row){
  201. if(type==1){
  202. this.$set(this,'propsLookDocumentData',{
  203. title:"整改报告",
  204. name:row.name,
  205. url:row.url
  206. });
  207. this.$set(this,'lookDocumentType',true);
  208. }else{
  209. this.$set(this,'lookDocumentType',false);
  210. }
  211. },
  212. //查看多个文档
  213. lookDocumentListButton(type,row){
  214. if(type==1){
  215. this.$set(this,'propsLookDocumentListData',{
  216. title:"查看附件",
  217. list:row.list
  218. });
  219. this.$set(this,'lookDocumentListType',true);
  220. }else{
  221. this.$set(this,'lookDocumentListType',false);
  222. }
  223. },
  224. },
  225. }
  226. </script>
  227. <style scoped lang="scss">
  228. .selfInspectionManagement{
  229. flex: 1;
  230. display: flex !important;
  231. flex-direction: column;
  232. overflow: hidden;
  233. .selfInspectionManagement-page{
  234. flex: 1;
  235. display: flex !important;
  236. flex-direction: column;
  237. overflow: hidden;
  238. .title-box{
  239. padding-top:20px;
  240. border-bottom:1px solid #dedede;
  241. .form-button-max-big-box{
  242. display: inline-block;
  243. .form-button-big-box{
  244. display: flex;
  245. div{
  246. position: relative;
  247. height:40px;
  248. width:80px;
  249. line-height: 40px;
  250. text-align: center;
  251. color:#999;
  252. font-size:14px;
  253. border:1px solid #999;
  254. border-radius:4px;
  255. margin-left:10px;
  256. font-weight:500;
  257. cursor: pointer;
  258. .icon-p{
  259. width:15px;
  260. height:15px;
  261. line-height:15px;
  262. text-align: center;
  263. position: absolute;
  264. right:0;
  265. bottom:0;
  266. color:#fff;
  267. background: #0183fa;
  268. border-top-left-radius:4px;
  269. }
  270. }
  271. .checkDiv{
  272. color:#0183FA;
  273. border:1px solid #0183FA;
  274. }
  275. }
  276. }
  277. }
  278. .content-box{
  279. flex: 1;
  280. display: flex;
  281. flex-direction: column;
  282. padding:20px;
  283. overflow: hidden;
  284. }
  285. }
  286. }
  287. </style>