api.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. const http = uni.$u.http;
  2. import qs from 'qs';
  3. import store from "../store/index.js";
  4. import config from '../uni_modules/uview-ui/libs/config/config.js';
  5. const mockApi = 'http://192.168.0.243:3001/mock-api/prod-api/crm';
  6. const install = (Vue, vm) => {
  7. vm.$u.api = {
  8. login: (params = {}) => http.post('/auth/login', params), // 登录
  9. getInfo: (params = {}) => http.get('/system/user/getInfo', { params }), // 获取用户数据
  10. sysMessageReceive: (params = {}) => http.get('/message/sysMessageReceive/list?' + qs.stringify(params)), // 消息接受列表
  11. getAppMessageList: (params = {}) => http.get('/message/sysMessageReceive/getAppMessageList?' + qs.stringify(params)), // 消息列表接口
  12. getDicts: (dictType) => http.get('/system/dict/data/type/' + dictType), // 获取字典
  13. getPhoneFileterResult: (data = {}) => http.post('/collect/all/casePhoneFilter/getPhoneFileterResult', data), // 滤号
  14. listDetpUser: (data = {}) => http.post('/system/user/getDeptCustomer', data), // 查询部门人员列表
  15. getDeptCustomerByOrg: (data = {}) => http.post('/system/user/getDeptCustomerByOrg', data, { params: data }), // 查询部门人员列表
  16. getDeptOwner: (data = {}) => http.post('/system/user/getDeptOwner', data), // 查询部门人员列表
  17. listByOrgDataScope: (params = {}) => http.get('/system/user/listByOrgDataScope', { params }), // 查询部门人员列表
  18. logout: () => http.delete("/auth/logout?systemCode=system_debt"), // 退出登录
  19. getUserProfile: (params = {}) => http.get('/system/user/profile?' + qs.stringify(params)), // 查询用户个人信息
  20. uploadAvatar: (url) => http.upload('/system/user/profile/avatar', { filePath: url, name: "avatarfile", timeout: 1000 * 60 * 10, custom: { loadingText: "上传中" } }),
  21. updateUserProfile: (data = {}) => http.put("/system/user/profile", data), // 更新个人信息
  22. getCofDeptBank: (params = {}) => http.get("/system/cofDeptBank/getCofDeptBank", params), // 查询机构配置
  23. getOutEquipmentByMacAddr: (mac, config) => http.get("system/caseOutEquipment/" + mac, config), // 根据mac地址获取外访设备状态可能为空
  24. addCaseOutEquipment: (data = {}) => http.post("system/caseOutEquipment", data), // 申请mac地址授权
  25. checkOutEquipment: (params = {}, config) => http.get("/system/caseOutEquipment/checkOutEquipment", { params, ...config }), // 检测外访设备是否有申请通过记录
  26. concatRecord: (files, params = {}) => http.upload('/fileVisit/concatRecord', { files, params, name: 'files', timeout: 1000 * 60 * 10, custom: { loadingText: "上传中" } }), // 合并录音并上传
  27. uploadFile: (url, params = {}) => http.upload('/file/aliossUpload', { filePath: url, params, name: "file", timeout: 1000 * 60 * 10, custom: { loadingText: "上传中" } }), // 上传文件
  28. watermarkUpload: (url, params = {}) => http.upload('/fileVisit/watermarkUpload', { filePath: url, params, name: "file", timeout: 1000 * 60 * 10, custom: { loadingText: "上传中" } }), // 上传文件
  29. getOutPolyline: (params = {}) => http.get("/system/caseOutPolyline/getOutPolyline", { params, custom: { loading: false } }), // 请求外访轨迹列表
  30. addOutPolyline: (data = {}) => http.post("/system/caseOutPolyline/addOutPolyline", data, { custom: { loading: false } }), // 添加外访轨迹
  31. updateUserPwd: (params = {}) => http.put("/system/user/profile/updatePwd?" + qs.stringify(params)), // 更新用户密码
  32. getSysVersion: (params = {}, config = {}) => http.get("/system/sysVersion/getSysVersion", { params, ...config, timeout: 2000 }), // 版本更新
  33. getBankDebtRule: (params = {}, config = {}) => http.get('/system/bankInfo/getBankDebtRule', { params, ...config }), // 获取委托方催收规则
  34. getBankContent: (params = {}, config = {}) => http.get('/system/bankInfo/getBankContent', { params, ...config }), // 催收状态
  35. getCofCallOutBindByUserId: (params = {}, config = {}) => http.get('/system/cofCallOutBind/getCofCallOutBindByUserId', { params, ...config }), // 获取分机号
  36. getCofShortcuts: (params = {}, config = {}) => http.get('/system/cofShortcuts/list', { params, ...config }), // 获取键盘速填
  37. getCofInfo: (params, config = {}) => http.get('/system/user/getCofInfo', { params, ...config }), // 获取权限
  38. extensionNumberState: (params, config = {}) => http.get("http://8.134.50.217:10085/cc/extensionNumberState", { params, custom: { loading: false } }), // 获取来电关联案件
  39. getSm4En: (str, config = {}) => http.get(store.state.user.path + '/caseMainInfo/getSm4En', { params: { str }, custom: { loading: false } }), // sm4加密
  40. setAPPLoginLimit: (params, config = {}) => http.get('/system/user/setAPPLoginLimit', { params, custom: { loading: false } }), // 设置设备码访问失败次数
  41. getAPPLoginLimit: (params, config = {}) => http.get('/system/user/getAPPLoginLimit', { params, custom: { loading: false }, timeout: 1000 }), // 获取设备码访问失败次数
  42. getExtensionStatus: (params, config = {}) => http.get('/sip/JcSip/getExtensionStatus', { params, custom: { loading: false } }), // 获取分机的状态
  43. setEffectiveCallerIdNumber: (params, config = {}) => http.get('/sip/JcSip/setEffectiveCallerIdNumber', { params, custom: { loading: false } }), // 固话设置号码
  44. getExtensionByUserId: (params, config = {}) => http.get('/sip/exten/getExtensionByUserId', { params, custom: { loading: false } }), // 通过用户id获取分机
  45. getLineByIds: (params, config = {}) => http.get('/sip/line/getLineByIds', { params, custom: { loading: false } }), // 根据线路获取线路
  46. getCodeImg: (params, config = {}) => http.get('/code', { params, custom: { loading: false }, timeout: 1500 }), // 获取验证码(主要用于判断配置是否正确)
  47. getAppSystemList: (params = {}, config = {}) => http.get('/system/sysVersion/getAppSystemList', { params, custom: { loading: false }, timeout: 1500 }), // 获取app的系统列表
  48. changeOnlineStatus: (data, config = {}) => http.put('/system/user/changeStatus', data), // 用户状态修改
  49. statisticsCaseState: (data, config = {}) => http.post(store.state.user.path + '/clueFixedFields/statisticsCaseState', data), // 统计线索阶段
  50. statisticsAddClueCount: (data, config = {}) => http.post(store.state.user.path + '/clueMainInfo/statisticsAddClueCount', data), // 统计添加阶段
  51. getClueMainInfoList: (params = {}, data = {}) => http.post(store.state.user.path + '/clueMainInfo/getClueMainInfoList?' + qs.stringify(params), data), // 线索列表
  52. getUserByUserIds: (params) => http.get('/system/user/getUserByUserIds', { params }), //
  53. getClueTagGroupVoList: (params = {}) => http.get(store.state.user.path + "/clueTagGroup/getClueTagGroupVoList", { params }), // 获取线索标签;
  54. getClueMainInfoVoById: (params = {}, config = {}) => http.get(store.state.user.path + "/clueMainInfo/getClueMainInfoVoById", { params, custom: { loading: false }, timeout: 1500 }), // 获取线索详情;
  55. updateClueFixedFieldsClueState: (data, config = {}) => http.post(store.state.user.path + '/clueFixedFields/updateClueFixedFieldsClueState', data),
  56. updateClueFixedFieldsAllTags: (data, config = {}) => http.post(store.state.user.path + '/clueFixedFields/updateClueFixedFieldsAllTags', data),
  57. getClueMainInfoById: (params = {}, config = {}) => http.get(store.state.user.path + '/clueMainInfo/getClueMainInfoById', { params, ...config }),
  58. getClueAdInfoByClueId: (params = {}, config = {}) => http.get(store.state.user.path + '/clueAdInfo/getClueAdInfoByClueId', { params, ...config }),
  59. getClueFollowList: (params = {}, config = {}) => http.get(store.state.user.path + '/clueFollow/getClueFollowList', { params, ...config }),
  60. deleteClueFollow: (data, config = {}) => http.post(store.state.user.path + '/clueFollow/deleteClueFollow', data),
  61. updateClueFixedFieldsClueOwner: (data, config = {}) => http.post(store.state.user.path + '/clueFixedFields/updateClueFixedFieldsClueOwner', data),
  62. addClueFollow: (data, config = {}) => http.post(store.state.user.path + '/clueFollow/addClueFollow', data),
  63. getDictCascadeData: (params, config = {}) => http.get(store.state.user.path + '/dictCascadeData/list', { params, ...config }),
  64. selectAllDeptList: (params, config = {}) => http.get('/system/dept/selectAllDeptList', { params, ...config }),
  65. getIdByName: (params, config = {}) => http.get(store.state.user.path + "/clueMainInfo/getIdByName", { params, ...config }),
  66. addClueMainInfo: (data, config = {}) => http.post(store.state.user.path + '/clueMainInfo/addClueMainInfo', data),
  67. saveLog: (data, config = {}) => http.post("/system/access/saveLog", data, { custom: { loading: false } }),
  68. saveClueFile: (data, config = {}) => http.post(store.state.user.path + '/clueFile/saveClueFile', data),
  69. updateClueMainInfo: (data, config = {}) => http.post(store.state.user.path + '/clueMainInfo/updateClueMainInfo', data),
  70. selectPromotionStats: (data, config = {}) => http.post(store.state.user.path + '/promotionStats/selectPromotionStats', data),
  71. firstLogin: (data) => http.post('/system/user/firstLogin', data),
  72. shiYuWxLoginGetInfo: (params) => http.get('/auth/shiYuWxLoginGetInfo', { params, custom: { noAuth: true } }),
  73. deleteClueFile: (data) => http.delete(store.state.user.path + '/clueFile/deleteClueFile', data),
  74. getCallClueFileByClueId: (params) => http.get(store.state.user.path + '/clueFile/getCallClueFileByClueId', { params, custom: { noAuth: true } }),
  75. getClueSendFormCountByClueId: (params = {}, config = {}) => http.get(store.state.user.path + '/clueSendForm/getClueSendFormCountByClueId', { params }),
  76. // 订单相关接口
  77. selectClueOrderFormList: (params = {}, data = {}) => http.post(store.state.user.path + '/clueSendForm/list?' + qs.stringify(params), data),
  78. oderForm: (data = {}) => http.post(store.state.user.path + '/clueSendForm/oderForm', data),
  79. updateTags: (data = {}) => http.post(store.state.user.path + '/clueSendForm/updateTags', data),
  80. addOrderFollow: (data = {}) => http.post(store.state.user.path + '/orderFollow/addOrderFollow', data),
  81. getOrderFollowListByOrderId: (params = {}) => http.get(store.state.user.path + '/orderFollow/getOrderFollowListByOrderId', { params }),
  82. deleteOrder: (data = {}) => http.post(store.state.user.path + '/clueSendForm/deleteOrder', data),
  83. updateOrderState: (data = {}) => http.post(store.state.user.path + '/clueSendForm/updateOrderState', data),
  84. updateClueOrderForm: (data = {}) => http.post(store.state.user.path + '/clueSendForm/updateClueOrderForm', data),
  85. getOrderFollowListByClueId: (params = {}, config = {}) => http.get(store.state.user.path + '/orderFollow/getOrderFollowListByClueId', { params }),
  86. getDuplicateOrderFollowListByClueId: (params = {}, config = {}) => http.get(store.state.user.path + '/orderFollow/getDuplicateOrderFollowListByClueId', { params }),
  87. deleteOrderFollow: (data, config = {}) => http.post(store.state.user.path + '/orderFollow/deleteOrderFollow', data),
  88. getOrderFollowList: (params = {}, config = {}) => http.get(store.state.user.path + '/orderFollow/getOrderFollowList', { params }),
  89. selectCommissionList: (params = {}, data = {}) => http.post(store.state.user.path + '/clueCommissionForm/list?' + qs.stringify(params), data),
  90. getClueSendFormVoByOrderId: (params = {}, config = {}) => http.get(store.state.user.path + '/clueSendForm/getClueSendFormVoByOrderId', { params }),
  91. // 跟进记录相关接口
  92. getDuplicateClueFollowByClueId: (params, config = {}) => http.get(store.state.user.path + '/clueFollow/getDuplicateClueFollowByClueId', { params, ...config }),
  93. // 文件相关接口
  94. selectClueFileByDto: (data, config = {}) => http.post(store.state.user.path + '/clueFile/selectClueFileByDto', data, config),
  95. updateClueFile: (data, config = {}) => http.put(store.state.user.path + '/clueFile/updateClueFile', data),
  96. addReceiptForm: (data, config = {}) => http.post(store.state.user.path + '/clueReceiptForm', data),
  97. updateReceiptForm: (data, config = {}) => http.put(store.state.user.path + '/clueReceiptForm', data),
  98. listReceiptFormByOrderId: (orderFormId, config = {}) => http.get(store.state.user.path + '/clueReceiptForm/listByOrderId/' + orderFormId),
  99. getReceiptForm: (id, config = {}) => http.get(store.state.user.path + '/clueReceiptForm/' + id),
  100. delReceiptForm: (id, config = {}) => http.delete(store.state.user.path + '/clueReceiptForm/' + id),
  101. saveClueOrderForm: (data = {}) => http.post(store.state.user.path + '/clueSendForm/saveClueOrderForm', data),
  102. clueReceiptFormListByOrderId: (orderId, config = {}) => http.get(store.state.user.path + '/clueReceiptForm/listByOrderId/' + orderId),
  103. clueCommissionAdd: (data = {}) => http.post(store.state.user.path + '/clueCommissionForm', data),
  104. clueCommissionUpdate: (data = {}) => http.put(store.state.user.path + '/clueCommissionForm', data),
  105. clueCommissionById: (id, config = {}) => http.get(store.state.user.path + '/clueCommissionForm/' + id),
  106. clueCommissionRemove: (ids, config = {}) => http.post(store.state.user.path + '/clueCommissionForm/remove', ids),
  107. getCustomerManagerAllList: () => http.post('/system/user/getCustomerManagerAllList'),
  108. getClueSendFormVoByOrderId: (params) => http.get(store.state.user.path + '/clueSendForm/getClueSendFormVoByOrderId?' + qs.stringify(params)),
  109. statisticsSendStatus: (data, config = {}) => http.post(store.state.user.path + '/clueSendForm/statisticsSendStatus', data), // 统计线索阶段
  110. // 支付相关接口
  111. saveOrderFileAndTransfer:(data={})=>http.post(store.state.user.path + '/storeInfo/saveOrderFileAndTransfer',data),
  112. // ========== Mock接口(开发环境使用,本地Mock服务器)==========
  113. // 服务器地址: http://192.168.0.243:3001
  114. // 手机预览时需要使用电脑局域网IP,不能用localhost
  115. // 切换真实接口时,将 baseUrl 改为真实接口地址即可
  116. getPersonCards:(params)=>http.get(store.state.user.path+'/personCenter/getPersonCards',{ params }),//个人中心-获取个人中心数据
  117. getPersonLatestClue:(params)=>http.get(store.state.user.path+'/personCenter/getPersonLatestClue',{ params }),//个人中心-获取最新线索
  118. getPersonRanking:(params)=>http.get(store.state.user.path+'/personCenter/getPersonRanking',{ params }),//个人中心-获取个人排名
  119. getWareHouseCard:(params)=>http.get(store.state.user.path+'/warehouse/getWareHouseCard',{ params }),//仓库中心-获取仓库信息
  120. addInquiry:(data)=>http.post(store.state.user.path+'/inquiryCenter/addInquiry',data),//添加询价
  121. inquiryVerificationList:(params,data)=>http.post(store.state.user.path+'/inquiryCenter/inquiryVerificationList?' + qs.stringify(params), data),// 询价/核价列表
  122. wareHouseList:(params,data)=>http.post(store.state.user.path+'/warehouse/wareHouseList?' + qs.stringify(params), data),//仓库中心-获取仓库列表
  123. wareHouseDetail:(params)=>http.get(store.state.user.path+'/warehouse/wareHouseDetail',{ params }),//仓库中心-获取仓库详情
  124. wareHouseLog:(params)=>http.get(store.state.user.path+'/warehouse/wareHouseLog',{ params }),//仓库中心-获取仓库操作日志
  125. wareHouseUpdate:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseUpdate',data),//仓库中心-编辑商品库存
  126. wareHouseLock:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseLock',data),//仓库中心-锁单
  127. wareHouseDown:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseDown',data),//仓库中心-下架商品
  128. wareHouseAdd:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseAdd',data),//仓库中心-新增商品
  129. wareHouseOpenOrder:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseOpenOrder',data),//仓库中心-开单
  130. wareHouseFakeAdd:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseFakeAdd',data),//仓库中心-假货新增
  131. wareHouseFakeEdit:(data)=>http.post(store.state.user.path+'/warehouse/wareHouseFakeEdit',data),//仓库中心-假货编辑
  132. wareHouseFakeList:(params,data)=>http.post(store.state.user.path+'/warehouse/wareHouseFakeList?' + qs.stringify(params), data),//仓库中心-假货列表
  133. saveOrderFileAndTransfer: (data = {}) => http.post(store.state.user.path + '/storeInfo/saveOrderFileAndTransfer', data),
  134. // 删除订单分成数据
  135. deleteClueCommissionForm: (id, config = {}) => http.delete(store.state.user.path + '/clueCommissionForm/' + id),
  136. }
  137. }
  138. export default { install }