From 0b3e7890c1ce12f348d53031707b39a3645fab27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Tue, 21 May 2024 17:32:20 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/report/inventoryWarning/index.ts | 67 +++++ src/utils/dict.ts | 2 + src/views/eam/basic/location/index.vue | 2 +- .../eam/report/inventoryWarning/index.vue | 242 ++++++++++++++++++ .../inventoryWarning/inventoryWarning.data.ts | 186 ++++++++++++++ .../report/itemWarning/itemWarning.data.ts | 4 +- 6 files changed, 500 insertions(+), 3 deletions(-) create mode 100644 src/api/eam/report/inventoryWarning/index.ts create mode 100644 src/views/eam/report/inventoryWarning/index.vue create mode 100644 src/views/eam/report/inventoryWarning/inventoryWarning.data.ts diff --git a/src/api/eam/report/inventoryWarning/index.ts b/src/api/eam/report/inventoryWarning/index.ts new file mode 100644 index 0000000..741fcbe --- /dev/null +++ b/src/api/eam/report/inventoryWarning/index.ts @@ -0,0 +1,67 @@ +import request from '@/config/axios' + +export interface InventoryWarningVO { + id: number + number: string + name: string + specifications: string + uom: string + supplierName: string + brand: string + maxInventory: number + minInventory: number + nowInventory: number + procurementCycle: number + classification: string + usePlace: string + project: string + price: number + procureStatus: string + describes: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询库存预警记录列表 +export const getInventoryWarningPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/record/inventory-warning/senior', data }) + } else { + return await request.get({ url: `/record/inventory-warning/page`, params }) + } +} + +// 查询库存预警记录详情 +export const getInventoryWarning = async (id: number) => { + return await request.get({ url: `/record/inventory-warning/get?id=` + id }) +} + +// 新增库存预警记录 +export const createInventoryWarning = async (data: InventoryWarningVO) => { + return await request.post({ url: `/record/inventory-warning/create`, data }) +} + +// 修改库存预警记录 +export const updateInventoryWarning = async (data: InventoryWarningVO) => { + return await request.put({ url: `/record/inventory-warning/update`, data }) +} + +// 删除库存预警记录 +export const deleteInventoryWarning = async (id: number) => { + return await request.delete({ url: `/record/inventory-warning/delete?id=` + id }) +} + +// 导出库存预警记录 Excel +export const exportInventoryWarning = async (params) => { + return await request.download({ url: `/record/inventory-warning/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/record/inventory-warning/get-import-template' }) +} \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index cbd96eb..aa69505 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -308,5 +308,7 @@ export enum DICT_TYPE { EQUIPMENT_INDEX_NAME = 'equipment_index_name',//设备年度目标指标名称分类字段 SPECIAL_DEPT_ROLE = 'special_dept_role', ITEM_ACCOUNT_LOCATION_TYPE = "item_account_location_type", + PROCURE_STATUS = "procure_status", + } diff --git a/src/views/eam/basic/location/index.vue b/src/views/eam/basic/location/index.vue index 4291e10..8bd11d4 100644 --- a/src/views/eam/basic/location/index.vue +++ b/src/views/eam/basic/location/index.vue @@ -59,7 +59,7 @@ const tableColumns = ref(Location.allSchemas.tableColumns) const importFormRef = ref() const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL - const src = ref(BASE_URL + '/jmreport/view/948743576290918400?token=' + getAccessToken()) + const src = ref(BASE_URL + '/jmreport/view/952737529008816128?token=' + getAccessToken()) // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { diff --git a/src/views/eam/report/inventoryWarning/index.vue b/src/views/eam/report/inventoryWarning/index.vue new file mode 100644 index 0000000..e9e9e8b --- /dev/null +++ b/src/views/eam/report/inventoryWarning/index.vue @@ -0,0 +1,242 @@ + + + diff --git a/src/views/eam/report/inventoryWarning/inventoryWarning.data.ts b/src/views/eam/report/inventoryWarning/inventoryWarning.data.ts new file mode 100644 index 0000000..98a7ff7 --- /dev/null +++ b/src/views/eam/report/inventoryWarning/inventoryWarning.data.ts @@ -0,0 +1,186 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const InventoryWarningRules = reactive({ + number: [required], + procureStatus: [required], + concurrencyStamp: [required], +}) + +export const InventoryWarning = useCrudSchemas(reactive([ + { + label: '备件编码', + field: 'number', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 180, + }, + }, + { + label: '备件名称', + field: 'name', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '规格型号', + field: 'specifications', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '单位', + field: 'uom', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '生产厂家', + field: 'brand', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '最高库存', + field: 'maxInventory', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '最低库存', + field: 'minInventory', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '最低库存', + field: 'nowInventory', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110, + }, + }, + { + label: '采购周期(周)', + field: 'procurementCycle', + sort: 'custom', + isSearch: false, + isForm: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: 'ABC分类', + field: 'classification', + sort: 'custom', + isSearch: false, + isForm: false, + }, + { + label: '使用地点', + field: 'usePlace', + sort: 'custom', + isSearch: false, + isForm: false, + }, + { + label: '项目', + field: 'project', + sort: 'custom', + isSearch: false, + isForm: false, + }, + { + label: '价格', + field: 'price', + sort: 'custom', + isSearch: false, + isForm: false, + }, + { + label: '采购状态分类', + field: 'procureStatus', + sort: 'custom', + dictType: DICT_TYPE.PROCURE_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 100 + }, + }, + { + label: '备注', + field: 'describes', + sort: 'custom', + isSearch: false, + isForm: false, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm: 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, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/report/itemWarning/itemWarning.data.ts b/src/views/eam/report/itemWarning/itemWarning.data.ts index f5c4bcd..f6674c5 100644 --- a/src/views/eam/report/itemWarning/itemWarning.data.ts +++ b/src/views/eam/report/itemWarning/itemWarning.data.ts @@ -21,7 +21,7 @@ export const ItemRules = reactive({ export const Item = useCrudSchemas(reactive([ { - label: '零件编码', + label: '备件编码', field: 'number', sort: 'custom', isSearch: true, @@ -30,7 +30,7 @@ export const Item = useCrudSchemas(reactive([ }, }, { - label: '零件名称', + label: '备件名称', field: 'name', sort: 'custom', isSearch: true,