index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <!-- 学院自查 -->
  2. <template>
  3. <div class="app-container selfInspectionProject">
  4. <div class="page-container selfInspectionProjectPage" v-if="pageType === 1">
  5. <div class="page-form-title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm"
  7. :inline="true" style="width:100%;">
  8. <div class="table-school-college-toggle-box">
  9. <p :class="planStatus===''?'p-check':''" @click="tableCheck('')">全部</p>
  10. <p :class="planStatus===0?'p-check':''" @click="tableCheck(0)">未开始</p>
  11. <p :class="planStatus===1?'p-check':''" @click="tableCheck(1)">进行中</p>
  12. <p :class="planStatus===2?'p-check':''" @click="tableCheck(2)">已结束</p>
  13. </div>
  14. <el-form-item label="" prop="checkTypeValue">
  15. <el-select v-model="queryParams.checkTypeValue" placeholder="检查类型" style="width: 150px">
  16. <el-option
  17. v-for="dict in optionList"
  18. :key="dict.value"
  19. :label="dict.label"
  20. :value="dict.value"
  21. />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="" prop="searchValue">
  25. <el-input
  26. maxLength="30"
  27. v-model="queryParams.searchValue"
  28. placeholder="计划标题"
  29. style="width: 200px"
  30. />
  31. </el-form-item>
  32. <el-form-item label="" prop="createName">
  33. <el-input
  34. maxLength="30"
  35. v-model="queryParams.createName"
  36. placeholder="创建人"
  37. style="width: 150px"
  38. />
  39. </el-form-item>
  40. <el-form-item label="" prop="state">
  41. <el-date-picker
  42. :clearable="false"
  43. v-model="dateRange"
  44. size="small"
  45. style="width: 240px"
  46. value-format="yyyy-MM-dd"
  47. type="daterange"
  48. range-separator="-"
  49. start-placeholder="开始日期"
  50. end-placeholder="结束日期"
  51. ></el-date-picker>
  52. </el-form-item>
  53. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  54. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  55. <p class="page-submit-common-style-button"
  56. style="float: right;"
  57. @click="tableButton(1)"
  58. v-if="adminIdentity == 'college'"
  59. v-hasPermiRouter="['security:checkPlan_1:add']"
  60. >创建计划</p>
  61. </el-form>
  62. </div>
  63. <div class="page-content-box">
  64. <el-table class="table-box" v-loading="loading" border :data="dataList">
  65. <el-table-column label="序号" type="index" width="60"/>
  66. <el-table-column label="计划标题" prop="planTitle" show-overflow-tooltip/>
  67. <el-table-column label="检查类型" prop="checkTypeName" width="100" show-overflow-tooltip/>
  68. <el-table-column label="计划周期" prop="cycleStartTime" width="250" show-overflow-tooltip>
  69. <template slot-scope="scope">
  70. <span>{{ parseTime(scope.row.cycleStartTime,"{y}-{m}-{d}") }}</span>
  71. <span>{{ parseTime(scope.row.cycleEndTime,"{y}-{m}-{d}") }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="检查进度" prop="checkProgress" width="175" show-overflow-tooltip>
  75. <template slot-scope="scope">
  76. <el-progress :percentage="scope.row.checkProgress"></el-progress>
  77. </template>
  78. </el-table-column>
  79. <!--<el-table-column label="整改进度" prop="content" width="175" show-overflow-tooltip>-->
  80. <!--<template slot-scope="scope">-->
  81. <!--<el-progress :percentage="50"></el-progress>-->
  82. <!--</template>-->
  83. <!--</el-table-column>-->
  84. <el-table-column label="状态" prop="state" width="100" show-overflow-tooltip>
  85. <template slot-scope="scope">
  86. {{scope.row.planStatus==0?'未开始':(scope.row.planStatus==1?'进行中':(scope.row.planStatus==2?'已结束':''))}}
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="创建人" prop="createName" width="100" show-overflow-tooltip/>
  90. <el-table-column label="创建时间" prop="createTime" width="160" show-overflow-tooltip>
  91. <template slot-scope="scope">
  92. <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="操作" width="220" show-overflow-tooltip >
  96. <template slot-scope="scope">
  97. <div class="table-button-box">
  98. <p class="table-button-null"></p>
  99. <p class="table-button-p"
  100. v-if="scope.row.planStatus!=0"
  101. @click="tableButton(2,scope.row)"
  102. >详情</p>
  103. <p class="table-button-p"
  104. v-if="scope.row.planStatus==0&&adminIdentity=='college'"
  105. @click="tableButton(3,scope.row)"
  106. v-hasPermiRouter="['security:checkPlan_1:edit']"
  107. >编辑</p>
  108. <p class="table-button-p"
  109. @click="tableButton(5,scope.row)"
  110. >检查明细</p>
  111. <p class="table-button-p"
  112. v-if="scope.row.planStatus==0&&adminIdentity=='college'"
  113. @click="tableButton(4,scope.row)"
  114. v-hasPermiRouter="['security:checkPlan_1:del']"
  115. >删除</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.page"
  125. :limit.sync="queryParams.pageSize"
  126. @pagination="getList"
  127. />
  128. </div>
  129. </div>
  130. <projectAddPage :propsData="propsData" v-if="pageType === 2"></projectAddPage>
  131. <inspect-statistics :propsData="propsData" v-if="pageType === 5"></inspect-statistics>
  132. </div>
  133. </template>
  134. <script>
  135. import {
  136. securityCheckPlanList,
  137. securityCheckPlanDelete,
  138. } from '@/api/safetyCheck/indexDemoOne'
  139. import projectAddPage from "@/views/safetyCheck/components/projectAddPage.vue";
  140. import inspectStatistics from "@/views/safetyCheck/components/inspectStatistics.vue";
  141. export default {
  142. name: 'index',
  143. components: {
  144. projectAddPage,
  145. inspectStatistics,
  146. },
  147. data () {
  148. return {
  149. tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
  150. adminIdentity: localStorage.getItem('adminIdentity'),
  151. //页面状态
  152. pageType:1,
  153. //计划状态选项卡
  154. planStatus:'',
  155. //页面遮罩
  156. loading:false,
  157. //下拉列表数据
  158. optionList:[],
  159. //查询条件
  160. queryParams:{
  161. page:1,
  162. pageSize:20,
  163. checkCategory:2,
  164. checkTypeValue:"",
  165. searchValue :"",
  166. createName :"",
  167. },
  168. //时间数据
  169. dateRange:[],
  170. //列表数据
  171. dataList:[],
  172. //数据数量
  173. total:0,
  174. //组件传参
  175. propsData:{},
  176. }
  177. },
  178. created () {
  179. //检查类型字典
  180. this.getDicts("check_type").then(response => {
  181. this.$set(this,'optionList',response.data);
  182. });
  183. },
  184. mounted () {
  185. this.getList();
  186. },
  187. methods: {
  188. //整改状态选项卡切换
  189. tableCheck(type){
  190. if (this.planStatus !== type){
  191. this.$set(this,'planStatus',type);
  192. this.resetQuery();
  193. }
  194. },
  195. //查询按钮
  196. handleQuery(){
  197. this.$set(this.queryParams,'page',1);
  198. this.getList();
  199. },
  200. //重置按钮
  201. resetQuery(){
  202. this.$set(this,'dateRange',[])
  203. this.$set(this,'queryParams',{
  204. page:1,
  205. pageSize:20,
  206. checkCategory:2,
  207. checkTypeValue:"",
  208. searchValue :"",
  209. createName :"",
  210. });
  211. this.getList();
  212. },
  213. //获取数据列表
  214. getList(){
  215. this.$set(this,'loading',true);
  216. let obj = JSON.parse(JSON.stringify(this.queryParams))
  217. if(this.dateRange[0]){
  218. obj.startTime = this.dateRange[0]+'T00:00:00'
  219. obj.endTime = this.dateRange[1]+'T23:59:59'
  220. }else{
  221. obj.startTime = "";
  222. obj.endTime = "";
  223. }
  224. obj.planStatus = this.planStatus;
  225. securityCheckPlanList(obj).then(response => {
  226. this.$set(this,'loading',false);
  227. this.$set(this,'dataList',response.data.records);
  228. this.$set(this,'total',response.data.total);
  229. });
  230. },
  231. //操作按钮
  232. tableButton(type,row){
  233. let self = this;
  234. if(type == 1){
  235. //新增
  236. this.$set(this,'pageType',2);
  237. this.$set(this,'propsData',{
  238. rank:'college'
  239. });
  240. }else if(type == 2){
  241. //详情
  242. this.$set(this,'pageType',2);
  243. let obj = JSON.parse(JSON.stringify(row))
  244. obj.showType = true;
  245. obj.rank = 'college';
  246. this.$set(this,'propsData',obj);
  247. }else if(type == 3){
  248. //编辑
  249. this.$set(this,'pageType',2);
  250. let obj = JSON.parse(JSON.stringify(row))
  251. obj.rank = 'college';
  252. this.$set(this,'propsData',obj);
  253. }else if(type == 4){
  254. //删除
  255. this.$confirm('是否确认删除?', "警告", {
  256. confirmButtonText: "确定",
  257. cancelButtonText: "取消",
  258. type: "warning"
  259. }).then(function() {
  260. }).then(() => {
  261. securityCheckPlanDelete({planId:row.planId}).then(response => {
  262. self.msgSuccess(response.message)
  263. self.getList();
  264. });
  265. }).catch(() => {});
  266. }else if(type == 5){
  267. //检查明细
  268. this.$set(this,'pageType',5);
  269. let obj = JSON.parse(JSON.stringify(row))
  270. obj.showType = true;
  271. obj.rank = 'college';
  272. this.$set(this,'propsData',obj);
  273. }else if(type == 6){
  274. //返回并刷新
  275. this.$set(this,'pageType',1);
  276. this.getList();
  277. }
  278. },
  279. },
  280. }
  281. </script>
  282. <style scoped lang="scss">
  283. .selfInspectionProject{
  284. .selfInspectionProjectPage{
  285. .table-school-college-toggle-box{
  286. overflow: hidden;
  287. display: inline-block;
  288. margin-right:10px;
  289. p{
  290. display: inline-block;
  291. text-align: center;
  292. width:80px;
  293. line-height:40px;
  294. height:40px;
  295. color:#333;
  296. background-color: #fff;
  297. border:1px solid #E0E0E0;
  298. font-size:14px;
  299. cursor: pointer;
  300. }
  301. p:nth-child(1){
  302. border-top-left-radius: 4px;
  303. border-bottom-left-radius: 4px;
  304. /*border-right:none;*/
  305. }
  306. p:nth-child(4){
  307. border-top-right-radius: 4px;
  308. border-bottom-right-radius: 4px;
  309. /*border-left:none;*/
  310. }
  311. .p-check{
  312. border:1px solid #0183FA;
  313. background-color: #0183FA;
  314. color:#fff;
  315. }
  316. }
  317. }
  318. }
  319. </style>