大宝管理后台代码
zzzz
2024-04-24 ae91f4a26f2fbb426e62c93422cbcec104219589
基金
5 files modified
341 ■■■■ changed files
.env.development 2 ●●● patch | view | raw | blame | history
src/config/router.config.js 52 ●●●● patch | view | raw | blame | history
src/views/interesttreasure/agentcomponents/EditAgentinfodialog.vue 152 ●●●●● patch | view | raw | blame | history
src/views/interesttreasure/agentcomponents/addagentdialog.vue 133 ●●●● patch | view | raw | blame | history
src/views/interesttreasure/set.vue 2 ●●● patch | view | raw | blame | history
.env.development
@@ -5,6 +5,6 @@
#  VUE_APP_API_BASE_URL=https://api.marwadi.online/
# VUE_APP_API_BASE_URL=https://www.rksv.store:8091/
# VUE_APP_API_BASE_URL=http://www.ojwuf.com:8091/
VUE_APP_API_BASE_URL=http://192.168.0.110:8091/
VUE_APP_API_BASE_URL=http://192.168.0.105:8091/
# VUE_APP_API_BASE_URL= https://www.prudentcapitals.net/
# VUE_APP_API_BASE_URL=https://api.guosen.org/
src/config/router.config.js
@@ -636,32 +636,32 @@
      //     // }
      //   ]
      // },
      // {
      //   path: '/interesttreasure',
      //   redirect: '/interesttreasure/index',
      //   component: RouteView,
      //   meta: { title: '利息宝管理', icon: 'usergroup-delete', permission: ['interesttreasure'] },
      //   children: [
      //     {
      //       path: '/interesttreasure/index',
      //       name: 'InterestTreasure',
      //       component: () => import('@/views/interesttreasure/index'),
      //       meta: { title: '利息宝列表', keepAlive: true, permission: ['interesttreasure'] }
      //     },
      //     {
      //       path: '/interesttreasure/set',
      //       name: 'set',
      //       component: () => import('@/views/interesttreasure/set'),
      //       meta: { title: '利息宝设置', keepAlive: true, permission: ['set'] }
      //     }
      //     // {
      //     //   path: '/userlist/agentlist',
      //     //   name: 'Agentlist',
      //     //   component: () => import('@/views/userlist/agentlist'),
      //     //   meta: { title: '代理列表', keepAlive: true, permission: ['agentlist'] }
      //     // }
      //   ]
      // }
      {
        path: '/interesttreasure',
        redirect: '/interesttreasure/index',
        component: RouteView,
        meta: { title: '基金管理', icon: 'usergroup-delete', permission: ['interesttreasure'] },
        children: [
          {
            path: '/interesttreasure/index',
            name: 'InterestTreasure',
            component: () => import('@/views/interesttreasure/index'),
            meta: { title: '基金列表', keepAlive: true, permission: ['interesttreasure'] },
          },
          {
            path: '/interesttreasure/set',
            name: 'set',
            component: () => import('@/views/interesttreasure/set'),
            meta: { title: '基金设置', keepAlive: true, permission: ['set'] },
          },
          // {
          //   path: '/userlist/agentlist',
          //   name: 'Agentlist',
          //   component: () => import('@/views/userlist/agentlist'),
          //   meta: { title: '代理列表', keepAlive: true, permission: ['agentlist'] }
          // }
        ],
      },
      // other
      /*
      {
src/views/interesttreasure/agentcomponents/EditAgentinfodialog.vue
@@ -1,27 +1,46 @@
<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>
@@ -31,69 +50,68 @@
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>
src/views/interesttreasure/agentcomponents/addagentdialog.vue
@@ -1,12 +1,13 @@
<template>
  <div>
    <a-modal
      title="添加利息宝"
      title="添加基金"
      :width="500"
      :visible="addUserdialog"
      :confirmLoading="addUserDialogloading"
      @ok="OkaddUserdialog"
      @cancel="CanceladdUserdialog">
      @cancel="CanceladdUserdialog"
    >
      <a-form :form="addUserform" ref="addUserform">
        <!-- <a-form-item label="上级代理" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-select
@@ -15,30 +16,41 @@
            <a-select-option value="0">总代理</a-select-option>
          </a-select>
        </a-form-item> -->
        <a-form-item label="利息宝名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-form-item label="基金名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input
            placeholder="请输入利息宝名称"
            v-decorator="['name', { rules: [{ required: true, message: '请输入利息宝名称', }] }]" />
            placeholder="请输入基金名称"
            v-decorator="['name', { 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: '请输入收益率', }] }]" />
            v-decorator="['returnOfRate', { 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: '请输入内容', }] }]" />
            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-item label="周期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input
            placeholder="请输入周期"
            v-decorator="['returnTime', { rules: [{ required: true, message: '请输入周期', }] }]" />
            v-decorator="['returnTime', { rules: [{ required: true, message: '请输入周期' }] }]"
          />
        </a-form-item>
        <a-form-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input
            placeholder="请输入标题"
            v-decorator="['title', { rules: [{ required: true, message: '请输入标题', }] }]" />
            v-decorator="['title', { rules: [{ required: true, message: '请输入标题' }] }]"
          />
        </a-form-item>
      </a-form>
    </a-modal>
@@ -47,60 +59,59 @@
<script>
import { addyeb } from '@/api/home'
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 }
            },
            addUserform: this.$form.createForm(this),
            addUserdialog: false,
            addUserDialogloading: false
        }
    agentlist: {
      type: Array,
    },
    methods: {
        // 新增用户取消弹窗
        CanceladdUserdialog () {
            this.addUserdialog = false
            const form = this.$refs.addUserform.form
            form.resetFields()
        },
        // 新增用户确定
        OkaddUserdialog () {
            const form = this.$refs.addUserform.form
            form.validateFields((errors, values) => {
                if (!errors) {
                    this.addUserDialogloading = true
                    values.isOpen = 1
                    addyeb(values).then(res => {
                        if (res.status == 0) {
                            this.addUserdialog = false
                            this.$message.success({ content: '添加成功', duration: 2 })
                            form.resetFields()
                            this.getinit()
                        } else {
                            this.$message.error({ content: '添加失败' })
                        }
                        this.addUserDialogloading = false
                    })
                }
            })
        }
  },
  data() {
    return {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 13 },
      },
      addUserform: this.$form.createForm(this),
      addUserdialog: false,
      addUserDialogloading: false,
    }
  },
  methods: {
    // 新增用户取消弹窗
    CanceladdUserdialog() {
      this.addUserdialog = false
      const form = this.$refs.addUserform.form
      form.resetFields()
    },
    // 新增用户确定
    OkaddUserdialog() {
      const form = this.$refs.addUserform.form
      form.validateFields((errors, values) => {
        if (!errors) {
          this.addUserDialogloading = true
          values.isOpen = 1
          addyeb(values).then((res) => {
            if (res.status == 0) {
              this.addUserdialog = false
              this.$message.success({ content: '添加成功', duration: 2 })
              form.resetFields()
              this.getinit()
            } else {
              this.$message.error({ content: '添加失败' })
            }
            this.addUserDialogloading = false
          })
        }
      })
    },
  },
}
</script>
src/views/interesttreasure/set.vue
@@ -5,7 +5,7 @@
        <a-button
          type="primary"
          icon="plus"
          @click="$refs.addagentdialog.addUserdialog = true">添加利息宝</a-button>
          @click="$refs.addagentdialog.addUserdialog = true">添加基金</a-button>
      </div>
    </a-card>