diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4e9e4a2..17490f2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,6 @@ allowBuilds: - '@parcel/watcher': set this to true or false - core-js: set this to true or false - electron-winstaller: set this to true or false - esbuild: set this to true or false - vue-demi: set this to true or false + '@parcel/watcher': true + core-js: true + electron-winstaller: true + esbuild: true + vue-demi: true diff --git a/src/api/tool.ts b/src/api/tool.ts new file mode 100644 index 0000000..a731824 --- /dev/null +++ b/src/api/tool.ts @@ -0,0 +1,77 @@ +import { request } from '@/utils/request' + +export interface Tool { + id?: number + toolCode: string + toolName: string + toolType: string + toolTypeId?: number + specModel: string + material: string + manufacturer: string + purchaseDate?: string | number + lifeCycle: number + usedCount?: number + status: number + remark: string + createTime?: string + updateTime?: string +} + +export const toolApi = { + page(params: { + page: number + pageSize: number + toolCode?: string + toolName?: string + status?: number + }) { + return request({ + url: '/biz/tool/page', + method: 'get', + params + }) + }, + + create(data: Tool) { + return request({ + url: '/biz/tool', + method: 'post', + data + }) + }, + + update(data: Tool) { + return request({ + url: '/biz/tool', + method: 'put', + data + }) + }, + + delete(ids: number[]) { + return request({ + url: `/biz/tool/${ids.join(',')}`, + method: 'delete' + }) + }, + + export(params?: { + ids?: number[] + toolCode?: string + toolName?: string + status?: number + }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.toolCode) p.toolCode = params.toolCode + if (params?.toolName) p.toolName = params.toolName + if (params?.status != null) p.status = params.status + return request({ + url: '/biz/tool/report', + method: 'get', + params: p, + responseType: 'blob' + }) + } +} \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index b2c625a..f190e34 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -290,16 +290,16 @@ const routes: RouteRecordRaw[] = [ meta: { title: '工序委外', icon: 'ListOutline' } }, { - path: 'biz/deviceGather', - name: 'deviceGather', - component: () => import('@/views/biz/deviceGather/index.vue'), - meta: { title: '设备采集', icon: 'ListOutline' } + path: 'biz/tool', + name: 'tool', + component: () => import('@/views/biz/tool/index.vue'), + meta: { title: '刀具管理', icon: 'ToolOutline' } }, { - path: 'biz/callingMaterials', - name: 'callingMaterials', - component: () => import('@/views/biz/callingMaterials/index.vue'), - meta: { title: '叫料记录', icon: 'ListOutline' } + path: 'biz/tool/usage', + name: 'toolUsage', + component: () => import('@/views/biz/tool/usage.vue'), + meta: { title: '刀具使用记录', icon: 'ToolOutline', activeMenu: '/biz/tool' } }, { // 开发工具