update:bug
This commit is contained in:
parent
8421e1aecd
commit
c73c71b54f
@ -135,7 +135,7 @@ export const appuserMemberStatusPost = (data) => {
|
|||||||
* @param {number} [params.PageSize] - 每页条数
|
* @param {number} [params.PageSize] - 每页条数
|
||||||
*/
|
*/
|
||||||
export const appuserAthletePageGet = (params) => {
|
export const appuserAthletePageGet = (params) => {
|
||||||
return http.get('/appuser/athlete/page', { params });
|
return http.get('/appuser/member/page', { ...params, personType: 1 });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,7 +149,7 @@ export const appuserAthletePageGet = (params) => {
|
|||||||
* @param {string} data.mobile - 手机号
|
* @param {string} data.mobile - 手机号
|
||||||
*/
|
*/
|
||||||
export const appuserAthleteAddPost = (data) => {
|
export const appuserAthleteAddPost = (data) => {
|
||||||
return http.post('/appuser/athlete/add', data);
|
return http.post('/appuser/member/save', { ...data, personType: 1 });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -164,7 +164,7 @@ export const appuserAthleteAddPost = (data) => {
|
|||||||
* @param {string} data.mobile - 手机号
|
* @param {string} data.mobile - 手机号
|
||||||
*/
|
*/
|
||||||
export const appuserAthleteUpdatePut = (data) => {
|
export const appuserAthleteUpdatePut = (data) => {
|
||||||
return http.put('/appuser/athlete/update', data);
|
return http.post('/appuser/member/save', { ...data, personType: 1 });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -173,7 +173,7 @@ export const appuserAthleteUpdatePut = (data) => {
|
|||||||
* @param {string} data.imageUrl - 身份证图片URL
|
* @param {string} data.imageUrl - 身份证图片URL
|
||||||
*/
|
*/
|
||||||
export const appuserAthleteOcrPost = (data) => {
|
export const appuserAthleteOcrPost = (data) => {
|
||||||
return http.post('/appuser/athlete/ocr', data);
|
return http.post('/appuser/member/ocr', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -181,7 +181,7 @@ export const appuserAthleteOcrPost = (data) => {
|
|||||||
* @param {Array<number>} data - 运动员ID数组
|
* @param {Array<number>} data - 运动员ID数组
|
||||||
*/
|
*/
|
||||||
export const appuserAthleteBatchdeletePost = (data) => {
|
export const appuserAthleteBatchdeletePost = (data) => {
|
||||||
return http.post('/appuser/athlete/batchdelete', data);
|
return http.post('/appuser/delete', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`units.${$index}.unitType`" :rules="[{ required: true, message: '请选择单位类型', trigger: 'change' }]" style="margin: 0;width: 100%;">
|
<el-form-item :prop="`units.${$index}.unitType`" :rules="[{ required: true, message: '请选择单位类型', trigger: 'change' }]" style="margin: 0;width: 100%;">
|
||||||
<el-select v-model="row.unitType" placeholder="请选择" style="width: 100%">
|
<el-select v-model="row.unitType" placeholder="请选择" style="width: 100%">
|
||||||
<el-option label="主办方" value="Host" />
|
<el-option label="主办方" :value="0" />
|
||||||
<el-option label="承办方" value="Organizer" />
|
<el-option label="承办方" :value="1" />
|
||||||
<el-option label="协办方" value="CoOrganizer" />
|
<el-option label="协办方" :value="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
<p>赛事{{formData.id ? '创建' : '修改'}}成功!</p>
|
<p>赛事{{formData.id ? '创建' : '修改'}}成功!</p>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button type="primary" @click="successDialogVisible=false; dialog.isShowDialog = false">确定</el-button>
|
<el-button type="primary" @click="successDialogVisible=false; dialog.isShowDialog = false; emit('refresh')">确定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
@ -82,6 +82,7 @@ const totalSteps = 4;
|
|||||||
|
|
||||||
// 步骤组件映射
|
// 步骤组件映射
|
||||||
const stepComponents = markRaw([Step1BasicInfo, Step2Units, Step3ProjectConfig, Step4FeeConfig]);
|
const stepComponents = markRaw([Step1BasicInfo, Step2Units, Step3ProjectConfig, Step4FeeConfig]);
|
||||||
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
// 计算当前显示的步骤组件
|
// 计算当前显示的步骤组件
|
||||||
const currentStepComponent = computed(() => {
|
const currentStepComponent = computed(() => {
|
||||||
|
|||||||
@ -16,8 +16,8 @@
|
|||||||
<template #index="scope">
|
<template #index="scope">
|
||||||
{{ scope.$index + 1 }}
|
{{ scope.$index + 1 }}
|
||||||
</template>
|
</template>
|
||||||
<template #qrCodeUrl="scope">
|
<template #coverImage="scope">
|
||||||
<el-image :src="scope.row.qrCodeUrl" style="height: 80px" fit="cover" />
|
<el-image :src="scope.row.coverImage" style="height: 80px" fit="cover" />
|
||||||
</template>
|
</template>
|
||||||
<template #eventStatus="scope">
|
<template #eventStatus="scope">
|
||||||
<el-tag :type="scope.row.eventStatus === 0 ? 'success' : scope.row.eventStatus === 1 ? 'warning' : 'danger'">
|
<el-tag :type="scope.row.eventStatus === 0 ? 'success' : scope.row.eventStatus === 1 ? 'warning' : 'danger'">
|
||||||
@ -75,7 +75,7 @@ const columns = reactive([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: '120px',
|
width: '120px',
|
||||||
prop: 'qrCodeUrl',
|
prop: 'coverImage',
|
||||||
label: '封面',
|
label: '封面',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '120px',
|
width: '120px',
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 组别 -->
|
<!-- 组别 -->
|
||||||
<div v-if="formData.projectTypeId == 1005 || formData.projectTypeId == 1006">
|
<div>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="'组别' + (index + 1) + ':'"
|
:label="'组别' + (index + 1) + ':'"
|
||||||
prop="groups"
|
prop="groups"
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="运动员管理" name="second">
|
<el-tab-pane label="运动员管理" name="second">
|
||||||
<ProTable ref="tableRefSport" :request-api="appuserAthletePageGet" :columns="columnsSport"
|
<ProTable ref="tableRefSport" :request-api="appuserAthletePageGet" :columns="columnsSport"
|
||||||
:pagination="true" :tool-button="true">
|
:pagination="true" :tool-button="true" :initParam="initParam">
|
||||||
<template #tools>
|
<template #tools>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="onOpenMenu()"> 新增
|
<el-button type="primary" icon="ele-Plus" @click="onOpenMenu()"> 新增
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<el-dialog title="新增" v-model="isShowDialog" width="width: 800px;">
|
<el-dialog :title="dialogTitle" v-model="isShowDialog" width="width: 800px;">
|
||||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="200px" style="margin-bottom: 30px;"
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="200px" style="margin-bottom: 30px;"
|
||||||
v-if="isShowDialog">
|
v-if="isShowDialog">
|
||||||
|
|
||||||
@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
<!-- 教练姓名 -->
|
<!-- 教练姓名 -->
|
||||||
<el-form-item label="姓名" prop="name">
|
<el-form-item label="姓名" prop="name">
|
||||||
<el-input v-model="formData.name" placeholder="请输入教练姓名"></el-input>
|
<el-input v-model="formData.name" placeholder="请输入教练姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 性别 -->
|
<!-- 性别 -->
|
||||||
@ -83,13 +83,17 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="身份证号" prop="idCardNumber">
|
<el-form-item label="出生日期" prop="birthDate">
|
||||||
<el-input v-model="formData.idCardNumber" placeholder="请输入身份证号"></el-input>
|
<el-date-picker v-model="formData.birthDate" placeholder="请选择出生日期" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="身份证号" prop="idCard">
|
||||||
|
<el-input v-model="formData.idCard" placeholder="请输入身份证号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 联系电话 -->
|
<!-- 联系电话 -->
|
||||||
<el-form-item label="联系电话" prop="mobil">
|
<el-form-item label="联系电话" prop="phone">
|
||||||
<el-input v-model="formData.mobil" placeholder="请输入联系电话" class="fee-input">
|
<el-input v-model="formData.phone" placeholder="请输入联系电话" class="fee-input">
|
||||||
<!-- <template #append>
|
<!-- <template #append>
|
||||||
<el-button type="primary" @click="onSendCode" >
|
<el-button type="primary" @click="onSendCode" >
|
||||||
{{ isSendCode ? '已发送' : '发送验证码' }}
|
{{ isSendCode ? '已发送' : '发送验证码' }}
|
||||||
@ -120,27 +124,34 @@ import { appuserAthletePageGet, appuserAthleteAddPost, appuserAthleteUpdatePut,
|
|||||||
// 定义表单引用类型
|
// 定义表单引用类型
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const activeTab = ref('first')
|
const activeTab = ref('first')
|
||||||
const formData = ref({
|
const getDefaultFormData = () => ({
|
||||||
|
id: undefined,
|
||||||
name: '',
|
name: '',
|
||||||
idCardNumber: '',
|
idCard: '',
|
||||||
gender: '',
|
gender: '',
|
||||||
idCardImageUrl: '',
|
idCardImageUrl: '',
|
||||||
mobil: '',
|
birthDate: '',
|
||||||
|
phone: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const formData = ref(getDefaultFormData())
|
||||||
|
|
||||||
|
const initParam = ref({
|
||||||
|
personType: 1,
|
||||||
|
refresh: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const formRules = ref({
|
const formRules = ref({
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: '请输入教练姓名', trigger: 'blur' }
|
{ required: true, message: '请输入运动员姓名', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
idCardNumber: [
|
idCard: [
|
||||||
{ required: true, message: '请输入身份证号', trigger: 'change' }
|
{ required: true, message: '请输入身份证号', trigger: 'change' }
|
||||||
],
|
],
|
||||||
gender: [
|
gender: [
|
||||||
{ required: true, message: '请选择性别', trigger: 'change' }
|
{ required: true, message: '请选择性别', trigger: 'change' }
|
||||||
],
|
],
|
||||||
mobil: [
|
phone: [
|
||||||
{ required: true, message: '请输入联系电话', trigger: 'blur' }
|
{ required: true, message: '请输入联系电话', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
idCardImageUrl: [
|
idCardImageUrl: [
|
||||||
@ -172,7 +183,7 @@ const columnsSport = ref([
|
|||||||
},
|
},
|
||||||
{ prop: 'idCardImageUrl', label: '身份证' },
|
{ prop: 'idCardImageUrl', label: '身份证' },
|
||||||
|
|
||||||
{ prop: 'mobile', label: '联系电话', search: { el: 'input' } },
|
{ prop: 'phone', label: '联系电话', search: { el: 'input' } },
|
||||||
|
|
||||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right' },
|
{ prop: 'action', label: '操作', align: 'center', fixed: 'right' },
|
||||||
]);
|
]);
|
||||||
@ -182,13 +193,19 @@ const dialogTitle = ref('新增');
|
|||||||
|
|
||||||
const onOpenMenu = (row) => {
|
const onOpenMenu = (row) => {
|
||||||
dialogTitle.value = row ? '编辑' : '新增';
|
dialogTitle.value = row ? '编辑' : '新增';
|
||||||
formData.value = {
|
formData.value = getDefaultFormData();
|
||||||
name: '',
|
if (row && typeof row === 'object') {
|
||||||
idCardNumber: '',
|
formData.value = {
|
||||||
gender: '',
|
...getDefaultFormData(),
|
||||||
idCardImageUrl: '',
|
id: row.id,
|
||||||
mobil: '',
|
name: row.name ?? '',
|
||||||
};
|
idCard: row.idCard ?? '',
|
||||||
|
gender: row.gender !== undefined && row.gender !== null ? String(row.gender) : '',
|
||||||
|
idCardImageUrl: row.idCardImageUrl ?? '',
|
||||||
|
birthDate: row.birthDate ?? '',
|
||||||
|
phone: row.phone ?? row.phone ?? '',
|
||||||
|
};
|
||||||
|
}
|
||||||
isShowDialog.value = true;
|
isShowDialog.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -226,8 +243,8 @@ const handleAvatarSuccess = async (response,
|
|||||||
const res = await appuserAthleteOcrPost(response[0].url)
|
const res = await appuserAthleteOcrPost(response[0].url)
|
||||||
if(res.succeeded){
|
if(res.succeeded){
|
||||||
formData.value.name = res.data.name
|
formData.value.name = res.data.name
|
||||||
formData.value.idCardNumber = res.data.idCardNumber
|
formData.value.idCard = res.data.idCard
|
||||||
formData.value.gender = res.data.gender
|
formData.value.gender = res.data.gender !== undefined && res.data.gender !== null ? String(res.data.gender) : ''
|
||||||
formData.value.birthDate = res.data.birthDate
|
formData.value.birthDate = res.data.birthDate
|
||||||
formData.value.idCardImageUrl = response[0].url
|
formData.value.idCardImageUrl = response[0].url
|
||||||
}else{
|
}else{
|
||||||
@ -254,24 +271,24 @@ const onSubmit = () => {
|
|||||||
|
|
||||||
formRef.value.validate(async (valid) => {
|
formRef.value.validate(async (valid) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
try {
|
||||||
// try {
|
const payload = {
|
||||||
// let res;
|
...formData.value,
|
||||||
// if (formData.value.id) {
|
gender: formData.value.gender !== undefined && formData.value.gender !== null ? Number(formData.value.gender) : '',
|
||||||
// res = await SysMenuApi.add(formData.value);
|
phone: formData.value.phone,
|
||||||
// } else {
|
};
|
||||||
// res = await SysMenuApi.add(formData.value);
|
const res = formData.value.id ? await appuserAthleteUpdatePut(payload) : await appuserAthleteAddPost(payload);
|
||||||
// }
|
if (res.succeeded) {
|
||||||
|
ElMessage.success(dialogTitle.value + '成功');
|
||||||
// if (res.succeeded) {
|
isShowDialog.value = false;
|
||||||
// ElMessage.success(dialogTitle.value + '成功');
|
initParam.value.refresh = !initParam.value.refresh;
|
||||||
// isShowDialog.value = false;
|
} else {
|
||||||
// } else {
|
ElMessage.error(res.errors || res.msg || dialogTitle.value + '失败');
|
||||||
// ElMessage.error(res.errors);
|
}
|
||||||
// }
|
} catch (error) {
|
||||||
// } catch (error) {
|
ElMessage.error(dialogTitle.value + '失败');
|
||||||
// console.error(error);
|
console.error(error);
|
||||||
// }
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user