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
64875d7c
authored
Apr 08, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_inquiry_order_20210311' into development
parents
6a5e9848
7711c919
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
11 deletions
app/Http/Controllers/AddOrderController.php
app/Http/routes.php
public/js/add_inquiry_order.js
resources/views/addInquiryOrder/content.blade.php
resources/views/addInquiryOrder/goodsInfo.blade.php
app/Http/Controllers/AddOrderController.php
View file @
64875d7c
...
...
@@ -106,6 +106,9 @@ Class AddOrderController extends Controller
// $info['company'] = (new CmsModel())->getCompany(); // 获取公司组织
$info
[
'report_ids'
]
=
$request
->
input
(
'report_ids'
,
''
);
// 询价系统销售报价ID
$perm
=
new
PermController
;
$info
[
'buyers'
]
=
$perm
->
getUserByDepartmentId
(
8
,
0
);
// 获取采购部人员
return
view
(
'addInquiryOrder'
,
$info
);
}
...
...
@@ -428,6 +431,16 @@ Class AddOrderController extends Controller
if
(
$data
[
'is_new'
])
{
// 新版下单页面,layui格式返回
$data
=
isset
(
$response
[
'data'
][
'list'
])
?
$response
[
'data'
][
'list'
]
:
[];
$perm
=
new
PermController
;
$buyers
=
$perm
->
getUserByDepartmentId
(
8
,
0
);
// 获取采购部人员
if
(
!
empty
(
$data
))
{
foreach
(
$data
as
&
$v
)
{
$v
[
'buyerSelect'
]
=
$this
->
getPurchaseSelect
(
$buyers
,
$v
[
'buyer_id'
]);
}
}
return
[
'code'
=>
$response
[
'err_code'
],
'msg'
=>
$response
[
'err_msg'
],
'data'
=>
$data
,
'count'
=>
count
(
$data
)];
}
...
...
@@ -439,6 +452,21 @@ Class AddOrderController extends Controller
}
}
// 生成采购下拉列表
public
function
getPurchaseSelect
(
$buyers
,
$buyer_id
)
{
$option
=
'<option vlaue=""></option>'
;
foreach
(
$buyers
as
$k
=>
$v
)
{
if
(
$v
->
userId
==
$buyer_id
)
{
$option
.=
'<option vlaue="'
.
$v
->
userId
.
'" selected>'
.
$v
->
name
.
'</option>'
;
}
else
{
$option
.=
'<option vlaue="'
.
$v
->
userId
.
'">'
.
$v
->
name
.
'</option>'
;
}
}
return
$option
;
}
// 获取订单赠品信息
public
function
getOrderGift
(
Request
$request
)
{
...
...
@@ -469,7 +497,7 @@ Class AddOrderController extends Controller
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
if
(
$type
==
3
)
{
// 联营批量添加
if
(
$type
==
3
||
$type
==
4
)
{
// 3-联营批量添加、4-询价单
$url
=
Config
(
'website.api_domain'
)
.
'cart/changeNumForJoint'
;
}
else
{
$url
=
Config
(
'website.api_domain'
)
.
'cart/changeNumByOrderSystem'
;
...
...
@@ -485,6 +513,47 @@ Class AddOrderController extends Controller
}
}
// 修改购物车字段
public
function
changeField
(
Request
$request
)
{
if
(
$request
->
isMethod
(
'post'
))
{
$uid
=
$request
->
input
(
'uid'
);
$cart_id
=
$request
->
input
(
'cart_id'
);
$goods_price
=
$request
->
input
(
'goods_price'
,
0
);
$delivery_time
=
$request
->
input
(
'delivery_time'
,
''
);
$batch
=
$request
->
input
(
'batch'
,
''
);
$buyer
=
$request
->
input
(
'buyer'
,
0
);
$data
=
[];
if
(
!
$delivery_time
)
{
// 交期不存在
$goods_price
&&
$data
[
'goods_price'
]
=
$goods_price
;
$batch
&&
$data
[
'batch'
]
=
$batch
;
if
(
$buyer
)
{
$CmsModel
=
new
CmsModel
;
$data
[
'buyer_id'
]
=
$CmsModel
->
getSaleId
(
$buyer
);
}
}
else
{
// 修改交期
$goods_data
=
DB
::
connection
(
'order'
)
->
table
(
'lie_shopping_cart'
)
->
where
(
'cart_id'
,
$cart_id
)
->
value
(
'goods_data'
);
if
(
!
$goods_data
)
{
$goods_data
[
'delivery_time'
]
=
$delivery_time
;
}
else
{
$goods_data
=
json_decode
(
$goods_data
,
true
);
$goods_data
[
'delivery_time'
]
=
$delivery_time
;
}
$data
[
'goods_data'
]
=
json_encode
(
$goods_data
);
}
$res
=
DB
::
connection
(
'order'
)
->
table
(
'lie_shopping_cart'
)
->
where
(
'cart_id'
,
$cart_id
)
->
update
(
$data
);
if
(
$res
===
false
)
return
[
'errcode'
=>
-
1
,
'errmsg'
=>
'修改失败'
];
return
[
'errcode'
=>
0
,
'errmsg'
=>
'修改成功'
];
}
}
// 删除购物车商品
public
function
deleteGoods
(
Request
$request
)
{
...
...
app/Http/routes.php
View file @
64875d7c
...
...
@@ -106,6 +106,7 @@ Route::group(['middleware' => 'web'], function () {
Route
::
post
(
'/ajax/cartList'
,
'AddOrderController@cartList'
);
Route
::
post
(
'/ajax/getOrderGift'
,
'AddOrderController@getOrderGift'
);
Route
::
post
(
'/ajax/changeNum'
,
'AddOrderController@changeNum'
);
Route
::
post
(
'/ajax/changeField'
,
'AddOrderController@changeField'
);
Route
::
post
(
'/ajax/deleteGoods'
,
'AddOrderController@deleteGoods'
);
Route
::
post
(
'/ajax/create'
,
'AddOrderController@create'
);
Route
::
get
(
'/addorder/success'
,
'AddOrderController@success'
);
...
...
public/js/add_inquiry_order.js
View file @
64875d7c
This diff is collapsed.
Click to expand it.
resources/views/addInquiryOrder/content.blade.php
View file @
64875d7c
...
...
@@ -38,12 +38,12 @@
</div>
</div>
<div
class=
"layui-colla-item client-info"
>
<
!-- <
div class="layui-colla-item client-info">
<h2 class="layui-colla-title">终端客户信息</h2>
<div class="layui-colla-content layui-show">
@include('addInquiryOrder.dgkInfo')
</div>
</div>
</div>
-->
<div
class=
"layui-colla-item order-info"
>
<h2
class=
"layui-colla-title"
>
订单信息
</h2>
...
...
resources/views/addInquiryOrder/goodsInfo.blade.php
View file @
64875d7c
...
...
@@ -102,14 +102,25 @@
<table
id=
"list"
lay-filter=
"list"
></table>
<textarea
name=
"remark"
id=
"remark"
class=
"layui-textarea"
placeholder=
"填写订单备注信息"
></textarea>
</div>
<script
type=
"text/html"
id=
"buyer_id"
>
@{{
#
if
(
d
.
buyer_id
!=
0
)
{
}}
@{{
d
.
buyer_id
}}
@{{
#
}
}}
</script>
<script>
var
buyers
=
eval
(
'{!! json_encode($buyers) !!}'
);
</script>
<script
type=
"text/html"
id=
"list_action"
>
<style>
td
.layui-form-select
{
margin-top
:
-10px
;
margin-left
:
-15px
;
margin-right
:
-15px
;
}
</style>
<script
type=
"text/html"
id=
"t_buyer_id"
>
<
select
name
=
"buyer_id"
id
=
"buyer_id"
lay
-
filter
=
"buyer_id"
data
-
cid
=
"@{{ d.cart_id }}"
>
@{{
d
.
buyerSelect
}}
<
/select>
</script>
<script
type=
"text/html"
id=
"list_action"
>
<
a
class
=
"btn btn-xs btn-danger"
lay
-
event
=
"del"
>
删除
<
/a>
</script>
</div>
</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