|
@@ -0,0 +1,395 @@
|
|
|
+<!DOCTYPE HTML>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <meta name="renderer" content="webkit|ie-comp|ie-stand">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
+ <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
|
|
+ <meta http-equiv="Cache-Control" content="no-siteapp" />
|
|
|
+ <link rel="Bookmark" href="/favicon.ico" >
|
|
|
+ <link rel="Shortcut Icon" href="/favicon.ico" />
|
|
|
+<#include "/base/add_base.ftl">
|
|
|
+ <title>添加订单</title>
|
|
|
+ <style>
|
|
|
+ .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
|
|
|
+ .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
|
|
|
+ .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
|
|
|
+ .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
|
|
|
+ #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
|
|
|
+
|
|
|
+ #suggest, #suggest2 {width:200px}
|
|
|
+ .gray {color:gray}
|
|
|
+ .ac_results {background:#fff;border:1px solid #7f9db9;position: absolute;z-index: 10000;display: none}
|
|
|
+ .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
|
|
|
+ .ac_results li {border:1px solid #fff}
|
|
|
+ .ac_over, .ac_results li a:hover {background:#c8e3fc}
|
|
|
+ .ac_results li a span {float:right}
|
|
|
+ .ac_result_tip {border-bottom:1px dashed #666;padding:3px}
|
|
|
+
|
|
|
+ .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
|
|
|
+ .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 25px;}
|
|
|
+ .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%); background-color: #fff;z-index: 10;}
|
|
|
+ .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
|
|
|
+ .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent #32a3d8 transparent transparent;font-size:0; line-height:0;}
|
|
|
+ .dalog-ask .ask{color: #000;margin: 10px 0 5px 0;}
|
|
|
+ .dalog-ask .answer{color: #666;margin-bottom: 10px;}
|
|
|
+ .dalog-ask .answer:hover{color: #32a3d8;cursor: pointer;}
|
|
|
+ .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
|
|
|
+ .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
|
|
|
+ .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
|
|
|
+ .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
|
|
|
+ .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
|
|
|
+ .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{ }
|
|
|
+ .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent transparent transparent #32a3d8;font-size:0; line-height:0;}
|
|
|
+ .time-line-list>li:first-child .arrow{ }
|
|
|
+ .table-bg th{background-color: #e2f6ff;}
|
|
|
+ .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
|
|
|
+ .my-search-input{padding-left: 30px;background: url(${path}/common/images/cm/search.png) 6px center no-repeat;background-size: auto 60%; }
|
|
|
+ .input-produce{height: 25px;line-height: 25px}
|
|
|
+ .color-div{height: 30px;}
|
|
|
+ .table-td-color{}
|
|
|
+ .msg-phone{height: 35px;line-height: 35px;}
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="page-container">
|
|
|
+ <form action="${path}/admin/customer/add_order_info" method="post" class="form form-horizontal" id="form-order-add" onkeydown="if(event.keyCode==13)return false;">
|
|
|
+ <div id="addOrder" >
|
|
|
+
|
|
|
+ <input type="hidden" name="itemJson" id="itemJson" value="">
|
|
|
+ <input type="hidden" name="salesStoreId" id="salesStoreId" value="0">
|
|
|
+ <input type="hidden" name="salesCompanyId" id="salesCompanyId" value="0">
|
|
|
+ <input type="hidden" name="salesPayType" id="salesPayType" value="1">
|
|
|
+ <input type="hidden" name="salesSendType" id="salesSendType" value="2">
|
|
|
+
|
|
|
+ <div style="">
|
|
|
+ <div class="row cl" id="productInfo" style="">
|
|
|
+ <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>购买信息:</label>
|
|
|
+ <div class="formControls col-10 col-sm-10">
|
|
|
+
|
|
|
+ <table class="table table-border table-bg table-bordered">
|
|
|
+ <thead>
|
|
|
+ <tr class="text-c">
|
|
|
+ <th style="text-align: center;" width="60">产品名称</th>
|
|
|
+ <th style="text-align: center;" width="60">产品颜色</th>
|
|
|
+ <th style="text-align: center;" width="60">产品配件</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="addProduct">
|
|
|
+
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row cl" id="recipientInfo" style=" margin-top: 20px;">
|
|
|
+ <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>购买信息:</label>
|
|
|
+ <div class="formControls col-3 col-sm-3">
|
|
|
+ <input type="text" class="input-text" value="" placeholder="填写收件人姓名" id="sendName" name="salesAddressTel" datatype="s1-20" errormsg="联系人格式不正确!" >
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-3 col-sm-3">
|
|
|
+ <input type="text" class="input-text associated-phone" value="" placeholder="填写收件人手机号" id="sendTel" name="salesAddressName" datatype="m" errormsg="联系人电话格式不正确!">
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-3 col-sm-3">
|
|
|
+ <input type="text" placeholder="购买日期" id="salesPayTime" name="salesPayTime" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss'})" readonly="readonly">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl" id="recipientAddress" style=" margin-top: 20px;">
|
|
|
+ <input type="hidden" id="addressInfo">
|
|
|
+ <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>收货地址:</label>
|
|
|
+ <div class="formControls col-3 col-sm-3">
|
|
|
+ <span class="select-box">
|
|
|
+ <select id="province" class="select" name="provinceNumber">
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-3 col-sm-3">
|
|
|
+ <span class="select-box">
|
|
|
+ <select id="city" class="select" name="cityNumber">
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-3 col-sm-3">
|
|
|
+ <span class="select-box">
|
|
|
+ <select id="district" class="select" name="areaNumber">
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <input type="hidden" name="salesAddressInfo" id="salesAddressInfo">
|
|
|
+ </div>
|
|
|
+ <div class="row cl" id="recipientAddressText" style=" margin-top: 20px;">
|
|
|
+ <label class="form-label col-1 col-sm-1" style="width: 110px;"></label>
|
|
|
+ <div class="formControls col-10 col-sm-10">
|
|
|
+ <textarea name="relationSendAddress" id="sendAddress" cols="" rows="2" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
|
|
|
+ <span id="addrssMsg"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row cl" id="addOrderButton" style=" margin-top: 20px;">
|
|
|
+ <div class="col-2 col-sm-2 col-offset-3">
|
|
|
+ <button class="btn btn-block btn-primary size-XL" type="submit">添加订单</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
+<tfoot>
|
|
|
+<#--<#include "/base/page_util.ftl">-->
|
|
|
+</tfoot>
|
|
|
+
|
|
|
+<#--时间控件-->
|
|
|
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+
|
|
|
+ /*初始化产品*/
|
|
|
+ setProduce();
|
|
|
+
|
|
|
+ var provicesId = setAddressPro();
|
|
|
+ var cityId = setAddressCity(provicesId);
|
|
|
+ setAddressDis(cityId);
|
|
|
+
|
|
|
+ /*监听省选择事件*/
|
|
|
+ $(document).on('change', '#province', function() {
|
|
|
+ var proId = $("#province").val();
|
|
|
+ var city = setAddressCity(proId);
|
|
|
+ setAddressDis(city);
|
|
|
+ });
|
|
|
+
|
|
|
+ /*监听市选择事件*/
|
|
|
+ $(document).on('change', '#city', function() {
|
|
|
+ var city = $("#city").val();
|
|
|
+ setAddressDis(city);
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ $(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) { //验证通过之前执行的函数
|
|
|
+
|
|
|
+ },
|
|
|
+ beforeSubmit: function (curform) { //验证通过之后执行的函数
|
|
|
+ var pro = $("#province").find("option:selected").text();
|
|
|
+ var city = $("#city").find("option:selected").text();
|
|
|
+ var dis = $("#district").find("option:selected").text();
|
|
|
+ var addres = $("#sendAddress").val();
|
|
|
+ if(addres == null || addres == ""){
|
|
|
+ layer.msg("未填写详细地址", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $("#salesAddressInfo").val(pro + "-" + city + "-" + dis + "-" + addres);
|
|
|
+
|
|
|
+ var itemList = new Array()
|
|
|
+ $("#addProduct").find(".input-color-number").each(function(){
|
|
|
+ var number = $(this).val();
|
|
|
+ if(number != null && number != ""){
|
|
|
+ var salesOrderItem = new Object();
|
|
|
+ salesOrderItem.itemProductId = $(this).parent().find(".input-produce-id").val();
|
|
|
+ salesOrderItem.itemColorId = $(this).parent().find(".input-color-id").val();
|
|
|
+ salesOrderItem.itemNum = number;
|
|
|
+ itemList.push(salesOrderItem);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $("#itemJson").val(JSON.stringify(itemList));
|
|
|
+ },
|
|
|
+ callback: function (data) {//异步回调函数
|
|
|
+ if (data) {
|
|
|
+ var index = layer.alert(data.resultMsg, function () {
|
|
|
+ if (data.resultCode == 200) {
|
|
|
+ addSaleOrder(data.returnMsg.orderId);
|
|
|
+ } else {
|
|
|
+ layer.close(index);
|
|
|
+ }
|
|
|
+ return ;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ /* 添加订单 */
|
|
|
+ function addSaleOrder(orderId){
|
|
|
+ parent.selectOrderInfo(orderId);
|
|
|
+ parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
|
+ }
|
|
|
+
|
|
|
+ /*设置省*/
|
|
|
+ function setAddressPro(){
|
|
|
+ var provinceHtml = "";
|
|
|
+ var provices = listProvince();
|
|
|
+ for(var i=0;i<provices.length;i++){
|
|
|
+ provinceHtml += '<option value="'+ provices[i].provinceId +'">'+ provices[i].province +'</option>';
|
|
|
+ }
|
|
|
+ $("#province").html(provinceHtml);
|
|
|
+ return provices[0].provinceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*设置市*/
|
|
|
+ function setAddressCity(proId){
|
|
|
+ var cityHtml = ''
|
|
|
+ var city = listCity( proId,"");
|
|
|
+ for(var i=0;i<city.length;i++){
|
|
|
+ cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
|
|
|
+ }
|
|
|
+ $("#city").html(cityHtml);
|
|
|
+ return city[0].cityId;
|
|
|
+ }
|
|
|
+ /*设置区*/
|
|
|
+ function setAddressDis(cityId){
|
|
|
+ var districtHtml = ''
|
|
|
+ var district = listDistrict(cityId ,"");
|
|
|
+ for(var i=0;i<district.length;i++){
|
|
|
+ districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
|
|
|
+ }
|
|
|
+ $("#district").html(districtHtml);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 展示产品
|
|
|
+ * @param orderItemList
|
|
|
+ */
|
|
|
+ function setProduce() {
|
|
|
+ var productList = getProduct() ; //所有产品
|
|
|
+ var html = "";
|
|
|
+ var productTypeNo = 0;
|
|
|
+
|
|
|
+ for(var i=0;i<productList.length;i++) {
|
|
|
+ var product = productList[i];
|
|
|
+ var produceFittings = getProduceFittings(product.productId); //获取该产品的所有配件
|
|
|
+ var colorList = product.colorList; //该产品的所有颜色
|
|
|
+
|
|
|
+ var productType = product.productType;
|
|
|
+
|
|
|
+ var colorHtml = '';
|
|
|
+ if(colorList != null && colorList.length >0 ){
|
|
|
+ colorHtml += '<table style="height: 100%;">';
|
|
|
+ for(var j=0;j<colorList.length;j++){
|
|
|
+ var number = "";
|
|
|
+ var color = colorList[j];
|
|
|
+// for(var k=0;k<orderItemList.length;k++){
|
|
|
+// var item = orderItemList[k];
|
|
|
+// if(item.itemColorId == color.colorId){
|
|
|
+// number = item.itemNum;
|
|
|
+// }
|
|
|
+// }
|
|
|
+ var fristInputStyle = "border-top: 1px solid #ddd;";
|
|
|
+ if(color.colorProductId == product.productId) {
|
|
|
+ colorHtml += '<tr >' +
|
|
|
+ ' <td width="85" style="border-left: none;text-align: center;'+ fristInputStyle +'">' + color.colorName + '</td>' +
|
|
|
+ ' <td width="15" style="'+ fristInputStyle +'">' +
|
|
|
+ ' <input type="hidden" class="input-produce-id" value="' + color.colorProductId + '">' +
|
|
|
+ ' <input type="hidden" class="input-color-id" value="' + color.colorId + '">' +
|
|
|
+ ' <input type="text" class="input-text input-color-number number-input" style="width: 100%;" value="'+ number +'" placeholder="数量" id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
|
|
|
+ ' </td>' +
|
|
|
+ ' </tr>';
|
|
|
+ fristInputStyle = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ colorHtml += '</table>';
|
|
|
+ }else{
|
|
|
+ colorHtml += '<span>暂无该产品的颜色!<span>';
|
|
|
+ }
|
|
|
+
|
|
|
+ var produceFittingsHtml = '';
|
|
|
+ if(produceFittings != null && produceFittings.length > 0){
|
|
|
+ produceFittingsHtml += '<table style="height: 100%;">';
|
|
|
+ for(var m=0;m<produceFittings.length;m++){
|
|
|
+ var produceFit = produceFittings[m];
|
|
|
+ if(produceFit.productId == product.productId) {
|
|
|
+ var fristInputStyle = "border-top: 1px solid #ddd;";
|
|
|
+ produceFittingsHtml += '<tr >' +
|
|
|
+ ' <td width="85" style="border-left: none;text-align: center; '+ fristInputStyle +'">' + produceFit.fittingsName +'</td>' +
|
|
|
+ ' <td width="15" style="'+ fristInputStyle +'">' +
|
|
|
+ ' <input type="hidden" class="input-produce-id" value="' + produceFit.productId + '">' +
|
|
|
+ ' <input type="hidden" class="input-fittings-id" value="' + produceFit.fittingsId +'">' +
|
|
|
+ ' <input type="text" class="input-text input-fittings-number" style="width: 100%;" value="'+ number +'" placeholder="数量" id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
|
|
|
+ ' </td>' +
|
|
|
+ ' </tr>';
|
|
|
+ fristInputStyle = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ produceFittingsHtml += '</table>';
|
|
|
+ }else{
|
|
|
+ produceFittingsHtml += '<span>暂无产品配件!<span>';
|
|
|
+ }
|
|
|
+
|
|
|
+ var produceHtml = '<input type="hidden" value="'+ product.productId +'">' +
|
|
|
+ '<span>'+ product.productName +'</span>';
|
|
|
+
|
|
|
+ html += ' <tr >' +
|
|
|
+ ' <td width="80">'+ produceHtml +'</td>' +
|
|
|
+ ' <td style="padding: 0px;text-align: center;">' +
|
|
|
+ colorHtml +
|
|
|
+ ' </td>' +
|
|
|
+ ' <td style="padding: 0px;text-align: center;">' +
|
|
|
+ produceFittingsHtml +
|
|
|
+ ' </td>' +
|
|
|
+ '</tr>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#addProduct").html(html);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*获取产品*/
|
|
|
+ function getProduct(){
|
|
|
+ var productList;
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ },
|
|
|
+ url: "${path}/admin/customer/select_produce",
|
|
|
+ async: false,
|
|
|
+ success: function(data){
|
|
|
+ if (data.returnCode == 200) {
|
|
|
+ productList = data.returnMsg.productList;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return productList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*获取产品配件*/
|
|
|
+ function getProduceFittings(productId){
|
|
|
+ var produceFittings;
|
|
|
+ $.ajax({
|
|
|
+ type: "get",
|
|
|
+ data: {
|
|
|
+ productId : productId
|
|
|
+ },
|
|
|
+ url: "${path}/admin/customer/select_produce_fittings",
|
|
|
+ async: false,
|
|
|
+ success: function(data){
|
|
|
+ if (data.returnCode == 200) {
|
|
|
+ produceFittings = data.returnMsg.produceFittingsList;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return produceFittings;
|
|
|
+ }
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|