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
bcfb747d
authored
Sep 11, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
供应商附加费随价格或数量改变
parent
f55bd7a9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
public/js/order.js
resources/views/detail/changeOrder.blade.php
public/js/order.js
View file @
bcfb747d
...
...
@@ -1015,13 +1015,30 @@
$
(
'.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
());
var
total
=
parseFloat
(
goods_total
+
fee
).
toFixed
(
2
);
...
...
resources/views/detail/changeOrder.blade.php
View file @
bcfb747d
...
...
@@ -89,7 +89,7 @@
<tbody>
@foreach ($order_items_info as $v)
<tr>
<tr
data-sup=
"{{$v['supplier_name']}}"
>
<td>
<p>
{{$v['supplier_name']}}
</p>
</td>
...
...
@@ -122,7 +122,7 @@
<?php
$extend_fee_items
=
json_decode
(
$order_temp_info
[
'extend_fee_items'
],
true
);
?>
@foreach ($extend_fee_items as $k => $v)
<tr>
<tr
data-sup=
"{{$v['supplier_name']}}"
>
<td>
@if (strpos($k, '.') !== false)
<p>
...
...
@@ -137,8 +137,8 @@
<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]"
value=
"{{$v['amount']}}"
>
<p>
{{$v['amount']}}
</p>
<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']}}"
>
...
...
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