diff --git a/src/api/eam/basic/fixedAssets/index.ts b/src/api/eam/basic/fixedAssets/index.ts new file mode 100644 index 0000000..aba3894 --- /dev/null +++ b/src/api/eam/basic/fixedAssets/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface FixedAssetsVO { + number: string + name: string + accountingUnit: string + specifications: string + locationNumber: string + purchaseDate: Date + purchaseDept: string + supplierNumber: string + productionDate: Date + purchasePrice: number + manageDept: string + unit: string + qty: number + siteId: string + available: string + concurrencyStamp: number +} + +// 查询固定资产列表 +export const getFixedAssetsPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/fixed-assets/senior', data }) + } else { + return await request.get({ url: `/eam/fixed-assets/page`, params }) + } +} + +// 查询固定资产详情 +export const getFixedAssets = async (id: number) => { + return await request.get({ url: `/eam/fixed-assets/get?id=` + id }) +} + +// 新增固定资产 +export const createFixedAssets = async (data: FixedAssetsVO) => { + return await request.post({ url: `/eam/fixed-assets/create`, data }) +} + +// 修改固定资产 +export const updateFixedAssets = async (data: FixedAssetsVO) => { + return await request.put({ url: `/eam/fixed-assets/update`, data }) +} + +// 删除固定资产 +export const deleteFixedAssets = async (id: number) => { + return await request.delete({ url: `/eam/fixed-assets/delete?id=` + id }) +} + +// 导出固定资产 Excel +export const exportFixedAssets = async (params) => { + return await request.download({ url: `/eam/fixed-assets/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/fixed-assets/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/eam/device/deviceAccounts/index.ts b/src/api/eam/device/deviceAccounts/index.ts index 59def69..121b946 100644 --- a/src/api/eam/device/deviceAccounts/index.ts +++ b/src/api/eam/device/deviceAccounts/index.ts @@ -17,7 +17,7 @@ export interface DeviceAccountsVO { concurrencyStamp: number } -// 查询备件台账列表 +// 查询设备台账列表 export const getDeviceAccountsPage = async (params) => { if (params.isSearch) { delete params.isSearch @@ -28,27 +28,27 @@ export const getDeviceAccountsPage = async (params) => { } } -// 查询备件台账详情 +// 查询设备台账详情 export const getDeviceAccounts = async (id: number) => { return await request.get({ url: `/eam/device-accounts/get?id=` + id }) } -// 新增备件台账 +// 新增设备台账 export const createDeviceAccounts = async (data: DeviceAccountsVO) => { return await request.post({ url: `/eam/device-accounts/create`, data }) } -// 修改备件台账 +// 修改设备台账 export const updateDeviceAccounts = async (data: DeviceAccountsVO) => { return await request.put({ url: `/eam/device-accounts/update`, data }) } -// 删除备件台账 +// 删除设备台账 export const deleteDeviceAccounts = async (id: number) => { return await request.delete({ url: `/eam/device-accounts/delete?id=` + id }) } -// 导出备件台账 Excel +// 导出设备台账 Excel export const exportDeviceAccounts = async (params) => { return await request.download({ url: `/eam/device-accounts/export-excel`, params }) } diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 90946a2..3e2ca6a 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -355,7 +355,7 @@ const open = async (type: string, row?: any, masterParmas?: any) => { console.log(8) if (row?.id || row?.masterId) { formLoading.value = true - console.log(99) + console.log(99) try { nextTick(() => { formRef.value.setValues(row) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index fbc090b..22040a3 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -748,6 +748,32 @@ export function selectDeviceBtn(option:any) { hasPermi: '' }) } + +// 主列表-二维码 +export function selectQrCodeBtn(option:any) { + return __defaultBtnOption(option,{ + label: '二维码', + name: 'selectQrCode', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-备件 +export function selectItemBtn(option:any) { + return __defaultBtnOption(option,{ + label: '备件', + name: 'selectItem', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/eam/basic/fixedAssets/fixedAssets.data.ts b/src/views/eam/basic/fixedAssets/fixedAssets.data.ts new file mode 100644 index 0000000..327c77d --- /dev/null +++ b/src/views/eam/basic/fixedAssets/fixedAssets.data.ts @@ -0,0 +1,146 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const FixedAssetsRules = reactive({ + number: [required], + name: [required], + locationNumber: [required], + supplierNumber: [required], + purchasePrice: [required], + qty: [required], + concurrencyStamp: [required], +}) + +export const FixedAssets = useCrudSchemas(reactive([ + { + label: '编号唯一标识', + field: 'number', + sort: 'custom', + isSearch: true, + }, + { + label: '资产名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '会计单位', + field: 'accountingUnit', + sort: 'custom', + isSearch: true, + }, + { + label: '规格型号', + field: 'specifications', + sort: 'custom', + }, + { + label: '库位编号', + field: 'locationNumber', + sort: 'custom', + isSearch: true, + }, + { + label: '购买时间', + field: 'purchaseDate', + sort: 'custom', + formatter: dateFormatter, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '采购部门', + field: 'purchaseDept', + sort: 'custom', + }, + { + label: '供应商编号', + field: 'supplierNumber', + sort: 'custom', + }, + { + label: '出厂日期', + field: 'productionDate', + sort: 'custom', + formatter: dateFormatter, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '购买价格', + field: 'purchasePrice', + sort: 'custom', + }, + { + label: '管理部门', + field: 'manageDept', + sort: 'custom', + }, + { + label: '单位', + field: 'unit', + sort: 'custom', + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + 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: '地点ID', + field: 'siteId', + sort: 'custom', + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/basic/fixedAssets/index.vue b/src/views/eam/basic/fixedAssets/index.vue new file mode 100644 index 0000000..9777979 --- /dev/null +++ b/src/views/eam/basic/fixedAssets/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts index c0dcfdb..151adbc 100644 --- a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts +++ b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts @@ -3,15 +3,14 @@ import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const DeviceAccountsRules = reactive({ - number: [required], + // number: [required], name: [required], - factoryAreaNumber: [required], - purchaseTime: [required], - deptId: [required], - purchaser: [required], - supplierNumber: [required], - siteId: [required], - concurrencyStamp: [required], + // factoryAreaNumber: [required], + // purchaseTime: [required], + // deptId: [required], + // purchaser: [required], + // supplierNumber: [required], + concurrencyStamp: [required] }) export const DeviceAccounts = useCrudSchemas(reactive([ @@ -20,17 +19,18 @@ export const DeviceAccounts = useCrudSchemas(reactive([ field: 'number', sort: 'custom', isSearch: true, + isForm: false, }, { label: '名称', field: 'name', sort: 'custom', - isSearch: true, + isSearch: true }, { label: '规格型号', field: 'specification', - sort: 'custom', + sort: 'custom' }, { label: '设备类型', @@ -39,12 +39,12 @@ export const DeviceAccounts = useCrudSchemas(reactive([ isSearch: true, form: { component: 'Select' - }, + } }, { label: '所属厂区编号', field: 'factoryAreaNumber', - sort: 'custom', + sort: 'custom' }, { label: '采购时间', @@ -57,30 +57,28 @@ export const DeviceAccounts = useCrudSchemas(reactive([ type: 'datetime', valueFormat: 'x' } - }, + } }, { label: '采购部门', field: 'deptId', sort: 'custom', form: { - component: 'InputNumber', - value: 0 - }, + component: 'Input', + } }, { label: '采购人', field: 'purchaser', sort: 'custom', form: { - component: 'InputNumber', - value: 0 - }, + component: 'Input', + } }, { label: '供应商编号', field: 'supplierNumber', - sort: 'custom', + sort: 'custom' }, { label: '出厂日期', @@ -93,39 +91,27 @@ export const DeviceAccounts = useCrudSchemas(reactive([ type: 'datetime', valueFormat: 'x' } - }, + } }, { label: '价格', field: 'purchasePrice', - sort: 'custom', + sort: 'custom' }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, - isForm: false, - }, - { - label: '地点ID', - field: 'siteId', - sort: 'custom', + isForm: false }, + { label: '是否可用', field: 'available', - sort: 'custom', - }, - { - label: '并发乐观锁', - field: 'concurrencyStamp', - sort: 'custom', - form: { - component: 'InputNumber', - value: 0 - }, + sort: 'custom' }, + { label: '操作', field: 'action', @@ -135,4 +121,4 @@ export const DeviceAccounts = useCrudSchemas(reactive([ fixed: 'right' } } -])) \ No newline at end of file +])) diff --git a/src/views/eam/device/deviceAccounts/index.vue b/src/views/eam/device/deviceAccounts/index.vue index 3596a65..5fbbaa7 100644 --- a/src/views/eam/device/deviceAccounts/index.vue +++ b/src/views/eam/device/deviceAccounts/index.vue @@ -41,16 +41,22 @@ + + @@ -60,12 +66,13 @@