Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dsyerp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
dsyerp
Commits
f100e9a5
Commit
f100e9a5
authored
Apr 25, 2023
by
wxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一键复制粘贴出库商品
parent
0fab4369
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
4 deletions
+77
-4
module/Stock/src/Controller/ExWarehouseController.php
module/Stock/src/Controller/ExWarehouseController.php
+11
-2
module/Stock/src/Repository/ExWarehouseOrderGoodsRepository.php
.../Stock/src/Repository/ExWarehouseOrderGoodsRepository.php
+16
-0
module/Stock/view/stock/ex-warehouse/add.phtml
module/Stock/view/stock/ex-warehouse/add.phtml
+21
-0
module/Stock/view/stock/ex-warehouse/index.phtml
module/Stock/view/stock/ex-warehouse/index.phtml
+29
-2
No files found.
module/Stock/src/Controller/ExWarehouseController.php
View file @
f100e9a5
...
...
@@ -65,8 +65,17 @@ class ExWarehouseController extends AbstractActionController
}
$array
[
'searchForm'
]
=
$searchForm
;
$query
=
$this
->
entityManager
->
getRepository
(
ExWarehouseOrder
::
class
)
->
findExWarehouseOrderList
(
$search
);
$array
[
'orderList'
]
=
$this
->
adminCommon
()
->
erpPaginator
(
$query
,
$page
);
$orderList
=
$this
->
adminCommon
()
->
erpPaginator
(
$query
,
$page
);
foreach
(
$orderList
as
$key
=>
$value
){
$orderGoodsIds
=
$this
->
entityManager
->
getRepository
(
ExWarehouseOrderGoods
::
class
)
->
findGoodsIdSearch
([
'ex_warehouse_order_id'
=>
$value
->
getExWarehouseOrderId
()]);
if
(
$orderGoodsIds
){
$goodsIds
=
array_column
(
$orderGoodsIds
,
"goodsId"
);
$value
->
orderGoodsIds
=
implode
(
","
,
$goodsIds
);
}
else
{
$value
->
orderGoodsIds
=
''
;
}
}
$array
[
'orderList'
]
=
$orderList
;
return
$array
;
}
...
...
module/Stock/src/Repository/ExWarehouseOrderGoodsRepository.php
View file @
f100e9a5
...
...
@@ -35,6 +35,22 @@ class ExWarehouseOrderGoodsRepository extends EntityRepository
return
$ExWarehouseAmount
?
$ExWarehouseAmount
:
0
;
}
/**
* 检索商品id
* @param $goodsName
* @return mixed
*/
public
function
findGoodsIdSearch
(
$search
=
[])
{
//当定义为某个字段时,输出的是数组
$query
=
$this
->
getEntityManager
()
->
createQueryBuilder
()
->
select
(
'e.goodsId,e.goodsName'
)
->
from
(
ExWarehouseOrderGoods
::
class
,
'e'
);
$this
->
querySearchData
(
$search
,
$query
);
$goodsIdResult
=
$query
->
getQuery
()
->
getResult
();
return
$goodsIdResult
;
}
private
function
querySearchData
(
$search
,
QueryBuilder
$queryBuilder
)
{
if
(
isset
(
$search
[
'ex_warehouse_order_goods_id'
])
&&
!
empty
(
$search
[
'ex_warehouse_order_goods_id'
]))
$queryBuilder
->
andWhere
(
$queryBuilder
->
expr
()
->
eq
(
'e.exWarehouseOrderGoodsId'
,
$search
[
'ex_warehouse_order_goods_id'
]));
...
...
module/Stock/view/stock/ex-warehouse/add.phtml
View file @
f100e9a5
...
...
@@ -64,6 +64,14 @@
</div>
<div
class=
"row"
>
<div
class=
"col-xs-4 form-group"
>
<div
class=
"col-sm-12"
>
<input
type=
"text"
id=
"pastevalue"
placeholder=
"这里是粘贴的内容"
/>
<button
type=
"button"
onclick=
"toPaste();"
class=
"btn btn-primary btn-sm"
><i
class=
"fa fa-copy"
aria-hidden=
"true"
></i>
<?php
echo
$this
->
translate
(
'粘贴'
);
?>
</button>
</div>
</div>
</div>
<?php
$goodsForm
=
$this
->
goodsForm
;
?>
...
...
@@ -241,4 +249,17 @@
function
searchGoods
()
{
dberpAjaxList
(
'
<?php
echo
$this
->
url
(
'goods'
,
[
'action'
=>
'ajaxGoodsSearch'
]);
?>
?searchGoodsName=
'
+
$
(
'
#searchGoodsName
'
).
val
(),
'
addGoodsListBody
'
);
}
function
toPaste
()
{
var
pastevalue
=
document
.
getElementById
(
"
pastevalue
"
).
value
;
var
array
=
pastevalue
.
split
(
'
,
'
);
if
(
array
.
length
>
0
){
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
){
addSelectGoods
(
array
[
i
]);
}
}
else
{
alert
(
"
请输入商品id
"
);
}
}
</script>
\ No newline at end of file
module/Stock/view/stock/ex-warehouse/index.phtml
View file @
f100e9a5
...
...
@@ -9,7 +9,6 @@
</h1>
</section>
<section
class=
"content"
>
<?php
echo
$this
->
partial
(
'layout/messages'
);
?>
...
...
@@ -91,7 +90,8 @@
[
'action'
=>
'view'
,
'id'
=>
$order
->
getExWarehouseOrderId
()]);
?>
"
class=
"btn btn-xs btn-info"
><i
class=
"fa fa-info-circle"
></i>
<?php
echo
$this
->
translate
(
'查看'
);
?>
</a>
</td>
<input
type=
"hidden"
value=
"
<?php
echo
$this
->
escapeHtml
(
$order
->
orderGoodsIds
);
?>
"
id=
"orderIds
<?php
echo
$this
->
escapeHtml
(
$order
->
getExWarehouseOrderId
());
?>
"
>
<button
type=
"button"
onclick=
"toCopy(
<?php
echo
$this
->
escapeHtml
(
$order
->
getExWarehouseOrderId
());
?>
);"
class=
"btn btn-primary btn-sm"
><i
class=
"fa fa-copy"
aria-hidden=
"true"
></i>
<?php
echo
$this
->
translate
(
'复制'
);
?>
</button>
</tr>
<?php
}
}
else
{
?>
<tfoot>
...
...
@@ -115,4 +115,31 @@
<script
type=
"text/javascript"
>
laydate
.
render
({
elem
:
'
#start_time
'
});
laydate
.
render
({
elem
:
'
#end_time
'
});
//复制
function
toCopy
(
id
)
{
var
copyval
=
$
(
'
#orderIds
'
+
id
).
val
();
console
.
log
(
"
复制的内容:
"
+
copyval
);
copyText
(
copyval
);
}
//复制事件
function
copyText
(
text
)
{
var
textarea
=
document
.
createElement
(
"
textarea
"
);
var
currentFocus
=
document
.
activeElement
;
document
.
body
.
appendChild
(
textarea
);
textarea
.
value
=
text
;
textarea
.
focus
();
if
(
textarea
.
setSelectionRange
)
textarea
.
setSelectionRange
(
0
,
textarea
.
value
.
length
);
else
textarea
.
select
();
try
{
var
flag
=
document
.
execCommand
(
"
copy
"
);
}
catch
(
eo
)
{
var
flag
=
false
;
}
document
.
body
.
removeChild
(
textarea
);
currentFocus
.
focus
();
return
flag
;
}
</script>
\ No newline at end of file
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