yangfeng
2023-08-16 8191562f28c525373941af4638c30c8f8e74c245
src/views/client/client/index.vue
@@ -171,15 +171,22 @@
                let contact_name = ""
                let contact_phone = ""
                let contact_id = 0
                let contact_wechat = ""
                let contact_email = ""
                let position = ""
                if (item.contacts.length !== 0) {
                  for (let i = 0; i < item.contacts.length; i++) {
                    if (item.contacts[i].is_first) {
                      contact_name = item.contacts[i].name
                      contact_phone = item.contacts[i].phone
                      contact_id = item.contacts[i].id
                      contact_wechat = item.contacts[i].wechat
                      contact_email = item.contacts[i].email
                      position = item.contacts[i].position
                    }
                  }
                }
                console.log(contact_wechat, contact_email)
                return {
                  ...item,
                  contact_name: contact_name,
@@ -187,7 +194,10 @@
                  client_level: item.client_level.name,
                  client_status: item.client_status.name,
                  contact_id: contact_id,
                  member_name: item.member.username
                  member_name: item.member.username,
                  contact_wechat: contact_wechat,
                  contact_email: contact_email,
                  position: position
                }
              })
              this.tableList.tableInfomation = list || []
@@ -232,18 +242,8 @@
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      let contactObj = {}
      if (row.contacts.length > 0) {
        row.contacts.forEach((ele) => {
          if (ele.is_first) {
            contactObj = { ...ele }
          }
        })
      }
      this.editConfig.infomation = {
        ...row,
        contact_wechat: contactObj.length > 0 ? contactObj.wechat : "",
        contact_email: contactObj.length > 0 ? contactObj.email : ""
        ...row
      }
    },
    // 删除