/*
 * @Author: wanglj 471442253@qq.com
 * @Date: 2022-12-27 11:10:39
 * @LastEditors: wanglj
 * @LastEditTime: 2022-12-28 14:49:40
 * @Description: file content
 * @FilePath: \opms_frontend\src\api\customer\index.js
 */
import micro_request from '@/utils/micro_request'
const basePath = process.env.VUE_APP_CustomerPath
export default {
  // 客户详情
  getDetail(query) {
    return micro_request.postRequest(
      basePath,
      'Customer',
      'GetEntityById',
      query
    )
  },
  // 客户编辑
  updateCostomer(query) {
    return micro_request.postRequest(basePath, 'Customer', 'UpdateById', query)
  },
  // 客户合并
  mergeCustomer(query) {
    return micro_request.postRequest(
      basePath,
      'Customer',
      'Mergecustomer',
      query
    )
  },
  // 客户联系人详情
  getContact(query) {
    return micro_request.postRequest(
      basePath,
      'Contant',
      'GetEntityById',
      query
    )
  },
  // 客户动态
  dynamicsList(query) {
    return micro_request.postRequest(
      basePath,
      'Customer',
      'DynamicsList',
      query
    )
  },
  // 客户归属记录
  getBelongs(query) {
    return micro_request.postRequest(basePath, 'Belong', 'GetEntityById', query)
  },
  // 编辑联系人
  updateContact(query) {
    return micro_request.postRequest(basePath, 'Contant', 'UpdateById', query)
  },
  // 删除联系人
  deleteContact(query) {
    return micro_request.postRequest(basePath, 'Contant', 'DeleteById', query)
  },
  // 公海列表
  getList(query) {
    return micro_request.postRequest(basePath, 'Customer', 'GetList', query)
  },
  // 移入公海
  moveToPubic(query) {
    return micro_request.postRequest(basePath, 'Customer', 'MoveToPubic', query)
  },
  // 客户列表
  getPublicList(query) {
    return micro_request.postRequest(
      basePath,
      'Customer',
      'PublicGetList',
      query
    )
  },
  // 客户删除
  deleteCustomer(query) {
    return micro_request.postRequest(basePath, 'Customer', 'DeleteById', query)
  },
  // 客户领取
  receiveCustomer(query) {
    // return micro_request.postRequest(basePath, 'Contant', 'Create', query)
  },
  // 省份
  getProvinceInfo(query) {
    return micro_request.postRequest(
      basePath,
      'District',
      'GetProvinceInfo',
      query
    )
  },
  // 省份详情
  getProvinceDetail(query) {
    return micro_request.postRequest(basePath, 'District', 'GetList', query)
  },
  // 新建客户
  createCustomer(query) {
    return micro_request.postRequest(basePath, 'Customer', 'Create', query)
  },
  // 新建联系人
  createContact(query) {
    return micro_request.postRequest(basePath, 'Contant', 'Create', query)
  },
}
