| | |
| | | :visible="editUserdialog" |
| | | :confirmLoading="editUserDialogloading" |
| | | @ok="OkeditUserdialog" |
| | | @cancel="CanceleditUserdialog"> |
| | | @cancel="CanceleditUserdialog" |
| | | > |
| | | <a-form :form="editUserform" ref="editUserform"> |
| | | <a-form-item label="所属代理" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-select placeholder="请选择所属代理" v-decorator="['agentId', {}]"> |
| | | <a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">{{ |
| | | item.agentName |
| | | }} |
| | | <a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id" |
| | | >{{ item.agentName }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | |
| | | <a-input placeholder="请输入用户名" v-decorator="['realName', {}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入密码" v-decorator="['pwd', {}]" /> |
| | | <a-input placeholder="请输入密码" v-decorator="['userPwd', {}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="资金使用百分比" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入资金使用百分比" v-decorator="['fundRatio', {}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="杠杠" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入杠杠" v-decorator="['lever', {}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="身份证号码" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入身份证号码" v-decorator="['idCard', {}]" /> |
| | |
| | | import { userupdate } from '@/api/home' |
| | | import pick from 'lodash.pick' |
| | | export default { |
| | | components: {}, |
| | | props: { |
| | | getinit: { |
| | | type: Function, |
| | | default: function () { |
| | | } |
| | | }, |
| | | agentlist: { |
| | | type: Array |
| | | } |
| | | components: {}, |
| | | props: { |
| | | getinit: { |
| | | 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: ['agentId', 'phone', 'realName', 'pwd', 'idCard', 'isLogin', 'isLock'], |
| | | currentDetails: {} |
| | | } |
| | | agentlist: { |
| | | type: Array, |
| | | }, |
| | | methods: { |
| | | getEditorder (val) { |
| | | this.currentDetails = 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.id = this.currentDetails.id |
| | | this.editUserDialogloading = true |
| | | userupdate(values).then(res => { |
| | | if (res.status == 0) { |
| | | this.editUserdialog = false |
| | | this.$message.success({ content: res.msg, duration: 2 }) |
| | | form.resetFields() |
| | | this.getinit() |
| | | } else { |
| | | this.$message.error({ content: res.msg }) |
| | | } |
| | | this.editUserDialogloading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | 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: ['agentId', 'phone', 'realName', 'userPwd', 'idCard', 'isLogin', 'isLock', 'fundRatio', 'lever'], |
| | | currentDetails: {}, |
| | | } |
| | | }, |
| | | methods: { |
| | | getEditorder(val) { |
| | | delete val.userPwd |
| | | this.currentDetails = 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.id = this.currentDetails.id |
| | | this.editUserDialogloading = true |
| | | userupdate(values).then((res) => { |
| | | if (res.status == 0) { |
| | | this.editUserdialog = false |
| | | this.$message.success(res.msg) |
| | | form.resetFields() |
| | | this.getinit() |
| | | } else { |
| | | this.$message.error(res.msg) |
| | | } |
| | | this.editUserDialogloading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |