Commit 1db080fe by 朱继来

Merge branch 'zjl_merge_20200821'

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