|
@@ -14,24 +14,50 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="order-detail-product-list">
|
|
|
- <ProductCard v-for="(product, index) in productData" :key="product.id" :title="setProductTitle(product, index)" :subtitle="product.auto !== 1 ? '该产品暂不支持系统自动开通权限,请联系运维开通': ''">
|
|
|
+ <ProductCard
|
|
|
+ v-for="(product, index) in productData"
|
|
|
+ :key="product.id"
|
|
|
+ :title="setProductTitle(product, index)"
|
|
|
+ :subtitle="product.auto !== 1 ? '该产品暂不支持系统自动开通权限,请联系运维开通': ''"
|
|
|
+ >
|
|
|
<div class="order-detail-product-content">
|
|
|
<div class="grouped-items">
|
|
|
- <div class="order-detail-card-item" :class="`item-span-${item.span}`" v-for="(item, index) in productInfoItems" :key="index">
|
|
|
- <div v-if="item.key === 'linkedOrder'" class="linkedOrder">
|
|
|
- {{ item.label }}:
|
|
|
- <TableCard :columns="linkOrderColumns"></TableCard>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in productInfoItems"
|
|
|
+ :key="index"
|
|
|
+ :class="`item-span-${item.span}`" >
|
|
|
+ <div
|
|
|
+ class="order-detail-card-item"
|
|
|
+ v-if="shouldRenderItem(item, product)"
|
|
|
+ >
|
|
|
+ <div v-if="item.key === 'linkedOrder'" class="linkedOrder">
|
|
|
+ {{ item.label }}:
|
|
|
+ <TableCard :table-data="product[item.key]" :columns="linkOrderColumns"></TableCard>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.key === 'final_price' || item.key === 'original_price'">
|
|
|
+ {{ item.label }}:¥{{ getFilteredValue(product[item.key], item.filter) || '-' }}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.key === 'validity_period'">
|
|
|
+ <span v-html="getValidityPeriodHtml(product, item)"></span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.key === 'supServicelds'">
|
|
|
+ {{ item.label }}:{{ getFilteredValue(product[item.key], item.filter) || '-' }}
|
|
|
+ </div>
|
|
|
+ <div v-else>{{ item.label }}:{{ getFilteredValue(product[item.key], item.filter) || '-' }}</div>
|
|
|
</div>
|
|
|
- <div v-else-if="item.key === 'validity_period'">
|
|
|
- <span v-html="getValidityPeriodHtml(product, item)"></span>
|
|
|
- </div>
|
|
|
- <div v-else>{{ item.label }}:{{ getFilteredValue(product[item.key], item.filter) || '-' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</ProductCard>
|
|
|
</div>
|
|
|
</InfoCard>
|
|
|
+ <InfoCard title="其他信息">
|
|
|
+ <div class="order-detail-card-content">
|
|
|
+ <div class="order-detail-card-item" v-for="(item, index) in otherInfoItems" :key="index">
|
|
|
+ {{ item.label }}:{{ getFilteredValue(orderData[item.key], item.filter) || '-' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </InfoCard>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -64,10 +90,16 @@ export default {
|
|
|
{ label: '订单审核状态', key: 'audit_status', filter: 'orderCoursed' },
|
|
|
{ label: '订单状态', key: 'order_status', filter: 'orderStatus' }
|
|
|
],
|
|
|
+ otherInfoItems: [
|
|
|
+ { label: '约定支付方式', key: 'pay_way' },
|
|
|
+ { label: '下单渠道', key: 'order_channel_new' },
|
|
|
+ { label: '付款户名', key: 'payment_user'},
|
|
|
+ { label: '订单备注', key: 'remark' },
|
|
|
+ ],
|
|
|
productInfoTotalItems: [
|
|
|
- { label: '合同金额合计', key: 'product_name' },
|
|
|
- { label: '标准售价合计', key: 'product_type'},
|
|
|
- { label: '折扣率', key: 'product_price' },
|
|
|
+ { label: '合同金额合计', key: 'final_price_total' },
|
|
|
+ { label: '标准售价合计', key: 'original_price_total'},
|
|
|
+ { label: '折扣率', key: 'rate_total' },
|
|
|
{ label: '渠道佣金', key: 'product_type'},
|
|
|
{ label: '净合同金额合计', key: 'product_type'},
|
|
|
{ label: '0元订单类型', key: 'product_type'}
|
|
@@ -75,15 +107,15 @@ export default {
|
|
|
productInfoItems: [
|
|
|
{ label: '活动产品', key: 'activity_code', span: 1 },
|
|
|
{ label: '付费类型', key: 'service_type', filter: 'orderServiceType', span: 3},
|
|
|
- { label: '升级内容', key: 'supServicelds', span: 3 },
|
|
|
+ { label: '升级内容', key: 'supServicelds', span: 3, condition: (product) => product.product_type === '大会员' },
|
|
|
{ label: '产品规格', key: 'productName', span: 3},
|
|
|
{ label: '服务列表', key: 'bigServiceNames', span: 1},
|
|
|
{ label: '有效周期', key: 'validity_period', span: 1},
|
|
|
{ label: '合同金额', key: 'final_price', span: 3},
|
|
|
{ label: '标准售价', key: 'original_price', span: 3},
|
|
|
{ label: '折扣率', key: 'rate', span: 3},
|
|
|
- { label: '子账号数量', key: 'product_type', span: 1},
|
|
|
- { label: '主账号数量', key: 'product_type', span: 1},
|
|
|
+ { label: '子账号数量', key: 'subAccountCount', span: 1, condition: (product) => product.product_type === 'VIP订阅' },
|
|
|
+ { label: '主账号数量', key: 'mainAccountCount', span: 1, condition: (product) => product.product_type === 'VIP订阅' },
|
|
|
{ label: '关联订单', key: 'linkedOrder', span: 1},
|
|
|
{ label: '开通权益手机号', key: 'phone', span: 3},
|
|
|
{ label: '服务开始时间', key: 'service_starttime', span: 3},
|
|
@@ -150,9 +182,15 @@ export default {
|
|
|
parsedFilter.give_cycle,
|
|
|
parsedFilter.give_type
|
|
|
);
|
|
|
+ // 设置子账号数量
|
|
|
+ if (product.product_type === 'VIP订阅') {
|
|
|
+ const countTotal = Number(product.buyAccountCount) + Number(product.giftAccountCount) || 0
|
|
|
+ product.subAccountCount = `付费${product.buyAccountCount || 0}个,赠送${product.giftAccountCount || 0}个,合计:${countTotal}个`
|
|
|
+ product.mainAccountCount = '1个';
|
|
|
+ }
|
|
|
// 设置合同金额和标准售价
|
|
|
- product.final_price = '¥' + (product.final_price / 100).toFixed(2)
|
|
|
- product.original_price = '¥' + (product.original_price / 100).toFixed(2)
|
|
|
+ product.final_price = (product.final_price / 100).toFixed(2)
|
|
|
+ product.original_price = (product.original_price / 100).toFixed(2)
|
|
|
return Object.assign(product, { filter: parsedFilter, rate});
|
|
|
} catch (error) {
|
|
|
console.error('JSON 解析失败:', error);
|
|
@@ -160,8 +198,25 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ // 设置合同金额合计和标准售价合计
|
|
|
+ const totalFinalPrice = (this.productData.reduce((acc, cur) => acc + Number(cur.final_price), 0)).toFixed(2)
|
|
|
+ const totalOriginalPrice = (this.productData.reduce((acc, cur) => acc + Number(cur.original_price), 0)).toFixed(2)
|
|
|
+ this.orderData.final_price_total = '¥' + totalFinalPrice
|
|
|
+ this.orderData.original_price_total = '¥' + totalOriginalPrice
|
|
|
+ this.orderData.rate_total = (div(totalFinalPrice, totalOriginalPrice) * 100).toFixed(2) + '%'
|
|
|
this.productData = this.orderDetail?.productData || []
|
|
|
},
|
|
|
+ shouldRenderItem(item, product) {
|
|
|
+ if (item.condition && typeof item.condition === 'function') {
|
|
|
+ const conditionResult = item.condition(product)
|
|
|
+ console.log(conditionResult, 'conditionResult')
|
|
|
+ if(!conditionResult) {
|
|
|
+ // item.span = 0
|
|
|
+ }
|
|
|
+ return conditionResult
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
calculateValidityPeriod(buyCycle, buyType, giveCycle, giveType) {
|
|
|
let totalMonths = 0;
|
|
|
let buyText = '';
|
|
@@ -239,7 +294,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
orderServiceType(val) {
|
|
|
- console.log(val, 'orderServiceType val')
|
|
|
const matchedOption = paymentTypeOptions.find(option => option.value === val);
|
|
|
return matchedOption ? matchedOption.label : val; // 如果未找到匹配项,返回原始值
|
|
|
},
|