|
|
|
@ -284,21 +284,21 @@ const adjustVisible = ref(false) |
|
|
|
const adjustTime = ref('') |
|
|
|
const adjustCoefficient = ref('') |
|
|
|
|
|
|
|
const matrixMarkets = [ |
|
|
|
{ key: 'sg', label: '新加坡' }, |
|
|
|
{ key: 'my', label: '马来西亚' }, |
|
|
|
{ key: 'hk', label: '香港' }, |
|
|
|
{ key: 'th', label: '泰国' }, |
|
|
|
{ key: 'vn', label: '越南' }, |
|
|
|
{ key: 'ca', label: '加拿大' } |
|
|
|
] |
|
|
|
const matrixMarkets = computed(() => [ |
|
|
|
{ key: 'sg', label: t('cash.markets.Singapore') }, |
|
|
|
{ key: 'my', label: t('cash.markets.Malaysia') }, |
|
|
|
{ key: 'hk', label: t('cash.markets.HongKong') }, |
|
|
|
{ key: 'th', label: t('cash.markets.Thailand') }, |
|
|
|
{ key: 'vn', label: t('clientCount.market.vnGold') }, |
|
|
|
{ key: 'ca', label: t('cash.markets.Canada') } |
|
|
|
]) |
|
|
|
|
|
|
|
const adjustData = ref([]) |
|
|
|
|
|
|
|
const initAdjustData = () => { |
|
|
|
adjustData.value = matrixMarkets.map(rowMarket => { |
|
|
|
const row = { inMarket: rowMarket.label + '客户' } |
|
|
|
matrixMarkets.forEach(colMarket => { |
|
|
|
adjustData.value = matrixMarkets.value.map(rowMarket => { |
|
|
|
const row = { inMarket: rowMarket.label + t('common.customer') } |
|
|
|
matrixMarkets.value.forEach(colMarket => { |
|
|
|
row[colMarket.key] = '' // 默认空 |
|
|
|
}) |
|
|
|
return row |
|
|
|
@ -314,9 +314,9 @@ const handleAdjustment = () => { |
|
|
|
|
|
|
|
const computedAdjustData = computed(() => { |
|
|
|
const data = [...adjustData.value] |
|
|
|
const sumRow = { inMarket: '合计', isSum: true } |
|
|
|
const sumRow = { inMarket: t('cash.cashFlow.total'), isSum: true } |
|
|
|
|
|
|
|
matrixMarkets.forEach(colMarket => { |
|
|
|
matrixMarkets.value.forEach(colMarket => { |
|
|
|
let colSum = 0 |
|
|
|
adjustData.value.forEach(row => { |
|
|
|
const val = parseFloat(row[colMarket.key]) |
|
|
|
@ -331,7 +331,7 @@ const computedAdjustData = computed(() => { |
|
|
|
|
|
|
|
const getRowTotal = (row) => { |
|
|
|
let sum = 0 |
|
|
|
matrixMarkets.forEach(colMarket => { |
|
|
|
matrixMarkets.value.forEach(colMarket => { |
|
|
|
const val = parseFloat(row[colMarket.key]) |
|
|
|
if (!isNaN(val)) sum += val |
|
|
|
}) |
|
|
|
@ -349,18 +349,18 @@ const formatNumber = (val) => { |
|
|
|
|
|
|
|
const submitAdjustment = async () => { |
|
|
|
if (!adjustTime.value) { |
|
|
|
ElMessage.warning('请选择时间') |
|
|
|
ElMessage.warning(t('cash.cashFlow.time')) |
|
|
|
return |
|
|
|
} |
|
|
|
if (!adjustCoefficient.value) { |
|
|
|
ElMessage.warning('请输入系数') |
|
|
|
ElMessage.warning(t('cash.cashFlow.coefficientPlaceholder')) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 组装矩阵数据 matrix (二维数组,6行6列) |
|
|
|
// 如果单元格为空或者非数字,默认为 0 |
|
|
|
const matrix = adjustData.value.map(row => { |
|
|
|
return matrixMarkets.map(colMarket => { |
|
|
|
return matrixMarkets.value.map(colMarket => { |
|
|
|
const val = parseFloat(row[colMarket.key]) |
|
|
|
return isNaN(val) ? 0 : val |
|
|
|
}) |
|
|
|
@ -370,7 +370,7 @@ const submitAdjustment = async () => { |
|
|
|
const payload = { |
|
|
|
matrix: matrix, |
|
|
|
weight: parseFloat(adjustCoefficient.value), // 系数 |
|
|
|
createTime: adjustTime.value, |
|
|
|
time: adjustTime.value, |
|
|
|
submitterId: adminData.value.id || 1000063, // 从全局 adminData 获取 |
|
|
|
submitterMarket: adminData.value.marketName || '总部' // 如果为空默认传总部 |
|
|
|
} |
|
|
|
@ -378,7 +378,7 @@ const submitAdjustment = async () => { |
|
|
|
console.log('提交的封装数据:', JSON.stringify(payload, null, 2)) |
|
|
|
|
|
|
|
await adjustment(payload) |
|
|
|
ElMessage.success('提交成功') |
|
|
|
ElMessage.success(t('common.submitSuccess')) |
|
|
|
adjustVisible.value = false |
|
|
|
fetchData() |
|
|
|
} |
|
|
|
@ -403,31 +403,18 @@ onMounted( async() => { |
|
|
|
<el-input v-model="queryParams.jwcode" :placeholder="t('common.jwcodePlaceholder')" clearable /> |
|
|
|
</div> |
|
|
|
<div class="search-item"> |
|
|
|
<span class="label">{{ t('common.market') }}:</span> |
|
|
|
<span class="label">{{ t('common_list.market') }}:</span> |
|
|
|
<!-- 下拉多选,使用 el-cascader 匹配地区树结构 --> |
|
|
|
<el-cascader |
|
|
|
v-model="queryParams.customerMarket" |
|
|
|
:options="marketOptions" |
|
|
|
:props="{ multiple: true, emitPath: false }" |
|
|
|
collapse-tags |
|
|
|
collapse-tags-tooltip |
|
|
|
:placeholder="t('common.marketPlaceholder')" |
|
|
|
clearable |
|
|
|
style="width: 8vw;" |
|
|
|
/> |
|
|
|
<el-cascader v-model="queryParams.customerMarket" :options="marketOptions" |
|
|
|
:props="{ multiple: true, emitPath: false }" collapse-tags collapse-tags-tooltip |
|
|
|
:placeholder="t('common_list.marketPlaceholder')" clearable style="width: 8vw;" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="search-item" style="width: auto;"> |
|
|
|
<span class="label">{{ t('common.payTime2') }}:</span> |
|
|
|
<el-date-picker |
|
|
|
v-model="queryParams.timeRange" |
|
|
|
type="datetimerange" |
|
|
|
:range-separator="t('common.to')" |
|
|
|
:start-placeholder="t('common.startTime')" |
|
|
|
:end-placeholder="t('common.endTime')" |
|
|
|
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" |
|
|
|
style="width: 18vw;" |
|
|
|
/> |
|
|
|
<el-date-picker v-model="queryParams.timeRange" type="datetimerange" :range-separator="t('common.to')" |
|
|
|
:start-placeholder="t('common.startTime')" :end-placeholder="t('common.endTime')" |
|
|
|
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" style="width: 18vw;" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -436,53 +423,46 @@ onMounted( async() => { |
|
|
|
<el-button type="primary" @click="handleExport">{{ t('common.exportExcel') }}</el-button> |
|
|
|
<el-button type="primary" @click="openExportList">{{ t('common.viewExportList') }}</el-button> |
|
|
|
<el-button type="success" @click="handleReset">{{ t('common.reset') }}</el-button> |
|
|
|
<button v-if="hasperformanceAdjustment" class="adjust-btn" @click="handleAdjustment">业绩调整</button> |
|
|
|
<button v-if="hasperformanceAdjustment" class="adjust-btn" @click="handleAdjustment">{{ |
|
|
|
t('cash.cashFlow.performanceAdjustment') }}</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<!-- 表格区域 --> |
|
|
|
<el-card class="table-card"> |
|
|
|
<el-table ref="tableRef" :data="tableData" v-loading="loading" style="width: 100%; flex: 1;" :cell-style="{ textAlign: 'center' }" :header-cell-style="{ background: '#F3FAFE', color: '#333',textAlign: 'center' }"> |
|
|
|
<el-table ref="tableRef" :data="tableData" v-loading="loading" style="width: 100%; flex: 1;" |
|
|
|
:cell-style="{ textAlign: 'center' }" |
|
|
|
:header-cell-style="{ background: '#F3FAFE', color: '#333', textAlign: 'center' }"> |
|
|
|
<el-table-column type="index" :label="t('common_list.id')" min-width="60" align="center" fixed="left"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ scope.$index + 1 + (queryParams.pageNum - 1) * queryParams.pageSize }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="jwcode" :label="t('common_list.jwcode')" min-width="120" fixed="left" /> |
|
|
|
<el-table-column prop="payTime" :label="t('cash.cashFlow.payTime')" min-width="180" /> |
|
|
|
<el-table-column prop="orderCode" :label="t('cash.cashFlow.orderCode')" min-width="350" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="receivedMarketName" :label="t('cash.cashFlow.receivedMarketName')" min-width="120" |
|
|
|
show-overflow-tooltip /> |
|
|
|
<el-table-column prop="performanceMarketName" :label="t('cash.cashFlow.performanceMarket')" min-width="120" |
|
|
|
show-overflow-tooltip /> |
|
|
|
<el-table-column prop="name" :label="t('common_list.name')" min-width="150" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="marketName" :label="t('common_list.market')" min-width="120" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="orderCode" :label="t('common_list.orderCode')" min-width="280" show-overflow-tooltip /> |
|
|
|
|
|
|
|
<el-table-column prop="paymentAmount" :label="t('common_list.payAmount')" min-width="150" align="right"> |
|
|
|
<!-- <template #default="{ row }"> |
|
|
|
{{ row.paymentAmount }} {{ row.paymentCurrency }} |
|
|
|
</template> --> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="paymentCurrency" :label="t('common_list.payCurrency')" min-width="180" show-overflow-tooltip /> |
|
|
|
|
|
|
|
<el-table-column prop="receivedAmount" :label="t('common_list.receiveAmount')" min-width="150" align="right"> |
|
|
|
<!-- <template #default="{ row }"> |
|
|
|
{{ row.receivedAmount }} {{ row.receivedCurrency }} |
|
|
|
</template> --> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="receivedCurrency" :label="t('common_list.receiveCurrency')" min-width="180" show-overflow-tooltip /> |
|
|
|
|
|
|
|
<el-table-column prop="handlingCharge" :label="t('common_list.fee')" min-width="100" align="right" /> |
|
|
|
<el-table-column prop="jwcode" :label="t('common_list.jwcode')" min-width="120" /> |
|
|
|
<el-table-column prop="goodsName" :label="t('cash.cashFlow.goodsName')" min-width="120" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="remark" :label="t('common_list.remark')" min-width="120" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="goodNum" :label="t('cash.cashFlow.goodNum')" min-width="120" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="payType" :label="t('cash.cashFlow.payType')" min-width="120" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="receivedCurrency" :label="t('common_list.receiveCurrency')" min-width="180" |
|
|
|
show-overflow-tooltip /> |
|
|
|
<el-table-column prop="paymentAmount" :label="t('common_list.payAmount')" min-width="150" /> |
|
|
|
<el-table-column prop="handlingCharge" :label="t('common_list.fee')" min-width="100" /> |
|
|
|
<el-table-column prop="receivedAmount" :label="t('common_list.receiveAmount')" min-width="150" /> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<!-- 分页 --> |
|
|
|
<div class="pagination-container"> |
|
|
|
<el-pagination |
|
|
|
background |
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
:total="total" |
|
|
|
:current-page="queryParams.pageNum" |
|
|
|
:page-size="queryParams.pageSize" |
|
|
|
:page-sizes="[10, 20, 50, 100]" |
|
|
|
@size-change="handlePageSizeChange" |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
/> |
|
|
|
<el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total" |
|
|
|
:current-page="queryParams.pageNum" :page-size="queryParams.pageSize" :page-sizes="[10, 20, 50, 100]" |
|
|
|
@size-change="handlePageSizeChange" @current-change="handleCurrentChange" /> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
@ -519,32 +499,32 @@ onMounted( async() => { |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 业绩调整弹窗 --> |
|
|
|
<el-dialog v-model="adjustVisible" title="市场消耗金币业绩调整" width="80%" top="5vh" align-center class="custom-adjust-dialog"> |
|
|
|
<el-dialog v-model="adjustVisible" :title="t('cash.cashFlow.marketConsumption')" width="80%" top="5vh" align-center |
|
|
|
class="custom-adjust-dialog"> |
|
|
|
<template #header="{ titleId, titleClass }"> |
|
|
|
<div style="text-align: center; font-weight: bold; font-size: 18px;" :id="titleId" :class="titleClass">市场消耗金币业绩调整</div> |
|
|
|
<div style="text-align: center; font-weight: bold; font-size: 18px;" :id="titleId" :class="titleClass">{{ |
|
|
|
t('cash.cashFlow.marketConsumption') }}</div> |
|
|
|
</template> |
|
|
|
<div style="display: flex; gap: 40px; margin-bottom: 20px; align-items: center;"> |
|
|
|
<div style="display: flex; align-items: center;"> |
|
|
|
<span style="margin-right: 10px; font-weight: bold;">选择时间</span> |
|
|
|
<el-date-picker |
|
|
|
v-model="adjustTime" |
|
|
|
type="datetime" |
|
|
|
placeholder="选择时间" |
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
/> |
|
|
|
<span style="margin-right: 10px; font-weight: bold;">{{ t('cash.cashFlow.time') }}</span> |
|
|
|
<el-date-picker v-model="adjustTime" type="datetime" :placeholder="t('cash.cashFlow.time')" |
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" /> |
|
|
|
</div> |
|
|
|
<div style="display: flex; align-items: center;"> |
|
|
|
<span style="margin-right: 10px; font-weight: bold;">系数调整</span> |
|
|
|
<el-input v-model="adjustCoefficient" placeholder="请输入系数调整" style="width: 200px;" @input="adjustCoefficient = formatNumber(adjustCoefficient)" /> |
|
|
|
<span style="margin-right: 10px; font-weight: bold;">{{ t('cash.cashFlow.coefficient') }}</span> |
|
|
|
<el-input v-model="adjustCoefficient" :placeholder="t('cash.cashFlow.coefficientPlaceholder')" |
|
|
|
style="width: 200px;" @input="adjustCoefficient = formatNumber(adjustCoefficient)" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table :data="computedAdjustData" border style="width: 100%" :cell-style="{ textAlign: 'center' }" :header-cell-style="{ background: '#F3FAFE', color: '#333', textAlign: 'center', padding: '0' }"> |
|
|
|
<el-table :data="computedAdjustData" border style="width: 100%" :cell-style="{ textAlign: 'center' }" |
|
|
|
:header-cell-style="{ background: '#F3FAFE', color: '#333', textAlign: 'center', padding: '0' }"> |
|
|
|
<el-table-column width="150" align="center" fixed="left"> |
|
|
|
<template #header> |
|
|
|
<div class="diagonal-header"> |
|
|
|
<span class="top-right">调入</span> |
|
|
|
<span class="bottom-left">调出</span> |
|
|
|
<span class="top-right">{{ t('cash.cashFlow.adjustment') }}</span> |
|
|
|
<span class="bottom-left">{{ t('cash.cashFlow.adjustmentOut') }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #default="{ row }"> |
|
|
|
@ -552,14 +532,16 @@ onMounted( async() => { |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-for="col in matrixMarkets" :key="col.key" :label="col.label + '市场团队'" min-width="120" align="center"> |
|
|
|
<el-table-column v-for="col in matrixMarkets" :key="col.key" :label="col.label + ' ' + t('cash.cashFlow.marketTeam')" |
|
|
|
min-width="120" align="center"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<span v-if="row.isSum">{{ row[col.key] }}</span> |
|
|
|
<el-input v-else v-model="row[col.key]" @input="row[col.key] = formatNumber($event)" placeholder="" class="seamless-input" /> |
|
|
|
<el-input v-else v-model="row[col.key]" @input="row[col.key] = formatNumber($event)" placeholder="" |
|
|
|
class="seamless-input" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="合计" min-width="120" align="center" fixed="right"> |
|
|
|
<el-table-column :label="t('cash.cashFlow.total')" min-width="120" align="center" fixed="right"> |
|
|
|
<template #default="{ row }"> |
|
|
|
{{ getRowTotal(row) }} |
|
|
|
</template> |
|
|
|
@ -568,8 +550,8 @@ onMounted( async() => { |
|
|
|
|
|
|
|
<template #footer> |
|
|
|
<div class="dialog-footer" style="text-align: center;"> |
|
|
|
<el-button type="primary" plain @click="adjustVisible = false" style="width: 100px;">取消</el-button> |
|
|
|
<el-button type="primary" @click="submitAdjustment" style="width: 100px;">提交</el-button> |
|
|
|
<el-button type="primary" plain @click="adjustVisible = false" style="width: 100px;">{{ t('common.cancel') }}</el-button> |
|
|
|
<el-button type="primary" @click="submitAdjustment" style="width: 100px;">{{ t('common.submit') }}</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
@ -619,7 +601,8 @@ onMounted( async() => { |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
|
|
|
|
.el-input, .el-select { |
|
|
|
.el-input, |
|
|
|
.el-select { |
|
|
|
width: 8vw; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -677,15 +660,18 @@ onMounted( async() => { |
|
|
|
.diagonal-header { |
|
|
|
position: relative; |
|
|
|
width: 100%; |
|
|
|
height: 50px; /* Set a fixed height to make diagonal line work well */ |
|
|
|
height: 50px; |
|
|
|
/* Set a fixed height to make diagonal line work well */ |
|
|
|
background: linear-gradient(to top right, transparent 49.5%, #dcdfe6 49.5%, #dcdfe6 50.5%, transparent 50.5%); |
|
|
|
} |
|
|
|
|
|
|
|
.diagonal-header .top-right { |
|
|
|
position: absolute; |
|
|
|
top: 5px; |
|
|
|
right: 15px; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
|
|
|
|
.diagonal-header .bottom-left { |
|
|
|
position: absolute; |
|
|
|
bottom: 5px; |
|
|
|
@ -695,7 +681,8 @@ onMounted( async() => { |
|
|
|
|
|
|
|
/* 业绩调整弹窗全局样式 */ |
|
|
|
:deep(.custom-adjust-dialog) { |
|
|
|
background-color: #f3fafe !important; /* 统一淡蓝色背景 */ |
|
|
|
background-color: #f3fafe !important; |
|
|
|
/* 统一淡蓝色背景 */ |
|
|
|
border-radius: 8px; |
|
|
|
} |
|
|
|
|
|
|
|
@ -715,11 +702,13 @@ onMounted( async() => { |
|
|
|
background-color: transparent !important; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.seamless-input :deep(.el-input__inner) { |
|
|
|
text-align: center; |
|
|
|
font-size: 14px; |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.seamless-input :deep(.el-input__inner:focus) { |
|
|
|
outline: none; |
|
|
|
} |
|
|
|
|