| File was renamed from src/views/loanmanage/agentcomponents/EditAgentinfodialog.vue |
| | |
| | | <template> |
| | | <div> |
| | | <a-modal |
| | | title="修改机构信息" |
| | | title="修改客服链接" |
| | | :width="500" |
| | | :visible="editUserdialog" |
| | | :confirmLoading="editUserDialogloading" |
| | | @ok="OkeditUserdialog" |
| | | @cancel="CanceleditUserdialog"> |
| | | <a-form :form="editUserform" ref="editUserform"> |
| | | <a-form-item label="代理ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入代理ID" disabled v-decorator="['id', {}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="机构名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入机构名称" v-decorator="['name', {rules: [{ required: true, message: '请输入机构名称', }] }]" /> |
| | | <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 { updkjg } from '@/api/home' |
| | | import { updataOnLineServices } from '@/api/home' |
| | | import pick from 'lodash.pick' |
| | | export default { |
| | | components: {}, |
| | | props: { |
| | | getinit: { |
| | | agentlist: { |
| | | type: Function, |
| | | default: function () { |
| | | } |
| | | }, |
| | | agentlist: { |
| | | type: Array |
| | | } |
| | | |
| | | }, |
| | | data () { |
| | | return { |
| | |
| | | editUserform: this.$form.createForm(this), |
| | | editUserdialog: false, |
| | | editUserDialogloading: false, |
| | | fields: ['id', 'dkJg'], |
| | | currentDetails: {} |
| | | 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) { |
| | | this.currentDetails = 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)) |
| | | this.editUserform.setFieldsValue(pick({ agentPwd: '' }, 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 |
| | | updkjg(values).then(res => { |
| | | updataOnLineServices(values).then(res => { |
| | | if (res.status == 0) { |
| | | this.editUserdialog = false |
| | | this.$message.success({ content: '修改成功', duration: 2 }) |
| | | this.$message.success({ content: res.msg, duration: 2 }) |
| | | form.resetFields() |
| | | this.getinit() |
| | | this.agentlist() |
| | | } else { |
| | | this.$message.error({ content: '修改失败' }) |
| | | this.$message.error({ content: res.msg }) |
| | | } |
| | | this.editUserDialogloading = false |
| | | }) |