Bläddra i källkod

fix(payroll): 修复课酬方案编辑对话框右侧明细表格被截断

问题:编辑方案时右侧「上限金额/额外/计算方式名」列被裁切;编辑方案 #2(城西校区)时校区下拉显示裸 12、老师下拉显示 ULID 串。

根因:
1. onMounted 用 scope.toQuery() 取校区/老师选项,当前作用域是校区 11(滨江),mock 按 campusId 过滤 → 校区选项只有滨江、老师只有滨江的张婷。课酬方案是机构级配置、可跨校区引用老师,这两个下拉必须按机构级全量取。
2. 明细编辑表 14 列固定宽合计约 1448px,超出 980px 对话框被裁。

修复:
- 校区/老师选项改用机构级 query(仅 institutionId)取全量。
- 对话框 980px → 1280px;明细 14 列固定宽收紧至合计约 1012px + 名称列 130px ≈ 1142px,在 1232px 内容宽内完整可见。
Q 3 timmar sedan
förälder
incheckning
30c37d9b70
1 ändrade filer med 26 tillägg och 24 borttagningar
  1. 26 24
      src/views/academic/payroll/index.vue

+ 26 - 24
src/views/academic/payroll/index.vue

@@ -45,7 +45,9 @@ const campusName = (id: number): string => (id === 0 ? '机构级' : campusOpts.
 const teacherName = (id: string | null): string => (id ? teacherOpts.value.find((t) => t.userId === id)?.realName ?? id : '通用档');
 
 onMounted(async () => {
-  const q = scope.toQuery();
+  // 课酬方案是机构级配置、可跨校区引用老师 → 校区/老师选项必须按机构级全量取,
+  // 不能用 scope.toQuery()(会带上当前校区,mock 会按校区过滤,导致其它校区的方案/老师显示不出来)。
+  const q = { institutionId: scope.current.institutionId };
   const [c, m] = await Promise.all([
     listCampuses({ ...q, pageSize: 200 }),
     listMembers({ ...q, personType: 'staff', pageSize: 200 }),
@@ -342,7 +344,7 @@ async function doQuote(): Promise<void> {
     </div>
 
     <!-- ② 方案编辑对话框(上半方案表单 + 下半明细表格) -->
-    <el-dialog v-model="editVisible" :title="editingId === null ? '新建课酬方案' : `编辑方案 #${editingId}`" width="980px">
+    <el-dialog v-model="editVisible" :title="editingId === null ? '新建课酬方案' : `编辑方案 #${editingId}`" width="1280px">
       <el-form label-width="90px" class="payroll-page__form">
         <el-row :gutter="12">
           <el-col :span="8">
@@ -376,63 +378,63 @@ async function doQuote(): Promise<void> {
         <el-button size="small" type="primary" @click="addDetail">加一行</el-button>
       </div>
       <el-table :data="detailRows" size="small" border max-height="360">
-        <el-table-column label="适用老师" min-width="140">
+        <el-table-column label="适用老师" width="120">
           <template #default="{ row: d }">
             <el-select v-model="d.teacherId" size="small" clearable placeholder="通用档" style="width: 100%">
               <el-option v-for="t in teacherOpts" :key="t.userId" :value="t.userId" :label="t.realName" />
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column label="科目" width="100">
+        <el-table-column label="科目" width="88">
           <template #default="{ row: d }">
             <el-select v-model="d.classifyId" size="small" style="width: 100%">
               <el-option v-for="k in CLASSIFIES" :key="k" :value="k" :label="classifyText[k]" />
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column label="年级(-1不限)" width="100">
+        <el-table-column label="年级(-1不限)" width="84">
           <template #default="{ row: d }">
-            <el-input-number v-model="d.gradeId" :min="-1" :max="12" size="small" controls-position="right" style="width: 88px" />
+            <el-input-number v-model="d.gradeId" :min="-1" :max="12" size="small" controls-position="right" style="width: 72px" />
           </template>
         </el-table-column>
-        <el-table-column label="学科(-1不限)" width="100">
+        <el-table-column label="学科(-1不限)" width="84">
           <template #default="{ row: d }">
-            <el-input-number v-model="d.subjectId" :min="-1" :max="12" size="small" controls-position="right" style="width: 88px" />
+            <el-input-number v-model="d.subjectId" :min="-1" :max="12" size="small" controls-position="right" style="width: 72px" />
           </template>
         </el-table-column>
-        <el-table-column label="持证(0不限)" width="96">
+        <el-table-column label="持证(0不限)" width="76">
           <template #default="{ row: d }">
-            <el-input-number v-model="d.teacherCert" :min="0" :max="1" size="small" controls-position="right" style="width: 84px" />
+            <el-input-number v-model="d.teacherCert" :min="0" :max="1" size="small" controls-position="right" style="width: 64px" />
           </template>
         </el-table-column>
-        <el-table-column label="教龄下限" width="96">
+        <el-table-column label="教龄下限" width="84">
           <template #default="{ row: d }">
-            <el-input-number v-model="d.teacherExpMin" :min="0" :step="0.1" size="small" controls-position="right" style="width: 88px" />
+            <el-input-number v-model="d.teacherExpMin" :min="0" :step="0.1" size="small" controls-position="right" style="width: 72px" />
           </template>
         </el-table-column>
-        <el-table-column label="教龄上限" width="96">
+        <el-table-column label="教龄上限" width="84">
           <template #default="{ row: d }">
-            <el-input-number v-model="d.teacherExpMax" :min="0" :step="0.1" size="small" controls-position="right" style="width: 88px" />
+            <el-input-number v-model="d.teacherExpMax" :min="0" :step="0.1" size="small" controls-position="right" style="width: 72px" />
           </template>
         </el-table-column>
-        <el-table-column label="比例%" width="96">
+        <el-table-column label="比例%" width="78">
           <template #default="{ row: d }">
-            <el-input v-model="d.percentage" size="small" placeholder="85.0" style="width: 84px" />
+            <el-input v-model="d.percentage" size="small" placeholder="85.0" style="width: 66px" />
           </template>
         </el-table-column>
-        <el-table-column label="下限金额" width="104">
+        <el-table-column label="下限金额" width="88">
           <template #default="{ row: d }">
-            <el-input v-model="d.min" size="small" placeholder="0.00" style="width: 92px" />
+            <el-input v-model="d.min" size="small" placeholder="0.00" style="width: 76px" />
           </template>
         </el-table-column>
-        <el-table-column label="上限金额" width="104">
+        <el-table-column label="上限金额" width="88">
           <template #default="{ row: d }">
-            <el-input v-model="d.max" size="small" placeholder="0.00" style="width: 92px" />
+            <el-input v-model="d.max" size="small" placeholder="0.00" style="width: 76px" />
           </template>
         </el-table-column>
-        <el-table-column label="额外" width="96">
+        <el-table-column label="额外" width="78">
           <template #default="{ row: d }">
-            <el-input v-model="d.reward" size="small" placeholder="0.00" style="width: 84px" />
+            <el-input v-model="d.reward" size="small" placeholder="0.00" style="width: 66px" />
           </template>
         </el-table-column>
         <el-table-column label="计算方式名" min-width="130">
@@ -440,12 +442,12 @@ async function doQuote(): Promise<void> {
             <el-input v-model="d.displayName" size="small" placeholder="如:数学 5~15 年教龄" />
           </template>
         </el-table-column>
-        <el-table-column label="档位启停" width="80">
+        <el-table-column label="档位启停" width="60">
           <template #default="{ row: d }">
             <el-switch v-model="d.detailActived" :active-value="1" :inactive-value="0" size="small" />
           </template>
         </el-table-column>
-        <el-table-column label="" width="60">
+        <el-table-column label="" width="40">
           <template #default="{ $index }">
             <el-button size="small" type="danger" link @click="removeDetail($index)">删</el-button>
           </template>