<template>
|
<div>
|
<a-modal
|
title="修改客服链接"
|
:width="500"
|
:visible="editUserdialog"
|
:confirmLoading="editUserDialogloading"
|
@ok="OkeditUserdialog"
|
@cancel="CanceleditUserdialog">
|
<a-form :form="editUserform" ref="editUserform">
|
<a-form-item label="客服链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input placeholder="请输入客服链接" v-decorator="['onLineServices', {}]" />
|
</a-form-item>
|
</a-form>
|
</a-modal>
|
</div>
|
</template>
|
<script>
|
import { updataOnLineServices } from '@/api/home'
|
import pick from 'lodash.pick'
|
export default {
|
components: {},
|
props: {
|
agentlist: {
|
type: Function,
|
default: function () {
|
}
|
}
|
|
},
|
data () {
|
return {
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 7 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 13 }
|
},
|
editUserform: this.$form.createForm(this),
|
editUserdialog: false,
|
editUserDialogloading: false,
|
fields: ['onLineServices'],
|
currentDetails: {},
|
userdetail: {}
|
}
|
},
|
methods: {
|
// getOnLineServices (val) {
|
// console.log(val);
|
// const data = {
|
// userId: val.id
|
// }
|
// this.getEditorder(val)
|
// // console.log(111);
|
// // usergetBank(data).then(res => {
|
// // if (res.status == 0) {
|
// // } else {
|
|
// // }
|
// // })
|
// },
|
getEditorder (val) {
|
console.log(val)
|
this.userdetail = val
|
this.editUserdialog = true
|
this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
|
this.editUserform.setFieldsValue(pick(val, this.fields))
|
},
|
CanceleditUserdialog () {
|
this.editUserdialog = false
|
const form = this.$refs.editUserform.form
|
form.resetFields()
|
},
|
OkeditUserdialog () {
|
const form = this.$refs.editUserform.form
|
form.validateFields((errors, values) => {
|
if (!errors) {
|
values.agentId = this.userdetail.id
|
this.editUserDialogloading = true
|
updataOnLineServices(values).then(res => {
|
if (res.status == 0) {
|
this.editUserdialog = false
|
this.$message.success({ content: res.msg, duration: 2 })
|
form.resetFields()
|
this.agentlist()
|
} else {
|
this.$message.error({ content: res.msg })
|
}
|
this.editUserDialogloading = false
|
})
|
}
|
})
|
}
|
}
|
}
|
</script>
|