Commit eec7258d authored by 姬鋆屾's avatar 姬鋆屾

fixed:修改员工关怀屏蔽导入

parent c6debec2
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
<!-- <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="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>
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
: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
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">
......@@ -43,11 +45,12 @@
<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
<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">
......@@ -71,12 +74,11 @@ import table from "@/assets/mixins/table";
export default {
name: "StaffCareList",
components: {
drawerShow
drawerShow,
},
mixins: [table],
created() {
},
data() {
created() {},
data() {
return {
// 用户导入参数
upload: {
......@@ -93,39 +95,53 @@ export default {
},
isExport: false,
config: {
isshowTabPane:true,
isshowTabPane: true,
search: [
{
name: "staffName",
type: "text",
label: "员工姓名",
fuzzy: true
fuzzy: true,
},
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "员工姓名", prop: "staffName"},
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{ 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: "操作",
width: 240,
formatter: row => {
formatter: (row) => {
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}
/>
);
}
}
]
}
}
},
},
],
},
};
},
methods: {
/** 导入 */
......@@ -137,11 +153,11 @@ export default {
downloadTemplate() {
this.isExport = true;
this.$download("/staff/care/downloadTemplate", {}, { type: "excel" })
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 文件上传中处理 */
handleFileUploadProgress(event, file, fileList) {
......@@ -162,21 +178,27 @@ export default {
/** 导出Excel */
doExport() {
this.isExport = true;
let params = {}
for(let value of this.config.search){
if(this.query[value.name]){
params[value.name] = this.query[value.name]
}
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
params[value.name] = this.query[value.name];
}
}
if(this.selection.length>0){
params['idList'] = this.selection
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
this.$download("/staff/care/exportExcel", {
...params
}, { type: "excel" }).then(() => this.isExport = false).catch(error => {
this.isExport = false;
this.$message.error(error.message);
})
this.$download(
"/staff/care/exportExcel",
{
...params,
},
{ type: "excel" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 重写新增方法 */
toAdd(row) {
......@@ -190,6 +212,6 @@ export default {
toView(row) {
this.$refs.drawerform.view(row);
},
}
}
},
};
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment