Kaynağa Gözat

Merge branch 'feature/v2.4.46' of https://jygit.jydev.jianyu360.cn/jianyu/qmx_page_admin into feature/v2.4.46

tangshizhe 1 ay önce
ebeveyn
işleme
f3de3da436

+ 10 - 0
src/views/create-order/components/schema-form/params/marketing.js

@@ -1,5 +1,6 @@
 import { SimpleParameters } from './base'
 import { getCommonParams } from "./common";
+import { dateFormatter } from '@/utils/globalFun'
 import { mul } from '@/utils/number'
 import { productTypeMap, productKeyMap, productGroupKeyMap } from '@/views/create-order/data'
 
@@ -31,6 +32,15 @@ export class MarketingGroup extends SimpleParameters {
       num: productForm.giftNum - 0 || undefined,
     }
 
+    if (productForm.validityPeriod) {
+      const periodStart = productForm.validityPeriod?.start
+      const periodEnd = productForm.validityPeriod?.end
+      Object.assign(p.filter, {
+        service_start_time: periodStart ? dateFormatter(periodStart) : undefined,
+        service_end_time: periodEnd ? dateFormatter(periodEnd) : undefined,
+      })
+    }
+
     if (this.isXSFY) {
       p.filter.num = mul(p.filter.num || 0, 100)
     }

+ 2 - 1
src/views/create-order/components/schema-form/products/common.js

@@ -308,7 +308,7 @@ function checkIsEntService(info) {
 
 // 服务起止时间 - 手动选择的时间区间
 // 当产品属性为“资源包、企业服务”且未配置有效周期且该产品类型不支持系统自动开通权限才展示,否则不展示;
-export function createValidityPeriodDateTimeSchema({ label, info, amountText = '' } = {}) {
+export function createValidityPeriodDateTimeSchema({ label, showPaybackOpenServerDay, amountText = '' } = {}) {
   // 产品属性 1会员服务 2 资源包 3实物 4其他
   // const isSourcePack = info?.attribute === 2
   // const isEntService = checkIsEntService(info)
@@ -339,6 +339,7 @@ export function createValidityPeriodDateTimeSchema({ label, info, amountText = '
     defaultValue,
     props: {
       amountText,
+      showPaybackOpenServerDay,
     }
   })
 }

+ 3 - 1
src/views/create-order/components/schema-form/products/marketing.js

@@ -5,6 +5,7 @@ import {
   createPaymentTypeSchema,
   createRelatedOrdersSchema,
   createContractAmountSchema,
+  createValidityPeriodDateTimeSchema,
   createGiftNumSchema,
   createGGSourceSchema,
   createAdditionalRemarksSchema,
@@ -41,7 +42,7 @@ export function createMarketingSchemaList(conf) {
   }
 
   // 广告来源
-  let ggSourceSchema = productGroupKeyMap.ggProduct.includes(info.code) ? createGGSourceSchema() : undefined
+  let ggSourceSchema = productGroupKeyMap.ggProduct.includes(info.code) ? [createGGSourceSchema(), createValidityPeriodDateTimeSchema({ showPaybackOpenServerDay: false })] : undefined
 
   let schema = connectArr(
     // 销售策略
@@ -54,6 +55,7 @@ export function createMarketingSchemaList(conf) {
     createRelatedOrdersSchema(),
     giftNumSchema,
     ggSourceSchema,
+
     // 补充说明
     createAdditionalRemarksSchema(),
     // 合同金额

+ 7 - 1
src/views/create-order/components/schema-form/resort/marketing.js

@@ -1,4 +1,4 @@
-import { getFilter } from './common'
+import { getFilter, sortValidityDateTime } from './common'
 
 export function sortMarketingProductFrom(product = {}) {
   const map = {}
@@ -9,5 +9,11 @@ export function sortMarketingProductFrom(product = {}) {
     map.ggSource = filter.source || ''
   }
 
+  // 时间周期
+  if (product.service_starttime || product.service_endtime) {
+    const t = sortValidityDateTime(product)
+    Object.assign(map, t)
+  }
+
   return map
 }