|
@@ -9,6 +9,7 @@ import ContractAmount from '@/views/create-order/components/product-info-submodu
|
|
|
import ServiceList from '@/views/create-order/components/product-info-submodule/ServiceList'
|
|
|
import CountNumber from '@/views/create-order/components/product-info-submodule/CountNumber'
|
|
|
import SelectGroup from '@/views/create-order/components/product-info-submodule/SelectGroup'
|
|
|
+import store from '@/store'
|
|
|
|
|
|
import {
|
|
|
schemaKeyMap,
|
|
@@ -192,6 +193,7 @@ export function createRelatedOrdersSchema() {
|
|
|
key: 'relatedOrders',
|
|
|
className: 'related-orders',
|
|
|
component: RelatedOrders,
|
|
|
+ defaultValue: [],
|
|
|
showMessage: false,
|
|
|
changedSchema: true,
|
|
|
props: {
|
|
@@ -280,8 +282,32 @@ export function createValidityPeriodSchema({ amountText = '' } = {}) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function checkIsEntService(info) {
|
|
|
+ const productList = store.state.order.productList
|
|
|
+ if (Array.isArray(productList) && productList.length > 0) {
|
|
|
+ const entService = productList.find(item => item.value.includes('企业服务'))
|
|
|
+ if (entService && Array.isArray(entService.children)) {
|
|
|
+ const t = entService.children.find(e => e.code === info.code)
|
|
|
+ return !!t
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
// 服务起止时间 - 手动选择的时间区间
|
|
|
-export function createValidityPeriodDateTimeSchema({ label, amountText = '' } = {}) {
|
|
|
+// 当产品属性为“资源包、企业服务”且未配置有效周期且该产品类型不支持系统自动开通权限才展示,否则不展示;
|
|
|
+export function createValidityPeriodDateTimeSchema({ label, info, amountText = '' } = {}) {
|
|
|
+ // 产品属性 1会员服务 2 资源包 3实物 4其他
|
|
|
+ const isSourcePack = info?.attribute === 2
|
|
|
+ const isEntService = checkIsEntService(info)
|
|
|
+ // 是否支持自动开通 1是 2否
|
|
|
+ const canAutoOpen = info?.auto === 1
|
|
|
+ const hasValidTime = !!amountText
|
|
|
+
|
|
|
+ const show = (isSourcePack || isEntService) && !hasValidTime && !canAutoOpen
|
|
|
+ if (!show) {
|
|
|
+ return undefined
|
|
|
+ }
|
|
|
return createSchemaItem({
|
|
|
label: label || '服务起止时间',
|
|
|
key: 'validityPeriod',
|