Commit 54aab9f3 by 朱继来

调整后台下单temp

parent 8f593127
......@@ -78,6 +78,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/getDJKConfg';
$info['api_dgk_url'] = ($url.'?k1='.$data['k1']."&".'k2='.$data['k2']);
$info['company'] = (new CmsModel())->getCompany(); // 获取公司组织
return view('addOrder', $info);
}
......@@ -247,7 +248,7 @@ Class AddOrderController extends Controller
{
if ($request->isMethod('post')) {
$data['uid'] = $request->input('uid');
$data['order_goods_type'] = $request->input('goods_type');
$data['order_goods_type'] = $request->input('goods_type', 1);
$data['cart_ids'] = $request->input('cart_ids');
$data['k1'] = time();
......@@ -311,7 +312,7 @@ Class AddOrderController extends Controller
}
return view('addOffline', $info);
}
}
// 获取SKU信息
public function getSku(Request $request)
......@@ -388,8 +389,8 @@ Class AddOrderController extends Controller
{
if ($request->isMethod('post')) {
$data['uid'] = $request->input('uid');
$data['type'] = $request->input('type');
$data['delivery_place'] = $request->input('delivery_place');
// $data['type'] = $request->input('type');
$data['delivery_place'] = $request->input('delivery_place', 1);
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
......@@ -398,11 +399,31 @@ Class AddOrderController extends Controller
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
} else {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
}
// if ($response['err_code'] == 0) {
// return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
// } else {
// return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
// }
$data = isset($response['data']['list']) ? $response['data']['list'] : [];
return ['code'=>$response['err_code'], 'msg'=>$response['err_msg'], 'data'=>$data, 'count'=>count($data)];
}
}
// 获取订单赠品信息
public function getOrderGift(Request $request)
{
if ($request->isMethod('post')) {
$data['cart_ids'] = $request->input('cart_ids', 1);
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'cart/getOrderGift';
$res = json_decode(curlApi($url, $data), true);
return ['errcode' => $res['err_code'], 'errmsg' => $res['err_msg'], 'data'=>$res['data']];
}
}
......@@ -410,16 +431,16 @@ Class AddOrderController extends Controller
public function changeNum(Request $request)
{
if ($request->isMethod('post')) {
$data['uid'] = $request->input('uid');
$data['num'] = $request->input('num');
$data['uid'] = $request->input('uid');
$data['num'] = $request->input('num');
$data['cart_id'] = $request->input('cart_id');
$type = $request->input('type'); // 3-批量添加的商品
$goods_type = $request->input('goods_type');
$type = $request->input('type'); // 3-批量添加的商品
// $goods_type = $request->input('goods_type');
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
if ($type == 3 && $goods_type == 1) { // 联营批量添加
if ($type == 3) { // 联营批量添加
$url = Config('website.api_domain').'cart/changeNumForJoint';
} else {
$url = Config('website.api_domain').'cart/changeNumByOrderSystem';
......@@ -474,7 +495,7 @@ Class AddOrderController extends Controller
$data['type'] = 4; // 自营其他业务
$data['business_type'] = $request->input('business_type', 0); // 业务类型
} else {
$data['type'] = $request->input('goods_type');
$data['type'] = $request->input('goods_type', 1);
}
$data['k1'] = time();
......@@ -552,6 +573,8 @@ Class AddOrderController extends Controller
$data['cart_id'] = implode(',', $request->input('cart_ids'));
$data['type'] = $request->input('type');
$data['remark'] = $request->input('remark');
$data['com_id'] = $request->input('com_id', 0);
$data['com_name'] = $request->input('com_name', '');
if ($data['type'] == 3) { // 自营线下订单
$data['address_name'] = $request->input('address_name');
......
......@@ -30,6 +30,7 @@ use App\Model\OrderServiceItemsModel;
use App\Model\OrderServiceLogModel;
use App\Model\OrderRefundModel;
use App\Model\OrderRefundLogModel;
use DB;
class ApiController extends Controller
{
......@@ -508,6 +509,74 @@ class ApiController extends Controller
$this->Export($temp['err_code'], $temp['err_msg'], $temp['data']);
}
// 获取用户绑定客服、发票
public function getUserInvoice($request)
{
$com_name = $request->input('com_name', '');
$account = $request->input('account', '');
$invoice_type = $request->input('invoice_type', '');
$curr_user_id = $request->user->userId;
$tax_info = [];
if (!$account) $this->Export(-1, '未填写联系方式');
if (preg_match('/@/', $account)) {
$field = 'email';
} else {
$field = 'mobile';
}
$user_id = DB::connection('order')->table('lie_user_main')->where($field, $account)->value('user_id');
if (!$user_id) $this->Export(-1, '当前联系账号不存在');
// 个人发票
if ($invoice_type == 2) {
$where = [];
$where['user_id'] = $user_id;
$where['inv_type'] = 2;
$tax_info = DB::connection('order')->table('lie_taxinfo')->where($where)->select('tax_title', 'tax_id')->get();
$this->Export(0, '', $tax_info);
}
if (!$com_name) $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['com_id'] = $invoice_company->id;
$map['user_id'] = $user_id;
$map['status'] = 0;
$sale_id = DB::connection('order')->table('lie_invoice_com_user')->where($map)->value('sale_id');
if ($sale_id && $sale_id != $curr_user_id) {
$CmsModel = new CmsModel();
$sale_name = $CmsModel->getUserName($sale_id);
$this->Export(-1, '当前公司和联系账号由'.$sale_name.'跟进');
}
$tax_info['tax_id'] = $invoice_company->tax_id;
$tax_info['tax_title'] = $com_name;
$tax_info['tax_no'] = $invoice_company->com_tax_registration;
if ($invoice_type == 4) $this->Export(0, '', $tax_info); // 增值税普票
$tax_info['com_addr'] = $invoice_company->com_addr;
$tax_info['com_tel'] = $invoice_company->com_tel;
$tax_info['com_bank'] = $invoice_company->com_bank;
$tax_info['com_bank_num'] = $invoice_company->com_bank_num;
$tax = DB::connection('order')->table('lie_taxinfo')->where('tax_id', $invoice_company->tax_id)->first();
$tax_info['consignee'] = $tax->consignee;
$tax_info['consignee_phone'] = $tax->consignee_phone;
$tax_info['consignee_addr'] = $tax->consignee_address;
$this->Export(0, '', $tax_info); // 增值税专票
}
}
......@@ -103,6 +103,7 @@ Route::group(['middleware' => 'web'], function () {
Route::post('/ajax/getSku', 'AddOrderController@getSku');
Route::post('/ajax/addCart', 'AddOrderController@addCart');
Route::post('/ajax/cartList', 'AddOrderController@cartList');
Route::post('/ajax/getOrderGift', 'AddOrderController@getOrderGift');
Route::post('/ajax/changeNum', 'AddOrderController@changeNum');
Route::post('/ajax/deleteGoods', 'AddOrderController@deleteGoods');
Route::post('/ajax/create', 'AddOrderController@create');
......
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class CmsModel extends Model
{
protected $table = 'user_info';
protected $primaryKey = 'userId';
public $timestamps = false;
// 获取用户名称
public function getUserName($userId, $field='name')
{
$user = $this->where(['userId' => $userId])->select($field)->first();
return $user ? $user->$field : '';
}
// 获取用户ID
public function getSaleId($name='')
{
if (!$name) return false;
$name && $map['name'] = $name;
$user = $this->where($map)->select('userId')->first();
return $user ? $user->userId : 0;
}
/*
查询cms系统用户信息
*/
public function getUserInfo($where){
return $this->where($where)->select('userId')->first();
}
/*
批量查询用户姓名
*/
public function getBatchUserName($user_ids){
return $this->whereIn('userId',$user_ids)->select('userId','name','email')->get()->toArray();
}
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class CmsModel extends Model
{
protected $table = 'user_info';
protected $primaryKey = 'userId';
public $timestamps = false;
// 获取用户名称
public function getUserName($userId, $field='name')
{
$user = $this->where(['userId' => $userId])->select($field)->first();
return $user ? $user->$field : '';
}
// 获取用户ID
public function getSaleId($name='')
{
if (!$name) return false;
$name && $map['name'] = $name;
$user = $this->where($map)->select('userId')->first();
return $user ? $user->userId : 0;
}
/*
查询cms系统用户信息
*/
public function getUserInfo($where){
return $this->where($where)->select('userId')->first();
}
/*
批量查询用户姓名
*/
public function getBatchUserName($user_ids)
{
return $this->whereIn('userId',$user_ids)->select('userId','name','email')->get()->toArray();
}
// 获取后台公司组织
public function getCompany()
{
return $this->from('lie_organization')->where('status', 1)->select('com_name', 'com_currency', 'id')->get()->keyBy('id')->toArray();
}
}
\ No newline at end of file
......@@ -3,6 +3,1007 @@ layui.use(['form', 'table', 'element'], function() {
var table = layui.table;
var element = layui.element;
// 公司、账号输入后,检查绑定客服、发票
$('.com_name, .account').blur(function() {
var com_name = $('.com_name').val();
var account = $('.account').val();
var invoice_type = $('input[name=invoice_type]:checked').val();
if (!invoice_type) return false;
var datax = {};
datax.com_name = com_name;
datax.account = account;
datax.invoice_type = invoice_type;
$.ajax({
type: "POST",
url: '/api/getUserInvoice',
data: datax,
dataType: "json",
success: function(resp){
if (resp.errcode != 0) {
layer.msg(resp.errmsg);
$('.tax_id').val('');
$('.invoice-section-2').hide();
$('.invoice-section-3').hide();
$('.invoice-section-4').hide();
return false;
}
var data = resp.data;
if (invoice_type == 2) {
var str = '<option value="">请选择</option>';
for(var i = 0; i < data.length; i++) {
str += '<option value="'+data[i].tax_id+'">'+data[i].tax_title+'</option>';
}
$('.invoice-section-2').show();
$('#user_tax_id').empty().append(str);
form.render('select', 'user-tax');
} else if (invoice_type == 3) { // 增值税专票
$('.tax_title').text(data.tax_title);
$('.tax_no').text(data.tax_no);
$('.com_addr').text(data.com_addr);
$('.com_tel').text(data.com_tel);
$('.com_bank').text(data.com_bank);
$('.com_bank_num').text(data.com_bank_num);
$('.consignee').text(data.consignee);
$('.consignee_phone').text(data.consignee_phone);
$('.consignee_addr').text(data.consignee_addr);
$('.tax_id').val(data.tax_id);
$('.invoice-section-3').show();
} else if (invoice_type == 4) { // 增值税普票
$('.tax_title').text(data.tax_title);
$('.tax_no').text(data.tax_no);
$('.tax_id').val(data.tax_id);
$('.invoice-section-4').show();
}
},
})
})
// 选择销售组织
form.on('select(com_id)', function(data) {
var val = data.value;
if (val == '') {
$('.currency-sign').text('');
$('.currency-section').hide();
$('.delivery_place').val('');
form.render('select', 'delivery_place');
return false;
}
var currency = $(data.elem).find("option:selected").attr('currency');
var currency_sign = '';
var delivery_place = 0;
if (currency == 1) {
currency_sign = 'RMB';
delivery_place = 1;
} else {
currency_sign = 'USD';
delivery_place = 2;
}
$('.currency-sign').text(currency_sign);
$('.currency-section').show();
$('.delivery_place').val(delivery_place);
form.render('select', 'delivery_place');
var user_id = $('.user_id').val();
getCartLists(user_id, delivery_place); // 加载购物车列表
})
// 获取SKU信息
$('.get-sku').click(function() {
var sku_id = $(this).siblings('.layui-input-inline').find('.search-sku').val();
var user_id = $('.user_id').val() || 0;
if (!sku_id) {
layer.msg('请输入SKU_ID');
return false;
}
if (!/^\d*$/.test(sku_id)) {
layer.msg('参数错误,请输入正确的SKU_ID');
return false;
}
$.ajax({
url: '/ajax/getSku',
type: 'post',
data: {sku_id : sku_id.trim(), user_id: user_id},
dataType: 'json',
success: function (resp) { console.log(resp)
if (resp.errcode != 0) {
console.log(resp.data)
layer.msg(resp.errmsg);
return false;
}
$('.sku-info').show();
var data = resp.data;
var status_val = '';
$('.goods_name').text(data.goods_name);
$('.brand_name').text(data.brand_name);
$('.supplier_name').text(data.supplier_name);
$('.stock').text(data.goods_number);
$('.moq').text(data.min_buy);
$('.mpq').text(data.min_mpq);
if(data.self_supplier_type == 1){
$('.self_supplier_type').text('自采');
}else if(data.self_supplier_type == 2){
$('.self_supplier_type').text('立创');
}else{
$('.self_supplier_type').text('自采');
}
status_val = data.is_buy ? '是' : '否';
$('.status').text(status_val);
$('.goods_id').val(data.goods_id);
$('.goods_type').val(data.goods_type);
//阶梯价格
if (data.tiered != null) {
var len = data.tiered.length;
if (len > 0) {
var html = '';
html += '<tr><th>阶梯</th><th>RMB价格</th>';
if (data.ac_type && data.ac_type != 5) { // ac_type = 5 为新客价,目前后台不展示新客价
switch (data.ac_type) {
case 1: html += '<th>限时限量</th>'; break;
case 2: html += '<th>活动价</th>'; break;
case 3: html += '<th>会员价</th>'; break;
case 6: html += '<th>自营清库存</th>'; break;
case 7: html += '<th>团购价</th>'; break;
case 8: html += '<th>折扣价</th>'; break;
case 10: html += '<th>活动打折</th>'; break;
default: html += '<th></th>'; break;
}
}
var joint_goods_type = ['1', '2']; // 商品联营类型
if (joint_goods_type.indexOf(data.goods_type) != -1) {
html += '<th>USD价格</th>';
}
html += '</tr>';
for (var i = 0; i < len; i++) {
html += '<tr>';
if (i == 0) {
if (data.ac_type && data.ac_type != 5) {
html += '<td><span class="goods-min-num">'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="goods-min-price price-line">'+data.tiered[i]['price_cn']+'</span><td>¥<span>'+data.tiered[i]['price_ac']+'</span></td>';
} else {
html += '<td><span class="goods-min-num">'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="goods-min-price">'+data.tiered[i]['price_cn']+'</span></td>';
}
if (joint_goods_type.indexOf(data.goods_type) != -1) {
html += '<td>$<span class="goods-min-price-us">'+data.tiered[i]['price_us']+'</span></td>';
}
} else {
if (data.ac_type && data.ac_type != 5) {
html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="price-line">'+data.tiered[i]['price_cn']+'</span></td><td>¥<span>'+data.tiered[i]['price_ac']+'</span></td>';
} else {
html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span>'+data.tiered[i]['price_cn']+'</span></td>';
}
if (joint_goods_type.indexOf(data.goods_type) != -1) {
html += '<td>$<span>'+data.tiered[i]['price_us']+'</span></td>';
}
}
html += '</tr>';
}
// $('.ladder_price_table tr:gt(0)').remove();
$('.ladder_price_table').empty().append(html);
}
}
}
})
})
// 添加到商品列表
$('.add-to-lists').click(function() {
var goods_min_num = $(this).parents('.sku-info').find('.moq').text();
var goods_id = $(this).siblings('.goods_id').val();
var type = $(this).siblings('.goods_type').val();
var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆
var user_id = 0;
user_id = $('.user_id').val();
if (!user_id) {
layer.msg('请先选择用户');
return false;
}
delivery_place = $('.delivery_place').val();
if (delivery_place == null) {
layer.msg('请选择交货地');
return false;
}
var goods_min_price = $(this).parents('.sku-info').find('.goods-min-price').text();
var goods_min_price_us = $(this).parents('.sku-info').find('.goods-min-price-us').text();
if (delivery_place == 1) {
if (goods_min_price == 0) {
layer.msg('缺少RMB价格,商品添加失败');
return false;
}
} else if (delivery_place == 2) {
if (goods_min_price_us == 0) {
layer.msg('缺少美金价格,商品添加失败');
return false;
}
}
var datax = {
uid: user_id,
id: goods_id,
num: goods_min_num,
buy: -1,
delivery_place: delivery_place,
}
$.ajax({
type: "POST",
url: '/ajax/addCart',
data: datax,
dataType: "json",
success: function(resp){
layer.msg(resp.errmsg);
renderTable();
return false;
},
})
})
// 批量导入物料
$('.goods_import').click(function() {
var user_id = $('.user_id').val() ? $('.user_id').val() : 0;
var delivery_place = $('.delivery_place').val() ? $('.delivery_place').val() : 1; // 1.大陆,2.香港 自营默认是大陆
if (!user_id) {
layer.msg('请先选择用户');
return false;
}
// 上传文件
var form = $('<form id="formUpload" method="post" enctype="multipart/form-data">\
<input type="file" name="upload" id="fileInput" accept="application/vnd.ms-excel, application/x-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, .csv">\
</form>');
var type = $(this).data('type'); // 1-联营模板,2-自营模板
form.find('input').change(function(){
var formData = new FormData();
formData.append('file', this.files[0]);
formData.append('type', type);
formData.append('user_id', user_id);
formData.append('delivery_place', delivery_place);
$.ajax({
type: "POST",
url: '/ajax/batchGoodsImport',
data: formData,
dataType: 'json',
cache: false,
processData: false,
contentType: false,
success: function(resp){
if (resp.errcode == 0) {
layer.msg(resp.errmsg);
renderTable();
return false;
}
layer.alert(resp.errmsg);
},
})
layer.msg('批量导入中...', {icon: 16, time: 0, shade: 0.3});
})
form.find('input[type="file"]').trigger('click');
})
$('.submit-order').off().on('click', function() {
var self = $(this);
var address_id = $('input[name=address_id]').val();
var type = self.data('type'); // 1-联营线上,2-自营线上,3-自营线下,4-自营其他业务
var cart_ids = [];
var user_id = 0;
var remark = $('#remark').val(); // 订单备注
if (internal_uid) {
user_id = internal_uid;
} else {
user_id = $('.user_id').val();
}
var is_dgk = false;
$('.shop-table tbody tr').each(function() {
var cid = $(this).data('cid');
cart_ids.push(cid);
var supplier_id = $(this).data('sup_id');
var supplier_name = $(this).data('sup_name');
if (supplier_id == '7' || supplier_name.toString().toLowerCase() == 'digikey') {
is_dgk = true;
}
})
if (cart_ids.length > 0) {
var submit = true;
var datax = {
uid: user_id,
sale_id: sale_id,
address_id: address_id,
type: type,
cart_ids: cart_ids,
remark: remark,
}
if (type == 3) { // 自营线下订单
datax.address_name = $('input[name=address_name]').val();
datax.address_mobile = $('input[name=address_mobile]').val();
} else { // 联营、自营线上订单
var tax_id = $('.tax_id').val();
var inv_type = $('input[name=inv_type]:checked').val();
var user_coupon_id = $('.user_coupon_id').val();
var zy_delivery_type = $('.zy_delivery_type').val();
if (!address_id) {
layer.msg('请选择快递信息');
return false;
}
if (!zy_delivery_type) {
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 (type == 1 && is_dgk) { // 联营包含digikey商品,则填写终端资料
var customer_cn = $('.customer_cn').val();
var customer_en = $('.customer_en').val();
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_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;
}
var com_id = $('.com_id').val(); // 公司ID
var com_name = $('.com_id').find("option:selected").text(); // 公司名称
if (!com_id) {
layer.msg('请选择销售组织');
return false;
}
datax.com_id = com_id;
datax.com_name = com_name;
datax.tax_id = tax_id;
datax.user_coupon_id = user_coupon_id;
datax.zy_delivery_type = zy_delivery_type;
}
// 自营线上
if (type == 2 && is_online == 1) {
var sale_type = $('#sale_type').val();
var cart_info = [];
$('.shop-table tbody tr').each(function() {
var gid = $(this).find('.goods_id').text();
var num = $(this).find('.goods_num').val();
cart_info.push({'gid':gid, 'num':num});
})
datax.role = role; // 自营线上下单添加角色
$.ajax({
type: "POST",
url: '/ajax/checkStock',
data: {cart_info: JSON.stringify(cart_info), sale_type: sale_type},
dataType: "json",
async: false,
success: function(resp){
if (resp.errcode == -1) {
var data = eval(resp.data);
var content = '<p>'+resp.errmsg+'</p>';
submit = false;
for (var i = 0; i < data.length; i++) {
content += '<p><span>'+(i+1)+'、</span>'+data[i]['goods_name']+',可用库存:'+data[i]['stock']+'</p>';
}
// 弹出提示
layer.open({
area: ['500px', '300px'],
title: '提示信息',
content: content,
btn: [],
});
// self.removeAttr('disabled').css('pointer-events', 'auto');
return false;
}
},
})
}
if (submit) {
$.ajax({
type: "POST",
url: '/ajax/create',
data: datax,
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
layer.msg(resp.errmsg);
location.href = '/addorder/success?order_id='+resp.data.order_id+'&type='+resp.data.type;
return false;
} else if (resp.errcode == 21024) {
layer.alert('该用户已进入公司黑名单,具体请联系吴承义,同时订单无法提交');
return false;
} else if (resp.errcode == 21030) {
layer.alert(resp.errmsg, function() {
var delivery_place = $('.delivery_place').val();
loading.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
loading.confirm(user_id, address_id, cart_ids, user_coupon_id, goods_type, is_online); // 确认订单信息
});
return false;
}
layer.alert(resp.errmsg);
},
})
layer.msg('订单生成中...', {icon: 16, time: 0, shade: 0.3});
}
} else {
layer.msg('请先添加商品');
}
})
var cart_ids = [];
var renderTable = function () {
table.render({
id: 'list'
,elem: '#list'
,url: '/ajax/cartList' //数据接口
,method:'post'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,where: {
uid: $('.user_id').val(),
delivery_place: $('.delivery_place').val() ? $('.delivery_place').val() : 1,
}
// ,page: true //开启分页
,cols: [[ //表头
{title: '序号', type: 'numbers', fixed: 'left', width: 60}
,{field: 'goods_id', title: 'SKUID', width: 180}
,{field: 'goods_name', title: '商品名称', width: 200}
,{field: 'brand_name', title: '制造商', width: 200}
,{field: 'mpl', title: '倍数'}
,{field: 'goods_number', title: '采购数量', edit: 'text', style: 'backgroud: #ccc', width: 100}
,{field: 'goods_price', title: '采购单价', width: 120}
,{field: 'goods_amount_format', title: '小计'}
,{field: 'delivery_time', title: '货期'}
,{field: 'supplier_name', title: '供应商'}
,{field: 'buyer_id', title: '采购员', templet: '#buyer_id'}
,{field: 'batch', title: '批次'}
,{title: '操作', align:'center', fixed: 'right', toolbar: '#list_action', width: 80}
]]
// ,limit: 10
// ,limits: [10, 20, 50,]
,done: function(res, curr, count) {
if (res.data.length == 0) return false;
cart_ids = [];
for( i=0; i < count; i++){
cart_ids.push(res.data[i].cart_id);
}
getOrderGift(cart_ids);
var user_id = $('.user_id').val();
var address_id = $('.address_id').val() ? $('.address_id').val() : 0;
var user_coupon_id = $('.user_coupon_id').val() ? $('.user_coupon_id').val() : 0;
orderConfirm(user_id, address_id, cart_ids, user_coupon_id); // 确认订单信息
}
});
};
renderTable();
// 获取赠品信息
function getOrderGift(cart_ids)
{
$.ajax({
type: "POST",
url: '/ajax/getOrderGift',
data: {cart_ids: cart_ids},
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
layer.msg(resp.errmsg)
var gift_len = resp.data.length;
var gift_data = resp.data;
var str = '';
for (var i = 0; i < gift_len; i++) {
str += '<tr>\
<td>'+gift_data[i].activity_id+'</td>\
<td>\
<div class="layer-photos-demo">\
<a><img src="'+gift_data[i].pic+'" width="20" height="20"></a>\
</div>\
</td>\
<td>'+gift_data[i].item_name+'</td>\
<td>'+gift_data[i].num+'</td>\
<td>'+gift_data[i].content+'</td>\
</tr>';
}
$('.gift-table tbody').empty().append(str);
$('.order-gift-info').show();
return false;
}
},
})
}
// 修改数量
table.on('edit(list)', function(obj){ //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值"
var old = $(this).prev().text(); // 原数量
var num = obj.value; // 修改后数量
if (!num) {
layer.msg('数量不能为0或空');
return false;
}
var min_buy = obj.data.min_buy;
var cart_id = obj.data.cart_id;
var type = obj.data.type; // 商品添加类型
var user_id = $('.user_id').val() ? $('.user_id').val() : 0;
var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆
if (num < min_buy) {
self.val(min_buy);
layer.msg('购买数量低于最小起订量,默认调整为最小起订量');
num = min_buy;
}
var curr_goods_type = obj.data.goods_type;
var joint_goods_type = [1, 2]; // 商品联营类型
if (joint_goods_type.indexOf(curr_goods_type) != -1) {
delivery_place = $('.delivery_place').val();
} else { // 自营数量需要结合倍数
var mpl = Number(obj.data.mpl); // 倍数
num = Math.ceil(num / mpl) * mpl;
}
$.ajax({
type: "POST",
url: '/ajax/changeNum',
data: {uid: user_id, num: num, cart_id: cart_id, type: type},
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
layer.msg(resp.errmsg)
renderTable();
return false;
}
layer.msg(resp.errmsg);
},
})
});
// tool操作
table.on('tool(list)', function(obj){ //注:tool是工具条事件名,test是table原始容器的属性lay-filter="对应的值"
var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var url = '';
var title = '';
var content = '';
var datax = {};
var user_id = 0;
var delivery_place = $('.delivery_place').val() ? $('.delivery_place').val() : 1; // 1.大陆,2.香港 自营默认是大陆
datax.cart_id = data.cart_id;
if (layEvent === 'del') {
url = '/ajax/deleteGoods';
title = '删除商品';
content = '<div style="margin: 40px;">确定删除该条商品('+ data.goods_name +')吗?</div>';
datax.uid = $('.user_id').val();
}
layer.open({
area: ['400px', '200px'],
title: title,
type: 1,
content: content,
btn: ['确认', '取消'],
yes: function(index) {
$.ajax({
url : url,
type: 'post',
data: datax,
dataType: 'json',
success: function(resp) {
if (resp.errcode == 0) {
layer.close(index);
layer.msg(resp.errmsg);
renderTable(); // 重新加载table
return false;
}
layer.msg(resp.errmsg);
},
error: function(err) {
console.log(err)
}
})
layer.msg(title+'中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
return false;
},
cancel: function(index) {
layer.close(index);
}
})
});
// 购物车商品列表
function getCartLists(user_id, delivery_place="1")
{
var user_coupon_id = $('.user_coupon_id').val() ? $('.user_coupon_id').val() : 0;
$.ajax({
type: 'post',
url: '/ajax/cartList',
data: {uid : user_id, delivery_place: delivery_place},
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
var list = resp.data.list;
var len = list.length;
var html = '';
var order_amount = 0;
var currency = '';
var cart_ids = [];
var cart_gift = resp.data.cart_gift; // 订单赠品信息
if (len == 0) return false;
var buyer = '';
// list = list.reverse();
// 购物车列表
for (var i = len - 1 ; i >= 0; i--) {
html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'" data-brand_id="'+list[i].brand_id+'" data-brand_name="'+list[i].brand_name+'" data-goods_type="'+list[i].goods_type+'">'+
'<td>'+(len - i)+'</td>'+
'<td class="goods_id">'+list[i].goods_id+'</td>'+
'<td>'+list[i].goods_name+'</td>'+
'<td>'+list[i].brand_name+'</td>';
html += list[i].standard_brand_name ? '<td class="standard-brand-yellow">' : '<td>';
html += '<div class="layui-input-inline" style="width: 75%;"><input type="text" class="layui-input change_standard_brand_name" name="standard_brand_name" value="'+list[i].standard_brand_name+'" readonly /></div><i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=1></i></td>';
var mpl = list[i].mpl ? list[i].mpl : '';
html += '<td><span class="goods_mpl">'+mpl+'</span></td>';
html += '<td><input type="text" class="layui-input goods_num" name="goods_num" value="'+list[i].goods_number+'" data-origin_num="'+list[i].goods_number+'"></td>'+
'<td class="goods_price">'+list[i].goods_price+'</td>'+
'<td class="goods_amount">'+list[i].goods_amount_format+'</td>'+
'<td>'+list[i].delivery_time+'</td>';
html += '<td>'+list[i].supplier_name+'</td>';
buyer = list[i].buyer_id != '0' ? list[i].buyer_id : '';
html += '<td>'+buyer+'</td>';
html += '<td>'+list[i].batch+'</td>';
html += '<td><a class="btn btn-danger btn-xs remove-goods">删除</a></td>'+
'</tr>';
cart_ids.push(list[i].cart_id); // 购物车ID集合
}
$('.shop-lists').show();
$('.shop-table tbody').empty().append(html);
$('#sale_type').val(list[0].sale_type); // 自营线上订单选择销售类型
var address_id = $('.address_id').val();
orderConfirm(user_id, address_id, cart_ids, user_coupon_id); // 确认订单信息
// 自营商品检查数量
var changeGoods = [];
$('.shop-table tbody tr').each(function() {
var goods_id = $(this).find('.goods_id').text();
var num = Number($(this).find('.goods_num').val());
var mpl = Number($(this).find('.goods_mpl').text());
var cart_id = $(this).data('cid');
var type = $(this).data('type');
var curr_goods_type = $(this).data('goods_type');
var self_goods_type = ['3', '4']; // 自营商品类型
// 自营商品 且 数量与倍数不匹配
if (self_goods_type.indexOf(curr_goods_type) != -1 && num % mpl != 0) {
num = Math.ceil(num / mpl) * mpl;
$.ajax({
type: "POST",
url: '/ajax/changeNum',
data: {uid: user_id, num: num, cart_id: cart_id, type: type},
dataType: "json",
async: false,
success: function(resp){
if (resp.errcode == 0) {
changeGoods.push(goods_id);
}
},
})
}
})
if (changeGoods.length > 0) {
layer.alert('已按倍数调整购买数量,商品ID:'+changeGoods.join(', '));
self.lists(user_id, delivery_place); // 加载购物车列表
}
// 赠品信息
if (cart_gift.err_code == 0) {
var gift_len = cart_gift.data.length;
var gift_data = cart_gift.data;
var str = '';
for (var i = 0; i < gift_len; i++) {
str += '<tr>\
<td>'+gift_data[i].activity_id+'</td>\
<td>\
<div class="layer-photos-demo">\
<a><img src="'+gift_data[i].pic+'" width="20" height="20"></a>\
</div>\
</td>\
<td>'+gift_data[i].item_name+'</td>\
<td>'+gift_data[i].num+'</td>\
<td>'+gift_data[i].content+'</td>\
</tr>';
}
$('.gift-table tbody').empty().append(str);
$('.order-gift-info').show();
} else {
$('.order-gift-info').hide();
}
return false;
}
layer.msg(resp.errmsg || '网络异常');
$('.shop-lists').hide();
$('.order-info').hide();
},
});
}
// 选择优惠券
$('#user_coupon').change(function(){
var coupon_id = $(this).val();
var address_id = $('.address_id').val();
var user_id = $('.user_id').val();
if (coupon_id) {
$('.user_coupon_id').val(coupon_id);
} else {
$('.user_coupon_id').val('');
}
orderConfirm(user_id, address_id, cart_ids, coupon_id); // 确认订单信息
})
// 确认订单信息
function orderConfirm(user_id, address_id, cart_ids, user_coupon_id)
{
var zy_delivery_type = $('.zy_delivery_type').val() ? $('.zy_delivery_type').val() : 1; // 发货方式
$.ajax({
type: 'post',
url: '/ajax/confirm',
data: {uid: user_id, address_id: address_id, cart_ids: cart_ids, user_coupon_id: user_coupon_id, zy_delivery_type: zy_delivery_type},
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
var data = resp.data;
$('.order-info').show();
$('.goods_amount_val').empty().text(data.goods_total_format); // 商品总额
$('.order_amount').empty().text(data.order_amount_format); // 订单总额
if (!user_coupon_id) { // 若优惠券ID不存在,则推荐
$('.preferential_price').hide();
$('.preferential_price_val').empty();
getCoupon(user_id, cart_ids); // 获取最优的优惠券
} else {
$('.preferential_price').show();
$('.preferential_price_val').empty().text(data.preferential_price_format);
}
var list = resp.data.list;
var is_dgk = false;
for (var i = 0; i < list.length; i++) {
if (list[i].supplier_id == '7' || list[i].supplier_name.toLowerCase() == 'digikey') {
is_dgk = true;
}
}
if (is_dgk) {
$('.client-info').css('display', 'block');
// 若已选择发票,再次触发发票事件,添加终端信息
if ($('.tax_id').val()) {
$('#invoice').trigger('change');
}
} else {
$('.client-info').css('display', 'none');
}
if (data.extend_fee) {
$('.extend_fee').show();
$('.extend_fee_val').empty().text(data.extend_fee_format); // 附加费
}
$('.express_fee_val').empty().text(data.finally_shipping_price_format); // 订单合并后,如果存在运费则需要展示
return false;
} else {
$('.client-info').css('display', 'none'); // 隐藏终端信息
}
layer.msg(resp.errmsg || '网络异常');
}
})
}
// 可用优惠券
function getCoupon(user_id, cart_ids)
{
$.ajax({
type: 'post',
url: '/ajax/getCoupon',
data: {uid : user_id, cart_ids : cart_ids},
dataType: "json",
success: function(resp){
if (resp.errcode == 0) {
var data = resp.data;
var str = '<option value="">请选择</option>';
if (data.user_coupon_id != null) {
layer.msg(resp.errmsg);
str += '<option value="'+data.user_coupon_id+'">'+data.coupon_name+'</option>';
$('#user_coupon').attr('data-amount', data.sale_amount); // 优惠券金额
$('#user_coupon').empty().append(str);
return false;
} else {
$('#user_coupon').empty().append(str);
}
return false;
}
// layer.msg(resp.errmsg || '网络异常');
}
})
}
})
\ No newline at end of file
......@@ -9,6 +9,7 @@
<link href="/js/layui/css/layui.css" rel="stylesheet">
<link href="/css/admin.css" rel="stylesheet">
<link href="/css/detail.css" rel="stylesheet">
@include('table.css')
<script src="/js/jquery-2.2.1.js"></script>
......@@ -40,7 +41,7 @@
@include('table.js')
<script src="/js/layui/layui.js"></script>
<script src="/js/web/common.js"></script>
<script src="/js/add_order.js"></script>
<script src="/js/add_order.js?v=<?= time() ?>"></script>
</body>
<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">发货方式:</label>
<div class="layui-input-inline">
<select name="zy_delivery_type" class="zy_delivery_type" lay-verify="required">
<option value=""></option>
<option value="1">现货发货</option>
<option value="2">拼单发货</option>
</select>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">销售组织:</label>
<div class="layui-input-inline">
<select name="com_id" class="com_id" lay-verify="required" lay-filter="com_id">
<option value=""></option>
@if ($company)
@foreach ($company as $k=>$v)
<option value="{{ $k }}" currency="{{ $v['com_currency'] }}">{{ $v['com_name'] }}</option>
@endforeach
@endif
</select>
</div>
<div class="layui-form-mid layui-word-aux">
<span class="currency-section hide"> 币别:<span class="currency-sign"></span></span>
</div>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">交货地:</label>
<div class="layui-input-inline layui-form" lay-filter="delivery_place">
<select name="delivery_place" class="delivery_place" disabled>
<option value=""></option>
<option value="1">大陆</option>
<option value="2">香港</option>
</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">收货方式:</label>
<div class="layui-input-block">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="2" title="快递上门">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="3" title="自提">
</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">收货地址:</label>
<div class="layui-input-inline">
<select name="address" class="address" lay-verify="required">
<option value=""></option>
</select>
</div>
<a class="layui-btn add-address">添加地址</a>
</div>
</div>
</div>
<div class="address-section">
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">联系人:</label>
<span class="address-consignee"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">联系电话:</label>
<span class="address-mobile"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">收货地址:</label>
<span class="address-detail"></span>
</div>
</div>
</div>
</div>
\ No newline at end of file
<style type="text/css">
.addOrder .layui-colla-title{ margin-top: 0px; margin-bottom: 0px; }
.invoice-section{ border: 1px solid #ccc; }
.invoice-section label{ width: 110px; }
.invoice-section span{ line-height: 35px; }
.addOrder .layui-form-item{ margin-bottom: 0px; }
.addOrder label{ width: 110px; }
.addOrder span{ line-height: 35px; }
.invoice-section, .address-section{ border: 1px solid #ccc; }
.invoice-section-2, .invoice-section-3, .invoice-section-4{ display: none; }
</style>
<input type="hidden" name="user_id" class="user_id" value="">
<div class="layui-collapse addOrder">
<form class="layui-form layui-box quoteForm" method="post">
<div class="layui-colla-item">
<h2 class="layui-colla-title">客户信息</h2>
<div class="layui-colla-content layui-show">
<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">开票方式:</label>
<div class="layui-input-block">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="2" title="个人">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="3" title="增值税专用发票">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="4" title="增值税普通发票">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="" title="不开发票">
</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">发票/公司:</label>
<div class="layui-input-inline">
<input type="text" name="com_name" required lay-verify="" placeholder="请输入公司" autocomplete="off" class="layui-input">
</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">联系方式:</label>
<div class="layui-input-inline">
<input type="text" name="account" required lay-verify="required" placeholder="请输入联系方式" autocomplete="off" class="layui-input account">
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label">联系人:</label>
<div class="layui-input-inline">
<input type="text" name="user_name" required lay-verify="" placeholder="请输入联系人" autocomplete="off" class="layui-input">
</div>
</div>
</div>
</div>
<!-- 与开票方式联动展示 -->
<div class="invoice-section">
<!-- 个人 -->
<div class="invoice-section-2">
</div>
<!-- 增值税专用发票展示信息 -->
<div class="invoice-section-3">
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">发票抬头:</label>
<span>xxxxxx</span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">开户银行:</label>
<span>xxxxxx</span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">收票人:</label>
<span>xxxxxx</span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">税务登记号:</label>
<span>xxxxxx</span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">银行卡号:</label>
<span>xxxxxx</span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">发票联系电话:</label>
<span>xxxxxx</span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">公司电话:</label>
<span>xxxxxx</span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">公司注册地址:</label>
<span>xxxxxx</span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">收票地址:</label>
<span>xxxxxx</span>
</div>
</div>
</div>
</div>
<!-- 增值税普通发票展示信息 -->
<div class="invoice-section-4">
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">发票抬头:</label>
<span>xxxxxx</span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">税务登记号:</label>
<span>xxxxxx</span>
</div>
</div>
</div>
</div>
</div>
@include('addOrder.userInfo')
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">收货信息</h2>
<div class="layui-colla-content layui-show">
<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">发货方式:</label>
<div class="layui-input-inline">
<select name="zy_delivery_type" class="zy_delivery_type" lay-verify="required">
<option value=""></option>
<option value="1">现货发货</option>
<option value="2">拼单发货</option>
</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">销售组织:</label>
<div class="layui-input-inline">
<select name="city" lay-verify="required">
<option value=""></option>
<option value="1">现货发货</option>
<option value="2">拼单发货</option>
</select>
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label">交货地:</label>
<div class="layui-input-inline">
<select name="city" lay-verify="required">
<option value=""></option>
<option value="1">大陆</option>
<option value="2">香港</option>
</select>
</div>
</div>
</div>
</div>
@include('addOrder.addressInfo')
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">商品信息</h2>
<div class="layui-colla-content layui-show">
@include('addOrder.goodsInfo')
</div>
</div>
<div class="layui-colla-item order-gift-info">
<h2 class="layui-colla-title">赠品信息</h2>
<div class="layui-colla-content layui-show">
@include('addOrder.giftInfo')
</div>
</div>
<div class="layui-colla-item order-info1">
<h2 class="layui-colla-title">订单信息</h2>
<div class="layui-colla-content layui-show">
@include('addOrder.orderInfo')
</div>
</div>
</form>
......
<div class="layui-row">
<div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
<div class="layui-form-item">
<table class="layui-table gift-table">
<thead>
<tr>
<th width="10%">活动ID</th>
<th width="20%">赠品图片</th>
<th width="20%">赠品名称</th>
<th width="20%">赠品数量</th>
<th width="30%">赠品说明</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
<div class="layui-form-item">
<div class="layui-input-inline" style="width: 235px;">
<input type="text" name="sku_id" lay-verify="" placeholder="请输入SKUID" autocomplete="off" class="layui-input search-sku">
</div>
<a class="btn btn-info get-sku">获取SKU信息</a>
<span>快捷入口:
<a href="{{Config('website.add-sku-url')}}" target="_blank" style="margin-right: 10px;">+新增SKU</a>
<a href="{{Config('website.search-sku-url-1')}}" target="_blank" style="margin-right: 10px;">查询联营SKU</a>
<a href="{{Config('website.search-sku-url-2')}}" target="_blank">查询自营SKU</a>
</span>
<div class="batch-btn">
<a class="btn btn-success goods_import" data-type="1">批量导入物料</a>
<a class="btn btn-info" href="https://img.ichunt.com/doc/excel/template/%E8%81%94%E8%90%A5%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx">联营物料模板下载</a>
</div>
</div>
</div>
</div>
<!-- SKU信息 -->
<div class="sku-info" style="margin-top: 10px;">
<div class="sku-info-left">
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">SKU型号:</label>
<span class="goods_name"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">制造商:</label>
<span class="brand_name"></span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">供应商:</label>
<span class="supplier_name"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">库存数量:</label>
<span class="stock"></span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">起订量:</label>
<span class="moq"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">标准包装量:</label>
<span class="mpq"></span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">是否能购买:</label>
<span class="status"></span>
</div>
</div>
</div>
</div>
<div class="sku-info-right">
<table class="layui-table ladder_price_table" style="margin: 0px;"></table>
</div>
<input type="hidden" name="goods_id" class="goods_id" value="">
<input type="hidden" name="goods_type" class="goods_type" value="">
<div class="clear"></div>
<a class="btn btn-success add-to-lists">添加至商品列表</a>
</div>
<!-- 商品列表 -->
<div class="carts-info">
<table id="list" lay-filter="list"></table>
<textarea name="remark" id="remark" class="layui-textarea" placeholder="填写订单备注信息"></textarea>
<script type="text/html" id="buyer_id">
@{{# if (d.buyer_id != 0) { }}
@{{ d.buyer_id }}
@{{# } }}
</script>
<script type="text/html" id="list_action">
<a class="btn btn-xs btn-danger" lay-event="del">删除</a>
</script>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">商品总额:</label>
<span class="goods_amount_val"></span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<input type="hidden" class="user_coupon_id" name="user_coupon_id" value="">
<label class="layui-form-label">选择优惠券:</label>
<div class="layui-input-inline">
<select name="user_coupon" id="user_coupon">
<option value="">请选择</option>
</select>
</div>
</div>
</div>
</div>
<div class="layui-row preferential_price">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">优惠金额:</label>
<span class="preferential_price_val"></span>
</div>
</div>
</div>
<div class="layui-row extend_fee">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">附加费:</label>
<span class="extend_fee_val">0.00</span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">运费:</label>
<span class="express_fee_val">0.00</span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">应付金额:</label>
<span class="text-danger order_amount">0.00</span>
</div>
</div>
</div>
<div class="ibox-title" style="text-align: right;">
<a class="btn btn-success submit-order" data-type="1">提交</a>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item">
<input type="hidden" name="tax_id" class="tax_id" value="">
<label class="layui-form-label">开票方式:</label>
<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="invoice_type" value="4" title="增值税普通发票">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="" title="不开发票">
<input type="radio" class="radio-invoice-type" name="invoice_type" value="2" title="个人">
</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">发票/公司:</label>
<div class="layui-input-inline">
<input type="text" name="com_name" required lay-verify="" placeholder="请输入公司" autocomplete="off" class="layui-input com_name">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">联系方式:</label>
<div class="layui-input-inline">
<input type="text" name="account" required lay-verify="required" placeholder="请输入联系方式" autocomplete="off" class="layui-input account">
</div>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">联系人:</label>
<div class="layui-input-inline">
<input type="text" name="user_name" required lay-verify="" placeholder="请输入联系人" autocomplete="off" class="layui-input">
</div>
</div>
</div>
</div>
<!-- 与开票方式联动展示 -->
<div class="invoice-section">
<!-- 个人 -->
<div class="invoice-section-2" style="margin-top: 10px;">
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">选择个人发票:</label>
<div class="layui-input-inline layui-form" lay-filter="user-tax">
<select name="user_tax_id" id="user_tax_id">
</select>
</div>
</div>
</div>
</div>
</div>
<!-- 增值税专用发票展示信息 -->
<div class="invoice-section-3">
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">发票抬头:</label>
<span class="tax_title"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">开户银行:</label>
<span class="com_bank"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">收票人:</label>
<span class="consignee"></span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">税务登记号:</label>
<span class="tax_no"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">银行卡号:</label>
<span class="com_bank_num"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">发票联系电话:</label>
<span class="consignee_phone"></span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">公司电话:</label>
<span class="com_tel"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">公司注册地址:</label>
<span class="com_addr"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">收票地址:</label>
<span class="consignee_address"></span>
</div>
</div>
</div>
</div>
<!-- 增值税普通发票展示信息 -->
<div class="invoice-section-4">
<div class="layui-row">
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">发票抬头:</label>
<span class="tax_title"></span>
</div>
</div>
<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">税务登记号:</label>
<span class="tax_no"></span>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
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