Browse Source

各个记录代码生成

master_hella_20240701
ljlong_2630 6 months ago
parent
commit
386d8a950e
  1. 16
      src/api/eam/equipmentAccounts/index.ts
  2. 60
      src/api/eam/equipmentInspectionRecordDetail/index.ts
  3. 79
      src/api/eam/equipmentInspectionRecordMain/index.ts
  4. 65
      src/api/eam/equipmentMaintenanceRecordDetail/index.ts
  5. 74
      src/api/eam/equipmentMaintenanceRecordMain/index.ts
  6. 59
      src/api/eam/equipmentRepairRecordDetail/index.ts
  7. 85
      src/api/eam/equipmentRepairRecordMain/index.ts
  8. 73
      src/api/eam/equipmentReportRepairRequest/index.ts
  9. 62
      src/api/eam/equipmentSpotCheckRecordDetail/index.ts
  10. 79
      src/api/eam/equipmentSpotCheckRecordMain/index.ts
  11. 65
      src/api/eam/equipmentTransferRecord/index.ts
  12. 1
      src/components/SearchTable/src/SearchTable.vue
  13. 16
      src/views/eam/equipmentAccounts/index.vue
  14. 190
      src/views/eam/equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data.ts
  15. 244
      src/views/eam/equipmentInspectionRecordDetail/index.vue
  16. 432
      src/views/eam/equipmentInspectionRecordMain/equipmentInspectionRecordMain.data.ts
  17. 244
      src/views/eam/equipmentInspectionRecordMain/index.vue
  18. 233
      src/views/eam/equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data.ts
  19. 244
      src/views/eam/equipmentMaintenanceRecordDetail/index.vue
  20. 290
      src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts
  21. 244
      src/views/eam/equipmentMaintenanceRecordMain/index.vue
  22. 154
      src/views/eam/equipmentRepairRecordDetail/equipmentRepairRecordDetail.data.ts
  23. 244
      src/views/eam/equipmentRepairRecordDetail/index.vue
  24. 458
      src/views/eam/equipmentRepairRecordMain/equipmentRepairRecordMain.data.ts
  25. 244
      src/views/eam/equipmentRepairRecordMain/index.vue
  26. 282
      src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts
  27. 244
      src/views/eam/equipmentReportRepairRequest/index.vue
  28. 199
      src/views/eam/equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data.ts
  29. 244
      src/views/eam/equipmentSpotCheckRecordDetail/index.vue
  30. 428
      src/views/eam/equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data.ts
  31. 244
      src/views/eam/equipmentSpotCheckRecordMain/index.vue
  32. 207
      src/views/eam/equipmentTransferRecord/equipmentTransferRecord.data.ts
  33. 244
      src/views/eam/equipmentTransferRecord/index.vue

16
src/api/eam/equipmentAccounts/index.ts

@ -42,38 +42,38 @@ export const getEquipmentAccountsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-accounts/senior', data })
return await request.post({ url: '/eam/device/equipment-accounts/senior', data })
} else {
return await request.get({ url: `/eam/equipment-accounts/page`, params })
return await request.get({ url: `/eam/device/equipment-accounts/page`, params })
}
}
// 查询设备台账详情
export const getEquipmentAccounts = async (id: number) => {
return await request.get({ url: `/eam/equipment-accounts/get?id=` + id })
return await request.get({ url: `/eam/device/equipment-accounts/get?id=` + id })
}
// 新增设备台账
export const createEquipmentAccounts = async (data: EquipmentAccountsVO) => {
return await request.post({ url: `/eam/equipment-accounts/create`, data })
return await request.post({ url: `/eam/device/equipment-accounts/create`, data })
}
// 修改设备台账
export const updateEquipmentAccounts = async (data: EquipmentAccountsVO) => {
return await request.put({ url: `/eam/equipment-accounts/update`, data })
return await request.put({ url: `/eam/device/equipment-accounts/update`, data })
}
// 删除设备台账
export const deleteEquipmentAccounts = async (id: number) => {
return await request.delete({ url: `/eam/equipment-accounts/delete?id=` + id })
return await request.delete({ url: `/eam/device/equipment-accounts/delete?id=` + id })
}
// 导出设备台账 Excel
export const exportEquipmentAccounts = async (params) => {
return await request.download({ url: `/eam/equipment-accounts/export-excel`, params })
return await request.download({ url: `/eam/device/equipment-accounts/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-accounts/get-import-template' })
return request.download({ url: '/eam/device/equipment-accounts/get-import-template' })
}

60
src/api/eam/equipmentInspectionRecordDetail/index.ts

@ -0,0 +1,60 @@
import request from '@/config/axios'
export interface EquipmentInspectionRecordDetailVO {
id: number
number: string
masterId: number
completionTime: Date
uncompletedCause: string
result: string
name: string
content: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询巡检记录子列表
export const getEquipmentInspectionRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-inspection-record-detail/senior', data })
} else {
return await request.get({ url: `/eam/equipment-inspection-record-detail/page`, params })
}
}
// 查询巡检记录子详情
export const getEquipmentInspectionRecordDetail = async (id: number) => {
return await request.get({ url: `/eam/equipment-inspection-record-detail/get?id=` + id })
}
// 新增巡检记录子
export const createEquipmentInspectionRecordDetail = async (data: EquipmentInspectionRecordDetailVO) => {
return await request.post({ url: `/eam/equipment-inspection-record-detail/create`, data })
}
// 修改巡检记录子
export const updateEquipmentInspectionRecordDetail = async (data: EquipmentInspectionRecordDetailVO) => {
return await request.put({ url: `/eam/equipment-inspection-record-detail/update`, data })
}
// 删除巡检记录子
export const deleteEquipmentInspectionRecordDetail = async (id: number) => {
return await request.delete({ url: `/eam/equipment-inspection-record-detail/delete?id=` + id })
}
// 导出巡检记录子 Excel
export const exportEquipmentInspectionRecordDetail = async (params) => {
return await request.download({ url: `/eam/equipment-inspection-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-inspection-record-detail/get-import-template' })
}

79
src/api/eam/equipmentInspectionRecordMain/index.ts

@ -0,0 +1,79 @@
import request from '@/config/axios'
export interface EquipmentInspectionRecordMainVO {
id: number
number: string
describing: string
equipmentCode: string
type: string
isPictures: boolean
planNumber: string
planStartTime: Date
planEndTime: Date
startTime: Date
endTime: Date
classType: string
verifyer: number
verifyContent: string
verifyTime: Date
maintenancer: number
completionTime: Date
maintenanceTime: Date
status: string
autoOrder: string
autoPerform: string
autoVerify: string
directCreateRecord: string
faultType: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询巡检记录主列表
export const getEquipmentInspectionRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-inspection-record-main/senior', data })
} else {
return await request.get({ url: `/eam/equipment-inspection-record-main/page`, params })
}
}
// 查询巡检记录主详情
export const getEquipmentInspectionRecordMain = async (id: number) => {
return await request.get({ url: `/eam/equipment-inspection-record-main/get?id=` + id })
}
// 新增巡检记录主
export const createEquipmentInspectionRecordMain = async (data: EquipmentInspectionRecordMainVO) => {
return await request.post({ url: `/eam/equipment-inspection-record-main/create`, data })
}
// 修改巡检记录主
export const updateEquipmentInspectionRecordMain = async (data: EquipmentInspectionRecordMainVO) => {
return await request.put({ url: `/eam/equipment-inspection-record-main/update`, data })
}
// 删除巡检记录主
export const deleteEquipmentInspectionRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/equipment-inspection-record-main/delete?id=` + id })
}
// 导出巡检记录主 Excel
export const exportEquipmentInspectionRecordMain = async (params) => {
return await request.download({ url: `/eam/equipment-inspection-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-inspection-record-main/get-import-template' })
}

65
src/api/eam/equipmentMaintenanceRecordDetail/index.ts

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface EquipmentMaintenanceRecordDetailVO {
id: number
number: string
masterId: number
peoples: number
estimatedMinutes: number
actualMinutes: number
chargePeoples: string
completionTime: Date
uncompletedCause: string
result: string
name: string
content: string
equipmentParts: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询保养记录子列表
export const getEquipmentMaintenanceRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-maintenance-record-detail/senior', data })
} else {
return await request.get({ url: `/eam/equipment-maintenance-record-detail/page`, params })
}
}
// 查询保养记录子详情
export const getEquipmentMaintenanceRecordDetail = async (id: number) => {
return await request.get({ url: `/eam/equipment-maintenance-record-detail/get?id=` + id })
}
// 新增保养记录子
export const createEquipmentMaintenanceRecordDetail = async (data: EquipmentMaintenanceRecordDetailVO) => {
return await request.post({ url: `/eam/equipment-maintenance-record-detail/create`, data })
}
// 修改保养记录子
export const updateEquipmentMaintenanceRecordDetail = async (data: EquipmentMaintenanceRecordDetailVO) => {
return await request.put({ url: `/eam/equipment-maintenance-record-detail/update`, data })
}
// 删除保养记录子
export const deleteEquipmentMaintenanceRecordDetail = async (id: number) => {
return await request.delete({ url: `/eam/equipment-maintenance-record-detail/delete?id=` + id })
}
// 导出保养记录子 Excel
export const exportEquipmentMaintenanceRecordDetail = async (params) => {
return await request.download({ url: `/eam/equipment-maintenance-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-maintenance-record-detail/get-import-template' })
}

74
src/api/eam/equipmentMaintenanceRecordMain/index.ts

@ -0,0 +1,74 @@
import request from '@/config/axios'
export interface EquipmentMaintenanceRecordMainVO {
id: number
number: string
describing: string
equipmentCode: string
category: string
classes: string
planNumber: string
faultType: string
cycle: string
times: string
verifyer2: number
verifyContent2: string
verifyTime2: Date
maintenancer: number
maintenancePhone: string
completeResult: string
completionTime2: Date
maintenanceTime: Date
status: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询设备保养记录主列表
export const getEquipmentMaintenanceRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-maintenance-record-main/senior', data })
} else {
return await request.get({ url: `/eam/equipment-maintenance-record-main/page`, params })
}
}
// 查询设备保养记录主详情
export const getEquipmentMaintenanceRecordMain = async (id: number) => {
return await request.get({ url: `/eam/equipment-maintenance-record-main/get?id=` + id })
}
// 新增设备保养记录主
export const createEquipmentMaintenanceRecordMain = async (data: EquipmentMaintenanceRecordMainVO) => {
return await request.post({ url: `/eam/equipment-maintenance-record-main/create`, data })
}
// 修改设备保养记录主
export const updateEquipmentMaintenanceRecordMain = async (data: EquipmentMaintenanceRecordMainVO) => {
return await request.put({ url: `/eam/equipment-maintenance-record-main/update`, data })
}
// 删除设备保养记录主
export const deleteEquipmentMaintenanceRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/equipment-maintenance-record-main/delete?id=` + id })
}
// 导出设备保养记录主 Excel
export const exportEquipmentMaintenanceRecordMain = async (params) => {
return await request.download({ url: `/eam/equipment-maintenance-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-maintenance-record-main/get-import-template' })
}

59
src/api/eam/equipmentRepairRecordDetail/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface EquipmentRepairRecordDetailVO {
id: number
number: string
masterId: number
describing: string
faultCause: string
workOut: string
maintenances: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询设备维修记录子列表
export const getEquipmentRepairRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-repair-record-detail/senior', data })
} else {
return await request.get({ url: `/eam/equipment-repair-record-detail/page`, params })
}
}
// 查询设备维修记录子详情
export const getEquipmentRepairRecordDetail = async (id: number) => {
return await request.get({ url: `/eam/equipment-repair-record-detail/get?id=` + id })
}
// 新增设备维修记录子
export const createEquipmentRepairRecordDetail = async (data: EquipmentRepairRecordDetailVO) => {
return await request.post({ url: `/eam/equipment-repair-record-detail/create`, data })
}
// 修改设备维修记录子
export const updateEquipmentRepairRecordDetail = async (data: EquipmentRepairRecordDetailVO) => {
return await request.put({ url: `/eam/equipment-repair-record-detail/update`, data })
}
// 删除设备维修记录子
export const deleteEquipmentRepairRecordDetail = async (id: number) => {
return await request.delete({ url: `/eam/equipment-repair-record-detail/delete?id=` + id })
}
// 导出设备维修记录子 Excel
export const exportEquipmentRepairRecordDetail = async (params) => {
return await request.download({ url: `/eam/equipment-repair-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-repair-record-detail/get-import-template' })
}

85
src/api/eam/equipmentRepairRecordMain/index.ts

@ -0,0 +1,85 @@
import request from '@/config/axios'
export interface EquipmentRepairRecordMainVO {
id: number
number: string
type: string
repairNumber: string
sources: string
maintenanceDesc: string
urgency: string
level: string
equipmentCode: string
shutDown: boolean
startTime: Date
endTime: Date
totalMinutes: number
verifyer: number
verifyContent: string
verifyTime: Date
maintenancer: number
maintenancePhone: string
completeResult: string
completionTime: Date
maintenanceTime: Date
repairTime: Date
repairer: number
faultType: string
status: string
autoOrder: string
autoPerform: string
autoVerify: string
directCreateRecord: string
classType: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询设备维修记录主列表
export const getEquipmentRepairRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-repair-record-main/senior', data })
} else {
return await request.get({ url: `/eam/equipment-repair-record-main/page`, params })
}
}
// 查询设备维修记录主详情
export const getEquipmentRepairRecordMain = async (id: number) => {
return await request.get({ url: `/eam/equipment-repair-record-main/get?id=` + id })
}
// 新增设备维修记录主
export const createEquipmentRepairRecordMain = async (data: EquipmentRepairRecordMainVO) => {
return await request.post({ url: `/eam/equipment-repair-record-main/create`, data })
}
// 修改设备维修记录主
export const updateEquipmentRepairRecordMain = async (data: EquipmentRepairRecordMainVO) => {
return await request.put({ url: `/eam/equipment-repair-record-main/update`, data })
}
// 删除设备维修记录主
export const deleteEquipmentRepairRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/equipment-repair-record-main/delete?id=` + id })
}
// 导出设备维修记录主 Excel
export const exportEquipmentRepairRecordMain = async (params) => {
return await request.download({ url: `/eam/equipment-repair-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-repair-record-main/get-import-template' })
}

73
src/api/eam/equipmentReportRepairRequest/index.ts

@ -0,0 +1,73 @@
import request from '@/config/axios'
export interface EquipmentReportRepairRequestVO {
id: number
number: string
type: string
equipmentCode: string
urgency: string
faultType: string
describing: string
shutDown: boolean
images: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
repairmaner: number
repairPhone: string
status: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
autoVerify: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询设报修申请列表
export const getEquipmentReportRepairRequestPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-report-repair-request/senior', data })
} else {
return await request.get({ url: `/eam/equipment-report-repair-request/page`, params })
}
}
// 查询设报修申请详情
export const getEquipmentReportRepairRequest = async (id: number) => {
return await request.get({ url: `/eam/equipment-report-repair-request/get?id=` + id })
}
// 新增设报修申请
export const createEquipmentReportRepairRequest = async (data: EquipmentReportRepairRequestVO) => {
return await request.post({ url: `/eam/equipment-report-repair-request/create`, data })
}
// 修改设报修申请
export const updateEquipmentReportRepairRequest = async (data: EquipmentReportRepairRequestVO) => {
return await request.put({ url: `/eam/equipment-report-repair-request/update`, data })
}
// 删除设报修申请
export const deleteEquipmentReportRepairRequest = async (id: number) => {
return await request.delete({ url: `/eam/equipment-report-repair-request/delete?id=` + id })
}
// 导出设报修申请 Excel
export const exportEquipmentReportRepairRequest = async (params) => {
return await request.download({ url: `/eam/equipment-report-repair-request/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-report-repair-request/get-import-template' })
}

62
src/api/eam/equipmentSpotCheckRecordDetail/index.ts

@ -0,0 +1,62 @@
import request from '@/config/axios'
export interface EquipmentSpotCheckRecordDetailVO {
id: number
number: string
masterId: number
completionTime: Date
uncompletedCause: string
result: string
name: string
content: string
equipmentParts: string
methods: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询点检记录子列表
export const getEquipmentSpotCheckRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-spot-check-record-detail/senior', data })
} else {
return await request.get({ url: `/eam/equipment-spot-check-record-detail/page`, params })
}
}
// 查询点检记录子详情
export const getEquipmentSpotCheckRecordDetail = async (id: number) => {
return await request.get({ url: `/eam/equipment-spot-check-record-detail/get?id=` + id })
}
// 新增点检记录子
export const createEquipmentSpotCheckRecordDetail = async (data: EquipmentSpotCheckRecordDetailVO) => {
return await request.post({ url: `/eam/equipment-spot-check-record-detail/create`, data })
}
// 修改点检记录子
export const updateEquipmentSpotCheckRecordDetail = async (data: EquipmentSpotCheckRecordDetailVO) => {
return await request.put({ url: `/eam/equipment-spot-check-record-detail/update`, data })
}
// 删除点检记录子
export const deleteEquipmentSpotCheckRecordDetail = async (id: number) => {
return await request.delete({ url: `/eam/equipment-spot-check-record-detail/delete?id=` + id })
}
// 导出点检记录子 Excel
export const exportEquipmentSpotCheckRecordDetail = async (params) => {
return await request.download({ url: `/eam/equipment-spot-check-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-spot-check-record-detail/get-import-template' })
}

79
src/api/eam/equipmentSpotCheckRecordMain/index.ts

@ -0,0 +1,79 @@
import request from '@/config/axios'
export interface EquipmentSpotCheckRecordMainVO {
id: number
number: string
describing: string
equipmentCode: string
type: string
planNumber: string
planStartTime: Date
planEndTime: Date
startTime: Date
endTime: Date
faultType: string
verifyer: number
verifyContent: string
verifyTime: Date
maintenancer: number
completionTime: Date
maintenanceTime: Date
isPictures: boolean
status: string
autoOrder: string
autoPerform: string
autoVerify: string
directCreateRecord: string
classType: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询点检记录主列表
export const getEquipmentSpotCheckRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-spot-check-record-main/senior', data })
} else {
return await request.get({ url: `/eam/equipment-spot-check-record-main/page`, params })
}
}
// 查询点检记录主详情
export const getEquipmentSpotCheckRecordMain = async (id: number) => {
return await request.get({ url: `/eam/equipment-spot-check-record-main/get?id=` + id })
}
// 新增点检记录主
export const createEquipmentSpotCheckRecordMain = async (data: EquipmentSpotCheckRecordMainVO) => {
return await request.post({ url: `/eam/equipment-spot-check-record-main/create`, data })
}
// 修改点检记录主
export const updateEquipmentSpotCheckRecordMain = async (data: EquipmentSpotCheckRecordMainVO) => {
return await request.put({ url: `/eam/equipment-spot-check-record-main/update`, data })
}
// 删除点检记录主
export const deleteEquipmentSpotCheckRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/equipment-spot-check-record-main/delete?id=` + id })
}
// 导出点检记录主 Excel
export const exportEquipmentSpotCheckRecordMain = async (params) => {
return await request.download({ url: `/eam/equipment-spot-check-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-spot-check-record-main/get-import-template' })
}

65
src/api/eam/equipmentTransferRecord/index.ts

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface EquipmentTransferRecordVO {
id: number
equipmentCode: string
type: string
operationDate: Date
operationer: string
beforeFactoryAreaCode: string
beforeLocation: string
beforeWorkshopCode: string
beforeWorkshopSectionCode: string
nowLocation: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询设备移动记录列表
export const getEquipmentTransferRecordPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-transfer-record/senior', data })
} else {
return await request.get({ url: `/eam/equipment-transfer-record/page`, params })
}
}
// 查询设备移动记录详情
export const getEquipmentTransferRecord = async (id: number) => {
return await request.get({ url: `/eam/equipment-transfer-record/get?id=` + id })
}
// 新增设备移动记录
export const createEquipmentTransferRecord = async (data: EquipmentTransferRecordVO) => {
return await request.post({ url: `/eam/equipment-transfer-record/create`, data })
}
// 修改设备移动记录
export const updateEquipmentTransferRecord = async (data: EquipmentTransferRecordVO) => {
return await request.put({ url: `/eam/equipment-transfer-record/update`, data })
}
// 删除设备移动记录
export const deleteEquipmentTransferRecord = async (id: number) => {
return await request.delete({ url: `/eam/equipment-transfer-record/delete?id=` + id })
}
// 导出设备移动记录 Excel
export const exportEquipmentTransferRecord = async (params) => {
return await request.download({ url: `/eam/equipment-transfer-record/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-transfer-record/get-import-template' })
}

1
src/components/SearchTable/src/SearchTable.vue

@ -93,7 +93,6 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
HeadButttondata.value = [
defaultButtons.defaultFilterBtn(null), //
]
debugger
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField

16
src/views/eam/equipmentAccounts/index.vue

@ -261,6 +261,7 @@ const searchSparePartTableRef = ref()
const searchTableSelections = ref([])
const searchTableSparePartSelections = ref([])
const syncData = async (row) => {
searchTableSparePartSelections.value = []
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code }).then(async (res) => {
await EquipmentMainPartApi.getEquipmentMainPartNoPage({}).then(response => {
searchTableSelections.value = response.filter(element => {
@ -276,7 +277,8 @@ const syncData = async (row) => {
});
};
const syncSparePartData = async (row) => {
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentCode: row.code }).then(async (res) => {
searchTableSparePartSelections.value = []
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code }).then(async (res) => {
await SparePartApi.getSparePartNoPage({}).then(response => {
searchTableSparePartSelections.value = response.filter(element => {
let flag = false;
@ -341,6 +343,18 @@ const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, r
})
}
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => {
const equipmentToolSparePartRelList = val.map((element) => ({
sparePartCode: element.code,
equipmentToolCode: rowRef.code,
type: 'DEVICE'
}))
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(res => {
message.success(t('common.createSuccess'))
getList()
})
}
/** 初始化 **/
onMounted(async () => {
getList()

190
src/views/eam/equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data.ts

@ -0,0 +1,190 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentInspectionRecordDetailRules = reactive({
number: [required],
masterId: [required],
name: [required],
concurrencyStamp: [required]
})
export const EquipmentInspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '巡检工单号',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '主表',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '完成时间',
field: 'completionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '未完成原因',
field: 'uncompletedCause',
sort: 'custom',
isSearch: true
},
{
label: '结果枚举',
field: 'result',
sort: 'custom',
dictType: DICT_TYPE.IS_COMPLETED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '名称来源于巡检项',
field: 'name',
sort: 'custom',
isSearch: true
},
{
label: '巡检内容来源于巡检项',
field: 'content',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentInspectionRecordDetail/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentInspectionRecordDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentInspectionRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentInspectionRecordDetailRules"
:formAllSchemas="EquipmentInspectionRecordDetail.allSchemas"
:apiUpdate="EquipmentInspectionRecordDetailApi.updateEquipmentInspectionRecordDetail"
:apiCreate="EquipmentInspectionRecordDetailApi.createEquipmentInspectionRecordDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentInspectionRecordDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-inspection-record-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentInspectionRecordDetail,EquipmentInspectionRecordDetailRules } from './equipmentInspectionRecordDetail.data'
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentInspectionRecordDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentInspectionRecordDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentInspectionRecordDetailApi.getEquipmentInspectionRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentInspectionRecordDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentInspectionRecordDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentInspectionRecordDetail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentInspectionRecordDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentInspectionRecordDetail:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentInspectionRecordDetail.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentInspectionRecordDetailApi.createEquipmentInspectionRecordDetail(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentInspectionRecordDetailApi.updateEquipmentInspectionRecordDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentInspectionRecordDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentInspectionRecordDetailApi.deleteEquipmentInspectionRecordDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentInspectionRecordDetailApi.exportEquipmentInspectionRecordDetail(tableObject.params)
download.excel(data, '巡检记录子.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '巡检记录子导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentInspectionRecordDetailApi.importTemplate()
})
</script>

432
src/views/eam/equipmentInspectionRecordMain/equipmentInspectionRecordMain.data.ts

@ -0,0 +1,432 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentInspectionRecordMainRules = reactive({
number: [required],
equipmentCode: [required],
planNumber: [required],
planStartTime: [required],
planEndTime: [required],
startTime: [required],
endTime: [required],
concurrencyStamp: [required]
})
export const EquipmentInspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '巡检工单编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'describing',
sort: 'custom',
isSearch: true
},
{
label: '设备编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
},
{
label: '类型设备或工装',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '是否拍照',
field: 'isPictures',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '巡检计划工单号',
field: 'planNumber',
sort: 'custom',
isSearch: true
},
{
label: '计划开始时间',
field: 'planStartTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '计划结束时间',
field: 'planEndTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '巡检开始时间',
field: 'startTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '巡检结束时间',
field: 'endTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '班组',
field: 'classType',
sort: 'custom',
dictType: DICT_TYPE.BASIC_TEAM_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '验证内容',
field: 'verifyContent',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '验证时间',
field: 'verifyTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '巡检人',
field: 'maintenancer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '完成时间',
field: 'completionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '保养时间',
field: 'maintenanceTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '流程状态枚举0:待派工1:已逾期2:已退单3:待接单4:待执行5:执行中6:待验证7:已完成8:已作废',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '自动接单',
field: 'autoOrder',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '自动执行',
field: 'autoPerform',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '自动验证',
field: 'autoVerify',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: true
},
{
label: '故障类型枚举',
field: 'faultType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentInspectionRecordMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentInspectionRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentInspectionRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentInspectionRecordMainRules"
:formAllSchemas="EquipmentInspectionRecordMain.allSchemas"
:apiUpdate="EquipmentInspectionRecordMainApi.updateEquipmentInspectionRecordMain"
:apiCreate="EquipmentInspectionRecordMainApi.createEquipmentInspectionRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentInspectionRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-inspection-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentInspectionRecordMain,EquipmentInspectionRecordMainRules } from './equipmentInspectionRecordMain.data'
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentInspectionRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentInspectionRecordMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentInspectionRecordMainApi.getEquipmentInspectionRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentInspectionRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentInspectionRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentInspectionRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentInspectionRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentInspectionRecordMain:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentInspectionRecordMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentInspectionRecordMainApi.createEquipmentInspectionRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentInspectionRecordMainApi.updateEquipmentInspectionRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentInspectionRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentInspectionRecordMainApi.deleteEquipmentInspectionRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentInspectionRecordMainApi.exportEquipmentInspectionRecordMain(tableObject.params)
download.excel(data, '巡检记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '巡检记录主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentInspectionRecordMainApi.importTemplate()
})
</script>

233
src/views/eam/equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data.ts

@ -0,0 +1,233 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentMaintenanceRecordDetailRules = reactive({
number: [required],
masterId: [required],
name: [required],
equipmentParts: [required],
concurrencyStamp: [required]
})
export const EquipmentMaintenanceRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '保养工单号',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '主表',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '人数',
field: 'peoples',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '预计分钟',
field: 'estimatedMinutes',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '实际分钟',
field: 'actualMinutes',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '责任人多选',
field: 'chargePeoples',
sort: 'custom',
isSearch: true
},
{
label: '完成时间',
field: 'completionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '未完成原因',
field: 'uncompletedCause',
sort: 'custom',
isSearch: true
},
{
label: '结果枚举',
field: 'result',
sort: 'custom',
dictType: DICT_TYPE.IS_COMPLETED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '保养名称',
field: 'name',
sort: 'custom',
isSearch: true
},
{
label: '保养要求',
field: 'content',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '保养部位',
field: 'equipmentParts',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentMaintenanceRecordDetail/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentMaintenanceRecordDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentMaintenanceRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentMaintenanceRecordDetailRules"
:formAllSchemas="EquipmentMaintenanceRecordDetail.allSchemas"
:apiUpdate="EquipmentMaintenanceRecordDetailApi.updateEquipmentMaintenanceRecordDetail"
:apiCreate="EquipmentMaintenanceRecordDetailApi.createEquipmentMaintenanceRecordDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentMaintenanceRecordDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-maintenance-record-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from './equipmentMaintenanceRecordDetail.data'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentMaintenanceRecordDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentMaintenanceRecordDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentMaintenanceRecordDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentMaintenanceRecordDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentMaintenanceRecordDetail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentMaintenanceRecordDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentMaintenanceRecordDetail:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentMaintenanceRecordDetail.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentMaintenanceRecordDetailApi.createEquipmentMaintenanceRecordDetail(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentMaintenanceRecordDetailApi.updateEquipmentMaintenanceRecordDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentMaintenanceRecordDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentMaintenanceRecordDetailApi.deleteEquipmentMaintenanceRecordDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentMaintenanceRecordDetailApi.exportEquipmentMaintenanceRecordDetail(tableObject.params)
download.excel(data, '保养记录子.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '保养记录子导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentMaintenanceRecordDetailApi.importTemplate()
})
</script>

290
src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts

@ -0,0 +1,290 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentMaintenanceRecordMainRules = reactive({
number: [required],
equipmentCode: [required],
planNumber: [required],
status: [required],
factoryAreaCode: [required],
concurrencyStamp: [required]
})
export const EquipmentMaintenanceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '保养工单编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'describing',
sort: 'custom',
isSearch: true
},
{
label: '设备编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
},
{
label: '设备类别',
field: 'category',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '班次枚举',
field: 'classes',
sort: 'custom',
dictType: DICT_TYPE.SHIFT_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '保养计划工单号',
field: 'planNumber',
sort: 'custom',
isSearch: true
},
{
label: '故障类型枚举',
field: 'faultType',
sort: 'custom',
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '保养周期',
field: 'cycle',
sort: 'custom',
dictType: DICT_TYPE.MAINTENANCE_CYCLE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '保养次数',
field: 'times',
sort: 'custom',
isSearch: true
},
{
label: '验证人',
field: 'verifyer2',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '验证内容',
field: 'verifyContent2',
sort: 'custom',
isSearch: true
},
{
label: '验证时间',
field: 'verifyTime2',
sort: 'custom',
isSearch: true
},
{
label: '保养人',
field: 'maintenancer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '保养人联系电话',
field: 'maintenancePhone',
sort: 'custom',
isSearch: true
},
{
label: '结果枚举临时措施、完成',
field: 'completeResult',
sort: 'custom',
isSearch: true
},
{
label: '完成时间',
field: 'completionTime2',
sort: 'custom',
isSearch: true
},
{
label: '保养时间',
field: 'maintenanceTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '流程状态枚举',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentMaintenanceRecordMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentMaintenanceRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentMaintenanceRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentMaintenanceRecordMainRules"
:formAllSchemas="EquipmentMaintenanceRecordMain.allSchemas"
:apiUpdate="EquipmentMaintenanceRecordMainApi.updateEquipmentMaintenanceRecordMain"
:apiCreate="EquipmentMaintenanceRecordMainApi.createEquipmentMaintenanceRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentMaintenanceRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-maintenance-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from './equipmentMaintenanceRecordMain.data'
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentMaintenanceRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentMaintenanceRecordMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentMaintenanceRecordMainApi.getEquipmentMaintenanceRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentMaintenanceRecordMain:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentMaintenanceRecordMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentMaintenanceRecordMainApi.createEquipmentMaintenanceRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentMaintenanceRecordMainApi.updateEquipmentMaintenanceRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentMaintenanceRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentMaintenanceRecordMainApi.deleteEquipmentMaintenanceRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentMaintenanceRecordMainApi.exportEquipmentMaintenanceRecordMain(tableObject.params)
download.excel(data, '设备保养记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设备保养记录主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentMaintenanceRecordMainApi.importTemplate()
})
</script>

154
src/views/eam/equipmentRepairRecordDetail/equipmentRepairRecordDetail.data.ts

@ -0,0 +1,154 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentRepairRecordDetailRules = reactive({
number: [required],
concurrencyStamp: [required]
})
export const EquipmentRepairRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '维修工单号',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '主表',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '故障描述',
field: 'describing',
sort: 'custom',
isSearch: true
},
{
label: '故障真因',
field: 'faultCause',
sort: 'custom',
isSearch: true
},
{
label: '解决措施',
field: 'workOut',
sort: 'custom',
isSearch: true
},
{
label: '维修人员字符串多个',
field: 'maintenances',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentRepairRecordDetail/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentRepairRecordDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentRepairRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentRepairRecordDetailRules"
:formAllSchemas="EquipmentRepairRecordDetail.allSchemas"
:apiUpdate="EquipmentRepairRecordDetailApi.updateEquipmentRepairRecordDetail"
:apiCreate="EquipmentRepairRecordDetailApi.createEquipmentRepairRecordDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentRepairRecordDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-repair-record-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from './equipmentRepairRecordDetail.data'
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentRepairRecordDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentRepairRecordDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentRepairRecordDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentRepairRecordDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentRepairRecordDetail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentRepairRecordDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentRepairRecordDetail:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentRepairRecordDetail.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentRepairRecordDetailApi.createEquipmentRepairRecordDetail(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentRepairRecordDetailApi.updateEquipmentRepairRecordDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairRecordDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentRepairRecordDetailApi.deleteEquipmentRepairRecordDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentRepairRecordDetailApi.exportEquipmentRepairRecordDetail(tableObject.params)
download.excel(data, '设备维修记录子.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设备维修记录子导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentRepairRecordDetailApi.importTemplate()
})
</script>

458
src/views/eam/equipmentRepairRecordMain/equipmentRepairRecordMain.data.ts

@ -0,0 +1,458 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentRepairRecordMainRules = reactive({
number: [required],
type: [required],
sources: [required],
urgency: [required],
level: [required],
equipmentCode: [required],
totalMinutes: [required],
faultType: [required],
concurrencyStamp: [required]
})
export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '维修编号',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '设备或工装字典',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '报修工单申请号',
field: 'repairNumber',
sort: 'custom',
isSearch: true
},
{
label: '来源字典0:报修工单1:临时工单',
field: 'sources',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '维修描述',
field: 'maintenanceDesc',
sort: 'custom',
isSearch: true
},
{
label: '紧急程度字典0:紧急故障1:重要故障2:一般故障',
field: 'urgency',
sort: 'custom',
dictType: DICT_TYPE.REPAIR_DEGREE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '维修级别0:大修1:中修2:小修',
field: 'level',
sort: 'custom',
dictType: DICT_TYPE.REPAIR_LEVEL,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '设备编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
},
{
label: '是否停机1不停机0停机',
field: 'shutDown',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '维修开始时间手输',
field: 'startTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '维修结束时间手输',
field: 'endTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '维修时间自动计算分钟',
field: 'totalMinutes',
sort: 'custom',
isSearch: true
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '验证内容',
field: 'verifyContent',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '验证时间',
field: 'verifyTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '执行人',
field: 'maintenancer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '维修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
isSearch: true
},
{
label: '结果枚举临时措施、完成',
field: 'completeResult',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '完成时间',
field: 'completionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '执行时间',
field: 'maintenanceTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '报修时间',
field: 'repairTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '报修人',
field: 'repairer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '故障类型关联基础数据',
field: 'faultType',
sort: 'custom',
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '流程状态枚举0:待派工1:已逾期2:已退单3:待接单4:待执行5:执行中6:待验证7:已完成8:已作废',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '自动接单',
field: 'autoOrder',
sort: 'custom',
isSearch: true
},
{
label: '自动执行',
field: 'autoPerform',
sort: 'custom',
isSearch: true
},
{
label: '自动验证',
field: 'autoVerify',
sort: 'custom',
isSearch: true
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: true
},
{
label: '班组类型',
field: 'classType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
},
{
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: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentRepairRecordMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentRepairRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentRepairRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentRepairRecordMainRules"
:formAllSchemas="EquipmentRepairRecordMain.allSchemas"
:apiUpdate="EquipmentRepairRecordMainApi.updateEquipmentRepairRecordMain"
:apiCreate="EquipmentRepairRecordMainApi.createEquipmentRepairRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentRepairRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-repair-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from './equipmentRepairRecordMain.data'
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentRepairRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentRepairRecordMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentRepairRecordMainApi.getEquipmentRepairRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentRepairRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentRepairRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentRepairRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentRepairRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentRepairRecordMain:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentRepairRecordMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentRepairRecordMainApi.createEquipmentRepairRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentRepairRecordMainApi.updateEquipmentRepairRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentRepairRecordMainApi.deleteEquipmentRepairRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentRepairRecordMainApi.exportEquipmentRepairRecordMain(tableObject.params)
download.excel(data, '设备维修记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设备维修记录主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentRepairRecordMainApi.importTemplate()
})
</script>

282
src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts

@ -0,0 +1,282 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentReportRepairRequestRules = reactive({
number: [required],
type: [required],
equipmentCode: [required],
urgency: [required],
repairmaner: [required],
status: [required],
concurrencyStamp: [required]
})
export const EquipmentReportRepairRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '设备或工装字典',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '设备或工装编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
},
{
label: '紧急程度字典0:紧急故障1:重要故障2:一般故障',
field: 'urgency',
sort: 'custom',
dictType: DICT_TYPE.FAILURE_DEGREE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '故障类型枚举',
field: 'faultType',
sort: 'custom',
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '故障描述',
field: 'describing',
sort: 'custom',
isSearch: true
},
{
label: '是否停机1不停机0停机',
field: 'shutDown',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '报修图片最多三张',
field: 'images',
sort: 'custom',
isSearch: true
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
},
{
label: '报修人',
field: 'repairmaner',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '报修人联系电话',
field: 'repairPhone',
sort: 'custom',
isSearch: true
},
{
label: '报修状态0:待审核1:已撤回2:审核中3:已通过4:已驳回5:已创建6:已确认',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '审核时间',
field: 'approveTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '自动审核',
field: 'autoExamine',
sort: 'custom',
isSearch: true
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: true
},
{
label: '自动确认',
field: 'autoVerify',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentReportRepairRequest/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentReportRepairRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentReportRepairRequest.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentReportRepairRequestRules"
:formAllSchemas="EquipmentReportRepairRequest.allSchemas"
:apiUpdate="EquipmentReportRepairRequestApi.updateEquipmentReportRepairRequest"
:apiCreate="EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentReportRepairRequest.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-report-repair-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from './equipmentReportRepairRequest.data'
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentReportRepairRequest' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentReportRepairRequest.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentReportRepairRequest:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentReportRepairRequest:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentReportRepairRequest:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentReportRepairRequest:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentReportRepairRequest.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentReportRepairRequestApi.updateEquipmentReportRepairRequest(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentReportRepairRequest')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentReportRepairRequestApi.deleteEquipmentReportRepairRequest(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentReportRepairRequestApi.exportEquipmentReportRepairRequest(tableObject.params)
download.excel(data, '设报修申请.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设报修申请导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentReportRepairRequestApi.importTemplate()
})
</script>

199
src/views/eam/equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data.ts

@ -0,0 +1,199 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentSpotCheckRecordDetailRules = reactive({
number: [required],
masterId: [required],
name: [required],
concurrencyStamp: [required]
})
export const EquipmentSpotCheckRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '点检工单号',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '主表',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '完成时间',
field: 'completionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '未完成原因',
field: 'uncompletedCause',
sort: 'custom',
isSearch: true
},
{
label: '结果枚举',
field: 'result',
sort: 'custom',
dictType: DICT_TYPE.IS_COMPLETED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '名称自动带出',
field: 'name',
sort: 'custom',
isSearch: true
},
{
label: '点检内容自动带出',
field: 'content',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '点检部位自动带出',
field: 'equipmentParts',
sort: 'custom',
isSearch: true
},
{
label: '点检方法自动带出',
field: 'methods',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentSpotCheckRecordDetail/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentSpotCheckRecordDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentSpotCheckRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentSpotCheckRecordDetailRules"
:formAllSchemas="EquipmentSpotCheckRecordDetail.allSchemas"
:apiUpdate="EquipmentSpotCheckRecordDetailApi.updateEquipmentSpotCheckRecordDetail"
:apiCreate="EquipmentSpotCheckRecordDetailApi.createEquipmentSpotCheckRecordDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentSpotCheckRecordDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-spot-check-record-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentSpotCheckRecordDetail,EquipmentSpotCheckRecordDetailRules } from './equipmentSpotCheckRecordDetail.data'
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentSpotCheckRecordDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentSpotCheckRecordDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentSpotCheckRecordDetailApi.getEquipmentSpotCheckRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentSpotCheckRecordDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentSpotCheckRecordDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentSpotCheckRecordDetail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentSpotCheckRecordDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentSpotCheckRecordDetail:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentSpotCheckRecordDetail.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentSpotCheckRecordDetailApi.createEquipmentSpotCheckRecordDetail(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentSpotCheckRecordDetailApi.updateEquipmentSpotCheckRecordDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentSpotCheckRecordDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentSpotCheckRecordDetailApi.deleteEquipmentSpotCheckRecordDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentSpotCheckRecordDetailApi.exportEquipmentSpotCheckRecordDetail(tableObject.params)
download.excel(data, '点检记录子.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '点检记录子导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentSpotCheckRecordDetailApi.importTemplate()
})
</script>

428
src/views/eam/equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data.ts

@ -0,0 +1,428 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentSpotCheckRecordMainRules = reactive({
number: [required],
equipmentCode: [required],
planNumber: [required],
planStartTime: [required],
planEndTime: [required],
startTime: [required],
endTime: [required],
concurrencyStamp: [required]
})
export const EquipmentSpotCheckRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '点检编号',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'describing',
sort: 'custom',
isSearch: true
},
{
label: '设备工装编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
},
{
label: '类型设备或工装',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '计划工单号',
field: 'planNumber',
sort: 'custom',
isSearch: true
},
{
label: '计划开始时间',
field: 'planStartTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '计划结束时间',
field: 'planEndTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '点检开始时间',
field: 'startTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '点检结束时间',
field: 'endTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '故障类型枚举',
field: 'faultType',
sort: 'custom',
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '验证内容',
field: 'verifyContent',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '验证时间',
field: 'verifyTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '点检人',
field: 'maintenancer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '完成时间',
field: 'completionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '点检时间',
field: 'maintenanceTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '是否拍照',
field: 'isPictures',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '流程状态枚举0:待派工1:已逾期2:已退单3:待接单4:待执行5:执行中6:待验证7:已完成8:已作废',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '自动接单',
field: 'autoOrder',
sort: 'custom',
isSearch: true
},
{
label: '自动执行',
field: 'autoPerform',
sort: 'custom',
isSearch: true
},
{
label: '自动验证',
field: 'autoVerify',
sort: 'custom',
isSearch: true
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: true
},
{
label: '班组类型',
field: 'classType',
sort: 'custom',
dictType: DICT_TYPE.BASIC_TEAM_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentSpotCheckRecordMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentSpotCheckRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentSpotCheckRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentSpotCheckRecordMainRules"
:formAllSchemas="EquipmentSpotCheckRecordMain.allSchemas"
:apiUpdate="EquipmentSpotCheckRecordMainApi.updateEquipmentSpotCheckRecordMain"
:apiCreate="EquipmentSpotCheckRecordMainApi.createEquipmentSpotCheckRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentSpotCheckRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-spot-check-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentSpotCheckRecordMain,EquipmentSpotCheckRecordMainRules } from './equipmentSpotCheckRecordMain.data'
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentSpotCheckRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentSpotCheckRecordMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentSpotCheckRecordMainApi.getEquipmentSpotCheckRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentSpotCheckRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentSpotCheckRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentSpotCheckRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentSpotCheckRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentSpotCheckRecordMain:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentSpotCheckRecordMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentSpotCheckRecordMainApi.createEquipmentSpotCheckRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentSpotCheckRecordMainApi.updateEquipmentSpotCheckRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentSpotCheckRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentSpotCheckRecordMainApi.deleteEquipmentSpotCheckRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentSpotCheckRecordMainApi.exportEquipmentSpotCheckRecordMain(tableObject.params)
download.excel(data, '点检记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '点检记录主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentSpotCheckRecordMainApi.importTemplate()
})
</script>

207
src/views/eam/equipmentTransferRecord/equipmentTransferRecord.data.ts

@ -0,0 +1,207 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentTransferRecordRules = reactive({
equipmentCode: [required],
concurrencyStamp: [required]
})
export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '设备编码',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
},
{
label: '设备类型枚举',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '操作日期',
field: 'operationDate',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '操作人',
field: 'operationer',
sort: 'custom',
isSearch: true
},
{
label: '原所属厂区编号',
field: 'beforeFactoryAreaCode',
sort: 'custom',
isSearch: true
},
{
label: '原地点',
field: 'beforeLocation',
sort: 'custom',
isSearch: true
},
{
label: '原车间编号',
field: 'beforeWorkshopCode',
sort: 'custom',
isSearch: true
},
{
label: '原工段编号',
field: 'beforeWorkshopSectionCode',
sort: 'custom',
isSearch: true
},
{
label: '现地点',
field: 'nowLocation',
sort: 'custom',
isSearch: true
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
},
{
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: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentTransferRecord/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentTransferRecord.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentTransferRecord.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentTransferRecordRules"
:formAllSchemas="EquipmentTransferRecord.allSchemas"
:apiUpdate="EquipmentTransferRecordApi.updateEquipmentTransferRecord"
:apiCreate="EquipmentTransferRecordApi.createEquipmentTransferRecord"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentTransferRecord.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-transfer-record/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentTransferRecord,EquipmentTransferRecordRules } from './equipmentTransferRecord.data'
import * as EquipmentTransferRecordApi from '@/api/eam/equipmentTransferRecord'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EquipmentTransferRecord' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentTransferRecord.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EquipmentTransferRecordApi.getEquipmentTransferRecordPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentTransferRecord:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentTransferRecord:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentTransferRecord:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentTransferRecord:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentTransferRecord:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentTransferRecord.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentTransferRecordApi.createEquipmentTransferRecord(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentTransferRecordApi.updateEquipmentTransferRecord(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentTransferRecord')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentTransferRecordApi.deleteEquipmentTransferRecord(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EquipmentTransferRecordApi.exportEquipmentTransferRecord(tableObject.params)
download.excel(data, '设备移动记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设备移动记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentTransferRecordApi.importTemplate()
})
</script>
Loading…
Cancel
Save