大宝管理后台代码
zzzz
2024-03-27 12fa274dfa153db39b6ee18a406b7ab9c4667e90
src/views/userlist/agentlist.vue
@@ -10,11 +10,9 @@
                  v-model="agentqueryParam.id"
                  placeholder="请选择下级代理"
                  @focus="getclickagentlist"
                  :loading="agentloading">
                  <a-select-option
                    v-for="(item, index) in clickagentlist"
                    :key="index"
                    :value="item.id">
                  :loading="agentloading"
                >
                  <a-select-option v-for="(item, index) in clickagentlist" :key="index" :value="item.id">
                    {{ `${item.agentName}/${item.id}` }}
                  </a-select-option>
                </a-select>
@@ -37,13 +35,12 @@
                  <a-button
                    type="primary"
                    icon="search"
                    @click="agentqueryParam.pageNum = 1, pagination.current = 1,getagentlist()">查询
                    @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>
            </a-col>
@@ -51,10 +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">添加下级代理</a-button>
      </div>
    </a-card>
@@ -65,7 +59,8 @@
        :pagination="pagination"
        :columns="columns"
        :data-source="agentlist"
        rowKey="id">
        rowKey="id"
      >
        <span slot="agentName" slot-scope="text,record">
          <template>
            <div>
@@ -82,17 +77,14 @@
          </template>
        </span>
        <template slot="action" slot-scope="text,record">
          <a
          <!-- <a
            slot="action"
            href="javascript:;"
            @click="$refs.editCapitalAgentdialog.getEditorder(record)">修改资金</a>
          <a-divider type="vertical" />
          <a-divider type="vertical" /> -->
          <a slot="action" href="javascript:;" @click="getDelagent(record)">删除代理</a>
          <a-divider type="vertical" />
          <a
            slot="action"
            href="javascript:;"
            @click="$refs.EditAgentinfodialog.getEditorder(record)">修改代理</a>
          <a slot="action" href="javascript:;" @click="$refs.EditAgentinfodialog.getEditorder(record)">修改代理</a>
        </template>
      </a-table>
    </a-card>
@@ -102,7 +94,6 @@
  </page-header-wrapper>
</template>
<script>
import editCapitalAgentdialog from './agentcomponents/editCapitalAgentdialog'
import EditAgentinfodialog from './agentcomponents/EditAgentinfodialog'
import addagentdialog from './agentcomponents/addagentdialog'
@@ -113,7 +104,7 @@
    components: {
        editCapitalAgentdialog,
        EditAgentinfodialog,
        addagentdialog
    addagentdialog,
    },
    data () {
        return {
@@ -121,34 +112,34 @@
                {
                    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: '总资金',
@@ -156,13 +147,13 @@
                    align: 'center',
                    customRender: (text, row, index) => {
                        return text
                    }
          },
                },
                {
                    title: '代理状态',
                    dataIndex: 'isLock',
                    align: 'center',
                    scopedSlots: { customRender: 'isLock' }
          scopedSlots: { customRender: 'isLock' },
                },
                {
                    title: '注册时间',
@@ -170,14 +161,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: {
@@ -188,7 +179,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: {
@@ -196,11 +187,11 @@
                phone: '',
                realName: '',
                pageNum: 1,
                pageSize: 10
        pageSize: 10,
            },
            agentloading: false,
            agentlist: [],
            clickagentlist: []
      clickagentlist: [],
        }
    },
    created () {
@@ -214,9 +205,9 @@
                content: '确认删除代理?此操作不可恢复',
                onOk () {
                    var data = {
                        agentId: val.id
            agentId: val.id,
                    }
                    agentdelAgent(data).then(res => {
          agentdelAgent(data).then((res) => {
                        if (res.status == 0) {
                            that.$message.success({ content: res.msg, duration: 2 })
                            that.getinit()
@@ -227,7 +218,7 @@
                },
                onCancel () {
                    console.log('Cancel')
                }
        },
            })
        },
        getinit () {
@@ -236,7 +227,7 @@
                phone: '',
                realName: '',
                pageNum: 1,
                pageSize: 10
        pageSize: 10,
            }
            this.pagination.current = 1
            this.getagentlist()
@@ -247,7 +238,7 @@
        getagentlist () {
            var that = this
            this.loading = true
            nextagent(this.agentqueryParam).then(res => {
      nextagent(this.agentqueryParam).then((res) => {
                this.agentlist = res.data.list
                this.pagination.total = res.data.total
                setTimeout(() => {
@@ -260,9 +251,9 @@
            this.agentloading = true
            var data = {
                pageNum: 1,
                pageSize: 100
        pageSize: 100,
            }
            nextagent(data).then(res => {
      nextagent(data).then((res) => {
                this.clickagentlist = res.data.list
                setTimeout(() => {
                    that.agentloading = false
@@ -279,7 +270,7 @@
            this.pagination.current = page
            this.agentqueryParam.pageSize = pageSize
            this.getagentlist()
        }
    }
    },
  },
}
</script>