|
@@ -39,7 +39,7 @@
|
|
|
<span class="red-chong" v-if="setRedPunchDisplay('折扣率')">(红冲过)</span>
|
|
|
</div>
|
|
|
<div v-else-if="item.key === 'final_price'">
|
|
|
- {{ item.label }}:¥{{ getFilteredValue(product[item.key], item.filter) || '-' }}
|
|
|
+ {{ item.label }}:¥{{ getFilteredValue(product[item.key], item.filter) }}
|
|
|
<span class="red-chong" v-if="setRedPunchDisplay('合同金额')">(红冲过)</span>
|
|
|
</div>
|
|
|
<div v-else-if="item.key === 'original_price'">
|
|
@@ -122,6 +122,7 @@ export default {
|
|
|
{ label: '升级内容', key: 'supServicelds', span: 3, condition: (product) => product.supServicelds },
|
|
|
{ label: '产品规格', key: 'productName', span: 3},
|
|
|
{ label: '服务列表', key: 'bigServiceNames', span: 1, condition: (product) => product.productName && product.productName.includes('自定义') && product.product_code === 'dyh001'},
|
|
|
+ { label: '数据条数', key: 'data_count', span: 1, condition: (product) => product.data_count && product.data_count !== '-'},
|
|
|
{ label: '有效周期', key: 'validity_period', span: 1},
|
|
|
{ label: '合同金额', key: 'final_price', span: 3},
|
|
|
{ label: '标准售价', key: 'original_price', span: 3},
|
|
@@ -129,6 +130,7 @@ export default {
|
|
|
{ label: '子账号数量', key: 'subAccountCount', span: 1, condition: () => this.parsedFilter.buyAccountCount && this.parsedFilter.giftAccountCount },
|
|
|
{ label: '主账号数量', key: 'mainAccountCount', span: 1 },
|
|
|
{ label: '关联订单', key: 'linkedOrder', span: 1},
|
|
|
+ { label: '补充说明', key: 'supExplanation', span: 1, condition: (product) => product.supExplanation && product.supExplanation !== '-' },
|
|
|
{ label: '开通权益手机号', key: 'phone', span: 3},
|
|
|
{ label: '服务开始时间', key: 'service_starttime', span: 3},
|
|
|
{ label: '服务结束时间', key: 'service_endtime', span: 3}
|
|
@@ -222,12 +224,11 @@ export default {
|
|
|
const bigServiceNames = product.product_type === '大会员' ? await this.buildBigServiceNames(serviceIds) : '';
|
|
|
const rate = this.calculateDiscountRate(product);
|
|
|
const validityPeriod = this.calculateValidityPeriod(
|
|
|
- parsedFilter.buy_cycle,
|
|
|
- parsedFilter.buy_type,
|
|
|
- parsedFilter.give_cycle,
|
|
|
- parsedFilter.give_type,
|
|
|
+ parsedFilter,
|
|
|
product
|
|
|
);
|
|
|
+ const supExplanation = parsedFilter.supExplanation
|
|
|
+ const dataCount = this.buildDataCount(product, parsedFilter);
|
|
|
const subAccountCount = this.buildSubAccountCount(product, parsedFilter);
|
|
|
const mainAccountCount = '1个';
|
|
|
const linkedOrder = this.processLinkedOrder(product);
|
|
@@ -240,12 +241,14 @@ export default {
|
|
|
filter: parsedFilter,
|
|
|
rate,
|
|
|
validity_period: validityPeriod,
|
|
|
+ data_count: dataCount,
|
|
|
subAccountCount,
|
|
|
mainAccountCount,
|
|
|
linkedOrder,
|
|
|
bigServiceNames,
|
|
|
final_price: finalPrice,
|
|
|
original_price: originalPrice,
|
|
|
+ supExplanation,
|
|
|
..._productArr[index] || {},
|
|
|
};
|
|
|
|
|
@@ -391,8 +394,25 @@ export default {
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
+ buildDataCount(product, parsedFilter) {
|
|
|
+ const { pNum, give_cycle } = parsedFilter;
|
|
|
+ const totalNums = Number(pNum) + (Number(give_cycle) || 0);
|
|
|
+ const { product_type } = product;
|
|
|
+ const includeProductType = ['数据流量包', '历史数据', '结构化数据']
|
|
|
+ if(includeProductType.includes(product_type)) {
|
|
|
+ return `${totalNums}条`;
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
|
|
|
- calculateValidityPeriod(buyCycle, buyType, giveCycle, giveType, product) {
|
|
|
+ },
|
|
|
+ calculateValidityPeriod(parsedFilter, product) {
|
|
|
+ const { buy_cycle, buy_type, give_cycle, give_type, validYear } = parsedFilter
|
|
|
+ const { product_type, returned_open } = product
|
|
|
+ const returned_opens = returned_open === 1 ? '(全额回款当日开通)' : '';
|
|
|
+ if(product_type === '数据流量包') {
|
|
|
+ return `${validYear}年${returned_opens}`;
|
|
|
+ }
|
|
|
let totalMonths = 0;
|
|
|
let buyText = '';
|
|
|
let giveText = '';
|
|
@@ -431,14 +451,13 @@ export default {
|
|
|
|
|
|
return { months, text };
|
|
|
};
|
|
|
- const buyResult = processCycle(buyCycle, buyType);
|
|
|
- const giveResult = processCycle(giveCycle, giveType);
|
|
|
+ const buyResult = processCycle(buy_cycle, buy_type);
|
|
|
+ const giveResult = processCycle(give_cycle, give_type);
|
|
|
totalMonths = buyResult.months + giveResult.months;
|
|
|
buyText = buyResult.text;
|
|
|
giveText = giveResult.text;
|
|
|
- const returned_open = product.returned_open === '1' ? '(全额回款当日开通)' : '';
|
|
|
if(totalMonths === 0) return '-'
|
|
|
- return `付费${buyText},赠送${giveText},合计<span class="color_main">${totalMonths.toFixed(0)}</span>个月${returned_open}`;
|
|
|
+ return `付费${buyText},赠送${giveText},合计<span class="color_main">${totalMonths.toFixed(0)}</span>个月${returned_opens}`;
|
|
|
},
|
|
|
|
|
|
getValidityPeriodHtml(product, item) {
|
|
@@ -449,6 +468,11 @@ export default {
|
|
|
|
|
|
// 替代过滤器的通用方法
|
|
|
getFilteredValue(value, filterName) {
|
|
|
+ console.log('getFilteredValue', value, filterName)
|
|
|
+ // 判断value是否是数字,或者是字符串数字
|
|
|
+ if (typeof value === 'number' || /^\d+$/.test(value)) {
|
|
|
+ if(!value) return '0.00'
|
|
|
+ }
|
|
|
if (!filterName) return value || '-';
|
|
|
return this[filterName](value);
|
|
|
},
|