Merge remote-tracking branch 'yudao/dev' into dev-crm

# Conflicts:
#	src/router/modules/remaining.ts
This commit is contained in:
puhui999
2024-01-14 21:53:31 +08:00
58 changed files with 1157 additions and 1269 deletions

View File

@ -103,7 +103,6 @@ export const getDictLabel = (dictType: string, value: any): string => {
export enum DICT_TYPE {
USER_TYPE = 'user_type',
COMMON_STATUS = 'common_status',
SYSTEM_TENANT_PACKAGE_ID = 'system_tenant_package_id',
TERMINAL = 'terminal', // 终端
// ========== SYSTEM 模块 ==========

View File

@ -177,7 +177,7 @@ export const fileSizeFormatter = (row, column, cellValue) => {
* @param target 目标对象
* @param source 源对象
*/
export const copyValueToTarget = (target, source) => {
export const copyValueToTarget = (target: any, source: any) => {
const newObj = Object.assign({}, target, source)
// 删除多余属性
Object.keys(newObj).forEach((key) => {
@ -194,10 +194,10 @@ export const copyValueToTarget = (target, source) => {
* 将一个整数转换为分数保留两位小数
* @param num
*/
export const formatToFraction = (num: number | string | undefined): number => {
if (typeof num === 'undefined') return 0
export const formatToFraction = (num: number | string | undefined): string => {
if (typeof num === 'undefined') return '0.00'
const parsedNumber = typeof num === 'string' ? parseFloat(num) : num
return parseFloat((parsedNumber / 100).toFixed(2))
return (parsedNumber / 100.0).toFixed(2)
}
/**
@ -249,7 +249,7 @@ export const yuanToFen = (amount: string | number): number => {
/**
* 分转元
*/
export const fenToYuan = (price: string | number): number => {
export const fenToYuan = (price: string | number): string => {
return formatToFraction(price)
}