Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jilinzhongdianrenqun-web
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
jilinzhongdianrenqun-web
Commits
a0dd1982
Commit
a0dd1982
authored
Dec 22, 2025
by
wangchunyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用品导出和组件
parent
8ec8b467
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
120 行增加
和
1 行删除
+120
-1
src/api/key-dm.js
+18
-0
src/view/key-person/key_dm_conf/index.vue
+102
-1
没有找到文件。
src/api/key-dm.js
View file @
a0dd1982
...
@@ -116,3 +116,21 @@ export const deleteMaterial = (param) => {
...
@@ -116,3 +116,21 @@ export const deleteMaterial = (param) => {
data
:
param
data
:
param
})
})
}
}
// 导入物料(Excel)
export
const
importMaterial
=
(
formData
)
=>
{
return
axios
.
request
({
url
:
'/api/ac/jilinsscgsdp/keyDmMaterial/import'
,
method
:
'post'
,
data
:
formData
})
}
// 下载物料导入模板
export
const
materialTemplateDownload
=
(
param
)
=>
{
return
axios
.
request
({
url
:
'/api/ac/jilinsscgsdp/keyDmMaterial/templateDownload'
,
method
:
'post'
,
data
:
param
})
}
src/view/key-person/key_dm_conf/index.vue
View file @
a0dd1982
...
@@ -137,6 +137,7 @@
...
@@ -137,6 +137,7 @@
<Button
type=
"primary"
class=
"mr10"
@
click=
"handleSearch('material')"
>
搜索
</Button>
<Button
type=
"primary"
class=
"mr10"
@
click=
"handleSearch('material')"
>
搜索
</Button>
<Button
class=
"mr10"
@
click=
"handleReset('material')"
>
重置
</Button>
<Button
class=
"mr10"
@
click=
"handleReset('material')"
>
重置
</Button>
<Button
type=
"success"
@
click=
"openAddModal('material')"
>
新增
</Button>
<Button
type=
"success"
@
click=
"openAddModal('material')"
>
新增
</Button>
<Button
type=
"primary"
class=
"mr10"
v-if=
"showImport()"
@
click=
"importShow = true"
>
导入
</Button>
</Col>
</Col>
</Row>
</Row>
</div>
</div>
...
@@ -179,6 +180,31 @@
...
@@ -179,6 +180,31 @@
<Button
type=
"primary"
:loading=
"modals.userCategory.saving"
@
click=
"handleSave('userCategory')"
>
保存
</Button>
<Button
type=
"primary"
:loading=
"modals.userCategory.saving"
@
click=
"handleSave('userCategory')"
>
保存
</Button>
</div>
</div>
</Modal>
</Modal>
<!-- 导入物料弹窗 -->
<Modal
v-model=
"importShow"
title=
"物料导入"
width=
"360"
>
<Row
type=
"flex"
justify=
"center"
align=
"middle"
>
<Col
span=
"10"
>
<div
style=
"text-align: center;"
>
<Upload
:show-upload-list=
"false"
:before-upload=
"handleBeforeUpload"
:format=
"['xls','xlsx']"
accept=
".xls,.xlsx"
:max-size=
"4096"
>
<Button
icon=
"ios-cloud-upload-outline"
type=
"primary"
:loading=
"impBtnDisabled"
>
导入
</Button>
</Upload>
</div>
</Col>
<Col
span=
"12"
>
<div
style=
"text-align: center;"
>
<Button
type=
"primary"
@
click=
"tplDownload"
style=
"margin-right: 10px;"
>
下载模板
</Button>
</div>
</Col>
</Row>
<div
slot=
"footer"
>
<Button
size=
"large"
type=
"text"
@
click=
"importShow = false"
>
关闭
</Button>
</div>
</Modal>
<!-- 假种管理弹窗 -->
<!-- 假种管理弹窗 -->
<Modal
v-model=
"modals.leaveType.visible"
:title=
"modals.leaveType.isEdit ? '修改请假类型' : '新增请假类型'"
width=
"700"
:mask-closable=
"false"
>
<Modal
v-model=
"modals.leaveType.visible"
:title=
"modals.leaveType.isEdit ? '修改请假类型' : '新增请假类型'"
width=
"700"
:mask-closable=
"false"
>
...
@@ -383,7 +409,9 @@ import {
...
@@ -383,7 +409,9 @@ import {
saveMaterial
,
saveMaterial
,
deleteMaterial
,
deleteMaterial
,
getUserCategoryPermissionList
,
getUserCategoryPermissionList
,
saveUserCategoryPermission
saveUserCategoryPermission
,
importMaterial
,
materialTemplateDownload
}
from
'@/api/key-dm'
}
from
'@/api/key-dm'
import
{
getDictList
}
from
'@/api/common'
import
{
getDictList
}
from
'@/api/common'
...
@@ -499,6 +527,8 @@ export default {
...
@@ -499,6 +527,8 @@ export default {
categoryName
:
''
,
categoryName
:
''
,
selectedPermissions
:
[]
selectedPermissions
:
[]
},
},
importShow
:
false
,
impBtnDisabled
:
false
,
permissionOptions
:
[],
permissionOptions
:
[],
materialCategoryOptions
:
[],
materialCategoryOptions
:
[],
userCategoryColumns
:
[
userCategoryColumns
:
[
...
@@ -763,6 +793,77 @@ export default {
...
@@ -763,6 +793,77 @@ export default {
}
}
})
})
}
}
,
tplDownload
()
{
// 下载物料导入模板
materialTemplateDownload
({}).
then
(
ret
=>
{
if
(
ret
&&
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
const
data
=
ret
.
data
.
data
// 如果后端直接返回文件流需要采用 axios blob 下载,这里假设返回 url 或 blob handled by backend
// 简单提示或可实现下载逻辑
this
.
$Notice
.
success
({
title
:
'模板已准备,请在后台下载'
})
}
else
{
this
.
$Notice
.
error
({
title
:
'模板下载失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
}
}).
catch
(()
=>
{
this
.
$Notice
.
error
({
title
:
'模板下载失败'
})
})
},
handleBeforeUpload
(
file
)
{
const
fileExt
=
file
.
name
.
split
(
'.'
).
pop
().
toLocaleLowerCase
()
if
(
fileExt
===
'xlsx'
||
fileExt
===
'xls'
)
{
this
.
readFile
(
file
)
}
else
{
this
.
$Notice
.
warning
({
title
:
'文件类型错误'
,
desc
:
'文件:'
+
file
.
name
+
'不是EXCEL文件,请选择后缀为.xlsx或者.xls的EXCEL文件。'
})
}
return
false
},
async
readFile
(
file
)
{
this
.
impBtnDisabled
=
true
const
formdata
=
new
FormData
()
formdata
.
append
(
'file'
,
file
)
formdata
.
append
(
'fileName'
,
file
.
name
)
const
ret
=
await
importMaterial
(
formdata
)
if
(
ret
&&
ret
.
data
)
{
this
.
importShow
=
false
this
.
impBtnDisabled
=
false
const
mobj
=
ret
.
data
.
data
||
{}
let
msg
=
'添加'
+
(
mobj
.
insert
||
0
)
+
'条, 更新'
+
(
mobj
.
update
||
0
)
+
'条'
if
(
mobj
.
error
)
{
msg
+=
', 缺少关键信息未能导入'
+
mobj
.
error
+
'条'
}
if
(
mobj
.
errInfo
&&
mobj
.
errInfo
!==
''
)
{
msg
+=
', 以下记录导入失败:'
+
mobj
.
errInfo
}
if
(
ret
.
data
.
errmsg
&&
ret
.
data
.
errmsg
!==
'success'
)
{
msg
+=
ret
.
data
.
errmsg
}
if
((
mobj
.
insert
||
0
)
+
(
mobj
.
update
||
0
)
>
0
)
{
this
.
fetchList
(
'material'
)
}
this
.
$Notice
.
success
({
title
:
'导入完成!'
,
desc
:
msg
})
}
else
{
this
.
impBtnDisabled
=
false
this
.
$Notice
.
warning
({
title
:
'未导入数据!'
,
desc
:
ret
&&
ret
.
data
&&
ret
.
data
.
errmsg
})
}
},
showImport
()
{
// 简单权限控制:可根据需要替换
const
info
=
this
.
$store
.
state
.
user
.
otherUserInfo
||
{}
const
areaId
=
info
.
area_id
||
''
if
(
areaId
&&
areaId
.
startsWith
(
'2201'
))
return
true
return
false
}
}
}
}
}
</
script
>
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论