This commit is contained in:
张良(004796)
2024-03-13 16:59:17 +08:00
parent 55c04e1d1b
commit 8f40a0c7dd
8 changed files with 588 additions and 72 deletions

View File

@@ -32,11 +32,22 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['xq:userExtend:add']"
>收益调整
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userExtendList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="用户编号" align="center" prop="usercode"/>
<el-table-column label="昵称" align="center" prop="nickname" show-overflow-tooltip/>
<el-table-column label="手机号" align="center" prop="mobile" width="100"/>
@@ -45,53 +56,33 @@
<image-avatar :src="scope.row.avatar"/>
</template>
</el-table-column>
<el-table-column label="收益" align="center" prop="incomeCoin" />
<el-table-column label="邀请人" align="center" prop="inviteId">
<template v-slot="scope">
<span v-if="!scope.row.inviteId">-</span>
<span v-if="scope.row.inviteId">{{scope.row.inviteNickname}}({{scope.row.inviteUsercode}})</span>
</template>
</el-table-column>
<el-table-column label="消费统计" align="center" prop="consumeTotal" />
<el-table-column label="提现统计" align="center" prop="withdrawTotal" />
<el-table-column label="给上级的提成" align="center" prop="cashbackTotal" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['xq:userExtend:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['xq:userExtend:remove']"
>删除</el-button>
</template>
</el-table-column>
<el-table-column label="收益" align="center" prop="incomeCoin"/>
<el-table-column label="消费统计" align="center" prop="consumeTotal"/>
<el-table-column label="提现统计" align="center" prop="withdrawTotal"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<add-account-dialog v-if="addAccountDialogVisible" ref="addAccountDialog" @refreshDataList="getList"/>
</div>
</template>
<script>
import { listUserExtend } from '@/api/xq/userExtend'
import AddAccountDialog from '@/views/xq/userExtend/add-account-dialog.vue'
export default {
name: "UserExtend",
name: 'UserExtend',
components: { AddAccountDialog },
data() {
return {
addAccountDialogVisible: false,
// 遮罩层
loading: true,
// 选中数组
@@ -112,39 +103,45 @@ export default {
pageSize: 10,
nickname: undefined,
usercode: undefined,
mobile: undefined,
},
};
mobile: undefined
}
}
},
created() {
this.getList();
this.getList()
},
methods: {
handleAdd(row) {
this.addAccountDialogVisible = true
this.$nextTick(() => {
this.$refs.addAccountDialog.init(row?.usercode)
})
},
/** 查询用户邀请列表 */
getList() {
this.loading = true;
this.loading = true
listUserExtend(this.queryParams).then(response => {
this.userExtendList = response.rows;
this.total = response.total;
this.loading = false;
});
this.userExtendList = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
}
}
};
}
</script>