Commit 00d0f598 by 朱继来

调整联营下单dgk终端信息

parent 5d370327
......@@ -193,7 +193,7 @@ Class AddOrderController extends Controller
$address = DB::connection('order')->table('lie_user_address')->where('address_id', $address_id)->first();
$address->province_val = $this->getAddress($address->province);
$address->city_val = $this->getAddress($address->city);
$address->city_val = $this->getAddress($address->city);
$address->district_val = $this->getAddress($address->district);
return ['errcode' => 0, 'errmsg' => '', 'data' => $address];
......@@ -209,9 +209,21 @@ Class AddOrderController extends Controller
$invoice = DB::connection('order')->table('lie_taxinfo')->where('tax_id', $tax_id)->first();
$invoice->province_val = $invoice->consignee_province ? $this->getAddress($invoice->consignee_province) : '';
$invoice->city_val = $invoice->consignee_city ? $this->getAddress($invoice->consignee_city) : '';
$invoice->city_val = $invoice->consignee_city ? $this->getAddress($invoice->consignee_city) : '';
$invoice->district_val = $invoice->consignee_district ? $this->getAddress($invoice->consignee_district) : '';
// 发票公司信息
if (in_array($invoice->inv_type, [3, 4])) {
$company_info = DB::connection('order')->table('lie_invoice_company')->where('com_name', $invoice->tax_title)->first();
if ($company_info) {
$invoice->customer_en = $company_info->customer_en;
$invoice->product_use_classone_sn = $company_info->product_use_classone_sn;
$invoice->product_use_classtwo_sn = $company_info->product_use_classtwo_sn;
$invoice->customer_website = $company_info->customer_website;
}
}
return ['errcode' => 0, 'errmsg' => '', 'data' => $invoice];
}
}
......@@ -556,6 +568,7 @@ Class AddOrderController extends Controller
$data['customer_type'] = $request->input('customer_type', '');
$data['product_use_classone_sn'] = $request->input('product_use_classone_sn', '');
$data['product_use_classtwo_sn'] = $request->input('product_use_classtwo_sn', '');
$data['customer_website'] = $request->input('customer_website', '');
}
if ($data['type'] == 4) {
......
......@@ -240,6 +240,26 @@
}
$('.inv_type').text(inv_type_val);
// 若购物车存在Digikey商品,选择增值税普票或专票后,默认将发票抬头赋值给终端信息(中文名称),且不能更改
if ($('.client-info').css('display') == 'block') {
if (data.inv_type == 3 || data.inv_type == 4) {
$('.customer_cn').val(data.tax_title);
if (data.customer_en && data.product_use_classone_sn && data.product_use_classtwo_sn && data.customer_website) { // 信息都存在的话,客户类型为终端
$('.customer_type').val(1);
}
$('.customer_en').val(data.customer_en);
$('.product_use_classone_sn').val(data.product_use_classone_sn);
$('.product_use_classone_sn').change(); // 添加change事件
$('.product_use_classtwo_sn').val(data.product_use_classtwo_sn);
$('.customer_website').val(data.customer_website);
} else {
layer.msg('购物车中存在digikey商品,请选择增值税普票或专票');
}
}
}
}
})
......@@ -729,38 +749,47 @@
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();
var customer_website = $('.customer_website').val();
if (!customer_cn) {
layer.msg('请填写终端中文名称');
return false;
}
if (customer_type == '') {
layer.msg('请选择客户类型');
return false;
}
// 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;
// }
datax.customer_cn = customer_cn;
datax.customer_en = customer_en;
datax.customer_type = customer_type;
if (customer_type == 1) { // 若客户类型为终端,则外文名称,产品用途和网址为必填
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 (product_use_classone_sn == '') {
layer.msg('请选择产品用途一级分类');
return false;
}
if (!customer_website) {
layer.msg('请填写客户网址');
return false;
}
}
datax.customer_cn = customer_cn;
datax.customer_en = customer_en;
datax.customer_type = customer_type;
datax.product_use_classone_sn = product_use_classone_sn;
datax.product_use_classtwo_sn = product_use_classtwo_sn;
datax.customer_website = customer_website;
}
datax.tax_id = tax_id;
......@@ -1054,6 +1083,11 @@
if (is_dgk) {
$('.client-info').css('display', 'block');
// 若已选择发票,再次触发发票事件,添加终端信息
if ($('.tax_id').val()) {
$('#invoice').trigger('change');
}
} else {
$('.client-info').css('display', 'none');
}
......
......@@ -227,29 +227,38 @@
</div>
</div>
</div>
<div class="client-info">
<style>
.client-info input{ width: 300px; }
.customer_type{ width: 30%; }
.product_use_classone_sn, .product_use_classtwo_sn{ float: left; width: 30%; }
</style>
<div class="client-info form-horizontal">
<h4>终端客户信息 <span class="title-tips"><i class="fa fa-info-circle"></i>digikey渠道商品必填,其他渠道可不填写</span></h4>
<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="">
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 终端中文名称:</label>
<div class="col-sm-10">
<input type="text" class="form-control customer_cn" name="customer_cn" value="" autocomplete="off" disabled="disabled">
</div>
</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>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 客户类型:</label>
<div class="col-sm-10">
<select class="form-control 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>
......@@ -257,20 +266,35 @@
<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="">
<a href="https://translate.google.cn/" target="_blank">谷歌翻译</a>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 终端英文名称:</label>
<div class="col-sm-10">
<input type="text" class="customer_en" name="customer_en" value="" autocomplete="off">
<a href="https://translate.google.cn/" target="_blank">谷歌翻译</a>
</div>
</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>
</select>
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 产品用途:</label>
<div class="col-sm-10">
<select class="form-control product_use_classone_sn" name="product_use_classone_sn">
<option value="">请选择</option>
</select>
<select class="layui-select product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
<select class="form-control product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-2 control-label"><i class="text-danger">*</i> 客户网址:</label>
<div class="col-sm-10">
<input type="text" class="customer_website" name="customer_website" value="" autocomplete="off">
</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