Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
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
mes
mes-ui
Commits
a1bd5c6f
Commit
a1bd5c6f
authored
Jan 27, 2024
by
hiyonx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产工单
parent
45823f12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
indexApply.vue
src/views/mes/pro/workorder/indexApply.vue
+77
-0
No files found.
src/views/mes/pro/workorder/indexApply.vue
View file @
a1bd5c6f
...
@@ -156,12 +156,50 @@
...
@@ -156,12 +156,50 @@
>
生成任务单
</el-button
>
生成任务单
</el-button
>
>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleImport"
v-hasPermi=
"['mes:pro:workorder:edit']"
>
导入工单
</el-button>
</el-col>
<right-toolbar
<right-toolbar
:showSearch
.
sync=
"showSearch"
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
@
queryTable=
"getList"
></right-toolbar>
></right-toolbar>
</el-row>
</el-row>
<!-- 用户导入对话框 -->
<el-dialog
title=
"导入工单"
:visible
.
sync=
"upload.open"
width=
"400px"
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__tip text-center"
slot=
"tip"
>
<span>
仅允许导入xls、xlsx格式文件。
</span>
<el-link
type=
"primary"
:underline=
"false"
style=
"font-size:12px;vertical-align: baseline;"
@
click=
"importTemplate"
>
下载模板
</el-link>
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"workorderList"
:data=
"workorderList"
...
@@ -625,6 +663,7 @@ import VendorSelect from "@/components/vendorSelect/single.vue";
...
@@ -625,6 +663,7 @@ import VendorSelect from "@/components/vendorSelect/single.vue";
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
import
{
getToken
}
from
'@/utils/auth'
export
default
{
export
default
{
name
:
"Workorder"
,
name
:
"Workorder"
,
...
@@ -661,6 +700,20 @@ export default {
...
@@ -661,6 +700,20 @@ export default {
title
:
""
,
title
:
""
,
// 是否显示弹出层
// 是否显示弹出层
open
:
false
,
open
:
false
,
upload
:
{
// 是否显示弹出层(用户导入)
open
:
false
,
// 弹出层标题(用户导入)
title
:
""
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的用户数据
updateSupport
:
0
,
// 设置上传的请求头部
headers
:
{
Authorization
:
"Bearer "
+
getToken
()
}
,
// 上传的地址
url
:
process
.
env
.
VUE_APP_BASE_API
+
"/mes/pro/workorder/importData"
}
,
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
...
@@ -738,6 +791,30 @@ export default {
...
@@ -738,6 +791,30 @@ export default {
this
.
loading
=
false
;
this
.
loading
=
false
;
}
);
}
);
}
,
}
,
importTemplate
()
{
this
.
download
(
'mes/pro/workorder/importTemplate'
,
{
}
,
`work_order_template_${new Date().getTime()
}
.xlsx`
)
}
,
/** 导入按钮操作 */
handleImport
()
{
this
.
upload
.
open
=
true
;
}
,
// 文件上传中处理
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
}
,
// 文件上传成功处理
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>"
+
response
.
msg
+
"</div>"
,
"导入结果"
,
{
dangerouslyUseHTMLString
:
true
}
);
this
.
getList
();
}
,
// 提交上传文件
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
}
,
/** 转换生产工单数据结构 */
/** 转换生产工单数据结构 */
normalizer
(
node
)
{
normalizer
(
node
)
{
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
...
...
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