Commit 1db080fe by 朱继来

Merge branch 'zjl_merge_20200821'

parents d04b6c23 66957556
...@@ -562,6 +562,7 @@ Class AddOrderController extends Controller ...@@ -562,6 +562,7 @@ Class AddOrderController extends Controller
$data['role'] = $request->input('role', ''); $data['role'] = $request->input('role', '');
$data['tax_id'] = $request->input('tax_id'); $data['tax_id'] = $request->input('tax_id');
$data['user_coupon_id'] = $request->input('user_coupon_id'); $data['user_coupon_id'] = $request->input('user_coupon_id');
$data['send_type'] = $request->input('zy_delivery_type'); // 发货方式
if ($data['type'] == 1) { // 联营 if ($data['type'] == 1) { // 联营
$data['customer_cn'] = $request->input('customer_cn', ''); $data['customer_cn'] = $request->input('customer_cn', '');
......
...@@ -161,6 +161,11 @@ li { ...@@ -161,6 +161,11 @@ li {
width: 100px; width: 100px;
} }
@media screen and (max-width: 1550px) {
.shop-lists input { width: 80px; }
.select-standard-brand { width: 20px; }
}
.amount-section{ .amount-section{
margin-top: 40px; margin-top: 40px;
text-align: right; text-align: right;
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
return false; return false;
} }
if (!/\d/.test(sku_id)) { if (!/^\d*$/.test(sku_id)) {
layer.msg('参数错误,请输入正确的SKU_ID'); layer.msg('参数错误,请输入正确的SKU_ID');
return false; return false;
} }
...@@ -301,7 +301,6 @@ ...@@ -301,7 +301,6 @@
$('.sku-info').show(); $('.sku-info').show();
var data = resp.data; var data = resp.data;
var status_val = ''; var status_val = '';
$('.goods_name').text(data.goods_name); $('.goods_name').text(data.goods_name);
...@@ -312,7 +311,7 @@ ...@@ -312,7 +311,7 @@
$('.mpq').text(data.min_mpq); $('.mpq').text(data.min_mpq);
if(data.self_supplier_type == 1){ if(data.self_supplier_type == 1){
$('.self_supplier_type').text('自采'); $('.self_supplier_type').text('自采');
}else if(data.self_supplier_type == 2){ }else if(data.self_supplier_type == 2){
$('.self_supplier_type').text('立创'); $('.self_supplier_type').text('立创');
}else{ }else{
...@@ -357,7 +356,9 @@ ...@@ -357,7 +356,9 @@
} }
} }
if (goods_type == 1) { var joint_goods_type = ['1', '2']; // 商品联营类型
if (joint_goods_type.indexOf(data.goods_type) != -1) {
html += '<th>USD价格</th>'; html += '<th>USD价格</th>';
} }
...@@ -373,7 +374,7 @@ ...@@ -373,7 +374,7 @@
html += '<td><span class="goods-min-num">'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="goods-min-price">'+data.tiered[i]['price_cn']+'</span></td>'; html += '<td><span class="goods-min-num">'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="goods-min-price">'+data.tiered[i]['price_cn']+'</span></td>';
} }
if (goods_type == 1) { if (joint_goods_type.indexOf(data.goods_type) != -1) {
html += '<td>$<span class="goods-min-price-us">'+data.tiered[i]['price_us']+'</span></td>'; html += '<td>$<span class="goods-min-price-us">'+data.tiered[i]['price_us']+'</span></td>';
} }
} else { } else {
...@@ -383,7 +384,7 @@ ...@@ -383,7 +384,7 @@
html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span>'+data.tiered[i]['price_cn']+'</span></td>'; html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span>'+data.tiered[i]['price_cn']+'</span></td>';
} }
if (goods_type == 1) { if (joint_goods_type.indexOf(data.goods_type) != -1) {
html += '<td>$<span>'+data.tiered[i]['price_us']+'</span></td>'; html += '<td>$<span>'+data.tiered[i]['price_us']+'</span></td>';
} }
} }
...@@ -418,7 +419,7 @@ ...@@ -418,7 +419,7 @@
return false; return false;
} }
if (goods_type == 1) { // 联营需要选择交货地 // if (goods_type == 1) { // 联营需要选择交货地
delivery_place = $('input[name=delivery_place]:checked').val(); delivery_place = $('input[name=delivery_place]:checked').val();
if (delivery_place == null) { if (delivery_place == null) {
...@@ -426,10 +427,10 @@ ...@@ -426,10 +427,10 @@
return false; return false;
} }
if (type == 3 || type == 4) { // if (type == 3 || type == 4) {
layer.msg('仅支持联营商品下单,请在自营订单中下单'); // layer.msg('仅支持联营商品下单,请在自营订单中下单');
return false; // return false;
} // }
var goods_min_price = $(this).parents('.sku-info').find('.goods-min-price').text(); var goods_min_price = $(this).parents('.sku-info').find('.goods-min-price').text();
var goods_min_price_us = $(this).parents('.sku-info').find('.goods-min-price-us').text(); var goods_min_price_us = $(this).parents('.sku-info').find('.goods-min-price-us').text();
...@@ -445,12 +446,12 @@ ...@@ -445,12 +446,12 @@
return false; return false;
} }
} }
} else { // } else {
if (type == 1 || type == 2) { // 1.联营 2.专卖 // if (type == 1 || type == 2) { // 1.联营 2.专卖
layer.msg('仅支持自营商品下单,请在联营订单中下单'); // layer.msg('仅支持自营商品下单,请在联营订单中下单');
return false; // return false;
} // }
} // }
var datax = { var datax = {
uid: user_id, uid: user_id,
...@@ -505,7 +506,11 @@ ...@@ -505,7 +506,11 @@
layer.msg('购买数量低于最小起订量,默认调整为最小起订量'); layer.msg('购买数量低于最小起订量,默认调整为最小起订量');
} }
if (goods_type == 1) { // 联营需要选择交货地 var curr_goods_type = $(this).parents('tr').data('goods_type');
var joint_goods_type = ['1', '2']; // 商品联营类型
// if (goods_type == 1) { // 联营需要选择交货地
if (joint_goods_type.indexOf(curr_goods_type) != -1) {
delivery_place = $('input[name=delivery_place]:checked').val(); delivery_place = $('input[name=delivery_place]:checked').val();
} else { // 自营数量需要结合倍数 } else { // 自营数量需要结合倍数
var mpl = Number(self.parents('tr').find('.goods_mpl').text()); // 倍数 var mpl = Number(self.parents('tr').find('.goods_mpl').text()); // 倍数
...@@ -725,14 +730,20 @@ ...@@ -725,14 +730,20 @@
datax.address_name = $('input[name=address_name]').val(); datax.address_name = $('input[name=address_name]').val();
datax.address_mobile = $('input[name=address_mobile]').val(); datax.address_mobile = $('input[name=address_mobile]').val();
} else { // 联营、自营线上订单 } else { // 联营、自营线上订单
var tax_id = $('.tax_id').val(); var tax_id = $('.tax_id').val();
var inv_type = $('input[name=inv_type]:checked').val(); var inv_type = $('input[name=inv_type]:checked').val();
var user_coupon_id = $('.user_coupon_id').val(); var user_coupon_id = $('.user_coupon_id').val();
var zy_delivery_type = $('.zy_delivery_type').val();
if (!address_id) { if (!address_id) {
layer.msg('请选择快递信息'); layer.msg('请选择快递信息');
return false; return false;
} }
if (!zy_delivery_type) {
layer.msg('请选择发货方式');
return false;
}
if (type == 4) { // 自营其他业务 if (type == 4) { // 自营其他业务
var business_type = $('#business_type').val(); var business_type = $('#business_type').val();
...@@ -794,12 +805,11 @@ ...@@ -794,12 +805,11 @@
datax.customer_website = customer_website; datax.customer_website = customer_website;
} }
datax.tax_id = tax_id; datax.tax_id = tax_id;
datax.user_coupon_id = user_coupon_id; datax.user_coupon_id = user_coupon_id;
datax.zy_delivery_type = zy_delivery_type;
} }
// self.attr('disabled', true).css('pointer-events', 'none'); // 成功生成订单后禁用按钮,防止重复提交
// 自营线上 // 自营线上
if (type == 2 && is_online == 1) { if (type == 2 && is_online == 1) {
var sale_type = $('#sale_type').val(); var sale_type = $('#sale_type').val();
...@@ -908,7 +918,7 @@ ...@@ -908,7 +918,7 @@
// list = list.reverse(); // list = list.reverse();
// 购物车列表 // 购物车列表
for (var i = len - 1 ; i >= 0; i--) { for (var i = len - 1 ; i >= 0; i--) {
html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'" data-brand_id="'+list[i].brand_id+'" data-brand_name="'+list[i].brand_name+'">'+ html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'" data-brand_id="'+list[i].brand_id+'" data-brand_name="'+list[i].brand_name+'" data-goods_type="'+list[i].goods_type+'">'+
'<td>'+(len - i)+'</td>'+ '<td>'+(len - i)+'</td>'+
'<td class="goods_id">'+list[i].goods_id+'</td>'+ '<td class="goods_id">'+list[i].goods_id+'</td>'+
'<td>'+list[i].goods_name+'</td>'+ '<td>'+list[i].goods_name+'</td>'+
...@@ -920,9 +930,10 @@ ...@@ -920,9 +930,10 @@
html += '<input type="text" class="change_standard_brand_name" name="standard_brand_name" value="'+list[i].standard_brand_name+'" readonly /><i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=1></i></td>'; html += '<input type="text" class="change_standard_brand_name" name="standard_brand_name" value="'+list[i].standard_brand_name+'" readonly /><i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=1></i></td>';
} }
if (goods_type == 2) { // if (goods_type == 2) {
html += '<td><span class="goods_mpl">'+list[i].mpl+'</span></td>'; var mpl = list[i].mpl ? list[i].mpl : '';
} html += '<td><span class="goods_mpl">'+mpl+'</span></td>';
// }
html += '<td><input type="text" class="goods_num" name="goods_num" value="'+list[i].goods_number+'" data-origin_num="'+list[i].goods_number+'"></td>'+ html += '<td><input type="text" class="goods_num" name="goods_num" value="'+list[i].goods_number+'" data-origin_num="'+list[i].goods_number+'"></td>'+
'<td class="goods_price">'+list[i].goods_price+'</td>'+ '<td class="goods_price">'+list[i].goods_price+'</td>'+
...@@ -954,17 +965,20 @@ ...@@ -954,17 +965,20 @@
} }
// 自营商品检查数量 // 自营商品检查数量
if (goods_type == 2) { // if (goods_type == 2) { // 20200826 订单合并后,不以goods_type为判断条件
var changeGoods = []; var changeGoods = [];
$('.shop-table tbody tr').each(function() { $('.shop-table tbody tr').each(function() {
var goods_id = $(this).find('.goods_id').text(); var goods_id = $(this).find('.goods_id').text();
var num = Number($(this).find('.goods_num').val()); var num = Number($(this).find('.goods_num').val());
var mpl = Number($(this).find('.goods_mpl').text()); var mpl = Number($(this).find('.goods_mpl').text());
var cart_id = $(this).data('cid'); var cart_id = $(this).data('cid');
var type = $(this).data('type'); var type = $(this).data('type');
var curr_goods_type = $(this).data('goods_type');
if (num % mpl != 0) { var self_goods_type = ['3', '4']; // 自营商品类型
// 自营商品 且 数量与倍数不匹配
if (self_goods_type.indexOf(curr_goods_type) != -1 && num % mpl != 0) {
num = Math.ceil(num / mpl) * mpl; num = Math.ceil(num / mpl) * mpl;
$.ajax({ $.ajax({
...@@ -986,7 +1000,7 @@ ...@@ -986,7 +1000,7 @@
layer.alert('已按倍数调整购买数量,商品ID:'+changeGoods.join(', ')); layer.alert('已按倍数调整购买数量,商品ID:'+changeGoods.join(', '));
self.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表 self.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
} }
} // }
} else { } else {
layer.msg(resp.errmsg || '网络异常'); layer.msg(resp.errmsg || '网络异常');
...@@ -1102,9 +1116,11 @@ ...@@ -1102,9 +1116,11 @@
$('.extend_fee_val').empty().text(data.extend_fee_format); // 附加费 $('.extend_fee_val').empty().text(data.extend_fee_format); // 附加费
} }
if (goods_type == 2 && business_type != 2) { // 自营仓库损耗不需要运费 // if (goods_type == 2 && business_type != 2) { // 自营仓库损耗不需要运费
$('.express_fee_val').empty().text(data.finally_shipping_price_format); // 运费 // $('.express_fee_val').empty().text(data.finally_shipping_price_format); // 运费
} // }
$('.express_fee_val').empty().text(data.finally_shipping_price_format); // 订单合并后,如果存在运费则需要展示
} else { } else {
$('.amount-section').show(); $('.amount-section').show();
$('.order_amount').empty().text(data.order_amount_format); $('.order_amount').empty().text(data.order_amount_format);
......
+(function($){ +(function($){
$.lie = $.lie || {version: "v1.0.0"}; $.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, { $.extend($.lie, {
changeOrder:{ changeOrder:{
//人工审单 //人工审单
index: function(){ index: function(){
// 删除商品 // 删除商品
$('.order-change-table tbody').delegate('.deletegoods', 'click', function(){ $('.order-change-table tbody').delegate('.deletegoods', 'click', function(){
var self = $(this); var self = $(this);
var rec_id = self.data('id'); var rec_id = self.data('id');
var goods_type = self.data('type'); var goods_type = self.data('type');
var order_type_extend = $('#order_type_extend').val(); var order_type_extend = $('#order_type_extend').val();
var content = ''; var content = '';
var is_add = self.parents('tr').find('.is_add').val(); // 新增的商品 var is_add = self.parents('tr').find('.is_add').val(); // 新增的商品
if (is_add) { if (is_add) {
content += '确定删除新增的商品吗?'; content += '确定删除新增的商品吗?';
} else { } else {
content += '<div><textarea type="text" class="reason" style="width:300px;height: 100px"></textarea></div><span class="error">请填写删除商品原因,100字以内</span>'; content += '<div><textarea type="text" class="reason" style="width:300px;height: 100px"></textarea></div><span class="error">请填写删除商品原因,100字以内</span>';
} }
layer.open({ layer.open({
title: '删除商品' title: '删除商品'
,content: content ,content: content
,btn:['确定', '取消'] ,btn:['确定', '取消']
,yes: function(index, layero){ ,yes: function(index, layero){
var reason = $('.reason').val(); var reason = $('.reason').val();
if(!reason && !is_add){ if(!reason && !is_add){
layer.tips('请填写删除商品原因',$('.reason')); layer.tips('请填写删除商品原因',$('.reason'));
return false; return false;
} }
if (goods_type == 1) { // 联营删除 if (goods_type == 1) { // 联营删除
self.parents('tr').find('.change_status').val(-1); // 调整状态 self.parents('tr').find('.change_status').val(-1); // 调整状态
self.parents('tr').find('.change_status_val').html('<i class="error">已取消</i>'); // 调整状态 self.parents('tr').find('.change_status_val').html('<i class="error">已取消</i>'); // 调整状态
self.parents('tr').find('.del_reason').val(reason); // 删除原因 self.parents('tr').find('.del_reason').val(reason); // 删除原因
self.parents('tr').find('input').attr('readonly', 'readonly'); // 设置当前行input只读 self.parents('tr').find('input').attr('readonly', 'readonly'); // 设置当前行input只读
calculate(self); calculate(self);
self.hide(); // 隐藏当前删除按钮 self.hide(); // 隐藏当前删除按钮
layer.close(index); layer.close(index);
} else { // 自营删除 } else { // 自营删除
$.ajax({ $.ajax({
type: 'post', type: 'post',
url:'/ajaxdeletegoods', url:'/ajaxdeletegoods',
data:{rec_id: rec_id, goods_type: goods_type, reason: reason}, data:{rec_id: rec_id, goods_type: goods_type, reason: reason},
dataType: 'json', dataType: 'json',
success: function(resp) { success: function(resp) {
if(resp.errcode == 0) { if(resp.errcode == 0) {
location.reload();//刷新本页 location.reload();//刷新本页
return false; return false;
} }
layer.msg(resp.errmsg); layer.msg(resp.errmsg);
return false; return false;
} }
}); });
} }
} }
,btn2: function(index, layero){ ,btn2: function(index, layero){
layer.close(index); layer.close(index);
} }
}); });
}) })
/** /**
* 计算各项费用 * 计算各项费用
* @param {String} self [当前删除商品对象] * @param {String} self [当前删除商品对象]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
function calculate(self='') function calculate(self='')
{ {
var rec_id = ''; var rec_id = '';
var curr_sup = ''; var curr_sup = '';
if (self) { if (self) {
var rec_id = self.data('id'); var rec_id = self.data('id');
var curr_sup = self.parents('tr').data('sup'); // 当前行供应商 var curr_sup = self.parents('tr').data('sup'); // 当前行供应商
} }
var goods_total = 0; // 商品总额 var goods_total = 0; // 商品总额
var supplier = []; // 各供应商商品小计数组 var supplier = []; // 各供应商商品小计数组
var is_supplier_exists = false; // 明细是否还存在同供应商商品,默认false不存在 var is_supplier_exists = false; // 明细是否还存在同供应商商品,默认false不存在
var goods_len = 0; // 明细条数 var goods_len = 0; // 明细条数
$('.order-change-table').find('tbody tr').each(function() { $('.order-change-table').find('tbody tr').each(function() {
var id = $(this).find('.change_rec_id').val(); var id = $(this).find('.change_rec_id').val();
var status = $(this).find('.change_status').val(); var status = $(this).find('.change_status').val();
if (id == rec_id) return true; // 过滤本次删除商品 if (id == rec_id) return true; // 过滤本次删除商品
if (status == -1) return true; // 结束本次循环 if (status == -1) return true; // 结束本次循环
var sup = $(this).data('sup'); var sup = $(this).data('sup');
if (sup == curr_sup) is_supplier_exists = true; if (sup == curr_sup) is_supplier_exists = true;
var num = parseInt($(this).find('.num').val()) || 0; var num = parseInt($(this).find('.num').val()) || 0;
var price = parseFloat($(this).find('.price').val()) || 0; var price = parseFloat($(this).find('.price').val()) || 0;
if (supplier.hasOwnProperty(sup)) { // 判断当前key是否存在于数组中 if (supplier.hasOwnProperty(sup)) { // 判断当前key是否存在于数组中
supplier[sup] = (parseFloat(supplier[sup]) + parseFloat(num * price)).toFixed(2); supplier[sup] = (parseFloat(supplier[sup]) + parseFloat(num * price)).toFixed(2);
} else { } else {
supplier[sup] = parseFloat(num * price).toFixed(2); supplier[sup] = parseFloat(num * price).toFixed(2);
} }
goods_total += parseFloat(num * price); goods_total += parseFloat(num * price);
goods_len++; goods_len++;
}); });
// 附加费存在 且 明细不存在同供应商商品 // 附加费存在 且 明细不存在同供应商商品
if ($('.extend-fee-table').length > 0 && !is_supplier_exists) { if ($('.extend-fee-table').length > 0 && !is_supplier_exists) {
// 若不存在,则删除指定的附加费 // 若不存在,则删除指定的附加费
var extend_fee_total = 0; var extend_fee_total = 0;
$('.extend-fee-table').find('tbody tr').each(function(){ $('.extend-fee-table').find('tbody tr').each(function(){
var sup = $(this).data('sup'); var sup = $(this).data('sup');
if (sup == curr_sup) { if (sup == curr_sup) {
$(this).remove(); $(this).remove();
return true; return true;
} }
$(this).find('.sup_amount').val(supplier[sup]); $(this).find('.sup_amount').val(supplier[sup]);
$(this).find('.sup_amount_val').text(supplier[sup]); $(this).find('.sup_amount_val').text(supplier[sup]);
var extend_fee = parseInt($(this).find('.adjust_extend_fee').val()) || 0; var extend_fee = parseInt($(this).find('.adjust_extend_fee').val()) || 0;
extend_fee_total += extend_fee; extend_fee_total += extend_fee;
}) })
$('.extra_fee').html(extend_fee_total); $('.extra_fee').html(extend_fee_total);
$('input[name="extra_fee"]').val(extend_fee_total); $('input[name="extra_fee"]').val(extend_fee_total);
} }
var extra_fee = $('input[name="extra_fee"]').val() ? parseFloat($('input[name="extra_fee"]').val()) : 0; var extra_fee = $('input[name="extra_fee"]').val() ? parseFloat($('input[name="extra_fee"]').val()) : 0;
var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费 var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费
var total = parseFloat(goods_total + freight_fee + extra_fee).toFixed(2); var discount_amount = $('input[name="discount_amount"]').val() ? parseFloat($('input[name="discount_amount"]').val()) : 0; // 优惠券
var total = parseFloat(goods_total + extra_fee + freight_fee + discount_amount).toFixed(2);
goods_total = goods_total.toFixed(2);
goods_total = goods_total.toFixed(2);
$('.goods_total').html(goods_total);
$('input[name="goods_amount"]').val(goods_total); $('.goods_total').html(goods_total);
$('input[name="order_amount"]').val(total); $('input[name="goods_amount"]').val(goods_total);
$('.total').html(total); $('input[name="order_amount"]').val(total);
$('.advance').val((total*0.3).toFixed(2)); $('.total').html(total);
$('.advance').val((total*0.3).toFixed(2));
if (goods_len == 1) { // 若明细条数为1,则隐藏所有的删除按钮
$('.deletegoods').hide(); if (goods_len == 1) { // 若明细条数为1,则隐藏所有的删除按钮
} $('.deletegoods').hide();
} }
}
// 判断付款类型
if (order_pay_type == 1 || order_pay_type == 4) { // 全款和货到猎芯付款 // 判断付款类型
$('.order_all_pay').attr('checked', true); if (order_pay_type == 1 || order_pay_type == 4) { // 全款和货到猎芯付款
$('.order_advance_pay').parent('label').show(); $('.order_all_pay').attr('checked', true);
} else if (order_pay_type == 2) { // 预付款 $('.order_advance_pay').parent('label').show();
$('.order_advance_pay').attr('checked', true); } else if (order_pay_type == 2) { // 预付款
$('.order_advance_pay').parent('label').show(); $('.order_advance_pay').attr('checked', true);
$('.show-advance-pay').show(); // 定金模块 $('.order_advance_pay').parent('label').show();
} else if (order_pay_type == 3) { // 账期 $('.show-advance-pay').show(); // 定金模块
$('.order_account_period').attr('checked', true); } else if (order_pay_type == 3) { // 账期
$('.show-pay-time').hide(); $('.order_account_period').attr('checked', true);
} $('.show-pay-time').hide();
}
// 选择付款类型
$('input[name=order_pay_type]').click(function(){ // 选择付款类型
var val = $(this).val(); $('input[name=order_pay_type]').click(function(){
var val = $(this).val();
if (val == 2) {
$('.show-advance-pay').show(); // 定金 if (val == 2) {
$('.show-pay-time').show(); // 付款时间 $('.show-advance-pay').show(); // 定金
} else if (val == 3) { $('.show-pay-time').show(); // 付款时间
$('.show-advance-pay').hide(); } else if (val == 3) {
$('.show-pay-time').hide(); $('.show-advance-pay').hide();
} else { $('.show-pay-time').hide();
$('.show-advance-pay').hide(); } else {
$('.show-pay-time').show(); $('.show-advance-pay').hide();
} $('.show-pay-time').show();
}) }
})
// 输入数量、单价校验
$('#checkOrderForm').off().delegate('.only_number', 'keyup', function(){ // 输入数量、单价校验
if($(this).val() == '') return false; $('#checkOrderForm').off().delegate('.only_number', 'keyup', function(){
if($(this).val() == '') return false;
if(!(/^\d{0,7}(\.\d{0,4})?$/g.test( $(this).val()))){//判断输入是否合法,不合法强制转换
if(isNaN(parseFloat($(this).val()))){ if(!(/^\d{0,7}(\.\d{0,4})?$/g.test( $(this).val()))){//判断输入是否合法,不合法强制转换
layer.msg('只能是数字和小数组成'); if(isNaN(parseFloat($(this).val()))){
$(this).val(''); layer.msg('只能是数字和小数组成');
}else{ $(this).val('');
$(this).val(parseFloat($(this).val()).toFixed(4)); }else{
} $(this).val(parseFloat($(this).val()).toFixed(4));
} }
}
if ($(this).val() < 0) {
layer.msg('只能是正整数'); if ($(this).val() < 0) {
$(this).val(''); layer.msg('只能是正整数');
return false; $(this).val('');
} return false;
}
if($(this).val() > 999999.9999){
$(this).val(999999.9999); if($(this).val() > 999999.9999){
} $(this).val(999999.9999);
}
if($(this).val().length > 11){
$(this).val($(this).val().slice(0,11)); if($(this).val().length > 11){
} $(this).val($(this).val().slice(0,11));
}); }
});
// 调整价格
$('.order-change-table').off().delegate('input', 'blur', function(e){ // 调整价格
e.preventDefault(); $('.order-change-table').off().delegate('input', 'blur', function(e){
e.preventDefault();
calculate();
calculate();
// var table = $('.order-change-table');
// var goods_total = 0; // var table = $('.order-change-table');
// var supplier = []; // var goods_total = 0;
// var supplier = [];
// $(table).find('tbody tr').each(function(){
// var num = parseInt($(this).find('.num').val()) || 0; // $(table).find('tbody tr').each(function(){
// var price = parseFloat($(this).find('.price').val()) || 0; // var num = parseInt($(this).find('.num').val()) || 0;
// var price = parseFloat($(this).find('.price').val()) || 0;
// goods_total += parseFloat(num * price);
// goods_total += parseFloat(num * price);
// var sup = $(this).data('sup');
// var sup = $(this).data('sup');
// if (supplier.hasOwnProperty(sup)) { // 判断当前key是否存在于数组中
// supplier[sup] += parseFloat(num * price).toFixed(2); // if (supplier.hasOwnProperty(sup)) { // 判断当前key是否存在于数组中
// } else { // supplier[sup] += parseFloat(num * price).toFixed(2);
// supplier[sup] = parseFloat(num * price).toFixed(2); // } else {
// } // supplier[sup] = parseFloat(num * price).toFixed(2);
// }); // }
// });
// // 附加费商品金额设置
// $('.extend-fee-table').find('tbody tr').each(function(){ // // 附加费商品金额设置
// var sup = $(this).data('sup'); // $('.extend-fee-table').find('tbody tr').each(function(){
// var sup = $(this).data('sup');
// $(this).find('.sup_amount').val(supplier[sup]);
// $(this).find('.sup_amount_val').text(supplier[sup]); // $(this).find('.sup_amount').val(supplier[sup]);
// }) // $(this).find('.sup_amount_val').text(supplier[sup]);
// })
// var extra_fee = $('input[name="extra_fee"]').val() ? parseFloat($('input[name="extra_fee"]').val()) : 0;
// var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费 // var extra_fee = $('input[name="extra_fee"]').val() ? parseFloat($('input[name="extra_fee"]').val()) : 0;
// var total = parseFloat(goods_total + freight_fee + extra_fee).toFixed(2); // var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费
// var total = parseFloat(goods_total + freight_fee + extra_fee).toFixed(2);
// goods_total = goods_total.toFixed(2);
// goods_total = goods_total.toFixed(2);
// $('.goods_total').html(goods_total);
// $('input[name="goods_amount"]').val(goods_total); // $('.goods_total').html(goods_total);
// $('input[name="order_amount"]').val(total); // $('input[name="goods_amount"]').val(goods_total);
// $('.total').html(total); // $('input[name="order_amount"]').val(total);
// $('.advance').val((total*0.3).toFixed(2)); // $('.total').html(total);
// $('.advance').val((total*0.3).toFixed(2));
return false;
}) return false;
})
// 根据供应商调整附加费
$('.extend-fee-table').delegate('input', 'keyup', function(){ // 根据供应商调整附加费
var table = $('.extend-fee-table'); $('.extend-fee-table').delegate('input', 'keyup', function(){
var goods_total = parseFloat($('.goods_total').text()); var table = $('.extend-fee-table');
var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费 var goods_total = parseFloat($('.goods_total').text());
var extend_fee_total = 0; var freight_fee = $('input[name="freight_fee"]').val() ? parseFloat($('input[name="freight_fee"]').val()) : 0; // 运费
var extend_fee_total = 0;
$(table).find('tbody tr').each(function(){
var extend_fee = parseInt($(this).find('.adjust_extend_fee').val()) || 0; $(table).find('tbody tr').each(function(){
var extend_fee = parseInt($(this).find('.adjust_extend_fee').val()) || 0;
extend_fee_total += extend_fee;
}); extend_fee_total += extend_fee;
});
var total = parseFloat(goods_total + freight_fee + extend_fee_total).toFixed(2);
var total = parseFloat(goods_total + freight_fee + extend_fee_total).toFixed(2);
$('.extra_fee').html(extend_fee_total);
$('input[name="extra_fee"]').val(extend_fee_total); $('.extra_fee').html(extend_fee_total);
$('input[name="order_amount"]').val(total); $('input[name="extra_fee"]').val(extend_fee_total);
$('.total').html(total); $('input[name="order_amount"]').val(total);
}) $('.total').html(total);
})
// 调整运费
$('.freight_fee').on('keyup', function() { // 调整运费
var freight_fee = parseFloat($(this).val()); $('.freight_fee').on('keyup', function() {
var freight_fee = parseFloat($(this).val());
if (!freight_fee) freight_fee = 0;
if (!freight_fee) freight_fee = 0;
$(this).val(freight_fee);
$(this).val(freight_fee);
var goods_total = parseFloat($('.goods_total').text());
var total = parseFloat(goods_total + freight_fee).toFixed(2); var goods_total = parseFloat($('.goods_total').text());
var total = parseFloat(goods_total + freight_fee).toFixed(2);
$('.total').html(total);
}) $('.total').html(total);
})
$('.advance').on('blur',function(){
var val = $(this).val(); $('.advance').on('blur',function(){
var val = $(this).val();
if (val == '') {
layer.tips('预付定金不能为空', $(this)); if (val == '') {
return false; layer.tips('预付定金不能为空', $(this));
} else if (val == 0) { return false;
layer.tips('预付定金为0,请更换付款方式:货到深圳仓付款', $(this)); } else if (val == 0) {
} layer.tips('预付定金为0,请更换付款方式:货到深圳仓付款', $(this));
}) }
})
// 用户来源 -- 其他
$('input[name="client_source"]').on('click', function(){ // 用户来源 -- 其他
if($(this).val() == 1){ $('input[name="client_source"]').on('click', function(){
$('.client-input-other').show(); if($(this).val() == 1){
} else { $('.client-input-other').show();
$('.client-input-other').hide(); } else {
} $('.client-input-other').hide();
}); }
});
// 设置折扣
$('.set_goods_price').off().on('blur', function(){ // 设置折扣
var val = $(this).val(); $('.set_goods_price').off().on('blur', function(){
var val = $(this).val();
if (!val) {
layer.msg('折扣值不能为空'); if (!val) {
val = 1; layer.msg('折扣值不能为空');
} val = 1;
}
if (isNaN(parseFloat(val))) {
layer.msg('折扣值只能是数字和小数组成'); if (isNaN(parseFloat(val))) {
val = 1; layer.msg('折扣值只能是数字和小数组成');
} val = 1;
}
if (val <= 0 || val > 1) {
layer.msg('折扣值只能大于0且小于等于1'); if (val <= 0 || val > 1) {
val = 1; layer.msg('折扣值只能大于0且小于等于1');
} val = 1;
}
var discount = parseFloat(val).toFixed(2);
$(this).val(discount); var discount = parseFloat(val).toFixed(2);
$(this).val(discount);
$('.order-change-table').find('tbody tr').each(function(){
var price = $(this).find('.price').val(); $('.order-change-table').find('tbody tr').each(function(){
var origin_price = $(this).find('.price').data('price'); var price = $(this).find('.price').val();
var discount_price = 0; var origin_price = $(this).find('.price').data('price');
var discount_price = 0;
if (val == 1) {
discount_price = origin_price; if (val == 1) {
} else { discount_price = origin_price;
discount_price = parseFloat(price * discount).toFixed(4); } else {
} discount_price = parseFloat(price * discount).toFixed(4);
}
$(this).find('.price').val(discount_price);
}) $(this).find('.price').val(discount_price);
})
$('.order-change-table input').triggerHandler('keyup'); // 自动触发
}) $('.order-change-table input').triggerHandler('keyup'); // 自动触发
})
// 选择付款时间
$('.payTime').change(function(){ // 选择付款时间
var val = $(this).val(); $('.payTime').change(function(){
var val = $(this).val();
if (val == 'other') {
$('.customArea').show(); if (val == 'other') {
} else { $('.customArea').show();
$('.customArea').hide(); } else {
} $('.customArea').hide();
}) }
})
// 提交表单
$('.checkOrder').click(function(){ // 提交表单
var is_newClient = $('input[name=is_newClient]:checked').val(); $('.checkOrder').click(function(){
var client_source = $('input[name=client_source]:checked').val(); var is_newClient = $('input[name=is_newClient]:checked').val();
var order_status = $('input[name=order_status]:checked').val(); var client_source = $('input[name=client_source]:checked').val();
var pay_type = $('input[name=order_pay_type]:checked').val(); // 订单付款类型 var order_status = $('input[name=order_status]:checked').val();
var reason = $('input[name=reason]:checked').val(); var pay_type = $('input[name=order_pay_type]:checked').val(); // 订单付款类型
var payTime = $('.payTime').val(); var reason = $('input[name=reason]:checked').val();
var payTimeOther = $('.payTimeOther').val(); var payTime = $('.payTime').val();
var order_goods_type = $('input[name=order_goods_type]').val(); var payTimeOther = $('.payTimeOther').val();
var order_id = $('input[name=order_id]').val(); var order_goods_type = $('input[name=order_goods_type]').val();
var business_type = $('input[name=business_type]').val(); var order_id = $('input[name=order_id]').val();
var business_type = $('input[name=business_type]').val();
// 若存在digikey商品,终端客户信息必填 2020-4-26
// if (is_dgk_exists) { // 若存在digikey商品,终端客户信息必填 2020-4-26
// var customer_cn = $('.customer_cn').val(); // if (is_dgk_exists) {
// var customer_en = $('.customer_en').val(); // var customer_cn = $('.customer_cn').val();
// var customer_type = $('.customer_type').val(); // var customer_en = $('.customer_en').val();
// var product_use_classone_sn = $('.product_use_classone_sn').val(); // var customer_type = $('.customer_type').val();
// var product_use_classtwo_sn = $('.product_use_classtwo_sn').val(); // var product_use_classone_sn = $('.product_use_classone_sn').val();
// var product_use_classtwo_sn = $('.product_use_classtwo_sn').val();
// if (!customer_cn) {
// layer.msg('请填写终端中文名称'); // if (!customer_cn) {
// return false; // layer.msg('请填写终端中文名称');
// } // return false;
// }
// if (!customer_en) {
// layer.msg('请填写终端英文名称'); // if (!customer_en) {
// return false; // layer.msg('请填写终端英文名称');
// } // return false;
// }
// var en_reg = /^[a-zA-Z0-9\.\s\,\(\)]+$/;
// if(!en_reg.test(customer_en)){ // var en_reg = /^[a-zA-Z0-9\.\s\,\(\)]+$/;
// layer.msg('请填写全英文名称'); // if(!en_reg.test(customer_en)){
// return false; // layer.msg('请填写全英文名称');
// } // return false;
// }
// if (customer_type == '') {
// layer.msg('请选择客户类型'); // if (customer_type == '') {
// return false; // layer.msg('请选择客户类型');
// } // return false;
// }
// if (product_use_classone_sn == '') {
// layer.msg('请选择产品用途一级分类'); // if (product_use_classone_sn == '') {
// return false; // layer.msg('请选择产品用途一级分类');
// } // return false;
// } // }
// }
if (isNewClient) {
if (client_source == null) { if (isNewClient) {
layer.msg('请选择用户来源渠道!'); if (client_source == null) {
return false; layer.msg('请选择用户来源渠道!');
} else if (client_source == 1) { return false;
if ($('#input-other-source').val() == '') { } else if (client_source == 1) {
layer.msg('请填写其他来源'); if ($('#input-other-source').val() == '') {
return false; layer.msg('请填写其他来源');
} return false;
} }
} }
}
// 审核不通过
if (order_status == -1) { // 审核不通过
$('.input-cancel-reason').click(); if (order_status == -1) {
return false; $('.input-cancel-reason').click();
} return false;
}
// 正常订单校验数量、单价
if (business_type == 0) { // 正常订单校验数量、单价
var change_price = false; if (business_type == 0) {
var change_goods_number = false; var change_price = false;
var change_buyer_id = false; var change_goods_number = false;
var change_batch = false; var change_buyer_id = false;
var change_str = ''; var change_batch = false;
var change_str = '';
$('.order-change-table').find('tbody tr').each(function(){
var goods_number = $(this).find('.change_goods_number').val(); $('.order-change-table').find('tbody tr').each(function(){
var price = $(this).find('.price').val(); var goods_number = $(this).find('.change_goods_number').val();
var goods_name = $(this).find('.change_goods_name').val(); var price = $(this).find('.price').val();
var buyer_id = $(this).find('.change_buyer_id').selectpicker('val'); var goods_name = $(this).find('.change_goods_name').val();
var batch = $(this).find('.change_batch').val(); var buyer_id = $(this).find('.change_buyer_id').selectpicker('val');
var status = $(this).find('.change_status').val(); var batch = $(this).find('.change_batch').val();
var status = $(this).find('.change_status').val();
if (status == -1) return true;
if (status == -1) return true;
if (goods_number == '' || goods_number == 0) {
change_goods_number = true; if (goods_number == '' || goods_number == 0) {
change_str += goods_name+'数量不能为0或空 '; change_goods_number = true;
} change_str += goods_name+'数量不能为0或空 ';
}
if (price == '' || price == 0) {
change_price = true; if (price == '' || price == 0) {
change_str += goods_name+'单价不能为0或空 '; change_price = true;
} change_str += goods_name+'单价不能为0或空 ';
}
if (order_goods_type == 1 && (buyer_id == null || buyer_id == '')) {
change_buyer_id = true; if (order_goods_type == 1 && (buyer_id == null || buyer_id == '')) {
change_str += goods_name+'采购员不能为空 '; change_buyer_id = true;
} change_str += goods_name+'采购员不能为空 ';
}
if (order_goods_type == 1 && batch == '') {
change_batch = true; if (order_goods_type == 1 && batch == '') {
change_str += goods_name+'批次不能为空 '; change_batch = true;
} change_str += goods_name+'批次不能为空 ';
}) }
})
if (change_price || change_goods_number || change_buyer_id || change_batch) {
layer.alert(change_str) if (change_price || change_goods_number || change_buyer_id || change_batch) {
return false; layer.alert(change_str)
} return false;
} }
}
// 预付款
if (pay_type == 2) { // 预付款
var deposit_amount = $('input[name=deposit_amount]').val(); if (pay_type == 2) {
var deposit_amount = $('input[name=deposit_amount]').val();
if (deposit_amount == '') {
layer.msg('请填写定金金额'); if (deposit_amount == '') {
return false; layer.msg('请填写定金金额');
}else if (deposit_amount == 0) { return false;
layer.msg('定金金额不能为0'); }else if (deposit_amount == 0) {
return false; layer.msg('定金金额不能为0');
} return false;
} }
}
// 非账期订单选择付款时间
if (pay_type != 3) { // 非账期订单选择付款时间
if (payTime == '') { if (pay_type != 3) {
layer.msg('请选择付款时间'); if (payTime == '') {
return false; layer.msg('请选择付款时间');
} return false;
}
if (payTime == 'other' && payTimeOther == '') {
layer.msg('请填写自定义时间'); if (payTime == 'other' && payTimeOther == '') {
return false; layer.msg('请填写自定义时间');
} return false;
}
if (payTimeOther) {
var reg = /\d/; if (payTimeOther) {
if (!reg.test(payTimeOther)) { var reg = /\d/;
layer.msg('格式错误'); if (!reg.test(payTimeOther)) {
return false; layer.msg('格式错误');
} return false;
}
if (payTimeOther < 1 || payTimeOther > 30) {
layer.msg('自定义时间限制在1-30天'); if (payTimeOther < 1 || payTimeOther > 30) {
return false; layer.msg('自定义时间限制在1-30天');
} return false;
} }
} }
}
if (!is_manager && order_goods_type != 1) { // 非管理员或经理权限和非联营订单需要判断商品价格是否低于80%以下
// 设置默认值false if (!is_manager && order_goods_type != 1) { // 非管理员或经理权限和非联营订单需要判断商品价格是否低于80%以下
$('input[name=check_failed]').val(0); // 设置默认值false
$('input[name=change_pay_type]').val(0); $('input[name=check_failed]').val(0);
$('input[name=change_pay_type]').val(0);
var check_failed_info = '';
// 检查商品单价 var check_failed_info = '';
$('.order-change-table').find('tbody tr').each(function(){ // 检查商品单价
var origin_price = parseFloat($(this).find('.price').data('origin')); $('.order-change-table').find('tbody tr').each(function(){
var price = parseFloat($(this).find('.price').val()) || 0; var origin_price = parseFloat($(this).find('.price').data('origin'));
var goods_name = $(this).find('.change_goods_name').val(); var price = parseFloat($(this).find('.price').val()) || 0;
var goods_name = $(this).find('.change_goods_name').val();
limit_price = (origin_price * 0.8).toFixed(4);
limit_price = (origin_price * 0.8).toFixed(4);
// 若商品单价降价幅度小于或等于20%则赋值
if (price <= limit_price) { // 若商品单价降价幅度小于或等于20%则赋值
check_failed_info += '型号:'+goods_name+',单价:'+origin_price+' -> '+price+' | '; if (price <= limit_price) {
$('input[name=check_failed]').val(1); check_failed_info += '型号:'+goods_name+',单价:'+origin_price+' -> '+price+' | ';
$('input[name=check_failed_info]').val(check_failed_info); $('input[name=check_failed]').val(1);
} $('input[name=check_failed_info]').val(check_failed_info);
}); }
});
// 预付款时设置
if (pay_type == 2) { // 预付款时设置
$('input[name=change_pay_type]').val(1); if (pay_type == 2) {
} $('input[name=change_pay_type]').val(1);
} }
}
var currencySign = currency == 1 ? '¥' : '$';
var goods_amount = parseFloat($('.goods_total').text()); var currencySign = currency == 1 ? '¥' : '$';
var order_amount = parseFloat($('.total').text()); var goods_amount = parseFloat($('.goods_total').text());
var extra_fee = $('input[name=extra_fee]').val() ? $('input[name=extra_fee]').val() : 0; var order_amount = parseFloat($('.total').text());
var freight_fee = $('input[name=freight_fee]').val() ? $('input[name=freight_fee]').val() : 0; var extra_fee = $('input[name=extra_fee]').val() ? $('input[name=extra_fee]').val() : 0;
var last_paid = parseFloat(order_amount + parseFloat(pay_preferential)).toFixed(2); // 实际支付金额 var freight_fee = $('input[name=freight_fee]').val() ? $('input[name=freight_fee]').val() : 0;
var order_type_extend = $('#order_type_extend').val(); var discount_amount = $('input[name="discount_amount"]').val() ? parseFloat($('input[name="discount_amount"]').val()) : 0; // 优惠券
var last_paid = parseFloat(order_amount + parseFloat(pay_preferential)).toFixed(2); // 实际支付金额
var content = '<div class="submit-check">'; var order_type_extend = $('#order_type_extend').val();
content += '<p class="error">请核对订单金额,谨慎操作!</p>'; var content = '<div class="submit-check">';
content += '<p class="error">请核对订单金额,谨慎操作!</p>';
content += '<p><label>商品总金额:</label>'+currencySign + goods_amount+'</p>'; content += '<p><label>商品总金额:</label>'+currencySign + goods_amount+'</p>';
content += '<p><label>优惠金额:</label>'+discount_amount+'</p>'+
content += '<p><label>优惠金额:</label>'+discount_amount+'</p>'+ '<p><label>附加费金额:</label>'+extra_fee+'</p>'+
'<p><label>附加费金额:</label>'+extra_fee+'</p>'+ '<p><label>运费金额:</label>'+freight_fee+'</p>'+
'<p><label>运费金额:</label>'+freight_fee+'</p>'+ '<p><label>订单总金额:</label><span class="error">'+currencySign + order_amount+'</span></p>';
'<p><label>订单总金额:</label><span class="error">'+currencySign + order_amount+'</span></p>';
if (order_goods_type == 1) {
if (order_goods_type == 1) { content += '</div>';
content += '</div>'; var url = '/details/'+order_id;
var url = '/details/'+order_id; } else {
} else { content += '<p><label>支付优惠:</label>'+pay_preferential+'</p>'+
content += '<p><label>支付优惠:</label>'+pay_preferential+'</p>'+ '<p><label>实际支付金额:</label><span class="error">'+currencySign + last_paid +'</span></p>'+
'<p><label>实际支付金额:</label><span class="error">'+currencySign + last_paid +'</span></p>'+ '</div>';
'</div>'; var url = '/details/'+order_id+'?tags=self';
var url = '/details/'+order_id+'?tags=self'; }
}
// 弹出提示
// 弹出提示 layer.open({
layer.open({ area: ['360px'],
area: ['360px'], title: '提示信息',
title: '提示信息', content: content,
content: content, btn:['确定', '取消'],
btn:['确定', '取消'], yes: function(index, layero){
yes: function(index, layero){ $.ajax({
$.ajax({ url : '/ajaxSaveChange',
url : '/ajaxSaveChange', type: 'post',
type: 'post', data: $('#checkOrderForm').serialize(),
data: $('#checkOrderForm').serialize(), dataType: 'json',
dataType: 'json', success: function (resp) {
success: function (resp) { if(resp.errcode == 0){
if(resp.errcode == 0){ layer.msg(resp.errmsg || '操作成功');
layer.msg(resp.errmsg || '操作成功'); setTimeout(function(){
setTimeout(function(){ // location.reload();
// location.reload(); location.href = url;
location.href = url; }, 1000);
}, 1000);
return false;
return false; }
}
layer.alert(resp.errmsg);
layer.alert(resp.errmsg); return false;
return false; // layer.alert(resp.errmsg || '网络异常', function() {
// layer.alert(resp.errmsg || '网络异常', function() { // location.reload();
// location.reload(); // });
// }); },
},
error: function (res) {
error: function (res) { console.log(res);
console.log(res); }
} })
})
layer.msg('审核提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
// layer.msg('审核提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交 },
}, btn2: function(index, layero){
btn2: function(index, layero){ layer.close(index);
layer.close(index); }
} });
}); })
})
// 临时保存
// 临时保存 $('.tempSave').click(function() {
$('.tempSave').click(function() { var order_id = $('input[name=order_id]').val();
var order_id = $('input[name=order_id]').val(); var datax = $('#checkOrderForm').serialize() + '&is_temp_save=1';
var datax = $('#checkOrderForm').serialize() + '&is_temp_save=1';
// 弹出提示
// 弹出提示 layer.open({
layer.open({ area: ['360px'],
area: ['360px'], title: '提示信息',
title: '提示信息', content: '确定临时保存编辑的信息吗?',
content: '确定临时保存编辑的信息吗?', btn:['确定', '取消'],
btn:['确定', '取消'], yes: function(index, layero){
yes: function(index, layero){ $.ajax({
$.ajax({ url : '/ajaxSaveChange',
url : '/ajaxSaveChange', type: 'post',
type: 'post', data: datax,
data: datax, dataType: 'json',
dataType: 'json', success: function (resp) {
success: function (resp) { if(resp.errcode === 0){
if(resp.errcode === 0){ layer.msg(resp.errmsg || '操作成功');
layer.msg(resp.errmsg || '操作成功'); setTimeout(function(){
setTimeout(function(){ location.href = '/details/'+order_id;;
location.href = '/details/'+order_id;; }, 1000);
}, 1000); } else {
} else { layer.alert(resp.errmsg || '网络异常', function() {
layer.alert(resp.errmsg || '网络异常', function() { location.reload();
location.reload(); });
}); }
} },
},
error: function (res) {
error: function (res) { console.log(res);
console.log(res); }
} })
})
layer.msg('保存中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
layer.msg('保存中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交 },
}, btn2: function(index, layero){
btn2: function(index, layero){ layer.close(index);
layer.close(index); }
} });
}); })
})
// 弹出临时保存的订单信息
// 弹出临时保存的订单信息 $('.viewTempSave').click(function(){
$('.viewTempSave').click(function(){ // 弹出提示
// 弹出提示 layer.open({
layer.open({ type: 1,
type: 1, title: '临时保存信息',
title: '临时保存信息', content: $('#temp-save-info'),
content: $('#temp-save-info'), area: ['700px', '600px'],
area: ['700px', '600px'], btn: ['应用', '取消'],
btn: ['应用', '取消'], yes: function(index, layero){
yes: function(index, layero){ // 调整终端客户
// 调整终端客户 if (temp_save_info.customer_cn) {
if (temp_save_info.customer_cn) { $('.customer_cn').val(temp_save_info.customer_cn);
$('.customer_cn').val(temp_save_info.customer_cn); $('.customer_en').val(temp_save_info.customer_en);
$('.customer_en').val(temp_save_info.customer_en); $('.customer_type').val(temp_save_info.customer_type);
$('.customer_type').val(temp_save_info.customer_type); $('.product_use_classone_sn').val(temp_save_info.product_use_classone_sn);
$('.product_use_classone_sn').val(temp_save_info.product_use_classone_sn); $('.product_use_classone_sn').change(); // 添加change事件
$('.product_use_classone_sn').change(); // 添加change事件 $('.product_use_classtwo_sn').val(temp_save_info.product_use_classtwo_sn);
$('.product_use_classtwo_sn').val(temp_save_info.product_use_classtwo_sn); }
}
$('.order_pay_type').val(temp_save_info.order_pay_type); // 调整付款类型
$('.order_pay_type').val(temp_save_info.order_pay_type); // 调整付款类型 $('#kefu_remark').val(temp_save_info.kefu_remark); // 客服备注
$('#kefu_remark').val(temp_save_info.kefu_remark); // 客服备注 $('.advance').val(temp_save_info.deposit_amount); // 调整定金
$('.advance').val(temp_save_info.deposit_amount); // 调整定金
// 调整付款时间
// 调整付款时间 if (temp_save_info.payTime == 'other') {
if (temp_save_info.payTime == 'other') { $('.payTime').val(temp_save_info.payTime);
$('.payTime').val(temp_save_info.payTime); $('.customArea').show();
$('.customArea').show(); $('.payTimeOther').val(temp_save_info.payTimeOther);
$('.payTimeOther').val(temp_save_info.payTimeOther); } else {
} else { $('.payTime').val(temp_save_info.payTime);
$('.payTime').val(temp_save_info.payTime); }
}
// 调整明细
// 调整明细 var items = temp_save_info.change_info;
var items = temp_save_info.change_info; var items_len = 0;
var items_len = 0; var new_str = ''; // 新增商品数据
var new_str = ''; // 新增商品数据 var curr_no = 1; // 标记当前行序号
var curr_no = 1; // 标记当前行序号
// 明细取消禁用
// 明细取消禁用 $('.deletegoods').attr('disabled', false).css('pointer-events', 'auto');
$('.deletegoods').attr('disabled', false).css('pointer-events', 'auto');
for (var i in items) {
for (var i in items) { if (!items[i].is_add) {
if (!items[i].is_add) { $('.change_item_'+i).find('.change_goods_price').val(items[i].goods_price);
$('.change_item_'+i).find('.change_goods_price').val(items[i].goods_price); $('.change_item_'+i).find('.change_goods_number').val(items[i].goods_number);
$('.change_item_'+i).find('.change_goods_number').val(items[i].goods_number); // $('.change_item_'+i).find('.change_buyer_id').val(items[i].buyer_id);
// $('.change_item_'+i).find('.change_buyer_id').val(items[i].buyer_id); $('.change_item_'+i).find('.change_buyer_id').selectpicker('val', items[i].buyer_id);
$('.change_item_'+i).find('.change_buyer_id').selectpicker('val', items[i].buyer_id); $('.change_item_'+i).find('.change_batch').click().val(items[i].batch);
$('.change_item_'+i).find('.change_batch').click().val(items[i].batch); $('.change_item_'+i).find('.change_standard_brand_id').val(items[i].standard_brand_id);
$('.change_item_'+i).find('.change_standard_brand_id').val(items[i].standard_brand_id); $('.change_item_'+i).find('.change_standard_brand_name').val(items[i].standard_brand_name);
$('.change_item_'+i).find('.change_standard_brand_name').val(items[i].standard_brand_name);
// input输入框 且 标准品牌存在
// input输入框 且 标准品牌存在 if ($('.change_item_'+i).find('.change_standard_brand_name').attr('type') == 'text' && items[i].standard_brand_name) {
if ($('.change_item_'+i).find('.change_standard_brand_name').attr('type') == 'text' && items[i].standard_brand_name) { $('.change_item_'+i).find('.change_standard_brand_name').parent('td').addClass('standard-brand-yellow');
$('.change_item_'+i).find('.change_standard_brand_name').parent('td').addClass('standard-brand-yellow'); }
}
if (items[i].status == -1) {
if (items[i].status == -1) { $('.change_item_'+i).find('.change_status').val(items[i].status);
$('.change_item_'+i).find('.change_status').val(items[i].status); $('.change_item_'+i).find('.change_status').next('.change_status_val').html('<i class="error">已取消</i>');
$('.change_item_'+i).find('.change_status').next('.change_status_val').html('<i class="error">已取消</i>'); $('.change_item_'+i).find('.deletegoods').hide();
$('.change_item_'+i).find('.deletegoods').hide(); }
} }
}
items_len++;
items_len++; }
}
// 添加新增商品
// 添加新增商品 for (var i in items) {
for (var i in items) { if (!items[i].is_add) continue;
if (!items[i].is_add) continue;
if (!items[i].add_type) {
if (!items[i].add_type) { var sup = items[i].canal ? items[i].supplier_id+'.'+items[i].canal : items[i].supplier_id;
var sup = items[i].canal ? items[i].supplier_id+'.'+items[i].canal : items[i].supplier_id; new_str += '<tr data-sup="'+sup+'" data-brand_id="'+items[i].brand_id+'" data-brand_name="'+items[i].brand_name+'">';
new_str += '<tr data-sup="'+sup+'" data-brand_id="'+items[i].brand_id+'" data-brand_name="'+items[i].brand_name+'">'; } else {
} else { new_str += '<tr data-brand_id="'+items[i].brand_id+'" data-brand_name="'+items[i].brand_name+'">';
new_str += '<tr data-brand_id="'+items[i].brand_id+'" data-brand_name="'+items[i].brand_name+'">'; }
}
new_str += '<td>'+i+'</td>\
new_str += '<td>'+i+'</td>\ <td>\
<td>\ <input type="hidden" name="change_info['+i+'][supplier_name]" value="'+items[i].supplier_name+'">\
<input type="hidden" name="change_info['+i+'][supplier_name]" value="'+items[i].supplier_name+'">\ <p>'+items[i].supplier_name+'</p>\
<p>'+items[i].supplier_name+'</p>\ </td>\
</td>\ <td>\
<td>\ <input class="change_goods_name" type="hidden" name="change_info['+i+'][goods_name]" value="'+items[i].goods_name+'">\
<input class="change_goods_name" type="hidden" name="change_info['+i+'][goods_name]" value="'+items[i].goods_name+'">\ <p>'+items[i].goods_name+'</p>\
<p>'+items[i].goods_name+'</p>\ </td>\
</td>\ <td>\
<td>\ <input class="change_brand_id" type="hidden" name="change_info['+i+'][brand_id]" value="'+items[i].brand_id+'">\
<input class="change_brand_id" type="hidden" name="change_info['+i+'][brand_id]" value="'+items[i].brand_id+'">\ <input class="change_brand_name" type="hidden" name="change_info['+i+'][brand_name]" value="'+items[i].brand_name+'">\
<input class="change_brand_name" type="hidden" name="change_info['+i+'][brand_name]" value="'+items[i].brand_name+'">\ <p>'+items[i].brand_name+'</p>\
<p>'+items[i].brand_name+'</p>\ </td>';
</td>';
if (items[i].standard_brand_name) {
if (items[i].standard_brand_name) { new_str += '<td class="standard-brand-yellow">';
new_str += '<td class="standard-brand-yellow">'; } else {
} else { new_str += '<td>';
new_str += '<td>'; }
}
new_str += '<input type="hidden" class="change_standard_brand_id" name="change_info['+i+'][standard_brand_id]" value="'+items[i].standard_brand_id+'" />\
new_str += '<input type="hidden" class="change_standard_brand_id" name="change_info['+i+'][standard_brand_id]" value="'+items[i].standard_brand_id+'" />\ <input type="text" class="change_standard_brand_name" name="change_info['+i+'][standard_brand_name]" value="'+items[i].standard_brand_name+'" readonly />\
<input type="text" class="change_standard_brand_name" name="change_info['+i+'][standard_brand_name]" value="'+items[i].standard_brand_name+'" readonly />\ <i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=2></i>\
<i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=2></i>\ </td>\
</td>\ <td>\
<td>\ <input class="only_number num change_goods_number" name="change_info['+i+'][goods_number]" value="'+items[i].goods_number+'">\
<input class="only_number num change_goods_number" name="change_info['+i+'][goods_number]" value="'+items[i].goods_number+'">\ </td>\
</td>\ <td>\
<td>\ <input class="price only_number" name="change_info['+i+'][goods_price]" data-price="'+items[i].goods_price+'" value="'+items[i].goods_price+'">\
<input class="price only_number" name="change_info['+i+'][goods_price]" data-price="'+items[i].goods_price+'" value="'+items[i].goods_price+'">\ </td>';
</td>';
if (items[i].status == 1) {
if (items[i].status == 1) { new_str += '<td>\
new_str += '<td>\ <input class="change_status" type="hidden" name="change_info['+i+'][status]" value="1">\
<input class="change_status" type="hidden" name="change_info['+i+'][status]" value="1">\ <span class="change_status_val">正常<i style="color:green;">(新增)</i></span>\
<span class="change_status_val">正常<i style="color:green;">(新增)</i></span>\ </td>';
</td>';
if (!items[i].add_type) {
if (!items[i].add_type) { new_str += '<td>\
new_str += '<td>\ <a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\
<a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\ <input class="is_add" type="hidden" name="change_info['+i+'][is_add]" value="1" />\
<input class="is_add" type="hidden" name="change_info['+i+'][is_add]" value="1" />\ <input type="hidden" name="change_info['+i+'][goods_id]" value="'+items[i].goods_id+'" />\
<input type="hidden" name="change_info['+i+'][goods_id]" value="'+items[i].goods_id+'" />\ </td>';
</td>'; } else { // 新增无skuid商品
} else { // 新增无skuid商品 new_str += '<td>\
new_str += '<td>\ <a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\
<a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\ <input class="is_add" type="hidden" name="change_info['+i+'][is_add]" value="1" />\
<input class="is_add" type="hidden" name="change_info['+i+'][is_add]" value="1" />\ <input type="hidden" name="change_info['+i+'][add_type]" value="1" />\
<input type="hidden" name="change_info['+i+'][add_type]" value="1" />\ <input type="hidden" name="change_info['+i+'][order_id]" value="'+items[i].order_id+'" />\
<input type="hidden" name="change_info['+i+'][order_id]" value="'+items[i].order_id+'" />\ <input type="hidden" name="change_info['+i+'][goods_id]" value="'+items[i].goods_id+'" />\
<input type="hidden" name="change_info['+i+'][goods_id]" value="'+items[i].goods_id+'" />\ <input type="hidden" name="change_info['+i+'][brand_name]" value="'+items[i].brand_name+'" />\
<input type="hidden" name="change_info['+i+'][brand_name]" value="'+items[i].brand_name+'" />\ <input type="hidden" name="change_info['+i+'][delivery_time]" value="'+items[i].delivery_time+'" />\
<input type="hidden" name="change_info['+i+'][delivery_time]" value="'+items[i].delivery_time+'" />\ <input type="hidden" name="change_info['+i+'][buyer_id]" value="'+items[i].buyer_id+'" />\
<input type="hidden" name="change_info['+i+'][buyer_id]" value="'+items[i].buyer_id+'" />\ <input type="hidden" name="change_info['+i+'][batch]" value="'+items[i].batch+'" />\
<input type="hidden" name="change_info['+i+'][batch]" value="'+items[i].batch+'" />\ <input type="hidden" name="change_info['+i+'][remarks]" value="'+items[i].remarks+'" />\
<input type="hidden" name="change_info['+i+'][remarks]" value="'+items[i].remarks+'" />\ </td>';
</td>'; }
} } else {
} else { new_str += '<td>\
new_str += '<td>\ <input class="change_status" type="hidden" name="change_info['+i+'][status]" value="-1">\
<input class="change_status" type="hidden" name="change_info['+i+'][status]" value="-1">\ <span class="change_status_val"><i style="color:red;">已取消</i></span>\
<span class="change_status_val"><i style="color:red;">已取消</i></span>\ </td>\
</td>\ <td><input class="is_add" type="hidden" name="change_info['+i+'][is_add]" value="1" /></td>';
<td><input class="is_add" type="hidden" name="change_info['+i+'][is_add]" value="1" /></td>'; }
}
new_str += '</tr>';
new_str += '</tr>'; }
}
$('.order-change-table').find('tbody').append(new_str);
$('.order-change-table').find('tbody').append(new_str); $('.order-change-table').find('tbody input').trigger('blur'); // 自动触发
$('.order-change-table').find('tbody input').trigger('blur'); // 自动触发
// 调整附加费
// 调整附加费 var extend_fee_items = temp_save_info.change_extend_fee;
var extend_fee_items = temp_save_info.change_extend_fee; var extend = '';
var extend = '';
for (var i in extend_fee_items) {
for (var i in extend_fee_items) { extend += '<tr data-sup="'+i+'">\
extend += '<tr data-sup="'+i+'">\ <td>\
<td>\ <p>'+extend_fee_items[i].supplier_name+'</p>\
<p>'+extend_fee_items[i].supplier_name+'</p>\ <input type="hidden" name="change_extend_fee['+i+'][supplier_name]" value="'+extend_fee_items[i].supplier_name+'">\
<input type="hidden" name="change_extend_fee['+i+'][supplier_name]" value="'+extend_fee_items[i].supplier_name+'">\ </td>\
</td>\ <td>\
<td>\ <input type="hidden" name="change_extend_fee['+i+'][amount]" class="sup_amount" value="'+extend_fee_items[i].amount+'">\
<input type="hidden" name="change_extend_fee['+i+'][amount]" class="sup_amount" value="'+extend_fee_items[i].amount+'">\ <p class="sup_amount_val">'+extend_fee_items[i].amount+'</p>\
<p class="sup_amount_val">'+extend_fee_items[i].amount+'</p>\ </td>\
</td>\ <td>\
<td>\ <input class="adjust_extend_fee only_number" name="change_extend_fee['+i+'][extend_fee]" value="'+extend_fee_items[i].extend_fee+'">\
<input class="adjust_extend_fee only_number" name="change_extend_fee['+i+'][extend_fee]" value="'+extend_fee_items[i].extend_fee+'">\ <input type="hidden" name="change_extend_fee['+i+'][count]" value="'+extend_fee_items[i].count+'">\
<input type="hidden" name="change_extend_fee['+i+'][count]" value="'+extend_fee_items[i].count+'">\ <input type="hidden" name="change_extend_fee['+i+'][ladder_max]" value="'+extend_fee_items[i].ladder_max+'">\
<input type="hidden" name="change_extend_fee['+i+'][ladder_max]" value="'+extend_fee_items[i].ladder_max+'">\ </td>\
</td>\ </tr>';
</tr>'; }
}
$('.extend-fee-table').find('tbody').empty().append(extend);
$('.extend-fee-table').find('tbody').empty().append(extend); $('.extend-fee-table').find('tbody input').trigger('keyup'); // 自动触发
$('.extend-fee-table').find('tbody input').trigger('keyup'); // 自动触发
layer.msg('应用成功,请在当前页面审单');
layer.msg('应用成功,请在当前页面审单'); layer.close(index)
layer.close(index) $('.viewTempSave').hide();
$('.viewTempSave').hide(); },
}, btn2: function(index, layero){
btn2: function(index, layero){ layer.close(index)
layer.close(index) }
} });
}); })
})
// 弹出已调价的订单信息
// 弹出已调价的订单信息 $('.checkAdjusted').click(function(){
$('.checkAdjusted').click(function(){ var adjusted_info = $('.adjusted_order').html();
var adjusted_info = $('.adjusted_order').html(); var order_id = $('input[name=order_id]').val();
var order_id = $('input[name=order_id]').val(); var order_goods_type = $('input[name=order_goods_type]').val();
var order_goods_type = $('input[name=order_goods_type]').val();
var layer_btn = is_manager ? ['通过', '驳回'] : [];
var layer_btn = is_manager ? ['通过', '驳回'] : []; var url = order_goods_type == 1 ? '/details/'+order_id : '/details/'+order_id+'?tags=self';
var url = order_goods_type == 1 ? '/details/'+order_id : '/details/'+order_id+'?tags=self';
// 弹出提示
// 弹出提示 layer.open({
layer.open({ title: '调价后的订单信息',
title: '调价后的订单信息', content: adjusted_info,
content: adjusted_info, area: ['700px', '400px'],
area: ['700px', '400px'], btn: layer_btn,
btn: layer_btn, yes: function(index, layero){
yes: function(index, layero){ $.ajax({
$.ajax({ url : '/ajaxSaveChange',
url : '/ajaxSaveChange', type: 'post',
type: 'post', data: $('#adjustedOrderForm').serialize()+'&order_status=2',
data: $('#adjustedOrderForm').serialize()+'&order_status=2', dataType: 'json',
dataType: 'json', success: function (resp) {
success: function (resp) { if(resp.errcode === 0){
if(resp.errcode === 0){ layer.msg(resp.errmsg || '操作成功');
layer.msg(resp.errmsg || '操作成功'); setTimeout(function(){
setTimeout(function(){ location.href = url;
location.href = url; }, 1000);
}, 1000); } else {
} else { layer.alert(resp.errmsg || '网络异常');
layer.alert(resp.errmsg || '网络异常'); }
} },
},
error: function (res) {
error: function (res) { console.log(res);
console.log(res); }
} })
}) },
}, btn2: function(index, layero){
btn2: function(index, layero){ $.ajax({
$.ajax({ url : '/ajaxRejected',
url : '/ajaxRejected', type: 'post',
type: 'post', data: $('#adjustedOrderForm').serialize()+'&order_status=1',
data: $('#adjustedOrderForm').serialize()+'&order_status=1', dataType: 'json',
dataType: 'json', success: function (resp) {
success: function (resp) { if(resp.errcode === 0){
if(resp.errcode === 0){ layer.msg(resp.errmsg || '操作成功');
layer.msg(resp.errmsg || '操作成功'); setTimeout(function(){
setTimeout(function(){ // location.reload();
// location.reload(); location.href = url;
location.href = url; }, 1000);
}, 1000); } else {
} else { layer.alert(resp.errmsg || '网络异常');
layer.alert(resp.errmsg || '网络异常'); }
} },
},
error: function (res) {
error: function (res) { console.log(res);
console.log(res); }
} })
}) }
} });
}); })
}) },
},
}
}
});
});
})(jQuery) })(jQuery)
\ No newline at end of file
...@@ -100,6 +100,8 @@ ...@@ -100,6 +100,8 @@
buyers_option += '<option value="'+buyers[i].userId+'">'+buyers[i].name+'</option>'; buyers_option += '<option value="'+buyers[i].userId+'">'+buyers[i].name+'</option>';
} }
var sale_type = order_item.sale_type == 1 ? '现卖' : '预售';
html += '<tr data-sup="'+sup+'" data-brand_name="'+order_item.brand_name+'">\ html += '<tr data-sup="'+sup+'" data-brand_name="'+order_item.brand_name+'">\
<td>'+curr_no+'</td>\ <td>'+curr_no+'</td>\
<td>\ <td>\
...@@ -107,6 +109,7 @@ ...@@ -107,6 +109,7 @@
<input type="hidden" name="change_info['+curr_no+'][supplier_name]" value="'+order_item.supplier_name+'">\ <input type="hidden" name="change_info['+curr_no+'][supplier_name]" value="'+order_item.supplier_name+'">\
<p>'+order_item.supplier_name+'</p>\ <p>'+order_item.supplier_name+'</p>\
</td>\ </td>\
<td>'+sale_type+'</td>\
<td>\ <td>\
<input class="change_goods_name" type="hidden" name="change_info['+curr_no+'][goods_name]" value="'+order_item.goods_name+'">\ <input class="change_goods_name" type="hidden" name="change_info['+curr_no+'][goods_name]" value="'+order_item.goods_name+'">\
<p>'+order_item.goods_name+'</p>\ <p>'+order_item.goods_name+'</p>\
...@@ -311,12 +314,15 @@ ...@@ -311,12 +314,15 @@
} }
} }
var sale_type = order_item.sale_type == 1 ? '现卖' : '预售';
html += '<tr data-brand_name="'+add_brand_name+'">\ html += '<tr data-brand_name="'+add_brand_name+'">\
<td>'+curr_no+'</td>\ <td>'+curr_no+'</td>\
<td>\ <td>\
<input type="hidden" name="change_info['+curr_no+'][supplier_name]" value="'+add_supplier_name+'">\ <input type="hidden" name="change_info['+curr_no+'][supplier_name]" value="'+add_supplier_name+'">\
<p>'+add_supplier_name+'</p>\ <p>'+add_supplier_name+'</p>\
</td>\ </td>\
<td>'+sale_type+'</td>\
<td>\ <td>\
<input class="change_goods_name" type="hidden" name="change_info['+curr_no+'][goods_name]" value="'+add_goods_name+'">\ <input class="change_goods_name" type="hidden" name="change_info['+curr_no+'][goods_name]" value="'+add_goods_name+'">\
<p>'+add_goods_name+'</p>\ <p>'+add_goods_name+'</p>\
......
...@@ -97,6 +97,23 @@ ...@@ -97,6 +97,23 @@
</div> </div>
</div> </div>
<div class="shipping-info">
<h4>发货方式 <span class="title-tips"><i class="fa fa-info-circle"></i>现货发货创建的自营通知单,账户为原客户账户,公司和原客户地址; 拼单发货创建的自营通知单,账户为15011111111,猎芯公司以及星火仓的地址</span></h4>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span><i class="text-danger">*</i> 选择发货方式:</span>
<select name="zy_delivery_type" class="zy_delivery_type">
<option value="">请选择</option>
<option value="1">现货发货</option>
<option value="2">拼单发货</option>
</select>
</div>
</div>
</div>
</div>
<div class="invoice-info"> <div class="invoice-info">
<h4>发票信息 <span class="title-tips"><i class="fa fa-info-circle"></i>可在订单中心完善发票信息,需要在订单审核通过前填写发票信息,否则无法同步至ERP</span></h4> <h4>发票信息 <span class="title-tips"><i class="fa fa-info-circle"></i>可在订单中心完善发票信息,需要在订单审核通过前填写发票信息,否则无法同步至ERP</span></h4>
...@@ -314,7 +331,8 @@ ...@@ -314,7 +331,8 @@
<span>快捷入口: <span>快捷入口:
<a href="{{Config('website.add-sku-url')}}" target="_blank" style="margin-right: 10px;">+新增SKU</a> <a href="{{Config('website.add-sku-url')}}" target="_blank" style="margin-right: 10px;">+新增SKU</a>
<a href="{{Config('website.search-sku-url-1')}}" target="_blank">查询SKU</a> <a href="{{Config('website.search-sku-url-1')}}" target="_blank" style="margin-right: 10px;">查询联营SKU</a>
<a href="{{Config('website.search-sku-url-2')}}" target="_blank">查询自营SKU</a>
</span> </span>
<div class="batch-btn"> <div class="batch-btn">
...@@ -406,22 +424,26 @@ ...@@ -406,22 +424,26 @@
</div> </div>
<!-- 商品列表 --> <!-- 商品列表 -->
<style>
.shop-table tbody tr td{ word-break: break-all; }
</style>
<div class="shop-lists table-responsive"> <div class="shop-lists table-responsive">
<table class="table table-bordered table-hover shop-table"> <table class="table table-bordered table-hover shop-table">
<thead> <thead>
<tr> <tr>
<th width="5%">序号</th> <th width="4%">序号</th>
<th width="10%">SKUID</th> <th width="10%">SKUID</th>
<th width="15%">商品名称</th> <th width="10%">商品名称</th>
<th width="10%">制造商</th> <th width="10%">制造商</th>
<th width="10%">标准品牌</th> <th width="10%">标准品牌</th>
<th width="4%">倍数</th>
<th width="8%">采购数量</th> <th width="8%">采购数量</th>
<th width="7%">采购单价</th> <th width="7%">采购单价</th>
<th width="7%">小计</th> <th width="7%">小计</th>
<th width="7%">货期</th> <th width="7%">货期</th>
<th width="7%">供应商</th> <th width="6%">供应商</th>
<th width="7%">采购员</th> <th width="6%">采购员</th>
<th width="10%">批次</th> <th width="7%">批次</th>
<th width="5%">操作</th> <th width="5%">操作</th>
</tr> </tr>
</thead> </thead>
...@@ -464,6 +486,11 @@ ...@@ -464,6 +486,11 @@
</div> </div>
<div class="row"> <div class="row">
<p class="con-title"><span>运费:</span></p>
<p class="con-val express_fee_val">0.00</p>
</div>
<div class="row">
<p class="con-title"><span>应付金额:</span></p> <p class="con-title"><span>应付金额:</span></p>
<p class="con-val text-danger order_amount"></p> <p class="con-val text-danger order_amount"></p>
</div> </div>
......
<div class="wrapper"> <div class="wrapper">
@include('layouts.header') @include('layouts.header')
<?php <?php
$currency = $order_info['currency'] == 2 ? '$' : '¥'; $currency = $order_info['currency'] == 2 ? '$' : '¥';
?> ?>
<div class="page-content order-details"> <div class="page-content order-details">
<style> <style>
.submit-check { margin: 0 auto; width: 200px; } .submit-check { margin: 0 auto; width: 200px; }
/* 提交审核弹框label */ /* 提交审核弹框label */
.submit-check label { display: inline-block; width: 120px; text-align: right;} .submit-check label { display: inline-block; width: 120px; text-align: right;}
</style> input[type="text"] {width: 120px;}
</style>
<div class="tabs-box">
<div class="order-change-main"> <div class="tabs-box">
@if (($order_info['order_goods_type'] == 1 && in_array($order_info['status'], [1, 2]) && $order_temp_info['is_manager_audit'] != 3) || ($order_info['order_goods_type'] == 2 && $order_info['adjust_count'] < 2)) <div class="order-change-main">
<form id="checkOrderForm" class="form-horizontal table-responsive"> @if (($order_info['order_goods_type'] == 1 && in_array($order_info['status'], [1, 2]) && $order_temp_info['is_manager_audit'] != 3) || ($order_info['order_goods_type'] == 2 && $order_info['adjust_count'] < 2))
<input type="hidden" name="auditor_role" value="{{ $role }}" > <form id="checkOrderForm" class="form-horizontal table-responsive">
<input type="hidden" name="order_sn" value="{{$order_info['order_sn']}}"> <input type="hidden" name="auditor_role" value="{{ $role }}" >
<input type="hidden" name="user_id" value="{{$order_info['user_id']}}"> <input type="hidden" name="order_sn" value="{{$order_info['order_sn']}}">
<input type="hidden" id="order_id" name="order_id" value="{{$order_info['order_id']}}"> <input type="hidden" name="user_id" value="{{$order_info['user_id']}}">
<input type="hidden" name="order_goods_type" value="{{$order_info['order_goods_type']}}"> <input type="hidden" id="order_id" name="order_id" value="{{$order_info['order_id']}}">
<input type="hidden" name="sale_id" value="{{$order_info['sale_id']}}"> <input type="hidden" name="order_goods_type" value="{{$order_info['order_goods_type']}}">
<input type="hidden" name="goods_amount" value="{{$order_price_info['goods_price']}}"> <input type="hidden" name="sale_id" value="{{$order_info['sale_id']}}">
<input type="hidden" name="order_amount" value="{{$order_info['order_amount']}}"> <input type="hidden" name="goods_amount" value="{{$order_price_info['goods_price']}}">
<input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}"> <input type="hidden" name="order_amount" value="{{$order_info['order_amount']}}">
<input type="hidden" name="check_failed" value=""> <input type="hidden" name="cancel_reason" value="{{isset($order_info['cancle_reason']) ? $order_info['cancle_reason'] : ''}}">
<input type="hidden" name="check_failed_info" value=""> <input type="hidden" name="check_failed" value="">
<input type="hidden" name="change_pay_type" value=""> <input type="hidden" name="check_failed_info" value="">
<input type="hidden" name="business_type" value="{{$order_temp_info['business_type']}}"> <input type="hidden" name="change_pay_type" value="">
<input type="hidden" name="business_type" value="{{$order_temp_info['business_type']}}">
<?php $isNewClient = App\Http\Controllers\isNewClient($order_info['order_goods_type'], $order_info['user_id'], $order_info['create_time']); ?>
@if ($isNewClient) <?php $isNewClient = App\Http\Controllers\isNewClient($order_info['order_goods_type'], $order_info['user_id'], $order_info['create_time']); ?>
<!-- 用户来源 --> @if ($isNewClient)
<p>用户来源</p> <!-- 用户来源 -->
<table class="table table-bordered table-hover check-table"> <p>用户来源</p>
<tr class="client_source_row"> <table class="table table-bordered table-hover check-table">
<td class="check-table-title" width="20%">用户来源:</td> <tr class="client_source_row">
<td> <td class="check-table-title" width="20%">用户来源:</td>
<div class="multi-reason"> <td>
<label><input type="radio" name="client_source" value="QQ群">QQ群</label> <div class="multi-reason">
<label><input type="radio" name="client_source" value="微信群">微信群</label> <label><input type="radio" name="client_source" value="QQ群">QQ群</label>
<label><input type="radio" name="client_source" value="微信公众号">微信公众号</label> <label><input type="radio" name="client_source" value="微信群">微信群</label>
<label><input type="radio" name="client_source" value="朋友介绍">朋友介绍</label> <label><input type="radio" name="client_source" value="微信公众号">微信公众号</label>
<label><input type="radio" name="client_source" value="线下广告">线下广告</label> <label><input type="radio" name="client_source" value="朋友介绍">朋友介绍</label>
<label><input type="radio" name="client_source" value="地推">地推</label> <label><input type="radio" name="client_source" value="线下广告">线下广告</label>
<label><input type="radio" name="client_source" value="1">其他</label> <label><input type="radio" name="client_source" value="地推">地推</label>
</div> <label><input type="radio" name="client_source" value="1">其他</label>
</div>
<div class="client-input-other" style="display: none;">
<textarea name="input-other-source" id="input-other-source" placeholder="请填写其他来源"></textarea> <div class="client-input-other" style="display: none;">
</div> <textarea name="input-other-source" id="input-other-source" placeholder="请填写其他来源"></textarea>
</td> </div>
</tr> </td>
</table> </tr>
@endif </table>
@endif
<!-- 存在digikey商品的时候展示 -->
@if ($is_dgk_exists) <!-- 存在digikey商品的时候展示 -->
<style> @if ($is_dgk_exists)
#checkOrderForm .row { margin-left: 0px !important; margin-right: 0px !important; } <style>
#checkOrderForm .form-group { margin-left: 0px !important; } #checkOrderForm .row { margin-left: 0px !important; margin-right: 0px !important; }
.change-order-end-client input { width: 300px; } #checkOrderForm .form-group { margin-left: 0px !important; }
.change-order-end-client select { width: 200px; } .change-order-end-client input { width: 300px; }
</style> .change-order-end-client select { width: 200px; }
<div class="change-order-end-client"> </style>
<h4>终端客户信息 <span class="title-tips"><i class="fa fa-info-circle"></i>digikey渠道商品必填,其他渠道可不填写</span></h4> <div class="change-order-end-client">
<input type="hidden" class="customer_id" name="customer_id" value="{{ $order_extra ? $order_extra['id'] : '' }}"> <h4>终端客户信息 <span class="title-tips"><i class="fa fa-info-circle"></i>digikey渠道商品必填,其他渠道可不填写</span></h4>
<input type="hidden" class="customer_id" name="customer_id" value="{{ $order_extra ? $order_extra['id'] : '' }}">
<div class="row">
<div class="col-sm-6"> <div class="row">
<div class="form-group"> <div class="col-sm-6">
<span><i class="text-danger">*</i> 终端中文名称:</span> <div class="form-group">
<input type="text" class="customer_cn" name="customer_cn" value="{{ $order_extra ? $order_extra['customer_cn'] : '' }}"> <span><i class="text-danger">*</i> 终端中文名称:</span>
</div> <input type="text" class="customer_cn" name="customer_cn" value="{{ $order_extra ? $order_extra['customer_cn'] : '' }}">
</div> </div>
</div>
<div class="col-sm-6">
<div class="form-group"> <div class="col-sm-6">
<span><i class="text-danger">*</i> 客户类型:</span> <div class="form-group">
<select class="layui-select customer_type" name="customer_type"> <span><i class="text-danger">*</i> 客户类型:</span>
<option value="">请选择</option> <select class="layui-select customer_type" name="customer_type">
@if (Config('params.end_user_type')) <option value="">请选择</option>
@foreach (Config('params.end_user_type') as $k => $v) @if (Config('params.end_user_type'))
<option value="{{ $k }}">{{ $v }}</option> @foreach (Config('params.end_user_type') as $k => $v)
@endforeach <option value="{{ $k }}">{{ $v }}</option>
@endif @endforeach
</select> @endif
</div> </select>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col-sm-6"> <div class="row">
<div class="form-group"> <div class="col-sm-6">
<span><i class="text-danger">*</i> 终端英文名称:</span> <div class="form-group">
<input type="text" class="customer_en" name="customer_en" value="{{ $order_extra ? $order_extra['customer_en'] : '' }}"> <span><i class="text-danger">*</i> 终端英文名称:</span>
<a href="https://translate.google.cn/" target="_blank">谷歌翻译</a> <input type="text" class="customer_en" name="customer_en" value="{{ $order_extra ? $order_extra['customer_en'] : '' }}">
</div> <a href="https://translate.google.cn/" target="_blank">谷歌翻译</a>
</div> </div>
</div>
<div class="col-sm-6">
<div class="form-group"> <div class="col-sm-6">
<span><i class="text-danger">*</i> 产品用途:</span> <div class="form-group">
<select class="layui-select product_use_classone_sn" name="product_use_classone_sn"> <span><i class="text-danger">*</i> 产品用途:</span>
<option value="">请选择</option> <select class="layui-select product_use_classone_sn" name="product_use_classone_sn">
@if ($api_dgk_config_one) <option value="">请选择</option>
@foreach ($api_dgk_config_one as $k=>$v) @if ($api_dgk_config_one)
<option value="{{ $k }}">{{ $v }}</option> @foreach ($api_dgk_config_one as $k=>$v)
@endforeach <option value="{{ $k }}">{{ $v }}</option>
@endif @endforeach
</select> @endif
</select>
<select class="layui-select product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
</div> <select class="layui-select product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col-sm-6"> <div class="row">
<div class="form-group"> <div class="col-sm-6">
<span><i class="text-danger">*</i> 终端客户网址:</span> <div class="form-group">
<input type="text" class="customer_website" name="customer_website" value="{{ $order_extra ? $order_extra['customer_website'] : '' }}"> <span><i class="text-danger">*</i> 终端客户网址:</span>
</div> <input type="text" class="customer_website" name="customer_website" value="{{ $order_extra ? $order_extra['customer_website'] : '' }}">
</div> </div>
</div> </div>
</div> </div>
</div>
<hr/>
@endif <hr/>
@endif
<div>
<a class="btn btn-info add_goods" data-type="{{ $order_info['order_goods_type'] }}" style="float: right; margin-bottom: 5px;">新增商品</a> <div>
<a class="btn btn-info add_goods" data-type="{{ $order_info['order_goods_type'] }}" style="float: right; margin-bottom: 5px;">新增商品</a>
@if ($order_info['order_goods_type'] == 1)
<a class="btn btn-primary add_goods_no_skuid" data-type="{{ $order_info['order_goods_type'] }}" style="float: right; margin-bottom: 5px; margin-right: 5px;">新增无SKUID</a> @if ($order_info['order_goods_type'] == 1)
@endif <a class="btn btn-primary add_goods_no_skuid" data-type="{{ $order_info['order_goods_type'] }}" style="float: right; margin-bottom: 5px; margin-right: 5px;">新增无SKUID</a>
</div> @endif
</div>
<!-- 调价 -->
<table class="table table-bordered table-hover text-nowrap order-change-table shop-table"> <!-- 调价 -->
<thead> <table class="table table-bordered table-hover text-nowrap order-change-table shop-table">
<th width="5%">序号</th> <thead>
<th width="10%">供应商</th> <th width="5%">序号</th>
<th width="10%">型号</th> <th width="10%">供应商</th>
<th width="10%">品牌</th> <th width="5%">销售类型</th>
@if ($order_info['order_goods_type'] == 1) <th width="10%">型号</th>
<th width="11%">标准品牌</th> <th width="10%">品牌</th>
@endif @if ($order_info['order_goods_type'] == 1)
<th width="5%">调整数量</th> <th width="11%">标准品牌</th>
<th width="5%">调整单价</th> @endif
<!-- 销售类型为预售时展示 --> <th width="5%">调整数量</th>
@if ($order_info['sale_type'] == 2) <th width="5%">调整单价</th>
<th width="10%">交期时间/天</th> <!-- 销售类型为预售时展示 -->
<th width="10%">锁定库存</th> @if ($order_info['sale_type'] == 2)
@endif <th width="10%">交期时间/天</th>
<th width="10%">锁定库存</th>
@if ($order_info['order_goods_type'] == 1) @endif
<th width="5%">采购员</th>
<th width="5%">批次</th> @if ($order_info['order_goods_type'] == 1)
@endif <th width="5%">采购员</th>
<th width="5%">批次</th>
<th width="3%">状态</th> @endif
<th width="3%">操作</th>
</thead> <th width="3%">状态</th>
<th width="3%">操作</th>
<tbody> </thead>
@foreach ($order_items_info as $k=>$v)
<tr class="change_item_{{$v['rec_id']}}" data-sup="{{$v['canal'] ? $v['supplier_id'].'.'.$v['canal'] : $v['supplier_id']}}" data-brand_id="{{ $v['brand_id'] }}" data-brand_name="{{ $v['brand_name'] }}"> <tbody>
<input class="change_rec_id" type="hidden" name="change_rec_id" value="{{ $v['rec_id'] }}"> @foreach ($order_items_info as $k=>$v)
<td>{{ $k+1 }}</td> <tr class="change_item_{{$v['rec_id']}}" data-sup="{{$v['canal'] ? $v['supplier_id'].'.'.$v['canal'] : $v['supplier_id']}}" data-brand_id="{{ $v['brand_id'] }}" data-brand_name="{{ $v['brand_name'] }}">
<td> <input class="change_rec_id" type="hidden" name="change_rec_id" value="{{ $v['rec_id'] }}">
<input type="hidden" name="change_info[{{$v['rec_id']}}][supplier_name]" value="{{$v['supplier_name']}}"> <td>{{ $k+1 }}</td>
<p>{{$v['supplier_name']}}</p> <td>
</td> <input type="hidden" name="change_info[{{$v['rec_id']}}][supplier_name]" value="{{$v['supplier_name']}}">
<td> <p>{{$v['supplier_name']}}</p>
<input class="change_goods_id" type="hidden" name="change_info[{{$v['rec_id']}}][goods_id]" value="{{$v['goods_id']}}"> </td>
<input class="change_goods_name" type="hidden" name="change_info[{{$v['rec_id']}}][goods_name]" value="{{$v['goods_name']}}"> <td>{{ $v['sale_type'] == 1 ? '现卖' : '预售' }}</td>
<p>{{$v['goods_name']}}</p> <td>
</td> <input class="change_goods_id" type="hidden" name="change_info[{{$v['rec_id']}}][goods_id]" value="{{$v['goods_id']}}">
<td> <input class="change_goods_name" type="hidden" name="change_info[{{$v['rec_id']}}][goods_name]" value="{{$v['goods_name']}}">
<input class="change_brand_id" type="hidden" name="change_info[{{$v['rec_id']}}][brand_id]" value="{{$v['brand_id']}}"> <p>{{$v['goods_name']}}</p>
<input class="change_brand_name" type="hidden" name="change_info[{{$v['rec_id']}}][brand_name]" value="{{$v['brand_name']}}"> </td>
<p>{{$v['brand_name']}}</p> <td>
</td> <input class="change_brand_id" type="hidden" name="change_info[{{$v['rec_id']}}][brand_id]" value="{{$v['brand_id']}}">
@if ($order_info['order_goods_type'] == 1) <input class="change_brand_name" type="hidden" name="change_info[{{$v['rec_id']}}][brand_name]" value="{{$v['brand_name']}}">
<td class="{{ $v['standard_brand_name'] && $v['status'] != -1 ? 'standard-brand-green' : '' }}"> <p>{{$v['brand_name']}}</p>
<input type="hidden" class="change_standard_brand_id" name="change_info[{{$v['rec_id']}}][standard_brand_id]" value="{{$v['standard_brand_id']}}" /> </td>
@if ($v['standard_brand_name'] || $v['status'] == -1) @if ($order_info['order_goods_type'] == 1)
<input type="hidden" class="change_standard_brand_name" name="change_info[{{$v['rec_id']}}][standard_brand_name]" value="{{$v['standard_brand_name']}}"/> <td class="{{ $v['standard_brand_name'] && $v['status'] != -1 ? 'standard-brand-green' : '' }}">
<p>{{$v['standard_brand_name']}}</p> <input type="hidden" class="change_standard_brand_id" name="change_info[{{$v['rec_id']}}][standard_brand_id]" value="{{$v['standard_brand_id']}}" />
@else @if ($v['standard_brand_name'] || $v['status'] == -1)
<input type="text" class="change_standard_brand_name" name="change_info[{{$v['rec_id']}}][standard_brand_name]" readonly /> <input type="hidden" class="change_standard_brand_name" name="change_info[{{$v['rec_id']}}][standard_brand_name]" value="{{$v['standard_brand_name']}}"/>
<i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=2></i> <p>{{$v['standard_brand_name']}}</p>
@endif @else
</td> <input type="text" class="change_standard_brand_name" name="change_info[{{$v['rec_id']}}][standard_brand_name]" readonly />
@endif <i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=2></i>
<td> @endif
<input type="text" class="only_number num change_goods_number" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>> </td>
</td> @endif
<td> <td>
<input type="text" class="price only_number change_goods_price" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['original_price']}}" data-price="{{$v['goods_price']}}" value="{{$v['goods_price']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>> <input type="text" class="only_number num change_goods_number" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>>
</td> </td>
<!-- 销售类型为预售时展示 --> <td>
@if ($order_info['sale_type'] == 2) <input type="text" class="price only_number change_goods_price" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['original_price']}}" data-price="{{$v['goods_price']}}" value="{{$v['goods_price']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>>
<td> </td>
<input type="text" class="only_number" name="change_info[{{$v['rec_id']}}][delivery_time]" value="{{$v['delivery_time']}}" placeholder="请填写天数"> <!-- 销售类型为预售时展示 -->
</td> @if ($order_info['sale_type'] == 2)
<td> <td>
<!-- 未锁库存 --> <input type="text" class="only_number" name="change_info[{{$v['rec_id']}}][delivery_time]" value="{{$v['delivery_time']}}" placeholder="请填写天数">
@if (!$v['is_lock']) </td>
<label> <td>
<input type="checkbox" name="change_info[{{$v['rec_id']}}][is_lock]" value="{{$v['goods_id']}}"> <!-- 未锁库存 -->
<span>锁定库存,可用库存:<b class="text-danger">{{ App\Http\Controllers\getSelfStock($v['goods_id']) }}</b></span> @if (!$v['is_lock'])
</label> <label>
@endif <input type="checkbox" name="change_info[{{$v['rec_id']}}][is_lock]" value="{{$v['goods_id']}}">
</td> <span>锁定库存,可用库存:<b class="text-danger">{{ App\Http\Controllers\getSelfStock($v['goods_id']) }}</b></span>
@endif </label>
@endif
@if ($order_info['order_goods_type'] == 1) </td>
<td> @endif
<select id="buyer_id_{{$v['rec_id']}}" class="form-control change_buyer_id selectpicker" name="change_info[{{ $v['rec_id'] }}][buyer_id]" data-live-search="true" data-size="5" title="请选择采购员">
<option value="">请选择采购员</option> @if ($order_info['order_goods_type'] == 1)
@if (!empty($buyers)) <td>
@foreach ($buyers as $val) <select id="buyer_id_{{$v['rec_id']}}" class="form-control change_buyer_id selectpicker" name="change_info[{{ $v['rec_id'] }}][buyer_id]" data-live-search="true" data-size="5" title="请选择采购员">
<option value="{{ $val->userId }}">{{ $val->name }}</option> <option value="">请选择采购员</option>
@endforeach @if (!empty($buyers))
@endif @foreach ($buyers as $val)
</select> <option value="{{ $val->userId }}">{{ $val->name }}</option>
</td> @endforeach
<script> @endif
var rec_id = "{{ $v['rec_id'] }}"; </select>
var buyer_id = "{{ $v['buyer_id'] }}"; </td>
$('#buyer_id_'+rec_id).selectpicker('val', buyer_id); <script>
</script> var rec_id = "{{ $v['rec_id'] }}";
<td> var buyer_id = "{{ $v['buyer_id'] }}";
<input type="text" class="form-control change_batch" name="change_info[{{ $v['rec_id'] }}][batch]" value="{{ $v['batch'] }}"> $('#buyer_id_'+rec_id).selectpicker('val', buyer_id);
</td> </script>
@endif <td>
<input type="text" class="form-control change_batch" name="change_info[{{ $v['rec_id'] }}][batch]" value="{{ $v['batch'] }}">
<td> </td>
<input class="change_status" type="hidden" name="change_info[{{$v['rec_id']}}][status]" value="{{$v['status']}}"> @endif
<span class="change_status_val"><?= $v['status'] == 1 ? '正常' : '<i class="error">已取消</i>' ?></span>
</td> <td>
<input class="change_status" type="hidden" name="change_info[{{$v['rec_id']}}][status]" value="{{$v['status']}}">
@if (in_array($order_info['status'], [1, 2]) && $v['status'] == 1) <span class="change_status_val"><?= $v['status'] == 1 ? '正常' : '<i class="error">已取消</i>' ?></span>
<td><a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="<?= $v['rec_id'] ?>" data-type="{{ $order_info['order_goods_type'] }}">删除</a></td> </td>
@else
<td></td> @if (in_array($order_info['status'], [1, 2]) && $v['status'] == 1)
@endif <td><a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="<?= $v['rec_id'] ?>" data-type="{{ $order_info['order_goods_type'] }}">删除</a></td>
<input type="hidden" class="del_reason" name="change_info[{{$v['rec_id']}}][del_reason]"> @else
</tr> <td></td>
@endforeach @endif
</tbody> <input type="hidden" class="del_reason" name="change_info[{{$v['rec_id']}}][del_reason]">
</table> </tr>
@endforeach
<textarea name="kefu_remark" id="kefu_remark" class="form-control" placeholder="客服备注信息" style="resize: none;">{{$order_temp_info['kefu_remark']}}</textarea> </tbody>
</table>
@if ($order_info['order_goods_type'] == 2)
<!--<table class="table table-bordered table-hover" style="margin-top:10px;"> <textarea name="kefu_remark" id="kefu_remark" class="form-control" placeholder="客服备注信息" style="resize: none;">{{$order_temp_info['kefu_remark']}}</textarea>
<tr>
<th width="20%">批量调价</th> @if ($order_info['order_goods_type'] == 2)
<td> <!--<table class="table table-bordered table-hover" style="margin-top:10px;">
<input type="text" class="set_goods_price" name="set_goods_price" value="1"> <tr>
<span class="text-danger">(批量设置单价,默认值1,折扣范围 0 < 值 <= 1)</span> <th width="20%">批量调价</th>
</td> <td>
</tr> <input type="text" class="set_goods_price" name="set_goods_price" value="1">
</table> --> <span class="text-danger">(批量设置单价,默认值1,折扣范围 0 < 值 <= 1)</span>
@endif </td>
</tr>
<?php $extend_fee_items = json_decode($order_temp_info['extend_fee_items'], true); ?> </table> -->
@endif
<!-- 供应商附加费 -->
@if ($extend_fee_items) <?php $extend_fee_items = json_decode($order_temp_info['extend_fee_items'], true); ?>
<hr/>
<p>附加费设置</p> <!-- 供应商附加费 -->
<table class="table table-bordered table-hover extend-fee-table"> @if ($extend_fee_items)
<thead> <hr/>
<th width="20%">供应商/渠道</th> <p>附加费设置</p>
<th>商品金额</th> <table class="table table-bordered table-hover extend-fee-table">
<th>调整附加费</th> <thead>
</thead> <th width="20%">供应商/渠道</th>
<th>商品金额</th>
<tbody> <th>调整附加费</th>
@foreach ($extend_fee_items as $k => $v) </thead>
<tr data-sup="{{$k}}">
<td> <tbody>
@if (strpos($k, '.') !== false) @foreach ($extend_fee_items as $k => $v)
<p> <tr data-sup="{{$k}}">
<?php <td>
$sid = explode('.', $k); @if (strpos($k, '.') !== false)
// echo App\Http\Controllers\getSupplierName($sid); <p>
<?php
if ($sid[0] == 17) { // 联营供应商 $sid = explode('.', $k);
echo $sid[1]; // echo App\Http\Controllers\getSupplierName($sid);
} else {
echo $v['supplier_name']; if ($sid[0] == 17) { // 联营供应商
} echo $sid[1];
?> } else {
</p> echo $v['supplier_name'];
@else }
<p>{{$v['supplier_name']}}</p> ?>
@endif </p>
<input type="hidden" name="change_extend_fee[{{$k}}][supplier_name]" value="{{$v['supplier_name']}}"> @else
</td> <p>{{$v['supplier_name']}}</p>
<td> @endif
<input type="hidden" name="change_extend_fee[{{$k}}][amount]" class="sup_amount" value="{{$v['amount']}}"> <input type="hidden" name="change_extend_fee[{{$k}}][supplier_name]" value="{{$v['supplier_name']}}">
<p class="sup_amount_val">{{$v['amount']}}</p> </td>
</td> <td>
<td> <input type="hidden" name="change_extend_fee[{{$k}}][amount]" class="sup_amount" value="{{$v['amount']}}">
<input class="adjust_extend_fee only_number" name="change_extend_fee[{{$k}}][extend_fee]" value="{{$v['extend_fee']}}"> <p class="sup_amount_val">{{$v['amount']}}</p>
</td> </td>
<td>
<input type="hidden" name="change_extend_fee[{{$k}}][count]" value="{{$v['count']}}"> <input class="adjust_extend_fee only_number" name="change_extend_fee[{{$k}}][extend_fee]" value="{{$v['extend_fee']}}">
</td>
@if (isset($v['ladder_max']))
<input type="hidden" name="change_extend_fee[{{$k}}][ladder_max]" value="{{$v['ladder_max']}}"> <input type="hidden" name="change_extend_fee[{{$k}}][count]" value="{{$v['count']}}">
@endif
</tr> @if (isset($v['ladder_max']))
@endforeach <input type="hidden" name="change_extend_fee[{{$k}}][ladder_max]" value="{{$v['ladder_max']}}">
</tbody> @endif
</table> </tr>
@endif @endforeach
</tbody>
<hr/> </table>
<table class="table table-bordered table-hover check-table"> @endif
@if ($order_info['order_goods_type'] == 1)
<tr> <hr/>
<td class="check-table-title" width="20%">付款类型:</td> <table class="table table-bordered table-hover check-table">
<td class="check-select"> @if ($order_info['order_goods_type'] == 1)
<label><input class="order_all_pay" type="radio" name="order_pay_type" value="1">全额付款</label> <tr>
<!-- 销售类型为现卖时展示 --> <td class="check-table-title" width="20%">付款类型:</td>
@if ($order_info['sale_type'] == 1) <td class="check-select">
<label><input class="order_advance_pay" type="radio" name="order_pay_type" value="2">预付首款</label> <label><input class="order_all_pay" type="radio" name="order_pay_type" value="1">全额付款</label>
<label><input class="order_account_period" type="radio" name="order_pay_type" value="3">账期</label> <!-- 销售类型为现卖时展示 -->
<!-- <label><input class="order_cod" type="radio" name="order_pay_type" value="4">货到猎芯付款</label> --> @if ($order_info['sale_type'] == 1)
@endif <label><input class="order_advance_pay" type="radio" name="order_pay_type" value="2">预付首款</label>
</td> <label><input class="order_account_period" type="radio" name="order_pay_type" value="3">账期</label>
</tr> <!-- <label><input class="order_cod" type="radio" name="order_pay_type" value="4">货到猎芯付款</label> -->
@else @endif
<tr> </td>
<td class="check-table-title" width="20%">付款类型:</td> </tr>
<td class="check-select"> @else
<label><input class="order_all_pay" type="radio" name="order_pay_type" value="1">全额付款</label> <tr>
<label><input class="order_account_period" type="radio" name="order_pay_type" value="3">账期</label> <td class="check-table-title" width="20%">付款类型:</td>
</td> <td class="check-select">
</tr> <label><input class="order_all_pay" type="radio" name="order_pay_type" value="1">全额付款</label>
@endif <label><input class="order_account_period" type="radio" name="order_pay_type" value="3">账期</label>
</table> </td>
</tr>
<table class="table table-bordered table-hover"> @endif
<tr> </table>
<th width="20%">商品总金额</th>
<td><p class="text-danger">{{$currency}}<span class="goods_total">{{$order_price_info['goods_price']}}</span></p></td> <table class="table table-bordered table-hover">
</tr> <tr>
<th width="20%">商品总金额</th>
<!-- 销售类型为现卖时展示 --> <td><p class="text-danger">{{$currency}}<span class="goods_total">{{$order_price_info['goods_price']}}</span></p></td>
@if ($order_info['sale_type'] == 1 && $order_price_info['ext_price']) </tr>
<tr>
<th width="20%">附加费金额</th> <!-- 销售类型为现卖时展示 -->
<td> @if ($order_info['sale_type'] == 1 && $order_price_info['ext_price'])
<p class="text-danger">{{$currency}}<span class="extra_fee">{{$order_price_info['ext_price'] ? $order_price_info['ext_price'] : 0}}</span></p> <tr>
<input type="hidden" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price'] ? $order_price_info['ext_price'] : 0}}"> <th width="20%">附加费金额</th>
</td> <td>
</tr> <p class="text-danger">{{$currency}}<span class="extra_fee">{{$order_price_info['ext_price'] ? $order_price_info['ext_price'] : 0}}</span></p>
@endif <input type="hidden" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price'] ? $order_price_info['ext_price'] : 0}}">
</td>
@if (($order_info['order_goods_type'] == 1 && $order_price_info['shipping_price']) || $order_info['order_goods_type'] == 2) </tr>
<tr> @endif
<th>运费</th>
<td> @if ($order_price_info['discount_amount'])
<span>{{$currency}}</span> <tr>
<input class="only_number freight_fee" type="text" name="freight_fee" value="{{ $order_price_info['shipping_price'] }}"> <th>优惠金额</th>
</td> <td>
</tr> <span>{{ $order_price_info['discount_amount'] }}</span>
@endif <input class="only_number discount_amount" type="hidden" name="discount_amount" value="{{ $order_price_info['discount_amount'] }}">
</td>
<tr> </tr>
<th width="20%">订单总额</th> @endif
<td>
<p class="text-danger">{{$currency}}<span class="total">{{$order_info['order_amount']}}</span></p> @if (($order_info['order_goods_type'] == 1 && $order_price_info['shipping_price']) || $order_info['order_goods_type'] == 2)
</td> <tr>
</tr> <th>运费</th>
</table> <td>
<input class="only_number freight_fee" type="text" name="freight_fee" value="{{ $order_price_info['shipping_price'] }}">
<div class="show-advance-pay"> </td>
<hr/> </tr>
<p>定金调整</p> @endif
<table class="table table-bordered table-hover">
<tr> <tr>
<th width="20%">定金金额</th> <th width="20%">订单总额</th>
<td> <td>
<p class="text-danger">{{$currency}} <p class="text-danger">{{$currency}}<span class="total">{{$order_info['order_amount']}}</span></p>
<?php </td>
if (!$order_info['advance_amount'] OR $order_info['advance_amount']==0) { </tr>
$price = number_format($order_info['order_amount']*(3/10), 2, '.', ''); </table>
echo '<input type="text" name="deposit_amount" class="only_number advance" value="'.$price.'">'; <div class="show-advance-pay">
} else { <hr/>
echo '<input type="text" name="deposit_amount" class="only_number advance" value="'.$order_info['advance_amount'].'">'; <p>定金调整</p>
} <table class="table table-bordered table-hover">
?> <tr>
</p> <th width="20%">定金金额</th>
</td> <td>
</tr> <p class="text-danger">{{$currency}}
</table> <?php
</div> if (!$order_info['advance_amount'] OR $order_info['advance_amount']==0) {
$price = number_format($order_info['order_amount']*(3/10), 2, '.', '');
<div class="show-pay-time">
<p>付款时间</p> echo '<input type="text" name="deposit_amount" class="only_number advance" value="'.$price.'">';
<table class="table table-bordered table-hover change-table"> } else {
<tr> echo '<input type="text" name="deposit_amount" class="only_number advance" value="'.$order_info['advance_amount'].'">';
<th width="20%">选择付款时间</th> }
<td> ?>
<select name="payTime" class="payTime"> </p>
<option value="">请选择</option> </td>
<option value="1">1天</option> </tr>
<!-- 预售订单默认2天 --> </table>
@if ($order_info['sale_type'] == 2) </div>
<option value="2" selected>2天</option>
@endif <div class="show-pay-time">
<option value="3">3天</option> <p>付款时间</p>
<option value="7">7天</option> <table class="table table-bordered table-hover change-table">
<option value="15">15天</option> <tr>
<option value="other">其他</option> <th width="20%">选择付款时间</th>
</select> <td>
<select name="payTime" class="payTime">
<div class="customArea"> <option value="">请选择</option>
<input type="text" name="payTimeOther" class="payTimeOther" value="" style="width: 50px;">&nbsp;<span class="error">(自定义天数,限制1~30)</span> <option value="1">1天</option>
</div> <!-- 预售订单默认2天 -->
</td> @if ($order_info['sale_type'] == 2)
</tr> <option value="2" selected>2天</option>
</table> @endif
</div> <option value="3">3天</option>
<option value="7">7天</option>
<div class="text-center" style="margin-top: 20px;"> <option value="15">15天</option>
@if ($order_temp_info['temp_save_info']) <option value="other">其他</option>
<a class="btn btn-primary viewTempSave" style="margin-right: 20px;">变更历史</a> </select>
@endif
<div class="customArea">
@if ($order_info['order_goods_type'] == 1) <input type="text" name="payTimeOther" class="payTimeOther" value="" style="width: 50px;">&nbsp;<span class="error">(自定义天数,限制1~30)</span>
<a class="btn btn-info tempSave" style="margin-right: 20px;">临时保存</a> </div>
@endif </td>
</tr>
@if ($order_info['order_goods_type'] == 2 && $order_temp_info['status'] == 1) </table>
<a class="btn btn-primary checkAdjusted">查看调价信息</a> </div>
@else
<a class="btn btn-success checkOrder">提交</a> <div class="text-center" style="margin-top: 20px;">
@endif @if ($order_temp_info['temp_save_info'])
</div> <a class="btn btn-primary viewTempSave" style="margin-right: 20px;">变更历史</a>
</form> @endif
@endif
@if ($order_info['order_goods_type'] == 1)
@if (($order_info['order_goods_type'] == 1 && $order_info['status'] == 2 && $order_temp_info['is_manager_audit'] == 3) || ($order_info['order_goods_type'] == 2 && $order_info['status'] == 2 && $order_info['adjust_count'] == 2)) <a class="btn btn-info tempSave" style="margin-right: 20px;">临时保存</a>
<div class="checked_section"> @endif
<div class="checked_left">
<p>交易状态:&nbsp;审核通过,请联系客户及时付款! @if ($order_info['order_goods_type'] == 2 && $order_temp_info['status'] == 1)
@if ($order_info['pay_time']) <a class="btn btn-primary checkAdjusted">查看调价信息</a>
<span>订单付款时间截止至:{{date('Y-m-d H:i:s', $order_info['pay_time'])}}</span> @else
@endif <a class="btn btn-success checkOrder">提交</a>
</p> @endif
</div>
<?php </form>
if ($order_info['order_goods_type'] == 2) { @endif
$adjustPriceUrl = "/adjustPrice/".$order_info['order_id']."?tags=self";
} else { @if (($order_info['order_goods_type'] == 1 && $order_info['status'] == 2 && $order_temp_info['is_manager_audit'] == 3) || ($order_info['order_goods_type'] == 2 && $order_info['status'] == 2 && $order_info['adjust_count'] == 2))
$adjustPriceUrl = "/adjustPrice/".$order_info['order_id']; <div class="checked_section">
} <div class="checked_left">
?> <p>交易状态:&nbsp;审核通过,请联系客户及时付款!
@if ($order_info['pay_time'])
@if ($order_info['order_goods_type'] == 2 && $order_info['adjust_count'] < 2) <span>订单付款时间截止至:{{date('Y-m-d H:i:s', $order_info['pay_time'])}}</span>
<a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span> @endif
@elseif ($order_info['order_goods_type'] == 1) </p>
<!-- <a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a> -->
@endif <?php
</div> if ($order_info['order_goods_type'] == 2) {
$adjustPriceUrl = "/adjustPrice/".$order_info['order_id']."?tags=self";
<!-- 非账期订单显示剩余时间 --> } else {
@if ($order_info['order_pay_type'] != 3) $adjustPriceUrl = "/adjustPrice/".$order_info['order_id'];
<div class="checked_right"> }
<p class="showtime"> ?>
<span class="error">剩余付款时间:</span>
<span class="count_time count_day"></span> @if ($order_info['order_goods_type'] == 2 && $order_info['adjust_count'] < 2)
<span class="count_time count_hour"></span> <a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span>
<span class="count_time count_min"></span> @elseif ($order_info['order_goods_type'] == 1)
<span class="count_time count_sec"></span> <!-- <a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a> -->
</p> @endif
</div>
<div class="showtime delay_time">
<span class="delay_time_title">延长付款时间:</span> <!-- 非账期订单显示剩余时间 -->
@if ($order_info['order_pay_type'] != 3)
<select name="payTime" class="payTime"> <div class="checked_right">
<option value="">请选择</option> <p class="showtime">
<option value="1">1天</option> <span class="error">剩余付款时间:</span>
<option value="3">3天</option> <span class="count_time count_day"></span>
<option value="7">7天</option> <span class="count_time count_hour"></span>
<option value="15">15天</option> <span class="count_time count_min"></span>
<option value="other">其他</option> <span class="count_time count_sec"></span>
</select> </p>
<div class="customArea"> <div class="showtime delay_time">
<input type="text" name="payTimeOther" class="payTimeOther" value="" style="width: 50px;">&nbsp;<span class="error">(自定义天数,限制1~30)</span> <span class="delay_time_title">延长付款时间:</span>
</div>
<select name="payTime" class="payTime">
<button class="btn btn-info btn-xs delay_confirm">确认</button> <option value="">请选择</option>
</div> <option value="1">1天</option>
</div> <option value="3">3天</option>
@endif <option value="7">7天</option>
</div> <option value="15">15天</option>
@endif <option value="other">其他</option>
</select>
@if ($order_info['status'] == -1)
@if ($order_info['cancel_reason'] != '') <div class="customArea">
<p>交易状态:&nbsp;审核不通过</p> <input type="text" name="payTimeOther" class="payTimeOther" value="" style="width: 50px;">&nbsp;<span class="error">(自定义天数,限制1~30)</span>
<p>审核不通过原因:&nbsp;{{$order_info['cancel_reason']}}</p> </div>
@else
<p>交易状态:&nbsp;用戶取消</p> <button class="btn btn-info btn-xs delay_confirm">确认</button>
@endif </div>
@endif </div>
</div> @endif
</div> </div>
@endif
<!-- 自营订单客服调价低于80% 显示经理审核 -->
@if ($order_info['order_goods_type'] == 2 && $order_temp_info['status'] == 1) @if ($order_info['status'] == -1)
<script> @if ($order_info['cancel_reason'] != '')
$('#checkOrderForm').find('input').attr('disabled', true); <p>交易状态:&nbsp;审核不通过</p>
$('#checkOrderForm').find('select').attr('disabled', true); <p>审核不通过原因:&nbsp;{{$order_info['cancel_reason']}}</p>
</script> @else
<p>交易状态:&nbsp;用戶取消</p>
@include('changeOrder.adjusted') @endif
@endif @endif
</div>
@if ($order_temp_info['temp_save_info']) </div>
@include('changeOrder.tempSave')
@endif <!-- 自营订单客服调价低于80% 显示经理审核 -->
@if ($order_info['order_goods_type'] == 2 && $order_temp_info['status'] == 1)
</div> <script>
</div> $('#checkOrderForm').find('input').attr('disabled', true);
$('#checkOrderForm').find('select').attr('disabled', true);
@include('changeOrder.addGoods') </script>
@include('changeOrder.addGoodsNoSkuid')
@include('common.selectBrand') @include('changeOrder.adjusted')
@endif
<script>
var is_manager = "{{ in_array($role, [1, 2, 5]) ? true : false }}"; @if ($order_temp_info['temp_save_info'])
@include('changeOrder.tempSave')
var isNewClient = "{{isset($isNewClient) ? $isNewClient : 0}}"; @endif
// var order_amount = "{{$order_info['order_amount']}}";
var currency = "{{$order_info['currency']}}"; // 币种 </div>
var order_pay_type = "{{$order_info['order_pay_type']}}"; // 付款类型 </div>
var discount_amount = "{{ $order_price_info['discount_amount'] ? $order_price_info['discount_amount'] : 0 }}"; // 优惠券金额
var pay_preferential = "{{ $order_price_info['pay_preferential'] ? $order_price_info['pay_preferential'] : 0 }}"; // 支付优惠(钱包) @include('changeOrder.addGoods')
var new_client_price = "{{ $order_price_info['new_client_price'] }}"; @include('changeOrder.addGoodsNoSkuid')
var buyers = eval('{!! isset($buyers) ? json_encode($buyers) : '' !!}'); // 采购员集合 @include('common.selectBrand')
// 明细数目 <script>
var item_count = "{{ count($order_items_info) }}"; var is_manager = "{{ in_array($role, [1, 2, 5]) ? true : false }}";
if (item_count == 1) { var isNewClient = "{{isset($isNewClient) ? $isNewClient : 0}}";
$('.deletegoods').attr('disabled', true).css('pointer-events', 'none'); // var order_amount = "{{$order_info['order_amount']}}";
} var currency = "{{$order_info['currency']}}"; // 币种
var order_pay_type = "{{$order_info['order_pay_type']}}"; // 付款类型
var rest_time = "{{$order_info['pay_time'] ? $order_info['pay_time'] - time() : NULL}}"; var discount_amount = "{{ $order_price_info['discount_amount'] ? $order_price_info['discount_amount'] : 0 }}"; // 优惠券金额
var pay_preferential = "{{ $order_price_info['pay_preferential'] ? $order_price_info['pay_preferential'] : 0 }}"; // 支付优惠(钱包)
if (rest_time) { var new_client_price = "{{ $order_price_info['new_client_price'] }}";
countDown(rest_time); var buyers = eval('{!! isset($buyers) ? json_encode($buyers) : '' !!}'); // 采购员集合
} else {
$('.checked_right').hide(); // 明细数目
} var item_count = "{{ count($order_items_info) }}";
// 倒计时 if (item_count == 1) {
function countDown(times){ $('.deletegoods').attr('disabled', true).css('pointer-events', 'none');
var timer=null; }
timer = setInterval(function(){
var day=0, var rest_time = "{{$order_info['pay_time'] ? $order_info['pay_time'] - time() : NULL}}";
hour=0,
minute=0, if (rest_time) {
second=0;//时间默认值 countDown(rest_time);
} else {
if (times > 0) { $('.checked_right').hide();
day = Math.floor(times / (60 * 60 * 24)); }
hour = Math.floor(times / (60 * 60)) - (day * 24);
minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60); // 倒计时
second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60); function countDown(times){
} var timer=null;
timer = setInterval(function(){
if (day <= 9) day = '0' + day; var day=0,
if (hour <= 9) hour = '0' + hour; hour=0,
if (minute <= 9) minute = '0' + minute; minute=0,
if (second <= 9) second = '0' + second; second=0;//时间默认值
$('.count_day').text(day); if (times > 0) {
$('.count_hour').text(hour); day = Math.floor(times / (60 * 60 * 24));
$('.count_min').text(minute); hour = Math.floor(times / (60 * 60)) - (day * 24);
$('.count_sec').text(second); minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);
second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
times--; }
}, 1000);
if (day <= 9) day = '0' + day;
if (times <= 0 ) { if (hour <= 9) hour = '0' + hour;
clearInterval(timer); if (minute <= 9) minute = '0' + minute;
} if (second <= 9) second = '0' + second;
}
$('.count_day').text(day);
// 延长付款时间 $('.count_hour').text(hour);
$('.delay_confirm').click(function(){ $('.count_min').text(minute);
var order_id = "{{$order_info['order_id']}}"; $('.count_sec').text(second);
var payTime = $('.payTime').val();
var payTimeOther = $('.payTimeOther').val(); times--;
var delay_time; }, 1000);
if (payTime == '') { if (times <= 0 ) {
layer.msg('请选择付款时间'); clearInterval(timer);
return false; }
} }
if (payTime == 'other' && payTimeOther == '') { // 延长付款时间
layer.msg('请填写自定义时间'); $('.delay_confirm').click(function(){
return false; var order_id = "{{$order_info['order_id']}}";
} var payTime = $('.payTime').val();
var payTimeOther = $('.payTimeOther').val();
if (payTimeOther) { var delay_time;
var reg = /\d/;
if (!reg.test(payTimeOther)) { if (payTime == '') {
layer.msg('格式错误'); layer.msg('请选择付款时间');
return false; return false;
} }
if (payTimeOther < 0 || payTimeOther > 30) { if (payTime == 'other' && payTimeOther == '') {
layer.msg('自定义时间限制在1-30天'); layer.msg('请填写自定义时间');
return false; return false;
} }
}
if (payTimeOther) {
if (payTime != '' && payTime != 'other') { var reg = /\d/;
payTimeOther = ''; if (!reg.test(payTimeOther)) {
} layer.msg('格式错误');
return false;
delay_time = payTimeOther ? payTimeOther : payTime; }
// 弹出提示 if (payTimeOther < 0 || payTimeOther > 30) {
layer.open({ layer.msg('自定义时间限制在1-30天');
title: '提示信息', return false;
content: '确定延长付款时间吗?', }
btn:['取消','确定'], }
yes: function(index, layero){
layer.close(index); if (payTime != '' && payTime != 'other') {
}, payTimeOther = '';
btn2: function(index, layero){ }
$.ajax({
url : '/ajaxDelayTime', delay_time = payTimeOther ? payTimeOther : payTime;
type: 'post',
data: {order_id:order_id, delay_time:delay_time}, // 弹出提示
dataType: 'json', layer.open({
success: function (resp) {console.log(resp) title: '提示信息',
if(resp.errcode === 0){ content: '确定延长付款时间吗?',
layer.msg(resp.errmsg || '操作成功'); btn:['取消','确定'],
setTimeout(function(){ yes: function(index, layero){
location.reload(); layer.close(index);
}, 1000); },
} else { btn2: function(index, layero){
layer.alert(resp.errmsg || '网络异常'); $.ajax({
} url : '/ajaxDelayTime',
}, type: 'post',
data: {order_id:order_id, delay_time:delay_time},
error: function (res) { dataType: 'json',
console.log(res); success: function (resp) {console.log(resp)
} if(resp.errcode === 0){
}) layer.msg(resp.errmsg || '操作成功');
} setTimeout(function(){
}); location.reload();
}) }, 1000);
} else {
// dgk 终端客户信息 layer.alert(resp.errmsg || '网络异常');
var is_dgk_exists = "{{ $is_dgk_exists }}"; }
},
if (is_dgk_exists) {
var api_dgk_config = eval('('+'{!! isset($api_dgk_config) ? json_encode($api_dgk_config) : '' !!}'+')'); error: function (res) {
var customer_type = "{{ $order_extra ? $order_extra['customer_type'] : 0 }}"; console.log(res);
var product_use_classone_sn = "{{ $order_extra ? $order_extra['product_use_classone_sn'] : '' }}"; }
var product_use_classtwo_sn = "{{ $order_extra ? $order_extra['product_use_classtwo_sn'] : '' }}"; })
}
$('.order-change-main').delegate('.product_use_classone_sn', 'change', function(data){ });
var select_key = $('.product_use_classone_sn').find('option:selected').text(); })
$('.product_use_classtwo_sn').html(''); // dgk 终端客户信息
for(let key in api_dgk_config){ var is_dgk_exists = "{{ $is_dgk_exists }}";
if(key == select_key){
for(var i = 0; i < api_dgk_config[key].length; i++){ if (is_dgk_exists) {
$('.product_use_classtwo_sn').append('<option value="'+i+'">'+api_dgk_config[key][i]+'</option>') var api_dgk_config = eval('('+'{!! isset($api_dgk_config) ? json_encode($api_dgk_config) : '' !!}'+')');
} var customer_type = "{{ $order_extra ? $order_extra['customer_type'] : 0 }}";
} var product_use_classone_sn = "{{ $order_extra ? $order_extra['product_use_classone_sn'] : '' }}";
} var product_use_classtwo_sn = "{{ $order_extra ? $order_extra['product_use_classtwo_sn'] : '' }}";
})
$('.order-change-main').delegate('.product_use_classone_sn', 'change', function(data){
// select 赋值 var select_key = $('.product_use_classone_sn').find('option:selected').text();
if (customer_type) {
$('select[name=customer_type]').val(customer_type); $('.product_use_classtwo_sn').html('');
} for(let key in api_dgk_config){
if(key == select_key){
if (product_use_classone_sn) { for(var i = 0; i < api_dgk_config[key].length; i++){
$('select[name=product_use_classone_sn]').val(product_use_classone_sn); $('.product_use_classtwo_sn').append('<option value="'+i+'">'+api_dgk_config[key][i]+'</option>')
$('select[name=product_use_classone_sn]').change(); // 添加change事件 }
$('select[name=product_use_classtwo_sn]').val(product_use_classtwo_sn); }
} }
} })
$.lie.changeOrder.index(); // select 赋值
$.lie.goods.add(); if (customer_type) {
$('select[name=customer_type]').val(customer_type);
</script> }
if (product_use_classone_sn) {
$('select[name=product_use_classone_sn]').val(product_use_classone_sn);
$('select[name=product_use_classone_sn]').change(); // 添加change事件
$('select[name=product_use_classtwo_sn]').val(product_use_classtwo_sn);
}
}
$.lie.changeOrder.index();
$.lie.goods.add();
</script>
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
#tempSaveForm { padding: 15px; } #tempSaveForm { padding: 15px; }
</style> </style>
<div id="temp-save-info"> <div id="temp-save-info">
<div class="order-change-main"> <div class="order-change-main row-fluid table-responsive">
<form id="tempSaveForm" class="form-horizontal table-responsive"> <form id="tempSaveForm" class="form-horizontal">
@if ($order_temp_info['temp_save_info']['customer_cn']) @if ($order_temp_info['temp_save_info']['customer_cn'])
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover text-nowrap">
<tr class="caption"> <tr class="caption">
<th colspan="4" style="text-align: center; background: #f9f9f9;">终端客户信息</th> <th colspan="4" style="text-align: center; background: #f9f9f9;">终端客户信息</th>
</tr> </tr>
...@@ -25,41 +25,44 @@ ...@@ -25,41 +25,44 @@
</table> </table>
@endif @endif
<table class="table table-bordered table-hover"> <div class="row-fluid table-responsive">
<thead> <table class="table table-bordered table-hover text-nowrap">
<tr> <thead>
<th width="20%">型号</th> <tr>
<th width="20%">标准品牌</th> <th width="20%">型号</th>
<th>调整数量</th> <th width="20%">标准品牌</th>
<th>调整单价</th> <th>调整数量</th>
<th>采购员</th> <th>调整单价</th>
<th>批次</th> <th>采购员</th>
<th>状态</th> <th>批次</th>
</tr> <th>状态</th>
</thead> </tr>
</thead>
<tbody> <tbody>
@if (isset($order_temp_info['temp_save_info']['change_info'])) @if (isset($order_temp_info['temp_save_info']['change_info']))
@foreach ($order_temp_info['temp_save_info']['change_info'] as $k => $v) @foreach ($order_temp_info['temp_save_info']['change_info'] as $k => $v)
<tr> <tr>
<td>{{$v['goods_name']}}</td> <td>{{$v['goods_name']}}</td>
<td>{{ isset($v['standard_brand_name']) ? $v['standard_brand_name'] : '' }}</td> <td>{{ isset($v['standard_brand_name']) ? $v['standard_brand_name'] : '' }}</td>
<td>{{$v['goods_number']}}</td> <td>{{$v['goods_number']}}</td>
<td>{{$v['goods_price']}}</td> <td>{{$v['goods_price']}}</td>
<td>{{ isset($v['buyer_id']) ? App\Http\Controllers\getSalesName($v['buyer_id']) : '' }}</td> <td>{{ isset($v['buyer_id']) ? App\Http\Controllers\getSalesName($v['buyer_id']) : '' }}</td>
<td>{{ isset($v['batch']) ? $v['batch'] : '' }}</td> <td>{{ isset($v['batch']) ? $v['batch'] : '' }}</td>
<td> <td>
<?= $v['status'] == 1 ? '正常' : '<i style="color: red;">已取消</i>' ?> <?= $v['status'] == 1 ? '正常' : '<i style="color: red;">已取消</i>' ?>
@if (isset($v['is_add'])) @if (isset($v['is_add']))
<i style="color: green;">(新增)</i> <i style="color: green;">(新增)</i>
@endif @endif
</td> </td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
</tbody> </tbody>
</table> </table>
</div>
<hr> <hr>
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">
<tr> <tr>
......
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
@endif @endif
@if (in_array($order_info['status'], array(3, 4, 7)) && in_array('order_refund', $userPerms)) @if (in_array($order_info['status'], array(3, 4, 7)) && in_array('order_refund', $userPerms))
<a href="{{URL('refund', ['order_id'=>$order_info['order_id']])}}" class="btn btn-info order_refund">退货退款</a> <!-- <a href="{{URL('refund', ['order_id'=>$order_info['order_id']])}}" class="btn btn-info order_refund">退货退款</a> -->
@endif @endif
<!-- 已发货之后的状态 --> <!-- 已发货之后的状态 -->
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
@endif @endif
@if (in_array($order_info['status'], [7, 8, 10]) && in_array('self_order_refund', $userPerms)) @if (in_array($order_info['status'], [7, 8, 10]) && in_array('self_order_refund', $userPerms))
<a href="/return/{{$order_info['order_id']}}?tags=self" class="btn btn-info order_refund">退货申请</a> <!-- <a href="/return/{{$order_info['order_id']}}?tags=self" class="btn btn-info order_refund">退货申请</a> -->
@endif @endif
<!-- 订单状态大于4,且处于开票状态,且存在权限 --> <!-- 订单状态大于4,且处于开票状态,且存在权限 -->
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
<th>支付方式</th> <th>支付方式</th>
<th>支付状态</th> <th>支付状态</th>
<th>支付类型</th> <th>支付类型</th>
@if ($order_info['order_goods_type'] == 1)
<th>发货方式</th>
@endif
<th>发货状态</th> <th>发货状态</th>
<th>物流单号</th> <th>物流单号</th>
<th>京东订单编号</th> <th>京东订单编号</th>
...@@ -100,6 +103,9 @@ ...@@ -100,6 +103,9 @@
} }
?> ?>
</td> </td>
@if ($order_info['order_goods_type'] == 1)
<td>{{ $order_temp_info['zy_delivery_type'] == 1 ? '现货发货' : '拼单发货' }}</td>
@endif
<td> <td>
<?php <?php
if ($order_shipping_info) { if ($order_shipping_info) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment