Browse Source

fix: change statistics

DESKTOP-USV654P\pc 1 day ago
parent
commit
e350f4c483

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ build:
 
 commit:
 	git add . && \
-	git commit --no-verify -m "fix: change probation report"
+	git commit --no-verify -m "fix: change statistics"
 
 checkPre:
 	git checkout pre

+ 19 - 8
src/utils/index.ts

@@ -71,14 +71,13 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal
   const { matched, ...opt } = route;
   return {
     ...opt,
-    matched:
-      (matched
-        ? matched.map((item) => ({
-            meta: item.meta,
-            name: item.name,
-            path: item.path,
-          }))
-        : undefined) as RouteRecordNormalized[],
+    matched: (matched
+      ? matched.map((item) => ({
+          meta: item.meta,
+          name: item.name,
+          path: item.path,
+        }))
+      : undefined) as RouteRecordNormalized[],
   };
 }
 
@@ -115,3 +114,15 @@ export function kkfilePreview(fileUrl) {
   a.click();
   a.remove();
 }
+
+export function formatLocale(text) {
+  if (!text) return '0';
+  return Number(text)
+    .toLocaleString('zh-CN', {
+      style: 'currency',
+      currency: 'CNY',
+      minimumFractionDigits: 2,
+      maximumFractionDigits: 4,
+    })
+    .replace(/^¥/, '');
+}

+ 16 - 6
src/views/course/statistics/data.config.ts

@@ -1,4 +1,5 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
+import { formatLocale } from '/@/utils';
 import { formatToDate } from '/@/utils/dateUtil';
 
 export const statusOptions = [
@@ -22,7 +23,6 @@ export const tableColumns: BasicColumn[] = [
     title: '时间',
     dataIndex: 'startDate',
     align: 'left',
-    width: 180,
     customRender: ({ record }) => {
       return `${formatToDate(record.startDate)}~${formatToDate(record.endDate)}`;
     },
@@ -36,19 +36,29 @@ export const tableColumns: BasicColumn[] = [
   {
     title: '总课时费(元)',
     dataIndex: 'classTimeAmount',
-    align: 'left',
-    width: 100,
+    align: 'right',
+    width: 150,
+    customRender: ({ text }) => {
+      return formatLocale(text);
+    },
   },
   {
     title: '总外聘教师超课时费(元)',
     dataIndex: 'beyondClassTimeAmount',
-    align: 'left',
-    width: 150,
+    align: 'right',
+    width: 180,
+    customRender: ({ text }) => {
+      return formatLocale(text);
+    },
   },
   {
     title: '总金额(元)',
     dataIndex: 'totalAmount',
-    align: 'left',
+    align: 'right',
+    width: 180,
+    customRender: ({ text }) => {
+      return formatLocale(text);
+    },
   },
   {
     title: '状态',

+ 11 - 2
src/views/educational/probation/report/index.vue

@@ -159,13 +159,19 @@
           type="primary"
           @click="handleDeleteBatch"
           :disabled="!searchInfo.enrollmentPlanId"
+          v-auth="'proReport:set'"
         >
           报到日期设置
         </a-button>
-        <a-button type="primary" @click="handleChangeReport" :disabled="!hasSelected">
+        <a-button
+          type="primary"
+          @click="handleChangeReport"
+          :disabled="!hasSelected"
+          v-auth="'proReport:allsign'"
+        >
           变更为已报到
         </a-button>
-        <a-button type="primary" @click="handleExport">导出</a-button>
+        <a-button type="primary" @click="handleExport" v-auth="'proReport:export'"> 导出 </a-button>
       </template>
       <template #action="{ record }">
         <TableAction
@@ -174,16 +180,19 @@
               label: '切换就读方式',
               onClick: handleChangeStduyStatus.bind(null, record),
               ifShow: record.className,
+              auth: 'proReport:stduyStatus',
             },
             {
               label: '非本班学生',
               onClick: handleDelete.bind(null, record),
               ifShow: record.className,
+              auth: 'proReport:del',
             },
             {
               label: '调整班级',
               onClick: handleAjdust.bind(null, record),
               ifShow: !record.className,
+              auth: 'proReport:adj',
             },
           ]"
         />