import request from '@/utils/request'

// 查询清单列表信息
export function listByKeyword(query) {
  return request({
    url: '/system/retail/listByKeyword',
    method: 'get',
    params: query
  })
}

export function listSelectDetail(id) {
  return request({
    url: `/system/retail/${id}`,
    method: 'get',
  })
}

// 保存资料
export function updateCust(params) {
  return request({
    url: `/system/retail/update`,
    method: 'put',
    params
  })
}

// 个人试图
export function getInfoByCustId(custId) {
  return request({
    url: `/system/retail/getInfoByCustId?custId=${custId}`,
    method: 'get',
  })
}
//个人折叠项
export function getIndividualfold(custIdc) {
  return request({
    url: `/system/retail/fold/${custIdc}`,
    method: 'get',
  })
}
//新增他行利率
export function addThll(data) {
  return request({
    url: `/system/rate/add?${data}`,
    method: 'post',
  })
}
//编辑他行利率
export function editThll(data) {
  return request({
    url: `/system/rate/edit?${data}`,
    method: 'put',
  })
}
//商户列表查询
export function commerciaList(query) {
  return request({
    url: '/system/merchant/list',
    method: 'get',
    params: query
  })
}
// 商户试图
export function getMerchantDetail(custId) {
  return request({
    url: `/system/merchant/getInfoByCustId?custId=${custId}`,
    method: 'get',
  })
}
//商户编辑
export function updateMerchantDetail(params) {
  return request({
    url: `/system/merchant`,
    method: 'put',
    params
  })
}
//企业列表查询
export function businessList(query) {
  return request({
    url: '/system/business/list',
    method: 'get',
    params: query
  })
}
// 企业试图
export function getBusinessDetail(custId) {
  return request({
    url: `/system/business/getInfoByCustId?custId=${custId}`,
    method: 'get',
  })
}
//企业编辑
export function updateBusinessDetail(params) {
  return request({
    url: `/system/business`,
    method: 'put',
    params
  })
}
//个人营销建档
export function addRetailRecord(data) {
  return request({
    url: `/system/retail/addRecord?${data}`,
    method: 'post',
  })
}
//商户营销建档
export function addMerchantRecord(data) {
  return request({
    url: `/system/merchant/addRecord?${data}`,
    method: 'post',
  })
}
//企业建档
export function addBusinessRecord(data) {
  return request({
    url: `/system/business/addRecord?${data}`,
    method: 'post',
  })
}

//查询行业
export function getIndustryTree() {
  return request({
    url: `/system/retail/selectIndustryTree`,
    method: 'get',
  })
}
//根据身份证号码查询
export function getInfoByCustIdc(custIdc) {
  return request({
    url: `/system/retail/getInfoByCustIdc?custIdc=${custIdc}`,
    method: 'get',
  })
}
//新增家庭成员
export function addFamily(data) {
  return request({
    url: `/system/family/members/add?${data}`,
    method: 'post',

  })
}



//建档页面相关接口
//列表查询
export function listByCustType(query) {
  return request({
    url: '/system/record/listByCustType',
    method: 'get',
    params: query
  })
}
//新增赢下建档
export function addRecord(data) {

  return request({
    url: `/system/record/add`,
    method: 'post',
    data:data
  })
}
//营销建档详情
export function getRecordDetail(id) {
  return request({
    url: `/system/record/${id}`,
    method: 'get',
  })
}
//营销建档详情修改
export function editRecord(params) {
  return request({
    url: `/system/record/edit`,
    method: 'put',
    params
  })
}
//家庭成员新增
export function addFamilyRecord(data) {
  return request({
    url: `/system/family/record/add?${data}`,
    method: 'post',
  })
}
//家庭成员修改
export function editFamilyRecord(data) {
  return request({
    url: `/system/family/record/edit?${data}`,
    method: 'put',
  })
}
//导出个人详情
export function exportRetailDetail(custId) {
  return request({
    url: `/system/retail/exportRetailDetail?custId=${custId}`,
    method: 'get',
    responseType: 'blob'
  })
}
//导出商户详情
export function exportMerchantDetail(custId) {
  return request({
    url: `/system/merchant/exportMerchantDetail?custId=${custId}`,
    method: 'get',
    responseType: 'blob'
  })
}
//导出企业详情
export function exportBusinessDetail(custId) {
  return request({
    url: `/system/business/exportBusinessDetail?custId=${custId}`,
    method: 'get',
    responseType: 'blob'
  })
}
//根据身份证号查询家庭成员
export function listByIdCard(idCard) {
  return request({
    url: `/system/member/listByIdCard?idCard=${idCard}`,
    method: 'get',
  })
}
//获取经营状态

export function getRegStatus() {
  return request({
    url: '/system/business/getRegStatus',
    method: 'get',
  })
}

// 试图个人走访记录
export function getVisitInfoList(custIdc, custType) {
  return request({
    url: `/system/campaign/visitInfoList?custIdc=${custIdc}&custType=${custType}`,
    method: 'get',
  })
}

// 试图商户企业走访记录
export function visitInfoList(socialCreditCode, custType) {
  return request({
    url: `/system/campaign/visitInfoList?socialCreditCode=${socialCreditCode}&custType=${custType}`,
    method: 'get',
  })
}

// 触达个人走访记录
export function getcdVisitInfoList(params) {
  return request({
    url: `/system/campaign/visitInfoList?custIdc=${params.custIdc}&campaignId=${params.campaignId}`,
    method: 'get',
  })
}

// 触达商户企业走访记录
export function cdVisitInfoList(params) {
  return request({
    url: `/system/campaign/visitInfoList?socialCreditCode=${params.socialCreditCode}&campaignId=${params.campaignId}`,
    method: 'get',
  })
}

// 获取走访记录
export function getListByCampign(query) {
  return request({
    url: `/visit/record/listByCampign`,
    method: 'get',
    params: query
  })
}

//编辑走访备注
export function editVisitInfo(data) {
  return request({
    url: `/system/campaign/editVisitInfo`,
    method: 'post',
    data: data,
  })
}

// 编辑标签
export function editCustTag(data) {
  return request({
    url: `/system/retail/editCustTag`,
    method: 'post',
    data: data
  })
}

// 自定义标签--编辑标签
export function editCustTag1(data) {
  return request({
    url: `/system/retail/editManualTag`,
    method: 'post',
    data: data
  })
}

//查询潜客登记列表
export function custLeadList(query) {
  return request({
    url: '/cust/lead/list',
    method: 'get',
    params: query
  })
}
//查询潜客登记信息
export function custLeadSelect(query) {
  return request({
    url: '/cust/lead/select',
    method: 'get',
    params: query
  })
}
// 走访反馈配置标签
export function getcustomTag(custType) {
  return request({
    url: `/system/retail/manualTagList?custType=${custType}`,
    method: 'get',
  })
}

// 获取客户层级
export function getcustomLevel(custType, custId) {
  return request({
    url: `/grid/cmpm/cust/level?custType=${custType}&custId=${custId}`,
    method: 'get',
  })
}

// 二次走访预约
export function appointmentSecondVisit(visitTime, data) {
  return request({
    url: `/appointment/secondVisit?visitTime=${visitTime}`,
    method: 'post',
    data: data
  })
}

// 获取全行柜员列表
export function systemUserAllTreeUser() {
  return request({
    url: `/system/user/allTreeUser`,
    method: 'get'
  })
}

// 资源协助申请
export function appointmentResourceAssist(userName, nickName, data) {
  return request({
    url: `/appointment/resourceAssist?userName=${userName}&nickName=${nickName}`,
    method: 'post',
    data: data
  })
}