yangfeng
2023-07-20 02a1ab651bb79684cf0656bd6fad0611fe568b2b
src/views/client/client/index.vue
@@ -36,6 +36,7 @@
            <el-button type="text" size="small">变更公海</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>
          </template>
        </el-table-column>
      </template>
@@ -47,7 +48,7 @@
<script>
import AddClientManageDialog from "@/views/client/client/AddClientManageDialog.vue"
import { getClientList } from "@/api/client/client"
import { getClientList, getDeleteClient } from "@/api/client/client"
export default {
  name: "CustomManage",
@@ -166,36 +167,7 @@
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = {
        name: "",
        number: "",
        client_status_id: "",
        member_id: "",
        client_type_id: "",
        clientSource: "",
        client_level_id: "",
        service_member_id: "",
        next_visit_time: "",
        latest_service_time: "",
        contact_name: "",
        contact_phone: "",
        contact_duties: "",
        contact_wechat: "",
        contact_email: "",
        industry_id: "",
        representative: "",
        registration_time: "",
        registered_capital_id: "",
        enterprise_nature_id: "",
        enterprise_scale_id: "",
        business_scope: "",
        country: "",
        province: "",
        city: "",
        region: "",
        detail_address: "",
        remark: ""
      }
      this.editConfig.infomation = {}
    },
    // 编辑
    handleClick(row) {
@@ -212,36 +184,33 @@
      }
      console.log(contactObj)
      this.editConfig.infomation = {
        id: row.id,
        name: row.name,
        number: row.number,
        client_status_id: row.client_status_id,
        member_id: row.member_id,
        client_type_id: row.client_type_id,
        clientSource: row.clientSource,
        client_level_id: row.client_level_id,
        service_member_id: row.service_member_id,
        next_visit_time: row.next_visit_time,
        latest_service_time: row.latest_service_time,
        contact_name: row.contact_name,
        contact_phone: row.contact_phone,
        contact_duties: "",
        ...row,
        contact_wechat: contactObj.length > 0 ? contactObj.wechat : "",
        contact_email: contactObj.length > 0 ? contactObj.email : "",
        industry_id: row.industry_id,
        representative: row.representative,
        registration_time: row.registration_time,
        registered_capital_id: row.registered_capital_id,
        enterprise_nature_id: row.enterprise_nature_id,
        enterprise_scale_id: row.enterprise_scale_id,
        business_scope: row.business_scope,
        country: row.country,
        province: row.province,
        city: row.city,
        region: row.region,
        detail_address: row.detail_address,
        remark: row.remark
        contact_email: contactObj.length > 0 ? contactObj.email : ""
      }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDeleteClient({ id: id })
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getUserList()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
    },
    getSelectArray(val) {
      console.log(val)
    }
  }
}