Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
Project
Project
Details
Activity
Releases
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
胡宝山
template_vue
Commits
3acc7b44
Commit
3acc7b44
authored
Mar 20, 2024
by
孙浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增库存管理,标签管理
parent
1d176c9e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
993 additions
and
0 deletions
+993
-0
incomeWmsBox.js
src/api/incomeWmsBox.js
+68
-0
incomeWmsLabel.js
src/api/incomeWmsLabel.js
+68
-0
incomeWmsBox.vue
src/views/template/incomeWmsBox.vue
+434
-0
incomeWmsLabel.vue
src/views/template/incomeWmsLabel.vue
+423
-0
No files found.
src/api/incomeWmsBox.js
0 → 100644
View file @
3acc7b44
import
request
from
'@/utils/request'
import
Qs
from
'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询库存管理列表
export
function
listIncomeWmsBox
(
query
)
{
return
request
({
url
:
'/incomewmsbox/list'
,
method
:
'get'
,
params
:
query
})
}
// 2. 查询库存管理详细信息
export
function
getIncomeWmsBox
(
businessId
)
{
return
request
({
url
:
'/incomewmsbox/detail/'
+
businessId
,
method
:
'get'
})
}
// 3. 新增库存管理
export
function
addIncomeWmsBox
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmsbox/add'
,
method
:
'post'
,
data
:
data
})
}
// 4. 修改库存管理
export
function
updateIncomeWmsBox
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmsbox/update/'
+
businessId
,
method
:
'put'
,
data
})
}
// 5. 逻辑删除库存管理
export
function
delIncomeWmsBox
(
businessId
)
{
return
request
({
url
:
'/incomewmsbox/deleteLogical/'
+
businessId
,
method
:
'delete'
})
}
// 6. 导出库存管理
export
function
exportIncomeWmsBox
(
query
)
{
return
request
({
url
:
'/incomewmsbox/export'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
src/api/incomeWmsLabel.js
0 → 100644
View file @
3acc7b44
import
request
from
'@/utils/request'
import
Qs
from
'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询标签管理列表
export
function
listIncomeWmsLabel
(
query
)
{
return
request
({
url
:
'/incomewmslabel/list'
,
method
:
'get'
,
params
:
query
})
}
// 2. 查询标签管理详细信息
export
function
getIncomeWmsLabel
(
businessId
)
{
return
request
({
url
:
'/incomewmslabel/detail/'
+
businessId
,
method
:
'get'
})
}
// 3. 新增标签管理
export
function
addIncomeWmsLabel
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmslabel/add'
,
method
:
'post'
,
data
:
data
})
}
// 4. 修改标签管理
export
function
updateIncomeWmsLabel
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/incomewmslabel/update/'
+
businessId
,
method
:
'put'
,
data
})
}
// 5. 逻辑删除标签管理
export
function
delIncomeWmsLabel
(
businessId
)
{
return
request
({
url
:
'/incomewmslabel/deleteLogical/'
+
businessId
,
method
:
'delete'
})
}
// 6. 导出标签管理
export
function
exportIncomeWmsLabel
(
query
)
{
return
request
({
url
:
'/incomewmslabel/export'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
src/views/template/incomeWmsBox.vue
0 → 100644
View file @
3acc7b44
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"lot"
prop=
"lot"
>
<el-input
v-model=
"queryParams.lot"
placeholder=
"请输入lot"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model=
"queryParams.pn"
placeholder=
"请输入pn"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"rank"
prop=
"rank"
>
<el-input
v-model=
"queryParams.rank"
placeholder=
"请输入rank"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"code"
prop=
"orderCode"
>
<el-input
v-model=
"queryParams.orderCode"
placeholder=
"请输入code"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"label_id"
prop=
"labelId"
>
<el-input
v-model=
"queryParams.labelId"
placeholder=
"请输入label_id"
clearable
:maxlength=
"50"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"flag"
>
<el-select
v-model=
"queryParams.flag"
placeholder=
"请选择状态"
clearable
size=
"small"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
:class=
"commonField.queryClass"
:type=
"commonField.typePrimary"
:icon=
"commonField.queryIcon"
:size=
"commonField.smallSize"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
:class=
"commonField.resetClass"
:icon=
"commonField.resetIcon"
:size=
"commonField.smallSize"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<div
style=
"float: right"
>
<el-form-item>
<el-button
:class=
"commonField.addClass"
:type=
"commonField.typePrimary"
:icon=
"commonField.addIcon"
:size=
"commonField.smallSize"
@
click=
"handleAdd"
>
新增
</el-button>
<el-button
:class=
"commonField.exportClass"
:type=
"commonField.typeSuccess"
:icon=
"commonField.exportIcon"
:size=
"commonField.smallSize"
@
click=
"handleExport"
>
导出
</el-button>
</el-form-item>
</div>
</el-form>
<div
class=
"placeholder"
/>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
库存管理列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"incomeWmsBoxList"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"lot"
prop=
"lot"
:show-overflow-tooltip=
"true"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
lot
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pn"
prop=
"pn"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"qty"
prop=
"qty"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
qty
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"rank"
prop=
"rank"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
rank
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"code"
prop=
"orderCode"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
orderCode
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"label_id"
prop=
"labelId"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
labelId
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
width=
"120"
label=
"状态"
prop=
"flag"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
class=
"switchDisabledStyle"
inactive-value=
"0"
active-value=
"1"
@
click
.
native=
"handleStatusChange(scope.row)"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
prop=
"remarks"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
remarks
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
prop=
"createDate"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createDate
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"200px"
>
<
template
slot-scope=
"scope"
>
<el-button
:class=
"commonField.updateClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
:class=
"commonField.delClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
<!-- 添加或修改库存管理配置对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"90px"
>
<el-form-item
label=
"lot"
prop=
"lot"
>
<el-input
v-model
.
trim=
"form.lot"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入lot"
/>
</el-form-item>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model
.
trim=
"form.pn"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"qty"
prop=
"qty"
>
<el-input-number
v-model
.
trim=
"form.qty"
controls-position=
"right"
:min=
"0"
/>
</el-form-item>
<el-form-item
label=
"rank"
prop=
"rank"
>
<el-input
v-model
.
trim=
"form.rank"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入rank"
/>
</el-form-item>
<el-form-item
label=
"code"
prop=
"orderCode"
>
<el-input
v-model
.
trim=
"form.orderCode"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入code"
/>
</el-form-item>
<el-form-item
label=
"label_id"
prop=
"labelId"
>
<el-input
v-model
.
trim=
"form.labelId"
show-word-limit
:maxlength=
"50"
placeholder=
"请输入label_id"
/>
</el-form-item>
<el-form-item
label=
"状态"
>
<el-radio-group
v-model=
"form.flag"
>
<el-radio
label=
"1"
>
启用
</el-radio>
<el-radio
label=
"0"
>
停用
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remarks"
>
<el-input
v-model
.
trim=
"form.remarks"
maxlength=
"200"
show-word-limit
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"cancelBtn"
@
click=
"cancel"
>
取 消
</el-button>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listIncomeWmsBox
,
getIncomeWmsBox
,
delIncomeWmsBox
,
addIncomeWmsBox
,
updateIncomeWmsBox
,
exportIncomeWmsBox
}
from
'@/api/incomeWmsBox'
import
commonField
from
'@/utils/commonField'
export
default
{
name
:
'IncomeWmsBox'
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 总条数
total
:
0
,
// 库存管理表格数据
incomeWmsBoxList
:
[],
// 弹出层标题
title
:
''
,
// 是否显示弹出层
open
:
false
,
// 状态菜单
statusOptions
:
[
{
dictLabel
:
'启用'
,
dictValue
:
'1'
},
{
dictLabel
:
'停用'
,
dictValue
:
'0'
}
],
// 查询参数
queryParams
:
{
page
:
1
,
rows
:
10
,
lot
:
undefined
,
pn
:
undefined
,
qty
:
undefined
,
rank
:
undefined
,
orderCode
:
undefined
,
labelId
:
undefined
,
flag
:
''
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
}
}
},
computed
:
{
commonField
()
{
return
commonField
}
},
created
()
{
this
.
getList
()
// 列表查询
},
methods
:
{
/** 查询库存管理列表 */
getList
()
{
this
.
loading
=
true
listIncomeWmsBox
(
this
.
queryParams
).
then
(
response
=>
{
this
.
incomeWmsBoxList
=
response
.
rows
this
.
total
=
response
.
total
this
.
loading
=
false
}
)
},
// 取消按钮
cancel
()
{
this
.
open
=
false
this
.
reset
()
},
// 表单重置
reset
()
{
this
.
form
=
{
businessId
:
undefined
,
remarks
:
undefined
,
lot
:
undefined
,
pn
:
undefined
,
qty
:
undefined
,
rank
:
undefined
,
orderCode
:
undefined
,
labelId
:
undefined
,
flag
:
'1'
}
this
.
resetForm
(
'form'
)
},
/** 查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
this
.
getList
()
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
queryParams
=
{
page
:
1
,
rows
:
10
,
lot
:
undefined
,
pn
:
undefined
,
qty
:
undefined
,
rank
:
undefined
,
orderCode
:
undefined
,
labelId
:
undefined
,
flag
:
''
}
this
.
handleQuery
()
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
()
this
.
open
=
true
this
.
title
=
'添加库存管理'
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
const
id
=
row
.
businessId
getIncomeWmsBox
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
open
=
true
this
.
title
=
'修改库存管理'
})
},
// 改变状态
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
this
.
$confirm
(
'确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
updateIncomeWmsBox
(
row
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
updateIncomeWmsBox
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
open
=
false
this
.
getList
()
})
}
else
{
addIncomeWmsBox
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'新增成功'
)
this
.
open
=
false
this
.
getList
()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
id
=
row
.
businessId
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
delIncomeWmsBox
(
id
)
}).
then
(()
=>
{
this
.
getList
()
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
this
.
$confirm
(
'是否确认操作?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
exportIncomeWmsBox
(
queryParams
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'库存管理信息'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
})
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.app-container
{
font-size
:
18px
;
padding
:
0
;
.placeholder
{
height
:
1
.3vh
;
background-color
:
#F4F4F4
;
margin-bottom
:
10px
}
}
</
style
>
src/views/template/incomeWmsLabel.vue
0 → 100644
View file @
3acc7b44
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"mac"
prop=
"mac"
>
<el-input
v-model=
"queryParams.mac"
placeholder=
"请输入mac"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model=
"queryParams.pn"
placeholder=
"请输入pn"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"location"
prop=
"location"
>
<el-input
v-model=
"queryParams.location"
placeholder=
"请输入location"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"barcode"
prop=
"barcode"
>
<el-input
v-model=
"queryParams.barcode"
placeholder=
"请输入barcode"
clearable
:maxlength=
"100"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"params"
prop=
"params"
>
<el-input
v-model=
"queryParams.params"
placeholder=
"请输入params"
clearable
:maxlength=
"2000"
size=
"small"
style=
"width: 150px"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"flag"
>
<el-select
v-model=
"queryParams.flag"
placeholder=
"请选择状态"
clearable
size=
"small"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
:class=
"commonField.queryClass"
:type=
"commonField.typePrimary"
:icon=
"commonField.queryIcon"
:size=
"commonField.smallSize"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
:class=
"commonField.resetClass"
:icon=
"commonField.resetIcon"
:size=
"commonField.smallSize"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
<div
style=
"float: right"
>
<el-form-item>
<el-button
:class=
"commonField.addClass"
:type=
"commonField.typePrimary"
:icon=
"commonField.addIcon"
:size=
"commonField.smallSize"
@
click=
"handleAdd"
>
新增
</el-button>
<el-button
:class=
"commonField.exportClass"
:type=
"commonField.typeSuccess"
:icon=
"commonField.exportIcon"
:size=
"commonField.smallSize"
@
click=
"handleExport"
>
导出
</el-button>
</el-form-item>
</div>
</el-form>
<div
class=
"placeholder"
/>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
标签管理列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"incomeWmsLabelList"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"mac"
prop=
"mac"
:show-overflow-tooltip=
"true"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
mac
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pn"
prop=
"pn"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"location"
prop=
"location"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
location
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"barcode"
prop=
"barcode"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
barcode
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"params"
prop=
"params"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
params
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
width=
"120"
label=
"状态"
prop=
"flag"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
class=
"switchDisabledStyle"
inactive-value=
"0"
active-value=
"1"
@
click
.
native=
"handleStatusChange(scope.row)"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
prop=
"remarks"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
remarks
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
prop=
"createDate"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createDate
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"200px"
>
<
template
slot-scope=
"scope"
>
<el-button
:class=
"commonField.updateClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
:class=
"commonField.delClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
<!-- 添加或修改标签管理配置对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"90px"
>
<el-form-item
label=
"mac"
prop=
"mac"
>
<el-input
v-model
.
trim=
"form.mac"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入mac"
/>
</el-form-item>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model
.
trim=
"form.pn"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"location"
prop=
"location"
>
<el-input
v-model
.
trim=
"form.location"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入location"
/>
</el-form-item>
<el-form-item
label=
"barcode"
prop=
"barcode"
>
<el-input
v-model
.
trim=
"form.barcode"
show-word-limit
:maxlength=
"100"
placeholder=
"请输入barcode"
/>
</el-form-item>
<el-form-item
label=
"params"
prop=
"params"
>
<el-input
v-model
.
trim=
"form.params"
show-word-limit
:maxlength=
"2000"
placeholder=
"请输入params"
/>
</el-form-item>
<el-form-item
label=
"状态"
>
<el-radio-group
v-model=
"form.flag"
>
<el-radio
label=
"1"
>
启用
</el-radio>
<el-radio
label=
"0"
>
停用
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remarks"
>
<el-input
v-model
.
trim=
"form.remarks"
maxlength=
"200"
show-word-limit
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"cancelBtn"
@
click=
"cancel"
>
取 消
</el-button>
<el-button
class=
"submitBtn"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listIncomeWmsLabel
,
getIncomeWmsLabel
,
delIncomeWmsLabel
,
addIncomeWmsLabel
,
updateIncomeWmsLabel
,
exportIncomeWmsLabel
}
from
'@/api/incomeWmsLabel'
import
commonField
from
'@/utils/commonField'
export
default
{
name
:
'IncomeWmsLabel'
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 总条数
total
:
0
,
// 标签管理表格数据
incomeWmsLabelList
:
[],
// 弹出层标题
title
:
''
,
// 是否显示弹出层
open
:
false
,
// 状态菜单
statusOptions
:
[
{
dictLabel
:
'启用'
,
dictValue
:
'1'
},
{
dictLabel
:
'停用'
,
dictValue
:
'0'
}
],
// 查询参数
queryParams
:
{
page
:
1
,
rows
:
10
,
mac
:
undefined
,
pn
:
undefined
,
location
:
undefined
,
barcode
:
undefined
,
params
:
undefined
,
flag
:
''
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
}
}
},
computed
:
{
commonField
()
{
return
commonField
}
},
created
()
{
this
.
getList
()
// 列表查询
},
methods
:
{
/** 查询标签管理列表 */
getList
()
{
this
.
loading
=
true
listIncomeWmsLabel
(
this
.
queryParams
).
then
(
response
=>
{
this
.
incomeWmsLabelList
=
response
.
rows
this
.
total
=
response
.
total
this
.
loading
=
false
}
)
},
// 取消按钮
cancel
()
{
this
.
open
=
false
this
.
reset
()
},
// 表单重置
reset
()
{
this
.
form
=
{
businessId
:
undefined
,
remarks
:
undefined
,
mac
:
undefined
,
pn
:
undefined
,
location
:
undefined
,
barcode
:
undefined
,
params
:
undefined
,
flag
:
'1'
}
this
.
resetForm
(
'form'
)
},
/** 查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
this
.
getList
()
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
queryParams
=
{
page
:
1
,
rows
:
10
,
mac
:
undefined
,
pn
:
undefined
,
location
:
undefined
,
barcode
:
undefined
,
params
:
undefined
,
flag
:
''
}
this
.
handleQuery
()
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
()
this
.
open
=
true
this
.
title
=
'添加标签管理'
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
const
id
=
row
.
businessId
getIncomeWmsLabel
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
open
=
true
this
.
title
=
'修改标签管理'
})
},
// 改变状态
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
this
.
$confirm
(
'确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
updateIncomeWmsLabel
(
row
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
updateIncomeWmsLabel
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
open
=
false
this
.
getList
()
})
}
else
{
addIncomeWmsLabel
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'新增成功'
)
this
.
open
=
false
this
.
getList
()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
id
=
row
.
businessId
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
delIncomeWmsLabel
(
id
)
}).
then
(()
=>
{
this
.
getList
()
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
this
.
$confirm
(
'是否确认操作?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
exportIncomeWmsLabel
(
queryParams
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'标签管理信息'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
})
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.app-container
{
font-size
:
18px
;
padding
:
0
;
.placeholder
{
height
:
1
.3vh
;
background-color
:
#F4F4F4
;
margin-bottom
:
10px
}
}
</
style
>
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