|
@@ -0,0 +1,766 @@
|
|
|
+<!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%);display: none;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{display: none;}
|
|
|
+ .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{display: none;}
|
|
|
+ .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;
|
|
|
+ }
|
|
|
+ .select-order{text-decoration:none;color: #32A3D8;}
|
|
|
+ .select-order:hover{text-decoration:underline;}
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="page-container">
|
|
|
+ <div class="order-list">
|
|
|
+ <div class="text-c">
|
|
|
+ <form action="" method="post">
|
|
|
+ <div class="row cl" style="margin-left: 0px;">
|
|
|
+
|
|
|
+ <#-- <div class="formControls col-1 col-sm-1" style="margin-right: 30px;">
|
|
|
+ <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name="" onclick="addOrder()">添加订单</button>
|
|
|
+ </div>-->
|
|
|
+ <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;" > <span class="select-box">
|
|
|
+ <select name="companyId" class="select" id="companyId">
|
|
|
+ <option value="">销售公司</option>
|
|
|
+ <#if companyInfoList?? && (companyInfoList?size > 0) >
|
|
|
+ <#list companyInfoList as companyInfo>
|
|
|
+ <option value ="${companyInfo.companyId!""}">${companyInfo.companyName!""}</option>
|
|
|
+ </#list>
|
|
|
+ </#if>
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;"> <span class="select-box">
|
|
|
+ <select name="storeId" class="select" id="storeId">
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;"> <span class="select-box">
|
|
|
+ <select name="salesOrderStatus" class="select" id="salesOrderStatus">
|
|
|
+ <#--1:正常 2:换货 3:退货 4:维修 5:补发-->
|
|
|
+ <option value="">所有类型</option>
|
|
|
+ <option value="1">正常</option>
|
|
|
+ <option value="2">换货</option>
|
|
|
+ <option value="3">退货</option>
|
|
|
+ <option value="4">维修</option>
|
|
|
+ <option value="5">补发</option>
|
|
|
+ <#--<option value="0">取消订单</option>
|
|
|
+ <option value="1">待支付</option>
|
|
|
+ <option value="2">已支付</option>
|
|
|
+ <option value="3">退款申请中</option>
|
|
|
+ <option value="4">已退款</option>
|
|
|
+ <option value="5">已发货</option>
|
|
|
+ <option value="6">申请退货中</option>
|
|
|
+ <option value="7">退货中</option>
|
|
|
+ <option value="8">订单退货,订单关闭</option>
|
|
|
+ <option value="9">换货中</option>
|
|
|
+ <option value="10">换货完成</option>
|
|
|
+ <option value="11">申请换货中</option>
|
|
|
+ <option value="12">已完成</option>
|
|
|
+ <option value="13">全额付款</option>
|
|
|
+ <option value="14">定金付款</option>-->
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;">
|
|
|
+ <input type="text" class="input-text" value="" placeholder="Efast订单号" id="salesOrderId" name="">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;" >
|
|
|
+ <input type="text" class="input-text" value="" placeholder="收货人姓名" id="salesAddressName" name="">
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;">
|
|
|
+ <input type="text" class="input-text" value="" placeholder="收货人电话" id="salesAddressTel" name="">
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-1 col-sm-1" >
|
|
|
+ <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="searchOrder" name="">搜索</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="formControls col-1 col-sm-1" >
|
|
|
+ <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" onclick="addOrder()"> 添加订单</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <#--<a src="javascript:void(0)" style="color: #00e;text-decoration: underline;" onclick="addOrder()">去添加</a>-->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mt-20" style="height: 330px;overflow: auto;overflow-x: hidden;margin-bottom: 12px;border: 1px solid #ddd;">
|
|
|
+ <table class="table table-border table-bordered table-bg table-hover table-sort">
|
|
|
+ <thead>
|
|
|
+ <tr class="text-c">
|
|
|
+ <th width="10"><input type="checkbox" class="selectAll" id="selectAll" value="selectAll" ></th>
|
|
|
+ <th width="50">销售公司</th>
|
|
|
+ <th width="50">店铺名称</th>
|
|
|
+ <th width="50">Efast订单号</th>
|
|
|
+ <th width="100">交易号</th>
|
|
|
+ <th width="60">收货人姓名</th>
|
|
|
+ <th width="80">收货人电话</th>
|
|
|
+ <th width="80">订单金额</th>
|
|
|
+ <th width="80">购买产品</th>
|
|
|
+ <th width="80">购买日期</th>
|
|
|
+ <th width="80">订单状态</th>
|
|
|
+ <th width="100">收货地址</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="orderAll">
|
|
|
+
|
|
|
+ <tr class="text-c">
|
|
|
+ <td colspan="12">请输入搜索条件,搜索订单~
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="formControls col-1 col-sm-1" style="margin-left: 45%;">
|
|
|
+ <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="selectOrderInfo()">确认选择</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="order-add" style="display: none">
|
|
|
+ <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">
|
|
|
+ <input type="hidden" name="salesAddType" id="salesAddType" value="3">
|
|
|
+ <input type="hidden" name="salesShippingStatus" id="salesShippingStatus" value="1">
|
|
|
+
|
|
|
+ <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">
|
|
|
+ <span class="select-box">
|
|
|
+ <select name="salesCompanyId" class="select" id="salesCompanyId">
|
|
|
+ <option value="">销售公司</option>
|
|
|
+ <#if companyInfoList?? && (companyInfoList?size > 0) >
|
|
|
+ <#list companyInfoList as companyInfo>
|
|
|
+ <option value ="${companyInfo.companyId!""}">${companyInfo.companyName!""}</option>
|
|
|
+ </#list>
|
|
|
+ </#if>
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="formControls col-3 col-sm-3">
|
|
|
+ <span class="select-box">
|
|
|
+ <select name="salesStoreId" class="select" id="salesStoreId">
|
|
|
+
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <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">
|
|
|
+ <div class="formControls col-3 col-sm-3" style="width: 100%;margin-left: -2%;margin-bottom: 5px;">
|
|
|
+ <input type="text" style="width: 30%;" class="input-text" value="" placeholder="请输入要搜索的产品名称" id="search-product-name-input">
|
|
|
+ <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 30px;" id="search-product-name-btn">搜索</button>
|
|
|
+ </div>
|
|
|
+ <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>
|
|
|
+ </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="salesAddressName" 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="salesAddressTel" datatype="/\w{11,11}/i" 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',maxDate: '%y-%M-%d'})" 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="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="salesAdminRemark" id="salesAdminRemark" cols="" rows="2" class="textarea" placeholder="商家备注" onKeyUp="$.Huitextarealength(this,50)"></textarea>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row cl" margin-top: 20px;">
|
|
|
+ <label class="form-label col-1 col-sm-1" style="width: 110px;"></label>
|
|
|
+ <div class="formControls col-2 col-sm-2">
|
|
|
+ <button style="height: 40px;font-size: 15px;" class="btn btn-block btn-primary size-XL" type="submit">添加订单</button>
|
|
|
+ </div>
|
|
|
+ <div class="formControls col-2 col-sm-2">
|
|
|
+ <button style="height: 40px;font-size: 15px;" class="btn btn-block btn-primary size-XL" type="button" onclick="toSearch()">去搜索</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+</div>
|
|
|
+
|
|
|
+<tfoot>
|
|
|
+<#--<#include "/base/page_util.ftl">-->
|
|
|
+</tfoot>
|
|
|
+
|
|
|
+<#--时间控件-->
|
|
|
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+ /* 1为选择的订单 2:为新添加的订单 */
|
|
|
+ var type = 1;
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+ /*选择店铺*/
|
|
|
+ $("[name='companyId']").change(function (){
|
|
|
+ var companyId = $(this).val();
|
|
|
+ setStore(companyId,$("#storeId")); //获取店铺
|
|
|
+ })
|
|
|
+
|
|
|
+ /*搜索*/
|
|
|
+ $(document).on('click', '#searchOrder', function() {
|
|
|
+ searchOrder();
|
|
|
+ });
|
|
|
+
|
|
|
+ /*初始化 搜索订单 */
|
|
|
+ //searchOrder();
|
|
|
+
|
|
|
+ /*回车搜索*/
|
|
|
+ $('.input-text').keydown(function(event){
|
|
|
+ if(event.keyCode == 13){ //绑定回车
|
|
|
+ $('#searchOrder').click();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 搜索订单
|
|
|
+ */
|
|
|
+ function searchOrder(){
|
|
|
+ var index = layer.load(1, {
|
|
|
+ shade: [0.5,'#fff'] //0.1透明度的白色背景
|
|
|
+ });
|
|
|
+
|
|
|
+ var salesCompanyId = convertUndefinedToEmpty($("#companyId").val());
|
|
|
+ var salesStoreId = convertUndefinedToEmpty($("#storeId").val());
|
|
|
+ var salesOrderStatus = convertUndefinedToEmpty($("#salesOrderStatus").val());
|
|
|
+ var salesId = convertUndefinedToEmpty($("#salesId").val());
|
|
|
+ var salesAddressName =convertUndefinedToEmpty($("#salesAddressName").val());
|
|
|
+ var salesAddressTel = convertUndefinedToEmpty($("#salesAddressTel").val());
|
|
|
+ var salesOrderId = convertUndefinedToEmpty($("#salesOrderId").val());
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ salesCompanyId : salesCompanyId,
|
|
|
+ salesStoreId : salesStoreId,
|
|
|
+ salesOrderStatus : salesOrderStatus,
|
|
|
+ salesId : salesId,
|
|
|
+ salesOrderId : salesOrderId,
|
|
|
+ salesAddressName : salesAddressName,
|
|
|
+ salesAddressTel : salesAddressTel
|
|
|
+ },
|
|
|
+ url: "${path}/admin/customer/select_salesOrder",
|
|
|
+ async: true,
|
|
|
+ success: function(data){
|
|
|
+ var html = "";
|
|
|
+ if (data.returnCode == 200 && data.returnMsg.salesOrderList.length > 0 ) {
|
|
|
+ for(var i=0;i<data.returnMsg.salesOrderList.length;i++){
|
|
|
+ var salesOrder = data.returnMsg.salesOrderList[i];
|
|
|
+
|
|
|
+ var productsHtml = '';
|
|
|
+ var salesOrderItem = salesOrder.salesOrderItemList;
|
|
|
+ for(var j=0;j<salesOrderItem.length;j++){
|
|
|
+ var item = interceptToString(salesOrderItem[j].itemProductName) +'('+salesOrderItem[j].itemProductColor+ ")*" + salesOrderItem[j].itemNum;
|
|
|
+ productsHtml += '<span class="label label-success radius" title="'+ salesOrderItem[j].itemProductName +'('+salesOrderItem[j].itemProductColor+')*'+ salesOrderItem[j].itemNum +'">' + item + '</span>';
|
|
|
+ }
|
|
|
+ var time = formatDate(new Date(salesOrder.salesPayTime),"yyyy-MM-dd");
|
|
|
+ var orderStatus = null;
|
|
|
+ if(salesOrder.salesOrderStatus == 1){
|
|
|
+ orderStatus = "正常";
|
|
|
+ }
|
|
|
+ if(salesOrder.salesOrderStatus == 2){
|
|
|
+ orderStatus = "换货";
|
|
|
+ }
|
|
|
+ if(salesOrder.salesOrderStatus == 3){
|
|
|
+ orderStatus = "退货";
|
|
|
+ }
|
|
|
+ if(salesOrder.salesOrderStatus == 4){
|
|
|
+ orderStatus = "维修";
|
|
|
+ }
|
|
|
+ if(salesOrder.salesOrderStatus == 5){
|
|
|
+ orderStatus = "补发";
|
|
|
+ }
|
|
|
+ <#--1:正常 2:换货 3:退货 4:维修 5:补发-->
|
|
|
+
|
|
|
+ var disHtml = "";
|
|
|
+ if(salesOrder.salesOrderId == null || salesOrder.salesOrderId == "" || typeof (salesOrder.salesOrderId) == 'undefined'){
|
|
|
+ disHtml = 'disabled="disabled"';
|
|
|
+ }
|
|
|
+ html += '<tr class="text-c">' +
|
|
|
+ ' <td><input type="radio" class="sales_order_id" id="" value="'+ salesOrder.salesId +'" '+ disHtml +'></td>' +
|
|
|
+ ' <td>'+ convertUndefinedToEmpty(salesOrder.companyName) +'</td>' +
|
|
|
+ ' <td>'+ convertUndefinedToEmpty(salesOrder.storeName) +'</td>' +
|
|
|
+ ' <td>'+ convertUndefinedToEmpty(salesOrder.salesOrderId) +'</td>' +
|
|
|
+ ' <td>'+ salesOrder.salesDealCode +'</td>' +
|
|
|
+ ' <td>'+ salesOrder.salesAddressName +'</td>' +
|
|
|
+ ' <td>'+ salesOrder.salesAddressTel +'</td>' +
|
|
|
+ ' <td>'+ salesOrder.salesAmount/100 +'</td>' +
|
|
|
+ ' <td>'+ productsHtml +'</td>' +
|
|
|
+ ' <td>'+ time +'</td>' +
|
|
|
+ ' <td>'+ orderStatus +'</td>' +
|
|
|
+ ' <td>'+ salesOrder.salesAddressInfo +'</td>' +
|
|
|
+ //' <td><a style="" class="select-order" href="javascript:void(0);" title="选择订单" onclick="selectOrderInfo('+ salesOrder.salesId +')" >选择订单</a></td>' +
|
|
|
+ ' </tr>';
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ html = '<tr class="text-c"><td colspan="12">没有搜索到订单,请点击“添加订单”按钮,添加订单。</td></tr>';
|
|
|
+ }
|
|
|
+ $("#orderAll").html(html);
|
|
|
+ layer.close(index);
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
+ layer.close(index);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 选择订单,返回订单内容到父级
|
|
|
+ */
|
|
|
+ function selectOrderInfo(newOrderId) {
|
|
|
+ var orderId = "";
|
|
|
+ if(type == 1){
|
|
|
+ $(".sales_order_id").each(function(){
|
|
|
+ if($(this).is(':checked')){
|
|
|
+ /*orderId += $(this).val() + "_";*/
|
|
|
+ orderId += $(this).val();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ if(newOrderId != null){
|
|
|
+ orderId = newOrderId + "_";;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ parent.setSelectCorrctOrder(orderId);
|
|
|
+ parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
|
+ }
|
|
|
+
|
|
|
+ function toSearch(){
|
|
|
+ $(".order-add").hide();
|
|
|
+ $(".order-list").show();
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+ $(function (){
|
|
|
+
|
|
|
+ $("#search-product-name-btn").click(function() {
|
|
|
+ var name = $("#search-product-name-input").val();
|
|
|
+ var trs = $("#addProduct").children("tr");
|
|
|
+ if (trs == null || trs.length <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (var i = 0; i < trs.length;i ++) {
|
|
|
+ var temp = $($(trs[i]).children("td")[0]).find("span").text();
|
|
|
+ if (temp.indexOf(name) == -1) {
|
|
|
+ $(trs[i]).hide();
|
|
|
+ } else {
|
|
|
+ $(trs[i]).show();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#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 salesCompanyId = $("#salesCompanyId").val();
|
|
|
+ var salesStoreId = $("#salesStoreId").val();
|
|
|
+ if(salesCompanyId == null || salesCompanyId == "" || typeof(salesCompanyId) == "undefined" ||
|
|
|
+ salesStoreId == null || salesStoreId == "" || typeof(salesStoreId) == "undefined"){
|
|
|
+ layer.msg("请选择销售公司与店铺", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ salesOrderItem.itemIsSource = 1; /*标识产品*/
|
|
|
+ itemList.push(salesOrderItem);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $("#addProduct").find(".input-fittings-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-fittings-id").val();
|
|
|
+ salesOrderItem.itemNum = number;
|
|
|
+ salesOrderItem.itemIsSource = 2; /*标识配件*/
|
|
|
+ itemList.push(salesOrderItem);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $("#itemJson").val(JSON.stringify(itemList));
|
|
|
+ },
|
|
|
+ callback: function (data) {//异步回调函数
|
|
|
+ if (data) {
|
|
|
+ var index = layer.alert(data.resultMsg, function () {
|
|
|
+ if (data.resultCode == 200) {
|
|
|
+ type = 2;
|
|
|
+ selectOrderInfo(data.returnMsg.orderId);
|
|
|
+ } else {
|
|
|
+ layer.close(index);
|
|
|
+ }
|
|
|
+ return ;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开添加订单的页面
|
|
|
+ */
|
|
|
+ function addOrder(){
|
|
|
+ $(".order-add").show();
|
|
|
+ $(".order-list").hide();
|
|
|
+
|
|
|
+
|
|
|
+ /*监听销售公司选择事件*/
|
|
|
+ $("[name='salesCompanyId']").change(function (){
|
|
|
+ var companyId = $(this).val();
|
|
|
+ setStore(companyId,$("#salesStoreId")); //获取店铺
|
|
|
+ })
|
|
|
+
|
|
|
+ /*初始化产品*/
|
|
|
+ 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 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 展示销售公司
|
|
|
+ */
|
|
|
+ function setStore(companyId,node){
|
|
|
+ var companyId = $("#companyId").val();
|
|
|
+ var html = '<option value="">店铺</option>';
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ companyId : companyId
|
|
|
+ },
|
|
|
+ url: "${path}/admin/customer/select_storeInfo",
|
|
|
+ success: function(data){
|
|
|
+ var id;
|
|
|
+ if (data.returnCode == 200) {
|
|
|
+ for(var i=0;i<data.returnMsg.storeInfoList.length;i++){
|
|
|
+ var storeInfo = data.returnMsg.storeInfoList[i];
|
|
|
+ html += '<option value="'+ storeInfo.storeId +'">'+ storeInfo.storeName +'</option>';
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ html = '';
|
|
|
+ }
|
|
|
+ $(node).html(html);
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 展示产品
|
|
|
+ * @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>' +
|
|
|
+ '</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>
|