query.vue 10.2 KB
Newer Older
黄卓's avatar
黄卓 committed
1 2 3 4 5 6 7 8
<template>
  <div>
    <el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
      <el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="16">
        <div style="display: flex;justify-content: space-between;align-items: flex-end;">
          <h2>查看</h2>
          <div>
            <el-button type="primary" size="small">添加优惠</el-button>
黄卓's avatar
黄卓 committed
9
            <el-button type="primary" size="small" @click="$router.push('/customer/edit/' + id)">编辑</el-button>
黄卓's avatar
黄卓 committed
10
            <el-button type="primary" size="small">报价</el-button>
Marcus's avatar
Marcus committed
11
            <el-button type="primary" size="small" @click="$refs['customerFollow'].customerFollow.dialogVisible = true">跟进</el-button>
12
            <el-button type="primary" size="small" @click="$refs['customerComplaint'].handleAdd()">客诉</el-button>
黄卓's avatar
黄卓 committed
13 14 15 16 17 18 19
            <el-button type="danger" size="small">删除</el-button>
          </div>
        </div>
        <el-card style="margin-top: 15px;">
          <el-descriptions :column="4" border>
            <el-descriptions-item label="客户编号">{{ customer.number }}</el-descriptions-item>
            <el-descriptions-item label="客户名称">{{ customer.name }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
20
            <el-descriptions-item label="结算方式">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
21
            <el-descriptions-item label="客户生日">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
22 23
            <el-descriptions-item label="客户等级">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}</el-descriptions-item>
            <el-descriptions-item label="国家">{{ getDictDataLabel(DICT_TYPE.COUNTRY, customer.country) }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
24
<!--            <el-descriptions-item label="业务员">{{ customer }}</el-descriptions-item>-->
黄卓's avatar
黄卓 committed
25 26
            <el-descriptions-item label="客户来源">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item>
            <el-descriptions-item label="客户类别">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_TYPE, customer.type) }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
27
<!--            <el-descriptions-item label="联系方式">{{ customer }}</el-descriptions-item>-->
黄卓's avatar
黄卓 committed
28 29
            <el-descriptions-item label="推介人">{{ promoter  }}</el-descriptions-item>
            <el-descriptions-item label="跟进客服">{{ customerService }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
30 31
            <el-descriptions-item label="公司名称">{{ customer.company }}</el-descriptions-item>
            <el-descriptions-item label="联系地址">{{ customer.address }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
32
            <el-descriptions-item label="创建时间">{{ parseTime(customer.createTime) }}</el-descriptions-item>
黄卓's avatar
黄卓 committed
33 34 35 36
            <el-descriptions-item label="状态">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}</el-descriptions-item>
            <el-descriptions-item label="主营类别">{{ productType }}</el-descriptions-item>
            <el-descriptions-item label="常提货网点">{{ pickupPoint }}</el-descriptions-item>
            <el-descriptions-item label="图片">
37
              <el-image v-show="!!customer.picture" :src="customer.picture" style="width: 100px;height: 100px"></el-image>
黄卓's avatar
黄卓 committed
38
            </el-descriptions-item>
黄卓's avatar
黄卓 committed
39 40 41 42 43 44 45 46 47
            <el-descriptions-item label="备注">{{ customer.remarks }}</el-descriptions-item>
<!--            <el-descriptions-item label="信用等级">{{ customer }}</el-descriptions-item>-->
          </el-descriptions>
        </el-card>

        <el-card style="margin-top: 15px">
          <h3>联系人</h3>

          <el-table
黄卓's avatar
黄卓 committed
48
            :data="customerContacts"
黄卓's avatar
黄卓 committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
            style="width: 100%"
            border
          >
            <el-table-column
              prop="department"
              label="部门"
            >
            </el-table-column>
            <el-table-column
              prop="position"
              label="职位"
            >
            </el-table-column>
            <el-table-column
              prop="name"
              label="联系人"
            >
            </el-table-column>
            <el-table-column
              prop="phoneNew"
              label="联系方式"
            >
黄卓's avatar
黄卓 committed
71 72 73
              <template v-slot="{row}">
                {{ row.areaCode + row.phoneNew }}
              </template>
黄卓's avatar
黄卓 committed
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
            </el-table-column>
            <el-table-column
              prop="username"
              label="关联账号"
            >
            </el-table-column>
            <el-table-column
              prop="social"
              label="社交软件"
            >
            </el-table-column>
            <el-table-column
              prop="socialNumber"
              label="社交软件号码"
            >
            </el-table-column>
            <el-table-column
              prop="email"
              label="邮箱"
            >
            </el-table-column>
          </el-table>
        </el-card>

        <el-tabs style="margin-top: 15px" type="border-card">
          <el-tab-pane label="订单">
Marcus's avatar
Marcus committed
100
            订单
黄卓's avatar
黄卓 committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 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
          </el-tab-pane>
          <el-tab-pane label="报价">
            <el-table
              :data="[]"
              style="width: 100%"
            >
              <el-table-column
                prop=""
                label="序号"
              >
              </el-table-column>
              <el-table-column
                prop=""
                label="报价单号"
              >
              </el-table-column>
              <el-table-column
                prop=""
                label="订单号"
              >
              </el-table-column>
              <el-table-column
                prop=""
                label="客户名称"
              >
              </el-table-column>
              <el-table-column
                prop=""
                label="目的地"
              >
              </el-table-column>
              <el-table-column
                prop=""
                label="销售阶段"
              >
              </el-table-column>
              <el-table-column
                prop=""
                label="预计结束时间"
              >
              </el-table-column>
              <el-table-column
                prop=""
                label="负责人"
              >
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="跟进">
150
            <customer-follow ref="customerFollow" :id="id" :customer-id="id"></customer-follow>
黄卓's avatar
黄卓 committed
151 152
          </el-tab-pane>
          <el-tab-pane label="客户投诉">
黄卓's avatar
黄卓 committed
153
            <customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
黄卓's avatar
黄卓 committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
          </el-tab-pane>
          <el-tab-pane label="账单">

          </el-tab-pane>
          <el-tab-pane label="数据">

          </el-tab-pane>
          <el-tab-pane label="品牌授权">

          </el-tab-pane>
          <el-tab-pane label="信用日志">

          </el-tab-pane>
          <el-tab-pane label="等级日志">

          </el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>

  </div>
</template>

<script>
黄卓's avatar
黄卓 committed
178
import { getCustomer, getCustomerSelect } from '@/api/ecw/customer'
黄卓's avatar
黄卓 committed
179 180 181
import { DICT_TYPE, getDictDataLabel } from '@/utils/dict'
import { getProductTypeList } from '@/api/ecw/productType'
import { getNodeList } from '@/api/ecw/node'
黄卓's avatar
黄卓 committed
182 183 184
import CustomerFollow from "@/components/CustomerFollow"
import { parseTime } from '@/utils/ruoyi'
import CustomerComplaint from '@/views/ecw/customerComplaint'
黄卓's avatar
黄卓 committed
185
import { listServiceUser } from '@/api/system/user'
黄卓's avatar
黄卓 committed
186
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
黄卓's avatar
黄卓 committed
187

黄卓's avatar
黄卓 committed
188 189 190 191 192
export default {
  name: 'query',
  props: {
    customerId: String
  },
Marcus's avatar
Marcus committed
193
  components: {
Marcus's avatar
Marcus committed
194
    CustomerFollow,
195
    CustomerComplaint
Marcus's avatar
Marcus committed
196
  },
黄卓's avatar
黄卓 committed
197 198 199 200
  created() {
    getNodeList().then(r => {
      this.nodeList = r.data
    })
黄卓's avatar
黄卓 committed
201
    getCustomer(this.id).then(response => {
黄卓's avatar
黄卓 committed
202
      this.customer = { ...this.customer, ...response.data }
黄卓's avatar
黄卓 committed
203

黄卓's avatar
黄卓 committed
204
      getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
黄卓's avatar
黄卓 committed
205 206
        this.customerContacts = r.data
      })
黄卓's avatar
黄卓 committed
207 208 209 210
    })
    getProductTypeList().then(r => {
      this.productTypeList = r.data
    })
Marcus's avatar
Marcus committed
211

黄卓's avatar
黄卓 committed
212 213 214 215 216 217
    getCustomerSelect().then(r => {
      this.customerSelect = r.data
    })
    listServiceUser().then(r => {
      this.serviceUserList = r.data
    })
黄卓's avatar
黄卓 committed
218
  },
黄卓's avatar
黄卓 committed
219 220
  data() {
    return {
黄卓's avatar
黄卓 committed
221 222
      DICT_TYPE,
      getDictDataLabel,
黄卓's avatar
黄卓 committed
223
      parseTime,
黄卓's avatar
黄卓 committed
224 225
      nodeList: [],
      productTypeList: [],
黄卓's avatar
黄卓 committed
226 227
      customerSelect: [],
      serviceUserList: [],
黄卓's avatar
黄卓 committed
228
      customerContacts: [],
黄卓's avatar
黄卓 committed
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
      customer: {
        id: undefined,
        number: undefined,
        name: undefined,
        level: undefined,
        country: undefined,
        type: undefined,
        agentId: undefined,
        company: undefined,
        address: undefined,
        productType: undefined,
        productId: undefined,
        pickupPoint: undefined,
        memberId: undefined,
        birthday: undefined,
        balance: undefined,
        source: undefined,
        picture: undefined,
        customerService: undefined,
        customerLines: [],
        promoter: undefined,
        status: undefined,
        founder: undefined,
        department: undefined,
        invoiceTitle: undefined,
        licenseNumber: undefined,
        bank: undefined,
        bankNumber: undefined,
        project: undefined,
        billingAddress: undefined,
        billingTell: undefined,
        taxRate: undefined,
        remarks: undefined,
        arrivalConfirm: undefined,
        weightUnit: undefined,
        createTime: undefined
Marcus's avatar
Marcus committed
265 266
      },
    }
黄卓's avatar
黄卓 committed
267 268 269 270 271 272 273 274 275
  },
  computed: {
    productType(){
      const productType = this.productTypeList.find(p => p.id === parseInt(this.customer.productType))
      return productType ? productType.titleZh : ''
    },
    pickupPoint(){
      const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint))
      return pickupPoint ? pickupPoint.titleZh : ''
黄卓's avatar
黄卓 committed
276 277 278 279 280 281
    },
    promoter() {
      return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
    },
    customerService() {
      return this.serviceUserList.find(e => e.id === this.customer.customerService)?.nickname || ''
黄卓's avatar
黄卓 committed
282 283 284
    },
    id() {
      return this.customerId ? parseInt(this.customerId) : undefined
黄卓's avatar
黄卓 committed
285
    }
黄卓's avatar
黄卓 committed
286 287 288 289 290 291 292
  }
}
</script>

<style scoped>

</style>