Commit 2727482ba50cc0e2e0d5a51ed4d18c3da1a74ed2
1 parent
1deb3207
1.维修上报功能添加提示确认信息
Showing
6 changed files
with
125 additions
and
27 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -134,7 +134,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 134 | 134 | * @throws |
| 135 | 135 | */ |
| 136 | 136 | @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST) |
| 137 | - public Map<String, Object> realOutAdjust(Map<String, String> map) { | |
| 137 | + public Map<String, Object> realOutAdjust(@RequestParam Map<String, String> map) { | |
| 138 | 138 | return scheduleRealInfoService.realOutAdjust(map); |
| 139 | 139 | } |
| 140 | 140 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -238,6 +238,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 238 | 238 | report2repair.put("9103", "9103"); |
| 239 | 239 | report2repair.put("9104", "9104"); |
| 240 | 240 | report2repair.put("9109", "9109"); |
| 241 | + report2repair.put("9201", "9201"); | |
| 242 | + report2repair.put("9202", "9202"); | |
| 243 | + report2repair.put("9203", "9203"); | |
| 244 | + report2repair.put("9204", "9204"); | |
| 245 | + report2repair.put("9209", "9209"); | |
| 246 | + report2repair.put("9301", "9301"); | |
| 247 | + report2repair.put("9302", "9302"); | |
| 248 | + report2repair.put("9303", "9303"); | |
| 249 | + report2repair.put("9304", "9304"); | |
| 250 | + report2repair.put("9305", "9305"); | |
| 251 | + report2repair.put("9306", "9306"); | |
| 252 | + report2repair.put("9309", "9309"); | |
| 241 | 253 | } |
| 242 | 254 | |
| 243 | 255 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
| ... | ... | @@ -182,8 +182,7 @@ |
| 182 | 182 | (function() { |
| 183 | 183 | var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; |
| 184 | 184 | var reportTypes = [{name:"无到", code:"9101"}, {name:"无出", code:"9109"}, {name:"掉线", code:"9102"}, {name:"指令故障", code:"9103"}, {name:"车辆漂移", code:"9104"}]; |
| 185 | - var modal = '#schedule-fcxxwt-modal' | |
| 186 | - ,sch; | |
| 185 | + var modal = '#schedule-fcxxwt-modal', sch, isReport = false; | |
| 187 | 186 | $(modal).on('init', function(e, data) { |
| 188 | 187 | e.stopPropagation(); |
| 189 | 188 | sch=data.sch; |
| ... | ... | @@ -216,6 +215,7 @@ |
| 216 | 215 | for (var j = 0;j < reportTypes.length;j++) { |
| 217 | 216 | if (items[i] == reportTypes[j].name) { |
| 218 | 217 | $('input:checkbox[value=' + reportTypes[j].code + ']').prop('checked', true); |
| 218 | + isReport = true; | |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | } |
| ... | ... | @@ -226,7 +226,7 @@ |
| 226 | 226 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 227 | 227 | f.on('success.form.fv', function(e) { |
| 228 | 228 | e.preventDefault(); |
| 229 | - var data = $(this).serializeJSON(); | |
| 229 | + var data = $(this).serializeJSON(), reportText = new Array(); | |
| 230 | 230 | |
| 231 | 231 | //校验实发实达时间 |
| 232 | 232 | if(!validation_s_e_Time(data)){ |
| ... | ... | @@ -239,11 +239,40 @@ |
| 239 | 239 | //修改里程 |
| 240 | 240 | var editJhlc = data.jhlc != sch.jhlc && data.jhlc != 0; |
| 241 | 241 | // 修改报修类型为字符串 |
| 242 | - if (data.reportTypes) data.reportTypes = data.reportTypes.join(";"); | |
| 243 | 242 | if(!data.adjustExps && (data.status==-1 || normalDestory || editJhlc)){ |
| 244 | 243 | notify_err("当前操作需要选择调整原因!"); |
| 245 | 244 | return; |
| 246 | 245 | } |
| 246 | + if (data.reportTypes) { | |
| 247 | + for (var i = 0;i < data.reportTypes.length;i++) { | |
| 248 | + for (var j = 0;j < reportTypes.length;j++) { | |
| 249 | + if (data.reportTypes[i] == reportTypes[j].code) { | |
| 250 | + reportText.push(reportTypes[j].name); | |
| 251 | + break; | |
| 252 | + } | |
| 253 | + } | |
| 254 | + } | |
| 255 | + if (!isReport) { | |
| 256 | + layer.confirm('确定上报类型[' + reportText.join(';') + ']?', { | |
| 257 | + btn : [ '确定', '取消' ], | |
| 258 | + icon : 3, | |
| 259 | + skin : 'layui-layer-cfm-add' | |
| 260 | + }, function() { | |
| 261 | + layer.closeAll(); | |
| 262 | + // 修改报修类型为字符串 | |
| 263 | + data.reportTypes = data.reportTypes.join(";"); | |
| 264 | + postData(data); | |
| 265 | + }, function() { | |
| 266 | + $('.uk-button-primary').attr('disabled', false); | |
| 267 | + }); | |
| 268 | + return; | |
| 269 | + } | |
| 270 | + | |
| 271 | + data.reportTypes = data.reportTypes.join(";"); | |
| 272 | + postData(data); | |
| 273 | + return; | |
| 274 | + } | |
| 275 | + | |
| 247 | 276 | postData(data); |
| 248 | 277 | }); |
| 249 | 278 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | <div class="uk-form-row"> |
| 15 | 15 | <label class="uk-form-label" >车辆</label> |
| 16 | 16 | <div class="uk-form-controls"> |
| 17 | - <input type="text" value="{{sch.clZbh}}" disabled> | |
| 17 | + <input type="text" name="clZbh" value="{{sch.clZbh}}" readonly> | |
| 18 | 18 | </div> |
| 19 | 19 | </div> |
| 20 | 20 | </div> |
| ... | ... | @@ -83,24 +83,65 @@ |
| 83 | 83 | |
| 84 | 84 | <script> |
| 85 | 85 | (function() { |
| 86 | - var modal = '#schedule-sftz-modal', | |
| 87 | - sch; | |
| 86 | + var modal = '#schedule-sftz-modal', sch, isReport = false; | |
| 88 | 87 | var reportTypes = [{name:"无到", code:"9101"}, {name:"无出", code:"9109"}, {name:"掉线", code:"9102"}, {name:"指令故障", code:"9103"}, {name:"车辆漂移", code:"9104"}]; |
| 89 | 88 | $(modal).on('init', function(e, data) { |
| 90 | 89 | e.stopPropagation(); |
| 91 | 90 | sch = data.sch; |
| 91 | + debugger; | |
| 92 | 92 | var formHtml = template('schedule-sftz-form-temp', {sch: sch, reportTypes:reportTypes}); |
| 93 | 93 | $('form', modal).html(formHtml); |
| 94 | + $('input:checkbox').click(function(){ | |
| 95 | + var remark = $('[name=remarks]').val(), title = $(this).prop("title"); | |
| 96 | + if ($(this).prop('checked')) { | |
| 97 | + if (remark.indexOf(title) > -1) return; | |
| 98 | + $('[name=remarks]').val((remark ? remark + ";" : "") + title); | |
| 99 | + } else { | |
| 100 | + $('[name=remarks]').val(remark.replace(";" + title, "").replace(title + ";", "").replace(title, "")); | |
| 101 | + } | |
| 102 | + }); | |
| 94 | 103 | |
| 95 | 104 | //submit |
| 96 | 105 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 97 | 106 | f.on('success.form.fv', function(e) { |
| 98 | 107 | e.preventDefault(); |
| 99 | - var data = $(this).serializeJSON(); | |
| 108 | + var data = $(this).serializeJSON(), reportText = new Array(); | |
| 100 | 109 | |
| 101 | - // 修改报修类型为字符串 | |
| 102 | - if (data.reportTypes) data.reportTypes = data.reportTypes.join(";"); | |
| 103 | - gb_common.$post('/realSchedule/realOutAdjust', data, function(rs) { | |
| 110 | + if (data.reportTypes) { | |
| 111 | + for (var i = 0;i < data.reportTypes.length;i++) { | |
| 112 | + for (var j = 0;j < reportTypes.length;j++) { | |
| 113 | + if (data.reportTypes[i] == reportTypes[j].code) { | |
| 114 | + reportText.push(reportTypes[j].name); | |
| 115 | + break; | |
| 116 | + } | |
| 117 | + } | |
| 118 | + } | |
| 119 | + if (!isReport) { | |
| 120 | + layer.confirm('确定上报类型[' + reportText.join(';') + ']?', { | |
| 121 | + btn : [ '确定', '取消' ], | |
| 122 | + icon : 3, | |
| 123 | + skin : 'layui-layer-cfm-add' | |
| 124 | + }, function() { | |
| 125 | + layer.closeAll(); | |
| 126 | + // 修改报修类型为字符串 | |
| 127 | + data.reportTypes = data.reportTypes.join(";"); | |
| 128 | + postData(data); | |
| 129 | + }, function() { | |
| 130 | + $('.uk-button-primary').attr('disabled', false); | |
| 131 | + }); | |
| 132 | + return; | |
| 133 | + } | |
| 134 | + | |
| 135 | + data.reportTypes = data.reportTypes.join(";"); | |
| 136 | + postData(data); | |
| 137 | + return; | |
| 138 | + } | |
| 139 | + | |
| 140 | + postData(data); | |
| 141 | + }); | |
| 142 | + | |
| 143 | + var postData = function (data) { | |
| 144 | + gb_common.$post('/realSchedule/realOutAdjust', data, function(rs) { | |
| 104 | 145 | if (rs.ts) { |
| 105 | 146 | //更新前端数据 |
| 106 | 147 | gb_schedule_table.updateSchedule(rs.ts); |
| ... | ... | @@ -111,7 +152,7 @@ |
| 111 | 152 | gb_schedule_table.calc_yfwf_num(sch.xlBm); |
| 112 | 153 | } |
| 113 | 154 | }); |
| 114 | - }); | |
| 155 | + } | |
| 115 | 156 | |
| 116 | 157 | // 维修类型选中 |
| 117 | 158 | var initReport = function() { | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/wxsb.html
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <div class="uk-form-row"> |
| 23 | 23 | <label class="uk-form-label" >故障类型</label> |
| 24 | 24 | <div class="uk-form-controls"> |
| 25 | - <select name="repairTypes"></select> | |
| 25 | + <select name="reportTypes"></select> | |
| 26 | 26 | </div> |
| 27 | 27 | </div> |
| 28 | 28 | </div> |
| ... | ... | @@ -35,8 +35,7 @@ |
| 35 | 35 | |
| 36 | 36 | <script> |
| 37 | 37 | (function() { |
| 38 | - var modal = '#schedule-wxsb-modal' | |
| 39 | - ,sch; | |
| 38 | + var modal = '#schedule-wxsb-modal', sch; | |
| 40 | 39 | |
| 41 | 40 | $(modal).on('init', function(e, data) { |
| 42 | 41 | e.stopPropagation(); |
| ... | ... | @@ -46,23 +45,40 @@ |
| 46 | 45 | |
| 47 | 46 | //报修类型字典 |
| 48 | 47 | var opts = new Array(); |
| 49 | - var repairTypes=[{name:"录像不连续", code:"9201"}, {name:"无录像", code:"9202"}, {name:"录像缺通告", code:"9203"}, {name:"无法调取录像", code:"9204"}, {name:"其它录像报修", code:"9209"}, {name:"黑屏", code:"9301"}, {name:"间歇性黑屏", code:"9302"}, {name:"中门视屏无", code:"9303"}, {name:"卡在启动界面", code:"9304"}, {name:"倒车视频无", code:"9305"}, {name:"启动后显示倒车", code:"9306"}, {name:"其它屏幕报修", code:"9309"}]; | |
| 50 | - for(var i = 0;i < repairTypes.length;i++){ | |
| 51 | - opts.push('<option value="'+repairTypes[i].code+'">'+repairTypes[i].name+'</option>'); | |
| 48 | + var reportTypes = [{name:"录像不连续", code:"9201"}, {name:"无录像", code:"9202"}, {name:"录像缺通告", code:"9203"}, {name:"无法调取录像", code:"9204"}, {name:"其它录像报修", code:"9209"}, {name:"黑屏", code:"9301"}, {name:"间歇性黑屏", code:"9302"}, {name:"中门视屏无", code:"9303"}, {name:"卡在启动界面", code:"9304"}, {name:"倒车视频无", code:"9305"}, {name:"启动后显示倒车", code:"9306"}, {name:"其它屏幕报修", code:"9309"}]; | |
| 49 | + for(var i = 0;i < reportTypes.length;i++){ | |
| 50 | + opts.push('<option value="'+reportTypes[i].code+'">'+reportTypes[i].name+'</option>'); | |
| 52 | 51 | } |
| 53 | - $('[name=repairTypes]', modal).html(opts.join("")); | |
| 52 | + $('[name=reportTypes]', modal).html(opts.join("")); | |
| 54 | 53 | |
| 55 | 54 | //submit |
| 56 | 55 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 57 | 56 | f.on('success.form.fv', function(e) { |
| 58 | 57 | e.preventDefault(); |
| 59 | 58 | $('[type=submit]', f).attr('disabled', 'disabled'); |
| 60 | - var data = $(this).serializeJSON(); | |
| 61 | - gb_common.$post('/realSchedule/wxsb', data, function(rs){ | |
| 62 | - //更新班次信息 | |
| 63 | - notify_succ('操作成功!'); | |
| 64 | - UIkit.modal(modal).hide(); | |
| 65 | - }); | |
| 59 | + var data = $(this).serializeJSON(), reportText = new Array(); | |
| 60 | + | |
| 61 | + for (var j = 0;j < reportTypes.length;j++) { | |
| 62 | + if (data.reportTypes == reportTypes[j].code) { | |
| 63 | + reportText.push(reportTypes[j].name); | |
| 64 | + break; | |
| 65 | + } | |
| 66 | + } | |
| 67 | + | |
| 68 | + layer.confirm('确定上报类型[' + reportText.join(';') + ']?', { | |
| 69 | + btn : [ '确定', '取消' ], | |
| 70 | + icon : 3, | |
| 71 | + skin : 'layui-layer-cfm-add' | |
| 72 | + }, function() { | |
| 73 | + layer.closeAll(); | |
| 74 | + gb_common.$post('/realSchedule/wxsb', data, function(rs){ | |
| 75 | + //更新班次信息 | |
| 76 | + notify_succ('操作成功!'); | |
| 77 | + UIkit.modal(modal).hide(); | |
| 78 | + }); | |
| 79 | + }, function() { | |
| 80 | + $('.uk-button-primary').attr('disabled', false); | |
| 81 | + }); | |
| 66 | 82 | }); |
| 67 | 83 | }); |
| 68 | 84 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js