wuzhen update

This commit is contained in:
wuzhen committed 2025-08-21 14:21:15 +08:00
1 parent cf5eb97553
commit be3d48b6e3
13 files changed
+273 -59

No files matched your search

+8 -8
View File
@@ -3,7 +3,7 @@ import { AxiosPromise } from 'axios';
export interface ScholarshipBatchVO {
/** 主键ID */
id?: string | number;
id?: string;
/** 批次编码 */
batchCode?: string;
/** 批次名称 */
@@ -33,7 +33,7 @@ export interface ScholarshipBatchVO {
/** 通知内容 */
noticeContent?: string;
/** 关联的奖学金类型ID列表 */
scholarshipTypeIds?: Array<string | number>;
scholarshipTypeIds?: Array<string>;
/** 创建者 */
createBy?: number;
/** 创建时间 */
@@ -46,7 +46,7 @@ export interface ScholarshipBatchVO {
export interface ScholarshipBatchForm {
/** 主键ID */
id?: string | number;
id?: string;
/** 批次编码 */
batchCode?: string;
/** 批次名称 */
@@ -76,7 +76,7 @@ export interface ScholarshipBatchForm {
/** 通知内容 */
noticeContent?: string;
/** 关联的奖学金类型ID列表 */
scholarshipTypeIds?: Array<string | number>;
scholarshipTypeIds?: Array<string>;
}
export interface ScholarshipBatchQuery extends PageQuery {
@@ -106,7 +106,7 @@ export function listScholarshipBatch(query: ScholarshipBatchQuery): AxiosPromise
}
// 查询奖学金评定批次详细
export function getScholarshipBatch(id: string | number): AxiosPromise<ScholarshipBatchVO> {
export function getScholarshipBatch(id: string): AxiosPromise<ScholarshipBatchVO> {
return request({
url: '/jcbt/scholarshipBatch/' + id,
method: 'get'
@@ -132,7 +132,7 @@ export function updateScholarshipBatch(data: ScholarshipBatchForm) {
}
// 删除奖学金评定批次
export function delScholarshipBatch(id: string | number | Array<string | number>) {
export function delScholarshipBatch(id: string | Array<string>) {
return request({
url: '/jcbt/scholarshipBatch/' + id,
method: 'delete'
@@ -177,7 +177,7 @@ export function getActiveBatches(): AxiosPromise<ScholarshipBatchVO[]> {
}
// 检查批次编码是否唯一
export function checkBatchCodeUnique(batchCode: string, id?: string | number): AxiosPromise<boolean> {
export function checkBatchCodeUnique(batchCode: string, id?: string): AxiosPromise<boolean> {
return request({
url: '/jcbt/scholarshipBatch/checkBatchCodeUnique',
method: 'get',
@@ -189,7 +189,7 @@ export function checkBatchCodeUnique(batchCode: string, id?: string | number): A
}
// 更改批次状态
export function changeScholarshipBatchStatus(id: string | number, status: string) {
export function changeScholarshipBatchStatus(id: string, status: string) {
return request({
url: '/jcbt/scholarshipBatch/changeStatus',
method: 'put',
-4
View File
@@ -27,8 +27,6 @@ export interface WorkStudyApplicationQuery extends PageQuery {
positionName?: string;
/** 岗位类型 */
positionType?: string;
/** 工作地点 */
workLocation?: string;
/** 申请状态 */
status?: string;
/** 学院审核状态 */
@@ -76,8 +74,6 @@ export interface WorkStudyApplicationForm {
positionName: string;
/** 岗位类型 */
positionType: string;
/** 工作地点 */
workLocation: string;
/** 计划工作时长 */
plannedWorkHours?: number;
/** 家庭经济情况 */
+30 -5
View File
@@ -720,12 +720,14 @@ function handleAdd() {
/** 修改按钮操作 */
async function handleUpdate(row?: ScholarshipBatchVO) {
reset();
const _id = row?.id || ids.value[0];
const res = await getScholarshipBatch(_id);
// 先赋值基本数据
Object.assign(form.value, res.data);
// 关键修复:不调用reset(),直接赋值数据,确保ID不会被重置为undefined
form.value = {
...res.data,
id: String(_id) // 🔧 修复:确保ID为字符串格式,避免精度丢失
};
// 确保scholarshipTypeIds正确赋值
if (res.data.scholarshipTypeIds && Array.isArray(res.data.scholarshipTypeIds)) {
@@ -734,6 +736,13 @@ async function handleUpdate(row?: ScholarshipBatchVO) {
form.value.scholarshipTypeIds = [];
}
// 清除表单验证状态,但不重置数据
batchFormRef.value?.clearValidate();
// 调试日志 - 验证ID是否正确
console.log('修改操作 - ID:', form.value.id, '类型:', typeof form.value.id);
console.log('修改操作 - 完整数据:', JSON.stringify(form.value, null, 2));
dialog.visible = true;
dialog.title = '修改奖学金评定批次';
}
@@ -753,6 +762,10 @@ function submitForm() {
buttonLoading.value = true;
try {
// 调试日志 - 提交前检查数据
console.log('提交前表单数据:', form.value);
console.log('提交前ID值:', form.value.id, '类型:', typeof form.value.id);
// 检查时间冲突
const conflictCheck = await checkTimeConflict(form.value);
if (conflictCheck.data) {
@@ -760,10 +773,22 @@ function submitForm() {
return;
}
if (form.value.id) {
await updateScholarshipBatch(form.value);
// 关键修复:更严格的ID检查逻辑
const isUpdate = form.value.id && form.value.id !== undefined && form.value.id !== '' && form.value.id !== null;
if (isUpdate) {
console.log('执行修改操作,ID:', form.value.id, '类型:', typeof form.value.id);
// 🔧 修复:保持ID为字符串格式,避免精度丢失
// 不再使用parseInt(),直接使用字符串格式的ID
const updateData = {
...form.value,
id: String(form.value.id) // 确保ID始终为字符串格式
};
console.log('发送到后端的修改数据:', JSON.stringify(updateData, null, 2));
await updateScholarshipBatch(updateData);
proxy?.$modal.msgSuccess('修改成功');
} else {
console.log('执行新增操作,ID为:', form.value.id);
await addScholarshipBatch(form.value);
proxy?.$modal.msgSuccess('新增成功');
}
@@ -16,10 +16,7 @@
<span class="preview-label">岗位名称:</span>
<el-tag type="primary" size="large">{{ position?.positionName }}</el-tag>
</div>
<div class="preview-item">
<span class="preview-label">工作地点:</span>
<span class="preview-value">{{ position?.workLocation }}</span>
</div>
<div class="preview-item">
<span class="preview-label">工作时间:</span>
<span class="preview-value">{{ position?.workTime }}</span>
@@ -196,7 +193,6 @@ const formData = reactive<WorkStudyApplicationForm>({
positionId: 0,
positionName: '',
positionType: '',
workLocation: '',
familyFinancialStatus: '',
applicationReason: '',
personalAbility: '',