Commit f63c96f0 by 朱继来

Merge branch 'zjl_adjust_20180925' into development

parents 64ff8254 c3e5b51b
...@@ -317,8 +317,12 @@ Class AddOrderController extends Controller ...@@ -317,8 +317,12 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/addByOrderSystem'; $url = Config('website.api_domain').'cart/addByOrderSystem';
$response = json_decode(curlApi($url, $data), true); $response = json_decode(curlApi($url, $data), true);
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['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']];
}
} }
} }
......
...@@ -608,6 +608,7 @@ Class OrderController extends Controller ...@@ -608,6 +608,7 @@ Class OrderController extends Controller
array('create_time_sec', '下单时间'), array('create_time_sec', '下单时间'),
array('com_name', '公司名称'), array('com_name', '公司名称'),
array('goods_name', '商品型号'), array('goods_name', '商品型号'),
array('supplier_name', '制造商'),
array('goods_number', '数量'), array('goods_number', '数量'),
array('goods_price', '单价'), array('goods_price', '单价'),
array('goods_amount', '商品小计'), array('goods_amount', '商品小计'),
...@@ -622,7 +623,6 @@ Class OrderController extends Controller ...@@ -622,7 +623,6 @@ Class OrderController extends Controller
array('shipping_status','发货状态'), array('shipping_status','发货状态'),
array('inv_type', '发票类型'), array('inv_type', '发票类型'),
array('invoice_status', '发票状态'), array('invoice_status', '发票状态'),
array('company_name', '供应商'),
array('sale_name', $sale_name), array('sale_name', $sale_name),
array('adtags', 'adtags来源'), array('adtags', 'adtags来源'),
array('client_source', '新用户来源'), array('client_source', '新用户来源'),
...@@ -771,7 +771,7 @@ Class OrderController extends Controller ...@@ -771,7 +771,7 @@ Class OrderController extends Controller
}) })
->where('it.status', '<>', -1) ->where('it.status', '<>', -1)
->where('o.order_goods_type', '=', $map['order_goods_type']) ->where('o.order_goods_type', '=', $map['order_goods_type'])
->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_pay_type', 'o.order_goods_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.inv_type', 'i.invoice_status', 'a.consignee', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'c.com_name', 'oe.send_remark') ->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_pay_type', 'o.order_goods_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.tax_title', 'i.inv_type', 'i.invoice_status', 'a.consignee', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'c.com_name', 'oe.send_remark')
->groupBy('it.rec_id') ->groupBy('it.rec_id')
->orderBy('o.create_time', 'DESC') ->orderBy('o.create_time', 'DESC')
->get(); ->get();
...@@ -874,6 +874,7 @@ Class OrderController extends Controller ...@@ -874,6 +874,7 @@ Class OrderController extends Controller
$tmp[$i]['create_time_date'] = ''; $tmp[$i]['create_time_date'] = '';
$tmp[$i]['create_time_sec'] = ''; $tmp[$i]['create_time_sec'] = '';
$tmp[$i]['com_name'] = ''; $tmp[$i]['com_name'] = '';
$tmp[$i]['supplier_name'] = '';
$tmp[$i]['goods_sum'] = ''; $tmp[$i]['goods_sum'] = '';
$tmp[$i]['shipping_fee'] = ''; $tmp[$i]['shipping_fee'] = '';
$tmp[$i]['extra_fee'] = ''; $tmp[$i]['extra_fee'] = '';
...@@ -885,7 +886,6 @@ Class OrderController extends Controller ...@@ -885,7 +886,6 @@ Class OrderController extends Controller
$tmp[$i]['shipping_status'] = ''; // 发货状态 $tmp[$i]['shipping_status'] = ''; // 发货状态
$tmp[$i]['inv_type'] = ''; // 发票类型 $tmp[$i]['inv_type'] = ''; // 发票类型
$tmp[$i]['invoice_status'] = ''; // 发票状态 $tmp[$i]['invoice_status'] = ''; // 发票状态
$tmp[$i]['company_name'] = '';
$tmp[$i]['sale_name'] = ''; // 推送业务员 $tmp[$i]['sale_name'] = ''; // 推送业务员
$tmp[$i]['adtags'] = ''; $tmp[$i]['adtags'] = '';
$tmp[$i]['client_source'] = ''; $tmp[$i]['client_source'] = '';
...@@ -897,7 +897,8 @@ Class OrderController extends Controller ...@@ -897,7 +897,8 @@ Class OrderController extends Controller
$tmp[$i]['consignee'] = isset($order[$i]->consignee) ? $order[$i]->consignee : ''; $tmp[$i]['consignee'] = isset($order[$i]->consignee) ? $order[$i]->consignee : '';
$tmp[$i]['create_time_date'] = date('Y-m-d', $order[$i]->create_time); $tmp[$i]['create_time_date'] = date('Y-m-d', $order[$i]->create_time);
$tmp[$i]['create_time_sec'] = date('H:i:s', $order[$i]->create_time); $tmp[$i]['create_time_sec'] = date('H:i:s', $order[$i]->create_time);
$tmp[$i]['com_name'] = isset($order[$i]->com_name) ? $order[$i]->com_name : ''; $tmp[$i]['com_name'] = isset($order[$i]->tax_title) ? $order[$i]->tax_title : '';
$tmp[$i]['supplier_name'] = $order[$i]->supplier_name;
$tmp[$i]['goods_sum'] = $this->getOrderPrice($order[$i]->order_id, 1); $tmp[$i]['goods_sum'] = $this->getOrderPrice($order[$i]->order_id, 1);
$tmp[$i]['shipping_fee'] = $this->getOrderPrice($order[$i]->order_id, 3); $tmp[$i]['shipping_fee'] = $this->getOrderPrice($order[$i]->order_id, 3);
$tmp[$i]['extra_fee'] = $this->getOrderPrice($order[$i]->order_id, 2); $tmp[$i]['extra_fee'] = $this->getOrderPrice($order[$i]->order_id, 2);
...@@ -909,7 +910,6 @@ Class OrderController extends Controller ...@@ -909,7 +910,6 @@ Class OrderController extends Controller
$tmp[$i]['shipping_status'] = !empty($order[$i]->shipping_status) ? $shipping_status[$order[$i]->shipping_status] : '无发货信息'; // 发货状态 $tmp[$i]['shipping_status'] = !empty($order[$i]->shipping_status) ? $shipping_status[$order[$i]->shipping_status] : '无发货信息'; // 发货状态
$tmp[$i]['inv_type'] = $order[$i]->inv_type ? $inv_type[$order[$i]->inv_type] : '未知'; // 发票类型 $tmp[$i]['inv_type'] = $order[$i]->inv_type ? $inv_type[$order[$i]->inv_type] : '未知'; // 发票类型
$tmp[$i]['invoice_status'] = !empty($order[$i]->invoice_status) ? $invoice_status[$order[$i]->invoice_status] : '无发票信息'; // 发票状态 $tmp[$i]['invoice_status'] = !empty($order[$i]->invoice_status) ? $invoice_status[$order[$i]->invoice_status] : '无发票信息'; // 发票状态
$tmp[$i]['company_name'] = $order[$i]->supplier_name;
$tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员 $tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员
$tmp[$i]['adtags'] = $order[$i]->order_source; $tmp[$i]['adtags'] = $order[$i]->order_source;
$tmp[$i]['client_source'] = $order[$i]->client_source; $tmp[$i]['client_source'] = $order[$i]->client_source;
...@@ -1906,6 +1906,7 @@ Class OrderController extends Controller ...@@ -1906,6 +1906,7 @@ Class OrderController extends Controller
$order = DB::connection('order') $order = DB::connection('order')
->table('lie_order') ->table('lie_order')
->where('order_goods_type', '=', 1) ->where('order_goods_type', '=', 1)
->where('order_pay_type', '<>', 3) // 过滤账期订单
->where('status', '=', 2) ->where('status', '=', 2)
// ->whereNotIn('user_id', $this->testMobile()) // ->whereNotIn('user_id', $this->testMobile())
->where('is_type', '=', 0) ->where('is_type', '=', 0)
......
...@@ -994,6 +994,9 @@ ...@@ -994,6 +994,9 @@
if (val == 2) { if (val == 2) {
$('.show-advance-pay').show(); $('.show-advance-pay').show();
} else if (val == 3) {
$('.show-advance-pay').hide();
$('.show-pay-time').hide();
} else { } else {
$('.show-advance-pay').hide(); $('.show-advance-pay').hide();
} }
...@@ -1294,28 +1297,31 @@ ...@@ -1294,28 +1297,31 @@
return false; return false;
} }
if (payTime == '') { // 非账期订单选择付款时间
layer.msg('请选择付款时间'); if (pay_type != 3) {
return false; if (payTime == '') {
} layer.msg('请选择付款时间');
if (payTime == 'other' && payTimeOther == '') {
layer.msg('请填写自定义时间');
return false;
}
if (payTimeOther) {
var reg = /\d/;
if (!reg.test(payTimeOther)) {
layer.msg('格式错误');
return false; return false;
} }
if (payTimeOther < 0 || payTimeOther > 30) { if (payTime == 'other' && payTimeOther == '') {
layer.msg('自定义时间限制在1-30天'); layer.msg('请填写自定义时间');
return false; return false;
} }
}
if (payTimeOther) {
var reg = /\d/;
if (!reg.test(payTimeOther)) {
layer.msg('格式错误');
return false;
}
if (payTimeOther < 0 || payTimeOther > 30) {
layer.msg('自定义时间限制在1-30天');
return false;
}
}
}
var currencySign = currency == 1 ? '¥' : '$'; var currencySign = currency == 1 ? '¥' : '$';
var goods_amount = currencySign+$('input[name=goods_amount]').val(); var goods_amount = currencySign+$('input[name=goods_amount]').val();
......
...@@ -161,6 +161,29 @@ ...@@ -161,6 +161,29 @@
nextTr.hide(); nextTr.hide();
} }
}) })
// 下载合同
$('.download-contract').click(function(){
var order_id = $(this).data('id');
$.ajax({
url: '/ajaxDownloadContract',
type: 'post',
data: {order_id:order_id},
dataType: 'json',
success: function(resp) {
if (resp.errcode != 0) {
layer.msg(resp.msg);
return false;
}
location.href = resp.data;
},
error: function(err) {
console.log(err)
}
})
})
} }
} }
}); });
......
...@@ -210,26 +210,28 @@ ...@@ -210,26 +210,28 @@
</table> </table>
</div> </div>
<p>付款时间</p> <div class="show-pay-time">
<table class="table table-bordered table-hover"> <p>付款时间</p>
<tr> <table class="table table-bordered table-hover change-table">
<th width="20%">选择付款时间</th> <tr>
<td> <th>选择付款时间</th>
<select name="payTime" class="payTime"> <td>
<option value="">请选择</option> <select name="payTime" class="payTime">
<option value="1">1天</option> <option value="">请选择</option>
<option value="3">3天</option> <option value="1">1天</option>
<option value="7">7天</option> <option value="3">3天</option>
<option value="15">15天</option> <option value="7">7天</option>
<option value="other">其他</option> <option value="15">15天</option>
</select> <option value="other">其他</option>
</select>
<div class="customArea">
<input type="text" name="payTimeOther" class="payTimeOther" value="" style="width: 50px;">&nbsp;<span class="error">(自定义天数,限制1~30)</span> <div class="customArea">
</div> <input type="text" name="payTimeOther" class="payTimeOther" value="" style="width: 50px;">&nbsp;<span class="error">(自定义天数,限制1~30)</span>
</td> </div>
</tr> </td>
</table> </tr>
</table>
</div>
@if ($order_info['status'] == 1 && $order_temp_info['status'] == 1) @if ($order_info['status'] == 1 && $order_temp_info['status'] == 1)
<a class="btn btn-primary checkAdjusted">查看调价信息</a> <a class="btn btn-primary checkAdjusted">查看调价信息</a>
...@@ -253,6 +255,8 @@ ...@@ -253,6 +255,8 @@
@endif @endif
</div> </div>
<!-- 非账期订单显示剩余时间 -->
@if ($order_info['order_pay_type'] != 3)
<div class="checked_right"> <div class="checked_right">
<p class="showtime"> <p class="showtime">
<span class="error">剩余付款时间:</span> <span class="error">剩余付款时间:</span>
...@@ -281,6 +285,7 @@ ...@@ -281,6 +285,7 @@
<button class="btn btn-info btn-xs delay_confirm">确认</button> <button class="btn btn-info btn-xs delay_confirm">确认</button>
</div> </div>
</div> </div>
@endif
</div> </div>
@endif @endif
......
...@@ -240,7 +240,11 @@ ...@@ -240,7 +240,11 @@
<td class="show-list">{{$username != 'vpadmin@ichunt.com' ? date('Y-m-d H:i:s', $v['create_time']) : date('Y-m-d', $v['create_time'])}}</td> <td class="show-list">{{$username != 'vpadmin@ichunt.com' ? date('Y-m-d H:i:s', $v['create_time']) : date('Y-m-d', $v['create_time'])}}</td>
<td> <td>
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs">
<a class="btn btn-primary" href="/details/{{$v['order_id']}}?tags=self" target="_blank">详情</a> <a class="btn btn-primary" href="/details/{{$v['order_id']}}?tags=self" target="_blank">详情</a>
@if (in_array('download_contract', $userPerms))
<a class="btn btn-default download-contract" data-id="{{$v['order_id']}}" href="javascript:;">下载合同</a>
@endif
</div> </div>
</td> </td>
</tr> </tr>
......
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