Commit f45eae8f by 朱继来

调整下单

parent 54aab9f3
...@@ -567,14 +567,15 @@ Class AddOrderController extends Controller ...@@ -567,14 +567,15 @@ Class AddOrderController extends Controller
public function create(Request $request) public function create(Request $request)
{ {
if ($request->isMethod('post')) { if ($request->isMethod('post')) {
$data['type'] = $request->input('type');
$data['uid'] = $request->input('uid'); $data['uid'] = $request->input('uid');
$data['sale_id'] = $request->input('sale_id'); $data['sale_id'] = $request->user->userId;
$data['address_id'] = $request->input('address_id'); $data['address_id'] = $request->input('address_id');
$data['cart_id'] = implode(',', $request->input('cart_ids')); $data['cart_id'] = implode(',', $request->input('cart_ids'));
$data['type'] = $request->input('type');
$data['remark'] = $request->input('remark'); $data['remark'] = $request->input('remark');
$data['com_id'] = $request->input('com_id', 0); $data['com_id'] = $request->input('com_id', 0);
$data['com_name'] = $request->input('com_name', ''); $data['com_name'] = $request->input('com_name', '');
$data['shipping_type'] = $request->input('shipping_type', 0);
if ($data['type'] == 3) { // 自营线下订单 if ($data['type'] == 3) { // 自营线下订单
$data['address_name'] = $request->input('address_name'); $data['address_name'] = $request->input('address_name');
...@@ -605,7 +606,7 @@ Class AddOrderController extends Controller ...@@ -605,7 +606,7 @@ Class AddOrderController extends Controller
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi'); $data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'order/create'; $url = Config('website.api_domain').'order/create';
// dd(curlApi($url, $data));
$response = json_decode(curlApi($url, $data), true); $response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) { if ($response['err_code'] == 0) {
...@@ -803,7 +804,7 @@ Class AddOrderController extends Controller ...@@ -803,7 +804,7 @@ Class AddOrderController extends Controller
$data['k1'] = time(); $data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi'); $data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
// dd(curlApi($url, $data, "POST"));
$temp = json_decode(curlApi($url, $data, "POST"), true); $temp = json_decode(curlApi($url, $data, "POST"), true);
return ['errcode' => $temp['err_code'], 'errmsg' => $temp['err_msg']]; return ['errcode' => $temp['err_code'], 'errmsg' => $temp['err_msg']];
......
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Error;
use DB;
use App\Http\Model\UserActionLogModel;
class AddressController extends Controller
{
// 添加收货地址
public function add(Request $request)
{
if ($request->isMethod('post')) {
$address_id = $request->input('address_id', 0);
$data = [
'user_id' => $request->input('user_id', 0),
'province' => $request->input('province', ''),
'city' => $request->input('city', ''),
'district' => $request->input('district', ''),
'detail_address' => $request->input('detail_address', ''),
'zipcode' => $request->input('zipcode', ''),
'intl_code' => $request->input('intl_code', ''),
'consignee' => $request->input('consignee', ''),
'mobile' => $request->input('mobile', ''),
'is_default' => $request->input('is_default', ''),
'address_type' => $request->input('address_type', 0),
'operator_id' => $request->user->userId,
];
$valid = $this->_valid($data);
if ($valid['errcode']) return $this->_valid($data);
if ($address_id) {
$data['address_id'] = $address_id;
$url = Config('website.api_domain').'address/update';
$errmsg = '编辑地址';
} else {
$url = Config('website.api_domain').'address/create';
$errmsg = '新增地址';
}
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['pf'] = 4;
$temp = json_decode(curlApi($url, $data, "POST"), true);
if ($temp['err_code'] != 0) return ['errcode' => Error::E_ADD_FAILED, 'errmsg' => $errmsg.'失败,'.$temp['err_msg']];
return ['errcode' => 0, 'errmsg' => $errmsg.'成功'];
}
}
// 地址
public function getRegion($region_id)
{
$region = DB::connection('member')->table('lie_region')->where('region_id', $region_id)->select('region_name')->first();
return $region ? $region->region_name : '';
}
// 获取地址信息
public function getAddressInfo(Request $request)
{
if ($request->isMethod('post')) {
$address_id = $request->input('address_id');
$info = DB::connection('member')->table('lie_user_address')->where('address_id', $address_id)->first();
if (empty($info)) return ['errcode' => Error::E_NOT_EXISTS, 'errmsg' => '未找到'];
return ['errcode' => 0, 'errmsg' => '', 'data' => $info];
}
}
//验证
private function _valid($data)
{
if (!$data['user_id']) {
return array(
'errcode' => 1,
'errmsg' => '非法操作~',
'field' => ''
);
}
if (!$data['province'] || !$data['city'] || !$data['district']) {
return array(
'errcode' => 1,
'errmsg' => '您还没选择【所在地区】~',
'field' => 'district'
);
}
if (!$data['detail_address']) {
return array(
'errcode' => 1,
'errmsg' => '您还没填写【详细地址】~',
'field' => 'detail_address'
);
}
if ($data['zipcode'] && !is_postcode($data['zipcode'])) {
return array(
'errcode' => 1,
'errmsg' => '您填写的【邮政编码】格式不正确~',
'field' => 'zipcode'
);
}
if (!$data['consignee']) {
return array(
'errcode' => 1,
'errmsg' => '您还没填写【收货人】~',
'field' => 'consignee'
);
}
if (!$data['mobile']) {
return array(
'errcode' => 1,
'errmsg' => '您还没填写【联系电话】~',
'field' => 'link_mobile'
);
}
if ($data['intl_code'] != '0086') {
$mobile = $data['intl_code'].'+'.$data['mobile'];
} else {
$mobile = $data['mobile'];
}
if (!is_mobile($mobile)) {
return array(
'errcode' => 1,
'errmsg' => '您填写的【联系电话】格式不正确~',
'field' => 'link_mobile'
);
}
return array(
'errcode' => 0,
'errmsg' => '验证通过~',
);
}
// Ajax地址列表
public function ajax_list(Request $request)
{
$addressList = array();
$map = array();
if ($request->input('user_id')) {
$map['user_id'] = $request->input('user_id', '');
}
if ($request->input('address_type') !== '') {
$map['address_type'] = $request->input('address_type', '');
}
if ($map['user_id'] && isset($map['address_type'])) {
$addressList = DB::connection('member')->table('lie_user_address')->where($map)->get();
}
if(!empty($addressList) && is_array($addressList)) {
$region = array();
foreach ($addressList as &$val) {
$region = DB::connection('member')
->table('lie_region')
->whereIn('region_id', [$val->province, $val->city, $val->district])
->select('region_id', 'region_name')
->get();
foreach ($region as $v) {
$address[$v->region_id] = $v->region_name;
}
$val->province_txt = $address[$val->province];
$val->city_txt = $address[$val->city];
$val->district_txt = $address[$val->district];
// 检查港台电话code
if ($val->intl_code && $val->intl_code != '0086') $val->mobile = $val->intl_code.'+'.$val->mobile;
}
}
$data['list'] = $addressList;
$data['isaction'] = $request->input('isaction');
return view('ajax_list', $data);
}
//设置默认地址
public function set_default(Request $request)
{
if ($request->isMethod('post')) {
$data['user_id'] = $request->input('user_id');
$data['address_id'] = $request->input('address_id');
$data['operator_id'] = $request->user->userId;
$url = Config('website.api_domain').'address/setdefault';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['pf'] = 4;
$temp = json_decode(curlApi($url, $data, "POST"), true);
return ['errcode' => $temp['err_code'], 'errmsg' => $temp['err_msg']];
}
}
// 删除地址
public function delete(Request $request)
{
if ($request->isMethod('post')) {
$data['user_id'] = $request->input('user_id');
$data['address_id'] = $request->input('address_id');
$data['operator_id'] = $request->user->userId;
$url = Config('website.api_domain').'address/delete';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['pf'] = 4;
$temp = json_decode(curlApi($url, $data, "POST"), true);
return ['errcode' => $temp['err_code'], 'errmsg' => $temp['err_msg']];
}
}
}
\ No newline at end of file
...@@ -509,25 +509,39 @@ class ApiController extends Controller ...@@ -509,25 +509,39 @@ class ApiController extends Controller
$this->Export($temp['err_code'], $temp['err_msg'], $temp['data']); $this->Export($temp['err_code'], $temp['err_msg'], $temp['data']);
} }
// 获取用户绑定客服、发票 // 获取用户信息
public function getUserInvoice($request) public function getUserInfo($request)
{ {
$com_name = $request->input('com_name', ''); $val = $request->input('val', '');
$account = $request->input('account', ''); $type = $request->input('type', 1);
$invoice_type = $request->input('invoice_type', '');
$curr_user_id = $request->user->userId;
$tax_info = [];
if (!$account) $this->Export(-1, '未填写联系方式'); if ($type == 1) {
$com_id = DB::connection('order')->table('lie_invoice_company')->where('com_name', $val)->value('id');
$this->Export(0, '', $com_id);
}
if (preg_match('/@/', $account)) { if (preg_match('/@/', $val)) {
$field = 'email'; $field = 'email';
} else { } else {
$field = 'mobile'; $field = 'mobile';
} }
$user_id = DB::connection('order')->table('lie_user_main')->where($field, $account)->value('user_id'); $user_id = DB::connection('order')->table('lie_user_main')->where($field, $val)->value('user_id');
if (!$user_id) $this->Export(-1, '当前联系账号不存在');
$this->Export(0, '', $user_id);
}
// 获取用户绑定客服、发票
public function getUserInvoice($request)
{
$com_id = $request->input('com_id', '');
$user_id = $request->input('user_id', 0);
$invoice_type = $request->input('invoice_type', 2);
$curr_user_id = $request->user->userId;
$tax_info = [];
if (!$user_id) $this->Export(-1, '未填写联系方式');
// 个人发票 // 个人发票
if ($invoice_type == 2) { if ($invoice_type == 2) {
...@@ -540,13 +554,10 @@ class ApiController extends Controller ...@@ -540,13 +554,10 @@ class ApiController extends Controller
$this->Export(0, '', $tax_info); $this->Export(0, '', $tax_info);
} }
if (!$com_name) $this->Export(-1, '未填写当前发票/公司'); if (!$com_id) $this->Export(-1, '未填写当前发票/公司');
$invoice_company = DB::connection('order')->table('lie_invoice_company')->where('com_name', $com_name)->first();
if (!$invoice_company) $this->Export(-1, '当前公司不存在');
$map = []; $map = [];
$map['com_id'] = $invoice_company->id; $map['com_id'] = $com_id;
$map['user_id'] = $user_id; $map['user_id'] = $user_id;
$map['status'] = 0; $map['status'] = 0;
...@@ -558,8 +569,11 @@ class ApiController extends Controller ...@@ -558,8 +569,11 @@ class ApiController extends Controller
$this->Export(-1, '当前公司和联系账号由'.$sale_name.'跟进'); $this->Export(-1, '当前公司和联系账号由'.$sale_name.'跟进');
} }
$invoice_company = DB::connection('order')->table('lie_invoice_company')->where('id', $com_id)->first();
if (!$invoice_company) $this->Export(-1, '当前公司不存在');
$tax_info['tax_id'] = $invoice_company->tax_id; $tax_info['tax_id'] = $invoice_company->tax_id;
$tax_info['tax_title'] = $com_name; $tax_info['tax_title'] = $invoice_company->com_name;
$tax_info['tax_no'] = $invoice_company->com_tax_registration; $tax_info['tax_no'] = $invoice_company->com_tax_registration;
if ($invoice_type == 4) $this->Export(0, '', $tax_info); // 增值税普票 if ($invoice_type == 4) $this->Export(0, '', $tax_info); // 增值税普票
...@@ -578,5 +592,36 @@ class ApiController extends Controller ...@@ -578,5 +592,36 @@ class ApiController extends Controller
$this->Export(0, '', $tax_info); // 增值税专票 $this->Export(0, '', $tax_info); // 增值税专票
} }
// 获取用户收货地址
public function getUserAddress($request)
{
$user_id = $request->input('user_id', 0);
if (!$user_id) $this->Export(-1, '用户ID缺失');
$map = [];
$map['user_id'] = $user_id;
$map['address_type'] = 0;
$address = DB::connection('order')->table('lie_user_address')->where($map)->get();
if (empty($address)) $this->Export(-1, '未获取到用户收货地址');
foreach ($address as &$v) {
$province_val = $this->getAddress($v->province);
$city_val = $this->getAddress($v->city);
$district_val = $this->getAddress($v->district);
$v->address = $province_val.$city_val.$district_val.$v->detail_address;
}
$this->Export(0, '', $address);
}
// 查询省市区
public function getAddress($id)
{
return DB::connection('order')->table('lie_region')->where('region_id', $id)->value('region_name');
}
} }
...@@ -508,3 +508,29 @@ function post_curl($url, $data, $headers = array(), $cookie ="") ...@@ -508,3 +508,29 @@ function post_curl($url, $data, $headers = array(), $cookie ="")
curl_close($ch); curl_close($ch);
return $output; return $output;
} }
/**
* 判断是否手机
* @param [type] $mobile [description]
* @return boolean [description]
*/
function is_mobile($mobile)
{
if (strstr($mobile, "+")) { // 国际手机
$res = explode("+", $mobile);
if (intval(strlen($res[1])) > 4 && strval($res[0]) !== '0086') {
return true;
}
if (strval(strlen($res[1])) === '11' && strval($res[0]) === '0086') {
return true;
}
} else if (preg_match("/^1[123456789]{1}\d{9}$/", $mobile)) {
return true;
}
return false;
}
// 验证邮编
function is_postcode($str) {
return preg_match('/^[1-9]\d{5}$/', $str) ? true : false;
}
\ No newline at end of file
...@@ -149,7 +149,7 @@ Route::group(['middleware' => 'web'], function () { ...@@ -149,7 +149,7 @@ Route::group(['middleware' => 'web'], function () {
Route::post('/ajax/batchImportBlackList', 'AddOrderController@batchImportBlackList'); Route::post('/ajax/batchImportBlackList', 'AddOrderController@batchImportBlackList');
Route::post('/address/add', 'AddressController@add');
//bom单 //bom单
Route::match(['get', 'post'],'/ajax/bom/{key}', 'BomApiController@Entrance'); Route::match(['get', 'post'],'/ajax/bom/{key}', 'BomApiController@Entrance');
......
layui.define(function(exports){ //提示:模块也可以依赖其它模块,如:layui.define('layer', callback);
//行政区域选择
var obj = {
boxOjb: null,
dataCache: {
provinces: null,
citys: null,
towns: null
},
/*
* 初始化
* @param container <string/Object> 行政区域表单容器
*/
init: function(container, provinceId, cityId, districtId){
var self = this;
if ((typeof container).toLowerCase() == 'string') {
self.boxOjb = $(container);
} else {
self.boxOjb = container;
}
self.getRegionData(function(){
self.makeRegionHtml(1, 1, provinceId || 0);
self.makeRegionHtml(2, provinceId || 2, cityId || 0);
self.makeRegionHtml(3, cityId || 52, districtId || 0);
// self.bind();
});
},
getRegionData: function(callback){
var self = this;
if(self.dataCache.provinces) {
if (typeof callback == 'function') {
callback();
}
return false;
}
$.ajax({
type: 'post',
url: '/region/getAll',
dataType: 'json',
async: false,
success: function(resp){
if (!resp) {
return layer.msg('网络异常,请稍后再试~');
}
if (resp.provinces) self.dataCache.provinces = resp.provinces;
if (resp.citys) self.dataCache.citys = resp.citys;
if (resp.towns) self.dataCache.towns = resp.towns;
if (typeof callback == 'function') {
callback();
}
}
})
},
// bind: function(){
// var self = this, parent_id = 0;
// //省份选择事件
// $(self.boxOjb).find('select.s_province').on('change', function(){
// parent_id = $(this).val();
// self.makeRegionHtml(2, parent_id);
// });
// //城市选择事件
// $(self.boxOjb).find('select.s_city').on('change', function(){
// parent_id = $(this).val();
// self.makeRegionHtml(3, parent_id);
// });
// },
makeRegionHtml: function(level, parentId, selectId){
var optionHtml = [], self = this, _data = null, selectName = '', d_parent_id = 0;
switch (level) {
case 1:
selectName = 's_province';
_data = self.dataCache.provinces;
break;
case 2:
selectName = 's_city';
_data = self.dataCache.citys;
break;
case 3:
selectName = 's_county';
_data = self.dataCache.towns;
break;
}
if (_data) {
var item = null, children = null;
for (var i in _data) {
item = _data[i];
if (item && item.parent_id == parentId) {
children = item.children;
optionHtml.push('<option value="0">请选择</option>');
for (var j in children) {
if (!d_parent_id) {
d_parent_id = children[j].region_id;
}
optionHtml.push('<option value="' + children[j].region_id + '">' + children[j].region_name + '</option>');
}
break;
}
}
}
self.boxOjb.find('select.' + selectName + '').html(optionHtml.join(''));
if (level == 2) {
self.makeRegionHtml(3, d_parent_id);
}
if (selectId) self.boxOjb.find('select.' + selectName + '').val(selectId);
}
};
//输出test接口
exports('region', obj);
});
\ No newline at end of file
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
<link href="/css/detail.css" rel="stylesheet"> <link href="/css/detail.css" rel="stylesheet">
@include('table.css') @include('table.css')
<script src="/js/jquery-2.2.1.js"></script> <script src="/js/jquery-2.2.1.js"></script>
@include('table.js')
<script src="/js/layui/layui.js"></script>
<script src="/js/region.js"></script>
<script src="/js/web/common.js"></script>
<script src="/js/add_order.js?v=<?= time() ?>"></script>
</head> </head>
<body class="body-small"> <body class="body-small">
...@@ -38,10 +42,7 @@ ...@@ -38,10 +42,7 @@
</div> </div>
</div> </div>
@include('table.js')
<script src="/js/layui/layui.js"></script>
<script src="/js/web/common.js"></script>
<script src="/js/add_order.js?v=<?= time() ?>"></script>
</body> </body>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="zy_delivery_type" class="zy_delivery_type" lay-verify="required"> <select name="zy_delivery_type" class="zy_delivery_type" lay-verify="required">
<option value=""></option> <option value=""></option>
<option value="1">现货发货</option> <option value="1">现货优先发货</option>
<option value="2">拼单发货</option> <option value="2">拼单发货</option>
</select> </select>
</div> </div>
...@@ -57,21 +57,26 @@ ...@@ -57,21 +57,26 @@
<label class="layui-form-label">收货方式:</label> <label class="layui-form-label">收货方式:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="2" title="快递上门"> <input type="radio" class="shipping_type" name="shipping_type" value="1" title="快递上门" lay-filter="shipping_type">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="3" title="自提"> <input type="radio" class="shipping_type" name="shipping_type" value="2" title="自提" lay-filter="shipping_type">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <style>
.address-select, .address-section{ display: none; }
</style>
<div class="layui-row address-select">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6"> <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<input type="hidden" name="address_id" class="address_id" value="">
<label class="layui-form-label">收货地址:</label> <label class="layui-form-label">收货地址:</label>
<div class="layui-input-inline"> <div class="layui-input-inline layui-form" lay-filter="user-address">
<select name="address" class="address" lay-verify="required"> <select name="address" class="address" lay-verify="required" lay-filter="address-val">
<option value=""></option>
</select> </select>
</div> </div>
...@@ -102,3 +107,82 @@ ...@@ -102,3 +107,82 @@
</div> </div>
</div> </div>
</div> </div>
<style>
#user-address-pop{ display: none; margin: 20px 0px; }
#user-address-pop input{ width: 200px; }
.link_mobile{ width: 193px !important; }
#add-address-pop{ overflow: visible; }
</style>
<div id="user-address-pop">
<form class="layui-form address-form" id="address-form">
<div class="layui-row">
<div class="form-form-item layui-form" lay-filter="s_region">
<label class="layui-form-label"><i class="text-danger">*</i> 所在地区</label>
<div class="layui-input-inline">
<select name="province" class="s_province province" lay-filter="s_province"></select>
</div>
<div class="layui-input-inline">
<select name="city" class="s_city city" lay-filter="s_city"></select>
</div>
<div class="layui-input-inline">
<select name="district" class="s_county district"></select>
</div>
</div>
</div>
<div class="layui-row" style="margin-bottom: 5px;">
<div class="form-form-item layui-form-text">
<label class="layui-form-label"><i class="text-danger">*</i> 详细地址</label>
<div class="layui-input-inline">
<textarea class="layui-textarea detail_address" name="detail_address" cols="80" autocomplete="off"></textarea>
</div>
</div>
</div>
<div class="layui-row">
<div class="form-form-item">
<label class="layui-form-label">邮政编码</label>
<div class="layui-input-inline">
<input type="text" class="layui-input zipcode" name="zipcode" autocomplete="off">
</div>
</div>
</div>
<div class="layui-row">
<div class="form-form-item">
<label class="layui-form-label"><i class="text-danger">*</i> 收货人</label>
<div class="layui-input-inline">
<input type="text" class="layui-input consignee" name="consignee" autocomplete="off">
</div>
</div>
</div>
<div class="layui-row">
<div class="form-form-item">
<label class="layui-form-label"><i class="text-danger">*</i> 联系电话</label>
<div class="layui-input-inline">
<select name="intl_code" id="intl_code" style="float: left;">
<option value="0086">0086 (中国)</option>
<option value="00852">00852 (香港)</option>
<option value="00853">00853 (澳门)</option>
<option value="00886">00886 (台湾)</option>
</select>
</div>
<div class="layui-input-inline">
<input type="text" class="layui-input link_mobile" name="link_mobile" autocomplete="off">
</div>
</div>
</div>
<div class="layui-row">
<div class="form-form-item">
<label class="layui-form-label"></label>
<div class="layui-input-inline layui-form" lay-filter="is_default">
<input type="checkbox" class="layui-input is_default" name="is_default" title="设为默认地址">
</div>
</div>
</div>
</form>
</div>
\ No newline at end of file
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
.addOrder .layui-colla-title{ margin-top: 0px; margin-bottom: 0px; } .addOrder .layui-colla-title{ margin-top: 0px; margin-bottom: 0px; }
.addOrder .layui-form-item{ margin-bottom: 0px; } .addOrder .layui-form-item{ margin-bottom: 0px; }
.addOrder label{ width: 110px; } .addOrder label{ width: 110px; }
.addOrder span{ line-height: 35px; } .addOrder span{ line-height: 37px; }
.invoice-section, .address-section{ border: 1px solid #ccc; } .invoice-section, .address-section{ border: 1px solid #ccc; }
.invoice-section-2, .invoice-section-3, .invoice-section-4{ display: none; } .invoice-section-2, .invoice-section-3, .invoice-section-4{ display: none; }
</style> </style>
<input type="hidden" name="user_id" class="user_id" value=""> <input type="hidden" name="user_id" class="user_id" value="">
<input type="hidden" name="inv_com_id" class="inv_com_id" value="">
<div class="layui-collapse addOrder"> <div class="layui-collapse addOrder">
<form class="layui-form layui-box quoteForm" method="post"> <form class="layui-form layui-box quoteForm" method="post">
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
</div> </div>
</div> </div>
<div class="layui-colla-item"> <div class="layui-colla-item address-info">
<h2 class="layui-colla-title">收货信息</h2> <h2 class="layui-colla-title">收货信息</h2>
<div class="layui-colla-content layui-show"> <div class="layui-colla-content layui-show">
@include('addOrder.addressInfo') @include('addOrder.addressInfo')
...@@ -39,7 +40,14 @@ ...@@ -39,7 +40,14 @@
</div> </div>
</div> </div>
<div class="layui-colla-item order-info1"> <div class="layui-colla-item client-info">
<h2 class="layui-colla-title">终端客户信息</h2>
<div class="layui-colla-content layui-show">
@include('addOrder.dgkInfo')
</div>
</div>
<div class="layui-colla-item order-info">
<h2 class="layui-colla-title">订单信息</h2> <h2 class="layui-colla-title">订单信息</h2>
<div class="layui-colla-content layui-show"> <div class="layui-colla-content layui-show">
@include('addOrder.orderInfo') @include('addOrder.orderInfo')
......
<style>
.client-info label{ width: 150px; }
</style>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><i class="text-danger">*</i> 终端中文名称:</label>
<div class="layui-input-inline">
<input type="text" class="layui-input customer_cn" name="customer_cn" value="" autocomplete="off">
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><i class="text-danger">*</i> 客户类型:</label>
<div class="layui-input-inline">
<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>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><i class="text-danger">*</i> 终端英文名称:</label>
<div class="layui-input-inline">
<input type="text" class="layui-input customer_en" name="customer_en" value="" autocomplete="off">
</div>
<div class="layui-form-mid">
<a href="https://translate.google.cn/" target="_blank">谷歌翻译</a>
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><i class="text-danger">*</i> 产品用途:</label>
<div class="layui-input-inline">
<select class="form-control product_use_classone_sn" name="product_use_classone_sn">
<option value="">请选择</option>
</select>
</div>
<div class="layui-input-inline">
<select class="form-control product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><i class="text-danger">*</i> 客户网址:</label>
<div class="layui-input-inline">
<input type="text" class="layui-input customer_website" name="customer_website" value="" autocomplete="off">
</div>
</div>
</div>
</div>
<script>
window.api_dgk_url_text ="<?php echo $api_dgk_url;?>"
setTimeout( function(){
$.get(window.api_dgk_url_text,function(data){
window.data = data.data.data
console.log(window.data)
var product = Object.keys(window.data); // 获取一级分类
var product_len = Object.keys(window.data).length
for(var i = 0; i < product_len; i++){
$('.product_use_classone_sn').append('<option value="'+i+'">'+product[i]+'</option>')
}
},'json')
}, 10)
$(document).on('change','.product_use_classone_sn',function(data){
var select_key = $('.product_use_classone_sn option:selected').text();
$('.product_use_classtwo_sn').html('');
for(let key in window.data){
if(key == select_key){
for(var i = 0; i < window.data[key].length; i++){
$('.product_use_classtwo_sn').append('<option value="'+i+'">'+window.data[key][i]+'</option>')
}
}
}
})
</script>
...@@ -94,6 +94,9 @@ ...@@ -94,6 +94,9 @@
<a class="btn btn-success add-to-lists">添加至商品列表</a> <a class="btn btn-success add-to-lists">添加至商品列表</a>
</div> </div>
<style>
.carts-info{ display: none; }
</style>
<!-- 商品列表 --> <!-- 商品列表 -->
<div class="carts-info"> <div class="carts-info">
<table id="list" lay-filter="list"></table> <table id="list" lay-filter="list"></table>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<label class="layui-form-label">选择优惠券:</label> <label class="layui-form-label">选择优惠券:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="user_coupon" id="user_coupon"> <select name="user_coupon" id="user_coupon" class="form-control">
<option value="">请选择</option> <option value="">请选择</option>
</select> </select>
</div> </div>
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<label class="layui-form-label">开票方式:</label> <label class="layui-form-label">开票方式:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="3" title="增值税专用发票"> <input type="radio" class="radio-invoice-type" name="inv_type" value="3" title="增值税专用发票" lay-filter="invoice_type">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="4" title="增值税普通发票"> <input type="radio" class="radio-invoice-type" name="inv_type" value="4" title="增值税普通发票" lay-filter="invoice_type">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="" title="不开发票"> <input type="radio" class="radio-invoice-type" name="inv_type" value="" title="不开发票" lay-filter="invoice_type">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="2" title="个人"> <input type="radio" class="radio-invoice-type" name="inv_type" value="2" title="个人" lay-filter="invoice_type">
</div> </div>
</div> </div>
</div> </div>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<label class="layui-form-label">发票/公司:</label> <label class="layui-form-label">发票/公司:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="com_name" required lay-verify="" placeholder="请输入公司" autocomplete="off" class="layui-input com_name"> <input type="text" name="com_name" required lay-verify="" placeholder="请输入公司" autocomplete="off" class="layui-input inv_com_name inv-user-info" data-type="1">
</div> </div>
</div> </div>
</div> </div>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<label class="layui-form-label">联系方式:</label> <label class="layui-form-label">联系方式:</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input type="text" name="account" required lay-verify="required" placeholder="请输入联系方式" autocomplete="off" class="layui-input account"> <input type="text" name="account" required lay-verify="required" placeholder="请输入联系方式" autocomplete="off" class="layui-input inv-user-info" data-type="2">
</div> </div>
</div> </div>
</div> </div>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<label class="layui-form-label">选择个人发票:</label> <label class="layui-form-label">选择个人发票:</label>
<div class="layui-input-inline layui-form" lay-filter="user-tax"> <div class="layui-input-inline layui-form" lay-filter="user-tax">
<select name="user_tax_id" id="user_tax_id"> <select name="user_tax_id" id="user_tax_id" lay-filter="user_tax_id">
</select> </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