lmx 3 дней назад
Родитель
Сommit
d62b365c0b

+ 2 - 2
src/views/crm/components/customerCallLogList.vue

@@ -42,11 +42,11 @@
                                 <span v-else>-</span>
                             </template>
                         </el-table-column>
-            <el-table-column label="通话费用" align="center" prop="cost" width="90">
+            <!-- <el-table-column label="通话费用" align="center" prop="cost" width="90">
                 <template slot-scope="scope">
                     <span v-if="scope.row.cost != null">{{ Number(scope.row.cost).toFixed(2) }}</span>
                 </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column label="创建时间" align="center" prop="createTime" width="165">
                 <template slot-scope="scope">
                     <span>{{ formatCreateTime(scope.row.createTime) }}</span>

+ 43 - 3
src/views/crm/components/customerDetails.vue

@@ -50,6 +50,10 @@
                                @click="handleAddRemark()"
                     >备注
                     </el-button>
+                    <el-button type="success" size="small" icon="el-icon-chat-dot-round"
+                               @click="handleViewHistory()"
+                    >查看历史沟通
+                    </el-button>
                     <el-button size="small" v-if="showDuplicate" v-hasPermi="['crm:customer:lookDuplicate']"
                                @click="getDetails"
                     >
@@ -358,6 +362,17 @@
         <el-drawer size="75%" :modal="false" :title="duplicate.title" :visible.sync="duplicate.open">
             <duplicate-customer ref="duplicateCustomer"/>
         </el-drawer>
+
+        <!-- 历史沟通弹窗(只读) -->
+        <el-dialog :title="historyDialog.title" :visible.sync="historyDialog.open" width="700px" append-to-body :show-close="true" class="customer-dialog">
+            <div class="history-communication-content">
+                <pre v-if="item && item.historicalCommunication" class="history-text">{{ item.historicalCommunication }}</pre>
+                <el-empty v-else description="暂无历史沟通记录"></el-empty>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="historyDialog.open = false">关 闭</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
@@ -438,7 +453,9 @@ export default {
             showRealPhone: false,
             realPhone: '',
             // 手动外呼记录总条数,用于控制“查看电话”按钮是否展示
-            callLogTotal: 0
+            callLogTotal: 0,
+            // 历史沟通弹窗
+            historyDialog: { open: false, title: '历史沟通' }
         }
     },
     created() {
@@ -573,9 +590,9 @@ export default {
             this.customerId = customerId
             var that = this
             this.exts = []
-            // 查询手动外呼记录总条数,仅当存在记录时才展示“查看电话”按钮;无权限时不调用避免 403
+            // 查询“已接通”的手动外呼记录总条数(minCallTime=0即 call_time>0),与主页列表“沟通次数”口径一致;无权限时不调用避免 403
             if (checkPermi(['crm:customerCallLog:list'])) {
-                listCustomerCallLog({ customerId: customerId, pageNum: 1, pageSize: 1 }).then(res => {
+                listCustomerCallLog({ customerId: customerId, minCallTime: 0, pageNum: 1, pageSize: 1 }).then(res => {
                     this.callLogTotal = res.total || 0
                 }).catch(() => {
                     this.callLogTotal = 0
@@ -641,6 +658,10 @@ export default {
         desensitizePhone(phone) {
             if (!phone || phone.length < 7) return phone;
             return phone.substring(0, 3) + '****' + phone.substring(phone.length - 4);
+        },
+        // 打开历史沟通弹窗(数据复用 item.historicalCommunication,无需额外请求)
+        handleViewHistory() {
+            this.historyDialog.open = true
         }
     }
 }
@@ -814,4 +835,23 @@ export default {
         top: 20px;
     }
 }
+
+.history-communication-content {
+    max-height: 500px;
+    overflow-y: auto;
+    padding: 4px 8px;
+
+    .history-text {
+        margin: 0;
+        padding: 16px;
+        background: #fafbfc;
+        border-radius: 6px;
+        color: #303133;
+        font-size: 14px;
+        line-height: 1.8;
+        white-space: pre-wrap;
+        word-break: break-word;
+        font-family: inherit;
+    }
+}
 </style>

+ 17 - 2
src/views/crm/customer/my.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
       <el-form-item label="客户编码" prop="customerCode">
         <el-input
           style="width:220px"
@@ -99,6 +99,12 @@
             <el-option key="0"  label="未下单" value="0" />
           </el-select>
       </el-form-item>
+      <el-form-item label="是否已沟通" prop="isManualCall">
+          <el-select style="width:220px" filterable v-model="queryParams.isManualCall" placeholder="请选择是否已沟通" clearable size="small">
+            <el-option key="1" label="已沟通" value="1" />
+            <el-option key="0" label="未沟通" value="0" />
+          </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -173,6 +179,11 @@
           </el-button>
         </template>
       </el-table-column>
+      <el-table-column label="沟通次数" align="center" prop="manualCallCount" width="100">
+        <template slot-scope="scope">
+          <span>{{ scope.row.manualCallCount || 0 }}</span>
+        </template>
+      </el-table-column>
       <el-table-column  label="客户来源" align="center" prop="source">
         <template slot-scope="scope">
             <el-tag prop="status" v-for="(item, index) in sourceOptions"    v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
@@ -428,7 +439,9 @@ export default {
         companyId: null,
         isLine: null,
         source: null,
-        tags: null
+        tags: null,
+        // 是否已沟通筛选(call_time>0 计打通):'1'-已沟通,'0'-未沟通,null-不筛选
+        isManualCall: null
       },
       // 表单参数
       form: {
@@ -762,6 +775,8 @@ export default {
       this.manualCallDialog.companyId = null;
       this.manualCallDialog.companyUserId = null;
       this.manualCallDialog.workflowInstanceId = null;
+      // 完成手动外呼关闭弹窗后刷新列表,保证“是否已外呼”筛选及外呼次数列数据同步
+      this.getList();
     }
   }
 };