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

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

parent c6debec2
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" :config="tableConfig"> <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 <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
icon="el-icon-tickets" icon="el-icon-tickets"
size="mini" size="mini"
@click="handleImport" @click="doExport"
>导入</el-button> :disabled="isExport"
<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> </LayoutTable>
<!-- 员工关怀信息导入对话框 --> <!-- 员工关怀信息导入对话框 -->
<el-dialog <el-dialog
:title="upload.title" :title="upload.title"
:visible.sync="upload.open" :visible.sync="upload.open"
width="400px" width="400px"
append-to-body append-to-body
> >
<el-upload <el-upload
ref="upload" ref="upload"
:limit="1" :limit="1"
accept=".xlsx, .xls" accept=".xlsx, .xls"
:headers="upload.headers" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:auto-upload="false" :auto-upload="false"
drag drag
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text"> <div class="el-upload__text">
...@@ -43,11 +45,12 @@ ...@@ -43,11 +45,12 @@
<em>点击上传</em> <em>点击上传</em>
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
<el-checkbox <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
v-model="upload.updateSupport" <el-link
/>是否更新已经存在的数据 type="primary"
<el-link type="primary" style="font-size: 14px" @click="downloadTemplate" style="font-size: 14px"
>下载模板</el-link @click="downloadTemplate"
>下载模板</el-link
> >
</div> </div>
<div class="el-upload__tip" style="color: red" slot="tip"> <div class="el-upload__tip" style="color: red" slot="tip">
...@@ -71,12 +74,11 @@ import table from "@/assets/mixins/table"; ...@@ -71,12 +74,11 @@ import table from "@/assets/mixins/table";
export default { export default {
name: "StaffCareList", name: "StaffCareList",
components: { components: {
drawerShow drawerShow,
}, },
mixins: [table], mixins: [table],
created() { created() {},
}, data() {
data() {
return { return {
// 用户导入参数 // 用户导入参数
upload: { upload: {
...@@ -93,39 +95,53 @@ export default { ...@@ -93,39 +95,53 @@ export default {
}, },
isExport: false, isExport: false,
config: { config: {
isshowTabPane:true, isshowTabPane: true,
search: [ search: [
{ {
name: "staffName", name: "staffName",
type: "text", type: "text",
label: "员工姓名", label: "员工姓名",
fuzzy: true fuzzy: true,
}, },
], ],
columns: [ columns: [
{type: "selection", width: 60}, { type: "selection", width: 60 },
{type: "index",label: "序号",width: 50}, { 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}
/>
); );
} },
} },
] ],
} },
} };
}, },
methods: { methods: {
/** 导入 */ /** 导入 */
...@@ -137,11 +153,11 @@ export default { ...@@ -137,11 +153,11 @@ export default {
downloadTemplate() { downloadTemplate() {
this.isExport = true; this.isExport = true;
this.$download("/staff/care/downloadTemplate", {}, { type: "excel" }) this.$download("/staff/care/downloadTemplate", {}, { type: "excel" })
.then(() => (this.isExport = false)) .then(() => (this.isExport = false))
.catch((error) => { .catch((error) => {
this.isExport = false; this.isExport = false;
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
/** 文件上传中处理 */ /** 文件上传中处理 */
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
...@@ -162,21 +178,27 @@ export default { ...@@ -162,21 +178,27 @@ export default {
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
this.isExport = true; this.isExport = true;
let params = {} let params = {};
for(let value of this.config.search){ for (let value of this.config.search) {
if(this.query[value.name]){ if (this.query[value.name]) {
params[value.name] = this.query[value.name] params[value.name] = this.query[value.name];
} }
} }
if(this.selection.length>0){ if (this.selection.length > 0) {
params['idList'] = this.selection params["idList"] = this.selection;
} }
this.$download("/staff/care/exportExcel", { this.$download(
...params "/staff/care/exportExcel",
}, { type: "excel" }).then(() => this.isExport = false).catch(error => { {
this.isExport = false; ...params,
this.$message.error(error.message); },
}) { type: "excel" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
}, },
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
...@@ -190,6 +212,6 @@ export default { ...@@ -190,6 +212,6 @@ export default {
toView(row) { toView(row) {
this.$refs.drawerform.view(row); this.$refs.drawerform.view(row);
}, },
} },
} };
</script> </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