Commit eb38f091 by 朱继来

调整订单

parent dabd08a0
......@@ -61,6 +61,7 @@ Class AddOrderController extends Controller
$info = $this->getPageInfo($request);
$info['title'] = '新增联营订单';
$info['sale_id'] = $request->user->userId;
$crm_user_id = $request->input('user_id', 0);
$info['crm_account'] = '';
......@@ -76,11 +77,38 @@ Class AddOrderController extends Controller
$info['api_dgk_url'] = ($url.'?k1='.$data['k1']."&".'k2='.$data['k2']);
// $info['company'] = (new CmsModel())->getCompany(); // 获取公司组织
$info['report_ids'] = $request->input('report_ids', ''); // 询价系统销售报价ID
// $info['report_ids'] = $request->input('report_ids', ''); // 询价系统销售报价ID
return view('addOrder', $info);
}
// 新增询价订单
public function addInquiryOrder(Request $request)
{
$info = $this->getPageInfo($request);
$info['title'] = '新增联营订单';
$crm_user_id = $request->input('user_id', 0);
$info['crm_account'] = '';
if ($crm_user_id) {
$UserMainModel = new UserMainModel();
$user_info = $UserMainModel->find($crm_user_id);
$info['crm_account'] = $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'];
}
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$url = Config('website.api_domain').'cart/getDJKConfg';
$info['dgk_info'] = json_decode(curlApi($url.'?k1='.$data['k1']."&".'k2='.$data['k2']), true);
// $info['company'] = (new CmsModel())->getCompany(); // 获取公司组织
$info['report_ids'] = $request->input('report_ids', ''); // 询价系统销售报价ID
return view('addInquiryOrder', $info);
}
// 新增自营线上订单
public function addOnline(Request $request)
{
......@@ -386,9 +414,10 @@ Class AddOrderController extends Controller
public function cartList(Request $request)
{
if ($request->isMethod('post')) {
$data['uid'] = $request->input('uid');
// $data['type'] = $request->input('type');
$data['uid'] = $request->input('uid');
// $data['type'] = $request->input('type', 1);
$data['delivery_place'] = $request->input('delivery_place', 1);
$data['is_new'] = $request->input('is_new', 0);
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
......@@ -396,15 +425,17 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/listsByOrderSystem';
$response = json_decode(curlApi($url, $data), true);
if ($data['is_new']) { // 新版下单页面,layui格式返回
$data = isset($response['data']['list']) ? $response['data']['list'] : [];
return ['code'=>$response['err_code'], 'msg'=>$response['err_msg'], 'data'=>$data, 'count'=>count($data)];
}
// 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']];
}
$data = isset($response['data']['list']) ? $response['data']['list'] : [];
return ['code'=>$response['err_code'], 'msg'=>$response['err_msg'], 'data'=>$data, 'count'=>count($data)];
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
}
}
......@@ -505,9 +536,9 @@ Class AddOrderController extends Controller
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']];
}
}
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
}
}
......@@ -573,7 +604,7 @@ Class AddOrderController extends Controller
$data['remark'] = $request->input('remark');
$data['com_id'] = $request->input('com_id', 0);
$data['com_name'] = $request->input('com_name', '');
$data['shipping_type'] = $request->input('shipping_type', 0);
$data['shipping_type'] = $request->input('shipping_type', 1);
if ($data['type'] == 3) { // 自营线下订单
$data['address_name'] = $request->input('address_name');
......@@ -609,9 +640,10 @@ Class AddOrderController extends Controller
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>['order_id' => $response['data'], 'type' => $data['type']]];
} else {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
}
}
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
}
}
......
......@@ -90,6 +90,7 @@ Route::group(['middleware' => 'web'], function () {
Route::post('/ajax/orderServiceApply', 'OrderController@orderServiceApply');
Route::get('/add_order', 'AddOrderController@addOrder');
Route::get('/add_inquiry_order', 'AddOrderController@addInquiryOrder');
Route::post('/ajax/getUserInfo', 'AddOrderController@getUserInfo');
Route::post('/ajax/selectAddr', 'AddOrderController@selectAddr');
Route::post('/ajax/selectInv', 'AddOrderController@selectInv');
......
This diff could not be displayed because it is too large.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单管理后台 | {{ $title }}</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
<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>
@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_inquiry_order.js?v=<?= time() ?>"></script>
</head>
<body class="body-small">
<div id="wrapper">
<!-- layouts.navigation -->
@include('layouts.navigation')
<div id="page-wrapper" class="gray-bg">
<div class="row">
<div class="wrapper">
@include('layouts.header')
<div class="page-content" style="margin-top: 10px;">
<div class="ibox float-e-margins">
<div class="ibox-content">
@include('addInquiryOrder.content')
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<style type="text/css">
.addInquiryOrder .layui-colla-title{ margin-top: 0px; margin-bottom: 0px; }
.addInquiryOrder .layui-form-item{ margin-bottom: 0px; }
.addInquiryOrder label{ width: 110px; }
.addInquiryOrder span{ line-height: 37px; }
</style>
<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 addInquiryOrder">
<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">
@include('addInquiryOrder.userInfo')
</div>
</div>
<div class="layui-colla-item address-info">
<h2 class="layui-colla-title">收货信息</h2>
<div class="layui-colla-content layui-show">
@include('addInquiryOrder.addressInfo')
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">商品信息</h2>
<div class="layui-colla-content layui-show">
@include('addInquiryOrder.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('addInquiryOrder.giftInfo')
</div>
</div>
<div class="layui-colla-item client-info">
<h2 class="layui-colla-title">终端客户信息</h2>
<div class="layui-colla-content layui-show">
@include('addInquiryOrder.dgkInfo')
</div>
</div>
<div class="layui-colla-item order-info">
<h2 class="layui-colla-title">订单信息</h2>
<div class="layui-colla-content layui-show">
@include('addInquiryOrder.orderInfo')
</div>
</div>
</form>
</div>
<script>
var report_ids = "{{ $report_ids }}";
console.log(report_ids)
</script>
\ No newline at end of file
......@@ -15,7 +15,7 @@
<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">
<select class="customer_type" name="customer_type">
<option value="">请选择</option>
@if (Config('params.end_user_type'))
@foreach (Config('params.end_user_type') as $k => $v)
......@@ -45,12 +45,17 @@
<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">
<select class="product_use_classone_sn" name="product_use_classone_sn" lay-filter="product_use_classone_sn">
<option value="">请选择</option>
@if (!empty($dgk_info['data']['data']))
@foreach ($dgk_info['data']['data'] as $k=>$v)
<option value="{{$k}}">{{$k}}</option>
@endforeach
@endif
</select>
</div>
<div class="layui-input-inline">
<select class="form-control product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
<div class="layui-input-inline layui-form" lay-filter="product_use_classtwo_sn">
<select class="product_use_classtwo_sn" name="product_use_classtwo_sn"></select>
</div>
</div>
</div>
......@@ -68,33 +73,6 @@
</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>')
}
}
}
})
var dgk_info = eval('('+ '<?php echo json_encode($dgk_info['data']['data']); ?>' +')');
</script>
......@@ -7,16 +7,8 @@
<title>订单管理后台 | {{ $title }}</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
<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>
@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>
@include('addOffline.css')
@include('addOffline.js')
</head>
<body class="body-small">
......@@ -29,20 +21,15 @@
<div class="wrapper">
@include('layouts.header')
<div class="page-content" style="margin-top: 10px;">
<div class="page-content">
<div class="ibox float-e-margins">
<div class="ibox-content">
@include('addOrder.content')
</div>
@include('addOrder.content')
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
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