Commit 9eb7c32f by 朱继来

Merge branch 'zjl_inquiry_20210519'

parents 5f5a1781 c271506e
...@@ -711,12 +711,26 @@ Class AddOrderController extends Controller ...@@ -711,12 +711,26 @@ Class AddOrderController extends Controller
// dd(curlApi($url, $data)); // 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) return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>['order_id' => $response['data'], 'type' => $data['type']]];
// 若存在销售报价明细ID,则修改对应报价单状态为已成单
$report_ids = $request->input('report_ids', '');
if ($report_ids) {
$ids = explode(',', $report_ids);
foreach ($ids as $v) {
$res = DB::connection('frq')->table('inquiry_items_report')->where('id', $v)->select('quote_id', 'inquiry_items_id')->first();
if ($res->quote_id) {
DB::connection('frq')->table('quote')->where('id', $res->quote_id)->update(['status'=>4, 'update_time'=>time()]);
}
DB::connection('frq')->table('inquiry_items')->where('id', $res->inquiry_items_id)->update(['status'=>10, 'update_time'=>time()]);
}
} }
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']]; return ['errcode'=>$response['err_code'], 'errmsg'=>$response['err_msg'], 'data'=>['order_id'=>$response['data'], 'type'=>$data['type']]];
} }
} }
......
...@@ -710,6 +710,7 @@ class ApiController extends Controller ...@@ -710,6 +710,7 @@ class ApiController extends Controller
$data['type'] = 4; // 批量导入销售报价 $data['type'] = 4; // 批量导入销售报价
$data['uid'] = $user_id; $data['uid'] = $user_id;
$data['delivery_place'] = $delivery_place; $data['delivery_place'] = $delivery_place;
$data['pf'] = 8; // 询价系统标记
$url = Config('website.api_domain').'cart/addBatchByOrderSystem'; $url = Config('website.api_domain').'cart/addBatchByOrderSystem';
......
...@@ -184,33 +184,33 @@ function getGoodsName($goods_id) ...@@ -184,33 +184,33 @@ function getGoodsName($goods_id)
function getOrderSource($order_id, $order_type=1, $order_goods_type=1) function getOrderSource($order_id, $order_type=1, $order_goods_type=1)
{ {
if ($order_type == 1) { if ($order_type == 1) {
$order = DB::connection('order')->table('lie_order_extend')->where('order_id', $order_id)->select('order_type')->first(); $order_source = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->value('order_source');
if ($order) {
switch ($order->order_type) {
case 1:
case 2:
case 3:
return '后台';
}
}
$order_source = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->select('order_source')->first();
if (preg_match('/pf=1/', $order_source->order_source)) { if (preg_match('/pf=1/', $order_source)) {
$source = 'PC端'; $source = 'PC端';
} else if (preg_match('/pf=2/', $order_source->order_source)) { } else if (preg_match('/pf=2/', $order_source)) {
$source = '移动端'; $source = '移动端';
} else if (preg_match('/pf=6/', $order_source->order_source)) { } else if (preg_match('/pf=6/', $order_source)) {
$source = '小程序'; $source = '小程序';
} else if (preg_match('/pf=8/', $order_source->order_source)) { } else if (preg_match('/pf=8/', $order_source)) {
$source = '询报价平台'; $source = '询报价平台';
} else if (preg_match('/pf=9/', $order_source->order_source)) { } else if (preg_match('/pf=9/', $order_source)) {
$source = '云芯平台'; $source = '云芯平台';
} else { } else {
$source = '台'; $source = '台';
} }
// $order = DB::connection('order')->table('lie_order_extend')->where('order_id', $order_id)->select('order_type')->first();
// if ($order) {
// switch ($order->order_type) {
// case 1:
// case 2:
// case 3:
// return '后台';
// }
// }
return $source; return $source;
} else if ($order_type == 2) { } else if ($order_type == 2) {
return 'ERP'; return 'ERP';
......
...@@ -759,6 +759,7 @@ layui.config({ ...@@ -759,6 +759,7 @@ layui.config({
remark: remark, remark: remark,
user_coupon_id: user_coupon_id, user_coupon_id: user_coupon_id,
cart_ids: cart_ids, cart_ids: cart_ids,
report_ids: report_ids, // 询价明细ID
} }
// if (is_dgk) { // 联营包含digikey商品,则填写终端资料 // if (is_dgk) { // 联营包含digikey商品,则填写终端资料
...@@ -868,14 +869,14 @@ layui.config({ ...@@ -868,14 +869,14 @@ layui.config({
,cols: [[ //表头 ,cols: [[ //表头
{title: '序号', type: 'numbers', fixed: 'left', width: 50} {title: '序号', type: 'numbers', fixed: 'left', width: 50}
,{field: 'goods_id', title: 'SKUID'} ,{field: 'goods_id', title: 'SKUID'}
,{field: 'goods_name', title: '商品名称'} ,{field: 'goods_name', title: '商品名称', minWidth: 100}
,{field: 'brand_name', title: '制造商'} ,{field: 'brand_name', title: '制造商'}
,{field: 'supplier_name', title: '供应商'} ,{field: 'supplier_name', title: '供应商'}
,{field: 'goods_number', title: '采购数量', edit: 'text', style: 'cursor: pointer;'} ,{field: 'goods_number', title: '采购数量', edit: 'text', style: 'cursor: pointer;'}
,{field: 'goods_price', title: '采购单价', edit: 'text', style: 'cursor: pointer;'} ,{field: 'goods_price', title: '采购单价', edit: 'text', style: 'cursor: pointer;'}
,{field: 'goods_amount_format', title: '小计'} ,{field: 'goods_amount_format', title: '小计'}
,{field: 'delivery_time', title: '货期', edit: 'text', style: 'cursor: pointer;'} ,{field: 'delivery_time', title: '货期', edit: 'text', style: 'cursor: pointer;'}
,{field: 'buyer_id', title: '采购员', templet: '#t_buyer_id', style: 'overflow: visible;'} ,{field: 'buyer_id', title: '采购员', templet: '#t_buyer_id'}
,{field: 'batch', title: '批次', edit: 'text', style: 'cursor: pointer;'} ,{field: 'batch', title: '批次', edit: 'text', style: 'cursor: pointer;'}
,{title: '操作', align:'center', fixed: 'right', toolbar: '#list_action', width: 80} ,{title: '操作', align:'center', fixed: 'right', toolbar: '#list_action', width: 80}
]] ]]
...@@ -890,6 +891,7 @@ layui.config({ ...@@ -890,6 +891,7 @@ layui.config({
$('.carts-info').show(); // 显示商品table $('.carts-info').show(); // 显示商品table
$(".layui-table-body, .layui-table-box").css('overflow', 'visible'); // 下拉显示 $(".layui-table-body, .layui-table-box").css('overflow', 'visible'); // 下拉显示
$('.buyer_id').parent('.layui-table-cell').css('overflow', 'visible');
cart_ids = []; cart_ids = [];
...@@ -912,7 +914,7 @@ layui.config({ ...@@ -912,7 +914,7 @@ layui.config({
//下拉框监听事件 //下拉框监听事件
form.on('select(buyer_id)', function(data) { form.on('select(buyer_id)', function(data) {
var cart_id = $('#buyer_id').data('cid'); var cart_id = $('.buyer_id').data('cid');
var value = data.value; var value = data.value;
var datax = { var datax = {
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<style> <style>
.carts-info{ display: none; } .carts-info{ display: none; }
.carts-info .laytable-cell-1-0-9{ overflow: visible; } /* 指定采购列 */ /*.carts-info .layui-table-cell{ overflow: visible; } */
</style> </style>
<!-- 商品列表 --> <!-- 商品列表 -->
<div class="carts-info"> <div class="carts-info">
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
} }
</style> </style>
<script type="text/html" id="t_buyer_id"> <script type="text/html" id="t_buyer_id">
<select name="buyer_id" id="buyer_id" lay-filter="buyer_id" data-cid="@{{ d.cart_id }}"> <select name="buyer_id" class="buyer_id" lay-filter="buyer_id" data-cid="@{{ d.cart_id }}">
@{{ d.buyerSelect }} @{{ d.buyerSelect }}
</select> </select>
</script> </script>
......
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