yangfeng
2023-08-09 acdff03246ce648082192dfb069c3a006a7fbee6
客户管理模块 批量删除、推进、跟进接口联调
1个文件已添加
17个文件已修改
1024 ■■■■ 已修改文件
src/api/client/client.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/client/contacts.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/client/followupRecords.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/client/salesLead.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/PublicFunctionBtnView.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/SearchCommonView.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/client/AddClientManageDialog.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/client/DetailClientManage.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/client/index.vue 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/contacts/DetailContacts.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/contacts/index.vue 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/followupRecords/index.vue 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/salesLead/AddSalesLeadDialog.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/salesLead/AdvanceDialog.vue 223 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/salesLead/DetailSalesLead.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/salesLead/index.vue 136 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other/commonDialog/HighViewScopeDialog.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/client/client.js
@@ -19,8 +19,9 @@
// 删除客户管理
export function getDeleteClient(data) {
  return request({
    url: "/api/client/delete/" + data.id,
    method: "delete"
    url: "/api/client/delete",
    method: "delete",
    data
  })
}
// 更新客户管理
src/api/client/contacts.js
@@ -19,8 +19,9 @@
// 删除联系人
export function getDeleteContact(data) {
  return request({
    url: "/api/contact/delete/" + data.id,
    method: "delete"
    url: "/api/contact/delete",
    method: "delete",
    data
  })
}
// 更新联系人
src/api/client/followupRecords.js
@@ -19,8 +19,9 @@
// 删除跟进记录
export function getDeleteFollowRecord(data) {
  return request({
    url: "/api/followRecord/delete/" + data.id,
    method: "delete"
    url: "/api/followRecord/delete",
    method: "delete",
    data
  })
}
// 更新跟进记录
src/api/client/salesLead.js
@@ -19,8 +19,9 @@
// 删除销售线索
export function getDeleteSalesLeads(data) {
  return request({
    url: "/api/salesLeads/delete/" + data.id,
    method: "delete"
    url: "/api/salesLeads/delete",
    method: "delete",
    data
  })
}
// 更新销售线索
@@ -32,6 +33,15 @@
  })
}
// 推进销售线索
export function pushSalesSources(data) {
  return request({
    url: "/api/salesLeads/push",
    method: "post",
    data
  })
}
// 商机来源列表
export function getSalesSourcesList() {
  return request({
src/components/makepager/PublicFunctionBtnView.vue
@@ -3,12 +3,14 @@
    <div class="btn-list">
      <el-button size="small" type="text" class="blue" @click="addBtnClick">新建</el-button>
      <!-- <el-button v-if="receive" size="small" type="text" class="gray" @click="receiveBtnClick">领取</el-button> -->
      <el-button v-if="allocation" size="small" type="text" class="gray" @click="allocationBtnClick">分配</el-button>
      <el-button v-if="allocation" size="small" type="text" class="gray" @click="allocationBtnClick" disabled
        >分配</el-button
      >
      <el-button v-if="deleteButton" size="small" type="text" class="gray" @click="deleteBtnClick">删除</el-button>
      <!-- <el-button v-if="submitApproval" size="small" type="text" class="gray width64" @click="submitApprovalBtnClick"
        >提交审批
      </el-button> -->
      <el-button v-if="duplicateCheck" size="small" type="text" class="gray" @click="duplicateCheckBtnClick"
      <el-button v-if="duplicateCheck" size="small" type="text" class="gray" @click="duplicateCheckBtnClick" disabled
        >查重</el-button
      >
      <!-- <el-button v-if="importButton" size="small" type="text" class="gray" @click="importBtnClick">导入</el-button>
@@ -153,9 +155,13 @@
    // 领取
    receiveBtnClick() {},
    // 分配
    allocationBtnClick() {},
    allocationBtnClick() {
      this.$emit("allocationBtnClick")
    },
    // 删除
    deleteBtnClick() {},
    deleteBtnClick() {
      this.$emit("batchDelete")
    },
    // 提交审批
    submitApprovalBtnClick() {},
    // 查重
src/components/makepager/SearchCommonView.vue
@@ -1,7 +1,7 @@
<template>
  <div class="search-list">
    <div class="search-top">
      <div class="query-class">
      <!-- <div class="query-class">
        <div class="query-class-title">查询分类</div>
        <el-select v-model="queryClassValue" placeholder="请选择" class="query-class-sel" size="mini">
          <el-option v-for="item in queryClassOptions" :key="item.value" :label="item.label" :value="item.value">
@@ -10,15 +10,21 @@
        <div class="query-class-btn" @click="queryClassClick">
          <i class="el-icon-setting"></i>
        </div>
      </div>
      </div> -->
      <div class="search">
        <el-input placeholder="请输入内容" v-model="searchInput" class="input-with-select" clearable>
          <el-select v-model="searchSelValue" slot="prepend" placeholder="请选择" class="search-sel">
            <el-option v-for="item in searchOptions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
          <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i>
          <!-- <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i> -->
        </el-input>
      </div>
      <div class="btn">
        <el-button type="primary" size="mini" @click="searchClick" icon="el-icon-search" style="margin-right: 5px"
          >搜索</el-button
        >
        <el-button size="mini" icon="el-icon-refresh-left" @click="resetClick">重置</el-button>
      </div>
      <!-- <div class="other-search">
        <div class="other-search-high" @click="highSearchClick">
@@ -35,7 +41,7 @@
        </div>
      </div> -->
    </div>
    <div v-if="isTileSearch" class="search-bottom">
    <!-- <div v-if="isTileSearch" class="search-bottom">
      <el-table :data="tileSearchData" style="width: 100%">
        <el-table-column prop="selField" label="选择字段" width="430">
          <template slot-scope="scope">
@@ -82,7 +88,7 @@
          <el-button size="small">取消</el-button>
        </div>
      </div>
    </div>
    </div> -->
    <!-- 查询分类弹窗 -->
    <QueryClassSettingDialog v-if="queryClassSetConfig.visible" :editCommonConfig="queryClassSetConfig" />
  </div>
@@ -105,7 +111,7 @@
    },
    searchSel: {
      type: String,
      default: "1"
      default: "name"
    },
    searchOptions: {
      type: Array,
@@ -159,7 +165,12 @@
      }
    },
    searchClick() {
      console.log("sssssssssss")
      this.$emit("searchClick", this.searchSelValue, this.searchInput)
    },
    resetClick() {
      this.searchSelValue = this.searchSel
      this.searchInput = ""
      this.$emit("resetClick")
    },
    // 高级查找
    highSearchClick() {},
@@ -194,6 +205,7 @@
  color: #333;
  .search-top {
    display: flex;
    align-items: center;
    .query-class {
      display: flex;
      height: 60px;
@@ -220,6 +232,9 @@
        margin-top: 7px;
      }
    }
    .btn {
      margin-left: 10px;
    }
    .other-search {
      display: flex;
      height: 60px;
src/views/client/client/AddClientManageDialog.vue
@@ -5,6 +5,8 @@
      :visible.sync="editConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
      append-to-body
      custom-class="iframe-dialog"
    >
      <el-form
        ref="form"
@@ -475,7 +477,7 @@
      <div slot="footer" class="dialog-footer">
        <!-- <el-button type="primary" size="small" @click="editConfig.visible = false">保并提交审批</el-button> -->
        <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
        <el-button size="small" @click="handleClose">取消</el-button>
      </div>
    </el-dialog>
  </div>
@@ -492,6 +494,7 @@
        return {
          visible: false,
          title: "新建",
          isSalesOpportunity: false,
          infomation: {}
        }
      }
@@ -546,7 +549,6 @@
    getCommonData() {
      getAllData()
        .then((res) => {
          console.log(res)
          this.memberOptions = res.data.member
          this.clientSourceOptions = res.data.client_origin
          this.clientStatusOptions = res.data.client_status
@@ -567,6 +569,9 @@
    },
    handleClose() {
      this.editConfig.visible = false
      if (this.editConfig.title === "新建" && this.editConfig.infomation.sales_leads_id) {
        this.$parent.handleClose()
      }
    },
    // 保存
    saveClick(formName) {
@@ -585,7 +590,13 @@
                    message: "添加成功",
                    type: "success"
                  })
                  this.$parent.getData()
                  if (this.editConfig.isSalesOpportunity) {
                    this.$emit("salesOpportunityClick", this.editConfig.infomation)
                  } else if (this.editConfig.title === "新建" && this.editConfig.infomation.sales_leads_id) {
                    this.$parent.handleClose()
                  } else {
                    this.$parent.getData()
                  }
                }
              })
              .catch((err) => {
@@ -657,7 +668,8 @@
        registration_time: data.registration_time || "",
        remark: data.remark || "",
        representative: data.representative || "",
        service_member_id: data.service_member_id || 0
        service_member_id: data.service_member_id || 0,
        sales_leads_id: data.sales_leads_id || 0
      }
      return params
    },
@@ -677,54 +689,56 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.add-client-manage {
  .basic-info {
    .basic-info-title {
      background-color: #f4f8fe;
      padding-left: 10px;
      font-size: 15px;
      font-weight: bold;
      color: #666;
      height: 42px;
      line-height: 42px;
    }
    .basic-info-view {
      margin-top: 10px;
      padding-right: 40px;
      .custom-name,
      .common-select {
::v-deep {
  .iframe-dialog .el-dialog__body {
    .basic-info {
      .basic-info-title {
        background-color: #f4f8fe;
        padding-left: 10px;
        font-size: 15px;
        font-weight: bold;
        color: #666;
        height: 42px;
        line-height: 42px;
      }
      .basic-info-view {
        margin-top: 10px;
        padding-right: 40px;
        .custom-name,
        .common-select {
          display: flex;
          .common-select-btn {
            margin-left: 5px;
            font-size: 18px;
            cursor: pointer;
          }
        }
        .common-select {
          .common-select-sel {
            width: 270px;
          }
        }
      }
      .annex-view {
        display: flex;
        .common-select-btn {
          margin-left: 5px;
          font-size: 18px;
          cursor: pointer;
        }
      }
      .common-select {
        .common-select-sel {
          width: 270px;
        color: #6166d3;
        .setFormat {
          margin-left: 10px;
        }
      }
    }
    .annex-view {
    .unflod-collapse {
      display: flex;
      height: 30px;
      justify-content: center;
      align-items: center;
      color: #6166d3;
      .setFormat {
        margin-left: 10px;
      }
    }
  }
  .unflod-collapse {
    display: flex;
    height: 30px;
    justify-content: center;
    align-items: center;
    color: #6166d3;
  }
  .dialog-footer {
    background-color: #f5f5f5;
    height: 55px;
    line-height: 55px;
    .dialog-footer {
      background-color: #f5f5f5;
      height: 55px;
      line-height: 55px;
    }
  }
}
</style>
src/views/client/client/DetailClientManage.vue
@@ -154,7 +154,7 @@
                <li>
                  <div class="left remark">
                    <div class="content-title">{{ "备注:" }}</div>
                    <div class="content-data">{{ "备注内容" }}</div>
                    <div class="content-data">{{ detailConfig.infomation.remark }}</div>
                  </div>
                </li>
              </ul>
@@ -247,35 +247,35 @@
    }
  },
  created() {
    this.setData()
    this.setData(this.detailConfig.infomation)
  },
  mounted() {},
  methods: {
    setData() {
    setData(item) {
      this.basicInfoList = [
        {
          leftStr: "客户名称",
          leftValue: this.detailConfig.infomation.client_name,
          leftValue: item.client_name,
          rightStr: "客户编号",
          rightValue: this.detailConfig.infomation.number
          rightValue: item.number
        },
        {
          leftStr: "客户状态",
          leftValue: this.detailConfig.infomation.contact_name,
          leftValue: item.client_status,
          rightStr: "销售负责人",
          rightValue: this.detailConfig.infomation.contact_position
          rightValue: item.member_id
        },
        {
          leftStr: "客户类型",
          leftValue: this.detailConfig.infomation.contact_phone,
          leftValue: item.client_type.name,
          rightStr: "客户来源",
          rightValue: "新建"
          rightValue: item.client_origin.name
        },
        {
          leftStr: "重要级别",
          leftValue: this.detailConfig.infomation.sales_sources_id,
          leftValue: item.client_level,
          rightStr: "公海状态",
          rightValue: this.detailConfig.infomation.member_id
          rightValue: ""
        },
        {
          leftStr: "所属公海",
@@ -287,13 +287,13 @@
          leftStr: "签到",
          leftValue: "",
          rightStr: "下次回访日期",
          rightValue: ""
          rightValue: this.processTime(item.next_visit_time)
        },
        {
          leftStr: "创建时间",
          leftValue: "",
          rightStr: "最晚服务到期日",
          rightValue: ""
          rightValue: this.processTime(item.latest_service_time)
        },
        {
          leftStr: "创建人",
@@ -305,9 +305,9 @@
      this.contactList = [
        {
          leftStr: "联系人姓名",
          leftValue: "",
          leftValue: item.contact_name,
          rightStr: "联系人手机",
          rightValue: ""
          rightValue: item.contact_phone
        },
        {
          leftStr: "联系人职务",
@@ -339,25 +339,25 @@
      this.businessInfoList = [
        {
          leftStr: "所属行业",
          leftValue: "",
          leftValue: item.Industry.name,
          rightStr: "法定代表人",
          rightValue: ""
          rightValue: item.representative
        },
        {
          leftStr: "注册时间",
          leftValue: "",
          leftValue: this.processTime(item.registration_time),
          rightStr: "注册资金",
          rightValue: ""
          rightValue: item.RegisteredCapital.name
        },
        {
          leftStr: "公司性质",
          leftValue: "",
          leftValue: item.EnterpriseNature.name,
          rightStr: "客户规模",
          rightValue: ""
          rightValue: item.EnterpriseScale.name
        },
        {
          leftStr: "经营范围",
          leftValue: "",
          leftValue: item.business_scope,
          rightStr: "",
          rightValue: ""
        }
@@ -365,19 +365,19 @@
      this.addressInfoList = [
        {
          leftStr: "国家",
          leftValue: "",
          leftValue: item.Country.name,
          rightStr: "省份",
          rightValue: ""
          rightValue: item.Province.name
        },
        {
          leftStr: "城市",
          leftValue: "",
          leftValue: item.City.name,
          rightStr: "区域",
          rightValue: ""
          rightValue: item.Region.name
        },
        {
          leftStr: "详细地址",
          leftValue: "",
          leftValue: item.detail_address,
          rightStr: "",
          rightValue: ""
        }
@@ -408,6 +408,33 @@
      } else if (value === "annex") {
        this.isAnnexExpand = !this.isAnnexExpand
      }
    },
    // 处理时间
    processTime(dateTime) {
      return this.dateFormat("YYYY-mm-dd HH:MM:SS", dateTime) === "1900-01-01 08:00:00"
        ? "--"
        : this.dateFormat("YYYY-mm-dd HH:MM:SS", dateTime)
    },
    // 时间显示
    dateFormat(fmt, date) {
      let ret = ""
      date = new Date(date)
      const opt = {
        "Y+": date.getFullYear().toString(), // 年
        "m+": (date.getMonth() + 1).toString(), // 月
        "d+": date.getDate().toString(), // 日
        "H+": date.getHours().toString(), // 时
        "M+": date.getMinutes().toString(), // 分
        "S+": date.getSeconds().toString() // 秒
        // 有其他格式化字符需求可以继续添加,必须转化成字符串
      }
      for (let k in opt) {
        ret = new RegExp("(" + k + ")").exec(fmt)
        if (ret) {
          fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"))
        }
      }
      return fmt
    }
  }
}
src/views/client/client/index.vue
@@ -2,14 +2,14 @@
  <div class="custom-manage">
    <div class="tab-view">
      <el-tabs v-model="activeName" @tab-click="tabsClick">
        <el-tab-pane label="全部(含所有公海)" name="first"></el-tab-pane>
        <el-tab-pane label="全部(含公海)" name="second"></el-tab-pane>
        <el-tab-pane label="全部(不含公海)" name="third"></el-tab-pane>
        <el-tab-pane label="公海已分配" name="fourth"></el-tab-pane>
        <el-tab-pane label="公未分配" name="aaa"></el-tab-pane>
        <el-tab-pane label="全部(含所有公海)" name="first" disabled></el-tab-pane>
        <el-tab-pane label="全部(含公海)" name="second" disabled></el-tab-pane>
        <el-tab-pane label="全部(不含公海)" name="third" disabled></el-tab-pane>
        <el-tab-pane label="公海已分配" name="fourth" disabled></el-tab-pane>
        <el-tab-pane label="公未分配" name="aaa" disabled></el-tab-pane>
      </el-tabs>
      <div class="sel-gonghai">
        <el-select v-model="gonghaiValue" placeholder="请选择" class="query-class-sel" size="mini">
        <el-select v-model="gonghaiValue" placeholder="请选择" class="query-class-sel" size="mini" disabled>
          <el-option v-for="item in gonghaiOptions" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
@@ -23,6 +23,8 @@
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        @searchClick="searchClick"
        @resetClick="resetClick"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView
@@ -31,6 +33,7 @@
          :map-button="true"
          :statistics="true"
          :operates-list="operatesList"
          @batchDelete="delClick"
        />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
@@ -41,14 +44,15 @@
      :table-list="tableList"
      @selClientClick="selClientClick"
      @selContactsClick="selContactsClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="180">
        <el-table-column label="操作" width="150">
          <template slot-scope="scope">
            <el-button type="text" size="small">变更公海</el-button>
            <el-button type="text" size="small" disabled>变更公海</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button type="text" size="small">跟进</el-button>
            <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
            <el-button @click="followupClick(scope.row)" type="text" size="small">跟进</el-button>
            <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
          </template>
        </el-table-column>
      </template>
@@ -59,6 +63,8 @@
    <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" />
    <!-- 联系人详情 -->
    <DetailContacts v-if="contactsDeail.visible" :contacts-detail="contactsDeail" />
    <!-- 新建/编辑跟进记录 -->
    <AddFollowupRecordsDialog v-if="editFollowupConfig.visible" :edit-contacts-config="editFollowupConfig" />
  </div>
</template>
@@ -66,6 +72,7 @@
import AddClientManageDialog from "@/views/client/client/AddClientManageDialog"
import { getClientList, getDeleteClient } from "@/api/client/client"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog"
export default {
  name: "CustomManage",
@@ -74,13 +81,10 @@
  components: {
    AddClientManageDialog,
    DetailContacts: () => import("@/views/client/contacts/DetailContacts"),
    DetailClientManage: () => import("@/views/client/client/DetailClientManage")
    DetailClientManage: () => import("@/views/client/client/DetailClientManage"),
    AddFollowupRecordsDialog
  },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    }
  },
  computed: {},
  data() {
    return {
      tableList: {},
@@ -119,6 +123,13 @@
      clientDeail: {
        visible: false,
        infomation: {}
      },
      search_map: {},
      selValueList: [],
      editFollowupConfig: {
        visible: false,
        title: "新建",
        infomation: {}
      }
    }
  },
@@ -132,11 +143,11 @@
        tableInfomation: [],
        tableColumn: [
          { label: "客户名称", prop: "name", min: 100, isClientClick: true }, // 客户名称
          { label: "销售负责人", prop: "member_id" }, // 销售负责人
          { label: "重要级别", prop: "client_level_id" }, // 重要级别
          { label: "销售负责人", prop: "member_name" }, // 销售负责人
          { label: "重要级别", prop: "client_level" }, // 重要级别
          { label: "下次回访日期", prop: "next_visit_time", isTime: true, min: 90 }, // 下次回访日期
          { label: "详细地址", prop: "detail_address", min: 200 }, // 详细地址
          { label: "客户状态", prop: "client_status_id" }, // 客户状态
          { label: "客户状态", prop: "client_status" }, // 客户状态
          { label: "联系人姓名", prop: "contact_name", isContactClick: true }, // 联系人姓名
          { label: "手机号码", prop: "contact_phone" } // 手机号码
        ]
@@ -144,14 +155,15 @@
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getClientList({
        keyword: "",
        search_map: this.search_map,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
@@ -173,7 +185,9 @@
                return {
                  ...item,
                  contact_name: contact_name,
                  contact_phone: contact_phone
                  contact_phone: contact_phone,
                  client_level: item.client_level.name,
                  client_status: item.client_status.name
                }
              })
              this.tableList.tableInfomation = list || []
@@ -195,6 +209,18 @@
    tabsClick(tab, event) {
      console.log(tab, event)
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
@@ -214,7 +240,6 @@
          }
        })
      }
      console.log(contactObj)
      this.editConfig.infomation = {
        ...row,
        contact_wechat: contactObj.length > 0 ? contactObj.wechat : "",
@@ -222,27 +247,35 @@
      }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDeleteClient({ id: id })
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
          .then(() => {
            getDeleteClient({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
              } else {
                this.$message.warning("删除失败")
              }
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    getSelectArray(val) {
      console.log(val)
      this.selValueList = []
      const list = val.map((item) => {
        return item.id
      })
      this.selValueList = list
    },
    // 客户名称详情
    selClientClick(row) {
@@ -254,7 +287,27 @@
    selContactsClick(row) {
      console.log(row)
      this.contactsDeail.visible = true
      this.contactsDeail.infomation = { ...row }
      let contact = {}
      if (row.contacts.length !== 0) {
        for (let i = 0; i < row.contacts.length; i++) {
          if (row.contacts[i].is_first) {
            contact = row.contacts[i]
          }
        }
      }
      this.contactsDeail.infomation = { ...contact, Client: { name: row.name } }
    },
    // 跟进
    followupClick(row) {
      console.log(row)
      this.editFollowupConfig.visible = true
      this.editFollowupConfig.title = "新建"
      this.editFollowupConfig.infomation = {
        ...row,
        client_name: row.name,
        number: "",
        next_follow_time: row.next_visit_time
      }
    }
  }
}
src/views/client/contacts/DetailContacts.vue
@@ -83,7 +83,7 @@
                <li>
                  <div class="left remark">
                    <div class="content-title">{{ "备注:" }}</div>
                    <div class="content-data">{{ "备注内容" }}</div>
                    <div class="content-data">{{ detailConfig.infomation.desc }}</div>
                  </div>
                </li>
              </ul>
@@ -154,41 +154,41 @@
    }
  },
  created() {
    this.setData()
    this.setData(this.detailConfig.infomation)
  },
  mounted() {},
  methods: {
    setData() {
    setData(item) {
      this.basicInfoList = [
        {
          leftStr: "联系人姓名",
          leftValue: "",
          leftValue: item.name,
          rightStr: "联系人编号",
          rightValue: ""
          rightValue: item.number
        },
        {
          leftStr: "客户名称",
          leftValue: "",
          leftValue: item.Client.name,
          rightStr: "手机",
          rightValue: ""
          rightValue: item.phone
        },
        {
          leftStr: "职务",
          leftValue: "",
          leftValue: item.position,
          rightStr: "销售负责人",
          rightValue: ""
          rightValue: item.member_id
        },
        {
          leftStr: "首要联系人",
          leftValue: "",
          leftValue: item.is_first,
          rightStr: "微信号",
          rightValue: ""
          rightValue: item.wechat
        },
        {
          leftStr: "生日",
          leftValue: "",
          leftValue: item.birthday,
          rightStr: "联系人Email",
          rightValue: ""
          rightValue: item.email
        },
        {
          leftStr: "签到",
@@ -206,15 +206,15 @@
      this.addressInfoList = [
        {
          leftStr: "国家",
          leftValue: "",
          leftValue: item.Country.name,
          rightStr: "省份",
          rightValue: ""
          rightValue: item.Province.name
        },
        {
          leftStr: "城市",
          leftValue: "",
          leftValue: item.City.name,
          rightStr: "区域",
          rightValue: ""
          rightValue: item.Region.name
        },
        {
          leftStr: "邮编",
src/views/client/contacts/index.vue
@@ -11,7 +11,7 @@
        :search-options="searchOptions"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :operates-list="operatesList" :allocation="false" />
        <PublicFunctionBtnView :operates-list="operatesList" :allocation="false" @batchDelete="delClick" />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
@@ -21,13 +21,14 @@
      :table-list="tableList"
      @selContactsClick="selContactsClick"
      @selClientClick="selClientClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="120" fixed="right">
        <el-table-column label="操作" width="90" fixed="right">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button type="text" size="small">跟进</el-button>
            <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
            <el-button @click="followupClick(scope.row)" type="text" size="small">跟进</el-button>
            <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
          </template>
        </el-table-column>
      </template>
@@ -38,6 +39,8 @@
    <DetailContacts v-if="contactsDeail.visible" :contacts-detail="contactsDeail" />
    <!-- 客户详情 -->
    <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" />
    <!-- 新建/编辑跟进记录 -->
    <AddFollowupRecordsDialog v-if="editFollowupConfig.visible" :edit-contacts-config="editFollowupConfig" />
  </div>
</template>
@@ -45,6 +48,7 @@
import AddContactsDialog from "@/views/client/contacts/AddContactsDialog"
import { getContactList, getDeleteContact } from "@/api/client/contacts"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog"
export default {
  name: "ContactsView",
  props: {
@@ -57,7 +61,8 @@
  components: {
    AddContactsDialog,
    DetailContacts: () => import("@/views/client/contacts/DetailContacts"),
    DetailClientManage: () => import("@/views/client/client/DetailClientManage")
    DetailClientManage: () => import("@/views/client/client/DetailClientManage"),
    AddFollowupRecordsDialog
  },
  computed: {},
  data() {
@@ -94,6 +99,12 @@
      clientDeail: {
        visible: false,
        infomation: {}
      },
      selValueList: [],
      editFollowupConfig: {
        visible: false,
        title: "新建",
        infomation: {}
      }
    }
  },
@@ -118,7 +129,8 @@
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
@@ -170,27 +182,52 @@
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDeleteContact({ id: id })
    delClick() {
      // this.$confirm("是否确认删除?", "警告", {
      //   confirmButtonText: "确定",
      //   cancelButtonText: "取消",
      //   type: "warning"
      // })
      //   .then(function () {
      //     return getDeleteContact({ id: id })
      //   })
      //   .then((response) => {
      //     if (response.code === 200) {
      //       this.$message.success("删除成功")
      //       this.getData()
      //     } else {
      //       this.$message.warning("删除失败")
      //     }
      //   })
      //   .catch(function () {})
      if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
          .then(() => {
            getDeleteContact({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
              } else {
                this.$message.warning("删除失败")
              }
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    getSelectArray(val) {
      console.log(val)
      this.selValueList = []
      const list = val.map((item) => {
        return item.id
      })
      this.selValueList = list
    },
    // 联系人详情
    selContactsClick(row) {
@@ -202,7 +239,23 @@
    selClientClick(row) {
      console.log(row)
      this.clientDeail.visible = true
      this.clientDeail.infomation = { ...row, client_name: row.Client.name }
      this.clientDeail.infomation = {
        ...row.Client,
        client_name: row.Client.name,
        client_level: row.Client.client_level.name,
        client_status: row.Client.client_status.name
      }
    },
    // 跟进
    followupClick(row) {
      console.log(row)
      this.editFollowupConfig.visible = true
      this.editFollowupConfig.title = "新建"
      this.editFollowupConfig.infomation = {
        ...row,
        client_name: row.Client.name,
        number: ""
      }
    }
  }
}
src/views/client/followupRecords/index.vue
@@ -11,7 +11,7 @@
        :search-options="searchOptions"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" />
        <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" @batchDelete="delClick" />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
@@ -22,12 +22,13 @@
      :select-box="!isDetail"
      @selContactsClick="selContactsClick"
      @selClientClick="selClientClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="120" fixed="right">
        <el-table-column label="操作" width="60" fixed="right">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
            <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
          </template>
        </el-table-column>
      </template>
@@ -101,7 +102,8 @@
      clientDeail: {
        visible: false,
        infomation: {}
      }
      },
      selValueList: []
    }
  },
  created() {
@@ -181,39 +183,52 @@
      this.editConfig.infomation = { ...row, sale_chance_name: "", sales_leads_name: "" }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDeleteFollowRecord({ id: id })
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
          .then(() => {
            getDeleteFollowRecord({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
              } else {
                this.$message.warning("删除失败")
              }
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    getSelectArray(val) {
      console.log(val)
      this.selValueList = []
      const list = val.map((item) => {
        return item.id
      })
      this.selValueList = list
    },
    // 联系人详情
    selContactsClick(row) {
      console.log(row)
      this.contactsDeail.visible = true
      this.contactsDeail.infomation = { ...row }
      this.contactsDeail.infomation = { ...row.contact, Client: { name: row.client_name } }
    },
    // 客户名称详情
    selClientClick(row) {
      console.log(row)
      this.clientDeail.visible = true
      this.clientDeail.infomation = { ...row }
      this.clientDeail.infomation = {
        ...row.client,
        client_name: row.client.name,
        client_level: row.client.client_level.name,
        client_status: row.client.client_status.name
      }
    }
  }
}
src/views/client/salesLead/AddSalesLeadDialog.vue
@@ -87,7 +87,7 @@
              <el-col :span="12">
                <el-form-item label="负责人" prop="member_id">
                  <el-select v-model="editConfig.infomation.member_id" placeholder="请选择" size="mini">
                    <el-option v-for="item in ownerOptions" :key="item.id" :label="item.username" :value="item.id">
                    <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
@@ -244,11 +244,7 @@
    }
  },
  components: { EditDropdownDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    }
  },
  computed: {},
  data() {
    return {
      dialogWidth: "80%",
@@ -269,7 +265,7 @@
        ]
      },
      businessSourceOptions: [],
      ownerOptions: [],
      memberOptions: [],
      countryOptions: [], // 国家
      provinceOptions: [], // 省份
      cityOptions: [], // 城市
@@ -286,9 +282,7 @@
  created() {
    this.getCommonData()
  },
  mounted() {
    this.setData()
  },
  mounted() {},
  methods: {
    getCommonData() {
      getAllData()
@@ -299,7 +293,7 @@
          this.provinceOptions = res.data.province
          this.cityOptions = res.data.city
          this.regionOptions = res.data.region
          this.ownerOptions = res.data.member
          this.memberOptions = res.data.member
        })
        .catch((err) => {
          console.log(err)
@@ -382,19 +376,6 @@
    editDropdownBox() {
      this.editDropdownConfig.editVisible = true
      this.editDropdownConfig.title = "商机来源"
    },
    // 数据处理
    setData() {
      this.editConfig.infomation.city_id =
        this.editConfig.infomation.city_id === 0 ? "" : this.editConfig.infomation.city_id
      this.editConfig.infomation.member_id =
        this.editConfig.infomation.member_id === 0 ? "" : this.editConfig.infomation.member_id
      this.editConfig.infomation.province_id =
        this.editConfig.infomation.province_id === 0 ? "" : this.editConfig.infomation.province_id
      this.editConfig.infomation.region_id =
        this.editConfig.infomation.region_id === 0 ? "" : this.editConfig.infomation.region_id
      this.editConfig.infomation.country_id =
        this.editConfig.infomation.country_id === 0 ? "" : this.editConfig.infomation.country_id
    },
    // 手机号输入
    confirmPhone(value) {
src/views/client/salesLead/AdvanceDialog.vue
New file
@@ -0,0 +1,223 @@
<template>
  <div class="advance">
    <el-dialog
      :title="'推进'"
      append-to-body
      :visible.sync="commonConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
      custom-class="advance-dialog"
    >
      <div class="content">
        <el-radio-group v-model="radio">
          <div class="one">
            <el-radio :label="1">
              <span>推进到下一阶段</span>
              <el-select v-model="value1" size="mini" disabled>
                <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
              </el-select>
            </el-radio>
          </div>
          <div class="two">
            <el-radio :label="2">
              <span>推进到指定阶段</span>
              <el-select v-model="value" size="mini" @change="designatedStageClick">
                <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
              </el-select>
              <div v-if="value === '失败关闭'" class="reason">
                <div class="label"><span style="color: red">*</span>原因</div>
                <el-input class="input" type="textarea" :rows="2" placeholder="请输入内容" v-model="reason"></el-input>
              </div>
            </el-radio>
          </div>
        </el-radio-group>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="saveClick()">推进</el-button>
        <el-button size="small" @click="commonConfig.visible = false">取消</el-button>
      </div>
      <!-- 新建/编辑客户管理 -->
      <AddClientManageDialog
        v-if="editConfig.visible"
        :edit-client-manage-config="editConfig"
        @salesOpportunityClick="salesOpportunityClick"
      />
      <!-- 新建/编辑销售机会 -->
      <AddSalesOpportunityDialog v-if="editOpportunityConfig.visible" :edit-common-config="editOpportunityConfig" />
    </el-dialog>
  </div>
</template>
<script>
import { pushSalesSources } from "@/api/client/salesLead"
import AddClientManageDialog from "@/views/client/client/AddClientManageDialog"
import AddSalesOpportunityDialog from "@/views/sales/salesOpportunity/AddSalesOpportunityDialog"
export default {
  name: "AdvanceDialog",
  props: {
    advanceConfig: {
      type: Object,
      default: () => {
        return {
          visible: false,
          infomation: {}
        }
      }
    }
  },
  components: { AddClientManageDialog, AddSalesOpportunityDialog },
  computed: {},
  data() {
    return {
      dialogWidth: "25%",
      radio: 1,
      commonConfig: this.advanceConfig,
      value1: "",
      value: "",
      options: [],
      reason: "",
      editConfig: {
        visible: false,
        title: "新建",
        isSalesOpportunity: false,
        infomation: {}
      },
      editOpportunityConfig: {
        visible: false,
        title: "新建",
        infomation: {}
      }
    }
  },
  watch: {},
  created() {
    this.setData(this.advanceConfig.infomation.sales_status)
  },
  methods: {
    setData(status) {
      if (status === 1) {
        this.options = ["新建", "失败关闭", "升级到客户", "升级到客户和销售机会"]
        this.value = "失败关闭"
        this.value1 = "失败关闭"
      } else if (status === -1) {
        this.options = ["新建", "跟进中", "升级到客户", "升级到客户和销售机会"]
        this.value = "升级到客户"
        this.value1 = "升级到客户"
      } else {
        this.options = ["跟进中", "失败关闭", "升级到客户", "升级到客户和销售机会"]
        this.value = "跟进中"
        this.value1 = "跟进中"
      }
    },
    handleClose() {
      this.commonConfig.visible = false
      if (this.value === "升级到客户和销售机会") {
        this.$parent.getData()
      }
    },
    designatedStageClick(val) {
      console.log(val)
      this.radio = 2
    },
    saveClick() {
      console.log(this.value)
      if (this.value === "跟进中") {
        // val === '新建' ||
        this.pushSalesSources(1)
      } else if (this.value === "失败关闭") {
        if (this.reason.length > 0) {
          this.pushSalesSources(-1)
        } else {
          this.$message.warning("原因不能为空")
        }
      } else if (this.value === "升级到客户") {
        this.$confirm('升级后将转入"客户管理"模块, 是否继续?', "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            this.editConfig.visible = true
            this.editConfig.title = "新建"
            this.editConfig.infomation = {
              ...this.commonConfig.infomation,
              sales_leads_id: this.commonConfig.infomation.id
            }
          })
          .catch(() => {})
      } else if (this.value === "升级到客户和销售机会") {
        this.$confirm('升级后将转入"客户管理"和"销售机会"模块, 是否继续?', "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            this.editConfig.visible = true
            this.editConfig.title = "新建"
            this.editConfig.isSalesOpportunity = true
            this.editConfig.infomation = {
              ...this.commonConfig.infomation,
              sales_leads_id: this.commonConfig.infomation.id
            }
          })
          .catch(() => {})
      }
    },
    // 推进接口
    async pushSalesSources(step) {
      await pushSalesSources({
        id: this.commonConfig.infomation.id,
        reason: this.reason,
        step: step
      }).then((res) => {
        console.log(res)
        this.$message.success("推进成功")
        this.handleClose()
        this.$parent.getData()
      })
    },
    // 销售机会
    salesOpportunityClick(item) {
      console.log(item)
      this.editOpportunityConfig.visible = true
      this.editOpportunityConfig.title = "新建"
      this.editOpportunityConfig.infomation = { client_name: item.name }
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
::v-deep {
  .advance-dialog .el-dialog__body {
    padding: 10px 20px;
    .content {
      .el-select {
        margin-left: 10px;
      }
      .two {
        margin-top: 15px;
        .reason {
          display: flex;
          margin-top: 10px;
          align-items: center;
          .label {
            width: 122px;
            text-align: right;
          }
          .input {
            margin-left: 10px;
            width: 195px;
          }
        }
      }
    }
    .dialog-footer {
      background-color: #f5f5f5;
      height: 55px;
      line-height: 55px;
    }
  }
}
</style>
src/views/client/salesLead/DetailSalesLead.vue
@@ -31,11 +31,11 @@
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -53,11 +53,11 @@
                <li v-for="(item, i) in dynamicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -75,11 +75,11 @@
                <li v-for="(item, i) in addressInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                  <div v-if="item.rightStr && item.rightStr.length > 0" class="right">
                    <div class="content-title">{{ item.rightStr + ":" }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -97,7 +97,7 @@
                <li>
                  <div class="left remark">
                    <div class="content-title">{{ "备注:" }}</div>
                    <div class="content-data">{{ "备注内容" }}</div>
                    <div class="content-data">{{ detailConfig.desc }}</div>
                  </div>
                </li>
              </ul>
src/views/client/salesLead/index.vue
@@ -3,22 +3,32 @@
    <div class="top">
      <SearchCommonView
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        @searchClick="searchClick"
        @resetClick="resetClick"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :operates-list="operatesList" />
        <PublicFunctionBtnView
          :operates-list="operatesList"
          @batchDelete="delClick"
          @allocationBtnClick="allocationBtnClick"
        />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
    <TableCommonView ref="tableListRef" :table-list="tableList" @selSalesLeadClick="selSalesLeadClick">
    <TableCommonView
      ref="tableListRef"
      :table-list="tableList"
      @selSalesLeadClick="selSalesLeadClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="160">
        <el-table-column label="操作" width="120">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button type="text" size="small">跟进</el-button>
            <el-button type="text" size="small">推进</el-button>
            <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
            <el-button @click="followupClick(scope.row)" type="text" size="small">跟进</el-button>
            <el-button @click="advanceClick(scope.row)" type="text" size="small">推进</el-button>
            <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
          </template>
        </el-table-column>
      </template>
@@ -29,6 +39,12 @@
    <ImportFileDialog v-if="importConfig.visible" :import-file-config="importConfig" />
    <!-- 详情 -->
    <DetailSalesLead v-if="salesLeadDeail.visible" :sales-lead-detail="salesLeadDeail" />
    <!-- 新建/编辑跟进记录 -->
    <AddFollowupRecordsDialog v-if="editConfig.visible" :edit-contacts-config="editConfig" />
    <!-- 推进 -->
    <AdvanceDialog v-if="advanceConfig.visible" :advance-config="advanceConfig" />
    <!-- 分配 -->
    <HighViewScopeDialog v-if="highViewScopeConfig.visible" :editCommonConfig="highViewScopeConfig" />
  </div>
</template>
@@ -38,6 +54,9 @@
import ImportFileDialog from "@/views/other/commonDialog/ImportFileDialog"
import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
import DetailSalesLead from "@/views/client/salesLead/DetailSalesLead"
import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog"
import AdvanceDialog from "@/views/client/salesLead/AdvanceDialog"
import HighViewScopeDialog from "@/views/other/commonDialog/HighViewScopeDialog"
export default {
  name: "SalesLead",
@@ -45,13 +64,17 @@
  components: {
    AddSalesLeadDialog,
    ImportFileDialog,
    DetailSalesLead
    DetailSalesLead,
    AddFollowupRecordsDialog,
    AdvanceDialog,
    HighViewScopeDialog
  },
  mixins: [pageMixin],
  computed: {},
  data() {
    return {
      tableList: {},
      selValueList: [],
      queryClassOptions: [
        { value: "1", label: "全部" },
        { value: "2", label: "广告宣传" },
@@ -82,6 +105,21 @@
      salesLeadDeail: {
        visible: false,
        infomation: {}
      },
      editConfig: {
        visible: false,
        title: "新建",
        infomation: {}
      },
      advanceConfig: {
        visible: false,
        sales_status: 1
      },
      search_map: {},
      highViewScopeConfig: {
        // 分配
        visible: false,
        infomation: {}
      }
    }
  },
@@ -107,13 +145,14 @@
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
    async getData() {
      await getSalesLeadsList({
        keyword: "",
        search_map: this.search_map,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
@@ -132,6 +171,18 @@
          console.log(err)
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 新建
    addBtnClick() {
      this.editSalesLeadConfig.visible = true
@@ -145,39 +196,68 @@
      this.editSalesLeadConfig.title = "编辑"
      this.editSalesLeadConfig.infomation = { ...row, businessStatus: "新建" }
    },
    // 跟进
    followupClick(row) {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = { sales_leads_name: row.name }
    },
    // 导入
    importClitk() {
      this.importConfig.visible = true
      this.importConfig.title = "销售线索"
    },
    // 分配
    allocationBtnClick() {
      if (this.selValueList && this.selValueList.length > 0) {
        this.highViewScopeConfig.visible = true
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDeleteSalesLeads({ id: id })
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
          .then(() => {
            console.log("dddd")
            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
              } else {
                this.$message.warning("删除失败")
              }
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    getSelectArray(val) {
      console.log(val)
      this.selValueList = []
      const list = val.map((item) => {
        return item.id
      })
      this.selValueList = list
    },
    // 详情
    selSalesLeadClick(row) {
      console.log(row)
      this.salesLeadDeail.visible = true
      this.salesLeadDeail.infomation = { ...row }
    },
    // 推进
    advanceClick(row) {
      console.log(row)
      this.advanceConfig.visible = true
      this.advanceConfig.sales_status = row.sales_status
      this.advanceConfig.infomation = { ...row }
    }
  }
}
src/views/other/commonDialog/HighViewScopeDialog.vue
@@ -6,12 +6,12 @@
      :width="dialogWidth"
      :before-close="handleClose"
    >
      <div class="view-sel-bg">
      <!-- <div class="view-sel-bg">
        <div class="title">查询选择</div>
        <el-input v-model="searchInput" size="mini" placeholder="请输入要查找的成员"></el-input>
        <el-checkbox v-model="resignMember">显示离职成员</el-checkbox>
        <el-checkbox v-model="defaultCollapse">子部门默认收起</el-checkbox>
      </div>
      </div> -->
      <div class="view-tree">
        <el-tree
          :data="data"
@@ -22,6 +22,10 @@
          highlight-current
          :props="defaultProps"
          :filter-node-method="filterNode"
          @check="handleCheckChange"
          :default-checked-keys="[id]"
          :check-strictly="true"
          :check-on-click-node="true"
        >
        </el-tree>
      </div>
@@ -139,6 +143,12 @@
    filterNode(value, data) {
      if (!value) return true
      return data.label.indexOf(value) !== -1
    },
    handleCheckChange(node, list) {
      this.id = node.id
      if (list.checkedKeys.length === 2) {
        this.$refs.tree.setCheckedKeys([node.id])
      }
    }
  }
}
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -497,7 +497,7 @@
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
        <el-button size="small" @click="handleClose">取消</el-button>
      </div>
      <!-- 选择客户 -->
      <SelectClientDialog
@@ -615,6 +615,10 @@
    },
    handleClose() {
      this.editConfig.visible = false
      console.log(this.editConfig.infomation.client_name)
      if (this.editConfig.title === "新建" && this.editConfig.infomation.client_name) {
        this.$parent.handleClose()
      }
    },
    // 保存
    saveClick(formName) {
@@ -633,7 +637,11 @@
                    message: "添加成功",
                    type: "success"
                  })
                  this.$parent.getData()
                  if (this.editConfig.title === "新建" && this.editConfig.infomation.client_name) {
                    this.$parent.handleClose()
                  } else {
                    this.$parent.getData()
                  }
                }
              })
              .catch((err) => {