Bläddra i källkod

Merge remote-tracking branch 'origin/master'

YPZ 3 veckor sedan
förälder
incheckning
dbb26ee221

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

@@ -198,7 +198,7 @@
 .customers-list { display: flex; flex-direction: column; gap: 12px; }
 .customer-item { padding: 14px; background: var(--bg-hover); border-radius: 10px; border-left: 3px solid var(--border); transition: all 0.2s; }
 .customer-item.protected { border-left-color: var(--success); background: rgba(16, 185, 129, 0.05); }
-.customer-item .customer-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
+.customer-item .customer-header { display: flex; justify-content: space-between; align-items: flex-start; }
 .customer-item .customer-info { flex: 1; }
 .customer-item .customer-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
 .customer-item .protection-badge { font-size: 10px; padding: 2px 8px; background: rgba(16, 185, 129, 0.2); color: var(--success); border-radius: 10px; font-weight: normal; }
@@ -209,7 +209,7 @@
 .customer-item .value-badge.中价值 { background: rgba(245, 158, 11, 0.2); color: #F59E0B; }
 .customer-item .value-badge.低价值 { background: rgba(107, 114, 128, 0.2); color: #6B7280; }
 .customer-item .engagement-badge { font-size: 11px; padding: 4px 10px; border-radius: 10px; }
-.customer-item .customer-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; font-size: 12px; }
+.customer-item .customer-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-size: 12px; }
 .customer-item .detail-item { display: flex; justify-content: space-between; padding: 6px 8px; background: var(--bg-dark); border-radius: 6px; }
 .customer-item .detail-item .label { color: var(--text-muted); }
 .customer-item .detail-item .value { font-weight: 600; }

+ 19 - 3
ui/smarttrade-platform/src/components/addMarketing.vue

@@ -435,7 +435,7 @@
                                     <div class="sop-step-content">
                                         <div class="sop-step-title">{{ step.name }}</div>
                                         <div class="sop-step-meta">
-                                            <span><i class="fas fa-clock"></i> 第{{ step.days }}天</span>
+                                            <span><i class="fas fa-clock"></i> 间隔{{ step.days }}天</span>
                                             <span><i :class="step.channelIcon"></i>
                                                 {{ getChannelName(step.type) }}</span>
                                         </div>
@@ -708,7 +708,7 @@
                             class="preview-step">
                             <div class="preview-content">
                                 <div class="preview-title">{{ step.name }}</div>
-                                <div class="preview-meta">第{{ step.days }}天 · {{ getChannelName(step.type) }}</div>
+                                <div class="preview-meta">间隔{{ step.days }}天 · {{ getChannelName(step.type) }}</div>
                             </div>
                         </div>
                         <div v-if="customSopData.details.filter(s => s.name).length === 0" class="preview-empty">
@@ -904,6 +904,11 @@
             ElMessage.error('请选择目标客户')
             return
         }
+        if (customerList.value.length > 500) {
+            currentStep.value = 2
+            ElMessage.error('目标客户数量限500个以内')
+            return
+        }
         try {
             loading.value = true
             const typeMap = { prospect: 1, nurture: 2, reactivate: 3, promote: 4, seasonal: 5, exhibition: 6, other: 7 }
@@ -1164,7 +1169,18 @@
         ElMessage.success('删除成功')
     }
 
-    const addCustomer = (data) => {
+    const addCustomer = (data, type) => {
+        if(type == 'all') {
+            customerList.value = customerList.value.concat(data)
+            // 去重
+            customerList.value = customerList.value.filter((item, index, self) => {
+                return index === self.findIndex((t) => (
+                    t.id === item.id
+                ))
+            })
+            ElMessage.success('添加成功')
+            return
+        }
         if(customerList.value.find(item => item.id === data.id)) {
             ElMessage.warning('客户已存在')
             return

+ 26 - 8
ui/smarttrade-platform/src/components/marketing/customerDetail.vue

@@ -92,14 +92,19 @@
                                 </div>
                             </div>
                         </div>
-                        <el-pagination
-                            :total="total"
-                            style="text-align: right;"
-                            :current-page="customerParams.pageIndex"
-                            :page-size="customerParams.pageSize"
-                            layout="total, prev, pager, next"
-                            @current-change="customerCurrentChange">
-                        </el-pagination>
+                        <div class="bottom-div">
+                            <el-pagination
+                                :total="total"
+                                style="text-align: right;"
+                                :current-page="customerParams.pageIndex"
+                                :page-size="customerParams.pageSize"
+                                layout="total, prev, pager, next"
+                                @current-change="customerCurrentChange">
+                            </el-pagination>
+                            <button class="btn btn-primary" @click="allAddCustomer" v-if="modalType == 'add'">
+                                <el-icon><Plus /></el-icon>全部添加
+                            </button>
+                        </div>
                     </template>
                     <div v-else class="empty-state">暂无客户数据</div>
                 </div>
@@ -230,6 +235,10 @@
         emits('add', data)
     }
 
+    const allAddCustomer = () => {
+        emits('add', customers.value, 'all')
+    }
+
     defineExpose({
         open
     })
@@ -452,4 +461,13 @@
         flex-direction: column;
         margin-top: 16px;
     }
+    .bottom-div{
+        position: relative;
+        margin-top: 10px;
+    }
+    .bottom-div .btn{
+        position: absolute;
+        bottom: 0;
+        right: 25px;
+    }
 </style>

+ 2 - 1
ui/smarttrade-platform/src/components/marketing/interventionCustomers.vue

@@ -59,6 +59,7 @@
 <script setup>
     import { ref } from 'vue';
     import { getInterventionCustomer, setProtectCustomer, setSuspendCustomer } from '@/api/marketing'
+    import { ElMessageBox } from 'element-plus'
 
     const showInterventionModal = ref(false);
     // 客户保护白名单 - 防止AI营销影响
@@ -81,7 +82,7 @@
 
     const unprotectCustomer = (customer) => {
       ElMessageBox.confirm(
-        `请确认是否${ tabType == 'protect' ? '移除保护' : '取消暂停' }?`,
+        `请确认是否${ tabType.value == 'protect' ? '移除保护' : '取消暂停' }?`,
         '提示',
         {
           confirmButtonText: '确认',

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

@@ -157,4 +157,7 @@
 
 <style scoped>
     @import '../../assets/styles/marketing.css';
+    .customer-item{
+      justify-content: space-between;
+    }
 </style>