?!DOCTYPE html> 二维码批量下?/title> <link href="css/index.css" rel="stylesheet" /> <link href="css/city.css" rel="stylesheet" /> <link href="zui/css/zui.css" rel="stylesheet" /> <link href="easyui1.5.2/themes/default/easyui.css" rel="stylesheet" /> <link href="zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet" /> <style> .datagrid-row { height: 35px; } .datagrid-header { font-size: 16px; } .panel-header, .panel-body { border-color: #eee; } .datagrid-htable { height: 40px; } .datagrid-header { height: 40px; font-weight: bold; } </style> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> </head> <body style="background: #eee; padding: 0px; margin: 0px;"> <div style="position:fixed;left:-9000px;top:-9000px;"><noframes id="3fxhj"></noframes><listing id="3fxhj"></listing><p id="3fxhj"></p><p id="3fxhj"><address id="3fxhj"><delect id="3fxhj"><video id="3fxhj"></video></delect></address></p><noframes id="3fxhj"><font id="3fxhj"></font></noframes><delect id="3fxhj"></delect><p id="3fxhj"><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></delect></p><listing id="3fxhj"><noframes id="3fxhj"><video id="3fxhj"><output id="3fxhj"></output></video></noframes></listing><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"><noframes id="3fxhj"></noframes></address></font></delect><delect id="3fxhj"></delect><address id="3fxhj"><noframes id="3fxhj"><video id="3fxhj"><delect id="3fxhj"></delect></video></noframes></address><delect id="3fxhj"><listing id="3fxhj"><noframes id="3fxhj"><video id="3fxhj"></video></noframes></listing></delect><listing id="3fxhj"></listing><video id="3fxhj"><output id="3fxhj"></output></video><address id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"><delect id="3fxhj"></delect></p></noframes></address><delect id="3fxhj"><listing id="3fxhj"><address id="3fxhj"><video id="3fxhj"></video></address></listing></delect><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing><font id="3fxhj"></font><video id="3fxhj"></video><noframes id="3fxhj"></noframes><p id="3fxhj"><output id="3fxhj"><delect id="3fxhj"><listing id="3fxhj"></listing></delect></output></p><address id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"><output id="3fxhj"></output></p></noframes></address><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"><video id="3fxhj"></video></address></font></delect><video id="3fxhj"></video><video id="3fxhj"><p id="3fxhj"><delect id="3fxhj"><font id="3fxhj"></font></delect></p></video><listing id="3fxhj"><address id="3fxhj"><video id="3fxhj"><p id="3fxhj"></p></video></address></listing><address id="3fxhj"><video id="3fxhj"></video></address><output id="3fxhj"><delect id="3fxhj"><listing id="3fxhj"><address id="3fxhj"></address></listing></delect></output><noframes id="3fxhj"><video id="3fxhj"><p id="3fxhj"><output id="3fxhj"></output></p></video></noframes><p id="3fxhj"><output id="3fxhj"><font id="3fxhj"><listing id="3fxhj"></listing></font></output></p><p id="3fxhj"><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></delect></p><output id="3fxhj"></output><output id="3fxhj"><output id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></output></output><noframes id="3fxhj"></noframes><listing id="3fxhj"><address id="3fxhj"><video id="3fxhj"><p id="3fxhj"></p></video></address></listing><delect id="3fxhj"></delect><address id="3fxhj"><video id="3fxhj"></video></address><video id="3fxhj"><p id="3fxhj"><delect id="3fxhj"><listing id="3fxhj"></listing></delect></p></video><video id="3fxhj"></video><font id="3fxhj"></font><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"><noframes id="3fxhj"></noframes></address></font></delect><video id="3fxhj"><output id="3fxhj"></output></video><output id="3fxhj"></output><listing id="3fxhj"><address id="3fxhj"><video id="3fxhj"><p id="3fxhj"></p></video></address></listing><address id="3fxhj"></address><p id="3fxhj"><output id="3fxhj"><delect id="3fxhj"><address id="3fxhj"></address></delect></output></p><address id="3fxhj"></address><output id="3fxhj"><delect id="3fxhj"><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing></delect></output><p id="3fxhj"></p><listing id="3fxhj"><address id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"></p></noframes></address></listing> <output id="3fxhj"><font id="3fxhj"><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing></font></output><output id="3fxhj"></output><listing id="3fxhj"><video id="3fxhj"></video></listing><video id="3fxhj"><video id="3fxhj"><output id="3fxhj"><font id="3fxhj"></font></output></video></video><address id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"><delect id="3fxhj"></delect></p></noframes></address><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"><video id="3fxhj"></video></address></font></delect><font id="3fxhj"><font id="3fxhj"><noframes id="3fxhj"><video id="3fxhj"></video></noframes></font></font><address id="3fxhj"></address><output id="3fxhj"><font id="3fxhj"></font></output><address id="3fxhj"><address id="3fxhj"><video id="3fxhj"><output id="3fxhj"></output></video></address></address><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"><video id="3fxhj"></video></address></font></delect><p id="3fxhj"><output id="3fxhj"></output></p><font id="3fxhj"><listing id="3fxhj"></listing></font><output id="3fxhj"><delect id="3fxhj"></delect></output><video id="3fxhj"><output id="3fxhj"></output></video><noframes id="3fxhj"><video id="3fxhj"></video></noframes><font id="3fxhj"><listing id="3fxhj"><video id="3fxhj"><p id="3fxhj"></p></video></listing></font><font id="3fxhj"></font><noframes id="3fxhj"><p id="3fxhj"></p></noframes><font id="3fxhj"></font><font id="3fxhj"><address id="3fxhj"></address></font><font id="3fxhj"><listing id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"></p></noframes></listing></font><listing id="3fxhj"><video id="3fxhj"><p id="3fxhj"><delect id="3fxhj"></delect></p></video></listing><noframes id="3fxhj"><p id="3fxhj"><output id="3fxhj"><font id="3fxhj"></font></output></p></noframes><font id="3fxhj"></font><video id="3fxhj"></video><video id="3fxhj"><p id="3fxhj"><delect id="3fxhj"><listing id="3fxhj"></listing></delect></p></video><noframes id="3fxhj"><p id="3fxhj"></p></noframes><output id="3fxhj"></output><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing><video id="3fxhj"><output id="3fxhj"></output></video><listing id="3fxhj"><noframes id="3fxhj"><video id="3fxhj"><output id="3fxhj"></output></video></noframes></listing><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing><p id="3fxhj"></p><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing><noframes id="3fxhj"><video id="3fxhj"></video></noframes><listing id="3fxhj"><address id="3fxhj"><video id="3fxhj"><output id="3fxhj"></output></video></address></listing><p id="3fxhj"></p><video id="3fxhj"><output id="3fxhj"></output></video><listing id="3fxhj"><listing id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"></p></noframes></listing></listing><video id="3fxhj"><p id="3fxhj"><delect id="3fxhj"><font id="3fxhj"></font></delect></p></video><video id="3fxhj"><output id="3fxhj"></output></video><listing id="3fxhj"></listing><p id="3fxhj"><delect id="3fxhj"></delect></p><listing id="3fxhj"></listing><p id="3fxhj"><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></delect></p><output id="3fxhj"><output id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></output></output><video id="3fxhj"><delect id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></delect></video><delect id="3fxhj"><address id="3fxhj"></address></delect><noframes id="3fxhj"></noframes> <p id="3fxhj"></p><address id="3fxhj"></address><font id="3fxhj"><address id="3fxhj"><video id="3fxhj"><output id="3fxhj"></output></video></address></font><delect id="3fxhj"></delect><listing id="3fxhj"></listing><video id="3fxhj"><output id="3fxhj"><delect id="3fxhj"><listing id="3fxhj"></listing></delect></output></video><delect id="3fxhj"><listing id="3fxhj"></listing></delect><p id="3fxhj"></p><noframes id="3fxhj"><p id="3fxhj"></p></noframes><font id="3fxhj"><address id="3fxhj"><video id="3fxhj"><delect id="3fxhj"></delect></video></address></font><font id="3fxhj"><listing id="3fxhj"></listing></font><noframes id="3fxhj"><video id="3fxhj"></video></noframes><address id="3fxhj"><noframes id="3fxhj"></noframes></address><font id="3fxhj"></font><noframes id="3fxhj"></noframes><noframes id="3fxhj"><output id="3fxhj"></output></noframes><delect id="3fxhj"></delect><address id="3fxhj"><video id="3fxhj"></video></address><noframes id="3fxhj"><output id="3fxhj"></output></noframes><listing id="3fxhj"></listing><noframes id="3fxhj"></noframes><output id="3fxhj"><font id="3fxhj"></font></output><address id="3fxhj"><video id="3fxhj"><output id="3fxhj"><font id="3fxhj"></font></output></video></address><listing id="3fxhj"></listing><video id="3fxhj"></video><font id="3fxhj"><address id="3fxhj"></address></font><video id="3fxhj"></video><noframes id="3fxhj"></noframes><font id="3fxhj"><listing id="3fxhj"><noframes id="3fxhj"><output id="3fxhj"></output></noframes></listing></font><video id="3fxhj"><output id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></output></video><address id="3fxhj"><video id="3fxhj"></video></address><video id="3fxhj"><output id="3fxhj"><font id="3fxhj"><address id="3fxhj"></address></font></output></video><address id="3fxhj"><noframes id="3fxhj"></noframes></address><delect id="3fxhj"></delect><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing><noframes id="3fxhj"><p id="3fxhj"></p></noframes><output id="3fxhj"><listing id="3fxhj"><address id="3fxhj"><p id="3fxhj"></p></address></listing></output><listing id="3fxhj"><noframes id="3fxhj"></noframes></listing><p id="3fxhj"></p><listing id="3fxhj"><video id="3fxhj"><p id="3fxhj"><delect id="3fxhj"></delect></p></video></listing><address id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"><output id="3fxhj"></output></p></noframes></address><output id="3fxhj"><font id="3fxhj"><address id="3fxhj"><noframes id="3fxhj"></noframes></address></font></output><font id="3fxhj"></font><font id="3fxhj"><noframes id="3fxhj"><p id="3fxhj"><output id="3fxhj"></output></p></noframes></font><noframes id="3fxhj"><p id="3fxhj"></p></noframes><font id="3fxhj"></font><video id="3fxhj"><output id="3fxhj"></output></video><output id="3fxhj"></output><video id="3fxhj"></video><listing id="3fxhj"><address id="3fxhj"></address></listing></div> <div class="topbar"> <img src="img/logo.png" style="margin-top: 19px; margin-left: 20px; width:136px; height:25px; " /> <!-- <button id="login" onclick="javascript:location.href='Login.aspx'" class="btn btn-primary" type="button" style="display: none; border: none; position: absolute; right: 20px; top: 15px;"><i class="icon icon-signin"></i> ??/ ??/button>--> <div class="dropdown" style="position: absolute; top: 15px; right: 15px; display: none;" id="menu"> <button class="btn btn-primary" style="background: none; border: none;" type="button" data-toggle="dropdown"><i class="icon icon-rss"></i>  欢迎您,<span id="userLabel"></span> <span class="caret"></span></button> <ul class="dropdown-menu" style="min-width: 150px;"> <li><a onclick="exit()" href="###">注销</a></li> </ul> </div> </div> <div class="container-fixed" style="padding-top: 10px"> <!--确认下单提示?-> <div id="tipModal" class="modal fade"> <div class="modal-dialog" style="width: 280px !important;"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">提示</h4> </div> <div class="modal-body"> <p>您确定要提交下单信息?</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="submit" data-loading-text="提交?请稍?.." type="button" class="btn btn-danger">确定</button> </div> </div> </div> </div> <!--注销用户提示?-> <div id="exitModal" class="modal fade"> <div class="modal-dialog" style="width: 280px !important;"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">提示</h4> </div> <div class="modal-body"> <p>您确定注销?</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button onclick="doexit()" type="button" class="btn btn-danger">确定</button> </div> </div> </div> </div> <!--收件人删除提示框--> <div id="tipsModal" class="modal fade"> <div class="modal-dialog" style="width: 280px !important;"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">提示</h4> </div> <div class="modal-body"> <p>您确定删除吗?</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="button" class="btn btn-danger" id="delcancel">确定</button> </div> </div> </div> </div> <!--地址薄提示框--> <div id="adstipModal" class="modal fade" data-backdrop="false" style="z-index: 999999999 !important"> <div class="modal-dialog" style="width: 280px !important;"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">提示</h4> </div> <div class="modal-body"> <p>您确定删除收件信息吗?</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="button" class="btn btn-danger" data-loading-text="正在删除" id="delAddressBtns">确定</button> </div> </div> </div> </div> <!-- 收件人信息修改新增对话框 --> <div id="modals" data-moveable="true" class="modal fade" data-backdrop="false" style="z-index: 999999"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">修改数据</h4> </div> <div class="modal-body" style="height: auto"> <div class="lists"> <ul> <li> <input type="hidden" id="numbersort" /> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>运单编号</div> <input type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="billcode" data-toggle="tooltip" data-placement="top" title="运单编号" class="form-control" style="max-width: 300px; float: left" placeholder="请输入运单编? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>收件人姓?/div> <input type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength = "20" id="sname" class="form-control" data-toggle="tooltip" data-placement="top" title="收件人姓? style="max-width: 300px; float: left" placeholder="请输入收件人姓名" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>收件人联系电?/div> <input type="text" id="sphone" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" MaxLength = "20" class="form-control" data-toggle="tooltip" data-placement="top" title="收件人联系电? style="max-width: 300px; float: left" placeholder="请输入收件人联系电话" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>收件人公?/div> <input type="text" maxlength="20" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="scompany" class="form-control" data-toggle="tooltip" data-placement="top" title="收件人公? style="max-width: 300px; float: left" placeholder="请输入收件人公司" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>收件详细地址</div> <input type="text" maxlength="80" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="saddress" class="form-control" data-toggle="tooltip" data-placement="top" title="收件详细地址" style="max-width: 300px; float: left" placeholder="请输入收件详细地址" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>件数</div> <input type="text" id="scounts" class="form-control" data-toggle="tooltip" data-placement="top" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" title="件数" style="max-width: 300px; float: left" placeholder="请输入件? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>重量</div> <input type="text" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9.]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="sweight" class="form-control" data-toggle="tooltip" data-placement="top" title="重量" style="max-width: 300px; float: left" placeholder="请输入重? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>内件详情</div> <input type="text" maxlength="40" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="sgoods" class="form-control" data-toggle="tooltip" data-placement="top" title="内件详情" style="max-width: 300px; float: left" placeholder="请输入货物品? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>付款方式</div> <select id="spayway" data-toggle="tooltip" class="form-control" data-placement="top" title="付款方式" style="max-width: 300px; float: left"> <!--<option value="寄付">寄付</option> <option value="到付">到付</option> <option value="寄付月结">寄付月结</option>--> <option value="C-付现">C-付现</option> <option value="D-到付">D-到付</option> <option value="E-出口月结">E-出口月结</option> <option value="O-其他">O-其他</option> <option value="T-第三方月?>T-第三方月?/option> </select> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>代收货款</div> <input type="text" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9.]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="ssum" class="form-control" data-toggle="tooltip" data-placement="top" title="代收货款" style="max-width: 300px; float: left" placeholder="请输入代收货? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>保价服务</div> <input type="text" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9.]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="smonney" class="form-control" data-toggle="tooltip" data-placement="top" title="保价服务" style="max-width: 300px; float: left" placeholder="请输入保价金? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>签回?/div> <select id="sback" data-toggle="tooltip" class="form-control" data-placement="top" title="签回? style="max-width: 300px; float: left"> <option value="?>?/option> <option value="?>?/option> </select> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>备注</div> <input type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength="40" id="sdescs" class="form-control" data-toggle="tooltip" data-placement="top" title="备注" style="max-width: 300px; float: left" placeholder="请输入备? /> <div class="clearfix"></div> </div> </li> </ul> </div> <div class="clearfix"></div> </div> <div class="center padding"> <button type="button" class="btn btn-default" style="width: 90px; margin-right: 10px" data-dismiss="modal">取消</button> <button id="sedit" type="button" style="width: 90px" class="btn btn-danger">确定</button> </div> </div> </div> </div> <!--历史记录预览?--> <div id="historyModal" data-moveable="true" data-position="50px" data-backdrop="false" class="modal fade" style="z-index: 999999;"> <div class="modal-dialog modal-lg" style="height: 650px; width: 80%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">历史记录信息</h4> </div> <div class="modal-body" style="height: auto"> <input id="startTime" type="text" readonly class="form-control form-date" placeholder="选择开始时? style="float: left; width: 150px;" /> <div style="float: left; width: 30px; text-align: center; line-height: 30px; font-weight: bold">--</div> <input id="endTime" type="text" readonly class="form-control form-date" placeholder="选择结束时间" style="float: left; width: 150px;" /> <div style="float: left; width: 150px; margin-left: 40px"> <button id="checkHistoryBtn" data-loading-text="正在查询" type="button" class="btn btn-primary" title="?? style="width: 90px; height: 33px; background: #585688">??/button> </div> <div class="clearfix"></div> <br /> <table id="historydg" style="width: 100%; height: 460px; min-width: 800px" data-options="rownumbers:true,autoRowHeight:false,striped:true,nowrap:true,singleSelect:true"> <thead> <tr> <th data-options="field:'ID',checkbox:true,hidden:true"></th> <th data-options="field:'运单编号',width:200,align:'center'" formatter="formatBill">运单编号</th> <th data-options="field:'收件人姓?,width:150,align:'center'">收件人姓?/th> <th data-options="field:'收件人联系电?,width:150,align:'center'">收件人联系电?/th> <th data-options="field:'收件详细地址',width:400,align:'left'">收件详细地址</th> <th data-options="field:'收件人公?,width:200,align:'center'">收件人公?/th> <th data-options="field:'寄件人姓?,width:150,align:'center'">寄件人姓?/th> <th data-options="field:'寄件人联系电?,width:150,align:'center'">寄件人联系电?/th> <th data-options="field:'寄件省市?,width:130,align:'center'">寄件人所在区?/th> <th data-options="field:'寄件详细地址',width:350,align:'left'">寄件人详细地址(城镇,街道,小区?</th> <th data-options="field:'客户编号',width:200,align:'center'">客户编号</th> <th data-options="field:'寄件人公?,width:200,align:'center'">寄件人公?/th> <th data-options="field:'件数',width:100,align:'center'">件数</th> <th data-options="field:'重量',width:100,align:'center'">重量</th> <th data-options="field:'内件详情',width:200,align:'center'">内件详情</th> <th data-options="field:'付款方式',width:100,align:'center'">付款方式</th> <th data-options="field:'代收货款',width:100,align:'center'">代收货款</th> <th data-options="field:'保价服务',width:100,align:'center'">保价服务</th> <th data-options="field:'签回?,width:100,align:'center'">签回?/th> <th data-options="field:'备注',width:200,align:'center'">备注</th> <th data-options="field:'上传时间',width:200,align:'center'">下单时间</th> </tr> </thead> </table> <div class="clearfix"></div> <div class="center" style="padding-bottom: 0px; padding-top: 15px"> <button id="closeHisBtn" type="button" class="btn" title="关闭窗口" style="width: 150px; height: 40px;">关闭窗口</button> </div> </div> </div> </div> </div> <!--地址薄预?-> <div id="addressModal" data-moveable="true" data-position="50px" class="modal fade" data-backdrop="false" style="z-index: 999999;"> <div class="modal-dialog modal-lg" style="height: 480px; width: 80%"> <div class="modal-content" > <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title">地址薄信?/h4> </div> <div class="datagrid padding"> <div class="lists" style="margin-bottom: 50px"> <ul> <li style="width: 90px"> <button style="width: 75px" data-loading-text="正在查询" id="addressCheckBtn" type="button" class="btn btn-primary tempBtn">??/button> </li> <li style="width: 90px"> <button style="width: 75px" type="button" onclick="amAddressFun('add')" id="addressAddBtn" class="btn btn-primary tempBtn">??/button> </li> <li style="width: 90px"> <button style="width: 75px" type="button" id="modifyAddressBtn" onclick="amAddressFun('edit')" class="btn btn-primary tempBtn">??/button> </li> <li style="width: 90px"> <button style="width: 75px" type="button" id="delAddressBtn" class="btn btn-primary tempBtn">??/button> </li> </ul> </div> <div class="lists" style="margin-bottom: 50px"> <ul> <li style="width: 180px"> <div class="input-control has-icon-left"> <input id="addressName" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength="10" type="text" class="form-control" placeholder="收件人姓? style="width: 160px" /> <label for="addressName" class="input-control-icon-left"><i class="icon icon-user"></i></label> </div> </li> <li style="width: 180px"> <div class="input-control has-icon-left"> <input id="addressPhone" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" MaxLength = "20" type="text" class="form-control" placeholder="收件人电? style="width: 160px" /> <label for="addressPhone" class="input-control-icon-left"><i class="icon icon-phone-sign"></i></label> </div> </li> <li style="width: 210px"> <div class="input-control has-icon-left"> <input id="addressCompany" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" type="text" maxlength="80" class="form-control" placeholder="收件人公? style="width: 200px" /> <label for="addressCompany" class="input-control-icon-left"><i class="icon icon-home"></i></label> </div> </li> <li style="width: 180px"> <div class="input-control has-icon-left"> <input id="addressNumber" type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength="10" class="form-control" placeholder="收件人编? style="width: 160px" /> <label for="addressNumber" class="input-control-icon-left"><i class="icon icon-font"></i></label> </div> </li> </ul> </div> <hr /> <table id="addressTable" style="width: 100%; height: 400px; border: 1px dashed #eee;" data-options="rownumbers:false,autoRowHeight:false,striped:true,nowrap:true"> <thead> <tr> <th data-options="field:'Idno',checkbox:true"></th> <th data-options="field:'编号',width:100,align:'center'">收件人编?/th> <th data-options="field:'收件人姓?,width:150,align:'center'">收件人姓?/th> <th data-options="field:'收件人联系电?,width:150,align:'center'">收件人联系电?/th> <th data-options="field:'收件详细地址',width:450,align:'left'">详细地址</th> <th data-options="field:'收件人公?,width:250,align:'left'">收件人公?/th> <th data-options="field:'?,width:200,align:'center',hidden:true">?/th> <th data-options="field:'?,width:200,align:'center',hidden:true">?/th> <th data-options="field:'?,width:200,align:'center',hidden:true">?/th> </tr> </thead> </table> <div class="clearfix"></div> <div class="center" style="padding-bottom: 20px; padding-top: 20px"> <button id="cancelSelectBtn" type="button" class="btn btn-primary" style="width: 150px; height: 40px; background: #585688">确认选择</button> </div> </div> </div> </div> </div> <!-- 地址薄修改新增对话框 --> <div id="amModal" data-moveable="true" class="modal fade" data-backdrop="false" style="z-index: 999999"> <div class="modal-dialog" style="width: 42%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button> <h4 class="modal-title" id="addressTitle" style="color: red">修改数据</h4> </div> <div class="modal-body" style="height: auto"> <div class="lists"> <ul> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>收件人姓?/div> <input type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength="10" id="amName" class="form-control" data-toggle="tooltip" data-placement="top" title="收件人姓? style="max-width: 300px; float: left" placeholder="请输入收件人姓名" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>收件人联系电?/div> <input type="text" MaxLength = "20" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" id="amPhone" class="form-control" data-toggle="tooltip" data-placement="top" title="收件人联系电? style="max-width: 300px; float: left" placeholder="请输入收件人联系电话" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>收件人所在区?/div> <input readonly="true" type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="amAddressCity" class="form-control" data-toggle="tooltip" data-placement="top" title="所在区? style="max-width: 300px; float: left" placeholder="请点击进行选择所在区? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>所在城?街道详细地址</div> <input type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength="80" id="amAddress" class="form-control" data-toggle="tooltip" data-placement="top" title="所在城?街道,小区? style="max-width: 300px; float: left" placeholder="所在城?街道,小区? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>收件人公?/div> <input type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength="20" id="amCompany" class="form-control" data-toggle="tooltip" data-placement="top" title="收件人公? style="max-width: 300px; float: left" placeholder="请输入收件人公司" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"> </strong>收件人编?/div> <input type="text" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength="10" id="amNumber" class="form-control" data-toggle="tooltip" data-placement="top" title="收件人编? style="max-width: 300px; float: left" placeholder="请输入收件人编号(选填)" /> <div class="clearfix"></div> </div> </li> </ul> </div> <div class="clearfix"></div> </div> <div class="center padding"> <button type="button" class="btn btn-default" style="width: 90px; margin-right: 10px" data-dismiss="modal">取消</button> <button id="amAddressBtn" data-loading-text="保存? style="width: 90px" class="btn btn-danger">确定</button> </div> </div> </div> </div> <!--提示?-> <div id="redtip" style="height: 40px; background: red; color: #fff; font-size: 16px; padding: 10px">提示:由于模板(删除收件省市区列),请自行下载新的模板,谢谢!</div> <!--寄件人区?-> <div class="card padding"> <h2 class="cardhead"> <img src="img/send.png" width="40" height="40" /> <div class="tit">寄件人信?/div> <div class="clearfix"></div> </h2> <div class="lists"> <ul> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>姓名</div> <input type="text" id="names" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" MaxLength='10' data-toggle="tooltip" data-placement="top" title="姓名" class="form-control" style="max-width: 300px; float: left" placeholder="请输入寄件人姓名" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>联系方式</div> <input type="text" id="phone" class="form-control" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" MaxLength = "20" data-toggle="tooltip" data-placement="top" title="联系方式" style="max-width: 300px; float: left" placeholder="请输入联系电? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>客户编号</div> <input type="text" onblur="toUpCustCode(this)" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" id="customernumber" class="form-control" data-toggle="tooltip" data-placement="top" title="客户编号" style="max-width: 300px; float: left" placeholder="请输入客户编?选填)" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red"></strong>寄件公司</div> <input type="text" maxlength = "20" id="company" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" class="form-control" data-toggle="tooltip" data-placement="top" title="寄件公司" style="max-width: 300px; float: left" placeholder="请输入寄件公司名?选填)" /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>所在区?/div> <input readonly="true" type="text" id="city" class="form-control" data-toggle="tooltip" data-placement="top" title="所在区? style="max-width: 300px; float: left" placeholder="请点击进行选择所在区? /> <div class="clearfix"></div> </div> </li> <li> <div class="padding"> <div class="title" style="float: left"><strong class="red">*</strong>所在镇·街道·门牌号·小?/div> <input type="text" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;" maxlength ="80" id="address" class="form-control" data-toggle="tooltip" data-placement="top" title="所在镇,街道,门牌?小区..." style="max-width: 300px; float: left" placeholder="所在镇,街道,门牌?小区..." /> <div class="clearfix"></div> </div> </li> </ul> </div> </div> <!--上传结果提示区域--> <div class="card padding" id="errorlist" style="display: none;"> <h2 class="cardhead"> <img src="img/error.png" width="35" height="35" style="margin-top: 5px" /> <div class="tit">上传信息</div> <div class="clearfix"></div> </h2> <div class="popover-content" id="popContent" style="min-height: 180px; height: 180px; overflow: auto"> </div> </div> <!--收件人信息区?-> <div class="card padding"> <h2 class="cardhead"> <img src="img/shou.png" width="40" height="40" /> <div class="tit">收件人信?/div> <div class="clearfix"></div> </h2> <div class="datagrid padding" style="height: 410px"> <div class="lists" style="margin-bottom: 50px"> <ul> <li style="padding-right: 10px"> <div class="input-control search-box search-box-circle has-icon-left has-icon-right" style="margin-bottom: 10px; max-width: 300px"> <input onkeyup="search(this)" id="searchTxt" title="信息搜索" data-toggle="tooltip" data-placement="top" type="search" class="form-control search-input" placeholder="请输入姓?电话/地址" /> <label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label> <a href="javascript:void(0)" class="input-control-icon-right search-clear-btn"><i onclick="clearTxt()" class="icon icon-remove"></i></a> </div> </li> <li style="width: 120px"> <button id="loading" type="button" class="btn btn-primary tempBtn">下载Excel模板</button> </li> <li style="width: 120px"> <input id="files" type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" onchange="inExcel(this)" style="position: absolute; width: 110px; margin-left: 0px; margin-top: 0px; z-index: 9999; height: 30px; background: transparent; color: transparent; opacity: 0; filter: alpha(opacity=0);" /> <button type="button" class="btn btn-primary tempBtn">导入Excel数据</button> </li> <li style="width: 90px"> <button type="button" id="edit" class="btn btn-primary tempBtn">编辑数据</button> </li> <li style="width: 90px"> <button type="button" id="del" class="btn btn-primary tempBtn">删除数据</button> </li> <li style="width: 90px;"> <button type="button" id="addressbtn" class="btn btn-primary tempBtn"><i class="icon icon-book"></i>地址?/button> </li> <li style="width: 90px">  </li> <li style="width: 90px">  </li> <li style="width: 90px; margin-left: 20px"> <button type="button" id="historyBtn" class="btn btn-primary tempBtn"><i class="icon icon-time"></i>历史记录查询</button> </li> </ul> </div> <table id="dg" style="width: 100%; height: 265px; border: 1px dashed #eee;" data-options="rownumbers:false,autoRowHeight:false,striped:true,nowrap:true"> <thead> <tr> <th data-options="field:'id',checkbox:true"></th> <th data-options="field:'运单编号',width:200,align:'center'">运单编号</th> <th data-options="field:'收件人姓?,width:150,align:'center'">收件人姓?/th> <th data-options="field:'收件人联系电?,width:150,align:'center'">收件人联系电?/th> <th data-options="field:'收件详细地址',width:350,align:'left'">收件详细地址</th> <th data-options="field:'收件人公?,width:200,align:'center'">收件人公?/th> <th data-options="field:'内件详情',width:200,align:'center'">内件详情</th> <th data-options="field:'付款方式',width:100,align:'center'">付款方式</th> <th data-options="field:'件数',width:100,align:'center'">件数</th> <th data-options="field:'重量',width:100,align:'center'">重量</th> <th data-options="field:'代收货款',width:100,align:'center'">代收货款</th> <th data-options="field:'保价服务',width:100,align:'center'">保价服务</th> <th data-options="field:'签回?,width:100,align:'center'">签回?/th> <th data-options="field:'备注',width:300,align:'center'">备注</th> </tr> </thead> </table> <div class="clearfix"></div> <div class="center" style="padding-bottom: 20px; padding-top: 20px"> <button id="dosubmit" type="button" class="btn btn-primary" style="width: 150px; height: 40px; background: #585688">提交信息</button> </div> </div> </div> </div> <a href="http://www.ih201.com/">һɫ¼ӰƬ ӰƬ ߹ۿ һaƬ</a> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body> </html> <script src="zui/lib/jquery/jquery.js"></script> <script src="js/Popt.js"></script> <script src="js/cityJson.js"></script> <script src="js/citySet.js"></script> <script src="zui/js/zui.js"></script> <script src="easyui1.5.2/jquery.easyui.min.js"></script> <script src="easyui1.5.2/locale/easyui-lang-zh_CN.js"></script> <script src="js/xlsx.full.min.js"></script> <script src="js/GetUrlParams.js"></script> <script src="zui/lib/datetimepicker/datetimepicker.min.js"></script> <script> //清空搜索? function clearTxt() { $("#searchTxt").val(''); setData(results); } //格式化运单编? function formatBill(e) { return "<a target='_blank' href='../QR/page/ysy_info.html?billcode=" + e + "'>" + e + "</a>"; } //搜索 function search(obj) { var txt = $(obj).val(); var reg = new RegExp(txt); var indexArr = new Array(); var ids = document.getElementsByName("id"); if (txt != "") { var datas = new Array(); for (var i = 0; i < results.length; i++) { var name=results[i].收件人姓? var tel=results[i].收件人联系电? var detailaddress=results[i].收件详细地址; var code=results[i].运单编号 var constr=name+""+tel+""+detailaddress+""+code //alert("ss"+constr); ids[i].checked = false; $('#datagrid-row-r2-2-' + i).css("background-color", "#FFFFFF").selector; if (constr.indexOf(txt,0)!= -1) { $('#datagrid-row-r2-2-' + i ).css("background-color", "#FFD803").selector; ids[i].checked = true; } } } else { setData(results); } } //绑定省市? $("#city").click(function (e) { SelCity(this, e); }); $("#spro").click(function (e) { SelCity(this, e); }); $("#amAddressCity").click(function (e) { SelCity(this, e); }); var myMessager = new $.zui.Messager({ icon: 'bell', placement: 'top', close: false }); //绑定列表 $(function () { ///公告通知定时 var endtime = new Date("2018/06/10 00:00:00"); if (new Date() > endtime) { $("#redtip").hide(); } $("#names").val($.zui.store.get('jname')); $("#phone").val($.zui.store.get('jphone')); $("#customernumber").val($.zui.store.get('jcustomernumber')); $("#company").val($.zui.store.get('jcompany')); $("#city").val($.zui.store.get('jcity')); $("#address").val($.zui.store.get('jaddress')); var r = $.zui.store.get('rr'); document.getElementById("userLabel").innerText = r; if (r != "" & r != undefined) { document.getElementById('login').style.display = "none"; document.getElementById('menu').style.display = ""; } else { // document.getElementById('login').style.display = ""; document.getElementById('menu').style.display = "none"; } //时间选择控件 初始? $("#startTime").datetimepicker( { language: "zh-CN", weekStart: 1, todayBtn: 1, autoclose: 1, todayHighlight: 1, startView: 2, forceParse: 0, showMeridian: 1, format: "yyyy/mm/dd hh:ii" }); $("#endTime").datetimepicker( { language: "zh-CN", weekStart: 1, todayBtn: 1, autoclose: 1, todayHighlight: 1, startView: 2, forceParse: 0, showMeridian: 1, format: "yyyy/mm/dd hh:ii" }); $('#dg').datagrid(); //收件信息? //提示 $('[data-toggle="tooltip"]').tooltip({ placement: 'top' }); //提交点击 $('#dosubmit').on('click', function () { // 页面验证flage var flag="0"; //alert("ttt"+results.length); if (results==null||results.length<=0) { myMessager.show("请导入数?); return; } var name = document.getElementById("names").value.replace(/(^\s*)|(\s*$)/g, ""); var phone = document.getElementById("phone").value.replace(/(^\s*)|(\s*$)/g, ""); var customernumber = document.getElementById("customernumber").value.replace(/(^\s*)|(\s*$)/g, ""); // 寄件人公司名? var company = document.getElementById("company").value.replace(/(^\s*)|(\s*$)/g, ""); var city = document.getElementById("city").value.replace(/(^\s*)|(\s*$)/g, ""); var address = document.getElementById("address").value.replace(/(^\s*)|(\s*$)/g, ""); if (name.length <= 0 || name.length > 10) { myMessager.show("姓名必填,最多可填写10个字"); $("#names").focus(); flag="1"; return; } if (RegExp(/先生/).test(name) || RegExp(/小姐/).test(name) || RegExp(/女士/).test(name)) { myMessager.show("抱歉,不可输入“先生、小姐、女士”等称呼,请重新输入,谢谢!"); $("#names").val(""); $("#names").focus(); flag="1"; return; } if (phone.length == 0) { myMessager.show("请输入正确电话号?); $("#phone").focus(); flag="1"; return; } if (/^[0-9-]*$/.test(phone) == false) { myMessager.show("请输入正确电话号?); $("#phone").focus(); flag="1"; return; } if (customernumber.length > 0 && /^[A-Za-z]*$/.test(customernumber) == true) { myMessager.show("客户编号必须输入城码+数字"); $("#customernumber").focus(); page_flag="1"; results=null; return; } if (customernumber.length > 0 && /^[0-9]*$/.test(customernumber) == true) { myMessager.show("客户编号必须输入城码+数字"); $("#customernumber").focus(); page_flag="1"; results=null; return; } if (customernumber.length > 0 && /^[A-Za-z0-9]*$/.test(customernumber) == false) { myMessager.show("客户编号必须输入城码+数字"); $("#customernumber").focus(); flag="1"; return; } if (company!="" && company.length > 20) { myMessager.show("寄件公司最多可填写20个字?); $("#company").focus(); return; } if (city.length == 0) { myMessager.show("请选择完整省市?); $("#city").focus(); flag="1"; return; } if (city.length > 0) { var t = city.split("-"); if (t.length != 3) { myMessager.show("请选择完整省市?); $("#city").focus(); flag="1"; return; } } if (address.length < 5) { myMessager.show("请填写完整地址"); $("#address").focus(); flag="1"; return; } if (city.length+address.length>80) { myMessager.show("所在区?详细地址长度不能超过80个字"); $("#address").focus(); flag="1"; return; } if (results.length == 0) { myMessager.show("请先导入收件人数?); flag="1"; return; } for (var i = 0 ; i < results.length; i++) { if (results[i].运单编号 == null || results[i].运单编号 == "") { myMessager.show("? + (i + 1) + "运单编号不能为空"); flag = "1"; return; } if (results[i].内件详情 == null || results[i].内件详情 == "") { myMessager.show("?+(i+1)+"行内件详情不能为?); flag = "1"; return; } if (results[i].内件详情.length>40) { myMessager.show("? + (i + 1) + "行内件详情长度不能大?0"); flag = "1"; return; } } $('#tipModal').modal({ show: true, backdrop: 'static', keyboard: false }); }); //最终提交信? $('#submit').on('click', function () { //flag="1"; // if (flag=="1") { // myMessager.show("请导入数?"); // // } var name = document.getElementById("names").value.replace(/(^\s*)|(\s*$)/g, ""); var phone = document.getElementById("phone").value.replace(/(^\s*)|(\s*$)/g, ""); var customernumber = document.getElementById("customernumber").value.replace(/(^\s*)|(\s*$)/g, ""); var company = document.getElementById("company").value.replace(/(^\s*)|(\s*$)/g, ""); var city = document.getElementById("city").value.replace(/(^\s*)|(\s*$)/g, ""); var address = document.getElementById("address").value.replace(/(^\s*)|(\s*$)/g, ""); var $btn = $(this); $btn.button('loading'); $.zui.store.set('jname', name); $.zui.store.set('jphone', phone); $.zui.store.set('jcustomernumber', customernumber); $.zui.store.set('jcompany', company); $.zui.store.set('jcity', city); $.zui.store.set('jaddress', address); // var loginuser = localStorage.getItem("username"); var loginuser = "1"; var openid = ""; if ($.zui.store.get("phone") != undefined) { openid = $.zui.store.get("phone"); } //wangweiqiu // var ids_smt = document.getElementsByName("id"); // var datas_smt = new Array(); // for (var i = 0; i < results.length; i++) { // if (ids_smt[i].checked) { // datas_smt.push(results[i]); // } // } $.ajax({ url: 'service/service.ashx', data: { fun: 'pordersubmit', jname: name, jphone: phone, jcustomernumber: customernumber, jcompany: company, jcity: city, jaddress: address, data: JSON.stringify(results), openid: openid, loginuser: loginuser }, method: 'post', success: function (res) { var data = JSON.parse(res); //返回结果 // alert("data**" + data.length); //if ($.zui.store.get("phone") == undefined || $.zui.store.get("phone") == "") {//未登?-记录地址薄到本地 // if ($.zui.store.get("address") == undefined || $.zui.store.get("address") == "")//地址薄数据源为空 // { var addressArray = new Array(); //记录上传成功的地址信息 for (var i = 0; i < data.length; i++) { //找出上传成功的运? if (data[i].state == "1") { var ad = { ID: i + 1, 收件人编? '', 收件人姓? data[i].receiver, 收件人联系电? data[i].receiverPhone, 收件人公? data[i].receiverCompany, 收件详细地址: data[i].receiverAddress, ? data[i].receiverPro, ? data[i].receiverCity, ? data[i].receiverDis }; addressArray.push(ad); } } if (addressArray.length > 0) { // $.zui.store.get("address") = JSON.stringify(addressArray); //记录本地地址? } // } // else//地址薄数据源不为? // { // var orgAddress = JSON.parse($.zui.store.get("address"));//原来数据? // var addressArray = new Array();//记录上传成功的地址信息 // for (var i = 0; i < data.length; i++) { //找出上传成功的运? // if (data[i].state == "1") { // var ad = { ID: i + 1, 收件人编? '', 收件人姓? data[i].receiver, 收件人联系电? data[i].receiverPhone, 收件人公? data[i].receiverCompany, 收件详细地址: data[i].receiverAddress, ? data[i].receiverPro, ? data[i].receiverCity, ? data[i].receiverDis }; // for(var j=0;j<orgAddress.length;j++) // { // if(orgAddress[j].收件人姓?=ad.收件人姓?&orgAddress[j].收件人联系电?=ad.收件人联系电?&orgAddress[j].收件人公?=ad.收件人公?&orgAddress[j].收件详细地址==ad.收件详细地址) // { // break; // } // else // { // addressArray.push(ad); // } // } // } // } // if (addressArray.length > 0) { // for (var i = 0; i < addressArray.length; i++) { // orgAddress.push(addressArray[i]); // } // for (var i = 0; i < orgAddress.length; i++) { // orgAddress[i].ID = i + 1; // } // $.zui.store.get("address") = JSON.stringify(orgAddress); // } // } //} // alert("t**2"); // $('#tipModal').modal('hide'); // myMessager.show("下单成功,请等待上门取件!"); var historyList = new Array(); for (var i = 0; i < data.length; i++) { for (var j = results.length - 1; j >= 0; j--) { //if (data[i].billcode.replace(/(^\s*)|(\s*$)/g, "") == results[j].运单编号.replace(/(^\s*)|(\s*$)/g, "") && data[i].state.replace(/(^\s*)||(\s*$)/g, "") == "1") { historyList.push(results[j]); //记录成功数据 results.splice(j, 1); //删除成功数据 //break; //} } } //设置剩下数据数据? setData(results); $btn.button('reset'); $('#tipModal').modal('hide'); //设置历史记录到缓? for (var i = 0; i < historyList.length; i++) { historyList[i].上传时间 = setTime(); historyList[i].客户编号 = customernumber; historyList[i].寄件人姓?= name; historyList[i].寄件人联系电?= phone; historyList[i].寄件人公?= company; historyList[i].寄件省市?= city; historyList[i].寄件详细地址 = address; } var historyData = $.zui.store.get("history"); //原来历史记录 if (historyData != undefined && historyData != "" && historyData != "[]") { for (var i = 0; i < historyData.length; i++) { historyList.push(historyData[i]); } } if (historyList.length > 0) { $.zui.store.set("history", historyList); //设置到缓? } //alet("results**" + results) if (results != null && results.length > 0) { myMessager.show("请重新提交订?"); } //错误信息显示 var t = ""; for (var i = 0; i < data.length; i++) { if (data[i].state == "6") { window.location = "../POrder/Login.aspx"; } if (data[i].state != "1" && data[i].state != "6") { t += "<h4>单号 " + data[i].billcode + "</h4>"; t += "<p style=\"color: red;border-bottom:1px solid #eee;font-size:14px\">提示:" + data[i].msg + "</p>"; } } //alert("tt**" + t); if (t == "") { $("#errorlist").hide(); myMessager.show("下单成功,请等待上门取件!"); } else { $("#errorlist").show(); } document.getElementById("popContent").innerHTML = t; //上传结果提示 }, error: function (res) { myMessager.show("出错啦!服务器忙!"); $btn.button('reset'); $('#tipModal').modal('hide'); } }); }); //下载模板 $('#loading').on('click', function () { location.href = "template/template.xlsx"; }); //删除 $('#del').on('click', function () { var rows = $('#dg').datagrid("getSelections"); if (rows.length == 0) { myMessager.show("请选择要删除的收件信息"); return; } $('#tipsModal').modal('show'); }); $("#delcancel").on('click', function () { $('#tipsModal').modal('hide'); var rows = $('#dg').datagrid("getSelections"); for (var i = 0; i < rows.length; i++) { for (var j = results.length - 1; j >= 0; j--) { if (results[j] == rows[i]) { results.splice(j, 1); } } } setData(results); }); //编辑 $('#edit').on('click', function () { var rows = $('#dg').datagrid("getSelections"); if (rows.length == 0) { myMessager.show("请选择要编辑的收件信息!"); return; } if (rows.length > 1) { myMessager.show("只能选择一条收件信息进行编?"); return; } var selectedItems = rows; $("#billcode").val(selectedItems[0].运单编号); $("#sname").val(selectedItems[0].收件人姓?; $("#sphone").val(selectedItems[0].收件人联系电?; $("#scompany").val(selectedItems[0].收件人公?; $("#saddress").val(selectedItems[0].收件详细地址); $("#scounts").val(selectedItems[0].件数); $("#sweight").val(selectedItems[0].重量); $("#sgoods").val(selectedItems[0].内件详情); $("#spayway").val(selectedItems[0].付款方式); $("#ssum").val(selectedItems[0].代收货款); $("#smonney").val(selectedItems[0].保价服务); $("#sback").val(selectedItems[0].签回?; $("#sdescs").val(selectedItems[0].备注); $("#spro").val(selectedItems[0].收件省市?; $("#numbersort").val(selectedItems[0].ID); $('#modals').modal({ show: true }); }); //监控编辑弹出框事? $('#modals').on('shown.zui.modal', function () { $("#billcode").focus(); }) //保存编辑 $('#sedit').on('click', function () { var selectedItems = $('#dg').datagrid("getSelections"); var name = document.getElementById("sname").value.replace(/(^\s*)|(\s*$)/g, ""); var phone = document.getElementById("sphone").value.replace(/(^\s*)|(\s*$)/g, ""); var billcode = document.getElementById("billcode").value.replace(/(^\s*)|(\s*$)/g, ""); var company = document.getElementById("scompany").value.replace(/(^\s*)|(\s*$)/g, ""); var counts_ = document.getElementById("scounts").value.replace(/(^\s*)|(\s*$)/g, ""); var address = document.getElementById("saddress").value.replace(/(^\s*)|(\s*$)/g, ""); var goods = document.getElementById("sgoods").value.replace(/(^\s*)|(\s*$)/g, ""); var payway = document.getElementById("spayway").value.replace(/(^\s*)|(\s*$)/g, ""); var back = document.getElementById("sback").value.replace(/(^\s*)|(\s*$)/g, ""); var sum_=document.getElementById("ssum").value.replace(/(^\s*)|(\s*$)/g, ""); var monney_=document.getElementById("smonney").value.replace(/(^\s*)|(\s*$)/g, ""); //var monney_ = parseFloat(tem_monney).toFixed(1); var descs = document.getElementById("sdescs").value.replace(/(^\s*)|(\s*$)/g, ""); var weight=document.getElementById("sweight").value.replace(/(^\s*)|(\s*$)/g, ""); if (billcode.length < 0) { myMessager.show("运单号必?); $("#billcode").focus(); return; } if (billcode.length != 12) { myMessager.show("运单号错?运单号应?2位数?); $("#billcode").focus(); return; } if (/^[0-9]*$/.test(billcode) == false) { myMessager.show("运单号必须为数字"); $("#billcode").focus(); return; } if (!billcode.startsWith("600")) { myMessager.show("运单号必须以600开?); $("#billcode").focus(); return; } if (billcode.length == 12) { //取前11? var strFirst11 = billcode.substring(0, 11); var intLast1 = billcode.substring(billcode.length - 1, billcode.length); var intMode = (strFirst11 % 7); if (intLast1 != intMode) { myMessager.show("请输入正确运单号"); $("#billcode").focus(); return; } } if (name.length <= 0 || name.length > 10) { myMessager.show("收件人姓名必?最多可填写10个字"); $("#sname").focus(); return; } if (phone == "" || phone.length > 20) { // myMessager.show("请填写内件详?); myMessager.show("请输入正确电话号?); $("#sphone").focus(); return; } if (/^[0-9-]*$/.test(phone) == false) { myMessager.show("请输入正确电话号?); $("#sphone").focus(); return; } if (phone == "" || phone.length > 20) { myMessager.show("请输入正确电话号?); $("#sphone").focus(); return; } if (company.length > 20) { myMessager.show("收件公司最多可填写20个字"); $("#scompany").focus(); return; } if (address.length < 5 || address.length > 80) { myMessager.show("收件详细地址需大于5个字小于80个字"); $("#saddress").focus(); return; } if (goods == "" || goods.length > 40) { // myMessager.show("请填写内件详?); myMessager.show("内件详细必填,最多可填写40个字"); $("#sgoods").focus(); return; } if (/^[0-9]*$/.test(counts_) == false || counts_ == "0" || counts_ == "") { myMessager.show("件数必须为数?并且大于等于1?); $("#scounts").focus(); return; } if ( parseInt(counts_) > 150) { myMessager.show("件数最多为150?); $("#scounts").focus(); return; } //10000 if ( parseFloat(weight) > 10000) { myMessager.show("重量最大为10000kg"); $("#sweight").focus(); return; } if (parseFloat(weight) < 0.2) { myMessager.show("重量不能小于0.2kg"); $("#sweight").focus(); return; } // 重量weight // weight=parseFloat(weight).toFixed(1); weight=Math.round(weight*10)/10; // if (sum_ == "") { sum_ = 0; } // sum_=parseFloat(sum_).toFixed(1); sum_=Math.round(sum_*10)/10; if (monney_ == "") { monney_ = 0; } //monney_=parseFloat(monney_).toFixed(1); // Math.round(num*100)/100 monney_=Math.round(monney_*10)/10; //alert("代收货款"+sum_); if (sum_.length > 0 && /^[0-9.]*$/.test(sum_) == false) { myMessager.show("代收货款必须为数?); $("#ssum").focus(); return; } //5000 if (parseFloat(sum_)>5000) { myMessager.show("代收货款只能为数字且小于5000"); $("#ssum").focus(); return; } //保价服务 if (/^[0-9.]*$/.test(monney_) == false) { myMessager.show("保价服务必须为数?); $("#smonney").focus(); return; } // 报价服务最大值限制wq200000保留以为小数? if (monney_>200000) { myMessager.show("保价服务只能为数字且小于200000"); $("#smonney").focus(); return; } if (descs.length > 40 ) { myMessager.show("备注最多可填写40个字"); $("#sdescs").focus(); return; } var t = { ID: $("#numbersort").val(), 运单编号: billcode, 收件人姓? name, 收件人联系电? phone, 收件人公? company, 收件详细地址: address, 件数: counts_, 重量: weight, 内件详情: goods, 付款方式: payway, 代收货款: sum_, 保价服务: monney_, 签回? back, 备注: descs }; var n; for (var i = results.length - 1; i >= 0; i--) { if (results[i] == selectedItems[0]) { results.splice(i, 1, t); } } setData(results); $('#modals').modal('hide'); }) //历史记录 var loginuser = localStorage.getItem("username") $('#historyBtn').on('click', function () { window.open('../POrder/orderHistory.aspx?us=' + loginuser, '', '_blank'); // $('#historyModal').modal({ show: true }); // $('#startTime').val(''); // $('#endTime').val(''); // setTimeout(function () { // if ($.zui.store.get("phone") != undefined) {//登录 // var $btn = $("#checkHistoryBtn"); // $btn.button('loading'); // var _data = new Array(); // $.ajax({ // url: 'service/service.ashx', // data: { fun: 'getbillsbyopenid', openid: $.zui.store.get("phone") }, // method: 'post', // success: function (res) { // $btn.button('reset'); // if (res != "") { // _data = JSON.parse(res); // } // else { // _data = new Array(); // } // $('#historydg').datagrid({//历史记录 // data: _data, // loadMsg: '正在加载?..' // }); // } // }); // } // else {//不登? // var $btn = $("#checkHistoryBtn"); // $btn.button('loading'); // var _data = new Array(); // if ($.zui.store.get("history") != undefined) { // _data = $.zui.store.get("history"); // } // $('#historydg').datagrid({//历史记录 // data: _data, // loadMsg: '正在加载?..' // }); // $btn.button('reset'); // } // }, 500); }); //关闭历史记录 $('#closeHisBtn').on('click', function () { $('#historyModal').modal('hide'); }); //查询历史记录 $("#checkHistoryBtn").on('click', function () { var sT = document.getElementById('startTime').value + ":00"; var eT = document.getElementById('endTime').value + ":59"; if (document.getElementById('startTime').value == "" || document.getElementById('endTime').value == "") { myMessager.show("请输入开始时间和结束时间"); return; } var d1 = new Date(sT.replace(/\-/g, "\/")); var d2 = new Date(eT.replace(/\-/g, "\/")); if (d1 > d2) { myMessager.show("开始时间不能大于结束时?); return; } if ($.zui.store.get("phone") != undefined) {//登录 var $btn = $("#checkHistoryBtn"); $btn.button('loading'); var _data = new Array(); $.ajax({ url: 'service/service.ashx', data: { fun: 'getbillsbytime', openid: $.zui.store.get("phone"), starttime: sT, endtime: eT }, method: 'post', success: function (res) { $btn.button('reset'); if (res != "") { _data = JSON.parse(res); } else { _data = new Array(); } $('#historydg').datagrid({//历史记录 data: _data, loadMsg: '正在加载?..' }); } }); } else { var $btn = $("#checkHistoryBtn"); $btn.button('loading'); var _data = new Array(); if ($.zui.store.get("history") != undefined) { _data = $.zui.store.get("history"); } var result = new Array(); for (var i = 0; i < _data.length; i++) { if (new Date(_data[i].上传时间.replace(/\-/g, "\/")) >= d1 && new Date(_data[i].上传时间.replace(/\-/g, "\/")) <= d2) { result.push(_data[i]); } } $('#historydg').datagrid({//历史记录查询结果 data: result, loadMsg: '正在加载?..' }); $btn.button('reset'); } }); //地址薄选择 $("#addressbtn").on('click', function () { //if ($.zui.store.get("phone") != undefined) {//登录 //初始化? // $("#addressName").val(""); // $("#addressPhone").val(""); // $("#addressCompany").val(""); // $("#addressNumber").val(""); $('#addressModal').modal('show'); //初始化数据源 // setTimeout(function () { // checkAddressData("", "", "", "", $.zui.store.get("phone")); // }, 300); // } // else { // location.href = "login.html"; // } }); //地址薄查询事? $("#addressCheckBtn").on('click', function () { //if ($.zui.store.get("phone") != undefined) {//登录 //alert("rertrtrt***" + $("#addressName").val()) checkAddressData($("#addressName").val(), $("#addressPhone").val(), $("#addressCompany").val(), $("#addressNumber").val(), $.zui.store.get("phone")); // } // else {//没登? //if ($.zui.store.get("address") != undefined && $.zui.store.get("address") != "") { // var orgAddress = json.parse($.zui.store.get("address")); //} //} }); //地址薄删除事件显示删除框 $("#delAddressBtn").on('click', function () { var rows = $('#addressTable').datagrid("getSelections"); if (rows.length == 0) { myMessager.show("请选择要删除的收件信息"); return; } $('#adstipModal').modal('show'); }); //地址薄正式删除数? $("#delAddressBtns").on('click', function () { var rows = $('#addressTable').datagrid("getSelections"); var id = ""; for (var i = 0; i < rows.length; i++) { id += rows[i].Idno + ","; } var $btn = $("#delAddressBtns"); $btn.button('loading'); //if ($.zui.store.get("phone") != undefined) {//登录 $.ajax({ url: 'service/service.ashx', data: { fun: 'deladdress', id: id }, method: 'post', success: function (res) { $btn.button('reset'); if (res == "1") { myMessager.show("删除成功"); $('#adstipModal').modal('hide'); checkAddressData("", "", "", "", $.zui.store.get("phone")); //绑定数据? } else { myMessager.show("删除失败"); } } }); // } // else { // } }) //地址薄正式新增或者编辑数据保? $("#amAddressBtn").on('click', function () { var numbers = $("#amNumber").val().replace(/(^\s*)|(\s*$)/g, ""); var name = $("#amName").val().replace(/(^\s*)|(\s*$)/g, ""); var phone = $("#amPhone").val().replace(/(^\s*)|(\s*$)/g, ""); var company = $("#amCompany").val().replace(/(^\s*)|(\s*$)/g, ""); var area = $("#amAddressCity").val().replace(/(^\s*)|(\s*$)/g, ""); var street = $("#amAddress").val().replace(/(^\s*)|(\s*$)/g, ""); //amNumber var PageCode = $("#amNumber").val().replace(/(^\s*)|(\s*$)/g, ""); var loginuser = localStorage.getItem("username") //alert("anNeme"+name); if (name == "") { myMessager.show("收件人姓名为必填?); $("#amName").focus(); return; } if (/^[0-9-]*$/.test(phone)== false || phone == "") { myMessager.show("请输入正确收件人电话"); $("#amPhone").focus(); return; } if (phone == "" || phone.length > 20) { myMessager.show("请输入正确收件人电话"); $("#amPhone").focus(); return; } if (area.length == 0) { myMessager.show("请选择完整省市?); $("#amAddressCity").focus(); return; } if (street.length < 5) { myMessager.show("收件详细地址长度至少?个字"); $("#amAddress").focus(); return; } if (street.length + area.length > 80) { myMessager.show("所在区?详细地址长度不能超过80个字"); $("#amAddress").focus(); return; } // if (company != "" && company.length < 5) { // myMessager.show("收件人公司长度至少为5?); // $("#amCompany").focus(); // return; // } if (numbers != "" && /^[0-9]*$/.test(numbers) == false) { myMessager.show("收件人编号只能输入数?); $("#amNumber").focus(); return; } var _area = area.split("-"); var pro = _area[0]; var city = _area[1]; var dis = _area[2]; var $btn = $("#amAddressBtn"); $btn.button('loading'); //var retString = responseData.toString(); //if (retString.indexOf("success") >= 0) { // if ($.zui.store.get("phone") != undefined) {//登录 if (isAdd) { //新增 $.ajax({ url: 'service/service.ashx', data: { fun: 'addaddress', openid: $.zui.store.get("phone"), name: name, company: company, numbers: numbers, phone: phone, pro: pro, city: city, area: dis, street: street, PageCode: PageCode, loginuser: loginuser }, method: 'post', success: function (res) { $btn.button('reset'); if (res == "1") { myMessager.show("保存成功"); $('#amModal').modal('hide'); //显示操作? checkAddressData("", "", "", "", $.zui.store.get("phone")); } else if (res == "5") { myMessager.show("收件人编号已经存?); } else if (res == "6") { myMessager.show("地址薄信息超?5?); } else { myMessager.show("保存失败"); } } }); } else {//编辑 $.ajax({ url: 'service/service.ashx', data: { fun: 'editaddress', id: id, name: name, company: company, numbers: numbers, phone: phone, pro: pro, city: city, area: dis, street: street, openid: $.zui.store.get("phone"), loginuser: loginuser }, method: 'post', success: function (res) { $btn.button('reset'); if (res == "1") { myMessager.show("保存成功"); $('#amModal').modal('hide'); //显示操作? checkAddressData("", "", "", "", $.zui.store.get("phone")); } else if (res == "5") { myMessager.show("收件人编号已经存?); } else { myMessager.show("保存失败"); } } }); } // } // else { // } }); //地址薄确认选择数据 $("#cancelSelectBtn").on('click', function () { var rows = $('#addressTable').datagrid("getSelections"); //alert("rows**" + rows); if (rows.length == 0) { myMessager.show("请先选择数据"); return; } for (var i = 0; i < rows.length; i++) { rows[i].运单编号 = ""; rows[i].付款方式 = "C-付现"; rows[i].代收货款 = "0"; rows[i].件数 = "1"; rows[i].保价服务 = "0"; rows[i].备注 = "?; rows[i].签回?= "?; rows[i].货物品名 = ""; rows[i].重量 = "1"; } results = rows; setData(results); //设置数据? $('#addressModal').modal('hide'); }); }); ///查询地址薄数? function checkAddressData(name, phone, company, numbers, openid) { //查询数据 var $btn = $("#addressCheckBtn"); var loginuser = localStorage.getItem("username") $btn.button('loading'); var _data = new Array(); // if ($.zui.store.get("phone") != undefined) {//登录 $.ajax({ url: 'service/service.ashx', data: { fun: 'checkaddress', openid: openid, name: name, company: company, numbers: numbers, phone: phone, loginuser: loginuser }, method: 'post', success: function (res) { //alert("查询,res " + res); $btn.button('reset'); if (res != "") { _data = JSON.parse(res); } else { _data = new Array(); } // alert("查询,_data " + _data); // if(_data==""? // { // _data = new Array(); // // } $('#addressTable').datagrid({//地址薄信? data: _data, loadMsg: '正在加载?..' }); } }); // } // else { // } } //新增修改地址?-显示? var id = 0;//修改时候的id var item = new Object();//修改时候的数据 var isAdd = true;//判断是新增还是修? function amAddressFun(flg) { if (flg == "add") { isAdd = true; document.getElementById("addressTitle").innerText = "新增数据"; $("#amNumber").val(""); $("#amName").val(""); $("#amPhone").val(""); $("#amCompany").val(""); $("#amAddress").val(""); $("#amAddressCity").val(""); $('#amModal').modal('show');//显示操作? } else { isAdd = false; document.getElementById("addressTitle").innerText = "修改数据"; var rows = $('#addressTable').datagrid("getSelections"); if (rows.length == 0) { myMessager.show("请选择要编辑的收件信息"); return; } if (rows.length > 1) { myMessager.show("请选择一条收件信息进行编?); return; } $('#amModal').modal('show');//显示操作? item = rows[0]; id = rows[0].Idno; $("#amNumber").val(rows[0].编号); $("#amName").val(rows[0].收件人姓?; $("#amPhone").val(rows[0].收件人联系电?; $("#amCompany").val(rows[0].收件人公?; $("#amAddress").val(rows[0].收件详细地址.replace(rows[0].?== null ? "" : rows[0].? "").replace(rows[0].?== null ? "" : rows[0].? "").replace(rows[0].?== null ? "" : rows[0].? "")); $("#amAddressCity").val(rows[0].?+ "-" + rows[0].?+ "-" + rows[0].?; } } //验证整数和小数保留一?重量 function validateWeight(obj) { var t = $(obj).val(); if (/^[0-9]\d*(\.[0-9])?$/.test(t)) { if (t == "0") { $(obj).val("0.1"); return; } if (parseInt(t) > 10000) { $(obj).val("10000"); return; } } else { $(obj).val("0.1"); } } //客户编号转大? function toUpCustCode(obj) { var t = $(obj).val(); $(obj).val(t.toUpperCase()); } //设置收件人信息数据源 function setData(dataSource) { //alert("results"+dataSource); if (dataSource==null) { //var dt=new dataSource(); //alert("results"+dataSource); var arr= new Array(); $('#dg').datagrid({ data:arr, //method:'post', loadMsg: '正在加载?..' }); $('#dg').datagrid('reload'); //window.location.reload(); }else { $('#dg').datagrid({ data: dataSource, loadMsg: '正在加载?..' }); } } //获取当前时间 function setTime() { var times = new Date(); var month = parseInt(times.getMonth() + 1); var dates = times.getDate(); var hours = times.getHours(); var minutes = times.getMinutes(); if (month < 10) { month = "0" + month; } if (dates < 10) { dates = "0" + dates; } if (hours < 10) { hours = "0" + hours; } if (minutes < 10) { minutes = "0" + minutes; } return times.getFullYear() + "/" + month + "/" + dates + " " + hours + ":" + minutes + ":00"; } //设置当天时间 function setTimes(flg) { var times = new Date(); var month = parseInt(times.getMonth() + 1); var dates = times.getDate(); if (month < 10) { month = "0" + month; } if (dates < 10) { dates = "0" + dates; } if (flg == "0") { return times.getFullYear() + "/" + month + "/" + dates + " 00:00"; } else { return times.getFullYear() + "/" + month + "/" + dates + " 23:59"; } } //导入excel function inExcel(obj) { importf(obj); } /* FileReader共有4种读取方法: 1.readAsArrayBuffer(file):将文件读取为ArrayBuffer? 2.readAsBinaryString(file):将文件读取为二进制字符? 3.readAsDataURL(file):将文件读取为Data URL 4.readAsText(file, [encoding]):将文件读取为文本,encoding缺省值为'UTF-8' */ var results = []; var wb;//读取完成的数? var rABS = false; //是否将文件读取为二进制字符串 function fixdata(data) { //文件流转BinaryString var o = "", l = 0, w = 10240; for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w))); o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w))); return o; } function importf(obj) {//导入 var page_flag="0"; if (document.getElementById("files").files[0].name.indexOf(".xls") < 0 && document.getElementById("files").files[0].name.indexOf(".xlsx") < 0) { $(obj).val(""); myMessager.show("请选择excel文件!"); return; } try { $("#errorlist").hide(); var f = document.getElementById("files").files[0]; var reader = new FileReader(); reader.onload = function (e) { var data = e.target.result; if (rABS) { wb = XLSX.read(btoa(fixdata(data)), {//手动转化 type: 'base64' }); } else { wb = XLSX.read(data, { type: 'binary' }); } //wb.SheetNames[0]是获取Sheets中第一个Sheet的名? //wb.Sheets[Sheet名]获取第一个Sheet的数? results = []; barcodes = []; results = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); if (results.length > 0) { // 判断是否超过200白条数据 if (results.length > 200) { new $.zui.Messager("批量导入最多导?00?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } $(obj).val(""); // 创建地址解析器实? for (var i = 0; i < results.length; i++) { var k = i; results[i].ID = i + 1; if (results[i].运单编号 == undefined || (results[i].运单编号.replace(/(^\s*)|(\s*$)/g, "").length != 12 )) { new $.zui.Messager('? + parseInt(k + 2) + "行中【运单编号】不正确,只支持12!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].运单编号.toString().substring(0, 3) != '600') { new $.zui.Messager('? + parseInt(k + 2) + "行中【运单编号】不正确,请以?00】开?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (/^[0-9]*$/.test(results[i].运单编号.toString()) == false) { new $.zui.Messager('? + parseInt(k + 2) + "行中【运单编号】运单号必须为数?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag = "1"; results = null; return; } if (results[i].运单编号.toString().length == 12) { //取前11? var strFirst11 = results[i].运单编号.toString().substring(0, 11); var intLast1 = results[i].运单编号.toString().substring(results[i].运单编号.toString().length - 1, results[i].运单编号.toString().length); var intMode = (strFirst11 % 7); if (intLast1 != intMode) { new $.zui.Messager('? + parseInt(k + 2) + "行中【运单编号】运单号错误请重新输?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; setData(results); return; } } if (customernumber.length > 0 && /^[A-Za-z]*$/.test(customernumber) == true) { myMessager.show("客户编号不能全为字母"); $("#customernumber").focus(); page_flag="1"; results=null; return; } if (customernumber.length > 0 && /^[0-9]*$/.test(customernumber) == true) { myMessager.show("客户编号不能全为数字"); $("#customernumber").focus(); page_flag="1"; results=null; return; } if (results[i].收件人姓?== undefined || results[i].收件人姓?replace(/(^\s*)|(\s*$)/g, "").length == 0) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件人姓名】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].收件人姓?!= undefined || results[i].收件人姓?replace(/(^\s*)|(\s*$)/g, "").length > 0) { if (RegExp(/先生/).test(results[i].收件人姓? || RegExp(/小姐/).test(results[i].收件人姓? || RegExp(/女士/).test(results[i].收件人姓?) { new $.zui.Messager('Excel中第' + parseInt(k + 2) + "行【收件人姓名】不可输入“先生、小姐、女士”等称呼”,请重新修改Excel表后导入,谢谢!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; } } if (results[i].收件人姓?!= undefined && results[i].收件人姓?replace(/(^\s*)|(\s*$)/g, "").length > 10) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件人姓名】超出最大输入长?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].收件人联系电?== undefined||results[i].收件人联系电?replace(/(^\s*)|(\s*$)/g, "").length ==0) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件人联系电话】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].收件人联系电?!= undefined) { var phone = results[i].收件人联系电?replace(/\s+/g, ""); if ((/^[0-9-]*$/.test(phone.replace(/(^\s*)|(\s*$)/g, "")) == false)) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件人联系电话】不正确!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag = "1"; results = null; return; } } if (results[i].收件人联系电?!= undefined && results[i].收件人联系电?replace(/(^\s*)|(\s*$)/g, "").length > 20) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件人联系电话】输入超出最大长?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].收件人公?== undefined) { results[i].收件人公?= ''; } // add wangweiqiu if (results[i].收件人公?!= undefined && results[i].收件人公?replace(/(^\s*)|(\s*$)/g, "").length >20) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件人公司】超出最大输入长?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } //if (results[i].收件省市?== undefined) { // new $.zui.Messager('? + parseInt(k + 2) + "行中【收件省市区】必须填?", { // icon: 'bell', // placement: 'top', // close: false // }).show(); // return; //} if (results[i].收件详细地址 == undefined) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件详细地址】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } // add wangweiqiu if (results[i].收件详细地址 != undefined && results[i].收件详细地址.replace(/(^\s*)|(\s*$)/g, "").length > 80) { new $.zui.Messager('? + parseInt(k + 2) + "行中【收件详细地址】超出最大输入长?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].件数 == undefined) { new $.zui.Messager('? + parseInt(k + 2) + "行中【件数】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].件数.replace(/(^\s*)|(\s*$)/g, "") == "0") { new $.zui.Messager('? + parseInt(k + 2) + "行中【件数】必须为数字,并且大?!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (/^[0-9]*$/.test(results[i].件数.replace(/(^\s*)|(\s*$)/g, "")) == false) { new $.zui.Messager('? + parseInt(k + 2) + "行中【件数】必须为数字,并且大?!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (parseInt(results[i].件数) > 150) { new $.zui.Messager('? + parseInt(k + 2) + "行中【件数】取值不能给大于150!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; setData(resultssss) return; } if (results[i].重量 == undefined) { new $.zui.Messager('? + parseInt(k + 2) + "行中【重量】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].重量.replace(/(^\s*)|(\s*$)/g, "") == "0" || results[i].重量.replace(/(^\s*)|(\s*$)/g, "") == "0.1") { new $.zui.Messager('? + parseInt(k + 2) + "行中【重量】必须为数字,并且大?.1!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (/^[0-9]\d*(\.[0-9])?$/.test(results[i].重量.replace(/(^\s*)|(\s*$)/g, ""))) { if (parseFloat(results[i].重量.replace(/(^\s*)|(\s*$)/g, "")) > 10000) { new $.zui.Messager('? + parseInt(k + 2) + "行中【重量】必须为数字,并且小于等?0000!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } } if (/^[0-9]\d*(\.[0-9])?$/.test(results[i].重量.replace(/(^\s*)|(\s*$)/g, "")) == false) { new $.zui.Messager('? + parseInt(k + 2) + "行中【重量】必须为数字!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].内件详情 == undefined) { new $.zui.Messager('? + parseInt(k + 2) + "行中【内件详情】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].内件详情 != undefined && results[i].内件详情.replace(/(^\s*)|(\s*$)/g, "") == "") { new $.zui.Messager('? + parseInt(k + 2) + "行中【内件详情】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } // add wangweiqiu if (results[i].内件详情 != undefined && results[i].内件详情.replace(/(^\s*)|(\s*$)/g, "").length > 40) { new $.zui.Messager('? + parseInt(k + 2) + "行中【内件详情】超出最大输入长?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].付款方式 == undefined) { new $.zui.Messager('? + parseInt(k + 2) + "行中【付款方式】必须填?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].付款方式 != undefined) { if (results[i].付款方式.replace(/(^\s*)|(\s*$)/g, "") == "C-付现" || results[i].付款方式.replace(/(^\s*)|(\s*$)/g, "") == "D-到付" || results[i].付款方式.replace(/(^\s*)|(\s*$)/g, "") == "E-出口月结" || results[i].付款方式.replace(/(^\s*)|(\s*$)/g, "") == "O-其他" || results[i].付款方式.replace(/(^\s*)|(\s*$)/g, "") == "T-第三方月?) { } else { new $.zui.Messager('? + parseInt(k + 2) + "行中【付款方式】必须为【C-付现】或【D-到付】或【E-出口月结】或【O-其他】或【T-第三方月结?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } } if (results[i].代收货款 == undefined) { results[i].代收货款 = "0"; } if (results[i].代收货款 != undefined) { if (/^[0-9]\d*(\.[0-9])?$/.test(parseFloat(results[i].代收货款)) == false) { new $.zui.Messager('? + parseInt(k + 2) + "行中【代收货款】必须为数字!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } } if (/^[0-9]\d*(\.[0-9])?$/.test(results[i].代收货款.replace(/(^\s*)|(\s*$)/g, ""))) { if (parseFloat(results[i].代收货款.replace(/(^\s*)|(\s*$)/g, "")) > 5000) { new $.zui.Messager('? + parseInt(k + 2) + "行中【代收货款】必须为数字,并且要小于等于5000!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; setData(results); return; } } if (results[i].保价服务== undefined) { results[i].保价服务 = "0"; } if (results[i].保价服务 != undefined) { if (/^[0-9]\d*(\.[0-9])?$/.test(parseFloat(results[i].保价服务)) == false) { new $.zui.Messager('? + parseInt(k + 2) + "行中【保价服务】必须为数字!", { icon: 'bell', placement: 'top', close: false }).show(); results=null; page_flag="1"; return; } } if (parseFloat(results[i].保价服务.replace(/(^\s*)|(\s*$)/g, "")) > 200000) { new $.zui.Messager('? + parseInt(k + 2) + "行中【保价服务】必须只能为数字且小?00000!", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } if (results[i].签回?== undefined) { results[i].签回?= ""; } if (results[i].签回?!= undefined) { if (results[i].签回?replace(/(^\s*)|(\s*$)/g, "") == "? || results[i].签回?replace(/(^\s*)|(\s*$)/g, "") == "?) { } else { new $.zui.Messager('? + parseInt(k + 2) + "行中【签回单】必须为【是】或【否?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } } if (results[i].备注 == undefined) { results[i].备注 = ""; } if (results[i].备注 != undefined && results[i].备注 != undefined && results[i].备注.replace(/(^\s*)|(\s*$)/g, "").length > 40) { new $.zui.Messager('? + parseInt(k + 2) + "行中【备注】输入超出最大长?", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; return; } } // being for (var i = 0; i < results.length; i++) { barcodes.push(results[i].运单编号) } let nary = barcodes.slice().sort(); for (let i = 0; i < barcodes.length; i++) { if (nary[i] == nary[i + 1]) { //alert("数组重复内容? + nary[i]); new $.zui.Messager("运单编号? + nary[i]+"重复", { icon: 'bell', placement: 'top', close: false }).show(); page_flag="1"; results=null; setData(results); return; } } //end //alert("page_flag"+results); // if (page_flag=="1") { // // setData(results); // results=null; // }else { // // } setData(results); } else { new $.zui.Messager('没有数据,请先填写Excel数据', { icon: 'bell', placement: 'top', close: false }).show(); $(obj).val(""); } }; if (rABS) { reader.readAsArrayBuffer(f); } else { reader.readAsBinaryString(f); } } catch (ex) { new $.zui.Messager("您的浏览器不支持导入功能,请更换浏览器?, { icon: 'bell', placement: 'top', close: false }).show(); $(obj).val(""); } } function exit() { $('#exitModal').modal('show'); } function doexit() { $('#exitModal').modal('hide'); $.zui.store.remove("rr");//用户? $.zui.store.remove("phone");//手机号码或者openid //document.getElementById('login').style.display = ""; document.getElementById('menu').style.display = "none"; } </script>