Commit aa97b375 by 朱继来

订单系统迭代(0917~0921)

parent bcee6243
......@@ -599,6 +599,7 @@ Class OrderController extends Controller
array('create_time_sec', '下单时间'),
array('com_name', '公司名称'),
array('goods_name', '商品型号'),
array('supplier_name', '制造商'),
array('goods_number', '数量'),
array('goods_price', '单价'),
array('goods_amount', '商品小计'),
......@@ -613,7 +614,6 @@ Class OrderController extends Controller
array('shipping_status','发货状态'),
array('inv_type', '发票类型'),
array('invoice_status', '发票状态'),
array('company_name', '供应商'),
array('sale_name', $sale_name),
array('adtags', 'adtags来源'),
array('client_source', '新用户来源'),
......@@ -762,7 +762,7 @@ Class OrderController extends Controller
})
->where('it.status', '<>', -1)
->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')
->orderBy('o.create_time', 'DESC')
->get();
......@@ -865,6 +865,7 @@ Class OrderController extends Controller
$tmp[$i]['create_time_date'] = '';
$tmp[$i]['create_time_sec'] = '';
$tmp[$i]['com_name'] = '';
$tmp[$i]['supplier_name'] = '';
$tmp[$i]['goods_sum'] = '';
$tmp[$i]['shipping_fee'] = '';
$tmp[$i]['extra_fee'] = '';
......@@ -876,7 +877,6 @@ Class OrderController extends Controller
$tmp[$i]['shipping_status'] = ''; // 发货状态
$tmp[$i]['inv_type'] = ''; // 发票类型
$tmp[$i]['invoice_status'] = ''; // 发票状态
$tmp[$i]['company_name'] = '';
$tmp[$i]['sale_name'] = ''; // 推送业务员
$tmp[$i]['adtags'] = '';
$tmp[$i]['client_source'] = '';
......@@ -888,7 +888,8 @@ Class OrderController extends Controller
$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_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]['shipping_fee'] = $this->getOrderPrice($order[$i]->order_id, 3);
$tmp[$i]['extra_fee'] = $this->getOrderPrice($order[$i]->order_id, 2);
......@@ -900,7 +901,6 @@ Class OrderController extends Controller
$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]['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]['adtags'] = $order[$i]->order_source;
$tmp[$i]['client_source'] = $order[$i]->client_source;
......@@ -1896,6 +1896,7 @@ Class OrderController extends Controller
$order = DB::connection('order')
->table('lie_order')
->where('order_goods_type', '=', 1)
->where('order_pay_type', '<>', 3) // 过滤账期订单
->where('status', '=', 2)
// ->whereNotIn('user_id', $this->testMobile())
->where('is_type', '=', 0)
......
......@@ -994,6 +994,9 @@
if (val == 2) {
$('.show-advance-pay').show();
} else if (val == 3) {
$('.show-advance-pay').hide();
$('.show-pay-time').hide();
} else {
$('.show-advance-pay').hide();
}
......@@ -1254,28 +1257,31 @@
return false;
}
if (payTime == '') {
layer.msg('请选择付款时间');
return false;
}
if (payTime == 'other' && payTimeOther == '') {
layer.msg('请填写自定义时间');
return false;
}
if (payTimeOther) {
var reg = /\d/;
if (!reg.test(payTimeOther)) {
layer.msg('格式错误');
// 非账期订单选择付款时间
if (pay_type != 3) {
if (payTime == '') {
layer.msg('请选择付款时间');
return false;
}
if (payTimeOther < 0 || payTimeOther > 30) {
layer.msg('自定义时间限制在1-30天');
if (payTime == 'other' && payTimeOther == '') {
layer.msg('请填写自定义时间');
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 goods_amount = currencySign+$('input[name=goods_amount]').val();
......
......@@ -161,6 +161,29 @@
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)
}
})
})
}
}
});
......
......@@ -155,27 +155,29 @@
</tr>
</table>
</div>
<p>付款时间</p>
<table class="table table-bordered table-hover change-table">
<tr>
<th>选择付款时间</th>
<td>
<select name="payTime" class="payTime">
<option value="">请选择</option>
<option value="1">1天</option>
<option value="3">3天</option>
<option value="7">7天</option>
<option value="15">15天</option>
<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>
</td>
</tr>
</table>
<div class="show-pay-time">
<p>付款时间</p>
<table class="table table-bordered table-hover change-table">
<tr>
<th>选择付款时间</th>
<td>
<select name="payTime" class="payTime">
<option value="">请选择</option>
<option value="1">1天</option>
<option value="3">3天</option>
<option value="7">7天</option>
<option value="15">15天</option>
<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>
</td>
</tr>
</table>
</div>
@if ($order_info['status'] == 1 && $order_temp_info['status'] == 1)
<a class="btn btn-primary checkAdjusted">查看调价信息</a>
......@@ -199,6 +201,8 @@
@endif
</div>
<!-- 非账期订单显示剩余时间 -->
@if ($order_info['order_pay_type'] != 3)
<div class="checked_right">
<p class="showtime">
<span class="error">剩余付款时间:</span>
......@@ -227,6 +231,7 @@
<button class="btn btn-info btn-xs delay_confirm">确认</button>
</div>
</div>
@endif
</div>
@endif
......
......@@ -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>
<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>
</td>
</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