Commit bcf38fa6 by 朱继来

Merge branch 'zjl_order_20200923'

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