大宝管理后台代码
jhzh
2024-09-28 451674dd4dd784fa0725b4ba052d94449d892712
src/views/userlist/agentlist.vue
@@ -36,13 +36,10 @@
                    type="primary"
                    icon="search"
                    @click=";(agentqueryParam.pageNum = 1), (pagination.current = 1), getagentlist()"
                  >查询
                    >查询
                  </a-button>
                  <a-button
                    style="margin-left: 8px"
                    @click="() => (this.agentqueryParam = {})"
                    icon="redo"
                  >重置</a-button
                  <a-button style="margin-left: 8px" @click="() => (this.agentqueryParam = {})" icon="redo"
                    >重置</a-button
                  >
                </span>
              </a-form-item>
@@ -51,7 +48,7 @@
        </a-form>
      </div>
      <div class="table-operator">
        <a-button type="primary" icon="plus" @click="$refs.addagentdialog.addUserdialog = true">添加下级代理</a-button>
        <a-button type="primary" icon="plus" @click="$refs.addagentdialog.addUserdialog = true, $refs.addagentdialog.initGetParensAgent()">添加下级代理</a-button>
      </div>
    </a-card>
@@ -107,42 +104,42 @@
  components: {
    editCapitalAgentdialog,
    EditAgentinfodialog,
    addagentdialog
    addagentdialog,
  },
  data () {
  data() {
    return {
      columns: [
        {
          title: '所属代理(Id)',
          scopedSlots: { customRender: 'agentName' },
          align: 'center'
          align: 'center',
        },
        {
          title: '代理编码',
          dataIndex: 'agentCode',
          align: 'center'
          align: 'center',
        },
        {
          title: '上级代理',
          dataIndex: 'parentName',
          align: 'center',
          scopedSlots: { customRender: 'parentName' }
          scopedSlots: { customRender: 'parentName' },
        },
        {
          title: '代理手机号',
          dataIndex: 'agentPhone',
          align: 'center'
          align: 'center',
        },
        {
          title: '真实姓名',
          dataIndex: 'agentRealName',
          align: 'center'
          align: 'center',
        },
        {
          title: '客服链接',
          dataIndex: 'onLineServices',
          align: 'center'
          align: 'center',
        },
        {
          title: '总资金',
@@ -150,13 +147,18 @@
          align: 'center',
          customRender: (text, row, index) => {
            return text
          }
          },
        },
        {
          title: '代理等级',
          dataIndex: 'agentLevel',
          align: 'center',
        },
        {
          title: '代理状态',
          dataIndex: 'isLock',
          align: 'center',
          scopedSlots: { customRender: 'isLock' }
          scopedSlots: { customRender: 'isLock' },
        },
        {
          title: '注册时间',
@@ -164,14 +166,14 @@
          align: 'center',
          customRender: (text, row, index) => {
            return moment(text).format('YYYY-MM-DD HH:mm:ss')
          }
          },
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
          scopedSlots: { customRender: 'action' },
        },
      ],
      // 表头
      pagination: {
@@ -182,7 +184,7 @@
        pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据
        onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示
        onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件
        showTotal: (total) => `共有 ${total} 条数据` // 分页中显示总的数据
        showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据
      },
      loading: false,
      agentqueryParam: {
@@ -190,55 +192,55 @@
        phone: '',
        realName: '',
        pageNum: 1,
        pageSize: 10
        pageSize: 10,
      },
      agentloading: false,
      agentlist: [],
      clickagentlist: []
      clickagentlist: [],
    }
  },
  created () {
  created() {
    this.getagentlist()
  },
  methods: {
    getDelagent (val) {
    getDelagent(val) {
      var that = this
      this.$confirm({
        title: '提示',
        content: '确认删除代理?此操作不可恢复',
        onOk () {
        onOk() {
          var data = {
            agentId: val.id
            agentId: val.id,
          }
          agentdelAgent(data).then((res) => {
            if (res.status == 0) {
              that.$message.success({ content: res.msg, duration: 2 })
              that.$message.success(res.msg)
              that.getinit()
            } else {
              that.$message.error({ content: res.msg })
              that.$message.error(res.msg)
            }
          })
        },
        onCancel () {
        onCancel() {
          console.log('Cancel')
        }
        },
      })
    },
    getinit () {
    getinit() {
      this.queryParam = {
        id: undefined,
        phone: '',
        realName: '',
        pageNum: 1,
        pageSize: 10
        pageSize: 10,
      }
      this.pagination.current = 1
      this.getagentlist()
    },
    geteditinit () {
    geteditinit() {
      this.getagentlist()
    },
    getagentlist () {
    getagentlist() {
      var that = this
      this.loading = true
      nextagent(this.agentqueryParam).then((res) => {
@@ -249,12 +251,12 @@
        }, 500)
      })
    },
    getclickagentlist () {
    getclickagentlist() {
      var that = this
      this.agentloading = true
      var data = {
        pageNum: 1,
        pageSize: 100
        pageSize: 100,
      }
      nextagent(data).then((res) => {
        this.clickagentlist = res.data.list
@@ -263,17 +265,17 @@
        }, 500)
      })
    },
    onPageChange (page, pageSize) {
    onPageChange(page, pageSize) {
      this.agentqueryParam.pageNum = page
      this.pagination.current = page
      this.getagentlist()
    },
    onSizeChange (current, pageSize) {
    onSizeChange(current, pageSize) {
      this.agentqueryParam.pageNum = current
      this.pagination.current = page
      // this.pagination.current = page
      this.agentqueryParam.pageSize = pageSize
      this.getagentlist()
    }
  }
    },
  },
}
</script>