Browse Source

设备模具代码生成

master
songguoqiang 10 months ago
parent
commit
0d02be8706
  1. 59
      src/api/eam/device/deviceAccounts/index.ts
  2. 59
      src/api/eam/device/deviceAllot/index.ts
  3. 57
      src/api/eam/device/deviceInspectionMain/index.ts
  4. 61
      src/api/eam/device/deviceMaintainOrderMain/index.ts
  5. 54
      src/api/eam/device/deviceMaintainPlan/index.ts
  6. 57
      src/api/eam/device/deviceMaintenanceMain/index.ts
  7. 56
      src/api/eam/device/deviceRepair/index.ts
  8. 55
      src/api/eam/device/deviceSpotInspectionRecordMain/index.ts
  9. 62
      src/api/eam/mold/moldAccounts/index.ts
  10. 57
      src/api/eam/mold/moldInspectionMain/index.ts
  11. 61
      src/api/eam/mold/moldMaintainOrderMain/index.ts
  12. 54
      src/api/eam/mold/moldMaintainPlan/index.ts
  13. 57
      src/api/eam/mold/moldMaintenanceMain/index.ts
  14. 56
      src/api/eam/mold/moldRepair/index.ts
  15. 138
      src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
  16. 231
      src/views/eam/device/deviceAccounts/index.vue
  17. 138
      src/views/eam/device/deviceAllot/deviceAllot.data.ts
  18. 231
      src/views/eam/device/deviceAllot/index.vue
  19. 110
      src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts
  20. 244
      src/views/eam/device/deviceInspectionMain/index.vue
  21. 177
      src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts
  22. 244
      src/views/eam/device/deviceMaintainOrderMain/index.vue
  23. 92
      src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts
  24. 244
      src/views/eam/device/deviceMaintainPlan/index.vue
  25. 111
      src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts
  26. 244
      src/views/eam/device/deviceMaintenanceMain/index.vue
  27. 105
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  28. 244
      src/views/eam/device/deviceRepair/index.vue
  29. 98
      src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
  30. 244
      src/views/eam/device/deviceSpotInspectionRecordMain/index.vue
  31. 244
      src/views/eam/mold/moldAccounts/index.vue
  32. 160
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts
  33. 244
      src/views/eam/mold/moldInspectionMain/index.vue
  34. 110
      src/views/eam/mold/moldInspectionMain/moldInspectionMain.data.ts
  35. 244
      src/views/eam/mold/moldMaintainOrderMain/index.vue
  36. 177
      src/views/eam/mold/moldMaintainOrderMain/moldMaintainOrderMain.data.ts
  37. 244
      src/views/eam/mold/moldMaintainPlan/index.vue
  38. 92
      src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts
  39. 244
      src/views/eam/mold/moldMaintenanceMain/index.vue
  40. 111
      src/views/eam/mold/moldMaintenanceMain/moldMaintenanceMain.data.ts
  41. 244
      src/views/eam/mold/moldRepair/index.vue
  42. 105
      src/views/eam/mold/moldRepair/moldRepair.data.ts

59
src/api/eam/device/deviceAccounts/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface DeviceAccountsVO {
number: string
name: string
specification: string
type: string
factoryAreaNumber: string
purchaseTime: Date
deptId: number
purchaser: number
supplierNumber: string
productionDate: Date
purchasePrice: number
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件台账列表
export const getDeviceAccountsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-accounts/senior', data })
} else {
return await request.get({ url: `/eam/device-accounts/page`, params })
}
}
// 查询备件台账详情
export const getDeviceAccounts = async (id: number) => {
return await request.get({ url: `/eam/device-accounts/get?id=` + id })
}
// 新增备件台账
export const createDeviceAccounts = async (data: DeviceAccountsVO) => {
return await request.post({ url: `/eam/device-accounts/create`, data })
}
// 修改备件台账
export const updateDeviceAccounts = async (data: DeviceAccountsVO) => {
return await request.put({ url: `/eam/device-accounts/update`, data })
}
// 删除备件台账
export const deleteDeviceAccounts = async (id: number) => {
return await request.delete({ url: `/eam/device-accounts/delete?id=` + id })
}
// 导出备件台账 Excel
export const exportDeviceAccounts = async (params) => {
return await request.download({ url: `/eam/device-accounts/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-accounts/get-import-template' })
}

59
src/api/eam/device/deviceAllot/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface DeviceAccountsVO {
number: string
name: string
specification: string
type: string
factoryAreaNumber: string
purchaseTime: Date
deptId: number
purchaser: number
supplierNumber: string
productionDate: Date
purchasePrice: number
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件台账列表
export const getDeviceAccountsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-accounts/senior', data })
} else {
return await request.get({ url: `/eam/device-accounts/page`, params })
}
}
// 查询备件台账详情
export const getDeviceAccounts = async (id: number) => {
return await request.get({ url: `/eam/device-accounts/get?id=` + id })
}
// 新增备件台账
export const createDeviceAccounts = async (data: DeviceAccountsVO) => {
return await request.post({ url: `/eam/device-accounts/create`, data })
}
// 修改备件台账
export const updateDeviceAccounts = async (data: DeviceAccountsVO) => {
return await request.put({ url: `/eam/device-accounts/update`, data })
}
// 删除备件台账
export const deleteDeviceAccounts = async (id: number) => {
return await request.delete({ url: `/eam/device-accounts/delete?id=` + id })
}
// 导出备件台账 Excel
export const exportDeviceAccounts = async (params) => {
return await request.download({ url: `/eam/device-accounts/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-accounts/get-import-template' })
}

57
src/api/eam/device/deviceInspectionMain/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface DeviceInspectionMainVO {
number: string
maintenanceNumber: string
deviceNumber: string
factoryAreaNumber: string
describe: string
maintenance: number
maintenancePhone: string
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询检修工单主列表
export const getDeviceInspectionMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-inspection-main/senior', data })
} else {
return await request.get({ url: `/eam/device-inspection-main/page`, params })
}
}
// 查询检修工单主详情
export const getDeviceInspectionMain = async (id: number) => {
return await request.get({ url: `/eam/device-inspection-main/get?id=` + id })
}
// 新增检修工单主
export const createDeviceInspectionMain = async (data: DeviceInspectionMainVO) => {
return await request.post({ url: `/eam/device-inspection-main/create`, data })
}
// 修改检修工单主
export const updateDeviceInspectionMain = async (data: DeviceInspectionMainVO) => {
return await request.put({ url: `/eam/device-inspection-main/update`, data })
}
// 删除检修工单主
export const deleteDeviceInspectionMain = async (id: number) => {
return await request.delete({ url: `/eam/device-inspection-main/delete?id=` + id })
}
// 导出检修工单主 Excel
export const exportDeviceInspectionMain = async (params) => {
return await request.download({ url: `/eam/device-inspection-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-inspection-main/get-import-template' })
}

61
src/api/eam/device/deviceMaintainOrderMain/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface deviceMaintainOrderMainVO {
number: string
name: string
planNumber: string
deviceNumber: string
factoryAreaNumber: string
engineer: number
receiveTime: Date
assignTime: Date
worker: number
finishedTime: Date
verifyTime: Date
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询保养工单主列表
export const getdeviceMaintainOrderMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-maintain-order-main/senior', data })
} else {
return await request.get({ url: `/eam/device-maintain-order-main/page`, params })
}
}
// 查询保养工单主详情
export const getdeviceMaintainOrderMain = async (id: number) => {
return await request.get({ url: `/eam/device-maintain-order-main/get?id=` + id })
}
// 新增保养工单主
export const createdeviceMaintainOrderMain = async (data: deviceMaintainOrderMainVO) => {
return await request.post({ url: `/eam/device-maintain-order-main/create`, data })
}
// 修改保养工单主
export const updatedeviceMaintainOrderMain = async (data: deviceMaintainOrderMainVO) => {
return await request.put({ url: `/eam/device-maintain-order-main/update`, data })
}
// 删除保养工单主
export const deletedeviceMaintainOrderMain = async (id: number) => {
return await request.delete({ url: `/eam/device-maintain-order-main/delete?id=` + id })
}
// 导出保养工单主 Excel
export const exportdeviceMaintainOrderMain = async (params) => {
return await request.download({ url: `/eam/device-maintain-order-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-maintain-order-main/get-import-template' })
}

54
src/api/eam/device/deviceMaintainPlan/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface DeviceMaintainPlanVO {
number: string
name: string
maintenanceType: string
cycle: string
times: number
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询保养计划列表
export const getDeviceMaintainPlanPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-maintain-plan/senior', data })
} else {
return await request.get({ url: `/eam/device-maintain-plan/page`, params })
}
}
// 查询保养计划详情
export const getDeviceMaintainPlan = async (id: number) => {
return await request.get({ url: `/eam/device-maintain-plan/get?id=` + id })
}
// 新增保养计划
export const createDeviceMaintainPlan = async (data: DeviceMaintainPlanVO) => {
return await request.post({ url: `/eam/device-maintain-plan/create`, data })
}
// 修改保养计划
export const updateDeviceMaintainPlan = async (data: DeviceMaintainPlanVO) => {
return await request.put({ url: `/eam/device-maintain-plan/update`, data })
}
// 删除保养计划
export const deleteDeviceMaintainPlan = async (id: number) => {
return await request.delete({ url: `/eam/device-maintain-plan/delete?id=` + id })
}
// 导出保养计划 Excel
export const exportDeviceMaintainPlan = async (params) => {
return await request.download({ url: `/eam/device-maintain-plan/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-maintain-plan/get-import-template' })
}

57
src/api/eam/device/deviceMaintenanceMain/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface DeviceMaintenanceMainVO {
number: string
requestNumber: string
describe: string
deviceNumber: string
factoryAreaNumber: string
maintenance: number
maintenancePhone: string
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询维修工单主列表
export const getDeviceMaintenanceMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-maintenance-main/senior', data })
} else {
return await request.get({ url: `/eam/device-maintenance-main/page`, params })
}
}
// 查询维修工单主详情
export const getDeviceMaintenanceMain = async (id: number) => {
return await request.get({ url: `/eam/device-maintenance-main/get?id=` + id })
}
// 新增维修工单主
export const createDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => {
return await request.post({ url: `/eam/device-maintenance-main/create`, data })
}
// 修改维修工单主
export const updateDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => {
return await request.put({ url: `/eam/device-maintenance-main/update`, data })
}
// 删除维修工单主
export const deleteDeviceMaintenanceMain = async (id: number) => {
return await request.delete({ url: `/eam/device-maintenance-main/delete?id=` + id })
}
// 导出维修工单主 Excel
export const exportDeviceMaintenanceMain = async (params) => {
return await request.download({ url: `/eam/device-maintenance-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-maintenance-main/get-import-template' })
}

56
src/api/eam/device/deviceRepair/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface DeviceRepairVO {
number: string
describe: string
deviceNumber: string
factoryAreaNumber: string
declarer: number
declarerPhone: string
faultType: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询报修申请列表
export const getDeviceRepairPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-repair/senior', data })
} else {
return await request.get({ url: `/eam/device-repair/page`, params })
}
}
// 查询报修申请详情
export const getDeviceRepair = async (id: number) => {
return await request.get({ url: `/eam/device-repair/get?id=` + id })
}
// 新增报修申请
export const createDeviceRepair = async (data: DeviceRepairVO) => {
return await request.post({ url: `/eam/device-repair/create`, data })
}
// 修改报修申请
export const updateDeviceRepair = async (data: DeviceRepairVO) => {
return await request.put({ url: `/eam/device-repair/update`, data })
}
// 删除报修申请
export const deleteDeviceRepair = async (id: number) => {
return await request.delete({ url: `/eam/device-repair/delete?id=` + id })
}
// 导出报修申请 Excel
export const exportDeviceRepair = async (params) => {
return await request.download({ url: `/eam/device-repair/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-repair/get-import-template' })
}

55
src/api/eam/device/deviceSpotInspectionRecordMain/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface DeviceSpotInspectionRecordMainVO {
number: string
deviceNumber: string
describe: string
maintenance: number
maintenancePhone: string
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询检修工单主列表
export const getDeviceSpotInspectionRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-spot-inspection-record-main/senior', data })
} else {
return await request.get({ url: `/eam/device-spot-inspection-record-main/page`, params })
}
}
// 查询检修工单主详情
export const getDeviceSpotInspectionRecordMain = async (id: number) => {
return await request.get({ url: `/eam/device-spot-inspection-record-main/get?id=` + id })
}
// 新增检修工单主
export const createDeviceSpotInspectionRecordMain = async (data: DeviceSpotInspectionRecordMainVO) => {
return await request.post({ url: `/eam/device-spot-inspection-record-main/create`, data })
}
// 修改检修工单主
export const updateDeviceSpotInspectionRecordMain = async (data: DeviceSpotInspectionRecordMainVO) => {
return await request.put({ url: `/eam/device-spot-inspection-record-main/update`, data })
}
// 删除检修工单主
export const deleteDeviceSpotInspectionRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/device-spot-inspection-record-main/delete?id=` + id })
}
// 导出检修工单主 Excel
export const exportDeviceSpotInspectionRecordMain = async (params) => {
return await request.download({ url: `/eam/device-spot-inspection-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-spot-inspection-record-main/get-import-template' })
}

62
src/api/eam/mold/moldAccounts/index.ts

@ -0,0 +1,62 @@
import request from '@/config/axios'
export interface MoldAccountsVO {
number: string
name: string
specification: string
type: string
factoryAreaNumber: string
purchaseTime: Date
deptId: number
purchaser: number
supplierNumber: string
productionDate: Date
purchasePrice: number
isClientAssets: string
frequency: number
beat: number
siteId: string
available: string
concurrencyStamp: number
}
// 查询模具台账列表
export const getMoldAccountsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/mold-accounts/senior', data })
} else {
return await request.get({ url: `/eam/mold-accounts/page`, params })
}
}
// 查询模具台账详情
export const getMoldAccounts = async (id: number) => {
return await request.get({ url: `/eam/mold-accounts/get?id=` + id })
}
// 新增模具台账
export const createMoldAccounts = async (data: MoldAccountsVO) => {
return await request.post({ url: `/eam/mold-accounts/create`, data })
}
// 修改模具台账
export const updateMoldAccounts = async (data: MoldAccountsVO) => {
return await request.put({ url: `/eam/mold-accounts/update`, data })
}
// 删除模具台账
export const deleteMoldAccounts = async (id: number) => {
return await request.delete({ url: `/eam/mold-accounts/delete?id=` + id })
}
// 导出模具台账 Excel
export const exportMoldAccounts = async (params) => {
return await request.download({ url: `/eam/mold-accounts/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/mold-accounts/get-import-template' })
}

57
src/api/eam/mold/moldInspectionMain/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface MoldInspectionMainVO {
number: string
maintenanceNumber: string
deviceNumber: string
factoryAreaNumber: string
describe: string
maintenance: number
maintenancePhone: string
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询检修工单主列表
export const getMoldInspectionMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-inspection-main/senior', data })
} else {
return await request.get({ url: `/eam/device-inspection-main/page`, params })
}
}
// 查询检修工单主详情
export const getMoldInspectionMain = async (id: number) => {
return await request.get({ url: `/eam/device-inspection-main/get?id=` + id })
}
// 新增检修工单主
export const createMoldInspectionMain = async (data: MoldInspectionMainVO) => {
return await request.post({ url: `/eam/device-inspection-main/create`, data })
}
// 修改检修工单主
export const updateMoldInspectionMain = async (data: MoldInspectionMainVO) => {
return await request.put({ url: `/eam/device-inspection-main/update`, data })
}
// 删除检修工单主
export const deleteMoldInspectionMain = async (id: number) => {
return await request.delete({ url: `/eam/device-inspection-main/delete?id=` + id })
}
// 导出检修工单主 Excel
export const exportMoldInspectionMain = async (params) => {
return await request.download({ url: `/eam/device-inspection-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-inspection-main/get-import-template' })
}

61
src/api/eam/mold/moldMaintainOrderMain/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface MoldMaintainOrderMainVO {
number: string
name: string
planNumber: string
deviceNumber: string
factoryAreaNumber: string
engineer: number
receiveTime: Date
assignTime: Date
worker: number
finishedTime: Date
verifyTime: Date
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询保养工单主列表
export const getMoldMaintainOrderMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-maintain-order-main/senior', data })
} else {
return await request.get({ url: `/eam/device-maintain-order-main/page`, params })
}
}
// 查询保养工单主详情
export const getMoldMaintainOrderMain = async (id: number) => {
return await request.get({ url: `/eam/device-maintain-order-main/get?id=` + id })
}
// 新增保养工单主
export const createMoldMaintainOrderMain = async (data: MoldMaintainOrderMainVO) => {
return await request.post({ url: `/eam/device-maintain-order-main/create`, data })
}
// 修改保养工单主
export const updateMoldMaintainOrderMain = async (data: MoldMaintainOrderMainVO) => {
return await request.put({ url: `/eam/device-maintain-order-main/update`, data })
}
// 删除保养工单主
export const deleteMoldMaintainOrderMain = async (id: number) => {
return await request.delete({ url: `/eam/device-maintain-order-main/delete?id=` + id })
}
// 导出保养工单主 Excel
export const exportMoldMaintainOrderMain = async (params) => {
return await request.download({ url: `/eam/device-maintain-order-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-maintain-order-main/get-import-template' })
}

54
src/api/eam/mold/moldMaintainPlan/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface MoldMaintainPlanVO {
number: string
name: string
maintenanceType: string
cycle: string
times: number
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询保养计划列表
export const getMoldMaintainPlanPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-maintain-plan/senior', data })
} else {
return await request.get({ url: `/eam/device-maintain-plan/page`, params })
}
}
// 查询保养计划详情
export const getMoldMaintainPlan = async (id: number) => {
return await request.get({ url: `/eam/device-maintain-plan/get?id=` + id })
}
// 新增保养计划
export const createMoldMaintainPlan = async (data: MoldMaintainPlanVO) => {
return await request.post({ url: `/eam/device-maintain-plan/create`, data })
}
// 修改保养计划
export const updateMoldMaintainPlan = async (data: MoldMaintainPlanVO) => {
return await request.put({ url: `/eam/device-maintain-plan/update`, data })
}
// 删除保养计划
export const deleteMoldMaintainPlan = async (id: number) => {
return await request.delete({ url: `/eam/device-maintain-plan/delete?id=` + id })
}
// 导出保养计划 Excel
export const exportMoldMaintainPlan = async (params) => {
return await request.download({ url: `/eam/device-maintain-plan/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-maintain-plan/get-import-template' })
}

57
src/api/eam/mold/moldMaintenanceMain/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface MoldMaintenanceMainVO {
number: string
requestNumber: string
describe: string
deviceNumber: string
factoryAreaNumber: string
maintenance: number
maintenancePhone: string
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询维修工单主列表
export const getMoldMaintenanceMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-maintenance-main/senior', data })
} else {
return await request.get({ url: `/eam/device-maintenance-main/page`, params })
}
}
// 查询维修工单主详情
export const getMoldMaintenanceMain = async (id: number) => {
return await request.get({ url: `/eam/device-maintenance-main/get?id=` + id })
}
// 新增维修工单主
export const createMoldMaintenanceMain = async (data: MoldMaintenanceMainVO) => {
return await request.post({ url: `/eam/device-maintenance-main/create`, data })
}
// 修改维修工单主
export const updateMoldMaintenanceMain = async (data: MoldMaintenanceMainVO) => {
return await request.put({ url: `/eam/device-maintenance-main/update`, data })
}
// 删除维修工单主
export const deleteMoldMaintenanceMain = async (id: number) => {
return await request.delete({ url: `/eam/device-maintenance-main/delete?id=` + id })
}
// 导出维修工单主 Excel
export const exportMoldMaintenanceMain = async (params) => {
return await request.download({ url: `/eam/device-maintenance-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-maintenance-main/get-import-template' })
}

56
src/api/eam/mold/moldRepair/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface MoldRepairVO {
number: string
describe: string
deviceNumber: string
factoryAreaNumber: string
declarer: number
declarerPhone: string
faultType: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询报修申请列表
export const getMoldRepairPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-repair/senior', data })
} else {
return await request.get({ url: `/eam/device-repair/page`, params })
}
}
// 查询报修申请详情
export const getMoldRepair = async (id: number) => {
return await request.get({ url: `/eam/device-repair/get?id=` + id })
}
// 新增报修申请
export const createMoldRepair = async (data: MoldRepairVO) => {
return await request.post({ url: `/eam/device-repair/create`, data })
}
// 修改报修申请
export const updateMoldRepair = async (data: MoldRepairVO) => {
return await request.put({ url: `/eam/device-repair/update`, data })
}
// 删除报修申请
export const deleteMoldRepair = async (id: number) => {
return await request.delete({ url: `/eam/device-repair/delete?id=` + id })
}
// 导出报修申请 Excel
export const exportMoldRepair = async (params) => {
return await request.download({ url: `/eam/device-repair/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-repair/get-import-template' })
}

138
src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

@ -0,0 +1,138 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceAccountsRules = reactive({
number: [required],
name: [required],
factoryAreaNumber: [required],
purchaseTime: [required],
deptId: [required],
purchaser: [required],
supplierNumber: [required],
siteId: [required],
concurrencyStamp: [required],
})
export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
{
label: '设备类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '所属厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '采购时间',
field: 'purchaseTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '采购部门',
field: 'deptId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '采购人',
field: 'purchaser',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '供应商编号',
field: 'supplierNumber',
sort: 'custom',
},
{
label: '出厂日期',
field: 'productionDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '价格',
field: 'purchasePrice',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

231
src/views/eam/device/deviceAccounts/index.vue

@ -0,0 +1,231 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceAccounts.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="getList"
:rules="DeviceAccountsRules"
:formAllSchemas="DeviceAccounts.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="DeviceAccountsApi.updateDeviceAccounts"
:apiCreate="DeviceAccountsApi.createDeviceAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceAccounts.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceAccounts,DeviceAccountsRules } from './deviceAccounts.data'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
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: 'DeviceAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceAccounts.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: DeviceAccountsApi.getDeviceAccountsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:deviceAccounts:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:deviceAccounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:deviceAccounts: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:deviceAccounts:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:deviceAccounts: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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceAccountsApi.deleteDeviceAccounts(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 DeviceAccountsApi.exportDeviceAccounts(setSearchParams)
download.excel(data, '备件台账.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceAccountsApi.importTemplate()
})
</script>

138
src/views/eam/device/deviceAllot/deviceAllot.data.ts

@ -0,0 +1,138 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceAllotRules = reactive({
number: [required],
name: [required],
factoryAreaNumber: [required],
purchaseTime: [required],
deptId: [required],
purchaser: [required],
supplierNumber: [required],
siteId: [required],
concurrencyStamp: [required],
})
export const DeviceAllot = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
{
label: '设备类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '所属厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '采购时间',
field: 'purchaseTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '采购部门',
field: 'deptId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '采购人',
field: 'purchaser',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '供应商编号',
field: 'supplierNumber',
sort: 'custom',
},
{
label: '出厂日期',
field: 'productionDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '价格',
field: 'purchasePrice',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

231
src/views/eam/device/deviceAllot/index.vue

@ -0,0 +1,231 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceAllot.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceAllot.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="getList"
:rules="DeviceAllotRules"
:formAllSchemas="DeviceAllot.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="DeviceAllotApi.updateDeviceAccounts"
:apiCreate="DeviceAllotApi.createDeviceAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceAllot.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceAllot,DeviceAllotRules } from './deviceAllot.data'
import * as DeviceAllotApi from '@/api/eam/device/deviceAllot'
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: 'DeviceAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceAllot.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: DeviceAllotApi.getDeviceAccountsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:deviceAccounts:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:deviceAccounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:deviceAccounts: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:deviceAccounts:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:deviceAccounts: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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceAllotApi.deleteDeviceAccounts(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 DeviceAllotApi.exportDeviceAccounts(setSearchParams)
download.excel(data, '备件台账.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceAllotApi.importTemplate()
})
</script>

110
src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts

@ -0,0 +1,110 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceInspectionMainRules = reactive({
number: [required],
maintenanceNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
status: [required],
type: [required],
concurrencyStamp: [required],
})
export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '维修工单号',
field: 'maintenanceNumber',
sort: 'custom',
},
{
label: '设备模具',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '维修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/device/deviceInspectionMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceInspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceInspectionMain.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="DeviceInspectionMainRules"
:formAllSchemas="DeviceInspectionMain.allSchemas"
:apiUpdate="DeviceInspectionMainApi.updateDeviceInspectionMain"
:apiCreate="DeviceInspectionMainApi.createDeviceInspectionMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceInspectionMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-inspection-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceInspectionMain,DeviceInspectionMainRules } from './deviceInspectionMain.data'
import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain'
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: 'DeviceInspectionMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceInspectionMain.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: DeviceInspectionMainApi.getDeviceInspectionMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceInspectionMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceInspectionMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceInspectionMain: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:'eam:deviceInspectionMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain: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 =DeviceInspectionMain.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 DeviceInspectionMainApi.createDeviceInspectionMain(data)
message.success(t('common.createSuccess'))
} else {
await DeviceInspectionMainApi.updateDeviceInspectionMain(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, 'basicDeviceInspectionMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceInspectionMainApi.deleteDeviceInspectionMain(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 DeviceInspectionMainApi.exportDeviceInspectionMain(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 DeviceInspectionMainApi.importTemplate()
})
</script>

177
src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts

@ -0,0 +1,177 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const deviceMaintainOrderMainRules = reactive({
number: [required],
name: [required],
planNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
status: [required],
type: [required],
concurrencyStamp: [required],
})
export const deviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '保养计划单号',
field: 'planNumber',
sort: 'custom',
},
{
label: '设备/模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '工程师id',
field: 'engineer',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '接单时间',
field: 'receiveTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '指派时间',
field: 'assignTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '工程师id',
field: 'worker',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '完成时间',
field: 'finishedTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '验证时间',
field: 'verifyTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/device/deviceMaintainOrderMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="deviceMaintainOrderMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="deviceMaintainOrderMain.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="deviceMaintainOrderMainRules"
:formAllSchemas="deviceMaintainOrderMain.allSchemas"
:apiUpdate="deviceMaintainOrderMainApi.updatedeviceMaintainOrderMain"
:apiCreate="deviceMaintainOrderMainApi.createdeviceMaintainOrderMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="deviceMaintainOrderMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-maintain-order-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { deviceMaintainOrderMain,deviceMaintainOrderMainRules } from './deviceMaintainOrderMain.data'
import * as deviceMaintainOrderMainApi from '@/api/eam/device/deviceMaintainOrderMain'
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: 'deviceMaintainOrderMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(deviceMaintainOrderMain.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: deviceMaintainOrderMainApi.getdeviceMaintainOrderMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceMaintainOrderMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceMaintainOrderMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceMaintainOrderMain: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:'eam:deviceMaintainOrderMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMaintainOrderMain: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 =deviceMaintainOrderMain.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 deviceMaintainOrderMainApi.createdeviceMaintainOrderMain(data)
message.success(t('common.createSuccess'))
} else {
await deviceMaintainOrderMainApi.updatedeviceMaintainOrderMain(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, 'basicdeviceMaintainOrderMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await deviceMaintainOrderMainApi.deletedeviceMaintainOrderMain(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 deviceMaintainOrderMainApi.exportdeviceMaintainOrderMain(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 deviceMaintainOrderMainApi.importTemplate()
})
</script>

92
src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts

@ -0,0 +1,92 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceMaintainPlanRules = reactive({
number: [required],
name: [required],
maintenanceType: [required],
type: [required],
concurrencyStamp: [required],
})
export const DeviceMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '保养类型',
field: 'maintenanceType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '设备执行周期、半年、年',
field: 'cycle',
sort: 'custom',
},
{
label: '次数',
field: 'times',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/device/deviceMaintainPlan/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceMaintainPlan.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceMaintainPlan.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="DeviceMaintainPlanRules"
:formAllSchemas="DeviceMaintainPlan.allSchemas"
:apiUpdate="DeviceMaintainPlanApi.updateDeviceMaintainPlan"
:apiCreate="DeviceMaintainPlanApi.createDeviceMaintainPlan"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintainPlan.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-maintain-plan/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceMaintainPlan,DeviceMaintainPlanRules } from './deviceMaintainPlan.data'
import * as DeviceMaintainPlanApi from '@/api/eam/device/deviceMaintainPlan'
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: 'DeviceMaintainPlan' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceMaintainPlan.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: DeviceMaintainPlanApi.getDeviceMaintainPlanPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceMaintainPlan:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceMaintainPlan:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceMaintainPlan: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:'eam:deviceMaintainPlan:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMaintainPlan: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 =DeviceMaintainPlan.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 DeviceMaintainPlanApi.createDeviceMaintainPlan(data)
message.success(t('common.createSuccess'))
} else {
await DeviceMaintainPlanApi.updateDeviceMaintainPlan(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, 'basicDeviceMaintainPlan')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceMaintainPlanApi.deleteDeviceMaintainPlan(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 DeviceMaintainPlanApi.exportDeviceMaintainPlan(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 DeviceMaintainPlanApi.importTemplate()
})
</script>

111
src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts

@ -0,0 +1,111 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceMaintenanceMainRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
status: [required],
type: [required],
siteId: [required],
concurrencyStamp: [required],
})
export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '报修工单申请号',
field: 'requestNumber',
sort: 'custom',
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '设备模具编号',
field: 'deviceNumber',
sort: 'custom',
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '报修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '类型设备',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/device/deviceMaintenanceMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceMaintenanceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceMaintenanceMain.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="DeviceMaintenanceMainRules"
:formAllSchemas="DeviceMaintenanceMain.allSchemas"
:apiUpdate="DeviceMaintenanceMainApi.updateDeviceMaintenanceMain"
:apiCreate="DeviceMaintenanceMainApi.createDeviceMaintenanceMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintenanceMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-maintenance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceMaintenanceMain,DeviceMaintenanceMainRules } from './deviceMaintenanceMain.data'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
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: 'DeviceMaintenanceMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceMaintenanceMain.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: DeviceMaintenanceMainApi.getDeviceMaintenanceMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceMaintenanceMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceMaintenanceMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceMaintenanceMain: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:'eam:deviceMaintenanceMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMaintenanceMain: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 =DeviceMaintenanceMain.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 DeviceMaintenanceMainApi.createDeviceMaintenanceMain(data)
message.success(t('common.createSuccess'))
} else {
await DeviceMaintenanceMainApi.updateDeviceMaintenanceMain(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, 'basicDeviceMaintenanceMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceMaintenanceMainApi.deleteDeviceMaintenanceMain(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 DeviceMaintenanceMainApi.exportDeviceMaintenanceMain(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 DeviceMaintenanceMainApi.importTemplate()
})
</script>

105
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -0,0 +1,105 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceRepairRules = reactive({
number: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
declarer: [required],
faultType: [required],
type: [required],
available: [required],
concurrencyStamp: [required],
})
export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '设备模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '报修人',
field: 'declarer',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '报修人联系电话',
field: 'declarerPhone',
sort: 'custom',
},
{
label: '故障类型枚举EM、CM、 PM',
field: 'faultType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/device/deviceRepair/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceRepair.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceRepair.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="DeviceRepairRules"
:formAllSchemas="DeviceRepair.allSchemas"
:apiUpdate="DeviceRepairApi.updateDeviceRepair"
:apiCreate="DeviceRepairApi.createDeviceRepair"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceRepair.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-repair/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceRepair,DeviceRepairRules } from './deviceRepair.data'
import * as DeviceRepairApi from '@/api/eam/device/deviceRepair'
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: 'DeviceRepair' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceRepair.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: DeviceRepairApi.getDeviceRepairPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceRepair:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceRepair:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceRepair: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:'eam:deviceRepair:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceRepair: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 =DeviceRepair.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 DeviceRepairApi.createDeviceRepair(data)
message.success(t('common.createSuccess'))
} else {
await DeviceRepairApi.updateDeviceRepair(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, 'basicDeviceRepair')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceRepairApi.deleteDeviceRepair(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 DeviceRepairApi.exportDeviceRepair(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 DeviceRepairApi.importTemplate()
})
</script>

98
src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts

@ -0,0 +1,98 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceSpotInspectionRecordMainRules = reactive({
number: [required],
deviceNumber: [required],
status: [required],
type: [required],
concurrencyStamp: [required],
})
export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '设备模具',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '维修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/device/deviceSpotInspectionRecordMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceSpotInspectionRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceSpotInspectionRecordMain.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="DeviceSpotInspectionRecordMainRules"
:formAllSchemas="DeviceSpotInspectionRecordMain.allSchemas"
:apiUpdate="DeviceSpotInspectionRecordMainApi.updateDeviceSpotInspectionRecordMain"
:apiCreate="DeviceSpotInspectionRecordMainApi.createDeviceSpotInspectionRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceSpotInspectionRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-spot-inspection-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceSpotInspectionRecordMain,DeviceSpotInspectionRecordMainRules } from './deviceSpotInspectionRecordMain.data'
import * as DeviceSpotInspectionRecordMainApi from '@/api/eam/device/deviceSpotInspectionRecordMain'
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: 'DeviceSpotInspectionRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceSpotInspectionRecordMain.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: DeviceSpotInspectionRecordMainApi.getDeviceSpotInspectionRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceSpotInspectionRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceSpotInspectionRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceSpotInspectionRecordMain: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:'eam:deviceSpotInspectionRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceSpotInspectionRecordMain: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 =DeviceSpotInspectionRecordMain.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 DeviceSpotInspectionRecordMainApi.createDeviceSpotInspectionRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await DeviceSpotInspectionRecordMainApi.updateDeviceSpotInspectionRecordMain(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, 'basicDeviceSpotInspectionRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceSpotInspectionRecordMainApi.deleteDeviceSpotInspectionRecordMain(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 DeviceSpotInspectionRecordMainApi.exportDeviceSpotInspectionRecordMain(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 DeviceSpotInspectionRecordMainApi.importTemplate()
})
</script>

244
src/views/eam/mold/moldAccounts/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="MoldAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="MoldAccounts.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="MoldAccountsRules"
:formAllSchemas="MoldAccounts.allSchemas"
:apiUpdate="MoldAccountsApi.updateMoldAccounts"
:apiCreate="MoldAccountsApi.createMoldAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldAccounts.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { MoldAccounts,MoldAccountsRules } from './moldAccounts.data'
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
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: 'MoldAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MoldAccounts.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: MoldAccountsApi.getMoldAccountsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:moldAccounts:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldAccounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldAccounts: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:'eam:moldAccounts:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldAccounts: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 =MoldAccounts.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 MoldAccountsApi.createMoldAccounts(data)
message.success(t('common.createSuccess'))
} else {
await MoldAccountsApi.updateMoldAccounts(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, 'basicMoldAccounts')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MoldAccountsApi.deleteMoldAccounts(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 MoldAccountsApi.exportMoldAccounts(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 MoldAccountsApi.importTemplate()
})
</script>

160
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -0,0 +1,160 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MoldAccountsRules = reactive({
number: [required],
name: [required],
factoryAreaNumber: [required],
purchaseTime: [required],
deptId: [required],
purchaser: [required],
supplierNumber: [required],
concurrencyStamp: [required],
})
export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
{
label: '模具类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '所属厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '采购时间',
field: 'purchaseTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '采购部门',
field: 'deptId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '采购人',
field: 'purchaser',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '供应商编号',
field: 'supplierNumber',
sort: 'custom',
},
{
label: '出厂日期',
field: 'productionDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '购买价格',
field: 'purchasePrice',
sort: 'custom',
},
{
label: '是否客户资产TRUE/FALSE',
field: 'isClientAssets',
sort: 'custom',
},
{
label: '生产次数 用来产生保养计划,保养计划完成后归零。',
field: 'frequency',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '节拍 生产一个零件所需时间,对系统没影响',
field: 'beat',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/mold/moldInspectionMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="MoldInspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="MoldInspectionMain.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="MoldInspectionMainRules"
:formAllSchemas="MoldInspectionMain.allSchemas"
:apiUpdate="MoldInspectionMainApi.updateMoldInspectionMain"
:apiCreate="MoldInspectionMainApi.createMoldInspectionMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldInspectionMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-inspection-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { MoldInspectionMain,MoldInspectionMainRules } from './moldInspectionMain.data'
import * as MoldInspectionMainApi from '@/api/eam/mold/moldInspectionMain'
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: 'MoldInspectionMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MoldInspectionMain.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: MoldInspectionMainApi.getMoldInspectionMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:moldInspectionMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldInspectionMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldInspectionMain: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:'eam:moldInspectionMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain: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 =MoldInspectionMain.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 MoldInspectionMainApi.createMoldInspectionMain(data)
message.success(t('common.createSuccess'))
} else {
await MoldInspectionMainApi.updateMoldInspectionMain(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, 'basicMoldInspectionMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MoldInspectionMainApi.deleteMoldInspectionMain(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 MoldInspectionMainApi.exportMoldInspectionMain(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 MoldInspectionMainApi.importTemplate()
})
</script>

110
src/views/eam/mold/moldInspectionMain/moldInspectionMain.data.ts

@ -0,0 +1,110 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MoldInspectionMainRules = reactive({
number: [required],
maintenanceNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
status: [required],
type: [required],
concurrencyStamp: [required],
})
export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '维修工单号',
field: 'maintenanceNumber',
sort: 'custom',
},
{
label: '设备模具',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '维修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/mold/moldMaintainOrderMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="MoldMaintainOrderMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="MoldMaintainOrderMain.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="MoldMaintainOrderMainRules"
:formAllSchemas="MoldMaintainOrderMain.allSchemas"
:apiUpdate="MoldMaintainOrderMainApi.updateMoldMaintainOrderMain"
:apiCreate="MoldMaintainOrderMainApi.createMoldMaintainOrderMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintainOrderMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-maintain-order-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { MoldMaintainOrderMain,MoldMaintainOrderMainRules } from './moldMaintainOrderMain.data'
import * as MoldMaintainOrderMainApi from '@/api/eam/mold/moldMaintainOrderMain'
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: 'MoldMaintainOrderMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MoldMaintainOrderMain.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: MoldMaintainOrderMainApi.getMoldMaintainOrderMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:moldMaintainOrderMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldMaintainOrderMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldMaintainOrderMain: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:'eam:moldMaintainOrderMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldMaintainOrderMain: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 =MoldMaintainOrderMain.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 MoldMaintainOrderMainApi.createMoldMaintainOrderMain(data)
message.success(t('common.createSuccess'))
} else {
await MoldMaintainOrderMainApi.updateMoldMaintainOrderMain(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, 'basicMoldMaintainOrderMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MoldMaintainOrderMainApi.deleteMoldMaintainOrderMain(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 MoldMaintainOrderMainApi.exportMoldMaintainOrderMain(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 MoldMaintainOrderMainApi.importTemplate()
})
</script>

177
src/views/eam/mold/moldMaintainOrderMain/moldMaintainOrderMain.data.ts

@ -0,0 +1,177 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MoldMaintainOrderMainRules = reactive({
number: [required],
name: [required],
planNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
status: [required],
type: [required],
concurrencyStamp: [required],
})
export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '保养计划单号',
field: 'planNumber',
sort: 'custom',
},
{
label: '设备/模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '工程师id',
field: 'engineer',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '接单时间',
field: 'receiveTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '指派时间',
field: 'assignTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '工程师id',
field: 'worker',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '完成时间',
field: 'finishedTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '验证时间',
field: 'verifyTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/mold/moldMaintainPlan/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="MoldMaintainPlan.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="MoldMaintainPlan.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="MoldMaintainPlanRules"
:formAllSchemas="MoldMaintainPlan.allSchemas"
:apiUpdate="MoldMaintainPlanApi.updateMoldMaintainPlan"
:apiCreate="MoldMaintainPlanApi.createMoldMaintainPlan"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintainPlan.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-maintain-plan/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { MoldMaintainPlan,MoldMaintainPlanRules } from './moldMaintainPlan.data'
import * as MoldMaintainPlanApi from '@/api/eam/mold/moldMaintainPlan'
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: 'MoldMaintainPlan' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MoldMaintainPlan.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: MoldMaintainPlanApi.getMoldMaintainPlanPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:moldMaintainPlan:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldMaintainPlan:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldMaintainPlan: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:'eam:moldMaintainPlan:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldMaintainPlan: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 =MoldMaintainPlan.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 MoldMaintainPlanApi.createMoldMaintainPlan(data)
message.success(t('common.createSuccess'))
} else {
await MoldMaintainPlanApi.updateMoldMaintainPlan(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, 'basicMoldMaintainPlan')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MoldMaintainPlanApi.deleteMoldMaintainPlan(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 MoldMaintainPlanApi.exportMoldMaintainPlan(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 MoldMaintainPlanApi.importTemplate()
})
</script>

92
src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts

@ -0,0 +1,92 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MoldMaintainPlanRules = reactive({
number: [required],
name: [required],
maintenanceType: [required],
type: [required],
concurrencyStamp: [required],
})
export const MoldMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '保养类型',
field: 'maintenanceType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '设备执行周期、半年、年',
field: 'cycle',
sort: 'custom',
},
{
label: '次数',
field: 'times',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/mold/moldMaintenanceMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="MoldMaintenanceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="MoldMaintenanceMain.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="MoldMaintenanceMainRules"
:formAllSchemas="MoldMaintenanceMain.allSchemas"
:apiUpdate="MoldMaintenanceMainApi.updateMoldMaintenanceMain"
:apiCreate="MoldMaintenanceMainApi.createMoldMaintenanceMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintenanceMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-maintenance-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { MoldMaintenanceMain,MoldMaintenanceMainRules } from './moldMaintenanceMain.data'
import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain'
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: 'MoldMaintenanceMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MoldMaintenanceMain.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: MoldMaintenanceMainApi.getMoldMaintenanceMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:moldMaintenanceMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldMaintenanceMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldMaintenanceMain: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:'eam:moldMaintenanceMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldMaintenanceMain: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 =MoldMaintenanceMain.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 MoldMaintenanceMainApi.createMoldMaintenanceMain(data)
message.success(t('common.createSuccess'))
} else {
await MoldMaintenanceMainApi.updateMoldMaintenanceMain(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, 'basicMoldMaintenanceMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MoldMaintenanceMainApi.deleteMoldMaintenanceMain(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 MoldMaintenanceMainApi.exportMoldMaintenanceMain(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 MoldMaintenanceMainApi.importTemplate()
})
</script>

111
src/views/eam/mold/moldMaintenanceMain/moldMaintenanceMain.data.ts

@ -0,0 +1,111 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MoldMaintenanceMainRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
status: [required],
type: [required],
siteId: [required],
concurrencyStamp: [required],
})
export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '报修工单申请号',
field: 'requestNumber',
sort: 'custom',
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '设备模具编号',
field: 'deviceNumber',
sort: 'custom',
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '报修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '类型设备',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/mold/moldRepair/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="MoldRepair.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="MoldRepair.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="MoldRepairRules"
:formAllSchemas="MoldRepair.allSchemas"
:apiUpdate="MoldRepairApi.updateMoldRepair"
:apiCreate="MoldRepairApi.createMoldRepair"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldRepair.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-repair/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { MoldRepair,MoldRepairRules } from './moldRepair.data'
import * as MoldRepairApi from '@/api/eam/mold/moldRepair'
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: 'MoldRepair' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MoldRepair.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: MoldRepairApi.getMoldRepairPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:moldRepair:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldRepair:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldRepair: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:'eam:moldRepair:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldRepair: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 =MoldRepair.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 MoldRepairApi.createMoldRepair(data)
message.success(t('common.createSuccess'))
} else {
await MoldRepairApi.updateMoldRepair(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, 'basicMoldRepair')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MoldRepairApi.deleteMoldRepair(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 MoldRepairApi.exportMoldRepair(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 MoldRepairApi.importTemplate()
})
</script>

105
src/views/eam/mold/moldRepair/moldRepair.data.ts

@ -0,0 +1,105 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MoldRepairRules = reactive({
number: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
declarer: [required],
faultType: [required],
type: [required],
available: [required],
concurrencyStamp: [required],
})
export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '设备模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
},
{
label: '报修人',
field: 'declarer',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '报修人联系电话',
field: 'declarerPhone',
sort: 'custom',
},
{
label: '故障类型枚举EM、CM、 PM',
field: 'faultType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
Loading…
Cancel
Save