소스 검색

修改营销活动

Fan 3 주 전
부모
커밋
eee072a268

+ 1 - 1
ui/smarttrade-platform/src/assets/styles/marketing.css

@@ -236,7 +236,7 @@
 .reply-item .priority-badge.medium { background: rgba(245, 158, 11, 0.2); color: #F59E0B; }
 .reply-item .priority-badge.low { background: rgba(107, 114, 128, 0.2); color: #6B7280; }
 .reply-item .reply-customer-info { display: flex; gap: 16px; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
-.reply-item .reply-time { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
+.reply-item .reply-time { font-size: 11px; color: var(--text-muted); }
 .reply-item .reply-content { padding: 10px; background: var(--bg-dark); border-radius: 8px; margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
 .reply-item .reply-review-notes { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; background: rgba(99, 102, 241, 0.1); border-radius: 6px; margin-bottom: 10px; font-size: 12px; color: var(--text-secondary); }
 .reply-item .reply-review-notes i { color: var(--primary); margin-top: 2px; flex-shrink: 0; }

+ 56 - 4
ui/smarttrade-platform/src/components/addMarketing.vue

@@ -205,6 +205,37 @@
                             <h5><i class="fas fa-filter"></i> 高级筛选</h5>
                             <button class="btn-link" @click="clearFilters">清除筛选</button>
                         </div>
+                        <div class="filter-row">
+                            <div class="form-group">
+                                <label class="form-label">客户分类</label>
+                                <el-select v-model="customerClassify" clearable placeholder="客户分类" @change="getCustomerData()">
+                                    <el-option label="公海客户" value="1" />
+                                    <el-option label="无效客户" value="2" />
+                                    <el-option label="重点客户" value="3" />
+                                    <el-option label="成交客户" value="4" />
+                                </el-select>
+                            </div>
+                            <div class="form-group">
+                                <label class="form-label">客户来源</label>
+                                <el-select v-model="customerParams.customerSourceDictValue" clearable placeholder="客户来源" @change="getCustomerData()">
+                                    <el-option label="搜索引擎(例:Google)" value="1" />
+                                    <el-option label="公司网站live chat咨询" value="2" />
+                                    <el-option label="公司网站留言" value="3" />
+                                    <el-option label="sales信箱" value="4" />
+                                    <el-option label="德国Embedded展会" value="5" />
+                                    <el-option label="CES展会" value="6" />
+                                    <el-option label="B2ClT" value="7" />
+                                    <el-option label="CEBIT展会" value="8" />
+                                    <el-option label="中国制造网" value="9" />
+                                    <el-option label="Computex展会" value="10" />
+                                    <el-option label="客户介绍" value="11" />
+                                    <el-option label="社交媒体(例:Linkedln)" value="12" />
+                                    <el-option label="SalesForce" value="13" />
+                                    <el-option label="香港电子展" value="14" />
+                                    <el-option label="官网注册用户" value="15" />
+                                </el-select>
+                            </div>
+                        </div>
                         <div class="filter-row">
                             <div class="form-group">
                                 <label class="form-label">地区</label>
@@ -1003,9 +1034,13 @@
             country: '',
             customerStatusDictValue: '',
             customerTypeDictValue: '',
-            customerLevelDictValue: ''
+            customerLevelDictValue: '',
+            customerSourceDictValue: '',
         }
-        getCustomerData()
+        customerClassify.value = ''
+        regionValue.value = []
+        customerList.value = []
+        sourceData.value = []
     }
     const removeTag = (tag) => {
         const idx = newCampaign.value.filters.selectedTags.indexOf(tag)
@@ -1167,12 +1202,29 @@
         country: '',
         customerStatusDictValue: '',
         customerTypeDictValue: '',
-        customerLevelDictValue: ''
+        customerLevelDictValue: '',
+        customerSourceDictValue: ''
     })
+    const customerClassify = ref('')
     const customerList = ref([])
     const sourceData = ref([])
     const getCustomerData = () => {
-        getTradeCustomer({ pageIndex: 1, pageSize: 10000, ...customerParams.value }).then(res => {
+        let params = {
+            pageIndex: 1,
+            pageSize: 10000,
+            ...customerParams.value
+        }
+        if(customerClassify.value == 1) {
+            params.hasPublicCustomer = 1
+        }else if(customerClassify.value == 2) {
+            params.hasGarbageCustomer = 1
+        }else if(customerClassify.value == 3) {
+            params.hasFollowCustomer = 1
+        }else if(customerClassify.value == 4) {
+            params.hasOrderForm = 1
+            params.hasPublicCustomer = 0
+        }
+        getTradeCustomer(params).then(res => {
             customerList.value = res.result.records || []
             newCampaign.value.filters.selectedTags = customerList.value.map(item => item.customerName)
             sourceData.value = []

+ 56 - 7
ui/smarttrade-platform/src/components/marketing/customerDetail.vue

@@ -52,6 +52,33 @@
                                 <el-option label="D级" value="4" />
                             </el-select>
                         </el-form-item>
+                        <el-form-item label="" prop="customerClassify">
+                            <el-select v-model="customerClassify" clearable placeholder="客户分类">
+                                <el-option label="公海客户" value="1" />
+                                <el-option label="无效客户" value="2" />
+                                <el-option label="重点客户" value="3" />
+                                <el-option label="成交客户" value="4" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="" prop="customerSourceDictValue">
+                            <el-select v-model="customerParams.customerSourceDictValue" clearable placeholder="客户来源">
+                                <el-option label="搜索引擎(例:Google)" value="1" />
+                                <el-option label="公司网站live chat咨询" value="2" />
+                                <el-option label="公司网站留言" value="3" />
+                                <el-option label="sales信箱" value="4" />
+                                <el-option label="德国Embedded展会" value="5" />
+                                <el-option label="CES展会" value="6" />
+                                <el-option label="B2ClT" value="7" />
+                                <el-option label="CEBIT展会" value="8" />
+                                <el-option label="中国制造网" value="9" />
+                                <el-option label="Computex展会" value="10" />
+                                <el-option label="客户介绍" value="11" />
+                                <el-option label="社交媒体(例:Linkedln)" value="12" />
+                                <el-option label="SalesForce" value="13" />
+                                <el-option label="香港电子展" value="14" />
+                                <el-option label="官网注册用户" value="15" />
+                            </el-select>
+                        </el-form-item>
                     </el-form>
                     <div class="btn-div">
                         <button class="btn btn-primary" @click="searchCustomer">
@@ -82,7 +109,7 @@
                                 </div>
                                 <div class="customer-card-right">
                                     <div class="card-right" v-if="customer.customerAnalysisResult">
-                                        <div class="customer-score">{{ customer.customerAnalysisResult.potentialScore }}</div>
+                                        <div class="customer-score">{{ customer.customerAnalysisResult.potentialScore || 0 }}</div>
                                         <div class="customer-score-label">意向分</div>
                                     </div>
                                     <div class="right-btn" @click="handleBtn(customer)">
@@ -142,13 +169,17 @@
             customerStatusDictValue: '',
             customerTypeDictValue: '',
             customerLevelDictValue: '',
-            liaisonName: ''
+            liaisonName: '',
+            customerSourceDictValue: ''
         }
+        customerClassify.value = ''
         if(type == 'detail'){
             filterData.value = data
             allData.value = data
             customers.value = data.slice(0, 10)
             total.value = data.length
+        }else{
+            getCustomerData()
         }
         showCustomerPreview.value = true
     }
@@ -161,8 +192,10 @@
         customerStatusDictValue: '',
         customerTypeDictValue: '',
         customerLevelDictValue: '',
-        liaisonName: ''
+        liaisonName: '',
+        customerSourceDictValue: ''
     })
+    const customerClassify = ref('')
     const regionValue = ref([])
     const getRegion = (value) => {
         customerParams.value.country = value ? value[1] : ''
@@ -173,7 +206,18 @@
     const customers = ref([])
     const total = ref(0)
     const getCustomerData = () => {
-        getTradeCustomer(customerParams.value).then(res => {
+        let params = JSON.parse(JSON.stringify(customerParams.value))
+        if(customerClassify.value == 1) {
+            params.hasPublicCustomer = 1
+        }else if(customerClassify.value == 2) {
+            params.hasGarbageCustomer = 1
+        }else if(customerClassify.value == 3) {
+            params.hasFollowCustomer = 1
+        }else if(customerClassify.value == 4) {
+            params.hasOrderForm = 1
+            params.hasPublicCustomer = 0
+        }
+        getTradeCustomer(params).then(res => {
             customers.value = res.result.records || []
             total.value = res.result.total || 0
         })
@@ -199,7 +243,12 @@
                 const typeMatch = customerParams.value.customerTypeDictValue ? (item.customerTypeDictValue == customerParams.value.customerTypeDictValue) : true
                 const levelMatch = customerParams.value.customerLevelDictValue ? (item.customerLevelDictValue == customerParams.value.customerLevelDictValue) : true
                 const countryMatch = customerParams.value.country ? (item.country == customerParams.value.country) : true
-                return blurryMatch && liaisonMatch && statusMatch && typeMatch && levelMatch && countryMatch
+                const sourceMatch = customerParams.value.customerSourceDictValue ? (item.customerSourceDictValue == customerParams.value.customerSourceDictValue) : true
+                const publicMatch = customerClassify.value == 1 ? (item.hasPublicCustomer == 1) : true
+                const garbageMatch = customerClassify.value == 2 ? (item.hasGarbageCustomer == 1) : true
+                const followMatch = customerClassify.value == 3 ? (item.hasFollowCustomer == 1) : true
+                const orderFormMatch = customerClassify.value == 4 ? (item.hasOrderForm == 1 && item.hasPublicCustomer == 0) : true
+                return blurryMatch && liaisonMatch && statusMatch && typeMatch && levelMatch && countryMatch && sourceMatch && publicMatch && garbageMatch && followMatch && orderFormMatch
             })
             customers.value = filterData.value.slice(0, 10)
             total.value = filterData.value.length
@@ -209,9 +258,9 @@
     const resetCustomerParams = () => {
         customerFormRef.value.resetFields()
         regionValue.value = []
+        customerClassify.value = ''
         if(modalType.value == 'add'){
-            customers.value = []
-            total.value = 0
+            getCustomerData()
         }else{
             filterData.value = allData.value
             customers.value = allData.value.slice(0, 10)

+ 7 - 6
ui/smarttrade-platform/src/components/marketing/emailList.vue

@@ -36,19 +36,19 @@
                     <span class="status-pill">{{ item.stageName }}</span>
                   </div>
                   <div class="email-card-subtitle">{{ item.recipient }}</div>
-                  <div class="email-card-subtitle">预计发送时间:{{ item.expectSendTime }}</div>
+                  <div class="email-card-subtitle">{{ activeFilter == 'error' ? '' : '预计' }}发送时间:{{ item.expectSendTime }}</div>
                 </div>
                 
               </div>
             </div>
             <div class="email-card-actions">
-              <button v-if="activeFilter !== 'sent'" class="btn btn-secondary" @click="cancelSend(item)">
+              <button v-if="activeFilter !== 'sent' && activeFilter !== 'error'" class="btn btn-secondary" @click="cancelSend(item)">
                 {{  activeFilter === 'pending' ? '取消' : '重新' }}发送
               </button>
-              <button class="btn btn-secondary" @click="viewDetail(item)" v-if="activeFilter == 'sent'">
+              <button class="btn btn-secondary" @click="viewDetail(item)" v-if="activeFilter == 'sent' || activeFilter == 'error'">
                 邮件详情
               </button>
-              <button v-if="activeFilter !== 'sent'" class="btn btn-primary" @click="editEmail(item)">
+              <button v-if="activeFilter !== 'sent' && activeFilter !== 'error'" class="btn btn-primary" @click="editEmail(item)">
                 编辑邮件
               </button>
             </div>
@@ -95,7 +95,8 @@ const getStatusCounts = () => {
     tabData.value = [
       { value: 'pending', title: '待发送', count: res.result.pendingSendCount || 0 },
       { value: 'sent', title: '已发送', count: res.result.sentCount || 0 },
-      { value: 'failed', title: '已取消', count: res.result.cancelledCount || 0 }
+      { value: 'failed', title: '已取消', count: res.result.cancelledCount || 0 },
+      { value: 'error', title: '发送失败', count: res.result.pendingInsertCount || 0 }
     ]
   })
 }
@@ -107,7 +108,7 @@ const getList = () => {
     marketingCampaignId: selectedCampaign.value.id,
     pageIndex: 1,
     pageSize: 10000,
-    status: activeFilter.value === 'pending' ? -1 : activeFilter.value === 'sent' ? 1 : -3
+    status: activeFilter.value === 'pending' ? -1 : activeFilter.value === 'sent' ? 1 : activeFilter.value === 'failed' ? -3 : -4
   }
   getEmailList(params).then((res) => {
     emailList.value = res.result.records || []

+ 47 - 16
ui/smarttrade-platform/src/components/marketing/interventionCustomers.vue

@@ -21,25 +21,33 @@
           <div class="detail-section" v-if="protectedCustomersList.length > 0">
             <div class="protected-customers">
               <div v-for="customer in protectedCustomersList" :key="customer.id" class="intervention-item" :class="{ 'protected-customer-item': tabType == 'protect', 'suspended-customer-item': tabType == 'suspend' }">
-                <div class="customer-header">
-                  <div class="customer-info">
-                    <div class="customer-name">
-                      {{ customer.customerName }}
-                      <!-- <span class="protection-level" :class="customer.protectionLevel">
-                        {{ customer.protectionLevel }}保护
-                      </span> -->
+                <div style="display: flex;justify-content: space-between;align-items: center;">
+                  <div>
+                    <div class="customer-header">
+                      <div class="customer-info">
+                        <div class="customer-name">
+                          {{ customer.customerName }}
+                          <!-- <span class="protection-level" :class="customer.protectionLevel">
+                            {{ customer.protectionLevel }}保护
+                          </span> -->
+                        </div>
+                        <div class="customer-email">{{ customer.recipient }}</div>
+                      </div>
+                    </div>
+                    <div class="customer-details">
+                      <!-- <span class="detail">{{ tabType == 'protect' ? '保护' : "暂停" }}原因: {{ customer.protectReason }}</span> -->
+                      <span class="detail">{{ tabType == 'protect' ? '保护' : "暂停" }}时间: {{ tabType == 'protect' ? customer.protectTime : customer.suspendTime }}</span>
+                    </div>
+                    <div class="customer-actions">
+                      <button class="btn btn-secondary btn-sm" @click="unprotectCustomer(customer)">
+                        <i class="fas fa-times"></i> {{ tabType == 'protect' ? '移除保护' : "取消暂停" }}
+                      </button>
                     </div>
-                    <div class="customer-email">{{ customer.recipient }}</div>
                   </div>
+                  <div class="card-score" v-if="customer.customerAnalysisResult">
+                    <div class="customer-score">{{ customer.customerAnalysisResult.potentialScore || 0 }}</div>
+                    <div class="customer-score-label">意向分</div>
                 </div>
-                <div class="customer-details">
-                  <!-- <span class="detail">{{ tabType == 'protect' ? '保护' : "暂停" }}原因: {{ customer.protectReason }}</span> -->
-                  <span class="detail">{{ tabType == 'protect' ? '保护' : "暂停" }}时间: {{ tabType == 'protect' ? customer.protectTime : customer.suspendTime }}</span>
-                </div>
-                <div class="customer-actions">
-                  <button class="btn btn-secondary btn-sm" @click="unprotectCustomer(customer)">
-                    <i class="fas fa-times"></i> {{ tabType == 'protect' ? '移除保护' : "取消暂停" }}
-                  </button>
                 </div>
               </div>
             </div>
@@ -120,4 +128,27 @@
 
 <style scoped>
     @import '../../assets/styles/marketing.css';
+    .card-score{
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+    }
+    .customer-score {
+        width: 54px;
+        height: 54px;
+        display: flex;
+        border-radius: 50%;
+        align-items: center;
+        background: rgba(34, 197, 94, 0.12);
+        color: var(--success);
+        font-size: 18px;
+        font-weight: 700;
+        justify-content: center;
+    }
+
+    .customer-score-label {
+        margin-top: 3px;
+        font-size: 12px;
+        color: #64748B;
+    }
 </style>

+ 3 - 3
ui/smarttrade-platform/src/components/marketing/marketingDetail.vue

@@ -101,9 +101,9 @@
                     <span>回复率: {{ selectedCampaign.replyRate }}%</span>
                   </div>
                 </div>
-                <div class="channel-status" :style="{ color: selectedCampaign.status == 2 ? 'var(--text-secondary)' : selectedCampaign.status == 3 ? 'var(--primary)' : 'var(--success)' }">
-                  <span class="status-dot" :class="{ 'active': selectedCampaign.status == 0 || selectedCampaign.status == 1 }"></span> 
-                  {{  selectedCampaign.status == 2 ? '已暂停' : selectedCampaign.status == 3 ? '已完成' : '运行中' }}
+                <div class="channel-status" :style="{ color: selectedCampaign.status == 0 ? 'white' : selectedCampaign.status == 1 ? 'var(--success)' : selectedCampaign.status == 2 ? 'var(--warning)' : 'var(--primary)' }">
+                  <span class="status-dot" :class="{ 'active': selectedCampaign.status == 1 }"></span> 
+                  {{ getStatusLabel(selectedCampaign.status || 0) }}
                 </div>
               </div>
             </div>

+ 27 - 0
ui/smarttrade-platform/src/components/marketing/openedCustomers.vue

@@ -35,6 +35,10 @@
                   <div class="customer-email">{{ customer.recipient }}</div>
                 </div>
               </div>
+              <div class="card-score" v-if="customer.customerAnalysisResult">
+                  <div class="customer-score">{{ customer.customerAnalysisResult.potentialScore || 0 }}</div>
+                  <div class="customer-score-label">意向分</div>
+              </div>
               <div class="customer-details">
                 <div class="detail-item">
                   <span class="label">打开时间:</span>
@@ -154,4 +158,27 @@
     .customer-item{
       justify-content: space-between;
     }
+    .card-score{
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+    }
+    .customer-score {
+        width: 54px;
+        height: 54px;
+        display: flex;
+        border-radius: 50%;
+        align-items: center;
+        background: rgba(34, 197, 94, 0.12);
+        color: var(--success);
+        font-size: 18px;
+        font-weight: 700;
+        justify-content: center;
+    }
+
+    .customer-score-label {
+        margin-top: 3px;
+        font-size: 12px;
+        color: #64748B;
+    }
 </style>

+ 43 - 12
ui/smarttrade-platform/src/components/marketing/replyCustomers.vue

@@ -24,21 +24,29 @@
           </div>
           <div class="replies-list" v-if="repliedCustomers.length > 0">
             <div v-for="reply in repliedCustomers" :key="reply.id" class="reply-item" :class="{ approved: reply.hasProtect, 'pending-review': !reply.hasProtect && reply.hasSuspend }">
-              <div class="reply-header">
-                <div class="reply-info">
-                  <div class="reply-name">
-                    {{ reply.customerName }}
+              <div style="display: flex;justify-content: space-between;margin-bottom: 10px;align-items: center;">
+                <div>
+                  <div class="reply-header">
+                    <div class="reply-info">
+                      <div class="reply-name">
+                        {{ reply.customerName }}
+                      </div>
+                      <div class="reply-email">{{ reply.recipient }}</div>
+                    </div>
+                    <!-- <div class="reply-badges">
+                      <span class="priority-badge" :class="reply.priority">
+                        {{ reply.priority }}优先级
+                      </span>
+                      <span class="value-badge" :class="reply.value">{{ reply.value }}</span>
+                    </div> -->
                   </div>
-                  <div class="reply-email">{{ reply.recipient }}</div>
+                  <div class="reply-time">回复时间: {{ reply.firstReplyTime }}</div>
+                </div>
+                <div class="card-score" v-if="reply.customerAnalysisResult">
+                    <div class="customer-score">{{ reply.customerAnalysisResult.potentialScore || 0 }}</div>
+                    <div class="customer-score-label">意向分</div>
                 </div>
-                <!-- <div class="reply-badges">
-                  <span class="priority-badge" :class="reply.priority">
-                    {{ reply.priority }}优先级
-                  </span>
-                  <span class="value-badge" :class="reply.value">{{ reply.value }}</span>
-                </div> -->
               </div>
-              <div class="reply-time">回复时间: {{ reply.firstReplyTime }}</div>
               <div class="reply-content">
                 <p>{{ reply.replyContent }}</p>
               </div>
@@ -150,4 +158,27 @@
 
 <style scoped>
     @import '../../assets/styles/marketing.css';
+    .card-score{
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+    }
+    .customer-score {
+        width: 54px;
+        height: 54px;
+        display: flex;
+        border-radius: 50%;
+        align-items: center;
+        background: rgba(34, 197, 94, 0.12);
+        color: var(--success);
+        font-size: 18px;
+        font-weight: 700;
+        justify-content: center;
+    }
+
+    .customer-score-label {
+        margin-top: 3px;
+        font-size: 12px;
+        color: #64748B;
+    }
 </style>