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
29a9b7d9
authored
May 22, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加编辑合同
parent
f7cfe5f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
308 additions
and
132 deletions
app/Http/Controllers/OrderController.php
app/Http/routes.php
public/js/order.js
resources/views/detail/content.blade.php
app/Http/Controllers/OrderController.php
View file @
29a9b7d9
...
@@ -1567,6 +1567,27 @@ Class OrderController extends Controller
...
@@ -1567,6 +1567,27 @@ Class OrderController extends Controller
}
}
}
}
// 编辑合同乙方信息
public
function
editContract
(
Request
$request
)
{
if
(
$request
->
isMethod
(
'post'
))
{
$order_id
=
$request
->
input
(
'order_id'
,
''
);
$data
[
'contract_com_name'
]
=
$request
->
input
(
'contract_com_name'
,
''
);
$data
[
'contract_com_addr'
]
=
$request
->
input
(
'contract_com_addr'
,
''
);
$data
[
'contract_link_name'
]
=
$request
->
input
(
'contract_link_name'
,
''
);
$data
[
'contract_link_tel'
]
=
$request
->
input
(
'contract_link_tel'
,
''
);
DB
::
connection
(
'order'
)
->
transaction
(
function
()
use
(
$request
,
$order_id
,
$data
)
{
DB
::
connection
(
'order'
)
->
table
(
'lie_order_extend'
)
->
where
(
'order_id'
,
$order_id
)
->
update
(
$data
);
$OrderActionLogModel
=
new
OrderActionLogModel
();
$OrderActionLogModel
->
addLog
(
$order_id
,
$request
->
user
->
userId
,
2
,
'编辑合同乙方信息'
);
// 操作记录
});
return
[
'errcode'
=>
0
,
'errmsg'
=>
'编辑合同成功'
];
}
}
public
function
tempCount
(
Request
$request
)
public
function
tempCount
(
Request
$request
)
{
{
$current
=
strtotime
(
date
(
'Y-m-d'
,
time
()));
// 当天0点
$current
=
strtotime
(
date
(
'Y-m-d'
,
time
()));
// 当天0点
...
...
app/Http/routes.php
View file @
29a9b7d9
...
@@ -121,6 +121,7 @@ Route::group(['middleware' => 'web'], function () {
...
@@ -121,6 +121,7 @@ Route::group(['middleware' => 'web'], function () {
Route
::
get
(
'/refund_self_export'
,
'RefundController@refundSelfExport'
);
Route
::
get
(
'/refund_self_export'
,
'RefundController@refundSelfExport'
);
Route
::
post
(
'/ajax/offlinePaid'
,
'OrderController@offlinePaid'
);
Route
::
post
(
'/ajax/offlinePaid'
,
'OrderController@offlinePaid'
);
Route
::
post
(
'/ajax/editContract'
,
'OrderController@editContract'
);
});
});
// 不需要登陆态
// 不需要登陆态
...
...
public/js/order.js
View file @
29a9b7d9
...
@@ -809,6 +809,77 @@
...
@@ -809,6 +809,77 @@
});
});
})
})
// 编辑合同信息
$
(
'.contract_info_edit'
).
click
(
function
(){
var
order_id
=
$
(
'input[name=order_id]'
).
val
();
var
content
=
$
(
'.contract_info:hidden'
).
html
();
layer
.
open
({
area
:[
'500px'
],
title
:
'编辑合同信息'
,
content
:
content
,
btn
:
[
'确认'
,
'取消'
],
btn1
:
function
()
{
var
contract_com_name
=
$
(
'.layui-layer-content'
).
find
(
'.contract_com_name'
).
val
();
var
contract_com_addr
=
$
(
'.layui-layer-content'
).
find
(
'.contract_com_addr'
).
val
();
var
contract_link_name
=
$
(
'.layui-layer-content'
).
find
(
'.contract_link_name'
).
val
();
var
contract_link_tel
=
$
(
'.layui-layer-content'
).
find
(
'.contract_link_tel'
).
val
();
if
(
!
contract_com_name
)
{
layer
.
tips
(
'请填写公司名称'
,
$
(
'.layui-layer-content'
).
find
(
'.contract_com_name'
));
return
false
;
}
if
(
!
contract_com_addr
)
{
layer
.
tips
(
'请填写公司地址'
,
$
(
'.layui-layer-content'
).
find
(
'.contract_com_addr'
));
return
false
;
}
if
(
!
contract_link_name
)
{
layer
.
tips
(
'请填写联系人'
,
$
(
'.layui-layer-content'
).
find
(
'.contract_link_name'
));
return
false
;
}
if
(
!
contract_link_tel
)
{
layer
.
tips
(
'请填写联系电话'
,
$
(
'.layui-layer-content'
).
find
(
'.contract_link_tel'
));
return
false
;
}
var
datax
=
{
order_id
:
order_id
,
contract_com_name
:
contract_com_name
,
contract_com_addr
:
contract_com_addr
,
contract_link_name
:
contract_link_name
,
contract_link_tel
:
contract_link_tel
,
};
$
.
ajax
({
url
:
'/ajax/editContract'
,
data
:
datax
,
type
:
'post'
,
dataType
:
'json'
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
){
layer
.
msg
(
resp
.
errmsg
||
'操作成功'
);
setTimeout
(
function
(){
location
.
reload
();
},
1000
);
return
false
;
}
else
{
layer
.
alert
(
resp
.
errmsg
||
'网络异常'
);
}
},
error
:
function
(){
layer
.
alert
(
'网络异常'
);
}
});
},
btn2
:
function
(
index
)
{
layer
.
close
(
index
);
}
})
})
},
},
//物流信息
//物流信息
...
...
resources/views/detail/content.blade.php
View file @
29a9b7d9
...
@@ -20,6 +20,9 @@
...
@@ -20,6 +20,9 @@
$action_name
=
explode
(
'@'
,
$route
)[
1
];
$action_name
=
explode
(
'@'
,
$route
)[
1
];
?>
?>
<input
type=
"hidden"
class=
"action_type"
value=
"{{$action_name}}"
>
<input
type=
"hidden"
class=
"action_type"
value=
"{{$action_name}}"
>
<input
type=
"hidden"
name=
"order_id"
value=
"{{$order_info['order_id']}}"
>
<input
type=
"hidden"
name=
"user_id"
value=
"{{$order_info['user_id']}}"
>
<div
class=
"tabs-box table-responsive"
>
<div
class=
"tabs-box table-responsive"
>
<table
class=
"table table-bordered order-express"
>
<table
class=
"table table-bordered order-express"
>
<?php
<?php
...
@@ -161,146 +164,192 @@
...
@@ -161,146 +164,192 @@
</tr>
</tr>
</table>
</table>
<input
type=
"hidden"
id=
"order_id"
value=
"{{$order_info['order_id']}}"
>
<div
class=
"col-lg-12 col-md-12 col-xs-12"
>
<input
type=
"hidden"
id=
"user_id"
value=
"{{$order_info['user_id']}}"
>
<!-- 收货信息 -->
<div
class=
"col-lg-4 col-md-4 col-xs-4"
>
<table
class=
"table table-bordered"
>
<table
class=
"table table-bordered"
>
<tr
class=
"caption"
>
<caption
style=
"text-align: center; background: #f9f9f9;"
>
收货信息
<th
colspan=
"7"
style=
"text-align: center; background: #f9f9f9;"
>
@if (!$isPage)
收货信息
<!-- 订单状态小于5 且 更新地址权限存在 显示按钮 -->
@if (!$isPage)
@if (!isset($_REQUEST['tags']))
<!-- 订单状态小于5 且 更新地址权限存在 显示按钮 -->
@if (in_array($order_info['status'], array(1, 2, 3, 4))
&&
in_array('update_address', $userPerms))
@if (!isset($_REQUEST['tags']))
<a
href=
"/changeShipping/{{$order_info['order_id']}}"
class=
"btn btn-success btn-sm changeBtn"
>
编辑
</a>
@if (in_array($order_info['status'], array(1, 2, 3, 4))
&&
in_array('update_address', $userPerms))
@endif
<a
href=
"/changeShipping/{{$order_info['order_id']}}"
class=
"btn btn-success btn-sm changeBtn"
>
更改收货地址
</a>
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'self')
@endif
@if (in_array($order_info['status'], array(1, 2, 4))
&&
in_array('self_order_update_address', $userPerms))
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'self')
<a
href=
"/changeShipping/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}"
class=
"btn btn-success btn-sm changeBtn"
>
编辑
</a>
@if (in_array($order_info['status'], array(1, 2, 4))
&&
in_array('self_order_update_address', $userPerms))
@endif
<a
href=
"/changeShipping/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}"
class=
"btn btn-success btn-sm changeBtn"
>
更改收货地址
</a>
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'erp')
@endif
<a
href=
"/changeShipping/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}"
class=
"btn btn-success btn-sm changeBtn"
>
编辑
</a>
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'erp')
@endif
<a
href=
"/changeShipping/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}"
class=
"btn btn-success btn-sm changeBtn"
>
更改收货地址
</a>
@endif
@endif
</caption>
@endif
</th>
</tr>
<tr>
<th>
订单编号
</th>
<th>
会员账号
</th>
<th>
收货人
</th>
<th>
联系电话/手机
</th>
<th>
配送方式
</th>
@if ($order_info['order_shipping_type'] == 2)
<th>
自提地址
</th>
@else
<th>
收货地址
</th>
@endif
</tr>
<tr>
<td>
{{$order_info['order_sn']}}
</td>
<td>
@if ($user_mobile)
{{$user_mobile}}
@else
{{isset($order_info['user_info']['email']) ? $order_info['user_info']['email'] : ''}}
@endif
</td>
<td>
{{$order_address_info['consignee']}}
</td>
<tr>
<th
width=
"25%"
>
订单编号
</th>
<td>
{{$order_info['order_sn']}}
</td>
</tr>
<td>
{{$order_address_info['mobile']}}
</td>
<tr>
<th>
会员账号
</th>
<td>
@if ($user_mobile)
{{$user_mobile}}
@else
{{isset($order_info['user_info']['email']) ? $order_info['user_info']['email'] : ''}}
@endif
</td>
</tr>
@if ($order_info['order_shipping_type'] == 2)
<tr>
<td>
客户自提
</td>
<th>
收货人
</th>
<td>
{{$order_address_info['address']}}
</td>
<td>
{{$order_address_info['consignee']}}
</td>
@else
</tr>
<td>
快递送货
</td>
<td>
{{$order_address_info['province_val']}}
{{$order_address_info['city_val']}}
{{$order_address_info['district_val']}}
{{$order_address_info['address']}}
</td>
@endif
</tr>
</table>
@if (!empty($order_invoice_info))
<table
class=
"table table-bordered order-express"
>
<tr
class=
"caption"
>
<th
colspan=
"3"
style=
"text-align: center; background: #f9f9f9;"
>
发票信息
@if (!$isPage)
<!-- 发票状态小于2(已发货)且更改权限存在 显示按钮 -->
@if (!isset($_REQUEST['tags']))
@if(in_array($order_info['status'], [1, 2, 3, 4])
&&
$order_invoice_info['invoice_status']
<
2
&&
in_array
('
update_invoice
',
$
userPerms
))
<
a
href=
"/changeInvoice/{{$order_info['order_id']}}"
class=
"btn btn-success btn-sm changeBtn"
>
更改发票
</a>
@endif
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'self'
&&
!$extend)
<?php
if
(
$order_info
[
'status'
]
>
3
)
{
// 已付款请求财务接口判断是否能修改发票
$isChangeInvoice
=
App\Http\Controllers\isChangeInvoice
(
$order_info
[
'order_sn'
]);
if
(
$isChangeInvoice
)
{
<tr>
echo
'<a href="/changeInvoice/'
.
$order_info
[
'order_id'
]
.
'?tags='
.
$_REQUEST
[
'tags'
]
.
'" class="btn btn-success btn-sm changeBtn">更改发票</a>'
;
<th>
联系电话
</th>
}
<td>
{{$order_address_info['mobile']}}
</td>
}
else
{
</tr>
if
(
$order_invoice_info
[
'invoice_status'
]
<
2
&&
in_array
(
'self_order_update_invoice'
,
$userPerms
))
{
echo
'<a href="/changeInvoice/'
.
$order_info
[
'order_id'
]
.
'?tags='
.
$_REQUEST
[
'tags'
]
.
'" class="btn btn-success btn-sm changeBtn">更改发票</a>'
;
<tr>
}
<th>
配送方式
</th>
}
<td>
?>
@if ($order_info['order_shipping_type'] == 2)
<!-- in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('self_order_update_invoice', $userPerms) -->
客户自提
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'erp')
@else
<a
href=
"/changeInvoice/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}"
class=
"btn btn-success btn-sm changeBtn"
>
更改发票
</a>
快递送货
@endif
@endif
@endif
</td>
</th>
</tr>
</tr>
<tr>
<tr>
<td
colspan=
"3"
>
<th>
配送地址
</th>
<table
class=
"table inv"
>
<td>
<tr>
@if ($order_info['order_shipping_type'] == 2)
<th>
发票类型
</th>
{{$order_address_info['address']}}
<th>
发票抬头
</th>
@else
<th>
公司注册地址
</th>
{{$order_address_info['province_val']}}
{{$order_address_info['city_val']}}
{{$order_address_info['district_val']}}
{{$order_address_info['address']}}
<th>
公司电话
</th>
@endif
<th>
税务登记号
</th>
</td>
<th>
开户银行
</th>
</tr>
<th>
银行卡号
</th>
</table>
<th>
开票状态
</th>
</div>
<!-- 发票信息 -->
@if (!empty($order_invoice_info))
<div
class=
"col-lg-4 col-md-4 col-xs-4"
>
<table
class=
"table table-bordered"
>
<caption
style=
"text-align: center; background: #f9f9f9;"
>
发票信息
@if (!$isPage)
<!-- 发票状态小于2(已发货)且更改权限存在 显示按钮 -->
@if (!isset($_REQUEST['tags']))
@if(in_array($order_info['status'], [1, 2, 3, 4])
&&
$order_invoice_info['invoice_status']
<
2
&&
in_array
('
update_invoice
',
$
userPerms
))
<
a
href=
"/changeInvoice/{{$order_info['order_id']}}"
class=
"btn btn-success btn-sm changeBtn"
>
编辑
</a>
@endif
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'self'
&&
!$extend)
<?php
if
(
$order_info
[
'status'
]
>
3
)
{
// 已付款请求财务接口判断是否能修改发票
$isChangeInvoice
=
App\Http\Controllers\isChangeInvoice
(
$order_info
[
'order_sn'
]);
if
(
$isChangeInvoice
)
{
echo
'<a href="/changeInvoice/'
.
$order_info
[
'order_id'
]
.
'?tags='
.
$_REQUEST
[
'tags'
]
.
'" class="btn btn-success btn-sm changeBtn">编辑</a>'
;
}
}
else
{
if
(
$order_invoice_info
[
'invoice_status'
]
<
2
&&
in_array
(
'self_order_update_invoice'
,
$userPerms
))
{
echo
'<a href="/changeInvoice/'
.
$order_info
[
'order_id'
]
.
'?tags='
.
$_REQUEST
[
'tags'
]
.
'" class="btn btn-success btn-sm changeBtn">编辑</a>'
;
}
}
?>
<!-- in_array($order_info['status'], [1, 2, 3, 4]) && $order_invoice_info['invoice_status'] < 2 && in_array('self_order_update_invoice', $userPerms) -->
@elseif (isset($_REQUEST['tags'])
&&
$_REQUEST['tags'] == 'erp')
<a
href=
"/changeInvoice/{{$order_info['order_id']}}?tags={{$_REQUEST['tags']}}"
class=
"btn btn-success btn-sm changeBtn"
>
编辑
</a>
@endif
@endif
</caption>
@if ($order_invoice_info['inv_type'] == 1)
<tr
style=
"text-align: center;"
>
<td
colspan=
"8"
>
不开发票
</td>
</tr>
</tr>
@else
<tr>
<th
width=
"25%"
>
发票类型
</th>
<td>
<?php
switch
(
$order_invoice_info
[
'inv_type'
])
{
case
2
:
echo
'普通发票'
;
break
;
case
3
:
echo
'增值税专用发票'
;
break
;
case
4
:
echo
'增值税普通发票'
;
break
;
}
?>
</td>
</tr>
@if ($order_invoice_info['inv_type'] == 1)
<tr>
<tr
style=
"text-align: center;"
>
<th>
发票抬头
</th>
<td
colspan=
"8"
>
不开发票
</td>
<td>
{{$order_invoice_info['tax_title']}}
</td>
</tr>
</tr>
@else
<tr>
<tr>
<th>
公司注册地址
</th>
<td>
<td>
{{$order_invoice_info['company_address']}}
</td>
<?php
</tr>
switch
(
$order_invoice_info
[
'inv_type'
])
{
<tr>
case
2
:
echo
'普通发票'
;
break
;
<th>
公司电话
</th>
case
3
:
echo
'增值税专用发票'
;
break
;
<td>
{{$order_invoice_info['company_phone']}}
</td>
case
4
:
echo
'增值税普通发票'
;
break
;
</tr>
}
<tr>
?>
<th>
税务登记号
</th>
</td>
<td>
{{$order_invoice_info['tax_no']}}
</td>
<td>
{{$order_invoice_info['tax_title']}}
</td>
</tr>
<td>
{{$order_invoice_info['company_address']}}
</td>
<tr>
<td>
{{$order_invoice_info['company_phone']}}
</td>
<th>
开户银行
</th>
<td>
{{$order_invoice_info['tax_no']}}
</td>
<td>
{{$order_invoice_info['bank_name']}}
</td>
<td>
{{$order_invoice_info['bank_name']}}
</td>
</tr>
<td>
{{$order_invoice_info['bank_account']}}
</td>
<tr>
<td>
{{$order_invoice_info['invoice_status_val']}}
</td>
<th>
银行卡号
</th>
</tr>
<td>
{{$order_invoice_info['bank_account']}}
</td>
</tr>
<tr>
<th>
开票状态
</th>
<td>
{{$order_invoice_info['invoice_status_val']}}
</td>
</tr>
@endif
</table>
</div>
@endif
<!-- 合同乙方信息 -->
<div
class=
"col-lg-4 col-md-4 col-xs-4"
>
<table
class=
"table table-bordered"
>
<caption
style=
"text-align: center; background: #f9f9f9;"
>
合同乙方信息
<!-- 待审核可编辑 -->
@if ($order_info['status'] == 1)
<a
href=
"javascript:;"
class=
"btn btn-success btn-sm changeBtn contract_info_edit"
>
编辑
</a>
@endif
@endif
</table>
</caption>
</td>
</tr>
<tr>
</table>
<th
width=
"25%"
>
公司名称
</th>
@endif
<td>
{{ $order_temp_info['contract_com_name'] }}
</td>
</tr>
<tr>
<th>
公司地址
</th>
<td>
{{ $order_temp_info['contract_com_addr'] }}
</td>
</tr>
<tr>
<th>
联系人
</th>
<td>
{{ $order_temp_info['contract_link_name'] }}
</td>
</tr>
<tr>
<th>
联系电话
</th>
<td>
{{ $order_temp_info['contract_link_tel'] }}
</td>
</tr>
</table>
</div>
</div>
<!-- 发票收货地址 -->
<!-- 发票收货地址 -->
@if ($order_invoice_address_info)
@if ($order_invoice_address_info)
...
@@ -854,6 +903,40 @@
...
@@ -854,6 +903,40 @@
</div>
</div>
</div>
</div>
<style>
.contract_info
{
display
:
none
;
}
.contractForm
input
{
width
:
240px
;
height
:
34px
;
}
.contractForm
textarea
{
width
:
240px
;
padding
:
6px
5px
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
resize
:
none
;
}
</style>
<div
class=
"contract_info"
>
<form
class=
"form-horizontal contractForm"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
><i
class=
"text-danger"
>
*
</i>
公司名称:
</label>
<div
class=
"col-sm-8"
>
<input
type=
"text"
name=
"contract_com_name"
class=
"form-control contract_com_name"
value=
"{{$order_temp_info['contract_com_name']}}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
><i
class=
"text-danger"
>
*
</i>
公司地址:
</label>
<div
class=
"col-sm-8"
>
<textarea
name=
"contract_com_addr"
class=
"form-control contract_com_addr"
cols=
"30"
rows=
"3"
>
{{$order_temp_info['contract_com_addr']}}
</textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
><i
class=
"text-danger"
>
*
</i>
联系人:
</label>
<div
class=
"col-sm-8"
>
<input
type=
"text"
name=
"contract_link_name"
class=
"form-control contract_link_name"
value=
"{{$order_temp_info['contract_link_name']}}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
><i
class=
"text-danger"
>
*
</i>
联系电话:
</label>
<div
class=
"col-sm-8"
>
<input
type=
"text"
name=
"contract_link_tel"
class=
"form-control contract_link_tel"
value=
"{{$order_temp_info['contract_link_tel']}}"
>
</div>
</div>
</form>
</div>
<script>
<script>
// 退款申请已处理或已拒绝,则隐藏退款按钮
// 退款申请已处理或已拒绝,则隐藏退款按钮
var
refund
=
"{{!empty($order_refund_info) && ($order_refund_info['status'] == -1 || $order_refund_info['status'] == 10) ? false : true}}"
;
var
refund
=
"{{!empty($order_refund_info) && ($order_refund_info['status'] == -1 || $order_refund_info['status'] == 10) ? false : true}}"
;
...
...
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