diff --git a/src/api/demo/customer/index.ts b/src/api/demo/customer/index.ts new file mode 100644 index 0000000..6cc0eb4 --- /dev/null +++ b/src/api/demo/customer/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DemoCustomerVO, DemoCustomerForm, DemoCustomerQuery } from '@/api/demo/customer/types'; + +/** + * 查询客户主表列表 + * @param query + * @returns {*} + */ + +export const listCustomer = (query?: DemoCustomerQuery): AxiosPromise => { + return request({ + url: '/demo/customer/list', + method: 'get', + params: query + }); +}; + +/** + * 查询客户主表详细 + * @param customerId + */ +export const getCustomer = (customerId: string | number): AxiosPromise => { + return request({ + url: '/demo/customer/' + customerId, + method: 'get' + }); +}; + +/** + * 新增客户主表 + * @param data + */ +export const addCustomer = (data: DemoCustomerForm) => { + return request({ + url: '/demo/customer', + method: 'post', + data: data + }); +}; + +/** + * 修改客户主表 + * @param data + */ +export const updateCustomer = (data: DemoCustomerForm) => { + return request({ + url: '/demo/customer', + method: 'put', + data: data + }); +}; + +/** + * 删除客户主表 + * @param customerId + */ +export const delCustomer = (customerId: string | number | Array) => { + return request({ + url: '/demo/customer/' + customerId, + method: 'delete' + }); +}; diff --git a/src/api/demo/customer/types.ts b/src/api/demo/customer/types.ts new file mode 100644 index 0000000..049ee84 --- /dev/null +++ b/src/api/demo/customer/types.ts @@ -0,0 +1,119 @@ +export interface DemoCustomerVO extends BaseEntity { + /** + * 客户姓名 + */ + customerName: string; + + /** + * 手机号码 + */ + phonenumber: string; + + /** + * 客户性别 + */ + gender: string; + + /** + * 客户生日 + */ + birthday: string; + + /** 商品子表信息 */ + goodsList: Array; +} + +export interface DemoGoodsVO extends BaseEntity { + /** 列表序号 */ + index:number; + /** + * 商品名称 + */ + name: string; + + /** + * 商品重量 + */ + weight: number; + + /** + * 商品价格 + */ + price: number; + + /** + * 商品时间 + */ + date: string; + + /** + * 商品种类 + */ + type: string; + + /** + * 乐观锁 + */ + version: number; + +} + +export interface DemoCustomerForm { + /** + * 客户id + */ + customerId?: string | number; + + /** + * 客户姓名 + */ + customerName?: string; + + /** + * 手机号码 + */ + phonenumber?: string; + + /** + * 客户性别 + */ + gender?: string; + + /** + * 客户生日 + */ + birthday?: string; + + /** + * 客户描述 + */ + remark?: string; + + /** + * 乐观锁 + */ + version?: number; + +} + +export interface DemoCustomerQuery extends PageQuery { + /** + * 客户姓名 + */ + customerName?: string; + + /** + * 手机号码 + */ + phonenumber?: string; + + /** + * 客户性别 + */ + gender?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/demo/product/index.ts b/src/api/demo/product/index.ts new file mode 100644 index 0000000..d526f6c --- /dev/null +++ b/src/api/demo/product/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DemoProductVO, DemoProductForm, DemoProductQuery } from '@/api/demo/product/types'; + +/** + * 查询产品树列表 + * @param query + * @returns {*} + */ + +export const listProduct = (query?: DemoProductQuery): AxiosPromise => { + return request({ + url: '/demo/product/list', + method: 'get', + params: query + }); +}; + +/** + * 查询产品树详细 + * @param productId + */ +export const getProduct = (productId: string | number): AxiosPromise => { + return request({ + url: '/demo/product/' + productId, + method: 'get' + }); +}; + +/** + * 新增产品树 + * @param data + */ +export const addProduct = (data: DemoProductForm) => { + return request({ + url: '/demo/product', + method: 'post', + data: data + }); +}; + +/** + * 修改产品树 + * @param data + */ +export const updateProduct = (data: DemoProductForm) => { + return request({ + url: '/demo/product', + method: 'put', + data: data + }); +}; + +/** + * 删除产品树 + * @param productId + */ +export const delProduct = (productId: string | number | Array) => { + return request({ + url: '/demo/product/' + productId, + method: 'delete' + }); +}; diff --git a/src/api/demo/product/types.ts b/src/api/demo/product/types.ts new file mode 100644 index 0000000..a87b726 --- /dev/null +++ b/src/api/demo/product/types.ts @@ -0,0 +1,78 @@ +import { DemoStudentVO } from '@/api/demo/student/types'; + +export interface DemoProductVO extends BaseEntity { + /** + * 父产品id + */ + parentId: string | number; + + /** + * 产品名称 + */ + productName: string; + + /** + * 显示顺序 + */ + orderNum: number; + + /** + * 产品状态(0正常 1停用) + */ + status: string; + + /** + * 子对象 + */ + children: DemoProductVO[]; +} + +export interface DemoProductForm { + /** + * 产品id + */ + productId?: string | number; + + /** + * 父产品id + */ + parentId?: string | number; + + /** + * 产品名称 + */ + productName?: string; + + /** + * 显示顺序 + */ + orderNum?: number; + + /** + * 产品状态(0正常 1停用) + */ + status?: string; + + /** + * 乐观锁 + */ + version?: number; + +} + +export interface DemoProductQuery { + /** + * 产品名称 + */ + productName?: string; + + /** + * 产品状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/demo/student/index.ts b/src/api/demo/student/index.ts new file mode 100644 index 0000000..2686cd7 --- /dev/null +++ b/src/api/demo/student/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DemoStudentVO, DemoStudentForm, DemoStudentQuery } from '@/api/demo/student/types'; + +/** + * 查询学生信息表列表 + * @param query + * @returns {*} + */ + +export const listStudent = (query?: DemoStudentQuery): AxiosPromise => { + return request({ + url: '/demo/student/list', + method: 'get', + params: query + }); +}; + +/** + * 查询学生信息表详细 + * @param studentId + */ +export const getStudent = (studentId: string | number): AxiosPromise => { + return request({ + url: '/demo/student/' + studentId, + method: 'get' + }); +}; + +/** + * 新增学生信息表 + * @param data + */ +export const addStudent = (data: DemoStudentForm) => { + return request({ + url: '/demo/student', + method: 'post', + data: data + }); +}; + +/** + * 修改学生信息表 + * @param data + */ +export const updateStudent = (data: DemoStudentForm) => { + return request({ + url: '/demo/student', + method: 'put', + data: data + }); +}; + +/** + * 删除学生信息表 + * @param studentId + */ +export const delStudent = (studentId: string | number | Array) => { + return request({ + url: '/demo/student/' + studentId, + method: 'delete' + }); +}; diff --git a/src/api/demo/student/types.ts b/src/api/demo/student/types.ts new file mode 100644 index 0000000..4ed5d02 --- /dev/null +++ b/src/api/demo/student/types.ts @@ -0,0 +1,96 @@ +export interface DemoStudentVO extends BaseEntity { + /** + * 学生名称 + */ + studentName: string; + + /** + * 年龄 + */ + studentAge: number; + + /** + * 爱好(0代码 1音乐 2电影) + */ + studentHobby: string; + + /** + * 性别(1男 2女 3未知) + */ + studentGender: string; + + /** + * 状态(0正常 1停用) + */ + studentStatus: string; + + /** + * 生日 + */ + studentBirthday: string; + +} + +export interface DemoStudentForm { + /** + * 编号 + */ + studentId?: string | number; + + /** + * 学生名称 + */ + studentName?: string; + + /** + * 年龄 + */ + studentAge?: number; + + /** + * 爱好(0代码 1音乐 2电影) + */ + studentHobby?: string; + + /** + * 性别(1男 2女 3未知) + */ + studentGender?: string; + + /** + * 状态(0正常 1停用) + */ + studentStatus?: string; + + /** + * 生日 + */ + studentBirthday?: string; + + /** + * 乐观锁 + */ + version?: number; + +} + +export interface DemoStudentQuery extends PageQuery { + + /** + * 学生名称 + */ + studentName?: string; + + /** + * 状态(0正常 1停用) + */ + studentStatus?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/views/demo/customer/index.vue b/src/views/demo/customer/index.vue new file mode 100644 index 0000000..f32e6a7 --- /dev/null +++ b/src/views/demo/customer/index.vue @@ -0,0 +1,394 @@ + + + diff --git a/src/views/demo/product/index.vue b/src/views/demo/product/index.vue new file mode 100644 index 0000000..bbe0610 --- /dev/null +++ b/src/views/demo/product/index.vue @@ -0,0 +1,289 @@ + + + diff --git a/src/views/demo/student/index.vue b/src/views/demo/student/index.vue new file mode 100644 index 0000000..3d3e4da --- /dev/null +++ b/src/views/demo/student/index.vue @@ -0,0 +1,310 @@ + + + diff --git a/src/views/mf/customer/index.vue b/src/views/mf/customer/index.vue index 3458187..9075312 100644 --- a/src/views/mf/customer/index.vue +++ b/src/views/mf/customer/index.vue @@ -368,7 +368,7 @@ const handleDeleteGoods = () => { } /** 复选框选中数据 */ -const handleGoodsSelectionChange = (selection: goodsVO[]) => { +const handleGoodsSelectionChange = (selection: GoodsVO[]) => { checkedGoods.value = selection.map(item => item.index) }