fix(crm): 合同产品数量保留一位小数
- 新增 formatAmount1 格式化器(1 位小数)
- 合同产品详情/审批列表的数量列改为 1 位小数,商机保持 3 位
- 合同产品编辑表格数量输入精度改为 1 位、最小值 0.1,商机行为不变
Co-Authored-By: Claude Code <noreply@anthropic.com>
| | |
| | | return erpCountInputFormatter(cellValue); |
| | | }, |
| | | }); |
| | | // 合同产品数量:保留 1 位小数 |
| | | vxeUI.formats.add('formatAmount1', { |
| | | tableCellFormatMethod({ cellValue }) { |
| | | return `${erpNumberFormatter(cellValue, 1)}`; |
| | | }, |
| | | }); |
| | | // add by 星语:数量格式化,保留 2 位 |
| | | vxeUI.formats.add('formatAmount2', { |
| | | tableCellFormatMethod({ cellValue }, digits = 2) { |
| | |
| | | import { ContentWrap } from '@vben/common-ui'; |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { |
| | | erpCountInputFormatter, |
| | | erpNumberFormatter, |
| | | erpPriceInputFormatter, |
| | | formatDateTime, |
| | | } from '@vben/utils'; |
| | |
| | | field: 'count', |
| | | title: '数量', |
| | | minWidth: 100, |
| | | formatter: ({ cellValue }) => erpCountInputFormatter(cellValue) || '-', |
| | | formatter: ({ cellValue }) => erpNumberFormatter(cellValue, 1) || '-', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | |
| | | { |
| | | field: 'count', |
| | | title: '数量', |
| | | formatter: 'formatAmount3', |
| | | // 商机保留 3 位;合同数量保留 1 位(见 adapter 的 formatAmount1) |
| | | formatter: showBusinessPrice ? 'formatAmount3' : 'formatAmount1', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | |
| | | <template #count="{ row }"> |
| | | <InputNumber |
| | | v-model:value="row.count" |
| | | :min="0.001" |
| | | :precision="3" |
| | | :min="isBusiness ? 0.001 : 0.1" |
| | | :precision="isBusiness ? 3 : 1" |
| | | @change="handlePriceChange(row)" |
| | | /> |
| | | </template> |