1
This commit is contained in:
@@ -60,8 +60,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品类型" width="80">
|
<el-table-column label="商品类型" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="(scope.row.owner === 'g' || scope.row.owner === 'G') ? 'success' : 'warning'">
|
<el-tag :type="(scope.row.owner === 'g' || (!scope.row.popId && scope.row.owner !== 'pop')) ? 'success' : 'warning'">
|
||||||
{{ (scope.row.owner === 'g' || scope.row.owner === 'G') ? '自营' : 'POP' }}
|
{{ (scope.row.owner === 'g' || (!scope.row.popId && scope.row.owner !== 'pop')) ? '自营' : 'POP' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -88,14 +88,14 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="佣金比例" width="100">
|
<el-table-column label="佣金比例" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.commissionShare">{{ scope.row.commissionShare }}%</span>
|
<span v-if="scope.row.commissionShare || scope.row.commission">{{ (scope.row.commissionShare || scope.row.commission) }}%</span>
|
||||||
<span v-else style="color: #909399;">-</span>
|
<span v-else style="color: #909399;">-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="佣金金额" width="120">
|
<el-table-column label="佣金金额" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.commission">
|
<span v-if="scope.row.commission">
|
||||||
¥{{ formatPrice(scope.row.commission) }}
|
¥{{ formatCommissionAmount(scope.row.commission, scope.row.price) }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else style="color: #909399;">-</span>
|
<span v-else style="color: #909399;">-</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -126,8 +126,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="类型" width="80">
|
<el-table-column label="类型" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="(scope.row.owner === 'g' || scope.row.owner === 'G') ? 'success' : 'warning'">
|
<el-tag :type="(scope.row.owner === 'g' || (!scope.row.popId && scope.row.owner !== 'pop')) ? 'success' : 'warning'">
|
||||||
{{ (scope.row.owner === 'g' || scope.row.owner === 'G') ? '自营' : 'POP' }}
|
{{ (scope.row.owner === 'g' || (!scope.row.popId && scope.row.owner !== 'pop')) ? '自营' : 'POP' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -413,9 +413,8 @@ export default {
|
|||||||
this.form.selectedProduct = product
|
this.form.selectedProduct = product
|
||||||
this.form.queryResult = product
|
this.form.queryResult = product
|
||||||
this.form.skuName = product.skuName || product.title || product.productName || product.cleanSkuName || ''
|
this.form.skuName = product.skuName || product.title || product.productName || product.cleanSkuName || ''
|
||||||
const ownerValue = product.owner || 'g'
|
const ownerValue = product.owner || (product.popId ? 'pop' : 'g') || 'g'
|
||||||
// owner: 'g'/'G' = 自营, 'p'/'pop' = POP
|
this.form.owner = ownerValue === 'p' ? 'pop' : (ownerValue === 'pop' ? 'pop' : 'g')
|
||||||
this.form.owner = (ownerValue === 'g' || ownerValue === 'G') ? 'g' : 'pop'
|
|
||||||
|
|
||||||
this.$modal.msgSuccess('已选择商品:' + this.form.skuName + '(' + (this.form.owner === 'g' ? '自营' : 'POP') + ')')
|
this.$modal.msgSuccess('已选择商品:' + this.form.skuName + '(' + (this.form.owner === 'g' ? '自营' : 'POP') + ')')
|
||||||
},
|
},
|
||||||
@@ -492,9 +491,8 @@ export default {
|
|||||||
this.form.selectedProduct = selectedProduct
|
this.form.selectedProduct = selectedProduct
|
||||||
this.form.queryResult = selectedProduct
|
this.form.queryResult = selectedProduct
|
||||||
this.form.skuName = selectedProduct.skuName || selectedProduct.title || selectedProduct.productName || selectedProduct.cleanSkuName || ''
|
this.form.skuName = selectedProduct.skuName || selectedProduct.title || selectedProduct.productName || selectedProduct.cleanSkuName || ''
|
||||||
const ownerValue = selectedProduct.owner || 'g'
|
const ownerValue = selectedProduct.owner || (selectedProduct.popId ? 'pop' : 'g') || 'g'
|
||||||
// owner: 'g'/'G' = 自营, 'p'/'pop' = POP
|
this.form.owner = ownerValue === 'p' ? 'pop' : (ownerValue === 'pop' ? 'pop' : 'g')
|
||||||
this.form.owner = (ownerValue === 'g' || ownerValue === 'G') ? 'g' : 'pop'
|
|
||||||
|
|
||||||
// 调用批量创建和替换
|
// 调用批量创建和替换
|
||||||
await this.handleReplace()
|
await this.handleReplace()
|
||||||
@@ -511,10 +509,8 @@ export default {
|
|||||||
return Number(price).toFixed(2)
|
return Number(price).toFixed(2)
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 格式化佣金金额(已废弃:commission字段本身就是佣金金额,不需要计算) */
|
/** 格式化佣金金额 */
|
||||||
formatCommissionAmount(commission, price) {
|
formatCommissionAmount(commission, price) {
|
||||||
// 已废弃:commission 字段已经是佣金金额(如 86.67),不是百分比
|
|
||||||
// 直接使用 formatPrice(scope.row.commission) 即可
|
|
||||||
if (!commission || !price) return '0.00'
|
if (!commission || !price) return '0.00'
|
||||||
// commission可能是百分比字符串或数值
|
// commission可能是百分比字符串或数值
|
||||||
let commissionPercent = 0
|
let commissionPercent = 0
|
||||||
|
|||||||
@@ -253,9 +253,16 @@ export default {
|
|||||||
console.log('isScheduled:', res.data.isScheduled)
|
console.log('isScheduled:', res.data.isScheduled)
|
||||||
console.log('remainingSeconds:', res.data.remainingSeconds)
|
console.log('remainingSeconds:', res.data.remainingSeconds)
|
||||||
console.log('scheduledTime:', res.data.scheduledTime)
|
console.log('scheduledTime:', res.data.scheduledTime)
|
||||||
this.pushStatus = res.data
|
|
||||||
|
// 重要:使用解构赋值,确保 remainingSeconds 被正确赋值
|
||||||
|
this.pushStatus = {
|
||||||
|
...res.data,
|
||||||
|
remainingSeconds: parseInt(res.data.remainingSeconds) || 0
|
||||||
|
}
|
||||||
|
|
||||||
this.updateCountdownDisplay()
|
this.updateCountdownDisplay()
|
||||||
console.log('倒计时显示:', this.countdownDisplay)
|
console.log('倒计时显示:', this.countdownDisplay)
|
||||||
|
console.log('pushStatus.remainingSeconds 已更新为:', this.pushStatus.remainingSeconds)
|
||||||
} else {
|
} else {
|
||||||
console.error('API返回错误:', res)
|
console.error('API返回错误:', res)
|
||||||
}
|
}
|
||||||
@@ -334,6 +341,10 @@ export default {
|
|||||||
|
|
||||||
startCountdown() {
|
startCountdown() {
|
||||||
this.stopCountdown()
|
this.stopCountdown()
|
||||||
|
|
||||||
|
// 立即更新一次显示
|
||||||
|
this.updateCountdownDisplay()
|
||||||
|
|
||||||
this.countdownTimer = setInterval(() => {
|
this.countdownTimer = setInterval(() => {
|
||||||
if (this.pushStatus.remainingSeconds > 0) {
|
if (this.pushStatus.remainingSeconds > 0) {
|
||||||
this.pushStatus.remainingSeconds--
|
this.pushStatus.remainingSeconds--
|
||||||
@@ -382,7 +393,23 @@ export default {
|
|||||||
|
|
||||||
formatDateTime(dateTime) {
|
formatDateTime(dateTime) {
|
||||||
if (!dateTime) return '-'
|
if (!dateTime) return '-'
|
||||||
return this.$moment(dateTime).format('YYYY-MM-DD HH:mm:ss')
|
try {
|
||||||
|
// 处理多种时间格式
|
||||||
|
const date = new Date(dateTime)
|
||||||
|
if (isNaN(date.getTime())) return dateTime
|
||||||
|
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0')
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||||
|
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||||
|
} catch (e) {
|
||||||
|
console.error('格式化时间失败:', e, dateTime)
|
||||||
|
return dateTime
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
formatDuration(ms) {
|
formatDuration(ms) {
|
||||||
|
|||||||
Reference in New Issue
Block a user