index.vue 3.91 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1
<template>
lanbaoming's avatar
lanbaoming committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
  <el-dialog
    :title="$t('选择联系人')"
    visible
    :before-close="closeDialog"
    :close-on-click-modal="false"
  >
    <div class="header mb-10 flex-center">
      <div class="flex-center">{{ $t("关键字") }}</div>
      <el-input v-model="form.searchKey" clearable class="w-200"></el-input>
      <el-button type="primary" class="ml-10" @click="handleQuery">{{
        $t("搜索")
      }}</el-button>
    </div>
    <div class="list">
      <div
        class="list-item"
        v-for="item in list"
        :key="item.customerContactsId"
        @click="choose(item)"
      >
        <div class="item-box">
          <div class="line">
            <div class="label">{{ $t("姓名") }}</div>
            <div class="value">{{ item.contactsName }}</div>
            <el-tag v-if="item.isInOpenSea" type="danger" effect="dark">{{
              $t("")
            }}</el-tag>
          </div>
          <!-- v1.7新增 -->
          <div class="line">
            <div class="label">{{ $t("姓名(英文)") }}</div>
            <div class="value">{{ item.contactsNameEn }}</div>
          </div>
          <div class="line">
            <div class="label">{{ $t("电话") }}</div>
            <div class="value">+{{ item.areaCode }} {{ item.phoneNew }}</div>
          </div>
          <div class="line">
            <div class="label">{{ $t("邮箱") }}</div>
            <div class="value">{{ item.email }}</div>
          </div>
          <div class="line">
            <div class="label">{{ $t("公司") }}</div>
            <div class="value">{{ item.company }}</div>
          </div>
          <!-- v1.7新增 -->
          <div class="line">
            <div class="label">{{ $t("公司(英文)") }}</div>
            <div class="value">{{ item.companyEn }}</div>
          </div>
lanbaoming's avatar
lanbaoming committed
52 53
        </div>
      </div>
lanbaoming's avatar
lanbaoming committed
54 55 56 57 58 59 60 61 62
    </div>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="form.pageNo"
      :limit.sync="form.pageSize"
      @pagination="loadList"
    />
  </el-dialog>
lanbaoming's avatar
lanbaoming committed
63 64
</template>
<script>
lanbaoming's avatar
lanbaoming committed
65 66 67 68
import {
  getCustomerContactsSelect,
  getCustomerContactsSelect2,
} from "@/api/ecw/customerContacts";
lanbaoming's avatar
lanbaoming committed
69
export default {
lanbaoming's avatar
lanbaoming committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
  props: {
    type: Number,
  },
  data() {
    return {
      show: true,
      form: {
        pageNo: 1,
        pageSize: 10,
        searchKey: "",
      },
      list: [],
      total: 0,
    };
  },
  created() {
    this.show = true;
    this.loadList();
  },
  methods: {
    handleQuery() {
      this.form.pageNo = 1;
      this.loadList();
lanbaoming's avatar
lanbaoming committed
93
    },
lanbaoming's avatar
lanbaoming committed
94
    loadList() {
lanbaoming's avatar
lanbaoming committed
95 96 97 98 99 100 101 102 103 104 105 106
      //加载联系人数据,怎样使用属性
      if (this.type == "1") {
        getCustomerContactsSelect2(this.form).then((res) => {
          this.list = res.data.list;
          this.total = res.data.total;
        });
      } else {
        getCustomerContactsSelect(this.form).then((res) => {
          this.list = res.data.list;
          this.total = res.data.total;
        });
      }
lanbaoming's avatar
lanbaoming committed
107
    },
lanbaoming's avatar
lanbaoming committed
108 109 110
    closeDialog() {
      this.show = false;
      this.$emit("close");
lanbaoming's avatar
lanbaoming committed
111
    },
lanbaoming's avatar
lanbaoming committed
112 113 114 115 116
    choose(contact) {
      this.$emit("choose", contact);
    },
  },
};
lanbaoming's avatar
lanbaoming committed
117 118
</script>
<style lang="scss" scoped>
lanbaoming's avatar
lanbaoming committed
119 120
.header {
  display: flex;
lanbaoming's avatar
lanbaoming committed
121
}
lanbaoming's avatar
lanbaoming committed
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
.list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  &-item {
    background: #eee;
    width: 300px;
    margin: 10px;
    padding: 5px;
    border-radius: 10px;
    border: 5px solid transparent;
    background: linear-gradient(white, white) padding-box,
      repeating-linear-gradient(
          -45deg,
          red 0,
          red 12.5%,
          transparent 0,
          transparent 25%,
          #58a 0,
          #58a 37.5%,
          transparent 0,
          transparent 50%
        )
        0/5em 5em;
    .item-box {
      /* background: #fbfaf5; */
      padding: 20px;
    }
    .line {
      display: flex;
      /* .label{
lanbaoming's avatar
lanbaoming committed
153 154
                width: 100px;
            } */
lanbaoming's avatar
lanbaoming committed
155 156 157 158
      .value {
        flex: 1;
        margin-left: 10px;
      }
lanbaoming's avatar
lanbaoming committed
159
    }
lanbaoming's avatar
lanbaoming committed
160
  }
lanbaoming's avatar
lanbaoming committed
161 162
}
</style>