|
|
@@ -0,0 +1,194 @@
|
|
|
+import request from '@/utils/request';
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取客户详情(包含基本信息、工商信息、销售信息、联系人、开票信息)
|
|
|
+ */
|
|
|
+export function getCustomerDetail(id: string | number) {
|
|
|
+ return request({
|
|
|
+ url: `/customer/customerInfo/${id}`,
|
|
|
+ method: 'get'
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取客户部门列表
|
|
|
+ */
|
|
|
+export function getCustomerDeptList(params: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/customerDept/list',
|
|
|
+ method: 'get',
|
|
|
+ params
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取客户部门树
|
|
|
+ */
|
|
|
+export function getCustomerDeptTree(customerId: string | number) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/customerDept/tree',
|
|
|
+ method: 'get',
|
|
|
+ params: { customerId }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取客户联系人列表(员工管理)
|
|
|
+ */
|
|
|
+export function getCustomerContactList(params: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/customerContact/list',
|
|
|
+ method: 'get',
|
|
|
+ params
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 新增客户联系人
|
|
|
+ */
|
|
|
+export function addCustomerContact(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/customerContact',
|
|
|
+ method: 'post',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 编辑客户联系人
|
|
|
+ */
|
|
|
+export function updateCustomerContact(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/customerContact',
|
|
|
+ method: 'put',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 删除客户联系人
|
|
|
+ */
|
|
|
+export function deleteCustomerContact(ids: string | number | (string | number)[]) {
|
|
|
+ return request({
|
|
|
+ url: `/customer/customerContact/${Array.isArray(ids) ? ids.join(',') : ids}`,
|
|
|
+ method: 'delete'
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取客户收货地址列表
|
|
|
+ */
|
|
|
+export function getCustomerAddressList(params: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/shippingAddress/list',
|
|
|
+ method: 'get',
|
|
|
+ params
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 新增客户收货地址
|
|
|
+ */
|
|
|
+export function addCustomerAddress(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/shippingAddress',
|
|
|
+ method: 'post',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 编辑客户收货地址
|
|
|
+ */
|
|
|
+export function updateCustomerAddress(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/shippingAddress',
|
|
|
+ method: 'put',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 删除客户收货地址
|
|
|
+ */
|
|
|
+export function deleteCustomerAddress(ids: string | number | (string | number)[]) {
|
|
|
+ return request({
|
|
|
+ url: `/customer/shippingAddress/${Array.isArray(ids) ? ids.join(',') : ids}`,
|
|
|
+ method: 'delete'
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取客户合同列表
|
|
|
+ */
|
|
|
+export function getCustomerContractList(params: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/contract/list',
|
|
|
+ method: 'get',
|
|
|
+ params
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 新增客户合同
|
|
|
+ */
|
|
|
+export function addCustomerContract(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/contract',
|
|
|
+ method: 'post',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 编辑客户合同
|
|
|
+ */
|
|
|
+export function updateCustomerContract(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/contract',
|
|
|
+ method: 'put',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 删除客户合同
|
|
|
+ */
|
|
|
+export function deleteCustomerContract(ids: string | number | (string | number)[]) {
|
|
|
+ return request({
|
|
|
+ url: `/customer/contract/${Array.isArray(ids) ? ids.join(',') : ids}`,
|
|
|
+ method: 'delete'
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 新增客户部门
|
|
|
+ */
|
|
|
+export function addCustomerDept(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/customerDept',
|
|
|
+ method: 'post',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 编辑客户部门
|
|
|
+ */
|
|
|
+export function updateCustomerDept(data: any) {
|
|
|
+ return request({
|
|
|
+ url: '/customer/customerDept',
|
|
|
+ method: 'put',
|
|
|
+ data
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 删除客户部门
|
|
|
+ */
|
|
|
+export function deleteCustomerDept(ids: string | number | (string | number)[]) {
|
|
|
+ return request({
|
|
|
+ url: `/customer/customerDept/${Array.isArray(ids) ? ids.join(',') : ids}`,
|
|
|
+ method: 'delete'
|
|
|
+ });
|
|
|
+}
|