|
@@ -66,28 +66,28 @@
|
|
|
<label class="form-label col-1 col-sm-1">更正类型:</label>
|
|
|
<div class="formControls col-8 col-sm-8 skin-minimal" style="">
|
|
|
<div class="radio-box">
|
|
|
- <input type="radio" id="tel-1" name="correctType" value="1" onclick="son()" >
|
|
|
+ <input type="radio" id="tel-1" name="correctType" value="1" checked>
|
|
|
<label for="tel-1">下错订单</label>
|
|
|
</div>
|
|
|
<div class="radio-box">
|
|
|
- <input type="radio" id="tel-2" name="correctType" value="2" onclick="son()" checked>
|
|
|
+ <input type="radio" id="tel-2" name="correctType" value="2" >
|
|
|
<label for="tel-2">订单漏发</label>
|
|
|
</div>
|
|
|
<div class="radio-box">
|
|
|
- <input type="radio" id="tel-3" name="correctType" value="3" onclick="son()" >
|
|
|
+ <input type="radio" id="tel-3" name="correctType" value="3" >
|
|
|
<label for="tel-3">其它原因</label>
|
|
|
<#--<input type="text" class="input-text trim_input customerSourceType_text_4" value="" style="width: 100px;">-->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row cl" style="">
|
|
|
+ <div class="row cl" style="" id="replacementDiv">
|
|
|
<label class="form-label col-1 col-sm-1">补发订单:</label>
|
|
|
<div class="formControls col-2 col-sm-2">
|
|
|
<input type="button" style="width: 100%;" class="btn btn-primary" id="selectOrder" value="选择补发订单" >
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="row cl" id="salesCustomer">
|
|
|
+ <div class="row cl">
|
|
|
<label class="form-label col-1 col-sm-1"></label>
|
|
|
<div class="formControls col-2 col-sm-2" style="color: #c00;">
|
|
|
<span id="salesCustomerIdHtml"></span>
|
|
@@ -119,9 +119,11 @@
|
|
|
<#list order.salesOrderItemList as item>
|
|
|
<tr class="text-c">
|
|
|
<input type="hidden" class="color_id" id="" value="${item.itemColorId}">
|
|
|
+ <input type="hidden" class="color_name" id="" value="${item.itemProductName}">
|
|
|
+ <input type="hidden" class="color_color" id="" value="${item.itemProductColor}">
|
|
|
<input type="hidden" class="color_price" id="" value="${item.itemProductPrice}">
|
|
|
- <input type="hidden" class="color_Price" id="" value="${item.itemProductPrice}">
|
|
|
<input type="hidden" class="color_discount" id="" value="${item.itemProductDiscount}">
|
|
|
+ <input type="hidden" class="item_id" id="" value="${item.itemId}">
|
|
|
<td>${item.itemProductName}</td>
|
|
|
<td>${item.itemProductColor}</td>
|
|
|
<td>${item.itemProductPrice/100}</td>
|
|
@@ -134,8 +136,8 @@
|
|
|
id=""
|
|
|
value="${item.itemNum}"
|
|
|
placeholder="产品数量"
|
|
|
- onkeyup="keyFun($(this),999,1)"
|
|
|
- onpaste="keyFun($(this),999,1)">
|
|
|
+ onkeyup="keyFun($(this),999,0)"
|
|
|
+ onpaste="keyFun($(this),999,0)">
|
|
|
</td>
|
|
|
</tr>
|
|
|
</#list>
|
|
@@ -162,6 +164,8 @@
|
|
|
|
|
|
<div class="row cl">
|
|
|
<div class="col-2 col-sm-2 col-offset-3">
|
|
|
+ <input type="hidden" name="salesId" id="salesId" value="${order.salesId}">
|
|
|
+ <input type="hidden" name="arrayItem" id="arrayItem" value="">
|
|
|
<button class="btn btn-block btn-primary size-XL" type="button" onclick="correct_order();">确认录入</button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -180,21 +184,110 @@
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
+ $(function(){
|
|
|
+ $('.skin-minimal input').iCheck({
|
|
|
+ checkboxClass: 'icheckbox-blue',
|
|
|
+ radioClass: 'iradio-blue',
|
|
|
+ increaseArea: '20%'
|
|
|
+ });
|
|
|
+ $("#replacementDiv").hide();
|
|
|
+ $("#tel-1").on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
|
|
|
+ $("#replacementDiv").hide();
|
|
|
+ $("#replacementOrderId").val("");
|
|
|
+ });
|
|
|
|
|
|
- initCheck();
|
|
|
+ $("#tel-2").on('ifChecked', function(event){
|
|
|
+ $("#replacementDiv").show();
|
|
|
+ });
|
|
|
|
|
|
- $("input[name='correctType']").change(function (){
|
|
|
- alert("11");
|
|
|
+ $("#tel-3").on('ifChecked', function(event){
|
|
|
+ $("#replacementDiv").hide();
|
|
|
+ $("#replacementOrderId").val("");
|
|
|
});
|
|
|
-function son() {
|
|
|
- alert("2");
|
|
|
-}
|
|
|
|
|
|
+ });
|
|
|
/**
|
|
|
* 确认录入
|
|
|
**/
|
|
|
function correct_order() {
|
|
|
+ //封装订单项数据
|
|
|
+ var array = new Array();
|
|
|
+ var nums = 0;
|
|
|
+ $("#add_product").find("tr").each(function () {
|
|
|
+ var item_id = $(this).find(".item_id").val();
|
|
|
+ var color_id = $(this).find(".color_id").val();
|
|
|
+ var color_name = $(this).find(".color_name").val();
|
|
|
+ var color_color = $(this).find(".color_color").val();
|
|
|
+ var color_price = parseInt($(this).find(".color_price").val()/100);
|
|
|
+ var color_discount = parseInt($(this).find(".color_discount").val()/100);
|
|
|
+ var item_num = parseInt($(this).find(".item-num").val());
|
|
|
+ nums = parseInt(nums + item_num);
|
|
|
+ var item = new Object();
|
|
|
+ item.itemId = item_id;
|
|
|
+ item.itemColorId = color_id;
|
|
|
+ item.itemProductName = color_name;
|
|
|
+ item.itemProductColor = color_color;
|
|
|
+ item.itemProductPrice = color_price;
|
|
|
+ item.itemProductDiscount = color_discount;
|
|
|
+ item.itemNum = item_num;
|
|
|
+ array.push(item);
|
|
|
+ });
|
|
|
+ $("#arrayItem").val(JSON.stringify(array));
|
|
|
//封装数据
|
|
|
+ var salesId = $("#salesId").val();
|
|
|
+ var correctType=$('input:radio[name="correctType"]:checked').val();
|
|
|
+ var replacementOrderId = $("#replacementOrderId").val();
|
|
|
+ var correctDesc = $("#correctDesc").val();
|
|
|
+ var arrayItem = $("#arrayItem").val();
|
|
|
+ if(salesId == null || salesId == ""){
|
|
|
+ layer.alert("参数有误,请刷新页面重试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(correctType == null || correctType == ""){
|
|
|
+ layer.alert("参数有误,请刷新页面重试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(correctType == 2){
|
|
|
+ if(replacementOrderId == null || replacementOrderId == ""){
|
|
|
+ layer.alert("更正类型为漏发时需要选择补发订单");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(arrayItem == null || arrayItem == ""){
|
|
|
+ layer.alert("参数有误,请刷新页面重试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(correctDesc != null){
|
|
|
+ if(correctDesc.length > 100){
|
|
|
+ layer.alert("备注长度过长");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(nums <= 0){
|
|
|
+ layer.alert("订单项总数量不能为0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ data: { itemOrderId : salesId,
|
|
|
+ correctType : correctType,
|
|
|
+ replacementOrderId : replacementOrderId,
|
|
|
+ correctDesc : correctDesc,
|
|
|
+ arrayItem : arrayItem},
|
|
|
+ url: url_path +"/admin/salesOrder/correct_order",
|
|
|
+ success: function(data){
|
|
|
+ if (data.returnCode == 200) {
|
|
|
+ layer.alert("更正订单成功!",function () {
|
|
|
+ history.go(-1);
|
|
|
+ });
|
|
|
+
|
|
|
+ }else{
|
|
|
+ layer.alert("更正订单失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/*搜索订单事件*/
|