Commit 4899f55d by 朱继来

调整下单发票

parent 2fc0978f
...@@ -159,12 +159,12 @@ Class AddOrderController extends Controller ...@@ -159,12 +159,12 @@ Class AddOrderController extends Controller
} }
} }
$address = DB::connection('order')->table('lie_user_address')->where('user_id', $user->user_id)->get(); // 收货地址 $address = DB::connection('order')->table('lie_user_address')->where('user_id', $user->user_id)->select('address_id', 'consignee')->get(); // 收货地址
$invoice = DB::connection('order')->table('lie_taxinfo')->where('user_id', $user->user_id)->get(); // 发票信息 // $invoice = DB::connection('order')->table('lie_taxinfo')->where('user_id', $user->user_id)->select('tax_id', 'tax_title')->get(); // 发票信息
$info['user'] = $user; $info['user'] = $user;
$info['address'] = $address; $info['address'] = $address;
$info['invoice'] = $invoice; // $info['invoice'] = $invoice;
return ['errcode' => 0, 'errmsg' => '', 'data' => $info]; return ['errcode' => 0, 'errmsg' => '', 'data' => $info];
} }
...@@ -236,11 +236,7 @@ Class AddOrderController extends Controller ...@@ -236,11 +236,7 @@ Class AddOrderController extends Controller
$user_id = $request->input('user_id'); $user_id = $request->input('user_id');
$inv_type = $request->input('inv_type'); $inv_type = $request->input('inv_type');
if ($inv_type == 3) { $invoice = DB::connection('order')->table('lie_taxinfo')->where(['user_id'=>$user_id, 'inv_type'=>$inv_type])->select('tax_id', 'tax_title')->get();
$invoice = DB::connection('order')->table('lie_taxinfo')->where(['user_id' => $user_id, 'inv_type' => $inv_type])->get();
} else {
$invoice = DB::connection('order')->table('lie_taxinfo')->where('user_id', $user_id)->whereIn('inv_type', [2, 4])->get();
}
return ['errcode' => 0, 'errmsg' => '', 'data' => $invoice]; return ['errcode' => 0, 'errmsg' => '', 'data' => $invoice];
} }
......
...@@ -84,16 +84,16 @@ ...@@ -84,16 +84,16 @@
} }
// 发票信息 // 发票信息
if (data.invoice != null) { // if (data.invoice != null) {
var inv_len = data.invoice.length; // var inv_len = data.invoice.length;
var inv_str = '<option value="">请选择</option>'; // var inv_str = '<option value="">请选择</option>';
for (var i = 0; i < inv_len; i++) { // for (var i = 0; i < inv_len; i++) {
inv_str += '<option value="'+data.invoice[i]['tax_id']+'">'+data.invoice[i]['tax_title']+'</option>'; // inv_str += '<option value="'+data.invoice[i]['tax_id']+'">'+data.invoice[i]['tax_title']+'</option>';
} // }
$('#invoice').empty().append(inv_str); // $('#invoice').empty().append(inv_str);
} // }
loading.lists(data.user.user_id, goods_type, is_online); // 加载该用户购物车 loading.lists(data.user.user_id, goods_type, is_online); // 加载该用户购物车
...@@ -171,6 +171,11 @@ ...@@ -171,6 +171,11 @@
$('.invoice-content').hide(); $('.invoice-content').hide();
$('.tax_id').val(''); $('.tax_id').val('');
// 提示
if (inv_type == 2 || inv_type == '') {
layer.alert('个人和不开票只能为个人形式,后续不能更改为公司进行开票,请确认风险');
}
if (inv_type) { if (inv_type) {
$.ajax({ $.ajax({
url: '/ajax/selectInvType', url: '/ajax/selectInvType',
...@@ -746,15 +751,20 @@ ...@@ -746,15 +751,20 @@
return false; return false;
} }
if ((typeof(inv_type) == 'undefined' || inv_type != '') && !tax_id) {
layer.msg('请选择发票信息');
return false;
}
if (type == 4) { // 自营其他业务 if (type == 4) { // 自营其他业务
var business_type = $('#business_type').val(); var business_type = $('#business_type').val();
datax.business_type = business_type; datax.business_type = business_type;
datax.role = role; // 自营线上下单添加角色 datax.role = role; // 自营线上下单添加角色
} else { } else {
if ((inv_type && !tax_id) || (!tax_id && goods_type == 2)) { // if ((inv_type && !tax_id) || (!tax_id && goods_type == 2)) {
layer.msg('请选择发票信息'); // layer.msg('请选择发票信息');
return false; // return false;
} // }
} }
if (type == 1 && is_dgk) { // 联营包含digikey商品,则填写终端资料 if (type == 1 && is_dgk) { // 联营包含digikey商品,则填写终端资料
......
<style>
.user-info h4 { line-height: 30px; border-bottom: 1px dotted #ccc; }
</style>
<form> <form>
<div class="ibox-title" style="border-top:0;"> <div class="ibox-title" style="border-top:0;">
<h3>客户信息</h3> <h3>客户信息</h3>
...@@ -124,6 +128,9 @@ ...@@ -124,6 +128,9 @@
<div class="form-group"> <div class="form-group">
<span>发票类型:</span> <span>发票类型:</span>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="inv_type" class="radio-inv-type" value="2"> 个人
</label>
<label class="radio-inline">
<input type="radio" name="inv_type" class="radio-inv-type" value="3"> 增值税专用发票 <input type="radio" name="inv_type" class="radio-inv-type" value="3"> 增值税专用发票
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
...@@ -139,6 +146,7 @@ ...@@ -139,6 +146,7 @@
<div class="form-group"> <div class="form-group">
<span>选择发票信息:</span> <span>选择发票信息:</span>
<select name="invoice" id="invoice"> <select name="invoice" id="invoice">
<option value="">请选择</option>
</select> </select>
</div> </div>
</div> </div>
......
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