Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c3e5b51b
authored
Sep 25, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
fix
parents
aa97b375
777fac3c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
32 deletions
app/Http/Controllers/OrderController.php
public/css/detail.css
public/js/order.js
resources/views/detail/changeOrder.blade.php
resources/views/detail/content.blade.php
app/Http/Controllers/OrderController.php
View file @
c3e5b51b
...
...
@@ -275,6 +275,15 @@ function getOrderAddress($order_id)
return
$order
->
consignee
;
}
// 获取渠道名称
function
getSupplierName
(
$key
)
{
$redis
=
Redis
::
connection
(
'read'
);
$supp_info
=
$redis
->
hget
(
'supp_info_'
,
$key
);
return
$supp_info
;
}
Class
OrderController
extends
Controller
{
// 首页
...
...
@@ -1098,6 +1107,7 @@ Class OrderController extends Controller
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
"client_source"
=>
$client_source
,
"change_extend_fee"
=>
$request
->
input
(
'change_extend_fee'
,
''
),
];
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
...
...
public/css/detail.css
View file @
c3e5b51b
...
...
@@ -34,10 +34,10 @@
width
:
100%
;
}
.order-details
.change-table
th
{
width
:
30%
;
/*width: 30%;*/
}
.order-details
.change-table
td
{
width
:
70%
;
/*width: 70%;*/
}
/* 审核 */
...
...
public/js/order.js
View file @
c3e5b51b
...
...
@@ -1057,15 +1057,35 @@
$
(
'.order-change-table input'
).
on
(
'blur'
,
function
(){
var
table
=
$
(
'.order-change-table'
);
var
goods_total
=
0
;
var
supplier
=
[];
$
(
table
).
find
(
'tbody tr'
).
each
(
function
(){
var
num
=
parseInt
(
$
(
this
).
find
(
'.num'
).
val
())
||
0
;
var
price
=
parseFloat
(
$
(
this
).
find
(
'.price'
).
val
())
||
0
;
goods_total
+=
parseFloat
(
num
*
price
);
var
sup
=
$
(
this
).
data
(
'sup'
);
if
(
supplier
.
hasOwnProperty
(
sup
))
{
// 判断当前key是否存在于数组中
supplier
[
sup
]
+=
parseFloat
(
num
*
price
);
}
else
{
supplier
[
sup
]
=
parseFloat
(
num
*
price
);
}
});
// 附加费商品金额设置
$
(
'.extend-fee-table'
).
find
(
'tbody tr'
).
each
(
function
(){
var
sup
=
$
(
this
).
data
(
'sup'
);
$
(
this
).
find
(
'.sup_amount'
).
val
(
supplier
[
sup
]);
$
(
this
).
find
(
'.sup_amount_val'
).
text
(
supplier
[
sup
]);
})
var
fee
=
parseFloat
(
$
(
'input[name="extra_fee"]'
).
val
());
goods_total
=
goods_total
.
toFixed
(
2
);
var
total
=
parseFloat
(
goods_total
+
fee
).
toFixed
(
2
);
goods_total
=
goods_total
.
toFixed
(
2
);
$
(
'.goods_total'
).
html
(
goods_total
);
$
(
'input[name="goods_amount"]'
).
val
(
goods_total
);
$
(
'input[name="order_amount"]'
).
val
(
total
);
...
...
@@ -1082,6 +1102,26 @@
// }
})
// 根据供应商调整附加费
$
(
'.extend-fee-table input'
).
on
(
'blur'
,
function
(){
var
table
=
$
(
'.extend-fee-table'
);
var
goods_total
=
parseFloat
(
$
(
'.goods_total'
).
text
());
var
extend_fee_total
=
0
;
$
(
table
).
find
(
'tbody tr'
).
each
(
function
(){
var
extend_fee
=
parseInt
(
$
(
this
).
find
(
'.adjust_extend_fee'
).
val
())
||
0
;
extend_fee_total
+=
extend_fee
;
});
var
total
=
parseFloat
(
goods_total
+
extend_fee_total
).
toFixed
(
2
);
$
(
'.extra_fee'
).
html
(
extend_fee_total
);
$
(
'input[name="extra_fee"]'
).
val
(
extend_fee_total
);
$
(
'input[name="order_amount"]'
).
val
(
total
);
$
(
'.total'
).
html
(
total
);
})
// 定金调整
// $('.advance').on('blur',function(){
// if($(this).val()<($('.total').html()*0.2)){
...
...
@@ -1147,27 +1187,27 @@
});
// 附加费
$
(
'input[name="extra_fee"]'
).
on
(
'blur'
,
function
(){
var
fee
=
parseFloat
(
$
(
this
).
val
());
var
goods_total
=
parseFloat
(
$
(
'.goods_total'
).
html
());
if
(
isNaN
(
fee
))
{
fee
=
0.0000
;
}
var
total
=
parseFloat
(
goods_total
+
fee
).
toFixed
(
2
);
$
(
'input[name="goods_amount"]'
).
val
(
goods_total
);
$
(
'input[name="order_amount"]'
).
val
(
total
);
$
(
'.total'
).
html
(
total
);
$
(
'.advance'
).
val
((
total
*
0.3
).
toFixed
(
2
));
//
$('input[name="extra_fee"]').on('blur', function(){
//
var fee = parseFloat($(this).val());
//
var goods_total = parseFloat($('.goods_total').html());
//
if (isNaN(fee)) {
//
fee = 0.0000;
//
}
//
var total = parseFloat(goods_total + fee).toFixed(2);
//
$('input[name="goods_amount"]').val(goods_total);
//
$('input[name="order_amount"]').val(total);
//
$('.total').html(total);
//
$('.advance').val((total*0.3).toFixed(2));
// 价格调整后,付款类型显示或隐藏
// var orderPayType = $('input[name=order_pay_type]').val();
//
// 价格调整后,付款类型显示或隐藏
//
// var orderPayType = $('input[name=order_pay_type]').val();
// if (currency == 1) { // 人民币
// checkPayType(total, orderPayType, 10000, 49999);
// } else {
// checkPayType(total, orderPayType, 1500, 7800);
// }
})
//
// if (currency == 1) { // 人民币
//
// checkPayType(total, orderPayType, 10000, 49999);
//
// } else {
//
// checkPayType(total, orderPayType, 1500, 7800);
//
// }
//
})
// 选择付款时间
$
(
'.payTime'
).
change
(
function
(){
...
...
resources/views/detail/changeOrder.blade.php
View file @
c3e5b51b
...
...
@@ -80,8 +80,9 @@
<hr/>
<!-- 调价 -->
<p>
调价
</p>
<table
class=
"table table-bordered table-hover order-change-table
change-table
"
>
<table
class=
"table table-bordered table-hover order-change-table"
>
<thead>
<th
width=
"20%"
>
供应商
</th>
<th>
型号
</th>
<th>
调整数量
</th>
<th>
调整单价
</th>
...
...
@@ -89,7 +90,10 @@
<tbody>
@foreach ($order_items_info as $v)
<tr>
<tr
data-sup=
"{{$v['canal'] ? $v['supplier_id'].'.'.$v['canal'] : $v['supplier_id']}}"
>
<td>
<p>
{{$v['supplier_name']}}
</p>
</td>
<td>
<input
type=
"hidden"
name=
"change_info[{{$v['rec_id']}}][goods_name]"
value=
"{{$v['goods_name']}}"
>
<p>
{{$v['goods_name']}}
</p>
...
...
@@ -105,17 +109,67 @@
</tbody>
</table>
<?php
$extend_fee_items
=
json_decode
(
$order_temp_info
[
'extend_fee_items'
],
true
);
?>
@if ($extend_fee_items)
<hr/>
<p>
附加费设置
</p>
<table
class=
"table table-bordered table-hover change-table"
>
<table
class=
"table table-bordered table-hover extend-fee-table"
>
<thead>
<th
width=
"20%"
>
供应商/渠道
</th>
<th>
商品金额
</th>
<th>
调整附加费
</th>
</thead>
<tbody>
@foreach ($extend_fee_items as $k => $v)
<tr
data-sup=
"{{$k}}"
>
<td>
@if (strpos($k, '.') !== false)
<p>
<?php
$sid
=
explode
(
'.'
,
$k
)[
1
];
echo
App\Http\Controllers\getSupplierName
(
$sid
);
?>
</p>
@else
<p>
{{$v['supplier_name']}}
</p>
@endif
<input
type=
"hidden"
name=
"change_extend_fee[{{$k}}][supplier_name]"
value=
"{{$v['supplier_name']}}"
>
</td>
<td>
<input
type=
"hidden"
name=
"change_extend_fee[{{$k}}][amount]"
class=
"sup_amount"
value=
"{{$v['amount']}}"
>
<p
class=
"sup_amount_val"
>
{{$v['amount']}}
</p>
</td>
<td>
<input
class=
"adjust_extend_fee only_number"
name=
"change_extend_fee[{{$k}}][extend_fee]"
value=
"{{$v['extend_fee']}}"
>
</td>
<input
type=
"hidden"
name=
"change_extend_fee[{{$k}}][count]"
value=
"{{$v['count']}}"
>
@if (isset($v['ladder_max']))
<input
type=
"hidden"
name=
"change_extend_fee[{{$k}}][ladder_max]"
value=
"{{$v['ladder_max']}}"
>
@endif
</tr>
@endforeach
</tbody>
</table>
@endif
<hr/>
<table
class=
"table table-bordered table-hover"
>
<tr>
<th>
商品总金额
</th>
<th
width=
"20%"
>
商品总金额
</th>
<td><p
class=
"text-danger"
>
{{$currency}}
<span
class=
"goods_total"
>
{{$order_price_info['goods_price']}}
</span></p></td>
</tr>
<tr>
<th>
附加费金额
</th>
<td><input
type=
"text"
name=
"extra_fee"
autocomplete=
"off"
value=
"{{$order_price_info['ext_price']}}"
class=
"only_number"
></td>
<th
width=
"20%"
>
附加费金额
</th>
<td>
<p
class=
"text-danger"
>
{{$currency}}
<span
class=
"extra_fee"
>
{{$order_price_info['ext_price'] ? $order_price_info['ext_price'] : 0}}
</span></p>
<input
type=
"hidden"
name=
"extra_fee"
autocomplete=
"off"
value=
"{{$order_price_info['ext_price'] ? $order_price_info['ext_price'] : 0}}"
>
</td>
<!-- <td><input type="text" name="extra_fee" autocomplete="off" value="{{$order_price_info['ext_price']}}" class="only_number"></td> -->
</tr>
<!-- <tr>
...
...
@@ -126,7 +180,7 @@
</tr> -->
<tr>
<th>
订单总额
</th>
<th
width=
"20%"
>
订单总额
</th>
<td>
<p
class=
"text-danger"
>
{{$currency}}
<span
class=
"total"
>
{{$order_info['order_amount']}}
</span></p>
</td>
...
...
@@ -136,9 +190,9 @@
<div
class=
"show-advance-pay"
>
<hr/>
<p>
定金调整
</p>
<table
class=
"table table-bordered table-hover
change-table
"
>
<table
class=
"table table-bordered table-hover"
>
<tr>
<th>
定金金额
</th>
<th
width=
"20%"
>
定金金额
</th>
<td>
<p
class=
"text-danger"
>
{{$currency}}
<?php
...
...
resources/views/detail/content.blade.php
View file @
c3e5b51b
...
...
@@ -412,7 +412,7 @@
<th>
采购数量
</th>
<th>
采购单价
</th>
<!-- <th>采购小计</th> -->
<th>
优惠
单价
</th>
<th>
均摊后
单价
</th>
<th>
小计
</th>
<th>
货期
</th>
<th>
供应商
</th>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment