JSP页面开发规范案例
添加
1 <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 2 3 <!-- window-add --> 4 <div id="window-add" style="display:none;"> 5 <form id="formAdd" method="post"> 6 <ul class="masPubFareAdd"> 7 <li class="fareAgent1"> 8 <span>佣金规则描述</span> 9 <span class="fareDesc"><input class="sams-input" id="winadd-fareDesc" name="fareDesc"/></span> 10 </li> 11 <li class="fareAgent2"> 12 <span>代理人号</span> 13 <span class="fareDesc1"><input class="sams-input" id="winadd-agentNos" name="agentNos"/></span> 14 </li> 15 <li class="fareAgent1"> 16 <span>旅客类型</span> 17 <span class="fareDesc"> 18 <input type="checkbox" name="pgnTypes" value="A">成人 19 <input type="checkbox" name="pgnTypes" value="C">儿童 20 <input type="checkbox" name="pgnTypes" value="B">婴儿 21 </span> 22 </li> 23 <li class="fareAgent2"> 24 <span>是否含燃油附加税</span> 25 <span class="fuelSurchargeIsable"> 26 <input id="winadd-fuelSurchargeIsable1" name="fuelSurchargeIsable" type="radio" value="Y">是 27 <input id="winadd-fuelSurchargeIsable2" name="fuelSurchargeIsable" type="radio" value="N" checked="checked">否 28 </span> 29 </li> 30 <li class="issue" style="margin-right:5px;"> 31 <fieldset> 32 <legend>出票地</legend> 33 <ul> 34 <li><span class="textLabelSpan">大区</span><input id="winadd-issuePointArea" name="issuePointArea"/></li> 35 <li><span class="textLabelSpan">国家</span><input id="winadd-issuePointCountrys" name="issuePointCountrys"/></li> 36 </ul> 37 </fieldset> 38 </li> 39 <li class="issue"> 40 <fieldset> 41 <legend>出票日期</legend> 42 <ul> 43 <li><span class="textLabelSpanDate">起始日期</span><input id="winadd-issueStartDateS" name="issueStartDateS" class="easyui-datebox" ></li> 44 <li><span class="textLabelSpanDate">截止日期</span><input id="winadd-issueEndDateS" name="issueEndDateS" class="easyui-datebox" ></li> 45 </ul> 46 </fieldset> 47 </li> 48 </ul> 49 50 <ul class="masPubFareAdd"> 51 <li> 52 <fieldset> 53 <legend>纯中国境内段</legend> 54 <ul> 55 <li><span class="title">本航承运</span> 56 <input id="winadd-benCarrD01" name="benCarrD0" type="radio" value="Y" checked="checked">全部舱位 57 <input id="winadd-benCarrD02" name="benCarrD0" type="radio" value="N">主舱位 58 </li> 59 <li id="liBenCarrD0"> 60 <span>全部舱位 </span> 61 <select id="benCarrD0Select"> 62 <option value="p">佣金率</option> 63 <option value="v">佣金</option> 64 </select> 65 <span id="benCarrDRateSpan0" class="rateAmt"> 66 <input class="amt" type="text" id="winadd-benCarrRateD0" name="benCarrRateD0"/> % 67 </span> 68 <span id="benCarrDAmtSpan0" class="rateAmt"> 69 货币代号 70 <input class="sams-airport sams-input" type="text" id="winadd-benCarrD0TypeAirport" name="benCarrD0TypeAirport"/> 71 <input class="amt" type="text" id="winadd-benCarrAmtD0" name="benCarrAmtD0"/> 72 </span> 73 </li> 74 <li id="liBenCarrD12"> 75 <span>头等舱 </span> 76 <select id="benCarrD1Select"> 77 <option value="p">佣金率</option> 78 <option value="v">佣金</option> 79 </select> 80 <span id="benCarrDRateSpan1" class="rateAmt"> 81 <input class="amt" type="text" id="winadd-benCarrRateD1" name="benCarrRateD1"/> % 82 </span> 83 <span id="benCarrDAmtSpan1" class="rateAmt"> 84 货币代号 85 <input class="sams-airport sams-input" type="text" id="winadd-benCarrD1TypeAirport" name="benCarrD1TypeAirport"/> 86 <input class="amt" type="text" id="winadd-benCarrAmtD1" name="benCarrAmtD1"/> 87 </span> 88 89 <span>公务舱</span> 90 <select id="benCarrD2Select"> 91 <option value="p">佣金率</option> 92 <option value="v">佣金</option> 93 </select> 94 <span id="benCarrDRateSpan2" class="rateAmt"> 95 <input class="amt" type="text" id="winadd-benCarrRateD2" name="benCarrRateD2"/> % 96 </span> 97 <span id="benCarrDAmtSpan2" class="rateAmt"> 98 货币代号 99 <input class="sams-airport sams-input" type="text" id="winadd-benCarrD2TypeAirport" name="benCarrD2TypeAirport"/> 100 <input class="amt" type="text" id="winadd-benCarrAmtD2" name="benCarrAmtD2"/> 101 </span> 102 </li> 103 <li id="liBenCarrD34"> 104 <span>高端经济舱</span> 105 <select id="benCarrD3Select"> 106 <option value="p">佣金率</option> 107 <option value="v">佣金</option> 108 </select> 109 <span id="benCarrDRateSpan3" class="rateAmt"> 110 <input class="amt" type="text" id="winadd-benCarrRateD3" name="benCarrRateD3"/> % 111 </span> 112 <span id="benCarrDAmtSpan3" class="rateAmt"> 113 货币代号 114 <input class="sams-airport sams-input" type="text" id="winadd-benCarrD3TypeAirport" name="benCarrD3TypeAirport"/> 115 <input class="amt" type="text" id="winadd-benCarrAmtD3" name="benCarrAmtD3"/> 116 </span> 117 118 <span>经济舱</span> 119 <select id="benCarrD4Select"> 120 <option value="p">佣金率</option> 121 <option value="v">佣金</option> 122 </select> 123 <span id="benCarrDRateSpan4" class="rateAmt"> 124 <input class="amt" type="text" id="winadd-benCarrRateD4" name="benCarrRateD4"/> % 125 </span> 126 <span id="benCarrDAmtSpan4" class="rateAmt"> 127 货币代号 128 <input class="sams-airport sams-input" type="text" id="winadd-benCarrD4TypeAirport" name="benCarrD4TypeAirport"/> 129 <input class="amt" type="text" id="winadd-benCarrAmtD4" name="benCarrAmtD4"/> 130 </span> 131 </li> 132 133 134 <li><span class="title">联运 </span> 135 <input id="winadd-lianCarrD01" name="lianCarrD0" type="radio" value="Y" checked="checked">全部舱位 136 <input id="winadd-lianCarrD02" name="lianCarrD0" type="radio" value="N">主舱位 137 </li> 138 <li id="liLianCarrD0"> 139 <span>全部舱位 </span> 140 <select id="lianCarrD0Select"> 141 <option value="p">佣金率</option> 142 <option value="v">佣金</option> 143 </select> 144 <span id="lianCarrDRateSpan0" class="rateAmt"> 145 <input class="amt" type="text" id="winadd-lianCarrRateD0" name="lianCarrRateD0"/> % 146 </span> 147 <span id="lianCarrDAmtSpan0" class="rateAmt"> 148 货币代号 149 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrD0TypeAirport" name="lianCarrD0TypeAirport"/> 150 <input class="amt" type="text" id="winadd-lianCarrAmtD0" name="lianCarrAmtD0"/> 151 </span> 152 </li> 153 <li id="liLianCarrD12"> 154 <span>头等舱 </span> 155 <select id="lianCarrD1Select"> 156 <option value="p">佣金率</option> 157 <option value="v">佣金</option> 158 </select> 159 <span id="lianCarrDRateSpan1" class="rateAmt"> 160 <input class="amt" type="text" id="winadd-lianCarrRateD1" name="lianCarrRateD1"/> % 161 </span> 162 <span id="lianCarrDAmtSpan1" class="rateAmt"> 163 货币代号 164 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrD1TypeAirport" name="lianCarrD1TypeAirport"/> 165 <input class="amt" type="text" id="winadd-lianCarrAmtD1" name="lianCarrAmtD1"/> 166 </span> 167 168 <span>公务舱</span> 169 <select id="lianCarrD2Select"> 170 <option value="p">佣金率</option> 171 <option value="v">佣金</option> 172 </select> 173 <span id="lianCarrDRateSpan2" class="rateAmt"> 174 <input class="amt" type="text" id="winadd-lianCarrRateD2" name="lianCarrRateD2"/> % 175 </span> 176 <span id="lianCarrDAmtSpan2" class="rateAmt"> 177 货币代号 178 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrD2TypeAirport" name="lianCarrD2TypeAirport"/> 179 <input class="amt" type="text" id="winadd-lianCarrAmtD2" name="lianCarrAmtD2"/> 180 </span> 181 </li> 182 <li id="liLianCarrD34"> 183 <span>高端经济舱</span> 184 <select id="lianCarrD3Select"> 185 <option value="p">佣金率</option> 186 <option value="v">佣金</option> 187 </select> 188 <span id="lianCarrDRateSpan3" class="rateAmt"> 189 <input class="amt" type="text" id="winadd-lianCarrRateD3" name="lianCarrRateD3"/> % 190 </span> 191 <span id="lianCarrDAmtSpan3" class="rateAmt"> 192 货币代号 193 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrD3TypeAirport" name="lianCarrD3TypeAirport"/> 194 <input class="amt" type="text" id="winadd-lianCarrAmtD3" name="lianCarrAmtD3"/> 195 </span> 196 197 <span>经济舱</span> 198 <select id="lianCarrD4Select"> 199 <option value="p">佣金率</option> 200 <option value="v">佣金</option> 201 </select> 202 <span id="lianCarrDRateSpan4" class="rateAmt"> 203 <input class="amt" type="text" id="winadd-lianCarrRateD4" name="lianCarrRateD4"/> % 204 </span> 205 <span id="lianCarrDAmtSpan4" class="rateAmt"> 206 货币代号 207 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrD4TypeAirport" name="lianCarrD4TypeAirport"/> 208 <input class="amt" type="text" id="winadd-lianCarrAmtD4" name="lianCarrAmtD4"/> 209 </span> 210 </li> 211 212 <li><span class="title">外航承运</span></li><li> 213 <span>全部舱位 </span> 214 <select id="waiCarrD0Select"> 215 <option value="p">佣金率</option> 216 <option value="v">佣金</option> 217 </select> 218 <span id="waiCarrDRateSpan0" class="rateAmt"> 219 <input class="amt" type="text" id="winadd-waiCarrRateD0" name="waiCarrRateD0"/> % 220 </span> 221 <span id="waiCarrDAmtSpan0" class="rateAmt"> 222 货币代号 223 <input class="sams-airport sams-input" type="text" id="winadd-waiCarrD0TypeAirport" name="waiCarrD0TypeAirport"/> 224 <input class="amt" type="text" id="winadd-waiCarrAmtD0" name="waiCarrAmtD0"/> 225 </span> 226 </li> 227 </ul> 228 </fieldset> 229 </li> 230 <li id="iareaAddLi"> 231 <fieldset> 232 <legend>国际及地区</legend> 233 <ul> 234 <li><span class="title">本航承运</span> 235 <span>始发地</span><input class="sams-fromCountry" id="winaddBenCarrFromIS" name="benCarrFromIS"/> 236 <input id="winadd-benCarrI01" name="benCarrI0" type="radio" value="Y" checked="checked">全部舱位 237 <input id="winadd-benCarrI02" name="benCarrI0" type="radio" value="N">主舱位 238 </li> 239 <li id="liBenCarrI0"> 240 <span>全部舱位 </span> 241 <select id="benCarrI0Select"> 242 <option value="p">佣金率</option> 243 <option value="v">佣金</option> 244 </select> 245 <span id="benCarrIRateSpan0" class="rateAmt"> 246 <input class="amt" type="text" id="winadd-benCarrRateI0" name="benCarrRateI0"/> % 247 </span> 248 <span id="benCarrIAmtSpan0" class="rateAmt"> 249 货币代号 250 <input class="sams-airport sams-input" type="text" id="winadd-benCarrI0TypeAirport" name="benCarrI0TypeAirport"/> 251 <input class="amt" type="text" id="winadd-benCarrAmtI0" name="benCarrAmtI0"/> 252 </span> 253 </li> 254 <li id="liBenCarrI12"> 255 <span>头等舱 </span> 256 <select id="benCarrI1Select"> 257 <option value="p">佣金率</option> 258 <option value="v">佣金</option> 259 </select> 260 <span id="benCarrIRateSpan1" class="rateAmt"> 261 <input class="amt" type="text" id="winadd-benCarrRateI1" name="benCarrRateI1"/> % 262 </span> 263 <span id="benCarrIAmtSpan1" class="rateAmt"> 264 货币代号 265 <input class="sams-airport sams-input" type="text" id="winadd-benCarrI1TypeAirport" name="benCarrI1TypeAirport"/> 266 <input class="amt" type="text" id="winadd-benCarrAmtI1" name="benCarrAmtI1"/> 267 </span> 268 269 <span>公务舱</span> 270 <select id="benCarrI2Select"> 271 <option value="p">佣金率</option> 272 <option value="v">佣金</option> 273 </select> 274 <span id="benCarrIRateSpan2" class="rateAmt"> 275 <input class="amt" type="text" id="winadd-benCarrRateI2" name="benCarrRateI2"/> % 276 </span> 277 <span id="benCarrIAmtSpan2" class="rateAmt"> 278 货币代号 279 <input class="sams-airport sams-input" type="text" id="winadd-benCarrI2TypeAirport" name="benCarrI2TypeAirport"/> 280 <input class="amt" type="text" id="winadd-benCarrAmtI2" name="benCarrAmtI2"/> 281 </span> 282 </li> 283 <li id="liBenCarrI34"> 284 <span>高端经济舱</span> 285 <select id="benCarrI3Select"> 286 <option value="p">佣金率</option> 287 <option value="v">佣金</option> 288 </select> 289 <span id="benCarrIRateSpan3" class="rateAmt"> 290 <input class="amt" type="text" id="winadd-benCarrRateI3" name="benCarrRateI3"/> % 291 </span> 292 <span id="benCarrIAmtSpan3" class="rateAmt"> 293 货币代号 294 <input class="sams-airport sams-input" type="text" id="winadd-benCarrI3TypeAirport" name="benCarrI3TypeAirport"/> 295 <input class="amt" type="text" id="winadd-benCarrAmtI3" name="benCarrAmtI3"/> 296 </span> 297 298 <span>经济舱</span> 299 <select id="benCarrI4Select"> 300 <option value="p">佣金率</option> 301 <option value="v">佣金</option> 302 </select> 303 <span id="benCarrIRateSpan4" class="rateAmt"> 304 <input class="amt" type="text" id="winadd-benCarrRateI4" name="benCarrRateI4"/> % 305 </span> 306 <span id="benCarrIAmtSpan4" class="rateAmt"> 307 货币代号 308 <input class="sams-airport sams-input" type="text" id="winadd-benCarrI4TypeAirport" name="benCarrI4TypeAirport"/> 309 <input class="amt" type="text" id="winadd-benCarrAmtI4" name="benCarrAmtI4"/> 310 </span> 311 </li> 312 313 <li><span class="title">联运 </span> 314 <span>始发地</span><input class="sams-fromCountry" id="winaddLianCarrFromIS" name="lianCarrFromIS"/> 315 316 <input id="winadd-lianCarrI01" name="lianCarrI0" type="radio" value="Y" checked="checked">全部舱位 317 <input id="winadd-lianCarrI02" name="lianCarrI0" type="radio" value="N">主舱位 318 </li> 319 <li id="liLianCarrI0"> 320 <span>全部舱位 </span> 321 <select id="lianCarrI0Select"> 322 <option value="p">佣金率</option> 323 <option value="v">佣金</option> 324 </select> 325 <span id="lianCarrIRateSpan0" class="rateAmt"> 326 <input class="amt" type="text" id="winadd-lianCarrRateI0" name="lianCarrRateI0"/> % 327 </span> 328 <span id="lianCarrIAmtSpan0" class="rateAmt"> 329 货币代号 330 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrI0TypeAirport" name="lianCarrI0TypeAirport"/> 331 <input class="amt" type="text" id="winadd-lianCarrAmtI0" name="lianCarrAmtI0"/> 332 </span> 333 </li> 334 <li id="liLianCarrI12"> 335 <span>头等舱 </span> 336 <select id="lianCarrI1Select"> 337 <option value="p">佣金率</option> 338 <option value="v">佣金</option> 339 </select> 340 <span id="lianCarrIRateSpan1" class="rateAmt"> 341 <input class="amt" type="text" id="winadd-lianCarrRateI1" name="lianCarrRateI1"/> % 342 </span> 343 <span id="lianCarrIAmtSpan1" class="rateAmt"> 344 货币代号 345 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrI1TypeAirport" name="lianCarrI1TypeAirport"/> 346 <input class="amt" type="text" id="winadd-lianCarrAmtI1" name="lianCarrAmtI1"/> 347 </span> 348 349 <span>公务舱</span> 350 <select id="lianCarrI2Select"> 351 <option value="p">佣金率</option> 352 <option value="v">佣金</option> 353 </select> 354 <span id="lianCarrIRateSpan2" class="rateAmt"> 355 <input class="amt" type="text" id="winadd-lianCarrRateI2" name="lianCarrRateI2"/> % 356 </span> 357 <span id="lianCarrIAmtSpan2" class="rateAmt"> 358 货币代号 359 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrI2TypeAirport" name="lianCarrI2TypeAirport"/> 360 <input class="amt" type="text" id="winadd-lianCarrAmtI2" name="lianCarrAmtI2"/> 361 </span> 362 </li> 363 <li id="liLianCarrI34"> 364 <span>高端经济舱</span> 365 <select id="lianCarrI3Select"> 366 <option value="p">佣金率</option> 367 <option value="v">佣金</option> 368 </select> 369 <span id="lianCarrIRateSpan3" class="rateAmt"> 370 <input class="amt" type="text" id="winadd-lianCarrRateI3" name="lianCarrRateI3"/> % 371 </span> 372 <span id="lianCarrIAmtSpan3" class="rateAmt"> 373 货币代号 374 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrI3TypeAirport" name="lianCarrI3TypeAirport"/> 375 <input class="amt" type="text" id="winadd-lianCarrAmtI3" name="lianCarrAmtI3"/> 376 </span> 377 378 <span>经济舱</span> 379 <select id="lianCarrI4Select"> 380 <option value="p">佣金率</option> 381 <option value="v">佣金</option> 382 </select> 383 <span id="lianCarrIRateSpan4" class="rateAmt"> 384 <input class="amt" type="text" id="winadd-lianCarrRateI4" name="lianCarrRateI4"/> % 385 </span> 386 <span id="lianCarrIAmtSpan4" class="rateAmt"> 387 货币代号 388 <input class="sams-airport sams-input" type="text" id="winadd-lianCarrI4TypeAirport" name="lianCarrI4TypeAirport"/> 389 <input class="amt" type="text" id="winadd-lianCarrAmtI4" name="lianCarrAmtI4"/> 390 </span> 391 </li> 392 393 <li><span class="title">外航承运</span></li><li> 394 <span>全部舱位 </span> 395 <select id="waiCarrI0Select"> 396 <option value="p">佣金率</option> 397 <option value="v">佣金</option> 398 </select> 399 <span id="waiCarrIRateSpan0" class="rateAmt"> 400 <input class="amt" type="text" id="winadd-waiCarrRateI0" name="waiCarrRateI0"/> % 401 </span> 402 <span id="waiCarrIAmtSpan0" class="rateAmt"> 403 货币代号 404 <input class="sams-airport sams-input" type="text" id="winadd-waiCarrI0TypeAirport" name="waiCarrI0TypeAirport"/> 405 <input class="amt" type="text" id="winadd-waiCarrAmtI0" name="waiCarrAmtI0"/> 406 </span> 407 </li> 408 </ul> 409 </fieldset> 410 </li> 411 <!-- <li> 412 <fieldset> 413 <legend>旅客类型</legend> 414 <ul> 415 <li><span class="title">儿童</span> 416 <input id="winadd-pgnChildQD1" name="pgnChildQD" type="radio" value="Y">同成人 417 <input id="winadd-pgnChildQD2" name="pgnChildQD" type="radio" value="N" checked="checked">不同成人 418 <select id="pgnChildQDSelect"> 419 <option value="p">佣金率</option> 420 <option value="v">佣金</option> 421 </select> 422 <span id="pgnChildQDRateSpan" class="rateAmt"> 423 <input class="amt" id="winadd-pgnChildNQRateD" name="pgnChildNQRateD"/> % 424 </span> 425 <span id="pgnChildQDAmtSpan" class="rateAmt"> 426 货币代号 427 <input class="sams-airport sams-input" type="text" id="winadd-pgnChildNTypeQDAirport" name="pgnChildNTypeQDAirport"/> 428 <input class="amt" type="text" id="winadd-pgnChildNQAmtD" name="pgnChildNQAmtD"/> 429 </span> 430 </li> 431 <li><span class="title">婴儿</span> 432 <input id="winadd-pgnBabyQD1" name="pgnBabyQD" type="radio" value="Y">同成人 433 <input id="winadd-pgnBabyQD2" name="pgnBabyQD" type="radio" value="N" checked="checked">不同成人 434 <select id="pgnBabyQDSelect"> 435 <option value="p">佣金率</option> 436 <option value="v">佣金</option> 437 </select> 438 <span id="pgnBabyQDRateSpan" class="rateAmt"> 439 <input class="amt" type="text" id="winadd-pgnBabyNQRateD" name="pgnBabyNQRateD"/> % 440 </span> 441 <span id="pgnBabyQDAmtSpan" class="rateAmt"> 442 货币代号 443 <input class="sams-airport sams-input" type="text" id="winadd-pgnBabyNTypeQDAirport" name="pgnBabyNTypeQDAirport"/> 444 <input class="amt" type="text" id="winadd-pgnBabyNQAmtD" name="pgnBabyNQAmtD"/> 445 </span> 446 </li> 447 </ul> 448 </fieldset> 449 </li> --> 450 451 </ul> 452 453 <div class="lastLi"> 454 <a id="btnAddSave"><fmt:message key="button_ok"/></a> 455 <a id="btnAddCancel"><fmt:message key="button_cancel"/></a> 456 </div> 457 </form> 458 </div> 459
js:
1 $('#btnAddSave').linkbutton({ 2 width: 80, 3 onClick: function(){ 4 var addParam = getALLInputValuesFromForm('formAdd'); 5 addParam.fuelSurchargeIsable = fuelSurchargeIsableVlaue; 6 addParam.diInd = diInd; 7 // addParam.issuePointCountrys = addParam.replace('1,', ''); 8 if ($('#formAdd').form('validate')) { // 标签是否验证通过 9 var pgnTypes = []; 10 $windowAdd.find('input[name=pgnTypes]').each(function() { 11 if ($(this).prop('checked')) { 12 pgnTypes.push($(this).val()); 13 } 14 }); 15 var pgnTypesTmp = ''; 16 if (pgnTypes.length > 0){ 17 for (var p = 0; p < pgnTypes.length; p++ ) { 18 if (p === 0){ 19 pgnTypesTmp = pgnTypes[p]; 20 } else { 21 pgnTypesTmp += ','+pgnTypes[p]; 22 } 23 } 24 } 25 addParam.pgnTypes = pgnTypesTmp; 26 27 var startD = $('#winadd-issueStartDateS').datebox('getValue'); 28 var endD = $('#winadd-issueEndDateS').datebox('getValue'); 29 var agentNo = addParam.agentNos; 30 var area = addParam.issuePointArea; 31 var areaName = $('#winadd-issuePointArea').combotree('getText'); 32 addParam.issuePointAreaName = areaName; 33 var country = addParam.issuePointCountrys; 34 addParam.issuePointCountryNames = countryName; 35 addParam.fromCountryNames = $('#winadd-issuePointCountrys').combotree('getText'); 36 37 if (addParam.benCarrFromIS === '' && addParam.lianCarrFromIS === '') { 38 benFromCByMainFile = ''; 39 } 40 if (startD === null || startD === '' || endD === null || endD === '') { 41 $.samsMessager.showAlert('出票起始和截止日期为必输项,不能为空!'); 42 return false; 43 } 44 // else if (agentNo === null || agentNo === '') { 45 // $.samsMessager.showAlert('代理人号为必输项,不能为空!'); 46 // return false; 47 // } 48 else if (area === null || area === '' || country === null || country === '') { 49 $.samsMessager.showAlert('大区和国家为必输项,不能为空!'); 50 return false; 51 } else { 52 if (agentNo === null || agentNo === ''){ 53 agentNoByMainFile = ''; 54 55 addParam.agentNos = 'ALL'; 56 if (benFromCByMainFile === '' && agentNoByMainFile === '') { 57 $.ajax({ 58 url: '../../comm/masPubFare/saveDate', 59 data: addParam, 60 type: 'post', 61 dataType: 'json', 62 success: function(r) { 63 if (r) { 64 if (r.flag) { 65 $.samsMessager.showMessage('添加成功!'); 66 clearMasPubFareInputsAdd('formAdd'); 67 $windowAdd.window('close'); 68 $dg.datagrid('load', queryParam).datagrid('clearSelections'); 69 70 } 71 else { 72 $.samsMessager.showAlert(r.message); 73 } 74 } 75 else { 76 $.samsMessager.showAlert(message_error); 77 clearMasPubFareInputsAdd('formAdd'); 78 } 79 } 80 }); 81 } else if (benFromCByMainFile !== '') { 82 $.samsMessager.showAlert('始发地校验不通过!'); 83 return false; 84 } else if (agentNoByMainFile !== '') { 85 $.samsMessager.showAlert('代理人号校验不通过!'); 86 return false; 87 } 88 89 return true; 90 } 91 else{ 92 $.ajax({ 93 url : './checkAgentNo', 94 data: {'agentNos': agentNo}, 95 type : 'post', 96 dataType : 'json', 97 success : function(r) { 98 if (r) { 99 if (r.flag) { 100 agentNoByMainFile = ''; 101 102 if (benFromCByMainFile === '' && agentNoByMainFile === '') { 103 $.ajax({ 104 url: '../../comm/masPubFare/saveDate', 105 data: addParam, 106 type: 'post', 107 dataType: 'json', 108 success: function(r) { 109 if (r) { 110 if (r.flag) { 111 $.samsMessager.showMessage('添加成功!'); 112 clearMasPubFareInputsAdd('formAdd'); 113 $windowAdd.window('close'); 114 $dg.datagrid('load', queryParam).datagrid('clearSelections'); 115 116 } 117 else { 118 $.samsMessager.showAlert(r.message); 119 } 120 } 121 else { 122 $.samsMessager.showAlert(message_error); 123 clearMasPubFareInputsAdd('formAdd'); 124 } 125 } 126 }); 127 } else if (benFromCByMainFile !== '') { 128 $.samsMessager.showAlert('始发地校验不通过!'); 129 return false; 130 } else if (agentNoByMainFile !== '') { 131 $.samsMessager.showAlert('代理人号校验不通过!'); 132 return false; 133 } 134 135 return true; 136 } 137 else { 138 agentNoByMainFile = r.message; 139 $.samsMessager.showAlert(r.message); 140 $(this).focus().select(); 141 return false; 142 } 143 } 144 else { 145 agentNoByMainFile = '代理人号校验出错!'; 146 $.samsMessager.showAlert('代理人号校验出错!'); 147 $(this).focus(); 148 return false; 149 } 150 } 151 }); 152 } 153 } 154 } 155 } 156 });
后台 添加修改,根据id判断是添加还是修改
@RequestMapping(value = "/saveDate") @ResponseBody public Map<String, Object> saveDate(MasPubFareVO voEnt,ServletRequest request) throws Exception{ Map<String, Object> jsonMap = new HashMap<String, Object>(); boolean flag = false; //获取当前时间 Date nowDate=new Date(); //查重:出票地一致、出票日期范围重叠,提示“与系统中现有记录重复,请修改现有记录截止日期” if(null != voEnt && voEnt.getId()!=null && !"".equals(voEnt.getId())){ //id不为空,修改 List<MasPubFare> doubleIssueList = checkIssueCountrys(voEnt); if(null != doubleIssueList && doubleIssueList.size()>0){ jsonMap.put("flag", flag); jsonMap.put("message", "与系统中现有记录重复"); }else{ if(StringUtils.isNotBlank(voEnt.getIssuePointCountrys())){ voEnt.setIssuePointCountrys(voEnt.getIssuePointCountrys().replace("1,", "")); } MasPubFare masPubFare = changeEntityFromVO(voEnt,nowDate,"update"); flag = masPubFareService.saveEntity(masPubFare); if(flag){ jsonMap.put("flag", flag); jsonMap.put("message", "修改成功"); }else{ jsonMap.put("flag", flag); jsonMap.put("message", "修改失败"); } } }else{ //id为空,添加 //TC是否为空 //查重 判断出票地和出票日期是否有重复 List<MasPubFare> doubleIssueList = checkIssueCountrys(voEnt); if(null != doubleIssueList && doubleIssueList.size()>0){ jsonMap.put("flag", flag); jsonMap.put("message", "与系统中现有记录重复"); }else{ //不重复 MasPubFare masPubFare = changeEntityFromVO(voEnt,nowDate,"add"); flag = masPubFareService.saveEntity(masPubFare); if(flag){ jsonMap.put("flag", flag); jsonMap.put("message", "添加成功"); }else{ jsonMap.put("flag", flag); jsonMap.put("message", "添加失败"); } } } return jsonMap; }
前台jsp