|
@@ -80,6 +80,13 @@
|
|
|
:disabled="multipleSelection.length==0"
|
|
|
@click="handleBatchDelete"
|
|
|
>删除选中项</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ icon="el-icon-upload2"
|
|
|
+ @click="batchImportVisible = true"
|
|
|
+ >导入</el-button>
|
|
|
</el-row>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
@@ -147,15 +154,66 @@
|
|
|
:title="modalTitle3"
|
|
|
@close="onDetailModalClose3"
|
|
|
></recruitInformationInfo-detail>
|
|
|
+ <el-dialog
|
|
|
+ title="批量导入企业"
|
|
|
+ :visible.sync="batchImportVisible"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ style="text-align: left"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <el-form label-width="150px">
|
|
|
+ <el-form-item label="模板下载">
|
|
|
+ <el-link
|
|
|
+ href="http://oss.xiaoxinda.com/jk-temporary-workers/person.xls"
|
|
|
+ type="primary"
|
|
|
+ target="_blank"
|
|
|
+ >点击下载模板</el-link
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="上传文件">
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ accept=".xls"
|
|
|
+ :action="uploadUrlXls"
|
|
|
+ :data="uploadXlsData"
|
|
|
+ :headers="headers"
|
|
|
+ :on-preview="handleBatchImportPreview"
|
|
|
+ name="uploadFile"
|
|
|
+ :multiple="true"
|
|
|
+ :limit="1"
|
|
|
+ :on-remove="handleBatchImportRemove"
|
|
|
+ :before-remove="beforeBatchImportRemove"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ :on-exceed="handleBatchImportExceed"
|
|
|
+ :on-success="handleBatchImportSuccess"
|
|
|
+ :file-list="batchImportFileList"
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary" :loading="xlsLoading"
|
|
|
+ >点击上传</el-button
|
|
|
+ >
|
|
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
+ 只能上传xls文件,且不超过500kb
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="batchImportVisible = false"
|
|
|
+ >关 闭</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+ import Constant from "@/constant";
|
|
|
import recruitInformationInfoApi from "@/api/base/recruitInformationInfo";
|
|
|
import enterpriseInfoDetail from "./enterpriseInfo-detail";
|
|
|
import recruitPersonRelationList from "./recruitPersonRelation-list";
|
|
|
import recruitInformationInfoDetail from "./recruitInformationInfo-detail";
|
|
|
import dataDictionaryApi from "@/api/sys/dataDictionary";
|
|
|
-
|
|
|
+ import { getToken } from "@/utils/auth"; // get token from cookie
|
|
|
+
|
|
|
export default {
|
|
|
name: 'baseRecruitInformationInfoList',
|
|
|
data() {
|
|
@@ -209,6 +267,16 @@
|
|
|
label: "name",
|
|
|
children: "children"
|
|
|
},
|
|
|
+ batchImportVisible: false,
|
|
|
+ xlsLoading: false,
|
|
|
+ batchImportFileList: [],
|
|
|
+ uploadUrlXls: Constant.serverUrl + "/base/recruitInformationInfo/importXls",
|
|
|
+ uploadXlsData: {
|
|
|
+ subFolder: "recruitInformationInfo",
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken(),
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -398,6 +466,64 @@
|
|
|
this.changePage(this.pageIndex);
|
|
|
}
|
|
|
},
|
|
|
+ beforeUpload(file, fileList) {
|
|
|
+ //导入前判断
|
|
|
+ var self = this;
|
|
|
+ self.xlsLoading = true;
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ //批量导入-上传成功
|
|
|
+ handleBatchImportSuccess(response, file, fileList) {
|
|
|
+ var self = this;
|
|
|
+ self.xlsLoading = false;
|
|
|
+
|
|
|
+ if (response.result) {
|
|
|
+ self.$message.success(response.message);
|
|
|
+ this.batchImportFileList = [];
|
|
|
+ this.changePage(1);
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ //this.$message.error(response.message);
|
|
|
+ this.batchImportFileList = [];
|
|
|
+ this.changePage(1);
|
|
|
+
|
|
|
+ if (response.data != null) {
|
|
|
+ //下载有错误信息提示的报表
|
|
|
+ //window.open(response.data);
|
|
|
+ self.$message({
|
|
|
+ showClose: true,
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message:
|
|
|
+ response.message +
|
|
|
+ `,<a href="${response.data}" target="_blank">点击下载未导入的数据报表</a> `,
|
|
|
+ duration: 30000,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.batchImportVisible = false;
|
|
|
+ },
|
|
|
+ //批量导入-预览
|
|
|
+ handleBatchImportPreview(file) {
|
|
|
+ console.log(file.url);
|
|
|
+ },
|
|
|
+ //批量导入-移除
|
|
|
+ handleBatchImportRemove(file, fileList) {
|
|
|
+ console.log(file, fileList);
|
|
|
+ },
|
|
|
+ //批量导入-移除前操作
|
|
|
+ beforeBatchImportRemove(file, fileList) {
|
|
|
+ console.log(file, fileList);
|
|
|
+ },
|
|
|
+ //批量导入-文件超出个数限制时的钩子
|
|
|
+ handleBatchImportExceed(files, fileList) {
|
|
|
+ this.$message.warning(
|
|
|
+ `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
+ files.length + fileList.length
|
|
|
+ } 个文件`
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
mounted: function() {
|
|
|
var self = this;
|