|
|
@@ -25,16 +25,14 @@
|
|
|
{{ unposted.storeName }}
|
|
|
</h2>
|
|
|
<el-row class="couponRow">
|
|
|
- <el-col :span="12"> 实际收益: {{ ((unposted.money || 0) / 100).toFixed(2) }} </el-col>
|
|
|
+ <el-col :span="12"> 实际收益: ¥{{ formatNumber(unposted.money / 100) }} </el-col>
|
|
|
<el-col :span="12">
|
|
|
{{ `技术服务费(${commissionRate}%)` }}:
|
|
|
- {{ unposted.commission != null ? (unposted.commission / 100).toFixed(2) : "--" }}
|
|
|
+ {{ formatNumber(unposted.commission / 100) }}
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row class="couponRow">
|
|
|
- <el-col :span="12">
|
|
|
- 售价: {{ ((Number(unposted.money) + Number(unposted.commission)) / 100).toFixed(2) || "0.00" }}
|
|
|
- </el-col>
|
|
|
+ <el-col :span="12"> 售价: ¥{{ formatNumber(unposted.orderPrice) }} </el-col>
|
|
|
</el-row>
|
|
|
<h3 class="orderInfo">订单信息</h3>
|
|
|
<div>
|
|
|
@@ -67,6 +65,21 @@ const toDetail = (row: any) => {
|
|
|
dialogVisible.value = true;
|
|
|
unposted.value = row;
|
|
|
};
|
|
|
+// 格式化数字为千分位
|
|
|
+const formatNumber = (value: any): string => {
|
|
|
+ if (value === null || value === undefined || value === "") {
|
|
|
+ return "0.00";
|
|
|
+ }
|
|
|
+ const num = typeof value === "string" ? parseFloat(value) : Number(value);
|
|
|
+ if (isNaN(num)) {
|
|
|
+ return "0.00";
|
|
|
+ }
|
|
|
+ // 保留两位小数并添加千分位
|
|
|
+ return num.toLocaleString("zh-CN", {
|
|
|
+ minimumFractionDigits: 2,
|
|
|
+ maximumFractionDigits: 2
|
|
|
+ });
|
|
|
+};
|
|
|
// 返回
|
|
|
const goBack = () => {
|
|
|
router.back();
|
|
|
@@ -84,21 +97,21 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
prop: "money",
|
|
|
label: "实际收益",
|
|
|
render: scope => {
|
|
|
- return ((scope.row.money || 0) / 100).toFixed(2) || "0.00";
|
|
|
+ return formatNumber(scope.row.money / 100);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
prop: "price",
|
|
|
label: "售价",
|
|
|
render: scope => {
|
|
|
- return ((Number(scope.row.money) + Number(scope.row.commission)) / 100).toFixed(2) || "0.00";
|
|
|
+ return formatNumber(Number(scope.row.money) + Number(scope.row.commission) / 100);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
prop: "commission",
|
|
|
label: "技术服务费",
|
|
|
render: scope => {
|
|
|
- return (scope.row.commission / 100).toFixed(2) || "0.00";
|
|
|
+ return formatNumber(scope.row.commission / 100);
|
|
|
}
|
|
|
},
|
|
|
{ prop: "operation", label: "操作", fixed: "right", width: 330 }
|