diff --git a/src/api/eam/toolAccounts/index.ts b/src/api/eam/toolAccounts/index.ts new file mode 100644 index 000000000..0f5ebd032 --- /dev/null +++ b/src/api/eam/toolAccounts/index.ts @@ -0,0 +1,79 @@ +import request from '@/config/axios' + +export interface ToolAccountsVO { + id: number + code: string + name: string + specification: string + type: string + equity: string + electricMachine: string + isCustomerAptitude: boolean + customerId: string + storageLocation: string + useDept: string + principal: string + principalTelephone: string + status: string + startDate: Date + supplierCode: string + purchaseTime: Date + purchaseDept: string + purchaser: string + productionDate: Date + manufactureCode: string + equipmentLife: string + acceptanceDate: Date + purchasePrice: number + factoryAreaCode: string + workshopCode: string + workshopSectionCode: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询工装台账列表 +export const getToolAccountsPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/tool-accounts/senior', data }) + } else { + return await request.get({ url: `/eam/tool-accounts/page`, params }) + } +} + +// 查询工装台账详情 +export const getToolAccounts = async (id: number) => { + return await request.get({ url: `/eam/tool-accounts/get?id=` + id }) +} + +// 新增工装台账 +export const createToolAccounts = async (data: ToolAccountsVO) => { + return await request.post({ url: `/eam/tool-accounts/create`, data }) +} + +// 修改工装台账 +export const updateToolAccounts = async (data: ToolAccountsVO) => { + return await request.put({ url: `/eam/tool-accounts/update`, data }) +} + +// 删除工装台账 +export const deleteToolAccounts = async (id: number) => { + return await request.delete({ url: `/eam/tool-accounts/delete?id=` + id }) +} + +// 导出工装台账 Excel +export const exportToolAccounts = async (params) => { + return await request.download({ url: `/eam/tool-accounts/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/tool-accounts/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/eam/toolMod/index.ts b/src/api/eam/toolMod/index.ts new file mode 100644 index 000000000..507aa8ee8 --- /dev/null +++ b/src/api/eam/toolMod/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface ToolModVO { + id: number + modCode: string + toolCode: string + type: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询工装物料关联列表 +export const getToolModPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic/tool-mod/senior', data }) + } else { + return await request.get({ url: `/eam/basic/tool-mod/page`, params }) + } +} + +// 查询工装物料关联详情 +export const getToolMod = async (id: number) => { + return await request.get({ url: `/eam/basic/tool-mod/get?id=` + id }) +} + +// 新增工装物料关联 +export const createToolMod = async (data: ToolModVO) => { + return await request.post({ url: `/eam/basic/tool-mod/create`, data }) +} + +// 修改工装物料关联 +export const updateToolMod = async (data: ToolModVO) => { + return await request.put({ url: `/eam/basic/tool-mod/update`, data }) +} + +// 删除工装物料关联 +export const deleteToolMod = async (id: number) => { + return await request.delete({ url: `/eam/basic/tool-mod/delete?id=` + id }) +} + +// 导出工装物料关联 Excel +export const exportToolMod = async (params) => { + return await request.download({ url: `/eam/basic/tool-mod/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic/tool-mod/get-import-template' }) +} + +// 新增工装物料关联 +export const createToolModBatch = async (data: ToolModVO) => { + return await request.post({ url: `/eam/basic/tool-mod/createBatch`, data }) +} diff --git a/src/views/eam/toolAccounts/index.vue b/src/views/eam/toolAccounts/index.vue new file mode 100644 index 000000000..abb89eceb --- /dev/null +++ b/src/views/eam/toolAccounts/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/toolAccounts/toolAccounts.data.ts b/src/views/eam/toolAccounts/toolAccounts.data.ts new file mode 100644 index 000000000..da9d18546 --- /dev/null +++ b/src/views/eam/toolAccounts/toolAccounts.data.ts @@ -0,0 +1,279 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ToolAccountsRules = reactive({ + code: [required], + name: [required], + concurrencyStamp: [required] +}) + +export const ToolAccounts = useCrudSchemas(reactive([ + { + label: '工装编号', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true + }, + { + label: '型号', + field: 'specification', + sort: 'custom', + isSearch: true + }, + { + label: '类型', + field: 'type', + sort: 'custom', + isSearch: false, + form: { + component: 'Select' + } + }, + { + label: '产权', + field: 'equity', + sort: 'custom', + isSearch: false + }, + { + label: '电机', + field: 'electricMachine', + sort: 'custom', + isSearch: false + }, + { + label: '是否客户资质', + field: 'isCustomerAptitude', + sort: 'custom', + isSearch: false, + form: { + component: 'Switch' + } + }, + { + label: '客户id', + field: 'customerId', + sort: 'custom', + isSearch: false + }, + { + label: '存放位置', + field: 'storageLocation', + sort: 'custom', + isSearch: false + }, + { + label: '使用部门', + field: 'useDept', + sort: 'custom', + isSearch: false + }, + { + label: '负责人', + field: 'principal', + sort: 'custom', + isSearch: false + }, + { + label: '负责人联系方式', + field: 'principalTelephone', + sort: 'custom', + isSearch: false + }, + { + label: '设备状态', + field: 'status', + sort: 'custom', + isSearch: false, + form: { + component: 'Switch' + } + }, + { + label: '启用日期', + field: 'startDate', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '供应商编号', + field: 'supplierCode', + sort: 'custom', + isSearch: false + }, + { + label: '采购时间', + field: 'purchaseTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '采购部门', + field: 'purchaseDept', + sort: 'custom', + isSearch: true + }, + { + label: '采购人', + field: 'purchaser', + sort: 'custom', + isSearch: true + }, + { + label: '出厂日期', + field: 'productionDate', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '生产厂商编码', + field: 'manufactureCode', + sort: 'custom', + isSearch: false + }, + { + label: '设备使用寿命', + field: 'equipmentLife', + sort: 'custom', + isSearch: false + }, + { + label: '验收日期', + field: 'acceptanceDate', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '价格', + field: 'purchasePrice', + sort: 'custom', + isSearch: false + }, + { + label: '所属厂区编号', + field: 'factoryAreaCode', + sort: 'custom', + isSearch: true + }, + { + label: '车间编号', + field: 'workshopCode', + sort: 'custom', + isSearch: true + }, + { + label: '工段编号', + field: 'workshopSectionCode', + sort: 'custom', + isSearch: true + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + isSearch: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false + }, + // { + // label: '是否可用', + // field: 'available', + // sort: 'custom', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + // isSearch: false, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/toolMod/index.vue b/src/views/eam/toolMod/index.vue new file mode 100644 index 000000000..3df940dde --- /dev/null +++ b/src/views/eam/toolMod/index.vue @@ -0,0 +1,285 @@ + + + diff --git a/src/views/eam/toolMod/operateForm.vue b/src/views/eam/toolMod/operateForm.vue new file mode 100644 index 000000000..ac16e28ef --- /dev/null +++ b/src/views/eam/toolMod/operateForm.vue @@ -0,0 +1,320 @@ + + + + diff --git a/src/views/eam/toolMod/toolMod.data.ts b/src/views/eam/toolMod/toolMod.data.ts new file mode 100644 index 000000000..e90d484e9 --- /dev/null +++ b/src/views/eam/toolMod/toolMod.data.ts @@ -0,0 +1,155 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; +import * as ItembasicApi from "@/api/wms/itembasic"; +import { ToolAccounts,ToolAccountsRules } from '../toolAccounts/toolAccounts.data' +import * as ToolAccountsApi from '@/api/eam/toolAccounts' + +// 表单校验 +export const ToolModRules = reactive({ + modCode: [required], + toolCode: [required], + type: [required], + concurrencyStamp: [required] +}) + +export const ToolMod = useCrudSchemas(reactive([ + { + label: '工装编码', + field: 'toolCode', + sort: 'custom', + isSearch: false, + isDetail: false, + isForm: false, + isTable: true, + isTableForm: false, + }, + // { + // label: '工装编码', + // field: 'toolCodeShow', + // sort: 'custom', + // isSearch: true, + // form: { + // componentProps: { + // isSearchList: true, + // searchListPlaceholder: '请选择工装代码', + // searchField: 'toolCodeShow', + // searchTitle: '客户物料基础信息', + // searchAllSchemas: ToolAccounts.allSchemas, + // searchPage: ToolAccountsApi.getToolAccountsPage, + // searchCondition: [{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // }, + // search: { + // componentProps: { + // isSearchList: true, + // searchListPlaceholder: '请选择工装代码', + // searchField: 'toolCodeShow', + // searchTitle: '客户物料基础信息', + // searchAllSchemas: ToolAccounts.allSchemas, + // searchPage: ToolAccountsApi.getToolAccountsPage, + // searchCondition: [{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // } + // }, + { + label: '物料编号', + field: 'modCode', + sort: 'custom', + isSearch: false, + isDetail: false, + isForm: false, + isTable: true, + isTableForm: false, + }, + // { + // label: '物料编号', + // field: 'modCodeShow', + // sort: 'custom', + // isSearch: true, + // form: { + // componentProps: { + // isSearchList: true, + // searchListPlaceholder: '请选择物料代码', + // searchField: 'modCodeShow', + // searchTitle: '客户物料基础信息', + // multiple:true, + // searchAllSchemas: Itembasic.allSchemas, + // searchPage: ItembasicApi.getItembasicPage, + // searchCondition: [{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // }, + // search: { + // componentProps: { + // isSearchList: true, + // searchListPlaceholder: '请选择物料代码', + // searchField: 'modCodeShow', + // searchTitle: '客户物料基础信息', + // multiple: true, + // searchAllSchemas: Itembasic.allSchemas, + // searchPage: ItembasicApi.getItembasicPage, + // searchCondition: [{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // } + // }, + { + label: '类型', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.DEVICE_TYPE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'Select' + } + }, + // { + // label: '部门', + // field: 'departmentCode', + // sort: 'custom', + // isSearch: true + // }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: true, + isDetail: false, + isSearch: false, + isTableForm: false, + isForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))