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
05b2beab
authored
Jun 23, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://119.23.72.7/zhujilai/Order
parents
4454e9ae
ba6a0201
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
136 additions
and
37 deletions
app/Http/Controllers/OrderController.php
app/Http/Controllers/PermController.php
app/Http/Controllers/ReturnController.php
app/Http/routes.php
app/Model/OrderModel.php
config/config.php
public/js/order_audit.js
public/js/order_send_email.js
public/js/refund.js
resources/views/changeOrder/content.blade.php
resources/views/detail/content.blade.php
resources/views/detail/detail_action_log.php
resources/views/detail/detail_base_info.blade.php
resources/views/detail/detail_items_info.php
resources/views/detail/detail_multi_info.php
resources/views/detail/js.blade.php
resources/views/orderlist/content.blade.php
resources/views/orderlist/js.blade.php
resources/views/returnDetails/content.blade.php
resources/views/selfOrder/content.blade.php
app/Http/Controllers/OrderController.php
View file @
05b2beab
This diff is collapsed.
Click to expand it.
app/Http/Controllers/PermController.php
View file @
05b2beab
...
...
@@ -344,29 +344,57 @@
// }
// 获取角色对应的主管邮箱
public
function
getManager
(
$request
)
{
$role
=
$this
->
getUserRole
(
$request
);
// 当前用户角色
//
public function getManager($request)
//
{
//
$role = $this->getUserRole($request); // 当前用户角色
$manager_key
=
array_search
(
$role
,
Config
(
'perm_args.manager_to_kefu'
));
// 获取对应的主管key
//
$manager_key = array_search($role, Config('perm_args.manager_to_kefu')); // 获取对应的主管key
if
(
!
$manager_key
)
return
false
;
//
if (!$manager_key) return false;
$role_name
=
array_search
(
$manager_key
,
Config
(
'perm_args.roles'
));
// 获取主管对应的角色名称
//
$role_name = array_search($manager_key, Config('perm_args.roles')); // 获取主管对应的角色名称
if
(
!
$role_name
)
return
false
;
//
if (!$role_name) return false;
$res
=
$this
->
getRoleUsers
(
$request
,
$role_name
);
// 获取角色对应的用户
//
$res = $this->getRoleUsers($request, $role_name); // 获取角色对应的用户
$email
=
[];
//
$email = [];
if
(
$res
)
{
foreach
(
$res
as
$v
)
{
$email
[]
=
$v
->
email
;
}
// if ($res) {
// foreach ($res as $v) {
// $email[] = $v->email;
// }
// }
// return $email;
// }
/**
* 获取角色对应的主管邮箱
* @param [type] $userId [description]
* @param [type] $position_id [主管ID]
* @return [type] [description]
*/
public
function
getManager
(
$userId
,
$position_id
)
{
// 获取当前所在部门
$department_id
=
DB
::
table
(
'user_info'
)
->
where
(
'userId'
,
$userId
)
->
value
(
'department_id'
);
if
(
!
$department_id
)
return
false
;
$map
=
[];
$map
[
'department_id'
]
=
$department_id
;
$map
[
'position_id'
]
=
$position_id
;
$email
=
DB
::
table
(
'user_info'
)
->
where
(
$map
)
->
select
(
'email'
)
->
get
();
if
(
empty
(
$email
))
return
false
;
foreach
(
$email
as
$v
)
{
$data
[]
=
$v
->
email
;
}
return
$
email
;
return
$
data
;
}
/* 订单系统权限调整 --- 20200511 */
...
...
@@ -434,7 +462,7 @@
return
DB
::
table
(
'user_info'
)
->
where
(
$map
)
->
select
(
'userId'
,
'name'
,
'position_id'
,
'position_name'
,
'department_id'
,
'department_name'
,
'status'
)
->
get
();
}
// 获取下级所有人员
// 获取
指定用户
下级所有人员
public
function
getSubSaleId
(
$userId
)
{
$sale_ids
=
[];
...
...
@@ -490,5 +518,15 @@
return
$user
;
}
// 检查用户是否属于某部门
public
function
checkUserDepartment
(
$userId
,
$department_id
)
{
$map
=
[];
$map
[
'userId'
]
=
$userId
;
$map
[
'department_id'
]
=
$department_id
;
return
DB
::
table
(
'user_info'
)
->
where
(
$map
)
->
select
(
'userId'
)
->
first
();
}
}
\ No newline at end of file
app/Http/Controllers/ReturnController.php
View file @
05b2beab
...
...
@@ -126,7 +126,7 @@ class ReturnController extends Controller
$map
[
'sale_id'
]
=
$request
->
input
(
'sale_id'
,
''
);
// 非管理员、查看下级,只能看到自己的退货单
if
(
!
in_array
(
$info
[
'role'
],
[
1
,
2
])
)
{
if
(
$info
[
'role'
]
==
3
)
{
$map
[
'create_uid'
]
=
$request
->
user
->
userId
;
}
...
...
app/Http/routes.php
View file @
05b2beab
...
...
@@ -43,6 +43,7 @@ Route::group(['middleware' => 'web'], function () {
Route
::
match
([
'get'
,
'post'
],
'/sendSales/{id?}'
,
'OrderController@sendSales'
);
Route
::
post
(
'/ajaxdeletegoods'
,
'OrderController@ajaxdeletegoods'
);
Route
::
post
(
'/ajaxSaveChange'
,
'OrderController@ajaxSaveChange'
);
Route
::
post
(
'/ajaxApplyManagerAudit'
,
'OrderController@ajaxApplyManagerAudit'
);
Route
::
post
(
'/ajaxAuditPass'
,
'OrderController@ajaxAuditPass'
);
Route
::
post
(
'/ajaxReAudit'
,
'OrderController@ajaxReAudit'
);
Route
::
get
(
'/check/{id}'
,
'OrderController@check'
);
...
...
app/Model/OrderModel.php
View file @
05b2beab
...
...
@@ -335,6 +335,7 @@ class OrderModel extends Model
'1'
=>
'自采'
,
'2'
=>
'立创'
,
'3'
=>
'京北'
,
'4'
=>
'油柑网'
,
);
$tmp
=
array
();
...
...
@@ -461,7 +462,7 @@ class OrderModel extends Model
$tmp
[
$i
][
'sale_type'
]
=
$order
[
$i
][
'sale_type'
]
==
1
?
'现卖'
:
'预售'
;
// 自营其他业务类型
$tmp
[
$i
][
'business_type'
]
=
$order
[
$i
][
'business_type'
]
?
Config
(
'params.business_type'
)[
$order
[
$i
][
'business_type'
]]
:
'正常订单'
;
$tmp
[
$i
][
'self_supplier_type'
]
=
$self_supplier_type
[
$order
[
$i
][
'self_supplier_type'
]]
;
// 自采标记
$tmp
[
$i
][
'self_supplier_type'
]
=
isset
(
$self_supplier_type
[
$order
[
$i
][
'self_supplier_type'
]])
?
$self_supplier_type
[
$order
[
$i
][
'self_supplier_type'
]]
:
'未知'
;
// 自采标记
$tmp
[
$i
][
'sample_demand_desc'
]
=
$order
[
$i
][
'sample_demand_desc'
];
// 样片项目需求描述
//收货地址的电话
$tmp
[
$i
][
'receiving_address'
]
=
isset
(
$current_order_addr
[
'mobile'
])
?
$current_order_addr
[
'mobile'
]
:
''
;
...
...
config/config.php
View file @
05b2beab
...
...
@@ -23,4 +23,9 @@ return [
// 'zoe@ichunt.com',
],
// 联营采购负责人
'joint_purchase_manager'
=>
[
'zty@ichunt.com'
,
],
];
public/js/order_audit.js
View file @
05b2beab
...
...
@@ -4,6 +4,48 @@
$
.
extend
(
$
.
lie
,
{
audit
:
{
index
:
function
()
{
// 申请主管审核
$
(
'.apply-manager-audit'
).
click
(
function
()
{
var
order_id
=
$
(
this
).
data
(
'id'
);
// 弹出提示
layer
.
open
({
area
:
[
'360px'
],
title
:
'提示信息'
,
content
:
'确定申请主管审核吗?'
,
btn
:[
'确定'
,
'取消'
],
yes
:
function
(
index
,
layero
){
$
.
ajax
({
url
:
'/ajaxApplyManagerAudit'
,
type
:
'post'
,
data
:
{
order_id
:
order_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
===
0
){
layer
.
msg
(
resp
.
errmsg
||
'操作成功'
);
setTimeout
(
function
(){
location
.
reload
();
},
1000
);
return
false
;
}
layer
.
alert
(
resp
.
errmsg
);
return
false
;
},
error
:
function
(
res
)
{
console
.
log
(
res
);
}
})
layer
.
msg
(
'申请中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
// 阻止重复提交
},
btn2
:
function
(
index
,
layero
){
layer
.
close
(
index
);
}
});
})
// 主管审核
$
(
'.manager-audit'
).
click
(
function
()
{
var
order_id
=
$
(
this
).
data
(
'id'
);
...
...
public/js/order_send_email.js
View file @
05b2beab
...
...
@@ -52,6 +52,8 @@
layer
.
alert
(
'网络异常'
);
}
});
layer
.
msg
(
'推送中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
},
btn2
:
function
(
index
){
layer
.
close
(
index
);
...
...
public/js/refund.js
View file @
05b2beab
...
...
@@ -387,7 +387,7 @@
$
(
'.return_num'
).
keyup
(
function
()
{
var
removal_number
=
parseInt
(
$
(
this
).
parents
(
'tr'
).
find
(
'.removal_number'
).
val
());
// 出库数量
var
single_pre_price
=
parseFloat
(
$
(
this
).
parents
(
'tr'
).
find
(
'.single_pre_price'
).
val
());
// 均摊单价
var
pay_amount
=
$
(
'.pay_amount'
).
val
(
);
var
pay_amount
=
parseFloat
(
$
(
'.pay_amount'
).
val
()
);
var
val
=
$
(
this
).
val
();
// 退货数量
if
(
val
>
removal_number
)
{
...
...
resources/views/changeOrder/content.blade.php
View file @
05b2beab
...
...
@@ -15,7 +15,7 @@
<div
class=
"tabs-box"
>
<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
))
@if (($order_info['order_goods_type'] == 1
&&
in_array($order_info['status'], [1, 2])
&&
$order_temp_info['is_manager_audit'] != 3
) || ($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']}}"
>
...
...
@@ -396,7 +396,7 @@
</form>
@endif
@if (($order_info['order_goods_type'] == 1
&&
$order_info['status'] == 2
) || ($order_info['order_goods_type'] != 1
&&
$order_info['adjust_count'] == 2))
@if (($order_info['order_goods_type'] == 1
&&
$order_info['status'] == 2
&&
$order_temp_info['is_manager_audit'] == 3) || ($order_info['order_goods_type'] == 2
&&
$order_info['status'] == 2
&&
$order_info['adjust_count'] == 2))
<div
class=
"checked_section"
>
<div
class=
"checked_left"
>
<p>
交易状态:
审核通过,请联系客户及时付款!
...
...
@@ -416,7 +416,7 @@
@if ($order_info['order_goods_type'] == 2
&&
$order_info['adjust_count']
<
2
)
<
a
class=
"btn btn-default"
href=
"{{$adjustPriceUrl}}"
>
再次调价
</a><span
class=
"warn-tip"
>
每笔订单仅有一次“再次调价”机会
</span>
@elseif ($order_info['order_goods_type'] == 1)
<
a
class=
"btn btn-default"
href=
"{{$adjustPriceUrl}}"
>
再次调价
</a
>
<
!-- <a class="btn btn-default" href="{{$adjustPriceUrl}}">再次调价</a> --
>
@endif
</div>
...
...
@@ -486,7 +486,7 @@
@include('changeOrder.addGoodsNoSkuid')
<script>
var
is_manager
=
"{{ in_array($role, [1, 2]) ? true : false }}"
;
var
is_manager
=
"{{ in_array($role, [1, 2
, 5
]) ? true : false }}"
;
var
isNewClient
=
"{{isset($isNewClient) ? $isNewClient : 0}}"
;
// var order_amount = "{{$order_info['order_amount']}}";
...
...
resources/views/detail/content.blade.php
View file @
05b2beab
...
...
@@ -157,15 +157,20 @@
@endif
@if (in_array('check_order', $userPerms)
&&
$order_info['sale_id'])
@if (
$order_info['status'] == 1
)
@if (
isset($order_temp_info['is_manager_audit'])
&&
$order_temp_info['is_manager_audit'] != 3
&&
in_array($order_info['status'], [1, 2])
)
<a
class=
"btn btn-success"
href=
"{{URL('change', ['order_id'=>$order_info['order_id']])}}"
target=
"_blank"
>
人工审单
</a>
@elseif ($order_info['status'] == 2
&&
in_array($role, [1, 2]))
@elseif ($order_info['status'] == 2
&&
$order_temp_info['is_manager_audit'] == 3
&&
in_array($role, [1, 2]))
<a
class=
"btn btn-success re-audit"
data-id=
"{{$order_info['order_id']}}"
>
反审
</a>
@endif
@endif
<!-- 申请主管审核 -->
@if (isset($order_temp_info['is_manager_audit'])
&&
$order_temp_info['is_manager_audit'] == 1
&&
$order_info['status'] == 2)
<a
class=
"btn btn-info apply-manager-audit"
data-id=
"{{$order_info['order_id']}}"
>
申请主管审核
</a>
@endif
<!-- 主管审核 -->
@if (
$order_temp_info['is_manager_audit']
&&
in_array($role, [1, 2])
&&
$order_info['status'] == 1
)
@if (
isset($order_temp_info['is_manager_audit'])
&&
(($order_info['status'] == 2
&&
$order_temp_info['is_manager_audit'] == 2) || ($order_info['status'] > 2
&&
$order_temp_info['is_manager_audit'] != 3))
&&
in_array($role, [1, 2])
&&
empty($order_temp_info['erp_sn'])
)
<a
class=
"btn btn-danger manager-audit"
data-id=
"{{$order_info['order_id']}}"
>
主管审核
</a>
@endif
...
...
resources/views/detail/detail_action_log.php
View file @
05b2beab
<style>
.action_log_event
{
word-break
:
break-all
;
}
</style>
<p>
操作记录
</p>
<div
class=
"tabs-box table-responsive"
>
<table
class=
"table table-bordered table-hover"
>
...
...
@@ -14,13 +18,13 @@
<tr>
<td
width=
"15%"
>
<?=
date
(
'Y-m-d H:i:s'
,
$v
->
create_time
)
?>
</td>
<td
width=
"10%"
>
<?=
App\Http\Controllers\getOperatorName
(
$v
->
operator_id
,
$v
->
operator_type
)
?>
</td>
<td>
<?=
$v
->
event
?>
</td>
<td
class=
"action_log_event"
>
<?=
$v
->
event
?>
</td>
</tr>
<?php
}
else
{
?>
<tr
class=
"other-infos"
>
<td
width=
"15%"
>
<?=
date
(
'Y-m-d H:i:s'
,
$v
->
create_time
)
?>
</td>
<td
width=
"10%"
>
<?=
App\Http\Controllers\getOperatorName
(
$v
->
operator_id
,
$v
->
operator_type
)
?>
</td>
<td>
<?=
$v
->
event
?>
</td>
<td
class=
"action_log_event"
>
<?=
$v
->
event
?>
</td>
</tr>
<?php
}
?>
...
...
resources/views/detail/detail_base_info.blade.php
View file @
05b2beab
...
...
@@ -30,12 +30,12 @@
<th>
发货状态
</th>
<th>
物流单号
</th>
<th>
京东订单编号
</th>
<th
width=
"8%"
>
自动确认收货时间
</th>
<th>
自动确认收货时间
</th>
</tr>
<tr>
<td>
{{ $order_info['order_sn'] }}
</td>
<td>
{{
$order_temp_info['is_manager_audit'] ? '待主管审核' :
Config('params.order_status')[$order_info['status']] }}
</td>
<td>
{{ Config('params.order_status')[$order_info['status']] }}
</td>
<td>
{{ $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'] }}
</td>
<td>
<?php
...
...
resources/views/detail/detail_items_info.php
View file @
05b2beab
...
...
@@ -143,7 +143,7 @@
<td>
<!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> -->
<?php
if
(
in_array
(
$order_info
[
'status'
],
[
1
,
2
,
3
])
&&
$v
[
'status'
]
==
1
)
{
?>
<?php
if
(
in_array
(
$order_info
[
'status'
],
[
1
,
2
,
3
,
4
])
&&
$v
[
'status'
]
==
1
)
{
?>
<button
type=
"button"
class=
"btn btn-success btn-xs edit-item"
data-id=
"
<?=
$v
[
'rec_id'
]
?>
"
data-batch=
"
<?=
$v
[
'batch'
]
?>
"
data-bid=
"
<?=
$v
[
'buyer_id'
]
?>
"
data-remarks=
"
<?=
$v
[
'remarks'
]
?>
"
>
编辑
</button>
<?php
}
?>
</td>
...
...
resources/views/detail/detail_multi_info.php
View file @
05b2beab
...
...
@@ -26,7 +26,7 @@
<th
colspan=
"8"
style=
"text-align: center; background: #f9f9f9;"
>
发票信息
<?php
//<!-- 发票状态小于2(已发货)且更改权限存在 显示按钮 -->
if
(
!
isset
(
$tags
))
{
if
(
empty
(
$tags
))
{
if
(
in_array
(
$order_info
[
'status'
],
[
1
,
2
,
3
,
4
])
&&
$order_invoice_info
[
'invoice_status'
]
<
2
&&
in_array
(
'update_invoice'
,
$userPerms
))
{
echo
'<a href="/changeInvoice/'
.
$order_info
[
'order_id'
]
.
'" class="btn btn-success btn-sm changeBtn">更改发票</a>'
;
}
...
...
resources/views/detail/js.blade.php
View file @
05b2beab
...
...
@@ -12,7 +12,7 @@
<script
src=
"/js/md5.js"
></script>
<script
src=
"/js/layui/layui.js"
></script>
<script
src=
"/js/details.js?v=
<?=
time
()
?>
"
></script>
<script
src=
"/js/order_audit.js"
></script>
<script
src=
"/js/order_audit.js
?v=
<?=
time
()
?>
"
></script>
<script
src=
"/js/order_track.js"
></script>
<script
src=
"/js/order_cancel.js"
></script>
<script
src=
"/js/order_send_email.js"
></script>
...
...
resources/views/orderlist/content.blade.php
View file @
05b2beab
This diff is collapsed.
Click to expand it.
resources/views/orderlist/js.blade.php
View file @
05b2beab
...
...
@@ -11,9 +11,9 @@
<script
src=
"/js/common.js"
></script>
<script
src=
"/js/layui/layui.js"
></script>
<script
src=
"/js/list.js?v=
<?=
time
()
?>
"
></script>
<script
src=
"/js/order_audit.js"
></script>
<script
src=
"/js/order_audit.js
?v=
<?=
time
()
?>
"
></script>
<script
src=
"/js/order_track.js"
></script>
<script
src=
"/js/order_cancel.js"
></script>
<script
src=
"/js/order_send_email.js"
></script>
<script
src=
"/js/refund.js?v=
<?=
time
()
?>
"
></script>
resources/views/returnDetails/content.blade.php
View file @
05b2beab
...
...
@@ -143,8 +143,8 @@
</div>
</div>
<!-- 管理员、经理、自营
客服主管及助理审核
&& 待审核状态 -->
@if (in_array($role, [1, 2,
10, 11
])
&&
$return['status'] == 1)
<!-- 管理员、经理、自营
查看
&& 待审核状态 -->
@if (in_array($role, [1, 2,
5
])
&&
$return['status'] == 1)
<div
class=
"text-center"
style=
"margin-bottom: 10px;"
>
<button
class=
"btn btn-info return-check"
style=
"margin-right: 10px;"
data-type=
"2"
data-id=
"{{ $return['return_id'] }}"
>
审核通过
</button>
<button
class=
"btn btn-danger return-check"
data-type=
"-2"
data-id=
"{{ $return['return_id'] }}"
>
驳回
</button>
...
...
resources/views/selfOrder/content.blade.php
View file @
05b2beab
...
...
@@ -390,7 +390,7 @@
@endif
@if ($v['status'] == -1
&&
!$v['cancel_reason'])
<a
class=
"btn btn-danger input-cancel-reason"
href=
"javascript:;"
data-oid=
"{{$v['order_id']}}"
>
填写取消原因
</a>
<a
class=
"btn btn-danger input-cancel-reason"
href=
"javascript:;"
data-oid=
"{{$v['order_id']}}"
data-type=
"4"
>
填写取消原因
</a>
@endif
</div>
</td>
...
...
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