|
@@ -56,7 +56,7 @@
|
|
|
>
|
|
|
<div v-if="item.key === 'linkedOrder'" class="linkedOrder">
|
|
|
{{ item.label }}:
|
|
|
- <TableCard :span-method="objectSpanMethod" v-if="product[item.key].length" :table-data="product[item.key]" :columns="linkOrderColumns">
|
|
|
+ <TableCard :span-method="objectSpanMethod" v-if="(product[item.key] || []).length" :table-data="product[item.key]" :columns="linkOrderColumns">
|
|
|
</TableCard>
|
|
|
<span v-else>-</span>
|
|
|
</div>
|
|
@@ -72,13 +72,13 @@
|
|
|
<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'">
|
|
|
{{ item.label }}:
|
|
|
<span v-if="!product.original_price" class="no_open_root">该产品暂无法计算标准售价</span>
|
|
|
- <span v-else>{{ getFilteredValue(product[item.key], item.filter) || '-' }}</span>
|
|
|
+ <span v-else>¥{{ getFilteredValue(product[item.key], item.filter) || '-' }}</span>
|
|
|
</div>
|
|
|
<div v-else-if="item.key === 'validity_period'">
|
|
|
<span v-html="getValidityPeriodHtml(product, item)"></span>
|
|
@@ -102,28 +102,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <template #activity>
|
|
|
- <div v-if="product.activityName" class="order-detail-product-activity">
|
|
|
- <div class="order-detail-product-activity-title">
|
|
|
- <span>活动商品:</span>
|
|
|
- <span>{{ product.activityName || '买2年大会员送:1年大会员+人脉管理+阳光直采+1000条数据流量包高级字段包+腾讯视频年卡' }}</span>
|
|
|
- </div>
|
|
|
- <div class="order-detail-product-activity-item">
|
|
|
- <div class="order-detail-product-activity-item-title">
|
|
|
- <span>合同金额合计:</span>
|
|
|
- <span>¥{{ product.final_price }}</span>
|
|
|
- </div>
|
|
|
- <div class="order-detail-product-activity-item-title">
|
|
|
- <span>标准售价合计:</span>
|
|
|
- <span>¥{{ product.original_price }}</span>
|
|
|
- </div>
|
|
|
- <div class="order-detail-product-activity-item-title">
|
|
|
- <span>折扣率:</span>
|
|
|
- <span>{{ product.rate }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+
|
|
|
<div class="order-detail-card-item" style="margin-left: 22px;">
|
|
|
是否{{formType}}:
|
|
|
<el-radio-group v-model="product.canSelect">
|
|
@@ -143,7 +122,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="desc">
|
|
|
- <el-input type="textarea" v-model="product.form.desc"></el-input>
|
|
|
+ <el-input type="textarea" maxlength="200" v-model="product.form.desc"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -161,7 +140,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="" prop="desc" v-if="product.form.reason === '其他'">
|
|
|
- <el-input type="textarea" v-model="product.form.desc" placeholder="请输入修正原因"></el-input>
|
|
|
+ <el-input type="textarea" maxlength="200" v-model="product.form.desc" placeholder="请输入修正原因"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -183,10 +162,11 @@
|
|
|
<script>
|
|
|
import InfoCard from '../../ui/InfoCard.vue';
|
|
|
import ProductCard from '../../ui/ProductCard.vue';
|
|
|
-import { paymentTypeOptions } from '../../data/options.js';
|
|
|
+import {buySubjectOptions, paymentTypeOptions} from '../../data/options.js';
|
|
|
import { div, calcDiscountRate, roundToTwoDecimals } from '@/utils/number/';
|
|
|
import TableCard from '../../ui/TableCard.vue';
|
|
|
import ServiceList from "@/views/create-order/components/product-info-submodule/ServiceList.vue";
|
|
|
+import {showActivityCardRateModule} from "@/views/create-order/hooks/utils";
|
|
|
export default {
|
|
|
name: 'SelectOrderDetailCard',
|
|
|
components: {
|
|
@@ -236,13 +216,15 @@ 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},
|
|
|
{ label: '折扣率', key: 'rate', span: 3},
|
|
|
{ label: '子账号数量', key: 'subAccountCount', span: 1, condition: () => this.parsedFilter.buyAccountCount && this.parsedFilter.giftAccountCount },
|
|
|
- { label: '主账号数量', key: 'mainAccountCount', span: 1, condition: (product) => product.product_type === 'VIP订阅' },
|
|
|
+ { 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}
|
|
@@ -282,7 +264,14 @@ export default {
|
|
|
{
|
|
|
prop: 'name',
|
|
|
label: '产品类型及规格',
|
|
|
- width: 154
|
|
|
+ width: 154,
|
|
|
+ render (row) {
|
|
|
+ if(row.name === 'VIP订阅') {
|
|
|
+ return '超级订阅'
|
|
|
+ } else {
|
|
|
+ return row.name ? row.name : '-'
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
prop: 'empowerCount',
|
|
@@ -297,7 +286,11 @@ export default {
|
|
|
{
|
|
|
prop: 'buySubject',
|
|
|
label: '购买主体',
|
|
|
- width: 80
|
|
|
+ width: 80,
|
|
|
+ render (row) {
|
|
|
+ return buySubjectOptions.find(item => item.value === row.buySubject)?.label || '-'
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
prop:'order_code',
|
|
@@ -307,7 +300,10 @@ export default {
|
|
|
{
|
|
|
prop:'service_type',
|
|
|
label: '付费类型',
|
|
|
- width: 80
|
|
|
+ width: 80,
|
|
|
+ render (row) {
|
|
|
+ return paymentTypeOptions.find(item => item.value === row.service_type)?.label || '-'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
prop:'create_time',
|
|
@@ -353,7 +349,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
if (vCount === vCountSuccess && vCountSuccess >= 1) {
|
|
|
- return this.productData.filter(v => v.canSelect)
|
|
|
+ return this.productData.filter(v => v.canSelect)
|
|
|
} else {
|
|
|
return []
|
|
|
}
|
|
@@ -384,6 +380,8 @@ export default {
|
|
|
async init() {
|
|
|
this.orderData = this.orderDetailInfo?.orderData || {};
|
|
|
let productData = this.orderDetailInfo?.productData || [];
|
|
|
+ const { _productArr } = this.orderDetailInfo || {}
|
|
|
+
|
|
|
if(productData.length > 0) {
|
|
|
// 使用 Promise.all 来并行处理每个 product 的异步操作
|
|
|
productData = await Promise.all(
|
|
@@ -395,33 +393,40 @@ export default {
|
|
|
const serviceIds = parsedFilter.serviceIds || [];
|
|
|
|
|
|
// 等待异步方法完成
|
|
|
- const bigServiceNames = await this.buildBigServiceNames(serviceIds);
|
|
|
+ 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 = this.buildMainAccountCount(product);
|
|
|
+ const mainAccountCount = '1个';
|
|
|
const linkedOrder = this.processLinkedOrder(product);
|
|
|
const finalPrice = this.formatNumber(product.final_price);
|
|
|
let originalPrice = this.formatNumber(product.original_price);
|
|
|
this.parsedFilter = parsedFilter;
|
|
|
- return {
|
|
|
+
|
|
|
+ const newProduct = {
|
|
|
...product,
|
|
|
filter: parsedFilter,
|
|
|
rate,
|
|
|
validity_period: validityPeriod,
|
|
|
+ data_count: dataCount,
|
|
|
subAccountCount,
|
|
|
mainAccountCount,
|
|
|
linkedOrder,
|
|
|
bigServiceNames,
|
|
|
final_price: finalPrice,
|
|
|
- original_price: originalPrice
|
|
|
+ original_price: originalPrice,
|
|
|
+ supExplanation,
|
|
|
+ ..._productArr[index] || {},
|
|
|
};
|
|
|
+
|
|
|
+ newProduct._a = showActivityCardRateModule(_productArr, newProduct)
|
|
|
+
|
|
|
+ return newProduct
|
|
|
} catch (error) {
|
|
|
console.error('产品信息初始化失败:', error);
|
|
|
return product;
|
|
@@ -571,8 +576,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 = '';
|
|
@@ -611,14 +633,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) {
|
|
@@ -629,6 +650,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);
|
|
|
},
|
|
@@ -779,29 +805,23 @@ export default {
|
|
|
color: #2ABED1;
|
|
|
}
|
|
|
}
|
|
|
- .order-detail-product-activity {
|
|
|
+ .activity-product-container {
|
|
|
padding: 14px 20px;
|
|
|
- border: 1px solid $color_main;
|
|
|
- background: rgba(42, 190, 209, 0.08);
|
|
|
border-radius: 8px;
|
|
|
- &-title {
|
|
|
+ border: 1px solid $main;
|
|
|
+ background-color: rgba($main, 0.08);
|
|
|
+ .desc-detail-info-list {
|
|
|
+ margin-top: 8px;
|
|
|
+ }
|
|
|
+ ::v-deep {
|
|
|
+ .desc-label {
|
|
|
font-size: 14px;
|
|
|
line-height: 22px;
|
|
|
- color: $color_main;
|
|
|
- }
|
|
|
- &-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-top: 8px;
|
|
|
+ color: #686868;
|
|
|
}
|
|
|
- &-item-title {
|
|
|
- margin-right: 24px;
|
|
|
- &>span {
|
|
|
+ .desc-value {
|
|
|
font-size: 14px;
|
|
|
line-height: 22px;
|
|
|
- color: #686868;
|
|
|
- }
|
|
|
- &>span:last-child {
|
|
|
color: #1D1D1D;
|
|
|
}
|
|
|
}
|