diff --git a/src/utils/commons.js b/src/utils/commons.js index ce0d136..4b158f4 100644 --- a/src/utils/commons.js +++ b/src/utils/commons.js @@ -143,3 +143,12 @@ export function groupBy(array, callback) { return groups; }, {}); } + + +export function formatPrice(price) { + return Math.ceil(price).toLocaleString(); +} + +export function formatPercent(number) { + return Math.round(number * 100) + "%"; +} \ No newline at end of file diff --git a/src/views/report/Index.jsx b/src/views/report/Index.jsx index 73213db..7730e10 100644 --- a/src/views/report/Index.jsx +++ b/src/views/report/Index.jsx @@ -3,6 +3,7 @@ import { observer } from "mobx-react"; import { Row, Col, Space, Button, Table, Divider, Typography, DatePicker } from "antd"; import { useStore } from "@/stores/StoreContext.js"; import * as config from "@/config"; +import * as comm from "@/utils/commons"; import { usePDF } from "react-to-pdf"; function Index() { @@ -31,6 +32,7 @@ function Index() { title: "Transaction Amount(USD)", dataIndex: "AmountUSD", key: "AmountUSD", + render: (value) => comm.formatPrice(value), }, { title: "Evaluation Score", @@ -46,6 +48,7 @@ function Index() { title: "TP Reviews Rate", dataIndex: "TPReviewRate", key: "TPReviewRate", + render: (value) => comm.formatPercent(value), }, { title: "Complaints", @@ -56,60 +59,63 @@ function Index() { title: "Complaint Rate", dataIndex: "ComplaintRate", key: "ComplaintRate", + render: (value) => comm.formatPercent(value), }, ]; const columns_guide = [ { - title: "导游", + title: "Name", dataIndex: "TGI2_Name", key: "TGI2_Name", }, { - title: "平均分", + title: "Average Scores", dataIndex: "VAverage", key: "VAverage", }, { - title: "接团数", + title: "Group Numbers", dataIndex: "ReceptionGroups", key: "ReceptionGroups", }, { - title: "表扬数", + title: "TP Reviews", dataIndex: "CommendNum", key: "CommendNum", }, { - title: "表扬率", + title: "TP Review Rate", dataIndex: "CommendRate", key: "CommendRate", + render: (value) => comm.formatPercent(value), }, { - title: "投诉数", + title: "Complaints", dataIndex: "Complaints", key: "Complaints", }, { - title: "投诉率", + title: "Complaint Rate", dataIndex: "ComplaintRate", key: "ComplaintRate", + render: (value) => comm.formatPercent(value), }, ]; const columns_commend = [ { - title: "团号", + title: "Reference Number", dataIndex: "GRI_NO", key: "GRI_NO", }, { - title: "对象", + title: "Tour Guides", dataIndex: "ObjectName", key: "ObjectName", }, { - title: "客人评论", + title: "Essential Comments", dataIndex: "ECI_Content", key: "ECI_Content", }, @@ -195,12 +201,12 @@ function Index() { {evaluationScores.Groups} {evaluationScores.PersonNum} - {evaluationScores.AmountUSD} + {comm.formatPrice(evaluationScores.AmountUSD)} {evaluationScores.EvaluationScore} {evaluationScores.TPReviews} - {evaluationScores.TPReviewRate} + {comm.formatPercent(evaluationScores.TPReviewRate)} {evaluationScores.Complaints} - {evaluationScores.ComplaintRate} + {comm.formatPercent(evaluationScores.ComplaintRate)} @@ -216,12 +222,7 @@ function Index() { - - 地接考核分数 Final Scores: - - {evaluationScores.FinalScores} - - + DMC Assessment Criteria
@@ -235,7 +236,7 @@ function Index() { 5 scores Your Scores Final Scores - 备注 + Note @@ -288,7 +289,7 @@ function Index() { 5 scores Your Scores Final Scores - 备注 + Note @@ -353,7 +354,7 @@ function Index() { 5 scores Your Scores Final Scores - 备注 + Note @@ -388,6 +389,11 @@ function Index() {
+ + + Final Scores: {evaluationScores.FinalScores} + +
@@ -411,7 +417,7 @@ function Index() {
- 反馈表分析 + Evaluation Scores
@@ -422,7 +428,7 @@ function Index() { 项目 产品 得分 - 备注说明 + Note @@ -467,16 +473,16 @@ function Index() {
- 导游接待情况 + Tour Guides Performence - 表扬情况 + TP Reviews
- 投诉情况 + Complaints
- 建议 + Suggestions from Customers