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
9abdda59
authored
Jun 23, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
daa6b500
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
33 deletions
app/Model/Bom/BomItemModel.php
app/Services/Bom/BomService.php
resources/views/web/BomReport.blade.php
app/Model/Bom/BomItemModel.php
View file @
9abdda59
...
@@ -29,7 +29,7 @@ class BomItemModel extends BomItemMatchBaseModel{
...
@@ -29,7 +29,7 @@ class BomItemModel extends BomItemMatchBaseModel{
$page
=
$request
->
input
(
"page"
,
1
);
$page
=
$request
->
input
(
"page"
,
1
);
$limit
=
$request
->
input
(
"limit"
,
10
);
$limit
=
$request
->
input
(
"limit"
,
10
);
$suffix
=
substr
(
strrev
(
$bom_id
),
0
,
1
);
$suffix
=
substr
(
strrev
(
$bom_id
),
0
,
1
);
$query
=
self
::
suffix
(
$suffix
)
->
select
(
"*"
)
->
where
(
'bom_id'
,
$bom_id
);
$query
=
self
::
suffix
(
$suffix
)
->
select
(
"*"
)
->
where
(
'bom_id'
,
$bom_id
)
->
where
([
"del_status"
=>
1
])
;
$query
=
$query
->
paginate
(
$limit
,[],
'page'
,
$page
);
$query
=
$query
->
paginate
(
$limit
,[],
'page'
,
$page
);
return
$query
;
return
$query
;
}
}
...
...
app/Services/Bom/BomService.php
View file @
9abdda59
...
@@ -52,8 +52,10 @@ class BomService {
...
@@ -52,8 +52,10 @@ class BomService {
list
(
$role_id
,
$sale_ids
)
=
$this
->
getRole
(
$request
);
list
(
$role_id
,
$sale_ids
)
=
$this
->
getRole
(
$request
);
// dump($role_id);
// dump($sale_ids);
$query
=
BomModel
::
select
(
"*"
)
->
with
(
"bomExtend"
)
->
SearchByUserNameOrKefu
(
$username
,
$is_kefu
)
$query
=
BomModel
::
select
(
"*"
)
->
w
here
([
"status"
=>
1
])
->
w
ith
(
"bomExtend"
)
->
SearchByUserNameOrKefu
(
$username
,
$is_kefu
)
->
SearchByBomName
(
$bom_name
)
->
SearchByIsCorder
(
$is_corder
)
->
SearchByTime
(
$begin_time
,
$end_time
)
->
SearchByBomName
(
$bom_name
)
->
SearchByIsCorder
(
$is_corder
)
->
SearchByTime
(
$begin_time
,
$end_time
)
->
SearchByrole
(
$role_id
,
$sale_ids
)
->
SearchByrole
(
$role_id
,
$sale_ids
)
->
orderBy
(
"bom_id"
,
"desc"
);
->
orderBy
(
"bom_id"
,
"desc"
);
...
@@ -189,6 +191,8 @@ class BomService {
...
@@ -189,6 +191,8 @@ class BomService {
$num
=
$num
-
intval
(
$modNum
);
$num
=
$num
-
intval
(
$modNum
);
}
}
$data
=
[
$data
=
[
"goods_id"
=>
$goodsInfo
[
'goods_id'
],
"goods_id"
=>
$goodsInfo
[
'goods_id'
],
"goods_name"
=>
$goodsInfo
[
'goods_name'
],
"goods_name"
=>
$goodsInfo
[
'goods_name'
],
...
@@ -237,6 +241,16 @@ class BomService {
...
@@ -237,6 +241,16 @@ class BomService {
$num
=
$num
-
intval
(
$modNum
);
$num
=
$num
-
intval
(
$modNum
);
}
}
//货期
try
{
$delivery_time
=
$goodsInfo
[
'delivery_time'
];
if
(
is_array
(
$delivery_time
)
&&
count
(
$delivery_time
)
==
2
){
$delivery_time
=
$delivery_time
[
$extend
[
'delivery_type'
]];
}
}
catch
(
\Exception
$e
){
$delivery_time
=
""
;
}
$data
=
[
$data
=
[
"bom_id"
=>
$bom_item_matching
[
'bom_id'
],
"bom_id"
=>
$bom_item_matching
[
'bom_id'
],
"bom_item_id"
=>
$bom_item_matching
[
'bom_item_id'
],
"bom_item_id"
=>
$bom_item_matching
[
'bom_item_id'
],
...
@@ -247,7 +261,7 @@ class BomService {
...
@@ -247,7 +261,7 @@ class BomService {
"goods_type"
=>
static
::
$GOODSTYPE
[
$goodsInfo
[
'goods_type'
]],
"goods_type"
=>
static
::
$GOODSTYPE
[
$goodsInfo
[
'goods_type'
]],
"supplier_id"
=>
$goodsInfo
[
'supplier_id'
],
"supplier_id"
=>
$goodsInfo
[
'supplier_id'
],
"supplier_name"
=>
$goodsInfo
[
'supplier_name'
],
"supplier_name"
=>
$goodsInfo
[
'supplier_name'
],
"delivery"
=>
$
goodsInfo
[
'delivery_time'
]
,
"delivery"
=>
$
delivery_time
,
"delivery_type"
=>
$extend
[
'delivery_type'
],
//交货类型
"delivery_type"
=>
$extend
[
'delivery_type'
],
//交货类型
"number"
=>
$num
,
"number"
=>
$num
,
"price"
=>
$goods_prices
[
'price'
],
"price"
=>
$goods_prices
[
'price'
],
...
@@ -368,6 +382,7 @@ class BomService {
...
@@ -368,6 +382,7 @@ class BomService {
$extend
[
"currency"
]
=
$currency
;
$extend
[
"currency"
]
=
$currency
;
foreach
(
$data
as
$k
=>
$item
){
foreach
(
$data
as
$k
=>
$item
){
// dump($item);exit;
//已下单的不能修改
//已下单的不能修改
if
(
isset
(
$item
[
'match_is_corder'
])
&&
$item
[
'match_is_corder'
]
==
1
){
if
(
isset
(
$item
[
'match_is_corder'
])
&&
$item
[
'match_is_corder'
]
==
1
){
// array_push($err_msg,sprintf("第%s个型号已下单,无法更改;",$k));
// array_push($err_msg,sprintf("第%s个型号已下单,无法更改;",$k));
...
@@ -398,6 +413,7 @@ class BomService {
...
@@ -398,6 +413,7 @@ class BomService {
continue
;
continue
;
}
}
}
else
{
}
else
{
//新增
//新增
if
(
$this
->
addBomItemMatchingBySearchApi
(
$item
,
$res
,
$extend
)){
if
(
$this
->
addBomItemMatchingBySearchApi
(
$item
,
$res
,
$extend
)){
continue
;
continue
;
...
@@ -419,7 +435,8 @@ class BomService {
...
@@ -419,7 +435,8 @@ class BomService {
}
catch
(
BomException
$e
){
}
catch
(
BomException
$e
){
return
[
'errcode'
=>
$e
->
getCode
(),
"errmsg"
=>
$e
->
getMessage
()];
return
[
'errcode'
=>
$e
->
getCode
(),
"errmsg"
=>
$e
->
getMessage
()];
}
catch
(
\Exception
$e
){
}
catch
(
\Exception
$e
){
return
[
'errcode'
=>-
1
,
"errmsg"
=>
$e
->
getMessage
()];
return
[
'errcode'
=>-
1
,
"errmsg"
=>
sprintf
(
"操作异常,请联系技术员 %s"
,
$e
->
getMessage
())];
}
}
}
}
...
@@ -534,16 +551,16 @@ class BomService {
...
@@ -534,16 +551,16 @@ class BomService {
$returnErrorMsg
=
""
;
$returnErrorMsg
=
""
;
if
(
isset
(
$bk1
))
if
(
isset
(
$bk1
))
$returnErrorMsg
.=
$bk1
?
"自营下单成功
"
:
"自营下单失败
"
;
$returnErrorMsg
.=
$bk1
?
"自营下单成功
:
\n
<br/>"
:
"自营下单失败:
\n
<br/>
"
;
if
(
isset
(
$bk2
))
if
(
isset
(
$bk2
))
$returnErrorMsg
.=
$bk2
?
"联营下单成功
"
:
"联营下单失败
"
;
$returnErrorMsg
.=
$bk2
?
"联营下单成功
:
\n
<br/>"
:
"联营下单失败:
\n
<br/>
"
;
if
(
!
empty
(
$err_msg
))
if
(
!
empty
(
$err_msg
))
$returnErrorMsg
.=
implode
(
"
\n
"
,
$err_msg
);
$returnErrorMsg
.=
implode
(
"
\n
<br/>"
,
$err_msg
);
//dump($err_msg);
return
[
'errcode'
=>
0
,
"errmsg"
=>
$returnErrorMsg
];
return
[
'errcode'
=>
0
,
"errmsg"
=>
$returnErrorMsg
];
...
...
resources/views/web/BomReport.blade.php
View file @
9abdda59
...
@@ -47,48 +47,31 @@
...
@@ -47,48 +47,31 @@
<tr>
<tr>
<th
lay-data=
""
>
提交BOM单数量
</th>
<th
lay-data=
""
>
提交BOM单数量
</th>
<th
lay-data=
""
>
BOM单数量
</th>
<th
lay-data=
""
>
BOM单数量
</th>
<th
lay-data=
""
>
BOM付款数量
</th>
{{--
<th
lay-data=
""
>
BOM付款数量
</th>
--}}
<th
lay-data=
""
>
提交型号数
</th>
<th
lay-data=
""
>
提交型号数
</th>
<th
lay-data=
""
>
下单型号数
</th>
<th
lay-data=
""
>
下单型号数
</th>
<th
lay-data=
>
付款型号数</th
>
{{--
<th
lay-data=
>
付款型号数</th
>
--}}
<th
lay-data=
>
提交BOM金额</th
>
<th
lay-data=
>
提交BOM金额</th
>
<th
lay-data=
>
下单BOM金额</th
>
<th
lay-data=
>
下单BOM金额</th
>
<th
>
无结果型号
</th>
<th>
询价型号数
</th>
</tr>
</tr>
<tr>
<tr>
<th
id=
"field1"
></th>
<th
id=
"field1"
></th>
<th
id=
"field2"
></th>
<th
id=
"field2"
></th>
<th
id=
"field3"
></th>
{{--
<th
id=
"field3"
></th>
--}}
<th
id=
"field4"
></th>
<th
id=
"field4"
></th>
<th
id=
"field5"
></th>
<th
id=
"field5"
></th>
<th
id=
"field6"
></th>
{{--
<th
id=
"field6"
></th>
--}}
<th
id=
"field7"
></th>
<th
id=
"field7"
></th>
<th
id=
"field8"
></th>
<th
id=
"field8"
></th>
</tr>
<tr>
<th
>
付款BOM金额
</th>
<th
>
无结果型号
</th>
<th>
询价型号数
</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th
id=
"field9"
></th>
<th
id=
"field10"
></th>
<th
id=
"field10"
></th>
<th
id=
"field11"
></th>
<th
id=
"field11"
></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</tr>
</table>
</table>
</div>
</div>
</div>
</div>
...
...
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