|
@@ -189,17 +189,17 @@
|
|
|
></el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column prop="position1" :label="position1" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="position1" :label="position1" width="180"></el-table-column>
|
|
|
<el-table-column prop="position2" :label="position2" width="180"></el-table-column>
|
|
|
<el-table-column prop="position3" :label="position3" width="180"></el-table-column>
|
|
|
<el-table-column prop="position4" :label="position4" width="180"></el-table-column>
|
|
|
- <el-table-column prop="position5" :label="position5" width="180"></el-table-column>-->
|
|
|
+ <el-table-column prop="position5" :label="position5" width="180"></el-table-column>
|
|
|
<el-table-column label="操作" width="300" fixed="right">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-button size="mini" type="warning" @click="handleEdit(row)">编辑</el-button>
|
|
|
- </el-col>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
|
|
|
</el-col>
|
|
@@ -301,7 +301,7 @@
|
|
|
:on-success="handleBatchImportSuccess"
|
|
|
:file-list="batchImportFileList"
|
|
|
>
|
|
|
- <el-button size="small" type="primary">点击上传</el-button>
|
|
|
+ <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>
|
|
@@ -402,7 +402,8 @@ export default {
|
|
|
uploadSync: [],
|
|
|
batchBoundDevice: false,
|
|
|
deviceResult: "",
|
|
|
- boundDeviceId: ""
|
|
|
+ boundDeviceId: "",
|
|
|
+ xlsLoading: false
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -568,9 +569,25 @@ export default {
|
|
|
this.personId = record.id;
|
|
|
this.showBoundModal = true;
|
|
|
},
|
|
|
+ beforeUpload(file, fileList) {
|
|
|
+ //导入前判断
|
|
|
+ var self = this;
|
|
|
+ if (self.uploadCompanyId == null || self.uploadCompanyId == "") {
|
|
|
+ self.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请选择企业"
|
|
|
+ });
|
|
|
+ self.xlsLoading = false;
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ self.xlsLoading = true;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
//批量导入-上传成功
|
|
|
handleBatchImportSuccess(response, file, fileList) {
|
|
|
- console.log(response);
|
|
|
+ var self = this;
|
|
|
+ self.xlsLoading = false;
|
|
|
if (response.result) {
|
|
|
this.$message.success(response.message);
|
|
|
this.batchImportFileList = [];
|
|
@@ -611,19 +628,6 @@ export default {
|
|
|
beforeBatchImportRemove(file, fileList) {
|
|
|
console.log(file, fileList);
|
|
|
},
|
|
|
- beforeUpload(file, fileList) {
|
|
|
- //导入前判断
|
|
|
- var self = this;
|
|
|
- if (self.uploadCompanyId == null || self.uploadCompanyId == "") {
|
|
|
- self.$message({
|
|
|
- type: "warning",
|
|
|
- message: "请选择企业"
|
|
|
- });
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- return true;
|
|
|
- }
|
|
|
- },
|
|
|
//批量导入-文件超出个数限制时的钩子
|
|
|
handleBatchImportExceed(files, fileList) {
|
|
|
this.$message.warning(
|