|
@@ -16,11 +16,12 @@
|
|
|
import SchemaFormRenderer from '@/components/common/form-schema-renderer.vue'
|
|
|
import { createSchema } from './schema'
|
|
|
import { mapState, mapMutations, mapActions } from 'vuex'
|
|
|
-import { schemaKeyMap, productKeyMap, productGroupKeyMap, productTypeMap } from '@/views/create-order/data'
|
|
|
+import { schemaKeyMap, productKeyMap, productGroupKeyMap } from '@/views/create-order/data'
|
|
|
import { mergeWith,cloneDeep, debounce } from 'lodash'
|
|
|
import { deepEqual } from '@/utils/object'
|
|
|
import { getIntersection, sleep } from '@/utils/utils'
|
|
|
import { div } from '@/utils/number'
|
|
|
+import {useProductTypeMapAllOfJs} from "@/views/create-order/hooks/utils";
|
|
|
|
|
|
const dhy001 = 'dyh001'
|
|
|
|
|
@@ -337,6 +338,7 @@ export default {
|
|
|
if (Array.isArray(serviceArrMap) && serviceArrMap.length > 0) {
|
|
|
// 当前产品下是否有相同产品类型的订单
|
|
|
currentProductTypeList = serviceArrMap.filter(item => {
|
|
|
+ const productTypeMap = useProductTypeMapAllOfJs()
|
|
|
return productTypeMap[item.productType] === productTypeMap[this.productType] || item._code === this.productType
|
|
|
})
|
|
|
noSameOrder = currentProductTypeList.length === 0
|
|
@@ -347,6 +349,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async getUserService() {
|
|
|
+ const productTypeMap = useProductTypeMapAllOfJs()
|
|
|
const payload = {
|
|
|
phone: this.pageForm.accountTel,
|
|
|
entName: this.pageForm.companyName,
|
|
@@ -499,7 +502,7 @@ export default {
|
|
|
standardMoney = ''
|
|
|
}
|
|
|
this.refreshValue({
|
|
|
- [key]: this.mergeWith({}, this.value[key], { standardMoney })
|
|
|
+ [key]: this.mergeWith({}, this.value[key], { standardMoney })
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -766,6 +769,7 @@ export default {
|
|
|
// 如果某个产品下有正在生效的权益。则只能选择当前产品的关联订单
|
|
|
// 如果当前产品下无正在生效的权益。则可以选择全部产品的关联订单(此时关联订单只做记录不做开通等其他用途)
|
|
|
const currentProductTypeList = opt.filter(item => {
|
|
|
+ const productTypeMap = useProductTypeMapAllOfJs()
|
|
|
return productTypeMap[item.productType] === productTypeMap[this.productType] || item._code === this.productType
|
|
|
})
|
|
|
if (currentProductTypeList.length > 0) {
|
|
@@ -915,7 +919,7 @@ export default {
|
|
|
// (1)产品属性为“会员服务”且购买主体为“企业”且付费类型不是升级;
|
|
|
const entNotUpgrade = this.utilCheckIsVipService() && buySubject === 2 && payment !== 3
|
|
|
// (2)产品属性为“会员服务”且购买主体为“企业”且付费类型是升级且升级内容有“增购子账号”;
|
|
|
- const entUpgradeAddSubAccount = this.utilCheckIsVipService() && buySubject === 2 && payment === 3 && hasAddSubAccount
|
|
|
+ const entUpgradeAddSubAccount = this.utilCheckIsVipService() && buySubject === 2 && payment === 3 && hasAddSubAccount
|
|
|
// (3)产品类型为大会员且付费类型不是升级;
|
|
|
const bigNotUpgrade = this.productType === productKeyMap.dhy && payment !== 3
|
|
|
// (4)产品类型为大会员且付费类型是升级且升级内容有“增购子账号”。
|
|
@@ -925,7 +929,7 @@ export default {
|
|
|
main.show = show
|
|
|
sub.show = show
|
|
|
sub.label = '子账号数量'
|
|
|
-
|
|
|
+
|
|
|
// 2.账号展示规则
|
|
|
// (1)主账号默认为1个;
|
|
|
// (2)子账号付费:仅可输入≥1的正整数;如若未填写则提示“请输入付费账号数量”;
|
|
@@ -966,7 +970,7 @@ export default {
|
|
|
} else if (payment === 3) {
|
|
|
// 升级
|
|
|
main.show = false
|
|
|
-
|
|
|
+
|
|
|
const upgradeContent = value[schemaKeyMap.upgradeContent]
|
|
|
if (Array.isArray(upgradeContent)) {
|
|
|
// 包含增购子账号
|
|
@@ -1087,8 +1091,8 @@ export default {
|
|
|
} else if (productGroupKeyMap.dataCountProduct.includes(type)) {
|
|
|
this.changeDataPackSchema(value)
|
|
|
} else if (
|
|
|
- productGroupKeyMap.marketingProduct.includes(type) ||
|
|
|
- productGroupKeyMap.ggProduct.includes(type) ||
|
|
|
+ productGroupKeyMap.marketingProduct.includes(type) ||
|
|
|
+ productGroupKeyMap.ggProduct.includes(type) ||
|
|
|
productGroupKeyMap.entityProduct.includes(type)
|
|
|
) {
|
|
|
this.changeMarketingSchema(value)
|
|
@@ -1189,7 +1193,7 @@ export default {
|
|
|
const { buySubject } = this.pageForm
|
|
|
this.$set(ma.props, 'buySubject', buySubject)
|
|
|
this.$set(ma.props, 'upgradeService', payment === 3)
|
|
|
-
|
|
|
+
|
|
|
// 1.付费类型为“续费”,则禁用服务列表全部,不支持修改;
|
|
|
// 2.如果是升级,则禁用已选的
|
|
|
if (buyOrTrail) {
|
|
@@ -1263,7 +1267,7 @@ export default {
|
|
|
// 3付费类型为“升级”且“升级内容”有“补充服务”或为空,仅可选择不低于关联订单的产品规格(注:特殊处理,大会员自定义版默认展示),其他产品规格不展示。
|
|
|
this.$set(ma.props, 'onlyShowSelected', false)
|
|
|
this.$set(ma.props, 'showMessageTip', true)
|
|
|
-
|
|
|
+
|
|
|
// 1补充服务 2增购子账号
|
|
|
if (upgradeContent.length === 1 && upgradeContent.includes(2)) {
|
|
|
// 仅为增购子账号:默认为关联订单的产品规格,其他产品规格不展示;
|
|
@@ -1403,7 +1407,7 @@ export default {
|
|
|
if (this.value[schemaKeyMap.validityCount]) {
|
|
|
obj[schemaKeyMap.validityCount] = cloneDeep(this.defaultValue[schemaKeyMap.validityCount])
|
|
|
}
|
|
|
- const buyType = [1, 4].includes(this.value[schemaKeyMap.payment])
|
|
|
+ const buyType = [1, 4].includes(this.value[schemaKeyMap.payment])
|
|
|
if (changedArr.includes(schemaKeyMap.payment) && buyType) {
|
|
|
obj[schemaKeyMap.relatedOrders] = []
|
|
|
}
|