|
@@ -50,7 +50,7 @@
|
|
|
</nav>
|
|
|
<article class="page-container" style="padding: 10px;">
|
|
|
<div class="pd-20 cl">
|
|
|
- <form action="${path}/admin/customer/save_customer" method="post" class="form form-horizontal" id="form-customer-add" onkeydown="if(event.keyCode==13)return false;">
|
|
|
+ <form action="${path}/admin/salesOrder/add_salesOrder" method="post" class="form form-horizontal" id="form-order-add" onkeydown="if(event.keyCode==13)return false;">
|
|
|
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-3">
|
|
@@ -60,50 +60,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <#-- private static final long serialVersionUID = -2015761953380110553L;
|
|
|
- private Integer salesId; //订单id
|
|
|
- private String salesOrderId; //订单号
|
|
|
- private String salesOpenId; //身份证号/openid
|
|
|
- private Integer salesDiscountMoney; //优惠金额
|
|
|
- private Integer salesPledgeMoney = 0; //押金金额
|
|
|
- private Integer salesRemainDeposit = 0; //待提取金额
|
|
|
- private Integer salesStatus; //确认状态
|
|
|
- private Integer salesSendType = 2; //送货方式 1:线下送货,2:物流发货
|
|
|
- private Date salesSendTime = null ; //发货时间
|
|
|
- private Date salesSalesTime = new Date(); //订购时间
|
|
|
- private String salesPostNum; //快递单号
|
|
|
- private String salesPostFirm; //快递公司
|
|
|
- private String salesAddressInfo = ""; //详细地址
|
|
|
- private String salesAddressTel; //收件人电话
|
|
|
- private String salesAddressName; //收件人姓名
|
|
|
- private Integer salesAmount = ; //订单总金额
|
|
|
- private Integer salesPayMoney = salesAmount; //已付金额 = 总金额
|
|
|
- private Integer salesPayType = 1; //付款方式 1:微信支付 2:现金支付3:已支付定金¥99 4:刷卡支付 5:支付宝支付
|
|
|
- private Integer salesWaitMoney; //待付金额
|
|
|
- private Integer salesLastMoney; //本次支付金额
|
|
|
- private Integer salesShippingFee; //邮费
|
|
|
- private Date salesPayTime; //支付时间
|
|
|
- private Date salesCreateTime; //创建时间
|
|
|
- private String salesAdminRemark; //后台的备注 -- 卖家备注
|
|
|
- private String salesUserRemark; //用户备注 --
|
|
|
- private String salesPayNumber; //交易尾号
|
|
|
- private Integer salesStoreId; //店铺id
|
|
|
- private Integer salesCompanyId; //销售公司id
|
|
|
- private Integer salesType; //订单类型
|
|
|
- private String salesDealCode; //交易号
|
|
|
- private Integer salesOrderStatus; //订单状态 订单状态:1:正常 2:换货 3:退货 4:维修 5:补发
|
|
|
- private Integer salesShippingStatus; //发货状态
|
|
|
- private Integer salesPayStatus; //付款状态
|
|
|
- private Integer salesProcessStatus; //单据状态
|
|
|
- private Integer salesIsSend; //是否通知配货
|
|
|
- private Integer salesIsLocked; //是否锁定
|
|
|
- private Integer salesIsSeparate; //是否缺货
|
|
|
- private Integer salesIsDownload; //是否下载过
|
|
|
- private Integer salesMainOrderId; //主订单id(拆单用)
|
|
|
- private String orderNoteRemark; //订单备注,推送到efast
|
|
|
- private String storeEfast; //Efast 的店铺id
|
|
|
- salesBatchId 、、批次
|
|
|
- -->
|
|
|
+
|
|
|
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-1 col-sm-1">批次编号:</label>
|
|
@@ -181,6 +138,15 @@
|
|
|
<input type="hidden" name="salesAddressInfo" id="salesAddressInfo" >
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
+ <div class="row cl" id="" style="">
|
|
|
+ <label class="form-label col-1 col-sm-1">支付时间:</label>
|
|
|
+ <div class="formControls col-2 col-sm-2">
|
|
|
+ <input type="text" placeholder="购买日期" id="salesPayTime" name="salesPayTime" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate: '%y-%M-%d'})" readonly="readonly">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-3">
|
|
|
<div class="tit-2">商品信息</div>
|
|
@@ -192,7 +158,7 @@
|
|
|
<div class="row cl" id="" style="">
|
|
|
<label class="form-label col-1 col-sm-1">商品信息:</label>
|
|
|
<div class="formControls col-8 col-sm-8">
|
|
|
- <input type="button" class="btn btn-primary" onclick="add_product()" value="添加商品" >
|
|
|
+ <input type="button" class="btn btn-primary add-order-button" onclick="add_product()" value="添加商品" >
|
|
|
|
|
|
<table class="table table-border table-bg table-bordered" style="margin-top: 10px;display: none" id="all_add_product">
|
|
|
<thead>
|
|
@@ -209,19 +175,33 @@
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
+ <input type="hidden" id="orderItemString" name="orderItemString" value="" >
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="row cl" id="" style="">
|
|
|
- <label class="form-label col-1 col-sm-1">商品价格:</label>
|
|
|
+ <label class="form-label col-1 col-sm-1">总金额:</label>
|
|
|
+ <div class="formControls col-2 col-sm-2">
|
|
|
+ <input type="text" class="input-text" value="" placeholder="总金额" datatype="*" errormsg="必须要输入总金额!" id="salesAmount" name="salesAmount" >
|
|
|
+ </div>
|
|
|
+ <label class="form-label col-2 col-sm-2">实付金额:</label>
|
|
|
<div class="formControls col-2 col-sm-2">
|
|
|
- <input type="text" class="input-text" value="" placeholder="订单总价" id="salesAmount" name="salesAmount" >
|
|
|
+ <input type="text" class="input-text" value="" placeholder="实付金额" datatype="*" errormsg="必须要输入总金额!" id="salesPayMoney" name="salesPayMoney" >
|
|
|
</div>
|
|
|
+ <div class="formControls col-2 col-sm-2" style="display: none">
|
|
|
+ <input type="text" class="input-text" value="0" placeholder="优惠金额" datatype="*" errormsg="必须要输入总金额!" id="salesDiscountMoney" name="salesDiscountMoney" >
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="formControls col-2 col-sm-2">
|
|
|
- <input type="text" class="input-text" value="" placeholder="实际总价" id="salesAmount" name="salesAmount" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)">
|
|
|
+ <input type="button" style="width: 100%;" class="btn btn-primary add-order-button" onclick="calculatePrice()" value="计算商品总价" >
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <input type="hidden" class="input-text" value="" placeholder="待付金额" id="salesWaitMoney" name="salesWaitMoney" >
|
|
|
+ <input type="hidden" class="input-text" value="" placeholder="本次支付金额" id="salesLastMoney" name="salesLastMoney" >
|
|
|
+ <input type="hidden" class="input-text" value="" placeholder="邮费" id="salesShippingFee" name="salesShippingFee" >
|
|
|
+
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-3">
|
|
|
<div class="tit-2">备注信息</div>
|
|
@@ -233,7 +213,7 @@
|
|
|
<div class="row cl" id="" style="">
|
|
|
<label class="form-label col-1 col-sm-1">用户备注:</label>
|
|
|
<div class="formControls col-6 col-sm-6">
|
|
|
- <textarea name="salesUserRemark" id="salesUserRemark" cols="" rows="2" datatype="" errormsg="" class="textarea" placeholder="请填写用户备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
|
|
|
+ <textarea name="salesUserRemark" id="salesUserRemark" cols="" rows="2" class="textarea" placeholder="请填写用户备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
|
|
|
<#--<span id="addrssMsg"></span>-->
|
|
|
</div>
|
|
|
</div>
|
|
@@ -241,7 +221,7 @@
|
|
|
<div class="row cl" id="" style="">
|
|
|
<label class="form-label col-1 col-sm-1">后台备注:</label>
|
|
|
<div class="formControls col-6 col-sm-6">
|
|
|
- <textarea name="salesAdminRemark" id="salesAdminRemark" cols="" rows="2" datatype="" errormsg="" class="textarea" placeholder="请填写后台备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
|
|
|
+ <textarea name="salesAdminRemark" id="salesAdminRemark" cols="" rows="2" class="textarea" placeholder="请填写后台备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
|
|
|
<#--<span id="addrssMsg"></span>-->
|
|
|
</div>
|
|
|
</div>
|
|
@@ -255,6 +235,10 @@
|
|
|
</div>
|
|
|
</article>
|
|
|
|
|
|
+
|
|
|
+<#--时间控件-->
|
|
|
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
|
|
|
+
|
|
|
<script type="text/javascript">
|
|
|
var url_path = "${path}";
|
|
|
</script>
|
|
@@ -268,7 +252,7 @@
|
|
|
});
|
|
|
|
|
|
/*初始化省市区*/
|
|
|
- $(".address_info").initAddress();
|
|
|
+ var address = $(".address_info").initAddress();
|
|
|
|
|
|
/*初始化销售公司店铺*/
|
|
|
$(".sales_channel").initSalesChannel();
|
|
@@ -280,6 +264,66 @@
|
|
|
layer_show("商品列表",url_path + "/admin/salesOrder/to_add_product","1000","500");
|
|
|
}
|
|
|
|
|
|
+ $(function(){
|
|
|
+
|
|
|
+ $("#form-order-add").Validform({
|
|
|
+ tiptype: function (msg, o, cssctl) {
|
|
|
+ if (o.type == 3) {//失败
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
+ $(window).scrollTop(o.obj.offset().top - 40);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ datatype: {//自定义验证类型
|
|
|
+ },
|
|
|
+ ignoreHidden: true,
|
|
|
+ tipSweep: true, //若为true,则只在表单提交时验证
|
|
|
+ ajaxPost: true, //异步提交
|
|
|
+ beforeCheck: function (curform) { //验证通过之前执行的函数
|
|
|
+ var flag = false;
|
|
|
+ },
|
|
|
+ beforeSubmit: function (curform) { //验证通过之后执行的函数
|
|
|
+
|
|
|
+ var flag = false;
|
|
|
+ /*封装订单项*/
|
|
|
+ var orderItemArray = new Array();
|
|
|
+ $("#add_product").find("tr").each(function(){
|
|
|
+ var orderItem = new Object();
|
|
|
+ orderItem.itemColorId = $(this).find(".color_id").val();
|
|
|
+ orderItem.itemNum = $(this).find(".item-num").val();
|
|
|
+ orderItemArray.push(orderItem);
|
|
|
+ flag = true;
|
|
|
+ })
|
|
|
+ if(!flag){
|
|
|
+ vailErrorMsg($(".add-order-button"),"必须要有一个产品");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#orderItemString").val(JSON.stringify(orderItemArray));
|
|
|
+
|
|
|
+ var index = layer.load(1, {
|
|
|
+ shade: [0.5,'#fff'] //0.1透明度的白色背景
|
|
|
+ });
|
|
|
+ },
|
|
|
+ callback: function (data) {//异步回调函数
|
|
|
+ if (data) {
|
|
|
+ var index = layer.alert(data.resultMsg, function (index) {
|
|
|
+ if (data.resultCode == 200) {
|
|
|
+ location.href = url_path + "/admin/salesOrder/list_order_page";
|
|
|
+ } else if(data.resultCode == 505){
|
|
|
+ location.href = url_path + "/admin/salesOrder/list_order_page";
|
|
|
+ }else {
|
|
|
+ layer.close(index);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 选择商品回调
|
|
|
+ * @param colorIds
|
|
|
+ */
|
|
|
function setSelectProduct(colorIds){
|
|
|
var index = layer.load(1, {
|
|
|
shade: [0.5,'#fff'] //0.1透明度的白色背景
|
|
@@ -315,23 +359,63 @@
|
|
|
var productColor = data.returnMsg.productColorList[i];
|
|
|
html += '<tr class="text-c">' +
|
|
|
'<input type="hidden" class="color_id" id="" value="'+ productColor.colorId +'" >' +
|
|
|
+ '<input type="hidden" class="color_price" id="" value="'+ productColor.colorPrice +'" >' +
|
|
|
+ '<input type="hidden" class="color_discount" id="" value="'+ productColor.colorDiscount +'" >' +
|
|
|
' <td>'+ cufte(productColor.productName) +'</td>' +
|
|
|
' <td>'+ cufte(productColor.colorName) +'</td>' +
|
|
|
' <td>'+ cufte(productColor.colorPrice)/100 +'</td>' +
|
|
|
' <td>'+ cufte(productColor.colorBar) +'</td>' +
|
|
|
- ' <td><input type="text" class="input-text input-number" style="width: 100%;border: none;text-align: center;" name="" id="" placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>' +
|
|
|
- ' <td><a href="javascript:void(0)" class="del_product all_down" >删除</a></td>' +
|
|
|
+ ' <td><input type="text" class="input-text input-number item-num" style="width: 100%;border: none;text-align: center;" name="" id="" placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>' +
|
|
|
+ ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))" >删除</a></td>' +
|
|
|
' </tr>';
|
|
|
}
|
|
|
}else{
|
|
|
html = '<tr class="text-c"><td colspan="12">没有搜索到商品,请重试!</td></tr>';
|
|
|
}
|
|
|
$("#add_product").append(html);
|
|
|
+ /*计算价格*/
|
|
|
+ calculatePrice();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
layer.close(index);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除商品
|
|
|
+ */
|
|
|
+ function delProduct($this){
|
|
|
+ $this.parents("tr").remove();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算价格
|
|
|
+ */
|
|
|
+ function calculatePrice(){
|
|
|
+ /*总价,折扣价,优惠金额*/
|
|
|
+ var colorDiscountAll = 0,colorPriceAll = 0,salesPayMoneyAll=0;
|
|
|
+ $("#add_product").find("tr").each(function(){
|
|
|
+ var colorDiscount = 0,colorPrice = 0,salesPayMoney=0,itemNum=0;
|
|
|
+ colorDiscount = parseInt($(this).find(".color_discount").val())/100;
|
|
|
+ colorPrice = parseInt($(this).find(".color_price").val())/100;
|
|
|
+ itemNum = $(this).find(".item-num").val();
|
|
|
+ if(!isEmpty(itemNum)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ itemNum = parseInt(itemNum);
|
|
|
+ salesPayMoney = colorPrice -colorDiscount;
|
|
|
+ if(salesPayMoney < 0){
|
|
|
+ salesPayMoney = 0;
|
|
|
+ }
|
|
|
+ colorDiscountAll += colorDiscount*itemNum;
|
|
|
+ colorPriceAll += colorPrice*itemNum;
|
|
|
+ salesPayMoneyAll += salesPayMoney*itemNum;
|
|
|
+ })
|
|
|
+ $("#salesAmount").val(colorPriceAll);
|
|
|
+ $("#salesPayMoney").val(colorDiscountAll);
|
|
|
+ $("#salesDiscountMoney").val(salesPayMoneyAll);
|
|
|
+ }
|
|
|
+
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|