| File was renamed from src/views/capital/agentcomponents/EditAgentinfodialogtj.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 label="用户id" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入用户id" disabled v-decorator="['agentId', {}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="通道名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入通道名称" v-decorator="['channelName', {rules: [{ required: true, message: '请输入通道名称', }] }]" /> |
| | | <a-form-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input |
| | | placeholder="请输入金额" |
| | | v-decorator="['amt', { rules: [{ required: true, message: '请输入金额', }] }]" /> |
| | | </a-form-item> |
| | | <a-form-item label="通道备注" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入通道备注" v-decorator="['channelDesc', {rules: [{ required: true, message: '请输入通道备注', }] }]" /> |
| | | <a-form-item label="扣入款" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-select |
| | | placeholder="请选择扣入款" |
| | | v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款', }] }]"> |
| | | <a-select-option value="1">扣款</a-select-option> |
| | | <a-select-option value="0">入款</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { upcztd } from '@/api/home' |
| | | import { agentupdateAgentAmt } from '@/api/home' |
| | | import pick from 'lodash.pick' |
| | | export default { |
| | | components: {}, |
| | |
| | | type: Function, |
| | | default: function () { |
| | | } |
| | | }, |
| | | agentlist: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data () { |
| | |
| | | editUserform: this.$form.createForm(this), |
| | | editUserdialog: false, |
| | | editUserDialogloading: false, |
| | | fields: ['id', 'channelName', 'channelDesc'], |
| | | fields: ['amt', 'direction', 'agentId'], |
| | | currentDetails: {} |
| | | } |
| | | }, |
| | |
| | | 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)) |
| | | this.editUserform.setFieldsValue(pick({ agentId: val.id }, 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) { |
| | | this.editUserDialogloading = true |
| | | values.channelMethod = '' |
| | | values.channelType = '2' |
| | | upcztd(values).then(res => { |
| | | agentupdateAgentAmt(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() |
| | | } else { |
| | | this.$message.error({ content: '修改失败' }) |
| | | this.$message.error({ content: res.msg }) |
| | | } |
| | | this.editUserDialogloading = false |
| | | }) |