系数字段修改

This commit is contained in:
zwgczx committed 2026-03-07 17:52:33 +08:00
1 parent 21d3f0379c
commit fc26a87bee
12 files changed
+782 -105

No files matched your search

@@ -6,7 +6,7 @@ import localforage from 'localforage'
import { taskList } from '@/sql'
import { myTheme, gridOptions } from '@/lib/diyAgGridOptions'
import { decimalAggSum, roundTo, sumByNumber, toDecimal } from '@/lib/decimal'
import { formatThousands } from '@/lib/numberFormat'
import { formatThousands, formatThousandsFlexible } from '@/lib/numberFormat'
import { parseNumberOrNull } from '@/lib/number'
import { syncPricingTotalToZxFw, ZXFW_RELOAD_SERVICE_KEY } from '@/lib/zxFwPricingSync'
import { usePricingPaneReloadStore } from '@/pinia/pricingPaneReload'
@@ -187,7 +187,10 @@ const mergeWithDictRows = (rowsFromDb: DetailRow[] | undefined): DetailRow[] =>
}
const parseSanitizedNumberOrNull = (value: unknown) =>
parseNumberOrNull(value, { sanitize: true, precision: 2 })
parseNumberOrNull(value, { sanitize: true, precision: 3 })
const parseSanitizedAdoptedPriceOrNull = (value: unknown) =>
parseNumberOrNull(value, { sanitize: true, precision: 6 })
const calcBasicFee = (row: DetailRow | undefined) => {
if (!row || isNoTaskRow(row)) return null
@@ -227,7 +230,7 @@ const formatEditableNumber = (params: any) => {
return '点击输入'
}
if (params.value == null) return ''
return Number(params.value).toFixed(2)
return formatThousandsFlexible(params.value, 3)
}
const spanRowsByTaskName = (params: any) => {
@@ -294,7 +297,7 @@ const columnDefs: ColDef<DetailRow>[] = [
!isNoTaskRow(params.data) &&
(params.value == null || params.value === '')
},
valueParser: params => parseSanitizedNumberOrNull(params.newValue),
valueParser: params => parseSanitizedAdoptedPriceOrNull(params.newValue),
valueFormatter: params => {
if (isNoTaskRow(params.data)) return '无'
if (!params.node?.group && !params.node?.rowPinned && (params.value == null || params.value === '')) {
@@ -302,7 +305,7 @@ const columnDefs: ColDef<DetailRow>[] = [
}
if (params.value == null) return ''
const unit = params.data?.unit || ''
return `${formatThousands(params.value)}${unit}`
return `${formatThousandsFlexible(params.value, 6)}${unit}`
}
},
{
@@ -354,7 +357,7 @@ const columnDefs: ColDef<DetailRow>[] = [
valueFormatter: params => {
if (isNoTaskRow(params.data)) return '无'
if (params.value == null || params.value === '') return ''
return formatThousands(roundTo(params.value, 2))
return formatThousandsFlexible(roundTo(params.value, 3), 3)
}
},
{