Просмотр исходного кода

追加客户& 执行日志支持查看录音

lmx 2 месяцев назад
Родитель
Сommit
ec2cbb0b95

+ 8 - 0
src/api/company/companyVoiceRobotic.js

@@ -196,3 +196,11 @@ export function pauseRoboticActive(data) {
   })
 }
 
+// 追加客户到运行中任务
+export function appendCustomers(data) {
+  return request({
+    url: '/company/companyVoiceRobotic/appendCustomers',
+    method: 'post',
+    data: data
+  })
+}

+ 106 - 3
src/views/company/companyVoiceRobotic/index.vue

@@ -190,6 +190,13 @@
             @click="stopRoboticFun(scope.row.taskId)"
             v-hasPermi="['system:companyVoiceRobotic:list']"
           >停止任务</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            v-if="scope.row.taskType == 1 && scope.row.taskStatus == 1"
+            :loading="actionLoading[scope.row.id + '_append']"
+            @click="handleAppendCustomers(scope.row)"
+          >追加客户</el-button>
           <el-button
             size="mini"
             type="text"
@@ -475,6 +482,7 @@
       </div>
     </el-drawer>
     <customer-select @success="selectFun" ref="customer"/>
+    <append-customer-select @success="appendSelectFun" ref="appendCustomer" />
     <component
       :is="getCurrentComponent()"
       @success="selectQwUserFun"
@@ -871,6 +879,11 @@
               <span>手机号:{{ contentDialog.customerPhone || '-' }}</span>
           </div>
 
+          <div v-if="contentDialog.recordPath" class="content-dialog-audio">
+              <span class="audio-label">录音播放:</span>
+              <audio controls :src="handleRecordPath(contentDialog.recordPath)"></audio>
+          </div>
+
           <div v-if="!contentDialog.content" class="content-empty">
               暂无对话内容
           </div>
@@ -918,11 +931,13 @@ import {
   // getCIDGroupList,
   getExecRecords,
   getCurrentCompanyId,
-  pauseRoboticActive
+  pauseRoboticActive,
+  appendCustomers
 } from "@/api/company/companyVoiceRobotic";
 import draggable from 'vuedraggable'
 // import { listAll } from '@/api/company/wxDialog';
 import customerSelect from '@/views/crm/components/CustomerSelect.vue';
+import appendCustomerSelect from '@/views/crm/components/AppendCustomerSelect.vue';
 import qwUserSelect from '@/views/components/QwUserSelect.vue';
 import qwUserSelectTwo from '@/views/components/QwUserSelectTwo.vue';
 import customerDetails from "@/views/crm/components/customerDetails.vue";
@@ -935,7 +950,7 @@ import AiTagPanel from "../../crm/components/AiTagPanel.vue";
 
 export default {
   name: "Robotic",
-  components: {AiTagPanel, draggable, customerDetails, customerSelect, qwUserSelect,qwUserSelectTwo,CallCenterPhoneBar},
+  components: {AiTagPanel, draggable, customerDetails, customerSelect, appendCustomerSelect, qwUserSelect,qwUserSelectTwo,CallCenterPhoneBar},
   data() {
     return {
       submitFormLoading:false,
@@ -1084,7 +1099,8 @@ export default {
         visible: false,
         content: '',
         customerName: '',
-        customerPhone: ''
+        customerPhone: '',
+        recordPath: ''
       },
       // 表单校验
       rules: {
@@ -1544,6 +1560,60 @@ export default {
         this.$set(this.actionLoading, key, false);
       });
     },
+    // 追加客户
+    handleAppendCustomers(row) {
+      this._appendRow = row;
+      const key = row.id + '_append';
+      this.$set(this.actionLoading, key, true);
+      // 获取当前任务已有的客户ID列表
+      calleesList({ id: row.id, pageNum: 1, pageSize: 99999 }).then(res => {
+        const existingIds = (res.rows || []).map(item => item.userId).filter(id => id != null);
+        this.$refs.appendCustomer.setRowsDesignatedCompany([], this.currentCompanyId);
+        this.$nextTick(() => {
+          this.$refs.appendCustomer.setExcludeCustomerIds(existingIds);
+        });
+      }).catch(() => {
+        this.$refs.appendCustomer.setRowsDesignatedCompany([], this.currentCompanyId);
+      }).finally(() => {
+        this.$set(this.actionLoading, key, false);
+      });
+    },
+    // 追加客户选择回调
+    appendSelectFun(data) {
+      const row = this._appendRow;
+      if (!row) return;
+      const key = row.id + '_append';
+      this.$set(this.actionLoading, key, true);
+      appendCustomers({
+        taskId: row.id,
+        customerIds: data.ids
+      }).then(res => {
+        if (res.code === 200) {
+          const successCount = res.successCount || 0;
+          const dupNames = res.duplicateCustomerNames || '';
+          const errors = res.errorMessages || [];
+          if (successCount > 0) {
+            this.$message.success(`成功追加 ${successCount} 位客户`);
+          }
+          if (dupNames) {
+            this.$message.warning(`以下客户已存在于任务中,已跳过:${dupNames}`);
+          }
+          if (errors.length > 0) {
+            this.$message.error(errors.join(';'));
+          }
+          if (successCount === 0 && !dupNames && errors.length === 0) {
+            this.$message.info('未追加任何客户');
+          }
+        } else {
+          this.$message.error(res.msg || '追加客户失败');
+        }
+      }).catch(err => {
+        this.$message.error('追加客户请求失败');
+      }).finally(() => {
+        this.$set(this.actionLoading, key, false);
+        this._appendRow = null;
+      });
+    },
     stopRoboticFun(id){
       const key = id + '_stop';
       this.$set(this.actionLoading, key, true);
@@ -1804,6 +1874,7 @@ export default {
       this.contentDialog.customerName = record.customerName || '';
       this.contentDialog.customerPhone = record.customerPhone || '';
       this.contentDialog.content = log.nodeContentList || '';
+      this.contentDialog.recordPath = log.nodeRecordPath || '';
       this.contentDialog.visible = true;
     },
 
@@ -1830,6 +1901,16 @@ export default {
           return []
       }
     },
+    handleRecordPath(url) {
+      if (!url) return '';
+      let fullUrl = '';
+      if (url.startsWith('http')) {
+        fullUrl = url;
+      } else {
+        fullUrl = 'http://129.28.164.235:8899/recordings/files?filename=' + url;
+      }
+      return process.env.VUE_APP_BASE_API + '/common/proxy/recording?url=' + encodeURIComponent(fullUrl);
+    },
     hasContent(record) {
       if (!record || !record.nodeContentList) return false
 
@@ -2317,6 +2398,28 @@ export default {
     color: #606266;
 }
 
+.content-dialog-audio {
+    display: flex;
+    align-items: center;
+    gap: 12px;
+    margin-bottom: 16px;
+    padding: 10px 12px;
+    background: #f5f7fa;
+    border-radius: 4px;
+}
+
+.content-dialog-audio .audio-label {
+    font-size: 14px;
+    color: #606266;
+    white-space: nowrap;
+}
+
+.content-dialog-audio audio {
+    flex: 1;
+    max-width: 400px;
+    height: 32px;
+}
+
 /* AI标签样式优化 */
 .ai-tags-container {
     display: flex;

+ 6 - 6
src/views/company/companyWorkflow/index.vue

@@ -10,7 +10,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="工作流类型" prop="workflowType">
+      <!-- <el-form-item label="工作流类型" prop="workflowType">
         <el-select v-model="queryParams.workflowType" placeholder="请选择类型" clearable size="small">
           <el-option
             v-for="dict in workflowTypeOptions"
@@ -19,8 +19,8 @@
             :value="dict.dictValue"
           />
         </el-select>
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
+      </el-form-item> -->
+      <!-- <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
           <el-option
             v-for="dict in statusOptions"
@@ -29,7 +29,7 @@
             :value="dict.dictValue"
           />
         </el-select>
-      </el-form-item>
+      </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>
@@ -105,12 +105,12 @@
             icon="el-icon-edit"
             @click="handleEdit(scope.row)"
           >设计</el-button>
-          <el-button
+          <!-- <el-button
             size="mini"
             type="text"
             icon="el-icon-user"
             @click="handleBindSales(scope.row)"
-          >绑定销售</el-button>
+          >绑定销售</el-button> -->
           <el-button
             size="mini"
             type="text"

+ 512 - 0
src/views/crm/components/AppendCustomerSelect.vue

@@ -0,0 +1,512 @@
+<template>
+  <el-drawer size="75%" title="追加客户选择" :visible.sync="shows" append-to-body>
+    <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form-item label="公司名" prop="companyId">
+          <el-select filterable v-model="queryParams.companyId" :disabled="designatedCompany" placeholder="请选择公司名" @change="companyChange" clearable size="small">
+            <el-option
+              v-for="item in companys"
+              :key="item.companyId"
+              :label="item.companyName"
+              :value="item.companyId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+        </el-form-item>
+        <el-form-item label="认领人" prop="companyUserNickName">
+          <el-input
+            v-model="queryParams.companyUserNickName"
+            placeholder="请输入认领人"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item label="客户状态" prop="status">
+          <el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
+            <el-option
+              v-for="item in statusOptions"
+              :key="'status'+item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="客户类型" prop="customerType">
+          <el-select multiple v-model="ctsTypeArr" placeholder="请选择客户类型" clearable size="small">
+            <el-option
+              v-for="(item, index) in typeOptions"
+              :key="`${item.dictValue}-${index}`"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="创建时间" prop="createTime">
+          <el-date-picker clearable size="small" style="width: 205.4px"
+                          v-model="dateRange"
+                          type="daterange"
+                          value-format="yyyy-MM-dd"
+                          start-placeholder="开始日期" end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="领取时间" prop="receiveTimeRange">
+          <el-date-picker
+            style="width:205.4px"
+            clearable size="small"
+            v-model="receiveTimeRange"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="客户来源" prop="source">
+          <el-select multiple v-model="sourceArr" placeholder="请选择客户来源" clearable size="small">
+            <el-option
+              v-for="item in sourceOptions"
+              :key="'source'+item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="客户标签" prop="tags">
+          <el-select multiple v-model="tagIds" placeholder="请选择客户标签" clearable size="small">
+            <el-option
+              v-for="(item, index) in tagsOptions"
+              :key="`${item.dictValue}-${index}`"
+              :label="item.dictLabel"
+              :value="item.dictLabel"
+            />
+          </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>
+        </el-form-item>
+      </el-form>
+      <el-row :gutter="10" class="mb8" v-if="designatedCompany">
+        <el-col :span="1.5">
+          <el-button
+            type="primary"
+            plain
+            icon="el-icon-edit"
+            size="mini"
+            :loading="conditionLoading"
+            @click="checkWithCondition()"
+          >按筛选条件选中
+          </el-button>
+        </el-col>
+      </el-row>
+      <el-table border v-loading="loading" :data="customerList" :row-key="getRowKeys" @selection-change="handleSelectionChange" size="mini" ref="table" height="450" :selectable="canSelect">
+        <el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="canSelect" />
+        <el-table-column label="ID" align="center" prop="customerId" />
+        <el-table-column label="所属公司" align="center" prop="companyName" width="300"/>
+        <el-table-column label="客户编码" align="center" prop="customerCode" width="150"/>
+        <el-table-column label="客户名称" align="center" prop="customerName" />
+        <el-table-column label="手机" align="center" prop="mobile" width="90"/>
+        <el-table-column label="性别" align="center" prop="sex" width="55">
+          <template slot-scope="scope">
+            <el-tag prop="sex" v-for="(item, index) in sexOptions" :key="'sex'+index" v-if="scope.row.sex==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="微信号" align="center" prop="weixin" width="95"/>
+        <el-table-column label="所在地" align="center" prop="address" />
+        <el-table-column label="标签" align="center" prop="tags" width="100" :show-overflow-tooltip="true"/>
+        <el-table-column label="客户来源" align="center" prop="source">
+          <template slot-scope="scope">
+            <el-tag prop="source" v-for="(item, index) in sourceOptions" :key="'source'+index" v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="客户类型" align="center" prop="customerType">
+          <template slot-scope="scope">
+            <el-tag prop="customerType" v-for="(item, index) in typeOptions" :key="'customerType'+index" v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="客户状态" align="center" prop="status">
+          <template slot-scope="scope">
+            <el-tag prop="status" v-for="(item, index) in statusOptions" :key="'status'+index" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="认领人" align="center" prop="companyUserNickName" />
+        <el-table-column label="状态" align="center" width="80">
+          <template slot-scope="scope">
+            <el-tag v-if="isExcluded(scope.row.customerId)" type="info" size="small">已添加</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" fixed="right" width="80px" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              @click="handleShow(scope.row)"
+              v-hasPermi="['crm:customer:query']"
+            >查看</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        :page-sizes="pageSizes"
+        @pagination="getList"
+      />
+      <div slot="footer" class="dialog-footer" style="width: 100%;display: flex;flex-direction: row-reverse;margin-top: 20px;z-index: 9898989;padding-top: 5px">
+        <el-button type="primary" :loading="submitLoading" @click="submitForm" style="margin-bottom: 5px">确 定</el-button>
+      </div>
+      <el-drawer
+        size="75%"
+        :title="show.title" :visible.sync="show.open" append-to-body>
+        <customer-details ref="customerDetails" />
+      </el-drawer>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import { listCustomerAll,listNoPage } from "@/api/crm/customer";
+import { getCompanyList } from "@/api/company/company";
+import customerDetails from '@/views/crm/components/customerDetails.vue';
+import {getCitys} from "@/api/store/city";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "AppendCustomerSelect",
+  components: { customerDetails, Treeselect },
+  props: {
+    // 通过 setExcludeCustomerIds 方法动态设置,不建议直接通过 prop 传
+  },
+  data() {
+    return {
+      designatedCompany: false,
+      shows: false,
+      deptOptions: [],
+      receiveTimeRange: [],
+      tagId: null,
+      deptId: undefined,
+      companyId: undefined,
+      tagsOptions: [],
+      ctsTypeArr: [],
+      sourceArr: [],
+      dateRange: [],
+      cityIds: [],
+      citys: [],
+      tags: [],
+      tagIds: [],
+      inputVisible: false,
+      inputValue: '',
+      statusOptions: [],
+      typeOptions: [],
+      sourceOptions: [],
+      sexOptions: [],
+      pageSizes: [10, 20, 30, 50, 100, 500],
+      submitLoading: false,
+      _excludeCustomerIds: [],
+      show: {
+        title: "客户详情",
+        open: false,
+      },
+      companys: [],
+      loading: true,
+      rows: [],
+      ids: [],
+      names: [],
+      conditionLoading: false,
+      isSyncingSelection: false,
+      single: true,
+      multiple: true,
+      showSearch: true,
+      total: 0,
+      customerList: [],
+      title: "",
+      open: false,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        customerCode: null,
+        customerName: null,
+        mobile: null,
+        sex: null,
+        weixin: null,
+        userId: null,
+        createUserId: null,
+        receiveUserId: null,
+        customerUserId: null,
+        address: null,
+        location: null,
+        detailAddress: null,
+        lng: null,
+        lat: null,
+        status: null,
+        isReceive: null,
+        deptId: null,
+        isDel: null,
+        customerType: null,
+        receiveTime: null,
+        poolTime: null,
+        companyId: null,
+        isLine: null,
+        source: null,
+        tags: null
+      },
+      form: {},
+      rules: {
+        mobile: [
+          { required: true, message: "手机号不能为空", trigger: "blur" }
+        ],
+        source: [
+          { required: true, message: "客户来源不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getDicts("crm_customer_tag").then((response) => {
+      this.tagsOptions = response.data;
+    });
+    this.getDicts("crm_customer_source").then((response) => {
+      this.sourceOptions = response.data;
+    });
+    this.getDicts("common_sex").then((response) => {
+      this.sexOptions = response.data;
+    });
+    this.getDicts("crm_customer_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("crm_customer_type").then((response) => {
+      this.typeOptions = response.data;
+    });
+    getCompanyList().then(response => {
+      this.companys = response.data;
+    });
+    this.getCitys();
+    this.getList();
+  },
+  methods: {
+    isExcluded(customerId) {
+      return this._excludeCustomerIds.includes(customerId);
+    },
+    setExcludeCustomerIds(ids) {
+      this._excludeCustomerIds = ids || [];
+    },
+    canSelect(row) {
+      return !this.isExcluded(row.customerId);
+    },
+    setRows(rows) {
+      this.shows = true;
+      this.rows = rows || [];
+      this.ids = (rows || []).map(item => item.customerId);
+      this.names = (rows || []).map(item => item.customerName);
+      this.getList();
+    },
+    setRowsDesignatedCompany(rows, companyId) {
+      this.designatedCompany = true;
+      this.shows = true;
+      this.rows = rows || [];
+      this.ids = (rows || []).map(item => item.customerId);
+      this.names = (rows || []).map(item => item.customerName);
+      this.queryParams.companyId = companyId;
+      this.companyChange(companyId);
+      this.getList();
+    },
+    initSelect() {
+      this.syncTableSelection();
+    },
+    syncTableSelection() {
+      if (!this.$refs.table) {
+        return;
+      }
+      this.isSyncingSelection = true;
+      const selectedIds = new Set((this.rows || []).map(item => item.customerId));
+      this.$nextTick(() => {
+        this.customerList.forEach(row => {
+          if (this.isExcluded(row.customerId)) {
+            this.$refs.table.toggleRowSelection(row, false);
+          } else {
+            const shouldBeSelected = selectedIds.has(row.customerId);
+            this.$refs.table.toggleRowSelection(row, shouldBeSelected);
+          }
+        });
+        this.$nextTick(() => {
+          this.isSyncingSelection = false;
+        });
+      });
+    },
+    buildQueryParams(extraParams = {}) {
+      const params = Object.assign({}, this.queryParams, extraParams);
+      if (this.receiveTimeRange != null && this.receiveTimeRange.length === 2) {
+        params.receiveTimeRange = this.receiveTimeRange[0] + "--" + this.receiveTimeRange[1];
+      } else {
+        params.receiveTimeRange = null;
+      }
+      if (this.ctsTypeArr.length > 0) {
+        params.customerType = this.ctsTypeArr.toString();
+      } else {
+        params.customerType = null;
+      }
+      if (this.sourceArr.length > 0) {
+        params.source = this.sourceArr.toString();
+      } else {
+        params.source = null;
+      }
+      if (this.tagIds.length > 0) {
+        params.tags = this.tagIds.toString();
+      } else {
+        params.tags = null;
+      }
+      return params;
+    },
+    getRowKeys(item) {
+      return item.customerId;
+    },
+    getCitys() {
+      getCitys().then(res => {
+        this.loading = false;
+        this.citys = res.data;
+      })
+    },
+    handleShow(row) {
+      var that = this;
+      that.show.open = true;
+      setTimeout(() => {
+        that.$refs.customerDetails.getDetails(row.customerId);
+      }, 200);
+    },
+    getList() {
+      this.loading = true;
+      const params = this.buildQueryParams();
+      listCustomerAll(this.addDateRange(params, this.dateRange)).then(response => {
+        this.customerList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+        this.initSelect();
+      });
+    },
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.resetForm("queryForm");
+    },
+    handleSelectionChange(selection) {
+      if (this.isSyncingSelection) {
+        return;
+      }
+      const currentPageIds = new Set(this.customerList.map(item => item.customerId));
+      const otherPageRows = (this.rows || []).filter(item => !currentPageIds.has(item.customerId));
+      const rowMap = new Map();
+      otherPageRows.forEach(row => rowMap.set(row.customerId, row));
+      selection.forEach(row => {
+        if (!this.isExcluded(row.customerId)) {
+          rowMap.set(row.customerId, row);
+        }
+      });
+      this.rows = Array.from(rowMap.values());
+      this.ids = this.rows.map(item => item.customerId);
+      this.names = this.rows.map(item => item.customerName);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    getTreeselect() {
+      var that = this;
+      var param = { companyId: this.companyId }
+      treeselect(param).then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    companyChange(val) {
+      this.companyId = val;
+      this.getTreeselect();
+    },
+    currDeptChange(val) {
+      this.queryParams.deptId = val;
+      this.getList();
+    },
+    submitForm() {
+      // 过滤掉已存在的客户(排除列表中的)
+      const filteredRows = (this.rows || []).filter(item => !this.isExcluded(item.customerId));
+      const filteredIds = filteredRows.map(item => item.customerId);
+      const filteredNames = filteredRows.map(item => item.customerName);
+
+      if (filteredRows.length === 0) {
+        this.$message.warning("请至少选择一位新客户(已添加的客户无法重复追加)");
+        return;
+      }
+
+      this.submitLoading = true;
+      this.$emit("success", { ids: filteredIds, names: filteredNames, rows: filteredRows });
+      this.shows = false;
+      this.$nextTick(() => {
+        if (this.$refs.table) {
+          this.isSyncingSelection = true;
+          this.$refs.table.clearSelection();
+          this.$nextTick(() => {
+            this.isSyncingSelection = false;
+          });
+        }
+        this.submitLoading = false;
+      });
+    },
+    checkWithCondition() {
+      this.conditionLoading = true;
+      const params = this.buildQueryParams();
+      listNoPage(this.addDateRange(params, this.dateRange)).then(response => {
+        const resList = (response.rows || []).filter(item => !this.isExcluded(item.customerId));
+        this.rows = resList;
+        this.ids = resList.map(item => item.customerId);
+        this.names = resList.map(item => item.customerName);
+        if (this.$refs.table) {
+          this.$refs.table.clearSelection();
+        }
+        this.syncTableSelection();
+        if (resList.length === 0) {
+          this.$message.warning("当前筛选条件下没有可追加的新客户");
+        } else {
+          this.$message.success(`已按筛选条件选中 ${resList.length} 位可追加客户,点击确定完成回传`);
+        }
+      }).finally(() => {
+        this.conditionLoading = false;
+      });
+    }
+  }
+};
+</script>
+<style scoped>
+  .el-tag + .el-tag {
+    margin-left: 10px;
+  }
+  .button-new-tag {
+    margin-left: 10px;
+    height: 32px;
+    line-height: 30px;
+    padding-top: 0;
+    padding-bottom: 0;
+  }
+  .input-new-tag {
+    width: 90px;
+    margin-left: 10px;
+    vertical-align: bottom;
+  }
+  .el-dialog__wrapper{
+    z-index: 100000;
+  }
+  .app-container{padding: 0}
+  .dialog-footer{
+    position: absolute;
+    bottom: 0;
+    right: 20px;
+    background: #FFF;
+  }
+</style>