yangfeng
2023-07-17 960d295793f1d164e3e8e22f8d7744b7923ae24b
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
        })
    },
    // 新建