123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
- <html>
- <head>
- <title>订单列表</title>
- <meta name="decorator" content="default"/>
- <%--<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>--%>
- <style type="text/css">
- *{margin: 0;padding: 0}
- a{list-style: none;text-decoration: none}
- body{background-color: rgb(255,255,255);}
- h3{line-height: 20px;padding:20px 0 20px 15px; border-bottom: 1px solid #CCCCCC;}
- .body-margin{margin:0 26px;}
- .stockorder{margin:0 26px;}
- .left-span{width: 3px;height: 20px;margin-right:10px;background-color: #00A6C7;display: inline-block;vertical-align: bottom}
- .no-pay{padding-left: 15px;font-style: normal}
- .now-status{font-size: 14px}
- .now-status p{padding: 20px}
- .now-status span{display: inline-block;width: 160px;line-height: 35px;margin-right: 15px;cursor: pointer; border:1px solid #CCCCCC;text-align: center;border-radius: 5px}
- .buyInfo{font-size: 14px}
- .the-h{padding:20px 0 20px 15px;border-bottom: 1px solid #CCCCCC;font-size: 16px;font-weight: normal}
- .buyInfo p{ padding: 15px 5px 0;}
- .buyInfo p label{width: 60px;display: inline-block;}
- .buyInfo p span{padding-left: 10px}
- .shopInfo{font-size: 14px}
- .table{width: 100%;border-collapse: collapse;margin-top: 20px}
- .table th{background-color: #CCCCCC}
- .table th,.table td{font-weight: normal;border: 1px solid #CCCCCC;height: 35px;text-align: center}
- .table td .div-img{box-sizing: border-box;}
- .table td .div-img img{width: 100px;height: 100px;vertical-align: middle}
- .table td .div-img span{}
- .orderInfo{}
- .div-order{font-size: 14px;margin-top: 20px}
- .div-order span{width: 260px; display: inline-block;margin-right: 50px}
- .costInfo{position: relative;text-align: right;font-size: 14px;}
- .the-h{text-align:left}
- .text-result{padding: 15px 0}
- .text-result p{padding-top: 15px}
- .mask{color: red;font-size: 14px;margin-top: 20px}
- .text-cost{text-align: left;}
- .text-cost p{padding: 20px 0}
- .moeny-cost{position: absolute;top:70px;right: 0;}
- .moeny-cost p{padding: 10px 0 0 0;text-align: left}
- .moeny-cost p label{display: inline-block;}
- .Staging{background-color: #fff;}
- .Staging table{width: 100%;border-collapse: collapse;margin-top: 20px}
- .Staging table th,.Staging table td{font-weight: normal;border: 1px solid #000;height: 35px;text-align: center;width: 10%;}
- /*修改收货人弹窗*/
- .change-info{position: fixed;top:0%;left: 50%;transform:translateX(-50%);z-index: 999; width: 800px;background-color: #fff;box-shadow: 0px 0px 15px #ccc;}
- .title-same{line-height: 40px;background-color: rgb(102,102,102);color: #fff;padding-left: 15px;}
- .item-div{margin-top: 20px;}
- .item-div label{width: 260px;text-align: right;display: inline-block;margin-right: 50px;}
- .item-div input{width: 300px;line-height: 35px;height: 35px;box-sizing: border-box; border: 1px solid #CCCCCC;display: inline-block}
- .item-div select{width: 90px;height: 35px;margin-right: 10px;}
- .item-div textarea{border: 1px solid #CCCCCC;margin-top: 20px;width: 300px;height: 80px;resize:none;display: block}
- .select-div{display: inline-block;vertical-align: top}
- .item-div .iphone1{width: 80px;}
- .item-div .iphone2{width: 210px;}
- #btn{margin:10px 0 30px 320px;}
- .layer-status{margin-top: 10px;}
- .layer-status span{display: inline-block;width: 80px;line-height: 35px;background-color: #00A6C7;text-align: center;color: #fff;cursor: pointer}
- .layer-status span:nth-of-type(1){}
- .layer-status span:nth-of-type(2){margin-left: 72px;}
- /*取消订单*/
- .same-style{position: fixed;top: 20%;left: 50%;transform: translateX(-50%); width: 500px;background-color: #fff;z-index: 999;box-shadow: 0 0 15px #666;}
- .warn-title{color: red;padding: 15px 20px;font-size: 14px;}
- .reason-cancel{font-size: 14px;padding: 0 20px;}
- .reason-cancel label{margin-right: 20px;}
- .reason-cancel textarea{width: 270px;height: 80px; resize: none;vertical-align: text-top;border: 1px solid #CCCCCC}
- .btn-same{text-align: center;margin-bottom: 10px;}
- .productInfo{float: left;width: 100%}
- .productInfo-left{float: left;width:30%}
- .productInfo-right{float: right;width:70%}
- #myModal{display: none;}
- .errorSN{margin-left: 20px;color:crimson}
- </style>
- </head>
- <body>
- <div class="bj" style="display: none"></div>
- <%--取消订单--%>
- <div class="cancelOrder same-style" style="display: none">
- <div class="title-same">取消订单</div>
- <p class="warn-title">建议取消之前,电话通知买家,达成一致意见。</p>
- <div class="reason-cancel">
- <label><i>*</i>取消原因</label>
- <textarea maxlength="100" style="resize:none" id="cancelReason"></textarea>
- </div>
- <div class="layer-status btn-same">
- <span class="btn1 btn1comfir">确定</span>
- <span class="btn2">取消</span>
- </div>
- </div>
- <%--修改收货人信息--%>
- <form id="form">
- <div class="change-info" style="display: none">
- <div class="info-title title-same">修改收货人信息</div>
- <div class="item-div">
- <label><i>*</i>收货人姓名</label>
- <input type="text" name="shouHuoRen" value="${orderUserInfo.shouHuoRen}"/>
- </div>
- <div class="item-div">
- <label><i>*</i>收货地址</label>
- <div class="select-div">
- <input type="hidden" name="id" value="${orderUserInfo.id }">
- <input type="hidden" name="orderID" value="${orderID}">
- <input type="hidden" name="shopOrderID" value="${shopOrderID}">
- <input type="hidden" id="curProvince" name="curProvince" value="${orderUserInfo.province }">
- <input type="hidden" id="curCity" name="curCity" value="${orderUserInfo.city }">
- <input type="hidden" id="curTown" name="curTown" value="${orderUserInfo.town }">
- <select class="input-xlarge required" id="province" name="province"
- onchange="loadCity()" style="width:100px;">
- </select>
- <select class="input-xlarge required" id="city" onchange="loadTown()" name="city"
- style="width:100px;">
- </select>
- <select class="input-xlarge required" id="town" name="town" style="width:100px;">
- </select>
- <textarea name="address" value="${orderUserInfo.address}">${orderUserInfo.address}</textarea>
- </div>
- </div>
- <div class="item-div">
- <label><i>*</i>电话号码</label>
- <input class="iphone1" type="text" name="phone" value="${orderUserInfo.phone}"/>
- </div>
- <div class="item-div">
- <label><i>*</i>手机号</label>
- <input type="text" name="mobile" value="${orderUserInfo.mobile}"/>
- </div>
- <div class="layer-status" id="btn">
- <span class="btn1 btnComfir" >确定</span>
- <span class="btn2">取消</span>
- </div>
- </div>
- </form>
- <div class="body-margin">
- <h3><span class="left-span"></span>订单列表--确认订单</h3>
- <div class="now-status">
- <p>当前订单状态:<i class="no-pay">
- <c:if test="${not empty orderID}"> <%-- 展示主订单状态 --%>
- ${fns:getDictLabel(order.status,"order_status","" )}
- <c:if test="${order.status == 6}">
- <br>取消原因: ${order.closeReason}</br>
- </c:if>
- </c:if>
- <c:if test="${not empty shopOrderID}"> <%-- 展示子订单状态 --%>
- ${fns:getDictLabel(shopOrder.status,"order_status","" )}
- <c:if test="${shopOrder.status == 6}">
- <br>取消原因: ${order.closeReason}</br>
- </c:if>
- </c:if>
- </i></p>
- <c:if test="${not empty orderID}">
- <c:if test="${order.status == 0}"> <%-- 待付款 --%>
- <span class="cancel-btn">取消订单</span>
- <span class="changeInfo">修改收货人信息</span>
- <span><a href="${ctx}/order/normalOrderModify?id=${order.orderID}">修改商品信息</a></span>
- </c:if>
- </c:if>
- <c:if test="${not empty shopOrderID}">
- <c:if test="${not empty snOrderProducts && snOrderProducts.size() > 0 && (shopOrder.status == 2 || shopOrder.status == 4)}">
- <c:choose>
- <c:when test="${not empty listSign && listSign.size() > 0 }">
- <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" onclick="values('修改SN码')">修改SN码</button>
- </c:when>
- <c:otherwise>
- <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" onclick="values('填写SN码')">填写SN码</button>
- </c:otherwise>
- </c:choose>
- </c:if>
- <c:if test="${shopOrder.status == 2}"> <%-- 待发货 --%>
- <span><a href="${ctx}/order/toDeliveryPage?shopOrderID=${shopOrderID}">发货</a></span>
- <span class="changeInfo">修改收货人信息</span>
- </c:if>
- <c:if test="${shopOrder.status == 4}"> <%-- 部分发货 --%>
- <span><a href="${ctx}/order/toDeliveryPage?shopOrderID=${shopOrderID}">发货</a></span>
- <span><a href="${ctx}/order/logisticsList?shopOrderID=${shopOrderID}">添加物流</a></span>
- <span><a href="${ctx}/order/logisticsDetails?shopOrderID=${shopOrderID}">查看物流</a></span>
- </c:if>
- <c:if test="${shopOrder.status == 3}"> <%-- 待收货 --%>
- <%--<span><a href="${ctx}/order/toDeliveryPage?shopOrderID=${shopOrderID}">发货</a></span>--%>
- <span><a href="${ctx}/order/logisticsList?shopOrderID=${shopOrderID}">添加物流</a></span>
- <span><a href="${ctx}/order/logisticsDetails?shopOrderID=${shopOrderID}">查看物流</a></span>
- <span><a href="${ctx}/order/confirmReceipt?shopOrderID=${shopOrderID}">确认收货</a></span>
- </c:if>
- <c:if test="${shopOrder.status == 5}"> <%-- 交易成功 --%>
- <span><a href="${ctx}/order/deleteOrder?shopOrderID=${shopOrderID}" onclick="return confirmx('确认要删除吗?', this.href)" >删除订单</a></span>
- </c:if>
- <c:if test="${shopOrder.status == 6}"> <%-- 交易关闭 --%>
- <span><a href="${ctx}/order/deleteOrder?shopOrderID=${shopOrderID}" onclick="return confirmx('确认要删除吗?', this.href)" >删除订单</a></span>
- </c:if>
- </c:if>
- </div>
- <div class="buyInfo">
- <h4 class="the-h">买家信息</h4>
- <p><label>买家:</label><span>${orderUserInfo.name}</span></p>
- <p><label>收货人:</label><span>${orderUserInfo.shouHuoRen}</span></p>
- <p><label>手机号码:</label><span>${orderUserInfo.mobile}</span></p>
- <p><label>收货地址:</label><span>${fns:appendLast(fns:appendLast1(orderUserInfo.province,orderUserInfo.city,orderUserInfo.town), orderUserInfo.address)}</span></p>
- </div>
- <div class="shopInfo">
- <h4 class="the-h">商品信息</h4>
- <table class="table">
- <tr>
- <th>商品信息</th>
- <th>SN码</th>
- <th>单价</th>
- <th>数量</th>
- <th>优惠</th>
- <th>成本价</th>
- <th>库存</th>
- <th>小计</th>
- </tr>
- <c:forEach items="${orderProducts}" var="op">
- <tr>
- <td>
- <div class="div-img">
- <a href="${fns:getConfig('wwwServer')}product-${op.productID}.html" target="_blank"><img src="${op.image}" /></a>
- <span title="${op.name}">${fns:abbr(op.name,15)}</span>
- </div>
- </td>
- <td>
- <c:choose>
- <c:when test="${op.cmProductSnList.size() > 0}">
- <c:forEach items="${op.cmProductSnList}" var="snBean">
- <span>${snBean.snCode}</span><br/>
- </c:forEach>
- </c:when>
- <c:otherwise>
- <span>此产品无SN码</span><br/>
- </c:otherwise>
- </c:choose>
- </td>
- <td>${op.price}</td>
- <td>${op.num}</td>
- <td>${op.preferential}</td>
- <td>${op.costPrice}</td>
- <td>${op.stock}</td>
- <td>${op.totalFee}</td>
- </tr>
- </c:forEach>
- </table>
- </div>
- <div class="orderInfo">
- <h4 class="the-h">订单信息</h4>
- <div class="div-order">
- <span>订单编号:${order.orderNo}</span>
- <c:if test="${order.newShopOrders.size() > 1}">
- <c:if test="${ not empty shopOrder}">
- <span>子订单编号:${shopOrder.shopOrderNo}</span>
- </c:if>
- <c:if test="${ empty shopOrder}">
- <c:forEach items="${order.newShopOrders}" var="so">
- <span>子订单编号:${so.shopOrderNo}</span>
- </c:forEach>
- </c:if>
- </c:if>
- </div>
- <div class="div-order">
- <span>支付方式:${order.payWay}</span>
- <span>下单时间:${order.orderTime}</span>
- <span>来源:
- ${fns:getDictLabel(order.orderSource,"bp_orderSource","" )}
- </span>
- </div>
- <div class="div-order">
- <span>付款时间:${order.payTime}</span>
- </div>
- <div class="div-order">
- <span>买家留言:
- <c:if test="${ not empty shopOrder}">
- ${shopOrder.note}
- </c:if>
- <c:if test="${ empty shopOrder}">
- <c:forEach items="${order.newShopOrders}" var="s">
- <p>${s.note}</p>
- </c:forEach>
- </c:if></span>
- </div>
- <div class="div-order">
- <span>发票信息:
- <c:if test="${not empty order.orderInvoice}">
- <%--0不开发票 1普通发票 2增值税发票--%>
- <c:if test="${order.orderInvoice.type eq 1}">
- <%--发票抬头类型 0个人 1 企业'--%>
- <c:if test="${order.orderInvoice.invoiceTitleType eq 0}">
- <div class="div-order">
- <span>发票抬头:${order.orderInvoice.invoiceTitle}</span>
- </div>
- </c:if>
- <c:if test="${order.orderInvoice.invoiceTitleType eq 1}">
- <div class="div-order">
- <span>发票抬头:${order.orderInvoice.invoiceTitle}</span>
- </div>
- <div class="div-order">
- <span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span>
- </div>
- </c:if>
- </c:if>
- <c:if test="${order.orderInvoice.type eq 2}">
- <div class="div-order">
- <span>单位名称:${order.orderInvoice.invoiceTitle}</span>
- </div>
- <div class="div-order">
- <span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span>
- </div>
- <div class="div-order">
- <span>注册地址:${order.orderInvoice.registeredAddress}</span>
- </div>
- <div class="div-order">
- <span>注册电话:${order.orderInvoice.registeredPhone}</span>
- </div>
- <div class="div-order">
- <span>开户银行:${order.orderInvoice.openBank}</span>
- </div>
- <div class="div-order">
- <span>银行账号:${order.orderInvoice.bankAccountNo}</span>
- </div>
- </c:if>
- </c:if>
- </span>
- </div>
- </div>
- <div class="costInfo">
- <h4 class="the-h">费用信息</h4>
- <div class="text-result">
- <p><label>商品总金额:</label>¥
- <c:if test="${ not empty shopOrder}">
- ${shopOrder.productAmount}
- </c:if>
- <c:if test="${ empty shopOrder}">
- ${order.productTotalFee}
- </c:if>
- </p> -
- <span> 发票税额:¥
- <c:if test="${ not empty shopOrder}">
- ${shopOrder.totalAddedValueTax}
- </c:if>
- <c:if test="${ empty shopOrder}">
- 0
- </c:if>
- </span> +
- <span> 配送费用:¥
- <c:if test="${ not empty shopOrder}">
- <c:if test="${shopOrder.fee == -1}">
- 到付
- </c:if>
- <c:if test="${shopOrder.fee == 0}">
- 包邮
- </c:if>
- <c:if test="${shopOrder.fee != -1 && shopOrder.fee != 0}">
- ¥${shopOrder.fee}
- </c:if>
- </c:if>
- <c:if test="${ empty shopOrder}">
- <c:if test="${order.freePostFlag == -1}">
- 到付
- </c:if>
- <c:if test="${order.freePostFlag == 0}">
- 包邮
- </c:if>
- <c:if test="${order.freePostFlag == -2}">
- 仪器到付-产品包邮
- </c:if>
- <c:if test="${order.freePostFlag == 1}">
- ¥${order.freight}
- </c:if>
- </c:if>
- </span>-
- <span> 折扣:¥
- <c:if test="${ not empty shopOrder}">
- ${shopOrder.preferential}
- </c:if>
- <c:if test="${ empty shopOrder}">
- ${order.preferential}
- </c:if>
- </span>-
- <span> 余额支付:¥
- <c:if test="${ not empty shopOrder}">
- ${shopOrder.accountAmount}
- </c:if>
- <c:if test="${ empty shopOrder}">
- ${order.balancePayFee}
- </c:if>
- </span>
- <p>=
- <%--订单总额:¥--%>
- <%--<c:if test="${ not empty shopOrder}">--%>
- <%--${shopOrder.totalAmount + ((shopOrder.fee == 0 || shopOrder.fee == -1) ? 0 : shopOrder.fee)}--%>
- <%--</c:if>--%>
- <%--<c:if test="${ empty shopOrder}">--%>
- <%--${order.orderTotalFee}--%>
- <%--</c:if>--%>
- 应付总额:¥
- <c:if test="${ not empty shopOrder}">
- ${shopOrder.needPayAmount}
- </c:if>
- <c:if test="${ empty shopOrder}">
- ${order.payTotalFee}
- </c:if>
- </p>
- </div>
- </div>
- </div>
- <!-- 模态框(Modal) -->
- <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetForm()">×</button>
- <h4 class="modal-title" id="myModalLabel">SN码</h4>
- </div>
- <div class="modal-body">
- <form id="orderProductData">
- <input type="hidden" name="orderNo" value="${orderProducts.get(0).orderNo}"/>
- <input type="hidden" name="orderID" value="${orderProducts.get(0).orderID}"/>
- <input type="hidden" name="shopOrderID" value="${orderProducts.get(0).shopOrderID}"/>
- <input type="hidden" name="shopOrderNo" value="${orderProducts.get(0).shopOrderNo}"/>
- <input type="hidden" name="productID" value="${orderProducts.get(0).productID}"/>
- </form>
- <form id="signData">
- <c:forEach items="${snOrderProducts}" var="product">
- <div class="productInfo">
- <div class="productInfo-left">
- <img src="${product.productImage}">
- </div>
- <div class="productInfo-right">
- <span>${product.name}</span><br/>
- <span>数量:x${product.num}</span><br/>
- <c:forEach items="${product.cmProductSnList}" var="sign" varStatus="status">
- <input type="text" id="dataSN${status.index}" name="${product.orderProductID}" value="${sign.snCode}" onblur="RepeatSN('dataSN${status.index}','${product.productID}','${sign.snID}','errorSN${status.index}')"/><span class="errorSN" id="errorSN${status.index}"></span><br/>
- </c:forEach>
- </div>
- </div>
- </c:forEach>
- </form>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="resetForm()">关闭</button>
- <button type="button" class="btn btn-primary" onclick="saveProductSN()">确认</button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal -->
- </div>
- <script type="text/javascript">
- window.onload=function (){
- var ifam_ = window.parent.document.getElementById('mainFrame').contentWindow;//ifram 代理需要
- var cancelBtn = ifam_.document.getElementsByClassName('cancel-btn');//取消订单
- var btn2_ = ifam_.document.getElementsByClassName('btn2');//取消按钮 -- 弹窗
- var confirm_ = document.getElementsByClassName('confirm'); //确认订单
- var confirmOrder_ = document.getElementsByClassName('same-style'); //确认按钮
- // var hidden_ =document.getElementById('hidden').value;//判断用户是那种状态 (确认按钮的弹窗)
- var close_ = document.getElementsByClassName('close');
- console.log(window.parent.document.getElementById('mainFrame').contentWindow.document.getElementsByClassName('changeInfo'))
- if(ifam_.document.getElementsByClassName('changeInfo').length == 0){
- }else{
- var changeInfo_ = ifam_.document.getElementsByClassName('changeInfo');//修改收货人消息
- changeInfo_[0].onclick = function () {
- ifam_.document.getElementsByClassName('change-info')[0].style.cssText = 'display:block';
- };
- }
- for(var i=0;i<cancelBtn.length;i++){
- cancelBtn[i].onclick = function () {
- ifam_.document.getElementsByClassName('cancelOrder')[0].style.cssText = 'display:block';
- ifam_.document.getElementsByClassName('bj')[0].style.cssText = 'display:block';
- }
- }
- for(var i=0;i<btn2_.length;i++){
- btn2_[i].onclick = function () {
- ifam_.document.getElementsByClassName('bj')[0].style.cssText = 'display:none';
- ifam_.document.getElementsByClassName('change-info')[0].style.cssText = 'display:none';
- for(var j=0;j<confirmOrder_.length;j++){
- confirmOrder_[j].style.cssText = 'display:none';
- }
- }
- }
- // confirm_[0].onclick =function () {
- // document.getElementsByClassName('bj')[0].style.cssText = 'display:none';
- // if(hidden_ == 1){
- // document.getElementsByClassName('confirmOrder1')[0].style.cssText = 'display:block';
- // }else if(hidden_ == 2){
- // document.getElementsByClassName('confirmOrder2')[0].style.cssText = 'display:block';
- // }
- // };
- // for(var i=0;i<close_.length;i++){
- // close_[i].onclick = function () {
- // for(var j=0;j<confirmOrder_.length;j++){
- // document.getElementsByClassName('same-style')[j].style.cssText = 'display:none';
- // }
- // }
- // }
- ifam_.document.getElementsByClassName("btnComfir")[0].onclick = function() {
- $.ajax({
- url: "${ctx}/order/orderUserInfo/update",
- type: "POST",
- dataType: "json",
- data: $("#form").serialize(),
- success: function (res) {
- if (res.success) {
- if(res.orderID != "") {
- window.location.href = "${ctx}/order/detailPage?id=" + res.orderID;
- }
- if (res.shopOrderID != "") {
- window.location.href = "${ctx}/order/detailPage?shopOrderID=" + res.shopOrderID;
- }
- } else {
- alert(res.msg);
- }
- }
- });
- };
- ifam_.document.getElementsByClassName("btn1")[0].onclick = function() {
- var cancelReason = ifam_.document.getElementById("cancelReason").value;
- if (!cancelReason) {
- alertx("请填写取消原因");
- return;
- }
- window.location.href = "${ctx}/order/cancelOrder?orderID=${order.orderID}&shopOrderID=${shopOrderID}¬e=" + cancelReason;
- }
- };
- // 验证重复元素,有重复返回true;否则返回false
- function isRepeat(arr) {
- var hash = {};
- for (var i in arr) {
- if (hash[arr[i]]){
- return true;
- }
- hash[arr[i]] = true;
- }
- return false;
- }
- function saveProductSN() {
- var errMsg = $('.errorSN').text();
- if(errMsg != undefined && errMsg != ""){
- return;
- }
- var signData = $("#signData").serializeArray();
- var ary = new Array();
- for(var i=0;i<signData.length;i++){
- var value = signData[i].value;
- if(value != null && value != ""){
- ary.push(value);
- }
- }
- if(isRepeat(ary)){
- alertx("SN码存在重复!")
- return
- }
- var orderProductData = $("#orderProductData").serializeArray();
- $.ajax({
- url: "${ctx}/order/cmProductSn/saveSn",
- type: "POST",
- dataType: "json",
- data: {
- signData :JSON.stringify(signData),
- orderProductData:JSON.stringify(orderProductData)
- },
- success: function (res) {
- debugger
- if (res.status) {
- window.location.href = "${ctx}/order/detailPage?shopOrderID=${shopOrderID}";
- }else{
- alert("操作失败");
- }
- }
- });
- }
- function values(value){
- $('.modal-title').text(value);
- }
- function RepeatSN(dataID,productID,snID,tipID){
- var snCode = $("#"+dataID).val();
- if(snCode == "" || snCode == undefined){
- return;
- }
- $.ajax({
- url: "${ctx}/order/cmProductSn/repeatSN",
- type: "POST",
- dataType: "json",
- data: {
- snCode :snCode,
- productID:productID,
- snID:snID
- },
- success: function (res) {
- if(!res.status){
- $("#"+tipID).text(res.msg);
- }else{
- $("#"+tipID).text("");
- }
- }
- });
- }
- function resetForm(){
- document.getElementById("signData").reset();
- $(".errorSN").text("");
- }
- </script>
- <script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/loadAddress.js"></script>
- </body>
- </html>
|