|
|
@@ -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>
|