normalOrderDetail.jsp 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>订单列表</title>
  6. <meta name="decorator" content="default"/>
  7. <%--<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>--%>
  8. <style type="text/css">
  9. *{margin: 0;padding: 0}
  10. a{list-style: none;text-decoration: none}
  11. body{background-color: rgb(255,255,255);}
  12. h3{line-height: 20px;padding:20px 0 20px 15px; border-bottom: 1px solid #CCCCCC;}
  13. .body-margin{margin:0 26px;}
  14. .stockorder{margin:0 26px;}
  15. .left-span{width: 3px;height: 20px;margin-right:10px;background-color: #00A6C7;display: inline-block;vertical-align: bottom}
  16. .no-pay{padding-left: 15px;font-style: normal}
  17. .now-status{font-size: 14px}
  18. .now-status p{padding: 20px}
  19. .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}
  20. .buyInfo{font-size: 14px}
  21. .the-h{padding:20px 0 20px 15px;border-bottom: 1px solid #CCCCCC;font-size: 16px;font-weight: normal}
  22. .buyInfo p{ padding: 15px 5px 0;}
  23. .buyInfo p label{width: 60px;display: inline-block;}
  24. .buyInfo p span{padding-left: 10px}
  25. .shopInfo{font-size: 14px}
  26. .table{width: 100%;border-collapse: collapse;margin-top: 20px}
  27. .table th{background-color: #CCCCCC}
  28. .table th,.table td{font-weight: normal;border: 1px solid #CCCCCC;height: 35px;text-align: center}
  29. .table td .div-img{box-sizing: border-box;}
  30. .table td .div-img img{width: 100px;height: 100px;vertical-align: middle}
  31. .table td .div-img span{}
  32. .orderInfo{}
  33. .div-order{font-size: 14px;margin-top: 20px}
  34. .div-order span{width: 260px; display: inline-block;margin-right: 50px}
  35. .costInfo{position: relative;text-align: right;font-size: 14px;}
  36. .the-h{text-align:left}
  37. .text-result{padding: 15px 0}
  38. .text-result p{padding-top: 15px}
  39. .mask{color: red;font-size: 14px;margin-top: 20px}
  40. .text-cost{text-align: left;}
  41. .text-cost p{padding: 20px 0}
  42. .moeny-cost{position: absolute;top:70px;right: 0;}
  43. .moeny-cost p{padding: 10px 0 0 0;text-align: left}
  44. .moeny-cost p label{display: inline-block;}
  45. .Staging{background-color: #fff;}
  46. .Staging table{width: 100%;border-collapse: collapse;margin-top: 20px}
  47. .Staging table th,.Staging table td{font-weight: normal;border: 1px solid #000;height: 35px;text-align: center;width: 10%;}
  48. /*修改收货人弹窗*/
  49. .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;}
  50. .title-same{line-height: 40px;background-color: rgb(102,102,102);color: #fff;padding-left: 15px;}
  51. .item-div{margin-top: 20px;}
  52. .item-div label{width: 260px;text-align: right;display: inline-block;margin-right: 50px;}
  53. .item-div input{width: 300px;line-height: 35px;height: 35px;box-sizing: border-box; border: 1px solid #CCCCCC;display: inline-block}
  54. .item-div select{width: 90px;height: 35px;margin-right: 10px;}
  55. .item-div textarea{border: 1px solid #CCCCCC;margin-top: 20px;width: 300px;height: 80px;resize:none;display: block}
  56. .select-div{display: inline-block;vertical-align: top}
  57. .item-div .iphone1{width: 80px;}
  58. .item-div .iphone2{width: 210px;}
  59. #btn{margin:10px 0 30px 320px;}
  60. .layer-status{margin-top: 10px;}
  61. .layer-status span{display: inline-block;width: 80px;line-height: 35px;background-color: #00A6C7;text-align: center;color: #fff;cursor: pointer}
  62. .layer-status span:nth-of-type(1){}
  63. .layer-status span:nth-of-type(2){margin-left: 72px;}
  64. /*取消订单*/
  65. .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;}
  66. .warn-title{color: red;padding: 15px 20px;font-size: 14px;}
  67. .reason-cancel{font-size: 14px;padding: 0 20px;}
  68. .reason-cancel label{margin-right: 20px;}
  69. .reason-cancel textarea{width: 270px;height: 80px; resize: none;vertical-align: text-top;border: 1px solid #CCCCCC}
  70. .btn-same{text-align: center;margin-bottom: 10px;}
  71. .productInfo{float: left;width: 100%}
  72. .productInfo-left{float: left;width:30%}
  73. .productInfo-right{float: right;width:70%}
  74. #myModal{display: none;}
  75. .errorSN{margin-left: 20px;color:crimson}
  76. </style>
  77. </head>
  78. <body>
  79. <div class="bj" style="display: none"></div>
  80. <%--取消订单--%>
  81. <div class="cancelOrder same-style" style="display: none">
  82. <div class="title-same">取消订单</div>
  83. <p class="warn-title">建议取消之前,电话通知买家,达成一致意见。</p>
  84. <div class="reason-cancel">
  85. <label><i>*</i>取消原因</label>
  86. <textarea maxlength="100" style="resize:none" id="cancelReason"></textarea>
  87. </div>
  88. <div class="layer-status btn-same">
  89. <span class="btn1 btn1comfir">确定</span>
  90. <span class="btn2">取消</span>
  91. </div>
  92. </div>
  93. <%--修改收货人信息--%>
  94. <form id="form">
  95. <div class="change-info" style="display: none">
  96. <div class="info-title title-same">修改收货人信息</div>
  97. <div class="item-div">
  98. <label><i>*</i>收货人姓名</label>
  99. <input type="text" name="shouHuoRen" value="${orderUserInfo.shouHuoRen}"/>
  100. </div>
  101. <div class="item-div">
  102. <label><i>*</i>收货地址</label>
  103. <div class="select-div">
  104. <input type="hidden" name="id" value="${orderUserInfo.id }">
  105. <input type="hidden" name="orderID" value="${orderID}">
  106. <input type="hidden" name="shopOrderID" value="${shopOrderID}">
  107. <input type="hidden" id="curProvince" name="curProvince" value="${orderUserInfo.province }">
  108. <input type="hidden" id="curCity" name="curCity" value="${orderUserInfo.city }">
  109. <input type="hidden" id="curTown" name="curTown" value="${orderUserInfo.town }">
  110. <select class="input-xlarge required" id="province" name="province"
  111. onchange="loadCity()" style="width:100px;">
  112. </select>
  113. <select class="input-xlarge required" id="city" onchange="loadTown()" name="city"
  114. style="width:100px;">
  115. </select>
  116. <select class="input-xlarge required" id="town" name="town" style="width:100px;">
  117. </select>
  118. <textarea name="address" value="${orderUserInfo.address}">${orderUserInfo.address}</textarea>
  119. </div>
  120. </div>
  121. <div class="item-div">
  122. <label><i>*</i>电话号码</label>
  123. <input class="iphone1" type="text" name="phone" value="${orderUserInfo.phone}"/>
  124. </div>
  125. <div class="item-div">
  126. <label><i>*</i>手机号</label>
  127. <input type="text" name="mobile" value="${orderUserInfo.mobile}"/>
  128. </div>
  129. <div class="layer-status" id="btn">
  130. <span class="btn1 btnComfir" >确定</span>
  131. <span class="btn2">取消</span>
  132. </div>
  133. </div>
  134. </form>
  135. <div class="body-margin">
  136. <h3><span class="left-span"></span>订单列表--确认订单</h3>
  137. <div class="now-status">
  138. <p>当前订单状态:<i class="no-pay">
  139. <c:if test="${not empty orderID}"> <%-- 展示主订单状态 --%>
  140. ${fns:getDictLabel(order.status,"order_status","" )}
  141. <c:if test="${order.status == 6}">
  142. <br>取消原因: ${order.closeReason}</br>
  143. </c:if>
  144. </c:if>
  145. <c:if test="${not empty shopOrderID}"> <%-- 展示子订单状态 --%>
  146. ${fns:getDictLabel(shopOrder.status,"order_status","" )}
  147. <c:if test="${shopOrder.status == 6}">
  148. <br>取消原因: ${order.closeReason}</br>
  149. </c:if>
  150. </c:if>
  151. </i></p>
  152. <c:if test="${not empty orderID}">
  153. <c:if test="${order.status == 0}"> <%-- 待付款 --%>
  154. <span class="cancel-btn">取消订单</span>
  155. <span class="changeInfo">修改收货人信息</span>
  156. <span><a href="${ctx}/order/normalOrderModify?id=${order.orderID}">修改商品信息</a></span>
  157. </c:if>
  158. </c:if>
  159. <c:if test="${not empty shopOrderID}">
  160. <c:if test="${not empty snOrderProducts && snOrderProducts.size() > 0 && (shopOrder.status == 2 || shopOrder.status == 4)}">
  161. <c:choose>
  162. <c:when test="${not empty listSign && listSign.size() > 0 }">
  163. <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" onclick="values('修改SN码')">修改SN码</button>
  164. </c:when>
  165. <c:otherwise>
  166. <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" onclick="values('填写SN码')">填写SN码</button>
  167. </c:otherwise>
  168. </c:choose>
  169. </c:if>
  170. <c:if test="${shopOrder.status == 2}"> <%-- 待发货 --%>
  171. <span><a href="${ctx}/order/toDeliveryPage?shopOrderID=${shopOrderID}">发货</a></span>
  172. <span class="changeInfo">修改收货人信息</span>
  173. </c:if>
  174. <c:if test="${shopOrder.status == 4}"> <%-- 部分发货 --%>
  175. <span><a href="${ctx}/order/toDeliveryPage?shopOrderID=${shopOrderID}">发货</a></span>
  176. <span><a href="${ctx}/order/logisticsList?shopOrderID=${shopOrderID}">添加物流</a></span>
  177. <span><a href="${ctx}/order/logisticsDetails?shopOrderID=${shopOrderID}">查看物流</a></span>
  178. </c:if>
  179. <c:if test="${shopOrder.status == 3}"> <%-- 待收货 --%>
  180. <%--<span><a href="${ctx}/order/toDeliveryPage?shopOrderID=${shopOrderID}">发货</a></span>--%>
  181. <span><a href="${ctx}/order/logisticsList?shopOrderID=${shopOrderID}">添加物流</a></span>
  182. <span><a href="${ctx}/order/logisticsDetails?shopOrderID=${shopOrderID}">查看物流</a></span>
  183. <span><a href="${ctx}/order/confirmReceipt?shopOrderID=${shopOrderID}">确认收货</a></span>
  184. </c:if>
  185. <c:if test="${shopOrder.status == 5}"> <%-- 交易成功 --%>
  186. <span><a href="${ctx}/order/deleteOrder?shopOrderID=${shopOrderID}" onclick="return confirmx('确认要删除吗?', this.href)" >删除订单</a></span>
  187. </c:if>
  188. <c:if test="${shopOrder.status == 6}"> <%-- 交易关闭 --%>
  189. <span><a href="${ctx}/order/deleteOrder?shopOrderID=${shopOrderID}" onclick="return confirmx('确认要删除吗?', this.href)" >删除订单</a></span>
  190. </c:if>
  191. </c:if>
  192. </div>
  193. <div class="buyInfo">
  194. <h4 class="the-h">买家信息</h4>
  195. <p><label>买家:</label><span>${orderUserInfo.name}</span></p>
  196. <p><label>收货人:</label><span>${orderUserInfo.shouHuoRen}</span></p>
  197. <p><label>手机号码:</label><span>${orderUserInfo.mobile}</span></p>
  198. <p><label>收货地址:</label><span>${fns:appendLast(fns:appendLast1(orderUserInfo.province,orderUserInfo.city,orderUserInfo.town), orderUserInfo.address)}</span></p>
  199. </div>
  200. <div class="shopInfo">
  201. <h4 class="the-h">商品信息</h4>
  202. <table class="table">
  203. <tr>
  204. <th>商品信息</th>
  205. <th>SN码</th>
  206. <th>单价</th>
  207. <th>数量</th>
  208. <th>优惠</th>
  209. <th>成本价</th>
  210. <th>库存</th>
  211. <th>小计</th>
  212. </tr>
  213. <c:forEach items="${orderProducts}" var="op">
  214. <tr>
  215. <td>
  216. <div class="div-img">
  217. <a href="${fns:getConfig('wwwServer')}product-${op.productID}.html" target="_blank"><img src="${op.image}" /></a>
  218. <span title="${op.name}">${fns:abbr(op.name,15)}</span>
  219. </div>
  220. </td>
  221. <td>
  222. <c:choose>
  223. <c:when test="${op.cmProductSnList.size() > 0}">
  224. <c:forEach items="${op.cmProductSnList}" var="snBean">
  225. <span>${snBean.snCode}</span><br/>
  226. </c:forEach>
  227. </c:when>
  228. <c:otherwise>
  229. <span>此产品无SN码</span><br/>
  230. </c:otherwise>
  231. </c:choose>
  232. </td>
  233. <td>${op.price}</td>
  234. <td>${op.num}</td>
  235. <td>${op.preferential}</td>
  236. <td>${op.costPrice}</td>
  237. <td>${op.stock}</td>
  238. <td>${op.totalFee}</td>
  239. </tr>
  240. </c:forEach>
  241. </table>
  242. </div>
  243. <div class="orderInfo">
  244. <h4 class="the-h">订单信息</h4>
  245. <div class="div-order">
  246. <span>订单编号:${order.orderNo}</span>
  247. <c:if test="${order.newShopOrders.size() > 1}">
  248. <c:if test="${ not empty shopOrder}">
  249. <span>子订单编号:${shopOrder.shopOrderNo}</span>
  250. </c:if>
  251. <c:if test="${ empty shopOrder}">
  252. <c:forEach items="${order.newShopOrders}" var="so">
  253. <span>子订单编号:${so.shopOrderNo}</span>
  254. </c:forEach>
  255. </c:if>
  256. </c:if>
  257. </div>
  258. <div class="div-order">
  259. <span>支付方式:${order.payWay}</span>
  260. <span>下单时间:${order.orderTime}</span>
  261. <span>来源:
  262. ${fns:getDictLabel(order.orderSource,"bp_orderSource","" )}
  263. </span>
  264. </div>
  265. <div class="div-order">
  266. <span>付款时间:${order.payTime}</span>
  267. </div>
  268. <div class="div-order">
  269. <span>买家留言:
  270. <c:if test="${ not empty shopOrder}">
  271. ${shopOrder.note}
  272. </c:if>
  273. <c:if test="${ empty shopOrder}">
  274. <c:forEach items="${order.newShopOrders}" var="s">
  275. <p>${s.note}</p>
  276. </c:forEach>
  277. </c:if></span>
  278. </div>
  279. <div class="div-order">
  280. <span>发票信息:
  281. <c:if test="${not empty order.orderInvoice}">
  282. <%--0不开发票 1普通发票 2增值税发票--%>
  283. <c:if test="${order.orderInvoice.type eq 1}">
  284. <%--发票抬头类型 0个人 1 企业'--%>
  285. <c:if test="${order.orderInvoice.invoiceTitleType eq 0}">
  286. <div class="div-order">
  287. <span>发票抬头:${order.orderInvoice.invoiceTitle}</span>
  288. </div>
  289. </c:if>
  290. <c:if test="${order.orderInvoice.invoiceTitleType eq 1}">
  291. <div class="div-order">
  292. <span>发票抬头:${order.orderInvoice.invoiceTitle}</span>
  293. </div>
  294. <div class="div-order">
  295. <span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span>
  296. </div>
  297. </c:if>
  298. </c:if>
  299. <c:if test="${order.orderInvoice.type eq 2}">
  300. <div class="div-order">
  301. <span>单位名称:${order.orderInvoice.invoiceTitle}</span>
  302. </div>
  303. <div class="div-order">
  304. <span>纳税人识别号:${order.orderInvoice.corporationTaxNum}</span>
  305. </div>
  306. <div class="div-order">
  307. <span>注册地址:${order.orderInvoice.registeredAddress}</span>
  308. </div>
  309. <div class="div-order">
  310. <span>注册电话:${order.orderInvoice.registeredPhone}</span>
  311. </div>
  312. <div class="div-order">
  313. <span>开户银行:${order.orderInvoice.openBank}</span>
  314. </div>
  315. <div class="div-order">
  316. <span>银行账号:${order.orderInvoice.bankAccountNo}</span>
  317. </div>
  318. </c:if>
  319. </c:if>
  320. </span>
  321. </div>
  322. </div>
  323. <div class="costInfo">
  324. <h4 class="the-h">费用信息</h4>
  325. <div class="text-result">
  326. <p><label>商品总金额:</label>¥
  327. <c:if test="${ not empty shopOrder}">
  328. ${shopOrder.productAmount}
  329. </c:if>
  330. <c:if test="${ empty shopOrder}">
  331. ${order.productTotalFee}
  332. </c:if>
  333. </p> -
  334. <span> 发票税额:¥
  335. <c:if test="${ not empty shopOrder}">
  336. ${shopOrder.totalAddedValueTax}
  337. </c:if>
  338. <c:if test="${ empty shopOrder}">
  339. 0
  340. </c:if>
  341. </span> +
  342. <span> 配送费用:¥
  343. <c:if test="${ not empty shopOrder}">
  344. <c:if test="${shopOrder.fee == -1}">
  345. 到付
  346. </c:if>
  347. <c:if test="${shopOrder.fee == 0}">
  348. 包邮
  349. </c:if>
  350. <c:if test="${shopOrder.fee != -1 && shopOrder.fee != 0}">
  351. ¥${shopOrder.fee}
  352. </c:if>
  353. </c:if>
  354. <c:if test="${ empty shopOrder}">
  355. <c:if test="${order.freePostFlag == -1}">
  356. 到付
  357. </c:if>
  358. <c:if test="${order.freePostFlag == 0}">
  359. 包邮
  360. </c:if>
  361. <c:if test="${order.freePostFlag == -2}">
  362. 仪器到付-产品包邮
  363. </c:if>
  364. <c:if test="${order.freePostFlag == 1}">
  365. ¥${order.freight}
  366. </c:if>
  367. </c:if>
  368. </span>-
  369. <span> 折扣:¥
  370. <c:if test="${ not empty shopOrder}">
  371. ${shopOrder.preferential}
  372. </c:if>
  373. <c:if test="${ empty shopOrder}">
  374. ${order.preferential}
  375. </c:if>
  376. </span>-
  377. <span> 余额支付:¥
  378. <c:if test="${ not empty shopOrder}">
  379. ${shopOrder.accountAmount}
  380. </c:if>
  381. <c:if test="${ empty shopOrder}">
  382. ${order.balancePayFee}
  383. </c:if>
  384. </span>
  385. <p>=
  386. <%--订单总额:¥--%>
  387. <%--<c:if test="${ not empty shopOrder}">--%>
  388. <%--${shopOrder.totalAmount + ((shopOrder.fee == 0 || shopOrder.fee == -1) ? 0 : shopOrder.fee)}--%>
  389. <%--</c:if>--%>
  390. <%--<c:if test="${ empty shopOrder}">--%>
  391. <%--${order.orderTotalFee}--%>
  392. <%--</c:if>--%>
  393. 应付总额:¥
  394. <c:if test="${ not empty shopOrder}">
  395. ${shopOrder.needPayAmount}
  396. </c:if>
  397. <c:if test="${ empty shopOrder}">
  398. ${order.payTotalFee}
  399. </c:if>
  400. </p>
  401. </div>
  402. </div>
  403. </div>
  404. <!-- 模态框(Modal) -->
  405. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
  406. <div class="modal-dialog">
  407. <div class="modal-content">
  408. <div class="modal-header">
  409. <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetForm()">&times;</button>
  410. <h4 class="modal-title" id="myModalLabel">SN码</h4>
  411. </div>
  412. <div class="modal-body">
  413. <form id="orderProductData">
  414. <input type="hidden" name="orderNo" value="${orderProducts.get(0).orderNo}"/>
  415. <input type="hidden" name="orderID" value="${orderProducts.get(0).orderID}"/>
  416. <input type="hidden" name="shopOrderID" value="${orderProducts.get(0).shopOrderID}"/>
  417. <input type="hidden" name="shopOrderNo" value="${orderProducts.get(0).shopOrderNo}"/>
  418. <input type="hidden" name="productID" value="${orderProducts.get(0).productID}"/>
  419. </form>
  420. <form id="signData">
  421. <c:forEach items="${snOrderProducts}" var="product">
  422. <div class="productInfo">
  423. <div class="productInfo-left">
  424. <img src="${product.productImage}">
  425. </div>
  426. <div class="productInfo-right">
  427. <span>${product.name}</span><br/>
  428. <span>数量:x${product.num}</span><br/>
  429. <c:forEach items="${product.cmProductSnList}" var="sign" varStatus="status">
  430. <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/>
  431. </c:forEach>
  432. </div>
  433. </div>
  434. </c:forEach>
  435. </form>
  436. </div>
  437. <div class="modal-footer">
  438. <button type="button" class="btn btn-default" data-dismiss="modal" onclick="resetForm()">关闭</button>
  439. <button type="button" class="btn btn-primary" onclick="saveProductSN()">确认</button>
  440. </div>
  441. </div><!-- /.modal-content -->
  442. </div><!-- /.modal -->
  443. </div>
  444. <script type="text/javascript">
  445. window.onload=function (){
  446. var ifam_ = window.parent.document.getElementById('mainFrame').contentWindow;//ifram 代理需要
  447. var cancelBtn = ifam_.document.getElementsByClassName('cancel-btn');//取消订单
  448. var btn2_ = ifam_.document.getElementsByClassName('btn2');//取消按钮 -- 弹窗
  449. var confirm_ = document.getElementsByClassName('confirm'); //确认订单
  450. var confirmOrder_ = document.getElementsByClassName('same-style'); //确认按钮
  451. // var hidden_ =document.getElementById('hidden').value;//判断用户是那种状态 (确认按钮的弹窗)
  452. var close_ = document.getElementsByClassName('close');
  453. console.log(window.parent.document.getElementById('mainFrame').contentWindow.document.getElementsByClassName('changeInfo'))
  454. if(ifam_.document.getElementsByClassName('changeInfo').length == 0){
  455. }else{
  456. var changeInfo_ = ifam_.document.getElementsByClassName('changeInfo');//修改收货人消息
  457. changeInfo_[0].onclick = function () {
  458. ifam_.document.getElementsByClassName('change-info')[0].style.cssText = 'display:block';
  459. };
  460. }
  461. for(var i=0;i<cancelBtn.length;i++){
  462. cancelBtn[i].onclick = function () {
  463. ifam_.document.getElementsByClassName('cancelOrder')[0].style.cssText = 'display:block';
  464. ifam_.document.getElementsByClassName('bj')[0].style.cssText = 'display:block';
  465. }
  466. }
  467. for(var i=0;i<btn2_.length;i++){
  468. btn2_[i].onclick = function () {
  469. ifam_.document.getElementsByClassName('bj')[0].style.cssText = 'display:none';
  470. ifam_.document.getElementsByClassName('change-info')[0].style.cssText = 'display:none';
  471. for(var j=0;j<confirmOrder_.length;j++){
  472. confirmOrder_[j].style.cssText = 'display:none';
  473. }
  474. }
  475. }
  476. // confirm_[0].onclick =function () {
  477. // document.getElementsByClassName('bj')[0].style.cssText = 'display:none';
  478. // if(hidden_ == 1){
  479. // document.getElementsByClassName('confirmOrder1')[0].style.cssText = 'display:block';
  480. // }else if(hidden_ == 2){
  481. // document.getElementsByClassName('confirmOrder2')[0].style.cssText = 'display:block';
  482. // }
  483. // };
  484. // for(var i=0;i<close_.length;i++){
  485. // close_[i].onclick = function () {
  486. // for(var j=0;j<confirmOrder_.length;j++){
  487. // document.getElementsByClassName('same-style')[j].style.cssText = 'display:none';
  488. // }
  489. // }
  490. // }
  491. ifam_.document.getElementsByClassName("btnComfir")[0].onclick = function() {
  492. $.ajax({
  493. url: "${ctx}/order/orderUserInfo/update",
  494. type: "POST",
  495. dataType: "json",
  496. data: $("#form").serialize(),
  497. success: function (res) {
  498. if (res.success) {
  499. if(res.orderID != "") {
  500. window.location.href = "${ctx}/order/detailPage?id=" + res.orderID;
  501. }
  502. if (res.shopOrderID != "") {
  503. window.location.href = "${ctx}/order/detailPage?shopOrderID=" + res.shopOrderID;
  504. }
  505. } else {
  506. alert(res.msg);
  507. }
  508. }
  509. });
  510. };
  511. ifam_.document.getElementsByClassName("btn1")[0].onclick = function() {
  512. var cancelReason = ifam_.document.getElementById("cancelReason").value;
  513. if (!cancelReason) {
  514. alertx("请填写取消原因");
  515. return;
  516. }
  517. window.location.href = "${ctx}/order/cancelOrder?orderID=${order.orderID}&shopOrderID=${shopOrderID}&note=" + cancelReason;
  518. }
  519. };
  520. // 验证重复元素,有重复返回true;否则返回false
  521. function isRepeat(arr) {
  522. var hash = {};
  523. for (var i in arr) {
  524. if (hash[arr[i]]){
  525. return true;
  526. }
  527. hash[arr[i]] = true;
  528. }
  529. return false;
  530. }
  531. function saveProductSN() {
  532. var errMsg = $('.errorSN').text();
  533. if(errMsg != undefined && errMsg != ""){
  534. return;
  535. }
  536. var signData = $("#signData").serializeArray();
  537. var ary = new Array();
  538. for(var i=0;i<signData.length;i++){
  539. var value = signData[i].value;
  540. if(value != null && value != ""){
  541. ary.push(value);
  542. }
  543. }
  544. if(isRepeat(ary)){
  545. alertx("SN码存在重复!")
  546. return
  547. }
  548. var orderProductData = $("#orderProductData").serializeArray();
  549. $.ajax({
  550. url: "${ctx}/order/cmProductSn/saveSn",
  551. type: "POST",
  552. dataType: "json",
  553. data: {
  554. signData :JSON.stringify(signData),
  555. orderProductData:JSON.stringify(orderProductData)
  556. },
  557. success: function (res) {
  558. debugger
  559. if (res.status) {
  560. window.location.href = "${ctx}/order/detailPage?shopOrderID=${shopOrderID}";
  561. }else{
  562. alert("操作失败");
  563. }
  564. }
  565. });
  566. }
  567. function values(value){
  568. $('.modal-title').text(value);
  569. }
  570. function RepeatSN(dataID,productID,snID,tipID){
  571. var snCode = $("#"+dataID).val();
  572. if(snCode == "" || snCode == undefined){
  573. return;
  574. }
  575. $.ajax({
  576. url: "${ctx}/order/cmProductSn/repeatSN",
  577. type: "POST",
  578. dataType: "json",
  579. data: {
  580. snCode :snCode,
  581. productID:productID,
  582. snID:snID
  583. },
  584. success: function (res) {
  585. if(!res.status){
  586. $("#"+tipID).text(res.msg);
  587. }else{
  588. $("#"+tipID).text("");
  589. }
  590. }
  591. });
  592. }
  593. function resetForm(){
  594. document.getElementById("signData").reset();
  595. $(".errorSN").text("");
  596. }
  597. </script>
  598. <script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/loadAddress.js"></script>
  599. </body>
  600. </html>