|
@@ -0,0 +1,107 @@
|
|
|
+import request from '@/utils/request';
|
|
|
+
|
|
|
+export const BasicApi = {
|
|
|
+ // Predefine APIs
|
|
|
+ async getPredefineList(type: string): Promise<BasicData.Predefine[]> {
|
|
|
+ return request.get('basic/predefine/all', { params: { type } });
|
|
|
+ },
|
|
|
+ async addPredefine(data: Omit<BasicData.Predefine, 'id'>): Promise<void> {
|
|
|
+ return request.post('basic/predefine/add', data);
|
|
|
+ },
|
|
|
+ async deletePredefine(type: string, value: string): Promise<void> {
|
|
|
+ return request.delete('basic/predefine/remove', { params: { type, value } });
|
|
|
+ },
|
|
|
+
|
|
|
+ // Product Type APIs
|
|
|
+ async deleteType(name: string): Promise<void> {
|
|
|
+ return request.delete('basic/product/remove-type', { params: { name } });
|
|
|
+ },
|
|
|
+
|
|
|
+ // Unit APIs
|
|
|
+ async getUnitList(): Promise<BasicData.Unit[]> {
|
|
|
+ return request.get('basic/product/units');
|
|
|
+ },
|
|
|
+ async updateUnit(data: Partial<BasicData.Unit>): Promise<void> {
|
|
|
+ return request.post('basic/product/update-unit', data);
|
|
|
+ },
|
|
|
+ async addUnit(data: Partial<BasicData.Unit>): Promise<void> {
|
|
|
+ return request.post('basic/product/add-unit', data);
|
|
|
+ },
|
|
|
+ async deletedUnit(id: number): Promise<void> {
|
|
|
+ return request.delete('basic/product/remove-unit', { params: { id } });
|
|
|
+ },
|
|
|
+
|
|
|
+ // Equipment APIs
|
|
|
+ async getEquipmentList(): Promise<BasicData.Equipment[]> {
|
|
|
+ return request.get('basic/equipment/all');
|
|
|
+ },
|
|
|
+ async updateEquipment(data: Partial<BasicData.Equipment>): Promise<void> {
|
|
|
+ return request.post('basic/equipment/update', data);
|
|
|
+ },
|
|
|
+ async addEquipment(data: Partial<BasicData.Equipment>): Promise<void> {
|
|
|
+ return request.post('basic/equipment/add', data);
|
|
|
+ },
|
|
|
+ async deletedEquipment(id: number): Promise<void> {
|
|
|
+ return request.get('basic/equipment/remove', { params: { id } });
|
|
|
+ },
|
|
|
+
|
|
|
+ // Operation APIs
|
|
|
+ async getOperationList(): Promise<BasicData.Operation[]> {
|
|
|
+ return request.get('basic/operation/all');
|
|
|
+ },
|
|
|
+ async updateOperation(data: Partial<BasicData.Operation>): Promise<void> {
|
|
|
+ return request.post('basic/operation/update', data);
|
|
|
+ },
|
|
|
+ async addOperation(data: Partial<BasicData.Operation>): Promise<void> {
|
|
|
+ return request.post('basic/operation/add', data);
|
|
|
+ },
|
|
|
+ async deletedOperation(id: number): Promise<void> {
|
|
|
+ return request.get('basic/operation/remove', { params: { id } });
|
|
|
+ },
|
|
|
+
|
|
|
+ // Position APIs
|
|
|
+ async getPositionList(): Promise<BasicData.Position[]> {
|
|
|
+ return request.get('basic/position/all');
|
|
|
+ },
|
|
|
+ async updatePosition(data: Partial<BasicData.Position>): Promise<void> {
|
|
|
+ return request.post('basic/position/update', data);
|
|
|
+ },
|
|
|
+ async addPosition(data: Partial<BasicData.Position>): Promise<void> {
|
|
|
+ return request.post('basic/position/add', data);
|
|
|
+ },
|
|
|
+ async deletedPosition(id: number): Promise<void> {
|
|
|
+ return request.get('basic/position/remove', { params: { id } });
|
|
|
+ },
|
|
|
+
|
|
|
+ // Department APIs
|
|
|
+ async getDepartmentList(): Promise<BasicData.Department[]> {
|
|
|
+ return request.get('hr/department/all');
|
|
|
+ },
|
|
|
+ async addDepartment(data: Partial<BasicData.Department>): Promise<void> {
|
|
|
+ return request.post('hr/department/add', data);
|
|
|
+ },
|
|
|
+ async updateDepartment(data: Partial<BasicData.Department>): Promise<void> {
|
|
|
+ return request.post('hr/department/update', data);
|
|
|
+ },
|
|
|
+ async removeDepartment(id: number): Promise<void> {
|
|
|
+ return request.get('hr/department/remove', { params: { id } });
|
|
|
+ },
|
|
|
+
|
|
|
+ // Job APIs
|
|
|
+ async getJobList(): Promise<BasicData.Job[]> {
|
|
|
+ return request.get('basic/job/all');
|
|
|
+ },
|
|
|
+ async addJob(data: Partial<BasicData.Job>): Promise<void> {
|
|
|
+ return request.post('basic/job/add', data);
|
|
|
+ },
|
|
|
+ async updateJob(data: Partial<BasicData.Job>): Promise<void> {
|
|
|
+ return request.post('basic/job/update', data);
|
|
|
+ },
|
|
|
+ async removeJob(id: number): Promise<void> {
|
|
|
+ return request.get('basic/job/remove', { params: { id } });
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+export default {
|
|
|
+ BasicApi,
|
|
|
+};
|