Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
Laisi_AutoMES2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiawei.su
Laisi_AutoMES2
Commits
3478e042
Commit
3478e042
authored
Jan 19, 2021
by
yucheng.jiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
储位信息维护
parent
c9dee765
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
222 additions
and
440 deletions
+222
-440
storagemaintenance.vue
Html/src/view/wms/config/storagemaintenance.vue
+222
-440
No files found.
Html/src/view/wms/config/storagemaintenance.vue
View file @
3478e042
<
template
>
<
template
>
<div>
<div>
<div
class=
"divborder leftDiv"
>
<div
class=
"divborder newSearchDiv"
>
<Tree
class=
"treeDiv"
:data=
"data1"
ref=
"tree"
@
on-select-change=
"getTypeid()"
></Tree>
<div
class=
"filter"
>
</div>
<label>
{{
$t
(
8070
)
}}
:
</label>
<div
class=
"rightDiv"
>
<Select
v-model=
"whid"
label-in-value
clearable
filterable
filter-by-label
class=
"searchSelect"
>
<div
class=
"divborder newSearchDiv"
>
<Option
<div
class=
"searchBtn"
>
v-for=
"(item,index) in whdata"
<Button
:value=
"item.id"
type=
"success"
:key=
"index"
class=
"twoWord"
:label=
"item.name"
icon=
"md-add-circle"
>
{{
item
.
name
}}
</Option
@
click=
"add()"
>
{{
$t
(
'1002'
)
}}
</Button>
<Button
type=
"warning"
class=
"twoWord"
icon=
"ios-create-outline"
@
click=
"edit()"
>
{{
$t
(
'1003'
)
}}
</Button>
<Button
type=
"primary"
class=
"twoWord intervalRight"
icon=
"ios-cloud-download"
@
click=
"print()"
>
打印
</Button>
<Button
type=
"primary"
class=
"fourWord"
icon=
"md-download"
@
click=
"loadexcel()"
>
{{
$t
(
'1005'
)
}}
</Button>
<Upload
style=
"display:inline-block"
ref=
"upload"
:action=
"action"
name=
"excel-file"
:headers=
"headers"
:show-upload-list=
"false"
:on-format-error=
"handleFormatError"
:on-success=
"handleSuccess"
:on-error=
"handleError"
:format=
"['xlsx']"
>
>
<Button
</Select>
type=
"primary"
</div>
class=
"fourWord"
<div
class=
"searchBtn"
>
icon=
"md-cloud-upload"
<Button
type=
"primary"
class=
"twoWord"
icon=
"ios-search"
@
click=
"tosearch()"
>
{{
$t
(
1001
)
}}
</Button>
>
{{
$t
(
'1006'
)
}}
</Button>
<Button
type=
"success"
class=
"twoWord"
icon=
"md-add-circle"
@
click=
"add()"
>
{{
$t
(
'1002'
)
}}
</Button>
</Upload>
<Button
type=
"warning"
class=
"twoWord"
icon=
"ios-create-outline"
@
click=
"edit()"
>
{{
$t
(
'1003'
)
}}
</Button>
<Button
type=
"error"
class=
"twoWord intervalRight"
icon=
"md-close-circle"
@
click=
"dele()"
>
{{
$t
(
1004
)
}}
</Button>
<!--
<Button
type=
"primary"
class=
"twoWord intervalRight"
icon=
"ios-cloud-download"
@
click=
"print()"
>
打印
</Button>
-->
<Button
type=
"primary"
class=
"fourWord"
icon=
"md-download"
@
click=
"loadexcel()"
>
{{
$t
(
'1005'
)
}}
</Button>
<Upload
style=
"display:inline-block"
ref=
"upload"
:action=
"action"
name=
"excel-file"
:headers=
"headers"
:show-upload-list=
"false"
:on-format-error=
"handleFormatError"
:on-success=
"handleSuccess"
:on-error=
"handleError"
:format=
"['xlsx']"
>
<Button
<Button
type=
"primary"
type=
"primary"
class=
"fourWord"
class=
"fourWord"
icon=
"
ios-cloud-down
load"
icon=
"
md-cloud-up
load"
@
click=
"Export()"
>
{{
$t
(
'1006'
)
}}
</Button>
>
{{
$t
(
'1007'
)
}}
</Button
>
</Upload
>
<
/div
>
<
Button
type=
"primary"
class=
"fourWord"
icon=
"ios-cloud-download"
@
click=
"Export()"
>
{{
$t
(
'1007'
)
}}
</Button
>
</div>
</div>
<div
class=
"divborder newTableDiv"
>
</div
>
<Table
<div
class=
"divborder newTableDiv"
>
class=
"tableClass"
<Table
@
on-current-change=
"handleRowChange
"
class=
"tableClass
"
highlight-row
@
on-current-change=
"handleRowChange"
:data=
"tableData1"
highlight-row
:columns=
"tableColumns
1"
:data=
"tableData
1"
></Table>
:columns=
"tableColumns1"
<div
class=
"pageDiv"
>
></Table
>
<div
class=
"pageDirection
"
>
<div
class=
"pageDiv
"
>
<Page
<div
class=
"pageDirection"
>
:total=
"total"
<Page
:current=
"page
"
:total=
"total
"
@
on-change=
"changeP
age"
:current=
"p
age"
show-elevator
@
on-change=
"changePage"
show-size
r
show-elevato
r
show-total
show-sizer
@
on-page-size-change=
"handlePageSize"
show-total
:page-size-opts=
"[10,20,30,40,100]
"
@
on-page-size-change=
"handlePageSize
"
></Page>
:page-size-opts=
"[10,20,30,40,100]"
</div
>
></Page
>
</div>
</div>
</div>
</div>
<Modal
class=
"newModalClass"
v-model=
"modal"
:styles=
"
{width:'500px'}">
</div>
<p
slot=
"header"
>
<Modal
class=
"newModalClass"
v-model=
"modal"
:styles=
"
{width:'400px'}">
<span
v-show=
"type==1"
>
添加储位信息
</span>
<p
slot=
"header"
>
<span
v-show=
"type==2"
>
修改储位信息
</span>
<span
v-show=
"type==1"
>
{{
$t
(
'1002'
)
}}
</span>
</p>
<span
v-show=
"type==2"
>
{{
$t
(
'1003'
)
}}
</span>
<div>
</p>
<div
class=
"filter"
>
<div
style=
"max-height:250px;overflow: auto;"
>
<label>
<div
class=
"filter"
>
<i>
*
</i>
当前储位名称:
<label><i>
*
</i>
ID:
</label>
</label>
<InputNumber
type=
"number"
class=
"searchInput"
v-model=
"stid"
:min=
"1"
/>
<Input
type=
"text"
class=
"searchInput"
v-model=
"name1"
/>
</div>
<div
class=
"filter row"
v-show=
"type==2"
>
<label>
是否停用:
</label>
<Checkbox
v-model=
"isdel"
style=
"width:25px"
></Checkbox>
</div>
</div>
</div>
<div
slot=
"footer"
>
<div
class=
"filter"
>
<Button
type=
"text"
size=
"large"
@
click=
"closeadd()"
>
{{
$t
(
'1033'
)
}}
</Button>
<label><i>
*
</i>
{{
$t
(
8070
)
}}
:
</label>
<Button
type=
"primary"
size=
"large"
@
click=
"adddata()"
>
{{
$t
(
'1011'
)
}}
</Button>
<Select
v-model=
"whid1"
label-in-value
clearable
filterable
filter-by-label
class=
"searchSelect"
>
<Option
v-for=
"(item,index) in whdata1"
:value=
"item.id"
:key=
"index"
:label=
"item.name"
>
{{
item
.
name
}}
</Option
>
</Select>
</div>
</div>
</Modal>
<div
class=
"filter"
v-for=
"(item,index) in sTypes"
:key=
"index"
>
</div>
<label><i>
*
</i>
{{
item
.
name
}}
:
</label>
<Input
type=
"text"
class=
"searchInput"
v-model=
"item.val"
/>
<!-- 打印设备二维码 -->
</div>
<Modal
<div
class=
"filter row"
v-show=
"type==2"
>
class=
"newModalClass"
<label>
是否停用:
</label>
:title=
"$t('5500098')"
<Checkbox
v-model=
"isdel"
style=
"width:25px"
></Checkbox>
v-model=
"downloadexe"
:styles=
"
{width:'700px'}"
>
<div
class=
"modal_body"
style=
"width:700px!important;padding:0 20px;"
>
<div
style=
"width:660px;padding-left:5px;"
>
<div>
<div
class=
"filter"
>
<a
href=
"/static/lodop/CLodop_Setup_for_Win32NT.exe"
>
{{
$t
(
'5500099'
)
}}
:CLodop_Setup_for_Win32NT.exe
</a>
<br
/>
<a
href=
"/static/lodop/install_lodop32.exe"
>
{{
$t
(
'5500099'
)
}}
:install_lodop32.exe
</a>
<br
/>
<a
href=
"/static/lodop/install_lodop64.exe"
>
{{
$t
(
'5500099'
)
}}
:install_lodop64.exe
</a>
</div>
</div>
</div>
</div>
</div>
</Modal>
<Modal
class=
"newModalClass"
:title=
"$t('100077')"
v-model=
"printModal"
:styles=
"
{width:'300px'}"
>
<div
id=
"print1"
>
<div
id=
"printHtml"
style=
"width:50px;"
></div>
<div
id=
"code"
style=
"font-size:12px"
></div>
</div>
</div>
<div
slot=
"footer"
>
<div
slot=
"footer"
>
<Button
type=
"text"
size=
"large"
@
click=
"printModal = false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"text"
size=
"large"
@
click=
"this.modal=false"
>
{{
$t
(
'1033'
)
}}
</Button>
<!--
<Button
type=
"primary"
size=
"large"
v-print=
"'print1'"
>
{{
$t
(
'1011'
)
}}
</Button>
-->
<Button
type=
"primary"
size=
"large"
@
click=
"addPost()"
>
{{
$t
(
'1011'
)
}}
</Button>
<Button
type=
"primary"
size=
"large"
@
click=
"CreateOne()"
>
{{
$t
(
'1011'
)
}}
</Button>
</div>
</div>
</Modal>
</Modal>
</div>
</div>
...
@@ -152,10 +106,7 @@
...
@@ -152,10 +106,7 @@
<
script
>
<
script
>
import
axios
from
"@/libs/api.request"
;
import
axios
from
"@/libs/api.request"
;
import
{
getLodop
}
from
"../../../static/Clodop/LodopFuncs"
;
import
{
getLodop
}
from
"../../../static/Clodop/LodopFuncs"
;
// import { getLodop } from "@/assets/js/LodopFuncs";
import
QRCode
from
"qrcodejs2"
;
import
QRCode
from
"qrcodejs2"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -166,8 +117,8 @@ export default {
...
@@ -166,8 +117,8 @@ export default {
nonce
:
localStorage
.
getItem
(
"nonce"
),
nonce
:
localStorage
.
getItem
(
"nonce"
),
sign
:
localStorage
.
getItem
(
"sign"
),
sign
:
localStorage
.
getItem
(
"sign"
),
},
},
data1
:
[],
whdata
:[],
//仓库列表
name
:
""
,
whid
:[],
//选中仓库id
tableData1
:
[],
tableData1
:
[],
total
:
0
,
total
:
0
,
page
:
1
,
page
:
1
,
...
@@ -184,31 +135,16 @@ export default {
...
@@ -184,31 +135,16 @@ export default {
);
);
},
},
},
},
{
title
:
"仓库"
,
key
:
"storageName"
,
},
{
title
:
"区域"
,
key
:
"area"
,
},
{
title
:
"货架"
,
key
:
"shelf"
,
},
{
title
:
"层号"
,
key
:
"floor"
,
},
{
title
:
"位置"
,
key
:
"location"
,
},
{
title
:
"是否停用"
,
key
:
"state"
,
},
],
],
storeTypes
:[],
//储位类别
sTypes
:[],
//储位类别
whid1
:
''
,
//添加仓库
whdata1
:[],
//仓库列表
stid
:
1
,
//储位id
data1
:
[],
name
:
""
,
detailobj
:
{},
detailobj
:
{},
modal
:
false
,
modal
:
false
,
type
:
1
,
type
:
1
,
...
@@ -228,71 +164,95 @@ export default {
...
@@ -228,71 +164,95 @@ export default {
};
};
},
},
created
()
{
created
()
{
this
.
getCategory
();
this
.
initTableTitle
();
//获取列表标题
this
.
search
(
1
,
10
);
this
.
initStorage
();
this
.
tosearch
();
this
.
tableColumns1
=
this
.
$time
.
initTableTitle
(
this
.
tableColumns1
);
this
.
tableColumns1
=
this
.
$time
.
initTableTitle
(
this
.
tableColumns1
);
},
},
methods
:
{
methods
:
{
getCategory
()
{
//仓库下拉框
this
.
request
(
"/wms/Location/GetLocationTypeTree"
,
""
,
"get"
).
then
(
initStorage
(){
let
data
=
{
page
:
1
,
pageSize
:
1000000
,
typeid
:
0
,
// 产线层级id
name
:
''
,
};
this
.
request
(
"/wms/WaveHouse/GetWaveHouseList"
,
data
,
"get"
).
then
(
(
res
)
=>
{
(
res
)
=>
{
// console.log(res.data);
this
.
whdata
=
[];
if
(
res
.
data
.
ret
==
1
)
{
this
.
whdata1
=
[];
this
.
data1
=
res
.
data
.
data
.
children
;
let
data
=
res
.
data
.
data
;
let
arr
=
res
.
data
.
data
.
children
;
if
(
res
.
data
.
ret
==
1
&&
Array
.
isArray
(
data
)
&&
data
.
length
)
{
this
.
contentTree
(
this
.
data1
);
this
.
whdata
=
res
.
data
.
data
;
this
.
whdata1
=
res
.
data
.
data
;
}
}
}
}
);
);
},
},
contentTree
(
arr
)
{
//获取列表标题
arr
.
forEach
((
ele
)
=>
{
initTableTitle
(){
ele
.
disabled
=
false
;
let
data
=
{
// ele.value = ele.id;
page
:
1
,
// ele.label = ele.name;
pageSize
:
1000000
ele
.
title
=
ele
.
name
;
};
if
(
this
.
request
(
'/wms/Location/GetLocationTypeList'
,
data
,
'get'
).
then
(
ele
.
children
.
length
!=
0
&&
res
=>
{
ele
.
children
!=
undefined
&&
this
.
tableColumns1
=
[
ele
.
children
!=
null
{
)
{
type
:
"index2"
,
this
.
contentTree
(
ele
.
children
);
title
:
this
.
$t
(
"1008"
),
key
:
"xuhao"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"span"
,
params
.
index
+
(
this
.
page
-
1
)
*
this
.
pagesize
+
1
);
},
},
{
key
:
'storageName'
,
title
:
this
.
$t
(
'8070'
)
}
];
let
data
=
res
.
data
.
data
;
this
.
storeTypes
=
res
.
data
.
data
;
if
(
res
.
data
.
ret
==
1
&&
Array
.
isArray
(
data
)
&&
data
.
length
)
{
data
.
forEach
((
item
,
key
)
=>
{
this
.
tableColumns1
.
push
({
key
:
'sm_'
+
key
,
title
:
item
.
name
});
})
this
.
tableColumns1
.
push
({
key
:
'state'
,
title
:
this
.
$t
(
'920152'
)
})
}
}
}
}
);
);
},
},
getTypeid
()
{
//查询储位
this
.
detailobj
=
{};
tosearch
(){
let
node
=
this
.
$refs
.
tree
.
getSelectedNodes
();
this
.
page
=
1
;
this
.
node
=
node
;
this
.
pagesize
=
10
;
// console.log(node)
this
.
search
();
if
(
node
.
length
>
0
)
{
this
.
typeid
=
node
[
0
].
id
;
this
.
typelevel
=
node
[
0
].
level
==
0
?
1
:
0
;
this
.
search
(
1
,
10
);
}
else
{
this
.
typeid
=
0
;
this
.
typelevel
=
0
;
this
.
search
(
1
,
10
);
}
},
},
search
(
page
,
pagesize
)
{
search
()
{
let
data
=
{
let
data
=
{
page
:
page
,
page
:
this
.
page
,
pageSize
:
pagesize
,
pageSize
:
this
.
pagesize
,
id
:
this
.
typeid
,
// 产线层级id
id
:
this
.
typeid
,
// 产线层级id
isWavehouse
:
this
.
typelevel
,
isWavehouse
:
this
.
typelevel
,
};
};
this
.
page
=
page
;
this
.
detailobj
=
{};
this
.
pagesize
=
pagesize
;
this
.
request
(
"/wms/Location/GetLocationList"
,
data
,
"get"
).
then
(
this
.
request
(
"/wms/Location/GetLocationList"
,
data
,
"get"
).
then
(
(
res
)
=>
{
(
res
)
=>
{
this
.
total
=
0
;
this
.
tableData1
=
[];
if
(
res
.
data
.
ret
==
1
)
{
if
(
res
.
data
.
ret
==
1
)
{
this
.
total
=
res
.
data
.
total
;
this
.
total
=
res
.
data
.
total
;
this
.
renderTable
(
res
.
data
.
data
);
this
.
renderTable
(
res
.
data
.
data
);
}
else
{
// this.$Message.error(this.$t(res.data.msg));
this
.
tableData1
=
[];
}
}
}
}
);
);
...
@@ -306,107 +266,92 @@ export default {
...
@@ -306,107 +266,92 @@ export default {
pid
:
item
.
pid
,
pid
:
item
.
pid
,
serialNumber
:
item
.
serialNumber
,
serialNumber
:
item
.
serialNumber
,
storageName
:
item
.
storageName
,
storageName
:
item
.
storageName
,
serial_number
:
item
.
serial_number
,
sm_0
:
item
.
field
[
0
],
area
:
item
.
field
[
0
],
sm_1
:
item
.
field
[
1
],
shelf
:
item
.
field
[
1
],
sm_2
:
item
.
field
[
2
],
floor
:
item
.
field
[
2
],
sm_3
:
item
.
field
[
3
],
location
:
item
.
field
[
3
],
state
:
item
.
state
==
1
?
"否"
:
"是"
,
state
:
item
.
state
==
1
?
"否"
:
"是"
,
});
});
});
});
}
}
this
.
tableData1
=
data
;
this
.
tableData1
=
data
;
},
},
//添加弹窗
add
()
{
add
()
{
if
(
this
.
typeid
==
""
)
{
//判断储位类别存不存在
this
.
$Message
.
error
(
"请先选择左边树形菜单"
);
if
(
!
this
.
storeTypes
||
!
this
.
storeTypes
.
length
){
this
.
$Message
.
error
(
"请先创建储位类别"
);
return
false
;
return
false
;
}
}
this
.
name1
=
""
;
this
.
sTypes
=
[];
this
.
type
=
1
;
this
.
storeTypes
.
forEach
((
item
)
=>
{
this
.
sTypes
.
push
({
id
:
item
.
id
,
name
:
item
.
name
,
val
:
''
})
})
this
.
whid1
=
""
;
this
.
stid
=
1
;
this
.
type
=
1
;
//添加
this
.
modal
=
true
;
this
.
modal
=
true
;
},
},
adddata
()
{
//添加提交
let
url
=
""
,
addPost
(){
msg
=
""
;
let
code
=
0
;
if
(
!
this
.
stid
){
// console.log(this.typelevel);
code
=
1
;
this
.
name1
=
this
.
name1
.
trim
();
}
if
(
this
.
name1
==
""
)
{
this
.
sTypes
.
forEach
((
item
)
=>
{
this
.
$Message
.
error
(
"请输入储位名称"
);
if
(
item
===
""
){
code
=
1
;
}
})
//编辑,不能修改仓库
if
(
this
.
type
===
1
&&
!
this
.
whid1
){
code
=
1
;
}
if
(
code
===
1
){
this
.
$Message
.
error
(
this
.
$t
(
'9000136'
));
return
false
;
return
false
;
}
}
let
data
=
{
let
url
=
''
;
parentid
:
this
.
typeid
,
if
(
this
.
type
===
1
){
name
:
this
.
name1
,
url
=
'/wms/Location/AddLocation'
;
status
:
1
,
}
else
{
type
:
this
.
typelevel
==
1
?
0
:
1
,
url
=
'/wms/Location/UpdateLocation'
;
};
if
(
this
.
type
==
1
)
{
data
.
status
=
1
;
url
=
"/wms/Location/AddLocation"
;
msg
=
"添加成功"
;
}
else
{
data
.
id
=
this
.
detailobj
.
id
?
this
.
detailobj
.
id
:
this
.
node
[
0
].
id
;
data
.
parentid
=
this
.
detailobj
.
pid
?
this
.
detailobj
.
pid
:
this
.
node
[
0
].
pid
;
data
.
status
=
this
.
isdel
==
false
?
1
:
0
;
data
.
type
=
0
;
url
=
"/wms/Location/UpdateLocation"
;
msg
=
"修改成功"
;
}
}
this
.
request
(
url
,
data
,
"post"
).
then
((
res
)
=>
{
this
.
request
(
url
,
data
,
"post"
).
then
((
res
)
=>
{
if
(
res
.
data
.
ret
==
1
)
{
if
(
res
.
data
.
ret
==
1
)
{
this
.
$Message
.
success
(
msg
);
this
.
search
(
1
,
10
);
this
.
getCategory
();
this
.
detailobj
=
{};
this
.
modal
=
false
;
this
.
modal
=
false
;
if
(
this
.
type
===
1
){
this
.
tosearch
();
this
.
$Message
.
success
(
this
.
$t
(
'1055'
));
}
else
{
this
.
$Message
.
success
(
this
.
$t
(
'1060'
));
this
.
search
();
}
}
else
{
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
+
''
));
setTimeout
(()
=>
{
this
.
modal
=
false
;
},
1000
);
this
.
search
(
1
,
10
);
}
}
});
});
},
},
edit
()
{
edit
()
{
if
(
this
.
typelevel
==
1
)
{
if
(
!
this
.
detailobj
||
!
this
.
detailobj
.
id
)
{
this
.
$Message
.
error
(
"不能选择第一级仓库"
);
this
.
$Message
.
error
(
this
.
$t
(
'1017'
));
return
false
;
}
if
(
!
this
.
detailobj
.
id
&&
this
.
typeid
==
0
)
{
this
.
$Message
.
error
(
"请选择数据"
);
return
false
;
return
false
;
}
}
if
(
this
.
detailobj
.
id
)
{
this
.
name1
=
this
.
detailobj
.
location
;
this
.
type
=
2
;
//修改
this
.
isdel
=
this
.
detailobj
.
isdel
==
"是"
;
}
if
(
this
.
typeid
!=
0
)
{
this
.
name1
=
this
.
node
[
0
].
title
;
this
.
isdel
=
this
.
detailobj
.
isdel
==
"是"
;
}
this
.
type
=
2
;
this
.
modal
=
true
;
this
.
modal
=
true
;
},
},
closeadd
()
{
this
.
modal
=
false
;
this
.
detailobj
=
{};
},
handleRowChange
(
currentRow
,
oldCurrentRow
)
{
handleRowChange
(
currentRow
,
oldCurrentRow
)
{
this
.
detailobj
=
currentRow
;
this
.
detailobj
=
currentRow
;
// console.log(this.detailobj);
},
},
handlePageSize
(
value
)
{
handlePageSize
(
value
)
{
this
.
page
=
1
;
this
.
pagesize
=
value
;
this
.
pagesize
=
value
;
this
.
tableData1
=
this
.
search
(
this
.
page
,
this
.
pagesize
);
this
.
tableData1
=
this
.
search
(
this
.
page
,
this
.
pagesize
);
},
},
...
@@ -414,148 +359,7 @@ export default {
...
@@ -414,148 +359,7 @@ export default {
this
.
page
=
value
;
this
.
page
=
value
;
this
.
tableData1
=
this
.
search
(
this
.
page
,
this
.
pagesize
);
this
.
tableData1
=
this
.
search
(
this
.
page
,
this
.
pagesize
);
},
},
downexe
()
{
window
.
location
.
href
=
"http://61.177.28.246:8102/Resources/tool/Lodop/CLodop_Setup_for_Win32NT.exe"
;
},
print
()
{
if
(
this
.
typeid
==
0
)
{
this
.
$Message
.
error
(
"请先选择左边树形菜单"
);
return
false
;
}
if
(
this
.
typelevel
==
1
)
{
this
.
$Message
.
error
(
"不能选择第一级仓库"
);
return
false
;
}
var
data
=
{
id
:
this
.
typeid
,
};
this
.
request
(
"/wms/Print/GetLocation"
,
data
,
"get"
).
then
((
res
)
=>
{
if
(
res
.
data
.
ret
==
1
&&
res
.
data
.
data
.
length
>
0
)
{
let
code
=
""
,
text
=
""
,
arr
=
[];
arr
=
res
.
data
.
data
[
0
];
code
=
arr
[
arr
.
length
-
1
].
sn
;
text
=
arr
[
arr
.
length
-
1
].
v
;
// console.log(code);
// return
document
.
getElementById
(
"printHtml"
).
innerHTML
=
""
;
document
.
getElementById
(
"code"
).
innerHTML
=
""
;
var
qrcode
=
new
QRCode
(
document
.
getElementById
(
"printHtml"
),
{
text
:
code
,
width
:
40
,
// 生成的二维码的宽度
height
:
40
,
// 生成的二维码的高度
colorDark
:
"#000000"
,
// 生成的二维码的深色部分
colorLight
:
"#ffffff"
,
// 生成二维码的浅色部分
correctLevel
:
QRCode
.
CorrectLevel
.
H
,
}
);
document
.
getElementById
(
"code"
).
innerHTML
=
text
;
this
.
printModal
=
true
;
// this.getQrcode(code, "printHtml");
// var data = [];
// $.each(res.data.data, function (i, ele) {
// var arr = {};
// var sn = ""; // 编号
// var arr1 = [];
// $.each(ele, function (key, value) {
// sn = value.sn;
// var text = value.k + ":" + value.v;
// arr1.push(text);
// });
// arr.serinum = sn;
// arr.columns = arr1;
// data.push(arr);
// });
// var dataArray = {
// type: 1, // 二维码打印
// data: data,
// };
// console.log(dataArray);
// this.LaunchApp(JSON.stringify(dataArray));
// this.LaunchApp(dataArray);
}
else
{
alert
(
this
.
$t
(
res
.
msg
));
}
});
},
CreateOne
()
{
LODOP
=
getLodop
();
let
list
=
document
.
getElementById
(
"print1"
);
// console.log(list[i].innerHTML);
var
html
=
""
;
html
=
"<body>"
+
list
.
innerHTML
;
(
"</body>"
);
LODOP
.
PRINT_INIT
(
""
);
// 打印初始化
// LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "60%");
LODOP
.
ADD_PRINT_HTM
(
20
,
50
,
400
,
300
,
html
);
// LODOP.PREVIEW(); // 打印预览
LODOP
.
PRINT
();
},
LaunchApp
(
data
)
{
let
LODOP
=
getLodop
();
if
(
LODOP
===
undefined
)
{
this
.
downloadexe
=
true
;
}
else
{
if
(
data
)
{
if
(
data
.
data
.
length
>
0
)
{
data
.
data
.
forEach
((
item
,
index
)
=>
{
this
.
CreateOneFormPage
(
item
);
});
}
}
}
// try {
// var ret = confirm('调用打印机?');
// if (ret == true) {
// window.location = 'myapp://' + data;
// }
// } catch (ex) {
// let errMsg = '启动 myapp 报错.\n\n';
// alert(errMsg);
// }
},
CreateOneFormPage
(
data
)
{
// 组装数据
var
sn
=
data
.
serinum
;
LODOP
=
getLodop
(
document
.
getElementById
(
"LODOP1"
));
LODOP
.
PRINT_INIT
(
"储位打印"
);
LODOP
.
SET_PRINT_STYLE
(
"FontSize"
,
14
);
LODOP
.
SET_PRINT_STYLE
(
"Bold"
,
1
);
// LODOP.SET_PRINT_COPIES(2);//打印份数
// LODOP.SET_PRINT_PAGESIZE(1,700,500,"");//设定纸张大小及打印方式
LODOP
.
ADD_PRINT_BARCODE
(
30
,
5
,
130
,
130
,
"QRCode"
,
sn
);
// 二维码打印
data
.
columns
.
forEach
((
ele
,
index
)
=>
{
var
num
=
30
+
index
*
30
;
var
text
=
ele
;
LODOP
.
ADD_PRINT_TEXT
(
num
,
120
,
300
,
30
,
text
);
});
LODOP
.
ADD_PRINT_TEXT
(
30
+
data
.
columns
.
length
*
30
,
120
,
300
,
30
,
"编号:"
+
sn
);
// LODOP.ADD_PRINT_TEXT(30,120,300,30,"仓库:一仓");
// LODOP.ADD_PRINT_TEXT(60,120,300,30,"区域:原材区001");
// LODOP.ADD_PRINT_TEXT(90,120,300,30,"货架:货架001");
// LODOP.ADD_PRINT_TEXT(120,120,300,30,"组号:组号001");
// LODOP.ADD_PRINT_TEXT(150,120,300,30,"层号:层号001");
// LODOP.ADD_PRINT_TEXT(180,120,300,30,"编号:C1_H1_Z1_C1_001");
},
handleFormatError
(
file
)
{
handleFormatError
(
file
)
{
this
.
$Message
.
error
(
this
.
$Message
.
error
(
this
.
$t
(
"950396"
)
+
file
.
name
+
this
.
$t
(
"950397"
)
this
.
$t
(
"950396"
)
+
file
.
name
+
this
.
$t
(
"950397"
)
...
@@ -604,28 +408,6 @@ export default {
...
@@ -604,28 +408,6 @@ export default {
}
}
);
);
},
},
// unloadexcel() {
// let file = this.readyFiles[0];
// const data = new FormData();
// data.append("file", file);
// data.append("type", 2);
// axios
// .request({
// url: "/tlm/Upload/Submit?templateName=TechToolList",
// data,
// method: "post"
// })
// .then(res => {
// if (res.ret === 1) {
// this.$Message.success(this.$t("100378"));
// } else {
// alert(res.data.msg);
// }
// })
// .catch(err => {
// alert(err.msg);
// });
// },
request
(
url
,
data
,
type
)
{
request
(
url
,
data
,
type
)
{
if
(
type
==
"get"
)
{
if
(
type
==
"get"
)
{
return
this
.
axios
return
this
.
axios
...
...
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