bug:单位用户&个人用户参赛记录
This commit is contained in:
parent
ed6cb2b19e
commit
57b55ca4ec
@ -1,12 +1,10 @@
|
||||
<template>
|
||||
<div class="system-menu-container layout-padding">
|
||||
<ProTable ref="tableRef" :request-api="appuserPageGet" @selection-change="handleSelectionChange" :columns="columns" :pagination="true"
|
||||
:tool-button="false" :initParams="initParam" row-key="id">
|
||||
<ProTable ref="tableRef" :request-api="appuserPageGet" @selection-change="handleSelectionChange" :columns="columns" :pagination="true" :tool-button="false" :initParams="initParam" row-key="id">
|
||||
<template #tools>
|
||||
<el-popconfirm title="确认批量审核吗?" @confirm="onBatchAudit">
|
||||
<template #reference>
|
||||
<el-button v-auth="'user:general:audit'" size="small" type="primary"> 批量审核
|
||||
</el-button>
|
||||
<el-button v-auth="'user:general:audit'" size="small" type="primary"> 批量审核 </el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
@ -19,36 +17,23 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #idCardImageUrl="scope">
|
||||
<PreviewImage
|
||||
v-if="scope.row.idCardImageUrl"
|
||||
:src="scope.row.idCardImageUrl"
|
||||
width="100px"
|
||||
height="100px"
|
||||
fit="cover"
|
||||
radius="4px"
|
||||
:show-zoom-icon="true"
|
||||
/>
|
||||
<PreviewImage v-if="scope.row.idCardImageUrl" :src="scope.row.idCardImageUrl" width="100px" height="100px" fit="cover" radius="4px" :show-zoom-icon="true" />
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary"
|
||||
@click="onOpenMenu(scope.row)"> 参赛记录 </el-button>
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary" @click="onOpenMenu(scope.row)"> 参赛记录 </el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog title="参赛记录" v-model="isShowDialog" width="80%" @close="onDialogClose">
|
||||
<ProTable v-if="isShowDialog" ref="table" :request-api="eventrecordPageGet" :columns="columnsUser" :pagination="true"
|
||||
:tool-button="false" :initParams="initParamUser">
|
||||
<ProTable v-if="isShowDialog" ref="table" :request-api="eventrecordPageGet" :columns="columnsUser" :pagination="true" :tool-button="false" :initParam="initParamUser">
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
<template #startTime="scope">
|
||||
{{ scope.row.startTime }} -- {{ scope.row.endTime }}
|
||||
</template>
|
||||
<template #startTime="scope"> {{ scope.row.startTime }} -- {{ scope.row.endTime }} </template>
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary"
|
||||
@click="lookBook(scope.row)"> 查看证书 </el-button>
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary" @click="lookBook(scope.row)"> 查看证书 </el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
<template #footer>
|
||||
@ -59,11 +44,9 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog title="查看证书" v-model="isShowBook" width="80%">
|
||||
<div>
|
||||
证书
|
||||
</div>
|
||||
<div>证书</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancelB">取消</el-button>
|
||||
@ -80,8 +63,8 @@ import { ElMessage, ElForm } from 'element-plus';
|
||||
import SysMenuApi from '/@/api/SysMenuApi';
|
||||
import { auths } from '/@/utils/authFunction';
|
||||
import ProTable from '/@/components/ProTable/index.vue';
|
||||
import { appuserPageGet , appuserAuditPost} from '/@/api/match/appuser';
|
||||
import { eventrecordPageGet , eventrecordCertificatesGet} from '/@/api/match/eventRecord';
|
||||
import { appuserPageGet, appuserAuditPost } from '/@/api/match/appuser';
|
||||
import { eventrecordPageGet, eventrecordCertificatesGet } from '/@/api/match/eventRecord';
|
||||
import PreviewImage from '/@/components/PreviewImage/index.vue';
|
||||
|
||||
const initParam = ref({
|
||||
@ -176,7 +159,7 @@ const handleSelectionChange = (val) => {
|
||||
selectedListIds.value = val.map((item) => item.id);
|
||||
};
|
||||
|
||||
const statusNameList = ['未提交','未审核','已通过','未通过'];
|
||||
const statusNameList = ['未提交', '未审核', '已通过', '未通过'];
|
||||
|
||||
const columnsUser = ref([
|
||||
{ prop: 'index', label: '序号', align: 'center' },
|
||||
@ -210,7 +193,7 @@ const columnsUser = ref([
|
||||
isShow: false,
|
||||
},
|
||||
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right'},
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right' },
|
||||
]);
|
||||
|
||||
const isShowDialog = ref(false);
|
||||
@ -218,29 +201,29 @@ const table = ref();
|
||||
|
||||
const onOpenMenu = (row) => {
|
||||
console.log(row);
|
||||
|
||||
|
||||
// 参数验证
|
||||
if (!row || !row.id) {
|
||||
ElMessage.warning('用户信息无效,无法查看参赛记录');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (typeof row.id !== 'number' || row.id <= 0) {
|
||||
ElMessage.warning('用户ID无效,请刷新页面后重试');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 设置用户ID参数
|
||||
initParamUser.value.appUserId = row.id;
|
||||
isShowDialog.value = true;
|
||||
|
||||
|
||||
// 下次打开对话框时强制刷新数据
|
||||
initParamUser.value.refresh = Date.now();
|
||||
};
|
||||
|
||||
const onBatchAudit = async () => {
|
||||
console.log(selectedListIds.value);
|
||||
const { succeeded, data } = await appuserAuditPost({ ids: selectedListIds.value , status: 2 });
|
||||
const { succeeded, data } = await appuserAuditPost({ ids: selectedListIds.value, status: 2 });
|
||||
if (succeeded) {
|
||||
ElMessage.success('操作成功');
|
||||
// initParam.value.refresh = !initParam.value.refresh;
|
||||
@ -266,13 +249,12 @@ const lookBook = async (row) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 对话框关闭时清理
|
||||
const onDialogClose = () => {
|
||||
// 清理参数,避免下次查询时使用旧参数
|
||||
initParamUser.value = {
|
||||
appUserId: null,
|
||||
refresh: Date.now()
|
||||
refresh: Date.now(),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,50 +1,44 @@
|
||||
<template>
|
||||
<div class="system-menu-container layout-padding">
|
||||
<ProTable ref="tableRef" :request-api="merchantcertificationPageGet" @selection-change="handleSelectionChange" :columns="columns" :pagination="true"
|
||||
:tool-button="false" :initParams="initParam" row-key="id">
|
||||
<ProTable
|
||||
ref="tableRef"
|
||||
:request-api="merchantcertificationPageGet"
|
||||
@selection-change="handleSelectionChange"
|
||||
:columns="columns"
|
||||
:pagination="true"
|
||||
:tool-button="false"
|
||||
:initParams="initParam"
|
||||
row-key="id"
|
||||
>
|
||||
<template #tools>
|
||||
<el-button v-auth="'user:general:audit'" size="small" type="primary" @click="showAuditDialog"> 批量审核
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button v-auth="'user:general:audit'" size="small" type="primary" @click="showAuditDialog"> 批量审核 </el-button>
|
||||
</template>
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
<template #auditStatus="scope">
|
||||
<el-tag :type="getAuditStatusType(scope.row.auditStatus)">
|
||||
{{ getAuditStatusText(scope.row.auditStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<el-tag :type="getAuditStatusType(scope.row.auditStatus)">
|
||||
{{ getAuditStatusText(scope.row.auditStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #businessLicenseUrl="scope">
|
||||
<PreviewImage
|
||||
v-if="scope.row.businessLicenseUrl"
|
||||
:src="scope.row.businessLicenseUrl"
|
||||
width="100px"
|
||||
height="100px"
|
||||
fit="cover"
|
||||
radius="4px"
|
||||
:show-zoom-icon="true"
|
||||
/>
|
||||
<PreviewImage v-if="scope.row.businessLicenseUrl" :src="scope.row.businessLicenseUrl" width="100px" height="100px" fit="cover" radius="4px" :show-zoom-icon="true" />
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary"
|
||||
@click="onOpenMenu(scope.row)"> 参赛记录 </el-button>
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary" @click="onOpenMenu(scope.row)"> 参赛记录 </el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog title="参赛记录" v-model="isShowDialog" width="80%" @close="onDialogClose">
|
||||
<ProTable v-if="isShowDialog" ref="table" :request-api="eventrecordPageGet" :columns="columnsUser" :pagination="true"
|
||||
:tool-button="false" :initParams="initParamUser">
|
||||
<ProTable v-if="isShowDialog" ref="table" :request-api="eventrecordPageGet" :columns="columnsUser" :pagination="true" :tool-button="false" :initParam="initParamUser">
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
<template #startTime="scope">
|
||||
{{ scope.row.startTime }} -- {{ scope.row.endTime }}
|
||||
</template>
|
||||
<template #startTime="scope"> {{ scope.row.startTime }} -- {{ scope.row.endTime }} </template>
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary"
|
||||
@click="lookBook(scope.row)"> 查看证书 </el-button>
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary" @click="lookBook(scope.row)"> 查看证书 </el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
<template #footer>
|
||||
@ -55,11 +49,9 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog title="查看证书" v-model="isShowBook" width="80%">
|
||||
<div>
|
||||
证书
|
||||
</div>
|
||||
<div>证书</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancelB">取消</el-button>
|
||||
@ -96,8 +88,8 @@ import { defineAsyncComponent, ref, reactive } from 'vue';
|
||||
import { ElMessage, ElForm } from 'element-plus';
|
||||
import { auths } from '/@/utils/authFunction';
|
||||
import ProTable from '/@/components/ProTable/index.vue';
|
||||
import { eventrecordPageGet , eventrecordCertificatesGet} from '/@/api/match/eventRecord';
|
||||
import { merchantcertificationPageGet, merchantcertificationAuditPost} from '/@/api/match/merchantcertification';
|
||||
import { eventrecordPageGet, eventrecordCertificatesGet } from '/@/api/match/eventRecord';
|
||||
import { merchantcertificationPageGet, merchantcertificationAuditPost } from '/@/api/match/merchantcertification';
|
||||
import PreviewImage from '/@/components/PreviewImage/index.vue';
|
||||
|
||||
const initParam = ref({
|
||||
@ -148,9 +140,9 @@ const columns = ref([
|
||||
{ prop: 'index', label: '序号', align: 'center' },
|
||||
{ prop: 'merchantName', label: '单位名称', search: { el: 'input' } },
|
||||
{ prop: 'address', label: '地址' },
|
||||
|
||||
|
||||
{ prop: 'contactPhone', label: '联系电话', search: { el: 'input' } },
|
||||
{prop: 'businessLicenseUrl', label: '营业执照', width: '130px',},
|
||||
{ prop: 'businessLicenseUrl', label: '营业执照', width: '130px' },
|
||||
{
|
||||
prop: 'auditStatus',
|
||||
label: '审核状态',
|
||||
@ -158,13 +150,13 @@ const columns = ref([
|
||||
el: 'select',
|
||||
},
|
||||
enum: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '审核拒绝', value: 3 },
|
||||
{ label: '审核通过', value: 2 },
|
||||
{ label: '待审核', value: 1 },
|
||||
{ label: '待提交', value: 0 },
|
||||
{ label: '已取消', value: 4 },
|
||||
],
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '审核拒绝', value: 3 },
|
||||
{ label: '审核通过', value: 2 },
|
||||
{ label: '待审核', value: 1 },
|
||||
{ label: '待提交', value: 0 },
|
||||
{ label: '已取消', value: 4 },
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'createdTime',
|
||||
@ -215,7 +207,7 @@ const columnsUser = ref([
|
||||
isShow: false,
|
||||
},
|
||||
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right'},
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right' },
|
||||
]);
|
||||
|
||||
const isShowDialog = ref(false);
|
||||
@ -223,22 +215,22 @@ const table = ref();
|
||||
|
||||
const onOpenMenu = (row) => {
|
||||
console.log(row);
|
||||
|
||||
|
||||
// 参数验证
|
||||
if (!row || !row.userId) {
|
||||
ElMessage.warning('用户信息无效,无法查看参赛记录');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (typeof row.userId !== 'number' || row.userId <= 0) {
|
||||
ElMessage.warning('用户ID无效,请刷新页面后重试');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 设置用户ID参数 - 单位用户使用 sysUserId
|
||||
initParamUser.value.sysUserId = row.userId;
|
||||
isShowDialog.value = true;
|
||||
|
||||
|
||||
// 下次打开对话框时强制刷新数据
|
||||
initParamUser.value.refresh = Date.now();
|
||||
};
|
||||
@ -262,7 +254,7 @@ const lookBook = async (row) => {
|
||||
const isShowAuditDialog = ref(false);
|
||||
const auditForm = reactive({
|
||||
status: 2, // 默认审核通过
|
||||
remark: ''
|
||||
remark: '',
|
||||
});
|
||||
|
||||
const showAuditDialog = () => {
|
||||
@ -277,10 +269,10 @@ const showAuditDialog = () => {
|
||||
|
||||
const onSubmitAudit = async () => {
|
||||
console.log(selectedListIds.value);
|
||||
const { succeeded, data } = await merchantcertificationAuditPost({
|
||||
ids: selectedListIds.value,
|
||||
const { succeeded, data } = await merchantcertificationAuditPost({
|
||||
ids: selectedListIds.value,
|
||||
status: auditForm.status,
|
||||
remark: auditForm.remark
|
||||
remark: auditForm.remark,
|
||||
});
|
||||
if (succeeded) {
|
||||
ElMessage.success('操作成功');
|
||||
@ -297,7 +289,7 @@ const onDialogClose = () => {
|
||||
// 清理参数,避免下次查询时使用旧参数
|
||||
initParamUser.value = {
|
||||
sysUserId: null,
|
||||
refresh: Date.now()
|
||||
refresh: Date.now(),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user