更新计费失败状态,新增销售价和产品价未匹配的错误信息,调整相关代码逻辑以支持新的状态处理。
This commit is contained in:
@@ -588,6 +588,55 @@ function renderVirtualText(col, row, rowIndex) {
|
||||
return String(text)
|
||||
}
|
||||
|
||||
/** Flatten slot VNode text for virtual-table overflow tooltip. */
|
||||
function extractSlotText(nodes) {
|
||||
if (nodes == null || nodes === false) return ''
|
||||
if (typeof nodes === 'string' || typeof nodes === 'number') return String(nodes)
|
||||
if (Array.isArray(nodes)) return nodes.map(extractSlotText).join('')
|
||||
if (typeof nodes === 'object') {
|
||||
if (typeof nodes.children === 'string' || typeof nodes.children === 'number') {
|
||||
return String(nodes.children)
|
||||
}
|
||||
if (Array.isArray(nodes.children)) return extractSlotText(nodes.children)
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
/** True when slot tree contains a component (button/tag/...), skip auto tooltip. */
|
||||
function slotHasComponent(nodes) {
|
||||
if (nodes == null || nodes === false) return false
|
||||
if (Array.isArray(nodes)) return nodes.some(slotHasComponent)
|
||||
if (typeof nodes !== 'object') return false
|
||||
if (typeof nodes.type === 'object' || typeof nodes.type === 'function') return true
|
||||
if (Array.isArray(nodes.children)) return slotHasComponent(nodes.children)
|
||||
return false
|
||||
}
|
||||
|
||||
function resolveVirtualTooltip(col, rowData, rowIndex, slotNodes) {
|
||||
if (col.showOverflowTooltip === false) return ''
|
||||
if (typeof col.tooltipFormatter === 'function') {
|
||||
const tip = col.tooltipFormatter(rowData, col, rowData ? rowData[col.prop] : undefined, rowIndex)
|
||||
return tip == null || tip === '' ? '' : String(tip)
|
||||
}
|
||||
if (slotNodes != null) {
|
||||
if (slotHasComponent(slotNodes)) return ''
|
||||
return extractSlotText(slotNodes).trim()
|
||||
}
|
||||
return renderVirtualText(col, rowData, rowIndex)
|
||||
}
|
||||
|
||||
function wrapVirtualTooltip(tip, cell) {
|
||||
if (!tip) return cell
|
||||
return h(ElTooltip, {
|
||||
content: tip,
|
||||
placement: 'top',
|
||||
showAfter: 300,
|
||||
enterable: false
|
||||
}, {
|
||||
default: () => cell
|
||||
})
|
||||
}
|
||||
|
||||
const virtualColumns = computed(() => {
|
||||
const cols = []
|
||||
if (props.selection) {
|
||||
@@ -629,18 +678,13 @@ const virtualColumns = computed(() => {
|
||||
})
|
||||
}
|
||||
if (slotFn) {
|
||||
return h('div', { class: 'basic-table-vcell' }, slotFn({ row: rowData, $index: rowIndex }))
|
||||
const nodes = slotFn({ row: rowData, $index: rowIndex })
|
||||
const cell = h('div', { class: 'basic-table-vcell' }, nodes)
|
||||
return wrapVirtualTooltip(resolveVirtualTooltip(col, rowData, rowIndex, nodes), cell)
|
||||
}
|
||||
const text = renderVirtualText(col, rowData, rowIndex)
|
||||
if (!text) return h('div', { class: 'basic-table-vcell' }, '')
|
||||
return h(ElTooltip, {
|
||||
content: text,
|
||||
placement: 'top',
|
||||
showAfter: 300,
|
||||
enterable: false
|
||||
}, {
|
||||
default: () => h('div', { class: 'basic-table-vcell' }, text)
|
||||
})
|
||||
const cell = h('div', { class: 'basic-table-vcell' }, text || '')
|
||||
return wrapVirtualTooltip(resolveVirtualTooltip(col, rowData, rowIndex), cell)
|
||||
}
|
||||
}
|
||||
if (headerSlot) column.headerCellRenderer = () => headerSlot({ column: col })
|
||||
|
||||
@@ -449,7 +449,7 @@ const columns = [
|
||||
{ label: '销售员', prop: 'belongSaler', minWidth: 100, showOverflowTooltip: true },
|
||||
{ label: '结算员', prop: 'settlementMan', minWidth: 100, showOverflowTooltip: true },
|
||||
{ label: '客服员', prop: 'serviceMan', minWidth: 100, showOverflowTooltip: true },
|
||||
{ label: '操作', prop: 'action', align: 'center', width: 240, fixed: 'right', slot: 'action', showInToolbar: false }
|
||||
{ label: '操作', prop: 'action', align: 'center', width: 240, fixed: 'right', slot: 'action', showInToolbar: false, showOverflowTooltip: false }
|
||||
]
|
||||
|
||||
const arrearsStatusOptions = [
|
||||
@@ -462,9 +462,12 @@ const refundStatusOptions = [
|
||||
]
|
||||
const billingFailStatusOptions = [
|
||||
{ label: '计费成功', value: 0 },
|
||||
{ label: '未匹配产品', value: 1 },
|
||||
{ label: '未匹配国家', value: 2 },
|
||||
{ label: '未匹配重量段', value: 3 },
|
||||
{ label: '销售价未匹配产品', value: 1 },
|
||||
{ label: '销售价未匹配国家', value: 2 },
|
||||
{ label: '销售价未匹配重量段', value: 3 },
|
||||
{ label: '产品价未匹配产品', value: 23 },
|
||||
{ label: '产品价未匹配国家', value: 24 },
|
||||
{ label: '产品价未匹配重量段', value: 25 },
|
||||
]
|
||||
|
||||
const searchColumns = [
|
||||
|
||||
@@ -249,9 +249,12 @@ function orderStatusLabel(code) {
|
||||
function billingFailStatusLabel(code) {
|
||||
const map = {
|
||||
0: '计费成功',
|
||||
1: '未匹配产品',
|
||||
2: '未匹配国家',
|
||||
3: '未匹配重量段'
|
||||
1: '销售价未匹配产品',
|
||||
2: '销售价未匹配国家',
|
||||
3: '销售价未匹配重量段',
|
||||
23: '产品价未匹配产品',
|
||||
24: '产品价未匹配国家',
|
||||
25: '产品价未匹配重量段'
|
||||
}
|
||||
const key = Number(code)
|
||||
return map[key] != null ? map[key] : String(code)
|
||||
|
||||
@@ -338,9 +338,12 @@ function formatDateTime(val) {
|
||||
|
||||
const billingFailStatusOptions = [
|
||||
{ label: '计费成功', value: 0 },
|
||||
{ label: '未匹配产品', value: 1 },
|
||||
{ label: '未匹配国家', value: 2 },
|
||||
{ label: '未匹配重量段', value: 3 },
|
||||
{ label: '销售价未匹配产品', value: 1 },
|
||||
{ label: '销售价未匹配国家', value: 2 },
|
||||
{ label: '销售价未匹配重量段', value: 3 },
|
||||
{ label: '产品价未匹配产品', value: 23 },
|
||||
{ label: '产品价未匹配国家', value: 24 },
|
||||
{ label: '产品价未匹配重量段', value: 25 },
|
||||
{ label: '未绑定套餐', value: 4 },
|
||||
{ label: '无生效套餐版本', value: 5 },
|
||||
{ label: '已生成应收账单', value: 6 },
|
||||
|
||||
@@ -270,9 +270,12 @@ const orderStatusOptions = Object.keys(orderStatusMap).map(k => ({ label: orderS
|
||||
|
||||
const billingFailStatusOptions = [
|
||||
{ label: '计费成功', value: 0 },
|
||||
{ label: '未匹配产品', value: 1 },
|
||||
{ label: '未匹配国家', value: 2 },
|
||||
{ label: '未匹配重量段', value: 3 },
|
||||
{ label: '销售价未匹配产品', value: 1 },
|
||||
{ label: '销售价未匹配国家', value: 2 },
|
||||
{ label: '销售价未匹配重量段', value: 3 },
|
||||
{ label: '产品价未匹配产品', value: 23 },
|
||||
{ label: '产品价未匹配国家', value: 24 },
|
||||
{ label: '产品价未匹配重量段', value: 25 },
|
||||
{ label: '未绑定套餐', value: 4 },
|
||||
{ label: '无生效套餐版本', value: 5 },
|
||||
{ label: '已生成应收账单', value: 6 },
|
||||
|
||||
Reference in New Issue
Block a user