|
@@ -227,6 +227,9 @@ export default {
|
|
|
{ label: '付费类型', key: 'service_type', filter: 'orderServiceType', span: 3},
|
|
|
{ label: '升级内容', key: 'supServiceIds', span: 3, condition: (product) => product.service_type === 3 },
|
|
|
{ label: '产品规格', key: 'productName', span: 3},
|
|
|
+ { label: '报告份数', key: 'reportNumber', span: 1, condition: (product) => this.reportType.includes(product.product_type)},
|
|
|
+ { label: '剑鱼币个数', key: 'coinCount', span: 1, condition: (product) => product.product_type && product.product_type === '剑鱼币'},
|
|
|
+ { label: '购买产品', key: 'buyProductName', span: 1, condition: (product) => product.product_type && product.product_type === '结构化数据'},
|
|
|
{ label: '服务列表', key: 'bigServiceNamesPro', 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},
|
|
@@ -236,6 +239,7 @@ export default {
|
|
|
{ label: '子账号数量', key: 'subAccountCount', span: 1, condition: (product) => product.filter.buyAccountCount || product.filter.giftAccountCount },
|
|
|
{ label: '主账号数量', key: 'mainAccountCount', span: 1 },
|
|
|
{ label: '关联订单', key: 'linkedOrder', span: 1},
|
|
|
+ { label: '邮箱地址', key: 'email', span: 1, condition: (product) => product.product_type === '数据报告' },
|
|
|
{ label: '赠品数量', key: 'giftCount', span: 1, condition: (product) => {
|
|
|
return product.tactics === '2' && product.filter.num && product.product_type !== '销售费用'
|
|
|
} },
|
|
@@ -338,6 +342,11 @@ export default {
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ reportType() {
|
|
|
+ return ['数据报告', '业主采购分析报告下载包', '企业中标分析报告下载包', '市场分析定制报告下载包', '采购单位画像包', '附件下载包', '投标企业信用报告']
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.beforeInit();
|
|
|
},
|
|
@@ -408,88 +417,98 @@ export default {
|
|
|
product.form = this.initItemForm()
|
|
|
try {
|
|
|
const parsedFilter = this.parseProductFilter(product);
|
|
|
- const serviceIds = parsedFilter.serviceIds || [];
|
|
|
- const supServiceIdsOrigin = parsedFilter.supServiceIds || [];
|
|
|
- const bigServiceNames = parsedFilter.bigServiceNames || '';
|
|
|
- const supServiceIds = this.buildSupServiceIds(parsedFilter || []);
|
|
|
- // 等待异步方法完成
|
|
|
- const bigServiceNamesPro = product.product_type === '大会员' ? await this.buildBigServiceNames(serviceIds, supServiceIdsOrigin, bigServiceNames) : '';
|
|
|
+ const serviceIds = parsedFilter.serviceIds || [];
|
|
|
+ const supServiceIdsOrigin = parsedFilter.supServiceIds || [];
|
|
|
+ const bigServiceNames = product.bigServiceNames || '';
|
|
|
+ // 等待异步方法完成
|
|
|
+ const supServiceIds = this.buildSupServiceIds(parsedFilter || []);
|
|
|
+ const bigServiceNamesPro = product.product_type === '大会员' ? await this.buildBigServiceNames(serviceIds, supServiceIdsOrigin, bigServiceNames) : '';
|
|
|
const rate = this.calculateDiscountRate(product);
|
|
|
const validityPeriod = this.calculateValidityPeriod(
|
|
|
parsedFilter,
|
|
|
product
|
|
|
);
|
|
|
- const supExplanation = parsedFilter.supExplanation
|
|
|
- const dataCount = this.buildDataCount(product, parsedFilter);
|
|
|
+ const supExplanation = parsedFilter.supExplanation
|
|
|
+ const dataCount = this.buildDataCount(product, parsedFilter);
|
|
|
+ const reportNumber = this.buildReportNumber(product, parsedFilter);
|
|
|
+ const coinCount = this.buildCoinCount(product, parsedFilter);
|
|
|
+ const buyProductName = this.buildBuyProductName(product, parsedFilter);
|
|
|
const subAccountCount = this.buildSubAccountCount(product, parsedFilter);
|
|
|
- const mainAccountCount = '1个';
|
|
|
- // const linkedOrder = this.processLinkedOrder(product);
|
|
|
+ const mainAccountCount = '1个';
|
|
|
+ // const linkedOrder = this.processLinkedOrder(product);
|
|
|
const finalPrice = this.formatNumber(product.final_price);
|
|
|
- let originalPrice = this.formatNumber(product.original_price);
|
|
|
- const linkedOrder = product.linkedOrder || {}; // 关联订单信息
|
|
|
- const { buySubject, empowerCount, name, serviceStartTime, serviceEndTime, provinceCount, orderArr } = linkedOrder || {}
|
|
|
-
|
|
|
- const options = [{
|
|
|
- buySubject,
|
|
|
- comboId: 0, // 套餐id
|
|
|
- empowerCount, // 人数
|
|
|
- name,
|
|
|
- phone: this.orderData.personPhone, // 开通权益手机号
|
|
|
- provinceCount, // 订阅省份
|
|
|
- serviceStartTime, // 服务开始时间
|
|
|
- serviceEndTime, // 结束时间
|
|
|
- serviceList: [],
|
|
|
- linkedOrder: orderArr,
|
|
|
- vipExist: false, //当前服务是否在有限期内
|
|
|
-
|
|
|
- }]
|
|
|
- const item = options[0]
|
|
|
- const arr = []
|
|
|
- if (Array.isArray(item.linkedOrder) && item.linkedOrder.length > 0) {
|
|
|
- item.linkedOrder.forEach(t => {
|
|
|
+ let originalPrice = this.formatNumber(product.original_price);
|
|
|
+ const linkedOrder = product.linkedOrder || {}; // 关联订单信息
|
|
|
+ const { buySubject, empowerCount, name, serviceStartTime, serviceEndTime, provinceCount, orderArr } = linkedOrder || {}
|
|
|
+
|
|
|
+ const options = [{
|
|
|
+ buySubject,
|
|
|
+ comboId: 0, // 套餐id
|
|
|
+ empowerCount, // 人数
|
|
|
+ name,
|
|
|
+ phone: this.orderData.personPhone, // 开通权益手机号
|
|
|
+ provinceCount, // 订阅省份
|
|
|
+ serviceStartTime, // 服务开始时间
|
|
|
+ serviceEndTime, // 结束时间
|
|
|
+ serviceList: [],
|
|
|
+ linkedOrder: orderArr,
|
|
|
+ vipExist: false, //当前服务是否在有限期内
|
|
|
+
|
|
|
+ }]
|
|
|
+ const item = options[0]
|
|
|
+ const arr = []
|
|
|
+ if (Array.isArray(item.linkedOrder) && item.linkedOrder.length > 0) {
|
|
|
+ item.linkedOrder.forEach(t => {
|
|
|
+ arr.push({
|
|
|
+ ...item,
|
|
|
+ linkedId: item.linkedId,
|
|
|
+ _linkedId: `${item.linkedId}-${t.order_code}`,
|
|
|
+ linkedOrderSplit: t,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 关联订单只有1个的情况
|
|
|
arr.push({
|
|
|
...item,
|
|
|
- linkedId: item.linkedId,
|
|
|
- _linkedId: `${item.linkedId}-${t.order_code}`,
|
|
|
- linkedOrderSplit: t,
|
|
|
+ _linkedId: item.linkedId + '',
|
|
|
})
|
|
|
- })
|
|
|
- } else {
|
|
|
- // 关联订单只有1个的情况
|
|
|
- arr.push({
|
|
|
- ...item,
|
|
|
- _linkedId: item.linkedId + '',
|
|
|
- })
|
|
|
- }
|
|
|
- const associationOrder = arr.map(t => {
|
|
|
- return {
|
|
|
- ...t,
|
|
|
- ...this.sortTableText(t),
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
- const newProduct = {
|
|
|
- ...product,
|
|
|
- filter: parsedFilter,
|
|
|
- rate,
|
|
|
- validity_period: validityPeriod,
|
|
|
- data_count: dataCount,
|
|
|
- subAccountCount,
|
|
|
- mainAccountCount,
|
|
|
- linkedOrder,
|
|
|
- supServiceIds,
|
|
|
+ const associationOrder = arr.map(t => {
|
|
|
+ return {
|
|
|
+ ...t,
|
|
|
+ ...this.sortTableText(t),
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const productName = product.product_type === '数据报告' ? parsedFilter.report_name : product.productName;
|
|
|
+ const email = product.product_type === '数据报告' ? parsedFilter.email : '';
|
|
|
+
|
|
|
+ const newProduct = {
|
|
|
+ ...product,
|
|
|
+ filter: parsedFilter,
|
|
|
+ rate,
|
|
|
+ productName,
|
|
|
+ reportNumber,
|
|
|
+ coinCount,
|
|
|
+ buyProductName,
|
|
|
+ validity_period: validityPeriod,
|
|
|
+ data_count: dataCount,
|
|
|
+ subAccountCount,
|
|
|
+ mainAccountCount,
|
|
|
+ linkedOrder,
|
|
|
+ supServiceIds,
|
|
|
bigServiceNamesPro,
|
|
|
- final_price: finalPrice,
|
|
|
- sale_final_price: finalPrice,
|
|
|
- original_price: originalPrice,
|
|
|
- supExplanation,
|
|
|
- ..._productArr[index] || {},
|
|
|
- options: associationOrder
|
|
|
- };
|
|
|
+ email,
|
|
|
+ final_price: finalPrice,
|
|
|
+ sale_final_price: finalPrice,
|
|
|
+ original_price: originalPrice,
|
|
|
+ supExplanation,
|
|
|
+ ..._productArr[index] || {},
|
|
|
+ options: associationOrder
|
|
|
+ };
|
|
|
|
|
|
- newProduct._a = showActivityCardRateModule(_productArr, newProduct)
|
|
|
+ newProduct._a = showActivityCardRateModule(_productArr, newProduct)
|
|
|
|
|
|
- return newProduct
|
|
|
+ return newProduct
|
|
|
} catch (error) {
|
|
|
console.error('产品信息初始化失败:', error);
|
|
|
return product;
|
|
@@ -708,6 +727,36 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ buildReportNumber(product, parsedFilter) {
|
|
|
+ const { num } = parsedFilter;
|
|
|
+ const { product_type } = product;
|
|
|
+ const includeProductType = this.reportType
|
|
|
+ if(includeProductType.includes(product_type) && num) {
|
|
|
+ return `${num || 0}份`;
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ buildCoinCount(product, parsedFilter) {
|
|
|
+ const { num } = parsedFilter;
|
|
|
+ const { product_type } = product;
|
|
|
+ const includeProductType = ['剑鱼币']
|
|
|
+ if(includeProductType.includes(product_type) && num) {
|
|
|
+ return `${num || 0}个`;
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ buildBuyProductName(product, parsedFilter) {
|
|
|
+ const { product: buy_product } = parsedFilter;
|
|
|
+ const { product_type } = product;
|
|
|
+ const includeProductType = ['结构化数据']
|
|
|
+ if(includeProductType.includes(product_type) && buy_product) {
|
|
|
+ return buy_product || '-';
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
divided(a, b) {
|
|
|
return div(a, b)
|
|
|
},
|