|
@@ -23,7 +23,7 @@
|
|
>
|
|
>
|
|
<div v-if="item.key === 'linkedOrder'" class="linkedOrder">
|
|
<div v-if="item.key === 'linkedOrder'" class="linkedOrder">
|
|
{{ item.label }}:
|
|
{{ item.label }}:
|
|
- <RelatedOrderTable v-if="product[item.key].length" :table-data="associationTableData">
|
|
|
|
|
|
+ <RelatedOrderTable v-if="product.linkedOrder && Object.keys(product.linkedOrder).length" :table-data="product.options">
|
|
</RelatedOrderTable>
|
|
</RelatedOrderTable>
|
|
<span v-else>-</span>
|
|
<span v-else>-</span>
|
|
</div>
|
|
</div>
|
|
@@ -68,7 +68,7 @@
|
|
{{ item.label }}:{{ product.filter.num || '-' }}个
|
|
{{ item.label }}:{{ product.filter.num || '-' }}个
|
|
</div>
|
|
</div>
|
|
<div v-else-if="item.key === 'sale_final_price'">
|
|
<div v-else-if="item.key === 'sale_final_price'">
|
|
- {{ item.label }}:¥{{ getFilteredValue(product[item.key], item.filter)}}
|
|
|
|
|
|
+ {{ item.label }}:¥{{ product.filter.num }}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div v-else>{{ item.label }}:{{ getFilteredValue(product[item.key], item.filter) || '-' }}</div>
|
|
<div v-else>{{ item.label }}:{{ getFilteredValue(product[item.key], item.filter) || '-' }}</div>
|
|
@@ -194,18 +194,14 @@ export default {
|
|
{
|
|
{
|
|
prop:'service_type',
|
|
prop:'service_type',
|
|
label: '付费类型',
|
|
label: '付费类型',
|
|
- width: 80,
|
|
|
|
- render (row) {
|
|
|
|
- return paymentTypeOptions.find(item => item.value === row.service_type)?.label || '-'
|
|
|
|
- }
|
|
|
|
|
|
+ width: 80
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop:'create_time',
|
|
prop:'create_time',
|
|
label: '创建时间',
|
|
label: '创建时间',
|
|
width: 102
|
|
width: 102
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- parsedFilter: {}
|
|
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -220,35 +216,7 @@ export default {
|
|
computed: {
|
|
computed: {
|
|
...mapState({
|
|
...mapState({
|
|
orderDetail: state => state.order.orderDetail
|
|
orderDetail: state => state.order.orderDetail
|
|
- }),
|
|
|
|
- // 对options展开
|
|
|
|
- associationTableData() {
|
|
|
|
- const arr = []
|
|
|
|
- this.productData.forEach(item => {
|
|
|
|
- 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 + '',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- return arr.map(t => {
|
|
|
|
- return {
|
|
|
|
- ...t,
|
|
|
|
- ...this.sortTableText(t),
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.beforeInit();
|
|
this.beforeInit();
|
|
@@ -283,10 +251,50 @@ export default {
|
|
const dataCount = this.buildDataCount(product, parsedFilter);
|
|
const dataCount = this.buildDataCount(product, parsedFilter);
|
|
const subAccountCount = this.buildSubAccountCount(product, parsedFilter);
|
|
const subAccountCount = this.buildSubAccountCount(product, parsedFilter);
|
|
const mainAccountCount = '1个';
|
|
const mainAccountCount = '1个';
|
|
- const linkedOrder = this.processLinkedOrder(product);
|
|
|
|
|
|
+ // const linkedOrder = this.processLinkedOrder(product);
|
|
const finalPrice = this.formatNumber(product.final_price);
|
|
const finalPrice = this.formatNumber(product.final_price);
|
|
let originalPrice = this.formatNumber(product.original_price);
|
|
let originalPrice = this.formatNumber(product.original_price);
|
|
- this.parsedFilter = parsedFilter;
|
|
|
|
|
|
+ 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 + '',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ const associationOrder = arr.map(t => {
|
|
|
|
+ return {
|
|
|
|
+ ...t,
|
|
|
|
+ ...this.sortTableText(t),
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
|
|
const newProduct = {
|
|
const newProduct = {
|
|
...product,
|
|
...product,
|
|
@@ -303,6 +311,7 @@ export default {
|
|
original_price: originalPrice,
|
|
original_price: originalPrice,
|
|
supExplanation,
|
|
supExplanation,
|
|
..._productArr[index] || {},
|
|
..._productArr[index] || {},
|
|
|
|
+ options: associationOrder
|
|
};
|
|
};
|
|
|
|
|
|
newProduct._a = showActivityCardRateModule(_productArr, newProduct)
|
|
newProduct._a = showActivityCardRateModule(_productArr, newProduct)
|
|
@@ -446,13 +455,13 @@ export default {
|
|
return '';
|
|
return '';
|
|
},
|
|
},
|
|
// 处理关联订单数据。
|
|
// 处理关联订单数据。
|
|
- processLinkedOrder(product) {
|
|
|
|
- if (product.linkedOrder && Object.keys(product.linkedOrder).length > 0) {
|
|
|
|
- const orderList = [product.linkedOrder];
|
|
|
|
- return this.flattenLinkOrderList(orderList);
|
|
|
|
- }
|
|
|
|
- return [];
|
|
|
|
- },
|
|
|
|
|
|
+ // processLinkedOrder(product) {
|
|
|
|
+ // if (product.linkedOrder && Object.keys(product.linkedOrder).length > 0) {
|
|
|
|
+ // const orderList = [product.linkedOrder];
|
|
|
|
+ // return this.flattenLinkOrderList(orderList);
|
|
|
|
+ // }
|
|
|
|
+ // return [];
|
|
|
|
+ // },
|
|
|
|
|
|
// 设置合同金额合计和标准售价合计,以及计算折扣率总和。
|
|
// 设置合同金额合计和标准售价合计,以及计算折扣率总和。
|
|
setTotalAmounts(productData) {
|
|
setTotalAmounts(productData) {
|
|
@@ -465,21 +474,21 @@ export default {
|
|
this.orderData.rate_total = Number(totalOriginalPrice) ? rateTotal : '无法计算';
|
|
this.orderData.rate_total = Number(totalOriginalPrice) ? rateTotal : '无法计算';
|
|
},
|
|
},
|
|
|
|
|
|
- flattenLinkOrderList(linkOrderList) {
|
|
|
|
- const result = [];
|
|
|
|
- if (!linkOrderList || linkOrderList.length === 0) return result;
|
|
|
|
- linkOrderList.forEach(item => {
|
|
|
|
- const { orderArr, ...rest } = item; // 拆分 orderArr 和其他字段
|
|
|
|
- if (!orderArr || orderArr.length === 0) return;
|
|
|
|
- orderArr.forEach(order => {
|
|
|
|
- result.push({
|
|
|
|
- ...rest, // 非 orderArr 的字段(如 name, empowerCount 等)
|
|
|
|
- ...order // orderArr 中的字段(如 order_code, service_type 等)
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- return result;
|
|
|
|
- },
|
|
|
|
|
|
+ // flattenLinkOrderList(linkOrderList) {
|
|
|
|
+ // const result = [];
|
|
|
|
+ // if (!linkOrderList || linkOrderList.length === 0) return result;
|
|
|
|
+ // linkOrderList.forEach(item => {
|
|
|
|
+ // const { orderArr, ...rest } = item; // 拆分 orderArr 和其他字段
|
|
|
|
+ // if (!orderArr || orderArr.length === 0) return;
|
|
|
|
+ // orderArr.forEach(order => {
|
|
|
|
+ // result.push({
|
|
|
|
+ // ...rest, // 非 orderArr 的字段(如 name, empowerCount 等)
|
|
|
|
+ // ...order // orderArr 中的字段(如 order_code, service_type 等)
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
+ // return result;
|
|
|
|
+ // },
|
|
|
|
|
|
shouldRenderItem(item, product) {
|
|
shouldRenderItem(item, product) {
|
|
if (item.condition && typeof item.condition === 'function') {
|
|
if (item.condition && typeof item.condition === 'function') {
|
|
@@ -588,6 +597,7 @@ export default {
|
|
|
|
|
|
orderServiceType(val) {
|
|
orderServiceType(val) {
|
|
const matchedOption = paymentTypeOptions.find(option => option.value === val);
|
|
const matchedOption = paymentTypeOptions.find(option => option.value === val);
|
|
|
|
+ console.log(matchedOption, 'matchedOption');
|
|
return matchedOption ? matchedOption.label : val; // 如果未找到匹配项,返回原始值
|
|
return matchedOption ? matchedOption.label : val; // 如果未找到匹配项,返回原始值
|
|
},
|
|
},
|
|
}
|
|
}
|