优化页面展示 计价 分成
This commit is contained in:
parent
8ba44ae2fb
commit
2da956c1b4
@ -132,8 +132,8 @@ const {
|
|||||||
render: (row) => {
|
render: (row) => {
|
||||||
if (!row.pricingRule) return '';
|
if (!row.pricingRule) return '';
|
||||||
const suffixMap = {
|
const suffixMap = {
|
||||||
'gjjjnzh': ' * 交易金额',
|
'BIZ006': ' * 交易金额',
|
||||||
'xzzhsdshlcltsdj': ' 元/条',
|
'BIZ028': ' * 交易金额',
|
||||||
'default': ' 元/条'
|
'default': ' 元/条'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -149,7 +149,10 @@ watch(visible, () => {
|
|||||||
:rows="3"
|
:rows="3"
|
||||||
placeholder="请输入计价规则说明"
|
placeholder="请输入计价规则说明"
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template v-if="model.typeId === 'BIZ006' || model.typeId === 'BIZ028' " #suffix>
|
||||||
|
* 交易金额
|
||||||
|
</template>
|
||||||
|
<template else #suffix>
|
||||||
元/条
|
元/条
|
||||||
</template>
|
</template>
|
||||||
</NInput>
|
</NInput>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { NDivider } from 'naive-ui';
|
import { NDivider, NEllipsis } from 'naive-ui';
|
||||||
import { fetchBatchDeletePercentage, fetchGetPercentageList } from '@/service/api/business/percentage';
|
import { fetchBatchDeletePercentage, fetchGetPercentageList } from '@/service/api/business/percentage';
|
||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
import { useAuth } from '@/hooks/business/auth';
|
import { useAuth } from '@/hooks/business/auth';
|
||||||
@ -79,7 +79,24 @@ const {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
resizable: true
|
resizable: true,
|
||||||
|
render: (row,index) => {
|
||||||
|
if (row.yxPercent === null || row.yxPercent === undefined) return '';
|
||||||
|
|
||||||
|
// 将小数转换为百分比(乘以100)
|
||||||
|
const percentageValue = parseFloat(row.yxPercent) * 100;
|
||||||
|
|
||||||
|
// 可选:去除小数点后的多余零(如50.00% → 50%)
|
||||||
|
const formattedValue = percentageValue % 1 === 0
|
||||||
|
? percentageValue.toFixed(0)
|
||||||
|
: percentageValue.toFixed(2);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NEllipsis style="width: 100%;" tooltip={true}>
|
||||||
|
{formattedValue}%
|
||||||
|
</NEllipsis>
|
||||||
|
)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'jbPercent',
|
key: 'jbPercent',
|
||||||
@ -87,7 +104,24 @@ const {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
resizable: true
|
resizable: true,
|
||||||
|
render: (row,index) => {
|
||||||
|
if (row.jbPercent === null || row.jbPercent === undefined) return '';
|
||||||
|
|
||||||
|
// 将小数转换为百分比(乘以100)
|
||||||
|
const percentageValue = parseFloat(row.jbPercent) * 100;
|
||||||
|
|
||||||
|
// 可选:去除小数点后的多余零(如50.00% → 50%)
|
||||||
|
const formattedValue = percentageValue % 1 === 0
|
||||||
|
? percentageValue.toFixed(0)
|
||||||
|
: percentageValue.toFixed(2);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NEllipsis style="width: 100%;" tooltip={true}>
|
||||||
|
{formattedValue}%
|
||||||
|
</NEllipsis>
|
||||||
|
)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'operate',
|
key: 'operate',
|
||||||
@ -112,7 +146,7 @@ const {
|
|||||||
type="primary"
|
type="primary"
|
||||||
local-icon="drive-file-rename-outline-outline"
|
local-icon="drive-file-rename-outline-outline"
|
||||||
tooltipContent={$t('common.edit')}
|
tooltipContent={$t('common.edit')}
|
||||||
onClick={() => edit(row.id!)}
|
onClick={() => edit(row.branchId!)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -128,7 +162,7 @@ const {
|
|||||||
local-icon="delete-outline"
|
local-icon="delete-outline"
|
||||||
tooltipContent={$t('common.delete')}
|
tooltipContent={$t('common.delete')}
|
||||||
popconfirmContent={$t('common.confirmDelete')}
|
popconfirmContent={$t('common.confirmDelete')}
|
||||||
onPositiveClick={() => handleDelete(row.id!)}
|
onPositiveClick={() => handleDelete(row.branchId!)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -192,7 +226,7 @@ async function handleDelete(id: CommonType.IdType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function edit(id: CommonType.IdType) {
|
function edit(id: CommonType.IdType) {
|
||||||
handleEdit('id', id);
|
handleEdit('branchId', id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleImport() {
|
function handleImport() {
|
||||||
@ -242,7 +276,7 @@ function handleExport() {
|
|||||||
:scroll-x="scrollX"
|
:scroll-x="scrollX"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
remote
|
remote
|
||||||
:row-key="row => row.id"
|
:row-key="row => row.branchId"
|
||||||
:pagination="mobilePagination"
|
:pagination="mobilePagination"
|
||||||
class="sm:h-full"
|
class="sm:h-full"
|
||||||
@update-resize-widths="scrollX = calculateTotalWidth()"
|
@update-resize-widths="scrollX = calculateTotalWidth()"
|
||||||
|
@ -47,8 +47,8 @@ function createDefaultModel(): Model {
|
|||||||
return {
|
return {
|
||||||
branchId: '',
|
branchId: '',
|
||||||
branchName: '',
|
branchName: '',
|
||||||
yxPercent: undefined,
|
yxPercent: 0.5,
|
||||||
jbPercent: undefined,
|
jbPercent: 0.5,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +121,28 @@ watch(visible, () => {
|
|||||||
restoreValidation();
|
restoreValidation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function handlePercentageChange(changedField: 'yx' | 'jb') {
|
||||||
|
if (changedField === 'yx') {
|
||||||
|
displayJbPercent.value = 100 - displayYxPercent.value
|
||||||
|
} else {
|
||||||
|
displayYxPercent.value = 100 - displayJbPercent.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const displayYxPercent = computed({
|
||||||
|
get: () => model.yxPercent ? Math.round(model.yxPercent * 100) : 0,
|
||||||
|
set: (val) => {
|
||||||
|
model.yxPercent = val ? val / 100 : 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const displayJbPercent = computed({
|
||||||
|
get: () => model.jbPercent ? Math.round(model.jbPercent * 100) : 0,
|
||||||
|
set: (val) => {
|
||||||
|
model.jbPercent = val ? val / 100 : 0
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -134,10 +156,34 @@ watch(visible, () => {
|
|||||||
<NInput v-model:value="model.branchName" placeholder="请输入支行名称" />
|
<NInput v-model:value="model.branchName" placeholder="请输入支行名称" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem label="营销人员分成比例" path="yxPercent">
|
<NFormItem label="营销人员分成比例" path="yxPercent">
|
||||||
<NInput v-model:value="model.yxPercent" placeholder="请输入营销人员分成比例" />
|
<!-- <NInput v-model:value="model.yxPercent" placeholder="请输入营销人员分成比例" />-->
|
||||||
|
<NInput-number
|
||||||
|
v-model:value="displayYxPercent"
|
||||||
|
:min="0"
|
||||||
|
:max="100"
|
||||||
|
:precision="0"
|
||||||
|
step="10"
|
||||||
|
@update:value="handlePercentageChange('yx')"
|
||||||
|
placeholder="请输入营销人员分成比例"
|
||||||
|
>
|
||||||
|
<template #suffix>
|
||||||
|
%
|
||||||
|
</template>
|
||||||
|
</NInput-number>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem label="经办人员分成比例" path="jbPercent">
|
<NFormItem label="经办人员分成比例" path="jbPercent">
|
||||||
<NInput v-model:value="model.jbPercent" placeholder="请输入经办人员分成比例" />
|
<NInput-number
|
||||||
|
v-model:value="displayJbPercent"
|
||||||
|
:min="0"
|
||||||
|
:max="100"
|
||||||
|
:precision="0"
|
||||||
|
step="10"
|
||||||
|
@update:value="handlePercentageChange('jb')"
|
||||||
|
placeholder="请输入经办人员分成比例" >
|
||||||
|
<template #suffix>
|
||||||
|
%
|
||||||
|
</template>
|
||||||
|
</NInput-number>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
</NForm>
|
</NForm>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
Loading…
Reference in New Issue
Block a user