yangfeng
2023-08-25 f417dc0a44d225d4ed19bcb5207250eb1b669455
src/views/client/client/index.vue
@@ -45,7 +45,10 @@
      <template slot="tableButton">
        <el-table-column label="操作" width="150">
          <template slot-scope="scope">
            <el-button type="text" size="small" disabled>变更公海</el-button>
            <el-button v-if="activeName === 'first'" type="text" size="small" @click="allocationBtnClick(scope.row)"
              >分配</el-button
            >
            <el-button v-else type="text" size="small" @click="changeHighSeasClick(scope.row)">变更公海</el-button>
            <el-button @click="handleClick(scope.row)" 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> -->
@@ -61,6 +64,8 @@
    <DetailContacts v-if="contactsDeail.visible" :contacts-detail="contactsDeail" />
    <!-- 新建/编辑跟进记录 -->
    <AddFollowupRecordsDialog v-if="editFollowupConfig.visible" :edit-contacts-config="editFollowupConfig" />
    <!-- 分配 -->
    <AllocationDialog v-if="allocationConfig.visible" :edit-common-config="allocationConfig" />
  </div>
</template>
@@ -69,6 +74,8 @@
import { getClientList, getDeleteClient } from "@/api/client/client"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog"
import AllocationDialog from "@/views/client/client/AllocationDialog"
import { getAssign } from "@/api/common/other"
export default {
  name: "CustomManage",
@@ -78,7 +85,8 @@
    AddClientManageDialog,
    DetailContacts: () => import("@/views/client/contacts/DetailContacts"),
    DetailClientManage: () => import("@/views/client/client/DetailClientManage"),
    AddFollowupRecordsDialog
    AddFollowupRecordsDialog,
    AllocationDialog
  },
  computed: {},
  data() {
@@ -126,11 +134,19 @@
        visible: false,
        title: "新建",
        infomation: {}
      }
      },
      allocationConfig: {
        visible: false,
        infomation: {}
      },
      not_admin: 2
    }
  },
  created() {
    this.setTable()
    this.search_map = {
      not_admin: this.not_admin
    }
    this.getData()
  },
  methods: {
@@ -186,7 +202,6 @@
                    }
                  }
                }
                console.log(contact_wechat, contact_email)
                return {
                  ...item,
                  contact_name: contact_name,
@@ -216,26 +231,44 @@
          this.loading = false
        })
    },
    tabsClick(tab, event) {
      console.log(tab, event)
    tabsClick(tab) {
      console.log(tab.name)
      if (tab.name === "first") {
        this.not_admin = 2
      } else {
        this.not_admin = 1
      }
      this.resetClick()
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        not_admin: this.not_admin,
        [val.value]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.search_map = {
        not_admin: this.not_admin
      }
      this.getData()
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = { city_id: 0 }
      this.editConfig.infomation = {
        city_id: 0,
        client_type_id: 1,
        client_origin_id: 1,
        client_level_id: 1,
        registered_capital_id: 1,
        enterprise_nature_id: 1,
        enterprise_scale_id: 1,
        industry_id: 1
      }
    },
    // 编辑
    handleClick(row) {
@@ -311,6 +344,26 @@
        number: "",
        next_follow_time: row.next_visit_time
      }
    },
    // 分配
    allocationBtnClick(row) {
      console.log(row)
      this.allocationConfig.visible = true
      this.allocationConfig.infomation = { member_id: row.member_id, id: row.id }
    },
    // 变更公海
    async changeHighSeasClick(row) {
      await getAssign({
        ids: [row.id],
        member_id: 1,
        type: "client"
      }).then((res) => {
        this.editConfig.visible = false
        if (res.code === 200) {
          this.$message.success("变更成功")
          this.getData()
        }
      })
    }
  }
}