Browse Source

会计金额展示

master_hella_20240701
yufei0306 7 months ago
parent
commit
7af6dcfd84
  1. 11
      src/utils/formatter.ts
  2. 13
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

11
src/utils/formatter.ts

@ -10,3 +10,14 @@ export const fenToYuanFormat = (
) => {
return `${fenToYuan(cellValue)}`
}
export const accountantFormart = (row, column, cellValue) => {
cellValue = cellValue + '' || ''
let x = cellValue.split('.')
let x1 = x[0]
let x2 = x.length > 1 ? '.' + x[1] : ''
const reg = /(\d+)(\d{3})/
while(reg.test(x1)){
x1 = x1.replace(reg, '$1,$2')
}
return x1+x2
}

13
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -1,5 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { accountantFormart } from '@/utils/formatter'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
const { t } = useI18n() // 国际化
@ -152,6 +154,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '金额',
field: 'amount',
formatter: accountantFormart,
table: {
width: 150
},
@ -183,6 +186,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '税额',
field: 'taxAmount',
formatter: accountantFormart,
table: {
width: 150
},
@ -203,6 +207,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '税后金额',
field: 'afterTaxAmount',
formatter: accountantFormart,
table: {
width: 150
},
@ -224,6 +229,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '索赔金额',
field: 'claimAmount',
formatter: accountantFormart,
table: {
width: 150
},
@ -247,6 +253,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '折扣金额',
field: 'discountAmount',
formatter: accountantFormart,
table: {
width: 150
},
@ -283,6 +290,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '总差额',
field: 'totalDifference',
formatter: accountantFormart,
table: {
width: 150
},
@ -820,6 +828,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
{
label: '合同价格',
field: 'singlePrice',
formatter: accountantFormart,
table: {
width: 150
},
@ -839,6 +848,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
{
label: '采购价格',
field: 'purchasePrice',
formatter: accountantFormart,
table: {
width: 150
},
@ -854,6 +864,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
{
label: '差额',
field: 'differencePrice',
formatter: accountantFormart,
table: {
width: 150
},
@ -870,6 +881,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
{
label: '未税差额',
field: 'untaxedDifference',
formatter: accountantFormart,
table: {
width: 150
},
@ -888,6 +900,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
{
label: '含税差额',
field: 'taxInclusiveDifference',
formatter: accountantFormart,
table: {
width: 150
},

Loading…
Cancel
Save