Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhongtong-avi-web
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
中通客车项目
zhongtong-avi-web
Commits
c455043b
Commit
c455043b
authored
Sep 19, 2019
by
李志鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fea(焊装车间): 焊装车间联调完成
parent
c09d2284
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
137 additions
and
10 deletions
+137
-10
list.vue
src/views/Workshop/Welding/list.vue
+137
-10
No files found.
src/views/Workshop/Welding/list.vue
View file @
c455043b
...
...
@@ -38,16 +38,27 @@
</div>
<div
class=
"tool-pack clear-float pl-15 pr-15"
>
<Search
searchCode=
"MATERIEL_TYPE"
v-if=
"searchComponentRenderToggle"
:searchCode=
"currentSearchCode"
@
search=
"doSearchClick"
@
reset=
"doResetClick"
>
</Search>
<div
class=
"float-left"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"doExportClick"
>
导出
</el-button>
</div>
</div>
<div
class=
"general-list-main-pack pl-15 pr-15"
>
<div>
<Table
:tableConfig=
"tableConfig"
>
</Table>
<PreviewTable
:tableConfig=
"tableConfig"
@
onPageSizeChange=
"onPageSizeChange"
@
onCurrentPageChange=
"onCurrentPageChange"
>
</PreviewTable>
</div>
</div>
</div>
...
...
@@ -55,13 +66,14 @@
</
template
>
<
script
>
import
Table
from
'@/components/Table/index.vu
e'
import
PreviewTable
from
'@/components/PreviewTabl
e'
import
Search
from
'@/components/Search'
import
request
from
'@/utils/request'
export
default
{
name
:
'Welding'
,
components
:
{
Table
,
Preview
Table
,
Search
},
data
()
{
...
...
@@ -89,10 +101,18 @@
code
:
'ROTARY_ROLLER_BED'
}
],
// 搜索组件关键字列表
searchList
:
{},
// 设备分类树高度
treeHeight
:
{},
// 当前选中分类
currentSort
:
{},
// 当前设备searchcode
currentSearchCode
:
''
,
// 当前车间code
currentWorkshopCode
:
'WELDING'
,
// 是否重新加载搜索组件
searchComponentRenderToggle
:
false
,
// 表格配置项
tableConfig
:
{
height
:
0
,
...
...
@@ -109,22 +129,129 @@
},
methods
:
{
// 点击刷新按钮
doRefreshClick
()
{},
doRefreshClick
()
{
this
.
getTableData
().
then
(()
=>
{
this
.
$message
.
success
(
'刷新成功!'
)
})
},
// 点击分类树
doSortTreeClick
(
treeNode
)
{
this
.
currentSort
=
_
.
cloneDeep
(
treeNode
)
this
.
currentSearchCode
=
this
.
currentSort
.
code
// 重新渲染搜索组件
this
.
searchComponentRenderToggle
=
false
this
.
$nextTick
(()
=>
{
this
.
searchComponentRenderToggle
=
true
})
// 获取列表表头展示字段
this
.
getTableLabel
()
},
// 点击搜索组件搜索按钮
doSearchClick
()
{},
doSearchClick
(
param
)
{
this
.
searchList
=
param
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
// 获取列表数据
this
.
getTableData
()
},
// 点击搜索组件重置按钮
doResetClick
()
{}
doResetClick
(
param
)
{
this
.
searchList
=
{
...
param
,
filters
:
[]
}
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
this
.
tableConfig
.
paginationConfig
.
pageSize
=
20
// 获取列表数据
this
.
getTableData
()
},
// 获取列表表头展示字段
getTableLabel
()
{
let
queryParams
=
{
searchCode
:
this
.
currentSearchCode
}
this
.
$fetch
(
'show-field-controller/showField-get'
,
queryParams
).
then
((
response
)
=>
{
this
.
tableConfig
.
fieldList
=
_
.
cloneDeep
(
response
)
})
},
// 获取列表数据
getTableData
()
{
let
queryParams
=
{
searchCode
:
this
.
currentSearchCode
,
filters
:
_
.
cloneDeep
(
this
.
searchList
.
filters
)
||
[],
pageSize
:
this
.
tableConfig
.
paginationConfig
.
pageSize
,
pageNum
:
this
.
tableConfig
.
paginationConfig
.
currentPage
}
queryParams
.
filters
.
push
({
fieldCode
:
'workshopCode'
,
fieldType
:
'STRING'
,
value
:
this
.
currentWorkshopCode
})
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$fetch
(
'equipment-controller/data-post'
,
queryParams
).
then
((
response
)
=>
{
this
.
tableConfig
.
data
=
_
.
cloneDeep
(
response
.
list
)
this
.
tableConfig
.
paginationConfig
.
total
=
_
.
cloneDeep
(
response
.
total
)
resolve
()
})
})
},
// 表格组件分页数量改变事件
onPageSizeChange
(
pageSize
)
{
this
.
tableConfig
.
paginationConfig
.
currentPage
=
1
this
.
tableConfig
.
paginationConfig
.
pageSize
=
pageSize
// 获取列表数据
this
.
getTableData
()
},
// 表格组件分页页数改变事件
onCurrentPageChange
(
currentPage
)
{
this
.
tableConfig
.
paginationConfig
.
currentPage
=
currentPage
// 获取列表数据
this
.
getTableData
()
},
// 点击程序下发按钮
doProgramIssuedClick
()
{
this
.
$refs
.
ProgramIssued
.
dialogToggle
=
true
},
// 点击导出按钮
async
doExportClick
()
{
let
queryParams
=
{
searchCode
:
this
.
currentSearchCode
,
filters
:
_
.
cloneDeep
(
this
.
searchList
.
filters
)
||
[]
}
queryParams
.
filters
.
push
({
fieldCode
:
'workshopCode'
,
fieldType
:
'STRING'
,
value
:
this
.
currentWorkshopCode
})
try
{
let
response
=
await
request
({
url
:
`
${
process
.
env
.
API_HOST
}
/api/equipment/data/export`
,
data
:
queryParams
,
method
:
'post'
,
responseType
:
'blob'
})
if
(
response
.
status
===
200
)
{
let
objectUrl
=
URL
.
createObjectURL
(
response
.
data
)
const
link
=
document
.
createElement
(
'a'
)
link
.
download
=
decodeURI
(
response
.
headers
.
filename
)
link
.
href
=
objectUrl
link
.
click
()
window
.
URL
.
revokeObjectURL
(
objectUrl
)
}
else
{
this
.
$message
.
error
(
response
.
message
)
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
},
mounted
()
{
setTimeout
(()
=>
{
this
.
treeHeight
=
{
'height'
:
`
${
document
.
body
.
offsetHeight
-
180
}
px`
}
this
.
tableConfig
.
height
=
document
.
querySelector
(
'.page-pack'
).
offsetHeight
-
180
this
.
tableConfig
.
height
=
document
.
querySelector
(
'.page-pack'
).
offsetHeight
-
205
this
.
$refs
.
sortTree
.
setCurrentKey
(
this
.
sortTreeData
[
0
].
id
)
this
.
currentSort
=
_
.
cloneDeep
(
this
.
sortTreeData
[
0
])
this
.
currentSearchCode
=
_
.
cloneDeep
(
this
.
sortTreeData
[
0
].
code
)
// 搜索组件渲染开启
this
.
searchComponentRenderToggle
=
true
// 获取列表表头展示字段
this
.
getTableLabel
()
// 获取列表数据
this
.
getTableData
()
},
0
)
}
}
...
...
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