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
bf049b01
authored
May 30, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
审核提交
parent
53c20bf3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
170 additions
and
30 deletions
app/Http/Controllers/OrderController.php
public/js/change_order.js
public/js/goods.js
resources/views/changeOrder/content.blade.php
resources/views/changeOrder/tempSave.blade.php
app/Http/Controllers/OrderController.php
View file @
bf049b01
...
...
@@ -840,14 +840,6 @@ Class OrderController extends Controller
$pay_time_limit
=
$request
->
input
(
'pay_time_limit'
);
}
$is_temp_save
=
$request
->
input
(
'is_temp_save'
,
''
);
if
(
$is_temp_save
)
{
// 临时保存接口
$url
=
Config
(
'website.api_domain'
)
.
'order/tempSaveOrder'
;
}
else
{
$url
=
Config
(
'website.api_domain'
)
.
'order/changeOrder'
;
}
$check
[
'k1'
]
=
time
();
$check
[
'k2'
]
=
md5
(
md5
(
$check
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
...
...
@@ -884,6 +876,21 @@ Class OrderController extends Controller
"product_use_classone_sn"
=>
$request
->
input
(
'product_use_classone_sn'
,
''
),
// 终端客户信息 一级分类
"product_use_classtwo_sn"
=>
$request
->
input
(
'product_use_classtwo_sn'
,
''
),
// 终端客户信息 二级分类
];
$is_temp_save
=
$request
->
input
(
'is_temp_save'
,
''
);
if
(
$is_temp_save
)
{
// 临时保存接口
$resData
[
'payTime'
]
=
$payTime
;
$resData
[
'payTimeOther'
]
=
$payTimeOther
;
$url
=
Config
(
'website.api_domain'
)
.
'order/tempSaveOrder'
;
}
else
{
$auditor_role
=
$request
->
input
(
'auditor_role'
,
1
);
// 当前操作人角色
$resData
[
'status'
]
=
$auditor_role
==
3
?
1
:
2
;
// 角色为‘查看自己’时,状态为待审核,否则为待付款
$url
=
Config
(
'website.api_domain'
)
.
'order/changeOrder'
;
}
// dd(curlApi($url, $resData, "POST"));
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
...
...
public/js/change_order.js
View file @
bf049b01
...
...
@@ -12,8 +12,13 @@
var
goods_type
=
self
.
data
(
'type'
);
var
order_type_extend
=
$
(
'#order_type_extend'
).
val
();
var
content
=
''
;
var
is_add
=
self
.
parents
(
'tr'
).
find
(
'.is_add'
).
val
();
// 新增的商品
if
(
is_add
)
{
content
+=
'确定删除新增的商品吗?'
;
}
else
{
content
+=
'<div><textarea type="text" class="reason" style="width:300px;height: 100px"></textarea></div><span class="error">请填写删除商品原因,100字以内</span>'
;
}
layer
.
open
({
title
:
'删除商品'
...
...
@@ -21,14 +26,14 @@
,
btn
:[
'确定'
,
'取消'
]
,
yes
:
function
(
index
,
layero
){
var
reason
=
$
(
'.reason'
).
val
();
if
(
!
reason
){
if
(
!
reason
&&
!
is_add
){
layer
.
tips
(
'请填写删除商品原因'
,
$
(
'.reason'
));
return
false
;
}
if
(
goods_type
==
1
)
{
// 联营删除
self
.
parents
(
'tr'
).
find
(
'.change_status'
).
val
(
-
1
);
// 调整状态
self
.
parents
(
'tr'
).
find
(
'.change_status_val'
).
text
(
'已取消
'
);
// 调整状态
self
.
parents
(
'tr'
).
find
(
'.change_status_val'
).
html
(
'<i class="error">已取消</i>
'
);
// 调整状态
self
.
parents
(
'tr'
).
find
(
'.del_reason'
).
val
(
reason
);
// 删除原因
self
.
parents
(
'tr'
).
find
(
'input'
).
attr
(
'disabled'
,
true
);
// 禁用当前行input
...
...
@@ -638,7 +643,134 @@
area
:
[
'700px'
],
btn
:
[
'应用'
,
'取消'
],
yes
:
function
(
index
,
layero
){
// 调整终端客户
if
(
temp_save_info
.
customer_cn
)
{
$
(
'.customer_cn'
).
val
(
temp_save_info
.
customer_cn
);
$
(
'.customer_en'
).
val
(
temp_save_info
.
customer_en
);
$
(
'.customer_type'
).
val
(
temp_save_info
.
customer_type
);
$
(
'.product_use_classone_sn'
).
val
(
temp_save_info
.
product_use_classone_sn
);
$
(
'.product_use_classone_sn'
).
change
();
// 添加change事件
$
(
'.product_use_classtwo_sn'
).
val
(
temp_save_info
.
product_use_classtwo_sn
);
}
$
(
'.order_pay_type'
).
val
(
temp_save_info
.
order_pay_type
);
// 调整付款类型
$
(
'#kefu_remark'
).
val
(
temp_save_info
.
kefu_remark
);
// 客服备注
$
(
'.advance'
).
val
(
temp_save_info
.
deposit_amount
);
// 调整定金
// 调整付款时间
if
(
temp_save_info
.
payTime
==
'other'
)
{
$
(
'.payTime'
).
val
(
temp_save_info
.
payTime
);
$
(
'.customArea'
).
show
();
$
(
'.payTimeOther'
).
val
(
temp_save_info
.
payTimeOther
);
}
else
{
$
(
'.payTime'
).
val
(
temp_save_info
.
payTime
);
}
// 调整明细
var
items
=
temp_save_info
.
change_info
;
var
items_len
=
0
;
var
new_str
=
''
;
// 新增商品数据
var
curr_no
=
1
;
// 标记当前行序号
for
(
var
i
in
items
)
{
if
(
!
items
[
i
].
is_add
)
{
$
(
'.change_item_'
+
i
).
find
(
'.change_goods_price'
).
val
(
items
[
i
].
goods_price
);
$
(
'.change_item_'
+
i
).
find
(
'.change_goods_number'
).
val
(
items
[
i
].
goods_number
);
if
(
items
[
i
].
status
==
-
1
)
{
$
(
'.change_item_'
+
i
).
find
(
'.change_status'
).
val
(
items
[
i
].
status
);
$
(
'.change_item_'
+
i
).
find
(
'.change_status'
).
next
(
'.change_status_val'
).
html
(
'<i class="error">已取消</i>'
);
}
}
items_len
++
;
}
for
(
var
i
in
items
)
{
if
(
!
items
[
i
].
is_add
)
continue
;
if
(
!
items
[
i
].
add_type
)
{
var
sup
=
items
[
i
].
canal
?
items
[
i
].
supplier_id
+
'.'
+
items
[
i
].
canal
:
items
[
i
].
supplier_id
;
new_str
+=
'<tr data-sup="'
+
sup
+
'">'
;
}
else
{
new_str
+=
'<tr>'
;
}
new_str
+=
'<td>'
+
i
+
'</td>\
<td>\
<input type="hidden" name="change_info['
+
i
+
'][supplier_name]" value="'
+
items
[
i
].
supplier_name
+
'">\
<p>'
+
items
[
i
].
supplier_name
+
'</p>\
</td>\
<td>\
<input class="change_goods_name" type="hidden" name="change_info['
+
i
+
'][goods_name]" value="'
+
items
[
i
].
goods_name
+
'">\
<p>'
+
items
[
i
].
goods_name
+
'</p>\
</td>\
<td>\
<input class="only_number num change_goods_number" name="change_info['
+
i
+
'][goods_number]" value="'
+
items
[
i
].
goods_number
+
'">\
</td>\
<td>\
<input class="price only_number" name="change_info['
+
i
+
'][goods_price]" data-price="'
+
items
[
i
].
goods_price
+
'" value="'
+
items
[
i
].
goods_price
+
'">\
</td>\
<td>\
<input class="change_status" type="hidden" name="change_info['
+
i
+
'][status]" value="1">\
<span class="change_status_val">正常<i style="color:green;">(新增)</i></span>\
</td>'
;
if
(
!
items
[
i
].
add_type
)
{
new_str
+=
'<td>\
<a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\
<input class="is_add" type="hidden" name="change_info['
+
i
+
'][is_add]" value="1" />\
<input type="hidden" name="change_info['
+
i
+
'][goods_id]" value="'
+
items
[
i
].
goods_id
+
'" />\
</td>'
;
}
else
{
// 新增无skuid商品
new_str
+=
'<td>\
<a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\
<input class="is_add" type="hidden" name="change_info['
+
i
+
'][is_add]" value="1" />\
<input type="hidden" name="change_info['
+
i
+
'][add_type]" value="1" />\
<input type="hidden" name="change_info['
+
i
+
'][order_id]" value="'
+
items
[
i
].
order_id
+
'" />\
<input type="hidden" name="change_info['
+
i
+
'][goods_id]" value="'
+
items
[
i
].
goods_id
+
'" />\
<input type="hidden" name="change_info['
+
i
+
'][brand_name]" value="'
+
items
[
i
].
brand_name
+
'" />\
<input type="hidden" name="change_info['
+
i
+
'][delivery_time]" value="'
+
items
[
i
].
delivery_time
+
'" />\
<input type="hidden" name="change_info['
+
i
+
'][buyer_id]" value="'
+
items
[
i
].
buyer_id
+
'" />\
<input type="hidden" name="change_info['
+
i
+
'][batch]" value="'
+
items
[
i
].
batch
+
'" />\
<input type="hidden" name="change_info['
+
i
+
'][remarks]" value="'
+
items
[
i
].
remarks
+
'" />\
</td>'
;
}
new_str
+=
'</tr>'
;
}
$
(
'.order-change-table'
).
find
(
'tbody'
).
append
(
new_str
);
$
(
'.order-change-table'
).
find
(
'tbody input'
).
trigger
(
'blur'
);
// 自动触发
// 调整附加费
var
extend_fee_items
=
temp_save_info
.
change_extend_fee
;
var
extend
=
''
;
for
(
var
i
in
extend_fee_items
)
{
extend
+=
'<tr data-sup="'
+
i
+
'">\
<td>\
<p>'
+
extend_fee_items
[
i
].
supplier_name
+
'</p>\
<input type="hidden" name="change_extend_fee['
+
i
+
'][supplier_name]" value="'
+
extend_fee_items
[
i
].
supplier_name
+
'">\
</td>\
<td>\
<input type="hidden" name="change_extend_fee['
+
i
+
'][amount]" class="sup_amount" value="'
+
extend_fee_items
[
i
].
amount
+
'">\
<p class="sup_amount_val">'
+
extend_fee_items
[
i
].
amount
+
'</p>\
</td>\
<td>\
<input class="adjust_extend_fee only_number" name="change_extend_fee['
+
i
+
'][extend_fee]" value="'
+
extend_fee_items
[
i
].
extend_fee
+
'">\
<input type="hidden" name="change_extend_fee['
+
i
+
'][count]" value="'
+
extend_fee_items
[
i
].
count
+
'">\
<input type="hidden" name="change_extend_fee['
+
i
+
'][ladder_max]" value="'
+
extend_fee_items
[
i
].
ladder_max
+
'">\
</td>\
</tr>'
;
}
$
(
'.extend-fee-table'
).
find
(
'tbody'
).
empty
().
append
(
extend
);
$
(
'.extend-fee-table'
).
find
(
'tbody input'
).
trigger
(
'keyup'
);
// 自动触发
layer
.
msg
(
'应用成功,请在当前页面审单'
);
layer
.
close
(
index
)
$
(
'.viewTempSave'
).
hide
();
},
btn2
:
function
(
index
,
layero
){
layer
.
close
(
index
)
...
...
public/js/goods.js
View file @
bf049b01
...
...
@@ -89,10 +89,12 @@
var
curr_no
=
goods_len
+
1
;
// 当前添加行序号
var
data
=
eval
(
'('
+
resp
.
data
+
')'
);
var
order_item
=
data
.
item
;
// 当前新增商品信息
var
sup
=
order_item
.
canal
?
order_item
.
supplier_id
+
'.'
+
order_item
.
canal
:
order_item
.
supplier_id
;
html
+=
'<tr">\
html
+=
'<tr
data-sup="'
+
sup
+
'
">\
<td>'
+
curr_no
+
'</td>\
<td>\
<input type="hidden" name="change_info['
+
curr_no
+
'][supplier_id]" value="'
+
order_item
.
supplier_id
+
'">\
<input type="hidden" name="change_info['
+
curr_no
+
'][supplier_name]" value="'
+
order_item
.
supplier_name
+
'">\
<p>'
+
order_item
.
supplier_name
+
'</p>\
</td>\
...
...
@@ -108,12 +110,13 @@
</td>\
<td>\
<input class="change_status" type="hidden" name="change_info['
+
curr_no
+
'][status]" value="1">\
<span class="change_status_val">正常</span>\
<span class="change_status_val">正常<
i style="color:green;">(新增)</i><
/span>\
</td>\
<td>\
<a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\
<input class="is_add" type="hidden" name="change_info['
+
curr_no
+
'][is_add]" value="1" />\
<input type="hidden" name="change_info['
+
curr_no
+
'][goods_id]" value="'
+
order_item
.
goods_id
+
'" />\
<input type="hidden" name="change_info['
+
curr_no
+
'][canal]" value="'
+
order_item
.
canal
+
'" />\
</td>\
</tr>'
;
...
...
@@ -259,7 +262,7 @@
var
curr_no
=
goods_len
+
1
;
// 当前添加行序号
html
+=
'<tr
"
>\
html
+=
'<tr>\
<td>'
+
curr_no
+
'</td>\
<td>\
<input type="hidden" name="change_info['
+
curr_no
+
'][supplier_name]" value="'
+
add_supplier_name
+
'">\
...
...
@@ -277,7 +280,7 @@
</td>\
<td>\
<input class="change_status" type="hidden" name="change_info['
+
curr_no
+
'][status]" value="1">\
<span class="change_status_val">正常</span>\
<span class="change_status_val">正常<
i style="color:green;">(新增)</i><
/span>\
</td>\
<td>\
<a class="btn btn-xs btn-danger deletegoods" href="javascript:;" data-id="" data-type="1">删除</a>\
...
...
resources/views/changeOrder/content.blade.php
View file @
bf049b01
...
...
@@ -17,6 +17,7 @@
<div
class=
"order-change-main"
>
@if (($order_info['order_goods_type'] == 1
&&
$order_info['status'] == 1) || ($order_info['order_goods_type'] == 2
&&
$order_info['adjust_count']
<
2
))
<
form
id=
"checkOrderForm"
class=
"form-horizontal table-responsive"
>
<input
type=
"hidden"
name=
"auditor_role"
value=
"{{ $role }}"
>
<input
type=
"hidden"
name=
"order_sn"
value=
"{{$order_info['order_sn']}}"
>
<input
type=
"hidden"
name=
"user_id"
value=
"{{$order_info['user_id']}}"
>
<input
type=
"hidden"
id=
"order_id"
name=
"order_id"
value=
"{{$order_info['order_id']}}"
>
...
...
@@ -178,7 +179,7 @@
<tbody>
@foreach ($order_items_info as $k=>$v)
<tr
data-sup=
"{{$v['canal'] ? $v['supplier_id'].'.'.$v['canal'] : $v['supplier_id']}}"
>
<tr
class=
"change_item_{{$v['rec_id']}}"
data-sup=
"{{$v['canal'] ? $v['supplier_id'].'.'.$v['canal'] : $v['supplier_id']}}"
>
<input
class=
"change_rec_id"
type=
"hidden"
name=
"change_rec_id"
value=
"{{ $v['rec_id'] }}"
>
<td>
{{ $k+1 }}
</td>
<td>
...
...
@@ -193,7 +194,7 @@
<input
class=
"only_number num change_goods_number"
name=
"change_info[{{$v['rec_id']}}][goods_number]"
value=
"{{$v['goods_number']}}"
>
</td>
<td>
<input
class=
"price only_number"
name=
"change_info[{{$v['rec_id']}}][goods_price]"
data-origin=
"{{$v['original_price']}}"
data-price=
"{{$v['goods_price']}}"
value=
"{{$v['goods_price']}}"
>
<input
class=
"price only_number
change_goods_price
"
name=
"change_info[{{$v['rec_id']}}][goods_price]"
data-origin=
"{{$v['original_price']}}"
data-price=
"{{$v['goods_price']}}"
value=
"{{$v['goods_price']}}"
>
</td>
<!-- 销售类型为预售时展示 -->
@if ($order_info['sale_type'] == 2)
...
...
@@ -213,7 +214,7 @@
<td>
<input
class=
"change_status"
type=
"hidden"
name=
"change_info[{{$v['rec_id']}}][status]"
value=
"{{$v['status']}}"
>
<span
class=
"change_status_val"
>
{{ $v['status'] == 1 ? '正常' : '
已取消
' }}
</span>
<span
class=
"change_status_val"
>
{{ $v['status'] == 1 ? '正常' : '
<i
class=
"error"
>
已取消
</i>
' }}
</span>
</td>
@if (count($order_items_info) > 1
&&
in_array($order_info['status'], [1, 2]))
...
...
resources/views/changeOrder/tempSave.blade.php
View file @
bf049b01
...
...
@@ -5,7 +5,7 @@
<div
id=
"temp-save-info"
>
<div
class=
"order-change-main"
>
<form
id=
"tempSaveForm"
class=
"form-horizontal table-responsive"
>
@if (
isset($order_temp_info['temp_save_info']['customer_cn'])
)
@if (
$order_temp_info['temp_save_info']['customer_cn']
)
<table
class=
"table table-bordered table-hover"
>
<tr
class=
"caption"
>
<th
colspan=
"4"
style=
"text-align: center; background: #f9f9f9;"
>
终端客户信息
</th>
...
...
@@ -39,18 +39,9 @@
@if (isset($order_temp_info['temp_save_info']['change_info']))
@foreach ($order_temp_info['temp_save_info']['change_info'] as $k => $v)
<tr>
<td>
<input
type=
"hidden"
name=
"change_info[{{$k}}][goods_name]"
value=
"{{$v['goods_name']}}"
>
<p>
{{$v['goods_name']}}
</p>
</td>
<td>
<input
type=
"hidden"
name=
"change_info[{{$k}}][goods_number]"
value=
"{{$v['goods_number']}}"
>
<p>
{{$v['goods_number']}}
</p>
</td>
<td>
<input
type=
"hidden"
name=
"change_info[{{$k}}][goods_price]"
value=
"{{$v['goods_price']}}"
>
<p>
{{$v['goods_price']}}
</p>
</td>
<td>
{{$v['goods_name']}}
</td>
<td>
{{$v['goods_number']}}
</td>
<td>
{{$v['goods_price']}}
</td>
<td>
{{ $v['status'] == 1 ? '正常' : '
<i
style=
"color: red;"
>
已取消
</i>
' }}
...
...
@@ -131,3 +122,9 @@
</form>
</div>
</div>
<script>
var
temp_save_info
=
'{!! json_encode($order_temp_info["temp_save_info"]) !!}'
;
temp_save_info
=
eval
(
'('
+
temp_save_info
+
')'
);
console
.
log
(
temp_save_info
)
</script>
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