|
|
@@ -161,7 +161,7 @@ watch(selectedCourseId, () => {
|
|
|
const classVisible = ref(false);
|
|
|
const classBusy = ref(false);
|
|
|
const classForm = reactive({
|
|
|
- teacher: '',
|
|
|
+ teacherId: '',
|
|
|
/** 周多选(-1 全周 或 0..6 子集;提交时拼逗号字符串;-1 与具体周互斥) */
|
|
|
weeks: [] as number[],
|
|
|
start: '',
|
|
|
@@ -169,7 +169,7 @@ const classForm = reactive({
|
|
|
campusId: 0,
|
|
|
});
|
|
|
function openClass(): void {
|
|
|
- classForm.teacher = staffOpts.value[0]?.userId ?? '';
|
|
|
+ classForm.teacherId = staffOpts.value[0]?.userId ?? '';
|
|
|
classForm.weeks = [];
|
|
|
classForm.start = '';
|
|
|
classForm.end = '';
|
|
|
@@ -202,7 +202,7 @@ function toggleWeek(v: number): void {
|
|
|
}
|
|
|
async function doCreateClass(): Promise<void> {
|
|
|
if (!selectedCourseId.value) return;
|
|
|
- if (!classForm.teacher || !weeksToString() || !classForm.start || !classForm.end) {
|
|
|
+ if (!classForm.teacherId || !weeksToString() || !classForm.start || !classForm.end) {
|
|
|
ElMessage_('warning', '请填全老师/周/上课起止时间');
|
|
|
return;
|
|
|
}
|
|
|
@@ -213,7 +213,7 @@ async function doCreateClass(): Promise<void> {
|
|
|
classBusy.value = true;
|
|
|
try {
|
|
|
const r = await createClass(selectedCourseId.value, {
|
|
|
- teacher: classForm.teacher,
|
|
|
+ teacherId: classForm.teacherId,
|
|
|
week: weeksToString(),
|
|
|
// 本地日期 + 时分秒 → RFC3339(无时区后缀 = 本地时间,与后端 dev 环境口径一致)
|
|
|
start: `${todayStr()}T${classForm.start}`,
|
|
|
@@ -364,7 +364,8 @@ interface AttRow {
|
|
|
name: string;
|
|
|
/** 上课类型(1 正常 / 2 插班 / 3 赠送) */
|
|
|
type: number;
|
|
|
- pay: number;
|
|
|
+ /** 是否已付(端点52 pay 0/1 源;端点53 不返回该值,初值按"已报课即已付"= true) */
|
|
|
+ pay: boolean;
|
|
|
cost: number;
|
|
|
giveCost: number;
|
|
|
}
|
|
|
@@ -385,8 +386,9 @@ async function openAttendance(rec: CourseRecordDTO): Promise<void> {
|
|
|
userId: s.userId,
|
|
|
name: s.realName ?? s.userId,
|
|
|
type: 1,
|
|
|
- // 金额字符串两位小数 → number(el-input-number 绑定;提交时 formatMoney 回字符串)
|
|
|
- pay: Number(s.pay) || 0,
|
|
|
+ // ⚠ 端点52 pay = 是否已付(0/1),端点53 不返回该值;初值按 Go 默认"已报课即已付"= true,打卡时可改 false(未付)
|
|
|
+ pay: true,
|
|
|
+ // 金额字段(cost/giveCost):端点53 金额字符串两位小数 → number(el-input-number 绑定;提交时 moneyPlain 回字符串)
|
|
|
cost: Number(s.cost) || 0,
|
|
|
giveCost: Number(s.giveCost) || 0,
|
|
|
}));
|
|
|
@@ -394,12 +396,12 @@ async function openAttendance(rec: CourseRecordDTO): Promise<void> {
|
|
|
async function doAttendance(): Promise<void> {
|
|
|
const rec = attRecord.value;
|
|
|
if (!rec) return;
|
|
|
- // number → 金额字符串两位小数(契约:金额字符串两位小数;提交位用 moneyPlain 不带千分位;0/undefined 不下发 = 不改)
|
|
|
+ // cost/giveCost → 金额字符串两位小数(moneyPlain 不带千分位;0/undefined 不下发 = 不改);pay = 是否已付 0/1(恒下发)
|
|
|
const toMoney = (v: number | null | undefined): string | undefined => (v && v > 0 ? moneyPlain(v) : undefined);
|
|
|
const list: AttendanceItem[] = attRows.value.map(({ userId, type, pay, cost, giveCost }) => ({
|
|
|
userId,
|
|
|
type,
|
|
|
- ...(toMoney(pay) ? { pay: toMoney(pay)! } : {}),
|
|
|
+ pay: pay ? 1 : 0,
|
|
|
...(toMoney(cost) ? { cost: toMoney(cost)! } : {}),
|
|
|
...(toMoney(giveCost) ? { giveCost: toMoney(giveCost)! } : {}),
|
|
|
}));
|
|
|
@@ -744,7 +746,7 @@ async function doCounteract(): Promise<void> {
|
|
|
<span>{{ selectedCourse?.name }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="授课老师">
|
|
|
- <el-select v-model="classForm.teacher" filterable placeholder="选择老师" style="width: 100%">
|
|
|
+ <el-select v-model="classForm.teacherId" filterable placeholder="选择老师" style="width: 100%">
|
|
|
<el-option v-for="m in staffOpts" :key="m.userId" :value="m.userId" :label="`${m.realName}(${m.phone})`" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -809,9 +811,9 @@ async function doCounteract(): Promise<void> {
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="课程费用" width="130">
|
|
|
+ <el-table-column label="是否已付" width="100">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input-number v-model="row.pay" size="small" :min="0" :precision="2" :step="100" controls-position="right" style="width: 100%" />
|
|
|
+ <el-switch v-model="row.pay" size="small" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="课时费用" width="130">
|