This commit is contained in:
wzt 2026-07-28 09:54:38 +08:00
parent 4c974947af
commit 147b802daf
3 changed files with 90 additions and 13 deletions

View File

@ -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

77
src/api/tool.ts Normal file
View File

@ -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<string, any> = {}
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'
})
}
}

View File

@ -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' }
},
{
// 开发工具