| | |
| | | <template> |
| | | <div> |
| | | <a-modal |
| | | title="修改利息宝信息" |
| | | title="修改基金信息" |
| | | :width="500" |
| | | :visible="editUserdialog" |
| | | :confirmLoading="editUserDialogloading" |
| | | @ok="OkeditUserdialog" |
| | | @cancel="CanceleditUserdialog"> |
| | | @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="['title', {rules: [{ required: true, message: '请输入标题', }] }]" /> |
| | | <a-input |
| | | placeholder="请输入标题" |
| | | v-decorator="['title', { rules: [{ required: true, message: '请输入标题' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item label="收益率" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入收益率" v-decorator="['returnOfRate', {rules: [{ required: true, message: '请输入收益率', }] }]" /> |
| | | <a-input |
| | | placeholder="请输入收益率" |
| | | v-decorator="['returnOfRate', { rules: [{ required: true, message: '请输入收益率' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item label="周期" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入周期" v-decorator="['returnTime', {rules: [{ required: true, message: '请输入周期', }] }]" /> |
| | | <a-input |
| | | placeholder="请输入周期" |
| | | v-decorator="['returnTime', { rules: [{ required: true, message: '请输入周期' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item label="内容" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请输入内容" v-decorator="['edesc', {rules: [{ required: true, message: '请输入内容', }] }]" /> |
| | | <a-input |
| | | placeholder="请输入内容" |
| | | v-decorator="['edesc', { rules: [{ required: true, message: '请输入内容' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item label="最低购买数量" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input |
| | | placeholder="请输入最低购买数量" |
| | | v-decorator="['buyLowestNum', { rules: [{ required: true, message: '请输入最低购买数量' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-modal> |
| | |
| | | import { upyeb } 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: ['id', 'title', 'returnOfRate', 'edesc', 'returnTime'], |
| | | 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)) |
| | | 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) { |
| | | this.editUserDialogloading = true |
| | | values.isOpen = 1 |
| | | upyeb(values).then(res => { |
| | | if (res.status == 0) { |
| | | this.editUserdialog = false |
| | | this.$message.success({ content: '修改成功', duration: 2 }) |
| | | form.resetFields() |
| | | this.getinit() |
| | | } else { |
| | | this.$message.error({ content: '修改失败' }) |
| | | } |
| | | 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: ['id', 'title', 'returnOfRate', 'edesc', 'returnTime', 'buyLowestNum'], |
| | | currentDetails: {}, |
| | | } |
| | | }, |
| | | methods: { |
| | | getEditorder(val) { |
| | | this.currentDetails = 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) { |
| | | this.editUserDialogloading = true |
| | | values.isOpen = 1 |
| | | upyeb(values).then((res) => { |
| | | if (res.status == 0) { |
| | | this.editUserdialog = false |
| | | this.$message.success({ content: '修改成功', duration: 2 }) |
| | | form.resetFields() |
| | | this.getinit() |
| | | } else { |
| | | this.$message.error({ content: '修改失败' }) |
| | | } |
| | | this.editUserDialogloading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |