index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <!--自查任务-->
  2. <template>
  3. <div class="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. handleAvatarSuccess(res) {
  185. if(this.dialogUpList.length>9){
  186. this.msgError('已到达上传数量上限')
  187. return
  188. }
  189. let suffixName= this.upDataName.split('.')[this.upDataName.split('.').length - 2]
  190. //判断文件名中是否有逗号和分号
  191. if(suffixName.indexOf(',')==-1 && suffixName.indexOf(';')==-1){
  192. }else{
  193. this.$message.info('文件名里包含逗号或分号,请修改后重新上传!')
  194. return
  195. }
  196. let obj ={
  197. name:this.upDataName,
  198. url:res.data.url,
  199. };
  200. this.dialogUpList.push(obj);
  201. this.$forceUpdate()
  202. },
  203. beforeAvatarUpload(file) {
  204. console.log('file',file)
  205. let type = false;
  206. if (file.type == 'application/pdf' || file.type == 'application/msword' || file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'|| file.type == 'application/vnd.ms-excel' || file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
  207. this.upDataName = file.name;
  208. type = true;
  209. }else{
  210. this.$message.error('只能上传png/jpeg/gif/doc/docx格式');
  211. type = false;
  212. }
  213. return type;
  214. },
  215. }
  216. }
  217. </script>
  218. <style scoped lang="scss">
  219. .selfInspectionTask{
  220. flex: 1;
  221. display: flex !important;
  222. flex-direction: column;
  223. overflow: hidden;
  224. .selfInspectionTask-page{
  225. flex: 1;
  226. display: flex !important;
  227. flex-direction: column;
  228. overflow: hidden;
  229. .title-box{
  230. padding-top:20px;
  231. border-bottom:1px solid #dedede;
  232. .form-button-max-big-box{
  233. display: inline-block;
  234. .form-button-big-box{
  235. display: flex;
  236. div{
  237. position: relative;
  238. height:40px;
  239. width:80px;
  240. line-height: 40px;
  241. text-align: center;
  242. color:#999;
  243. font-size:14px;
  244. border:1px solid #999;
  245. border-radius:4px;
  246. margin-left:10px;
  247. font-weight:500;
  248. cursor: pointer;
  249. .icon-p{
  250. width:15px;
  251. height:15px;
  252. line-height:15px;
  253. text-align: center;
  254. position: absolute;
  255. right:0;
  256. bottom:0;
  257. color:#fff;
  258. background: #0183fa;
  259. border-top-left-radius:4px;
  260. }
  261. }
  262. .checkDiv{
  263. color:#0183FA;
  264. border:1px solid #0183FA;
  265. }
  266. }
  267. }
  268. }
  269. .content-box{
  270. flex: 1;
  271. display: flex;
  272. flex-direction: column;
  273. padding:20px;
  274. overflow: hidden;
  275. }
  276. }
  277. }
  278. </style>