Browse Source

Merge branch 'master_hella' into master_hella_20240701

master_hella_20240701
陈薪名 7 months ago
parent
commit
000cdabdf1
  1. 8
      src/api/eam/classTypeRole/index.ts
  2. 6
      src/api/eam/equipmentInspectionMain/index.ts
  3. 6
      src/api/eam/equipmentMaintenanceMain/index.ts
  4. 6
      src/api/eam/equipmentSigning/index.ts
  5. 6
      src/api/eam/equipmentSpotCheckMain/index.ts
  6. 10
      src/api/eam/inspectionItemSelectSet/index.ts
  7. 12
      src/api/eam/maintenanceItemSelectSet/index.ts
  8. 63
      src/api/eam/sparePartsApplyDetail/index.ts
  9. 87
      src/api/eam/sparePartsApplyMain/index.ts
  10. 58
      src/api/eam/sparePartsInLocationDetail/index.ts
  11. 91
      src/api/eam/sparePartsInLocationMain/index.ts
  12. 58
      src/api/eam/sparePartsInLocationRecordDetail/index.ts
  13. 72
      src/api/eam/sparePartsInLocationRecordMain/index.ts
  14. 61
      src/api/eam/sparePartsOutLocationDetail/index.ts
  15. 81
      src/api/eam/sparePartsOutLocationMain/index.ts
  16. 72
      src/api/eam/sparePartsOutLocationRecordDetail/index.ts
  17. 54
      src/api/eam/sparePartsOutLocationRecordDetail/sparePartsOutLocationDetailRecord.js
  18. 71
      src/api/eam/sparePartsOutLocationRecordMain/index.ts
  19. 11
      src/api/eam/spotCheckSelectSet/index.ts
  20. 1
      src/api/wms/countPlanMain/index.ts
  21. 56
      src/api/wms/mstr/index.ts
  22. 4
      src/api/wms/supplierinvoiceRequestMain/index.ts
  23. 4
      src/components/BasicForm/src/BasicForm.vue
  24. 30
      src/components/DictTag/src/DictTag.vue
  25. 128
      src/components/SearchTable/src/SearchTable.vue
  26. 32
      src/components/Table/src/Table.vue
  27. 685
      src/components/TableForm/src/TableForm.vue
  28. 2
      src/components/XButton/src/ButtonBase.vue
  29. 2
      src/locales/en-US.ts
  30. 2
      src/locales/zh-CN.ts
  31. 4
      src/utils/dict.ts
  32. 525
      src/utils/disposition/defaultButtons.ts
  33. 374
      src/views/eam/SparePartsOutLocationRecord/index.vue
  34. 527
      src/views/eam/applicationRecord/index.vue
  35. 38
      src/views/eam/basicInspectionOption/itemSelectSetForm.vue
  36. 31
      src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue
  37. 27
      src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue
  38. 58
      src/views/eam/classTypeRole/index.vue
  39. 127
      src/views/eam/countadjustPlan/countadjustPlan.data.ts
  40. 540
      src/views/eam/countadjustWork/index.vue
  41. 8
      src/views/eam/equipmentAccounts/equipmentAccounts.data.ts
  42. 354
      src/views/eam/equipmentAccounts/index.vue
  43. 6
      src/views/eam/equipmentInspectionMain/equipmentInspectionMain.data.ts
  44. 27
      src/views/eam/equipmentInspectionMain/finishForm1.vue
  45. 18
      src/views/eam/equipmentInspectionMain/finishForm2.vue
  46. 30
      src/views/eam/equipmentInspectionMain/index.vue
  47. 5
      src/views/eam/equipmentInspectionRecordMain/equipmentInspectionRecordMain.data.ts
  48. 47
      src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts
  49. 103
      src/views/eam/equipmentMaintenanceMain/finishForm1.vue
  50. 18
      src/views/eam/equipmentMaintenanceMain/finishForm2.vue
  51. 36
      src/views/eam/equipmentMaintenanceMain/index.vue
  52. 8
      src/views/eam/equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data.ts
  53. 30
      src/views/eam/equipmentMaintenanceRecordMain/index.vue
  54. 2
      src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts
  55. 25
      src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts
  56. 16
      src/views/eam/equipmentRepairJobMain/finishForm2.vue
  57. 10
      src/views/eam/equipmentRepairJobMain/index.vue
  58. 8
      src/views/eam/equipmentRepairRecordMain/equipmentRepairRecordMain.data.ts
  59. 29
      src/views/eam/equipmentRepairRecordMain/index.vue
  60. 72
      src/views/eam/equipmentReportRepairRequest/audiForm.vue
  61. 12
      src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts
  62. 38
      src/views/eam/equipmentReportRepairRequest/index.vue
  63. 35
      src/views/eam/equipmentSigning/equipmentSigning.data.ts
  64. 8
      src/views/eam/equipmentSigning/index.vue
  65. 5
      src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts
  66. 34
      src/views/eam/equipmentSpotCheckMain/finishForm1.vue
  67. 18
      src/views/eam/equipmentSpotCheckMain/finishForm2.vue
  68. 11
      src/views/eam/equipmentSpotCheckMain/index.vue
  69. 5
      src/views/eam/equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data.ts
  70. 6
      src/views/eam/equipmentTransferRecord/index.vue
  71. 28
      src/views/eam/inspectionItem/inspectionItem.data.ts
  72. 2
      src/views/eam/item/index.vue
  73. 5
      src/views/eam/item/item.data.ts
  74. 51
      src/views/eam/itemAccounts/index.vue
  75. 89
      src/views/eam/itemAccounts/itemAccounts.data.ts
  76. 2
      src/views/eam/location/location.data.ts
  77. 135
      src/views/eam/locationArea/locationArea.data.ts
  78. 12
      src/views/eam/maintainExperience/index.vue
  79. 8
      src/views/eam/maintainExperience/maintainExperience.data.ts
  80. 969
      src/views/eam/maintenance/maintenance.data.ts
  81. 19
      src/views/eam/maintenanceItem/maintenanceItem.data.ts
  82. 6
      src/views/eam/maintenanceItemSelectSet/itemSelectSetForm.vue
  83. 8
      src/views/eam/planInspection/planInspection.data.ts
  84. 12
      src/views/eam/repairExperience/index.vue
  85. 14
      src/views/eam/repairExperience/repairExperience.data.ts
  86. 365
      src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts
  87. 511
      src/views/eam/sparePartsApplyMain/index.vue
  88. 137
      src/views/eam/sparePartsInLocationRecord/index.vue
  89. 258
      src/views/eam/sparePartsInLocationRecord/sparePartsInLocationRecordMain.data.ts
  90. 472
      src/views/eam/sparepartsinlocation/index.vue
  91. 298
      src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts
  92. 344
      src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts
  93. 399
      src/views/eam/sparepartsoutlocation/index.vue
  94. 28
      src/views/eam/spotCheckItem/spotCheckItem.data.ts
  95. 350
      src/views/eam/toolAccounts/index.vue
  96. 86
      src/views/eam/transaction/index.vue
  97. 160
      src/views/eam/transaction/transaction.data.ts
  98. 53
      src/views/qms/inspectionJob/addForm.vue
  99. 3
      src/views/qms/inspectionScheme/addForm.vue
  100. 21
      src/views/system/user/index.vue

8
src/api/eam/classTypeRole/index.ts

@ -61,4 +61,10 @@ export const exportClassTypeRole = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/basic/class-type-role/get-import-template' })
}
}
// 启用 / 禁用
export const updateEnableCode = async (data: ClassTypeRoleVO) => {
return await request.post({ url: `/eam/basic/class-type-role/ables` , data })
}

6
src/api/eam/equipmentInspectionMain/index.ts

@ -68,9 +68,9 @@ export const updateEquipmentInspectionMain = async (data: EquipmentInspectionMai
return await request.put({ url: `/eam/equipment-inspection-main/update`, data })
}
// 修改巡检工单主
export const updateEquipmentInspection = async (data: EquipmentInspectionMainVO) => {
return await request.post({ url: `/eam/equipment-inspection-main/updateOrders`, data })
// 验证巡检工单主
export const verifyEquipmentInspectionMain = async (data: EquipmentInspectionMainVO) => {
return await request.post({ url: `/eam/equipment-inspection-main/verifyOrder`, data })
}
// 删除巡检工单主

6
src/api/eam/equipmentMaintenanceMain/index.ts

@ -70,9 +70,9 @@ export const updateEquipmentMaintenanceMain = async (data: EquipmentMaintenanceM
return await request.put({ url: `/eam/equipment-maintenance-main/update`, data })
}
// 修改设备保养工单主
export const updateEquipmentMaintenance = async (data: EquipmentMaintenanceMainVO) => {
return await request.post({ url: `/eam/equipment-maintenance-main/updateOrders`, data })
// 验证设备保养工单主
export const verifyEquipmentMaintenanceMain = async (data: EquipmentMaintenanceMainVO) => {
return await request.post({ url: `/eam/equipment-maintenance-main/verifyOrder`, data })
}
// 删除设备保养工单主

6
src/api/eam/equipmentSigning/index.ts

@ -50,6 +50,10 @@ export const getEquipmentSigning = async (id: number) => {
export const createEquipmentSigning = async (data: EquipmentSigningVO) => {
return await request.post({ url: `/eam/equipment-signing/create`, data })
}
export const createsEquipmentSigning = async (data: EquipmentSigningVO) => {
return await request.post({ url: `/eam/equipment-signing/creates`, data })
}
// 修改设备到货签收记录
export const updateEquipmentSigning = async (data: EquipmentSigningVO) => {
@ -69,4 +73,4 @@ export const exportEquipmentSigning = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-signing/get-import-template' })
}
}

6
src/api/eam/equipmentSpotCheckMain/index.ts

@ -66,9 +66,9 @@ export const updateEquipmentSpotCheckMain = async (data: EquipmentSpotCheckMainV
return await request.put({ url: `/eam/equipment-spot-check-main/update`, data })
}
// 完成点检工单主
export const updateEquipmentSpotCheck = async (data: EquipmentSpotCheckMainVO) => {
return await request.post({ url: `/eam/equipment-spot-check-main/updateOrders`, data })
// 验证点检工单主
export const verifyEquipmentSpotCheckMain = async (data: EquipmentSpotCheckMainVO) => {
return await request.post({ url: `/eam/equipment-spot-check-main/verifyOrder`, data })
}
// 删除点检工单主

10
src/api/eam/inspectionItemSelectSet/index.ts

@ -58,3 +58,13 @@ export const importTemplate = () => {
export const updateEnableCode = async (data: InspectionItemSelectSetVO) => {
return await request.post({ url: `/eam/basic/inspection-item-select-set/ables` , data })
}
// 查询巡检项选择集列表
export const getInspectionItemSelectSetList = async (params) => {
return await request.get({ url: `/eam/basic/inspection-item/getList`, params })
}
// 查询巡检方案项列表
export const getRalInspectionOptionItemList = async (params) => {
return await request.get({url: `/eam/relation-inspection-option-item/getList?optionCode=` + params})
}

12
src/api/eam/maintenanceItemSelectSet/index.ts

@ -56,5 +56,15 @@ export const importTemplate = () => {
// 启用 / 禁用
export const updateEnableCode = async (data: MaintenanceItemSelectSetVO) => {
return await request.post({ url: `/eam/basic/inspection-item-select-set/ables` , data })
return await request.post({ url: `/eam/basic/maintenance-item-select-set/ables` , data })
}
// 查询保养项选择集列表
export const getMaintenanceItemSelectSetList = async (params) => {
return await request.get({ url: `/eam/basic/maintenance-item/getList`, params })
}
// 查询保养方案项列表
export const getRalMaintenanceOptionItemList = async (params) => {
return await request.get({url: `/eam/relation-maintenance-option-item/getList?optionCode=` + params})
}

63
src/api/eam/sparePartsApplyDetail/index.ts

@ -0,0 +1,63 @@
import request from '@/config/axios'
export interface SparePartsApplyDetailVO {
id: number
number: string
masterId: number
sparePartsCode: string
isRadeIn: string
applyQty: number
currentQty: number
type: string
currentSinglePrice: number
equipmentCode: byte[]
jobNumber: byte[]
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件领用申请子列表
export const getSparePartsApplyDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/spare-parts-apply-detail/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-apply-detail/page`, params })
}
}
// 查询备件领用申请子详情
export const getSparePartsApplyDetail = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-apply-detail/get?id=` + id })
}
// 新增备件领用申请子
export const createSparePartsApplyDetail = async (data: SparePartsApplyDetailVO) => {
return await request.post({ url: `/eam/spare-parts-apply-detail/create`, data })
}
// 修改备件领用申请子
export const updateSparePartsApplyDetail = async (data: SparePartsApplyDetailVO) => {
return await request.put({ url: `/eam/spare-parts-apply-detail/update`, data })
}
// 删除备件领用申请子
export const deleteSparePartsApplyDetail = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-apply-detail/delete?id=` + id })
}
// 导出备件领用申请子 Excel
export const exportSparePartsApplyDetail = async (params) => {
return await request.download({ url: `/eam/spare-parts-apply-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-apply-detail/get-import-template' })
}

87
src/api/eam/sparePartsApplyMain/index.ts

@ -0,0 +1,87 @@
import request from '@/config/axios'
export interface SparePartsApplyMainVO {
id: number
number: string
description: string
applyDeptId: string
sumVal: number
status: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件领用申请列表
export const getSparePartsApplyMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/spare-parts-apply-main/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-apply-main/page`, params })
}
}
// 查询备件领用申请详情
export const getSparePartsApplyMain = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-apply-main/get?id=` + id })
}
// 新增备件领用申请
export const createSparePartsApplyMain = async (data: SparePartsApplyMainVO) => {
return await request.post({ url: `/eam/spare-parts-apply-main/create`, data })
}
// 修改备件领用申请
export const updateSparePartsApplyMain = async (data: SparePartsApplyMainVO) => {
return await request.put({ url: `/eam/spare-parts-apply-main/update`, data })
}
// 删除备件领用申请
export const deleteSparePartsApplyMain = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-apply-main/delete?id=` + id })
}
// 导出备件领用申请 Excel
export const exportSparePartsApplyMain = async (params) => {
return await request.download({ url: `/eam/spare-parts-apply-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-apply-main/get-import-template' })
}
// 撤回
export const cancelSparePartsApplyMain = async (id) => {
return await request.get({ url: `/eam/spare-parts-apply-main/cancel?id=` + id })
}
// 审核
export const submitSparePartsApplyMain = async (id) => {
return await request.get({ url: `/eam/spare-parts-apply-main/submitExamine?id=` + id })
}
// 审核驳回
export const rejectSparePartsApplyMain = async (id) => {
return await request.get({ url: `/eam/spare-parts-apply-main/reject?id=` + id })
}
// 审核通过
export const approveSparePartsApplyMain = async (data) => {
return await request.post({ url: `/eam/spare-parts-apply-main/approve`, data })
}
// 完成
export const finishSparePartsApplyMain = async (id) => {
return await request.post({ url: `/eam/spare-parts-apply-main/finish?id=` + id })
}

58
src/api/eam/sparePartsInLocationDetail/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface SparePartsInLocationDetailVO {
id: number
number: string
masterId: number
sparePartsCode: string
isRadeIn: string
applyQty: number
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录子列表
export const getSparePartsInLocationDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/spare-parts-in-location-detail/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-in-location-detail/page`, params })
}
}
// 查询备件入库记录子详情
export const getSparePartsInLocationDetail = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-detail/get?id=` + id })
}
// 新增备件入库记录子
export const createSparePartsInLocationDetail = async (data: SparePartsInLocationDetailVO) => {
return await request.post({ url: `/eam/spare-parts-in-location-detail/create`, data })
}
// 修改备件入库记录子
export const updateSparePartsInLocationDetail = async (data: SparePartsInLocationDetailVO) => {
return await request.put({ url: `/eam/spare-parts-in-location-detail/update`, data })
}
// 删除备件入库记录子
export const deleteSparePartsInLocationDetail = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-detail/delete?id=` + id })
}
// 导出备件入库记录子 Excel
export const exportSparePartsInLocationDetail = async (params) => {
return await request.download({ url: `/eam/spare-parts-in-location-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-detail/get-import-template' })
}

91
src/api/eam/sparePartsInLocationMain/index.ts

@ -0,0 +1,91 @@
import request from '@/config/axios'
export interface SparePartsInLocationMainVO {
id: number
number: string
theme: string
status: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
areaCode: string
locationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录主列表
export const getSparePartsInLocationMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/spare-parts-in-location-main/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-in-location-main/page`, params })
}
}
// 查询备件入库记录主详情
export const getSparePartsInLocationMain = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/get?id=` + id })
}
// 新增备件入库记录主
export const createSparePartsInLocationMain = async (data: SparePartsInLocationMainVO) => {
return await request.post({ url: `/eam/spare-parts-in-location-main/create`, data })
}
// 修改备件入库记录主
export const updateSparePartsInLocationMain = async (data: SparePartsInLocationMainVO) => {
return await request.put({ url: `/eam/spare-parts-in-location-main/update`, data })
}
// 删除备件入库记录主
export const deleteSparePartsInLocationMain = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-main/delete?id=` + id })
}
// 导出备件入库记录主 Excel
export const exportSparePartsInLocationMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/eam/spare-parts-in-location-main/export-excel-senior`, data })
}else{
return await request.download({ url: `/eam/spare-parts-in-location-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-main/get-import-template' })
}
// 撤回
export const cancelSparePartsInLocation = async (id) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/cancel?id=` + id })
}
// 审核
export const submitExamineSparePartsInLocation = async (id) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/submitExamine?id=` + id })
}
// 审核驳回
export const rejectSparePartsInLocation = async (id) => {
return await request.get({ url: `/eam/spare-parts-in-location-main/reject?id=` + id })
}
// 审核通过
export const approveSparePartsInLocation = async (data) => {
return await request.post({ url: `/eam/spare-parts-in-location-main/approve`,data })
}
// 完成
export const finishSparePartsInLocation = async (id) => {
return await request.post({ url: `/eam/spare-parts-in-location-main/finish?id=` + id })
}

58
src/api/eam/sparePartsInLocationRecordDetail/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface SparePartsInLocationDetailRecordVO {
id: number
number: string
masterId: number
sparePartsCode: string
isRadeIn: string
applyQty: number
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录子列表
export const getSparePartsInLocationRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/spare-parts-in-location-detail-record/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-in-location-detail-record/page`, params })
}
}
// 查询备件入库记录子详情
export const getSparePartsInLocationRecordDetail = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-detail-record/get?id=` + id })
}
// 新增备件入库记录子
export const createSparePartsInLocationRecordDetail= async (data: SparePartsInLocationDetailRecordVO) => {
return await request.post({ url: `/eam/spare-parts-in-location-detail-record/create`, data })
}
// 修改备件入库记录子
export const updateSparePartsInLocationRecordDetail = async (data: SparePartsInLocationDetailRecordVO) => {
return await request.put({ url: `/eam/spare-parts-in-location-detail-record/update`, data })
}
// 删除备件入库记录子
export const deleteSparePartsInLocationRecordDetail = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-detail-record/delete?id=` + id })
}
// 导出备件入库记录子 Excel
export const exportSparePartsInLocationRecordDetail = async (params) => {
return await request.download({ url: `/eam/spare-parts-in-location-detail-record/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-detail-record/get-import-template' })
}

72
src/api/eam/sparePartsInLocationRecordMain/index.ts

@ -0,0 +1,72 @@
import request from '@/config/axios'
export interface SparePartsInLocationMainRecordVO {
id: number
number: string
theme: string
status: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
areaCode: string
locationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录主列表
export const getSparePartsInLocationRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/spare-parts-in-location-main-record/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-in-location-main-record/page`, params })
}
}
// 查询备件入库记录主详情
export const getSparePartsInLocationRecordMain = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-main-record/get?id=` + id })
}
// 新增备件入库记录主
export const createSparePartsInLocationRecordMain = async (
data: SparePartsInLocationMainRecordVO
) => {
return await request.post({ url: `/eam/spare-parts-in-location-main-record/create`, data })
}
// 修改备件入库记录主
export const updateSparePartsInLocationRecordMain = async (
data: SparePartsInLocationMainRecordVO
) => {
return await request.put({ url: `/eam/spare-parts-in-location-main-record/update`, data })
}
// 删除备件入库记录主
export const deleteSparePartsInLocationRecordMain= async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-main-record/delete?id=` + id })
}
// 导出备件入库记录主 Excel
export const exportSparePartsInLocationRecordMain = async (params) => {
return await request.download({
url: `/eam/spare-parts-in-location-main-record/export-excel`,
params
})
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-main-record/get-import-template' })
}

61
src/api/eam/sparePartsOutLocationDetail/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface SparePartsOutLocationDetailVO {
id: number
number: string
masterId: number
sparePartsCode: string
isRadeIn: string
applyQty: number
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录子列表
export const getSparePartsOutLocationDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/spare-parts-out-location-detail/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-out-location-detail/page`, params })
}
}
// 查询备件入库记录子详情
export const getSparePartsOutLocationDetail = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-out-location-detail/get?id=` + id })
}
// 新增备件入库记录子
export const createSparePartsOutLocationDetail = async (data: SparePartsOutLocationDetailVO) => {
return await request.post({ url: `/eam/spare-parts-out-location-detail/create`, data })
}
// 修改备件入库记录子
export const updateSparePartsOutLocationDetail = async (data: SparePartsOutLocationDetailVO) => {
return await request.put({ url: `/eam/spare-parts-out-location-detail/update`, data })
}
// 删除备件入库记录子
export const deleteSparePartsOutLocationDetail = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-out-location-detail/delete?id=` + id })
}
// 导出备件入库记录子 Excel
export const exportSparePartsOutLocationDetail = async (params) => {
return await request.download({
url: `/eam/spare-parts-out-location-detail/export-excel`,
params
})
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-out-location-detail/get-import-template' })
}

81
src/api/eam/sparePartsOutLocationMain/index.ts

@ -0,0 +1,81 @@
import request from '@/config/axios'
export interface SparePartsOutLocationMainVO {
id: number
number: string
theme: string
status: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
areaCode: string
locationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录主列表
export const getSparePartsOutLocationMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/spare-parts-out-location-main/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-out-location-main/page`, params })
}
}
// 查询备件入库记录主详情
export const getSparePartsOutLocationMain = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-out-location-main/get?id=` + id })
}
// 新增备件入库记录主
export const createSparePartsOutLocationMain = async (data: SparePartsOutLocationMainVO) => {
return await request.post({ url: `/eam/spare-parts-out-location-main/create`, data })
}
// 修改备件入库记录主
export const updateSparePartsOutLocationMain = async (data: SparePartsOutLocationMainVO) => {
return await request.put({ url: `/eam/spare-parts-out-location-main/update`, data })
}
// 删除备件入库记录主
export const deleteSparePartsOutLocationMain = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-out-location-main/delete?id=` + id })
}
// 出库
export const outSparePartsOutLocationMain = async (id) => {
return await request.get({ url: `/eam/spare-parts-out-location-main/out?id=` + id })
}
// 导出备件入库记录主 Excel
export const exportSparePartsOutLocationMain = async (params) => {
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({
url: `/eam/spare-parts-out-location-main/export-excel-senior`,
data
})
} else {
return await request.download({
url: `/eam/spare-parts-out-location-main/export-excel`,
params
})
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-out-location-main/get-import-template' })
}

72
src/api/eam/sparePartsOutLocationRecordDetail/index.ts

@ -0,0 +1,72 @@
import request from '@/config/axios'
export interface SparePartsOutLocationRecordDetailVO {
id: number
number: string
theme: string
status: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
areaCode: string
locationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询备件入库记录主列表
export const getSparePartsOutLocationDetailRecordPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/spare-parts-in-location-main-record/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-in-location-main-record/page`, params })
}
}
// 查询备件入库记录主详情
export const getSparePartsOutLocationDetailRecord = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-main-record/get?id=` + id })
}
// 新增备件入库记录主
export const createSparePartsOutLocationDetailRecord = async (
data: SparePartsInLocationMainRecordVO
) => {
return await request.post({ url: `/eam/spare-parts-in-location-main-record/create`, data })
}
// 修改备件入库记录主
export const updateSparePartsOutLocationDetailRecord = async (
data: SparePartsInLocationMainRecordVO
) => {
return await request.put({ url: `/eam/spare-parts-in-location-main-record/update`, data })
}
// 删除备件入库记录主
export const deleteSparePartsOutLocationDetailRecord = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-main-record/delete?id=` + id })
}
// 导出备件入库记录主 Excel
export const exportSparePartsOutLocationDetailRecord = async (params) => {
return await request.download({
url: `/eam/spare-parts-in-location-main-record/export-excel`,
params
})
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-in-location-main-record/get-import-template' })
}

54
src/api/eam/sparePartsOutLocationRecordDetail/sparePartsOutLocationDetailRecord.js

@ -0,0 +1,54 @@
import request from '@/config/axios'
// 创建领用出库记录子
export function createSparePartsOutLocationRecordDetail(data) {
return request({
url: '/eam/spare-parts-out-location-detail-record/create',
method: 'post',
data: data
})
}
// 更新领用出库记录子
export function updateSparePartsOutLocationRecordDetail(data) {
return request({
url: '/eam/spare-parts-out-location-detail-record/update',
method: 'put',
data: data
})
}
// 删除领用出库记录子
export function deleteSparePartsOutLocationRecordDetail(id) {
return request({
url: '/eam/spare-parts-out-location-detail-record/delete?id=' + id,
method: 'delete'
})
}
// 获得领用出库记录子
export function getSparePartsOutLocationRecordDetail(id) {
return request({
url: '/eam/spare-parts-out-location-detail-record/get?id=' + id,
method: 'get'
})
}
// 获得领用出库记录子分页
export function getSparePartsOutLocationRecordDetailPage(query) {
return request({
url: '/eam/spare-parts-out-location-detail-record/page',
method: 'get',
params: query
})
}
// 导出领用出库记录子 Excel
export function exportSparePartsOutLocationRecordDetailExcel(query) {
return request({
url: '/eam/spare-parts-out-location-detail-record/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

71
src/api/eam/sparePartsOutLocationRecordMain/index.ts

@ -0,0 +1,71 @@
import request from '@/config/axios'
export interface SparePartsOutLocationRecordMainVO {
id: number
number: string
theme: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
areaCode: string
locationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询领用出库记录主列表
export const getSparePartsOutLocationRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/spare-parts-out-location-main-record/senior', data })
} else {
return await request.get({ url: `/eam/spare-parts-out-location-main-record/page`, params })
}
}
// 查询领用出库记录主详情
export const getSparePartsOutLocationRecordMain = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-out-location-main-record/get?id=` + id })
}
// 新增领用出库记录主
export const createSparePartsOutLocationRecordMain = async (
data: SparePartsOutLocationRecordMainVO
) => {
return await request.post({ url: `/eam/spare-parts-out-location-main-record/create`, data })
}
// 修改领用出库记录主
export const updateSparePartsOutLocationRecordMain = async (
data: SparePartsOutLocationRecordMainVO
) => {
return await request.put({ url: `/eam/spare-parts-out-location-main-record/update`, data })
}
// 删除领用出库记录主
export const deleteSparePartsOutLocationRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-out-location-main-record/delete?id=` + id })
}
// 导出领用出库记录主 Excel
export const exportSparePartsOutLocationRecordMain = async (params) => {
return await request.download({
url: `/eam/spare-parts-out-location-main-record/export-excel`,
params
})
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/spare-parts-out-location-main-record/get-import-template' })
}

11
src/api/eam/spotCheckSelectSet/index.ts

@ -59,3 +59,14 @@ export const importTemplate = () => {
export const updateEnableCode = async (data: BasicSpotCheckSelectSetVO) => {
return await request.post({ url: `/eam/basic/spot-check-select-set/ables` , data })
}
// 查询点检项选择集列表
export const getSpotCheckSelectSetList = async (params) => {
return await request.get({ url: `/eam/basic/spot-check-item/getList`, params })
}
// 查询点检方案项列表
export const getRalSpotCheckOptionItemList = async (params) => {
return await request.get({url: `/eam/relation-spotCheck-option-item/getList?optionCode=` + params})
}

1
src/api/wms/countPlanMain/index.ts

@ -8,6 +8,7 @@ export interface CountPlanMainVO {
ignoreListOfItem: string
ignoreListOfLocation: string
scopeList: string
countSplitType: string
number: string
businessType: string
remark: string

56
src/api/wms/mstr/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface MstrVO {
id: number
hflccHflcd: string
plProdLine: string
plDesc: string
plMvarAcct: string
plCchgAcct: string
type: string
remark: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询产品类信息列表
export const getMstrPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/mstr/senior', data })
} else {
return await request.get({ url: `/wms/mstr/page`, params })
}
}
// 查询产品类信息详情
export const getMstr = async (id: number) => {
return await request.get({ url: `/wms/mstr/get?id=` + id })
}
// 新增产品类信息
export const createMstr = async (data: MstrVO) => {
return await request.post({ url: `/wms/mstr/create`, data })
}
// 修改产品类信息
export const updateMstr = async (data: MstrVO) => {
return await request.put({ url: `/wms/mstr/update`, data })
}
// 删除产品类信息
export const deleteMstr = async (id: number) => {
return await request.delete({ url: `/wms/mstr/delete?id=` + id })
}
// 导出产品类信息 Excel
export const exportMstr = async (params) => {
return await request.download({ url: `/wms/mstr/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/mstr/get-import-template' })
}

4
src/api/wms/supplierinvoiceRequestMain/index.ts

@ -75,8 +75,8 @@ export const subSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/sub?id=` + id })
}
// 采购--审批通过供应商发货申请主
export const appSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id })
export const appSupplierinvoiceRequestMain = async (id: number,balanceStatement:any) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id+ (balanceStatement?'&balanceStatement=' + balanceStatement:'')})
}
// 采购--驳回供应商发货申请主
export const rejSupplierinvoiceRequestMain = async (data) => {

4
src/components/BasicForm/src/BasicForm.vue

@ -619,14 +619,12 @@ const submitForm = async () => {
formLoading.value = true
if (formType.value == 'create') {
const validateForm = await tableFormRef.value.validateForm()
if (!validateForm && props.tableFormDataLength) {
if (props.tableFormDataLength) {
if (props.tableData.length == 0) {
message.warning('请填写明细信息!')
formLoading.value = false
return
}
formLoading.value = false
return
}
//
try {

30
src/components/DictTag/src/DictTag.vue

@ -45,20 +45,22 @@ export default defineComponent({
//
// dictDataList
if (dictDataList.length == 0) {
return (
<ElTag
style={dictData.value?.cssClass ? 'color: #fff' : ''}
type={dictData.value?.colorType}
color={
dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)
? dictData.value?.cssClass
: ''
}
disableTransitions={true}
>
{t(`ts.${dictData.value?.label}`).replace('ts.', '')}
</ElTag>
)
if(dictData.value?.label !== '' && dictData.value?.label !== undefined){
return (<ElTag
style={dictData.value?.cssClass ? 'color: #fff' : ''}
type={dictData.value?.colorType}
color={
dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)
? dictData.value?.cssClass
: ''
}
disableTransitions={true}
>
{t(`ts.${dictData.value?.label}`).replace('ts.', '')}
</ElTag>
)
}
} else {
return (
dictDataList.map(item => {

128
src/components/SearchTable/src/SearchTable.vue

@ -1,5 +1,5 @@
<template>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth" >
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth">
<!-- 搜索工作栏 -->
<slot :name="'searchQuery'+formFieldRef"></slot>
<ContentWrap v-if="searchQuery">
@ -15,7 +15,8 @@
:allSchemas="allSchemasRef"
/>
<ContentWrap>
<Table v-clientSearchTable
<Table
v-clientSearchTable
ref="searchTableRef"
:columns="tableColumns"
:data="tableObjectRef.tableList"
@ -31,13 +32,14 @@
:selectionTotal="multipleBol"
:reserveSelection="true"
row-key="id"
@rowClick="rowClick"
/>
</ContentWrap>
<template #footer>
<div class="flex items-center">
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="searchDialogVisible = false"> </el-button>
<slot name="actions"></slot>
</div>
</template>
@ -46,7 +48,7 @@
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
const props = defineProps({
showSearchTableQueryFields:{
showSearchTableQueryFields: {
type: Array,
required: false,
default: []
@ -69,23 +71,25 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 12
const multipleBol = ref(false)
//
const HeadButttondata = ref(multipleBol.value?
[
defaultButtons.defaultWhenPageBtn(null), //
defaultButtons.defaultUnselectPageBtn(null), //
// defaultButtons.defaultDeselectAllBtn(null), //
defaultButtons.defaultFilterBtn(null), //
]:[
defaultButtons.defaultFilterBtn(null) //
])
const HeadButttondata = ref(
multipleBol.value
? [
defaultButtons.defaultWhenPageBtn(null), //
defaultButtons.defaultUnselectPageBtn(null), //
// defaultButtons.defaultDeselectAllBtn(null), //
defaultButtons.defaultFilterBtn(null) //
]
: [
defaultButtons.defaultFilterBtn(null) //
]
)
/** 打开弹窗 */
const getListRef = ref()
const setSearchParamsRef = ref()
const tableObjectRef = ref()
const getPage:any = ref()
const getPage: any = ref()
const searchSchema = ref()
const tableColumns = ref()
const formFieldRef = ref()
@ -94,21 +98,23 @@ const typeRef = ref()
const rowRef = ref()
const allSchemasRef = ref()
const searchConditionRef = ref()
const searchTableSelectionsList = ref()//
const searchTableSelectionsList = ref() //
const searchQuery = ref(false)
const hiddenFilterBtn = ref(false)
const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any) => {
dialogWidth.value = '80%'
multipleBol.value = multiple
HeadButttondata.value = multiple?[
defaultButtons.defaultWhenPageBtn(null), //
defaultButtons.defaultUnselectPageBtn(null), //
// defaultButtons.defaultDeselectAllBtn(null), //
defaultButtons.defaultFilterBtn(null), //
]:[
defaultButtons.defaultFilterBtn(null), //
]
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','')
HeadButttondata.value = multiple
? [
defaultButtons.defaultWhenPageBtn(null), //
defaultButtons.defaultUnselectPageBtn(null), //
// defaultButtons.defaultDeselectAllBtn(null), //
defaultButtons.defaultFilterBtn(null) //
]
: [
defaultButtons.defaultFilterBtn(null) //
]
dialogTitle.value = t(`ts.${titleName}`).replace('ts.', '')
tableObjectRef.value = tableObject
searchDialogVisible.value = true
allSchemasRef.value = allSchemas
@ -138,29 +144,31 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
searchFieldRef.value = searchField
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema
if(isConcatDetailSchemas){
if (isConcatDetailSchemas) {
//
console.log('detailSchemas',detailSchemas)
tableColumns.value = [...allSchemas?.tableColumns,...detailSchemas?.tableMainColumns].filter(item => (item.field !== 'action'))
}else{
tableColumns.value = allSchemas?.tableColumns.filter(item => (item.field !== 'action'))
console.log('detailSchemas', detailSchemas)
tableColumns.value = [...allSchemas?.tableColumns, ...detailSchemas?.tableMainColumns].filter(
(item) => item.field !== 'action'
)
} else {
tableColumns.value = allSchemas?.tableColumns.filter((item) => item.field !== 'action')
}
getPage.value = getApiPage
typeRef.value = type
rowRef.value = row
// dialogTitle.value = t('action.' + type)
dialogTitle.value = t(`ts.${titleName}`).replace('ts.','')
dialogTitle.value = t(`ts.${titleName}`).replace('ts.', '')
searchTableSelectionsList.value = searchTableSelections
const {tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: getPage.value //
})
tableObjectRef.value = tableObject
searchConditionRef.value = searchCondition
if (searchCondition) tableObjectRef.value.params = searchCondition;
if (searchCondition) tableObjectRef.value.params = searchCondition
//
const { getList , setSearchParams } = tableMethods
const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams
getListRef.value = getList
getList()
@ -169,7 +177,7 @@ const dialogWidth = ref('80%')
const changeDialogWidth = (width: any) => {
dialogWidth.value = width
}
const hiddenFilterButton = ()=>{
const hiddenFilterButton = () => {
HeadButttondata.value = []
}
@ -178,34 +186,34 @@ const searchFormClick = (searchData) => {
console.log(99, rowRef.value)
console.log(100, searchData)
console.log(101, searchConditionRef.value)
// 20240104 searchData.filters
// 20240104 searchData.filters
// 20240321 searchData
if (searchData.filters) {
if (searchConditionRef.value.filters) {
Object.keys(searchConditionRef.value.filters).forEach(key => {
Object.keys(searchConditionRef.value.filters).forEach((key) => {
searchData.filters.push(searchConditionRef.value.filters[key])
});
})
} else {
Object.keys(searchConditionRef.value).forEach(key => {
Object.keys(searchConditionRef.value).forEach((key) => {
searchData.filters.push({
action: "==",
action: '==',
column: key,
value: searchConditionRef.value[key]
})
});
})
}
} else {
if (searchConditionRef.value.filters) {
searchData.filters = searchConditionRef.value.filters
} else {
searchData.filters = []
Object.keys(searchConditionRef.value).forEach(key => {
Object.keys(searchConditionRef.value).forEach((key) => {
searchData.filters.push({
action: "==",
action: '==',
column: key,
value: searchConditionRef.value[key]
})
});
})
}
}
tableObjectRef.value.params = {
@ -215,7 +223,7 @@ const searchFormClick = (searchData) => {
getListRef.value() //
}
const buttonBaseClick = (val, item) => {
//
//
if (val == 'DeselectAll') {
//
searchTableRef.value.clearSelection()
@ -241,29 +249,47 @@ const submitForm = async () => {
formLoading.value = true
const selections = searchTableRef.value.selections
//
if(!multipleBol.value){
if(selections.length > 1 || selections.length == 0) {
if (!multipleBol.value) {
if (selections.length > 1 || selections.length == 0) {
message.warning('请选择一条数据!')
formLoading.value = false
return
}
//
}else{
if(selections.length == 0) {
} else {
if (selections.length == 0) {
message.warning('至少选择一条数据!')
formLoading.value = false
return
}
}
try {
searchDialogVisible.value = false
//
emit('searchTableSuccess', formFieldRef.value, searchFieldRef.value, selections, typeRef.value, rowRef.value)
emit(
'searchTableSuccess',
formFieldRef.value,
searchFieldRef.value,
selections,
typeRef.value,
rowRef.value
)
} finally {
formLoading.value = false
}
}
const rowClick = (row: any, column: any, event: Event) => {
const selected = searchTableRef.value?.elTableRef
?.getSelectionRows()
.some((item) => item.id === row.id)
if (!selected) {
searchTableRef.value?.elTableRef?.toggleRowSelection(row, true)
} else {
//
searchTableRef.value?.elTableRef?.toggleRowSelection(row, false)
}
}
</script>
<style scoped lang="scss">
</style>

32
src/components/Table/src/Table.vue

@ -64,7 +64,7 @@ export default defineComponent({
selectionColor: propTypes.bool.def(false),
rowKey: propTypes.string.def(''),
},
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows'],
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows','rowClick'],
setup(props, { attrs, slots, emit, expose }) {
const elTableRef = ref<ComponentRef<typeof ElTable>>()
@ -121,12 +121,24 @@ export default defineComponent({
const sortRef = ref()
//
const selectRow = ()=>{
console.log(currentPageRef.value,elTableRef.value?.getSelectionRows())
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
//
const selectAll = ()=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
const rowClick = (row: any, column: any, event: Event)=>{
// const selected = elTableRef.value?.getSelectionRows().some(item => item.id === row.id)
// if (!selected) {
// elTableRef.value?.toggleRowSelection(row, true);
// } else {
// //
// elTableRef.value?.toggleRowSelection(row, false);
// }
// console.log(elTableRef.value?.getSelectionRows())
emit('rowClick',row,column,event)
}
//
const togglePageSelection = ()=>{
unref(getProps).data.forEach(row=>{
@ -166,7 +178,8 @@ export default defineComponent({
selectAll,
toggleAllSelection,
togglePageSelection,
clearSelection
clearSelection,
elTableRef
})
const pagination = computed(() => {
@ -390,6 +403,7 @@ export default defineComponent({
onSelection-change={selectionChange}
onSort-change={sortChange}
row-key={unref(getProps).rowKey}
onRow-click={rowClick}
{...unref(getBindValue)}
>
{{
@ -399,7 +413,7 @@ export default defineComponent({
}}
</ElTable>
{unref(getProps).selectionTotal ? (
<div class="mt-5px">已选{selections.value.length}条数据</div>
<div class="mt-15px float-left" style='height:32px;line-height:32px'>已选{selections.value.length}条数据</div>
):undefined}
{unref(getProps).pagination ? (
// update by Pagination
@ -418,18 +432,17 @@ export default defineComponent({
</script>
<style lang="scss">
.expandTable .el-table .tableHeader{
.expandTable .el-table .tableHeader {
--el-table-header-bg-color: #f5f5f5;
}
.expandTable .el-table .tableRow{
}
.expandTable .el-table .tableRow {
--el-table-tr-bg-color: #f5f5f5;
--el-bg-color:#f5f5f5;
--el-bg-color: #f5f5f5;
}
.el-table .selectionRow{
.el-table .selectionRow {
--el-table-tr-bg-color: var(--el-color-primary-light-9);
}
</style>
<style lang="scss" scoped>
:deep(.el-button.is-text) {
@ -441,5 +454,4 @@ export default defineComponent({
padding: 8px 4px;
margin-left: 0;
}
</style>

685
src/components/TableForm/src/TableForm.vue

@ -1,341 +1,418 @@
<!-- 附件组件 -->
<template>
<div class="table-form">
<el-table class="multipleTableComponents"
ref="TableBaseComponents_Ref"
v-loading="tableLoading"
<el-table
class="multipleTableComponents"
ref="TableBaseComponents_Ref"
v-loading="tableLoading"
:data="showTableData()"
:max-height="maxHeight"
row-key="id"
:border="border"
row-key="id"
:border="border"
@selection-change="tableSelectionChange"
@sort-change="tableSortChange"
@sort-change="tableSortChange"
@row-click="handleTableSelect"
>
<!-- 删除按钮多选 -->
<el-table-column fixed="left" type="selection" width="50" v-if="isShowReduceButtonSelection" :reserve-selection="true" />
<el-table-column
fixed="left"
type="selection"
width="50"
v-if="isShowReduceButtonSelection"
:reserve-selection="true"
/>
<!-- 删除按钮 -->
<el-table-column
fixed="left"
:width="50"
v-else-if="isShowReduceButton"
fixed="left"
:width="50"
v-else-if="isShowReduceButton"
v-slot="{ row, $index }"
>
<Icon icon="ep:remove" color="#757575" :size="26" style="cursor: pointer;margin-top: -16px;" @click="handleDeleteTable (row, $index)" />
<Icon
icon="ep:remove"
color="#757575"
:size="26"
style="cursor: pointer; margin-top: -16px"
@click.stop="handleDeleteTable(row, $index)"
/>
</el-table-column>
<!-- 多选 -->
<el-table-column
fixed="left"
<el-table-column
fixed="left"
v-if="selectionTable"
:reserve-selection="true"
type="selection"
:width="50"
:reserve-selection="true"
type="selection"
:width="50"
/>
<!-- 序号 -->
<el-table-column
type="index"
fixed="left"
:label="t(`ts.序号`)"
width="80"
:align="'center'"
v-if="isShowIndex"
<el-table-column
type="index"
fixed="left"
:label="t(`ts.序号`)"
width="80"
:align="'center'"
v-if="isShowIndex"
/>
<el-table-column
v-slot="{ row, $index }"
v-for="(headerItem) in tableFields.filter(item=>(!item.hidden))"
<el-table-column
v-slot="{ row, $index }"
v-for="headerItem in tableFields.filter((item) => !item.hidden)"
:key="headerItem"
:fixed="headerItem.tableForm?.fixed"
:label="t(`ts.${headerItem.label}`).replace('ts.','')" :prop="headerItem.field"
:align="headerItem?.tableForm?.align || 'center'"
:fixed="headerItem.tableForm?.fixed"
:label="t(`ts.${headerItem.label}`).replace('ts.', '')"
:prop="headerItem.field"
:align="headerItem?.tableForm?.align || 'center'"
:sortable="headerItem?.tableForm?.sortable || false"
:width="headerItem?.tableForm?.width || '200px'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'">
<el-form
ref="TableBaseForm_Ref"
:model="row"
style="width: 100%;"
:width="headerItem?.tableForm?.width || '200px'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'"
>
<el-form
ref="TableBaseForm_Ref"
:model="row"
style="width: 100%"
:rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'">
:class="tableFormRules ? '' : 'noRulesForm'"
@click.stop=""
>
<!-- 字符串输入框 -->
<el-form-item
v-if="!headerItem?.tableForm?.type || headerItem?.tableForm?.type == 'InputString'"
:prop="headerItem.field" style="display: flex;align-items: center;">
<el-input :key="headerItem.field+$index"
:prop="headerItem.field"
style="display: flex; align-items: center"
>
<el-input
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
clearable
:type="headerItem?.tableForm?.inputType"
:placeholder="t(`ts.${headerItem?.tableForm?.placeholder || '请输入' + headerItem.label}`).replace('ts.','')"
:disabled="disabledInput(headerItem,row)"
style="flex:1"
@blur="inputStringBlur(headerItem, row[headerItem.field], row,index)"
:placeholder="
t(
`ts.${headerItem?.tableForm?.placeholder || '请输入' + headerItem.label}`
).replace('ts.', '')
"
:disabled="disabledInput(headerItem, row)"
style="flex: 1"
@blur="inputStringBlur(headerItem, row[headerItem.field], row, index)"
/>
<Icon
icon="ep:circle-close"
v-if="
headerItem?.tableForm?.isInpuFocusShow &&
headerItem?.tableForm?.disabled &&
headerItem?.tableForm?.clearable
"
style="position: absolute; right: 50px; cursor: pointer"
@click="clearInput(headerItem.field, row, index)"
/>
<Icon icon="ep:circle-close" v-if="headerItem?.tableForm?.isInpuFocusShow && headerItem?.tableForm?.disabled&& headerItem?.tableForm?.clearable" style='position:absolute;right:50px;cursor: pointer;' @click="clearInput(headerItem.field,row,index)"/>
<el-button :key="headerItem.field+$index+'button'" v-if="headerItem?.tableForm?.isInpuFocusShow" @click="inpuFocus(headerItem,row,index)"><Icon icon="ep:search" size="14"/></el-button>
<el-button
:key="headerItem.field + $index + 'button'"
v-if="headerItem?.tableForm?.isInpuFocusShow"
@click="inpuFocus(headerItem, row, index)"
><Icon icon="ep:search" size="14"
/></el-button>
</el-form-item>
<el-form-item v-if="headerItem?.tableForm?.type == 'slot'">
<el-form-item v-if="headerItem?.tableForm?.type == 'slot'">
<slot :row="row"></slot>
</el-form-item>
<!-- 金额输入框 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'number'"
:prop="headerItem.field">
<el-input :key="headerItem.field+$index"
v-model="row[headerItem.field]"
clearable
type="number"
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:disabled="itemIsDisabled(headerItem, row)"
style="width: 100%;"
@input="row[headerItem.field] = row[headerItem.field].replace(/[^\d\.-]/g, '')"
/>
</el-form-item>
<el-form-item v-if="headerItem?.tableForm?.type == 'number'" :prop="headerItem.field" >
<el-input
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
clearable
type="number"
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:disabled="itemIsDisabled(headerItem, row)"
style="width: 100%"
@input="row[headerItem.field] = row[headerItem.field].replace(/[^\d\.-]/g, '')"
/>
</el-form-item>
<!-- 数字输入框 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'InputNumber'"
:prop="headerItem.field">
<el-input-number
style="width: 100%;"
:key="headerItem.field+$index"
v-model="row[headerItem.field]"
<el-form-item
v-if="headerItem?.tableForm?.type == 'InputNumber'"
:prop="headerItem.field"
>
<el-input-number
style="width: 100%"
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:max="headerItem?.tableForm?.max"
:min="headerItem?.tableForm?.min"
:precision="headerItem?.tableForm?.precision"
:disabled="itemIsDisabled(headerItem, row)"
@change="(e)=>{inputNumberChange(headerItem.field, $index, row, e)}"
:min="headerItem?.tableForm?.min"
:precision="headerItem?.tableForm?.precision"
:disabled="itemIsDisabled(headerItem, row)"
@change="
(e) => {
inputNumberChange(headerItem.field, $index, row, e)
}
"
/>
</el-form-item>
<!-- 下拉框 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'Select'"
:prop="headerItem.field">
<el-select :key="headerItem.field+$index"
v-model="row[headerItem.field]"
<el-form-item v-if="headerItem?.tableForm?.type == 'Select'" :prop="headerItem.field">
<el-select
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="headerItem?.tableForm.clearable || true"
:multiple="headerItem?.tableForm.multiple"
:size="headerItem?.tableForm.size"
:collapse-tags ="headerItem?.tableForm.collapseTags"
:collapse-tags-tooltip ="headerItem?.tableForm.collapseTagsTooltip"
:multiple-limit ="headerItem?.tableForm.multipleLimit"
:multiple="headerItem?.tableForm.multiple"
:size="headerItem?.tableForm.size"
:collapse-tags="headerItem?.tableForm.collapseTags"
:collapse-tags-tooltip="headerItem?.tableForm.collapseTagsTooltip"
:multiple-limit="headerItem?.tableForm.multipleLimit"
:disabled="itemIsDisabled(headerItem, row)"
:filterable="headerItem?.tableForm.filterable"
:filterable="headerItem?.tableForm.filterable"
:allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%"
style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event,row)"
@blur="tableFormSelectOnBlur(headerItem.field, $event,row, $index)">
<el-option
v-for="op in initSelectOptions(headerItem)"
:label="t(`ts.${op.label}`).replace('ts.','')"
@change="formSelectChange(headerItem.field, $event, row)"
@blur="tableFormSelectOnBlur(headerItem.field, $event, row, $index)"
>
<el-option
v-for="op in initSelectOptions(headerItem)"
:label="t(`ts.${op.label}`).replace('ts.', '')"
:value="op.value"
:key="op.value" />
:key="op.value"
/>
</el-select>
</el-form-item>
<!-- 下拉框 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'SelectGroup'"
:prop="headerItem.field">
<el-select :key="headerItem.field+$index"
v-model="row[headerItem.field]"
<el-form-item
v-if="headerItem?.tableForm?.type == 'SelectGroup'"
:prop="headerItem.field"
>
<el-select
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="headerItem?.tableForm.clearable || true"
:multiple="headerItem?.tableForm.multiple"
:size="headerItem?.tableForm.size"
:collapse-tags ="headerItem?.tableForm.collapseTags"
:collapse-tags-tooltip ="headerItem?.tableForm.collapseTagsTooltip"
:multiple-limit ="headerItem?.tableForm.multipleLimit"
:multiple="headerItem?.tableForm.multiple"
:size="headerItem?.tableForm.size"
:collapse-tags="headerItem?.tableForm.collapseTags"
:collapse-tags-tooltip="headerItem?.tableForm.collapseTagsTooltip"
:multiple-limit="headerItem?.tableForm.multipleLimit"
:disabled="itemIsDisabled(headerItem, row)"
:filterable="headerItem?.tableForm.filterable"
:filterable="headerItem?.tableForm.filterable"
:allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%"
style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event,row)"
@blur="tableFormSelectOnBlur(headerItem.field, $event,row, $index)">
<el-option-group
v-for="group in initSelectOptions(headerItem)"
:key="group.type"
:label="t(`ts.${group.name}`).replace('ts.','')"
>
<el-option
v-for="item in group.options"
:key="item.value"
:label="t(`ts.${item.label}`).replace('ts.','')"
:value="item.value"
/>
</el-option-group>
@change="formSelectChange(headerItem.field, $event, row)"
@blur="tableFormSelectOnBlur(headerItem.field, $event, row, $index)"
>
<el-option-group
v-for="group in initSelectOptions(headerItem)"
:key="group.type"
:label="t(`ts.${group.name}`).replace('ts.', '')"
>
<el-option
v-for="item in group.options"
:key="item.value"
:label="t(`ts.${item.label}`).replace('ts.', '')"
:value="item.value"
/>
</el-option-group>
</el-select>
</el-form-item>
<!-- 时间选择器 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'FormTime'"
:prop="headerItem.field">
<el-time-picker :key="headerItem.field+$index"
v-model="row[headerItem.field]"
<el-form-item v-if="headerItem?.tableForm?.type == 'FormTime'" :prop="headerItem.field">
<el-time-picker
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="true"
:placeholder="headerItem?.tableForm?.placeholder || '选择时间'"
style="width: 100%" :disabled="itemIsDisabled(headerItem, row)"
style="width: 100%"
:disabled="itemIsDisabled(headerItem, row)"
:format="headerItem?.tableForm?.format || 'HH:mm:ss'"
:value-format="headerItem?.tableForm?.valueFormat || 'HH:mm:ss'" />
:value-format="headerItem?.tableForm?.valueFormat || 'HH:mm:ss'"
/>
</el-form-item>
<!-- 日期选择器 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'FormDate'"
:prop="headerItem.field">
<el-form-item v-if="headerItem?.tableForm?.type == 'FormDate'" :prop="headerItem.field">
<el-date-picker
:key="headerItem.field+$index"
v-model="row[headerItem.field]"
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="true"
style="width: 100%"
:disabled="itemIsDisabled(headerItem, row)"
:disabled="itemIsDisabled(headerItem, row)"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期'"
:format="headerItem?.tableForm?.format || 'YYYY-MM-DD'"
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DD'"
@change="formFormDateChange(headerItem.field, $event,row, $index)" />
@change="formFormDateChange(headerItem.field, $event, row, $index)"
/>
</el-form-item>
<!-- 日期时间选择器 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'FormDateTime'"
:prop="headerItem.field">
<el-date-picker
:key="headerItem.field+$index"
<el-form-item
v-if="headerItem?.tableForm?.type == 'FormDateTime'"
:prop="headerItem.field"
>
<el-date-picker
:key="headerItem.field + $index"
type="datetime"
:clearable="true"
v-model="row[headerItem.field]"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期时间'"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期时间'"
style="width: 100%"
:format="headerItem?.tableForm?.format || 'YYYY-MM-DD HH:mm:ss'"
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DDTHH:mm:ss'"
:disabled="itemIsDisabled(headerItem, row)" />
:disabled="itemIsDisabled(headerItem, row)"
/>
</el-form-item>
<!--开始时间结束时间选择器 (原类型datetimerange已弃用 使用type+timeType结合方式)-->
<el-form-item
v-if="headerItem?.tableForm?.type == 'FormTimerange'"
:prop="headerItem.field">
<el-date-picker :key="headerItem.field+$index"
<el-form-item
v-if="headerItem?.tableForm?.type == 'FormTimerange'"
:prop="headerItem.field"
>
<el-date-picker
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="true"
:disabled="itemIsDisabled(headerItem, row)"
:type="headerItem?.tableForm?.timeType || 'datetimerange'"
range-separator="至"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
end-placeholder="结束日期"
:format="headerItem?.tableForm?.format || 'YYYY-MM-DD HH:mm:ss'"
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DDTHH:mm:ss'" />
:value-format="headerItem?.tableForm?.valueFormat || 'YYYY-MM-DDTHH:mm:ss'"
/>
</el-form-item>
<!-- Switch 开关 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'Switch'"
:prop="headerItem.field">
<el-switch :key="headerItem.field+$index"
v-model="row[headerItem.field]"
<el-form-item v-if="headerItem?.tableForm?.type == 'Switch'" :prop="headerItem.field">
<el-switch
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:disabled="itemIsDisabled(headerItem, row)"
:loading="headerItem?.tableForm?.loading"
:loading="headerItem?.tableForm?.loading"
:size="headerItem?.tableForm?.size"
:active-icon="headerItem?.tableForm?.activeIcon"
:active-icon="headerItem?.tableForm?.activeIcon"
:inactive-icon="headerItem?.tableForm?.inactiveIcon"
:active-text="headerItem?.tableForm?.activeText"
:active-text="headerItem?.tableForm?.activeText"
:inactive-text="headerItem?.tableForm?.inactiveText"
:active-value="headerItem?.tableForm?.activeValue"
:active-value="headerItem?.tableForm?.activeValue"
:inactive-value="headerItem?.tableForm?.inactiveValue"
:active-color="headerItem?.tableForm?.inactiveColor"
:inactive-color="headerItem?.tableForm?.inactiveColor" />
:inactive-color="headerItem?.tableForm?.inactiveColor"
/>
</el-form-item>
<!-- Radio 单选-->
<el-form-item
v-if="headerItem?.tableForm?.type == 'Radio'"
:prop="headerItem.field">
<el-radio-group :key="headerItem.field+$index"
v-model="row[headerItem.field]"
<el-form-item v-if="headerItem?.tableForm?.type == 'Radio'" :prop="headerItem.field">
<el-radio-group
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:size="headerItem?.tableForm?.size"
:disabled="itemIsDisabled(headerItem, row)"
:disabled="itemIsDisabled(headerItem, row)"
:text-color="headerItem?.tableForm?.textColor"
:fill="headerItem?.tableForm?.fill"
:name="headerItem?.tableForm?.name"
:id="headerItem?.tableForm?.id">
<el-radio
v-for="(item, index) in initSelectOptions(headerItem)"
:key="index"
:label="t(`ts.${item.value}`).replace('ts.','')"
:size="headerItem?.tableForm?.size"
:fill="headerItem?.tableForm?.fill"
:name="headerItem?.tableForm?.name"
:id="headerItem?.tableForm?.id"
>
<el-radio
v-for="(item, index) in initSelectOptions(headerItem)"
:key="index"
:label="t(`ts.${item.value}`).replace('ts.', '')"
:size="headerItem?.tableForm?.size"
:disabled="itemIsDisabled(headerItem, row)"
:border="headerItem?.tableForm?.border">
:border="headerItem?.tableForm?.border"
>
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<!-- Checkbox 多选-->
<el-form-item
v-if="headerItem?.tableForm?.type == 'Checkbox'"
:prop="headerItem.field">
<el-checkbox-group :key="headerItem.field+$index"
v-model="row[headerItem.field]"
<el-form-item v-if="headerItem?.tableForm?.type == 'Checkbox'" :prop="headerItem.field">
<el-checkbox-group
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:disabled="itemIsDisabled(headerItem, row)"
:size="headerItem?.tableForm?.size"
:min="headerItem?.tableForm?.min"
:size="headerItem?.tableForm?.size"
:min="headerItem?.tableForm?.min"
:max="headerItem?.tableForm?.max"
:text-color="headerItem?.tableForm?.textColor"
:fill="headerItem?.tableForm?.fill">
<el-checkbox
v-for="(item, index) in initSelectOptions(headerItem)"
:key="index"
:label="t(`ts.${item.value}`).replace('ts.','')"
:disabled="itemIsDisabled(headerItem, row)"
:true-label="t(`ts.${headerItem?.tableForm?.trueLabel}`).replace('ts.','')"
:false-label="t(`ts.${headerItem?.tableForm?.falseLabel}`).replace('ts.','')"
:text-color="headerItem?.tableForm?.textColor"
:fill="headerItem?.tableForm?.fill"
>
<el-checkbox
v-for="(item, index) in initSelectOptions(headerItem)"
:key="index"
:label="t(`ts.${item.value}`).replace('ts.', '')"
:disabled="itemIsDisabled(headerItem, row)"
:true-label="t(`ts.${headerItem?.tableForm?.trueLabel}`).replace('ts.', '')"
:false-label="t(`ts.${headerItem?.tableForm?.falseLabel}`).replace('ts.', '')"
:border="headerItem?.tableForm?.border"
:size="headerItem?.tableForm?.size"
:size="headerItem?.tableForm?.size"
:name="headerItem?.tableForm?.name"
:checked="headerItem?.tableForm?.checked">
:checked="headerItem?.tableForm?.checked"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<!-- table表添加操作列 -->
<!-- <el-form-item> -->
<div v-if="headerItem?.tableForm?.type == 'action'" :key="headerItem.field+$index">
<el-button
v-for="(itemButton, indexButton) in headerItem?.tableForm?.buttonText.split('|')"
:key="indexButton"
type="text"
style="padding-top: 0px;align-items:unsafe;"
@click="buttonOperationClick(row, headerItem?.tableForm?.buttonName.split('|')[indexButton], $index)"
>{{itemButton}}</el-button>
</div>
<div v-if="headerItem?.tableForm?.type == 'action'" :key="headerItem.field + $index">
<el-button
v-for="(itemButton, indexButton) in headerItem?.tableForm?.buttonText.split('|')"
:key="indexButton"
type="text"
style="padding-top: 0px; align-items: unsafe"
@click.stop="
buttonOperationClick(
row,
headerItem?.tableForm?.buttonName.split('|')[indexButton],
$index
)
"
>{{ itemButton }}</el-button
>
</div>
<!-- </el-form-item> -->
</el-form>
</el-table-column>
<!-- 删除按钮 -->
<el-table-column
fixed="right"
fixed="right"
:label="t('ts.操作')"
align="center"
:width="60"
v-if="isShowReduceButtonSelection"
:width="60"
v-if="isShowReduceButtonSelection"
v-slot="{ row, $index }"
>
<ButtonBase :Butttondata="[defaultButtons.mainListDeleteBtn(),]" @button-base-click="handleDeleteTable (row, $index)" />
<ButtonBase
:Butttondata="[defaultButtons.mainListDeleteBtn()]"
@button-base-click="handleDeleteTable(row, $index)"
/>
</el-table-column>
</el-table>
<!-- :page-sizes="[ 10,20, 30, 50, 100]" sizes-->
<el-pagination v-show="tableData.length>10" style="margin-top:10px"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:small="true"
:background="false"
layout="total, prev, pager, next, jumper"
:total="tableData.length"
/>
<div class="button flex" v-if="isShowButton||isShowReduceButtonSelection">
<div class="p-12px" v-if="isShowButton" @click="handleAddTable">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" />
<div>{{t('ts.添加明细')}}</div>
<el-pagination
v-show="tableData.length > 10"
style="margin-top: 10px"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:small="true"
:background="false"
layout="total, prev, pager, next, jumper"
:total="tableData.length"
/>
<div class="button flex" v-if="isShowButton || isShowReduceButtonSelection">
<div class="p-12px" v-if="isShowButton" @click.stop="handleAddTable">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer" />
<div>{{ t('ts.添加明细') }}</div>
</div>
<div class="p-12px" v-if="isShowReduceButtonSelection" @click="handleSelectionDelete">
<Icon icon="ep:delete" color="#409eff" size="26" style="cursor: pointer;" />
<div>{{t('ts.批量删除')}}</div>
<div class="p-12px" v-if="isShowReduceButtonSelection" @click.stop="handleSelectionDelete">
<Icon icon="ep:delete" color="#409eff" size="26" style="cursor: pointer" />
<div>{{ t('ts.批量删除') }}</div>
</div>
<div class="p-12px" v-if="routeName == 'PurchaseMain'||routeName == 'ProductionMain'||routeName == 'ZZBJDeliverPlanMain'||routeName == 'DeliverPlanMain'||routeName == 'DeliverRequestMain'||routeName == 'ZZBJDeliverRequestMain'||routeName == 'UnplannedreceiptRequestMain'">
<el-input v-model="keyWord" style="width: 240px" placeholder="回车自动添加"/>
<el-button type="primary" style="margin-left: 10px" @click="batchAdd">{{t('批量添加')}}</el-button>
<div
class="p-12px"
v-if="
routeName == 'PurchaseMain' ||
routeName == 'ProductionMain' ||
routeName == 'ZZBJDeliverPlanMain' ||
routeName == 'DeliverPlanMain' ||
routeName == 'DeliverRequestMain' ||
routeName == 'ZZBJDeliverRequestMain' ||
routeName == 'UnplannedreceiptRequestMain'
"
>
<el-input v-model="keyWord" style="width: 240px" placeholder="回车自动添加" />
<el-button type="primary" style="margin-left: 10px" @click.stop="batchAdd">{{
t('批量添加')
}}</el-button>
</div>
</div>
</div>
@ -349,46 +426,46 @@ const props = defineProps({
//
isShowButton: {
type: Boolean,
default: true,
default: true
},
// :custom="headerItem.sortable?headerItem.sortable:false"
selectionTable: {
type: Boolean,
default: false,
default: false
},
//
isShowIndex: {
type: Boolean,
default: false,
default: false
},
// --
isShowReduceButtonSelection:{
isShowReduceButtonSelection: {
type: Boolean,
default: false,
default: false
},
//
isShowReduceButton:{
isShowReduceButton: {
type: Boolean,
default: true,
default: true
},
//
tableLoading: {
type: Boolean,
default: false,
default: false
},
//
tableData: {
type: Array,
default: () => {
return []
},
}
},
//
tableFields: {
type: Array,
default: () => {
return []
},
}
},
// table
height: {
@ -396,7 +473,7 @@ const props = defineProps({
default: () => {
return '200'
}
},
},
maxHeight: {
type: [Number, String],
default: () => {
@ -406,7 +483,7 @@ const props = defineProps({
//
border: {
type: Boolean,
default: false,
default: false
},
// tablerules
tableFormRules: {
@ -418,7 +495,7 @@ const props = defineProps({
type: String,
required: false,
default: ''
},
}
})
//
const emit = defineEmits([
@ -444,16 +521,16 @@ const initSelectOptions = (item) => {
return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions
}
//
const formSelectChange = (field, val,row) => {
emit('formSelectChange', field, val,row)
const formSelectChange = (field, val, row) => {
emit('formSelectChange', field, val, row)
}
//
const formFormDateChange = (field, val,row, index) => {
emit('formFormDateChange', field, val,row, index)
const formFormDateChange = (field, val, row, index) => {
emit('formFormDateChange', field, val, row, index)
}
//
const tableFormSelectOnBlur = (field, val,row,index) => {
emit('tableFormSelectOnBlur', field, val,row,index)
const tableFormSelectOnBlur = (field, val, row, index) => {
emit('tableFormSelectOnBlur', field, val, row, index)
}
// -
const inputNumberChange = (field, index, row, e) => {
@ -465,18 +542,19 @@ const deleteTableData = ref([])
// selection
const tableSelectionChange = (val) => {
if(props.isShowReduceButtonSelection){
//
if (props.isShowReduceButtonSelection) {
//
deleteTableData.value = val
}else{
} else {
emit('tableSelectionChange', val)
}
}
const handleSelectionDelete = ()=>{
const handleSelectionDelete = () => {
emit('tableSelectionDelete', deleteTableData.value)
nextTick(()=>{
deleteTableData.value.forEach(row=>{
TableBaseComponents_Ref.value!.toggleRowSelection(row,false)
TableBaseComponents_Ref.value.clearSelection()
nextTick(() => {
deleteTableData.value.forEach((row) => {
TableBaseComponents_Ref.value!.toggleRowSelection(row, false)
})
})
}
@ -491,12 +569,25 @@ const tableSortChange = (column, prop, order) => {
//
const handleTableSelect = (row, column, event) => {
const selected = TableBaseComponents_Ref.value
?.getSelectionRows()
.some((item) => item.id === row.id)
if (!selected) {
TableBaseComponents_Ref.value?.toggleRowSelection(row, true)
} else {
//
TableBaseComponents_Ref.value?.toggleRowSelection(row, false)
}
emit('handleTableSelect', row, column, event)
}
// item
const itemIsDisabled = (colum, row) => {
return Boolean(colum.tableForm?.disabled) || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field])
return (
Boolean(colum.tableForm?.disabled) ||
Boolean(row.disabled) ||
Boolean(row['disabled_' + colum.field])
)
}
// const { t } = useI18n() //
@ -506,25 +597,27 @@ const TableBaseComponents_Ref = ref()
const TableBaseForm_Ref = ref()
/**
* 验证表单是否符合rules
* @param {*} success 如果验证成功走的方法
* @param {*} error 如果验证不成功走的方法
*/
* 验证表单是否符合rules
* @param {*} success 如果验证成功走的方法
* @param {*} error 如果验证不成功走的方法
*/
const validateForm = () => {
console.log(TableBaseForm_Ref.value)
let _lists = TableBaseForm_Ref.value?.map(v => v.validate())
return Promise.all(_lists).then(() => {
return true
}).catch(() => {
return false
})
let _lists = TableBaseForm_Ref.value?.map((v) => v.validate())
return Promise.all(_lists)
.then(() => {
return true
})
.catch(() => {
return false
})
}
//
const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index)
nextTick(()=>{
TableBaseComponents_Ref.value!.toggleRowSelection(row,false)
nextTick(() => {
TableBaseComponents_Ref.value!.toggleRowSelection(row, false)
})
}
//
@ -532,59 +625,67 @@ const handleAddTable = () => {
emit('handleAddTable')
}
//
const inpuFocus = (headerItem, row, index)=>{
if(headerItem?.tableForm?.isInpuFocusShow){
emit('inpuFocus', headerItem, row, index)
const inpuFocus = (headerItem, row, index) => {
if (headerItem?.tableForm?.isInpuFocusShow) {
emit('inpuFocus', headerItem, row, index)
}
}
// input
const inputStringBlur = (headerItem, val,row,index) => {
emit('inputStringBlur', headerItem, val,row,index)
const inputStringBlur = (headerItem, val, row, index) => {
emit('inputStringBlur', headerItem, val, row, index)
}
const clearInput= (field, row, index) => {
emit('clearInput',field, row, index)
const clearInput = (field, row, index) => {
emit('clearInput', field, row, index)
}
//table
const buttonOperationClick = (row, label, index)=> {
emit("buttonOperationClick", row, label, index);
const buttonOperationClick = (row, label, index) => {
emit('buttonOperationClick', row, label, index)
}
const currentPage =ref(1)
const currentPage = ref(1)
const pageSize = ref(10)
const showTableData = ()=>{
if(props.tableData.length>10){
return props.tableData.slice((currentPage.value-1)*pageSize.value,currentPage.value*pageSize.value)
}else{
const showTableData = () => {
if (props.tableData.length > 10) {
return props.tableData.slice(
(currentPage.value - 1) * pageSize.value,
currentPage.value * pageSize.value
)
} else {
return props.tableData
}
}
const keyWord = ref('')
console.log(9999,props.tableFields)
const batchAdd = ()=>{
console.log(9999, props.tableFields)
const batchAdd = () => {
console.log(keyWord.value)
let field = ''
const itemCodeFields = props.tableFields.find(item=>item.field == 'itemCode')
const supplierFields = props.tableFields.find(item=>item.field == 'supplierCode')
if(itemCodeFields){
const itemCodeFields = props.tableFields.find((item) => item.field == 'itemCode')
const supplierFields = props.tableFields.find((item) => item.field == 'supplierCode')
if (itemCodeFields) {
field = itemCodeFields.field
}else {
if(itemCodeFields){
} else {
if (itemCodeFields) {
field = supplierFields.field
}
}
console.log(field)
emit('batchAdd',keyWord.value)
console.log(field)
emit('batchAdd', keyWord.value)
}
const disabledInput=(headerItem,row)=>{
if(headerItem.tableForm?.isInpuFocusShow){
if(headerItem.tableForm?.enterSearch){
const disabledInput = (headerItem, row) => {
if (headerItem.tableForm?.isInpuFocusShow) {
if (headerItem.tableForm?.enterSearch) {
return false
}else{
} else {
return true
}
}else{
return headerItem?.tableForm?.disabled || Boolean(row.disabled) || Boolean(row['disabled_' + headerItem.field]) ||false
} else {
return (
headerItem?.tableForm?.disabled ||
Boolean(row.disabled) ||
Boolean(row['disabled_' + headerItem.field]) ||
false
)
}
}
@ -594,13 +695,12 @@ defineExpose({
validateForm,
keyWord
})
</script>
<style scoped lang="scss">
::v-deep(.el-table__body){
padding:10px 0px
::v-deep(.el-table__body) {
padding: 10px 0px;
}
::v-deep(.el-table--default .el-table__cell) {
padding: 2px 0px;
@ -623,20 +723,23 @@ defineExpose({
display: block;
}
.table-form ::v-deep(.is-horizontal) {
height: 12px !important;
display: block !important;
}
.button {
>div {
> div {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
>div {
> div {
margin-left: 6px;
text-decoration: underline;
color: #409eff;
}
}
}
</style>

2
src/components/XButton/src/ButtonBase.vue

@ -8,7 +8,7 @@
:disabled="item.disabled"
v-hasPermi="[item.hasPermi] || []"
v-if="item.name != 'set'"
@click="buttonBaseClick(item.name, item, $event)"
@click.stop="buttonBaseClick(item.name, item, $event)"
>
<Icon v-if="item.icon" :icon="item.icon" class="mr-1px" />
<span :style="{width:item.width+'px'||'auto'}" :class="[item.width?'ellipsis':'']">{{ item.label }}</span>

2
src/locales/en-US.ts

@ -885,6 +885,7 @@ export default {
:'Open',
:'Save',
:'Next',
:'Next',
:'Please select filter',
:'Please inputr content',
:'Attachment',
@ -1140,6 +1141,7 @@ export default {
'重新生成标签会删除上次生成的标签,是否确认继续?':'Regenerating labels will delete the last generated label. Are you sure you want to continue?',
'确 认':'Confirm',
:'Please enter the reason for rejection',
:'View details',
:'All read'
},

2
src/locales/zh-CN.ts

@ -885,6 +885,7 @@ export default {
:'打开',
:'保存',
:'下一步',
:'下一步',
:'请选择筛选对象',
:'请输入内容',
:'附件',
@ -1140,6 +1141,7 @@ export default {
'重新生成标签会删除上次生成的标签,是否确认继续?':'重新生成标签会删除上次生成的标签,是否确认继续?',
'确 认':'确 认',
:'请输入拒收原因',
:'查看明细',
:'全部已读'
},

4
src/utils/dict.ts

@ -225,11 +225,14 @@ export enum DICT_TYPE {
REQEUST_MODE = 'reqeust_mode', // 申请模式
TIME_UNIT = 'time_unit', // 时间单位
COUNT_TYPE = 'count_type', // 盘点类型
COUNT_SPLIT_TYPE = 'count_split_type', // 盘点拆分方式
COUNT_SCOPE_TYPE = 'count_scope_type', // 盘点范围类型
BARCODE_PREFIX = 'barcode_prefix', // 条码前缀
SETTLEMENT_TYPE = 'settlement_type', // 结算类型
FROZEN_REASON = 'frozen_reason', // 冻结原因
INVENTORY_ACTION = 'inventory_action', // 库存动作
EAM_INVENTORY_ACTION = 'EAM_inventory_action', // EAM库存动作
EAM_TRANSACTION_TYPE = 'EAM_transaction_Type', // EAM库存类型
CONTAINER_TYPE = 'container_type', // 器具类型
CONTAINER_CONTENT_TYPE = 'container_content_type', // 器具内容类型
RESET_PERIOD = 'reset_period', // 重置周期
@ -283,6 +286,7 @@ export enum DICT_TYPE {
DELIVER_TYPE = 'deliver_type', //发货类型
BILL_TYPE = 'bill_type', // 发票类型
CONTAIN_MANAGE_TYPE = 'contain_menage_type', //器具管理类型
INVOICE_BALANCE_STATEMENT_STATUS = 'invoice_balance_statement_status', //是否有价差
// ========== 业务 - mes ==========
MESDO_STATUS = 'mes_do_status', // 工单执行状态

525
src/utils/disposition/defaultButtons.ts

File diff suppressed because it is too large

374
src/views/eam/SparePartsOutLocationRecord/index.vue

@ -0,0 +1,374 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsOutLocationRecordMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsOutLocationRecordMain.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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SparePartsOutLocationRecordMainRules"
:formAllSchemas="SparePartsOutLocationRecordMain.allSchemas"
:tableAllSchemas="SparePartsOutLocationRecordDetail.allSchemas"
:tableFormRules="SparePartsOutLocationRecordDetailRules"
:tableData="tableData"
:apiUpdate="SparePartsOutLocationRecordMainApi.updateSparePartsOutLocationRecordMain"
:apiCreate="SparePartsOutLocationRecordMainApi.createSparePartsOutLocationRecordMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsOutLocationRecordMain.allSchemas"
:detailAllSchemas="SparePartsOutLocationRecordDetail.allSchemas"
:detailAllSchemasRules="SparePartsOutLocationRecordDetailRules"
:apiCreate="SparePartsOutLocationRecordDetailApi.createSparePartsOutLocationRecordDetail"
:apiUpdate="SparePartsOutLocationRecordDetailApi.updateSparePartsOutLocationRecordDetail"
:apiPage="SparePartsOutLocationRecordDetailApi.getSparePartsOutLocationRecordDetailPage"
:apiDelete="SparePartsOutLocationRecordDetailApi.deleteSparePartsOutLocationRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/sparePartsOutLocationRecordDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsOutLocationRecordMain,
SparePartsOutLocationRecordMainRules,
SparePartsOutLocationRecordDetail,
SparePartsOutLocationRecordDetailRules
} from './sparePartsOutLocationRecord.data'
import * as SparePartsOutLocationRecordMainApi from '@/api/eam/sparePartsOutLocationRecordMain/index'
import * as SparePartsOutLocationRecordDetailApi from '@/api/eam/sparePartsOutLocationRecordDetail/index'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'SparePartsOutLocationRecord' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SparePartsOutLocationRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'sparePartsCode') {
row['sparePartsCode'] = val[0].itemNumber
row['currentQty'] = val[0].qty
}
if (formField == 'equipmentCode') {
row['equipmentCode'] = val[0].code
}
formRef.setValues(setV)
})
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SparePartsOutLocationRecordMainApi.getSparePartsOutLocationRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
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 isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
// defaultButtons.mainAdjust(null),//
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
}
// else if (val == 'mainOrderClo') {
// //
// handleClose(row.id)
// }
else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSparePartsOutLocationRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SparePartsOutLocationRecordMainApi.deleteSparePartsOutLocationRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id: number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsOutLocationRecordMainApi.exportSparePartsOutLocationRecordMain(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
// const handleClose = async (id: number) => {
// try {
// //
// await message.confirm('')
// //
// await SparePartsOutLocationRecordMainApi.closeSparePartsOutLocationRecordMain(id)
// message.success(t('!'))
// //
// await getList()
// } catch {}
// }
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsOutLocationRecordMainApi.exportSparePartsOutLocationRecordMain(
tableObject.params
)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SparePartsOutLocationRecordDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await SparePartsOutLocationRecordMainApi.createSparePartsOutLocationRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await SparePartsOutLocationRecordMainApi.updateSparePartsOutLocationRecordMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = 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 SparePartsOutLocationRecordMainApi.importTemplate()
})
</script>

527
src/views/eam/applicationRecord/index.vue

@ -1,51 +1,83 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ApplicationRecordMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
<Search
:schema="ApplicationRecordMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ApplicationRecordMain.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ApplicationRecordMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<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 #number="{row}">
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" :rules="ApplicationRecordMainRules"
:formAllSchemas="ApplicationRecordMain.allSchemas" :tableAllSchemas="ApplicationRecordDetail.allSchemas"
:tableFormRules="ApplicationRecordDetailRules" :tableData="tableData"
<BasicForm
ref="formRef"
@success="getList"
:rules="ApplicationRecordMainRules"
:formAllSchemas="ApplicationRecordMain.allSchemas"
:tableAllSchemas="ApplicationRecordDetail.allSchemas"
:tableFormRules="ApplicationRecordDetailRules"
:tableData="tableData"
:apiUpdate="ApplicationRecordMainApi.updateApplicationRecordMain"
:apiCreate="ApplicationRecordMainApi.createApplicationRecordMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
:apiCreate="ApplicationRecordMainApi.createApplicationRecordMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="ApplicationRecordMain.allSchemas"
:detailAllSchemas="ApplicationRecordDetail.allSchemas" :detailAllSchemasRules="ApplicationRecordDetailRules"
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ApplicationRecordMain.allSchemas"
:detailAllSchemas="ApplicationRecordDetail.allSchemas"
:detailAllSchemasRules="ApplicationRecordDetailRules"
:apiCreate="ApplicationRecordDetailApi.createApplicationRecordDetail"
:apiUpdate="ApplicationRecordDetailApi.updateApplicationRecordDetail"
:apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage"
:apiDelete="ApplicationRecordDetailApi.deleteApplicationRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true" />
:detailButtonIsShow="true"
/>
<!-- 审批详情 -->
<!-- <approveDetail ref="detailRef1" :isBasic="false" :allSchemas="ApplicationRecordMain.allSchemas"
:detailAllSchemas="ApplicationRecordDetail.allSchemas" :detailAllSchemasRules="ApplicationRecordDetailRules"
@ -55,255 +87,280 @@
@searchTableSuccessDetail="searchTableSuccessDetail"
@agree="getList"/> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<ImportForm
ref="importFormRef"
url="/wms/purchase-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:isShowOut="true"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ApplicationRecordMain, ApplicationRecordMainRules, ApplicationRecordDetail, ApplicationRecordDetailRules } from './applicationRecordMain.data'
import * as ApplicationRecordMainApi from '@/api/eam/applicationRecordMain'
import * as ApplicationRecordDetailApi from '@/api/eam/applicationRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//import approveDetail from '@/components/Detail/src/approveDetail.vue'
import download from '@/utils/download'
import {
ApplicationRecordMain,
ApplicationRecordMainRules,
ApplicationRecordDetail,
ApplicationRecordDetailRules
} from './applicationRecordMain.data'
import * as ApplicationRecordMainApi from '@/api/eam/applicationRecordMain'
import * as ApplicationRecordDetailApi from '@/api/eam/applicationRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//import approveDetail from '@/components/Detail/src/approveDetail.vue'
//
defineOptions({ name: 'ApplicationRecord' })
//
defineOptions({ name: 'ApplicationRecord' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ApplicationRecordMain.allSchemas.tableColumns)
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ApplicationRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: ApplicationRecordMainApi.getApplicationRecordMainPage //
})
const { tableObject, tableMethods } = useTable({
getListApi: ApplicationRecordMainApi.getApplicationRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
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 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 isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.approveBtn({ hide: isShowMainButton(row, ['0']) ,hasPermi:'item:itemApplyMain:approve'}), //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const butttondata = (row) => {
return [
defaultButtons.approveBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: 'item:itemApplyMain:approve'
}) //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'approve') { //
handleApprove(row, '单据号', row.number)
} else if (val == 'delete') { //
handleDelete(row.id)
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'approve') {
//
handleApprove(row, '单据号', row.number)
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain')
}
const detailRef1 = ref()
const handleApprove = (row : any, titleName : any, titleValue : any) => {
detailRef1.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain')
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain')
}
const detailRef1 = ref()
const handleApprove = (row: any, titleName: any, titleValue: any) => {
detailRef1.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain')
//
getList()
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ApplicationRecordMainApi.deleteApplicationRecordMain(id)
message.success(t('common.delSuccess'))
//
getList()
}
await getList()
} catch {}
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ApplicationRecordMainApi.deleteApplicationRecordMain(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 ApplicationRecordMainApi.exportApplicationRecordMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ApplicationRecordMainApi.exportApplicationRecordMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
ApplicationRecordDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
/**
* tableForm方法
*/
const tableFormKeys = {}
ApplicationRecordDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await ApplicationRecordMainApi.createApplicationRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await ApplicationRecordMainApi.updateApplicationRecordMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await ApplicationRecordMainApi.createApplicationRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await ApplicationRecordMainApi.updateApplicationRecordMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ApplicationRecordMainApi.importTemplate()
})
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ApplicationRecordMainApi.importTemplate()
})
</script>

38
src/views/eam/basicInspectionOption/itemSelectSetForm.vue

@ -65,7 +65,7 @@
</el-col>
</el-row>
</el-form>
<el-table :data="inspectionItemData" style="width: 100%; height: 80%">
<el-table :data="inspectionItemData" style="width: 100%; height: 200px">
<el-table-column prop="itemCode" label="巡检项ID" />
<el-table-column prop="itemName" label="巡检名称" />
<el-table-column prop="isSelectd" label="" width="150" >
@ -83,15 +83,6 @@
</template>
</el-table-column>
</el-table>
<el-pagination
small
:page-size="3"
background
layout="prev, pager, next"
:total="5"
class="mt-4"
@current-change="handleGroupPageChange"
/>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
@ -109,6 +100,7 @@ import { SearchTable } from '@/components/SearchTable'
import { InspectionItemSelectSet} from "@/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data";
import * as inspectionItemItemSelectSetApi from "@/api/eam/inspectionItemSelectSet";
import {ElInput} from "element-plus";
import {ref} from "vue";
defineOptions({ name: 'TeamForm' })
@ -128,6 +120,7 @@ const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const inspectionItemData = ref([])
const itemsId = ref('')
const itemData = ref({
id: '',
@ -216,7 +209,6 @@ const addItemCommon = (multiple,field) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick?.(async () => {
if (formField === 'xunJianItem') {
let itemsId = '';
//ID
val.forEach(item => {
const isExist = tags.value.some(tag => tag.id === item.id);
@ -227,19 +219,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
itemsId.value = item.itemCode;
});
inspectionItemData.value = [];
let query = {
itemsId: itemsId.value
}
let res = await inspectionItemItemSelectSetApi.getInspectionItemSelectSetList(query)
//
try {
formLoading.value = true;
inspectionItemData.value = [];
for (const item of itemsId.split(",")) {
let res = await request.get({url: `/eam/basic/inspection-item/get?id=` + item})
console.log(res)
for (const item of res) {
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['itemCode'] = item.id;
newItem['itemName'] = item.name;
newItem['equipmentParts'] = item.equipmentParts;
newItem['isSelectd'] = true;
inspectionItemData.value.push(newItem);
}
@ -285,7 +280,7 @@ const open = async (type: string, row?: object) => {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-inspection-option-item/getList?optionCode=` + row.code})
let res = await inspectionItemItemSelectSetApi.getRalInspectionOptionItemList(row.code)
try {
inspectionItemData.value = [];
formLoading.value = true;
@ -320,7 +315,6 @@ const submitForm = async () => {
message.warning('巡检项最多10个');
return
}
// ID
formData.value.selectId = tags.value[0].selectId
//
@ -328,7 +322,7 @@ const submitForm = async () => {
try {
if (formType.value === 'create') {
for (var i = 0; i < inspectionItemData.value.length; i++) {
inspectionItemData.value[i].optionCode = formData.value.code
inspectionItemData.value[i].optionCode = formData.value.code
}
formData.value.optionItem = inspectionItemData.value
//

31
src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue

@ -65,10 +65,9 @@
</el-col>
</el-row>
</el-form>
<el-table :data="maintenanceItemData" style="width: 100%; height: 80%">
<el-table :data="maintenanceItemData" style="width: 100%; height: 200px">
<el-table-column prop="itemCode" label="保养项ID" />
<el-table-column prop="itemName" label="保养名称" />
<!-- <el-table-column prop="equipmentParts" label="保养部位" />-->
<el-table-column prop="isSelectd" label="" width="150" >
<template #header>
<span>是否必选默认是</span>
@ -101,6 +100,11 @@ import { SearchTable } from '@/components/SearchTable'
import { BasicMaintenanceItemSelectSet} from "@/views/eam/maintenanceItemSelectSet/maintenanceItemSelectSet.data";
import * as maintenanceItemSelectSetApi from "@/api/eam/maintenanceItemSelectSet";
import {ElInput} from "element-plus";
import {ref} from "vue";
import {
getMaintenanceItemSelectSetList,
getRalMaintenanceOptionItemList
} from "@/api/eam/maintenanceItemSelectSet";
defineOptions({ name: 'TeamForm' })
@ -119,6 +123,7 @@ const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const maintenanceItemData = ref([])
const itemsId = ref('')
const itemData = ref({
id: '',
@ -159,8 +164,6 @@ const basicFormRef = ref() // 表单 Ref
/** 删除巡检项 */
const handleClose = (id: string) => {
console.log(id)
console.log(tags)
const index = tags.value.findIndex(tag => tag.selectId === id);
if (index !== -1) {
tags.value.splice(index, 1);
@ -209,7 +212,6 @@ const addItemCommon = (multiple,field) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick?.(async () => {
if (formField === 'baoYangItem') {
let itemsId = '';
//ID
val.forEach(item => {
const isExist = tags.value.some(tag => tag.id === item.id);
@ -220,18 +222,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
itemsId.value = item.itemCode;
});
maintenanceItemData.value = []
let query = {
itemsId: itemsId.value
}
let res = await maintenanceItemSelectSetApi.getMaintenanceItemSelectSetList(query);
//
try {
formLoading.value = true;
maintenanceItemData.value = [];
for (const item of itemsId.split(",")) {
let res = await request.get({url: `/eam/basic/maintenance-item/get?id=` + item})
for (const item of res) {
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['itemCode'] = item.id;
newItem['itemName'] = item.name;
newItem['equipmentParts'] = item.equipmentParts;
newItem['isSelectd'] = true;
maintenanceItemData.value.push(newItem);
}
@ -277,7 +282,7 @@ const open = async (type: string, row?: object) => {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-maintenance-option-item/getList?optionCode=` + row.code})
let res = await maintenanceItemSelectSetApi.getRalMaintenanceOptionItemList(row.code);
try {
maintenanceItemData.value = [];
formLoading.value = true;

27
src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue

@ -65,7 +65,7 @@
</el-col>
</el-row>
</el-form>
<el-table :data="spotCheckItemData" style="width: 100%; height: 80%">
<el-table :data="spotCheckItemData" style="width: 100%; height: 200px">
<el-table-column prop="itemCode" label="点检项ID" />
<el-table-column prop="itemName" label="点检名称" />
<el-table-column prop="isSelectd" label="" width="150" >
@ -100,6 +100,11 @@ import { BasicSpotCheckSelectSet} from "@/views/eam/spotCheckSelectSet/spotCheck
import * as SpotCheckSelectSetApi from "@/api/eam/spotCheckSelectSet";
import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption";
import {ElInput} from "element-plus";
import {
getRalSpotCheckOptionItemList,
getSpotCheckSelectSetList
} from "@/api/eam/spotCheckSelectSet";
import {ref} from "vue";
defineOptions({ name: 'TeamForm' })
@ -119,6 +124,7 @@ const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const spotCheckItemData = ref([])
const itemsId = ref('')
const itemData = ref({
id: '',
@ -209,7 +215,6 @@ const addItemCommon = (multiple,field) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick?.(async () => {
if (formField === 'dianJianItem') {
let itemsId = '';
//ID
val.forEach(item => {
const isExist = tags.value.some(tag => tag.id === item.id);
@ -220,18 +225,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
itemsId.value = item.itemCode;
});
spotCheckItemData.value = [];
let query = {
itemsId: itemsId.value
}
let res = await SpotCheckSelectSetApi.getSpotCheckSelectSetList(query);
//
try {
formLoading.value = true;
spotCheckItemData.value = [];
for (const item of itemsId.split(",")) {
let res = await request.get({url: `/eam/basic/spot-check-item/get?id=` + item})
for (const item of res) {
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['itemCode'] = item.id;
newItem['itemName'] = item.name;
newItem['equipmentParts'] = item.equipmentParts;
newItem['isSelectd'] = true;
spotCheckItemData.value.push(newItem);
}
@ -277,7 +286,7 @@ const open = async (type: string, row?: object) => {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-spotCheck-option-item/getList?optionCode=` + row.code})
let res = await SpotCheckSelectSetApi.getRalSpotCheckOptionItemList(row.code);
try {
spotCheckItemData.value = [];
formLoading.value = true;

58
src/views/eam/classTypeRole/index.vue

@ -33,7 +33,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -69,6 +69,7 @@ import * as roleApi from '@/api/system/role'
import { Role } from '@/views/system/role/role.data'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as InspectionItemSelectSetApi from "@/api/eam/inspectionItemSelectSet";
defineOptions({ name: 'ClassTypeRole' })
@ -144,11 +145,23 @@ const buttonBaseClick = (val, item) => {
}
}
const isShowMainButton = (row,val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:class-type-role:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:class-type-role:delete'}), //
]
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:class-type-role:update'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:class-type-role:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:class-type-role:update'}),
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:inspection-item:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
@ -156,6 +169,10 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
}
}
@ -215,6 +232,37 @@ const handleDelete = async (id: number) => {
} catch {}
}
/** 启用 */
const handleEnable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await ClassTypeRoleApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 禁用 */
const handleDisable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'FALSE'
await ClassTypeRoleApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {

127
src/views/eam/countadjustPlan/countadjustPlan.data.ts

@ -4,75 +4,74 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
export const CountadjustPlanRules = reactive({
number: [required],
name: [required],
classification: [
{ required: true, message: '请选择盘点类型', trigger: 'blur' }
],
classification: [{ required: true, message: '请选择盘点类型', trigger: 'blur' }]
})
export const CountadjustPlan = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '计划编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '盘点类型',
field: 'classification',
sort: 'custom',
dictType: DICT_TYPE.CLASSIFICATION,
dictClass: 'string',
isSearch: false,
isTable: true,
isForm: true,
table: {
width: 150
export const CountadjustPlan = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '计划编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false
},
tableForm: {
type: 'Select',
disabled: false
}
},
{
label: '是否账内库',
field: 'isInAccount',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 140
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
{
label: '盘点类型',
field: 'classification',
sort: 'custom',
dictType: DICT_TYPE.PART_CLASS,
dictClass: 'string',
isSearch: false,
isTable: true,
isForm: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: false
}
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
{
label: '是否账内库',
field: 'isInAccount',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 140
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
activeValue: 'TRUE'
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
])
)

540
src/views/eam/countadjustWork/index.vue

@ -1,306 +1,360 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="CountJobMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="CountJobMain.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountJobMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<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 #number="{row}">
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" :rules="CountJobMainRules" :formAllSchemas="CountJobMain.allSchemas"
:tableAllSchemas="CountJobDetail.allSchemas" :tableFormRules="CountJobDetailRules" :tableData="tableData"
:apiUpdate="CountJobMainApi.updateCountJobMain" :apiCreate="CountJobMainApi.createCountJobMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
<BasicForm
ref="formRef"
@success="getList"
:rules="CountJobMainRules"
:formAllSchemas="CountJobMain.allSchemas"
:tableAllSchemas="CountJobDetail.allSchemas"
:tableFormRules="CountJobDetailRules"
:tableData="tableData"
:apiUpdate="CountJobMainApi.updateCountJobMain"
:apiCreate="CountJobMainApi.createCountJobMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="CountJobMain.allSchemas"
:detailAllSchemas="CountJobDetail.allSchemas" :detailAllSchemasRules="CountJobDetailRules"
:apiCreate="CountJobDetailApi.createCountJobDetail" :apiUpdate="CountJobDetailApi.updateCountJobDetail"
:apiPage="CountJobDetailApi.getCountJobDetailPage" :apiDelete="CountJobDetailApi.deleteCountJobDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="CountJobMain.allSchemas"
:detailAllSchemas="CountJobDetail.allSchemas"
:detailAllSchemasRules="CountJobDetailRules"
:apiCreate="CountJobDetailApi.createCountJobDetail"
:apiUpdate="CountJobDetailApi.updateCountJobDetail"
:apiPage="CountJobDetailApi.getCountJobDetailPage"
:apiDelete="CountJobDetailApi.deleteCountJobDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
:detailButtonIsShow="true"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/countJobDetail/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShow="false"/>
<ImportForm
ref="importFormRef"
url="/eam/countJobDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:isShow="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CountJobMain, CountJobMainRules, CountJobDetail, CountJobDetailRules } from './countadjustWork.data'
import * as CountJobMainApi from '@/api/eam/countJobMain'
import * as CountJobDetailApi from '@/api/eam/countJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import download from '@/utils/download'
import {
CountJobMain,
CountJobMainRules,
CountJobDetail,
CountJobDetailRules
} from './countadjustWork.data'
import * as CountJobMainApi from '@/api/eam/countJobMain'
import * as CountJobDetailApi from '@/api/eam/countJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'CountadjustWork' })
//
defineOptions({ name: 'CountadjustWork' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CountJobMain.allSchemas.tableColumns)
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CountJobMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: CountJobMainApi.getCountJobMainPage //
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const { getList, setSearchParams } = tableMethods
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: CountJobMainApi.getCountJobMainPage //
})
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const { getList, setSearchParams } = tableMethods
//
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 HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
//
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 = (row) => {
return [
defaultButtons.mainExport({hasPermi:'item:countadjustWork:export'}),//
defaultButtons.mainAdjustImport({hasPermi:'item:countadjustWork:import'}),//
]
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
// -
const buttonTableClick = async (val, row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainExport({ hasPermi: 'item:countadjustWork:export' }), //
defaultButtons.mainAdjustImport({ hasPermi: 'item:countadjustWork:import' }) //
]
}
if (val == 'edit') { //
openForm('update', row)
}
else if (val == 'mainExport') { //
handleMainExport(row.id)
}
else if (val == 'mainAdjustImport') { //
handleImport()
}
else if (val == 'delete') { //
handleDelete(row.id)
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'mainExport') {
//
handleMainExport(row.id)
} else if (val == 'mainAdjustImport') {
//
handleImport()
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicCountJobMain')
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicCountJobMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await CountJobMainApi.deleteCountJobMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CountJobMainApi.deleteCountJobMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id : number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountJobMainApi.handleMainExport(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id: number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountJobMainApi.handleMainExport(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountJobMainApi.exportCountJobMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountJobMainApi.exportCountJobMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
CountJobDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
/**
* tableForm方法
*/
const tableFormKeys = {}
CountJobDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await CountJobMainApi.createCountJobMain(data)
message.success(t('common.createSuccess'))
} else {
await CountJobMainApi.updateCountJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await CountJobMainApi.createCountJobMain(data)
message.success(t('common.createSuccess'))
} else {
await CountJobMainApi.updateCountJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await CountJobMainApi.importTemplate()
})
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await CountJobMainApi.importTemplate()
})
</script>

8
src/views/eam/equipmentAccounts/equipmentAccounts.data.ts

@ -62,6 +62,12 @@ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: false
},
{
label: '出厂编号',
field: 'factoryCode',
sort: 'custom',
isSearch: false
},
{
label: '设备类型',
field: 'type',
@ -625,7 +631,7 @@ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action',
isForm: false,
table: {
width: 150,
width: 200,
fixed: 'right'
}
}

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

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="EquipmentAccounts.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentAccounts.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentAccounts.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
@ -27,13 +31,13 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<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)" />
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -51,68 +55,105 @@
/>
<!-- 详情 -->
<DetailLedger
ref="detailRef"
:isBasic="true"
:allSchemas="EquipmentAccounts.allSchemas"
:subTabs="subTabList"
:operationRecordList="operationRecordList"
@handleOperationTabsChange="handleOperationTabsChange"
<DetailLedger
ref="detailRef"
:isBasic="true"
:allSchemas="EquipmentAccounts.allSchemas"
:subTabs="subTabList"
:operationRecordList="operationRecordList"
@handleOperationTabsChange="handleOperationTabsChange"
:detailAllSchemas="detailAllSchemas"
:apiPage="apiPage"
:dialogApiPage="dialogApiPage"
:dialogAllSchemas="dialogAllSchemas"
:dynamicInfoFields="dynamicInfoFields"
funcCode="device_mould_file"
/>
/>
<!-- 主要部件 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="submitEquipmentMainPartRelation" />
<!-- 备件 -->
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device/equipment-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/eam/device/equipment-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentAccounts,EquipmentAccountsRules } from './equipmentAccounts.data'
import { EquipmentAccounts, EquipmentAccountsRules } from './equipmentAccounts.data'
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import DetailLedger from '@/components/Detail/src/DetailLedger.vue'
import { RelationMainPart,RelationMainPartRules } from '../relationMainPart/relationMainPart.data'
import { RelationMainPart, RelationMainPartRules } from '../relationMainPart/relationMainPart.data'
import * as RelationMainPartApi from '@/api/eam/relationMainPart'
import { EquipmentMainPart,EquipmentMainPartRules } from '../equipmentMainPart/equipmentMainPart.data'
import {
EquipmentMainPart,
EquipmentMainPartRules
} from '../equipmentMainPart/equipmentMainPart.data'
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart'
import { SparePart,SparePartRules } from '../sparePart/sparePart.data'
import * as SparePartApi from '@/api/eam/sparePart'
import { EquipmentToolSparePart,EquipmentToolSparePartRules } from '../equipmentToolSparePart/equipmentToolSparePart.data'
import { Item, ItemRules } from '../item/item.data'
import * as ItemApi from '@/api/eam/item'
import {
EquipmentToolSparePart,
EquipmentToolSparePartRules
} from '../equipmentToolSparePart/equipmentToolSparePart.data'
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart'
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data'
import {
EquipmentReportRepairRequest,
EquipmentReportRepairRequestRules
} from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data'
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
import { EquipmentSpotCheckRecordMain,EquipmentSpotCheckRecordMainRules } from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data'
import {
EquipmentSpotCheckRecordMain,
EquipmentSpotCheckRecordMainRules
} from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data'
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain'
import { EquipmentSpotCheckRecordDetail,EquipmentSpotCheckRecordDetailRules } from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data'
import {
EquipmentSpotCheckRecordDetail,
EquipmentSpotCheckRecordDetailRules
} from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data'
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail'
import { EquipmentInspectionRecordMain,EquipmentInspectionRecordMainRules } from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data'
import {
EquipmentInspectionRecordMain,
EquipmentInspectionRecordMainRules
} from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data'
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain'
import { EquipmentInspectionRecordDetail,EquipmentInspectionRecordDetailRules } from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data'
import {
EquipmentInspectionRecordDetail,
EquipmentInspectionRecordDetailRules
} from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data'
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail'
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data'
import {
EquipmentRepairRecordMain,
EquipmentRepairRecordMainRules
} from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data'
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain'
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data'
import {
EquipmentRepairRecordDetail,
EquipmentRepairRecordDetailRules
} from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data'
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail'
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data'
import {
EquipmentMaintenanceRecordMain,
EquipmentMaintenanceRecordMainRules
} from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data'
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import {
EquipmentMaintenanceRecordDetail,
EquipmentMaintenanceRecordDetailRules
} from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as WorkshopApi from '@/api/wms/workshop'
import * as ProductionlineApi from '@/api/wms/productionline'
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer'
defineOptions({ name: 'EquipmentAccounts' })
const message = useMessage() //
@ -123,8 +164,8 @@ const routeName = ref()
const deviceNumber = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentAccounts.allSchemas.tableColumns)
const tabs = ref<{ label: string; prop: string; }[]>([])
const subTabList = ref([]);
const tabs = ref<{ label: string; prop: string }[]>([])
const subTabList = ref([])
const detailAllSchemas = ref()
const apiPage = ref()
const dialogApiPage = ref()
@ -134,16 +175,16 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'workshopName'){
if (formField == 'workshopName') {
setV['workshopCode'] = val[0]['code']
setV['workshopName'] = val[0]['name']
}else if(formField == 'lineName'){
} else if (formField == 'lineName') {
setV['lineCode'] = val[0]['code']
setV['lineName'] = val[0]['name']
}else if(formField == 'manufactureName'){
} else if (formField == 'manufactureName') {
setV['manufactureCode'] = val[0]['number']
setV['manufactureName'] = val[0]['name']
}else if(formField == 'supplierName'){
} else if (formField == 'supplierName') {
setV['supplierCode'] = val[0]['number']
setV['supplierName'] = val[0]['name']
}
@ -152,24 +193,22 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}
const operationRecordList = ref([
{label:'报修记录',value:'report'},
{label:'维修记录',value:'repair'},
{label:'保养记录',value:'maintenance'},
{label:'巡检记录',value:'inspection'},
{label:'点检记录',value:'spot_check'},
{ label: '报修记录', value: 'report' },
{ label: '维修记录', value: 'repair' },
{ label: '保养记录', value: 'maintenance' },
{ label: '巡检记录', value: 'inspection' },
{ label: '点检记录', value: 'spot_check' }
])
const dynamicInfoFields = ref([
"totalRunningTime",
"maintenanceRunningTime",
"usageTimes",
"lastInspectionDate",
"outageRate",
"breakdownRecover",
"purchaseInterval"
]);
'totalRunningTime',
'maintenanceRunningTime',
'usageTimes',
'lastInspectionDate',
'outageRate',
'breakdownRecover',
'purchaseInterval'
])
//
const updataTableColumns = (val) => {
@ -185,12 +224,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-accounts:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-accounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-accounts:export'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'eam:equipment-accounts:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'eam:equipment-accounts:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'eam:equipment-accounts:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -203,37 +242,47 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-accounts:update'}), //
defaultButtons.componentBtn({hasPermi:'eam:equipment-accounts:component'}), //
defaultButtons.sparePartBtn({hasPermi:'eam:equipment-accounts:item'}), //
defaultButtons.mainListEditBtn({ hasPermi: 'eam:equipment-accounts:update' }), //
defaultButtons.componentBtn({ hasPermi: 'eam:equipment-accounts:component' }), //
defaultButtons.sparePartBtn({ hasPermi: 'eam:equipment-accounts:item' }) //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-accounts:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'component') { //
} else if (val == 'component') {
//
openComponent(row)
} else if (val == 'sparePart') { //
} else if (val == 'sparePart') {
//
openSparePart(row)
}
}
@ -241,32 +290,37 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = async (type: string, row?: any) => {
if(type == 'update'){
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
if (type == 'update') {
const equipmentManufacturerNoPage =
await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
row.workshopName = workshopNoPage?.find(item=>item.code == row.workshopCode)?.name
row.lineName = productionlineNoPage?.find(item=>item.code == row.lineCode)?.name
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({})
row.workshopName = workshopNoPage?.find((item) => item.code == row.workshopCode)?.name
row.lineName = productionlineNoPage?.find((item) => item.code == row.lineCode)?.name
row.manufactureName = equipmentManufacturerNoPage?.find(
(item) => item.number == row.manufactureCode
)?.name
row.supplierName = equipmentSupplierNoPage?.find(
(item) => item.number == row.supplierCode
)?.name
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentAccounts.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
const formsSuccess = async (formType, data) => {
var isHave = EquipmentAccounts.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;
return
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await EquipmentAccountsApi.createEquipmentAccounts(data)
message.success(t('common.createSuccess'))
@ -337,45 +391,49 @@ const searchFormClick = (searchData) => {
getList() //
}
const searchTableRef = ref()
const searchSparePartTableRef = ref()
const searchTableSelections = ref([])
const searchTableSparePartSelections = ref([])
const syncData = async (row) => {
searchTableSparePartSelections.value = []
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code,type: 'DEVICE' }).then(async (res) => {
await EquipmentMainPartApi.getEquipmentMainPartNoPage({type: 'DEVICE' }).then(response => {
searchTableSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
await RelationMainPartApi.getRelationMainPartNoPage({
equipmentCode: row.code,
type: 'DEVICE'
}).then(async (res) => {
await EquipmentMainPartApi.getEquipmentMainPartNoPage({ type: 'DEVICE' }).then((response) => {
searchTableSelections.value = response.filter((element) => {
let flag = false
res.forEach((item) => {
if (element.code == item.mainPartCode) {
flag = true;
flag = true
}
});
return flag;
});
});
});
};
})
return flag
})
})
})
}
const syncSparePartData = async (row) => {
searchTableSparePartSelections.value = []
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code}).then(async (res) => {
await SparePartApi.getSparePartNoPage({}).then(response => {
searchTableSparePartSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({
equipmentToolCode: row.code
}).then(async (res) => {
await SparePartApi.getSparePartNoPage({}).then((response) => {
searchTableSparePartSelections.value = response.filter((element) => {
let flag = false
res.forEach((item) => {
if (element.code == item.sparePartCode) {
flag = true;
flag = true
}
});
return flag;
});
});
});
};
})
return flag
})
})
})
}
/** 绑定备件操作 */
const openComponent = async (row : any) => {
const openComponent = async (row: any) => {
await syncData(row)
searchTableRef.value.open(
'选择部件',
@ -384,9 +442,9 @@ const openComponent = async (row : any) => {
'equipmentMainPart',
EquipmentMainPart.allSchemas.searchSchema,
true,
null,//type
null, //type
row,
{type: 'DEVICE'},
{ type: 'DEVICE' },
null,
null,
null,
@ -394,16 +452,16 @@ const openComponent = async (row : any) => {
)
}
const openSparePart = async (row : any) => {
const openSparePart = async (row: any) => {
await syncSparePartData(row)
searchSparePartTableRef.value.open(
'选择备件',
SparePart.allSchemas,
SparePartApi.getSparePartPage,
'sparePartPart',
SparePart.allSchemas.searchSchema,
Item.allSchemas,
ItemApi.getItemPage,
'item',
Item.allSchemas.searchSchema,
true,
null,//type
null, //type
row,
null,
null,
@ -413,37 +471,38 @@ const openSparePart = async (row : any) => {
)
}
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => {
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => {
const deviceMainPartRelList = val.map((element) => ({
mainPartCode: element.code,
equipmentCode: rowRef.code,
type: 'DEVICE'
}))
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then(res => {
mainPartCode: element.number,
equipmentCode: rowRef.code,
type: 'DEVICE'
}))
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then((res) => {
message.success(t('common.createSuccess'))
getList()
})
}
const handleOperationTabsChange = (val) => {
if(val == 'report'){
if (val == 'report') {
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage
detailAllSchemas.value = EquipmentReportRepairRequest.allSchemas
}else if(val == 'repair'){
} else if (val == 'repair') {
apiPage.value = EquipmentRepairRecordMainApi.getEquipmentRepairRecordMainPage
detailAllSchemas.value = EquipmentRepairRecordMain.allSchemas
dialogApiPage.value = EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage
dialogAllSchemas.value = EquipmentRepairRecordDetail.allSchemas
}else if(val == 'maintenance'){
} else if (val == 'maintenance') {
apiPage.value = EquipmentMaintenanceRecordMainApi.getEquipmentMaintenanceRecordMainPage
detailAllSchemas.value = EquipmentMaintenanceRecordMain.allSchemas
dialogApiPage.value = EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage
dialogApiPage.value =
EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage
dialogAllSchemas.value = EquipmentMaintenanceRecordDetail.allSchemas
}else if(val == 'inspection'){
} else if (val == 'inspection') {
apiPage.value = EquipmentInspectionRecordMainApi.getEquipmentInspectionRecordMainPage
detailAllSchemas.value = EquipmentInspectionRecordMain.allSchemas
dialogApiPage.value = EquipmentInspectionRecordDetailApi.getEquipmentInspectionRecordDetailPage
dialogAllSchemas.value = EquipmentInspectionRecordDetail.allSchemas
}else if(val == 'spot_check'){
} else if (val == 'spot_check') {
apiPage.value = EquipmentSpotCheckRecordMainApi.getEquipmentSpotCheckRecordMainPage
detailAllSchemas.value = EquipmentSpotCheckRecordMain.allSchemas
dialogApiPage.value = EquipmentSpotCheckRecordDetailApi.getEquipmentSpotCheckRecordDetailPage
@ -451,16 +510,18 @@ const handleOperationTabsChange = (val) => {
}
}
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => {
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => {
const equipmentToolSparePartRelList = val.map((element) => ({
sparePartCode: element.code,
equipmentToolCode: rowRef.code,
type: 'DEVICE'
}))
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(res => {
message.success(t('common.createSuccess'))
getList()
})
sparePartCode: element.number,
equipmentToolCode: rowRef.code,
type: 'DEVICE'
}))
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(
(res) => {
message.success(t('common.createSuccess'))
getList()
}
)
}
/** 初始化 **/
@ -468,5 +529,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentAccountsApi.importTemplate()
})
</script>

6
src/views/eam/equipmentInspectionMain/equipmentInspectionMain.data.ts

@ -94,8 +94,10 @@ export const EquipmentInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '是否拍照',
field: 'isPictures',
sort: 'custom',
isSearch: true,
isForm: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
dictType: DICT_TYPE.FALSE_OR_TRUE,
dictClass: 'string',
form: {

27
src/views/eam/equipmentInspectionMain/finishForm1.vue

@ -13,18 +13,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="验证时间" prop="verifyTime">
<el-date-picker
v-model="formData.verifyTime"
type="datetime"
value-format="x"
placeholder="选择验证时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
@ -41,7 +29,10 @@ import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain
import * as EquipmentInspectionMainApi from '@/api/eam/equipmentInspectionMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import {updateEquipmentInspection} from "@/api/eam/equipmentInspectionMain";
import {
updateEquipmentInspection,
verifyEquipmentInspectionMain
} from "@/api/eam/equipmentInspectionMain";
defineOptions({ name: 'TeamForm' })
@ -63,9 +54,8 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
//verifyer: '',
verifyContent: '',
verifyTime: '',
status:''
})
const formRules = reactive({
// verifyer: [
@ -76,9 +66,6 @@ const formRules = reactive({
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTime: [
{ required: true, message: '验证时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
@ -102,8 +89,10 @@ const submitForm = async (val) => {
const valid = await basicFormRef.value.validate()
if (!valid) return
formData.value.status = '7'
//
await EquipmentInspectionMainApi.updateEquipmentInspection(formData.value)
await EquipmentInspectionMainApi.verifyEquipmentInspectionMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false

18
src/views/eam/equipmentInspectionMain/finishForm2.vue

@ -7,11 +7,11 @@
<!-- <el-input v-model="formData.maintenancer" placeholder="请输入巡检人" :disabled="isDisabled"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="巡检人电话" prop="maintenancePhone">
<el-input v-model="formData.maintenancePhone" placeholder="请输入巡检人电话" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="巡检人电话" prop="maintenancePhone">-->
<!-- <el-input v-model="formData.maintenancePhone" placeholder="请输入巡检人电话" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row>
<el-col :span="12">
@ -72,14 +72,16 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
maintenancePhone: '',
startTime:'',
endTime:'',
status:'5',
})
const formRules = reactive({
maintenancePhone: [
{ required: true, message: '巡检人电话不能为空', trigger: 'blur' },
startTime: [
{ required: true, message: '巡检开始时间不能为空', trigger: 'blur' },
],
endTime: [
{ required: true, message: '巡检结束时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref

30
src/views/eam/equipmentInspectionMain/index.vue

@ -190,7 +190,7 @@ const isShowEditStatusButton = (row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentInspectionMain:update'}), //
//defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListCancelBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentInspectionMain:update'}), //
@ -480,20 +480,8 @@ const getClosed1=(val)=> {
const getData1=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
await EquipmentInspectionMainApi.updateEquipmentInspectionOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
//
await getList()
}
)
}
@ -501,7 +489,6 @@ const getData1=(val)=> {
//finishForm2
const getClosed2=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
@ -509,17 +496,6 @@ const getClosed2=(val)=> {
//finishForm2
const getData2=(val)=> {
nextTick?.(async () => {
console.log(val)
// const params = ref({
// id: '',
// status: '',
// })
// params.value.id = val
// params.value.status = '5'
// //
// await EquipmentInspectionMainApi.executeEquipmentInspectionOrder(params.value)
//message.success(t(''))
//
await getList()
})
}

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

@ -50,7 +50,10 @@ export const EquipmentInspectionRecordMain = useCrudSchemas(reactive<CrudSchema[
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Radio'
}

47
src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts

@ -99,7 +99,10 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '故障类型',
field: 'faultType',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
@ -151,6 +154,9 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
@ -173,6 +179,9 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
@ -195,7 +204,9 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isForm:false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
@ -218,7 +229,9 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isForm:false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
@ -369,6 +382,9 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '所属厂区编号',
@ -382,6 +398,9 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'workshopCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
required: true,
form: {
componentProps: {
@ -597,26 +616,38 @@ export const EquipmentMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>(
label: '人数',
field: 'peoples',
sort: 'custom',
isSearch: true,
isForm: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '预计分钟',
field: 'estimatedMinutes',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '实际分钟',
field: 'actualMinutes',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '责任人多选',
field: 'chargePeoples',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '完成时间',

103
src/views/eam/equipmentMaintenanceMain/finishForm1.vue

@ -2,26 +2,9 @@
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false">
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="验证人" prop="verifyer">
<el-input v-model="formData.verifyer" placeholder="请输入验证人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="验证内容" prop="verifyContent">
<el-input v-model="formData.verifyContent" placeholder="请输入验证内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="验证时间" prop="verifyTime">
<el-date-picker
v-model="formData.verifyTime"
type="datetime"
value-format="x"
placeholder="选择验证时间">
</el-date-picker>
<el-input v-model="formData.verifyContent" type="textarea" :input-style="{height:'100px'}" maxlength="300" placeholder="请输入验证内容" />
</el-form-item>
</el-col>
</el-row>
@ -40,6 +23,7 @@
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import {verifyEquipmentMaintenanceMain} from "@/api/eam/equipmentMaintenanceMain";
defineOptions({ name: 'TeamForm' })
@ -61,93 +45,18 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
verifyer: '',
verifyContent: '',
verifyTime: '',
status:''
})
const formRules = reactive({
verifyer: [
{ required: true, message: '验证人不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyContent: [
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTime: [
{ required: true, message: '验证时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
// /** */
// const searchTableRef = ref();
// const _searchTableTitle = ref();
// const _searchTableAllSchemas = ref();
// const _searchTablePage = ref();
// const _formField = ref();
// const _searchField = ref();
// const _multiple = ref();
// const _type = ref();
// const _row = ref();
// const _searchCondition = ref({})
//
//
// const addItem = () =>{
// addItemCommon(true,'xunJianItem')
// }
//
// /** */
// const addItemCommon = (multiple,field) => {
// _searchCondition.value = {}
// const filters: any[] = []
// filters.push({
// action: "==",
// column: 'available',
// value: 'TRUE'
// })
// //
// _searchCondition.value.isSearch = true
// _searchCondition.value.filters = filters
// _searchTableTitle.value = ''
// _multiple.value = multiple
// _formField.value = field
// _searchField.value = field
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage
// _searchTableAllSchemas.value = InspectionItem.allSchemas
// openCommon()
// }
//
// /** */
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
// nextTick?.(() => {
// if (formField === 'xunJianItem') {
// val.forEach(item => {
// const isExist = tags.value.some(tag => tag.content === item.content);
// if (!isExist){
// const newItem = {};
// newItem['content'] = item.content;
// newItem['id'] = item.id;
// tags.value.push(newItem);
// }
// });
// }
// })
// }
// /**/
// const openCommon = () => {
// searchTableRef.value.open(
// _searchTableTitle.value,
// _searchTableAllSchemas.value,
// _searchTablePage.value,
// _formField.value,
// _searchField.value,
// _multiple.value,
// _type.value,
// _row.value,
// _searchCondition.value
// )
// }
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
@ -167,8 +76,10 @@ const submitForm = async (val) => {
const valid = await basicFormRef.value.validate()
if (!valid) return
formData.value.status = '7'
//
await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value)
await EquipmentMaintenanceMainApi.verifyEquipmentMaintenanceMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false

18
src/views/eam/equipmentMaintenanceMain/finishForm2.vue

@ -7,11 +7,11 @@
<!-- <el-input v-model="formData.maintenancer" placeholder="请输入保养人" :disabled="isDisabled"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="保养人电话" prop="maintenancePhone">
<el-input v-model="formData.maintenancePhone" placeholder="请输入保养人电话" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="保养人电话" prop="maintenancePhone">-->
<!-- <el-input v-model="formData.maintenancePhone" placeholder="请输入保养人电话" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row>
<el-col :span="12">
@ -71,14 +71,16 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
maintenancePhone: '',
startTime:'',
endTime:'',
status:'5',
})
const formRules = reactive({
maintenancePhone: [
{ required: true, message: '保养人电话不能为空', trigger: 'blur' },
startTime: [
{ required: true, message: '保养开始时间不能为空', trigger: 'blur' },
],
endTime: [
{ required: true, message: '保养结束时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref

36
src/views/eam/equipmentMaintenanceMain/index.vue

@ -198,14 +198,14 @@ const isShowEditStatusButton = (row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
//defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListCancelBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListValidateBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:equipmentMaintenanceMain:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:equipmentMaintenanceMain:update'}),
//defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:equipmentMaintenanceMain:update'}),
//defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:equipmentMaintenanceMain:update'}),
]
}
@ -539,7 +539,6 @@ const searchFormClick = (searchData) => {
//finishForm1
const getClosed1=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
@ -547,23 +546,8 @@ const getClosed1=(val)=> {
//finishForm1
const getData1=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
await EquipmentMaintenanceMainApi.updateMaintenanceOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
}
)
await getList()
})
}
//finishForm2
@ -577,16 +561,6 @@ const getClosed2=(val)=> {
//finishForm2
const getData2=(val)=> {
nextTick?.(async () => {
console.log(val)
// const params = ref({
// id: '',
// status: '',
// })
// params.value.id = val
// params.value.status = '5'
// //
// await EquipmentMaintenanceMainApi.executeMaintenanceOrder(params.value)
//message.success(t(''))
//
await getList()
})

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

@ -273,6 +273,14 @@ export const EquipmentMaintenanceRecordMain = useCrudSchemas(reactive<CrudSchema
dictType: DICT_TYPE.EAM_ORDER_STATUS,
dictClass: 'string',
},
{
label: '保养经验',
field: 'isExperience',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
},
// {
// label: '自动接单',
// field: 'autoOrder',

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

@ -32,8 +32,8 @@
<span>{{ row.recordNo }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -88,6 +88,7 @@ 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'
import {maintainExperienceBtn} from "@/utils/disposition/defaultButtons";
defineOptions({ name: 'EquipmentMaintenanceRecordMain' })
@ -154,21 +155,16 @@ const buttonBaseClick = (val, item) => {
}
}
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
defaultButtons.repairExperienceBtn({ hide:isShowMainButton(row,['0']),hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) //
]
const butttondata = (row) => {
return [
defaultButtons.maintainExperienceBtn({ hide:isShowMainButton(row),hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) //
]
}
//
const isShowMainButton = (row,val) => {
console.log(row.isExperience)
if (val.indexOf(row.isExperience) > -1) {
//
const isShowMainButton = (row) => {
if (row.isExperience === 'FALSE') {
return false
} else {
} else{
return true
}
}
@ -189,7 +185,7 @@ const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
//
const maintainExperienceFormRef = ref()
const openMaintainExperience = (type: string, row?: any) => {
maintainExperienceFormRef.value.open(type, row)
@ -225,7 +221,6 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
}
//
const maintainExperienceFormsSuccess = async (formType, data) => {
console.log(data)
const data1 = {
maintainRecordNumber: data.recordNo,
name: data.name,
@ -233,7 +228,6 @@ const maintainExperienceFormsSuccess = async (formType, data) => {
masterId: data.id,
orderType: 'MAINTAIN',
}
console.log(data1)
try {
await MaintainExperienceApi.createMaintainExperience(data1)
message.success(t('common.createSuccess'))

2
src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts

@ -17,7 +17,7 @@ export const EquipmentManufacturerRules = reactive({
export const EquipmentManufacturer = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备厂商编号',
label: '生产商编号',
field: 'number',
sort: 'custom',
isSearch: true,

25
src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts

@ -90,7 +90,10 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
dictType: DICT_TYPE.EAM_MAINTENANCE_LEVEL,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '设备编号',
@ -123,7 +126,10 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Radio'
}
@ -407,6 +413,12 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '故障描述',
field: 'faultDesc',
sort: 'custom',
isSearch: false
},
{
label: '流程状态',
field: 'status',
@ -438,12 +450,18 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '班组类型',
field: 'classType',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
// {
// label: '所属厂区编号',
@ -456,6 +474,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'workshopCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
required: true,
form: {
componentProps: {

16
src/views/eam/equipmentRepairJobMain/finishForm2.vue

@ -45,11 +45,11 @@
<!-- <el-input v-model="formData.maintenancer" placeholder="请输入执行人"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="维修人电话" prop="maintenancePhone">
<el-input v-model="formData.maintenancePhone" placeholder="请输入维修人电话" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="维修人电话" prop="maintenancePhone">-->
<!-- <el-input v-model="formData.maintenancePhone" placeholder="请输入维修人电话" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row>
<el-col :span="12">
@ -101,9 +101,8 @@ const formData = ref({
level: '',
startTime:'',
endTime:'',
maintenancePhone:'',
completeResult:'',
status:'6'
status:'5'
})
const formRules = reactive({
maintenanceDesc: [
@ -118,9 +117,6 @@ const formRules = reactive({
endTime: [
{ required: true, message: '结束时间不能为空', trigger: 'blur' },
],
maintenancePhone: [
{ required: true, message: '维修人电话不能为空', trigger: 'blur' },
],
completeResult: [
{ required: true, message: '结果不能为空', trigger: 'blur' },
],

10
src/views/eam/equipmentRepairJobMain/index.vue

@ -184,7 +184,7 @@ const isShowBaoXiuButton = (row) => {
// -
const butttondata = (row) => {
return[
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
//defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListTransferBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
@ -486,14 +486,6 @@ const getClosed2=(val)=> {
//finishForm2
const getData2=(val)=> {
nextTick?.(async () => {
// const params = ref({
// id: '',
// status: '',
// })
// params.value.id = val
// params.value.status = '5'
// //
// await EquipmentRepairJobMainApi.executeEquipmentRepairJobMain(params.value)
message.success(t('工单已完成'))
//
await getList()

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

@ -316,6 +316,14 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string',
isSearch: true,
},
{
label: '维修经验',
field: 'isExperience',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
},
{
label: '自动接单',
field: 'autoOrder',

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

@ -36,8 +36,8 @@
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event, row)" />
<template #action="{row}">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -103,6 +103,7 @@ 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'
import {repairExperienceBtn} from "@/utils/disposition/defaultButtons";
defineOptions({ name: 'EquipmentRepairRecordMain' })
@ -176,23 +177,17 @@ const buttonBaseClick = (val, item) => {
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
defaultButtons.repairExperienceBtn({ hide:isShowMainButton(row,['0']),hasPermi: 'eam:equipmentRepairRecordMain:repairExperience' }) //
]
const butttondata = (row) => {
return [
defaultButtons.repairExperienceBtn({ hide:isShowMainButton(row),hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) //
]
}
//
const isShowMainButton = (row,val) => {
console.log(row.isExperience)
if (val.indexOf(row.isExperience) > -1) {
//
const isShowMainButton = (row) => {
if (row.isExperience === 'FALSE') {
return false
} else {
} else{
return true
}
}
@ -252,7 +247,6 @@ const openRepairExperience = (type: string, row?: any) => {
}
//
const repairExperienceFormsSuccess = async (formType, data) => {
console.log(data)
const data1 = {
repairRecordNumber: data.recordNo,
name: data.name,
@ -260,7 +254,6 @@ const repairExperienceFormsSuccess = async (formType, data) => {
masterId: data.id,
orderType: 'REPAIR',
}
console.log(data1)
try {
await RepairExperienceApi.createRepairExperience(data1)
message.success(t('common.createSuccess'))

72
src/views/eam/equipmentReportRepairRequest/audiForm.vue

@ -2,29 +2,24 @@
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false">
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px">
<el-row>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="审核人" prop="approver">-->
<!-- <el-input v-model="formData.approver" placeholder="请输入审核人" :disabled="isDisabled"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="审核内容" prop="approveContent">
<el-input v-model="formData.approveContent" placeholder="请输入审核内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="审核时间" prop="approveTime">
<el-date-picker
v-model="formData.approveTime"
type="datetime"
value-format="x"
placeholder="选择审核时间">
</el-date-picker>
<el-input v-model="formData.approveContent" type="textarea" :input-style="{height:'100px'}" maxlength="300" placeholder="请输入审核内容" />
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="审核时间" prop="approveTime">-->
<!-- <el-date-picker-->
<!-- v-model="formData.approveTime"-->
<!-- type="datetime"-->
<!-- value-format="x"-->
<!-- placeholder="选择审核时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
@ -40,7 +35,6 @@
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import * as EquipmentReportRepairRequestApi from "@/api/eam/equipmentReportRepairRequest";
import {audiEquipmentReportRepairOrder} from "@/api/eam/equipmentReportRepairRequest";
defineOptions({ name: 'TeamForm' })
@ -50,7 +44,7 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formType = ref('') // passed - noPassed -
const tags=ref([])
const inputValue = ref('')
@ -62,22 +56,17 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
//approver: '',
approveContent: '',
approveTime: '',
status:'',
})
const formRules = reactive({
// approver: [
// { required: true, message: '', trigger: 'blur' },
// { max: 50, message: '50', trigger: 'blur' }
// ],
approveContent: [
{ required: true, message: '审核内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
approveTime: [
{ required: true, message: '审核时间不能为空', trigger: 'blur' },
],
// approveTime: [
// { required: true, message: '', trigger: 'blur' },
// ],
})
const basicFormRef = ref() // Ref
@ -85,7 +74,7 @@ const basicFormRef = ref() // 表单 Ref
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
dialogTitle.value = t('编辑')
formType.value = type
//
formData.value.id = row.id
@ -95,16 +84,29 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const submitForm = async (val) => {
//success
emit('success',formData.value.id)
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await EquipmentReportRepairRequestApi.audiEquipmentReportRepairOrder(formData.value)
dialogVisible.value = false
if(formType.value == 'passed'){
formData.value.status = '3'
//
await EquipmentReportRepairRequestApi.audiEquipmentReportRepairOrder(formData.value)
dialogVisible.value = false
}else if(formType.value == 'noPassed'){
formData.value.status = '4'
//
await EquipmentReportRepairRequestApi.audiEquipmentReportRepairOrder(formData.value)
dialogVisible.value = false
}else{
console.log("error")
}
//success
emit('success')
}
const handleClose=(val)=>{

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

@ -105,7 +105,10 @@ export const EquipmentReportRepairRequest = useCrudSchemas(reactive<CrudSchema[]
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Radio'
}
@ -140,6 +143,9 @@ export const EquipmentReportRepairRequest = useCrudSchemas(reactive<CrudSchema[]
field: 'workshopCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
required: true,
form: {
componentProps: {
@ -162,12 +168,14 @@ export const EquipmentReportRepairRequest = useCrudSchemas(reactive<CrudSchema[]
field: 'repairmaner',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '报修人联系电话',
field: 'repairPhone',
sort: 'custom',
isSearch: false
isSearch: false,
isForm: false,
},
{
label: '报修状态',

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

@ -162,7 +162,7 @@ const butttondata = (row) => {
defaultButtons.mainListAuditedBtn({ hide: isShowStatusButton(row, ['2']), hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
defaultButtons.mainListRevokeBtn({ hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
defaultButtons.mainListFinishBtn({ hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:equipmentReportRepairRequest:update' }),
defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
//defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
]
}
@ -281,20 +281,12 @@ const handleFinish = async (id: number) => {
//
const handleAudited = async (row) => {
message.confirmAudi(t('')).then(async () => {
//
audiFormRef.value.open('update', row);
//
audiFormRef.value.open('passed', row);
}).catch(async (action: Action) => {
//
if (action === 'cancel') {
const params = ref({
id: '',
status: '',
})
params.value.id = row.id
params.value.status = '4'
await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
audiFormRef.value.open('noPassed', row);
}
})
}
@ -387,23 +379,9 @@ const getClosed = (val) => {
//audiForm
const getData = (val) => {
nextTick?.(async () => {
try {
const params = ref({
id: '',
status: '',
})
params.value.id = val
params.value.status = '3'
await EquipmentReportRepairRequestApi.updateEquipmentReportRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch { }
}
)
nextTick?.(() => {
getList()
})
}

35
src/views/eam/equipmentSigning/equipmentSigning.data.ts

@ -54,10 +54,15 @@ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '设备信息', // 查询弹窗标题
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchPage: EquipmentAccountsApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
searchCondition:
[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'status',
value: 'TOACCEPT',
isMainValue: false
}]
}
},
@ -136,19 +141,22 @@ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
label: '供应商编号',
field: 'supplierCode',
sort: 'custom',
isSearch: true
isSearch: true,
isForm: false
},
{
label: '供应商联系人',
field: 'supplierPeople',
sort: 'custom',
isSearch: true
isSearch: true,
isForm: false
},
{
label: '供应商联系方式',
field: 'supplierTelephone',
sort: 'custom',
isSearch: false
isSearch: false,
isForm: false,
},
// {
// label: '流程状态',
@ -260,6 +268,7 @@ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
field: 'storageLocation',
sort: 'custom',
isSearch: false,
isForm: false,
form: {
component: 'Input',
componentProps: {
@ -279,28 +288,14 @@ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
field: 'workshopCode',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
isForm: false,
},
{
label: '产线编号',
field: 'lineCode',
sort: 'custom',
isSearch: true,
isForm: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {

8
src/views/eam/equipmentSigning/index.vue

@ -45,7 +45,7 @@
:rules="EquipmentSigningRules"
:formAllSchemas="EquipmentSigning.allSchemas"
:apiUpdate="EquipmentSigningApi.updateEquipmentSigning"
:apiCreate="EquipmentSigningApi.createEquipmentSigning"
:apiCreate="EquipmentSigningApi.createsEquipmentSigning"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
@ -140,8 +140,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-signing:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-signing:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-signing:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-signing:delete'}), //
]
// -
@ -179,7 +179,7 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EquipmentSigningApi.createEquipmentSigning(data)
await EquipmentSigningApi.createsEquipmentSigning(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentSigningApi.updateEquipmentSigning(data)

5
src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts

@ -312,7 +312,10 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '是否拍照',
field: 'isPictures',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
dictType: DICT_TYPE.FALSE_OR_TRUE,
dictClass: 'string',
},

34
src/views/eam/equipmentSpotCheckMain/finishForm1.vue

@ -2,29 +2,12 @@
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false">
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px">
<el-row>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="验证人" prop="verifyer">-->
<!-- <el-input v-model="formData.verifyer" placeholder="请输入验证人" :disabled="isDisabled"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="验证内容" prop="verifyContent">
<el-input v-model="formData.verifyContent" type="textarea" :input-style="{height:'100px'}" maxlength="300" placeholder="请输入验证内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="验证时间" prop="verifyTime">
<el-date-picker
v-model="formData.verifyTime"
type="datetime"
value-format="x"
placeholder="选择验证时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
@ -37,12 +20,9 @@
</template>
<script lang="ts" setup>
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain'
import * as EquipmentInspectionMainApi from '@/api/eam/equipmentInspectionMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import * as EquipmentSpotCheckMainApi from "@/api/eam/equipmentSpotCheckMain";
import {updateEquipmentSpotCheck} from "@/api/eam/equipmentSpotCheckMain";
defineOptions({ name: 'TeamForm' })
@ -64,23 +44,15 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
// verifyer: '',
verifyContent: '',
verifyTime: '',
status : '',
isRepair:"",
})
const formRules = reactive({
// verifyer: [
// { required: true, message: '', trigger: 'blur' },
// { max: 50, message: '50', trigger: 'blur' }
// ],
verifyContent: [
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTime: [
{ required: true, message: '验证时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
@ -105,8 +77,10 @@ const submitForm = async (val) => {
const valid = await basicFormRef.value.validate()
if (!valid) return
formData.value.status = '7'
//
await EquipmentSpotCheckMainApi.updateEquipmentSpotCheck(formData.value)
await EquipmentSpotCheckMainApi.verifyEquipmentSpotCheckMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false

18
src/views/eam/equipmentSpotCheckMain/finishForm2.vue

@ -7,11 +7,11 @@
<!-- <el-input v-model="formData.maintenancer" placeholder="请输入巡检人" :disabled="isDisabled"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="巡检人电话" prop="maintenancePhone">
<el-input v-model="formData.maintenancePhone" placeholder="请输入巡检人电话" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="巡检人电话" prop="maintenancePhone">-->
<!-- <el-input v-model="formData.maintenancePhone" placeholder="请输入巡检人电话" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row>
<el-col :span="12">
@ -73,14 +73,16 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
maintenancePhone: '',
startTime:'',
endTime:'',
status:'5',
})
const formRules = reactive({
maintenancePhone: [
{ required: true, message: '巡检人电话不能为空', trigger: 'blur' },
startTime: [
{ required: true, message: '点检开始时间不能为空', trigger: 'blur' },
],
endTime: [
{ required: true, message: '点检结束时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref

11
src/views/eam/equipmentSpotCheckMain/index.vue

@ -188,7 +188,7 @@ const isShowEditStatusButton = (row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
//defaultButtons.mainListEditBtn({hide: isShowStatusButton(row,['3','4']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListCancelBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
@ -507,15 +507,6 @@ const getClosed2=(val)=> {
const getData2=(val)=> {
nextTick?.(async () => {
console.log(val)
// const params = ref({
// id: '',
// status: '',
// })
// params.value.id = val
// params.value.status = '5'
//
//await EquipmentSpotCheckMainApi.executeEquipmentSpotCheckOrder(params.value)
//message.success(t(''))
//
await getList()
})

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

@ -250,7 +250,10 @@ export const EquipmentSpotCheckRecordMain = useCrudSchemas(reactive<CrudSchema[]
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Radio'
}

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

@ -113,7 +113,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-transfer-record:create'}), //
//defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-transfer-record:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-transfer-record:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-transfer-record:export'}), //
defaultButtons.defaultFreshBtn(null), //
@ -147,8 +147,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-transfer-record:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-transfer-record:delete'}), //
//defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-transfer-record:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-transfer-record:delete'}), //
]
// -

28
src/views/eam/inspectionItem/inspectionItem.data.ts

@ -11,17 +11,28 @@ deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
export const InspectionItemRules = reactive({
content: [required],
serialNumber: [required],
concurrencyStamp: [required],
type: [required],
name: [required],
})
export const InspectionItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '序号',
field: 'serialNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
fixed: 'left',
form: {
component:'InputNumber'
@ -63,7 +74,10 @@ export const InspectionItem = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Select'
}
@ -72,10 +86,10 @@ export const InspectionItem = useCrudSchemas(reactive<CrudSchema[]>([
label: '部门',
field: 'departmentCode',
sort: 'custom',
isTable: false,
isDetail: false,
isSearch: false,
isTableForm: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表

2
src/views/eam/item/index.vue

@ -174,7 +174,7 @@ const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'basic:item:update' }), //
// defaultButtons.chooseDeviceBtn({ hasPermi: 'basic:item:choose' }), //
defaultButtons.selectQrCodeBtn(null), //
//defaultButtons.selectQrCodeBtn(null), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'basic:item:delete' }), //
defaultButtons.viewBtn({ hide: !(row.filePathList != null && row.filePathList.length != 0) })
]

5
src/views/eam/item/item.data.ts

@ -133,11 +133,6 @@ export const Item = useCrudSchemas(
type: 'Select'
}
},
// {
// label: '单价',
// field: 'singlePrice',
// sort: 'custom',
// },
{
label: '重采购点',
field: 'reprocurement',

51
src/views/eam/itemAccounts/index.vue

@ -120,6 +120,30 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'locationNumber') {
setV['locationNumber'] = val[0].number
setV['areaNumber'] = val[0].areaNumber
}
if (formField == 'itemNumber') {
setV['itemNumber'] = val[0].number
setV['name'] = val[0].name
setV['brand'] = val[0].brand
setV['specifications'] = val[0].specifications
setV['isOverall'] = val[0].isOverall
setV['subject'] = val[0].subject
setV['subjectCode'] = val[0].subjectCode
setV['type'] = val[0].type
setV['region'] = val[0].region
setV['classification'] = val[0].classification
setV['uom'] = val[0].uom
setV['manufacturer'] = val[0].manufacturer
setV['minInventory'] = val[0].minInventory
setV['maxInventory'] = val[0].maxInventory
setV['replacementCycle'] = val[0].replacementCycle
setV['storageLocation'] = val[0].storageLocation
setV['remark'] = val[0].remark
setV['available'] = val[0].available
}
formRef.setValues(setV)
})
}
@ -176,18 +200,23 @@ const buttonBaseClick = (val, item) => {
}
}
// -
// const butttondata = [
// defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
// defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }) //
// ]
//
// const isShowMainButton = (row) => {
// if (row.qty === 0) {
// return false
// } else {
// return true
// }
// }
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
// defaultButtons.replaceLocation({
// hide: isShowMainButton(row),
// hasPermi: 'item:itemAccounts:replaceLocation'
// }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }), //
defaultButtons.viewBtn({ hide: !(row.filePathList != null && row.filePathList.length != 0) })
//defaultButtons.backoutBtn({hasPermi:'eam:device-repair-request:cancel', hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), //
@ -207,9 +236,11 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'replaceLocation') {
openItem(row.locationNumber, row.id)
} else if (val == 'view') {
}
// else if (val == 'replaceLocation') {
// openItem(row.locationNumber, row.id)
// }
else if (val == 'view') {
//
openForm('view', row)
}

89
src/views/eam/itemAccounts/itemAccounts.data.ts

@ -1,11 +1,18 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItemApi from '@/api/eam/item'
import { Item } from '../item/item.data'
import * as LocationApi from '@/api/eam/location'
import { Location } from '../location/location.data'
// 表单校验
export const ItemAccountsRules = reactive({
itemNumber: [required],
areaNumber: [required],
concurrencyStamp: [required]
locationNumber: [required],
singlePrice: [required],
qty: [required]
})
export const ItemAccounts = useCrudSchemas(
@ -15,43 +22,72 @@ export const ItemAccounts = useCrudSchemas(
field: 'itemNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
}
},
{
label: '库位编号',
field: 'locationNumber',
label: '备件名称',
field: 'name',
sort: 'custom',
table: {
width: 110
}
},
isSearch: false
},
{
label: '库区编号',
field: 'areaNumber',
label: '库编号',
field: 'locationNumber',
sort: 'custom',
table: {
width: 110
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区编号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '库区信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
}
},
{
label: '备件名称',
field: 'name',
label: '库区编号',
field: 'areaNumber',
sort: 'custom',
required: true,
table: {
width: 110
},
isSearch: false
}
},
{
label: '规格',
field: 'specifications',
label: '单价',
field: 'singlePrice',
sort: 'custom'
},
{
label: '库存数量',
field: 'qty',
@ -60,6 +96,11 @@ export const ItemAccounts = useCrudSchemas(
width: 110
}
},
{
label: '规格',
field: 'specifications',
sort: 'custom'
},
{
label: '是否账内库',
field: 'isInAccount',
@ -178,11 +219,7 @@ export const ItemAccounts = useCrudSchemas(
type: 'Select'
}
},
// {
// label: '单价',
// field: 'singlePrice',
// sort: 'custom',
// },
{
label: '重采购点',
field: 'reprocurement',
@ -308,7 +345,7 @@ export const ItemAccounts = useCrudSchemas(
field: 'action',
isForm: false,
table: {
width: 150,
width: 180,
fixed: 'right'
}
}

2
src/views/eam/location/location.data.ts

@ -63,7 +63,7 @@ export const Location = useCrudSchemas(
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.LOCATION_AREA_TYPE,
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,

135
src/views/eam/locationArea/locationArea.data.ts

@ -4,97 +4,74 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const LocationAreaRules = reactive({
number: [
{ required: true, message: '请输入库区编号', trigger: 'blur' },
{ required: true, message: '请输入库区编号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入库区名称', trigger: 'blur' },
{ required: true, message: '请输入库区名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
]
})
export const LocationArea = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库区编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: true,
table: {
width: 180,
fixed: 'left'
export const LocationArea = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '库区编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: true,
table: {
width: 180,
fixed: 'left'
}
},
{
label: '库区名称',
field: 'name',
sort: 'custom',
isSearch: true
},
},
{
label: '库区名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.LOCATION_AREA_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
}
},
},
// {
// label: '是否可用',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isSearch: false,
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select',
// inactiveValue: 'FALSE',
// disabled: true
// },
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
}
},
{
label: '描述',
field: 'description',
sort: 'custom',
table: {
width: 150
{
label: '描述',
field: 'description',
sort: 'custom',
table: {
width: 150
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
}
]))
])
)

12
src/views/eam/maintainExperience/index.vue

@ -111,11 +111,11 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:maintainExperience:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:maintainExperience:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:maintainExperience:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'eam:maintainExperience:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:maintainExperience:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:maintainExperience:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
@ -145,8 +145,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:maintainExperience:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:maintainExperience:delete'}), //
defaultButtons.mainListEditBtn({hasPermi:'eam:maintainExperience:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:maintainExperience:delete'}), //
]
// -

8
src/views/eam/maintainExperience/maintainExperience.data.ts

@ -8,7 +8,11 @@ export const MaintainExperienceRules = reactive({
})
export const MaintainExperience = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
},
{
label: '经验标题',
field: 'name',
@ -19,7 +23,7 @@ export const MaintainExperience = useCrudSchemas(reactive<CrudSchema[]>([
label: '经验内容',
field: 'content',
sort: 'custom',
isTable:false,
isTable:true,
form: {
componentProps: {
type: 'textarea',

969
src/views/eam/maintenance/maintenance.data.ts

File diff suppressed because it is too large

19
src/views/eam/maintenanceItem/maintenanceItem.data.ts

@ -10,16 +10,28 @@ deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
export const MaintenanceItemRules = reactive({
content: [required],
serialNumber: [required],
concurrencyStamp: [required]
name: [required],
})
export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '序号',
field: 'serialNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
fixed: 'left',
form: {
component:'InputNumber'
@ -61,6 +73,7 @@ export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false,
isSearch: false,
isTableForm: false,
isForm: false,
form: {
component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表

6
src/views/eam/maintenanceItemSelectSet/itemSelectSetForm.vue

@ -25,7 +25,7 @@
<el-form-item label="保养项" prop="items">
<div class="tag-container flex gap-2">
<el-tag v-for="ent in tags" :key="ent.content" closable :disable-transitions="false" @close="handleClose(ent.id)">
{{ ent.content}}
{{ ent.name}}
</el-tag>
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"/>
<el-button v-else class="button-new-tag" size="small" @click="addItem">
@ -145,10 +145,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick?.(() => {
if (formField === 'baoYangItem') {
val.forEach(item => {
const isExist = tags.value.some(tag => tag.content === item.content);
const isExist = tags.value.some(tag => tag.name === item.name);
if (!isExist){
const newItem = {};
newItem['content'] = item.content;
newItem['name'] = item.name;
newItem['id'] = item.id;
tags.value.push(newItem);
}

8
src/views/eam/planInspection/planInspection.data.ts

@ -222,6 +222,9 @@ export const PlanInspection = useCrudSchemas(reactive<CrudSchema[]>([
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '所属厂区编号',
@ -237,7 +240,10 @@ export const PlanInspection = useCrudSchemas(reactive<CrudSchema[]>([
field: 'workshopCode',
sort: 'custom',
isSearch: false,
required: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗

12
src/views/eam/repairExperience/index.vue

@ -114,11 +114,11 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:repairExperience:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:repairExperience:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:repairExperience:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'eam:repairExperience:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:repairExperience:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:repairExperience:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
@ -148,8 +148,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:repairExperience:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:repairExperience:delete'}), //
defaultButtons.mainListEditBtn({hasPermi:'eam:repairExperience:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:repairExperience:delete'}), //
]
// -

14
src/views/eam/repairExperience/repairExperience.data.ts

@ -8,7 +8,12 @@ export const RepairExperienceRules = reactive({
})
export const RepairExperience = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
},
{
label: '经验标题',
field: 'name',
@ -27,7 +32,6 @@ export const RepairExperience = useCrudSchemas(reactive<CrudSchema[]>([
label: '经验内容',
field: 'content',
sort: 'custom',
isTable:false,
isSearch:false,
form: {
component: 'Input',
@ -86,8 +90,6 @@ export const RepairExperience = useCrudSchemas(reactive<CrudSchema[]>([
label: '故障类型',
field: 'faultType',
sort: 'custom',
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
isForm:false
},
@ -96,7 +98,9 @@ export const RepairExperience = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime',
sort: 'custom',
isSearch:false,
isForm:false
isForm:false,
isTable:false,
isDetail:false
},
{
label: '创建时间',

365
src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts

@ -0,0 +1,365 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data'
import { EquipmentAccounts } from '@/views/eam/equipmentAccounts/equipmentAccounts.data'
import * as EquipmentItemApi from '@/api/eam/equipmentAccounts'
import { dateFormatter } from '@/utils/formatTime'
export const SparePartsApplyMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '申请编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '出库类型',
field: 'outType',
dictType: DICT_TYPE.EAM_OUT_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: false,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '关联工单',
field: 'workNumber',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '设备信息', // 查询弹窗标题
searchListPlaceholder: '请选择 设备编号', // 输入框占位文本
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
multiple: true,
searchCondition: [
{
key: 'status',
value: 'NORMAL',
action: '==',
isSearch: true,
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'status',
value: 'NORMAL',
action: '==',
isSearch: true,
isMainValue: false
}
]
}
},
{
label: '出库主题',
field: 'theme',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'description',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '申领备件总价',
field: 'sumVal',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
isTable: true,
isForm: false,
form: {
component: 'Select'
}
},
{
label: '申请人',
field: 'applyer',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: true,
isTable: false,
isForm: false
},
{
label: '审核时间',
field: 'approveTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '自动审核',
field: 'autoExamine',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
},
{
label: '操作11',
field: 'action',
isForm: false,
table: {
width: 180,
fixed: 'right'
}
}
])
)
//表单校验
export const SparePartsApplyMainRules = reactive({
outType: [{ required: true, message: '请输入出库类型', trigger: 'blur' }],
theme: [{ required: true, message: '请输入出库主题', trigger: 'blur' }]
})
/**
* @returns {Array}
*/
export const SparePartsApplyDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '库位编号',
field: 'locationCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
{
label: '库区编号',
field: 'areaCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '备件编号',
field: 'sparePartsCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
},
isDetail: false,
isTable: false
},
{
label: '申领数量',
field: 'applyQty',
sort: 'custom',
isSearch: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false
}
])
)
//表单校验
export const SparePartsApplyDetailRules = reactive({
applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }]
})
// 审核完成字段
export const SparePartsApplyExamine = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea'
}
}
}
])
)

511
src/views/eam/sparePartsApplyMain/index.vue

@ -0,0 +1,511 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsApplyMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsApplyMain.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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SparePartsApplyMainRules"
:formAllSchemas="SparePartsApplyMain.allSchemas"
:tableAllSchemas="SparePartsApplyDetail.allSchemas"
:tableFormRules="SparePartsApplyDetailRules"
:tableData="tableData"
:apiUpdate="SparePartsApplyMainApi.updateSparePartsApplyMain"
:apiCreate="SparePartsApplyMainApi.createSparePartsApplyMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsApplyMain.allSchemas"
:detailAllSchemas="SparePartsApplyDetail.allSchemas"
:detailAllSchemasRules="SparePartsApplyDetailRules"
:apiCreate="SparePartsApplyDetailApi.createSparePartsApplyDetail"
:apiUpdate="SparePartsApplyDetailApi.updateSparePartsApplyDetail"
:apiPage="SparePartsApplyDetailApi.getSparePartsApplyDetailPage"
:apiDelete="SparePartsApplyDetailApi.deleteSparePartsApplyDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 审核页面 -->
<!-- <AudiForm ref="audiFormRef" @success="handleApprove"/> -->
<BasicForm
ref="formRefApproved"
:rules="SparePartsApplyMainRules"
:formAllSchemas="SparePartsApplyExamine.allSchemas"
@submitForm="approveSparePartsApplyMain"
:isCol="false"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/sparePartsApplyDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsApplyMain,
SparePartsApplyMainRules,
SparePartsApplyDetail,
SparePartsApplyDetailRules,
SparePartsApplyExamine
} from './SparePartsApply.data'
import * as SparePartsApplyMainApi from '@/api/eam/sparePartsApplyMain'
import * as SparePartsApplyDetailApi from '@/api/eam/sparePartsApplyDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'SparePartsApply' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SparePartsApplyMain.allSchemas.tableColumns)
const formRefApproved = ref()
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
console.log(11, val[0])
if (type == 'tableForm') {
if (formField == 'locationCode') {
row['locationCode'] = val[0].locationNumber
row['areaCode'] = val[0].areaNumber
row['sparePartsCode'] = val[0].itemNumber
row['currentQty'] = val[0].qty
row['isRadeIn'] = val[0].isRadeIn
}
} else {
if (formField == 'locationCode') {
setV['locationCode'] = val[0].locationNumber
setV['areaCode'] = val[0].areaNumber
setV['sparePartsCode'] = val[0].itemNumber
setV['currentQty'] = val[0].qty
setV['isRadeIn'] = val[0].isRadeIn
}
}
formRef.setValues(setV)
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SparePartsApplyMainApi.getSparePartsApplyMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
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 isShowStatusButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({
hide: isShowStatusButton(row, ['0']),
hasPermi: 'eam:spare-parts-in-location-main:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowStatusButton(row, ['0']),
hasPermi: 'eam:spare-parts-in-location-main:delete'
}), //
defaultButtons.mainListAuditingBtn({
hide: isShowStatusButton(row, ['0']),
hasPermi: 'eam:spare-parts-in-location-main:examine'
}), //
defaultButtons.mainListRevokeBtn({
hide: isShowStatusButton(row, ['3']),
hasPermi: 'eam:spare-parts-in-location-main:cancel'
}), //
defaultButtons.mainListTurnDownBtn({
hide: isShowStatusButton(row, ['3']),
hasPermi: 'eam:spare-parts-in-location-main:rejecte'
}), //
defaultButtons.mainListApproveBtn({
hide: isShowStatusButton(row, ['3']),
hasPermi: 'eam:spare-parts-in-location-main:approve'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowStatusButton(row, ['4']),
hasPermi: 'eam:spare-parts-in-location-main:finish'
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'auditing') {
//
handleSubmitExamine(row.id)
} else if (val == 'mainTurnDown') {
//
handleRejecte(row.id)
} else if (val == 'mainApprove') {
//
formRefApproved.value.open('update', row, { masterId: row.id }, 'auditing')
} else if (val == 'revoke') {
//
handleCancel(row.id)
} else if (val == 'finish') {
//
handleFinish(row.id)
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSparePartsApplyMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SparePartsApplyMainApi.deleteSparePartsApplyMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id: number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsApplyMainApi.exportSparePartsApplyMain(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
// const handleClose = async (id: number) => {
// try {
// //
// await message.confirm('')
// //
// await SparePartsApplyMainApi.closeSparePartsApplyMain(id)
// message.success(t('!'))
// //
// await getList()
// } catch {}
// }
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsApplyMainApi.exportSparePartsApplyMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SparePartsApplyDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
console.log(formRef.value)
formRef.value.formLoading = true
let isHave = data.subList.some((item) => item.applyQty > item.currentQty)
if (isHave) {
message.warning('申领数量不能大于库存数量')
return
}
try {
if (formType === 'create') {
await SparePartsApplyMainApi.createSparePartsApplyMain(data)
message.success(t('common.createSuccess'))
} else {
await SparePartsApplyMainApi.updateSparePartsApplyMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = 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() //
}
const onChange = (field, item) => {
if (field == 'outType') {
if (item == '3') {
SparePartsApplyMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'workNumber') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
})
} else {
SparePartsApplyMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'workNumber') {
item.componentProps.disabled = true
item.componentProps.isSearchList = true
}
})
}
}
}
//
const handleSubmitExamine = async (id: number) => {
await message.delConfirm(t('ts.是否提交审核?'))
try {
await SparePartsApplyMainApi.submitSparePartsApplyMain(id)
message.success(t('ts.提交审批成功!'))
//
await getList()
} catch {}
}
/** 撤回按钮操作 */
const handleCancel = async (id: number) => {
await message.delConfirm(t('ts.是否撤回所选中数据?'))
try {
await SparePartsApplyMainApi.cancelSparePartsApplyMain(id)
message.success(t('ts.撤回成功!'))
//
await getList()
} catch {}
}
//
const handleRejecte = async (id: number) => {
await message.delConfirm(t('ts.是否驳回所选中数据?'))
try {
await SparePartsApplyMainApi.rejectSparePartsApplyMain(id)
message.success(t('ts.驳回成功!'))
//
await getList()
} catch {}
}
//
const approveSparePartsApplyMain = async (formType, data) => {
try {
await SparePartsApplyMainApi.approveSparePartsApplyMain(data)
message.success(t('ts.审核通过!'))
//
formRefApproved.value.dialogVisible = false
await getList()
} finally {
formRefApproved.value.formLoading = false
}
}
//
const handleFinish = async (id: number) => {
await message.delConfirm(t('ts.是否完成所选中数据?'))
try {
await SparePartsApplyMainApi.finishSparePartsApplyMain(id)
message.success(t('ts.完成成功!'))
//
await getList()
} catch {}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SparePartsApplyMainApi.importTemplate()
})
</script>

137
src/views/eam/sparePartsInLocationRecord/index.vue

@ -0,0 +1,137 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsInLocationRecordMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsInLocationRecordMain.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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsInLocationRecordMain.allSchemas"
:detailAllSchemas="SparePartsInLocationRecordDetail.allSchemas"
:detailAllSchemasRules="SparePartsInLocationRecordDetailRules"
:apiPage="SparePartsInLocationRecordDetailApi.getSparePartsInLocationRecordDetailPage"
:isShowAddBtn="false"
:detailButtonIsShowAdd="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsInLocationRecordMain,
SparePartsInLocationRecordDetail,
SparePartsInLocationRecordDetailRules
} from './sparePartsInLocationRecordMain.data'
import * as SparePartsInLocationRecordMainApi from '@/api/eam/sparePartsInLocationRecordMain'
import * as SparePartsInLocationRecordDetailApi from '@/api/eam/sparePartsInLocationRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
//
defineOptions({ name: 'SparepartsinlocationRecord' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SparePartsInLocationRecordMain.allSchemas.tableColumns)
// const audiFormRef = ref()
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SparePartsInLocationRecordMainApi.getSparePartsInLocationRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({ hasPermi: 'eam:spare-parts-in-location-main:create' }), //
// defaultButtons.defaultImportBtn({ hasPermi: 'eam:spare-parts-in-location-main:import' }), //
// defaultButtons.defaultExportBtn({ hasPermi: 'eam:spare-parts-in-location-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSparePartsApplyMain')
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

258
src/views/eam/sparePartsInLocationRecord/sparePartsInLocationRecordMain.data.ts

@ -0,0 +1,258 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data'
// 表单校验
export const SparePartsInLocationRecordMainRules = reactive({
number: [required],
theme: [required],
type: [required],
})
// 备件入库主表
export const SparePartsInLocationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '入库主题',
field: 'theme',
sort: 'custom',
isSearch: true,
},{
label: '入库类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.PUT_IN_TYPE,
dictClass: 'string',
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: false,
isForm:false,
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM,
dictClass: 'string',
},
{
label: '入库申请人',
field: 'applyer',
sort: 'custom',
isSearch: false,
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
isForm:false
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
isForm:false
},
{
label: '审核时间',
field: 'approveTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isForm:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '入库时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
]))
// 备件入库子表
export const SparePartsInLocationRecordDetailRules = reactive({
number: [required],
masterId: [required],
locationCode: [required],
areaCode: [required],
sparePartsCode: [required],
applyQty: [required],
})
export const SparePartsInLocationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库位编号',
field: 'locationCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
{
label: '库区编号',
field: 'areaCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
},
{
label: '备件编号',
field: 'sparePartsCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled: true
}
},
isDetail:false,
isTable:false
},
{
label: '申领数量',
field: 'applyQty',
sort: 'custom',
isSearch: false
},
{
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,
isTableForm:false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
]))

472
src/views/eam/sparepartsinlocation/index.vue

@ -0,0 +1,472 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsInLocationMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsInLocationMain.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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SparePartsInLocationMainRules"
:formAllSchemas="SparePartsInLocationMain.allSchemas"
:tableAllSchemas="SparePartsInLocationDetail.allSchemas"
:tableFormRules="SparePartsInLocationDetailRules"
:tableData="tableData"
:apiUpdate="SparePartsInLocationMainApi.updateSparePartsApplyMain"
:apiCreate="SparePartsInLocationMainApi.createSparePartsApplyMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsInLocationMain.allSchemas"
:detailAllSchemas="SparePartsInLocationDetail.allSchemas"
:detailAllSchemasRules="SparePartsInLocationDetailRules"
:apiCreate="SparePartsInLocationDetailApi.createSparePartsInLocationDetail"
:apiUpdate="SparePartsInLocationDetailApi.updateSparePartsInLocationDetail"
:apiPage="SparePartsInLocationDetailApi.getSparePartsInLocationDetailPage"
:apiDelete="SparePartsInLocationDetailApi.deleteSparePartsInLocationDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="true"
:detailButtonIsShowAdd="true"
:detailButtonIsShowAddStatusArray="['0']"
/>
<!-- 审核页面 -->
<!-- <AudiForm ref="audiFormRef" @success="handleApprove"/> -->
<BasicForm
ref="formRefApproved"
:rules="SparePartsInLocationMainRules"
:formAllSchemas="SparePartsInLocationExamine.allSchemas"
@submitForm="approveSparePartsInLocation"
:isCol="false"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/spare-parts-in-location-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsInLocationMain,
SparePartsInLocationMainRules,
SparePartsInLocationDetail,
SparePartsInLocationDetailRules,
SparePartsInLocationExamine
} from './sparePartsInLocationMain.data'
import * as SparePartsInLocationMainApi from '@/api/eam/sparePartsInLocationMain'
import * as SparePartsInLocationDetailApi from '@/api/eam/sparePartsInLocationDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import AudiForm from '@/views/eam/sparepartsinlocation/audiForm.vue'
//
defineOptions({ name: 'SparePartsApply' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const formRef = ref()
const formRefApproved = ref()
const tableColumns = ref(SparePartsInLocationMain.allSchemas.tableColumns)
// const audiFormRef = ref()
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
console.log(11, val[0])
if (type == 'tableForm') {
if (formField == 'locationCode') {
row['locationCode'] = val[0].locationNumber
row['areaCode'] = val[0].areaNumber
row['sparePartsCode'] = val[0].itemNumber
row['currentQty'] = val[0].qty
row['isRadeIn'] = val[0].isRadeIn
}
} else {
if (formField == 'locationCode') {
setV['locationCode'] = val[0].locationNumber
setV['areaCode'] = val[0].areaNumber
setV['sparePartsCode'] = val[0].itemNumber
setV['currentQty'] = val[0].qty
setV['isRadeIn'] = val[0].isRadeIn
}
}
formRef.setValues(setV)
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
if (formField == 'locationCode') {
setV['locationCode'] = val[0].locationNumber
setV['areaCode'] = val[0].areaNumber
setV['sparePartsCode'] = val[0].itemNumber
setV['currentQty'] = val[0].qty
setV['isRadeIn'] = val[0].isRadeIn
}
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SparePartsInLocationMainApi.getSparePartsInLocationMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'eam:spare-parts-in-location-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'eam:spare-parts-in-location-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'eam:spare-parts-in-location-main: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 isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({
hide: isShowStatusButton(row, ['0']),
hasPermi: 'eam:spare-parts-in-location-main:update'
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowStatusButton(row, ['0']),
hasPermi: 'eam:spare-parts-in-location-main:delete'
}), //
defaultButtons.mainListAuditingBtn({
hide: isShowStatusButton(row, ['0']),
hasPermi: 'eam:spare-parts-in-location-main:examine'
}), //
defaultButtons.mainListRevokeBtn({
hide: isShowStatusButton(row, ['3']),
hasPermi: 'eam:spare-parts-in-location-main:cancel'
}), //
defaultButtons.mainListTurnDownBtn({
hide: isShowStatusButton(row, ['3']),
hasPermi: 'eam:spare-parts-in-location-main:rejecte'
}), //
defaultButtons.mainListApproveBtn({
hide: isShowStatusButton(row, ['3']),
hasPermi: 'eam:spare-parts-in-location-main:approve'
}), //
defaultButtons.mainListFinishBtn({
hide: isShowStatusButton(row, ['4']),
hasPermi: 'eam:spare-parts-in-location-main:finish'
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'auditing') {
//
handleSubmitExamine(row.id)
} else if (val == 'mainTurnDown') {
//
handleRejecte(row.id)
} else if (val == 'mainApprove') {
//
formRefApproved.value.open('update', row, { masterId: row.id }, 'auditing')
} else if (val == 'revoke') {
//
handleCancel(row.id)
} else if (val == 'finish') {
//
handleFinish(row.id)
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
const isShowStatusButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
/** 添加/修改操作 */
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSparePartsApplyMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SparePartsInLocationMainApi.deleteSparePartsInLocationMain(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 SparePartsInLocationMainApi.exportSparePartsInLocationMain(
tableObject.params
)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SparePartsInLocationDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
console.log(formRef.value)
formRef.value.formLoading = true
let isHave = data.subList.some(item=>item.applyQty>item.currentQty)
if(isHave){
message.warning('申领数量不能大于库存数量')
return
}
try {
if (formType === 'create') {
await SparePartsInLocationMainApi.createSparePartsInLocationMain(data)
message.success(t('common.createSuccess'))
} else {
await SparePartsInLocationMainApi.updateSparePartsInLocationMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = 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() //
}
//
const handleSubmitExamine = async (id: number) => {
await message.delConfirm(t('ts.是否提交审核?'))
try {
await SparePartsInLocationMainApi.submitExamineSparePartsInLocation(id)
message.success(t('ts.提交审批成功!'))
//
await getList()
} catch {}
}
/** 撤回按钮操作 */
const handleCancel = async (id: number) => {
await message.delConfirm(t('ts.是否撤回所选中数据?'))
try {
await SparePartsInLocationMainApi.cancelSparePartsInLocation(id)
message.success(t('ts.撤回成功!'))
//
await getList()
} catch {}
}
//
const handleRejecte = async (id: number) => {
await message.delConfirm(t('ts.是否驳回所选中数据?'))
try {
await SparePartsInLocationMainApi.rejectSparePartsInLocation(id)
message.success(t('ts.驳回成功!'))
//
await getList()
} catch {}
}
//
const approveSparePartsInLocation = async (formType, data) => {
try {
await SparePartsInLocationMainApi.approveSparePartsInLocation(data)
message.success(t('ts.审核通过!'))
//
formRefApproved.value.dialogVisible = false
await getList()
} finally {
formRefApproved.value.formLoading = false
}
}
//
const handleFinish = async (id: number) => {
await message.delConfirm(t('ts.是否完成所选中数据?'))
try {
await SparePartsInLocationMainApi.finishSparePartsInLocation(id)
message.success(t('ts.完成成功!'))
//
await getList()
} catch {}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SparePartsInLocationMainApi.importTemplate()
})
</script>

298
src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts

@ -0,0 +1,298 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data'
// 表单校验
export const SparePartsInLocationMainRules = reactive({
number: [required],
theme: [required],
type: [required],
})
// 备件入库主表
export const SparePartsInLocationMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '入库主题',
field: 'theme',
sort: 'custom',
isSearch: true,
},{
label: '入库类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.PUT_IN_TYPE,
dictClass: 'string',
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: false,
isForm:false,
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM,
dictClass: 'string',
},
{
label: '入库申请人',
field: 'applyer',
sort: 'custom',
isSearch: false,
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
isForm:false
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
isForm:false
},
{
label: '审核时间',
field: 'approveTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isForm:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '入库时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 220,
fixed: 'right'
},
isDetail:false
}
]))
// 备件入库子表
export const SparePartsInLocationDetailRules = reactive({
number: [required],
masterId: [required],
locationCode: [required],
areaCode: [required],
sparePartsCode: [required],
applyQty: [required],
})
export const SparePartsInLocationDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库位编号',
field: 'locationCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
{
label: '库区编号',
field: 'areaCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
},
{
label: '备件编号',
field: 'sparePartsCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form:{
componentProps:{
disabled: true
}
},
isDetail:false,
isTable:false
},
{
label: '申领数量',
field: 'applyQty',
sort: 'custom',
isSearch: false
},
{
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,
isTableForm:false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
}
]))
export const SparePartsInLocationExamineRules = reactive({
approver: [required],
approveContent: [required],
sparePartsCode: [required],
})
// 审核完成字段
export const SparePartsInLocationExamine = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
form:{
component: 'Input',
componentProps: {
type: 'textarea'
}
}
},
]))

344
src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts

@ -0,0 +1,344 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data'
import { EquipmentAccounts } from '@/views/eam/equipmentAccounts/equipmentAccounts.data'
import * as EquipmentItemApi from '@/api/eam/equipmentAccounts'
import { dateFormatter } from '@/utils/formatTime'
export const SparePartsOutLocationMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '申请编号',
field: 'applyNumber',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '出库类型',
field: 'outType',
dictType: DICT_TYPE.EAM_OUT_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: false,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '关联工单',
field: 'workNumber',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '设备信息', // 查询弹窗标题
searchListPlaceholder: '请选择 设备编号', // 输入框占位文本
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
multiple: true,
searchCondition: [
{
key: 'status',
value: 'NORMAL',
action: '==',
isSearch: true,
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'status',
value: 'NORMAL',
action: '==',
isSearch: true,
isMainValue: false
}
]
}
},
{
label: '出库主题',
field: 'theme',
sort: 'custom',
isSearch: true
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: false,
isForm: false,
dictType: DICT_TYPE.EAM_OUT_STATUS,
dictClass: 'string'
},
{
label: '申请人',
field: 'applyer',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: true,
isTable: false,
isForm: false
},
{
label: '审核时间',
field: 'approveTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '自动审核',
field: 'autoExamine',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)
//表单校验
export const SparePartsOutLocationMainRules = reactive({
description: [{ required: true, message: '描述不能为空', trigger: 'change' }]
})
/**
* @returns {Array}
*/
export const SparePartsOutLocationDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '库位编号',
field: 'locationCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
searchTitle: '备件信息', // 查询弹窗标题
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
{
label: '库区编号',
field: 'areaCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '备件编号',
field: 'sparePartsCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
},
isDetail: false,
isTable: false
},
{
label: '申领数量',
field: 'applyQty',
sort: 'custom',
isSearch: false
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: false,
isForm: false,
dictType: DICT_TYPE.EAM_OUT_STATUS,
dictClass: 'string'
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false
}
])
)
//表单校验
export const SparePartsOutLocationDetailRules = reactive({
applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }]
})

399
src/views/eam/sparepartsoutlocation/index.vue

@ -0,0 +1,399 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsOutLocationMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsOutLocationMain.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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SparePartsOutLocationMainRules"
:formAllSchemas="SparePartsOutLocationMain.allSchemas"
:tableAllSchemas="SparePartsOutLocationDetail.allSchemas"
:tableFormRules="SparePartsOutLocationDetailRules"
:tableData="tableData"
:apiUpdate="SparePartsOutLocationMainApi.updateSparePartsOutLocationMain"
:apiCreate="SparePartsOutLocationMainApi.createSparePartsOutLocationMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsOutLocationMain.allSchemas"
:detailAllSchemas="SparePartsOutLocationDetail.allSchemas"
:detailAllSchemasRules="SparePartsOutLocationDetailRules"
:apiCreate="SparePartsOutLocationDetailApi.createSparePartsOutLocationDetail"
:apiUpdate="SparePartsOutLocationDetailApi.updateSparePartsOutLocationDetail"
:apiPage="SparePartsOutLocationDetailApi.getSparePartsOutLocationDetailPage"
:apiDelete="SparePartsOutLocationDetailApi.deleteSparePartsOutLocationDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/sparePartsOutLocationDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsOutLocationMain,
SparePartsOutLocationMainRules,
SparePartsOutLocationDetail,
SparePartsOutLocationDetailRules
} from './SparePartsOutLocation.data.ts'
import * as SparePartsOutLocationMainApi from '@/api/eam/sparePartsOutLocationMain'
import * as SparePartsOutLocationDetailApi from '@/api/eam/sparePartsOutLocationDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'SparePartsOutLocation' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SparePartsOutLocationMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'sparePartsCode') {
row['sparePartsCode'] = val[0].itemNumber
row['currentQty'] = val[0].qty
}
if (formField == 'equipmentCode') {
row['equipmentCode'] = val[0].code
}
formRef.setValues(setV)
})
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SparePartsOutLocationMainApi.getSparePartsOutLocationMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
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 isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
const isShowStatusButton = (row) => {
if (row.status === '1') {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
// defaultButtons.mainAdjust(null),//
defaultButtons.outBtn({
hide: isShowStatusButton(row)
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
}
// else if (val == 'mainOrderClo') {
// //
// handleClose(row.id)
// }
else if (val == 'out') {
//
handleOut(row.id)
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
//
const handleOut = async (id: number) => {
await message.delConfirm(t('是否出库所选中数据?'))
try {
await SparePartsOutLocationMainApi.outSparePartsOutLocationMain(id)
message.success(t('出库成功!'))
//
await getList()
} catch {}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSparePartsOutLocationMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SparePartsOutLocationMainApi.deleteSparePartsOutLocationMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id: number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsOutLocationMainApi.exportSparePartsOutLocationMain(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
// const handleClose = async (id: number) => {
// try {
// //
// await message.confirm('')
// //
// await SparePartsOutLocationMainApi.closeSparePartsOutLocationMain(id)
// message.success(t('!'))
// //
// await getList()
// } catch {}
// }
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsOutLocationMainApi.exportSparePartsOutLocationMain(
tableObject.params
)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SparePartsOutLocationDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await SparePartsOutLocationMainApi.createSparePartsOutLocationMain(data)
message.success(t('common.createSuccess'))
} else {
await SparePartsOutLocationMainApi.updateSparePartsOutLocationMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = 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 SparePartsOutLocationMainApi.importTemplate()
})
</script>

28
src/views/eam/spotCheckItem/spotCheckItem.data.ts

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { handleTreeToComponentOptions } from '@/utils/tree'
import * as DeptApi from '@/api/system/dept'
const deptList = ref<Tree[]>([]) // 树形结构
@ -11,16 +10,28 @@ deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
export const SpotCheckItemRules = reactive({
content: [required],
serialNumber: [required],
concurrencyStamp: [required],
type: [required],
name: [required],
})
export const SpotCheckItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '序号',
field: 'serialNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
fixed: 'left',
form: {
component:'InputNumber'
@ -56,7 +67,10 @@ export const SpotCheckItem = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Select'
}
@ -65,10 +79,10 @@ export const SpotCheckItem = useCrudSchemas(reactive<CrudSchema[]>([
label: '部门',
field: 'departmentCode',
sort: 'custom',
isTable: false,
isDetail: false,
isSearch: false,
isTableForm: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表

350
src/views/eam/toolAccounts/index.vue

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ToolAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="ToolAccounts.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ToolAccounts.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ToolAccounts.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
@ -27,13 +31,13 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<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)" />
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -51,19 +55,19 @@
/>
<!-- 详情 -->
<DetailLedger
ref="detailRef"
:isBasic="true"
<DetailLedger
ref="detailRef"
:isBasic="true"
:allSchemas="ToolAccounts.allSchemas"
:subTabs="subTabList"
:operationRecordList="operationRecordList"
@handleOperationTabsChange="handleOperationTabsChange"
:subTabs="subTabList"
:operationRecordList="operationRecordList"
@handleOperationTabsChange="handleOperationTabsChange"
:detailAllSchemas="detailAllSchemas"
:apiPage="apiPage"
:dialogApiPage="dialogApiPage"
:dialogAllSchemas="dialogAllSchemas"
:dynamicInfoFields="dynamicInfoFields"
funcCode="tool_mould_file"
funcCode="tool_mould_file"
/>
<!-- 主要部件 -->
@ -71,40 +75,75 @@
<!-- 备件 -->
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/tool/tool-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/eam/tool/tool-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ToolAccounts,ToolAccountsRules } from './toolAccounts.data'
import { ToolAccounts, ToolAccountsRules } from './toolAccounts.data'
import * as ToolAccountsApi from '@/api/eam/toolAccounts'
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'
import * as RelationMainPartApi from '@/api/eam/relationMainPart'
import { EquipmentMainPart,EquipmentMainPartRules } from '../equipmentMainPart/equipmentMainPart.data'
import {
EquipmentMainPart,
EquipmentMainPartRules
} from '../equipmentMainPart/equipmentMainPart.data'
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart'
import { SparePart,SparePartRules } from '../sparePart/sparePart.data'
import * as SparePartApi from '@/api/eam/sparePart'
import { Item, ItemRules } from '../item/item.data'
import * as ItemApi from '@/api/eam/item'
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart'
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data'
import {
EquipmentReportRepairRequest,
EquipmentReportRepairRequestRules
} from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data'
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
import { EquipmentSpotCheckRecordMain,EquipmentSpotCheckRecordMainRules } from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data'
import {
EquipmentSpotCheckRecordMain,
EquipmentSpotCheckRecordMainRules
} from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data'
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain'
import { EquipmentSpotCheckRecordDetail,EquipmentSpotCheckRecordDetailRules } from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data'
import {
EquipmentSpotCheckRecordDetail,
EquipmentSpotCheckRecordDetailRules
} from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data'
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail'
import { EquipmentInspectionRecordMain,EquipmentInspectionRecordMainRules } from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data'
import {
EquipmentInspectionRecordMain,
EquipmentInspectionRecordMainRules
} from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data'
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain'
import { EquipmentInspectionRecordDetail,EquipmentInspectionRecordDetailRules } from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data'
import {
EquipmentInspectionRecordDetail,
EquipmentInspectionRecordDetailRules
} from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data'
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail'
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data'
import {
EquipmentRepairRecordMain,
EquipmentRepairRecordMainRules
} from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data'
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain'
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data'
import {
EquipmentRepairRecordDetail,
EquipmentRepairRecordDetailRules
} from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data'
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail'
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data'
import {
EquipmentMaintenanceRecordMain,
EquipmentMaintenanceRecordMainRules
} from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data'
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import {
EquipmentMaintenanceRecordDetail,
EquipmentMaintenanceRecordDetailRules
} from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as WorkshopApi from '@/api/wms/workshop'
import * as ProductionlineApi from '@/api/wms/productionline'
@ -120,18 +159,18 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ToolAccounts.allSchemas.tableColumns)
const tabs = ref<{ label: string; prop: string; }[]>([])
const subTabList = ref([]);
const tabs = ref<{ label: string; prop: string }[]>([])
const subTabList = ref([])
const detailAllSchemas = ref()
const apiPage = ref()
const dialogApiPage = ref()
const dialogAllSchemas = ref()
const operationRecordList = ref([
{label:'报修记录',value:'report'},
{label:'维修记录',value:'repair'},
{label:'保养记录',value:'maintenance'},
{label:'巡检记录',value:'inspection'},
{label:'点检记录',value:'spot_check'},
{ label: '报修记录', value: 'report' },
{ label: '维修记录', value: 'repair' },
{ label: '保养记录', value: 'maintenance' },
{ label: '巡检记录', value: 'inspection' },
{ label: '点检记录', value: 'spot_check' }
])
//
@ -139,16 +178,16 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'workshopName'){
if (formField == 'workshopName') {
setV['workshopCode'] = val[0]['code']
setV['workshopName'] = val[0]['name']
}else if(formField == 'lineName'){
} else if (formField == 'lineName') {
setV['lineCode'] = val[0]['code']
setV['lineName'] = val[0]['name']
}else if(formField == 'manufactureName'){
} else if (formField == 'manufactureName') {
setV['manufactureCode'] = val[0]['number']
setV['manufactureName'] = val[0]['name']
}else if(formField == 'supplierName'){
} else if (formField == 'supplierName') {
setV['supplierCode'] = val[0]['number']
setV['supplierName'] = val[0]['name']
}
@ -170,12 +209,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:tool-accounts:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:tool-accounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:tool-accounts:export'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'eam:tool-accounts:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'eam:tool-accounts:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'eam:tool-accounts:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -188,37 +227,47 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:tool-accounts:update'}), //
defaultButtons.componentBtn({hasPermi:'eam:tool-accounts:component'}), //
defaultButtons.sparePartBtn({hasPermi:'eam:tool-accounts:item'}), //
defaultButtons.mainListEditBtn({ hasPermi: 'eam:tool-accounts:update' }), //
defaultButtons.componentBtn({ hasPermi: 'eam:tool-accounts:component' }), //
defaultButtons.sparePartBtn({ hasPermi: 'eam:tool-accounts:item' }) //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:tool-accounts:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'component') { //
} else if (val == 'component') {
//
openComponent(row)
} else if (val == 'sparePart') { //
} else if (val == 'sparePart') {
//
openSparePart(row)
}
}
@ -226,32 +275,37 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = async (type: string, row?: any) => {
if(type == 'update'){
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
if (type == 'update') {
const equipmentManufacturerNoPage =
await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
row.workshopName = workshopNoPage?.find(item=>item.code == row.workshopCode)?.name
row.lineName = productionlineNoPage?.find(item=>item.code == row.lineCode)?.name
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({})
row.workshopName = workshopNoPage?.find((item) => item.code == row.workshopCode)?.name
row.lineName = productionlineNoPage?.find((item) => item.code == row.lineCode)?.name
row.manufactureName = equipmentManufacturerNoPage?.find(
(item) => item.number == row.manufactureCode
)?.name
row.supplierName = equipmentSupplierNoPage?.find(
(item) => item.number == row.supplierCode
)?.name
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ToolAccounts.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
const formsSuccess = async (formType, data) => {
var isHave = ToolAccounts.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;
return
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await ToolAccountsApi.createToolAccounts(data)
message.success(t('common.createSuccess'))
@ -266,14 +320,14 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
const dynamicInfoFields = ref([
"totalRunningTime",
"maintenanceRunningTime",
"usageTimes",
"lastInspectionDate",
"outageRate",
"breakdownRecover",
"purchaseInterval"
]);
'totalRunningTime',
'maintenanceRunningTime',
'usageTimes',
'lastInspectionDate',
'outageRate',
'breakdownRecover',
'purchaseInterval'
])
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicToolAccounts')
@ -332,27 +386,27 @@ const searchFormClick = (searchData) => {
getList() //
}
const handleOperationTabsChange = (val) => {
if(val == 'report'){
if (val == 'report') {
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage
detailAllSchemas.value = EquipmentReportRepairRequest.allSchemas
}else if(val == 'repair'){
} else if (val == 'repair') {
apiPage.value = EquipmentRepairRecordMainApi.getEquipmentRepairRecordMainPage
detailAllSchemas.value = EquipmentRepairRecordMain.allSchemas
dialogApiPage.value = EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage
dialogAllSchemas.value = EquipmentRepairRecordDetail.allSchemas
}else if(val == 'maintenance'){
} else if (val == 'maintenance') {
apiPage.value = EquipmentMaintenanceRecordMainApi.getEquipmentMaintenanceRecordMainPage
detailAllSchemas.value = EquipmentMaintenanceRecordMain.allSchemas
dialogApiPage.value = EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage
dialogApiPage.value =
EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage
dialogAllSchemas.value = EquipmentMaintenanceRecordDetail.allSchemas
}else if(val == 'inspection'){
} else if (val == 'inspection') {
apiPage.value = EquipmentInspectionRecordMainApi.getEquipmentInspectionRecordMainPage
detailAllSchemas.value = EquipmentInspectionRecordMain.allSchemas
dialogApiPage.value = EquipmentInspectionRecordDetailApi.getEquipmentInspectionRecordDetailPage
dialogAllSchemas.value = EquipmentInspectionRecordDetail.allSchemas
}else if(val == 'spot_check'){
} else if (val == 'spot_check') {
apiPage.value = EquipmentSpotCheckRecordMainApi.getEquipmentSpotCheckRecordMainPage
detailAllSchemas.value = EquipmentSpotCheckRecordMain.allSchemas
dialogApiPage.value = EquipmentSpotCheckRecordDetailApi.getEquipmentSpotCheckRecordDetailPage
@ -366,38 +420,45 @@ const searchTableSelections = ref([])
const searchTableSparePartSelections = ref([])
const syncData = async (row) => {
searchTableSparePartSelections.value = []
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code,type: 'EQUIPMENT' }).then(async (res) => {
await EquipmentMainPartApi.getEquipmentMainPartNoPage({type: 'EQUIPMENT'}).then(response => {
searchTableSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
if (element.code == item.mainPartCode) {
flag = true;
}
});
return flag;
});
});
});
};
await RelationMainPartApi.getRelationMainPartNoPage({
equipmentCode: row.code,
type: 'EQUIPMENT'
}).then(async (res) => {
await EquipmentMainPartApi.getEquipmentMainPartNoPage({ type: 'EQUIPMENT' }).then(
(response) => {
searchTableSelections.value = response.filter((element) => {
let flag = false
res.forEach((item) => {
if (element.code == item.mainPartCode) {
flag = true
}
})
return flag
})
}
)
})
}
const syncSparePartData = async (row) => {
searchTableSparePartSelections.value = []
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code}).then(async (res) => {
await SparePartApi.getSparePartNoPage({}).then(response => {
searchTableSparePartSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
if (element.code == item.sparePartCode) {
flag = true;
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({
equipmentToolCode: row.code
}).then(async (res) => {
await ItemApi.getItemNoPage({}).then((response) => {
searchTableSparePartSelections.value = response.filter((element) => {
let flag = false
res.forEach((item) => {
if (element.number == item.sparePartCode) {
flag = true
}
});
return flag;
});
});
});
};
})
return flag
})
})
})
}
/** 绑定备件操作 */
const openComponent = async (row : any) => {
const openComponent = async (row: any) => {
await syncData(row)
searchTableRef.value.open(
'选择部件',
@ -406,9 +467,9 @@ const openComponent = async (row : any) => {
'equipmentMainPart',
EquipmentMainPart.allSchemas.searchSchema,
true,
null,//type
null, //type
row,
{type: 'EQUIPMENT'},
{ type: 'EQUIPMENT' },
null,
null,
null,
@ -416,16 +477,16 @@ const openComponent = async (row : any) => {
)
}
const openSparePart = async (row : any) => {
const openSparePart = async (row: any) => {
await syncSparePartData(row)
searchSparePartTableRef.value.open(
'选择备件',
SparePart.allSchemas,
SparePartApi.getSparePartPage,
'sparePartPart',
SparePart.allSchemas.searchSchema,
Item.allSchemas,
ItemApi.getItemPage,
'item',
Item.allSchemas.searchSchema,
true,
null,//type
null, //type
row,
null,
null,
@ -435,33 +496,34 @@ const openSparePart = async (row : any) => {
)
}
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => {
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => {
const deviceMainPartRelList = val.map((element) => ({
mainPartCode: element.code,
equipmentCode: rowRef.code,
type: 'EQUIPMENT'
}))
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then(res => {
mainPartCode: element.number,
equipmentCode: rowRef.code,
type: 'EQUIPMENT'
}))
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then((res) => {
message.success(t('common.createSuccess'))
getList()
})
}
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => {
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => {
const equipmentToolSparePartRelList = val.map((element) => ({
sparePartCode: element.code,
equipmentToolCode: rowRef.code,
type: 'EQUIPMENT'
}))
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(res => {
message.success(t('common.createSuccess'))
getList()
})
sparePartCode: element.number,
equipmentToolCode: rowRef.code,
type: 'EQUIPMENT'
}))
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(
(res) => {
message.success(t('common.createSuccess'))
getList()
}
)
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ToolAccountsApi.importTemplate()
})
</script>

86
src/views/eam/transaction/index.vue

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Transaction.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Transaction.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Transaction.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Transaction.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
@ -27,13 +31,13 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<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)" />
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -52,12 +56,11 @@
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Transaction.allSchemas" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Transaction,Rules } from './transaction.data'
import { Transaction, Rules } from './transaction.data'
import * as TransactionApi from '@/api/eam/transaction'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -97,12 +100,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'item:transaction:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'item:transaction:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'item:transaction:export'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'item:transaction:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'item:transaction:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'item:transaction:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -115,31 +118,39 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'item:transaction:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'item:transaction:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'item:transaction:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'item:transaction:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
@ -151,18 +162,18 @@ const openForm = (type: string, row?: any) => {
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Transaction.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
const formsSuccess = async (formType, data) => {
var isHave = Transaction.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;
return
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await TransactionApi.createTransaction(data)
message.success(t('common.createSuccess'))
@ -237,5 +248,4 @@ const searchFormClick = (searchData) => {
onMounted(async () => {
getList()
})
</script>

160
src/views/eam/transaction/transaction.data.ts

@ -6,89 +6,91 @@ export const Rules = reactive({
locationNumber: [required],
inventoryAction: [required],
businessType: [required],
uom: [required],
uom: [required]
})
export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '库位编码',
field: 'locationNumber',
sort: 'custom',
isSearch: true,
},
{
label: '事务类型',
field: 'transactionType',
sort: 'custom',
dictType: DICT_TYPE.TRANSACTION_TYPE,
dictClass: 'string',
isSearch: false,
isTable: true,
table: {
width: 150
export const Transaction = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true
},
tableForm: {
type: 'Select'
}
},
{
label: '库存动作',
field: 'inventoryAction',
sort: 'custom',
dictType: DICT_TYPE.INVENTORY_ACTION,
dictClass: 'string',
isSearch: false,
isTable: true,
table: {
width: 150
{
label: '库位编码',
field: 'locationNumber',
sort: 'custom',
isSearch: true
},
tableForm: {
type: 'Select'
}
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
isSearch: false,
form: {
component: 'Radio'
{
label: '事务类型',
field: 'transactionType',
sort: 'custom',
dictType: DICT_TYPE.EAM_TRANSACTION_TYPE,
dictClass: 'string',
isSearch: false,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '库存动作',
field: 'inventoryAction',
sort: 'custom',
dictType: DICT_TYPE.EAM_INVENTORY_ACTION,
dictClass: 'string',
isSearch: false,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
isSearch: false,
form: {
component: 'Radio'
}
},
{
label: '关联单号',
field: 'associatedNumber',
sort: 'custom',
isSearch: false,
form: {
component: 'Radio'
}
},
},
{
label: '关联单号',
field: 'associatedNumber',
sort: 'custom',
isSearch: false,
form: {
component: 'Radio'
{
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: false
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: false
}
}
]))
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
])
)

53
src/views/qms/inspectionJob/addForm.vue

@ -108,6 +108,59 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping">
<el-form-item
label="上限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
>
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0">
<el-form-item
label="是否设定下限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit">
<el-form-item
label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
>
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0">
<el-form-item
label="是否设定目标值"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget">
<el-form-item
label="目标值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
>
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime">
<el-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"

3
src/views/qms/inspectionScheme/addForm.vue

@ -1232,9 +1232,10 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
data.value.samplePieceSize = 1
isSamplePieceSizeDisabled.value = true
} else {
data.value.samplePieceSize = ''
data.value.samplePieceSize = 1
isSamplePieceSizeDisabled.value = false
}
data.value.description = val[0].desc1
} else if (formField == 'inspectionType') {
data.value.testTypeName = val[0].description
} else if (formField == 'programmeTemplateCode') {

21
src/views/system/user/index.vue

@ -90,9 +90,10 @@
</el-row>
<!-- 添加或修改用户对话框 -->
<UserForm ref="formRef" @success="getList" />
<!-- 用户导入对话框 -->
<UserImportForm ref="importFormRef" @success="getList" />
<!-- <UserForm ref="formRef" @success="getList" /> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/system/user/import" :updateIsDisable='true' :coverIsDisable='true' :mode='2' :importTemplateData="importTemplateData" @success="importSuccess" />
<!-- 分配角色 -->
<UserAssignRoleForm ref="assignRoleFormRef" @success="getList" />
</template>
@ -105,6 +106,7 @@ import { CommonStatusEnum } from '@/utils/constants'
import * as UserApi from '@/api/system/user'
import UserForm from './UserForm.vue'
import UserImportForm from './UserImportForm.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import UserAssignRoleForm from './UserAssignRoleForm.vue'
import DeptTree from './DeptTree.vue'
@ -168,7 +170,11 @@ const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '用户导入模版.xlsx'
})
/** 修改用户状态 */
const handleStatusChange = async (row: UserApi.UserVO) => {
try {
@ -252,9 +258,14 @@ const assignRoleFormRef = ref()
const handleRole = (row: UserApi.UserVO) => {
assignRoleFormRef.value.open(row)
}
//
const importSuccess = () => {
getList()
}
/** 初始化 */
onMounted(() => {
onMounted(async() => {
getList()
importTemplateData.templateUrl = await UserApi.importUserTemplate()
})
</script>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save