From 863db086c7830e9c252e60a87f5b51d4283c852a Mon Sep 17 00:00:00 2001
From: chendaze <1824191732@qq.com>
Date: Tue, 2 Apr 2024 08:49:14 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E8=81=94=E7=B3=BB=E4=BA=BA=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/admin/customer.js | 9 ++
src/views/admin/CustomerEdit.vue | 78 +++++++++++++++-
.../admin/modules/CustomerContactsModal.vue | 93 ++++++++++++++++++-
3 files changed, 174 insertions(+), 6 deletions(-)
diff --git a/src/api/admin/customer.js b/src/api/admin/customer.js
index 3dd850c..9bf965f 100644
--- a/src/api/admin/customer.js
+++ b/src/api/admin/customer.js
@@ -100,6 +100,15 @@ export function getCustomer (parameter) {
})
}
+export function importData (data) {
+ return axios({
+ url: api.icsCustomerStaff + '/importData',
+ method: 'post',
+ headers: { 'Content-Type': 'multipart/form-data' },
+ params: data
+ })
+}
+
export function getQiXinBasicInfo (parameter) {
return axios({
url: api.customer + '/getBasicInfo',
diff --git a/src/views/admin/CustomerEdit.vue b/src/views/admin/CustomerEdit.vue
index fc310b6..4a7851c 100644
--- a/src/views/admin/CustomerEdit.vue
+++ b/src/views/admin/CustomerEdit.vue
@@ -290,6 +290,9 @@
新建企业员工
+
+ 导入用户
+
@@ -312,6 +315,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 导入
+
+
+
+
+
+
+
+
+
+
+
+
@@ -325,7 +361,8 @@ import {
getQiXinBasicInfo,
getStaffList,
selectCustomerStaffList,
- updateStaffByCustomer
+ updateStaffByCustomer,
+ importData
} from '@/api/admin/customer'
import {
getFloorList,
@@ -439,6 +476,8 @@ export default {
form: this.$form.createForm(this),
floorList: [],
roomList: [],
+ file:'',
+ visible:false
}
},
filters: {
@@ -472,6 +511,43 @@ export default {
this.floorList = res.data
})
},
+
+ customRequest(file){
+ // file 是上传的文件 其内容会在放在下面截图中
+ // 后端需要接受的参数是 formData数据,
+ // uploadFile 我自己的接口
+ console.log(file)
+ importData({ filePath:file.file.name }).then(res => {
+ if (res.success) {
+ // 调用组件内方法, 设置为成功状态
+ file.onSuccess(res, file.file)
+ file.status = 'done'
+ } else {
+ file.onError()
+ file.status = 'error'
+ }
+ })
+ },
+
+ handleFileChange(info){
+ this.fileList = info.fileList
+
+ if (info.file.status === 'done') {
+ const result = info.file.response
+ this.file =info.file.response
+ this.fileName = result.fileName
+ }
+ },
+ //导入用户数据
+ importUser(){
+ this.visible = true
+ },
+ handleFileOk(){
+ console.log(this.file)
+ importData({file:this.file}).then(res =>{
+ console.log(res)
+ })
+ },
// 获取房间
getRoomList(value) {
let param = {
diff --git a/src/views/admin/modules/CustomerContactsModal.vue b/src/views/admin/modules/CustomerContactsModal.vue
index d3e056c..f7d6b90 100644
--- a/src/views/admin/modules/CustomerContactsModal.vue
+++ b/src/views/admin/modules/CustomerContactsModal.vue
@@ -81,7 +81,6 @@
-
@@ -92,8 +91,10 @@