Commit 04e126d9 by 朱继来

调整审单

parent 33e5e809
...@@ -802,9 +802,9 @@ ...@@ -802,9 +802,9 @@
} }
} }
}) })
} else {
createOrder();
} }
}) })
function createOrder() { function createOrder() {
......
...@@ -486,7 +486,37 @@ ...@@ -486,7 +486,37 @@
}) })
// 提交表单 // 提交表单
$('.checkOrder').click(function(){ $('.checkOrder').click(function () {
var tax_id = $('.tax_id').val();
if (tax_id) {
$.ajax({
url: '/ajax/selectInv',
type: 'post',
data: { tax_id: tax_id },
dataType: 'json',
success: function (resp) {
if (resp.errcode == 1) {
layer.alert(resp.errmsg);
return false;
}
if (resp.errcode == 2) {
layer.confirm(resp.errmsg, function (index) {
checkOrder();
layer.close(index)
});
return false;
}
}
})
} else {
checkOrder();
}
})
function checkOrder() {
var is_newClient = $('input[name=is_newClient]:checked').val(); var is_newClient = $('input[name=is_newClient]:checked').val();
var client_source = $('input[name=client_source]:checked').val(); var client_source = $('input[name=client_source]:checked').val();
var order_status = $('input[name=order_status]:checked').val(); var order_status = $('input[name=order_status]:checked').val();
...@@ -565,7 +595,7 @@ ...@@ -565,7 +595,7 @@
var is_all_self = true; // 全部为自营商品 var is_all_self = true; // 全部为自营商品
var is_all_self_xm = true; // 全部为自营现货 var is_all_self_xm = true; // 全部为自营现货
$('.order-change-table').find('tbody tr').each(function(){ $('.order-change-table').find('tbody tr').each(function () {
var goods_number = $(this).find('.change_goods_number').val(); var goods_number = $(this).find('.change_goods_number').val();
var price = $(this).find('.price').val(); var price = $(this).find('.price').val();
var goods_name = $(this).find('.change_goods_name').val(); var goods_name = $(this).find('.change_goods_name').val();
...@@ -579,22 +609,22 @@ ...@@ -579,22 +609,22 @@
if (goods_number == '' || goods_number == 0) { if (goods_number == '' || goods_number == 0) {
change_goods_number = true; change_goods_number = true;
change_str += goods_name+'数量不能为0或空 '; change_str += goods_name + '数量不能为0或空 ';
} }
if (price == '' || price == 0) { if (price == '' || price == 0) {
change_price = true; change_price = true;
change_str += goods_name+'单价不能为0或空 '; change_str += goods_name + '单价不能为0或空 ';
} }
if (order_goods_type == 1 && (buyer_id == null || buyer_id == '')) { if (order_goods_type == 1 && (buyer_id == null || buyer_id == '')) {
change_buyer_id = true; change_buyer_id = true;
change_str += goods_name+'采购员不能为空 '; change_str += goods_name + '采购员不能为空 ';
} }
if (order_goods_type == 1 && batch == '') { if (order_goods_type == 1 && batch == '') {
change_batch = true; change_batch = true;
change_str += goods_name+'批次不能为空 '; change_str += goods_name + '批次不能为空 ';
} }
if (supplier_id != 10000) { if (supplier_id != 10000) {
...@@ -621,13 +651,13 @@ ...@@ -621,13 +651,13 @@
} }
$.ajax({ $.ajax({
url : '/api/getOrderFreight', url: '/api/getOrderFreight',
type: 'post', type: 'post',
data: {order_id: order_id}, data: { order_id: order_id },
dataType: 'json', dataType: 'json',
async: false, async: false,
success: function (resp) { success: function (resp) {
if(resp.errcode == 0){ if (resp.errcode == 0) {
msg_txt += resp.data; msg_txt += resp.data;
$('.freight_fee').val(resp.data).trigger('keyup'); $('.freight_fee').val(resp.data).trigger('keyup');
} }
...@@ -651,7 +681,7 @@ ...@@ -651,7 +681,7 @@
if (deposit_amount == '') { if (deposit_amount == '') {
layer.msg('请填写定金金额'); layer.msg('请填写定金金额');
return false; return false;
}else if (deposit_amount == 0) { } else if (deposit_amount == 0) {
layer.msg('定金金额不能为0'); layer.msg('定金金额不能为0');
return false; return false;
} }
...@@ -697,7 +727,7 @@ ...@@ -697,7 +727,7 @@
var check_failed_info = ''; var check_failed_info = '';
// 检查商品单价 // 检查商品单价
$('.order-change-table').find('tbody tr').each(function(){ $('.order-change-table').find('tbody tr').each(function () {
var origin_price = parseFloat($(this).find('.price').data('origin')); var origin_price = parseFloat($(this).find('.price').data('origin'));
var price = parseFloat($(this).find('.price').val()) || 0; var price = parseFloat($(this).find('.price').val()) || 0;
var goods_name = $(this).find('.change_goods_name').val(); var goods_name = $(this).find('.change_goods_name').val();
...@@ -706,7 +736,7 @@ ...@@ -706,7 +736,7 @@
// 若商品单价降价幅度小于或等于20%则赋值 // 若商品单价降价幅度小于或等于20%则赋值
if (price <= limit_price) { if (price <= limit_price) {
check_failed_info += '型号:'+goods_name+',单价:'+origin_price+' -> '+price+' | '; check_failed_info += '型号:' + goods_name + ',单价:' + origin_price + ' -> ' + price + ' | ';
$('input[name=check_failed]').val(1); $('input[name=check_failed]').val(1);
$('input[name=check_failed_info]').val(check_failed_info); $('input[name=check_failed_info]').val(check_failed_info);
} }
...@@ -727,21 +757,21 @@ ...@@ -727,21 +757,21 @@
var order_type_extend = $('#order_type_extend').val(); var order_type_extend = $('#order_type_extend').val();
var content = '<div class="submit-check">'; var content = '<div class="submit-check">';
content += '<p class="error">请仔细核对订单金额,谨慎操作!'+msg_txt+'</p>'; content += '<p class="error">请仔细核对订单金额,谨慎操作!' + msg_txt + '</p>';
content += '<p><label>商品总金额:</label>'+currencySign + goods_amount+'</p>'; content += '<p><label>商品总金额:</label>' + currencySign + goods_amount + '</p>';
content += '<p><label>优惠金额:</label>'+discount_amount+'</p>'+ content += '<p><label>优惠金额:</label>' + discount_amount + '</p>' +
'<p><label>附加费金额:</label>'+extra_fee+'</p>'+ '<p><label>附加费金额:</label>' + extra_fee + '</p>' +
'<p><label>运费金额:</label>'+freight_fee+'</p>'+ '<p><label>运费金额:</label>' + freight_fee + '</p>' +
'<p><label>订单总金额:</label><span class="error">'+currencySign + order_amount+'</span></p>'; '<p><label>订单总金额:</label><span class="error">' + currencySign + order_amount + '</span></p>';
if (order_goods_type == 1) { if (order_goods_type == 1) {
content += '</div>'; content += '</div>';
var url = '/details/'+order_id; var url = '/details/' + order_id;
} else { } else {
content += '<p><label>支付优惠:</label>'+pay_preferential+'</p>'+ content += '<p><label>支付优惠:</label>' + pay_preferential + '</p>' +
'<p><label>实际支付金额:</label><span class="error">'+currencySign + last_paid +'</span></p>'+ '<p><label>实际支付金额:</label><span class="error">' + currencySign + last_paid + '</span></p>' +
'</div>'; '</div>';
var url = '/details/'+order_id+'?tags=self'; var url = '/details/' + order_id + '?tags=self';
} }
// 弹出提示 // 弹出提示
...@@ -749,17 +779,17 @@ ...@@ -749,17 +779,17 @@
area: ['360px'], area: ['360px'],
title: '提示信息', title: '提示信息',
content: content, content: content,
btn:['确定', '取消'], btn: ['确定', '取消'],
yes: function(index, layero){ yes: function (index, layero) {
$.ajax({ $.ajax({
url : '/ajaxSaveChange', url: '/ajaxSaveChange',
type: 'post', type: 'post',
data: $('#checkOrderForm').serialize(), data: $('#checkOrderForm').serialize(),
dataType: 'json', dataType: 'json',
success: function (resp) { success: function (resp) {
if(resp.errcode == 0){ if (resp.errcode == 0) {
layer.msg(resp.errmsg || '操作成功'); layer.msg(resp.errmsg || '操作成功');
setTimeout(function(){ setTimeout(function () {
// location.reload(); // location.reload();
location.href = url; location.href = url;
}, 1000); }, 1000);
...@@ -779,13 +809,13 @@ ...@@ -779,13 +809,13 @@
} }
}) })
layer.msg('审核提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交 layer.msg('审核提交中...', { icon: 16, time: 0, shade: 0.3 }); // 阻止重复提交
}, },
btn2: function(index, layero){ btn2: function (index, layero) {
layer.close(index); layer.close(index);
} }
}); });
}) }
// 临时保存 // 临时保存
$('.tempSave').click(function() { $('.tempSave').click(function() {
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<input type="hidden" name="check_failed_info" value=""> <input type="hidden" name="check_failed_info" value="">
<input type="hidden" name="change_pay_type" value=""> <input type="hidden" name="change_pay_type" value="">
<input type="hidden" name="business_type" value="{{$order_temp_info['business_type']}}"> <input type="hidden" name="business_type" value="{{$order_temp_info['business_type']}}">
<input type="hidden" class="tax_id" name="tax_id" value="{{ isset($order_invoice_info['tax_id']) ? $order_invoice_info['tax_id'] : '' }}">
<?php $isNewClient = App\Http\Controllers\isNewClient($order_info['order_goods_type'], $order_info['user_id'], $order_info['create_time']); ?> <?php $isNewClient = App\Http\Controllers\isNewClient($order_info['order_goods_type'], $order_info['user_id'], $order_info['create_time']); ?>
@if ($isNewClient) @if ($isNewClient)
......
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