This commit is contained in:
李远 2026-03-17 15:59:16 +08:00
parent 5e940ceade
commit 4b712be3be
10 changed files with 332 additions and 372 deletions

View File

@ -18,6 +18,6 @@ export async function getFeeTemplateOptionsApi(): Promise<any> {
return request.get<any>('user/getFeeSettingOptions')
}
//编辑代理点差
export async function editPointDiffConfigApi(params: pointDiffConfigParams): Promise<any> {
export async function editPointDiffApi(params: pointDiffConfigParams): Promise<any> {
return request.post<any>('/agent/editAgent',{...params})
}

View File

@ -1,7 +1,7 @@
import { request } from '@/api';
import type{ searchParams,pointDiffConfigParams } from '@/api/types/account/market'
// 查询做市商列表
// 查询和获取做市商列表
export async function getMarketListApi(params: searchParams): Promise<any> {
return request.get<any>('agent/getAgentList', { ...params })
}

View File

@ -56,7 +56,7 @@
<!-- 操作按钮 -->
<el-form-item>
<el-button type="primary" @click="$emit('search')">
{{ buttonConfig.searchText || '查询' }}
{{ buttonConfig.searchText || '搜索' }}
</el-button>
<el-button @click="$emit('reset')">
{{ buttonConfig.resetText || '重置' }}

View File

@ -1,27 +1,67 @@
<template>
<div class="agent">
<!-- 搜索 -->
<MarketSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch" />
<AgentSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
@reset="handleReset" />
<!-- 表格 -->
<!-- <MarketTable :table-data="tableData" :table-columns="tableColumns" @change="handleChange" /> -->
<AgentTable :table-data="agentTree" :columns="agentTableColumnsOptions" row-key="id">
<template #status="{ row }">
<el-switch :model-value="row.status === 1" :active-value="true" :inactive-value="false" />
</template>
<template #pointDifference="{ row }">
<el-button type="primary" size="small" @click="handleViewPointDiff(row)">
查看
</el-button>
</template>
<template #edit="{ row }">
<el-button type="primary" size="small" @click="handleEdit(row)">
编辑
</el-button>
</template>
</AgentTable>
<!-- 分页 -->
<!-- <MarketPagination :pagination="pagination" @change="handlePaginationChange" /> -->
<AgentPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
@pagination-change="handlePaginationChange" />
</div>
<!-- 弹窗 -->
<AgentDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" :fullscreen="dialogFullscreen"
:show-footer="dialogType !== 'view'" @confirm="handleSubmit" @cancel="handleCancel" @close="handleClose">
<!-- 编辑表单 -->
<AgentForm :form-data="agentForm" :form-rules="agentFormRules" :form-items="agentFormItemOptions"
:options-map="agentFormOptionsMap" ref="agentFormRef" v-if="dialogType !== 'view'"></AgentForm>
<!-- 点差表格 -->
<AgentTable :table-data="agentPointTree" :columns="agentPointTableColumnsOptions" row-key="id">
<template #assignedPointDiff="{ row }">
<el-form :model="row" :rules="rules()">
<el-form-item prop="assignedPointDifference">
<el-input v-model="row.assignedPointDifference" size="small" placeholder="请输入点差" />
</el-form-item>
</el-form>
</template>
</AgentTable>
</AgentDialog>
<!-- 编辑/查看表单 -->
</template>
<script lang="ts" setup>
//
import MarketSearch from '@/components/common/Search.vue'
import MarketTable from '@/components/common/Table.vue'
import MarketPagination from '@/components/common/Pagination.vue'
import MarketDialog from '@/components/common/Dialog.vue'
import MarketForm from '@/components/common/Form.vue'
import AgentSearch from '@/components/common/Search.vue'
import AgentTable from '@/components/common/Table.vue'
import AgentPagination from '@/components/common/Pagination.vue'
import AgentDialog from '@/components/common/Dialog.vue'
import AgentForm from '@/components/common/Form.vue'
//
import { agentSearch, agentTableColumns, viewAgentPointTableColumns, agentPointTableColumns, PointDiffFormItem } from './options'
import { rules } from './rules'
//
import { getAgentListApi, getPointDiffConfigApi, getRiskTemplateOptionsApi, getFeeTemplateOptionsApi, editPointDiffApi } from '@/api/modules/account/agent'
//
import { getStorage } from '@/utils/storage';
//id
const useInfo = ref<any>(getStorage('userInfo'))
/**
* @description 定义搜索数据
*/
@ -31,18 +71,21 @@ const searchForm = ref({
startDateTime: '',
endDateTime: '',
})
const searchOptions = ref()
const searchOptions = ref(agentSearch)
/**
* @description 定义表格数据
*/
const AgentTree = ref([])
const agentTableColumnsOptions = ref()
const agentTree = ref([])
const agentTableColumnsOptions = ref(agentTableColumns)
/**
* @description 定义分页数据
*/
const total = ref(0)
const pageSize = ref(10)
const currentPage = ref(1)
/**
* @description 定义弹窗数据
*/
@ -50,44 +93,276 @@ const dialogVisible = ref<boolean>(false)
const dialogTitle = ref<string>('')
const dialogType = ref<string>('edit')
const dialogFullscreen = ref(false)
/**
* @description 定义弹窗form数据
*/
const agentForm = ref({})
const agentFormRules = ref()
const agentForm = ref({
username: '',
parentUsername: '',
riskTemplate: '',
feeTemplate: '',
positionRatio: '',
feeRate: '',
//id
id: '',
})
const agentFormRules = rules()
const agentFormRef = ref()
const agentFormItemOptions = ref()
const agentFormOptionsMap = ref()
const agentFormItemOptions = ref(PointDiffFormItem)
//使
const optionsFetched = ref(false)
interface SelectOption {
label: string
value: string | number
}
const agentFormOptionsMap = ref({
riskTemplate: [] as SelectOption[],
feeTemplate: [] as SelectOption[],
})
/**
* @description 定义弹窗表格数据
*/
const agentPointTree = ref([])
const agentPointTableColumnsOptions = computed(() => {
return dialogType.value !== 'view' ? agentPointTableColumns : viewAgentPointTableColumns;
});
/**
* @description 定义通用数据处理方法
*/
// + +
function sumStrNumsWith5Decimals(strNums: string[]) {
// 1.
let total = 0;
// 2.
strNums.forEach(strNum => {
// /0
const num = parseFloat(strNum) || 0;
total += num;
});
// 3.
const result = parseFloat(total.toFixed(5));
return result;
}
//
const mapObjectToOptions = (obj: Record<string, string>) => {
return Object.entries(obj).map(([label, value]) => ({
label, // /
value // /ID
}))
}
/**
* @description 定义通用数据获取方法
*/
//
const getAgentList = async () => {
const params = {
user_id: useInfo.value.id,
page: currentPage.value,
page_size: pageSize.value,
user_name: searchForm.value.username,
status: searchForm.value.status,
reg_start_time: searchForm.value.startDateTime,
reg_end_time: searchForm.value.endDateTime,
}
const data = await getAgentListApi(params)
//
agentTree.value = data.data.map((item: any) => {
//item
const walletNums = [
// undefined
item.wallet_capital?.commission_fee_handling || '0.00000',
item.wallet_capital?.commission_point_diff || '0.00000'
];
//
const rebateTotalAmount = sumStrNumsWith5Decimals(walletNums);
return {
...item,
createTime: item.created_at || '',
feeRate: item.wallet_capital.fee_handling_percent,
rebateRate: item.wallet_capital.commission_fee_handling,
pointDifference: item.wallet_capital.commission_point_diff,
rebateTotalAmount: rebateTotalAmount,
clientCount: item.son_user.length,
level: item.role.title,
parentUsername: item.par_uid === item.parent.id ? item.parent.username : '',
}
})
//
total.value = data.total
currentPage.value = data.current_page
pageSize.value = Number(data.per_page)
}
//
const getPointDiffConfig = async (row: any) => {
const params = {
user_id: row.par_uid,
}
const data = await getPointDiffConfigApi(params)
//
agentPointTree.value = data.map((item: any) => ({
...item,
varietyName: item.name,
varietyCode: item.code,
pointDifference: item.target_point_diff,
assignedPointDifference: ''
}));
}
//
const getOptions = async () => {
//
if (optionsFetched.value) return
try {
const [riskTemplateRes, feeTemplateRes] = await Promise.all([
//
getRiskTemplateOptionsApi(),
//
getFeeTemplateOptionsApi()
])
// label=value=ID
agentFormOptionsMap.value.riskTemplate = riskTemplateRes.map((item: any) => ({
label: item.name,
value: item.id
}))
// label=value=ID
agentFormOptionsMap.value.feeTemplate = mapObjectToOptions(feeTemplateRes as Record<string, string>)
optionsFetched.value = true //
} catch (error) {
console.error('获取表单选项失败:', error)
}
}
/**
* @description 页面加载完成需要调用的方法
*/
onMounted(() => {
getAgentList()
})
/**
* @description 定义搜索方法
* @description 定义搜索组件的全部方法
*/
const handleSearch = () => {
getAgentList()
}
const handleReset = () => {
searchForm.value = {
username: '',
status: '正常',
startDateTime: '',
endDateTime: '',
}
getAgentList()
}
/**
* @description 定义表格方法
*/
//
const handleViewPointDiff = (row: any) => {
getPointDiffConfig(row)
dialogVisible.value = true
dialogTitle.value = '查看点差'
dialogType.value = 'view'
dialogFullscreen.value = true
}
//
const handleEdit = async (row: any) => {
console.log('编辑', row);
//
await Promise.all([
getPointDiffConfig(row),
getOptions()
])
agentForm.value = {
username: row.username || '',
parentUsername: row.parentUsername || '',
riskTemplate: row.wallet_capital.risk_control_id || '',
feeTemplate: row.wallet_capital.fee_setting_id || '',
positionRatio: row.wallet_capital.toucun_percent || '',
feeRate: row.feeRate || '',
id: row.id || '',
}
console.log('agentForm.value', agentForm.value)
dialogVisible.value = true
dialogTitle.value = '编辑'
dialogType.value = 'edit'
dialogFullscreen.value = false
}
/**
* @description 定义分页方法
*/
//
const handlePaginationChange = async (page: { currentPage: number, pageSize: number }) => {
currentPage.value = page.currentPage
pageSize.value = page.pageSize
await getAgentList()
}
/**
* @description 定义dialog方法
*/
/**
* @description 提交之前构造数据
*/
// { "1":"42", "2":"38" }
const formatPointDiffToObject = () => {
if (!agentPointTree.value || !agentPointTree.value.length) return {};
//
const pointDiffObj: Record<string, string> = {};
// { : }
agentPointTree.value.forEach((item: { id: string | number; assignedPointDifference: string }) => {
//
pointDiffObj[String(item.id)] = item.assignedPointDifference || '0';
});
return pointDiffObj; //
};
//
const handleSubmit = async () => {
await agentFormRef.value.validate()
const pointDiffObj = formatPointDiffToObject()
console.log('agentForm.value', agentForm.value)
const params = {
user_id: agentForm.value.id || '',
toucun_percent: agentForm.value.positionRatio || '',
point_diffs_json: JSON.stringify(pointDiffObj),
fee_handling_percent: agentForm.value.feeRate || '',
fee_setting_id: agentForm.value.feeTemplate || '',
risk_control_id: agentForm.value.riskTemplate || '',
}
await editPointDiffApi(params)
//
await getAgentList()
dialogVisible.value = false
}
//
const handleCancel = () => {
dialogVisible.value = false
}
//
const handleClose = () => {
dialogVisible.value = false
}
</script>
<style scoped lang="scss"></style>

View File

@ -41,24 +41,36 @@ export const agentTableColumns = [
]
// 定义点差表格列配置
export const agentPointTableColumns = [
// 查看点差表格列配置
export const viewAgentPointTableColumns = [
{ prop: 'varietyName', label: '品种名称', align: 'center' as const },
{ prop: 'varietyCode', label: '品种编号', align: 'center' as const },
{ prop: 'pointDifference', label: '可用点差', align: 'center' as const },
{ prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const },
]
//编辑点差表格列配置
export const agentPointTableColumns = ([
{ prop: 'varietyName', label: '名称', align: 'center' as const },
{ prop: 'varietyCode', label: '编号', align: 'center' as const },
{ prop: 'pointDifference', label: '可分配点差', align: 'center' as const },
{ prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const, slotName: 'assignedPointDiff' },
])
//编辑点差form配置
export const PointDiffFormItem = [
//代理名称
{ prop: 'username', label: '代理名称', type: 'input' as const, placeholder: '代理名称', width: '120px' },
//所属上级
{ prop: 'parentUsername', label: '所属上级', type: 'input' as const, placeholder: '所属上级', width: '120px' },
//手续费
{ prop: 'feeRate', label: '手续费', type: 'input' as const, placeholder: '手续费', width: '120px' },
//风控模板
{ prop: 'riskTemplate', label: '风控模板', type: 'select' as const, placeholder: '风控模板', width: '120px' },
//手续费模板
{ prop: 'feeTemplate', label: '手续费模板', type: 'select' as const, placeholder: '手续费模板', width: '120px' },
//头寸
{ prop: 'positionRatio', label: '头寸', type: 'input' as const, placeholder: '请输入头寸', width: '120px' },
//手续费
{ prop: 'feeRate', label: '手续费', type: 'input' as const, placeholder: '手续费', width: '120px' },
]

View File

@ -0,0 +1,12 @@
import type{ FormRules } from 'element-plus'
export const rules = (): FormRules => {
return {
name: [
{ required: true, message: '请输入名称', trigger: ['blur'] }
],
pointDiff: [
{ required: true, message: '请输入点差', trigger: ['blur'] }
],
}
}

View File

@ -1,341 +0,0 @@
<template>
<div class="agent">
<AgentSearch :search-form="agentSearchForm" :search-options="agentSearchOptions" @search="handleSearch"
@reset="handleReset">
</AgentSearch>
<AgentTable :table-data="agentTree" :columns="agentTableColumnsOptions" row-key="id">
<template #status="{ row }">
<el-switch :model-value="row.status === 1" :active-value="true" :inactive-value="false" active-text="启用"
inactive-text="禁用" />
</template>
<template #pointDifference="{ row }">
<el-button type="primary" size="small" @click="handlePointDifference(row)">
查看
</el-button>
</template>
<template #edit="{ row }">
<el-button type="primary" size="small" @click="handleEdit(row)">
编辑
</el-button>
</template>
</AgentTable>
<AgentPagination v-model="agentSearchForm.page" v-model:page-size-value="agentSearchForm.pageSize"
:total="agentSearchForm.total" @pagination-change="handlePaginationChange" />
<AgentDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" :fullscreen="dialogFullscreen" @submit="handleSubmit"
@cancel="handleCancel" @close="handleClose" :class="{ 'edit-dialog': isEdit }">
<AgentForm :form-data="agentForm" :form-rules="agentFormRules" :form-items="agentFormItems"
:options-map="agentFormOptionsMap" v-if="isEdit" />
<AgentTable :table-data="agentPointTree" :columns="agentPointTableColumnsOptions" row-key="id" />
</AgentDialog>
</div>
</template>
<script lang="ts" setup>
//
import AgentSearch from '@/components/common/Search.vue'
import AgentTable from '@/components/common/Table.vue'
import AgentPagination from '@/components/common/Pagination.vue'
import AgentDialog from '@/components/common/Dialog.vue'
import AgentForm from '@/components/common/Form.vue'
//
import { getAgentListApi, getPointDiffConfigApi, getRiskTemplateOptionsApi, getFeeTemplateOptionsApi,editPointDiffConfigApi } from '@/api/modules/account/agent'
//
import { agentSearch, agentTableColumns, agentPointTableColumns, PointDiffFormItem } from './options'
//
const agentSearchOptions = ref(agentSearch)
const agentSearchForm = ref({
username: '',
status: '正常',
startDateTime: '',
endDateTime: '',
page: 1,
pageSize: 100,
total: 100,
})
//
const agentTree = ref<any[]>([])
const agentTableColumnsOptions = ref(agentTableColumns)
//
const dialogVisible = ref(false)
const dialogTitle = ref('查看点差')
const dialogFullscreen = ref(false)
const dialogType = ref('add')
const agentPointTree = ref<any[]>([])
const agentPointTableColumnsOptions = ref(agentPointTableColumns)
//
const isEdit = ref(false)
const agentFormItems = ref(PointDiffFormItem)
const agentFormRules = ref({
username: [{ required: true, message: '请输入代理名称', trigger: ['blur'] }],
parentUsername: [{ required: true, message: '请输入所属上级', trigger: ['blur'] }],
feeRate: [{ required: true, message: '请输入手续费', trigger: ['blur'] }],
riskTemplate: [{ required: true, message: '请选择风控模板', trigger: ['change'] }],
feeTemplate: [{ required: true, message: '请选择手续费模板', trigger: ['change'] }],
})
const agentForm = ref({
username: '',
parentUsername: '',
feeRate: '',
riskTemplate: '',
feeTemplate: '',
})
const agentFormOptionsMap = ref<any>({
riskTemplate: [],
feeTemplate: [],
})
/**
* @description 统一获取数据
*/
/**
* 处理字符串数值转数字 + 相加 + 保留五位小数
* @param {Array<string>} strNums - 待处理的字符串数值数组 ["0.00000", "0.00000"]
* @returns {number} 相加后保留五位小数的数字最终结果
*/
function sumStrNumsWith5Decimals(strNums: string[]) {
// 1.
let total = 0;
// 2.
strNums.forEach(strNum => {
// /0
const num = parseFloat(strNum) || 0;
total += num;
});
// 3.
const result = parseFloat(total.toFixed(5));
return result;
}
//
const mapObjectToOptions = (obj: Record<string, string>) => {
console.log('obj', obj)
return Object.entries(obj).map(([label, value]) => ({
label, // /
value // /ID
}))
}
//
const fetchAgentList = async () => {
const params = {
page: agentSearchForm.value.page,
page_size: agentSearchForm.value.pageSize,
user_name: agentSearchForm.value.username,
reg_start_time: agentSearchForm.value.startDateTime.length > 0 ? `${agentSearchForm.value.startDateTime} 0:00:00` : '',
reg_end_time: agentSearchForm.value.endDateTime.length > 0 ? `${agentSearchForm.value.endDateTime} 23:59:59` : '',
}
try {
const data = await getAgentListApi(params)
//
agentSearchForm.value.total = data.total || 0
agentSearchForm.value.pageSize = Number(data.per_page) || 0
//
agentTree.value = data.data.map((item: any) => {
//item
const walletNums = [
// undefined
item.wallet_capital?.commission_fee_handling || '0.00000',
item.wallet_capital?.commission_point_diff || '0.00000'
];
//
const rebateTotalAmount = sumStrNumsWith5Decimals(walletNums);
return {
...item,
createTime: item.created_at || '',
feeRate: item.wallet_capital.fee_handling_percent,
rebateRate: item.wallet_capital.commission_fee_handling,
pointDifference: item.wallet_capital.commission_point_diff,
rebateTotalAmount: rebateTotalAmount,
clientCount: item.son_user.length,
level: item.role.title,
parentUsername: item.par_uid === item.parent.id ? item.parent.username : '',
}
})
} catch (err) {
console.error('获取代理列表失败', err)
}
}
//
const fetchAgentPointDiffConfig = async (id: number | string) => {
console.log(id)
const params = {
user_id: id
}
try {
const data = await getPointDiffConfigApi(params)
//
agentPointTree.value = data.map((item: any) => ({
...item,
varietyName: item.name,
varietyCode: item.code,
pointDifference: item.point_diff,
assignedPointDifference: item.target_point_diff
}))
} catch (err) {
console.error('获取代理点差配置失败', err)
}
}
//
const optionsFetched = ref(false)
const getOptions = async () => {
//
if (optionsFetched.value) return
try {
const [riskTemplateRes, feeTemplateRes] = await Promise.all([
getRiskTemplateOptionsApi(), // riskTemplateRes
getFeeTemplateOptionsApi(), // feeTemplateRes
])
console.log('获取表单选项:', riskTemplateRes, feeTemplateRes)
// label=value=ID
agentFormOptionsMap.value.riskTemplate = mapObjectToOptions(feeTemplateRes as Record<string, string>)
agentFormOptionsMap.value.feeTemplate = riskTemplateRes.map((item: any) => ({
label: item.name,
value: item.id
}))
optionsFetched.value = true //
} catch (error) {
console.error('获取表单选项失败:', error)
}
}
/**
* @description 页面加载完成后获取数据
*/
onMounted(() => {
fetchAgentList()
})
/**
* @description 搜索方法
*/
const handleSearch = () => {
fetchAgentList()
}
const handleReset = () => {
//
agentSearchForm.value = {
username: '',
status: '正常',
startDateTime: '',
endDateTime: '',
page: 1,
pageSize: 10,
total: 100,
}
fetchAgentList()
}
const handleDialogType = (type: string) => {
console.log('handleDialogType', type)
if (type === 'edit') {
isEdit.value = true
dialogFullscreen.value = false
} else {
isEdit.value = false
dialogFullscreen.value = true
}
}
/**
* @description 查看点差方法
*/
const handlePointDifference = (row: any) => {
dialogVisible.value = true
dialogTitle.value = '查看点差'
dialogType.value = 'view'
handleDialogType(dialogType.value)
console.log(dialogType.value)
fetchAgentPointDiffConfig(row.id)
}
/**
* @description 编辑方法
*/
const handleEdit = (row: any) => {
dialogVisible.value = true
dialogTitle.value = '编辑点差'
dialogType.value = 'edit'
dialogFullscreen.value = false
handleDialogType(dialogType.value)
console.log(dialogType.value)
getOptions()
// fetchAgentPointDiffConfig(row.id)
}
/**
* @description 分页方法
*/
const handlePaginationChange = (page: { currentPage: number, pageSize: number }) => {
agentSearchForm.value.page = page.currentPage
agentSearchForm.value.pageSize = page.pageSize
handleSearch()
}
/**
* @description dialog方法
*/
const handleSubmit = async () => {
if (dialogType.value === 'edit') {
const params = {
user_id: "",
toucun_percent: "",
point_diffs_json: "",
fee_handling_percent: "",
}
await editPointDiffConfigApi(params)
await fetchAgentList()
dialogVisible.value = false
} else {
}
}
//
const handleCancel = () => {
dialogVisible.value = false
dialogType.value = 'view'
}
//
const handleClose = () => {
dialogVisible.value = false
dialogType.value = 'view'
}
</script>
<style scoped lang="scss">
.agent {
:deep(.el-dialog) {
.el-dialog__footer {
display: none;
}
}
:deep(.edit-dialog) {
.el-dialog__footer {
display: block;
}
}
}
</style>

View File

@ -512,6 +512,7 @@ const handleSubmit = async () => {
fee_handling_percent: marketForm.value.commissionRatio,
point_diffs_json: JSON.stringify(pointDiffObj),
risk_control_id: marketForm.value.riskControlTemplate,
fee_setting_id: '',
}
await addMarketApi(params)
// 5.
@ -525,6 +526,7 @@ const handleSubmit = async () => {
point_diffs_json: JSON.stringify(pointDiffObj),
risk_control_id: marketForm.value.riskControlTemplate,
fee_handling_percent: marketForm.value.commissionRatio,
fee_setting_id: '',
}
// 4.
await editMarketApi(params)

View File

@ -48,11 +48,11 @@ export const marketFormItem = [
//账户名称
{ label: '账户名称', prop: 'accountName', type: 'input' as const, placeholder: '请输入账户名称', },
//级别
{ label: '级别', prop: 'level', type: 'select' as const, placeholder: '请选择级别'},
{ label: '级别', prop: 'level', type: 'select' as const, placeholder: '请选择级别' },
//所属上级
{ label: '所属上级', prop: 'parentAccountName', type: 'select' as const, placeholder: '请选择所属上级账户名称', },
// 风控模板
{ label: '风控模板', prop: 'riskControlTemplate', type: 'select' as const, placeholder: '请选择风控模板'},
// 风控模板
{ label: '风控模板', prop: 'riskControlTemplate', type: 'select' as const, placeholder: '请选择风控模板' },
//头寸
{ label: '头寸', prop: 'positionRatio', type: 'input' as const, placeholder: '请输入头寸', },
//手续费
@ -79,7 +79,7 @@ export const marketPointTableColumns = ([
{ prop: 'varietyName', label: '名称', align: 'center' as const },
{ prop: 'varietyCode', label: '编号', align: 'center' as const },
{ prop: 'pointDifference', label: '可分配点差', align: 'center' as const },
{ prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const, slotName:'assignedPointDiff'},
{ prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const, slotName: 'assignedPointDiff' },
])
// 查看点差表格列配置
@ -87,5 +87,5 @@ export const viewMarketPointTableColumns = ([
{ prop: 'varietyName', label: '名称', align: 'center' as const },
{ prop: 'varietyCode', label: '编号', align: 'center' as const },
{ prop: 'pointDifference', label: '可分配点差', align: 'center' as const },
{ prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const},
{ prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const },
])

View File

@ -135,7 +135,7 @@ export const rules = (marketForm: any, row?: any): FormRules => {
if (row && row.pointDifference !== undefined) {
const maxPointDiff = Number(row.pointDifference)
if (numValue > maxPointDiff) {
return callback(new Error(`不能超过可分配点差(${maxPointDiff})`))
return callback(new Error(`可分配点差(${maxPointDiff})`))
}
}