diff --git a/src/api/mf/customer/index.ts b/src/api/mf/customer/index.ts new file mode 100644 index 0000000..07db2dd --- /dev/null +++ b/src/api/mf/customer/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { CustomerVO, CustomerForm, CustomerQuery } from '@/api/mf/customer/types'; + +/** + * 查询客户主表列表 + * @param query + * @returns {*} + */ + +export const listCustomer = (query?: CustomerQuery): AxiosPromise => { + return request({ + url: '/mf/customer/list', + method: 'get', + params: query + }); +}; + +/** + * 查询客户主表详细 + * @param customerId + */ +export const getCustomer = (customerId: string | number): AxiosPromise => { + return request({ + url: '/mf/customer/' + customerId, + method: 'get' + }); +}; + +/** + * 新增客户主表 + * @param data + */ +export const addCustomer = (data: CustomerForm) => { + return request({ + url: '/mf/customer', + method: 'post', + data: data + }); +}; + +/** + * 修改客户主表 + * @param data + */ +export const updateCustomer = (data: CustomerForm) => { + return request({ + url: '/mf/customer', + method: 'put', + data: data + }); +}; + +/** + * 删除客户主表 + * @param customerId + */ +export const delCustomer = (customerId: string | number | Array) => { + return request({ + url: '/mf/customer/' + customerId, + method: 'delete' + }); +}; diff --git a/src/api/mf/customer/types.ts b/src/api/mf/customer/types.ts new file mode 100644 index 0000000..f5db02c --- /dev/null +++ b/src/api/mf/customer/types.ts @@ -0,0 +1,119 @@ +export interface CustomerVO extends BaseEntity { + /** + * 客户姓名 + */ + customerName: string; + + /** + * 手机号码 + */ + phonenumber: string; + + /** + * 客户性别 + */ + gender: string; + + /** + * 客户生日 + */ + birthday: string; + + /** 商品子表信息 */ + goodsList: Array; +} + +export interface GoodsVO extends BaseEntity { + /** 列表序号 */ + index:number; + /** + * 商品名称 + */ + name: string; + + /** + * 商品重量 + */ + weight: number; + + /** + * 商品价格 + */ + price: number; + + /** + * 商品时间 + */ + date: string; + + /** + * 商品种类 + */ + type: string; + + /** + * 乐观锁 + */ + version: number; + +} + +export interface CustomerForm { + /** + * 客户id + */ + customerId?: string | number; + + /** + * 客户姓名 + */ + customerName?: string; + + /** + * 手机号码 + */ + phonenumber?: string; + + /** + * 客户性别 + */ + gender?: string; + + /** + * 客户生日 + */ + birthday?: string; + + /** + * 客户描述 + */ + remark?: string; + + /** + * 乐观锁 + */ + version?: number; + +} + +export interface CustomerQuery extends PageQuery { + /** + * 客户姓名 + */ + customerName?: string; + + /** + * 手机号码 + */ + phonenumber?: string; + + /** + * 客户性别 + */ + gender?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/views/mf/customer/index.vue b/src/views/mf/customer/index.vue new file mode 100644 index 0000000..3458187 --- /dev/null +++ b/src/views/mf/customer/index.vue @@ -0,0 +1,385 @@ + + +