From 82e27d0cadbddfc73e8b978e778b802dc8e51fa1 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 29 三月 2024 10:51:36 +0800 Subject: [PATCH] 报工入参修改和工序ID修改 --- src/api/index.ts | 189 ++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 178 insertions(+), 11 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index e474d51..185ed66 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,9 +1,10 @@ import { request } from '@/common/utils' -import type { CraftParamsResponse, TasksGroupByChannel } from './task' +import type { CraftParamsResponse, TasksGroupByChannel, Task } from './task' import type { PLCResponse } from './plc' import type { Devices } from './device' import type { CraftModel } from './craftModel' import type { Problem } from './problem' +import type { ReportingRecord } from './reporting' export interface BaseResponse<T = any> { code: number @@ -27,6 +28,8 @@ offset: number /** 鏌ュ灏戞潯 */ limit: number + /** 璁惧id */ + deviceID: string } /** @@ -35,7 +38,26 @@ */ export function getTaskList(params: TaskListParams) { return request<BaseResponse<TasksGroupByChannel>>({ - url: '/v1/task/list', + url: '/api-s/v1/reportWork/taskList', + method: 'get', + params + }) +} + +export interface TaskInfoParams { + /** 璁惧id */ + deviceID: string + /** 宸ュ簭id */ + procedureID: number +} + +/** + * 鑾峰彇浠诲姟璇︽儏 + * @param params + */ +export function getTaskInfo(params: TaskInfoParams) { + return request<BaseResponse<Task>>({ + url: '/api-s/v1/reportWork/taskInfo', method: 'get', params }) @@ -43,7 +65,7 @@ export interface ProductProgressParams { channel: number - procedureId: number + procedureId?: number } /** @@ -105,12 +127,30 @@ }) } +export interface ProcedureUpdateParams { + isFinish: boolean + isProcessing: boolean + workOrderProcedureID: number +} + +/** + * 寮�濮嬩换鍔�/瀹屾垚浠诲姟 (鍘� 鑾峰彇宸ヨ壓鍙傛暟/缁撴潫浠诲姟) + * @param params + */ +export function procedureUpdate(params: ProcedureUpdateParams) { + return request<BaseResponse>({ + url: `/api-s/v1/reportWork/procedureUpdate`, + method: 'post', + data: params + }) +} + /** * 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛� */ export function getDeviceList() { return request<BaseResponse<Devices>>({ - url: `/v1/device/list`, + url: `/api-s/v1/reportWork/deviceList`, method: 'get' }) } @@ -120,11 +160,26 @@ } /** - * 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛� + * 璁惧畾褰撳墠璁惧 */ export function apiSetCurrentDevice(data: SetCurrentDeviceParams) { - return request<BaseResponse<Devices>>({ - url: `/v1/device/setCurrentDeviceId`, + return request<BaseResponse>({ + url: `/api-s/v1/reportWork/setCurrentDeviceId`, + method: 'post', + data + }) +} + +export interface SetCurrentDeviceConfigParams { + needSetProcessParams: boolean +} + +/** + * 璁惧畾褰撳墠璁惧閰嶇疆 + */ +export function apiSetCurrentDeviceConfig(data: SetCurrentDeviceConfigParams) { + return request<BaseResponse>({ + url: `/v1/device/config`, method: 'post', data }) @@ -167,9 +222,121 @@ /** * 鑾峰彇闂璇婃柇闂鍒楄〃 */ -export function apiGetProblemList() { - return request<BaseResponse<Problem[]>>({ - url: '/v1/system/problemList', - method: 'get' +// export function apiGetProblemList() { +// return request<BaseResponse<Problem[]>>({ +// url: '/v1/system/problemList', +// method: 'get' +// }) +// } + +export interface ReportingRecordListParams { + page?: number + pageSize?: number + workOrderProcedureID: number +} + +/** + * 鑾峰彇鎶ュ伐璁板綍鍒楄〃 + */ +export function apiGetReportingRecordList(params: ReportingRecordListParams) { + return request<ListResponse<ReportingRecord[]>>({ + url: '/api-s/v1/reportWork/list', + method: 'get', + params + }) +} + +export interface ReportWorkParams { + workOrderProcedureID: number + reportAmount: number + workerID: string + workerName: string +} + +/** + * 鎶ュ伐 + */ +export function apiReportWork(params: ReportWorkParams) { + return request<BaseResponse>({ + url: '/api-s/v1/reportWork/report', + method: 'post', + data: params + }) +} + +/** + * 鑾峰彇楠岃瘉鐮� + */ +export function getCaptcha() { + return request({ + url: '/api/base/captcha', + method: 'post' + }) +} + +export interface loginParams { + username: string + password: string + captcha: string + captchaId: string +} +/** + * 鐧诲綍 + */ +export function login(params: loginParams) { + return request({ + url: '/api/base/login', + method: 'post', + data: params + }) +} + +export interface qualityParams { + reportAmount: number + workOrderProcedureID: number + workerID: string + workerName: string +} +/** + * 鐪嬫澘璐ㄦ + */ +export function bulletinQualityInspection(params: qualityParams) { + return request({ + url: '/api-s/v1/reportWork/bulletinQualityInspection', + method: 'post', + data: params + }) +} + +export interface getQualityParams { + workOrderId: string + procedureId: string +} +/** + * 鐪嬫澘鑾峰彇璐ㄦ淇℃伅 + */ +export function getQualityInspection(params: getQualityParams) { + return request({ + url: '/api-s/v1/reportWork/bulletinGetQualityInspection', + method: 'post', + data: params + }) +} + +export interface bulletinReportParams { + reportAmount: number + workOrderProcedureID: number + workerID: string + workerName: string + ids: any[] +} +/** + * 鐪嬫澘鎶ュ伐 + */ +export function bulletinReport(params: bulletinReportParams) { + return request({ + url: '/api-s/v1/reportWork/bulletinReport', + method: 'post', + data: params }) } -- Gitblit v1.8.0