|
@@ -2,30 +2,28 @@
|
|
|
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
|
|
|
<html>
|
|
|
<head>
|
|
|
- <title>订单列表</title>
|
|
|
+ <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}
|
|
|
i{font-style: normal}
|
|
|
body{background-color: rgb(255,255,255);}
|
|
|
h3{line-height: 20px;padding:20px 0 20px 15px; border-bottom: 1px solid #CCCCCC;font-weight: normal}
|
|
|
- .body-margin{margin:0 26px;}
|
|
|
+ .body-margin{margin:26px}
|
|
|
.left-span{width: 3px;height: 20px;margin-right:10px;background-color: #00A6C7;display: inline-block;vertical-align: bottom}
|
|
|
.bj{position: fixed;width: 100%;height: 100%;bottom: 0;top:0;left: 0;z-index: 99;}
|
|
|
- .shop-info{}
|
|
|
+ .delivery-info{padding: 15px;background-color: #f5f5f5;}
|
|
|
.shop-title{ color: #000;border-bottom: 1px solid #ccc;padding: 20px;margin-bottom: 20px;}
|
|
|
.table{width: 100%;border-collapse: collapse;}
|
|
|
.table th{color: #000;font-weight: normal}
|
|
|
.table th,.table td{width: 25%;height: 35px;border: 1px solid #CCCCCC;text-align: center;padding: 5px 0;}
|
|
|
.table td img{width: 60px;height: 60px;vertical-align: middle}
|
|
|
.express-delivery{font-size: 14px;}
|
|
|
- .express-div{padding: 20px;}
|
|
|
+ .express-div{padding:10px 0;}
|
|
|
.express-div label{width: 100px;line-height: 35px;display: inline-block;vertical-align: middle}
|
|
|
.select-btn{display: inline-block;}
|
|
|
.select-btn input{width: 210px;height: 35px; vertical-align: top;box-sizing: border-box !important;}
|
|
|
- /*.select-btn .span_jia{display: inline-block;float: none;margin-left: 0; width: 35px;height: 35px;line-height: 33px; box-sizing: border-box; vertical-align: top; border: 1px solid #ccc;cursor: pointer; text-align: center;font-size: 24px;border-radius: 4px;}*/
|
|
|
.the-span{display: inline-block;float: none;margin-left: 0; width: 35px;height: 35px;line-height: 33px; box-sizing: border-box; vertical-align: top; border: 1px solid #ccc;cursor: pointer; text-align: center;font-size: 24px;border-radius: 4px;}
|
|
|
input::-webkit-input-placeholder {text-align: center}
|
|
|
.mask{padding:20px 20px 20px 120px;font-size: 14px;position:relative;}
|
|
@@ -45,7 +43,6 @@
|
|
|
.change-info{position: fixed;top: 20%;left: 50%;transform:translateX(-50%);z-index: 999;padding: 50px;background-color: #fff;box-shadow: 0px 0px 15px #ccc;}
|
|
|
.mar-css{margin-left: 5px !important;}
|
|
|
.controls{font-size:0}
|
|
|
- .select2-choice{width:100px}
|
|
|
.upload-content{position:relative;}
|
|
|
.upload-content *{margin:0;padding:0;}
|
|
|
.upload-content .conList{display:inline-block;margin-right:5px;width:90px;height:90px;background:#e6e6e6;border-radius:5px;position:relative;overflow:hidden}
|
|
@@ -58,216 +55,18 @@
|
|
|
.hide-pic{display:none !important}
|
|
|
.upload-tips{margin:10px 0}
|
|
|
</style>
|
|
|
- <script type="text/javascript">
|
|
|
- var op_html = "";
|
|
|
- window.onload = function () {
|
|
|
- var spanjia_ = document.getElementsByClassName('span_jia');
|
|
|
- var express_ = document.getElementsByClassName('express-delivery');
|
|
|
- var danjia_ = document.getElementsByClassName('dan_jia');
|
|
|
- var shipnum_ = document.getElementsByClassName('ship-num');
|
|
|
- var input_ = document.getElementsByClassName('input')//数量输入框
|
|
|
- var confirm_ = document.getElementsByClassName('confirm');//确定按钮
|
|
|
- var expressDelivery_ = document.getElementsByClassName('express-delivery');//循环物流
|
|
|
- var masktext_ = document.getElementsByClassName('mask-text');//备注
|
|
|
- var singlenum_= document.getElementsByClassName('single-num');//新建输入框判断
|
|
|
- var obj = {};
|
|
|
- // var valuearr = {};
|
|
|
- var expressval = document.getElementsByTagName('select');//物流快递
|
|
|
- var index = expressval[0].selectedIndex ;//索引值
|
|
|
- var value = expressval[0].options[index].value;
|
|
|
- var arr = [];
|
|
|
- for(var i=0;i<expressval[0].options.length;i++){
|
|
|
- var valuearr = {};
|
|
|
- valuearr['name'] = expressval[0].options[i].text;
|
|
|
- valuearr['value'] = expressval[0].options[i].value;
|
|
|
- arr.push(valuearr);
|
|
|
- }
|
|
|
- //新建输入框判断
|
|
|
-
|
|
|
- for(var i=0;i<singlenum_.length;i++){
|
|
|
-
|
|
|
- }
|
|
|
- //输入框判断
|
|
|
- for(var i=0;i<input_.length;i++){
|
|
|
- input_[i].onchange = function () {
|
|
|
- var intval = this.value;
|
|
|
- var buynum = this.parentNode.parentNode.getElementsByClassName('buy-num');//购买数量
|
|
|
- var sent_ = this.parentNode.parentNode.getElementsByClassName('sent');//已发数量
|
|
|
- if(parseInt(intval)+parseInt(sent_[0].innerHTML) >=parseInt(buynum[0].innerHTML)){
|
|
|
- document.getElementsByClassName('bj')[0].style.cssText = 'display:block';
|
|
|
- document.getElementsByClassName('change-info')[0].style.cssText = 'display:block';
|
|
|
- setTimeout(function () {
|
|
|
- document.getElementsByClassName('bj')[0].style.cssText = 'display:none';
|
|
|
- document.getElementsByClassName('change-info')[0].style.cssText = 'display:none';
|
|
|
- },1000);
|
|
|
- this.value = 0
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //物流加减
|
|
|
- for(var i=0;i<spanjia_.length;i++){
|
|
|
- spanjia_[i].onclick =function () {
|
|
|
-
|
|
|
- var html=''
|
|
|
- html+='<div class="express-delivery border-express">';
|
|
|
- html+='<div class="express-div">';
|
|
|
- html+='<label><i>*</i>快递公司</label>';
|
|
|
- html+='<div class="select-btn">';
|
|
|
- html+='<select class="express-input required input-xlarge">';
|
|
|
- for(var i=0;i<arr.length;i++){
|
|
|
- html+='<option value="'+arr[i].value+'">'+arr[i].name;
|
|
|
- html+='</option>';
|
|
|
- }
|
|
|
- html+='</select>';
|
|
|
- html+='<span onclick="jian(this)" class="span_jian mar-css the-span">-</span>';
|
|
|
- html+='</div>';
|
|
|
- html+='</div>';
|
|
|
- html+='<div class="express-div">';
|
|
|
- html+='<label><i>*</i>物流编号</label>';
|
|
|
- html+='<div class="select-btn">';
|
|
|
- html+='<input class="single-num" type="text" placeholder="请输入单号">';
|
|
|
- html+='<span onclick="danjia(this)" class="dan_jia mar-css the-span">+</span>';
|
|
|
- html+='</div>';
|
|
|
- html+='</div>';
|
|
|
- html+='</div>';
|
|
|
-
|
|
|
- express_[0].insertAdjacentHTML('afterend', html);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //物流单号
|
|
|
- for(var i=0;i<spanjia_.length;i++){
|
|
|
- danjia_[i].onclick =function () {
|
|
|
- danjia(this)
|
|
|
- }
|
|
|
- }
|
|
|
- //列表信息展示
|
|
|
- var resdata = JSON.parse(localStorage.getItem('jsonstring'));
|
|
|
- console.log(resdata)
|
|
|
- var html = '';
|
|
|
- for(var i=0;i<resdata.length;i++){
|
|
|
- html+='<tr>';
|
|
|
- html+='<td>'+resdata[i].shopName+'</td>'
|
|
|
- html+='<td>';
|
|
|
- html+='<img src="'+resdata[i].image+'">';
|
|
|
- html+='</td>';
|
|
|
- html+='<td>';
|
|
|
- html+=resdata[i].name;
|
|
|
- html+='</td>';
|
|
|
- html+='<td class="buy-num">';
|
|
|
- html+=resdata[i].num;
|
|
|
- html+='</td>';
|
|
|
- html+='<td>';
|
|
|
- html+=resdata[i].presentNum;
|
|
|
- html+='</td>';
|
|
|
- html+='<td class="sent">';
|
|
|
- html+=resdata[i].num + resdata[i].presentNum - resdata[i].notOutStore;
|
|
|
- html+='</td>';
|
|
|
- html+='<td>';
|
|
|
- html+='<span data-id='+resdata[i].orderProductID+' data-type='+resdata[i].shopOrderID+' class="input">';
|
|
|
- html+=''+resdata[i].deliveryNum+'';
|
|
|
- html+='</span>';
|
|
|
- html+='</td>';
|
|
|
- html+='</tr>';
|
|
|
-
|
|
|
- obj['orderProductID_'+resdata[i].orderProductID+''] = resdata[i].deliveryNum;
|
|
|
- obj['shopOrderID'] = resdata[i].shopOrderID;
|
|
|
-
|
|
|
- }
|
|
|
- $('.table').append(html);
|
|
|
- //确认点击获取物流以及物流单号
|
|
|
- confirm_[0].onclick = function () {
|
|
|
- var _masktext = masktext_[0].value;
|
|
|
- obj['remarks'] = _masktext;
|
|
|
- for(var i=0;i<expressDelivery_.length;i++){
|
|
|
- var expressval = expressDelivery_[i].getElementsByTagName('select');//物流快递
|
|
|
- if(!expressval[0].value){
|
|
|
- $.jBox.info('请选择物流快递!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- var index = expressval[0].selectedIndex ;//索引值
|
|
|
- var singlenum_ = expressDelivery_[i].getElementsByClassName('single-num');//物流单号
|
|
|
- console.log(expressval[0].value + singlenum_[0].value);
|
|
|
- var list_ = '';
|
|
|
- for(var j=0;j<singlenum_.length;j++){
|
|
|
- if(!singlenum_[j].value){
|
|
|
- $.jBox.info('请填写物流单号!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- list_+= singlenum_[j].value+'_';
|
|
|
- obj['logisticsInfo_'+expressval[0].options[index].value+''] = list_.substring(0,list_.length - 1);
|
|
|
- }
|
|
|
- }
|
|
|
- var imgArr = [];
|
|
|
- if($('#image1').val()){ imgArr.push($('#image1').val()); }
|
|
|
- if($('#image2').val()){ imgArr.push($('#image2').val()); }
|
|
|
- if($('#image3').val()){ imgArr.push($('#image3').val()); }
|
|
|
- if($('#image4').val()){ imgArr.push($('#image4').val()); }
|
|
|
- if($('#image5').val()){ imgArr.push($('#image5').val()); }
|
|
|
- if($('#image6').val()){ imgArr.push($('#image6').val()); }
|
|
|
- if($('#image7').val()){ imgArr.push($('#image7').val()); }
|
|
|
- if($('#image8').val()){ imgArr.push($('#image8').val()); }
|
|
|
- if($('#image9').val()){ imgArr.push($('#image9').val()); }
|
|
|
- if($('#image10').val()){ imgArr.push($('#image10').val()); }
|
|
|
- obj['remarkImages'] = imgArr.join("##");
|
|
|
- console.log(obj);
|
|
|
- $.ajax({
|
|
|
- url : "${ctx}/order/delivery",
|
|
|
- contentType:'application/json',
|
|
|
- data : JSON.stringify(obj),
|
|
|
- type : 'post',
|
|
|
- success : function(data){
|
|
|
- if (data.success) {
|
|
|
- window.location.href = "${ctx}/order/logisticsDetails?orderID=${orderID}";
|
|
|
- } else {
|
|
|
- alert(data.msg);
|
|
|
- }
|
|
|
- },
|
|
|
- error : function(){
|
|
|
- alert("服务器内部错误");
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- };
|
|
|
- //物流单号
|
|
|
- function danjia(that) {
|
|
|
- if(that.parentNode.getElementsByClassName('single-num')[0].value ==''){return}
|
|
|
- var html=''
|
|
|
- html+='<div class="express-div">';
|
|
|
- html+='<label><i>*</i>物流编号</label>';
|
|
|
- html+='<div class="select-btn">';
|
|
|
- html+='<input class="single-num" type="text" placeholder="请输入单号">';
|
|
|
- html+='<span onclick="shipjian(this)" class="span_jian mar-css the-span">-</span>';
|
|
|
- html+='</div>';
|
|
|
- html+='</div>';
|
|
|
- that.parentNode.parentNode.insertAdjacentHTML('afterend', html);
|
|
|
- }
|
|
|
- //减物流
|
|
|
- function jian(that) {
|
|
|
- var that_ = that.parentNode.parentNode.parentNode;
|
|
|
- that.parentNode.parentNode.parentNode.parentNode.removeChild(that_);
|
|
|
-
|
|
|
- }
|
|
|
- //减单号
|
|
|
- function shipjian(that) {
|
|
|
- var that_ = that.parentNode.parentNode;
|
|
|
- that.parentNode.parentNode.parentNode.removeChild(that_);
|
|
|
- }
|
|
|
- //判断输入框不能为空
|
|
|
- function input(that) {
|
|
|
- if(that.parentNode.getElementsByClassName('single-num')[0].value == ''){return}
|
|
|
- }
|
|
|
-
|
|
|
- </script>
|
|
|
</head>
|
|
|
<body>
|
|
|
+<ul class="nav nav-tabs">
|
|
|
+ <li><a href="${ctx}/order/orderList">订单列表</a></li>
|
|
|
+ <li><a href="${ctx}/order/toDeliveryPage?id=${orderID}">发货</a></li>
|
|
|
+ <li class="active"><a href="${ctx}/order/toShipLogistic?orderID=${orderID}">添加物流</a></li>
|
|
|
+</ul>
|
|
|
+
|
|
|
<div class="change-info" style="display: none">发货数量大于总数量</div>
|
|
|
<div class="bj" style="display: none"></div>
|
|
|
<div class="body-margin">
|
|
|
- <h3><span class="left-span"></span>订单列表--添加物流</h3>
|
|
|
<div class="shop-info">
|
|
|
- <div class="shop-title">商品信息</div>
|
|
|
<table class="table">
|
|
|
<tr class="first-tr">
|
|
|
<th>供应商</th>
|
|
@@ -278,114 +77,288 @@
|
|
|
<th>已发数量</th>
|
|
|
<th>本次发货</th>
|
|
|
</tr>
|
|
|
- <%--<c:forEach items="${orderProductList}" var="orderProduct">--%>
|
|
|
- <%--<tr class="first-tr">--%>
|
|
|
- <%--<td><img src="${orderProduct.image}"> </td>--%>
|
|
|
- <%--<td>${orderProduct.name} </td>--%>
|
|
|
- <%--<td class="buy-num">${orderProduct.num + orderProduct.presentNum}</td>--%>
|
|
|
- <%--<td class="sent">${orderProduct.num + orderProduct.presentNum - orderProduct.notOutStore}</td>--%>
|
|
|
- <%--<td><input oninput="this.value=this.value.replace(/\D/g,'').replace(/^0+(?=\d)/,1)" class="input" value="${orderProduct.deliveryNum}" type="text"/></td>--%>
|
|
|
- <%--</tr>--%>
|
|
|
- <%--</c:forEach>--%>
|
|
|
</table>
|
|
|
</div>
|
|
|
- <%--已有物流信息--%>
|
|
|
- <%--<div class="logistic-already">--%>
|
|
|
- <%--<h3>已有物流信息</h3>--%>
|
|
|
- <%--<div class="have-logistic">--%>
|
|
|
- <%--<div class="logistic-item">--%>
|
|
|
- <%--<div><label>快递公司:</label><span>顺丰快递</span></div>--%>
|
|
|
- <%--<div><label>快递单号:</label><span>1213212555</span></div>--%>
|
|
|
- <%--</div>--%>
|
|
|
- <%--<div class="logistic-item">--%>
|
|
|
- <%--<div><label>快递公司:</label><span>顺丰快递</span></div>--%>
|
|
|
- <%--<div><label>快递单号:</label><span>1213212555</span></div>--%>
|
|
|
- <%--</div>--%>
|
|
|
- <%--</div>--%>
|
|
|
- <%--</div>--%>
|
|
|
- <div class="express-delivery">
|
|
|
- <div class="express-div">
|
|
|
- <label><i>*</i>快递公司</label>
|
|
|
- <div class="select-btn" id="qqq">
|
|
|
- <select class="express-input required input-xlarge" style="width:300px;">
|
|
|
- <c:forEach items="${fns:getDictList('kd_type')}" var="kd">
|
|
|
- <option value="${kd.label}">${kd.label}</option>
|
|
|
- <%--<script>--%>
|
|
|
- <%--op_html += "<option value='${kd.id}'>${kd.label}</option>";--%>
|
|
|
- <%--</script>--%>
|
|
|
- </c:forEach>
|
|
|
- </select>
|
|
|
- <%--<input class="express-input" type="text" placeholder="请选择">--%>
|
|
|
- <span onclick="input(this)" class="span_jia the-span">+</span>
|
|
|
+ <div class="delivery-info">
|
|
|
+ <div class="express-delivery">
|
|
|
+ <div class="express-div">
|
|
|
+ <label><i>*</i>快递公司</label>
|
|
|
+ <div class="select-btn" id="qqq">
|
|
|
+ <select class="express-input required input-xlarge" style="width:300px;">
|
|
|
+ <c:forEach items="${fns:getDictList('kd_type')}" var="kd">
|
|
|
+ <option value="${kd.label}">${kd.label}</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
+ <span onclick="input(this)" class="span_jia the-span">+</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="express-div ship-num">
|
|
|
- <label><i>*</i>物流编号</label>
|
|
|
- <div class="select-btn">
|
|
|
- <input class="single-num" type="text" placeholder="请输入单号" style="width:300px;">
|
|
|
- <span onclick="input(this)" class="dan_jia the-span">+</span>
|
|
|
+ <div class="express-div ship-num">
|
|
|
+ <label><i>*</i>物流编号</label>
|
|
|
+ <div class="select-btn">
|
|
|
+ <input class="single-num" type="text" placeholder="请输入单号" style="width:300px;">
|
|
|
+ <span onclick="input(this)" class="dan_jia the-span">+</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="mask">
|
|
|
- <label>图片备注:</label>
|
|
|
- <div class="imgbox">
|
|
|
- <div class="controls upload-content" id="remarkImageBox">
|
|
|
- <div class="conList">
|
|
|
- <input type="hidden" id="image1" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image2" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image3" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image4" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image5" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image6" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image6" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image7" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image7" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image8" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image8" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image9" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image9" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
- </div>
|
|
|
- <div class="conList hide-pic">
|
|
|
- <input type="hidden" id="image10" maxlength="150" class="imagesInput">
|
|
|
- <sys:ckfinder input="image10" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ <div class="mask">
|
|
|
+ <label>图片备注:</label>
|
|
|
+ <div class="imgbox">
|
|
|
+ <div class="controls upload-content" id="remarkImageBox">
|
|
|
+ <div class="conList">
|
|
|
+ <input type="hidden" id="image1" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image2" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image3" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image4" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image5" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image6" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image6" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image7" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image7" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image8" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image8" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image9" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image9" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
+ <div class="conList hide-pic">
|
|
|
+ <input type="hidden" id="image10" maxlength="150" class="imagesInput">
|
|
|
+ <sys:ckfinder input="image10" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <div class="conList upload-tips"><span style="color:red;">注意:请上传jpg / png格式的图片,最大不超过5M,最多可上传10张</span></div>
|
|
|
</div>
|
|
|
- <div class="conList upload-tips"><span style="color:red;">注意:请上传jpg / png格式的图片,最大不超过5M,最多可上传10张</span></div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="mask">
|
|
|
- <label>备注:</label>
|
|
|
- <textarea class="mask-text" placeholder="请输入备注文字,200字以内..." maxlength="200" style="width:300px;"></textarea>
|
|
|
- <p style="width:300px;text-align:right;"><span id="remarkLen" style="color:red;">0</span>/200</p>
|
|
|
- </div>
|
|
|
- <div class="cencal-btn">
|
|
|
- <span><a href="javascript:history.go(-1)">取消</a></span>
|
|
|
- <span class="confirm">确认</span>
|
|
|
+ <div class="mask">
|
|
|
+ <label>备注:</label>
|
|
|
+ <textarea class="mask-text" placeholder="请输入备注文字,200字以内..." maxlength="200" style="width:300px;"></textarea>
|
|
|
+ <p style="width:300px;text-align:right;"><span id="remarkLen" style="color:red;">0</span>/200</p>
|
|
|
+ </div>
|
|
|
+ <div class="cencal-btn">
|
|
|
+ <span><a href="javascript:history.go(-1)">取消</a></span>
|
|
|
+ <span class="confirm">确认</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script>
|
|
|
+var op_html = "";
|
|
|
+window.onload = function () {
|
|
|
+ var spanjia_ = document.getElementsByClassName('span_jia');
|
|
|
+ var express_ = document.getElementsByClassName('express-delivery');
|
|
|
+ var danjia_ = document.getElementsByClassName('dan_jia');
|
|
|
+ var shipnum_ = document.getElementsByClassName('ship-num');
|
|
|
+ var input_ = document.getElementsByClassName('input')//数量输入框
|
|
|
+ var confirm_ = document.getElementsByClassName('confirm');//确定按钮
|
|
|
+ var expressDelivery_ = document.getElementsByClassName('express-delivery');//循环物流
|
|
|
+ var masktext_ = document.getElementsByClassName('mask-text');//备注
|
|
|
+ var singlenum_= document.getElementsByClassName('single-num');//新建输入框判断
|
|
|
+ var obj = {};
|
|
|
+ // var valuearr = {};
|
|
|
+ var expressval = document.getElementsByTagName('select');//物流快递
|
|
|
+ var index = expressval[0].selectedIndex ;//索引值
|
|
|
+ var value = expressval[0].options[index].value;
|
|
|
+ var arr = [];
|
|
|
+ for(var i=0;i<expressval[0].options.length;i++){
|
|
|
+ var valuearr = {};
|
|
|
+ valuearr['name'] = expressval[0].options[i].text;
|
|
|
+ valuearr['value'] = expressval[0].options[i].value;
|
|
|
+ arr.push(valuearr);
|
|
|
+ }
|
|
|
+ //新建输入框判断
|
|
|
+
|
|
|
+ for(var i=0;i<singlenum_.length;i++){
|
|
|
+
|
|
|
+ }
|
|
|
+ //输入框判断
|
|
|
+ for(var i=0;i<input_.length;i++){
|
|
|
+ input_[i].onchange = function () {
|
|
|
+ var intval = this.value;
|
|
|
+ var buynum = this.parentNode.parentNode.getElementsByClassName('buy-num');//购买数量
|
|
|
+ var sent_ = this.parentNode.parentNode.getElementsByClassName('sent');//已发数量
|
|
|
+ if(parseInt(intval)+parseInt(sent_[0].innerHTML) >=parseInt(buynum[0].innerHTML)){
|
|
|
+ document.getElementsByClassName('bj')[0].style.cssText = 'display:block';
|
|
|
+ document.getElementsByClassName('change-info')[0].style.cssText = 'display:block';
|
|
|
+ setTimeout(function () {
|
|
|
+ document.getElementsByClassName('bj')[0].style.cssText = 'display:none';
|
|
|
+ document.getElementsByClassName('change-info')[0].style.cssText = 'display:none';
|
|
|
+ },1000);
|
|
|
+ this.value = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //物流加减
|
|
|
+ for(var i=0;i<spanjia_.length;i++){
|
|
|
+ spanjia_[i].onclick =function () {
|
|
|
+
|
|
|
+ var html=''
|
|
|
+ html+='<div class="express-delivery border-express">';
|
|
|
+ html+='<div class="express-div">';
|
|
|
+ html+='<label><i>*</i>快递公司</label>';
|
|
|
+ html+='<div class="select-btn">';
|
|
|
+ html+='<select class="express-input required input-xlarge">';
|
|
|
+ for(var i=0;i<arr.length;i++){
|
|
|
+ html+='<option value="'+arr[i].value+'">'+arr[i].name;
|
|
|
+ html+='</option>';
|
|
|
+ }
|
|
|
+ html+='</select>';
|
|
|
+ html+='<span onclick="jian(this)" class="span_jian mar-css the-span">-</span>';
|
|
|
+ html+='</div>';
|
|
|
+ html+='</div>';
|
|
|
+ html+='<div class="express-div">';
|
|
|
+ html+='<label><i>*</i>物流编号</label>';
|
|
|
+ html+='<div class="select-btn">';
|
|
|
+ html+='<input class="single-num" type="text" placeholder="请输入单号">';
|
|
|
+ html+='<span onclick="danjia(this)" class="dan_jia mar-css the-span">+</span>';
|
|
|
+ html+='</div>';
|
|
|
+ html+='</div>';
|
|
|
+ html+='</div>';
|
|
|
+
|
|
|
+ express_[0].insertAdjacentHTML('afterend', html);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //物流单号
|
|
|
+ for(var i=0;i<spanjia_.length;i++){
|
|
|
+ danjia_[i].onclick =function () {
|
|
|
+ danjia(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //列表信息展示
|
|
|
+ var resdata = JSON.parse(localStorage.getItem('jsonstring'));
|
|
|
+ console.log(resdata)
|
|
|
+ var html = '';
|
|
|
+ for(var i=0;i<resdata.length;i++){
|
|
|
+ html+='<tr>';
|
|
|
+ html+='<td>'+resdata[i].shopName+'</td>'
|
|
|
+ html+='<td>';
|
|
|
+ html+='<img src="'+resdata[i].image+'">';
|
|
|
+ html+='</td>';
|
|
|
+ html+='<td>';
|
|
|
+ html+=resdata[i].name;
|
|
|
+ html+='</td>';
|
|
|
+ html+='<td class="buy-num">';
|
|
|
+ html+=resdata[i].num;
|
|
|
+ html+='</td>';
|
|
|
+ html+='<td>';
|
|
|
+ html+=resdata[i].presentNum;
|
|
|
+ html+='</td>';
|
|
|
+ html+='<td class="sent">';
|
|
|
+ html+=resdata[i].num + resdata[i].presentNum - resdata[i].notOutStore;
|
|
|
+ html+='</td>';
|
|
|
+ html+='<td>';
|
|
|
+ html+='<span data-id='+resdata[i].orderProductID+' data-type='+resdata[i].shopOrderID+' class="input">';
|
|
|
+ html+=''+resdata[i].deliveryNum+'';
|
|
|
+ html+='</span>';
|
|
|
+ html+='</td>';
|
|
|
+ html+='</tr>';
|
|
|
+
|
|
|
+ obj['orderProductID_'+resdata[i].orderProductID+''] = resdata[i].deliveryNum;
|
|
|
+ obj['shopOrderID'] = resdata[i].shopOrderID;
|
|
|
+
|
|
|
+ }
|
|
|
+ $('.table').append(html);
|
|
|
+ //确认点击获取物流以及物流单号
|
|
|
+ confirm_[0].onclick = function () {
|
|
|
+ var _masktext = masktext_[0].value;
|
|
|
+ obj['remarks'] = _masktext;
|
|
|
+ for(var i=0;i<expressDelivery_.length;i++){
|
|
|
+ var expressval = expressDelivery_[i].getElementsByTagName('select');//物流快递
|
|
|
+ if(!expressval[0].value){
|
|
|
+ $.jBox.info('请选择物流快递!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var index = expressval[0].selectedIndex ;//索引值
|
|
|
+ var singlenum_ = expressDelivery_[i].getElementsByClassName('single-num');//物流单号
|
|
|
+ console.log(expressval[0].value + singlenum_[0].value);
|
|
|
+ var list_ = '';
|
|
|
+ for(var j=0;j<singlenum_.length;j++){
|
|
|
+ if(!singlenum_[j].value){
|
|
|
+ $.jBox.info('请填写物流单号!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ list_+= singlenum_[j].value+'_';
|
|
|
+ obj['logisticsInfo_'+expressval[0].options[index].value+''] = list_.substring(0,list_.length - 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var imgArr = [];
|
|
|
+ if($('#image1').val()){ imgArr.push($('#image1').val()); }
|
|
|
+ if($('#image2').val()){ imgArr.push($('#image2').val()); }
|
|
|
+ if($('#image3').val()){ imgArr.push($('#image3').val()); }
|
|
|
+ if($('#image4').val()){ imgArr.push($('#image4').val()); }
|
|
|
+ if($('#image5').val()){ imgArr.push($('#image5').val()); }
|
|
|
+ if($('#image6').val()){ imgArr.push($('#image6').val()); }
|
|
|
+ if($('#image7').val()){ imgArr.push($('#image7').val()); }
|
|
|
+ if($('#image8').val()){ imgArr.push($('#image8').val()); }
|
|
|
+ if($('#image9').val()){ imgArr.push($('#image9').val()); }
|
|
|
+ if($('#image10').val()){ imgArr.push($('#image10').val()); }
|
|
|
+ obj['remarkImages'] = imgArr.join("##");
|
|
|
+ console.log(obj);
|
|
|
+ $.ajax({
|
|
|
+ url : "${ctx}/order/delivery",
|
|
|
+ contentType:'application/json',
|
|
|
+ data : JSON.stringify(obj),
|
|
|
+ type : 'post',
|
|
|
+ success : function(data){
|
|
|
+ if (data.success) {
|
|
|
+ window.location.href = "${ctx}/order/logisticsDetails?orderID=${orderID}";
|
|
|
+ } else {
|
|
|
+ alert(data.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : function(){
|
|
|
+ alert("服务器内部错误");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+};
|
|
|
+//物流单号
|
|
|
+function danjia(that) {
|
|
|
+ if(that.parentNode.getElementsByClassName('single-num')[0].value ==''){return}
|
|
|
+ var html=''
|
|
|
+ html+='<div class="express-div">';
|
|
|
+ html+='<label><i>*</i>物流编号</label>';
|
|
|
+ html+='<div class="select-btn">';
|
|
|
+ html+='<input class="single-num" type="text" placeholder="请输入单号">';
|
|
|
+ html+='<span onclick="shipjian(this)" class="span_jian mar-css the-span">-</span>';
|
|
|
+ html+='</div>';
|
|
|
+ html+='</div>';
|
|
|
+ that.parentNode.parentNode.insertAdjacentHTML('afterend', html);
|
|
|
+}
|
|
|
+//减物流
|
|
|
+function jian(that) {
|
|
|
+ var that_ = that.parentNode.parentNode.parentNode;
|
|
|
+ that.parentNode.parentNode.parentNode.parentNode.removeChild(that_);
|
|
|
+
|
|
|
+}
|
|
|
+//减单号
|
|
|
+function shipjian(that) {
|
|
|
+ var that_ = that.parentNode.parentNode;
|
|
|
+ that.parentNode.parentNode.parentNode.removeChild(that_);
|
|
|
+}
|
|
|
+//判断输入框不能为空
|
|
|
+function input(that) {
|
|
|
+ if(that.parentNode.getElementsByClassName('single-num')[0].value == ''){return}
|
|
|
+}
|
|
|
$(function () {
|
|
|
$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
|
|
|
$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
|