diff --git a/src/components/ReadExcel/index.vue b/src/components/ReadExcel/index.vue
new file mode 100644
index 0000000..5df785e
--- /dev/null
+++ b/src/components/ReadExcel/index.vue
@@ -0,0 +1,154 @@
+
+
+
+
+ 将文件拖到此处,或点击上传
+ 只能上传xls/xlsx文件
+
+
+
确认
+
+
+
+
+
+
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 6e74784..5fd2b49 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -126,10 +126,10 @@ export default {
// password: '111111'
// },
loginForm: {
- username: "", //18882564006
- captcha: "",
- // username: "18882564006", //18882564006
- // captcha: "111111",
+ // username: "", //18882564006
+ // captcha: "",
+ username: "18882564006", //18882564006
+ captcha: "111111",
appVersion: "1.0.0",
system: "IOS",
device: navigator.userAgent,
diff --git a/src/views/residentInformation/list.vue b/src/views/residentInformation/list.vue
index 4373ee4..f750126 100644
--- a/src/views/residentInformation/list.vue
+++ b/src/views/residentInformation/list.vue
@@ -72,6 +72,15 @@
style="font-size:12px;padding:10px 20px;margin-bottom:20px"
>新增
+ 导入
@@ -281,6 +290,16 @@
确 定
+
+
+
+
+
@@ -295,9 +314,10 @@ import RegionSelect from "@/components/RegionSelect";
import { getRegions } from "@/api/region";
import Pagination from "@/components/Pagination";
import CutUpload from "@/components/cutUploadImage/index.vue";
+import ReadExcel from "@/components/ReadExcel/index";
export default {
- components: { Pagination, CutUpload, RegionSelect },
+ components: { Pagination, CutUpload, RegionSelect, ReadExcel },
data() {
return {
listLoading: false,
@@ -335,7 +355,9 @@ export default {
},
regionSearchVal: undefined,
dialogDeleteConfirm: false,
- isStaff: false
+ isStaff: false,
+ excelUploading: false,
+ dialogExcelImport: false
};
},
created() {
@@ -537,6 +559,31 @@ export default {
// this.listQuery.params.isConvenience === undefined;
// console.log(this.listQuery.params);
// }
+ },
+ handleExcelImport() {
+ this.dialogExcelImport = true;
+ },
+ getExcelData(data) {
+ this.excelUploading = true;
+ addResidentInfoList(data)
+ .then(res => {
+ if (res.c === 200) {
+ this.$notify.success("导入成功");
+ setTimeout(() => {
+ this.excelUploading = false;
+ }, 3000);
+ this.dialogExcelImport = false;
+ this.getList();
+ } else {
+ setTimeout(() => {
+ this.excelUploading = false;
+ }, 3000);
+ this.dialogExcelImport = false;
+ }
+ })
+ .catch(error => {
+ this.$notify.error(error);
+ });
}
}
};