yangfeng
2023-07-17 960d295793f1d164e3e8e22f8d7744b7923ae24b
销售线索列表、新建、编辑接口联调
3个文件已添加
2 文件已重命名
11个文件已修改
674 ■■■■ 已修改文件
src/api/common/address.js 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/custom/client.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/custom/contacts.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/custom/followupRecords.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/custom/salesLead.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/common/config/index.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/appsidebar/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonSelectView.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/custom/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/custom/client/AddClientManageDialog.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/custom/client/index.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/custom/contacts/index.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/custom/followupRecords/index.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/custom/salesLead/AddSalesLeadDialog.vue 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/custom/salesLead/index.vue 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/common/address.js
New file
@@ -0,0 +1,75 @@
import request from "@/common/untils/request.js"
// 获取国家列表
export function getCountryList() {
  return request({
    url: "/api/country/list",
    method: "get"
  })
}
// 添加国家
export function getAddCountry() {
  return request({
    url: "/api/country/add",
    method: "post"
  })
}
// 删除国家
export function getDeleteCountry(data) {
  return request({
    url: "/api/country/delete",
    method: "delete",
    data
  })
}
// 设置国家
export function getSetCountry() {
  return request({
    url: "/api/country/set",
    method: "put"
  })
}
// 更新国家
export function getUpdateCountry() {
  return request({
    url: "/api/country/update",
    method: "put"
  })
}
// 获取省份列表
export function getProvinceList() {
  return request({
    url: "/api/province/list",
    method: "get"
  })
}
// 添加省份
export function getAddProvince() {
  return request({
    url: "/api/province/add",
    method: "post"
  })
}
// 删除省份
export function getDeleteProvince(data) {
  return request({
    url: "/api/province/delete",
    method: "delete",
    data
  })
}
// 设置省份
export function getSetProvince() {
  return request({
    url: "/api/province/set",
    method: "put"
  })
}
// 更新省份
export function getUpdateProvince() {
  return request({
    url: "/api/province/update",
    method: "put"
  })
}
src/api/custom/client.js
New file
@@ -0,0 +1,31 @@
import request from "@/common/untils/request.js"
// 客户管理列表
export function getClientList() {
  return request({
    url: "/api/client/list",
    method: "get"
  })
}
// 添加客户管理
export function getAddClient() {
  return request({
    url: "/api/client/add",
    method: "post"
  })
}
// 删除客户管理
export function getDeleteClient(data) {
  return request({
    url: "/api/client/delete",
    method: "delete",
    data
  })
}
// 更新客户管理
export function getUpdateClient() {
  return request({
    url: "/api/client/update",
    method: "put"
  })
}
src/api/custom/contacts.js
New file
@@ -0,0 +1,31 @@
import request from "@/common/untils/request.js"
// 联系人列表
export function getContactList() {
  return request({
    url: "/api/contact/list",
    method: "get"
  })
}
// 添加联系人
export function getAddContact() {
  return request({
    url: "/api/contact/add",
    method: "post"
  })
}
// 删除联系人
export function getDeleteContact(data) {
  return request({
    url: "/api/contact/delete",
    method: "delete",
    data
  })
}
// 更新联系人
export function getUpdateContact() {
  return request({
    url: "/api/contact/update",
    method: "put"
  })
}
src/api/custom/followupRecords.js
@@ -7,3 +7,25 @@
    method: "get"
  })
}
// 添加跟进记录
export function getAddFollowRecord() {
  return request({
    url: "/api/followRecord/add",
    method: "post"
  })
}
// 删除跟进记录
export function getDeleteFollowRecord(data) {
  return request({
    url: "/api/followRecord/delete",
    method: "delete",
    data
  })
}
// 更新跟进记录
export function getUpdateFollowRecord() {
  return request({
    url: "/api/followRecord/update",
    method: "put"
  })
}
src/api/custom/salesLead.js
@@ -8,10 +8,11 @@
  })
}
// 添加销售线索
export function getAddSalesLeads() {
export function getAddSalesLeads(data) {
  return request({
    url: "/api/salesLeads/add",
    method: "post"
    method: "post",
    data
  })
}
// 删除销售线索
@@ -23,12 +24,14 @@
  })
}
// 更新销售线索
export function getUpdateSalesLeads() {
export function getUpdateSalesLeads(data) {
  return request({
    url: "/api/salesLeads/update",
    method: "put"
    method: "put",
    data
  })
}
// 商机来源列表
export function getSalesSourcesList() {
  return request({
src/common/config/index.js
@@ -0,0 +1,20 @@
export function 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/components/layout/components/appsidebar/index.vue
@@ -19,7 +19,7 @@
            <span>客户管理</span>
          </template>
          <el-menu-item index="/custom/salesLead">销售线索</el-menu-item>
          <el-menu-item index="/custom/customManage">客户管理</el-menu-item>
          <el-menu-item index="/custom/clientManage">客户管理</el-menu-item>
          <el-menu-item index="/custom/contacts">联系人</el-menu-item>
          <el-menu-item index="/custom/followupRecords">跟进记录</el-menu-item>
        </el-submenu>
src/components/makepager/CommonSelectView.vue
@@ -1,7 +1,7 @@
<template>
  <div class="common-select">
    <el-select v-model="commonDefautValue" placeholder="请选择" class="common-select-sel" size="mini">
      <el-option v-for="item in commonOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
      <el-option v-for="item in commonOptions" :key="item.id" :label="item.name" :value="item.name"> </el-option>
    </el-select>
    <div class="common-select-btn" @click="commonSelClick">
      <i class="el-icon-setting"></i>
@@ -29,6 +29,7 @@
  },
  methods: {
    commonSelClick() {
      console.log("1111111")
      this.$emit("editDropdownBox")
    }
  }
src/components/makepager/TableCommonView.vue
@@ -28,7 +28,7 @@
        <template slot-scope="scope">
          <span v-if="item.price">{{ "¥" + number_format(scope.row[item.prop], 2, ".", ",") }}</span>
          <div v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div>
          <span v-else>{{ scope.row[item.prop] }}</span>
          <span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span>
        </template>
      </el-table-column>
      <slot name="tableButton" />
src/router/custom/index.js
@@ -1,7 +1,7 @@
// const type from '@/router/deployCode'
const salesLead = (resolve) => require(["@/views/custom/salesLead/index"], resolve) // 销售线索
const customManage = (resolve) => require(["@/views/custom/customManage/index"], resolve) // 销售线索
const clientManage = (resolve) => require(["@/views/custom/client/index"], resolve) // 客户管理
const contacts = (resolve) => require(["@/views/custom/contacts/index"], resolve) // 联系人
const followupRecords = (resolve) => require(["@/views/custom/followupRecords/index"], resolve) // 跟进记录
@@ -16,9 +16,9 @@
    }
  },
  {
    path: "/custom/customManage",
    name: "customManage",
    component: customManage,
    path: "/custom/clientManage",
    name: "clientManage",
    component: clientManage,
    meta: {
      title: "客户管理",
      requireAuth: true
src/views/custom/client/AddClientManageDialog.vue
File was renamed from src/views/custom/customManage/AddCustomManageDialog.vue
@@ -1,7 +1,7 @@
<template>
  <div class="add-custom-manage">
  <div class="add-client-manage">
    <el-dialog
      :title="editCuntomManageConfig.title + '客户管理'"
      :title="editClientManageConfig.title + '客户管理'"
      :visible.sync="editConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
@@ -352,9 +352,9 @@
<script>
import CommonSelectView from "@/components/makepager/CommonSelectView"
export default {
  name: "AddCustomManageDialog",
  name: "AddClientManageDialog",
  props: {
    editCuntomManageConfig: {
    editClientManageConfig: {
      type: Object,
      default: () => {
        return {
@@ -409,7 +409,7 @@
  data() {
    return {
      dialogWidth: "80%",
      editConfig: this.editCuntomManageConfig,
      editConfig: this.editClientManageConfig,
      rules: {
        customName: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
        customStatus: [{ required: true, message: "请选择客户状态", trigger: "change" }],
@@ -471,7 +471,7 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.add-custom-manage {
.add-client-manage {
  .basic-info {
    .basic-info-title {
      background-color: #f4f8fe;
src/views/custom/client/index.vue
File was renamed from src/views/custom/customManage/index.vue
@@ -29,7 +29,7 @@
      />
      <PagerView class="page" />
    </div>
    <TableCommonView ref="tableListRef" :table-list="tableList">
    <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList">
      <template slot="tableButton">
        <el-table-column label="操作" width="150" fixed="right">
          <template slot-scope="scope">
@@ -41,17 +41,19 @@
      </template>
    </TableCommonView>
    <!-- 新建/编辑客户管理 -->
    <AddCustomManageDialog v-if="editConfig.visible" :edit-cuntom-manage-config="editConfig" />
    <AddClientManageDialog v-if="editConfig.visible" :edit-client-manage-config="editConfig" />
  </div>
</template>
<script>
import AddCustomManageDialog from "@/views/custom/customManage/AddCustomManageDialog"
import AddClientManageDialog from "@/views/custom/client/AddClientManageDialog"
import { getClientList } from "@/api/custom/client"
import { dateFormat } from "@/common/config/index"
export default {
  name: "CustomManage",
  props: {},
  components: {
    AddCustomManageDialog
    AddClientManageDialog
  },
  computed: {
    searchCommonHeight() {
@@ -61,6 +63,7 @@
  data() {
    return {
      tableList: {},
      loading: false,
      activeName: "first",
      gonghaiValue: "",
      gonghaiOptions: [],
@@ -92,33 +95,22 @@
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            customName: "上海通用机械有限公司",
            saleLeadOwner: "BOSS",
            importantLevel: "C类客户",
            notContactDay: "20",
            contactName: "董奇伟",
            phoneNumber: "15988887777",
            nextFollowDate: "2023-07-26",
            detailAddress: "上海市静安区威海路115号",
            customStatus: "潜在客户"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "客户名称", prop: "customName", min: 100 }, // 客户名称
          { label: "销售负责人", prop: "saleLeadOwner" }, // 销售负责人
          { label: "客户名称", prop: "name", min: 100 }, // 客户名称
          { label: "销售负责人", prop: "service_member_id" }, // 销售负责人
          { label: "重要级别", prop: "importantLevel" }, // 重要级别
          { label: "下次回访日期", prop: "notContactDay", min: 90 }, // 未联系人天数
          { label: "手机号码", prop: "nextFollowDate" }, // 下次回访日期
          { label: "详细地址", prop: "detailAddress", min: 200 }, // 详细地址
          { label: "客户状态", prop: "customStatus" }, // 客户状态
          { label: "联系人姓名", prop: "contactName" }, // 联系人姓名
          { label: "手机", prop: "phoneNumber" } // 手机号码
          { label: "下次回访日期", prop: "next_visit_time", min: 90 }, // 下次回访日期
          { label: "手机号码", prop: "phoneNumber" }, // 手机号码
          { label: "详细地址", prop: "detail_address", min: 200 }, // 详细地址
          { label: "客户状态", prop: "client_status_id" }, // 客户状态
          { label: "联系人姓名", prop: "contact_name" }, // 联系人姓名
          { label: "手机", prop: "phone" } // 手机号码
        ]
      }
      this.searchOptions = []
@@ -127,6 +119,42 @@
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getClientList()
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  name: item.name,
                  service_member_id: item.service_member_id,
                  importantLevel: "",
                  next_visit_time: dateFormat("YYYY-mm-dd HH:MM", item.next_visit_time),
                  phoneNumber: "",
                  detail_address: item.detail_address,
                  client_status_id: item.client_status_id,
                  contact_name: "",
                  phone: ""
                }
              })
              this.tableList.tableInfomation = list || []
            } else {
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
    tabsClick(tab, event) {
      console.log(tab, event)
    },
src/views/custom/contacts/index.vue
@@ -5,7 +5,7 @@
      <PublicFunctionBtnView :operates-list="operatesList" />
      <PagerView class="page" />
    </div>
    <TableCommonView ref="tableListRef" :table-list="tableList">
    <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList">
      <template slot="tableButton">
        <el-table-column label="操作" width="120" fixed="right">
          <template slot-scope="scope">
@@ -22,6 +22,7 @@
<script>
import AddContactsDialog from "@/views/custom/contacts/AddContactsDialog"
import { getContactList } from "@/api/custom/contacts"
export default {
  name: "ContactsView",
  props: {},
@@ -32,6 +33,7 @@
  data() {
    return {
      tableList: {},
      loading: false,
      queryClassOptions: [
        { value: "1", label: "全部" },
        { value: "2", label: "本月生日" }
@@ -59,29 +61,20 @@
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            contactName: "上海通用机械有限公司",
            customName: "BOSS",
            contactNumber: "C类客户",
            duties: "20",
            phoneNumber: "董奇伟",
            salesHead: "15988887777",
            primaryContact: "2023-07-26"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "联系人姓名", prop: "contactName", min: 100 }, // 联系人姓名
          { label: "客户名称", prop: "customName", min: 190 }, // 客户名称
          { label: "联系人编号", prop: "contactNumber", min: 100 }, // 联系人编号
          { label: "客户名称", prop: "client_name", min: 190 }, // 客户名称
          { label: "联系人编号", prop: "number", min: 100 }, // 联系人编号
          { label: "职务", prop: "duties", min: 120 }, // 职务
          { label: "手机", prop: "phoneNumber", min: 100 }, // 手机号码
          { label: "手机", prop: "phone", min: 100 }, // 手机号码
          { label: "销售负责人", prop: "salesHead", min: 120 }, // 销售负责人
          { label: "首要联系人", prop: "primaryContact", min: 90 } // 首要联系人
          { label: "首要联系人", prop: "name", min: 90 } // 首要联系人
        ]
      }
      this.searchOptions = []
@@ -90,6 +83,40 @@
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getContactList()
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  contactName: "",
                  client_name: item.Client.name,
                  number: item.number,
                  duties: "",
                  phone: item.phone,
                  salesHead: "",
                  name: item.name
                }
              })
              this.tableList.tableInfomation = list || []
            } else {
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
src/views/custom/followupRecords/index.vue
@@ -5,7 +5,7 @@
      <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" />
      <PagerView class="page" />
    </div>
    <TableCommonView ref="tableListRef" :table-list="tableList">
    <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList">
      <template slot="tableButton">
        <el-table-column label="操作" width="120" fixed="right">
          <template slot-scope="scope">
@@ -22,6 +22,7 @@
<script>
import AddFollowupRecordsDialog from "@/views/custom/followupRecords/AddFollowupRecordsDialog"
import { getFollowRecordList } from "@/api/custom/followupRecords.js"
import { dateFormat } from "@/common/config/index"
export default {
  name: "FollowupRecords",
@@ -37,6 +38,7 @@
  data() {
    return {
      tableList: {},
      loading: false,
      activeName: "second",
      queryClassOptions: [
        { value: "1", label: "全部" },
@@ -69,29 +71,17 @@
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            theme: "上门拜访",
            customName: "上海通用机械有限公司",
            contactName: "BOSS",
            customStatus: "C类客户",
            phoneNumber: "15988887777",
            contactDate: "董奇伟",
            nextFollowupDate: "2023-07-28",
            owner: "2023-07-26",
            followupRecords: "上海市静安区威海路115号"
          }
        ],
        tableInfomation: [],
        tableColumn: [
          { label: "主题", prop: "theme", min: 190 }, // 主题
          { label: "客户名称", prop: "customName", min: 190 }, // 客户名称
          { label: "联系人姓名", prop: "contactName", min: 100 }, // 联系人姓名
          { label: "客户状态", prop: "customStatus", min: 100 }, // 客户状态
          { label: "联系方式", prop: "phoneNumber", min: 100 }, // 联系方式
          { label: "联系人日期", prop: "contactDate", min: 100 }, // 联系人日期
          { label: "下次回访日期", prop: "nextFollowupDate", min: 130 }, // 下次回访日期
          { label: "负责人", prop: "owner", min: 120 }, // 负责人
          { label: "跟进记录", prop: "followupRecords", min: 120 } // 跟进记录
          { label: "主题", prop: "topic", min: 190 }, // 主题
          { label: "客户名称", prop: "client_name", min: 190 }, // 客户名称
          { label: "联系人姓名", prop: "contact_name", min: 100 }, // 联系人姓名
          { label: "客户状态", prop: "client_status_id", min: 100 }, // 客户状态
          { label: "联系方式", prop: "phone", min: 100 }, // 联系方式
          { label: "联系人日期", prop: "follow_time", min: 100 }, // 联系人日期
          { label: "下次回访日期", prop: "next_follow_time", min: 130 }, // 下次回访日期
          { label: "负责人", prop: "member_id", min: 120 }, // 负责人
          { label: "跟进记录", prop: "record", min: 120 } // 跟进记录
        ]
      }
      this.searchOptions = []
@@ -101,13 +91,40 @@
      }
    },
    // 请求数据
    // 请求数据
    async getData() {
      this.loading = true
      await getFollowRecordList()
        .then((res) => {
          console.log("成功" + res)
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  topic: item.topic,
                  client_name: item.client.name,
                  contact_name: item.contact.name,
                  client_status_id: item.client.client_status_id,
                  phone: item.contact.phone,
                  follow_time: dateFormat("YYYY-mm-dd HH:MM", item.follow_time),
                  next_follow_time: dateFormat("YYYY-mm-dd HH:MM", item.next_follow_time),
                  member_id: item.member_id,
                  record: item.record
                }
              })
              this.tableList.tableInfomation = list || []
            } else {
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
    // 新建
src/views/custom/salesLead/AddSalesLeadDialog.vue
@@ -21,32 +21,32 @@
          <div class="basic-info-view">
            <el-row>
              <el-col :span="12">
                <el-form-item label="客户名称" prop="customName">
                  <el-input v-model="editConfig.infomation.customName"></el-input>
                <el-form-item label="客户名称" prop="name">
                  <el-input v-model="editConfig.infomation.name"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="销售线索编号" prop="saleLeadNumber">
                  <el-input v-model="editConfig.infomation.saleLeadNumber"></el-input>
                <el-form-item label="销售线索编号" prop="number">
                  <el-input v-model="editConfig.infomation.number"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="联系人姓名" prop="contactName">
                  <el-input v-model="editConfig.infomation.contactName"></el-input>
                <el-form-item label="联系人姓名" prop="contact_name">
                  <el-input v-model="editConfig.infomation.contact_name"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="联系人职务" prop="contactDuties">
                  <el-input v-model="editConfig.infomation.contactDuties"></el-input>
                <el-form-item label="联系人职务" prop="contact_position">
                  <el-input v-model="editConfig.infomation.contact_position"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="手机号码" prop="phoneNumber">
                  <el-input v-model="editConfig.infomation.phoneNumber"></el-input>
                <el-form-item label="手机号码" prop="contact_phone">
                  <el-input v-model="editConfig.infomation.contact_phone"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
@@ -57,17 +57,31 @@
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="商机来源" prop="businessSource">
                  <CommonSelectView
                    :common-value="editConfig.infomation.businessSource"
                    :common-options="businessSourceOptions"
                    @editDropdownBox="editDropdownBox"
                  />
                <el-form-item label="商机来源" prop="sales_sources_id">
                  <div class="common-select">
                    <el-select
                      v-model="editConfig.infomation.sales_sources_id"
                      placeholder="请选择"
                      class="common-select-sel"
                      size="mini"
                    >
                      <el-option
                        v-for="item in businessSourceOptions"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      >
                      </el-option>
                    </el-select>
                    <div class="common-select-btn" @click="editDropdownBox">
                      <i class="el-icon-setting"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="负责人" prop="owner">
                  <el-select v-model="editConfig.infomation.owner" placeholder="请选择" size="mini">
                <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.value" :label="item.label" :value="item.value">
                    </el-option>
                  </el-select>
@@ -77,8 +91,8 @@
          </div>
          <!-- 地址信息 -->
          <div v-if="isUnflod" class="basic-info-title">地址信息</div>
          <div v-if="isUnflod" class="address-view">
            <el-row>
          <div v-if="isUnflod" class="basic-info-view">
            <!-- <el-row>
              <el-col :span="24">
                <el-form-item label="定位" prop="position">
                  <el-input v-model="editConfig.infomation.position"></el-input>
@@ -91,7 +105,7 @@
                  <div style="height: 100px"></div>
                </el-form-item>
              </el-col>
            </el-row>
            </el-row> -->
            <el-row>
              <el-col :span="12">
                <el-form-item label="国家" prop="country">
@@ -134,12 +148,12 @@
          <div v-if="isUnflod" class="basic-info-view">
            <el-row>
              <el-col :span="24">
                <el-form-item label="地址" prop="address">
                <el-form-item label="备注" prop="desc">
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 2, maxRows: 4 }"
                    placeholder="请输入内容"
                    v-model="editConfig.infomation.address"
                    v-model="editConfig.infomation.desc"
                  ></el-input>
                </el-form-item>
              </el-col>
@@ -166,7 +180,7 @@
<script>
import CommonSelectView from "@/components/makepager/CommonSelectView"
import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog"
import { getSalesSourcesList } from "@/api/custom/salesLead"
import { getSalesSourcesList, getAddSalesLeads, getUpdateSalesLeads } from "@/api/custom/salesLead"
export default {
  name: "AddSalesLeadDialog",
@@ -178,21 +192,21 @@
          visible: false,
          title: "新建",
          infomation: {
            customName: "",
            saleLeadNumber: "LEA50",
            contactName: "",
            contactDuties: "",
            phoneNumber: "",
            name: "",
            number: "LEA50",
            contact_name: "",
            contact_position: "",
            contact_phone: "",
            businessStatus: "",
            businessSource: "1",
            owner: "",
            position: "",
            map: "",
            country: "1",
            province: "1",
            city: "1",
            region: "1",
            address: ""
            sales_sources_id: "",
            member_id: "",
            country: "",
            province: "",
            city: "",
            region: "",
            address: "",
            desc: "",
            id: ""
          }
        }
      }
@@ -209,20 +223,20 @@
      dialogWidth: "80%",
      editConfig: this.editSalesLeadConfig,
      rules: {
        customName: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
        saleLeadNumber: [{ required: true, message: "请输入销售线索编号", trigger: "blur" }],
        name: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
        number: [{ required: true, message: "请输入销售线索编号", trigger: "blur" }],
        businessStatus: [{ required: true, message: "请输入商机状态", trigger: "blur" }],
        businessSource: [{ required: true, message: "请选择商机来源", trigger: "change" }]
        sales_sources_id: [{ required: true, message: "请选择商机来源", trigger: "change" }]
      },
      businessSourceOptions: [
        { value: "1", label: "后台注册" },
        { value: "2", label: "代理商客户" },
        { value: "3", label: "电话陌生拜访" },
        { value: "4", label: "直接访问" },
        { value: "5", label: "项目合作" },
        { value: "6", label: "个人自找" },
        { value: "7", label: "二次销售" },
        { value: "8", label: "公司电话" }
        { id: "1", name: "后台注册" },
        { id: "2", name: "代理商客户" },
        { id: "3", name: "电话陌生拜访" },
        { id: "4", name: "直接访问" },
        { id: "5", name: "项目合作" },
        { id: "6", name: "个人自找" },
        { id: "7", name: "二次销售" },
        { id: "8", name: "公司电话" }
      ],
      ownerOptions: [
        { value: "1", label: "BOSS" },
@@ -269,7 +283,7 @@
      getSalesSourcesList()
        .then((res) => {
          console.log(res)
          // this.businessSourceOptions = res.data.tableList
          this.businessSourceOptions = res.data.list
        })
        .catch((err) => {
          console.log(err)
@@ -282,7 +296,56 @@
    saveClick(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit")
          console.log(this.editConfig.infomation)
          let params = {
            city_id: 0,
            contact_name: this.editConfig.infomation.contact_name || "",
            contact_phone: this.editConfig.infomation.contact_phone || "",
            contact_position: this.editConfig.infomation.contact_position || "",
            country_id: 0,
            id: this.editConfig.title === "新建" ? 0 : this.editConfig.infomation.id,
            desc: this.editConfig.infomation.desc || "",
            member_id: parseInt(this.editConfig.infomation.member_id) || 0,
            name: this.editConfig.infomation.name || "",
            number: this.editConfig.infomation.number || "",
            province_id: 0,
            region_id: 0,
            sales_sources_id: this.editConfig.infomation.sales_sources_id || 0
          }
          console.log(params)
          if (this.editConfig.title === "新建") {
            getAddSalesLeads(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "添加成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
          } else {
            getUpdateSalesLeads(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "编辑成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
          }
        } else {
          console.log("error submit")
          return false
@@ -325,10 +388,17 @@
    .basic-info-view {
      margin-top: 10px;
      padding-right: 40px;
      .common-select {
        display: flex;
        .common-select-sel {
          width: 270px;
    }
    .address-view {
      margin-top: 10px;
      padding-right: 40px;
        .common-select-btn {
          margin-left: 5px;
          font-size: 16px;
          cursor: pointer;
        }
      }
    }
  }
  .unflod-collapse {
src/views/custom/salesLead/index.vue
@@ -86,7 +86,7 @@
          { label: "商机来源", prop: "sales_sources_id", min: 190 }, // 商机来源
          { label: "省份", prop: "province", min: 190 }, // 省份
          { label: "城市", prop: "city", min: 190 }, // 城市
          { label: "负责人", prop: "owner", min: 190 } // 负责人
          { label: "负责人", prop: "member_id", min: 190 } // 负责人
        ]
      }
      this.searchOptions = []
@@ -99,12 +99,20 @@
    async getData() {
      await getSalesLeadsList()
        .then((res) => {
          console.log(res)
          this.tableList.tableInfomation = res.data.tableList.map((item) => {
            item.province = item.Province.name
            item.city = item.City.name
            return item
          const list = res.data.list.map((item) => {
            return {
              id: item.id,
              name: item.name,
              number: item.number,
              contact_name: item.contact_name,
              contact_phone: item.contact_phone,
              sales_sources_id: item.sales_sources_id,
              province: item.Province.name,
              city: item.City.name,
              member_id: item.member_id
            }
          })
          this.tableList.tableInfomation = list || []
        })
        .catch((err) => {
          console.log(err)
@@ -115,21 +123,20 @@
      this.editSalesLeadConfig.visible = true
      this.editSalesLeadConfig.title = "新建"
      this.editSalesLeadConfig.infomation = {
        customName: "",
        saleLeadNumber: "LEA50",
        contactName: "",
        contactDuties: "",
        phoneNumber: "",
        name: "",
        number: "",
        contact_name: "",
        contact_position: "",
        contact_phone: "",
        businessStatus: "新建",
        businessSource: "1",
        owner: "",
        position: "",
        map: "",
        country: "1",
        province: "1",
        city: "1",
        region: "1",
        address: ""
        sales_sources_id: "",
        member_id: "",
        country: "",
        province: "",
        city: "",
        region: "",
        address: "",
        desc: ""
      }
    },
    // 编辑
@@ -138,21 +145,21 @@
      this.editSalesLeadConfig.visible = true
      this.editSalesLeadConfig.title = "编辑"
      this.editSalesLeadConfig.infomation = {
        customName: row.customName,
        saleLeadNumber: row.saleLeadNumber,
        contactName: row.contactName,
        contactDuties: row.contactDuties,
        phoneNumber: row.phoneNumber,
        businessStatus: "新建",
        businessSource: row.businessSource,
        owner: row.owner,
        position: "",
        map: "",
        country: "1",
        province: "1",
        city: "1",
        region: "1",
        address: ""
        id: row.id,
        name: row.name,
        number: row.number,
        contact_name: row.contact_name,
        contact_position: row.contact_position,
        contact_phone: row.contact_phone,
        businessStatus: "编辑",
        sales_sources_id: row.sales_sources_id,
        member_id: row.member_id,
        country: "",
        province: "",
        city: "",
        region: "",
        address: "",
        desc: row.desc
      }
    },
    // 导入