diff --git a/src/api/eam/basic/item/index.ts b/src/api/eam/basic/item/index.ts index 122c879..a0d72d3 100644 --- a/src/api/eam/basic/item/index.ts +++ b/src/api/eam/basic/item/index.ts @@ -33,6 +33,17 @@ export const getItemPage = async (params) => { } } +// 查询备件列表 +export const getWarningPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + return await request.post({ url: '/eam/item/warningSenior', data }) + } else { + return await request.get({ url: `/eam/item/warningPage`, params }) + } +} + // 生成标签 export const genDevice = async (data) => { return await request.post({ url: `/eam/item/genDevice`, data }) diff --git a/src/views/eam/basic/item/item.data.ts b/src/views/eam/basic/item/item.data.ts index d42ac55..a05ed1b 100644 --- a/src/views/eam/basic/item/item.data.ts +++ b/src/views/eam/basic/item/item.data.ts @@ -11,6 +11,12 @@ export const ItemRules = reactive({ { required: true, message: '请选择备件单位', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], + maxInventory: [ + { required: true, message: '请输入最高库存', trigger: 'blur' } + ], + minInventory: [ + { required: true, message: '请输入最高库存', trigger: 'blur' } + ], }) export const Item = useCrudSchemas(reactive([ diff --git a/src/views/eam/report/itemWarning/index.vue b/src/views/eam/report/itemWarning/index.vue new file mode 100644 index 0000000..cf6726e --- /dev/null +++ b/src/views/eam/report/itemWarning/index.vue @@ -0,0 +1,275 @@ + + + diff --git a/src/views/eam/report/itemWarning/item.data.ts b/src/views/eam/report/itemWarning/item.data.ts new file mode 100644 index 0000000..334f1d2 --- /dev/null +++ b/src/views/eam/report/itemWarning/item.data.ts @@ -0,0 +1,199 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ItemRules = reactive({ + name: [ + { required: true, message: '请输入备件名称', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + uom: [ + { required: true, message: '请选择备件单位', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + maxInventory: [ + { required: true, message: '请输入最高库存', trigger: 'blur' } + ], + minInventory: [ + { required: true, message: '请输入最高库存', trigger: 'blur' } + ], +}) + +export const Item = useCrudSchemas(reactive([ + { + label: '零件编码', + field: 'number', + sort: 'custom', + isSearch: true, + table: { + width: 180, + fixed: 'left' + }, + }, + { + label: '零件名称', + field: 'name', + sort: 'custom', + isSearch: true, + table: { + width: 110 + }, + }, + { + label: '规格型号', + field: 'specifications', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '单位', + field: 'uom', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch: false, + table: { + width: 130 + }, + }, + { + label: '生产厂家', + field: 'brand', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '最高库存', + field: 'maxInventory', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + table: { + width: 110 + }, + }, + { + label: '最低库存', + field: 'minInventory', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + table: { + width: 110 + }, + }, + { + label: '现有库存', + field: 'allCount', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '采购周期(周)', + field: 'procurementCycle', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + table: { + width: 150 + }, + }, + { + label: 'ABC分类', + field: 'classification', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '使用地点', + field: 'usePlace', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '项目', + field: 'project', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '价格', + field: 'price', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '描述', + field: 'describes', + sort: 'custom', + isSearch: false, + table: { + width: 110 + }, + }, + { + label: '创建时间', + field: 'createTime', + 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')] + } + }, + isForm: false, + table: { + width: 180 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))