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
715f3bfb
Commit
715f3bfb
authored
Mar 20, 2025
by
tanjunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 部分页面增加导入导出功能
parent
bcaa2995
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
429 additions
and
53 deletions
+429
-53
index.vue
src/views/mes/md/product/index.vue
+6
-6
index.vue
src/views/mes/md/workshop/index.vue
+90
-13
index.vue
src/views/mes/md/workstation/index.vue
+87
-12
index.vue
src/views/mes/md/workunit/index.vue
+86
-11
index.vue
src/views/mes/pro/arrangeRule/index.vue
+78
-4
index.vue
src/views/mes/pro/process/index.vue
+82
-7
No files found.
src/views/mes/md/product/index.vue
View file @
715f3bfb
...
@@ -52,10 +52,10 @@
...
@@ -52,10 +52,10 @@
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"multiple"
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"multiple"
@
click=
"handBecomeFormalProduct"
>
转正式产品
</el-button>
@
click=
"handBecomeFormalProduct"
>
转正式产品
</el-button>
</el-col>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
</el-col>
-->
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
>
导出
</el-button>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
>
导出
</el-button>
</el-col>
</el-col>
...
@@ -697,7 +697,7 @@ export default {
...
@@ -697,7 +697,7 @@ export default {
/** 导出按钮操作 */
/** 导出按钮操作 */
handleExport
()
{
handleExport
()
{
this
.
download
(
this
.
download
(
"mes/md/mditem/
export
"
,
"mes/md/mditem/
importData
"
,
{
{
...
this
.
queryParams
,
...
this
.
queryParams
,
},
},
...
@@ -706,7 +706,7 @@ export default {
...
@@ -706,7 +706,7 @@ export default {
},
},
/** 导入按钮操作 */
/** 导入按钮操作 */
handleImport
()
{
handleImport
()
{
this
.
upload
.
title
=
"
物料/产品
导入"
;
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
this
.
upload
.
open
=
true
;
},
},
/** 下载模板操作 */
/** 下载模板操作 */
...
...
src/views/mes/md/workshop/index.vue
View file @
715f3bfb
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<
!--
<
el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<
!--
<
el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"primary"
type=
"primary"
plain
plain
...
@@ -56,8 +56,14 @@
...
@@ -56,8 +56,14 @@
v-hasPermi=
"['mes:md:workshop:remove']"
v-hasPermi=
"['mes:md:workshop:remove']"
>
删除
</el-button>
>
删除
</el-button>
</el-col>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
-->
</el-row>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
>
导出
</el-button>
</el-col>
</el-row>
<el-table
v-loading=
"loading"
:data=
"workshopList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"workshopList"
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
-->
<!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
-->
...
@@ -185,12 +191,34 @@
...
@@ -185,12 +191,34 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
: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"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的用户数据
</div>
<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>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
listWorkshop
,
getWorkshop
,
delWorkshop
,
addWorkshop
,
updateWorkshop
}
from
"@/api/mes/md/workshop"
;
import
{
listWorkshop
,
getWorkshop
,
delWorkshop
,
addWorkshop
,
updateWorkshop
}
from
"@/api/mes/md/workshop"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
import
{
genCode
}
from
"@/api/system/autocode/rule"
import
{
getToken
}
from
"@/utils/auth"
;
import
fcatorySelect
from
"@/components/FactorySelect/index.vue"
;
import
fcatorySelect
from
"@/components/FactorySelect/index.vue"
;
export
default
{
export
default
{
name
:
"Workshop"
,
name
:
"Workshop"
,
...
@@ -218,6 +246,21 @@ export default {
...
@@ -218,6 +246,21 @@ 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/md/workshop/importData"
,
},
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
...
@@ -372,12 +415,6 @@ export default {
...
@@ -372,12 +415,6 @@ export default {
this
.
$modal
.
msgSuccess
(
"删除成功"
);
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}).
catch
(()
=>
{});
},
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'md/workshop/export'
,
{
...
this
.
queryParams
},
`workshop_
${
new
Date
().
getTime
()}
.xlsx`
)
},
//自动生成物料编码
//自动生成物料编码
handleAutoGenChange
(
autoGenFlag
){
handleAutoGenChange
(
autoGenFlag
){
debugger
;
debugger
;
...
@@ -388,8 +425,48 @@ export default {
...
@@ -388,8 +425,48 @@ export default {
}
else
{
}
else
{
this
.
form
.
workshopCode
=
null
;
this
.
form
.
workshopCode
=
null
;
}
}
},
}
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'md/workshop/importTemplate'
,
{
...
this
.
queryParams
},
`workshop_
${
new
Date
().
getTime
()}
.xlsx`
)
},
/** 导入按钮操作 */
handleImport
()
{
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
importTemplate
()
{
this
.
download
(
"mes/md/workshop/importData"
,
{},
`workshop_
${
new
Date
().
getTime
()}
.xlsx`
);
},
// 文件上传中处理
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
();
},
}
}
};
};
</
script
>
</
script
>
src/views/mes/md/workstation/index.vue
View file @
715f3bfb
...
@@ -126,6 +126,9 @@
...
@@ -126,6 +126,9 @@
>
删除
</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"
>
导入
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"warning"
type=
"warning"
...
@@ -503,6 +506,27 @@
...
@@ -503,6 +506,27 @@
<el-button
@
click=
"cancel"
>
关 闭
</el-button>
<el-button
@
click=
"cancel"
>
关 闭
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
: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"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的用户数据
</div>
<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>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
...
@@ -525,6 +549,7 @@ import BrandSelect from "@/components/userSelect/single.vue";
...
@@ -525,6 +549,7 @@ import BrandSelect from "@/components/userSelect/single.vue";
// import { getTreeList } from "@/api/mes/wm/warehouse";
// import { getTreeList } from "@/api/mes/wm/warehouse";
import
{
listAllProcess
,
listProcess
}
from
"@/api/mes/pro/process"
;
import
{
listAllProcess
,
listProcess
}
from
"@/api/mes/pro/process"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
listAllWorkshop
}
from
"@/api/mes/md/workshop"
;
import
{
listAllWorkshop
}
from
"@/api/mes/md/workshop"
;
export
default
{
export
default
{
name
:
"Workstation"
,
name
:
"Workstation"
,
...
@@ -581,6 +606,21 @@ export default {
...
@@ -581,6 +606,21 @@ 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/md/workstation/importData"
,
},
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
...
@@ -806,16 +846,6 @@ export default {
...
@@ -806,16 +846,6 @@ export default {
})
})
.
catch
(()
=>
{});
.
catch
(()
=>
{});
},
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"mes/md/workstation/export"
,
{
...
this
.
queryParams
,
},
`workstation_
${
new
Date
().
getTime
()}
.xlsx`
);
},
//自动生成编码
//自动生成编码
handleAutoGenChange
(
autoGenFlag
)
{
handleAutoGenChange
(
autoGenFlag
)
{
if
(
autoGenFlag
)
{
if
(
autoGenFlag
)
{
...
@@ -858,6 +888,51 @@ export default {
...
@@ -858,6 +888,51 @@ export default {
this
.
form
.
nickName
=
row
.
nickName
;
this
.
form
.
nickName
=
row
.
nickName
;
}
}
},
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"mes/md/workstation/importTemplate"
,
{
...
this
.
queryParams
,
},
`workstation_
${
new
Date
().
getTime
()}
.xlsx`
);
},
/** 导入按钮操作 */
handleImport
()
{
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
importTemplate
()
{
this
.
download
(
"mes/md/workstation/importData"
,
{},
`workshop_
${
new
Date
().
getTime
()}
.xlsx`
);
},
// 文件上传中处理
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
();
},
},
},
};
};
</
script
>
</
script
>
src/views/mes/md/workunit/index.vue
View file @
715f3bfb
...
@@ -101,6 +101,9 @@
...
@@ -101,6 +101,9 @@
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['md:workunit:remove']"
>
删除
</el-button>
v-hasPermi=
"['md:workunit:remove']"
>
删除
</el-button>
</el-col>
-->
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"warning"
type=
"warning"
...
@@ -595,6 +598,27 @@
...
@@ -595,6 +598,27 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
: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"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的用户数据
</div>
<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>
</div>
</div>
</template>
</template>
...
@@ -608,6 +632,7 @@ import {
...
@@ -608,6 +632,7 @@ import {
}
from
"@/api/mes/md/workunit"
;
}
from
"@/api/mes/md/workunit"
;
import
WorkstationSelect
from
"@/components/workstationSelect/simpletableSingle.vue"
;
import
WorkstationSelect
from
"@/components/workstationSelect/simpletableSingle.vue"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
getToken
}
from
"@/utils/auth"
;
export
default
{
export
default
{
name
:
"Workunit"
,
name
:
"Workunit"
,
...
@@ -635,6 +660,21 @@ export default {
...
@@ -635,6 +660,21 @@ 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
+
"/md/cal/workunit/importData"
,
},
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
...
@@ -817,16 +857,6 @@ export default {
...
@@ -817,16 +857,6 @@ export default {
})
})
.
catch
(()
=>
{});
.
catch
(()
=>
{});
},
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"md/workunit/export"
,
{
...
this
.
queryParams
,
},
`workunit_
${
new
Date
().
getTime
()}
.xlsx`
);
},
handleWorkstationSelect
()
{
handleWorkstationSelect
()
{
this
.
$refs
.
workstationSelect
.
showFlag
=
true
;
this
.
$refs
.
workstationSelect
.
showFlag
=
true
;
this
.
$refs
.
workstationSelect
.
getList
();
this
.
$refs
.
workstationSelect
.
getList
();
...
@@ -852,7 +882,52 @@ export default {
...
@@ -852,7 +882,52 @@ export default {
updateWorkunit
(
this
.
form
).
then
((
response
)
=>
{
updateWorkunit
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
$modal
.
msgSuccess
(
"修改成功"
);
});
});
}
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"md/cal/workunit/importTemplate"
,
{
...
this
.
queryParams
,
},
`workunit_
${
new
Date
().
getTime
()}
.xlsx`
);
},
/** 导入按钮操作 */
handleImport
()
{
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
importTemplate
()
{
this
.
download
(
"md/cal/workunit/importData"
,
{},
`workunit_
${
new
Date
().
getTime
()}
.xlsx`
);
},
// 文件上传中处理
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
();
},
},
},
};
};
</
script
>
</
script
>
src/views/mes/pro/arrangeRule/index.vue
View file @
715f3bfb
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
v-hasPermi=
"['pro:ProWorkOrderArrangeRule:remove']"
v-hasPermi=
"['pro:ProWorkOrderArrangeRule:remove']"
>
删除
</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"
>
导入
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"warning"
type=
"warning"
...
@@ -556,6 +559,27 @@
...
@@ -556,6 +559,27 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
: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"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的用户数据
</div>
<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>
</div>
</div>
</template>
</template>
...
@@ -568,6 +592,7 @@ delProWorkOrderArrangeRule,
...
@@ -568,6 +592,7 @@ delProWorkOrderArrangeRule,
addProWorkOrderArrangeRule
,
addProWorkOrderArrangeRule
,
updateProWorkOrderArrangeRule
}
from
"@/api/mes/pro/arrangeRule"
;
updateProWorkOrderArrangeRule
}
from
"@/api/mes/pro/arrangeRule"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
BrandSelect
from
"@/components/itemType/single.vue"
;
import
BrandSelect
from
"@/components/itemType/single.vue"
;
import
ProcessSelect
from
"@/components/process/taskSelectSingle.vue"
;
import
ProcessSelect
from
"@/components/process/taskSelectSingle.vue"
;
export
default
{
export
default
{
...
@@ -594,6 +619,21 @@ export default {
...
@@ -594,6 +619,21 @@ 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/ProWorkOrderArrangeRule/importData"
,
},
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
...
@@ -622,6 +662,7 @@ export default {
...
@@ -622,6 +662,7 @@ export default {
},
},
// 表单参数
// 表单参数
form
:
{},
form
:
{},
optType
:
""
,
// 表单校验
// 表单校验
rules
:
{
rules
:
{
arrangeRuleCode
:
[
arrangeRuleCode
:
[
...
@@ -718,8 +759,6 @@ export default {
...
@@ -718,8 +759,6 @@ export default {
}
}
},
},
// 多选框选中数据
// 多选框选中数据
handleSelectionChange
(
selection
)
{
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
arrangeRuleId
)
this
.
ids
=
selection
.
map
(
item
=>
item
.
arrangeRuleId
)
...
@@ -776,10 +815,45 @@ export default {
...
@@ -776,10 +815,45 @@ export default {
},
},
/** 导出按钮操作 */
/** 导出按钮操作 */
handleExport
()
{
handleExport
()
{
this
.
download
(
'/mes/pro/ProWorkOrderArrangeRule/
export
'
,
{
this
.
download
(
'/mes/pro/ProWorkOrderArrangeRule/
importTemplate
'
,
{
...
this
.
queryParams
...
this
.
queryParams
},
`ProWorkOrderArrangeRule_
${
new
Date
().
getTime
()}
.xlsx`
)
},
`ProWorkOrderArrangeRule_
${
new
Date
().
getTime
()}
.xlsx`
)
}
},
/** 导入按钮操作 */
handleImport
()
{
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
importTemplate
()
{
this
.
download
(
"mes/pro/ProWorkOrderArrangeRule/importData"
,
{},
`ProWorkOrderArrangeRule_
${
new
Date
().
getTime
()}
.xlsx`
);
},
// 文件上传中处理
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
();
},
}
}
};
};
</
script
>
</
script
>
src/views/mes/pro/process/index.vue
View file @
715f3bfb
...
@@ -64,6 +64,9 @@
...
@@ -64,6 +64,9 @@
v-hasPermi=
"['mes:pro:process:remove']"
v-hasPermi=
"['mes:pro:process:remove']"
>
删除
</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"
>
导入
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"warning"
type=
"warning"
...
@@ -241,6 +244,27 @@
...
@@ -241,6 +244,27 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
: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"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的用户数据
</div>
<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>
</div>
</div>
</template>
</template>
...
@@ -248,6 +272,7 @@
...
@@ -248,6 +272,7 @@
import
{
listProcess
,
getProcess
,
delProcess
,
addProcess
,
updateProcess
}
from
"@/api/mes/pro/process"
;
import
{
listProcess
,
getProcess
,
delProcess
,
addProcess
,
updateProcess
}
from
"@/api/mes/pro/process"
;
import
Processcontent
from
"./content.vue"
;
import
Processcontent
from
"./content.vue"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
import
{
genCode
}
from
"@/api/system/autocode/rule"
import
{
getToken
}
from
"@/utils/auth"
;
export
default
{
export
default
{
name
:
"Process"
,
name
:
"Process"
,
dicts
:
[
'sys_yes_no'
,
'sys_yes_non'
],
dicts
:
[
'sys_yes_no'
,
'sys_yes_non'
],
...
@@ -289,6 +314,21 @@ export default {
...
@@ -289,6 +314,21 @@ export default {
},
},
// 是否显示弹出层
// 是否显示弹出层
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/process/importData"
,
},
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
pageNum
:
1
,
...
@@ -431,12 +471,6 @@ export default {
...
@@ -431,12 +471,6 @@ export default {
this
.
$modal
.
msgSuccess
(
"删除成功"
);
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}).
catch
(()
=>
{});
},
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'mes/pro/process/export'
,
{
...
this
.
queryParams
},
`process_
${
new
Date
().
getTime
()}
.xlsx`
)
},
//自动生成编码
//自动生成编码
handleAutoGenChange
(
autoGenFlag
){
handleAutoGenChange
(
autoGenFlag
){
if
(
autoGenFlag
){
if
(
autoGenFlag
){
...
@@ -446,7 +480,48 @@ export default {
...
@@ -446,7 +480,48 @@ export default {
}
else
{
}
else
{
this
.
form
.
processCode
=
null
;
this
.
form
.
processCode
=
null
;
}
}
}
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'mes/pro/process/importTemplate'
,
{
...
this
.
queryParams
},
`process_
${
new
Date
().
getTime
()}
.xlsx`
)
},
/** 导入按钮操作 */
handleImport
()
{
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
importTemplate
()
{
this
.
download
(
"mes/pro/process/importData"
,
{},
`process_
${
new
Date
().
getTime
()}
.xlsx`
);
},
// 文件上传中处理
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
();
},
}
}
};
};
</
script
>
</
script
>
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