Commit 4d94e096f5c89af2fd2d3729c3ea3f06f0dc93ba
1 parent
a6bc5e30
车辆长宽高必填,gps创表修复
Showing
2 changed files
with
26 additions
and
10 deletions
trash-common/src/main/java/com/trash/common/utils/DateUtils.java
| @@ -184,18 +184,28 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils | @@ -184,18 +184,28 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils | ||
| 184 | return false; | 184 | return false; |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | + /** | ||
| 188 | + * 获取下个月的年月yyyyMM | ||
| 189 | + * @param date 日期 | ||
| 190 | + * @return 结果 | ||
| 191 | + */ | ||
| 187 | public static String getNextMonth(Date date) { | 192 | public static String getNextMonth(Date date) { |
| 188 | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM"); | 193 | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM"); |
| 189 | String format = sdf.format(date); | 194 | String format = sdf.format(date); |
| 190 | - String year = format.substring(0,4); | ||
| 191 | - String month = format.substring(4,6); | 195 | + String year = format.substring(0, 4); |
| 196 | + String month = format.substring(4, 6); | ||
| 192 | int i = Integer.parseInt(month); | 197 | int i = Integer.parseInt(month); |
| 193 | - if(i==12){ | ||
| 194 | - year = String.valueOf(Integer.parseInt(year)+1); | ||
| 195 | - month = "01"; | ||
| 196 | - }else{ | ||
| 197 | - month = String.valueOf(i+1); | 198 | + if (i == 12) { |
| 199 | + i = 1; | ||
| 200 | + year = String.valueOf(Integer.parseInt(year) + 1); | ||
| 201 | + } else { | ||
| 202 | + i++; | ||
| 203 | + } | ||
| 204 | + if (i < 10) { | ||
| 205 | + month = "0" + i; | ||
| 206 | + } else { | ||
| 207 | + month = String.valueOf(i); | ||
| 198 | } | 208 | } |
| 199 | - return year+month; | 209 | + return year + month; |
| 200 | } | 210 | } |
| 201 | } | 211 | } |
trash-ui/src/views/unit/carInfo/info.vue
| @@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
| 100 | 100 | ||
| 101 | </el-col> | 101 | </el-col> |
| 102 | <el-col :span="7"> | 102 | <el-col :span="7"> |
| 103 | - <el-form-item label="箱货体积" prop="containerVolume"> | 103 | + <el-form-item label="箱货体积和长宽高" prop="containerVolume"> |
| 104 | <el-row> | 104 | <el-row> |
| 105 | <el-col :span="5"> | 105 | <el-col :span="5"> |
| 106 | <el-select v-model="volumeOrLWH" placeholder="请选择排放标准" style="width: 100%;"> | 106 | <el-select v-model="volumeOrLWH" placeholder="请选择排放标准" style="width: 100%;"> |
| @@ -668,8 +668,14 @@ export default { | @@ -668,8 +668,14 @@ export default { | ||
| 668 | form.carBehind = null; | 668 | form.carBehind = null; |
| 669 | form.carRight = null; | 669 | form.carRight = null; |
| 670 | 670 | ||
| 671 | - if(this.volumeOrLWH==="长宽高"){ | 671 | + if(form.length!=null&&form.width!=null&&form.height!=null){ |
| 672 | form.lengthWidthHeight = form.length+";"+form.width+";"+form.height; | 672 | form.lengthWidthHeight = form.length+";"+form.width+";"+form.height; |
| 673 | + }else{ | ||
| 674 | + this.$message({ | ||
| 675 | + message: '请填写长宽高!', | ||
| 676 | + type: 'warning' | ||
| 677 | + }); | ||
| 678 | + return; | ||
| 673 | } | 679 | } |
| 674 | this.form.drivers = this.drivers.join(","); | 680 | this.form.drivers = this.drivers.join(","); |
| 675 | this.roadTransport.forEach(item => { | 681 | this.roadTransport.forEach(item => { |