Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
707e5868
Commit
707e5868
authored
Apr 10, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端员工关怀添加了导入导出
parent
03c74975
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
176 additions
and
62 deletions
+176
-62
attendance-performance-manager-ui/admin/src/views/staff/care/list.vue
...erformance-manager-ui/admin/src/views/staff/care/list.vue
+176
-62
No files found.
attendance-performance-manager-ui/admin/src/views/staff/care/list.vue
View file @
707e5868
<
template
>
<
template
>
<div
class=
"page"
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button>
</LayoutTable>
<!-- 员工关怀信息导入对话框 -->
<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"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</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>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
/** 表单弹出框模式需引入 */
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
export
default
{
name
:
"
StaffCareList
"
,
name
:
"
StaffCareList
"
,
components
:
{
components
:
{
drawerShow
drawerShow
},
},
mixins
:
[
table
],
mixins
:
[
table
],
created
()
{
created
()
{
},
},
methods
:
{
methods
:
{
/** 重写新增方法 */
/** 导入 */
toAdd
(
row
)
{
handleImport
()
{
this
.
$refs
.
drawerform
.
add
(
row
);
this
.
upload
.
title
=
"
员工关怀信息导入
"
;
},
this
.
upload
.
open
=
true
;
/** 重写编辑方法 */
},
toEdit
(
row
)
{
/** 下载模板操作 */
this
.
$refs
.
drawerform
.
edit
(
row
);
downloadTemplate
()
{
},
this
.
isExport
=
true
;
/** 重写查看方法 */
this
.
$download
(
"
/staff/care/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
toView
(
row
)
{
.
then
(()
=>
(
this
.
isExport
=
false
))
this
.
$refs
.
drawerform
.
view
(
row
);
.
catch
((
error
)
=>
{
},
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
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
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/staff/care/exportExcel
"
,
{
"
idList
"
:
this
.
selection
,
'
staffName
'
:
this
.
$route
.
query
[
'
staffName
'
],
'
careType
'
:
this
.
$route
.
query
[
'
careType
'
],
'
sendStatus
'
:
this
.
$route
.
query
[
'
sendStatus
'
],
},
{
type
:
"
excel
"
}).
then
(()
=>
this
.
isExport
=
false
).
catch
(
error
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
},
data
()
{
data
()
{
return
{
return
{
config
:
{
// 用户导入参数
search
:
[
upload
:
{
{
// 是否显示弹出层(员工关怀信息导入)
name
:
"
staffName
"
,
open
:
false
,
type
:
"
text
"
,
// 弹出层标题(员工关怀信息导入)
label
:
"
员工姓名
"
,
title
:
"
导入员工关怀信息数据
"
,
fuzzy
:
true
// 是否禁用上传
},
isUploading
:
false
,
],
// 是否更新已经存在的数据
columns
:
[
updateSupport
:
0
,
{
type
:
"
selection
"
,
width
:
60
},
// 上传的地址
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
url
:
"
/attendance/staff/care/importData
"
,
},
isExport
:
false
,
config
:
{
search
:
[
{
name
:
"
staffName
"
,
type
:
"
text
"
,
label
:
"
员工姓名
"
,
fuzzy
:
true
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
员工姓名
"
,
prop
:
"
staffName
"
},
{
label
:
"
员工姓名
"
,
prop
:
"
staffName
"
},
{
label
:
"
入职时间
"
,
prop
:
"
entryDate
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
入职时间
"
,
prop
:
"
entryDate
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
关怀类型
"
,
prop
:
"
careType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
关怀类型
"
,
prop
:
"
careType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
发送状态
"
,
prop
:
"
sendStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
发送状态
"
,
prop
:
"
sendStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
},
{
{
label
:
"
操作
"
,
label
:
"
操作
"
,
width
:
240
,
width
:
240
,
formatter
:
row
=>
{
formatter
:
row
=>
{
return
(
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
);
}
}
}
}
]
]
}
}
};
}
};
};
}
};
</
script
>
</
script
>
\ No newline at end of file
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