添加翻译和格式化金额

release
YCC 1 year ago
parent 52cd2728a6
commit 7180272c35

@ -143,3 +143,12 @@ export function groupBy(array, callback) {
return groups; return groups;
}, {}); }, {});
} }
export function formatPrice(price) {
return Math.ceil(price).toLocaleString();
}
export function formatPercent(number) {
return Math.round(number * 100) + "%";
}

@ -3,6 +3,7 @@ import { observer } from "mobx-react";
import { Row, Col, Space, Button, Table, Divider, Typography, DatePicker } from "antd"; import { Row, Col, Space, Button, Table, Divider, Typography, DatePicker } from "antd";
import { useStore } from "@/stores/StoreContext.js"; import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config"; import * as config from "@/config";
import * as comm from "@/utils/commons";
import { usePDF } from "react-to-pdf"; import { usePDF } from "react-to-pdf";
function Index() { function Index() {
@ -31,6 +32,7 @@ function Index() {
title: "Transaction AmountUSD)", title: "Transaction AmountUSD)",
dataIndex: "AmountUSD", dataIndex: "AmountUSD",
key: "AmountUSD", key: "AmountUSD",
render: (value) => comm.formatPrice(value),
}, },
{ {
title: "Evaluation Score", title: "Evaluation Score",
@ -46,6 +48,7 @@ function Index() {
title: "TP Reviews Rate", title: "TP Reviews Rate",
dataIndex: "TPReviewRate", dataIndex: "TPReviewRate",
key: "TPReviewRate", key: "TPReviewRate",
render: (value) => comm.formatPercent(value),
}, },
{ {
title: "Complaints", title: "Complaints",
@ -56,60 +59,63 @@ function Index() {
title: "Complaint Rate", title: "Complaint Rate",
dataIndex: "ComplaintRate", dataIndex: "ComplaintRate",
key: "ComplaintRate", key: "ComplaintRate",
render: (value) => comm.formatPercent(value),
}, },
]; ];
const columns_guide = [ const columns_guide = [
{ {
title: "导游", title: "Name",
dataIndex: "TGI2_Name", dataIndex: "TGI2_Name",
key: "TGI2_Name", key: "TGI2_Name",
}, },
{ {
title: "平均分", title: "Average Scores",
dataIndex: "VAverage", dataIndex: "VAverage",
key: "VAverage", key: "VAverage",
}, },
{ {
title: "接团数", title: "Group Numbers",
dataIndex: "ReceptionGroups", dataIndex: "ReceptionGroups",
key: "ReceptionGroups", key: "ReceptionGroups",
}, },
{ {
title: "表扬数", title: "TP Reviews",
dataIndex: "CommendNum", dataIndex: "CommendNum",
key: "CommendNum", key: "CommendNum",
}, },
{ {
title: "表扬率", title: "TP Review Rate",
dataIndex: "CommendRate", dataIndex: "CommendRate",
key: "CommendRate", key: "CommendRate",
render: (value) => comm.formatPercent(value),
}, },
{ {
title: "投诉数", title: "Complaints",
dataIndex: "Complaints", dataIndex: "Complaints",
key: "Complaints", key: "Complaints",
}, },
{ {
title: "投诉率", title: "Complaint Rate",
dataIndex: "ComplaintRate", dataIndex: "ComplaintRate",
key: "ComplaintRate", key: "ComplaintRate",
render: (value) => comm.formatPercent(value),
}, },
]; ];
const columns_commend = [ const columns_commend = [
{ {
title: "团号", title: "Reference Number",
dataIndex: "GRI_NO", dataIndex: "GRI_NO",
key: "GRI_NO", key: "GRI_NO",
}, },
{ {
title: "对象", title: "Tour Guides",
dataIndex: "ObjectName", dataIndex: "ObjectName",
key: "ObjectName", key: "ObjectName",
}, },
{ {
title: "客人评论", title: "Essential Comments",
dataIndex: "ECI_Content", dataIndex: "ECI_Content",
key: "ECI_Content", key: "ECI_Content",
}, },
@ -195,12 +201,12 @@ function Index() {
<tr className="ant-table-row ant-table-row-level-0"> <tr className="ant-table-row ant-table-row-level-0">
<td>{evaluationScores.Groups}</td> <td>{evaluationScores.Groups}</td>
<td>{evaluationScores.PersonNum}</td> <td>{evaluationScores.PersonNum}</td>
<td>{evaluationScores.AmountUSD}</td> <td>{comm.formatPrice(evaluationScores.AmountUSD)}</td>
<td>{evaluationScores.EvaluationScore}</td> <td>{evaluationScores.EvaluationScore}</td>
<td>{evaluationScores.TPReviews}</td> <td>{evaluationScores.TPReviews}</td>
<td>{evaluationScores.TPReviewRate}</td> <td>{comm.formatPercent(evaluationScores.TPReviewRate)}</td>
<td>{evaluationScores.Complaints}</td> <td>{evaluationScores.Complaints}</td>
<td>{evaluationScores.ComplaintRate}</td> <td>{comm.formatPercent(evaluationScores.ComplaintRate)}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -216,12 +222,7 @@ function Index() {
</Col> </Col>
<Col md={24} lg={24} xxl={16}> <Col md={24} lg={24} xxl={16}>
<Divider orientation="left"> <Divider orientation="left">DMC Assessment Criteria</Divider>
地接考核分数 Final Scores:
<Typography.Title level={3} type="danger">
{evaluationScores.FinalScores}
</Typography.Title>
</Divider>
<div className="ant-table-wrapper ant-spin-nested-loading css-dev-only-do-not-override-3op25v "> <div className="ant-table-wrapper ant-spin-nested-loading css-dev-only-do-not-override-3op25v ">
<div className="ant-spin-container ant-table ant-table-bordered"> <div className="ant-spin-container ant-table ant-table-bordered">
<div className="ant-table-container"> <div className="ant-table-container">
@ -235,7 +236,7 @@ function Index() {
<th scope="col">5 scores</th> <th scope="col">5 scores</th>
<th scope="col">Your Scores</th> <th scope="col">Your Scores</th>
<th scope="col">Final Scores</th> <th scope="col">Final Scores</th>
<th scope="col">备注</th> <th scope="col">Note</th>
</tr> </tr>
</thead> </thead>
<tbody className="ant-table-tbody"> <tbody className="ant-table-tbody">
@ -288,7 +289,7 @@ function Index() {
<th scope="col">5 scores</th> <th scope="col">5 scores</th>
<th scope="col">Your Scores</th> <th scope="col">Your Scores</th>
<th scope="col">Final Scores</th> <th scope="col">Final Scores</th>
<th scope="col">备注</th> <th scope="col">Note</th>
</tr> </tr>
</thead> </thead>
<tbody className="ant-table-tbody"> <tbody className="ant-table-tbody">
@ -353,7 +354,7 @@ function Index() {
<th scope="col">5 scores</th> <th scope="col">5 scores</th>
<th scope="col">Your Scores</th> <th scope="col">Your Scores</th>
<th scope="col">Final Scores</th> <th scope="col">Final Scores</th>
<th scope="col">备注</th> <th scope="col">Note</th>
</tr> </tr>
</thead> </thead>
<tbody className="ant-table-tbody"> <tbody className="ant-table-tbody">
@ -388,6 +389,11 @@ function Index() {
</div> </div>
</div> </div>
</div> </div>
<Divider orientation="center">
<Typography.Title level={3} type="danger">
Final Scores: {evaluationScores.FinalScores}
</Typography.Title>
</Divider>
<br /> <br />
<Typography> <Typography>
<Typography.Title level={3} type="success"> <Typography.Title level={3} type="success">
@ -411,7 +417,7 @@ function Index() {
</Typography> </Typography>
<br /> <br />
<Divider orientation="left">反馈表分析</Divider> <Divider orientation="left">Evaluation Scores</Divider>
<div className="ant-table-wrapper ant-spin-nested-loading css-dev-only-do-not-override-3op25v "> <div className="ant-table-wrapper ant-spin-nested-loading css-dev-only-do-not-override-3op25v ">
<div className="ant-spin-container ant-table ant-table-bordered"> <div className="ant-spin-container ant-table ant-table-bordered">
<div className="ant-table-container"> <div className="ant-table-container">
@ -422,7 +428,7 @@ function Index() {
<th scope="col">项目</th> <th scope="col">项目</th>
<th scope="col">产品</th> <th scope="col">产品</th>
<th scope="col">得分</th> <th scope="col">得分</th>
<th scope="col">备注说明</th> <th scope="col">Note</th>
</tr> </tr>
</thead> </thead>
<tbody className="ant-table-tbody"> <tbody className="ant-table-tbody">
@ -467,16 +473,16 @@ function Index() {
</div> </div>
</Col> </Col>
<Col md={24} lg={24} xxl={16}> <Col md={24} lg={24} xxl={16}>
<Divider orientation="left">导游接待情况</Divider> <Divider orientation="left">Tour Guides Performence</Divider>
<Table dataSource={productScoresData.GuideScores} columns={columns_guide} pagination={false} bordered /> <Table dataSource={productScoresData.GuideScores} columns={columns_guide} pagination={false} bordered />
<Divider orientation="left">表扬情况</Divider> <Divider orientation="left">TP Reviews</Divider>
<Table dataSource={commendScoresData.CommendScores} columns={columns_commend} pagination={false} bordered /> <Table dataSource={commendScoresData.CommendScores} columns={columns_commend} pagination={false} bordered />
<Divider orientation="left">投诉情况</Divider> <Divider orientation="left">Complaints</Divider>
<Table dataSource={commendScoresData.ComplaintScores} columns={columns_commend} pagination={false} bordered /> <Table dataSource={commendScoresData.ComplaintScores} columns={columns_commend} pagination={false} bordered />
<Divider orientation="left">建议</Divider> <Divider orientation="left">Suggestions from Customers</Divider>
<Table dataSource={commendScoresData.CriticizeScores} columns={columns_commend} pagination={false} bordered /> <Table dataSource={commendScoresData.CriticizeScores} columns={columns_commend} pagination={false} bordered />
</Col> </Col>
</Row> </Row>

Loading…
Cancel
Save