|
@@ -29,7 +29,8 @@
|
|
|
align="center"
|
|
|
label="产品类型及规格">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.productTypeText.replace('VIP订阅', '超级订阅') }}
|
|
|
+ <!-- {{ scope.row.productTypeText.replace('VIP订阅', '超级订阅') }} -->
|
|
|
+ {{ getProductTypeText(scope.row) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -65,7 +66,7 @@
|
|
|
align="center"
|
|
|
label="订单编号">
|
|
|
<template slot-scope="scope">
|
|
|
- <span class="highlight-text pointer order-code" @click="toOrderDetail(scope.row)">{{ scope.row.order_code }}</span>
|
|
|
+ <span class="highlight-text pointer order-code" :style="{ cursor: 'pointer' }" @click="toOrderDetail(scope.row)">{{ scope.row.order_code }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -85,6 +86,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getProductTypeConfWithSpecCode } from '@/views/create-order/hooks/utils'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'RelatedOrderTable',
|
|
|
props: {
|
|
@@ -170,6 +173,31 @@ export default {
|
|
|
}
|
|
|
this.onInput(selectedRowId)
|
|
|
},
|
|
|
+ getProductTypeText(row) {
|
|
|
+ let text = row.productTypeText || ''
|
|
|
+ if (!text) {
|
|
|
+ text = this.calcProductTypeTextWithCode(row.productCode)
|
|
|
+ }
|
|
|
+ return text?.replaceAll('VIP订阅', '超级订阅')
|
|
|
+ },
|
|
|
+ calcProductTypeTextWithCode(code) {
|
|
|
+ const info = getProductTypeConfWithSpecCode(code)
|
|
|
+ if (Array.isArray(info.product_list) && info.product_list.length > 1) {
|
|
|
+ const t = info.product_list.find(p => p.code === code)
|
|
|
+ if (t) {
|
|
|
+ const mainName = info.label
|
|
|
+ const subName = t.name?.replace(mainName, '')
|
|
|
+
|
|
|
+ const arr = [mainName]
|
|
|
+ if (subName) {
|
|
|
+ arr.push(subName)
|
|
|
+ }
|
|
|
+
|
|
|
+ return arr.join(' - ').replaceAll('VIP订阅', '超级订阅')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return info.label
|
|
|
+ },
|
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
const needSpan = Array.isArray(row.linkedOrder) && row.linkedOrder.length > 1
|
|
|
const unSpanKey = ['order_code', 'service_type_text', 'create_time']
|