Procházet zdrojové kódy

平台级黑名单

yuhongqi před 6 dny
rodič
revize
6d119cf65f

+ 38 - 9
src/api/company/companyVoiceBlacklist.js

@@ -1,15 +1,21 @@
 import request from '@/utils/request'
 
-// 查询黑名单管理列表
+/** 租户级黑名单 businessType=12 */
+const TENANT_BLACKLIST_TYPE = '12'
+
+// 查询租户级黑名单列表
 export function listApi(query) {
   return request({
     url: '/company/companyVoiceBlacklist/list',
     method: 'get',
-    params: query
+    params: {
+      ...query,
+      businessType: query.businessType || TENANT_BLACKLIST_TYPE
+    }
   })
 }
 
-// 查询黑名单管理详细
+// 查询黑名单详情
 export function getApi(id) {
   return request({
     url: '/company/companyVoiceBlacklist/' + id,
@@ -17,28 +23,51 @@ export function getApi(id) {
   })
 }
 
-// 新增黑名单管理
+// 新增黑名单
 export function addApi(data) {
   return request({
     url: '/company/companyVoiceBlacklist',
     method: 'post',
-    data: data
+    data: {
+      ...data,
+      businessType: TENANT_BLACKLIST_TYPE
+    }
   })
 }
 
-// 修改黑名单管理
+// 修改黑名单
 export function updateApi(data) {
   return request({
     url: '/company/companyVoiceBlacklist',
     method: 'put',
+    data: {
+      ...data,
+      businessType: TENANT_BLACKLIST_TYPE
+    }
+  })
+}
+
+// 修改黑名单状态
+export function changeStatusApi(data) {
+  return request({
+    url: '/company/companyVoiceBlacklist/changeStatus',
+    method: 'put',
     data: data
   })
 }
 
-// 删除黑名单管理
-export function delApi(id) {
+// 删除黑名单(支持单个或逗号分隔多个ID)
+export function delApi(ids) {
   return request({
-    url: '/company/companyVoiceBlacklist/' + id,
+    url: '/company/companyVoiceBlacklist/' + ids,
     method: 'delete'
   })
 }
+
+// 查看解密手机号
+export function queryPhoneApi(id) {
+  return request({
+    url: '/company/companyVoiceBlacklist/queryPhone/' + id,
+    method: 'get'
+  })
+}

+ 31 - 0
src/api/company/companyVoiceBlacklistIntercept.js

@@ -0,0 +1,31 @@
+import request from '@/utils/request'
+
+export function listInterceptLog(query) {
+  return request({
+    url: '/company/companyVoiceBlacklistIntercept/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getInterceptLog(id) {
+  return request({
+    url: '/company/companyVoiceBlacklistIntercept/' + id,
+    method: 'get'
+  })
+}
+
+export function queryInterceptLogPhone(id) {
+  return request({
+    url: '/company/companyVoiceBlacklistIntercept/queryPhone/' + id,
+    method: 'get'
+  })
+}
+
+export function exportInterceptLog(data) {
+  return request({
+    url: '/company/companyVoiceBlacklistIntercept/export',
+    method: 'post',
+    data: data
+  })
+}

+ 450 - 29
src/views/company/companyVoiceBlacklist/index.vue

@@ -1,46 +1,272 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
-      <el-form-item label="关键词" prop="keyword">
-        <el-input v-model="queryParams.keyword" placeholder="请输入关键词" clearable size="small"
-          @keyup.enter.native="handleQuery" />
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="80px"
+      @submit.native.prevent
+    >
+      <el-form-item label="对象类型" prop="targetType">
+        <el-select
+          v-model="queryParams.targetType"
+          placeholder="请选择对象类型"
+          clearable
+          size="small"
+          style="width: 160px"
+        >
+          <el-option label="手机号" :value="1" />
+          <el-option label="客户ID" :value="2" />
+          <el-option label="企微客户ID" :value="3" />
+        </el-select>
       </el-form-item>
+
+      <el-form-item label="对象值" prop="targetValue">
+        <el-input
+          v-model="queryParams.targetValue"
+          placeholder="请输入手机号/客户ID/企微客户ID"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="状态" prop="status">
+        <el-select
+          v-model="queryParams.status"
+          placeholder="请选择状态"
+          clearable
+          size="small"
+          style="width: 140px"
+        >
+          <el-option label="生效" :value="1" />
+          <el-option label="失效" :value="0" />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="来源" prop="source">
+        <el-select
+          v-model="queryParams.source"
+          placeholder="请选择来源"
+          clearable
+          size="small"
+          style="width: 140px"
+        >
+          <el-option label="手动添加" :value="1" />
+          <el-option label="外部系统同步" :value="2" />
+        </el-select>
+      </el-form-item>
+
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
+
     <el-row :gutter="10" class="mb8">
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['company:companyVoiceBlacklist:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate()"
+          v-hasPermi="['company:companyVoiceBlacklist:update']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDeleteBatch"
+          v-hasPermi="['company:companyVoiceBlacklist:remove']"
+        >删除</el-button>
+      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-tag type="warning" size="small">租户级黑名单</el-tag>-->
+<!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
     </el-row>
-    <el-table v-loading="loading" :data="list">
-      <el-table-column type="selection" width="50" align="center" />
+
+    <el-table v-loading="loading" :data="list" border @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="ID" align="center" prop="id" width="80" />
-      <el-table-column label="黑名单号码" align="center" prop="phone" width="140" />
-      <el-table-column label="黑名单类型" align="center" prop="blacklistType" width="120" />
-      <el-table-column label="原因" align="center" prop="reason" />
-      <el-table-column label="状态" align="center" prop="status" width="80">
+      <el-table-column label="对象类型" align="center" prop="targetType" width="120">
+        <template slot-scope="scope">
+          <span v-if="isPhoneTargetType(scope.row)">手机号</span>
+          <span v-else-if="scope.row.targetType === 2 || scope.row.targetType === '2'">客户ID</span>
+          <span v-else-if="scope.row.targetType === 3 || scope.row.targetType === '3'">企微客户ID</span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="对象值" align="center" prop="targetValue" min-width="220">
+        <template slot-scope="scope">
+          <div v-if="isPhoneTargetType(scope.row)" class="target-value-cell">
+            <span class="target-value-text" :title="scope.row.targetValue">{{ scope.row.targetValue }}</span>
+            <el-tooltip content="查看完整手机号" placement="top">
+              <el-button
+                type="text"
+                size="mini"
+                class="target-value-phone-btn"
+                @click="handlePhone(scope)"
+                v-hasPermi="['company:companyVoiceBlacklist:queryPhone']"
+              >
+                <i class="el-icon-zoom-in"></i>
+              </el-button>
+            </el-tooltip>
+          </div>
+          <span v-else class="target-value-text" :title="scope.row.targetValue">{{ scope.row.targetValue }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="拉黑原因" align="center" prop="reason" min-width="160" show-overflow-tooltip />
+      <el-table-column label="来源" align="center" prop="source" width="100">
         <template slot-scope="scope">
-          <el-tag :type="scope.row.status==='0'?'success':'danger'" size="small">{{ scope.row.status==='0'?'启用':'停用' }}</el-tag>
+          <el-tag v-if="scope.row.source === 1" size="mini">手动添加</el-tag>
+          <el-tag v-else-if="scope.row.source === 2" type="info" size="mini">系统同步</el-tag>
+          <span v-else>-</span>
         </template>
       </el-table-column>
+      <el-table-column label="状态" align="center" prop="status" width="90">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status === 1" type="success" size="mini">生效</el-tag>
+          <el-tag v-else type="danger" size="mini">失效</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" min-width="140" show-overflow-tooltip />
+      <el-table-column label="创建人" align="center" prop="createBy" width="110" />
       <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
         <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)"
-            v-hasPermi="['company:companyVoiceBlacklist:query']">详情</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-            v-hasPermi="['company:companyVoiceBlacklist:remove']">删除</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['company:companyVoiceBlacklist:update']"
+          >修改</el-button>
+          <el-button
+            v-if="scope.row.status === 0"
+            size="mini"
+            type="text"
+            @click="handleChangeStatus(scope.row, 1)"
+            v-hasPermi="['company:companyVoiceBlacklist:update']"
+          >启用</el-button>
+          <el-button
+            v-if="scope.row.status === 1"
+            size="mini"
+            type="text"
+            @click="handleChangeStatus(scope.row, 0)"
+            v-hasPermi="['company:companyVoiceBlacklist:update']"
+          >失效</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['company:companyVoiceBlacklist:remove']"
+          >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize" @pagination="getList" />
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 新增/修改弹窗 -->
+    <el-dialog :title="title" :visible.sync="open" width="680px" append-to-body @close="reset">
+      <el-form ref="form" :model="form" :rules="rules" label-width="95px">
+<!--        <el-form-item label="黑名单级别">-->
+<!--          <el-tag type="warning">租户级</el-tag>-->
+<!--        </el-form-item>-->
+
+        <el-form-item label="对象类型" prop="targetType">
+          <el-select v-model="form.targetType" placeholder="请选择对象类型" style="width: 100%">
+            <el-option label="手机号" :value="1" />
+            <el-option label="客户ID" :value="2" />
+            <el-option label="企微客户ID" :value="3" />
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="对象值" prop="targetValue">
+          <el-input
+            v-model="form.targetValue"
+            :placeholder="isEditForm ? '不填写则不修改对象值' : '请输入手机号 / 客户ID / 企微客户ID'"
+            maxlength="128"
+            show-word-limit
+            clearable
+          />
+        </el-form-item>
+
+        <el-form-item label="拉黑原因" prop="reason">
+          <el-input
+            v-model="form.reason"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入拉黑原因"
+            maxlength="255"
+            show-word-limit
+          />
+        </el-form-item>
+
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            v-model="form.remark"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入备注"
+            maxlength="500"
+            show-word-limit
+          />
+        </el-form-item>
+
+        <el-form-item label="状态" prop="status">
+          <el-radio-group v-model="form.status">
+            <el-radio :label="1">生效</el-radio>
+            <el-radio :label="0">失效</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listApi, delApi } from '@/api/company/companyVoiceBlacklist'
+import {
+  listApi,
+  getApi,
+  addApi,
+  updateApi,
+  delApi,
+  queryPhoneApi,
+  changeStatusApi
+} from '@/api/company/companyVoiceBlacklist'
+
+const TENANT_BLACKLIST_TYPE = '12'
 
 export default {
   name: 'CompanyVoiceBlacklist',
@@ -50,24 +276,76 @@ export default {
       showSearch: true,
       total: 0,
       list: [],
+      ids: [],
+      single: true,
+      multiple: true,
+      title: '',
+      open: false,
+      form: {},
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        keyword: null
+        businessType: TENANT_BLACKLIST_TYPE,
+        targetType: null,
+        targetValue: null,
+        status: null,
+        source: null
+      }
+    }
+  },
+  computed: {
+    rules() {
+      const targetValueRules = this.isEditForm
+        ? []
+        : [
+            { required: true, message: '对象值不能为空', trigger: 'blur' },
+            { required: true, message: '对象值不能为空', trigger: 'change' }
+          ]
+      return {
+        targetType: [
+          { required: true, message: '对象类型不能为空', trigger: 'change' }
+        ],
+        targetValue: targetValueRules
       }
+    },
+    isEditForm() {
+      return this.form.id !== undefined && this.form.id !== null && this.form.id !== ''
     }
   },
   created() {
     this.getList()
   },
   methods: {
+    isPhoneTargetType(row) {
+      return row && (row.targetType === 1 || row.targetType === '1')
+    },
     getList() {
       this.loading = true
       listApi(this.queryParams).then(res => {
-        this.list = res.rows || (res.data && res.data.list) || []
-        this.total = res.total || (res.data && res.data.total) || 0
+        this.list = res.rows || []
+        this.total = res.total || 0
         this.loading = false
-      }).catch(() => { this.loading = false })
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    reset() {
+      this.form = {
+        id: null,
+        businessType: TENANT_BLACKLIST_TYPE,
+        targetType: 1,
+        targetValue: null,
+        reason: null,
+        source: 1,
+        status: 1,
+        remark: null
+      }
+      this.resetForm('form')
     },
     handleQuery() {
       this.queryParams.pageNum = 1
@@ -75,19 +353,162 @@ export default {
     },
     resetQuery() {
       this.resetForm('queryForm')
+      this.queryParams.businessType = TENANT_BLACKLIST_TYPE
       this.handleQuery()
     },
-    handleDetail(row) {
-      this.$message.info('详情功能开发中')
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = '新增黑名单'
+    },
+    handleUpdate(row) {
+      const id = row && row.id != null ? row.id : this.ids[0]
+      if (!id) {
+        this.msgWarning('请选择要修改的数据')
+        return
+      }
+      this.reset()
+      getApi(id).then(res => {
+        this.form = res.data || {}
+        this.form.businessType = TENANT_BLACKLIST_TYPE
+        // 修改时不回显对象值(含手机号),按 id 更新其他字段;需改对象值时再填写
+        this.form.targetValue = null
+        this.open = true
+        this.title = '修改黑名单'
+        this.$nextTick(() => {
+          if (this.$refs.form) {
+            this.$refs.form.clearValidate()
+          }
+        })
+      })
+    },
+    isSubmitSuccess(res) {
+      const code = res && res.code !== undefined ? res.code : 200
+      return Number(code) === 200
+    },
+    /** 提交成功:关闭弹窗、重置表单、刷新列表 */
+    handleSubmitSuccess(res) {
+      const msg = (res && res.msg) || '操作成功'
+      this.open = false
+      this.msgSuccess(msg)
+      this.$nextTick(() => {
+        this.reset()
+        this.getList()
+      })
+    },
+    submitForm() {
+      this.$refs.form.validate(valid => {
+        if (!valid) {
+          return
+        }
+        const payload = {
+          ...this.form,
+          businessType: TENANT_BLACKLIST_TYPE
+        }
+        if (this.isEditForm) {
+          if (!payload.targetValue) {
+            delete payload.targetValue
+          }
+          updateApi(payload).then(res => {
+            if (this.isSubmitSuccess(res)) {
+              this.handleSubmitSuccess(res)
+            } else {
+              this.msgError((res && res.msg) || '修改失败')
+            }
+          })
+        } else {
+          const targetValue = payload.targetValue != null ? String(payload.targetValue).trim() : ''
+          if (!targetValue) {
+            this.msgWarning('对象值不能为空')
+            return
+          }
+          payload.targetValue = targetValue
+          addApi(payload).then(res => {
+            if (this.isSubmitSuccess(res)) {
+              this.handleSubmitSuccess(res)
+            } else {
+              this.msgError((res && res.msg) || '新增失败')
+            }
+          })
+        }
+      })
+    },
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    handleChangeStatus(row, status) {
+      const text = status === 1 ? '启用' : '失效'
+      this.$confirm('确认要' + text + '该黑名单吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return changeStatusApi({ id: row.id, status: status })
+      }).then(() => {
+        this.msgSuccess(text + '成功')
+        this.getList()
+      }).catch(() => {})
+    },
+    handlePhone(scope) {
+      queryPhoneApi(scope.row.id).then(res => {
+        const mobile = res.mobile || (res.data && res.data.mobile)
+        if (mobile) {
+          scope.row.targetValue = mobile
+        } else {
+          this.$modal.msgError(res.msg || '获取手机号失败')
+        }
+      })
     },
     handleDelete(row) {
-      this.$modal.confirm('是否确认删除?').then(() => {
-        return delApi(row.id)
+      const ids = row && row.id != null && row.id !== '' ? row.id : this.ids
+      const idStr = Array.isArray(ids) ? ids.join(',') : ids
+      if (!idStr) {
+        this.msgWarning('请选择要删除的数据')
+        return
+      }
+      this.$confirm('是否确认删除黑名单编号为"' + idStr + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return delApi(idStr)
       }).then(() => {
         this.getList()
-        this.$modal.msgSuccess('删除成功')
+        this.msgSuccess('删除成功')
       }).catch(() => {})
+    },
+    handleDeleteBatch() {
+      if (!this.ids.length) {
+        this.msgWarning('请选择要删除的数据')
+        return
+      }
+      this.handleDelete({ id: this.ids.join(',') })
     }
   }
 }
 </script>
+
+<style scoped>
+.target-value-cell {
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  max-width: 100%;
+}
+
+.target-value-text {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  max-width: calc(100% - 28px);
+}
+
+.target-value-phone-btn {
+  flex-shrink: 0;
+  margin-left: 4px;
+  padding: 0 4px;
+  font-size: 16px;
+  color: #409eff;
+}
+</style>

+ 294 - 0
src/views/company/companyVoiceBlacklistIntercept/index.vue

@@ -0,0 +1,294 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="80px"
+      @submit.native.prevent
+    >
+      <el-form-item label="业务场景" prop="sceneCode">
+        <el-select
+          v-model="queryParams.sceneCode"
+          placeholder="请选择业务场景"
+          clearable
+          size="small"
+          style="width: 140px"
+        >
+          <el-option label="外呼" value="CALL" />
+          <el-option label="短信" value="SMS" />
+          <el-option label="加微" value="ADD_WX" />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="对象类型" prop="targetType">
+        <el-select
+          v-model="queryParams.targetType"
+          placeholder="请选择对象类型"
+          clearable
+          size="small"
+          style="width: 160px"
+        >
+          <el-option label="手机号" :value="1" />
+          <el-option label="客户ID" :value="2" />
+          <el-option label="企微客户ID" :value="3" />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="对象值" prop="targetValue">
+        <el-input
+          v-model="queryParams.targetValue"
+          placeholder="请输入对象值"
+          clearable
+          size="small"
+          style="width: 220px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="拦截时间">
+        <el-date-picker
+          v-model="dateRange"
+          size="small"
+          style="width: 340px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="-"
+          start-placeholder="开始时间"
+          end-placeholder="结束时间"
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['company:companyVoiceBlacklistIntercept:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
+    </el-row>
+
+    <el-table v-loading="loading" :data="list" border>
+      <el-table-column label="ID" align="center" prop="id" width="80" />
+      <el-table-column label="业务场景" align="center" prop="sceneCode" width="100">
+        <template slot-scope="scope">
+          <span>{{ formatSceneCode(scope.row.sceneCode) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="对象类型" align="center" prop="targetType" width="110">
+        <template slot-scope="scope">
+          <span v-if="isPhoneTargetType(scope.row)">手机号</span>
+          <span v-else-if="scope.row.targetType === 2 || scope.row.targetType === '2'">客户ID</span>
+          <span v-else-if="scope.row.targetType === 3 || scope.row.targetType === '3'">企微客户ID</span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="对象值" align="center" prop="targetValue" min-width="200">
+        <template slot-scope="scope">
+          <div v-if="isPhoneTargetType(scope.row)" class="target-value-cell">
+            <span class="target-value-text" :title="scope.row.targetValue">{{ scope.row.targetValue }}</span>
+            <el-tooltip content="查看完整手机号" placement="top">
+              <el-button
+                type="text"
+                size="mini"
+                class="target-value-phone-btn"
+                @click="handlePhone(scope)"
+                v-hasPermi="['company:companyVoiceBlacklistIntercept:queryPhone']"
+              >
+                <i class="el-icon-zoom-in"></i>
+              </el-button>
+            </el-tooltip>
+          </div>
+          <span v-else class="target-value-text" :title="scope.row.targetValue">{{ scope.row.targetValue }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="拦截说明" align="center" prop="interceptReason" min-width="180" show-overflow-tooltip />
+      <el-table-column label="拉黑原因" align="center" prop="blacklistReason" min-width="140" show-overflow-tooltip />
+      <el-table-column label="黑名单ID" align="center" prop="blacklistId" width="90" />
+      <el-table-column label="客户ID" align="center" prop="customerId" width="90" />
+      <el-table-column label="外呼任务ID" align="center" prop="roboticId" width="100" />
+      <el-table-column label="拦截时间" align="center" prop="createTime" width="160" />
+      <el-table-column label="操作" align="center" width="80" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleDetail(scope.row)"
+            v-hasPermi="['company:companyVoiceBlacklistIntercept:query']"
+          >详情</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <el-dialog title="拦截明细详情" :visible.sync="detailOpen" width="640px" append-to-body>
+      <el-descriptions v-if="detail" :column="1" border size="small">
+        <el-descriptions-item label="ID">{{ detail.id }}</el-descriptions-item>
+        <el-descriptions-item label="业务场景">{{ formatSceneCode(detail.sceneCode) }}</el-descriptions-item>
+        <el-descriptions-item label="对象类型">{{ formatTargetType(detail.targetType) }}</el-descriptions-item>
+        <el-descriptions-item label="对象值">{{ detail.targetValue }}</el-descriptions-item>
+        <el-descriptions-item label="拦截说明">{{ detail.interceptReason || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="拉黑原因">{{ detail.blacklistReason || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="黑名单ID">{{ detail.blacklistId || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="客户ID">{{ detail.customerId || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="被叫人ID">{{ detail.calleeId || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="外呼任务ID">{{ detail.roboticId || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="操作人ID">{{ detail.companyUserId || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="业务ID">{{ detail.bizId || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="拦截时间">{{ detail.createTime || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="备注">{{ detail.remark || '-' }}</el-descriptions-item>
+      </el-descriptions>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="detailOpen = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listInterceptLog,
+  getInterceptLog,
+  queryInterceptLogPhone,
+  exportInterceptLog
+} from '@/api/company/companyVoiceBlacklistIntercept'
+
+export default {
+  name: 'CompanyVoiceBlacklistIntercept',
+  data() {
+    return {
+      loading: true,
+      exportLoading: false,
+      showSearch: true,
+      total: 0,
+      list: [],
+      dateRange: [],
+      detailOpen: false,
+      detail: null,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sceneCode: null,
+        targetType: null,
+        targetValue: null
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    isPhoneTargetType(row) {
+      return row && (row.targetType === 1 || row.targetType === '1')
+    },
+    formatSceneCode(code) {
+      if (code === 'CALL') return '外呼'
+      if (code === 'SMS') return '短信'
+      if (code === 'ADD_WX') return '加微'
+      return code || '-'
+    },
+    formatTargetType(targetType) {
+      if (targetType === 1 || targetType === '1') return '手机号'
+      if (targetType === 2 || targetType === '2') return '客户ID'
+      if (targetType === 3 || targetType === '3') return '企微客户ID'
+      return '-'
+    },
+    getList() {
+      this.loading = true
+      listInterceptLog(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
+        this.list = res.rows || []
+        this.total = res.total || 0
+        this.loading = false
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    resetQuery() {
+      this.dateRange = []
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    handleDetail(row) {
+      getInterceptLog(row.id).then(res => {
+        this.detail = res.data || {}
+        this.detailOpen = true
+      })
+    },
+    handlePhone(scope) {
+      queryInterceptLogPhone(scope.row.id).then(res => {
+        const mobile = res.mobile || (res.data && res.data.mobile)
+        if (mobile) {
+          scope.row.targetValue = mobile
+        } else {
+          this.msgError(res.msg || '获取手机号失败')
+        }
+      })
+    },
+    handleExport() {
+      this.$confirm('是否确认导出黑名单拦截明细数据?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.exportLoading = true
+        const params = this.addDateRange({ ...this.queryParams }, this.dateRange)
+        return exportInterceptLog(params)
+      }).then(response => {
+        this.download(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+        this.exportLoading = false
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.target-value-cell {
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  max-width: 100%;
+}
+
+.target-value-text {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  max-width: calc(100% - 28px);
+}
+
+.target-value-phone-btn {
+  flex-shrink: 0;
+  margin-left: 4px;
+  padding: 0 4px;
+  font-size: 16px;
+  color: #409eff;
+}
+</style>