index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <!--自查任务-->
  2. <template>
  3. <div class="app-container selfInspectionTask">
  4. <div class="selfInspectionTask-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: 200px"
  34. />
  35. </el-form-item>
  36. <el-form-item label="检查周期" prop="dateRange" style="margin-left:10px;" label-width="70px">
  37. <el-date-picker
  38. :clearable="false"
  39. v-model="dateRange"
  40. size="small"
  41. style="width: 240px"
  42. value-format="yyyy-MM-dd"
  43. type="daterange"
  44. range-separator="-"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期"
  47. ></el-date-picker>
  48. </el-form-item>
  49. <el-form-item>
  50. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  51. <p class="reset-button-one" @click="resetQuery">重置</p>
  52. </el-form-item>
  53. <el-form-item style="float: right;">
  54. <el-col :span="1.5">
  55. <p class="inquire-button-one"
  56. style="width:130px;"
  57. @click="addDialogOpen(1)"
  58. ><i class="el-icon-plus"></i> 创建自查任务</p>
  59. </el-col>
  60. </el-form-item>
  61. </el-form>
  62. </div>
  63. <div class="content-box">
  64. <el-table border :data="tableList" ref="multipleTable" @sort-change="sortChange">
  65. <el-table-column label="序号" align="center" type="index" width="60" />
  66. <el-table-column label="计划标题" align="center" prop="deptName" show-overflow-tooltip/>
  67. <el-table-column label="检查范围" align="center" prop="deptName" show-overflow-tooltip width="120"/>
  68. <el-table-column label="检查周期" align="center" prop="deptName" show-overflow-tooltip width="280"/>
  69. <el-table-column label="检查状态" align="center" prop="deptName" show-overflow-tooltip width="130"/>
  70. <el-table-column label="检查进度" align="center" prop="deptName" show-overflow-tooltip width="220"/>
  71. <el-table-column label="创建人" align="center" prop="deptName" show-overflow-tooltip width="130"/>
  72. <el-table-column label="创建时间" sortable align="center" prop="deptName" show-overflow-tooltip width="157"/>
  73. <el-table-column label="操作" align="center" prop="deptName" width="200">
  74. <template slot-scope="scope">
  75. <div class="table-button-box">
  76. <p class="table-button-p" @click="addDialogOpen(2,scope.row)">编辑</p>
  77. <p class="table-button-p">删除</p>
  78. <p class="table-button-p" @click="addDialogOpen(3,scope.row)">详情</p>
  79. <p class="table-button-p" @click="goPage(2,scope.row)">自查管理</p>
  80. <!--<p class="table-button-p">查看附件</p>-->
  81. </div>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. <pagination :page-sizes="[20, 30, 40, 50]"
  86. v-show="total>0"
  87. :total="total"
  88. :page.sync="queryParams.pageNum"
  89. :limit.sync="queryParams.pageSize"
  90. @pagination="getList"
  91. />
  92. </div>
  93. </div>
  94. <add-dialog ref="addDialog"></add-dialog>
  95. <list-page v-if="pageType == 2"></list-page>
  96. </div>
  97. </template>
  98. <script>
  99. import addDialog from './addDialog.vue'
  100. import listPage from './listPage.vue'
  101. export default {
  102. name: 'index',
  103. components: {
  104. addDialog,
  105. listPage
  106. },
  107. data(){
  108. return{
  109. pageType:1,
  110. queryParams:{
  111. pageNum:1,
  112. pageSize:20,
  113. buttonType:1,
  114. timeType:0,
  115. searchValue:"",
  116. data1:""
  117. },
  118. dateRange:[],
  119. tableList:[{}],
  120. total:0,
  121. }
  122. },
  123. created(){
  124. },
  125. mounted(){
  126. },
  127. methods:{
  128. goPage(type){
  129. if(this.pageType != type){
  130. this.$set(this,'pageType',type);
  131. }
  132. },
  133. //弹窗开启
  134. addDialogOpen(type,data){
  135. if(type==1){
  136. this.$refs.addDialog.addDialogOpen(type);
  137. }else if(type==2){
  138. this.$refs.addDialog.addDialogOpen(type,data);
  139. }else{
  140. this.$refs.addDialog.addDialogOpen(type,data);
  141. }
  142. },
  143. //范围选择
  144. topLeftClickType(type){
  145. if(this.queryParams.buttonType != type){
  146. this.$set(this.queryParams,'buttonType',type);
  147. this.getList();
  148. }
  149. },
  150. //时间排序方法
  151. sortChange(val){
  152. //ascending 上 descending 下 null 无
  153. console.log('val',val.order)
  154. this.$set(this.queryParams,'timeType',val.order=='ascending'?1:(val.order=='descending'?2:''));
  155. },
  156. //获取数据列表
  157. getList(){
  158. // this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
  159. // this.queryParamsData.type = 'RFID_RECOGNIZER';
  160. // listHardware(this.queryParamsData).then(response => {
  161. // this.total = response.total;
  162. // this.tableList = response.rows;
  163. // });
  164. },
  165. /** 搜索按钮操作 */
  166. handleQuery() {
  167. this.$set(this.queryParams,'pageNum',1);
  168. this.getList();
  169. },
  170. /** 重置按钮操作 */
  171. resetQuery() {
  172. this.$set(this,'dateRange',[]);
  173. this.$set(this,'queryParams',{
  174. pageNum:1,
  175. pageSize:20,
  176. buttonType:1,
  177. timeType:0,
  178. searchValue:"",
  179. data1:""
  180. });
  181. this.handleQuery();
  182. },
  183. }
  184. }
  185. </script>
  186. <style scoped lang="scss">
  187. .selfInspectionTask{
  188. flex: 1;
  189. display: flex !important;
  190. flex-direction: column;
  191. overflow: hidden;
  192. .selfInspectionTask-page{
  193. flex: 1;
  194. display: flex !important;
  195. flex-direction: column;
  196. overflow: hidden;
  197. .title-box{
  198. padding-top:20px;
  199. border-bottom:1px solid #dedede;
  200. .form-button-max-big-box{
  201. display: inline-block;
  202. .form-button-big-box{
  203. display: flex;
  204. div{
  205. position: relative;
  206. height:40px;
  207. width:80px;
  208. line-height: 40px;
  209. text-align: center;
  210. color:#999;
  211. font-size:14px;
  212. border:1px solid #999;
  213. border-radius:4px;
  214. margin-left:10px;
  215. font-weight:500;
  216. cursor: pointer;
  217. .icon-p{
  218. width:15px;
  219. height:15px;
  220. line-height:15px;
  221. text-align: center;
  222. position: absolute;
  223. right:0;
  224. bottom:0;
  225. color:#fff;
  226. background: #0183fa;
  227. border-top-left-radius:4px;
  228. }
  229. }
  230. .checkDiv{
  231. color:#0183FA;
  232. border:1px solid #0183FA;
  233. }
  234. }
  235. }
  236. }
  237. .content-box{
  238. flex: 1;
  239. display: flex;
  240. flex-direction: column;
  241. padding:20px;
  242. overflow: hidden;
  243. }
  244. }
  245. }
  246. </style>