Commit a783e5ba0b4e621992ed317a9d3db5c350148023
1 parent
1bc2e3aa
修复bug
Showing
2 changed files
with
34 additions
and
19 deletions
trash-ui/src/views/casefile/violationCaseFile/violationCaseTable.vue
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <div class="app-container"> |
| 3 | 3 | <el-form ref="queryForm" :inline="true" label-width="105px"> |
| 4 | 4 | <el-form-item label="所属区域" prop="owningRegion"> |
| 5 | - <el-select v-model="owningRegion" placeholder="请选择违规类型" clearable size="small"> | |
| 5 | + <el-select v-model="owningRegion" placeholder="请选择所属区域" clearable size="small"> | |
| 6 | 6 | <el-option v-for="item in areas" :label="item.name" :value="item.name"/> |
| 7 | 7 | </el-select> |
| 8 | 8 | </el-form-item> |
| ... | ... | @@ -19,10 +19,11 @@ |
| 19 | 19 | <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| 20 | 20 | </el-form-item> |
| 21 | 21 | </el-form> |
| 22 | - <el-table :data="tableData" :span-method="spanMethod" :show-summary="true" :summary-method="getSummaries" v-if="hackReset"> | |
| 22 | + <el-table :data="tableData" :span-method="spanMethod" :show-summary="true" :summary-method="getSummaries" | |
| 23 | + v-if="hackReset"> | |
| 23 | 24 | <el-table-column label="行政范围" header-align="center" align="center"> |
| 24 | 25 | <template slot-scope="scope"> |
| 25 | - {{owningRegion!=""&&owningRegion!=null?owningRegion:"长沙市"}} | |
| 26 | + {{ owningRegion != "" && owningRegion != null ? owningRegion : "长沙市" }} | |
| 26 | 27 | </template> |
| 27 | 28 | </el-table-column> |
| 28 | 29 | <el-table-column property="type" label="案卷类型" header-align="center" align="center"></el-table-column> |
| ... | ... | @@ -38,21 +39,21 @@ |
| 38 | 39 | |
| 39 | 40 | import {caseTable} from "@/api/casefile/violationCaseFile"; |
| 40 | 41 | import {getAreaList} from "@/api/casefile/remoteServer"; |
| 42 | + | |
| 41 | 43 | export default { |
| 42 | 44 | name: "caseTable", |
| 43 | - props: { | |
| 44 | - }, | |
| 45 | + props: {}, | |
| 45 | 46 | data() { |
| 46 | 47 | return { |
| 47 | - tableData:[], | |
| 48 | + tableData: [], | |
| 48 | 49 | owningRegion: "", |
| 49 | 50 | createTime: [], |
| 50 | 51 | areas: [], |
| 51 | - hackReset:false, | |
| 52 | + hackReset: false, | |
| 52 | 53 | } |
| 53 | 54 | }, |
| 54 | 55 | created() { |
| 55 | - caseTable({owningRegion:"",startDate:"",endDate:""}).then(res => { | |
| 56 | + caseTable({owningRegion: "", startDate: "", endDate: ""}).then(res => { | |
| 56 | 57 | this.tableData = res.data; |
| 57 | 58 | this.hackReset = true; |
| 58 | 59 | }); |
| ... | ... | @@ -60,7 +61,7 @@ export default { |
| 60 | 61 | this.areas = res.data; |
| 61 | 62 | }); |
| 62 | 63 | }, |
| 63 | - methods:{ | |
| 64 | + methods: { | |
| 64 | 65 | spanMethod({row, column, rowIndex, columnIndex}) { |
| 65 | 66 | if (columnIndex == 0) { |
| 66 | 67 | if (rowIndex == 0) { |
| ... | ... | @@ -78,8 +79,8 @@ export default { |
| 78 | 79 | let allRepCount = 0; |
| 79 | 80 | for (let i in data) { |
| 80 | 81 | |
| 81 | - allCount += Number(data[i].count==null?0:data[i].count); | |
| 82 | - allRepCount += Number(data[i].repCount==null?0:data[i].repCount); | |
| 82 | + allCount += Number(data[i].count == null ? 0 : data[i].count); | |
| 83 | + allRepCount += Number(data[i].repCount == null ? 0 : data[i].repCount); | |
| 83 | 84 | |
| 84 | 85 | } |
| 85 | 86 | |
| ... | ... | @@ -97,9 +98,9 @@ export default { |
| 97 | 98 | } |
| 98 | 99 | |
| 99 | 100 | if (index == 4) { |
| 100 | - if(allCount==0||allRepCount==0){ | |
| 101 | + if (allCount == 0 || allRepCount == 0) { | |
| 101 | 102 | sums[4] = "0" + "%"; |
| 102 | - }else{ | |
| 103 | + } else { | |
| 103 | 104 | sums[4] = ((allRepCount / allCount) * 100).toFixed(2) + "%"; |
| 104 | 105 | } |
| 105 | 106 | } |
| ... | ... | @@ -107,15 +108,22 @@ export default { |
| 107 | 108 | |
| 108 | 109 | return sums; |
| 109 | 110 | }, |
| 110 | - handleQuery(){ | |
| 111 | - console.log(this.createTime); | |
| 112 | - caseTable({owningRegion:this.owningRegion,startDate:this.createTime[0],endDate:this.createTime[1]}).then(res => { | |
| 111 | + handleQuery() { | |
| 112 | + let startDate = this.formatDate(this.createTime[0]); | |
| 113 | + let endDate = this.formatDate(this.createTime[1]); | |
| 114 | + caseTable({owningRegion: this.owningRegion, startDate: startDate, endDate: endDate}).then(res => { | |
| 113 | 115 | this.tableData = res.data; |
| 114 | 116 | this.hackReset = false; |
| 115 | 117 | this.$nextTick(() => { |
| 116 | 118 | this.hackReset = true |
| 117 | 119 | }) |
| 118 | 120 | }); |
| 121 | + }, | |
| 122 | + formatDate(date) { | |
| 123 | + const year = date.getFullYear(); | |
| 124 | + const month = String(date.getMonth() + 1).padStart(2, '0'); | |
| 125 | + const day = String(date.getDate()).padStart(2, '0'); | |
| 126 | + return `${year}-${month}-${day}`; | |
| 119 | 127 | } |
| 120 | 128 | |
| 121 | 129 | } | ... | ... |
trash-ui/src/views/casefile/violationWarningInformation/violationWarningInformationTable.vue
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <div class="app-container"> |
| 3 | 3 | <el-form ref="queryForm" :inline="true" label-width="105px"> |
| 4 | 4 | <el-form-item label="所属区域" prop="owningRegion"> |
| 5 | - <el-select v-model="owningRegion" placeholder="请选择违规类型" clearable size="small"> | |
| 5 | + <el-select v-model="owningRegion" placeholder="请选择所属区域" clearable size="small"> | |
| 6 | 6 | <el-option v-for="item in areas" :label="item.name" :value="item.name"/> |
| 7 | 7 | </el-select> |
| 8 | 8 | </el-form-item> |
| ... | ... | @@ -108,14 +108,21 @@ export default { |
| 108 | 108 | return sums; |
| 109 | 109 | }, |
| 110 | 110 | handleQuery(){ |
| 111 | - console.log(this.createTime); | |
| 112 | - caseTable({owningRegion:this.owningRegion,startDate:this.createTime[0],endDate:this.createTime[1]}).then(res => { | |
| 111 | + let startDate = this.formatDate(this.createTime[0]); | |
| 112 | + let endDate = this.formatDate(this.createTime[1]); | |
| 113 | + caseTable({owningRegion:this.owningRegion,startDate:startDate,endDate:endDate}).then(res => { | |
| 113 | 114 | this.tableData = res.data; |
| 114 | 115 | this.hackReset = false; |
| 115 | 116 | this.$nextTick(() => { |
| 116 | 117 | this.hackReset = true |
| 117 | 118 | }) |
| 118 | 119 | }); |
| 120 | + }, | |
| 121 | + formatDate(date) { | |
| 122 | + const year = date.getFullYear(); | |
| 123 | + const month = String(date.getMonth() + 1).padStart(2, '0'); | |
| 124 | + const day = String(date.getDate()).padStart(2, '0'); | |
| 125 | + return `${year}-${month}-${day}`; | |
| 119 | 126 | } |
| 120 | 127 | |
| 121 | 128 | } | ... | ... |