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
c09d2284
Commit
c09d2284
authored
Sep 19, 2019
by
李志鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fea(制件车间): 制件车间联调完成
parent
bb0152fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
277 additions
and
5 deletions
+277
-5
apis.js
src/interface/apis.js
+12
-0
ProgramIssued.vue
src/views/Workshop/Parts/components/ProgramIssued.vue
+246
-0
list.vue
src/views/Workshop/Parts/list.vue
+19
-5
No files found.
src/interface/apis.js
View file @
c09d2284
...
...
@@ -47,6 +47,18 @@
}
},
"equipment-controller"
:
{
"export-post"
:
{
"url"
:
"/api/equipment/data/export"
,
"method"
:
"post"
},
"findByType-get"
:
{
"url"
:
"/api/equipment/equip/findByType"
,
"method"
:
"get"
},
"transfer-post"
:
{
"url"
:
"/api/equipment/program/transfer"
,
"method"
:
"post"
},
"data-post"
:
{
"url"
:
"/api/equipment/realTime/data"
,
"method"
:
"post"
...
...
src/views/Workshop/Parts/components/ProgramIssued.vue
0 → 100644
View file @
c09d2284
<
template
>
<el-dialog
title=
"程序下发"
v-drag-dialog
:visible
.
sync=
"dialogToggle"
:show-close=
"false"
:close-on-press-escape=
"false"
:close-on-click-modal=
"false"
width=
"600px"
>
<el-form
label-width=
"100px"
label-position=
"top"
:model=
"formData"
:rules=
"formRules"
ref=
"form"
>
<el-row
:gutter=
"30"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"设备编号"
required
prop=
"equipCode"
>
<el-select
size=
"mini"
style=
"width: 100%"
v-model=
"formData.equipCode"
placeholder=
"请选择设备编号"
@
change=
"onSelectChange"
>
<el-option
v-for=
"(item, index) in deviceList"
:key=
"index"
:label=
"item.equipCode"
:value=
"item.equipCode"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"设备名称"
required
prop=
"equipName"
>
<el-input
size=
"mini"
placeholder=
"请选择设备编号自动带出"
v-model=
"formData.equipName"
disabled
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"30"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"程序文件"
prop=
"filePath"
required
>
<el-upload
class=
"upload-demo"
:action=
"uploadApi"
:headers=
"uploadHeaders"
:file-list=
"fileList"
:on-success=
"uploadSuccess"
:on-remove=
"uploadRemove"
:limit=
"1"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
只能上传一个程序文件
</div>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"30"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"备注"
>
<el-input
type=
"textarea"
placeholder=
"请输入备注"
rows=
"6"
v-model=
"formData.remark"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer text-center"
>
<el-button
size=
"small"
type=
"primary"
icon=
"el-icon-check"
:loading=
"loadingToggle"
@
click=
"doConfirmClick('form')"
>
确认
</el-button>
<el-button
size=
"small"
icon=
"el-icon-close"
@
click=
"doCancelClick('form')"
>
取消
</el-button>
</span>
</el-dialog>
</
template
>
<
script
>
import
dragDialog
from
'@/directive/dragDialog'
export
default
{
directives
:
{
dragDialog
},
props
:
{
equipType
:
{},
workshopCode
:
{}
},
watch
:
{
dialogToggle
(
newVal
,
oldVal
)
{
this
.
uploadHeaders
.
Authorization
=
window
.
sessionStorage
.
getItem
(
'Admin-Token'
)
// 获取设备列表
this
.
getSeviceList
()
}
},
data
()
{
return
{
// 数据提交状态开关标识
loadingToggle
:
false
,
// 弹出框开关标识
dialogToggle
:
false
,
// 表单数据
formData
:
{
equipCode
:
''
,
equipName
:
''
,
filePath
:
''
,
remark
:
''
},
// 设备列表数据
deviceList
:
[],
// 表单正则
formRules
:
{
// 设备编号
equipCode
:
[{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
_
.
trim
(
value
)
===
''
)
{
callback
(
new
Error
(
'请选择设备编号'
))
}
callback
();
},
trigger
:
[
'change'
,
'blur'
]
}],
// 设备名称
equipName
:
[{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
_
.
trim
(
value
)
===
''
)
{
callback
(
new
Error
(
'请选择设备编号自动带出'
))
}
callback
();
},
trigger
:
[
'change'
,
'blur'
]
}],
// 程序文件
filePath
:
[{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
_
.
trim
(
value
)
===
''
)
{
callback
(
new
Error
(
'请至少选择一个程序文件'
))
}
callback
();
},
trigger
:
[
'change'
,
'blur'
]
}]
},
// 附件上传api
uploadApi
:
`
${
process
.
env
.
API_HOST
}
/api/equipment/file/upload`
,
// 请求头信息
uploadHeaders
:
{
Authorization
:
''
},
// 文件列表
fileList
:
[]
}
},
methods
:
{
// 获取设备列表
getSeviceList
()
{
let
queryParams
=
{
equipType
:
this
.
equipType
,
workshopCode
:
this
.
workshopCode
}
this
.
$fetch
(
'equipment-controller/findByType-get'
,
queryParams
).
then
((
response
)
=>
{
this
.
deviceList
=
_
.
cloneDeep
(
response
)
})
},
// 触发设备编号多选值事件
onSelectChange
(
selectValue
)
{
for
(
let
item
of
this
.
deviceList
)
{
if
(
item
.
equipCode
===
selectValue
)
{
this
.
formData
.
equipName
=
item
.
equipName
break
}
}
},
// 点击确认按钮
doConfirmClick
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
vaild
)
=>
{
if
(
vaild
)
{
this
.
loadingToggle
=
true
let
queryParams
=
{
...
this
.
formData
}
this
.
$fetch
(
'equipment-controller/transfer-post'
,
queryParams
).
then
((
response
)
=>
{
this
.
$message
.
success
(
'程序下发成功!'
)
this
.
loadingToggle
=
false
this
.
$refs
[
formName
].
resetFields
()
this
.
dialogToggle
=
false
for
(
let
key
in
this
.
formData
)
{
this
.
formData
[
key
]
=
''
}
}).
catch
(()
=>
{
this
.
loadingToggle
=
false
})
}
})
},
// 点击取消按钮
doCancelClick
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
()
this
.
dialogToggle
=
false
for
(
let
key
in
this
.
formData
)
{
this
.
formData
[
key
]
=
''
}
},
// 文件上传成功
uploadSuccess
(
res
,
file
)
{
this
.
fileList
.
push
({
name
:
res
.
data
.
name
,
url
:
res
.
data
.
path
})
this
.
formData
.
filePath
=
res
.
data
.
path
},
// 文件移除
uploadRemove
(
file
,
fileList
)
{
this
.
fileList
=
[]
this
.
formData
.
filePath
=
''
}
}
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
src/views/Workshop/Parts/list.vue
View file @
c09d2284
...
...
@@ -51,7 +51,8 @@
导出
</el-button>
<el-button
size=
"small"
>
size=
"small"
@
click=
"doProgramIssuedClick"
>
程序下发
</el-button>
</div>
...
...
@@ -66,6 +67,13 @@
</div>
</div>
</div>
<!-- 程序下发dialog -->
<ProgramIssued
:equipType=
"currentSearchCode"
:workshopCode =
"currentWorkshopCode"
ref=
"ProgramIssued"
>
</ProgramIssued>
</div>
</
template
>
...
...
@@ -73,12 +81,14 @@
import
PreviewTable
from
'@/components/PreviewTable'
import
Search
from
'@/components/Search'
import
request
from
'@/utils/request'
import
ProgramIssued
from
'./components/ProgramIssued'
export
default
{
name
:
'Parts'
,
components
:
{
PreviewTable
,
Search
Search
,
ProgramIssued
},
data
()
{
return
{
...
...
@@ -161,7 +171,7 @@
// 点击分类树
doSortTreeClick
(
treeNode
)
{
this
.
currentSort
=
_
.
cloneDeep
(
treeNode
)
this
.
s
earchCode
=
this
.
currentSort
.
code
this
.
currentS
earchCode
=
this
.
currentSort
.
code
// 重新渲染搜索组件
this
.
searchComponentRenderToggle
=
false
this
.
$nextTick
(()
=>
{
...
...
@@ -196,7 +206,7 @@
getTableData
()
{
let
queryParams
=
{
searchCode
:
this
.
currentSearchCode
,
filters
:
this
.
searchList
.
filters
||
[],
filters
:
_
.
cloneDeep
(
this
.
searchList
.
filters
)
||
[],
pageSize
:
this
.
tableConfig
.
paginationConfig
.
pageSize
,
pageNum
:
this
.
tableConfig
.
paginationConfig
.
currentPage
}
...
...
@@ -226,11 +236,15 @@
// 获取列表数据
this
.
getTableData
()
},
// 点击程序下发按钮
doProgramIssuedClick
()
{
this
.
$refs
.
ProgramIssued
.
dialogToggle
=
true
},
// 点击导出按钮
async
doExportClick
()
{
let
queryParams
=
{
searchCode
:
this
.
currentSearchCode
,
filters
:
this
.
searchList
.
filters
||
[]
filters
:
_
.
cloneDeep
(
this
.
searchList
.
filters
)
||
[]
}
queryParams
.
filters
.
push
({
fieldCode
:
'workshopCode'
,
...
...
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