mirror of
https://gitee.com/elegant_wings/dbd-meeting-html.git
synced 2025-06-21 05:39:36 +08:00
修改了企业联系人功能
This commit is contained in:
parent
ec052fd417
commit
863db086c7
@ -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) {
|
export function getQiXinBasicInfo (parameter) {
|
||||||
return axios({
|
return axios({
|
||||||
url: api.customer + '/getBasicInfo',
|
url: api.customer + '/getBasicInfo',
|
||||||
|
@ -290,6 +290,9 @@
|
|||||||
<a-button type='primary' @click='$refs.contactModal.add({ customerId: $route.query.customerId })'>
|
<a-button type='primary' @click='$refs.contactModal.add({ customerId: $route.query.customerId })'>
|
||||||
新建企业员工
|
新建企业员工
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-button style='margin-left: 30px' type='success' @click='importUser'>
|
||||||
|
导入用户
|
||||||
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
<a-table :pagination='false' :columns='contactsItemColumns' :dataSource='contactsItemData' rowKey='id'>
|
<a-table :pagination='false' :columns='contactsItemColumns' :dataSource='contactsItemData' rowKey='id'>
|
||||||
<template slot='operation' slot-scope='text, record'>
|
<template slot='operation' slot-scope='text, record'>
|
||||||
@ -312,6 +315,39 @@
|
|||||||
</a-tabs>
|
</a-tabs>
|
||||||
</a-form>
|
</a-form>
|
||||||
<customer-contacts-modal ref='contactModal' @ok='handleContactSaved' />
|
<customer-contacts-modal ref='contactModal' @ok='handleContactSaved' />
|
||||||
|
<a-modal v-model="visible" title="导入用户" @ok="handleFileOk">
|
||||||
|
<!-- <a-upload-dragger-->
|
||||||
|
<!-- name="file"-->
|
||||||
|
<!-- :multiple="true"-->
|
||||||
|
<!-- :file-list="fileList"-->
|
||||||
|
<!-- :action="uploadUrl"-->
|
||||||
|
<!-- :headers="headers"-->
|
||||||
|
<!-- @change="handleFileChange"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <p class="ant-upload-drag-icon">-->
|
||||||
|
<!-- <a-icon type="inbox" />-->
|
||||||
|
<!-- </p>-->
|
||||||
|
<!-- <p class="ant-upload-text">-->
|
||||||
|
<!-- 单击或拖动文件到此区域进行上传-->
|
||||||
|
<!-- </p>-->
|
||||||
|
<!-- </a-upload-dragger>-->
|
||||||
|
|
||||||
|
<a-upload
|
||||||
|
:fileList="fileList"
|
||||||
|
:customRequest="customRequest">
|
||||||
|
<a-button type="primary" >导入</a-button>
|
||||||
|
|
||||||
|
|
||||||
|
</a-upload>
|
||||||
|
<!-- <a-upload-->
|
||||||
|
<!-- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"-->
|
||||||
|
<!-- :customRequest="customRequest"-->
|
||||||
|
<!-- @change="customChange"-->
|
||||||
|
<!-- :disabled="uploadDisabled">-->
|
||||||
|
<!-- <a-button type="primary" :icon="uploadIcon" :disabled="uploadDisabled">导入</a-button>-->
|
||||||
|
<!-- </a-upload>-->
|
||||||
|
|
||||||
|
</a-modal>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -325,7 +361,8 @@ import {
|
|||||||
getQiXinBasicInfo,
|
getQiXinBasicInfo,
|
||||||
getStaffList,
|
getStaffList,
|
||||||
selectCustomerStaffList,
|
selectCustomerStaffList,
|
||||||
updateStaffByCustomer
|
updateStaffByCustomer,
|
||||||
|
importData
|
||||||
} from '@/api/admin/customer'
|
} from '@/api/admin/customer'
|
||||||
import {
|
import {
|
||||||
getFloorList,
|
getFloorList,
|
||||||
@ -439,6 +476,8 @@ export default {
|
|||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
floorList: [],
|
floorList: [],
|
||||||
roomList: [],
|
roomList: [],
|
||||||
|
file:'',
|
||||||
|
visible:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
@ -472,6 +511,43 @@ export default {
|
|||||||
this.floorList = res.data
|
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) {
|
getRoomList(value) {
|
||||||
let param = {
|
let param = {
|
||||||
|
@ -81,7 +81,6 @@
|
|||||||
<a-input placeholder='紧急联系人' v-decorator="['urgent']" />
|
<a-input placeholder='紧急联系人' v-decorator="['urgent']" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
</a-form-item>
|
|
||||||
<!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">-->
|
<!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">-->
|
||||||
<!-- <a-input placeholder="联系电话" v-decorator="['phone']"/>-->
|
<!-- <a-input placeholder="联系电话" v-decorator="['phone']"/>-->
|
||||||
<!-- </a-form-item>-->
|
<!-- </a-form-item>-->
|
||||||
@ -92,8 +91,10 @@
|
|||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { saveCustomerContacts,getStaffList,updateStaff,getStaffListNotId } from '@/api/admin/customer'
|
import { importData,getStaffList,updateStaff,getCustomer,getStaffListNotId } from '@/api/admin/customer'
|
||||||
import pick from 'lodash.pick'
|
import pick from 'lodash.pick'
|
||||||
|
import storage from 'store'
|
||||||
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
export default {
|
export default {
|
||||||
name: 'CustomerContactsModal',
|
name: 'CustomerContactsModal',
|
||||||
props: {
|
props: {
|
||||||
@ -112,12 +113,21 @@ export default {
|
|||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 16 }
|
sm: { span: 16 }
|
||||||
},
|
},
|
||||||
|
uploadUrl: process.env.VUE_APP_API_BASE_URL + '/api/dfs/upload',
|
||||||
|
imageUrl: '',
|
||||||
|
headers: {
|
||||||
|
Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
|
||||||
|
},
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
mdl: {},
|
mdl: {},
|
||||||
customerId: undefined,
|
customerId: undefined,
|
||||||
contactId: undefined,
|
contactId: undefined,
|
||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
data:[],
|
data:[],
|
||||||
|
photoImageUrl: '',
|
||||||
|
photoLoading: false,
|
||||||
|
avatarImageUrl: '',
|
||||||
|
avatarLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeCreate () {
|
beforeCreate () {
|
||||||
@ -126,6 +136,79 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 照片
|
||||||
|
photoBeforeUpload(file) {
|
||||||
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
|
||||||
|
if (!isJpgOrPng) {
|
||||||
|
this.$message.error('You can only upload JPG file!')
|
||||||
|
}
|
||||||
|
const isLt2M = file.size / 1024 < 5000
|
||||||
|
if (!isLt2M) {
|
||||||
|
this.$message.error('图片必须小于 5M!')
|
||||||
|
}
|
||||||
|
return isJpgOrPng && isLt2M
|
||||||
|
},
|
||||||
|
photoHandleChange(info) {
|
||||||
|
if (info.file.status === 'uploading') {
|
||||||
|
this.photoLoading = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (info.file.status === 'done') {
|
||||||
|
const { form: { setFieldsValue } } = this
|
||||||
|
const result = info.file.response
|
||||||
|
// 设置值
|
||||||
|
this.$nextTick(() => {
|
||||||
|
setFieldsValue({
|
||||||
|
// 设置相对路径
|
||||||
|
photo: result.fileName
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// Get this url from response in real world.
|
||||||
|
this.getBase64(info.file.originFileObj, imageUrl => {
|
||||||
|
this.photoImageUrl = imageUrl
|
||||||
|
this.photoLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 头像
|
||||||
|
avatarBeforeUpload(file) {
|
||||||
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
|
||||||
|
if (!isJpgOrPng) {
|
||||||
|
this.$message.error('You can only upload JPG file!')
|
||||||
|
}
|
||||||
|
const isLt2M = file.size / 1024 < 5000
|
||||||
|
if (!isLt2M) {
|
||||||
|
this.$message.error('图片必须小于 5M!')
|
||||||
|
}
|
||||||
|
return isJpgOrPng && isLt2M
|
||||||
|
},
|
||||||
|
avatarHandleChange(info) {
|
||||||
|
if (info.file.status === 'uploading') {
|
||||||
|
this.avatarLoading = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (info.file.status === 'done') {
|
||||||
|
const { form: { setFieldsValue } } = this
|
||||||
|
const result = info.file.response
|
||||||
|
// 设置值
|
||||||
|
this.$nextTick(() => {
|
||||||
|
setFieldsValue({
|
||||||
|
// 设置相对路径
|
||||||
|
avatar: result.fileName
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// Get this url from response in real world.
|
||||||
|
this.getBase64(info.file.originFileObj, imageUrl => {
|
||||||
|
this.avatarImageUrl = imageUrl
|
||||||
|
this.avatarLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getBase64(img, callback) {
|
||||||
|
const reader = new FileReader()
|
||||||
|
reader.addEventListener('load', () => callback(reader.result))
|
||||||
|
reader.readAsDataURL(img)
|
||||||
|
},
|
||||||
handleSearch(value){
|
handleSearch(value){
|
||||||
let param = {
|
let param = {
|
||||||
mobile:value
|
mobile:value
|
||||||
@ -151,7 +234,7 @@ export default {
|
|||||||
let param = {
|
let param = {
|
||||||
icsCustomerId:contactInfo.customerId
|
icsCustomerId:contactInfo.customerId
|
||||||
}
|
}
|
||||||
getStaffListNotId(param).then(res =>{
|
getCustomer(param).then(res =>{
|
||||||
this.data =res.rows
|
this.data =res.rows
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -159,10 +242,10 @@ export default {
|
|||||||
edit (record) {
|
edit (record) {
|
||||||
this.mdl = Object.assign(record)
|
this.mdl = Object.assign(record)
|
||||||
console.log(this.mdl)
|
console.log(this.mdl)
|
||||||
// this.mdl = record
|
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.mdl, 'id', 'customerId', 'name', 'phone', 'remark'))
|
this.form.setFieldsValue(pick(this.mdl, 'id','name','username','mobile','gender',
|
||||||
|
'photo','avatar','cardNo','address','email','degree','urgent', 'customerId', 'remark'))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSubmit (e) {
|
handleSubmit (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user