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
56e5e79a
Commit
56e5e79a
authored
May 26, 2025
by
tanjunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 1.生产报工细节优化; 2.生产报工导出功能优化
parent
4428d3a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
6 deletions
+43
-6
main.js
src/main.js
+2
-1
request.js
src/utils/request.js
+25
-0
indexApply.vue
src/views/mes/pro/workorder/indexApply.vue
+16
-5
No files found.
src/main.js
View file @
56e5e79a
...
...
@@ -16,7 +16,7 @@ import store from './store'
import
router
from
'./router'
import
directive
from
'./directive'
// directive
import
plugins
from
'./plugins'
// plugins
import
{
download
}
from
'@/utils/request'
import
{
download
,
download1
}
from
'@/utils/request'
import
'./assets/icons'
// icon
import
'./permission'
// permission control
...
...
@@ -64,6 +64,7 @@ Vue.prototype.addDateRange = addDateRange
Vue
.
prototype
.
selectDictLabel
=
selectDictLabel
Vue
.
prototype
.
selectDictLabels
=
selectDictLabels
Vue
.
prototype
.
download
=
download
Vue
.
prototype
.
download1
=
download1
Vue
.
prototype
.
handleTree
=
handleTree
Vue
.
prototype
.
formatMoney
=
formatMoney
...
...
src/utils/request.js
View file @
56e5e79a
...
...
@@ -200,4 +200,29 @@ export function download(url, params, filename) {
})
}
export
function
download1
(
url
,
params
,
filename
)
{
downloadLoadingInstance
=
Loading
.
service
({
text
:
"正在下载数据,请稍候"
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
,
})
return
service
.
post
(
url
,
params
,
{
// transformRequest: [(params) => { return tansParams(params) }],
headers
:
{
'Content-Type'
:
'application/json;charset=utf-8'
},
responseType
:
'blob'
}).
then
(
async
(
data
)
=>
{
const
isLogin
=
await
blobValidate
(
data
);
if
(
isLogin
)
{
const
blob
=
new
Blob
([
data
])
saveAs
(
blob
,
filename
)
}
else
{
const
resText
=
await
data
.
text
();
const
rspObj
=
JSON
.
parse
(
resText
);
const
errMsg
=
errorCode
[
rspObj
.
code
]
||
rspObj
.
msg
||
errorCode
[
'default'
]
Message
.
error
(
errMsg
);
}
downloadLoadingInstance
.
close
();
}).
catch
((
r
)
=>
{
console
.
error
(
r
)
Message
.
error
(
'下载文件出现错误,请联系管理员!'
)
downloadLoadingInstance
.
close
();
})
}
export
default
service
src/views/mes/pro/workorder/indexApply.vue
View file @
56e5e79a
...
...
@@ -296,7 +296,7 @@
</el-button>
</
template
>
</el-table-column>
<el-table-column
label=
"编排单号"
width=
"1
00px"
align=
"center"
prop=
"arrangeCode"
:show-overflow-tooltip=
"tru
e"
>
<el-table-column
label=
"编排单号"
width=
"1
40px"
align=
"center"
prop=
"arrangeCod
e"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"showArrangDetail(scope.row, scope.row.arrangeCode)"
>
{{
scope
.
row
.
arrangeCode
}}
...
...
@@ -1589,11 +1589,22 @@ export default {
}
,
/** 导出按钮操作 */
handleExport() {
this.download(
const params = {
...this.queryParams,
workorderCodes: this.queryParams.workorderCodes ? this.queryParams.workorderCodes.split(/[\n,;,、;。]/).filter(item => item) : null,
salesVouchers: this.queryParams.salesVouchers ? this.queryParams.salesVouchers.split(/[\n,;,、;。]/).filter(item => item) : null,
productCodes: this.queryParams.productCodes ? this.queryParams.productCodes.split(/[\n,;,、;。]/).filter(item => item) : null,
arrangeCodes: this.queryParams.arrangeCodes ? this.queryParams.arrangeCodes.split(/[\n,;,、;。]/).filter(item => item) : null
}
if(this.ids && this.ids.length > 0) {
params.workorderCodes = this.selectedRows.map(item => item.workorderCode)
}
params.statusArr = params.statusArr.length > 0 ? params.statusArr : null;
delete params.pageNum;
delete params.pageSize;
this.download1(
"mes/pro/workorder/export",
{
...this.queryParams,
}
,
params,
`
workorder_$
{
new
Date
().
getTime
()
}
.
xlsx
`
);
}
,
...
...
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