金额格式设置

This commit is contained in:
2025-09-09 17:03:01 +08:00
parent 460472b29a
commit d92a540786
32 changed files with 633 additions and 318 deletions

View File

@ -77,8 +77,8 @@
changePrice(scope.row);
}
"
:precision="2"
:step="0.1"
:min="0"
:precision="4"
:controls="false"
v-if="scope.row.quantity && scope.row.quantity != 0"
/>
@ -86,7 +86,7 @@
</el-table-column>
<el-table-column prop="price" label="总价" align="center">
<template #default="scope">
{{ scope.row.price != 0 ? Number(scope.row.price).toFixed(2) : null }}
{{ proxy.formatPrice(scope.row.price) }}
</template>
</el-table-column>
<el-table-column prop="operate" label="操作" align="center">

View File

@ -25,7 +25,11 @@
</el-table-column>
<el-table-column prop="name" label="名称" align="center" />
<el-table-column prop="content" label="内容" align="center" />
<el-table-column prop="price" label="限价" align="center" />
<el-table-column prop="price" label="限价" align="center">
<template #default="scope">
{{ proxy.formatPrice(scope.row.price) }}
</template>
</el-table-column>
<el-table-column prop="plannedBiddingTime" align="center">
<template #header> <span style="color: red">*</span>计划招标时间 </template>
<template #default="scope">
@ -158,22 +162,28 @@
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价" align="center" />
<el-table-column prop="unitPrice" label="单价" align="center">
<template #default="scope">
{{ proxy.formatPrice(scope.row.unitPrice) }}
</template>
</el-table-column>
<el-table-column prop="price" label="总价" align="center">
<template #default="scope">
{{
((scope.row.quantity ? Number(scope.row.quantity) : 0) -
(scope.row.useQuantity ? Number(scope.row.useQuantity) : 0) -
(scope.row.selectNum ? Number(scope.row.selectNum) : 0)) *
Number(scope.row.unitPrice) ==
0
? ''
: (
((scope.row.quantity ? Number(scope.row.quantity) : 0) -
proxy.formatPrice(
((scope.row.quantity ? Number(scope.row.quantity) : 0) -
(scope.row.useQuantity ? Number(scope.row.useQuantity) : 0) -
(scope.row.selectNum ? Number(scope.row.selectNum) : 0)) *
Number(scope.row.unitPrice) ==
0
? ''
: ((scope.row.quantity ? Number(scope.row.quantity) : 0) -
(scope.row.useQuantity ? Number(scope.row.useQuantity) : 0) -
(scope.row.selectNum ? Number(scope.row.selectNum) : 0)) *
Number(scope.row.unitPrice)
).toFixed(2)
Number(scope.row.unitPrice),
false
)
}}
</template>
</el-table-column>
@ -207,6 +217,7 @@ import { useUserStoreHook } from '@/store/modules/user';
import { getDicts } from '@/api/system/dict/data';
import { Plus } from '@element-plus/icons-vue';
import { FormInstance } from 'element-plus';
const { proxy } = getCurrentInstance();
import {
treeList,
sheetList,

View File

@ -79,18 +79,16 @@
changePrice(scope.row);
}
"
:precision="2"
:step="0.1"
:min="0"
:precision="4"
:controls="false"
v-if="scope.row.quantity && scope.row.quantity != 0"
/>
</template>
</el-table-column>
<el-table-column prop="price" label="总价" align="center" >
<el-table-column prop="price" label="总价" align="center">
<template #default="scope">
<!-- {{ scope.row.children.length > 0 ? scope.row.children.reduce((sum, child) => sum + child.price, 0) : scope.row.price }} -->
{{ scope.row.price != 0 ? Number(scope.row.price).toFixed(2) : null }}
<!-- {{ scope.row.price }} -->
{{ proxy.formatPrice(scope.row.price) }}
</template>
</el-table-column>
<el-table-column prop="operate" label="操作" align="center">

View File

@ -41,10 +41,14 @@
<el-table-column prop="specification" label="规格" />
<el-table-column prop="unit" label="单位" />
<el-table-column prop="quantity" label="数量" />
<el-table-column prop="unitPrice" label="单价" align="center" />
<el-table-column prop="price" label="总价" align="center">
<el-table-column prop="unitPrice" label="单价" align="center">
<template #default="scope">
{{ scope.row.price != 0 ? Number(scope.row.price).toFixed(2) : null }}
{{ proxy.formatPrice(scope.row.unitPrice, false) }}
</template>
</el-table-column>
<el-table-column prop="price" label="总价" align="center" width="150">
<template #default="scope">
{{ proxy.formatPrice(scope.row.price) }}
</template>
</el-table-column>
</el-table>
@ -70,8 +74,12 @@
</div>
<template #footer>
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors">取消</el-button>
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">确认</el-button>
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
>取消</el-button
>
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
>确认</el-button
>
</div>
</template>
</el-dialog>